From 0b311348359e1406b173d9c0de4974af3e90f836 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 18 Oct 2022 03:01:49 +0000 Subject: CTAN sync 202210180301 --- macros/latex/contrib/adjustbox/DEPENDS.txt | 8 + macros/latex/contrib/adjustbox/README | 26 - macros/latex/contrib/adjustbox/README.txt | 28 + macros/latex/contrib/adjustbox/adjcalc.dtx | 6 +- macros/latex/contrib/adjustbox/adjcalc.pdf | Bin 153058 -> 162884 bytes macros/latex/contrib/adjustbox/adjustbox.dtx | 16 +- macros/latex/contrib/adjustbox/adjustbox.pdf | Bin 381806 -> 393152 bytes macros/latex/contrib/adjustbox/trimclip.dtx | 23 +- macros/latex/contrib/adjustbox/trimclip.pdf | Bin 213705 -> 225437 bytes macros/latex/contrib/collectbox/DEPENDS.txt | 2 + macros/latex/contrib/collectbox/README | 14 - macros/latex/contrib/collectbox/README.txt | 15 + macros/latex/contrib/collectbox/collectbox.dtx | 15 +- macros/latex/contrib/collectbox/collectbox.pdf | Bin 270329 -> 167134 bytes macros/latex/contrib/docshots/README.md | 8 + macros/latex/contrib/docshots/docshots.dtx | 282 +- macros/latex/contrib/docshots/docshots.pdf | Bin 292815 -> 334497 bytes macros/latex/contrib/gensymb/gensymb.dtx | 2 +- macros/latex/contrib/gensymb/gensymb.pdf | Bin 220452 -> 219979 bytes macros/latex/contrib/glossaries/CHANGES | 147 +- macros/latex/contrib/glossaries/DEPENDS.txt | 8 + macros/latex/contrib/glossaries/README.md | 13 +- .../latex/contrib/glossaries/glossaries-code.pdf | Bin 1577360 -> 2237746 bytes .../glossaries-user-example001.pdf | Bin 0 -> 23904 bytes .../glossaries-user-example001.png | Bin 0 -> 2989 bytes .../glossaries-user-example001.tex | 43 + .../glossaries-user-example002.pdf | Bin 0 -> 36694 bytes .../glossaries-user-example002.png | Bin 0 -> 8172 bytes .../glossaries-user-example002.tex | 41 + .../glossaries-user-example003.pdf | Bin 0 -> 36443 bytes .../glossaries-user-example003.png | Bin 0 -> 7702 bytes .../glossaries-user-example003.tex | 29 + .../glossaries-user-example004.pdf | Bin 0 -> 36443 bytes .../glossaries-user-example004.png | Bin 0 -> 7702 bytes .../glossaries-user-example004.tex | 30 + .../glossaries-user-example005.pdf | Bin 0 -> 36443 bytes .../glossaries-user-example005.png | Bin 0 -> 7702 bytes .../glossaries-user-example005.tex | 30 + .../glossaries-user-example006.pdf | Bin 0 -> 36291 bytes .../glossaries-user-example006.png | Bin 0 -> 6850 bytes .../glossaries-user-example006.tex | 44 + .../glossaries-user-example007.pdf | Bin 0 -> 37155 bytes .../glossaries-user-example007.png | Bin 0 -> 8774 bytes .../glossaries-user-example007.tex | 28 + .../glossaries-user-example008.pdf | Bin 0 -> 62536 bytes .../glossaries-user-example008.png | Bin 0 -> 9443 bytes .../glossaries-user-example008.tex | 39 + .../glossaries-user-example022.pdf | Bin 0 -> 15087 bytes .../glossaries-user-example022.png | Bin 0 -> 2509 bytes .../glossaries-user-example022.tex | 15 + .../glossaries-user-example023.pdf | Bin 0 -> 14255 bytes .../glossaries-user-example023.png | Bin 0 -> 2838 bytes .../glossaries-user-example023.tex | 16 + .../glossaries-user-example024.pdf | Bin 0 -> 14263 bytes .../glossaries-user-example024.png | Bin 0 -> 2825 bytes .../glossaries-user-example024.tex | 16 + .../glossaries-user-example025.pdf | Bin 0 -> 10078 bytes .../glossaries-user-example025.png | Bin 0 -> 671 bytes .../glossaries-user-example025.tex | 12 + .../glossaries-user-example030.pdf | Bin 0 -> 28091 bytes .../glossaries-user-example030.png | Bin 0 -> 9066 bytes .../glossaries-user-example030.tex | 31 + .../latex/contrib/glossaries/glossaries-user.html | 66443 +++++-------------- .../latex/contrib/glossaries/glossaries-user.pdf | Bin 1290631 -> 4965728 bytes .../latex/contrib/glossaries/glossaries-user.tex | 43676 ++++++++---- macros/latex/contrib/glossaries/glossaries.dtx | 41425 ++++++++---- macros/latex/contrib/glossaries/glossaries.ins | 96 +- .../latex/contrib/glossaries/glossariesbegin.html | 5903 +- .../latex/contrib/glossaries/glossariesbegin.pdf | Bin 199339 -> 385141 bytes .../latex/contrib/glossaries/glossariesbegin.tex | 3786 +- .../contrib/glossaries/glossary2glossaries.html | 2801 +- .../contrib/glossaries/glossary2glossaries.pdf | Bin 150971 -> 140991 bytes .../contrib/glossaries/glossary2glossaries.tex | 999 +- macros/latex/contrib/glossaries/makeglossaries | 499 +- .../latex/contrib/glossaries/makeglossaries-lite.1 | 4 +- .../contrib/glossaries/makeglossaries-lite.lua | 8 +- macros/latex/contrib/glossaries/makeglossaries.1 | 76 +- .../samples/glossary-lipsum-examples.pdf | Bin 253751 -> 253736 bytes .../contrib/glossaries/samples/minimalgls.pdf | Bin 52281 -> 52292 bytes .../contrib/glossaries/samples/mwe-acr-desc.pdf | Bin 40453 -> 40462 bytes .../latex/contrib/glossaries/samples/mwe-acr.pdf | Bin 36142 -> 36154 bytes .../latex/contrib/glossaries/samples/mwe-gls.pdf | Bin 32434 -> 32447 bytes .../contrib/glossaries/samples/sample-FnDesc.pdf | Bin 63839 -> 63848 bytes .../glossaries/samples/sample-chap-hyperfirst.pdf | Bin 57363 -> 57372 bytes .../contrib/glossaries/samples/sample-crossref.pdf | Bin 60854 -> 60867 bytes .../glossaries/samples/sample-custom-acronym.pdf | Bin 87954 -> 87965 bytes .../glossaries/samples/sample-custom-acronym.tex | 12 +- .../contrib/glossaries/samples/sample-dot-abbr.pdf | Bin 56048 -> 56061 bytes .../contrib/glossaries/samples/sample-dual.pdf | Bin 38951 -> 38960 bytes .../glossaries/samples/sample-entrycount.pdf | Bin 39327 -> 39338 bytes .../contrib/glossaries/samples/sample-entryfmt.pdf | Bin 37396 -> 37407 bytes .../glossaries/samples/sample-font-abbr.pdf | Bin 54880 -> 54893 bytes .../contrib/glossaries/samples/sample-ignored.pdf | Bin 34306 -> 34318 bytes .../contrib/glossaries/samples/sample-index.pdf | Bin 45908 -> 45914 bytes .../contrib/glossaries/samples/sample-inline.pdf | Bin 157981 -> 157855 bytes .../contrib/glossaries/samples/sample-langdict.pdf | Bin 41686 -> 41705 bytes .../contrib/glossaries/samples/sample-newkeys.pdf | Bin 41693 -> 41702 bytes .../glossaries/samples/sample-noidxapp-utf8.pdf | Bin 102925 -> 102907 bytes .../glossaries/samples/sample-noidxapp-utf8.tex | 13 +- .../contrib/glossaries/samples/sample-noidxapp.pdf | Bin 71461 -> 71576 bytes .../contrib/glossaries/samples/sample-noidxapp.tex | 10 +- .../glossaries/samples/sample-nomathhyper.pdf | Bin 45028 -> 45043 bytes .../glossaries/samples/sample-numberlist.pdf | Bin 44600 -> 44614 bytes .../contrib/glossaries/samples/sample-prefix.pdf | Bin 48812 -> 48818 bytes .../latex/contrib/glossaries/samples/sample-si.pdf | Bin 23382 -> 23392 bytes .../samples/sample-storage-abbr-desc.pdf | Bin 42390 -> 42398 bytes .../glossaries/samples/sample-storage-abbr.pdf | Bin 40153 -> 40166 bytes macros/latex/contrib/glossaries/samples/sample.pdf | Bin 128111 -> 127985 bytes .../contrib/glossaries/samples/sample4col.pdf | Bin 46597 -> 46607 bytes .../latex/contrib/glossaries/samples/sampleAcr.pdf | Bin 68907 -> 68914 bytes .../contrib/glossaries/samples/sampleAcrDesc.pdf | Bin 99383 -> 99391 bytes .../contrib/glossaries/samples/sampleCustomAcr.pdf | Bin 160556 -> 160559 bytes .../latex/contrib/glossaries/samples/sampleDB.pdf | Bin 51288 -> 51302 bytes .../contrib/glossaries/samples/sampleDesc.pdf | Bin 50956 -> 50963 bytes .../latex/contrib/glossaries/samples/sampleEq.pdf | Bin 167747 -> 167771 bytes .../contrib/glossaries/samples/sampleEqPg.pdf | Bin 181661 -> 181791 bytes .../contrib/glossaries/samples/sampleFnAcrDesc.pdf | Bin 158217 -> 158227 bytes .../latex/contrib/glossaries/samples/sampleNtn.pdf | Bin 106120 -> 105898 bytes .../contrib/glossaries/samples/samplePeople.pdf | Bin 49986 -> 49998 bytes .../latex/contrib/glossaries/samples/sampleSec.pdf | Bin 69909 -> 69919 bytes .../contrib/glossaries/samples/sampleSort.pdf | Bin 101736 -> 101605 bytes .../contrib/glossaries/samples/sampleaccsupp.pdf | Bin 86105 -> 86116 bytes .../contrib/glossaries/samples/sampleacronyms.pdf | Bin 39695 -> 39704 bytes .../contrib/glossaries/samples/sampletree.pdf | Bin 72384 -> 64302 bytes .../contrib/glossaries/samples/sampleutf8.pdf | Bin 47767 -> 47779 bytes .../latex/contrib/glossaries/samples/samplexdy.pdf | Bin 144217 -> 144016 bytes .../latex/contrib/glossaries/samples/samplexdy.tex | 2 +- .../contrib/glossaries/samples/samplexdy2.pdf | Bin 73159 -> 73171 bytes .../contrib/glossaries/samples/samplexdy3.pdf | Bin 190880 -> 190704 bytes .../contrib/glossaries/samples/samplexdy3.tex | 2 +- macros/latex/contrib/mismath/mismath.dtx | 167 +- macros/latex/contrib/mismath/mismath.ins | 4 +- macros/latex/contrib/mismath/mismath.pdf | Bin 531103 -> 360639 bytes .../latex/contrib/proflycee/doc/ProfLycee-doc.pdf | Bin 886664 -> 930967 bytes .../latex/contrib/proflycee/doc/ProfLycee-doc.tex | 244 +- .../proflycee/doc/graphics/pl-doc-probas_a.png | Bin 0 -> 10939 bytes .../proflycee/doc/graphics/pl-doc-probas_b.png | Bin 0 -> 10804 bytes .../proflycee/doc/graphics/pl-doc-probas_c.png | Bin 0 -> 7252 bytes .../proflycee/doc/graphics/pl-doc-probas_d.png | Bin 0 -> 7380 bytes .../proflycee/doc/graphics/pl-doc-probas_e.png | Bin 0 -> 9965 bytes .../proflycee/doc/graphics/pl-doc-probas_f.png | Bin 0 -> 7670 bytes macros/latex/contrib/proflycee/tex/ProfLycee.sty | 163 +- macros/unicodetex/latex/bithesis/bithesis.dtx | 48 +- macros/unicodetex/latex/bithesis/bithesis.pdf | Bin 968083 -> 975276 bytes 144 files changed, 82060 insertions(+), 85308 deletions(-) create mode 100644 macros/latex/contrib/adjustbox/DEPENDS.txt delete mode 100644 macros/latex/contrib/adjustbox/README create mode 100644 macros/latex/contrib/adjustbox/README.txt create mode 100644 macros/latex/contrib/collectbox/DEPENDS.txt delete mode 100644 macros/latex/contrib/collectbox/README create mode 100644 macros/latex/contrib/collectbox/README.txt create mode 100644 macros/latex/contrib/glossaries/DEPENDS.txt create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.tex create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.pdf create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.png create mode 100644 macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.tex create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_a.png create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_b.png create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_c.png create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_d.png create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_e.png create mode 100644 macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_f.png (limited to 'macros') diff --git a/macros/latex/contrib/adjustbox/DEPENDS.txt b/macros/latex/contrib/adjustbox/DEPENDS.txt new file mode 100644 index 0000000000..35ed13d4c1 --- /dev/null +++ b/macros/latex/contrib/adjustbox/DEPENDS.txt @@ -0,0 +1,8 @@ +hard xkeyval +hard collectbox +hard graphicx +soft pgf +soft tikz +soft calc +soft ifoddpage +soft storebox diff --git a/macros/latex/contrib/adjustbox/README b/macros/latex/contrib/adjustbox/README deleted file mode 100644 index 684613ca7b..0000000000 --- a/macros/latex/contrib/adjustbox/README +++ /dev/null @@ -1,26 +0,0 @@ -LaTeX bundle adjustbox -======================== -Copyright (c) 2011-2020 by Martin Scharrer -WWW: (incl. bug tracker) - -This bundle contains the the adjustbox package and its auxiliary packages trimclip and adjcalc. -The initial purpose of adjustbox was to supplement the standard graphics/x package, -which defines the macros \resizebox, \scalebox and \rotatebox, with the macros \trimbox and \clipbox. -An additional \marginbox macro is also provided. -These macros are now placed in the dedicated package trimclip which is loaded by adjustbox. -The package comes with clipping driver files are provided for pdftex (incl. LuaLaTeX), dvips and xetex. A -fall-back driver which uses the pgf package is still included. -The driver files got written by Joseph Wright (LaTeX3 project) and the package author. - -The main feature of adjustbox is the general \adjustbox macro which extends the key=value -interface of \includegraphics from the graphicx package, and applies it to general text -content. It also provides further text/box modifications keys, macros and envionments. - -Both adjustbox and trimclip use the adjcalc package to allow for algebraic expressions for all length -arguments. The adjcalc package can use either e-TeX, the calc package or the pgfmath package. - -All macros use the authors other package collectbox to read the content as box and not as -macro argument. This allows for all forms of content including special material like verbatim content. -A special feature of collectbox is used to provide matching environments with the identical names as the -macros. - diff --git a/macros/latex/contrib/adjustbox/README.txt b/macros/latex/contrib/adjustbox/README.txt new file mode 100644 index 0000000000..5bf3065789 --- /dev/null +++ b/macros/latex/contrib/adjustbox/README.txt @@ -0,0 +1,28 @@ +LaTeX bundle adjustbox +======================== +Copyright (c) 2011-2022 by Martin Scharrer +License: LaTeX Project Public License, v1.3 or later: http://www.latex-project.org/lppl.txt +Repository: https://github.com/MartinScharrer/adjustbox +Issues: https://github.com/MartinScharrer/adjustbox/issues + +This bundle contains the the adjustbox package and its auxiliary packages trimclip and adjcalc. +The initial purpose of adjustbox was to supplement the standard graphics/x package, +which defines the macros \resizebox, \scalebox and \rotatebox, with the macros \trimbox and \clipbox. +An additional \marginbox macro is also provided. +These macros are now placed in the dedicated package trimclip which is loaded by adjustbox. +The package comes with clipping driver files are provided for pdftex (incl. LuaLaTeX), dvips and xetex. A +fall-back driver which uses the pgf package is still included. +The driver files got written by Joseph Wright (LaTeX3 project) and the package author. + +The main feature of adjustbox is the general \adjustbox macro which extends the key=value +interface of \includegraphics from the graphicx package, and applies it to general text +content. It also provides further text/box modifications keys, macros and envionments. + +Both adjustbox and trimclip use the adjcalc package to allow for algebraic expressions for all length +arguments. The adjcalc package can use either e-TeX, the calc package or the pgfmath package. + +All macros use the authors other package collectbox to read the content as box and not as +macro argument. This allows for all forms of content including special material like verbatim content. +A special feature of collectbox is used to provide matching environments with the identical names as the +macros. + diff --git a/macros/latex/contrib/adjustbox/adjcalc.dtx b/macros/latex/contrib/adjustbox/adjcalc.dtx index 318bda128f..04ff271821 100644 --- a/macros/latex/contrib/adjustbox/adjcalc.dtx +++ b/macros/latex/contrib/adjustbox/adjcalc.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2011-2018 by Martin Scharrer -%% ---------------------------------------------------------------------- +%% Copyright C 2011-2022 by Martin Scharrer +%% ----------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. @@ -85,7 +85,7 @@ % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\gdef,\let} % \bundle{adjustbox} % \author{Martin Scharrer} -% \email{martin@scharrer-online.de} +% \email{martin.scharrer@web.de} % \ydocpdfsettings % \maketitle % diff --git a/macros/latex/contrib/adjustbox/adjcalc.pdf b/macros/latex/contrib/adjustbox/adjcalc.pdf index 7e7103f4d3..9d68f19015 100644 Binary files a/macros/latex/contrib/adjustbox/adjcalc.pdf and b/macros/latex/contrib/adjustbox/adjcalc.pdf differ diff --git a/macros/latex/contrib/adjustbox/adjustbox.dtx b/macros/latex/contrib/adjustbox/adjustbox.dtx index e6cdb33f37..170e02434f 100644 --- a/macros/latex/contrib/adjustbox/adjustbox.dtx +++ b/macros/latex/contrib/adjustbox/adjustbox.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2011-2020 by Martin Scharrer -%% ---------------------------------------------------------------------- +%% Copyright (C) 2011-2022 by Martin Scharrer +%% ------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. @@ -26,10 +26,10 @@ %<*driver> \ProvidesFile{adjustbox.dtx}[% %<=*DATE> - 2020/08/19 + 2022/10/17 %<=/DATE> %<=*VERSION> - v1.3 + v1.3a %<=/VERSION> DTX file for the adjustbox package] \documentclass[a4paper]{ydoc}[2011/08/11] @@ -264,14 +264,18 @@ % * Removed old graphicx key 'print'. % * trimclip: Added explicit luatex driver which uses the pdftex driver to avoid the fallback to PGF driver. % } +% \changes{v1.3a}{2022/10/17}{%^^A +% * Updated documentation with new repository URL and new email address. +% * Added dependency file for texlive. +% } % % \GetFileInfo{adjustbox.dtx} % % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\gdef,\let} % % \author{Martin Scharrer} -% \email{martin@scharrer-online.de} -% \repository{https://helixteamhub.cloud/scharrer/projects/adjustbox/} +% \email{martin.scharrer@web.de} +% \repository{https://github.com/MartinScharrer/adjustbox/} % \ydocpdfsettings % \maketitle % diff --git a/macros/latex/contrib/adjustbox/adjustbox.pdf b/macros/latex/contrib/adjustbox/adjustbox.pdf index 676c6a9aad..1861fdb0f7 100644 Binary files a/macros/latex/contrib/adjustbox/adjustbox.pdf and b/macros/latex/contrib/adjustbox/adjustbox.pdf differ diff --git a/macros/latex/contrib/adjustbox/trimclip.dtx b/macros/latex/contrib/adjustbox/trimclip.dtx index ab37107325..a82cefd6b9 100644 --- a/macros/latex/contrib/adjustbox/trimclip.dtx +++ b/macros/latex/contrib/adjustbox/trimclip.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2011-2020 by Martin Scharrer -%% ---------------------------------------------------------------------- +%% Copyright (C) 2011-2022 by Martin Scharrer +%% ------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. @@ -187,8 +187,7 @@ % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\gdef,\let} % \bundle{adjustbox} % \author{Martin Scharrer} -% \email{martin@scharrer-online.de} -% ^^A\repository{https://helixteamhub.cloud/scharrer/projects/adjustbox/} +% \email{martin.scharrer@web.de} % \ydocpdfsettings % \maketitle % @@ -1549,7 +1548,7 @@ \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 \begin{tikzpicture}[font=\sffamily,>=latex] \newcommand\Cs[1]{\texttt{\scriptsize\textbackslash #1}} @@ -1764,7 +1763,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 \begin{tikzpicture}[font=\sffamily,>=latex] % Save example text in box @@ -1831,7 +1830,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 % \begin{tikzpicture}[font=\sffamily,>=latex] @@ -1899,7 +1898,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 % Save example text in box @@ -1995,7 +1994,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 % Save example text in box @@ -2093,7 +2092,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 \begin{tikzpicture}[font=\sffamily,>=latex] % Save example text in box @@ -2184,7 +2183,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 % Save example text in box @@ -2281,7 +2280,7 @@ margin=1pt 1pt 1pt 1pt,frame,angle=1, \begin{document} % % Diagram of the TeX box model and its dimensions -% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 +% Copyright (C) 2001 by Martin Scharrer , Nov 12th 2011 % This is free code under the LPPL v1.3 or later version OR the CC BY-SA 3.0 % Save example text in box diff --git a/macros/latex/contrib/adjustbox/trimclip.pdf b/macros/latex/contrib/adjustbox/trimclip.pdf index 01a7dd723c..4de93cc7b7 100644 Binary files a/macros/latex/contrib/adjustbox/trimclip.pdf and b/macros/latex/contrib/adjustbox/trimclip.pdf differ diff --git a/macros/latex/contrib/collectbox/DEPENDS.txt b/macros/latex/contrib/collectbox/DEPENDS.txt new file mode 100644 index 0000000000..1aaeb042a7 --- /dev/null +++ b/macros/latex/contrib/collectbox/DEPENDS.txt @@ -0,0 +1,2 @@ +# No dependencies + diff --git a/macros/latex/contrib/collectbox/README b/macros/latex/contrib/collectbox/README deleted file mode 100644 index d83c61d077..0000000000 --- a/macros/latex/contrib/collectbox/README +++ /dev/null @@ -1,14 +0,0 @@ -LaTeX package 'collectbox' -~~~~~~~~~~~~~~~~~~~~~~~~~~ -Copyright (c) 2011 by Martin Scharrer -Code Repository: https://bitbucket.org/martin_scharrer/collectbox/ -WWW: http://latex.scharrer-online.de/ - -This package provides macros to collect and process an macro argument (i.e. -something which looks like a macro argument) as horizontal box instead as a real -macro argument. These "arguments" will be stored like when using \savebox, -\sbox or the lrbox environment and allow verbatim or other special code. Instead -of explicit braces also implicit braces in the form of \bgroup and \egroup -are supported. This allows to split the begin and end over different macros or to -place them in the begin and end code of an environment. The provided macros are -mainly intended to be used inside other macros or environments diff --git a/macros/latex/contrib/collectbox/README.txt b/macros/latex/contrib/collectbox/README.txt new file mode 100644 index 0000000000..2071df4211 --- /dev/null +++ b/macros/latex/contrib/collectbox/README.txt @@ -0,0 +1,15 @@ +LaTeX package 'collectbox' +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Copyright (c) 2010-2022 by Martin Scharrer +License: LaTeX Project Public License, v1.3 or later: http://www.latex-project.org/lppl.txt +Repository: https://github.com/MartinScharrer/collectbox +Issues: https://github.com/MartinScharrer/collectbox/issues + +This package provides macros to collect and process an macro argument (i.e. +something which looks like a macro argument) as horizontal box instead as a real +macro argument. These "arguments" will be stored like when using \savebox, +\sbox or the lrbox environment and allow verbatim or other special code. Instead +of explicit braces also implicit braces in the form of \bgroup and \egroup +are supported. This allows to split the begin and end over different macros or to +place them in the begin and end code of an environment. The provided macros are +mainly intended to be used inside other macros or environments diff --git a/macros/latex/contrib/collectbox/collectbox.dtx b/macros/latex/contrib/collectbox/collectbox.dtx index 5981b9dd00..98e100808b 100644 --- a/macros/latex/contrib/collectbox/collectbox.dtx +++ b/macros/latex/contrib/collectbox/collectbox.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2012 by Martin Scharrer -%% -------------------------------------------------------------------- +%% Copyright (C) 2012-2022 by Martin Scharrer +%% ------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. @@ -24,10 +24,10 @@ %<*driver> \ProvidesFile{collectbox.dtx}[% %<=*DATE> - 2012/05/17 + 2022/10/17 %<=/DATE> %<=*VERSION> - v0.4b + v0.4c %<=/VERSION> DTX File of collectbox] \documentclass{ydoc} @@ -74,14 +74,15 @@ % Added support for tabular-like environments in macro-mode.} % \changes{v0.4a}{2012/05/13}{Made use of \cs{noindent} by the environment version optional.} % \changes{v0.4b}{2012/05/17}{Added \cs{@Collectbox} macro.} +% \changes{v0.4c}{2022/10/17}{Updated repository URL and email address.} % % % \DoNotIndex{\newcommand,\newenvironment} % % \GetFileInfo{collectbox.dtx} % \author{Martin Scharrer} -% \email{martin@scharrer-online.de} -% \repository{https://bitbucket.org/martin_scharrer/collectbox} +% \email{martin.scharrer@web.de} +% \repository{https://github.com/MartinScharrer/collectbox} % \maketitle % % \begin{abstract} @@ -561,7 +562,7 @@ % \begin{macrocode} \begingroup \expandafter\ifx\csname protected\endcsname\relax - \let\collectbox@protecteddef\def% + \global\let\collectbox@protecteddef\def% \else \gdef\collectbox@protecteddef{\protected\def}% \fi diff --git a/macros/latex/contrib/collectbox/collectbox.pdf b/macros/latex/contrib/collectbox/collectbox.pdf index 17adb6eeec..fd8f967c05 100644 Binary files a/macros/latex/contrib/collectbox/collectbox.pdf and b/macros/latex/contrib/collectbox/collectbox.pdf differ diff --git a/macros/latex/contrib/docshots/README.md b/macros/latex/contrib/docshots/README.md index 3e8327ed79..ff64e5ba6e 100644 --- a/macros/latex/contrib/docshots/README.md +++ b/macros/latex/contrib/docshots/README.md @@ -11,6 +11,11 @@ from [CTAN](https://ctan.org/pkg/docshots) and then use like this: ```tex +\documentclass{article} +\usepackage{docshots} +\begin{document} +Here is how you can use \LaTeX: + \begin{docshot} \documentclass{article} \pagestyle{empty} @@ -18,6 +23,9 @@ and then use like this: Hello, \LaTeX! \end{document} \end{docshot} + +For more informaiton, read \TeX{} Book by Donald Knuth. +\end{document} ``` If you want to contribute yourself, make a fork, then create a branch, diff --git a/macros/latex/contrib/docshots/docshots.dtx b/macros/latex/contrib/docshots/docshots.dtx index 65eade188b..18f9b6356a 100644 --- a/macros/latex/contrib/docshots/docshots.dtx +++ b/macros/latex/contrib/docshots/docshots.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{docshots} %<*package> -[2022-10-16 0.0.2 TeX Samples Next to Their PDF Snapshots in DTX] +[2022-10-17 0.0.3 TeX Samples Next to Their PDF Snapshots in DTX] % %<*driver> \documentclass{ltxdoc} @@ -78,11 +78,12 @@ % \maketitle % % \textbf{\color{red}NB!} -% You must run \TeX{} processor with |--shell-escape| option -% and you must have -% \href{...}{pdflatex}, +% This package doesn't work on Windows! +% Also, you must run \TeX{} processor with |--shell-escape| option. +% Also, you must have +% |pdlaftex|, % \href{https://www.perl.org}{Perl}, -% \href{...}{Ghostscript}, +% \href{https://www.ghostscript.com}{Ghostscript}, % and \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} % installed. @@ -92,7 +93,8 @@ % how to use certain \TeX{} commands, the best way would be % to show exactly how the entire document will be rendered in PDF, % using a subprocess that would render it (via |pdflatex|, for example). -% To my best knowledge, there were no packages that would allow +% To \href{https://tex.stackexchange.com/questions/661027}{my best} +% knowledge, there were no packages that would allow % you do exactly this. That's why I created this simple package. % For example, this code: % @@ -103,8 +105,8 @@ \begin{docshot} \documentclass{article} \usepackage{xcolor} -\begin{document} \pagestyle{empty} +\begin{document} Hello, {\color{orange}\LaTeX}! \end{document} \end{docshot} @@ -116,8 +118,8 @@ % \begin{docshot} % \documentclass{article} % \usepackage{xcolor} -% \begin{document} % \pagestyle{empty} +% \begin{document} % Hello, {\color{orange}\LaTeX}! % \end{document} % \end{docshot} @@ -126,11 +128,11 @@ % \begin{docshot} % \documentclass{article} % \usepackage{tikz} -% \begin{document} % \pagestyle{empty} +% \begin{document} % \begin{tikzpicture} % \node [circle,draw] (v0) {$v_0$}; -% \node [circle,draw, +% \node [circle,draw=orange,thick, % below right of=v0] (v1) {$v_1$}; % \draw [->] (v0) -- (v1); % \end{tikzpicture} @@ -142,10 +144,24 @@ % After a successful processing of \TeX{} sources, we use % \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} to trim the document. -% We execute |pdflatex| with |-interaction=batchmode| option. This means that -% \TeX{} processing errors will be ignored as much as possible and the PDF -% rendered may look not like you expect it to look. Check your \TeX{} log -% to understand what may go wrong. +% We execute |pdflatex| with |-interaction=batchmode| and |-halt-on-error| options. +% This means that +% \TeX{} processing will stop at the first error. Check your \TeX{} log +% to understand what went wrong. + +% When you render a text instead of a single picture, it's recommended to use +% \href{https://ctan.org/pkg/geometry}{geometry} package to change the size +% of the page and then |empty| page style to remove page numbering: +% \begin{docshot} +% \documentclass{article} +% \usepackage[paperwidth=2in]{geometry} +% \pagestyle{empty} +% \begin{document} +% ``There is no sadder thing than +% a young pessimist, except an old +% pessimist'' --- \emph{Mark Twain} +% \end{document} +% \end{docshot} % \section{Package Options} @@ -250,6 +266,120 @@ Hello, world! % %\fi +% \DescribeMacro{tmpdir} +% The default location of temp files is |\docshots@tmpdir|. You can change this using |tmpdir| option: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\usepackage[tmpdir=/tmp/foo]{docshot} +\end{verbatim} +%\iffalse +% +%\fi + +% \DescribeMacro{runs} +% By default, we run |pdflatex| just once for each docshot. You can change this number using the package +% option |runs|. This may be helpful if you need Bib\TeX{} processing, for example: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\usepackage[runs=3]{docshot} +\end{verbatim} +%\iffalse +% +%\fi + +% \DescribeMacro{small} +% \DescribeMacro{tiny} +% You don't have too much freedom in formatting of verbatim texts, but you can make +% their font a bit smaller using |small| package option. You can also make it very +% small using |tiny| option: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\usepackage[small]{docshot} +\end{verbatim} +%\iffalse +% +%\fi + +% \section{Prerequisites} + +% \DescribeMacro{\docshotPrerequisite} +% If you need some files to be present next to the |.tex| snippet while +% it's rendered by |pdflatex|, you can use |\docshotPrerequisite| with +% a single mandatory argument. The argument is the name of a file you need +% to be copied from current directory to the temporary directory, where +% all snippets are rendered. The command can be used either in the body +% of the document or in the preamble --- it doesn't matter, as long as +% it shows up before the docshot that needs the prerequisite. For example: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass{article} +\usepackage{docshot} +\docshotPrerequisite{duck.jpg} +\begin{document} +\begin{docshot} + \documentclass{article} + \usepackage{graphicx} + \pagestyle{empty} + \begin{document} + This is my favorite picture of a duck: + \includegraphics[width=2in]{duck.jpg} + \end{document} +\end{docshot} +\end{document} +\end{verbatim} +%\iffalse +% +%\fi + +% \DescribeMacro{\docshotAfter} +% If you need something to happen after each |pdflatex| run of a docshot, you may use +% |\docshotAfter| command right before |docshot| environment. For example, you have a bibliography file that +% you want to be visible for all snippets and you want all of them to +% run \href{https://ctan.org/pkg/biber}{biber} in order to process citations: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass{article} +\usepackage{docshot} +\docshotPrerequisite{main.bib} +\begin{document} +\docshotAfter{biber $2} +\begin{docshot} + \documentclass{acmart} + \usepackage[natbib=true]{biblatex} + \addbibresource{main.bib} + \pagestyle{empty} + \begin{document} + You must read the book of \citet{knuth1984}. + \printbibliography + \end{document} +\end{docshot} +\end{document} +\end{verbatim} +%\iffalse +% +%\fi +% The script you specify in the first argument of |\docshotAfter| will get +% three arguments when it runs: +% \begin{description}\setlength\itemsep{0em} +% \item[|\$1|] the cycle of |pdflatex| processing (1, 2, ...), +% \item[|\$2|] the hash of the snippet, +% \item[|\$3|] the name of the |.tex| file. +% \end{description} +% |$2| is basically equals to |$1| with an +% attached |.tex| suffix. |\docshotAfter| applies only to the first |docshot| +% environment that goes after it! You must specify |\docshotAfter| before +% each |docshot| where you want such post-processing to happen. + % \StopEventually{} % \section{Implementation} @@ -272,6 +402,12 @@ Hello, world! \pgfkeys{ /docshots/.cd, dtx/.store in=\docshots@dtx, + tmpdir/.store in=\docshots@tmpdir, + tmpdir/.default=_docshots, + small/.store in=\docshots@small, + tiny/.store in=\docshots@tiny, + runs/.store in=\docshots@runs, + runs/.default=1, pdflatex/.store in=\docshots@pdflatex, pdflatex/.default=pdflatex, gs/.store in=\docshots@gs, @@ -281,12 +417,12 @@ Hello, world! margin/.store in=\docshots@margin, margin/.default=5, hspace/.store in=\docshots@hspace, - hspace/.default=1.8em, + hspace/.default=.05\linewidth, left/.store in=\docshots@left, left/.default=.3\linewidth, right/.store in=\docshots@right, - right/.default=.65\linewidth, - pdflatex,gs,pdfcrop,margin,hspace,left,right + right/.default=.55\linewidth, + tmpdir,pdflatex,gs,pdfcrop,margin,hspace,left,right,runs } \ProcessPgfOptions{/docshots} % \end{macrocode} @@ -308,7 +444,7 @@ Hello, world! % Then, we make a directory where all temporary files will be kept: % \begin{macrocode} -\iexec[null]{mkdir -p _docshots/\jobname}% +\iexec[null]{mkdir -p \docshots@tmpdir/\jobname}% % \end{macrocode} % \begin{macro}{docshot} @@ -316,40 +452,110 @@ Hello, world! % \begin{macrocode} \newenvironment{docshot} {\VerbatimEnvironment\begin{VerbatimOut} - {_docshots/\jobname/verbatim.tex}} + {\docshots@tmpdir/\jobname/verbatim.tex}} {\end{VerbatimOut}% +% \end{macrocode} +% If we are in |dtx| mode, leading percent characters must be removed: +% \begin{macrocode} \ifdefined\docshots@dtx% \iexec[null]{perl -i -0777pe "s/(\\n|^)\\x{25} /\\1/g" - _docshots/\jobname/verbatim.tex}% + \docshots@tmpdir/\jobname/verbatim.tex}% \fi% - \def\hash{\pdfmdfivesum file {_docshots/\jobname/verbatim.tex}}% - \IfFileExists{_docshots/\jobname/\hash.pdf} - {\message{won't render, the PDF already exists: _docshots/\jobname/\hash.pdf^^J}} - {\iexec[log,quiet]{cp _docshots/\jobname/verbatim.tex - _docshots/\jobname/\hash.tex}% - \iexec[log,quiet]{cd _docshots/\jobname; - \docshots@pdflatex\space -interaction=batchmode - -shell-escape \hash.tex}}% - \IfFileExists{_docshots/\jobname/\hash.crop.pdf} - {\message{won't pdfcrop, the PDF already exists: _docshots/\jobname/\hash.crop.pdf^^J}} +% \end{macrocode} +% We calculate MD5 hashsum of the file content: +% \begin{macrocode} + \def\hash{\pdfmdfivesum file {\docshots@tmpdir/\jobname/verbatim.tex}}% +% \end{macrocode} +% If the PDF with the required name already exists, we ignore this step. +% Otherwise, we copy |verbatim.tex| into new file and run |pdflatex|: +% \begin{macrocode} + \IfFileExists{\docshots@tmpdir/\jobname/\hash.pdf} + {\message{docshots: won't render, the PDF already exists + (\docshots@tmpdir/\jobname/\hash.pdf)^^J}} + {\iexec[log,quiet]{cp \docshots@tmpdir/\jobname/verbatim.tex + \docshots@tmpdir/\jobname/\hash.tex}% + \foreach \n in {1,...,\docshots@runs}{ + \iexec[log,quiet]{cd \docshots@tmpdir/\jobname; + \docshots@pdflatex\space + -interaction=errorstopmode + -halt-on-error + -shell-escape + \hash.tex} + \message{docshots: pdflatex run no.\n^^J} + \IfFileExists{\docshots@tmpdir/\jobname/after.sh} + {\iexec[log,quiet]{chmod a+x + \docshots@tmpdir/\jobname/after.sh} + \iexec[log,quiet]{cd \docshots@tmpdir/\jobname; + ./after.sh \n\space \hash\space \hash.tex}} + {}}}% +% \end{macrocode} +% Here we delete |after.sh| which may exist here after the last +% compilation of |pdflatex|: +% \begin{macrocode} + \iexec[log,quiet]{rm -f \docshots@tmpdir/\jobname/after.sh} +% \end{macrocode} +% If a cropped version of the PDF with the required name already exists, we ignore this step. +% Otherwise, we ask |pdfcrop| to crop the PDF: +% \begin{macrocode} + \IfFileExists{\docshots@tmpdir/\jobname/\hash.crop.pdf} + {\message{docshots: on't pdfcrop, the PDF already exists + (\docshots@tmpdir/\jobname/\hash.crop.pdf)^^J}} {\iexec[log,quiet]{\docshots@pdfcrop\space --margins \docshots@margin\space - _docshots/\jobname/\hash.pdf - _docshots/\jobname/\hash.crop.pdf}}% - \fvset{frame=leftline,numbers=left,numbersep=3pt, - framerule=.4pt,rulecolor=\color{gray}, - samepage=true}% + \docshots@tmpdir/\jobname/\hash.pdf + \docshots@tmpdir/\jobname/\hash.crop.pdf}}% +% \end{macrocode} +% We configure |fancyvrb|: +% \begin{macrocode} + \fvset{numbers=left,numbersep=3pt}% + \fvset{frame=leftline,framerule=.4pt,rulecolor=\color{gray}}% + \fvset{samepage=true,baselinestretch=1}% + \fvset{baselinestretch=1}% + \ifdefined\docshots@small% + \fvset{fontsize=\small}% + \fi% + \ifdefined\docshots@tiny% + \fvset{fontsize=\scriptsize}% + \fi% +% \end{macrocode} +% We render the two column content: +% \begin{macrocode} + \begingroup% \par% - \tikz[baseline=(a.north)] \node[draw=gray] (a) + \tikz[baseline=(a.north)] + \node (a) [draw=gray] {\includegraphics[width=\docshots@left] - {_docshots/\jobname/\hash.crop.pdf}};% + {\docshots@tmpdir/\jobname/\hash.crop.pdf}};% \hspace{\docshots@hspace}% \begin{minipage}[t]{\docshots@right}% \vspace{0pt}% - \VerbatimInput{_docshots/\jobname/\hash.tex}% + \VerbatimInput{\docshots@tmpdir/\jobname/\hash.tex}% \vspace{0pt}% \end{minipage}% \par% + \endgroup% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\docshotPrerequisite} +% Then, we define |\docshotPrerequisite| command: +% \begin{macrocode} +\newcommand\docshotPrerequisite[1]{ + \iexec[log,quiet]{cp #1 \docshots@tmpdir/\jobname}% + \message{docshots: file #1 copied to + \docshots@tmpdir/\jobname/#1^^J}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\docshotAfter} +% Finally, we define |\docshotAfter| command: +% \begin{macrocode} +\newcommand\docshotAfter[1]{ + \iexec[log,quiet]{/bin/echo -n '\detokenize{#1}' + > \docshots@tmpdir/\jobname/after.sh}% + \message{docshots: file \docshots@tmpdir/\jobname/after.sh created^^J}% } % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/docshots/docshots.pdf b/macros/latex/contrib/docshots/docshots.pdf index 4c03380bb6..b4a800febd 100644 Binary files a/macros/latex/contrib/docshots/docshots.pdf and b/macros/latex/contrib/docshots/docshots.pdf differ diff --git a/macros/latex/contrib/gensymb/gensymb.dtx b/macros/latex/contrib/gensymb/gensymb.dtx index 8629a84f87..4b9be6150a 100644 --- a/macros/latex/contrib/gensymb/gensymb.dtx +++ b/macros/latex/contrib/gensymb/gensymb.dtx @@ -28,7 +28,7 @@ \ProvidesFile{gensymb.drv} % %\ProvidesPackage{gensymb} - [2022/10 v1.0.1 (KJH)] + [2022/10/17 v1.0.2 (KJH)] %<*driver> \documentclass{ltxdoc} \OnlyDescription diff --git a/macros/latex/contrib/gensymb/gensymb.pdf b/macros/latex/contrib/gensymb/gensymb.pdf index f0ab15cb81..bf1b6302d0 100644 Binary files a/macros/latex/contrib/gensymb/gensymb.pdf and b/macros/latex/contrib/gensymb/gensymb.pdf differ diff --git a/macros/latex/contrib/glossaries/CHANGES b/macros/latex/contrib/glossaries/CHANGES index 729b3f2c67..fec6450cd0 100644 --- a/macros/latex/contrib/glossaries/CHANGES +++ b/macros/latex/contrib/glossaries/CHANGES @@ -1,5 +1,148 @@ glossaries change log: +v4.50 (2022-10-14): + + * glossaries.sty: + + - Case-changing support now tries to detect the new mfirstuc.sty v2.08 + commands. If available: + + - exclusions, blockers and mappings will be established for \makefirstuc. + + - \mfirstucMakeUppercase won't be redefined (since it will now be using + \text_uppercase:n instead of \MakeUppercase) + + - textcase.sty (which is now deprecated) won't be loaded. All + the functionality of textcase is now pre-provided with + recent LaTeX kernels. + + If an older version of mfirstuc is present, textcase will be + loaded and the old limitations of \makefirstuc will still apply + (most notably, the requirement to group any leading UTF-8 character). + + For the best support, ensure you have mfirstuc v2.08 and + glossaries-extra v1.49 when they become available. + + - new command \glssentencecase used for sentence-casing. Default + definition uses \makefirstuc but may be redefined to use + \MFUsentencecase if preferred. + + - \glsentrytitlecase, \Glsentryname etc now expand to sentence case + in PDF bookmarks + + - new package option mfirstuc implements expanded/unexpanded options + provided by mfirstuc v2.08+ + + - new commands \glslowercase and \glsuppercase + + - The default setting for esclocations and \ifglswrallowprimitivemods + is now false. If a document requiring xindy has locations that expand to + robust commands you may need to switch these on or see the + "Problematic Locations" section of the user manual. + + - new commands used by \glshypernumber: + + \glswrglosslocationtarget + \glswrglossdisableanchorcmds + + - added \glswrglossdisablelocationcmds to disable commands when + writing locations to the glossary file. + + - \glsaddprotectedpagefmt now only has an effect with + esclocations=true + + - automake package option has new options: + + automake=makegloss -> use makeglossaries + automake=lite -> use makeglossaries-lite + automake=delayed -> formerly automake=true + + automake=true is now a deprecated synonym of automake=delayed + + If the value isn't specified the default is now + automake=immediate instead of automake=true since the immediate + setting is more reliable. + + Note that neither makeglossaries nor makeglossaries-lite are on + the list of trusted applications, so the unrestricted shell escape + will be required with these options. + + - if the automake package option is used with LuaLaTeX, the + shellesc package will automatically be loaded. Note that if you + specify automake in \setupglossaries, you'll need to explicitly + load shellesc + + - Bug fix #196: xindy codepage now defaults to utf8 if + \inputencodingname isn't defined + + - Bug fix #189: setting mathrel category gives ordinary spacing instead of mathrel spacing + https://www.dickimaw-books.com/bugtracker.php?key=194 + + This bug fix has introduced a new command \glsencapwrcontent + which adds grouping around the indexing whatsit. If this + grouping causes a problem redefine it without the grouping: + + \renewcommand*{\glsencapwrcontent}[1]{#1} + + - Bug fix #195: Conflict if xtab is loaded + https://www.dickimaw-books.com/bugtracker.php?key=195 + + If xtab has been loaded, nosuper is automatically implemented + + - Bug fix #191: local \gls option not localised + https://www.dickimaw-books.com/bugtracker.php?key=191 + + - Bug fix: \GlsAddXdyCounters causes duplicate attribute + definitions in the .xdy file + + - Bug fix: \newacronym longplural using incorrect plural suffix + (\acrpluralsuffix instead of \glspluralsuffix) + + - Bug fix: removed inappropriate \acronymfont from around long form + of dua-desc style + + - Added \glsshowtargetinner and \glsdoshowtarget (debug=target) + + - Added package option languages + + - Corrected kernelredefs choice internal commands + + - Added check for \nofiles + + - Entry counting now has associated conditional \ifglsresetcurrcount + which determines whether or not to set the counter back to 0 + when the first use flag is reset. (This has also been added to + glossaries-extra v1.49.) The default is false, which is a change + in behaviour to previous versions. + + - added sort=clear option + + - added \glsindexingsetting + + - added \ifglsfieldvoid + + - added \glsnoidxprenumberlist (fixed nonumberlist key with + "noidx" indexing) + + - compatibility options compatible-3.07 and compatible-2.07 are no + longer available. Use rollback for backward-compatibility. + + - deprecated acronym style package options + 'description', 'footnote', 'smaller', 'smallcaps', 'dua' + no longer available. Use rollback for backward-compatibiliy. + + * glossary-inline.sty: + + - added \glsinlineifhaschildren + + * makeglossaries: + + - added -e switch (don't attempt to repair multiple encaps) + + - added check for \glsignore when repairing multiple encaps + + - added check and repair for illegal page number/digit messages + v4.49 (2021-11-01): * glossary-list.sty: @@ -1075,7 +1218,7 @@ v3.08a: - Added \par to end of theglossary environment for index style. (http://www.dickimaw-books.com/cgi-bin/bugtracker.cgi?action=view&key=38) -v3.07: +v3.07 (2013-07-05): * glossaries.sty @@ -1329,7 +1472,7 @@ v3.0 (Major changes): * added more diagnostics to give more helpful messages than those supplied by xindy or makeindex. -v2.07: +v2.07 (2010-07-10): * Fixed bug that ignored format key in \glsadd diff --git a/macros/latex/contrib/glossaries/DEPENDS.txt b/macros/latex/contrib/glossaries/DEPENDS.txt new file mode 100644 index 0000000000..fd194929ab --- /dev/null +++ b/macros/latex/contrib/glossaries/DEPENDS.txt @@ -0,0 +1,8 @@ +amsmath +datatool +etoolbox +ifthen +mfirstuc +tracklang +xfor +xkeyval diff --git a/macros/latex/contrib/glossaries/README.md b/macros/latex/contrib/glossaries/README.md index 9471f71aa0..cee9ead41c 100644 --- a/macros/latex/contrib/glossaries/README.md +++ b/macros/latex/contrib/glossaries/README.md @@ -1,4 +1,4 @@ -# glossaries v4.49 (2021-11-01) +# glossaries v4.50 (2022-10-14) Author: Nicola Talbot ([contact](http://www.dickimaw-books.com/contact)) @@ -8,7 +8,7 @@ This material is subject to the LaTeX Project Public License. See http://www.ctan.org/license/lppl1.3 for the details of that license. -Copyright 2007-2021 Nicola Talbot +Copyright 2007-2022 Nicola Talbot ## DESCRIPTION @@ -117,12 +117,3 @@ If you want to use `\oldacronym` with `\xspace` you will also need xspace.sty. This needs to be explicitly loaded in your document if required. (Not recommended.) -## LaTeX2HTML - -This package comes with a LaTeX2HTML style file glossaries.perl -which should be placed in the relevant LaTeX2HTML -styles directory, but note that this style only supplies a sub-set -of the commands provided by glossaries.sty, so some -commands may not be implemented or may be implemented in a different -way. This file has not be tested with recent versions of -LaTeX2HTML and may no longer be compatible. diff --git a/macros/latex/contrib/glossaries/glossaries-code.pdf b/macros/latex/contrib/glossaries/glossaries-code.pdf index 2b2f585673..bc81f9c3a3 100644 Binary files a/macros/latex/contrib/glossaries/glossaries-code.pdf and b/macros/latex/contrib/glossaries/glossaries-code.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.pdf new file mode 100644 index 0000000000..64df5bcb16 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.png new file mode 100644 index 0000000000..86a954b0f8 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.tex new file mode 100644 index 0000000000..f0d7f9cd06 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example001.tex @@ -0,0 +1,43 @@ +% This file is embedded in glossaries-user.pdf +% Example 1 Simple document with no glossary +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[ + sort=none % no sorting or indexing required + ] {glossaries} + +\newglossaryentry +{cafe}% label + {% definition: + name={café}, + description={small restaurant selling refreshments} +} + +\setacronymstyle{long-short} \newacronym +{html}% label + {HTML}% short form + {hypertext markup language}% long form + + +\newglossaryentry +{pi}% label + {% definition: + name={\ensuremath{\pi}}, + description={Archimedes' Constant} +} + +% This is a trivial example. For a real document I recommend you use siunitx for units + \newglossaryentry + {distance}% label + {% definition: + name={distance}, + description={the length between two points}, + symbol={m} + } +\begin{document} +First use: \gls{cafe}, \gls{html}, \gls{pi}. Next use: \gls{cafe}, \gls{html}, \gls{pi}. + +\Gls{distance} (\glsentrydesc{distance}) is measured in \glssymbol{distance}. +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.pdf new file mode 100644 index 0000000000..916e8f3943 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.png new file mode 100644 index 0000000000..16054de8c2 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.tex new file mode 100644 index 0000000000..dc1efc9266 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.tex @@ -0,0 +1,41 @@ +% This file is embedded in glossaries-user.pdf +% Example 2 Simple document with unsorted glossaries +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[ sort=none,% no sorting or indexing required + abbreviations,% create list of abbreviations + symbols,% create list of symbols + postdot, % append a full stop after the descriptions + stylemods,style=index % set the default glossary style + ]{glossaries-extra} + +\newglossaryentry % glossaries.sty +{cafe}% label + {% definition: + name={café}, + description={small restaurant selling refreshments} +} + +\setabbreviationstyle{long-short}% glossaries-extra.sty +\newabbreviation % glossaries-extra.sty +{html}% label + {HTML}% short form + {hypertext markup language}% long form + % requires glossaries-extra.sty 'symbols' option + \glsxtrnewsymbol [description={Archimedes' constant}]% options + {pi}% label + {\ensuremath{\pi}}% symbol + % This is a trivial example. For a real document I recommend you use siunitx for units + \newglossaryentry % glossaries.sty +{distance}% label + {% definition: + name={distance}, description={the length between two points}, symbol={m} } +\begin{document} +First use: \gls{cafe}, \gls{html}, \gls{pi}. Next use: \gls{cafe}, \gls{html}, \gls{pi}. + +\Gls{distance} is measured in \glssymbol{distance}. +\printunsrtglossaries % list all defined entries + +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.pdf new file mode 100644 index 0000000000..b9d14403be Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.png new file mode 100644 index 0000000000..1b6a5d4fc8 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.tex new file mode 100644 index 0000000000..d8b41f23ae --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example003.tex @@ -0,0 +1,29 @@ +% This file is embedded in glossaries-user.pdf +% Example 3 Simple document that uses TeX\ to sort entries +% arara: pdflatex +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[style=indexgroup]{glossaries} +\makenoidxglossaries % use TeX to sort + \newglossaryentry{parrot}{name={parrot}, + description={a brightly coloured tropical bird}} +\newglossaryentry{duck}{name={duck}, + description={a waterbird}} +\newglossaryentry{puffin}{name={puffin}, + description={a seabird with a brightly coloured bill}} +\newglossaryentry{penguin}{name={penguin}, + description={a flightless black and white seabird}} +% a symbol: + \newglossaryentry{alpha}{name={\ensuremath{\alpha}}, + sort={alpha},description={a variable}} +% an acronym: + \setacronymstyle{short-long} + \newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network} +\begin{document} +\Gls{puffin}, \gls{duck} and \gls{parrot}. +\gls{arpanet} and \gls{alpha}. +Next use: \gls{arpanet}. +\printnoidxglossary +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.pdf new file mode 100644 index 0000000000..01bde654d7 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.png new file mode 100644 index 0000000000..d991b85b99 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.tex new file mode 100644 index 0000000000..d174169dbf --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example004.tex @@ -0,0 +1,30 @@ +% This file is embedded in glossaries-user.pdf +% Example 4 Simple document that uses makeindex to sort entries +% arara: pdflatex +% arara: makeglossaries +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[style=indexgroup]{glossaries} +\makeglossaries % open \dglspl {indexingfile} + \newglossaryentry{parrot}{name={parrot}, + description={a brightly coloured tropical bird}} +\newglossaryentry{duck}{name={duck}, + description={a waterbird}} +\newglossaryentry{puffin}{name={puffin}, + description={a seabird with a brightly coloured bill}} +\newglossaryentry{penguin}{name={penguin}, + description={a flightless black and white seabird}} +% a symbol: + \newglossaryentry{alpha}{name={\ensuremath{\alpha}}, + sort={alpha},description={a variable}} +% an acronym: + \setacronymstyle{short-long} + \newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network} +\begin{document} +\Gls{puffin}, \gls{duck} and \gls{parrot}. +\gls{arpanet} and \gls{alpha}. +Next use: \gls{arpanet}. +\printglossary +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.pdf new file mode 100644 index 0000000000..9e946198d6 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.png new file mode 100644 index 0000000000..518a57b377 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.tex new file mode 100644 index 0000000000..e7f9eb535e --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example005.tex @@ -0,0 +1,30 @@ +% This file is embedded in glossaries-user.pdf +% Example 5 Simple document that uses xindy to sort entries +% arara: pdflatex +% arara: makeglossaries +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[xindy,style=indexgroup]{glossaries} +\makeglossaries % open \dglspl {indexingfile} + \newglossaryentry{parrot}{name={parrot}, + description={a brightly coloured tropical bird}} +\newglossaryentry{duck}{name={duck}, + description={a waterbird}} +\newglossaryentry{puffin}{name={puffin}, + description={a seabird with a brightly coloured bill}} +\newglossaryentry{penguin}{name={penguin}, + description={a flightless black and white seabird}} +% a symbol: + \newglossaryentry{alpha}{name={\ensuremath{\alpha}}, + sort={alpha},description={a variable}} +% an acronym: + \setacronymstyle{short-long} + \newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network} +\begin{document} +\Gls{puffin}, \gls{duck} and \gls{parrot}. +\gls{arpanet} and \gls{alpha}. +Next use: \gls{arpanet}. +\printglossary +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.pdf new file mode 100644 index 0000000000..02283269eb Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.png new file mode 100644 index 0000000000..c401aaa863 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.tex new file mode 100644 index 0000000000..e3a96d6606 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example006.tex @@ -0,0 +1,44 @@ +% This file is embedded in glossaries-user.pdf +% Example 6 Simple document that uses bib2gls to sort entries +% arara: pdflatex +% arara: bib2gls +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\begin{filecontents*}{sample-entries.bib} +@entry{parrot, + name={parrot}, + description={a brightly coloured tropical bird} +} +@entry{duck, + name={duck}, + description={a waterbird} +} +@entry{puffin, + name={puffin}, + description={a seabird with a brightly coloured bill} +} +@entry{penguin, + name={penguin}, + description={a flightless black and white seabird} +} +@symbol{alpha, + name={\ensuremath{\alpha}}, + description={a variable} +} +@abbreviation{arpanet, + short={ARPANET}, + long={Advanced Research Projects Agency Network} +} +\end{filecontents*} +\usepackage[record,style=indexgroup]{glossaries-extra} +\setabbreviationstyle{short-long} +\GlsXtrLoadResources[src={sample-entries}]% data in sample-entries.bib + +\begin{document} +\Gls{puffin}, \gls{duck} and \gls{parrot}. +\gls{arpanet} and \gls{alpha}. +Next use: \gls{arpanet}. +\printunsrtglossary +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.pdf new file mode 100644 index 0000000000..25da6015a5 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.png new file mode 100644 index 0000000000..0b07c4ff90 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.tex new file mode 100644 index 0000000000..d8ac491914 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example007.tex @@ -0,0 +1,28 @@ +% This file is embedded in glossaries-user.pdf +% Example 7 Simple document with an unsorted list of all defined entries +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[style=indexgroup]{glossaries-extra} +\newglossaryentry{parrot}{name={parrot}, + description={a brightly coloured tropical bird}} +\newglossaryentry{duck}{name={duck}, + description={a waterbird}} +\newglossaryentry{puffin}{name={puffin}, + description={a seabird with a brightly coloured bill}} +\newglossaryentry{penguin}{name={penguin}, + description={a flightless black and white seabird}} +% a symbol: + \newglossaryentry{alpha}{name={\ensuremath{\alpha}}, + sort={alpha},description={a variable}} +% an abbreviation: + \setabbreviationstyle{short-long} +\newabbreviation{arpanet}{ARPANET}{Advanced Research Projects Agency Network} +\begin{document} +\Gls{puffin}, \gls{duck} and \gls{parrot}. +\gls{arpanet} and \gls{alpha}. +Next use: \gls{arpanet}. +% entries are listed in order of definition + \printunsrtglossary +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.pdf new file mode 100644 index 0000000000..d9ddc42525 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.png new file mode 100644 index 0000000000..fe791c5a6d Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.tex new file mode 100644 index 0000000000..3b5e7f6f3e --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example008.tex @@ -0,0 +1,39 @@ +% This file is embedded in glossaries-user.pdf +% Example 8 Simple document with standalone entries +% arara: pdflatex +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[colorlinks]{hyperref} +\usepackage[sort=none, + nostyles% <- no glossary styles are required + ]{glossaries-extra} + +\newglossaryentry{set}{name={set}, + description={a collection of any kind of objects}, + symbol={\ensuremath{\mathcal{S}}} +} + +\newglossaryentry{function}{name={function}, + description={a rule that assigns every element in the + domain \gls{set} to an element in the range \gls{set}}, + symbol={\ensuremath{f(x)}} } +\newcommand*{\termdef}[1]{% + \section{\glsxtrglossentry{#1} \glsentrysymbol{#1}}% + \begin{quote}\em\Glsentrydesc{#1}.\end{quote}% +} +\begin{document} +\tableofcontents + +\section{Introduction} +Sample document about \glspl{function} and \glspl{set}. + +\termdef{set} + +More detailed information about \glspl{set} with examples. + +\termdef{function} + +More detailed information about \glspl{function} with examples. +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.pdf new file mode 100644 index 0000000000..d606a0faa2 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.png new file mode 100644 index 0000000000..d61c4249f5 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.tex new file mode 100644 index 0000000000..1167f0968b --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example022.tex @@ -0,0 +1,15 @@ +% This file is embedded in glossaries-user.pdf +% Example 22 Simple document with acronyms +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage{glossaries} +\setacronymstyle{long-short} +\newacronym{html}{HTML}{hypertext markup language} +\newacronym{xml}{XML}{extensible markup language} +\begin{document} +First use: \gls{html} and \gls{xml}. + +Next use: \gls{html} and \gls{xml}. +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.pdf new file mode 100644 index 0000000000..7bc49fdd86 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.png new file mode 100644 index 0000000000..09360faa5f Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.tex new file mode 100644 index 0000000000..2096c621d1 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example023.tex @@ -0,0 +1,16 @@ +% This file is embedded in glossaries-user.pdf +% Example 23 Defining and Using an Acronym +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage{glossaries} +\setacronymstyle{long-short} +\newacronym{idn}{IDN}{identification number} +\begin{document} +First use: \gls{idn}. Next use: \gls{idn}. + +\glsreset{idn}% reset first use + The \gls{idn}['s] prefix is a capital letter. +Next use: the \gls{idn}['s] prefix is a capital letter. +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.pdf new file mode 100644 index 0000000000..2a3bf61b6d Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.png new file mode 100644 index 0000000000..8156859e0a Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.tex new file mode 100644 index 0000000000..bb48775a0d --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example024.tex @@ -0,0 +1,16 @@ +% This file is embedded in glossaries-user.pdf +% Example 24 Defining and Using an Acronym (Rollback) +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage{glossaries}[=v4.46]% rollback to v4.46 + % no \setacronymstyle so old style used + \newacronym{idn}{IDN}{identification number} +\begin{document} +First use: \gls{idn}. Next use: \gls{idn}. + +\glsreset{idn}% reset first use + The \gls{idn}['s] prefix is a capital letter. +Next use: the \gls{idn}['s] prefix is a capital letter. +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.pdf new file mode 100644 index 0000000000..9e6f19d2b0 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.png new file mode 100644 index 0000000000..958bd9b554 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.tex new file mode 100644 index 0000000000..e2bd177cae --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example025.tex @@ -0,0 +1,12 @@ +% This file is embedded in glossaries-user.pdf +% Example 25 Small-Caps Acronym +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage{glossaries} +\setacronymstyle{long-sc-short} +\newacronym{mathml}{MathML}{mathematical markup language} +\begin{document} +\acrshort{mathml} +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.pdf b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.pdf new file mode 100644 index 0000000000..f0f00917ff Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.png b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.png new file mode 100644 index 0000000000..ee722efde4 Binary files /dev/null and b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.png differ diff --git a/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.tex b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.tex new file mode 100644 index 0000000000..00a5e2fe49 --- /dev/null +++ b/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example030.tex @@ -0,0 +1,31 @@ +% This file is embedded in glossaries-user.pdf +% Example 30 Don't index entries that are only used once +% arara: pdflatex +% arara: pdflatex +% arara: makeglossaries +% arara: pdflatex +% arara: pdfcrop +\documentclass[12pt]{article} +\pagestyle{empty} +\usepackage[colorlinks]{hyperref} +\usepackage[acronym]{glossaries} +\makeglossaries + +\glsenableentrycount + +\setacronymstyle{long-short} + +\newacronym{html}{HTML}{hypertext markup language} +\newacronym{css}{CSS}{cascading style sheets} +\newacronym{xml}{XML}{extensible markup language} +\newacronym{sql}{SQL}{structured query language} +\newacronym{rdbms}{RDBMS}{relational database management system} +\newacronym{rdsms}{RDSMS}{relational data stream management system} +\begin{document} +These entries are only used once: \cgls{sql}, \cgls{rdbms}, +\cgls{xml}. These entries are used multiple times: +\cgls{html}, \cgls{html}, \cgls{css}, \cgls{css}, \cgls{css}, +\cgls{rdsms}, \cgls{rdsms}. + +\printglossaries +\end{document} diff --git a/macros/latex/contrib/glossaries/glossaries-user.html b/macros/latex/contrib/glossaries/glossaries-user.html index c3e01f1d7c..97d229ea49 100644 --- a/macros/latex/contrib/glossaries/glossaries-user.html +++ b/macros/latex/contrib/glossaries/glossaries-user.html @@ -1,49888 +1,16735 @@ - - - - - - - - - - - - + + +
+
User Manual for glossaries.sty v4.50
Nicola L.C. Talbot
+ +dickimaw-books.com/contact
2022-10-14

+

+ +

Abstract
+ The glossaries package provides a means to define terms or acronyms or symbols that can be referenced within your document. Sorted lists with collated locations can be generated either using TeX or using a supplementary indexing application. Sample documents are provided with the glossaries package. These are listed in §18.
+

+

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

+Note that glossaries-extra provides an extra indexing option (bib2gls) which isn’t available with just the base glossaries package.

+

+If you require multilingual support you must also install the relevant language module. Each language module is called glossaries-language, where language is the root language name. For example, glossaries-french or glossaries-german. If a language module is required, the glossaries package will automatically try to load it and will give a warning if the module isn’t found. See §1.5 for further details. If there isn’t any support available for your language, use the nolangwarn package option to suppress the warning and provide your own translations. (For example, use the title key in \printglossary.)

+

+Documents have wide-ranging styles when it comes to presenting glossaries 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 glossary. They may just have symbols with terse descriptions or they may have long technical words with complicated descriptions. The glossaries package is flexible enough to accommodate such varied requirements, but this flexibility comes at a price: a big manual.

+1f631 If you’re freaking out at the size of this manual, start with “The glossaries package: a guide for beginners”. You should find it in the same directory as this document or try

texdoc glossariesbegin
Once you’ve got to grips with the basics, then come back to this manual to find out how to adjust the settings.
+

+The glossaries bundle includes the following documentation: +

+
The glossaries package: a guide for beginners
+
If you want some brief information and examples to get you going, start with the guide for beginners.
+

+

User Manual for glossaries.sty (glossaries-user.pdf)
+

+ +

This document is the main user guide for the glossaries package.
+

+

Documented Code for glossaries (glossaries-code.pdf)
+

+ +

Advanced users wishing to know more about the inner workings of all the packages provided in the glossaries bundle should read “Documented Code for glossaries v4.50”.
+

+

CHANGES
---> - - -

-

- - -

- - -

-
-

-

User Manual for glossaries.sty v4.49 -

-
Change log. +

+

README.md
+

+ +

Package summary.
+

+

Depends.txt
+

+ +

List of all packages unconditionally required by glossaries. Other unlisted packages may be required under certain circumstances. For help on installing packages see, for example, How do I update my TeX distribution? or (for Linux users) Updating TeX on Linux.
+

+ + + Related resources: +

+

+

+If you use hyperref and glossaries, you must load hyperref first (although, in general, hyperref should be loaded after other packages).
+

+

+ + +
+

List of Tables

+
-
Nicola L.C. Talbot
dickimaw-books.com/contact
-
-

2021-11-01

-
-

- - -

-

-Abstract -

-

The glossaries package provides a means to define terms or abbreviations or symbols that can be referenced -within your document. Sorted lists with collated locations can be generated either using TeX or using a -supplementary indexing application. Sample documents are provided with the glossaries package. These are -listed in §18 Sample Documents. -

- - -

-
-

Additional features not provided here may be available through the extension package glossaries-extra which, -if required, needs to be installed separately. New features will be added to glossaries-extra. Versions of the -glossaries package after v4.21 will mostly be just bug fixes or minor maintenance. Note that glossaries-extra -provides an extra indexing option (bib2gls) which isn’t available with just the base glossaries package. -
-

-

If you require multilingual support you must also separately install the relevant language module. Each -language module is distributed under the name glossaries-language⟩, where ⟨language⟩ is the root language -name. For example, glossaries-french or glossaries-german. If a language module is required, the glossaries -package will automatically try to load it and will give a warning if the module isn’t found. See §1.4 Multi-Lingual -Support for further details. If there isn’t any support available for your language, use the nolangwarn package -option to suppress the warning and provide your own translations. (For example, use the title key in -\printglossary.) -

The glossaries package requires a number of other packages including, but not limited to, tracklang, mfirstuc, -etoolbox, xkeyval (at least version dated 2006/11/18), textcase, xfor, datatool-base (part of the datatool bundle) -and amsgen. These packages are all available in the latest TeX Live and MikTeX distributions. If any of them -are missing, please update your TeX distribution using your update manager. For help on this -see, for example, How do I update my TeX distribution? or (for Linux users) Updating TeX on -Linux. -

Note that occasionally you may find that certain packages need to be loaded after packages that are required -by glossaries. For example, a package ⟨X⟩ might need to be loaded after amsgen. In which case, load the required -package first (for example, amsgen), then ⟨X⟩, and finally load glossaries. -

Documents have wide-ranging styles when it comes to presenting glossaries 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 glossary. They may just have symbols with terse descriptions -or they may have long technical words with complicated descriptions. The glossaries package is -flexible enough to accommodate such varied requirements, but this flexibility comes at a price: a big -manual. -

😱 If you’re freaking out at the size of this manual, start with glossariesbegin.pdf (“The glossaries package: -a guide for beginnners”). You should find it in the same directory as this document or try texdoc -glossariesbegin.pdf. Once you’ve got to grips with the basics, then come back to this manual to find out how -to adjust the settings.

-

-

The glossaries bundle includes the following documentation: -

-

-glossariesbegin.pdf

-

If you are a complete beginner, start with “The glossaries package: a guide for beginners”. -

-

- - -glossaries-user.pdf

-

This document is the main user guide for the glossaries package. -

-

-glossaries-code.pdf

-

Advanced users wishing to know more about the inner workings of all the packages provided in the - glossaries bundle should read “Documented Code for glossaries v4.49”. -

-

-CHANGES

-

Change log. -

-

-README.md

-

Package summary. -

-
-

Related resources:

- -

If you use hyperref and glossaries, you must load hyperref first (although hyperref should be loaded after -most other packages). Similarly the doc package must also be loaded before glossaries. (If doc is loaded, the file -extensions for the default main glossary are changed to gls2, glo2 and glg2 to avoid conflict with doc’s changes -glossary.) -

If you are using hyperref, it’s best to use pdflatex rather than latex (DVI format) as pdflatex deals with -hyperlinks much better. If you use the DVI format, you will encounter problems where you have long hyperlinks -or hyperlinks in subscripts or superscripts. This is an issue with the DVI format not with glossaries. If you really -need to use the DVI format and have a problem with hyperlinks in maths mode, I recommend you use -glossaries-extra with the hyperoutside and textformat attributes set to appropriate values for problematic entries. -

-

-

The glossaries package replaces the glossary package which is now obsolete. Please see the document -“Upgrading from the glossary package to the glossaries package” for assistance in upgrading. - - - - -

-

Contents

-
- Glossary -
1 Introduction -
 1.1 Rollback -
 1.2 Indexing Options -
 1.3 Dummy Entries for Testing -
 1.4 Multi-Lingual Support -
  1.4.1 Changing the Fixed Names -
  1.4.2 Creating a New Language Module -
 1.5 Generating the Associated Glossary Files -
  1.5.1 Using the makeglossaries Perl Script -
  1.5.2 Using the makeglossaries-lite Lua Script -
  1.5.3 Using xindy explicitly (Option 3) -
  1.5.4 Using makeindex explicitly (Option 2) -
 1.6 Note to Front-End and Script Developers -
  1.6.1 MakeIndex and Xindy -
  1.6.2 Entry Labels -
  1.6.3 Bib2Gls -
2 Package Options -
 2.1 General Options -
 2.2 Sectioning, Headings and TOC Options -
 2.3 Glossary Appearance Options -
 2.4 Indexing Options -
 2.5 Sorting Options -
 2.6 Glossary Type Options -
 2.7 Acronym and Abbreviation Options -
 2.8 Deprecated Acronym Style Options -
 2.9 Other Options -
 2.10 Setting Options After the Package is Loaded -
3 Setting Up -
 3.1 Option 1 -
 3.2 Options 2 and 3 -
4 Defining Glossary Entries -
 4.1 Plurals -
 4.2 Other Grammatical Constructs -
 4.3 Additional Keys - - -
  4.3.1 Document Keys -
  4.3.2 Storage Keys -
 4.4 Expansion -
 4.5 Sub-Entries -
  4.5.1 Hierarchical Categories -
  4.5.2 Homographs -
 4.6 Loading Entries From a File -
 4.7 Moving Entries to Another Glossary -
 4.8 Drawbacks With Defining Entries in the Document Environment -
  4.8.1 Technical Issues -
  4.8.2 Good Practice Issues -
5 Referencing Entries in the Document -
 5.1 Links to Glossary Entries -
  5.1.1 The \gls-Like Commands (First Use Flag Queried) -
  5.1.2 The \glstext-Like Commands (First Use Flag Not Queried) -
  5.1.3 Changing the format of the link text -
  5.1.4 Enabling and disabling hyperlinks to glossary entries -
 5.2 Using Glossary Terms Without Links -
6 Acronyms and Other Abbreviations -
 6.1 Displaying the Long, Short and Full Forms (Independent of First Use) -
 6.2 Changing the Acronym Style -
  6.2.1 Predefined Acronym Styles -
  6.2.2 Defining A Custom Acronym Style -
 6.3 Displaying the List of Acronyms -
 6.4 Upgrading From the glossary Package -
7 Unsetting and Resetting Entry Flags -
 7.1 Counting the Number of Times an Entry has been Used (First Use Flag Unset) -
8 Displaying a Glossary -
9 Defining New Glossaries -
10 Adding an Entry to the Glossary Without Generating Text -
11 Cross-Referencing Entries -
 11.1 Customising Cross-reference Text -
12 Number Lists -
 12.1 Encap Values (Location Formats) -
 12.2 Locations -
 12.3 Range Formations -
 12.4 Style Hook -
13 Glossary Styles -
 13.1 Predefined Styles -
  13.1.1 List Styles -
  13.1.2 Longtable Styles -
  13.1.3 Longtable Styles (Ragged Right) -
  13.1.4 Longtable Styles (booktabs) -
  13.1.5 Supertabular Styles -
  13.1.6 Supertabular Styles (Ragged Right) -
  13.1.7 Tree-Like Styles - - -
  13.1.8 Multicols Style -
  13.1.9 In-Line Style -
 13.2 Defining your own glossary style -
14 Xindy (Option 3) -
 14.1 Language and Encodings -
 14.2 Locations and Number lists -
 14.3 Glossary Groups -
15 Utilities -
 15.1 Loops -
 15.2 Conditionals -
 15.3 Fetching and Updating the Value of a Field -
16 Prefixes or Determiners -
17 Accessibility Support -
18 Sample Documents -
 18.1 Basic -
 18.2 Acronyms and First Use -
 18.3 Non-Page Locations -
 18.4 Multiple Glossaries -
 18.5 Sorting -
 18.6 Child Entries -
 18.7 Cross-Referencing -
 18.8 Custom Keys -
 18.9 Xindy (Option 3) -
 18.10 No Indexing Application (Option 1) -
 18.11 Other -
19 Troubleshooting -
- - - - - - -

List of Tables

- - - - - -

- - -

-

Glossary

-

This glossary style was setup using:

-
\usepackage[xindy, -
-

nonumberlist,
-

toc,
-

nopostdot,
-

style=altlist,
-

nogroupskip]{glossaries}
-

-

-

-bib2gls

-


An indexing application that combines two functions in one: (1) fetches entry definition from a bib - file based on information provided in the aux file (similar to bibtex); (2) hierarchically sorts and - collates location lists (similar to makeindex and xindy). This application is designed for use with - glossaries-extra and can’t be used with just the base glossaries package. See Option 4.
-

-

-Command Line Interface (CLI)

-


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 a command prompt or terminal.
-

-

-convertgls2bib

-


An application provided with bib2gls that converts tex files containing entry definitions to bib - files suitable for use with 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 “undefined - command” warnings as convertgls2bib only has a limited set of known commands. You can limit - it so that it only parses the preamble with the --preamble-only switch (requires at least bib2gls - v2.0).
-

-

-Entry location

-


The location of the entry in the document. This defaults to the page number on which the entry - appears. An entry may have multiple locations.
-

-

-Extended Latin Alphabet

-


An alphabet consisting of Latin characters and extended Latin characters.
-

-

-Extended Latin Character

-


A character that’s created by combining Latin characters to form ligatures (e.g. æ) or by applying - diacritical marks to a Latin character or characters (e.g. á). See also non-Latin character.
-

-

-First use

-


The first time a glossary entry is used (from the start of the document or after a reset) with one - of the following commands: \gls, \Gls, \GLS, \glspl, \Glspl, \GLSpl or \glsdisp. (See first use - flag & first use text.)
-

-

-First use flag

-


A conditional that determines whether or not the entry has been used according to the rules of - first use. Commands to unset or reset this conditional are described in §7 Unsetting - and Resetting Entry Flags.
- - -

-

-First use text

-


The text that is displayed on first use, which is governed by the first and firstplural keys of - \newglossaryentry. (May be overridden by \glsdisp or by \defglsentry.)
-

-

-glossaries-extra

-


A separate package that extends the glossaries package, providing new features or improving existing - features. If you want to use glossaries-extra, you must have both the glossaries package and the - glossaries-extra package installed.
-

-

-Indexing application

-


An application (piece of software) separate from TeX/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 glossary entry. There are two main indexing applications that are used with - TeX: makeindex and xindy. These are both command line interface (CLI) applications.
-

-

-Latin Alphabet

-


The alphabet consisting of Latin characters. See also extended Latin alphabet.
-

-

-Latin Character

-


One of the letters a, …, z, A, …, Z. See also extended Latin character.
-

-

-Link text

- - -


The text produced by commands such as \gls. It may or may not be a hyperlink to the glossary. -
-

-

-makeglossaries

-


A custom designed Perl script interface to xindy and makeindex provided with the glossaries - package. TeX distributions on Windows convert the original makeglossaries script into an - executable makeglossaries.exe for convenience (but Perl is still required).
-

-

-makeglossariesgui

-


A Java GUI alternative to makeglossaries that also provides diagnostic tools. Available separately - on CTAN.
-

-

-makeglossaries-lite

-


A custom designed Lua script interface to xindy and makeindex provided with the glossaries - package. This is a cut-down alternative to the Perl makeglossaries script. If you have Perl - installed, use the Perl script instead. This script is actually distributed with the file name - makeglossaries-lite.lua, but TeX Live (on Unix-like systems) creates a symbolic link called - makeglossaries-lite (without the .lua extension) to the actual makeglossaries-lite.lua - script.
-

-

-makeindex

-


An indexing application. See Option 2.
-

-

-Non-Latin Alphabet

- - -


An alphabet consisting of non-Latin characters.
-

-

-Non-Latin Character

-


An extended Latin character or a character that isn’t a Latin character.
-

-

-Number list

-


A list of entry locations (also called a location list). The number list can be suppressed using the - nonumberlist package option.
-

-

-Sanitize

-


Converts command names into character sequences. That is, a command called, say, \foo, is - converted into the sequence of characters: \, f, o, o. Depending on the font, the backslash character - may appear as a dash when used in the main document text, so \foo will appear as: —foo. -

Earlier versions of 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 sort - key.
-

-

-Small caps

-


Small capitals. The LaTeX kernel provides \textsc{text} to produce small capitals. This uses - a font where lowercase letters have a small capital design. Uppercase letters have the standard - height and there’s no noticeable difference with uppercase characters in corresponding non-small - caps fonts. This means that for a small caps appearance, you need to use lowercase letters in the - ⟨text⟩ argument. The package provides \textsmaller{text} which simulates small caps by reducing - the size of the font, so in this case the contents of ⟨text⟩ should be uppercase (otherwise the effect - is simply smaller 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.
- - -

-

-Standard LaTeX Extended Latin Character

-


An extended Latin character that can be created by a core LaTeX command, such as \o (ø) or - \’e (é). That is, the character can be produced without the need to load a particular package.
-

-

-UTF-8

-


A variable-width character encoding. 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 causes complications. Related blog article: - Binary Files, Text Files and File Encodings.
-

-

-xindy

-


A flexible indexing application with multilingual support written in Perl. See Option 3.

- - -

1. Introduction

-

The glossaries package is provided to assist generating lists of terms, symbols or abbreviations. (For -convenience, these lists are all referred to as glossaries in this manual. The terms, symbols and abbreviations are -collectively referred to as entries.) The package has a certain amount of flexibility, allowing the user -to customize the format of the glossary and define multiple glossaries. It also supports glossary -styles that include an associated symbol (in addition to a name and description) for each glossary -entry. -

There is provision for loading a database of glossary entries. Only those entries -indexed1.1 in -the document will be displayed in the glossary. (Unless you use Option 5, which doesn’t use any indexing but -will instead list all defined entries in order of definition.) -

It’s not necessary to actually have a glossary in the document. You may be interested in using this package -just as means to consistently format certain types of terms, such as abbreviations, or you may prefer to have -descriptions scattered about the document and be able to easily link to the relevant description -(Option 6). -

The simplest document is one without a glossary: - - -

-
-\documentclass{article}
-\usepackage[
-  sort=none % no sorting or indexing required
+
+
+
+                  
+ + +
+

List of Examples

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +

+ +
+
I. User Guide
+

+ +

+ +
+

1. Introduction

+

+

+\usepackage[options]{glossaries}
+

+The glossaries package is provided to assist generating lists of terms, symbols or acronyms. For convenience, these lists are all referred to as glossaries in this manual. The terms, symbols and acronyms are collectively referred to as glossary entries.

+The package has a certain amount of flexibility, allowing the user to customize the format of the glossary and define multiple glossaries. It also supports glossary styles that include an associated symbol (in addition to a name and description) for each glossary entry.

+There is provision for loading a database of glossary entries. Only those entries indexed in the document will be displayed in the glossary. (Unless you use Option 5, which doesn’t use any indexing but will instead list all defined entries in order of definition.)

+It’s not necessary to actually have a glossary in the document. You may be interested in using this package just as means to consistently format certain types of terms, such as acronyms, or you may prefer to have descriptions scattered about the document and be able to easily link to the relevant description (Option 6).

+The simplest document is one without a glossary:

\documentclass{article}
+\usepackage[
+  sort=none % no sorting or indexing required
 ]
 {glossaries}
-\newglossaryentry
- {cafe}% label
- {% definition:
-   name={caf\'e},
-   description={small restaurant selling refreshments}
- }
-\setacronymstyle{long-short}
-\newacronym
- {html}% label
- {HTML}% short form
- {hypertext markup language}% long form
-\newglossaryentry
- {pi}% label
- {% definition:
-   name={\ensuremath{\pi}},
-   description={Archimedes' Constant}
- }
-\newglossaryentry
- {distance}% label
- {% definition:
-   name={distance},
-   description={the length between two points},
-   symbol={m}
- }
-\begin{document}
-First use: \gls{cafe}, \gls{html}, \gls{pi}.
-Next use: \gls{cafe}, \gls{html}, \gls{pi}.
-\Gls{distance} (\glsentrydesc{distance}) is measured in
-\glssymbol{distance}.
-\end{document}
-
-

(This is a trivial example. For a real document I recommend you use siunitx for units.) -


glossaries-extraThe glossaries-extra package, which is distributed as a separate bundle, extends the capabilities -of the glossaries package. The simplest document with a glossary can be created with glossaries-extra (which - - -internally loads the glossaries package): - - -

-
-\documentclass{article}
-
-

-
-\usepackage[ -
 sort=none,% no sorting or indexing required -
 abbreviations,% create list of abbreviations -
 symbols,% create list of symbols -
 postdot, % append a full stop after the descriptions -
 stylemods,style=index % set the default glossary style -
]{glossaries-extra} -
-
- - -
-\newglossaryentry % provided by glossaries.sty
- {cafe}% label
- {% definition:
-   name={caf\'e},
-   description={small restaurant selling refreshments}
- }
-
-

-
-% provided by glossaries-extra.sty: -
\setabbreviationstyle{long-short} -
-
\newabbreviation % provided by glossaries-extra.sty -
 {html}% label -
 {HTML}% short form -
 {hypertext markup language}% long form -
-
% provided by glossaries-extra.sty 'symbols' option: -
\glsxtrnewsymbol -
 [description={Archimedes' constant}]% options -
 {pi}% label -
 {\ensuremath{\pi}}% symbol -
-
- - -
-\newglossaryentry % provided by glossaries.sty
- {distance}% label
- {% definition:
-   name={distance},
-   description={the length between two points},
-   symbol={m}
- }
-\begin{document}
-First use: \gls{cafe}, \gls{html}, \gls{pi}.
-Next use: \gls{cafe}, \gls{html}, \gls{pi}.
-\Gls{distance} is measured in \glssymbol{distance}.
-
-

-
-\printunsrtglossaries % list all defined entries -
\end{document} -
-
Note the difference in the way the abbreviation (HTML) and symbol (π) are defined in the two above -examples. The abbreviations, postdot and stylemods options are specific to glossaries-extra. Other options are -passed to the base glossaries package. -

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

-

One of the strengths of the 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 guide for beginners. -

There’s a common misconception that you have to have Perl installed in order to use the glossaries -package. Perl is not a requirement (as demonstrated by the above examples) but it does increase the -available options, particularly if you use an extended Latin alphabet or a non-Latin alphabet. -
-

-

This document uses the glossaries package. For example, when viewing the PDF version of this document in -a hyperlinked-enabled PDF viewer (such as Adobe Reader or Okular) if you click on the word “xindy” you’ll be -taken to the entry in the glossary where there’s a brief description of the term “xindy”. This is the way the -glossaries mechanism works. An indexing application is used to generate the sorted list of terms. The indexing -applications are command line interface (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 arara to -run them. -

Neither of the above two examples require an indexing application. The first is just using the glossaries -package for consistent formatting, and there is no list. The second has lists but they are unsorted (see -Option 5). -

The remainder of this introductory section covers the following:

- -

There are some sample documents provided with this package. They are described in §18 Sample -Documents. -

-

Top

1.1 Rollback

-

There is one rollback release: v4.46 (2020-03-19) for glossaries.sty and glossary-list.sty. The other associated -packages haven’t been changed since that release (apart from the version numbers, which are always updated for -each new release, regardless of whether or not the file has otherwise been changed). If you rollback to v4.46 -using: - - -

-
-\usepackage{glossaries}[=v4.46]
-
-

then the 4.46 version of glossary-list.sty will automatically be loaded. If you use nostyles and subsequently load -glossary-list you will also need to add the rollback version: - - -

-
-\usepackage[nostyles]{glossaries}[=v4.46]
-\usepackage{glossary-list}[=v4.46]
-
-

If you rollback using latexrelease to an earlier date, then you will need to specify v4.46 for glossaries as there are -no earlier rollback versions available. -

-

-

Top

1.2 Indexing Options

-

The basic idea behind the glossaries package is that you first define your entries (terms, symbols or -abbreviations). Then you can reference these within your document (like \cite or \ref). You can also, -optionally, display a list of the entries you have referenced in your document (the glossary). This last part, -displaying the glossary, is the part that most new users find difficult. There are three options available with the -base glossaries package (Options 13). The glossaries-extra extension package provides two extra options for lists -(Options 4 and 5) as well as an option for standalone descriptions within the document body -(Option 6). -

An overview of Options 15 is given in table 1.1. Option 6 is omitted from the table as it doesn’t -produce a list. For a more detailed comparison of the various methods, see the glossaries performance -page. -

If you are developing a class or package that loads glossaries, I recommend that you don’t -force the user into a particular indexing method by adding an unconditional \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 \makeglossaries (such -as \newglossary) and they can’t switch off the indexing whilst working on a draft document. -
-

-

Strictly speaking, Options 5 and 6 aren’t actually indexing options as no indexing is performed. In the -case of Option 5, all defined entries are listed in order of definition. In the case of Option 6, 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 indexing -options. -

-
- - -


- - -
Table 1.1: Glossary Options: Pros and Cons
- - -
- - - - - - - - - - - - - - - - -

Option 1 Option 2 Option 3 Option 4 Option 5

Requires -glossaries-extra?

Requires -an -external -application?

Requires -Perl?

Requires -Java?

Can -sort -extended -Latin -alphabets -or -non-Latin -alphabets?

* N/A

Efficient -sort -algorithm?

N/A

Can -use -a -different -sort -method -for -each -glossary?

N/A

Any -problematic -sort -values?

Are -entries -with -identical -sort -values -treated -as -separate -unique -entries?

§

Can -automatically -form -ranges -in -the -location -lists?

Can -have -non-standard -locations -in -the -location -lists?

Maximum -hierarchical -depth -(style-dependent)

# 3

\glsdisplaynumberlist -reliable?

\newglossaryentry -allowed -in -document -environment? -(Not -recommended.)

Requires -additional -write -registers?

Default -value -of -sanitizesort -package -option

false true true true true
- -
-

______________________________________________________________________________________ -

* Strips standard LaTeX accents (that is, accents generated by core LaTeX commands) so, for example, \AA is treated the -same as A. -

Only with the hybrid method provided with glossaries-extra. -

Provided sort=none is used. -

§ Entries with the same sort value are merged. -

Requires some setting up. -

The locations must be set explicitly through the custom location field provided by glossaries-extra. -

# Unlimited but unreliable. -

Entries are defined in bib format. \newglossaryentry should not be used explicitly. -

Provided docdef=true or docdef=restricted but not recommended. -

Provided docdef=false or docdef=restricted. -

Irrelevant with sort=none. (The record=only option automatically switches this on.) - - -

-

-
- -

🔗Option 1 (TeX)

-

This option isn’t generally recommended for reasons given below. Example Document: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-
-

-
-\makenoidxglossaries % use TeX to sort -
-
- - -
-\newglossaryentry{sample}{name={sample},
-  description={an example}}
-\begin{document}
-\gls{sample}.
-
-

-
-\printnoidxglossary -
\end{document} -
-
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries -(after \makenoidxglossaries). -

This option doesn’t require an external indexing application but, with the default alphabetic sorting, it’s -very slow with severe limitations. If you want a sorted list, it doesn’t work well for extended Latin alphabets or -non-Latin alphabets and there’s no guarantee that it will work with UTF-8. However, if you use -the sanitizesort=false package option (the default for Option 1) then the standard LaTeX accent -commands will be ignored, so if an entry’s name is set to {\’e}lite then the sort value will default to -elite if sanitizesort=false is used and will default to \’elite if sanitizesort=true is used. If you -have any other kinds of commands that don’t expand to ASCII characters, such as \alpha or -\si, then you must use sanitizesort=true or change the sort method (sort=use or sort=def) in the -package options or explicitly set the sort key when you define the relevant entries. For example: -

-
-\newglossaryentry{alpha}{name={\ensuremath{\alpha}}, -
 sort={alpha},description={...}} -
-
-

The glossaries-extra package has a modified symbols package option that provides \glsxtrnewsymbol, which -automatically sets the sort key to the entry label (instead of the name).
-

-

This option works best with the sort=def or sort=use setting. For any other setting, be prepared for a long -document build time, especially if you have a lot of entries defined. This option is intended as a last resort for -alphabetical sorting. This option allows a mixture of sort methods. (For example, sorting by word order for one -glossary and order of use for another.) This option is not suitable for hierarchical glossaries and does not form -ranges in the number lists. If you really can’t use an indexing application consider using Option 5 -instead. -

Summary: - - -

    -
  1. -

    Add - - -

    -
    -     \makenoidxglossaries
    -
    -

    to your preamble (before you start defining your entries, as described in §4 Defining - Glossary Entries). -

  2. -
  3. -

    Put - - -

    -
    -     \printnoidxglossary
    -
    -

    where you want your list of entries to appear (described in §8 Displaying a Glossary). - Alternatively, to display all glossaries use the iterative command: - - -

    -
    -     \printnoidxglossaries
    -
    -

    -

  4. -
  5. -

    Run LaTeX twice on your document. (As you would do to make a table of contents appear.) For example, - click twice on the “typeset” or “build” or “PDFLaTeX” button in your editor.

- -

-

-

🔗Option 2 (makeindex)

-

Example document: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-
-

-
-\makeglossaries % open glossary files -
-
- - -
-\newglossaryentry{sample}{name={sample},
- description={an example}}
-\begin{document}
-\gls{sample}.
-
-

-
-\printglossary -
\end{document} -
-
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries -(after \makeglossaries). -

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

This option works best if you want to sort entries according to the English alphabet and you don’t want to -install Perl or Java. This method can also work with the restricted shell escape since makeindex is considered a -trusted application. (So you should be able to use the automake package option provided the shell escape hasn’t -been completely disabled.) -

This method can form ranges in the number list but only accepts limited number formats: \arabic, \roman, -\Roman, \alph and \Alph. -

This option does not allow a mixture of sort methods. All glossaries must be sorted according to the same -method: word/letter ordering or order of use or order of definition. If you need word ordering for one -glossary and letter ordering for another you’ll have to explicitly call makeindex for each glossary -type. -

The glossaries-extra package allows a hybrid mix of Options 1 and 2 to provide word/letter ordering with -Option 2 and order of use/definition with Option 1. See the glossaries-extra documentation for further -details. See also the glossaries-extra alternative to sampleSort.tex in §18.5 Sorting. -
-

-

Summary: -

    -
  1. -

    If you want to use makeindex’s -g option you must change the quote character using \GlsSetQuote. For - example: - - -

    -
    -     \GlsSetQuote{+}
    -
    -

    This must be used before \makeglossaries. Note that if you are using babel, the shorthands aren’t - enabled until the start of the document, so you won’t be able to use the shorthands in definitions made in - the preamble. -

  2. -
  3. -

    Add - - -

    -
    -     \makeglossaries
    -
    -

    to your preamble (before you start defining your entries, as described in §4 Defining - Glossary Entries). -

  4. -
  5. -

    Put - - -

    -
    -     \printglossary
    -
    -

    where you want your list of entries to appear (described in §8 Displaying a Glossary). - Alternatively, to display all glossaries use the iterative command: - - -

    -
    -     \printglossaries
    -
    -

    -

  6. -
  7. -

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

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

  8. -
  9. -

    🔗 Run makeindex with the .glo file as the input file and the .ist file as the style so that it creates an - output file with the extension .gls. If you have access to a terminal or a command prompt (for example, - the MSDOS command prompt for Windows users or the bash console for Unix-like users) then you need to - run the command: -

    
    -     
    makeindex -s myDoc.ist -o myDoc.gls myDoc.glo -
    -
    - (Replace myDoc with the base name of your LaTeX document file. Avoid spaces in the file name if - possible. The $ symbol indicates the command prompt and should be omitted.) -

    The file extensions vary according to the glossary type. See §1.5.4 Using makeindex - explicitly (Option 2) for further details. makeindex must be called for each set of files.
    -

    -

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

    Alternatively, run makeindex indirectly via the makeglossaries script: -

    
    -                                                                                      
    -                                                                                      
    -     
    makeglossaries myDoc -
    -
    - Note that the file extension isn’t supplied in this case. (Replace makeglossaries with - makeglossaries-lite if you don’t have Perl installed.) This will pick up all the file extensions - from the aux file and run makeindex the appropriate number of times with all the necessary - switches. -

    The simplest approach is to use arara and add the following comment lines to the start of your document: -

    -
    - % arara: pdflatex -
    % arara: makeglossaries -
    % arara: pdflatex -
    -
    (Replace makeglossaries with makeglossarieslite in the second line above if you don’t have Perl - installed. Note that there’s no hyphen in this case.) -

    The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to - add the -l switch: -

    
    -     
    makeindex -l -s myDoc.ist -o myDoc.gls myDoc.glo -
    -
    - (See §1.5.4 Using makeindex explicitly (Option 2) for further details on using makeindex - explicitly.) If you use makeglossaries or makeglossaries-lite then use the order=letter package option - and the -l option will be added automatically. -

  10. -
  11. -

    🔗 Once you have successfully completed the previous step, you can now run LaTeX on your document - again.

-

You’ll need to repeat the last step if you have used the toc option (unless you’re using glossaries-extra) to ensure the -section heading is added to the table of contents. You’ll also need to repeat steps 5 and 6 if you have any -cross-references which can’t be indexed until the glossary file has been created. - - - -

-

-

🔗Option 3 (xindy)

-

Example document:

-
-\documentclass{article} -
\usepackage[xindy]{glossaries} -
\makeglossaries % open glossary files -
-
- - -
-\newglossaryentry{sample}{name={sample},
- description={an example}}
-\begin{document}
-\gls{sample}.
-
-

-
-\printglossary -
\end{document} -
-
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries -(after \makeglossaries). -

This option uses a CLI application called xindy to sort the entries. This application is more flexible than -makeindex and is able to sort extended Latin alphabets or non-Latin alphabets, however it does still have some -limitations. -

The xindy application comes with both TeX Live and MiKTeX, but since xindy is a Perl script, you will -also need to install Perl, if you don’t already have it. In a similar way to Option 2, this option involves making -LaTeX write the glossary information to a temporary file which xindy reads. Then xindy writes a new file -containing the code to typeset the glossary. Then \printglossary reads this file in on the next -run. -

This is the best option with just the base glossaries package if you want to sort according to -a language other than English or if you want non-standard location lists, but it can require some -setting up (see §14 Xindy (Option 3)). There are some problems with certain sort values: -

-
    -
  • -

    entries with the same sort value are merged by xindy into a single glossary line so you must make - sure that each entry has a unique sort value; -

  • -
  • -

    xindy forbids empty sort values; -

  • -
  • -

    xindy automatically strips control sequences, the math-shift character $ and braces {} from the - sort value, which is usually desired but this can cause the sort value to collapse to an empty string - which xindy forbids.

-

In these problematic cases, you must set the sort field explicitly. For example:

- - -
-\newglossaryentry{alpha}{name={\ensuremath{\alpha}}, -
 sort={alpha},description={...}} -
-
-

The glossaries-extra package has a modified symbols package option that provides \glsxtrnewsymbol, which -automatically sets the sort key to the entry label (instead of the name).
-

-

All glossaries must be sorted according to the same method (word/letter ordering, order of use, or order of -definition). -

The glossaries-extra package allows a hybrid mix of Options 1 and 3 to provide word/letter ordering with -Option 3 and order of use/definition with Option 1. See the glossaries-extra documentation for further details. -
-

-

Summary: -

    -
  1. -

    Add the xindy option to the glossaries package option list: - - -

    -
    -     \usepackage[xindy]{glossaries}
    -
    -

    If you are using a non-Latin script you’ll also need to either switch off the creation of the number - group: - - -

    -
    -     \usepackage[xindy={glsnumbers=false}]{glossaries}
    -
    -

    or use either \GlsSetXdyFirstLetterAfterDigits{letter} (to indicate the first letter group to follow the - digits) or \GlsSetXdyNumberGroupOrder{spec} to indicate where the number group should be placed (see - §14 Xindy (Option 3)). -

  2. -
  3. -

    Add \makeglossaries to your preamble (before you start defining your entries, as described in - §4 Defining Glossary Entries). -

  4. -
  5. -

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

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

  6. -
  7. -

    Run xindy with the .glo file as the input file and the .xdy file as a module so that it creates an output - file with the extension .gls. You also need to set the language name and input encoding. If you have - access to a terminal or a command prompt (for example, the MSDOS command prompt for Windows - users or the bash console for Unix-like users) then you need to run the command (all on one - line): -

    
    -     
    xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo -
    -
    - (Replace myDoc with the base name of your LaTeX document file. Avoid spaces in the file name. If - necessary, also replace english with the name of your language and utf8 with your input encoding, for - example, -L german -C din5007-utf8.) - - -

    The file extensions vary according to the glossary type. See §1.5.3 Using xindy explicitly - (Option 3) for further details. xindy must be called for each set of files.
    -

    -

    It’s much simpler to use makeglossaries instead: -

    
    -     
    makeglossaries myDoc -
    -
    - Note that the file extension isn’t supplied in this case. This will pick up all the file extensions from the aux - file and run xindy the appropriate number of times with all the necessary switches. -

    There’s no benefit in using makeglossaries-lite with xindy. (Remember that xindy is a Perl - script so if you can use xindy then you can also use makeglossaries, and if you don’t want - to use makeglossaries because you don’t want to install Perl, then you can’t use xindy - either.) -

    If you don’t know how to use the command prompt, then you can probably access xindy or - makeglossaries via your text editor, but each editor has a different method of doing this. See - Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build for some - examples. -

    Again, a convenient method is to use arara and add the follow comment lines to the start of your - document:

    -
    - % arara: pdflatex -
    % arara: makeglossaries -
    % arara: pdflatex -
    -
    -

    The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to - add the order=letter package option: - - -

    -
    -     \usepackage[xindy,order=letter]{glossaries}
    -
    -

    (and return to the previous step). This option is picked up by makeglossaries. If you are explicitly using - xindy then you’ll need to add -M ord/letorder to the options list. See §1.5.3 Using xindy - explicitly (Option 3) for further details on using xindy explicitly. -

  8. -
  9. -

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

    -
- -

-

-

🔗Option 4 (bib2gls)

-


glossaries-extraThis option is only available with the glossaries-extra extension package. This method uses -bib2gls to both fetch entry definitions from bib files and to hierarchically sort and collate. -

Example document:

-
-\documentclass{article} -
\usepackage[record=nameref]{glossaries-extra} -
\GlsXtrLoadResources[src={entries}] -
\begin{document} -
\gls{sample}, \gls{alpha}, \gls{html}. -
\printunsrtglossary -
\end{document} -
-
where the file entries.bib contains:
- - -
-@entry{sample, -
  name={sample}, -
  description={an example} -
} -
@symbol{alpha, -
  name={\ensuremath{\alpha}}, -
  description={...} -
} -
@abbreviation{html, -
  short={HTML}, -
  long={hypertext markup language} -
} -
-
-

All entries must be provided in one or more bib files. See the bib2gls user manual for the required -format. -

Note that the sort key should not be used. Each entry type (@entry, @symbol, @abbreviation) -has a particular field that’s used for the sort value by default (name, the label, short). You will -break this mechanism if you explicitly use the sort key. See bib2gls gallery: sorting for examples. -
-

-

The glossaries-extra package needs to be loaded with the record package option:

-
-\usepackage[record]{glossaries-extra} -
-
or (equivalently)
-
-\usepackage[record=only]{glossaries-extra} -
-
or (with at least glossaries-extra v1.37 and bib2gls v1.8):
-
-\usepackage[record=nameref]{glossaries-extra} -
-
The record=nameref option is the best method. -

(It’s possible to use a hybrid of this method and Options 2 or 3 with record=hybrid but in general there is -little need for this and it complicates the build process.) -

Each resource set is loaded with \GlsXtrLoadResources[options]. For example:

- - -
-\GlsXtrLoadResources -
[% definitions in entries1.bib and entries2.bib: -
 src={entries1,entries2}, -
 sort={de-CH-1996}% sort according to this locale -
] -
-
The bib files are identified as a comma-separated list in the value of the src key. The sort option identifies the -sorting method. This may be a locale identifier for alphabetic sorting, but there are other sort methods -available, such as character code or numeric. One resource set may cover multiple glossaries or one glossary may -be split across multiple resource sets, forming logical sub-blocks. -

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

The glossary is displayed using:

-
-\printunsrtglossary -
-
Alternatively all glossaries can be displayed using the iterative command:
-
-\printunsrtglossaries -
-
The document is built using: -


-   
pdflatex myDoc -
bib2gls myDoc -
pdflatex myDoc -
-
-If letter groups are required, you need the --group switch: -


-   
bib2gls --group myDoc -
-
-or with arara:

-
-% arara: bib2gls: { group: on } - - -
-
(You will also need an appropriate glossary style.) -

Unlike Options 2 and 3, this method doesn’t create a file containing the typeset glossary but simply -determines which entries are needed for the document, their associated locations and (if required) their -associated letter group. This option allows a mixture of sort methods. For example, sorting by word order for -one glossary and order of use for another or even sorting one block of the glossary differently to another block in -the same glossary. See bib2gls gallery: sorting. -

This method supports Unicode and uses the Common Locale Data Repository, which provides more extensive language support -than xindy.1.2 The -locations in the number list may be in any format. If bib2gls can deduce a numerical value it will attempt to -form ranges otherwise it will simply list the locations. -

Summary: -

    -
  1. -

    Use glossaries-extra with the p=recordackage option: - - -

    -
    -     \usepackage[record]{glossaries-extra}
    -
    -

    -

  2. -
  3. -

    Use \*GlsXtrLoadResources to identify the bib file(s) and bib2gls options: - - -

    -
    -     \GlsXtrLoadResources[src={terms.bib,abbreviations.bib},sort=en]
    -
    -

    -

  4. -
  5. -

    Put

    -
    - \*printunsrtglossary -
    -
    where you want your list of entries to appear. Alternatively to display all glossaries use the iterative - command:
    -
    - \*printunsrtglossaries -
    -
    -
  6. -
  7. -

    Run LaTeX on your document. -

  8. -
  9. -

    Run bib2gls with just the document base name. -

  10. -
  11. -

    Run LaTeX on your document. -

    -
- - -

See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further details of -this method, and also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document -build. - -

-

-

🔗Option 5 (no sorting)

-


glossaries-extraThis option is only available with the extension package glossaries-extra. No indexing application -is required. -

Example document: - - -

-
-\documentclass{article}
-\usepackage[sort=none]{glossaries-extra}
-\newglossaryentry{sample}{name={sample},
- description={an example}}
-\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
- description={...}}
-\begin{document}
-\gls{sample}.
-
-

-
-\printunsrtglossary -
\end{document} -
-
-

This method is best used with the package option sort=none (as shown above). There’s no “activation” -command (such as \makeglossaries for Options 2 and 3). In general it’s best to use a style that doesn’t show -letter group headings. If you do want letter headings then you must ensure that you have defined -your entries in alphabetical order, and use XeLaTeX or LuaLaTeX if you require UTF-8 letter -groups. -

All entries must be defined before the glossary is displayed (preferably in the preamble) in the -required order, and child entries must be defined immediately after their parent entry if they must be -kept together in the glossary. (Some glossary styles indent entries that have a parent but it’s the -indexing application that ensures the child entries are listed immediately after the parent. If you’re -opting to use this manual approach then it’s your responsibility to define the entries in the correct -order.) You can place all your entry definitions in a separate file and load it in the preamble with -\loadglsentries. -

The glossary is displayed using:

-
-\printunsrtglossary -
-
Alternatively all glossaries can be displayed using the iterative command:
-
-\printunsrtglossaries - - -
-
This will display all defined entries, regardless of whether or not they have been used in the document. The -number lists have to be set explicitly otherwise they won’t appear. Note that this uses the same command for -displaying the glossary as Option 4. This is because bib2gls takes advantage of this method by defining the -wanted entries in the required order and setting the locations (and letter group information, if -required). -

Therefore, the above example document has a glossary containing the entries: sample and α (in -that order). Note that the alpha entry has been included even though it wasn’t referenced in the -document. -

This just requires a single LaTeX call: -


-   
pdflatex myDoc -
-
-unless the glossary needs to appear in the table of contents, in which case a second run is required: -


-   
pdflatex myDoc -
pdflatex myDoc -
-
-(Naturally if the document also contains citations, and so on, then additional steps are required. Similarly for all -the other options above.) -

See the glossaries-extra documentation for further details of this method. - -

-

-

🔗Option 6 (standalone)

-


glossaries-extraThis option is only available with the glossaries-extra extension -package.1.3 -Instead of creating a list, this has standalone definitions throughout the document. The entry name may or may -not be in a section heading. -

You can either define entries in the document preamble (or in an external file loaded with \loadglsentries), as -with Option 5, for example: - - -

-
-\documentclass{article}
-\usepackage[colorlinks]{hyperref}
-\usepackage[sort=none,
-   nostyles% <- no glossary styles are required
- ]{glossaries-extra}
-\newglossaryentry{set}{name={set},
-  description={a collection of any kind of objects},
-  symbol={\ensuremath{\mathcal{S}}}
+
+\newglossaryentry
+ {cafe}% label
+ {% definition:
+   name={café},
+   description={small restaurant selling refreshments}
+ }
+
+\setacronymstyle{long-short}
+\newacronym
+ {html}% label
+ {HTML}% short form
+ {hypertext markup language}% long form
+
+\newglossaryentry
+ {pi}% label
+ {% definition:
+   name={\ensuremath{\pi}},
+   description={Archimedes' Constant}
+ }
+
+\newglossaryentry
+ {distance}% label
+ {% definition:
+   name={distance},
+   description={the length between two points},
+   symbol={m}
+ }
+
+\begin{document}
+First use: \gls{cafe}, \gls{html}, \gls{pi}.
+Next use: \gls{cafe}, \gls{html}, \gls{pi}.
+
+\Gls{distance} (\glsentrydesc{distance}) is measured in
+\glssymbol{distance}.
+\end{document}
+
(This is a trivial example. For a real document I recommend you use siunitx for units.)
+Example 1: Simple document with no glossary 📥🖹 📥🖺

+Example document that defines some glossary entries and references them in the text..

+

+

+The glossaries-extra package, which is distributed as a separate bundle, extends the capabilities of the glossaries package. The simplest document with a glossary can be created with glossaries-extra (which internally loads the glossaries package):
\documentclass{article}
+\usepackage[
+ sort=none,% no sorting or indexing required
+ abbreviations,% create list of abbreviations
+ symbols,% create list of symbols
+ postdot, % append a full stop after the descriptions
+ stylemods,style=index % set the default glossary style
+]{glossaries-extra}
+
+\newglossaryentry % glossaries.sty {cafe}% label
+ {% definition:
+   name={café},
+   description={small restaurant selling refreshments}
+ }
+
+\setabbreviationstyle{long-short}% glossaries-extra.sty
+\newabbreviation % glossaries-extra.sty {html}% label
+ {HTML}% short form
+ {hypertext markup language}% long form
+
+% requires glossaries-extra.sty 'symbols' option
+\glsxtrnewsymbol 
+ [description={Archimedes' constant}]% options
+ {pi}% label
+ {\ensuremath{\pi}}% symbol
+
+\newglossaryentry % glossaries.sty {distance}% label
+ {% definition:
+   name={distance},
+   description={the length between two points},
+   symbol={m}
+ }
+
+\begin{document}
+First use: \gls{cafe}, \gls{html}, \gls{pi}.
+Next use: \gls{cafe}, \gls{html}, \gls{pi}.
+
+\Gls{distance} is measured in \glssymbol{distance}.
+\printunsrtglossaries % list all defined entries
+\end{document}
+

+

+Example 2: Simple document with unsorted glossaries 📥🖹 📥🖺

+Example document that defines some glossary entries, references them in the text, and displays three simple unsorted glossaries..

+

+Note the difference in the way the abbreviation (HTML) and symbol (\(𝜋\)) are defined in the two above examples. The abbreviations, postdot and stylemods options are specific to glossaries-extra. Other options are passed to the base glossaries package.

+

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

+One of the strengths of the 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 guide for beginners.

+

+There’s a common misconception that you have to have Perl installed in order to use the glossaries package. Perl is not a requirement (as demonstrated by the above examples) but it does increase the available options, particularly if you use an extended Latin alphabet or a non-Latin alphabet.
+

+This document uses the glossaries-extra package with bib2gls (Option 4). For example, when viewing the PDF version of this document in a hyperlinked-enabled PDF viewer (such as Adobe Reader or Okular) if you click on the word indexing you’ll be taken to the entry in the main glossary where there’s a brief description of the term. This is the way the glossaries mechanism works. An indexing application (bib2gls in this case) is used to generate the sorted list of terms. The indexing applications are 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 arara to run them.

+In addition to standard glossaries, this document has “standalone” definitions (Option 6). For example, if you click on the command \gls, the hyperlink will take you to main part of the document where the command is described. The index and summaries are also glossaries. The technique used is too complicated to describe in this manual, but an example can be found in bib2gls: Standalone entries and repeated lists (a little book of poisons)” TUGboat, Volume 43 (2022), No. 1.

+Neither of the above two examples require an indexing application. The first is just using the glossaries package for consistent formatting, and there is no list. The second has lists but they are unsorted (see Option 5).

+The remainder of this introductory section covers the following: +

    +
  • §1.3 lists the available indexing options.

    +

  • §1.4 lists the files provided that contain dummy glossary entries which may be used for testing.

    +

  • §1.5 provides information for users who wish to write in a language other than English.

    +

  • §1.6 describes how to use an indexing application to create the sorted glossaries for your document (Options 2 or 3).

    + +

+

+In addition to the examples provided in this document, there are some sample documents provided with the glossaries package. They are described in §18.

+The glossaries package comes with a number of sample documents that illustrate the various functions. These are listed in §18.

+ +

+ +
+

1.1. Rollback

+

+The following rollback releases are available:

+ +

    +
  • Version 4.49 (2021-11-01):
    \usepackage{glossaries}[=v4.49]
    +
    Note that this should also rollback mfirstuc to version 2.07 if you have a later version installed.

    +

  • Version 4.46 (2020-03-19):
    \usepackage{glossaries}[=v4.46]
    +

    + +

+

+If you rollback using latexrelease to an earlier date, then you will need to specify v4.46 for glossaries as there are no earlier rollback versions available. You may want to consider using one of the historic TeX Live Docker images instead. See, for example, Legacy Documents and TeX Live Docker Images.

+ +

+ +
+

1.2. Integrating Other Packages and Known Issues

+

+If you use hyperref and glossaries, you must load hyperref first (although, in general, hyperref should be loaded after other packages).

+Occasionally you may find that certain packages need to be loaded after packages that are required by glossaries but need to also be loaded before glossaries. For example, a package X might need to be loaded after amsgen but before hyperref (which needs to be loaded before glossaries). In which case, load the required package first (for example, amsgen), then X, and finally load glossaries.

\usepackage{amsgen}% load before X
+\usepackage{X}% must be loaded after amsgen
+\usepackage{hyperref}% load after X
+\usepackage{glossaries}% load after hyperref
+

+Some packages don’t work with some glossary styles. For example, classicthesis doesn’t work with the styles that use the description environment, such as the list style. Since this is the default style, the glossaries package checks for classicthesis and will change the default to the index style if it has been loaded.

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

+The language-support is implemented using tracklang. This needs to know the document languages that have to be supported. It currently (version 1.6 at the time of writing) can’t detect the use of \babelprovide. The tracklang package is able to pick up known language labels from the document class options, for example:

\documentclass[german]{article}
+\usepackage[translate=true]{glossaries}
+
The above doesn’t load babel or polyglossia or translator, but the translate=true setting will ensure that tracklang is loaded and the language-sensitive command provided by glossaries will use the definitions in glossaries-german.ldf (which needs to be installed separately, see §1.5) because tracklang can pick up the german document class option.

+The tracklang package is also able to pick up languages passed as package options to babel or translator, provided they were loaded before tracklang. For example,

\usepackage[french]{babel}
+\usepackage[translate=babel]{glossaries}
+
The tracklang package used to be able to detect languages identified by polyglossia’s \setmainlanguage and \setotherlanguage, but tracklang v1.5 can’t with newer versions of polyglossia. You will need to upgrade to tracklang v1.6+ to allow this to work again.

+In the event that tracklang can’t pick up the required languages, it’s also possible to identify them with the languages option. For example:

\usepackage[nil]{babel}
+\babelprovide{french}
+\usepackage[languages=french]{glossaries}
+

+ +

+ +
+

1.3. Indexing Options

+

+The basic idea behind the glossaries package is that you first define your entries (terms, symbols or acronyms). Then you can reference these within your document (analogous to \cite or \ref). You can also, optionally, display a list of the entries you have referenced in your document (the glossary). This last part, displaying the glossary, is the part that most new users find difficult. There are three options available with the base glossaries package (Options 13). The glossaries-extra extension package provides two extra options for lists (Options 4 and 5) as well as an option for standalone descriptions within the document body (Option 6).

+An overview of Options 15 is given in Table 1.1. Option 6 is omitted from the table as it doesn’t produce a list. For a more detailed comparison of the various methods, see the glossaries performance page. If, for some reason, you want to know what indexing option is in effect, you can test the value of:

+\glsindexingsetting
+ This is initialised to:
\ifglsxindy xindy\else makeindex\fi
+
If the sort=none or sort=clear options are used, \glsindexingsetting will be redefined to none. If \makeglossaries is used \glsindexingsetting will be updated to either makeindex or xindy as appropriate (that is, the conditional will no longer be part of the definition). If \makenoidxglossaries is used then \glsindexingsetting will be updated to noidx. This means that \glsindexingsetting can’t be fully relied on until the start of the document environment. (If you are using glossaries-extra v1.49+, then this command will also be updated to take the record setting into account.)

+

+If you are developing a class or package that loads glossaries, I recommend that you don’t force the user into a particular indexing method by adding an unconditional \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 \makeglossaries (such as \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 disablemakegloss option to glossaries. For example, via the document class options.)
+

+Strictly speaking, Options 5 and 6 aren’t actually indexing options as no indexing is performed. In the case of Option 5, all defined entries are listed in order of definition. In the case of Option 6, 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 indexing options.

+

Table 1: Glossary Options: Pros and Cons
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Option 1 2 3 4 5
Requires glossaries-extra?
Requires an external application?
Requires Perl?
Requires Java?
Can sort extended Latin alphabets or non-Latin alphabets? N/A
Efficient sort algorithm? N/A
Can use a different sort method for each glossary? N/A
Any problematic sort values?
Are entries with identical sort values treated as separate unique entries? §
Can automatically form ranges in the location lists?
Can have non-standard locations in the location lists?
Maximum hierarchical depth (style-dependent) # 3
\glsdisplaynumberlist reliable?
\newglossaryentry allowed in document environment? (Not recommended.)
Requires additional write registers?
Default value of sanitizesort package option false true true true true
+

+

Strips standard LaTeX accents (that is, accents generated by core LaTeX commands) so, for example, \AA is treated the same as A.
+
Only with the hybrid method provided with glossaries-extra.
+
Provided sort=none is used.
+
§Entries with the same sort value are merged.
+
Requires some setting up.
+
The locations must be set explicitly through the custom location field provided by glossaries-extra.
+
#Unlimited but unreliable.
+
Entries are defined in bib format. \newglossaryentry should not be used explicitly.
+
Provided docdef=true or docdef=restricted but not recommended.
+
Provided docdef=false or docdef=restricted.
+
Irrelevant with sort=none. (The record=only option automatically switches this on.)
+
+

+ +

+ +
+

1.3.1. Option 1 (“noidx”)

+

+This option isn’t generally recommended for reasons given below. It’s best used with sort=use (order of use) or sort=def (order of definition). Example Document:

\documentclass{article}
+\usepackage[style=indexgroup]{glossaries}
+\makenoidxglossaries % use TeX to sort
+\newglossaryentry{parrot}{name={parrot}, 
+  description={a brightly coloured tropical bird}}
+\newglossaryentry{duck}{name={duck}, 
+  description={a waterbird}}
+\newglossaryentry{puffin}{name={puffin},
+  description={a seabird with a brightly coloured bill}}
+\newglossaryentry{penguin}{name={penguin}, 
+  description={a flightless black and white seabird}}
+% a symbol:
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ sort={alpha},description={a variable}}
+% an acronym:
+\setacronymstyle{short-long}
+\newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network}
+\begin{document}
+\Gls{puffin}, \gls{duck} and \gls{parrot}.
+\gls{arpanet} and \gls{alpha}.
+Next use: \gls{arpanet}.
+\printnoidxglossary
+\end{document}
+
You can place all your entry definitions in a separate file and load it in the document preamble with \loadglsentries (after \makenoidxglossaries). Note that six entries have been defined but only five are referenced (indexed) in the document so only those five appear in the glossary.
+Example 3: Simple document that uses TeX to sort entries 📥🖹 📥🖺

+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.

+ This uses the indexgroup style, which puts a heading at the start of each letter group. The letter group is determined by the first character of the sort value. For a preview of all available styles, see Gallery: Predefined Styles. The number 1 after each description is the number list (or location list). 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.

+This option doesn’t require an external indexing application but, with the default alphabetic sorting, it’s very slow with severe limitations. If you want a sorted list, it doesn’t work well for extended Latin alphabets or non-Latin alphabets. However, if you use the sanitizesort=false package option (the default for Option 1) then the standard LaTeX accent commands will be ignored, so if an entry’s name is set to \'elite then the sort value will default to elite if sanitizesort=false is used and will default to the literal string \’elite if sanitizesort=true is used.

+

+Previously, it was also possible to strip accents from UTF-8 characters, but that’s not possible following updates to the LaTeX kernel. The kernel updates are beneficial as they make it possible to use UTF-8 characters in labels, but the trick of stripping accents was a hack that no longer works.
+

+If you have any other kinds of commands that don’t expand to ASCII characters, such as \alpha, then you must use sanitizesort=true or change the sort method (sort=use or sort=def) in the package options or explicitly set the sort key when you define the relevant entries, as shown in the above example which has:

\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ sort={alpha},description={a variable}
+}
+

+

+ The glossaries-extra package has a modified symbols package option that provides \glsxtrnewsymbol, which automatically sets the sort key to the entry label (instead of the name).
+

+This option works best with the sort=def or sort=use setting. For any other setting, be prepared for a long document build time, especially if you have a lot of entries defined. This option is intended as a last resort for alphabetical sorting. This option allows a mixture of sort methods. (For example, sorting by word order for one glossary and order of use for another.) This option is not suitable for hierarchical glossaries and does not form ranges in the location lists. If you really can’t use an indexing application consider using Option 5 instead.

+Summary: +

    +
  1. 1.Add
    \makenoidxglossaries
    +
    to your preamble (before you start defining your entries, as described in §4).

    +

  2. 2.Put
    \printnoidxglossary
    +
    where you want your list of entries to appear (described in §8). Alternatively, to display all glossaries use the iterative command:
    \printnoidxglossaries
    +

    +

  3. 3.Run LaTeX twice on your document. (As you would do to make a table of contents appear.) For example, click twice on the “typeset” or “build” or “pdfLaTeX” button in your editor. +
+

+ +

+ +
+

1.3.2. Option 2 (makeindex)

+

+Example document:

\documentclass{article}
+\usepackage[style=indexgroup]{glossaries}
+\makeglossaries % open indexing files
+\newglossaryentry{parrot}{name={parrot}, 
+  description={a brightly coloured tropical bird}}
+\newglossaryentry{duck}{name={duck}, 
+  description={a waterbird}}
+\newglossaryentry{puffin}{name={puffin},
+  description={a seabird with a brightly coloured bill}}
+\newglossaryentry{penguin}{name={penguin}, 
+  description={a flightless black and white seabird}}
+% a symbol:
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ sort={alpha},description={a variable}}
+% an acronym:
+\setacronymstyle{short-long}
+\newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network}
+\begin{document}
+\Gls{puffin}, \gls{duck} and \gls{parrot}.
+\gls{arpanet} and \gls{alpha}.
+Next use: \gls{arpanet}.
+\printglossary
+\end{document}
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries (after \makeglossaries). The result is the same as for Example 3.
+Example 4: Simple document that uses makeindex to sort entries 📥🖹 📥🖺

+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.

+

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

+

+There are other applications that can read makeindex files, such as texindy and xindex, but the glossaries package uses a customized ist style file (created by \makeglossaries) that adjusts the special characters and input keyword and also ensures that the resulting file (which is input by \printglossary) adheres to the glossary style. If you want to use an alternative, you will need to ensure that it can honour the settings in the ist file.
+

+This option works best if you want to sort entries according to the English alphabet and you don’t want to install Perl or Java. This method can also work with the restricted shell escape since makeindex is considered a trusted application, which means you should be able to use the automake=immediate or automake=true package option provided the shell escape hasn’t been completely disabled.

+This method can form ranges in the number list but only accepts limited number formats: \arabic, \roman, \Roman, \alph and \Alph.

+This option does not allow a mixture of sort methods. All glossaries must be sorted according to the same method: word/letter ordering or order of use or order of definition. If you need word ordering for one glossary and letter ordering for another you’ll have to explicitly call makeindex for each glossary type.

+

+ The glossaries-extra package allows a hybrid mix of Options 1 and 2 to provide word/letter ordering with Option 2 and order of use/definition with Option 1. See the glossaries-extra documentation for further details. See also the glossaries-extra alternative to sampleSort.tex in §18.5.
+

+Summary: +

    +
  1. 1.If you want to use makeindex’s -g option you must change the quote character using \GlsSetQuote. For example:
    \GlsSetQuote{+}
    +
    This must be used before \makeglossaries. Note that if you are using babel, the shorthands aren’t enabled until the start of the document, so you won’t be able to use the shorthands in definitions that occur in the preamble.

    +

  2. 2.Add
    \makeglossaries
    +
    to your preamble (before you start defining your entries, as described in §4).

    +

  3. 3.Put
    \printglossary
    +
    where you want your list of entries to appear (described in §8). Alternatively, to display all glossaries use the iterative command:
    \printglossaries
    +

    +

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

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

    +

  5. 5. Run makeindex with the glo file as the input file and the ist file as the style so that it creates an output file with the extension gls:
    makeindex -s myDoc.ist -o myDoc.gls myDoc.glo
    +
    (Replace myDoc with the base name of your LaTeX document file. Avoid spaces in the file name if possible.)

    +

    +The file extensions vary according to the glossary type. See §1.6.4 for further details. makeindex must be called for each set of files.
    +

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

    +Alternatively, run makeindex indirectly via the makeglossaries script:

    makeglossaries myDoc
    +
    Note that the file extension isn’t supplied in this case. (Replace makeglossaries with makeglossaries-lite if you don’t have Perl installed.) This will pick up all the file extensions from the aux file and run makeindex the appropriate number of times with all the necessary switches.

    +The simplest approach is to use arara and add the following comment lines to the start of your document:

    % arara: pdflatex
    +% arara: makeglossaries
    +% arara: pdflatex
    +
    (Replace makeglossaries with makeglossarieslite in the second line above if you don’t have Perl installed. Note that there’s no hyphen in this case.)

    +The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to add the -l switch:

    makeindex -l -s myDoc.ist -o myDoc.gls myDoc.glo
    +
    (See §1.6.4 for further details on using makeindex explicitly.) If you use makeglossaries or makeglossaries-lite then use the order=letter package option and the -l option will be added automatically.

    +

  6. 6. Once you have successfully completed the previous step, you can now run LaTeX on your document again. +
+ You’ll need to repeat the last step if you have used the toc option (unless you’re using glossaries-extra) to ensure the section heading is added to the table of contents. You’ll also need to repeat steps 5 and 6 if you have any cross-references which can’t be indexed until the indexing file has been created.

+ +

+ +
+

1.3.3. Option 3 (xindy)

+

+Example document:

\documentclass{article}
+\usepackage[xindy,style=indexgroup]{glossaries}
+\makeglossaries % open indexing files
+\newglossaryentry{parrot}{name={parrot}, 
+  description={a brightly coloured tropical bird}}
+\newglossaryentry{duck}{name={duck}, 
+  description={a waterbird}}
+\newglossaryentry{puffin}{name={puffin},
+  description={a seabird with a brightly coloured bill}}
+\newglossaryentry{penguin}{name={penguin}, 
+  description={a flightless black and white seabird}}
+% a symbol:
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ sort={alpha},description={a variable}}
+% an acronym:
+\setacronymstyle{short-long}
+\newacronym{arpanet}{ARPANET}{Advanced Research Projects Agency Network}
+\begin{document}
+\Gls{puffin}, \gls{duck} and \gls{parrot}.
+\gls{arpanet} and \gls{alpha}.
+Next use: \gls{arpanet}.
+\printglossary
+\end{document}
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries (after \makeglossaries). The result is the same as for Example 3 and Example 4.
+Example 5: Simple document that uses xindy to sort entries 📥🖹 📥🖺

+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.

+

+This option uses a CLI application called xindy to sort the entries. This application is more flexible than makeindex and is able to sort extended Latin alphabets or non-Latin alphabets, however it does still have some limitations.

+The xindy application comes with both TeX Live and MikTeX, but since xindy is a Perl script, you will also need to install Perl, if you don’t already have it. In a similar way to Option 2, this option involves making LaTeX write the glossary information to a temporary file which xindy reads. Then xindy writes a new file containing the code to typeset the glossary. Then \printglossary reads this file in on the next run.

+This is the best option with just the base glossaries package if you want to sort according to a language other than English or if you want non-standard location lists, but it can require some setting up (see §14). There are some problems with certain sort values: +

    +
  • entries with the same sort value are merged by xindy into a single glossary line so you must make sure that each entry has a unique sort value;
  • xindy forbids empty sort values;
  • xindy automatically strips control sequences, the math-shift character $ and braces {} from the sort value, which is usually desired but this can cause the sort value to collapse to an empty string which xindy forbids. +
+ In these problematic cases, you must set the sort field explicitly, as in the above example which has:
\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ sort={alpha},description={a variable}
+}
+
+ The glossaries-extra package has a modified symbols package option that provides \glsxtrnewsymbol, which automatically sets the sort key to the entry label (instead of the name).
+

+All glossaries must be sorted according to the same method (word/letter ordering, order of use, or order of definition).

+

+ The glossaries-extra package allows a hybrid mix of Options 1 and 3 to provide word/letter ordering with Option 3 and order of use/definition with Option 2. See the glossaries-extra documentation for further details.
+

+Summary: +

    +
  1. 1.Add the xindy option to the glossaries package option list:
    \usepackage[xindy]{glossaries}
    +
    If you are using a non-Latin script you’ll also need to either switch off the creation of the number group:
    \usepackage[xindy={glsnumbers=false}]{glossaries}
    +
    or use either \GlsSetXdyFirstLetterAfterDigits{letter} (to indicate the first letter group to follow the digits) or \GlsSetXdyNumberGroupOrder{spec} to indicate where the number group should be placed (see §14).

    +

  2. 2.Add \makeglossaries to your preamble (before you start defining your entries, as described in §4).

    +

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

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

    +

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

    +

    +The file extensions vary according to the glossary type. See §1.6.3 for further details. xindy must be called for each set of files.
    +

    +It’s much simpler to use makeglossaries instead:

    makeglossaries myDoc
    +
    Note that the file extension isn’t supplied in this case. This will pick up all the file extensions from the aux file and run xindy the appropriate number of times with all the necessary switches.

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

    +Again, a convenient method is to use arara and add the follow comment lines to the start of your document:

    % arara: pdflatex
    +% arara: makeglossaries
    +% arara: pdflatex
    +

    +The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to add the order=letter package option:

    \usepackage[xindy,order=letter]{glossaries}
    +
    (and return to the previous step). This option is picked up by makeglossaries. If you are explicitly using xindy then you’ll need to add -M ord/letorder to the options list. See §1.6.3 for further details on using xindy explicitly.

    +

  5. 5.Once you have successfully completed the previous step, you can now run LaTeX on your document again. As with makeindex (Option 2), you may need to repeat the previous step and this step to ensure the table of contents and cross-references are resolved.

    + +

+

+ +

+ +
+

1.3.4. Option 4 (bib2gls)

+

+

+This option is only available with the glossaries-extra extension package. This method uses bib2gls to both fetch entry definitions from bib files and to hierarchically sort and collate.

+Example document:

\documentclass{article}
+\usepackage[record,style=indexgroup]{glossaries-extra}
+\setabbreviationstyle{short-long}
+% data in sample-entries.bib:
+\GlsXtrLoadResources[src={sample-entries}]
+\begin{document}
+\Gls{puffin}, \gls{duck} and \gls{parrot}.
+\gls{arpanet} and \gls{alpha}.
+Next use: \gls{arpanet}.
+\printunsrtglossary
+\end{document}
+
Note that the abbreviation style must be set before \GlsXtrLoadResources. The file sample-entries.bib contains:
@entry{parrot,
+ name={parrot}, 
+ description={a brightly coloured tropical bird}
+}
+@entry{duck,
+ name={duck}, 
+ description={a waterbird}
+}
+@entry{puffin,
+ name={puffin},
+ description={a seabird with a brightly coloured bill}
+}
+@entry{penguin,
+ name={penguin}, 
+ description={a flightless black and white seabird}
+}
+@symbol{alpha,
+ name={\ensuremath{\alpha}},
+ description={a variable}
+}
+@abbreviation{arpanet,
+  short={ARPANET},
+  long={Advanced Research Projects Agency Network}
+}
+
The result is slightly different from the previous examples. Letter groups aren’t created by default with bib2gls so, even though the glossary style supports letter groups, there’s no group information.
+Example 6: Simple document that uses bib2gls to sort entries 📥🖹 📥🖺

+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.

+

+All entries must be provided in one or more bib files. (See the bib2gls user manual for the required format.) In this example, the terms “parrot”, “duck”, “puffin” and “penguin” are defined using @atentry, the symbol alpha (\(𝛼\)) is defined using @symbol and the abbreviation “ARPANET” is defined using @abbreviation.

+

+Note that the sort key should not be used. Each entry type (@entry, @symbol, @abbreviation) has a particular field that’s used for the sort value by default (name, the label, short). You will break this mechanism if you explicitly use the sort key. See bib2gls gallery: sorting for examples.
+

+The glossaries-extra package needs to be loaded with the record package option:

\usepackage[record]{glossaries-extra}
+
or (equivalently)
\usepackage[record=only]{glossaries-extra}
+
or (with glossaries-extra v1.37+ and bib2gls v1.8+):
\usepackage[record=nameref]{glossaries-extra}
+
The record=nameref option is the best method if you are using hyperref.

+Each resource set is loaded with \GlsXtrLoadResources. For example:

\GlsXtrLoadResources
+[% definitions in entries1.bib and entries2.bib:
+ src={entries1,entries2},
+ sort={de-CH-1996}% sort according to this locale
+]
+
The bib files are identified as a comma-separated list in the value of the src key. The sort option identifies the sorting method. This may be a locale identifier for alphabetic sorting, but there are other sort methods available, such as character code or numeric. One resource set may cover multiple glossaries or one glossary may be split across multiple resource sets, forming logical sub-blocks.

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

+The glossary is displayed using:

\printunsrtglossary
+
Alternatively all glossaries can be displayed using the iterative command:
\printunsrtglossaries
+
The document is built using:
pdflatex myDoc
+bib2gls myDoc
+pdflatex myDoc
+
If letter groups are required, you need the --group switch:
bib2gls --group myDoc
+
or with arara:
% arara: bib2gls: { group: on }
+
(You will also need an appropriate glossary style.)

+Unlike Options 2 and 3, this method doesn’t create a file containing the typeset glossary but simply determines which entries are needed for the document, their associated locations and (if required) their associated letter group. This option allows a mixture of sort methods. For example, sorting by word order for one glossary and order of use for another or even sorting one block of the glossary differently to another block in the same glossary. See bib2gls gallery: sorting.

+This method supports Unicode and uses the Common Locale Data Repository, which provides more extensive language support than xindy. (Except for Klingon, which is supported by xindy, but not by the CLDR.) The locations in the number list may be in any format. If bib2gls can deduce a numerical value it will attempt to form ranges otherwise it will simply list the locations.

+Summary: +

    +
  1. 1.Use glossaries-extra with the record package option:
    \usepackage[record]{glossaries-extra}
    +

    +

  2. 2.Use \GlsXtrLoadResources to identify the bib file(s) and bib2gls options. The bib extension may be omitted:
    \GlsXtrLoadResources[src={terms.bib,abbreviations.bib},sort=en]
    +

    +

  3. 3.Put
    \printunsrtglossary
    +
    where you want your list of entries to appear. Alternatively to display all glossaries use the iterative command:
    \printunsrtglossaries
    +

    +

  4. 4.Run LaTeX on your document.

    +

  5. 5.Run bib2gls with just the document base name.

    +

  6. 6.Run LaTeX on your document.

    + +

+

+See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further details of this method, and also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

+ +

+ +
+

1.3.5. Option 5 (“unsrt”)

+

+

+This option is only available with the extension package glossaries-extra. No indexing application is required.

+Example document:

\documentclass{article}
+\usepackage[style=indexgroup]{glossaries-extra}
+\newglossaryentry{parrot}{name={parrot}, 
+  description={a brightly coloured tropical bird}}
+\newglossaryentry{duck}{name={duck}, 
+  description={a waterbird}}
+\newglossaryentry{puffin}{name={puffin},
+  description={a seabird with a brightly coloured bill}}
+\newglossaryentry{penguin}{name={penguin}, 
+  description={a flightless black and white seabird}}
+% a symbol:
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ description={a variable}}
+% an abbreviation:
+\setabbreviationstyle{short-long}
+\newabbreviation{arpanet}{ARPANET}{Advanced Research Projects Agency Network}
+\begin{document}
+\Gls{puffin}, \gls{duck} and \gls{parrot}.
+\gls{arpanet} and \gls{alpha}.
+Next use: \gls{arpanet}.
+\printunsrtglossary
+\end{document}
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries. There’s no “activation” command (such as \makeglossaries for Options 2 and 3).

+The result is different from the previous examples. Now all entries are listed in the glossary, including “penguin” which hasn’t been referenced in the document, and the list is in the order that the entries were defined. There are no number lists.

+Example 7: Simple document with an unsorted list of all defined entries 📥🖹 📥🖺

+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.

+ Note that the letter groups are fragmented because the list isn’t in alphabetical order, so there are two “P” letter groups.

+The \printunsrtglossary command simply iterates over the set of all defined entries associated with the given 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 glossary styles indent entries that have a parent but it’s the indexing application that ensures the child entries are listed immediately after the parent. If you’re opting to use this manual approach then it’s your responsibility to define the entries in the correct order.

+The glossaries-extra package requires entries to be defined in the preamble by default. It’s possible to remove this restriction, but bear in mind that any entries defined after \printunsrtglossary won’t be listed.

+The glossary is displayed using:

\printunsrtglossary
+
Alternatively all glossaries can be displayed using the iterative command:
\printunsrtglossaries
+

+This method will display 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 glossary as Option 4. This is because bib2gls takes advantage of this method by defining the wanted entries in the required order and setting the locations (and letter group information, if required). See the glossaries-extra manual for further details.

+Therefore, the above example document has a glossary containing the entries: parrot, duck, puffin, penguin, \(𝛼\) and ARPANET (in that order). Note that the “penguin” entry has been included even though it wasn’t referenced in the document.

+This just requires a single LaTeX call:

pdflatex myDoc
+
unless the glossary needs to appear in the table of contents, in which case a second run is required:
pdflatex myDoc
+pdflatex myDoc
+
(Naturally if the document also contains citations, and so on, then additional steps are required. Similarly for all the other options above.)

+See the glossaries-extra documentation for further details of this method.

+ +

+ +
+

1.3.6. Option 6 (“standalone”)

+

+

+This option is only available with the glossaries-extra extension package. (You can just use the base 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 \glsentryname{label} or \Glsentryname{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 preamble (or in an external file loaded with \loadglsentries), as with Option 5, for example:

\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[sort=none,
+   nostyles% <- no glossary styles are required
+ ]{glossaries-extra}
+
+\newglossaryentry{set}{name={set},
+  description={a collection of any kind of objects},
+  symbol={\ensuremath{\mathcal{S}}}
+}
+
+\newglossaryentry{function}{name={function},
+  description={a rule that assigns every element in the    domain \gls{set} to an element in the range \gls{set}},
+  symbol={\ensuremath{f(x)}}
+}
+\newcommand*{\termdef}[1]{% 
+  \section{\glsxtrglossentry{#1} \glsentrysymbol{#1}}% 
+  \begin{quote}\em\Glsentrydesc{#1}.\end{quote}% 
+}
+\begin{document}
+\tableofcontents
+
+\section{Introduction}
+Sample document about \glspl{function} and \glspl{set}.
+
+\termdef{set}
+
+More detailed information about \glspl{set} with examples.
+
+\termdef{function}
+
+More detailed information about \glspl{function} with examples.
+
+\end{document}
+
This allows the references to hyperlink to the standalone definitions rather than to a glossary.
+Example 8: Simple document with standalone entries 📥🖹 📥🖺

+Example document that defines entries and displays them in the document..

+

+Or you can use bib2gls if you want to manage a large database of terms. For example:

\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[record,
+   nostyles% <- no glossary styles are required
+  ]{glossaries-extra}
+
+\GlsXtrLoadResources[src={terms},sort=none,save-locations=false]
+
+\newcommand*{\termdef}[1]{% 
+  \section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}% 
+  \glsadd{#1}% <- index this entry
+  \begin{quote}\em\Glsentrydesc{#1}.\end{quote}% 
+}
+\begin{document}
+\tableofcontents
+
+\section{Introduction}
+Sample document about \glspl{function} and \glspl{set}.
+
+\termdef{set}
+
+More detailed information about \glspl{set} with examples.
+
+\termdef{function}
+
+More detailed information about \glspl{function} with examples.
+\end{document}
+
Where the file terms.bib contains:
@entry{set,
+  name={set},
+  description={a collection of any kind of objects},
+  symbol={\ensuremath{\mathcal{S}}}
+}
+@entry{function,
+  name={function},
+  description={a rule that assigns every element in the domain   \gls{set} to an element in the range \gls{set}},
+  symbol={\ensuremath{f(x)}}
+}
+
The advantage in this approach (with \loadglsentries or bib2gls) is that you can use an existing database of entries shared across multiple documents, ensuring consistent notation for all of them.

+In both cases, there’s no need to load all the glossary styles packages, as they’re not required, so I’ve used the nostyles package option to prevent them from being loaded.

+In the first case, you just need to define the terms (preferably in the preamble or in a file that’s input in the preamble). No external tool is required. Just run LaTeX as normal. (Twice to ensure that the table of contents is up to date.)

pdflatex myDoc
+pdflatex myDoc
+

+In the second case, you need the record package option (as in Option 4) since bib2gls is needed to select the required entries, but you don’t need a sorted list:

\GlsXtrLoadResources[src={terms},sort=none]
+
This will ensure that any entries indexed in the document (through commands like \gls or \glsadd) will be selected by bib2gls, but it will skip the sorting step. (The chances are you probably also won’t need location lists either. If so, you can add the option save-locations=false.)

+Remember that for this second case you need to run bib2gls as per Option 4:

pdflatex myDoc
+bib2gls myDoc
+pdflatex myDoc
+pdflatex myDoc
+

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

+(Instead of using \glsentrydesc or \Glsentrydesc, you can use \glossentrydesc{label}, which will obey category attributes such as glossdesc and glossdescfont. See the glossaries-extra manual for further details.)

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

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

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

+If you want to test if the symbol field has been set, you need to use \ifglshassymbol outside of the section title. For example:

\ifglshassymbol{#1}% 
+{\section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}}
+{\section{\glsxtrglossentry{#1}}}
+

+In both of the above examples, the section titles start with a lowercase character (because the name value is all lowercase in entry definitions). You can apply automatic case change with the glossname category attribute. For example:

\glssetcategoryattribute{general}{glossname}{firstuc}
+
or (for title-case)
\glssetcategoryattribute{general}{glossname}{title}
+
However, this won’t apply the case change in the table of contents or bookmarks. Instead you can use helper commands provided by glossaries-extra v1.49+ but make sure you have up-to-date versions of glossaries and mfirstuc.

+In the second example, you can instead use bib2gls to apply a case change. For example, to apply sentence case to the name field:

\GlsXtrLoadResources[src={terms},
+ sort=none,save-locations=false,
+ replicate-fields={name=text},
+ name-case-change=firstuc
+]
+
(Or name-case-change=title for title case.) This copies the name value to the text field and then applies a case change to the name field (leaving the text field unchanged). The name in the section titles now starts with a capital but the link text produced by commands like \gls is still lowercase.

+In the first example (without bib2gls) you can do this manually. For example:

\newglossaryentry{set}{name={Set},text={set},
+  description={a collection of any kind of objects},
+  symbol={\ensuremath{\mathcal{S}}}
+}
+
A more automated solution can be obtained with the standalone helper commands for the PDF bookmark and heading text (glossaries-extra v1.49+).

+Note that if you use the default save-locations=true with bib2gls, it’s possible to combine Options 4 and 6 to have both standalone definitions and an index. In this case, a glossary style is required. In the example below, I’ve use bookindex, which is provided in the glossary-bookindex package (bundled with glossaries-extra). I don’t need any of the other style packages, so I can still keep the nostyles option and just load glossary-bookindex:

\usepackage[record=nameref,% <- using bib2gls
+ nostyles,% <- don't load default style packages
+ stylemods=bookindex,% <- load glossary-bookindex.sty
+ style=bookindex% <- set the default style to 'bookindex'
+]{glossaries-extra}
+
I also need to sort the entries, so the resource command is now:
\GlsXtrLoadResources[src={terms},% definitions in terms.bib
+ sort=en-GB,% sort by this locale
+ replicate-fields={name=text},
+ name-case-change=firstuc
+]
+
At the end of the document, I can add the glossary:
\printunsrtglossary[title=Index,target=false]
+
Note that I’ve had to switch off the hypertargets with target=false (otherwise there would be duplicate targets). If you want letter group headings you need to use the --group switch:
bib2gls --group myDoc
+
or if you are using arara:
% arara: bib2gls: { group: on }
+

+The bookindex style doesn’t show the description, so only the name and location is displayed. Remember that the name has had a case change so it now starts with an initial capital. If you feel this is inappropriate for the index, you can adjust the bookindex style so that it uses the text field instead. For example:

\renewcommand*{\glsxtrbookindexname}[1]{% 
+  \glossentrynameother{#1}{text}}
+
See the glossaries-extra user manual for further details about this style.

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

+If there are extra terms that need to be included in the index that don’t have a description, you can define them with @index in the bib file. For example:

@index{element}
+@index{member,alias={element}}
+
They can be used in the document as usual:
The objects that make up a set are the \glspl{element}
+or \glspl{member}.
+
See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further details.

+ +

+ +
+

1.4. Dummy Entries for Testing

+

+In addition to the sample files described in §18, glossaries also provides some files containing lorum ipsum dummy entries. These are provided for testing purposes and are on TeX’s path (in tex/latex/glossaries/test-entries) so they can be included via \input or \loadglsentries. The glossaries-extra package provides bib versions of all these files for use with bib2gls. The files are as follows:

+

🗋 example-glossaries-brief.tex
+ These entries all have brief descriptions. For example:
\newglossaryentry{lorem}{name={lorem},description={ipsum}}
+

+

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

+

🗋 example-glossaries-multipar.tex
+ These entries all have multi-paragraph descriptions. For example:
\longnewglossaryentry{loremi-ii}{name={lorem 1--2}}% 
+{% 
+Lorem ipsum ...
+
+Nam dui ligula...
+}
+

+

🗋 example-glossaries-symbols.tex
+ These entries all use the symbol key. For example:
\newglossaryentry{alpha}{name={alpha},
+symbol={\ensuremath{\alpha}},
+description={Quisque ullamcorper placerat ipsum.}}
+

+

🗋 example-glossaries-symbolnames.tex
+ Similar to the previous file but the symbol key isn’t used. Instead the symbol is stored in the name key. For example:
\newglossaryentry{sym.alpha}{sort={alpha},
+name={\ensuremath{\alpha}},
+description={Quisque ullamcorper placerat ipsum.}}
+

+

🗋 example-glossaries-images.tex
+ These entries use the user1 key to store the name of an image file. (The images are provided by the mwe package and should be on TeX’s path.) One entry doesn’t have an associated image to help test for a missing key. The descriptions are long to allow for tests with the text wrapping around the image. For example:
\longnewglossaryentry{sedfeugiat}{name={sed feugiat},
+user1={example-image}}% 
+{% 
+Cum sociis natoque...
+
+Etiam...
+}
+

+

🗋 example-glossaries-acronym.tex
+ These entries are all acronyms. For example:
\newacronym[type={\glsdefaulttype}]{lid}{LID}{lorem ipsum 
+dolor}
+
+ If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation with the category key set to acronym (rather than the default abbreviation). This means that you need to set the abbreviation style for the acronym category. For example:
\setabbreviationstyle[acronym]{long-short}
+
+

+

🗋 example-glossaries-acronym-desc.tex
+ This file contains entries that are all acronyms that use the description key. For example:
\newacronym[type={\glsdefaulttype},
+  description={fringilla a, euismod sodales,   sollicitudin vel, wisi}]{ndl}{NDL}{nam dui ligula}
+
+ If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation with the category key set to acronym (rather than the default abbreviation). This means that you need to set the abbreviation style for the acronym category. For example:
\setabbreviationstyle[acronym]{long-short-desc}
+
+

+

🗋 example-glossaries-acronyms-lang.tex
+ These entries are all acronyms, where some of them have a translation supplied in the user1 key. For example:
\newacronym[type={\glsdefaulttype},user1={love itself}]
+ {li}{LI}{lorem ipsum}
+
+ If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation with the category key set to acronym (rather than the default abbreviation). This means that you need to set the abbreviation style for the acronym category. For example:
\setabbreviationstyle[acronym]{long-short-user}
+
+

+

🗋 example-glossaries-parent.tex
+ These are hierarchical entries where the child entries use the name key. For example:
\newglossaryentry{sedmattis}{name={sed mattis},
+description={erat sit amet}}
+
+\newglossaryentry{gravida}{parent={sedmattis},
+  name={gravida},description={malesuada}}
+

+

🗋 example-glossaries-childnoname.tex
+ These are hierarchical entries where the child entries don’t use the name key. For example:
\newglossaryentry{scelerisque}{name={scelerisque},
+  description={at}}
+
+\newglossaryentry{vestibulum}{parent={scelerisque},
+  description={eu, nulla}}
+

+

🗋 example-glossaries-longchild.tex
+ These entries all have long descriptions and there are some child entries. For example:
\newglossaryentry{longsedmattis}{name={sed mattis},
+ description={erat sit amet dolor sit amet, consectetuer adipiscing elit.   Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.   Curabitur dictum gravida mauris.}}
+
+\newglossaryentry{longgravida}{parent={longsedmattis},name={gravida},
+ 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.}}
+

+

🗋 example-glossaries-childmultipar.tex
+ This consists of parent entries with single paragraph descriptions and child entries with multi-paragraph descriptions. Some entries have the user1 key set to the name of an image file provided by the mwe package. For example:
\newglossaryentry{hiersedmattis}{name={sed mattis},user1={example-image},
+ 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.}}
+
+\longnewglossaryentry{hierloremi-ii}
+{name={lorem 1--2},parent={hiersedmattis}}% 
+{% 
+Lorem ipsum ...
+
+Nam dui ligula...
+}
+

+

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

+

🗋 example-glossaries-url.tex
+ These entries use the user1 key to store an URL associated with the entry. For example:
\newglossaryentry{aenean-url}{name={aenean},
+ description={adipiscing auctor est},
+ user1={http://uk.tug.org/}}
+

+The sample file glossary-lipsum-examples.tex in the doc/latex/glossaries/samples directory uses all these files. See also glossaries gallery.

+

+The glossaries-extra package provides the additional test file:
🗋 example-glossaries-xr.tex
+ These entries use the see key provided by the base glossaries package and also the alias and seealso keys that require glossaries-extra. For example:
\newglossaryentry{alias-lorem}{name={alias-lorem},
+ description={ipsum},alias={lorem}}
+
+\newglossaryentry{amet}{name={amet},description={consectetuer},
+ see={dolor}}
+
+\newglossaryentry{arcu}name={arcu},description={libero},
+ seealso={placerat,vitae,curabitur}
+

+ +

+ +
+

1.5. Multi-Lingual Support

+

+

+The glossaries package uses the tracklang package to determine the document languages. Unfortunately, because there isn’t a standard language identification framework provided with LaTeX, tracklang isn’t always able to detect the selected languages either as a result of using an unknown interface or where the interface doesn’t provide a way of detecting the language. In particular, tracklang can’t pick up languages specified using babel’s \babelprovide. In the event that tracklang can’t detect the language, use the languages package option. See §1.2 and also Localisation with tracklang.tex for further details.
+

+As from version 1.17, the glossaries package can be used with xindy as well as makeindex. If you are writing in a language that uses an extended Latin alphabet or non-Latin alphabet it’s best to use Option 3 (xindy) or Option 4 (bib2gls) as makeindex (Option 2) is hard-coded for the non-extended Latin alphabet and Option 1 can only perform limited ASCII comparisons.

+This means that with Options 3 or 4 you are not restricted to the A, …, Z letter groups. If you want to use xindy, remember to use the xindy package option. For example:

\documentclass[french]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{babel}
+\usepackage[xindy]{glossaries}
+
If you are using a non-Latin script, you may need the xindynoglsnumbers=option or use \GlsSetXdyFirstLetterAfterDigits to indicate the first letter group that should follow the number group.

+If you want to use bib2gls, you need to use the record option with glossaries-extra and supply the definitions in bib files. (See the bib2gls user manual for further details.)

+

+Note that although a non-Latin character, such as é, looks like a plain character in your tex file, with standard LaTeX it’s actually a macro and can therefore cause problems. (This issue doesn’t occur with XeLaTeX or LuaLaTeX which both natively support UTF-8.) Recent versions of the LaTeX kernel have made significant improvements in handling UTF-8. To ensure you have the best UTF-8 support, use at least mfirstuc v2.08+ with glossaries v4.50+ (and, if required, glossaries-extra v1.49+).
+

+With old versions of mfirstuc (pre v2.08), if you use a UTF-8 character at the start of an entry name, you must place it in a group, or it will cause a problem for sentence case commands (e.g. \Gls). For example:

% mfirstuc v2.07:
+\newglossaryentry{elite}{name={{é}lite},
+description={select group or class}}
+
This isn’t necessary with glossaries v4.50+ and mfirstuc v2.08+.
% mfirstuc v2.08:
+\newglossaryentry{elite}{name={élite},
+description={select group or class}}
+

+If you are using xindy or bib2gls, the application needs to know the encoding of the tex file. This information is added to the aux file and can be picked up by makeglossaries and bib2gls. If you use xindy explicitly instead of via \makeglossaries, you may need to specify the encoding using the -C option. Read the xindy manual for further details of this option.

+If you have the double-quote character (") as an active character (for example, a babel shorthand) and you want to use makeindex’s -g option, you’ll need to change makeindex’s quote character using:

+\GlsSetQuote{character}

+

+
+ Note that character may not be one of ? (question mark), | (pipe) or ! (exclamation mark). For example:
\GlsSetQuote{+}
+
This must be done before \makeglossaries and any entry definitions. It’s only applicable for makeindex. This option in conjunction with ngerman will also cause makeglossaries to use the -g switch when invoking makeindex.

+

+Be careful of babel’s shorthands. These aren’t switched on until the start of the document, so any entries defined in the preamble won’t be able to use those shorthands. However, if you define the entries in the document and any of those shorthands happen to be special characters for makeindex or xindy (such as the double-quote) then this will interfere with code that tries to escape any of those characters that occur in the sort key.
+

+In general, it’s best not to use babel’s shorthands in entry definitions. For example:

\documentclass{article}
+
+\usepackage[ngerman]{babel}
+\usepackage{glossaries}
+
+\GlsSetQuote{+}
+
+\makeglossaries
+
+\newglossaryentry{rna}{name=ribonukleinsäure,
+  sort={ribonukleins"aure},
+  description={eine Nukleinsäure}}
+
+\begin{document}
+\gls{rna}
+
+\printglossaries
+\end{document}
+

+ +

+ +
+

1.5.1. Changing the Fixed Names

+

+The fixed names are produced using the commands listed in Table 1.2. If you aren’t using a language package such as babel or polyglossia that uses caption hooks, you can just redefine these commands as appropriate. If you are using babel or polyglossia, you need to use their caption hooks to change the defaults. See changing the words babel uses or read the babel or polyglossia documentation. If you have loaded babel, then glossaries will attempt to load translator, unless you have used the notranslate, translate=false or translate=babel package options. If the translator package is loaded, the translations are provided by dictionary files (for example, glossaries-dictionary-English.dict). See the translator package for advice on changing translations provided by translator dictionaries. If you can’t work out how to modify these dictionary definitions, try switching to babel’s interface using translate=babel:

\documentclass[english,french]{article}
+\usepackage{babel}
+\usepackage[translate=babel]{glossaries}
+
and then use babel’s caption hook mechanism. Note that if you pass the language options directly to babel rather that using the document class options or otherwise passing the same options to translator, then translator won’t pick up the language and no dictionaries will be loaded and babel’s caption hooks will be used instead.

+

Table 2: Customised Text
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Command Name Translator Key Word Purpose
\glossaryname Glossary Title of the main glossary.
\acronymname Acronyms Title of the list of acronyms (when used with package option acronym).
\entryname Notation (glossaries) Header for first column in the glossary (for 2, 3 or 4 column glossaries that support headers).
\descriptionname Description (glossaries) Header for second column in the glossary (for 2, 3 or 4 column glossaries that support headers).
\symbolname Symbol (glossaries) Header for symbol column in the glossary for glossary styles that support this option.
\pagelistname Page List (glossaries) Header for the page list column in the glossary for glossaries that support this option.
\glssymbolsgroupname Symbols (glossaries) Header for symbols section of the glossary for glossary styles that support this option.
\glsnumbersgroupname Numbers (glossaries) Header for numbers section of the glossary for glossary styles that support this option.
+

+As from version 4.12, multilingual support is provided by separate language modules that need to be installed in addition to installing the 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 http://www.dickimaw-books.com/contact.html. The translator dictionary files for 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: +

    +
  • Using babel and translator:
    \documentclass[english,french]{article}
    +\usepackage{babel}
    +\usepackage{glossaries}
    +
    (translator is automatically loaded).

    +

  • Using babel:
    \documentclass[english,french]{article}
    +\usepackage{babel}
    +\usepackage[translate=babel]{glossaries}
    +
    (translator isn’t loaded). The glossaries-extra package has translate=babel as the default if babel has been loaded.

    +

  • Using polyglossia:
    \documentclass{article}
    +\usepackage{polyglossia}
    +\setmainlanguage{english}
    +\usepackage{glossaries}
    +

    + +

+

+Due to the varied nature of glossaries, it’s likely that the predefined translations may not be appropriate. If you are using the babel package and the glossaries package option translate=babel, you need to be familiar with the advice given in changing the words babel uses. If you are using the translator package, then you can provide your own dictionary with the necessary modifications (using \deftranslation) and load it using \usedictionary. If you simply want to change the title of a glossary, you can use the title key in commands like \printglossary (but not the iterative commands like \printglossaries).

+

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

+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 “Nomenclature” and the location list should be labelled “Location”, then you can create a file called, say, myinstitute-glossaries-dictionary-English.dict that contains the following:

\ProvidesDictionary{myinstitute-glossaries-dictionary}{English}
+\deftranslation{Glossary}{Nomenclature}
+\deftranslation{Page List (glossaries)}{Location}
+
You can now load it using:
\usedictionary{myinstitute-glossaries-dictionary}
+
(Make sure that myinstitute-glossaries-dictionary-English.dict can be found by TeX.) If you want to share your custom dictionary, you can upload it to CTAN.

+If you are using babel and don’t want to use the translator interface, you can use the package option translate=babel. For example:

\documentclass[british]{article}
+
+\usepackage{babel}
+\usepackage[translate=babel]{glossaries}
+
+\addto\captionsbritish{% 
+  \renewcommand*{\glossaryname}{List of Terms}% 
+  \renewcommand*{\acronymname}{List of Acronyms}% 
+}
+

+Note that xindy and bib2gls provide much better multi-lingual support than makeindex, so I recommend that you use Options 2 or 3 if you have glossary entries that contain non-Latin characters. See §14 for further details on xindy, and see the bib2gls user manual for further details of that application.

+ +

+ +
+

1.5.2. Creating a New Language Module

+

+The glossaries package now uses the 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 tracklang documentation.

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

+Here’s an example of glossaries-dictionary-English.dict:

\ProvidesDictionary{glossaries-dictionary}{English}
+
+\providetranslation{Glossary}{Glossary}
+\providetranslation{Acronyms}{Acronyms}
+\providetranslation{Notation (glossaries)}{Notation}
+\providetranslation{Description (glossaries)}{Description}
+\providetranslation{Symbol (glossaries)}{Symbol}
+\providetranslation{Page List (glossaries)}{Page List}
+\providetranslation{Symbols (glossaries)}{Symbols}
+\providetranslation{Numbers (glossaries)}{Numbers}
+
You can use this as a template for your dictionary file. Change English to the translator name for your language (so that it matches the file name glossaries-dictionary-Lang.dict) and, for each \providetranslation, change the second argument to the appropriate translation.

+Here’s an example of glossaries-english.ldf:

\ProvidesGlossariesLang{english}
+
+\glsifusedtranslatordict{English}
+{% 
+  \addglossarytocaptions{\CurrentTrackedLanguage}% 
+  \addglossarytocaptions{\CurrentTrackedDialect}% 
+}
+{% 
+  \@ifpackageloaded{polyglossia}% 
+  {% 
+    \newcommand*{\glossariescaptionsenglish}{% 
+      \renewcommand*{\glossaryname}{\textenglish{Glossary}}% 
+      \renewcommand*{\acronymname}{\textenglish{Acronyms}}% 
+      \renewcommand*{\entryname}{\textenglish{Notation}}% 
+      \renewcommand*{\descriptionname}{\textenglish{Description}}% 
+      \renewcommand*{\symbolname}{\textenglish{Symbol}}% 
+      \renewcommand*{\pagelistname}{\textenglish{Page List}}% 
+      \renewcommand*{\glssymbolsgroupname}{\textenglish{Symbols}}% 
+      \renewcommand*{\glsnumbersgroupname}{\textenglish{Numbers}}% 
+    }% 
+  }% 
+  {% 
+    \newcommand*{\glossariescaptionsenglish}{% 
+      \renewcommand*{\glossaryname}{Glossary}% 
+      \renewcommand*{\acronymname}{Acronyms}% 
+      \renewcommand*{\entryname}{Notation}% 
+      \renewcommand*{\descriptionname}{Description}% 
+      \renewcommand*{\symbolname}{Symbol}% 
+      \renewcommand*{\pagelistname}{Page List}% 
+      \renewcommand*{\glssymbolsgroupname}{Symbols}% 
+      \renewcommand*{\glsnumbersgroupname}{Numbers}% 
+    }% 
+  }% 
+  \ifcsdef{captions\CurrentTrackedDialect}
+  {% 
+    \csappto{captions\CurrentTrackedDialect}% 
+    {% 
+      \glossariescaptionsenglish
+    }% 
+  }% 
+  {% 
+    \ifcsdef{captions\CurrentTrackedLanguage}
+    {% 
+      \csappto{captions\CurrentTrackedLanguage}% 
+      {% 
+        \glossariescaptionsenglish
+      }% 
+    }% 
+    % 
+    % 
+  }% 
+  \glossariescaptionsenglish
+}
+\renewcommand*{\glspluralsuffix}{s}
+\renewcommand*{\glsacrpluralsuffix}{\glspluralsuffix}
+\renewcommand*{\glsupacrpluralsuffix}{\glstextup{\glspluralsuffix}}
+
This is a somewhat longer file, but again you can use it as a template. Replace English with the translator language label Lang used for the dictionary file and replace english with the root language name lang. Within the definition of \glossariescaptionslang, replace the English text (such as “Glossaries”) with the appropriate translation.

+The suffixes used to generate the plural forms when the plural hasn’t been specified are given by \glspluralsuffix (for general entries). For acronyms defined with the base \newacronym, \glsupacrpluralsuffix is used for the small caps acronym styles where the suffix needs to be set using \glstextup to counteract the effects of \textsc and \glsacrpluralsuffix for other acronym styles. 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 glossaries configuration.

+

+Therefore these plural suffix command definitions aren’t included in the \captionslanguage hook as that’s typically not switched used until the start of the document. 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 plural, longplural, shortplural etc keys to override exceptions.
+

+If you want to add a regional variation, create a file called glossaries-iso-lang-iso-region.ldf, where iso-lang is the ISO language code and iso-region is the ISO country code. For example, glossaries-en-GB.ldf. This file can load the root language file and make the appropriate changes, for example:

\ProvidesGlossariesLang{en-GB}
+ \RequireGlossariesLang{english}
+ \glsifusedtranslatordict{British}
+ {% 
+   \addglossarytocaptions{\CurrentTrackedLanguage}% 
+   \addglossarytocaptions{\CurrentTrackedDialect}% 
+ }
+ {% 
+   \@ifpackageloaded{polyglossia}% 
+   {% 
+     % Modify \glossariescaptionsenglish as appropriate for
+     % polyglossia
+   }% 
+   {% 
+     % Modify \glossariescaptionsenglish as appropriate for
+     % non-polyglossia
+   }% 
+ }
+

+If the translations includes non-Latin characters, it’s a good idea to provide code that’s independent of the input encoding. Remember that while some users may use UTF-8 (and it’s now the default encoding with modern LaTeX kernels), others may use Latin-1 or any other supported encoding, but while users won’t appreciate you enforcing your preference on them, it’s useful to provide a UTF-8 version.

+The glossaries-irish.ldf file provides this as follows:

\ProvidesGlossariesLang{irish}
+
+\glsifusedtranslatordict{Irish}
+{% 
+  \addglossarytocaptions{\CurrentTrackedLanguage}% 
+  \addglossarytocaptions{\CurrentTrackedDialect}% 
+}
+{% 
+  \ifdefstring{\inputencodingname}{utf8}
+  {\input{glossaries-irish-utf8.ldf}}% 
+  {% 
+    \ifdef\XeTeXinputencoding% XeTeX defaults to UTF-8
+    {\input{glossaries-irish-utf8.ldf}}% 
+    {\input{glossaries-irish-noenc.ldf}}
+  }
+  \ifcsdef{captions\CurrentTrackedDialect}
+  {% 
+    \csappto{captions\CurrentTrackedDialect}% 
+    {% 
+      \glossariescaptionsirish
+    }% 
+  }% 
+  {% 
+    \ifcsdef{captions\CurrentTrackedLanguage}
+    {
+      \csappto{captions\CurrentTrackedLanguage}% 
+      {% 
+        \glossariescaptionsirish
+      }% 
+    }% 
+    {% 
+    }% 
+  }% 
+  \glossariescaptionsirish
+}
+
(Again you can use this as a template. Replace irish with your root language label and Irish with the translator dictionary label.)

+There are now two extra files: glossaries-irish-noenc.ldf (no encoding information) and glossaries-irish-utf8.ldf (UTF-8).

+These both define \glossariescaptionsirish but the *-noenc.ldf file uses LaTeX accent commands:

\@ifpackageloaded{polyglossia}% 
+{% 
+  \newcommand*{\glossariescaptionsirish}{% 
+    \renewcommand*{\glossaryname}{\textirish{Gluais}}% 
+    \renewcommand*{\acronymname}{\textirish{Acrainmneacha}}% 
+    \renewcommand*{\entryname}{\textirish{Ciall}}% 
+    \renewcommand*{\descriptionname}{\textirish{Tuairisc}}% 
+    \renewcommand*{\symbolname}{\textirish{Comhartha}}% 
+    \renewcommand*{\glssymbolsgroupname}{\textirish{Comhartha\'\i}}% 
+    \renewcommand*{\pagelistname}{\textirish{Leathanaigh}}% 
+    \renewcommand*{\glsnumbersgroupname}{\textirish{Uimhreacha}}% 
+  }% 
+}% 
+{% 
+  \newcommand*{\glossariescaptionsirish}{% 
+    \renewcommand*{\glossaryname}{Gluais}% 
+    \renewcommand*{\acronymname}{Acrainmneacha}% 
+    \renewcommand*{\entryname}{Ciall}% 
+    \renewcommand*{\descriptionname}{Tuairisc}% 
+    \renewcommand*{\symbolname}{Comhartha}% 
+    \renewcommand*{\glssymbolsgroupname}{Comhartha\'\i}% 
+    \renewcommand*{\pagelistname}{Leathanaigh}% 
+    \renewcommand*{\glsnumbersgroupname}{Uimhreacha}% 
+  }% 
+}
+
whereas the *-utf8.ldf file replaces the accent commands with the appropriate UTF-8 characters.

+ +

+ +
+

1.6. Generating the Associated Glossary Files

+

+

+This section is only applicable if you have chosen Options 2 or 4. You can ignore this section if you have chosen any of the other options. If you want to alphabetically sort your entries always remember to use the sort key if the name contains any LaTeX commands (except if you’re using bib2gls).
+

+If this section seriously confuses you, and you can’t work out how to run external tools like makeglossaries or makeindex, you can try using the automake package option, described in §2.5, but you will need TeX’s shell escape enabled. See also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

+In order to generate a sorted glossary with compact number lists, it is necessary to use an external indexing application as an intermediate step (unless you have chosen Option 1, which uses TeX to do the sorting or Option 5, which doesn’t perform any sorting). It is this application that creates the file containing the code required to typeset the glossary. If this step is omitted, the glossaries will not appear in your document. The two indexing applications that are most commonly used with LaTeX are makeindex and xindy. As from version 1.17, the glossaries package can be used with either of these applications. Previous versions were designed to be used with makeindex only. With the glossaries-extra package, you can also use bib2gls as the indexing application. (See the glossaries-extra and bib2gls user manuals for further details.) Note that xindy and bib2gls have much better multi-lingual support than makeindex, so xindy or bib2gls are recommended if you’re not writing in English. Commands that only have an effect when xindy is used are described in §14.

+

+This is a multi-stage process, but there are methods of automating document compilation using applications such as latexmk and arara. With arara you can just add special comments to your document source:
% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+
With latexmk you need to set up the required dependencies.
+

+The glossaries package comes with the Perl script makeglossaries which will run makeindex or xindy on all the indexing files using a customized style file (which is created by \makeglossaries). See §1.6.1 for further details. Perl is stable, cross-platform, open source software that is used by a number of TeX-related applications (including xindy and latexmk). Most Unix-like operating systems come with a Perl interpreter. TeX Live 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 makeglossaries or xindy. Further information is available at http://www.perl.org/about.html and MikTeX and Perl scripts (and one Python script).

+The advantages of using makeglossaries: +

+ The first two items also apply to makeglossaries-lite.

+As from version 4.16, the glossaries package also comes with a Lua script called makeglossaries-lite. This is a trimmed-down alternative to the 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 makeglossaries-lite so it’s an alternative to makeglossaries if you want to use Option 2 (makeindex).

+If things go wrong and you can’t work out why your glossaries aren’t being generated correctly, you can use makeglossariesgui as a diagnostic tool. Once you’ve fixed the problem, you can then go back to using makeglossaries or makeglossaries-lite.

+Whilst I strongly recommended that you use the makeglossaries Perl script or the makeglossaries-lite Lua script, it is possible to use the glossaries package without using those applications. However, note that some commands and package options have no effect if you explicitly run makeindex/xindy. These are listed in Table 1.3.

+

+If you are choosing not to use makeglossaries because you don’t want to install Perl, you will only be able to use makeindex as xindy also requires Perl. (Other useful Perl scripts include epstopdf and latexmk, so it’s well-worth the effort to install Perl.)
+

+Below, references to makeglossaries can usually be substituted with makeglossaries-lite, except where noted otherwise.

+If any of your entries use an entry that is not referenced outside the glossary (for example, the entry is only referenced in the description of another entry), you will need to do an additional makeglossaries, makeindex or xindy run, as appropriate. For example, suppose you have defined the following entries:

\newglossaryentry{citrusfruit}{name={citrus fruit},
+description={fruit of any citrus tree. (See also  \gls{orange})}}
+
+\newglossaryentry{orange}{name={orange},
+description={an orange coloured fruit.}}
+
and suppose you have \gls{citrusfruit} in your document but don’t reference the “orange” entry, then the orange entry won’t appear in your glossary until you first create the glossary and then do another run of makeglossaries, makeindex or xindy. For example, if the document is called myDoc.tex, then you must do:
pdflatex myDoc
+makeglossaries myDoc
+pdflatex myDoc
+makeglossaries myDoc
+pdflatex myDoc
+
(In the case of Option 4, bib2gls will scan the description for instances of commands like \gls to ensure they are selected but an extra bib2gls call is required to ensure the locations are included, if location lists are required. See the and bib2gls manual for further details.)

+Likewise, an additional 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 number lists in the glossary may need updating.

+The examples in this document assume that you are accessing makeglossaries, xindy or makeindex via a terminal. Windows users can use the command prompt which is usually accessed via the StartAll Programs menu or StartAll ProgramsAccessories menu or StartWindows System.

+Alternatively, your text editor may have the facility to create a function that will call the required application. See Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

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

+

+ + + + + + + + + + + + + + + + + + +
Table 3: Commands and package options that have no effect when using xindy or makeindex explicitly
Command or Package Option makeindex xindy
order=letter use -l use -M ord/letorder
order=word default default
xindy=language={lang},codepage={code} N/A use -L lang -C code
\GlsSetXdyLanguage{lang} N/A use -L lang
\GlsSetXdyCodePage{code} N/A use -C code
+

+

+ +

+ +
+

1.6.1. Using the makeglossaries Perl Script

+

+

makeglossaries options aux-file

+The makeglossaries script picks up the relevant information from the auxiliary (aux) file and will either call xindy or makeindex, depending on the supplied information. Therefore, you only need to pass the document’s name without the extension to makeglossaries. For example, if your document is called myDoc.tex, type the following in your terminal:

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

+Windows users: TeX Live on Windows has its own internal Perl interpreter and provides makeglossaries.exe as a convenient wrapper for the makeglossaries Perl script. MikTeX also provides a wrapper makeglossaries.exe but doesn’t provide a Perl interpreter (as far as I know), which is still required even if you run MikTeX’s makeglossaries.exe, so with MikTeX you’ll need to install Perl. There’s more information about this at MikTeX and Perl scripts (and one Python script).

+

+When upgrading the glossaries package, make sure you also upgrade your version of makeglossaries. The current version is 4.50.
+

+Some of the options are only applicable to makeindex and some are only applicable to xindy.

+

+--help
+ Shows a summary of all available options.

+

+--version
+ Shows the version details.

+

+-n
+ Dry run mode. This doesn’t actually run makeindex/xindy but just prints the command it would execute based on the information given in the aux file and the supplied options.

+

+-d directory
+ Instructs makeglossaries to change to the given directory, which should be where the aux, glo etc files are located. For example:
pdflatex -output-directory myTmpDir myDoc
+makeglossaries -d myTmpDir myDoc
+

+

+-e
+ Don’t check for multiple encaps (only applicable with makeindex). By default, if you are using makeindex, makeglossaries will check the makeindex transcript for multiple encap warnings.

+The multiple encap warning is where different location encap values (location formats) are used on the same location for the same entry. For example:

\documentclass{article}
+
+\usepackage{glossaries}
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},description={an example}}
+
+\begin{document}
+\gls{sample}, \gls[format=textbf]{sample}.
+\printglossaries
+\end{document}
+
If you explicitly use makeindex, this will cause a warning and the location list will be “1, 1. That is, the page number will be repeated with each format. As from v2.18, 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 makeglossaries from checking and correcting the duplicates with -e.

+There’s no similar check for xindy as xindy won’t produce any warning and will simply discard duplicates.

+

+-q
+ Suppresses messages. The makeglossaries script attempts to fork the makeindex/xindy process using open() on the piped redirection 2>&1 | and parses the processor output to help diagnose problems. If this method fails makeglossaries will print an “Unable to fork” warning and will retry without redirection. Without this redirection, the -q switch doesn’t work as well. Some operating systems don’t support redirection.

+

+-Q
+ Suppresses the “Unable to fork” warning.

+

+-k
+ Don’t attempt redirection.

+

+-m applicationinitial: makeindex
+ The 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 makeindex files (including support for makeindex style files via -s), then you can use -m to specify the alternative application to use instead of makeindex. Note that both xindex and texindy can read makeindex files using the default makeindex syntax but, as of the time of writing this, they don’t support makeindex style files.

+

+-x applicationinitial: xindy
+ The xindy application. Only the name is required if it’s on the operating system’s path, otherwise the full path name will be needed.

+

+-c
+ Compress intermediate blanks. This will pass -c to makeindex. (Ignored if xindy should be called.)

+

+-r
+ Disable implicit page range formation. This will pass -r to makeindex. (Ignored if xindy should be called.)

+

+-p num
+ Set the starting page number. This will pass -p num to makeindex. (Ignored if xindy should be called.)

+The following switches may be used to override settings written to the aux file.

+

+-l
+ Use letter ordering. This will pass -l to makeindex or -M ord/letorder to xindy.

+

+-L language
+ The language to pass to xindy. (Ignored if makeindex should be called.)

+

+-g
+ Employ German word ordering. This will pass -g to makeindex. (Ignored if xindy should be called.)

+

+-s filename
+ Set the style file. This will pass -s filename to makeindex or -M basename to xindy (where basename is filename with the xdy extension removed). This will generate an error if the extension is xdy when makeindex should be called, or if the extension isn’t xdy when xindy should be called.

+

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

+

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

+ +

+ +
+

1.6.2. Using the makeglossaries-lite Lua Script

+

+

makeglossaries-lite options aux-file

+The Lua alternative to the 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 makeglossaries-lite script is therefore limited by this and some of the options available to the makeglossaries Perl script aren’t available here. (In particular the -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.

+

+The script is actually supplied as makeglossaries-lite.lua but TeX distributions on Windows convert this to an executable wrapper makeglossaries-lite.exe and TeX Live on Unix-like systems provide a symbolic link without the extension.
+

+The makeglossaries-lite script can be invoked in the same way as makeglossaries. For example, if your document is called myDoc.tex, then do

makeglossaries-lite myDoc
+
Note that the arara rule doesn’t contain the hyphen:
% arara: makeglossarieslite
+

+Some of the options are only applicable to makeindex and some are only applicable to xindy.

+

+--help
+ Shows a summary of all available options.

+

+--version
+ Shows the version details.

+

+-n
+ Dry run mode. This doesn’t actually run makeindex/xindy but just prints the command it would execute based on the information given in the aux file and the supplied options.

+

+-q
+ Quiet mode. This suppresses some but not all messages.

+

+-m applicationinitial: makeindex
+ The makeindex application. Only the name is required if it’s on the operating system’s path, otherwise the full path name will be needed.

+

+-x applicationinitial: xindy
+ The xindy application. Only the name is required if it’s on the operating system’s path, otherwise the full path name will be needed.

+

+-c
+ Compress intermediate blanks. This will pass -c to makeindex. (Ignored if xindy should be called.)

+

+-r
+ Disable implicit page range formation. This will pass -r to makeindex. (Ignored if xindy should be called.)

+

+-p num
+ Set the starting page number. This will pass -p num to makeindex. (Ignored if xindy should be called.)

+The following switches may be used to override settings written to the aux file.

+

+-l
+ Use letter ordering. This will pass -l to makeindex or -M ord/letorder to xindy.

+

+-L language
+ The language to pass to xindy. (Ignored if makeindex should be called.)

+

+-g
+ Employ German word ordering. This will pass -g to makeindex. (Ignored if xindy should be called.)

+

+-s filename
+ Set the style file.

+

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

+

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

+ +

+ +
+

1.6.3. Using xindy explicitly (Option 3)

+

+xindy comes with TeX Live. It has also been added to MikTeX, but if you don’t have it installed, see How to use Xindy with MikTeX.

+If you want to use xindy to process the glossary files, you must make sure you have used the xindy package option:

\usepackage[xindy]{glossaries}
+
This is required regardless of whether you use xindy explicitly or whether it’s called implicitly via applications such as makeglossaries. This causes the glossary entries to be written in raw xindy format, so you need to use -I xindy not -I tex.

+To run xindy type the following in your terminal (all on one line):

xindy -L language -C encoding -I xindy -M style -t base.glg -o base.gls base.glo
+
where language is the required language name, encoding is the encoding, base is the name of the document without the tex extension and style is the name of the xindy style file without the xdy extension. The default name for this style file is basexdy but can be changed via \setStyleFile. You may need to specify the full path name depending on the current working directory. If any of the file names contain spaces, you must delimit them using double-quotes.

+For example, if your document is called myDoc.tex and you are using UTF-8 encoding in English, then type the following in your terminal:

xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
+

+Note that this just creates the main glossary. You need to do the same for each of the other glossaries (including the list of acronyms if you have used the acronym package option), substituting glg, gls and glo with the relevant extensions. For example, if you have used the acronym package option, then you would need to do:

xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
+
For additional glossaries, the extensions are those supplied when you created the glossary with \newglossary.

+Note that if you use makeglossaries instead, you can replace all those calls to xindy with just one call to makeglossaries:

makeglossaries myDoc
+
Note also that some commands and package options have no effect if you use xindy explicitly instead of using makeglossaries. These are listed in Table 1.3.

+ +

+ +
+

1.6.4. Using makeindex explicitly (Option 2)

+

+If you want to use makeindex explicitly, you must make sure that you haven’t used the xindy package option or the glossary entries will be written in the wrong format. To run makeindex, type the following in your terminal:

makeindex -s style.ist -t base.glg -o base.gls base.glo
+
where base is the name of your document without the tex extension and styleist is the name of the makeindex style file. By default, this is baseist, but may be changed via \setStyleFile. Note that there are other options, such as -l (letter ordering). See the makeindex manual for further details.

+For example, if your document is called myDoc.tex, then type the following at the terminal:

makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo
+
Note that this only creates the main glossary. If you have additional glossaries (for example, if you have used the acronym package option) then you must call makeindex for each glossary, substituting glg, gls and glo with the relevant extensions. For example, if you have used the acronym package option, then you need to type the following in your terminal:
makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn
+
For additional glossaries, the extensions are those supplied when you created the glossary with \newglossary.

+Note that if you use makeglossaries instead, you can replace all those calls to makeindex with just one call to makeglossaries:

makeglossaries myDoc
+
Note also that some commands and package options have no effect if you use makeindex explicitly instead of using makeglossaries. These are listed in Table 1.3.

+ +

+ +
+

1.7. Note to Front-End and Script Developers

+

+The information needed to determine whether to use xindy, makeindex or bib2gls is stored in the aux file. This information can be gathered by a front-end, editor or script to make the glossaries where appropriate. This section describes how the information is stored in the auxiliary file.

+ +

+ +
+

1.7.1. MakeIndex and Xindy

+

+The file extension of the indexing files used for each defined glossary (not including any ignored glossaries) are given by:

+\@newglossary{glossary-label}{log}{out-ext}{in-ext}
+where in-ext is the extension of the indexing application’s input file (the output file from the glossaries package’s point of view), such as glo, out-ext is the extension of the indexing application’s output file (the input file from the glossaries package’s point of view), such as gls, and log is the extension of the indexing application’s transcript file, such as glg. The label for the glossary is also given. This isn’t required with makeindex, but with xindy it’s needed to pick up the associated language and encoding (see below). For example, the information for the default main glossary is written as:
\@newglossary{main}{glg}{gls}{glo}
+
If glossaries-extra’s hybrid method has been used (with \makeglossaries[sub-list]), then the sub-list of glossaries that need to be processed will be identified with:
+\glsxtr@makeglossaries{label-list}
+

+The indexing application’s style file is specified by:

+\@istfilename{filename}
+ The file extension indicates whether to use makeindex (ist) or xindy (xdy). Note that the glossary information has a different syntax depending on which indexing application is supposed to be used, so it’s important to call the correct one.

+For example, with arara you can easily determine whether to run makeglossaries:

% arara: makeglossaries if found("aux", "@istfilename")
+
It’s more complicated if you want to explicitly run makeindex or xindy.

+

+Note that if you choose to explicitly call makeindex or xindy then the user will miss out on the diagnostic information and the encap-clash fix that makeglossaries also provides.
+

+Word or letter ordering is specified by:

+\@glsorder{order}
+ where order can be either word or letter (obtained from the order package option).

+If xindy should be used, the language for each glossary is specified by:

+\@xdylanguage{glossary-label}{language}
+ where glossary-label identifies the glossary and language is the root language (for example, english).

+The codepage (file encoding) for all glossaries is specified by:

+\@gls@codepage{code-page}
+ where code is the encoding (for example, utf8). The above two commands are omitted if makeindex should be used.

+If Option 1 has been used, the aux file will contain

+\@gls@reference{type}{label}{location}
+ for every time an entry has been referenced.

+ +

+ +
+

1.7.2. Entry Labels

+

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

+

+ The glossaries-extra package also provides docdef=atom, which will create the glsdefs file but will act like docdef=restricted.
+

+ +

+ +
+

1.7.3. Bib2Gls

+

+

+If Option 4 has been used, the aux file will contain one or more instances of:
+\glsxtr@resource{options}{basename}
+ where basename is the basename of the glstex file that needs to be created by bib2gls. If src={bib list} isn’t present in options then basename also indicates the name of the associated bib file.

+For example, with arara you can easily determine whether or not to run bib2gls:

% arara: bib2gls if found("aux", "glsxtr@resource")
+
(It gets more complicated if both \glsxtr@resource and \@istfilename are present as that indicates the hybrid record=hybrid option.)

+Remember that with bib2gls, the glossary entries will never be defined on the first LaTeX call (because their definitions are contained in the glstex file created by bib2gls). You can also pick up labels from the records in aux file, which will be in the form:

+\glsxtr@record{label}{h-prefix}{counter}{format}{loc}
+ or (with record=nameref):
+\glsxtr@record@nameref{label}{href prefix}{counter}{format}{location}{title}{href anchor}{href value}
+ or (with \glssee):
+\glsxtr@recordsee{label}{xr list}
+{label}{xr list} You can also pick up the commands defined with \glsxtrnewglslike, which are added to the aux file for bib2gls’s benefit:
+\@glsxtr@newglslike{label-prefix}{cs}
+ If \GlsXtrSetAltModifier is used, then the modifier is identified with:
+\@glsxtr@altmodifier{character}
+ Label prefixes (for the \dgls set of commands) are identified with:
+\@glsxtr@prefixlabellist{list}
+

+ +

+ +
+

2. Package Options

+

+This section describes the available glossaries package options. You may omit the =true for boolean options. (For example, acronym is equivalent to acronym=true).

+

+ The glossaries-extra package has additional options described in the 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 glossaries-extra may have additional package options or new values for existing settings that aren’t listed here.
+

+

+Note that key=value package options can’t be passed via the document class options. (This includes options where the value part may be omitted, such as acronym.) This is a general limitation not restricted to the glossaries package. Options that aren’t key=value (such as makeindex) may be passed via the document class options.
+

+

+ +

+ +
+

2.1. General Options

+

+

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

+

+nolangwarn
+ This suppresses the warning generated by a missing language module.

+

+noredefwarn
+ If you load glossaries with a class or another package that already defines glossary related commands, by default glossaries will warn you that it’s redefining those commands. If you are aware of the consequences of using 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 nowarn option described above. (This option is automatically switched on by glossaries-extra.)

+

+debug=valueinitial: false
+ Debugging mode may write information to the transcript file or add markers to the document. The following values are available:
+debug=false
+ Switches off debugging mode.

+

+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 \makeglossaries:
wrglossary(glossary-type)(indexing info)
+
Note that this setting will also cancel nowarn.

+

+debug=showtargets
+ As debug=true but also adds a marker where the glossary-related hyperlinks and targets occur in the document.

+The debug=showtargets option will additionally use:

+\glsshowtarget{target name}
+ to show the hypertarget or hyperlink name when \glsdohypertarget is used by commands like \glstarget and when \glsdohyperlink is used by commands like \gls. In math mode or inner mode, this uses:
+\glsshowtargetinner{target name}
+ which typesets the target name as:
[\glsshowtargetfonttext{target name}]
+
just before the link or anchor. This uses the text-block command:
+\glsshowtargetfonttext{text}
+ which checks for math-mode before applying the font change. In outer mode \glsshowtarget uses:
+\glsshowtargetouter{target name}
+ which by default places the target name in the margin with a symbol produced with:
+\glsshowtargetsymbol{target name}
+ which defaults to a small right facing triangle.

+The font used by both \glsshowtargetfonttext and \glsshowtargetouter is given by the declaration:

+\glsshowtargetfontinitial: \ttfamily\footnotesize
+

+

+debug=showaccsupp
+ As debug=true but also adds a marker where the glossary-related accessibility information occurs (see glossaries-accsupp) using:
+\glsshowaccsupp{options}{PDF element}{value}
+

+

+ The glossaries-extra package provides extra values debug=showwrgloss, that may be used to show where the indexing is occurring, and debug=all, which switches on all debugging options. See the glossaries-extra manual for further details.
+

+The purpose of the debug mode can be demonstrated with the following example document:

\documentclass{article}
+\usepackage{glossaries}
+\newglossaryentry{sample1}{name={sample1},description={example}}
+\newglossaryentry{sample2}{name={sample2},description={example}}
+\glsadd{sample2}% <- does nothing here
+\makeglossaries
+\begin{document}
+\gls{sample1}.
+\printglossaries
+\end{document}
+
In this case, only the “sample1” entry has been indexed, even though \glsadd{sample2} appears in the source code. This is because \glsadd{sample2} has been used before the associated file is opened by \makeglossaries. Since the file isn’t open yet, the information can’t be written to it, which is why the “sample2” entry doesn’t appear in the glossary.

+Without \makeglossaries the indexing is suppressed with Options 2 and 3 but, other than that, commands like \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 glossaries to format the entries (for example, to show a different form on first use) but not display any glossaries (or the user may prefer to use the unsorted Options 5 or 6). It’s also possible that the user may want to temporarily comment out \makeglossaries in order to suppress the indexing while working on a draft version to speed compilation, or the user may prefer to use Options 1 or 4 for indexing, which don’t use \makeglossaries.

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

+The debug mode, enabled with the debug option,

\usepackage[debug]{glossaries}
+
will write information to the log file when the indexing can’t occur because the associated file isn’t open. The message is written in the form
Package glossaries Info: wrglossary(type)(text) on
+input line line number.
+
where type is the glossary label and 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 \glsadd or \glsaddall, try switching on the debug option and see if any information has been written to the log file.

+

+savewrites=booleandefault: true; initial: false
+ This is a boolean option to minimise the number of write registers used by the glossaries package. The default is savewrites=false. With Options 2 and 3, one write register is required per (non-ignored) glossary and one for the style file.

+

+In general, this package option is best avoided.
+

+With all options except Options 1 and 414, another write register is required if the glsdefs file is needed to save document definitions. With both Options 1 and 4, no write registers are required (document definitions aren’t permitted and indexing information is written to the aux file). If you really need document definitions but you want to minimise the number of write registers then consider using docdef=restricted with glossaries-extra.

+There are only a limited number of write registers, and if you have a large number of glossaries 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 savewrites is set, the glossary information will be stored in token registers until the end of the document when they will be written to the external files.

+

+This option can significantly slow document compilation and may cause the indexing to fail. Page numbers in the number list will be incorrect on page boundaries due to TeX’s asynchronous output routine. As an alternative, you can use the scrwfile package (part of the KOMA-Script bundle) and not use this option.
+

+By way of comparison, sample-multi2.tex provided with bib2gls has a total of 15 glossaries. With Options 2 or 3, this would require 46 associated files and 16 write registers. (These figures don’t include standard files and registers provided by the kernel or hyperref, such as aux and out.) With bib2gls, no write registers are required and there are only 10 associated files for that particular document (9 resource files and 1 transcript file).

+

+If you want to use TeX’s shell escape to call makeindex or xindy from your document and use savewrites, then use automake=immediate or automake=makegloss or automake=lite.
+

+

+translate=valuedefault: true; initial: varies
+ This can take one of the values listed below. If no supported language package has been loaded the default is translate=false otherwise the default is translate=true for the base glossaries package and translate=babel for glossaries-extra.

+

+ If babel has been loaded and the translator package is installed, translator will be loaded and the translations will be provided by the translator package interface. You can modify the translations by providing your own dictionary. If the translator package isn’t installed and babel is loaded, the glossaries-babel package will be loaded and the translations will be provided using babel’s \addto\captionslanguage mechanism. If polyglossia has been loaded, glossaries-polyglossia will be loaded.

+

+ Don’t provide translations, even if babel or polyglossia has been loaded. (Note that babel provides the command \glossaryname so that will still be translated if you have loaded babel.)

+

+ Don’t load the translator package. Instead load glossaries-babel.

+

+I recommend you use translate=babel if you have any problems with the translations or with PDF bookmarks, but to maintain backward compatibility, if babel has been loaded the default is translate=true.
+

+See §1.5.1 for further details.

+

+notranslate
+ This is equivalent to translate=false and may be passed via the document class options.

+

+languages
+ This automatically implements translate=babel (which means that translator won’t automatically be loaded) but will also add the list of languages to tracklang’s list of tracked languages. Each element in the list may be an ISO language tag (such as pt-BR) or one of tracklang’s known language labels (such as british).

+

+hyperfirst=booleandefault: true; initial: true
+ If true, terms on first use will have a hyperlink, if supported, unless the hyperlink is explicitly suppressed using starred versions of commands such as \gls*. If false, only subsequent use instances will have a hyperlink (if supported).

+Note that nohypertypes overrides hyperfirst=true. This option only affects commands that check the first use flag, such as the \gls-like commands (for example, \gls or \glsdisp), but not the \glstext-like commands (for example, \glslink or \glstext).

+The hyperfirst setting applies to all glossary types (unless identified by nohypertypes or defined with \newignoredglossary). It can be overridden on an individual basis by explicitly setting the 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 hyperlinks for just the acronyms (where the first use explains the meaning of the acronym) but not for ordinary glossary entries (where the first use is identical to subsequent use). In this case, you can use hyperfirst=false and apply \glsunsetall to all the regular (non-acronym) glossaries. For example:

\usepackage[acronym,hyperfirst=false]{glossaries}
+% acronym and glossary entry definitions
+
+% at the end of the preamble
+\glsunsetall[main]
+

+Alternatively you can redefine the hook

+\glslinkcheckfirsthyperhook
+ which is used by the commands that check the first use flag, such as \gls. Within the definition of this command, you can use \glslabel to reference the entry label and \glstype to reference the glossary type. You can also use \ifglsused to determine if the entry has been used. You can test if an entry is an acronym by checking if it has the long key set using \ifglshaslong (or if the short key has been set using \ifglshasshort). For example, to switch off the hyperlink on first use just for acronyms:
\renewcommand*{\glslinkcheckfirsthyperhook}{% 
+ \ifglsused{\glslabel}{}% 
+ {% 
+   \ifglshaslong{\glslabel}{\setkeys{glslink}{hyper=false}}% 
+ }% 
+}
+

+Note that this hook isn’t used by the commands that don’t check the first use flag, such as \glstext. (You can, instead, redefine \glslinkpostsetkeys, which is used by both the \gls-like and \glstext-like commands.)

+

+ The glossaries-extra package provides a method of disabling the first use hyperlink according to the entry’s associated category. For example, if you only want to switch off the first use hyperlink for abbreviations then you simply need to set the nohyperfirst attribute for the abbreviation and, if appropriate, acronym categories. (Instead of using the hyperfirst package option.) See the glossaries-extra manual for further details.
+

+

+writeglslabels
+ This option will create a file called \jobname.glslabels at the end of the document. This file simply contains a list of all defined entry labels (including those in any ignored glossaries). It’s provided for the benefit of text editors that need to know labels for auto-completion. If you also want the name, use writeglslabelnames. (See also glossaries-extra’s docdef=atom package option.)

+

+ Note that with bib2gls the file will only contain the entries that bib2gls has selected from the bib files.
+

+

+writeglslabelnames
+ Similar to writeglslabels but writes both the label and name (separated by a tab).

+

+undefaction=valueinitial: error
+

+Only available with glossaries-extra, the value for this option may be one of:

+

+ Generates an error if a referenced entry is undefined (default, and the only available setting with just the base glossaries package).

+

+ Only warns if a referenced entry is undefined (automatically activated with Option 4).

+

+docdef=valuedefault: true; initial: false
+

+Only available with glossaries-extra, this option governs the use of \newglossaryentry. Available values:

+

+docdef=false
+ This setting means that \newglossaryentry is not permitted in the document environment (default with glossaries-extra and for Option 1 with just the base glossaries package).

+

+docdef=restricted
+ This setting means that \newglossaryentry is only permitted in the document environment if it occurs before \printglossary (not available for some indexing options, such as Option 4).

+

+docdef=atom
+ This setting is as docdef=restricted but creates the glsdefs file for use by atom (without the limitations of docdef=true).

+

+docdef=true
+ This setting means that \newglossaryentry is permitted in the document environment where it would normally be permitted by the base glossaries package. This will create the glsdefs file if \newglossaryentry is found in the document environment.

+ +

+ +
+

2.2. Sectioning, Headings and TOC Options

+

+

+toc=booleandefault: true; initial: varies
+ Adds the glossaries to the table of contents (toc file). Note that an extra LaTeX run is required with this option. Alternatively, you can switch this function on and off using
+\glstoctrue
+ and
+\glstocfalse
+ You can test whether or not this option is set using:
+\ifglstoc true\else false\fiinitial: \iffalse
+ The default value is toc=false for the base glossaries package and toc=true for glossaries-extra.

+

+numberline=booleandefault: true; initial: false
+ When used with toc=true option, this will add \numberline{} in the final argument of \addcontentsline. This will align the table of contents entry with the numbered section titles. Note that this option has no effect with toc=false. If toc=true is used without numberline, the glossary title will be aligned with the section numbers rather than the section titles.

+

+section=namedefault: section
+

+This option indicates the sectional unit to use for the glossary. The value name should be the control sequence name without the leading backslash or following star (for example, just chapter not \chapter or chapter*).

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

+Example:

\usepackage[section=subsection]{glossaries}
+
You can omit the value if you want to use \section:
\usepackage[section]{glossaries}
+
is equivalent to
\usepackage[section=section]{glossaries}
+
You can change this value later in the document using
+\setglossarysectionname
+ where name is the sectional unit.

+The start of each glossary adds information to the page header via \glsglossarymark (see §8.2).

+

+ucmark=booleandefault: true; initial: varies
+ If ucmark=true, this will make \glsglossarymark use all caps in the header, otherwise no case change will be applied. The default is ucmark=false, unless memoir has been loaded, in which case the default is ucmark=true.

+You can test if this option has been set using:

+\ifglsucmark true\else false\fiinitial: varies
+ For example:
\renewcommand{\glsglossarymark}[1]{% 
+  \ifglsucmark
+    \markright{\glsuppercase{#1}}% 
+  \else
+    \markright{#1}% 
+  \fi}
+

+

+numberedsection=valuedefault: nolabel; initial: false
+ The glossaries are placed in unnumbered sectional units by default, but this can be changed using numberedsection. This option can take one of the following values:

+

+ No number, that is, use the starred form of sectioning command (for example, \chapter* or \section*).

+

+ Use a numbered section, that is, the unstarred form of sectioning command (for example, \chapter or \section), but no label is automatically added.

+

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

+

+ This setting is like numberedsection=autolabel but uses an unnumbered sectioning command (for example, \chapter* or \section*). It’s designed for use with the nameref package. For example:
\usepackage{nameref}
+\usepackage[numberedsection=nameref]{glossaries}
+
Alternatively, since nameref is automatically loaded by hyperref:
\usepackage{hyperref}
+\usepackage[numberedsection=nameref]{glossaries}
+
Now \nameref{main} will display the (table of contents) section title associated with the main glossary. As above, you can redefine \glsautoprefix to provide a prefix for the label.

+ +

+ +
+

2.3. Glossary Appearance Options

+

+

+savenumberlist=booleandefault: true; initial: false

+

Options 2 and 3 only
+
+ This is a boolean option that specifies whether or not to gather and store the number list for each entry. The default is savenumberlist=false with Options 2 and 3. (See \glsentrynumberlist and \glsdisplaynumberlist in §5.2.) This setting is always true if you use Option 1 as a by-product of the way that indexing method works.

+

+ If you use the record option (with either no value or record=only or record=nameref) then this package option has no effect. With bib2gls, the number lists are automatically saved with the default save-locations=true and save-loclist=true resource settings.
+

+

+entrycounter=booleandefault: true; initial: false
+ If set, this will create the counter:
+glossaryentry
+ Each top level (level 0) entry will increment and display that counter at the start of the entry line when using glossary styles that support this setting. Note that if you also use subentrycounter the option order makes a difference. If entrycounter is specified first, the sub-entry counter will be dependent on the glossaryentry counter.

+If you use this option (and are using a glossary style that supports this option) then you can reference the entry number within the document using:

+\glsrefentry{label}
+ where label is the label associated with that glossary entry. This will use \ref if either entrycounter=true or subentrycounter=true, with the label prefixlabel, where label is the entry’s label and prefix is given by:
+\GlsEntryCounterLabelPrefixinitial: glsentry-
+ If both entrycounter=false and subentrycounter=false, \gls{label} will be used instead.

+

+If you use \glsrefentry, you must run LaTeX twice after creating the indexing files using makeglossaries, makeindex or xindy (or after creating the glstex file with bib2gls) to ensure the cross-references are up-to-date. This is because the counter can’t be incremented and labelled until the glossary is typeset.
+

+The glossaryentry counter can be reset back to zero with:

+\glsresetentrycounter
+ This does nothing if entrycounter=false. The glossaryentry counter can be simultaneously incremented and labelled (using \refstepcounter and \label) with:
+\glsstepentry{label}
+ This command is within the definition of \glsentryitem, which is typically used in glossary styles at the start of top level (level 0) entries. The argument is the entry label.

+The value of the glossaryentry counter can be displayed with:

+\theglossaryentry

+

+
+ This command is defined when the glossaryentry counter is defined, so won’t be available otherwise. The formatted value is more usually displayed with:
+\glsentrycounterlabel
+ This will do \theglossaryentry.\space if entrycounter=true, otherwise does nothing. This is therefore more generally useful in glossary styles as it will silently do nothing if the setting isn’t on. This command is used within the definition of \glsentryitem.

+If you want to test whether or not this option is currently enabled, use the conditional:

+\ifglsentrycounter true\else false\fiinitial: \iffalse
+ You can later switch it off using:
+\glsentrycounterfalse
+ and switch it back on with:
+\glsentrycountertrue
+ but note that this won’t define glossaryentry if entrycounter=true wasn’t used initially. You can also locally enable or disable this option for a specific glossary using the entrycounter \printglossary option.

+

+counterwithin=parent-counter
+ If used, this option will automatically set entrycountertrue and the glossaryentry counter will be reset every time parent-counter is incremented. An empty value indicates that glossaryentry has no parent counter (but glossaryentry will still be defined).

+

+The glossaryentry counter isn’t automatically reset at the start of each glossary, except when glossary section numbering is on and the counter used by counterwithin is the same as the counter used in the glossary’s sectioning command.
+

+If you want the counter reset at the start of each glossary, you can modify the glossary preamble(\glossarypreamble) to use \glsresetentrycounter. For example:

\renewcommand{\glossarypreamble}{% 
+  \glsresetentrycounter
+}
+
or if you are using \setglossarypreamble, add it to each glossary preamble, as required. For example:
\setglossarypreamble[acronym]{% 
+  \glsresetentrycounter
+  The preamble text here for the list of acronyms.
+}
+\setglossarypreamble{% 
+  \glsresetentrycounter
+  The preamble text here for the main glossary.
+}
+

+

+subentrycounter=booleandefault: true; initial: false
+ If set, each level 1 glossary entry will be numbered at the start of its entry line when using glossary styles that support this option. This option creates the counter
+glossarysubentry
+ If the entrycounter option is used before subentrycounter, then glossarysubentry will be added to the reset list for glossaryentry. If subentrycounter is used without entrycounter then the glossarysubentry counter will be reset by \glsentryitem. If subentrycounter is used before entrycounter then the two counters are independent.

+

+There’s no support for deeper hierarchical levels. 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.
+

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

+The glossarysubentry counter can be reset back to zero with:

+\glsresetsubentrycounter
+ This does nothing if subentrycounter=false. This command is used within the definition of \glsentryitem if entrycounter=false.

+The glossarysubentry counter can be simultaneously incremented and labelled (using \refstepcounter and \label) with:

+\glsstepsubentry{label}
+ This command is used in \glssubentryitem if subentrycounter=true, otherwise it does nothing. The argument is the entry label and is passed to \label is as for \glsrefentry.

+The value of the glossarysubentry counter can be displayed with:

+\theglossarysubentry

+

+
+ This command is defined when the glossarysubentry counter is defined, so won’t be available otherwise. The formatted value is more usually displayed with:
+\glssubentrycounterlabel
+ This will do \theglossarysubentry)\space if subentrycounter=true, otherwise does nothing. This is therefore more generally useful in glossary styles as it will silently do nothing if the setting isn’t on. This command is used in \glssubentryitem.

+If you want to test whether or not this option is currently enabled, use the conditional:

+\ifglssubentrycounter true\else false\fiinitial: \iffalse
+ You can later switch it off using:
+\glssubentrycounterfalse
+ and switch it back on with:
+\glssubentrycountertrue
+ but note that this won’t define glossarysubentry if subentrycounter=true wasn’t used initially. You can also locally enable or disable this option for a specific glossary using the subentrycounter \printglossary option.

+

+style=style-nameinitial: varies
+ This option sets the default glossary style to style-name. This is initialised to style=list unless classicthesis has been loaded, in which case the default is style=index. (The styles that use the description environment, such as the list style, are incompatible with classicthesis.)

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

+Alternatively, you can set the style later using:

+\setglossarystyle{style-name}
+ or use the style \printglossary option. (See §13 for further details.)

+

+nolong
+ This prevents the glossaries package from automatically loading glossary-long (which means that the 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 glossary styles defined in the glossary-long package (unless you explicitly load glossary-long).

+

+Some style packages implicitly load glossary-long, so this package may still end up being loaded even if you use nolong.
+

+

+nosuper
+ This prevents the glossaries package from automatically loading glossary-super (which means that the 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 glossary styles defined in the glossary-super package (unless you explicitly load glossary-super).

+

+This option is automatically implemented if xtab has been loaded as it’s incompatible with supertabular. This option is also automatically implemented if supertabular isn’t installed.
+

+

+nolist
+ This prevents the glossaries package from automatically loading 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 glossary styles defined in the glossary-list package (unless you explicitly load glossary-list). Note that since the default style is list (unless classicthesis has been loaded), you will also need to use the style option to set the style to something else.

+

+notree
+ This prevents the glossaries package from automatically loading 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 glossary styles defined in the glossary-tree package (unless you explicitly load glossary-tree). Note that if classicthesis has been loaded, the default style is index, which is provided by glossary-tree.

+

+Some style packages implicitly load glossary-tree, so this package may still end up being loaded even if you use notree.
+

+

+nostyles
+ This prevents all the predefined styles from being loaded. If you use this option, you need to load a glossary style package (such as glossary-mcols). Also if you use this option, you can’t use the style package option (unless you use stylemods with glossaries-extra). Instead you must either use \setglossarystyle or the style \printglossary option. Example:
\usepackage[nostyles]{glossaries}
+\usepackage{glossary-mcols}
+\setglossarystyle{mcoltree}
+
Alternatively:
\usepackage[nostyles,stylemods=mcols,style=mcoltree]{glossaries-extra}
+

+

+nonumberlist
+ This option will suppress the associated number lists in the glossaries (see also §12). This option can also be locally switched on or off for a specific glossary with the nonumberlist \printglossary options.

+

+Note that if you use Options 2 or 3 (makeindex or xindy) then the locations must still be valid even if this setting is on. This package option merely prevents the number list from being displayed, but both makeindex and xindy still require a location or cross-reference for each term that’s indexed.
+

+Remember that number list includes any cross-references, so suppressing the number list will also hide the cross-references (in which case, you may want to use seeautonumberlist).

+

+ With bib2gls, it’s more efficient to use save-locations=false in the resource options if no locations are required.
+

+

+seeautonumberlist
+ If you suppress the number lists with nonumberlist, described above, this will also suppress any cross-referencing information supplied by the see key in \newglossaryentry or \glssee. If you use seeautonumberlist, the see key will automatically implement nonumberlist=false for that entry. (Note this doesn’t affect \glssee.) For further details see §11.

+

+counter=counter-nameinitial: page
+ This setting indicates that counter-name should be the default counter to use in the number lists (see §12). This option can be overridden for a specific glossary by the counter optional argument of \newglossary or the counter key when defining an entry or by the counter option when referencing an entry.

+This option will redefine:

+\glscounterinitial: page
+ to counter-name.

+

+nopostdot=booleandefault: true; initial: true
+ If true, this option suppresses the default terminating full stop in glossary styles that use the post-description hook:
+\glspostdescription
+

+The default setting is nopostdot=false for the base glossaries package and nopostdot=true for glossaries-extra.

+

+ The glossaries-extra package provides postdot, which is equivalent to nopostdot=false, and also postpunc, which allows you to choose a different punctuation character.
+

+

+nogroupskip=booleandefault: true; initial: false
+ If true, this option suppresses the default vertical gap between letter groups used by some of the predefined glossary styles. This option can also be locally switched on or off for a specific glossary with the nogroupskip \printglossary options.

+This option is only relevant for glossary styles that use the conditional:

+\ifglsnogroupskip true\else false\fiinitial: \iffalse
+ to test for this setting.

+

+ If you are using bib2gls without the --group (or -g) switch then this option is irrelevant as there won’t be any letter groups.
+

+

+stylemods=listdefault: default
+

+Loads the glossaries-extra-stylemods package, which patches the predefined glossary styles. The list argument is optional. If present, this will also load glossary-element.sty for each element in the comma-separated list. See the glossaries-extra manual for further details.

+ +

+ +
+

2.4. Indexing Options

+

+

+seenoindex=valueinitial: error
+ (This option is only relevant with makeindex and xindy.) The see key automatically indexes the cross-referenced entry using \glssee. This means that if this key is used in an entry definition before the relevant indexing file has been opened, the indexing can’t be performed. Since this is easy to miss, the glossaries package by default issues an error message if the see key is used before \makeglossaries.

+This option may take one of the following values:

+ This is the default setting that issues an error message.

+

+ This setting will trigger a warning rather than an error.

+

+ This setting will do nothing.

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

+

+esclocations=booleandefault: true; initial: false
+

+Only applicable to makeindex and xindy. As from v4.50, the initial setting is now esclocations=false. Previously it was esclocations=true.

+Both makeindex and xindy are fussy about the location syntax (makeindex more so than xindy) so, if esclocations=true, the 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 indexing application. 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 glossary file before passing it to the relevant indexing application) then use esclocations=false to avoid the complex escaping of location values. This is now the default.

+If, however, your locations (for example, \thepage with the default counter=page) expand to a robust command then you may need to use esclocations=true. You may additionally need to set the following conditional to true:

+\ifglswrallowprimitivemods true\else false\fiinitial: \iffalse
+ which will locally redefine some primitives in order to escape special characters without prematurely expanding \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:

+\glswrallowprimitivemodstrue
+ but remember that it will have no effect with esclocations=false. If can be switched off with:
+\glswrallowprimitivemodsfalse
+

+If you are using makeindex and your location expands to content in the form cs {num}, where cs is a command (optionally preceded by \protect) and num is a location acceptable to makeindex, then you can use makeglossaries to make a suitable adjustment without esclocations=true. See §12.5 for furthe details.

+This isn’t an issue for Options 1 or 4 as the locations are written to the aux file and both methods use LaTeX syntax, so no conversion is required.

+

+indexonlyfirst=booleandefault: true; initial: false
+ If true, this setting will only index on first use. The default setting indexonlyfirst=false, will index the entry every time one of the \gls-like or \glstext-like commands are used. Note that \glsadd will always add information to the external glossary file (since that’s the purpose of that command).

+You can test if this setting is on using the conditional:

+\ifglsindexonlyfirst true\else false\fiinitial: \iffalse
+ This setting can also be switched on with:
+\glsindexonlyfirsttrue
+ and off with:
+\glsindexonlyfirstfalse
+

+

+Resetting the first use flag with commands like \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 first use flag before an entry has been indexed will prevent it from being indexed (unless specifically indexed with \glsadd).
+

+You can customise the default behaviour by redefining

+\glswriteentry{label}{indexing code}
+ where label is the entry’s label and indexing code is the code that writes the entry’s information to the external file. The default definition of \glswriteentry is:
\newcommand*{\glswriteentry}[2]{% 
+  \ifglsindexonlyfirst
+    \ifglsused{#1}{}{#2}% 
+  \else
+    #2% 
+  \fi
+}
+
This does indexing code unless indexonlyfirst=true and the entry identified by label has been marked as used

+For example, suppose you only want to index the first use for entries in the acronym glossary and not in the main (or any other) glossary:

\renewcommand*{\glswriteentry}[2]{% 
+ \ifthenelse\equal{\glsentrytype{#1}}{acronym}
+ {\ifglsused{#1}{}{#2}}% 
+ {#2}% 
+}
+
Here I’ve used \ifthenelse to ensure the arguments of \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 glossaries-extra package it’s possible to only index first use for particular categories. For example, if you only want this enabled for abbreviations then you can set the indexonlyfirst attribute for the abbreviation and, if appropriate, acronym categories. (Instead of using the indexonlyfirst package option.) See the glossaries-extra manual for further details.

+

+indexcrossrefs=booleandefault: true; initial: true
+

+This option is only available with glossaries-extra. If true, this will automatically index (\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 glossaries-extra manual for further details.

+

+ Note that bib2gls can automatically find dependent entries when it parses the bib file. Use the selection option to determine the selection of dependencies.
+

+

+autoseeindex=booleandefault: true; initial: true
+

+This option is only available with glossaries-extra. The base glossaries package always implements autoseeindex=true.

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

+

+ With bib2gls, use the selection resource option to determine the selection of dependencies.
+

+

+record=valuedefault: only; initial: off
+

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

+

+ This default setting indicates that bib2gls isn’t being used.

+

+record=only
+ This setting indicates that bib2gls is being used to fetch entries from one or more bib files, to sort the entries and collate the number lists, where the location information is the same as for Options 1, 2 and 3.

+

+record=nameref
+ This setting is like 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.

+

+record=hybrid
+ This setting indicates a hybrid approach where bib2gls is used to fetch entries from one or more bib files but makeindex or xindy are used for the indexing. This requires a more complicated document build and isn’t recommended.

+

+equations=booleandefault: true; initial: false
+

+This option is only available with glossaries-extra. If true, this option will cause the default location counter to automatically switch to equation when inside a numbered equation environment.

+

+floats=booleandefault: true; initial: false
+

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

+

+indexcounter
+

+This option is only available with glossaries-extra. This valueless option is primarily intended for use with bib2gls and hyperref allowing the page location 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 glossaries-extra manual for further details.

+ +

+ +
+

2.5. Sorting Options

+

+This section is mostly for Options 2 and 3. Only the sort and order options are applicable for Option 1.

+

+ With Options 4, 5 and 6, only sort=none is applicable (and this is automatically implemented by record=only and record=nameref). With bib2gls, the sort method is provided in the optional argument of \GlsXtrLoadResources not with the sort package option. There’s no sorting with Options 5 and 6.
+

+

+sanitizesort=booleandefault: true; initial: varies
+ This option determines whether or not to sanitize the sort value when writing to the external indexing file. For example, suppose you define an entry as follows:
\newglossaryentry{hash}{name={\#},sort={},
+ description={hash symbol}}
+
The sort value () must be sanitized before writing it to the indexing file, 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:
\newcommand{\mysortvalue}{AAA}
+\newglossaryentry{sample}{% 
+  name={sample},
+  sort={\mysortvalue},
+  description={an example}}
+
and you actually want \mysortvalue expanded, so that the entry is sorted according to AAA, then use the package option sanitizesortfalse.

+The default for Options 2 and 3 is sanitizesort=true, and the default for Option 1 is sanitizesort=false.

+

+sort=valueinitial: standard
+ If you use Options 2 or 3, this package option is the only way of specifying how to sort the glossaries. Only Option 1 allows you to specify sort methods for individual glossaries via the sort key in the optional argument of \printnoidxglossary. If you have multiple glossaries in your document and you are using Option 1, only use the package options sort=def or sort=use if you want to set this sort method for all your glossaries.

+

+sort=none
+ This setting is only for documents that don’t use \makeglossaries (Options 2 or 3) or \makenoidxglossaries (Option 1). 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 glossary is required or if \printunsrtglossary is used (Option 5). If you want an unsorted glossary with bib2gls, use the resource option sort=none instead. This option will redefine \glsindexingsetting to none.

+

+This option will still assign the sort key to its default value. It simply doesn’t process it. If you want the sort key set to an empty value instead, use sort=clear instead.
+

+

+sort=clear
+ As sort=none but sets the sort key to an empty value. This will affect letter group formations in \printunsrtglossary with Option 5. See the glossaries-extra manual for further details. This option will redefine \glsindexingsetting to none. The remaining sort options listed below don’t change \glsindexingsetting.

+

+sort=def
+ Entries are sorted in the order in which they were defined. With Option 1, this is implemented by simply iterating over all defined entries so there’s no actual sorting. With Options 2 and 3, sorting is always performed (since that’s the purpose of makeindex and xindy). This means that to obtain a list in order of definition, the sort key is assigned a numeric value that’s incremented whenever a new entry is defined.

+

+sort=use
+ Entries are sorted according to the order in which they are used in the document. With Option 1, this order is obtained by iterating over a list that’s formed with the aux file is input at the start of the document. With Options 2 and 3, again the sort key is assigned a numeric value, but in this case the value is incremented, and the sort key is assigned, the first time an entry is indexed.

+Both sort=def and sort=use zero-pad the sort key to a six digit number using:

+\glssortnumberfmt{number}
+ This can be redefined, if required, before the entries are defined (in the case of sort=def) or before the entries are used (in the case of sort=use).

+Note that the group styles (such as listgroup) are incompatible with the sort=use and sort=def options.

+

+sort=standard
+ Entries are sorted according to the value of the sort key used in \newglossaryentry (if present) or the name key (if sort key is missing).

+When the standard sort option is in use, you can hook into the sort mechanism by redefining:

+\glsprestandardsort{sort cs}{type}{entry-label}
+ where sort cs is a temporary control sequence that stores the sort value (which was either explicitly set via the sort key or implicitly set via the name key) before any escaping of the makeindex/xindy special characters is performed. By default \glsprestandardsort just does:
+\glsdosanitizesort

+

+
+ which sanitizes sort cs if sanitizesort=true (or does nothing if sanitizesort=false).

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

+

+Redefining \glsprestandardsort won’t affect any entries that have already been defined and will have no effect at all if you use another sort setting.
+

+

Example 9: Mixing Alphabetical and Order of Definition Sorting
Suppose I have three glossaries: main, acronym and notation, and let’s suppose I want the main and acronym glossaries to be sorted alphabetically, but the notation type should be sorted in order of definition.

+For Option 1, the sort option can be used in \printnoidxglossary:

\printnoidxglossary[sort=word]
+\printnoidxglossary[type=acronym,sort=word]
+\printnoidxglossary[type=notation,sort=def]
+

+For Options 2 or 3, I can set sort=standard (which is the default), and I can either define all my main and acronym entries, then redefine \glsprestandardsort to set sort cs to an incremented integer, and then define all my notation entries. Alternatively, I can redefine \glsprestandardsort to check for the glossary type and only modify sort cs if type is notation.

+The first method can be achieved as follows:

\newcounter{sortcount}
+
+\renewcommand{\glsprestandardsort}[3]{% 
+  \stepcounter{sortcount}% 
+  \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% 
+}
+
The second method can be achieved as follows:
\newcounter{sortcount}
+
+\renewcommand{\glsprestandardsort}[3]{% 
+  \ifdefstring{#2}{notation}% 
+  {% 
+     \stepcounter{sortcount}% 
+     \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% 
+  }% 
+  {% 
+     \glsdosanitizesort
+  }% 
+}
+
(\ifdefstring is defined by the etoolbox package, which is automatically loaded by glossaries.) For a complete document, see the sample file sampleSort.tex.

+

Example 10: Customizing Standard Sort (Options 2 or 3)
Suppose you want a glossary of people and you want the names listed as first-name surname in the glossary, but you want the names sorted by surname, first-name. You can do this by defining a command called, say, \name{first-name}{surname} that you can use in the name key when you define the entry, but hook into the standard sort mechanism to temporarily redefine \name while the sort value is being set.

+First, define two commands to set the person’s name:

\newcommand{\sortname}[2]{#2, #1}
+\newcommand{\textname}[2]{#1 #2}
+
and \name needs to be initialised to \textname:
\let\name\textname
+
Now redefine \glsprestandardsort so that it temporarily sets \name to \sortname and expands the sort value, then sets \name to \textname so that the person’s name appears as first-name surname in the text:
\renewcommand{\glsprestandardsort}[3]{% 
+ \let\name\sortname
+ \edef#1{\expandafter\expandonce\expandafter{#1}}% 
+ \let\name\textname
+ \glsdosanitizesort
+}
+
(The somewhat complicate use of \expandafter etc helps to protect fragile commands, but care is still needed.)

+Now the entries can be defined:

\newglossaryentry{joebloggs}name={\name{Joe}{Bloggs}},
+  description={some information about Joe Bloggs}
+
+\newglossaryentry{johnsmith}{name={\name{John}{Smith}},
+  description={some information about John Smith}}
+
For a complete document, see the sample file samplePeople.tex.

+

+orderinitial: word
+ This may take two values:

+

+order=word
+ Word order (“sea lion” before “seal”).

+

+order=letter
+ Letter order (“seal” before “sea lion”).

+

+Note that with Options 2 and 3, the order option has no effect if you explicitly call makeindex or xindy.
+

+If you use Option 1, this setting will be used if you use sort=standard in the optional argument of \printnoidxglossary:

\printnoidxglossary[sort=standard]
+
Alternatively, you can specify the order for individual glossaries:
\printnoidxglossary[sort=word]
+\printnoidxglossary[type=acronym,sort=letter]
+

+

+ With bib2gls, use the break-at option in \GlsXtrLoadResources instead of order.
+

+

+makeindex

+

+
+ The glossary information and indexing style file will be written in makeindex format. If you use makeglossaries or makeglossaries-lite, it will automatically detect that it needs to call makeindex. If you don’t use makeglossaries, you need to remember to use makeindex not xindy. The indexing style file will been given a ist extension.

+You may omit this package option if you are using Option 2 as this is the default. It’s available in case you need to override the effect of an earlier occurrence of xindy in the package option list.

+

+xindy={options}

+

+
+ The glossary information and indexing style file will be written in xindy format. If you use makeglossaries, it will automatically detect that it needs to call xindy. If you don’t use makeglossaries, you need to remember to use xindy not makeindex. The indexing style file will been given a xdy extension.

+This package option may additionally have a value that is a key=value comma-separated list to override some default options. Note that these options are irrelevant if you explicitly call xindy. See §14 for further details on using xindy with the glossaries package.

+You can test if this option has been set using the conditional:

+\ifglsxindy true\else false\fiinitial: \iffalse
+ Note that this conditional should not be changed after \makeglossaries otherwise the syntax in the glossary files will be incorrect. If this conditional is false, it means that any option other than Option 3 is in effect. (If you need to know which indexing option is in effect, check the definition of \glsindexingsetting instead.)

+The options value may be omitted. If set, it should be a key=value list, where the following three options may be used:

+

+language={value}
+ The language module to use, which is passed to xindy with the -L switch. The default is obtained from \languagename but note that this may not be correct as xindy has a different labelling system to babel and polyglossia.

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

+However, even if the appropriate mapping is available, \languagename may still not expand to the language required for the glossary. In which case, you need to specify the correct xindy language. For example:

\usepackage[brazilian,english]{babel}
+\usepackage[xindy=language=portuguese]{glossaries}
+
If you have multiple glossaries in different languages, use \GlsSetXdyLanguage to set the language for each glossary.

+

+codepage={value}
+ The codepage is the file encoding for the xindy files and is passed to xindy with the -C switch. The default codepage is obtained from \inputencodingname. As from v4.50, if \inputencodingname isn’t defined, UTF-8 is assumed (which is identified by the label utf8). If this is incorrect, you will need to use the codepage option but make sure you use the xindy codepage label (for example, cp1252 or latin9). See the xindy documentation for further details.

+

+The codepage may not simply be the encoding but may include a sorting rule, such as ij-as-y-utf8 or din5007-utf8. See §14.2.
+

+For example:

\usepackage[xindy=language=english,codepage=cp1252]
+  {glossaries}
+

+

+glsnumbers={boolean}default: true; initial: true
+ If true, this option will define the number group in the xindy style file, which by default will be placed before the “A” letter group. If you don’t want this letter group, set this option to false. Note that the “A” letter group is only available with Latin alphabets, so if you are using a non-Latin alphabet, you will either need to switch off the number group or identify the letter group that it should come before with \GlsSetXdyNumberGroupOrder.

+

+xindygloss

+

+
+ This is equivalent to xindy without any value supplied and may be used as a document class option. The language and code page can be set via \GlsSetXdyLanguage and \GlsSetXdyCodePage if the defaults are inappropriate (see §14.2.)

+

+xindynoglsnumbers

+

+
+ This is equivalent to xindy={glsnumbers=false} and may be used as a document class option.

+

+automake=valuedefault: immediate; initial: false
+ This option will attempt to use the shell escape to run the appropriate indexing application. You will still need to run LaTeX twice. For example, if the document in the file myDoc.tex contains:
\usepackage[automake]{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={an example}}
+\begin{document}
+\gls{sample}
+\printglossaries
+\end{document}
+
Then the document build is now:
pdflatex myDoc
+pdflatex myDoc
+
This will run makeindex on every LaTeX run. If you have a large glossary with a complex document build, this can end up being more time-consuming that simply running makeindex (either explicitly or via makeglossaries) the minimum number of required times.

+

+Note that you will need to have the shell escape enabled (restricted mode for a direct call to makeindex and unrestricted mode for xindy, makeglossaries or makeglossaries-lite). If you switch this option on and you are using LuaLaTeX, then the shellesc package will be loaded.
+

+If this option doesn’t seem to work, open the log file in your text editor and search for “runsystem”. For example, if the document is in a file called myDoc.tex and it has:

\usepackage[automake]{glossaries}
+
and you run LaTeX in restricted mode, then if call was successful, you should find the following line in the file myDoc.log:
runsystem(makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo)...executed safely (allowed).
+
The parentheses immediately after “runsystem” show how the command was called. The bit after the three dots ... indicates whether or not the command was run and, if so, whether it was successful. In the above case, it has “executed safely (allowed)”. This means that it was allowed to run in restricted mode because makeindex is on the list of trusted applications.

+If you change the package option to:

\usepackage[automake=makegloss]{glossaries}
+
and rerun LaTeX in restricted mode, then the line in myDoc.log will now be:
runsystem(makeglossaries myDoc)...disabled (restricted).
+
This indicates that an attempt was made to run makeglossaries (rather than a direct call to makeindex), which isn’t permitted in restricted mode. There will be a similar message with automake=lite or if the xindy option is used. These cases require the unrestricted shell escape.

+

+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 shell escape disabled) and search the log file for “runsystem” to find out exactly what system calls are being attempted.
+

+If the document is compiled in unrestricted mode, the corresponding line in the log file should now be:

runsystem(makeglossaries myDoc)...executed.
+
This means that makeglossaries was run. If it has “failed” instead of “executed”, then it means there was a fatal error. Note that just because the log file has “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 indexing application’s transcript file (for example, the glg file, myDoc.glg in the above, for the main glossary).

+

+automake=false
+ No attempt is made to use the shell escape.

+

+ This is now a deprecated synonym for automake=delayed. This used to be the default if the value to automake wasn’t supplied, but the default switched to the less problematic automake=immediate in version 4.50.

+

+automake=delayed
+ A direct call to makeindex or xindy (as appropriate) for each non-empty glossary will be made at the end of the document using a delayed write to ensure that the glossary files are complete. (It’s necessary to delay writing to the indexing files in order to ensure that \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).

+

+automake=immediate
+ A direct call to makeindex or xindy (as appropriate) for each non-empty glossary will be made at the start of \makeglossaries using an immediate write. This ensures that the indexing files are read by the indexing application before they are opened (which will clear their content).

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

+

+automake=makegloss
+ A call to makeglossaries will be made at the start of \makeglossaries using an immediate write if the aux file exists. On the one hand, it’s better to use makeglossaries as it has some extra diagnostic functions, but on the other hand it both requires Perl and the unrestricted shell escape.

+

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

+

+automakeglossalias: makegloss
+ This valueless option is equivalent to automake=makegloss.

+

+automakeglosslitealias: lite
+ This valueless option is equivalent to automake=lite.

+

+disablemakegloss
+ This valueless option indicates that \makeglossaries and \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 §1.3 and automatically performs \makeglossaries or \makenoidxglossaries but you don’t want this. (For example, you want to use a different indexing method or you want to disable indexing while working on a draft document.)

+Naturally, if there’s a particular reason why the class or package insists on a specific 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 \PassOptionsToPackage before glossaries is loaded. Note that this does nothing if \makeglossaries or \makenoidxglossaries has already been used whilst enabled.

+

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

+For example, suppose the class customclass.cls automatically loads glossaries and does \makeglossaries but you need an extra glossary, which has to be defined before \makeglossaries, then you can do:

\documentclass[disablemakegloss]{customclass}
+\newglossary*{functions}{Functions}
+\setupglossaries{restoremakegloss}
+\makeglossaries
+
or
\PassOptionsToPackage{disablemakegloss}{glossaries}
+\documentclass{customclass}
+\newglossary*{functions}{Functions}
+\setupglossaries{restoremakegloss}
+\makeglossaries
+

+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 record=only or record=nameref options with glossaries-extra then you can’t use \makeglossaries or \makenoidxglossaries regardless of restoremakegloss.

+ +

+ +
+

2.6. Glossary Type Options

+

+

+nohypertypes={list}
+ Use this option if you have multiple glossaries and you want to suppress the entry hyperlinks for a particular glossary or glossaries. The value of this option should be a comma-separated list of glossary types where \gls etc shouldn’t have hyperlinks by default. Make sure you enclose the value in braces if it contains any commas. Example:
\usepackage[acronym,nohypertypes={acronym,notation}]
+  {glossaries}
+\newglossary[nlg]{notation}{not}{ntn}{Notation}
+
As illustrated above, the glossary doesn’t need to exist when you identify it in nohypertypes.

+

+The values must be fully expanded, so don’t try, for example, nohypertypes=\acronymtype.
+

+You may also use:

+\GlsDeclareNoHyperList{list}
+ instead or additionally. See §5.1 for further details.

+

+ The glossaries-extra package has the nohyper category attribute which will suppress the hyperlink for entries with the given category, which can be used as an alternative to suppressing the hyperlink on a per-glossary basis.
+

+

+nomain
+ This suppresses the creation of the main glossary and associated glo file, if unrequired. Note that if you use this option, you must create another glossary in which to put all your entries (either via the acronym (or acronyms) package option described in §2.7 or via the symbols, numbers or index options described in §2.9 or via \newglossary described in §9). Even if you don’t intend to display the glossary, a default glossary is still required.

+If you don’t use the main glossary and you don’t use this option to suppress its creation, makeglossaries will produce a warning:

Warning: File 'filename.glo' is empty.
+Have you used any entries defined in glossary 'main'?
+Remember to use package option 'nomain' if 
+you don't want to use the main glossary.
+
If you did actually want to use the main glossary and you see this warning, check that you have referenced the entries in that glossary via commands such as \gls.

+

+symbols
+ This valueless option defines a new glossary type with the label symbols via
\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}
+
It also defines
+\printsymbols[options]

+

+
+ which is a synonym for
\printglossary[type=symbols,options]
+

+If you use Option 1, you need to use:

\printnoidxglossary[type=symbols,options]
+
to display the list of symbols.

+

+Remember to use the nomain package option if you’re only interested in using this symbols glossary and don’t intend to use the main glossary.
+

+

+ The glossaries-extra package has a slightly modified version of this option which additionally provides \glsxtrnewsymbol as a convenient shortcut method for defining symbols. See the glossaries-extra manual for further details.
+

+

+numbers
+ This valueless option defines a new glossary type with the label numbers via
\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}
+
It also defines
+\printnumbers[options]

+

+
+ which is a synonym for
\printglossary[type=numbers,options]
+

+If you use Option 1, you need to use:

\printnoidxglossary[type=numbers,options]
+
to display the list of numbers.

+

+Remember to use the nomain package option if you’re only interested in using this numbers glossary and don’t intend to use the main glossary.
+

+

+ The glossaries-extra package has a slightly modified version of this option which additionally provides \glsxtrnewnumber as a convenient shortcut method for defining numbers. See the glossaries-extra manual for further details.
+

+

+index
+ This valueless option defines a new glossary type with the label index via
\newglossary[ilg]{index}{ind}{idx}{\indexname}
+
It also defines
+\newterm[key=value list]{entry-label}

+

+
+ which is a synonym for
\newglossaryentry{entry-label}{type={index},name={entry-label},
+description={\nopostdesc},options}
+
and
+\printindex[options] v4.02+

+

+
+ which is a synonym for
\printglossary[type=index,options]
+

+If you use Option 1, you need to use:

\printnoidxglossary[type=index,options]
+
to display this glossary.

+

+Remember to use the nomain package option if you’re only interested in using this index glossary and don’t intend to use the main glossary. Note that you can’t mix this option with \index. Either use glossaries for the indexing or use a custom indexing package, such as makeidx, imakeidx. (You can, of course, load one of those packages and load glossaries without the index package option.)
+

+Since the index isn’t designed for terms with descriptions, you might also want to disable the hyperlinks for this glossary using the package option nohypertypes=index or the command

\GlsDeclareNoHyperList{index}
+
However, it can also be useful to link to the index in order to look up the term’s location list to find other parts of the document where it might be used. For example, this manual will have a hyperlink to the index for general terms, such as table of contents, or general commands, such as \index, that aren’t defined anywhere in the document.

+The example file sample-index.tex illustrates the use of the index package option.

+

+noglossaryindex
+ This valueless option switches off index if index has been passed implicitly (for example, through global document options). This option can’t be used in \setupglossaries.

+ +

+ +
+

2.7. acronym and abbreviation Options

+

+

+acronym=booleandefault: true; initial: false
+ If true, this creates a new glossary with the label acronym. This is equivalent to:
\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
+
It will also provide (if not already defined)
+\printacronyms[options]

+

+
+ that’s equivalent to
\printglossary[type=acronym,options]
+

+If you are using Option 1, you need to use

\printnoidxglossary[type=acronym,options]
+
to display the list of acronyms.

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

+

+Remember to use the nomain package option if you’re only interested in using this acronym glossary. (That is, you don’t intend to use the main glossary.)
+

+

+ The glossaries-extra extension package comes with an analogous abbreviations option, which creates a new glossary with the label abbreviations and sets the command \glsxtrabbrvtype to this. If the acronym option hasn’t also been used, then \acronymtype will be set to \glsxtrabbrvtype. This enables both \newacronym and \newabbreviation to use the same glossary.

+Make sure you have at least v1.42 of glossaries-extra if you use the acronym (or acronyms) package option with the extension package to avoid a bug that interferes with the abbreviation style.

+

+

+acronyms
+ This is equivalent to acronym=true and may be used in the document class option list.

+

+abbreviations
+

+This valueless option provided by glossaries-extra creates a new glossary type with the label abbreviations using:

\newglossary[glg-abr]{abbreviations}{gls-abr}{glo-abr}{\abbreviationsname}
+
The label can be accessed with \glsxtrabbrvtype, which is analogous to \acronymtype. See glossaries-extra manual for further details.

+

+acronymlists={label-list}
+ This option is used to identify the glossaries that contain acronyms so that they can have their entry format adjusted by \setacronymstyle. (It also enables \forallacronyms to work.)

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

+If you have other lists of acronyms, you can specify them as a comma-separated list in the value of acronymlists. For example, if you use the acronym package option but you also want the main glossary to also contain a list of acronyms, you can do:

\usepackage[acronym,acronymlists=main]{glossaries}
+
No check is performed to determine if the listed glossaries exist, so you can add glossaries you haven’t defined yet. For example:
\usepackage[acronym,acronymlists={main,acronym2}]
+  {glossaries}
+\newglossary[alg2]{acronym2}{acr2}{acn2}% 
+  {Statistical Acronyms}
+
You can use
+\DeclareAcronymList{list}
+ instead of or in addition to the acronymlists option. This will add the glossaries given in list to the list of glossaries that are identified as lists of acronyms. To replace the list of acronym lists with a new list use:
+\SetAcronymLists{list}
+

+If the list is changed after \setacronymstyle then it will result in inconsistencies in the formatting. If this does happen, and is for some reason unavoidable (such as \setacronymstyle occurring in a package that loads glossaries), you will need to set the entry format to match the style:

\DeclareAcronymList{glossary-label}
+\defglsentryfmt[glossary-label]{\GlsUseAcrEntryDispStyle}{style-name}
+

+You can determine if a glossary has been identified as being a list of acronyms using:

+\glsIfListOfAcronyms{glossary-label}{true}{false}
+

+

+ This option and associated commands are incompatible with glossaries-extra’s abbreviation mechanism. Lists of abbreviations don’t need identifying.
+

+

+shortcuts={boolean}default: false; initial: false
+ This option provides shortcut commands for acronyms. See §6 for further details. Alternatively you can use:
+\DefineAcronymSynonyms
+

+

+ The glossaries-extra package provides additional shortcuts.
+

+ +

+ +
+

2.8. Deprecated Acronym Style Options

+

+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 §1.1). 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 acronym style, use \setacronymstyle instead. See §6 for further details.

+

+descriptionDeprecated
+ This option changed the definition of \newacronym to allow a description. This option may be replaced by:
\setacronymstyle{long-short-desc}
+
or (with smallcaps)
\setacronymstyle{long-sc-short-desc}
+
or (with smaller)
\setacronymstyle{long-sm-short-desc}
+
or (with footnote)
\setacronymstyle{footnote-desc}
+
or (with footnote and smallcaps)
\setacronymstyle{footnote-sc-desc}
+
or (with footnote and smaller)
\setacronymstyle{footnote-sm-desc}
+
or (with dua)
\setacronymstyle{dua-desc}
+

+

+ This option changed the definition of \newacronym and the way that acronyms are displayed. This option may be replaced by:
\setacronymstyle{long-sc-short}
+
or (with description)
\setacronymstyle{long-sc-short-desc}
+
or (with description and footnote)
\setacronymstyle{footnote-sc-desc}
+

+

+ This option changed the definition of \newacronym and the way that acronyms are displayed. This option may be replaced by:
\setacronymstyle{long-sm-short}
+
or (with description)
\setacronymstyle{long-sm-short-desc}
+
or (with description and footnote)
\setacronymstyle{footnote-sm-desc}
+

+

+ This option changed the definition of \newacronym and the way that acronyms are displayed. This option may be replaced by:
\setacronymstyle{footnote}
+
or (with smallcaps)
\setacronymstyle{footnote-sc}
+
or (with smaller)
\setacronymstyle{footnote-sm}
+
or (with description)
\setacronymstyle{footnote-desc}
+
or (with smallcaps and description)
\setacronymstyle{footnote-sc-desc}
+
or (with smaller and description)
\setacronymstyle{footnote-sm-desc}
+

+

+ This option changed the definition of \newacronym so that acronyms are always expanded. This option may be replaced by:
\setacronymstyle{dua}
+
or (with description)
\setacronymstyle{dua-desc}
+

+ +

+ +
+

2.9. Other Options

+

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

+

+accsupp
+

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

+

+prefix
+

+Only available with glossaries-extra, this option loads the glossaries-prefix package.

+

+nomissingglstext=booleandefault: true; initial: false
+

+This option may be used to suppress the boilerplate text generated by \printglossary if the indexing file is missing.

+

+mfirstuc=valueinitial: unexpanded
+

+The value may be either expanded or unexpanded and performs the same function as mfirstuc’s expanded and unexpanded package options. Note that there’s no value corresponding to mfirstuc’s other package option.

+The default is mfirstuc=unexpanded to safeguard against glossary styles that convert the description to sentence case. With older versions of mfirstuc (pre v2.08), fragile commands in the description would not have been affected by the case change, but now, if the entire description is passed to \MFUsentencecase, it will be expanded, which could break existing documents.

+

+compatible-2.07Deprecated
+

+Compatibility mode for old documents created using version 2.07 or below. This option is now only available with rollback (see §1.1).

+

+compatible-3.07Deprecated
+ Compatibility mode for old documents created using version 3.07 or below. This option is now only available with rollback (see §1.1).

+

+kernelglossredefs=valuedefault: true; initial: false
+ As a legacy from the precursor glossary package, the standard glossary commands provided by the LaTeX kernel (\makeglossary and \glossary) are redefined in terms of the glossaries package’s commands. However, they were never documented in this user manual, and the conversion guide (“Upgrading from the glossary package to the glossaries package”) 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 glossaries and no longer worked when they were removed, so they were restored in v4.41 with this option to undo the effect with kernelglossredefs=true as the default. As from v4.50, the default is now kernelglossredefs=false.

+

+ Don’t redefine \glossary and \makeglossary. If they have been previously redefined by kernelglossredefs their original definitions (at the time glossaries was loaded) will be restored.

+

+ Redefine \glossary and \makeglossary, but their use will trigger warnings.

+

+ Redefine \glossary and \makeglossary without any warnings.

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

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

+ +

+ +
+

2.10. Setting Options After the Package is Loaded

+

+Some of the options described above may also be set after the glossaries package has been loaded using

+\setupglossaries{options}
+ The following package options can’t be used in \setupglossaries: xindy, xindygloss, xindynoglsnumbers, makeindex, nolong, nosuper, nolist, notree, nostyles, nomain, compatible-2.07, translate, notranslate, languages, acronym. These options have to be set while the package is loading, except for the xindy sub-options which can be set using commands like \GlsSetXdyLanguage (see §14 for further details).

+

+If you need to use this command, use it as soon as possible after loading 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.
+

+

+

+ +

+ +
+

3. Setting Up

+

+In the preamble you need to indicate which method you want to use to generate the glossary (or glossaries). The available options with both glossaries and glossaries-extra are summarized in §1.3. This chapter documents Options 1, 2 and 3, which are provided by the base package. See the glossaries-extra and bib2gls manuals for the full documentation of the other options.

+If you don’t need to display any glossaries, for example, if you are just using the glossaries package to enable consistent formatting, then skip ahead to §4.

+ +

+ +
+

3.1. Option 1

+

+The command

+\makenoidxglossaries

+

+
+ must be placed in the document preamble. This sets up the internal commands required to make Option 1 work. If you omit \makenoidxglossaries none of the glossaries will be displayed.

+ +

+ +
+

3.2. Options 2 and 3

+

+The command

+\makeglossaries

+

+
+ must be placed in the document preamblein order to create the customised makeindex (ist) or xindy (xdy) style file (for Options 2 or 3, respectively) and to ensure that glossary entries are written to the appropriate output files. If you omit \makeglossaries none of the indexing files will be created.

+

+ If you are using glossaries-extra, \makeglossaries has an optional argument that allows you to have a hybrid of Options 1 or 2 or Options 1 or 3. See glossaries-extra manual for further details.
+

+

+Note that some of the commands provided by the glossaries package must not be used after \makeglossaries as they are required when creating the customised style file. If you attempt to use those commands after \makeglossaries you will generate an error. Similarly, there are some commands that must not be used before \makeglossaries because they require the associated indexing files to be open, if those files should be created. These may not necessarily generate an error or warning as a different indexing option may be chosen that doesn’t require those files (such as Options 5 or 6).
+

+The \makeglossaries command internally uses:

+\writeist
+ to create the custom makeindex/xindy style file. This command disables itself by setting itself to \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 \jobname.ist (Option 2) or \jobname.xdy (Option 3). This name may be changed using:

+\setStyleFile{name}
+ where name is the name of the style file without the extension.

+There is a hook near the end of \writeist that can be set with:

+\GlsSetWriteIstHook{code}
+ The 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:
+\glswrite
+ Note that this register is defined by \writeist to prevent an unnecessary write register from being created in the event that neither makeindex nor xindy is required.

+If you use the \GlsSetWriteIstHook hook to write extra information to the style file, make sure you use the appropriate syntax for the desired indexing application. For example, with makeindex:

\GlsSetWriteIstHook{% 
+ \write\glswrite{page_precedence "arnAR"}% 
+ \write\glswrite{line_max 80}% 
+}
+
This changes the page precedence and the maximum line length used by makeindex.

+Remember that if you switch to xindy, this will no longer be valid code.

+You can suppress the creation of the customised xindy or makeindex style file using:

+\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 glossaries package. This command sets \writeist to \relax (making it do nothing) but will also update the xindy attribute list if applicable.

+If you have a custom xdy file created when using glossaries version 2.07 (2010-0710) or below, you will need to use rollback and the 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 Legacy Documents and TeX Live Docker Images).

+Each glossary entry is assigned a number list that lists all the locations in the document where that entry was used. By default, the location refers to the page number but this may be overridden using the counter package option. The default form of the location number assumes a full stop compositor (for example, 1.2), but if your location numbers use a different compositor (for example, 1-2) you need to set this using

+\glsSetCompositor{character}
+{symbol} For example:
\glsSetCompositor{-}
+
This command must not be used after \makeglossaries. Note that with makeindex, any locations with the wrong compositor (or one that hasn’t been correctly identified with \glsSetCompositor) will cause makeindex to reject the location with an invalid number/digit message. As from v4.50, makeglossaries will check for this message and attempt a correction, but this can result in an incorrectly formatted location in the number list. See the information about makeglossaries’s -e switch in §1.6.1 for further details.

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

+If you use Option 3, you can have a different compositor for page numbers starting with an upper case alphabetical character using:

+\glsSetAlphaCompositor{character}

+

+
+ This command is only available with xindy. For example, if you want number lists containing a mixture of A-1 and 2.3 style formats, then do:
\glsSetCompositor{.}\glsSetAlphaCompositor{-}
+
See §12 for further information about number lists.

+ +

+ +
+

4. Defining glossary entries

+

+

+ If you want to use bib2gls, entries must be defined in bib files using the syntax described in the bib2gls user manual.
+

+Acronyms are covered in §6 but they use the same underlying mechanism as all the other glossary entries, so it’s a good idea to read this chapter first. The keys provided for \newglossaryentry can also be used in the optional argument of \newacronym, although some of them, such as first and plural, interfere with the acronym styles.

+All glossary entries must be defined before they are used, so it is better to define them in the document preambleto ensure this. In fact, some commands such as \longnewglossaryentry may only be used in the preamble. See §4.8 for a discussion of the problems with defining entries within the document instead of in the preamble. (The glossaries-extra package has an option that provides a restricted form of document definitions that avoids some of the issues discussed in §4.8.)

+Option 1 enforces the preamble-only restriction on \newglossaryentry. Option 4 requires that definitions are provided in bib format. Options 5 and 6 work best with either preamble-only definitions or the use of the glossaries-extra package option docdef=restricted.
+

+Bear in mind that with docdef=restricted, the entries must be defined before any entries are used, including when they are displayed in the glossary (for example, with \printunsrtglossary) or where they appear in the table of contents 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 entries that are indexed in the document (using any of the commands described in §5.1, §10 or §11) will appear in the glossary. See §8 to find out how to display the glossary.

+New glossary entries are defined using the command:

+\newglossaryentry{entry-label}{key=value list}
+ This is a short command, so values in key=value list can’t contain any paragraph breaks. Take care to enclose values containing any commas (,) or equal signs (=) with braces to hide them from the key=value list parser.

+If you have a long description that needs to span multiple paragraphs, use the following instead:

+\longnewglossaryentry{entry-label}{key=value list}{description}
+ Note that this command may only be used in the preamble (regardless of docdef).

+

+Be careful of unwanted spaces.
+

+\longnewglossaryentry will remove trailing spaces in the description (via \unskip) but won’t remove leading spaces. This command also appends \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 glossaries-extra package provides a starred version of \longnewglossaryentry that doesn’t append either \unskip or \nopostdesc.

+There are also commands that will only define the entry if it hasn’t already been defined:

+\provideglossaryentry{entry-label}{key=value list}
+ and
+\longprovideglossaryentry{entry-label}{key=value list}{description}
+ (These are both preamble-only commands.)

+For all the above commands, the first argument, entry-label, must be a unique label with which to identify this entry. 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 \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 UTF-8 characters in the label.

+

+Be careful of babel’s options that change certain punctuation characters, such as colon (:) or double-quote ("), to active characters.
+

+The second argument, key=value list, is a key=value list that supplies the relevant information about this entry. There are two required fields: description and either name or parent. The description is set in the third argument of \longnewglossaryentry and \longprovideglossaryentry. With the other commands it’s set via the description key.

+As is typical with key=value lists, values that contain a comma (,) or equal sign (=) must be enclosed in braces. Available fields are listed below. Additional fields are provided by the supplementary packages glossaries-prefix16) and glossaries-accsupp17) and also by glossaries-extra. You can also define your own custom keys (see §4.3).

+

+name={text}
+ The name of the entry (as it will appear in the glossary). If this key is omitted and the parent key is supplied, this value will be the same as the parent’s name.

+

+If the name key contains any commands, you must also use the sort key (described below) if you intend sorting the entries alphabetically with Options 1, 2 or 3, otherwise the entries can’t be sorted correctly.
+

+

+description={text}
+ A brief description of this term (to appear in the glossary). Within this value, you can use:
+\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 description={\nopostdesc}. If you want a paragraph break in the description use:
+\glspar
+ or, better, use \longnewglossaryentry. However, note that not all glossary styles support multi-line descriptions. If you are using one of the tabular-like glossary styles that permit multi-line descriptions and you really need an explicit line break, use \newline not \\ (but in general, avoid \\ outside of tabular contexts anyway and use a ragged style if you are having problems with line breaks in a narrow column).

+

+ With glossaries-extra, use \glsxtrnopostpunc instead of \nopostdesc to suppress the post-description punctuation.
+

+

+parent=parent-label
+ This key establishes the entry’s hierarchical level. The value must be the label of the parent entry (not the name, although they may be the same). The parent-label value must match the entry-label used when the parent entry was defined. See §4.5 for further details.

+

+The parent entry must be defined before it’s referenced in the parent key of another entry.
+

+

+descriptionplural={text}
+ The plural form of the description, if required. If omitted, the value is set to the same as the description key.

+

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

+This key is automatically set by \newacronym. Although it is possible to override it by using text in the optional argument of \newacronym, it will interfere with the acronym style and cause unexpected results.

+

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

+You may prefer to use acronyms6) or the abbreviations or the category post-link hook (\glsdefpostlink) provided by glossaries-extra if you would like to automatically append content on first use in a consistent manner. See, for example, Gallery: Units (glossaries-extra.sty).

+Although it is possible to use first in the optional argument of \newacronym, it can interfere with the acronym style and cause unexpected results.

+

+plural={text}
+ How the entry will appear in the document text when using \glspl on subsequent use. If this field is omitted, the value is obtained by appending \glspluralsuffix to the value of the text field.

+Although it is possible to use plural in the optional argument of \newacronym, it can interfere with the acronym style and cause unexpected results. Use shortplural instead, if the default value is inappropriate.

+

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

+Although it is possible to use firstplural in the optional argument of \newacronym, it can interfere with the acronym style and cause unexpected results. Use shortplural and longplural instead, if the default value is inappropriate.

+

+Prior to version 1.13, the default value of firstplural was always taken by appending “s” to the first key, which meant that you had to specify both plural and firstplural, even if you hadn’t used the first key.
+

+

+symbol={symbol}initial: \relax
+ This field is provided to allow the user to specify an associated symbol. If omitted, the value is set to \relax. Note that not all glossary styles display the symbol.

+

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

+

+sort=valueinitial: entry name
+ This value indicates the text to be used by the sort comparator when ordering all the glossary entries. If omitted, the value is given by the name field unless one of the package options sort=def and sort=use have been used. With Option 2 it’s best to use the sort key if the name contains commands (for example, \ensuremath{\alpha}) and with Options 2 and 3, it’s strongly recommended as the indexing may fail if you don’t (see below).

+You can also override the sort key by redefining \glsprestandardsort (see §2.5).

+

+ The sort key shouldn’t be used with bib2gls. It has a system of fallbacks that allow different types of entries to obtain the sort value from the most relevant field. See the bib2gls manual for further details, and see also bib2gls gallery: sorting.
+

+Option 1 by default strips the standard LaTeX accents (that is, accents generated by core LaTeX commands) from the name key when it sets the sort key. So with Option 1:

\newglossaryentry{elite}{
+  name={\'elite},
+  description={select group of people}
+}
+
This is equivalent to:
\newglossaryentry{elite}{
+  name={\'elite},
+  description={select group of people}
+  sort={elite}
+}
+
Unless you use the package option sanitizesort=true, in which case it’s equivalent to:
\newglossaryentry{elite}{
+  name={\'elite},
+  description={select group of people}
+  sort={\'elite},
+}
+
This will place the entry before the “A” letter group since the sort value starts with a symbol (a literal backslash \). Note that Option 1 shouldn’t be used with UTF-8 characters. With old LaTeX kernels, it was able to convert a UTF-8 character, such as é, to an ASCII equivalent but this is no longer possible.

+With Options 2 and 3, the default value of sort will either be set to the name key (if sanitizesort=true) or it will set it to the expansion of the name key (if sanitizesort=false).

+

+Take care with xindy (Option 3): if you have entries with the same sort value they will be treated as the same entry. If you use xindy and aren’t using the def or use sort methods, always use the sort key for entries where the name just consists of commands (for example name={\alpha}).

+Take care if you use Option 1 and the name contains fragile commands. You will either need to explicitly set the sort key or use the sanitizesort=true package option (unless you use the def or use sort methods).

+

+

+type=glossary-labelinitial: \glsdefaulttype
+ This specifies the label of the glossary in which this entry belongs. If omitted, the default glossary identified by \glsdefaulttype is assumed unless \newacronym is used (see §6).

+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 \glsaddkey or \glsaddstoragekey (see §4.3).

+

+user1={text}
+ The first user key.

+

+user2={text}
+ The second user key.

+

+user3={text}
+ The third user key.

+

+user4={text}
+ The fourth user key.

+

+user5={text}
+ The fifth user key.

+

+user6={text}
+ The sixth user key.

+

+nonumberlist={boolean}default: true; initial: false
+ If the value is missing or is true, this will suppress the number list just for this entry. Conversely, if you have used the package option nonumberlist=true, you can activate the number list just for this entry with nonumberlist={false}. (See §12.)

+This key works by adding \glsnonextpages (nonumberlist={true}) or \glsnextpages (nonumberlist={false}) to the indexing information for Options 2 and 3. Note that this means that if the entry is added to the 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 number list suppressed instead.

+With Option 1, this key saves the appropriate command in the prenumberlist internal field, which is used by \glsnoidxprenumberlist.

+

+see={[tag]xr-list}
+ This key essentially provides a convenient shortcut that performs
\glssee[tag]{entry-label}{xr-list}
+
after the entry has been defined. (See §11.) It was originally designed for synonyms that may not occur in the document text but needed to be included in the glossary in order to redirect the reader. Note that it doesn’t index the cross-referenced entry (or entries) as that would interfere with their number lists.

+

+Using the see key will automatically add this entry to the glossary, but will not automatically add the cross-referenced entry.
+

+For example:

\newglossaryentry{courgette}{name={courgette},
+  description={variety of small marrow}}
+\newglossaryentry{zucchini}{name={zucchini},
+  description={(North American)},
+  see={courgette}}
+
This defines two entries (courgette and zucchini) and automatically adds a cross-reference from zucchini to courgette. (That is, it adds see courgette” to zucchini’s number list.) This doesn’t automatically index courgette since this would create an unwanted location in courgette’s number list. (Page 1, if the definitions occur in the preamble.)

+Note that while it’s possible to put the cross-reference in the description instead, for example:

\newglossaryentry{zucchini}{name={zucchini},
+  description={(North American) see \gls{courgette}}}
+
this won’t index the zucchini entry, so if zucchini isn’t indexed elsewhere (with commands like \gls or \glsadd) then it won’t appear in the glossary even if courgette does.

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

+

+If you have suppressed the number list, the cross-referencing information won’t appear in the glossary, as it forms part of the number list.
+

+You can override this for individual glossary entries using nonumberlist={false}. Alternatively, you can use the seeautonumberlist package option. For further details, see §11.

+

+For Options 2 and 3, \makeglossaries must be used before any occurrence of \newglossaryentry that contains the see key.
+

+Since it’s useful to suppress the indexing while working on a draft document, consider using the seenoindex package option to warn about or ignore the see key while \makeglossaries is commented out.

+If you use the see key, you may want to consider using the glossaries-extra package which additionally provides a seealso and alias key. If you want to avoid the automatic indexing triggered by the see key, consider using Option 4. See also the FAQ item Why does the see key automatically index the entry?

+

+ The analogous bib2gls see, seealso and alias fields have a slightly different meaning. The selection resource option determines the behaviour.
+

+

+seealso={xr-list}
+ This key is only available with glossaries-extra and is similar to see but it doesn’t allow for the optional tag. The glossaries-extra package provides \seealsoname and seealso={xr-list} is essentially like see={[\seealsoname]xr-list} (Options 3 and 4 may treat these differently).

+

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

+

+ More variations with the alias key are available with bib2gls.
+

+

+counter={counter-name}
+ This key will set the default location counter for the given entry. This will override the counter assigned to the entry’s glossary in the final optional argument of \newglossary (if provided) and the counter identified by the counter package option. The location counter can be overridden by the counter option when using the \gls-like and \glstext-like commands.

+

+category=category-labelinitial: general
+ This key is only available with glossaries-extra and is used to assign a category to the entry. The value should be a label that can be used to identify the category. See glossaries-extra manual for further details.

+The following keys are reserved for \newacronym (see §6) and also for \newabbreviation (see the glossaries-extra manual): long, longplural, short and shortplural. You can use longplural and shortplural in the optional argument of \newacronym (or \newabbreviation) to override the defaults, but don’t explicitly use the long or short keys as that may interfere with acronym style (or abbreviation style).

+

+ There are also special internal field names used by bib2gls. See the bib2gls manual for further details.
+

+The supplementary packages glossaries-prefix16) and glossaries-accsupp17) provide additional keys.

+

+Avoid using any of the \gls-like or \glstext-like commands within the text, first, short or long keys (or their plural equivalent) or any other key that you plan to access through those commands. (For example, the symbol key if you intend to use \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 description key if you don’t use \glsdesc. Additionally, they’ll confuse the formatting placeholder commands, such as \glslabel. The glossaries-extra package provides \glsxtrp for this type of situation.
+

+With older LaTeX kernels and pre-2.08 versions of mfirstuc, if the name starts with non-Latin character, you need to group the character, otherwise it will cause a problem for commands like \Gls and \Glspl. For example:

% mfirstuc v2.07
+\newglossaryentry{elite}{name={{\'e}lite},
+description={select group or class}}
+
Note that the same applies with inputenc:
% mfirstuc v2.07
+\newglossaryentry{elite}{name={{é}lite},
+description={select group or class}}
+
This doesn’t apply for XeLaTeX or LuaLaTeX documents or with mfirstuc v2.08+.
% mfirstuc v2.08
+\newglossaryentry{elite}{name={élite},
+description={select group or class}}
+
See the mfirstuc manual for further details.

+Note that in the above UTF-8 examples, you will also need to supply the sort key if you are using Options 1 or 2 whereas xindy (Option 3) is usually able to sort non-Latin characters correctly.

+ +

+ +
+

4.1. Plurals

+

+You may have noticed from above that you can specify the plural form when you define an entry. If you omit this, the plural will be obtained by appending:

+\glspluralsuffixinitial: s
+ to the singular form. This command may expand when the entry is defined, if expansion is on for the relevant keys, or may not expand until the entry is referenced, if expansion is off or if the suffix has been hidden inside non-expanding context (which can happen when defining acronyms or abbreviations).

+For example:

\newglossaryentry{cow}{name={cow},description={a fully grown female of any bovine animal}}
+
defines a new entry whose singular form is “cow” and plural form is “cows”. However, if you are writing in archaic English, you may want to use “kine” as the plural form, in which case you would have to do:
\newglossaryentry{cow}{name={cow},plural={kine},
+description={a fully grown female of any bovine animal}}
+

+If you are writing in a language that supports multiple plurals (for a given term) then use the plural key for one of them and one of the user keys to specify the other plural form. For example:

\newglossaryentry{cow}{
+  name={cow},
+  description={a fully grown female of any bovine animal                 (plural cows, archaic plural kine)},
+  user1={kine}}
+
You can then use \glspl{cow} to produce “cows” and \glsuseri{cow} to produce “kine”. You can, of course, define an easy to remember synonym. For example:
\let\glsaltpl\glsuseri
+
Then you don’t have to remember which key you used to store the second plural. (Be careful with using \let as it doesn’t check if the command already exists.)

+Alternatively, you can define your own keys using \glsaddkey, described in §4.3 (or simply use \glsdisp or \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 \glspluralsuffix as required. However, this must be done 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 plural key (and the firstplural key where necessary).

+ +

+ +
+

4.2. Other Grammatical Constructs

+

+You can use the six user keys to provide alternatives, such as participles. For example:

\let\glsing\glsuseri
+\let\glsd\glsuserii
+
+\newcommand*{\ingkey}{user1}
+\newcommand*{\edkey}{user2}
+
+\newcommand*{\newword}[3][]{% 
+  \newglossaryentry{#2}{% 
+   name={#2},% 
+   description={#3},% 
+   \edkey={#2ed},% 
+   \ingkey={#2ing},#1% 
+  }}
+
With the above definitions, I can now define terms like this:
\newword{play}{to take part in activities for enjoyment}
+\newword[\edkey={ran},\ingkey={running}]{run}{to move fast using 
+the legs}
+
and use them in the text:
Peter is \glsing{play} in the park today.
+
+Jane \glsd{play} in the park yesterday.
+
+Peter and Jane \glsd{run} in the park last week.
+

+Alternatively, you can define your own keys using \glsaddkey, described below in §4.3. It may, however, be simpler just to use \glslink or \glsdisp with the appropriate link text.

+ +

+ +
+

4.3. Additional Keys

+

+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 \glsaddkey described in §4.3.1. If, on the other hand, you want to add a key to indicate to a glossary style or acronym style that this entry should be formatted differently to other entries, then you can use \glsaddstoragekey described in §4.3.2.

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

+ +

+ +
+

4.3.1. Document Keys

+

+A custom key that can be used in the document is defined using:

+\glsaddkey{key}{default value}{no link cs}{no link ucfirst cs}{link cs}{link ucfirst cs}{link allcaps cs}
+ where the arguments are as follows: +
+ key is the new key to use in \newglossaryentry (or similar commands such as \longnewglossaryentry); 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 \glslabel, but you will have to switch on expansion via the starred version of \glsaddkey and protect fragile commands); no link cs is the control sequence to use analogous to commands like \glsentrytext; no link ucfirst cs is the control sequence to use analogous to commands like \Glsentrytext; link cs is the control sequence to use analogous to commands like \glstext; link ucfirst cs is the control sequence to use analogous to commands like \Glstext; link allcaps cs is the control sequence to use analogous to commands like \GLStext. +
+ The starred version of \glsaddkey switches on expansion for this key. The unstarred version doesn’t override the current expansion setting.

+

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

+These entries can later be used in the document:

The dog \glsed{jump} over the duck.
+
+The duck was \glsing{waddle} round the dog.
+
+The dog \glsed{run} away from the duck.
+
For a complete document, see the sample file sample-newkeys.tex.

+ +

+ +
+

4.3.2. Storage Keys

+

+A custom key that can be used for simply storing information is defined using:

+\glsaddstoragekey{key}{default value}{no link cs}
+ where the arguments are as the first three arguments of \glsaddkey, described above in §4.3.1.

+This is essentially the same as \glsaddkey except that it doesn’t define the additional commands. You can access or update the value of your new field using the commands described in §15.5.

+

Example 12: Defining Custom Storage Key (Acronyms and Initialisms)
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 glossary and I want the acronyms on first use to be displayed with the short form followed by the long form in parentheses, but the opposite way round for other forms of abbreviations. (The glossaries-extra package provides a simpler way of achieving this.)

+Here I can define a new key that determines whether the term is actually an acronym rather than some other form of abbreviation. I’m going to call this key abbrtype (since type already exists):

\glsaddstoragekey
+ {abbrtype}% key/field name
+ {word}% default value if not explicitly set
+ {\abbrtype}% custom command to access the value if required
+

+Now I can define a style that looks up the value of this new key to determine how to display the full form:

\newacronymstyle
+ {mystyle}% style name
+ {% Use the generic display
+   \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% 
+ }% 
+ {% Put the long form in the description
+   \renewcommand*{\GenericAcronymFields}{% 
+       description={\the\glslongtok}}% 
+   % For the full format, test the value of the "abbrtype" key.
+   % If it's set to "word" put the short form first with
+   % the long form in brackets.
+   \renewcommand*{\genacrfullformat}[2]{% 
+    \ifglsfieldeq{##1}{abbrtype}{word}
+    {% is a proper acronym
+      \protect\firstacronymfont{\glsentryshort{##1}}##2\space
+       (\glsentrylong{##1})% 
+    }% 
+    {% is another form of abbreviation
+     \glsentrylong{##1}##2\space
+      (\protect\firstacronymfont{\glsentryshort{##1}})% 
+    }% 
+   }% 
+   % sentence case version:
+   \renewcommand*{\Genacrfullformat}[2]{% 
+    \ifglsfieldeq{##1}{abbrtype}{word}
+    {% is a proper acronym
+      \protect\firstacronymfont{\Glsentryshort{##1}}##2\space
+       (\glsentrylong{##1})% 
+    }
+    {% is another form of abbreviation
+     \Glsentrylong{##1}##2\space
+      (\protect\firstacronymfont{\glsentryshort{##1}})% 
+    }% 
+   }% 
+   % plural
+   \renewcommand*{\genplacrfullformat}[2]{% 
+    \ifglsfieldeq{##1}{abbrtype}{word}% 
+    {% is a proper acronym
+      \protect\firstacronymfont{\glsentryshortpl{##1}}##2\space
+       (\glsentrylong{##1})% 
+    }% 
+    {% is another form of abbreviation
+     \glsentrylongpl{##1}##2\space
+      (\protect\firstacronymfont{\glsentryshortpl{##1}})% 
+    }% 
+  }% 
+  % plural and sentence case
+  \renewcommand*{\Genplacrfullformat}[2]{% 
+    \ifglsfieldeq{##1}{abbrtype}{word}% 
+    {% is a proper acronym
+      \protect\firstacronymfont{\Glsentryshortpl{##1}}##2\space
+       (\glsentrylong{##1})% 
+    }% 
+    {% is another form of abbreviation
+     \Glsentrylongpl{##1}##2\space
+      (\protect\firstacronymfont{\glsentryshortpl{##1}})% 
+    }% 
+  }% 
+  % Just use the short form as the name part in the glossary:
+  \renewcommand*{\acronymentry}[1]{% 
+     \acronymfont{\glsentryshort{##1}}}% 
+  % Sort by the short form:
+  \renewcommand*{\acronymsort}[2]{##1}% 
+  % Just use the surrounding font for the short form:
+  \renewcommand*{\acronymfont}[1]{##1}% 
+  % Same for first use:
+  \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% 
+  % Default plural suffix if the plural isn't explicitly set
+  \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% 
+ }
+
Remember that the new style needs to be set before defining any terms:
\setacronymstyle{mystyle}
+

+Since it may be a bit confusing to use \newacronym for something that’s not technically an acronym, let’s define a new command for initialisms:

\newcommand*{\newinitialism}[4][]{% 
+  \newacronym[abbrtype=initialism,#1]{#2}{#3}{#4}% 
+}
+
Now the entries can all be defined:
\newacronym{radar}{radar}{radio detecting and ranging}
+\newacronym{laser}{laser}{light amplification by stimulated
+emission of radiation}
+\newacronym{scuba}{scuba}{self-contained underwater breathing
+apparatus}
+\newinitialism{dsp}{DSP}{digital signal processing}
+\newinitialism{atm}{ATM}{automated teller machine}
+
On first use, \gls{radar} will produce “radar (radio detecting and ranging)” but \gls{dsp} will produce “DSP (digital signal processing)”.

+For a complete document, see the sample file sample-storage-abbr.tex.

+In the above example, if \newglossaryentry is explicitly used (instead of through \newacronym) the abbrtype key will be set to its default value of “word” but the \ifglshaslong test in the custom acronym style will be false (since the long key hasn’t been set) so the display style will switch to that given by \glsgenentryfmt and they’ll be no test performed on the abbrtype field.

+

Example 13: Defining Custom Storage Key (Acronyms and Non-Acronyms with Descriptions)
The previous example can be modified if the description also needs to be provided. Here I’ve changed “word” to “acronym”:
\glsaddstoragekey
+ {abbrtype}% key/field name
+ {acronym}% default value if not explicitly set
+ {\abbrtype}% custom command to access the value if required
+
This may seem a little odd for non-abbreviated entries that are defined using \newglossaryentry directly, but \ifglshaslong can be used to determine whether or not to reference the value of this new abbrtype field.

+The new acronym style has a minor modification that forces the user to specify a description. In the previous example, the line:

\renewcommand*{\GenericAcronymFields}{% 
+     description={\the\glslongtok}}% 
+
needs to be changed to:
\renewcommand*{\GenericAcronymFields}{}% 
+
Additionally, to accommodate the change in the default value of the abbrtype key, all instances of
\ifglsfieldeq{##1}{abbrtype}{word}
+
need to be changed to:
\ifglsfieldeq{##1}{abbrtype}{acronym}
+

+Once this new style has been set, the new acronyms can be defined using the optional argument to set the description:

\newacronym[description={system for detecting the position and speed of aircraft, ships, etc}]{radar}{radar}{radio detecting
+and ranging}
+

+No change is required for the definition of \newinitialism but again the optional argument is required to set the description:

\newinitialism[description={mathematical manipulation of an information signal}]{dsp}{DSP}{digital signal processing}
+

+We can also accommodate contractions in a similar manner to the initialisms:

\newcommand*{\newcontraction}[4][]{% 
+  \newacronym[abbrtype=contraction,#1]{#2}{#3}{#4}% 
+}
+
The contractions can similarly been defined using this new command:
\newcontraction[description={front part of a ship below the deck}]{focsle}{fo'c's'le}{forecastle}
+

+Since the custom acronym style just checks if abbrtype is “acronym”, the contractions will be treated the same as the initialisms, but the style could be modified by a further test of the abbrtype value if required.

+To test regular non-abbreviated entries, I’ve also defined a simple word:

\newglossaryentry{apple}{name={apple},description={a fruit}}
+

+Now for a new glossary style that provides information about the abbreviation (in addition to the description):

\newglossarystyle
+ {mystyle}% style name
+ {% base it on the "list" style
+   \setglossarystyle{list}% 
+   \renewcommand*{\glossentry}[2]{% 
+     \item[\glsentryitem{##1}% 
+          \glstarget{##1}{\glossentryname{##1}}]
+       \ifglshaslong{##1}% 
+       { (\abbrtype{##1}: \glsentrylong{##1})\space}{}% 
+       \glossentrydesc{##1}\glspostdescription\space ##2}% 
+ }
+
This uses \ifglshaslong to determine whether or not the term is an abbreviation. (An alternative is to use \ifglshasshort. The long and short keys are only set for acronyms/abbreviations.)

+If the entry has an short/long value, the full form is supplied in parentheses and \abbrtype (defined by \glsaddstoragekey earlier) is used to indicate the type of abbreviation.

+With this style set, the “apple” entry is simply displayed in the glossary as: +

+ apple a fruit. +
+ but the abbreviations are displayed in the form +
+ laser (acronym: light amplification by stimulated emission of radiation) device that creates a narrow beam of intense light. +
+ (for acronyms) or +
+ DSP (initialism: digital signal processing) mathematical manipulation of an information signal. +
+ (for initalisms) or +
+ fo’c’s’le (contraction: forecastle) front part of a ship below the deck. +
+ (for contractions).

+For a complete document, see sample-storage-abbr-desc.tex.

+ +

+ +
+

4.4. Expansion

+

+When you define new glossary entries expansion is performed by default, except for the name, description, descriptionplural, symbol, symbolplural and sort keys (these keys all have expansion suppressed via \glssetnoexpandfield).

+You can switch expansion on or off for individual keys using:

+\glssetexpandfield{field}
+ or
+\glssetnoexpandfield{field}
+ respectively, where field is the internal field label corresponding to the key. In most cases, this is the same as the name of the key except for those listed in Table 4.1.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4: Key to Field Mappings
Key Field
sort sortvalue
firstplural firstpl
description desc
descriptionplural descplural
user1 useri
user2 userii
user3 useriii
user4 useriv
user5 userv
user6 uservi
longplural longpl
shortplural shortpl
+

+Any keys that haven’t had the expansion explicitly set using \glssetexpandfield or \glssetnoexpandfield are governed by

+\glsexpandfields
+ and
+\glsnoexpandfields
+

+If your entries contain any fragile commands, I recommend you switch off expansion via \glsnoexpandfields. (This should be used before you define the entries.)

+

+Both \newacronym and \newabbreviation partially suppress expansion of some keys regardless of the above expansion settings.
+

+ +

+ +
+

4.5. Sub-Entries

+

+A sub-entry is created by setting the parent key. These will normally be sorted so that they are placed immediately after their parent entry. However, some sort methods aren’t suitable when there are sub-entries. In particular, sub-entries are problematic with Option 1, and with Option 5 the sub-entries must be defined immediately after their parent entry (rather than at any point after the parent entry has been defined).

+The hierarchical level indicates the sub-entry level. An entry with no parent (a top level entry) is a hierarchical level 0 entry. An entry with a parent has a hierarchical level that’s one more than its parent’s level. The level is calculated when an entry is defined.

+

+The hierarchical level is stored in the level internal field. It can be accessed using commands like \glsfieldfetch or (with glossaries-extra) \glsxtrusefield, but neither the level nor the parent values should be altered as it can cause inconsistencies in the sorting and glossary formatting. The indexing syntax for Options 2 and 3 is generated when the entry is first defined, so it’s too late to change the hierarchy after that, and bib2gls obtains the hierarchical information from the bib files and the resource options. Note, however, that glossaries-extra does allow the ability to locally alter the level with the leveloffset option, which is mainly intended for nested glossary. See the glossaries-extra manual for further details and also Gallery: Inner or Nested Glossaries.
+

+There are two different types of sub-entries: those that have the same name as their parent (homographs, see §4.5.2) and those that establish a hierarchy (see §4.5.1). Both types are considered hierarchical entries from the point of view of the glossaries package and the indexing applications, but typically homographs will have the name key obtained from the parent, rather than have it explicitly set, and have a maximum hierarchical level of 1.

+Not all glossary styles support hierarchical entries and may display all the entries in a flat format. Of the styles that support sub-entries, some display the sub-entry’s name whilst others don’t. Therefore you need to ensure that you use a suitable style. (See §13 for a list of predefined glossary styles.) If you want level 1 sub-entries automatically numbered (in glossary styles that support it) use the subentrycounter package option (see §2.3 for further details).

+Note that the parent entry will automatically be added to the glossary if any of its child entries are used in the document. If the parent entry is not referenced in the document, it will not have a number list. Note also that makeindex has a restriction on the maximum hierarchical depth.

+ +

+ +
+

4.5.1. Hierarchy

+

+To create a glossary with hierarchical divisions, you need to first define the division, which will be a top level (level 0) entry, and then define the sub-entries using the relevant higher level entry as the value of the 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.

+

Example 14: Hierarchical Divisions―Greek and Roman Mathematical Symbols

+Suppose I want a glossary of mathematical symbols that are divided into Greek letters and Roman letters. Then I can define the divisions as follows:

\newglossaryentry{greekletter}{name={Greek letters},
+description={\nopostdesc}}
+
+\newglossaryentryromanletter{name={Roman letters},
+description={\nopostdesc}}
+

+Note that in this example, the top level entries don’t need a description so I have set the descriptions to \nopostdesc. This gives a blank description and suppresses the description terminator.

+I can now define my sub-entries as follows:

\newglossaryentry{pi}name={\ensuremath{\pi}},sort={pi},
+description={ratio of the circumference of a circle to  the diameter},
+parent={greekletter}
+
+\newglossaryentry{C}{name={\ensuremath{C}},sort={C},
+description={Euler's constant},
+parent={romanletter}}
+
For a complete document, see the sample file sampletree.tex.

+

+ If you want to switch to Option 5, you will need to move the definitions of the sub-entries to immediately after the definition of their parent entry. So, in this case, “pi” needs to be defined after “greekletter” and before “romanletter”.
+

+ +

+ +
+

4.5.2. homographs

+

+Sub-entries that have the same name as the parent entry don’t need to have the name key explicitly set. For example, the word “glossary” can mean a list of technical words or a collection of glosses. In both cases the plural is “glossaries”. So first define the parent entry:

\newglossaryentry{glossary}{name={glossary},
+description={\nopostdesc},
+plural={glossaries}}
+
As in the previous example, the parent entry has no description, so the description terminator needs to be suppressed using \nopostdesc.

+Now define the two different meanings of the word with the parent key set to the above parent entry label:

\newglossaryentry{glossarylist}{
+description={list of technical words},
+sort={1},
+parent={glossary}}
+
+\newglossaryentry{glossarycol}{
+description={collection of glosses},
+sort={2},
+parent={glossary}}
+
Note that if I reference the parent entry (for example, \gls{glossary}), the location will be added to the parent’s number list, whereas if I reference any of the child entries (for example, \gls{glossarylist}), the location will be added to the child entry’s number list. Note also that since the sub-entries have the same name, the sort key is required with Option 3 (xindy) and recommended with Option 2 (makeindex). You can use the subentrycounter package option to automatically number the level 1 child entries in the glossary (if you use a glossary style that supports it). See §2.3 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 plural key was not required for the child entries. However, if the sub-entries have different plurals, they will need to be specified. For example:

\newglossaryentry{bravo}{name={bravo},
+description={\nopostdesc}}
+
+\newglossaryentry{bravocry}{description={cry of approval  (pl. bravos)},
+sort={1},
+plural={bravos},
+parent={bravo}}
+
+\newglossaryentry{bravoruffian}{description={hired  ruffian or killer (pl. bravoes)},
+sort={2},
+plural={bravoes},
+parent={bravo}}
+
For a complete document, see the sample file sample.tex.

+ +

+ +
+

4.6. Loading Entries From a File

+

+You can store all your glossary entry definitions in another file and use:

+\loadglsentries[type]{filename}
+ where filename is the name of the file containing all the \newglossaryentry, \longnewglossaryentry, \newacronym etc commands. The optional argument type is the name of the glossary to which those entries should belong, for those entries where the type key has been omitted (or, more specifically, for those entries whose type has been set to \glsdefaulttype, which is what \newglossaryentry uses by default). See sampleDB.tex for a complete example document.

+

+Commands like \newacronym, \newabbreviation, \newterm, \glsxtrnewsymbol and \glsxtrnewnumber all set the type key to the appropriate glossary. This means that the type optional argument won’t apply to those commands, unless they have type={\glsdefaulttype}.
+

+This is a preamble-only command. You may also use \input to load the file but don’t use \include. If you find that your file is becoming unmanageably large, you may want to consider switching to bib2gls and use an application such as JabRef to manage the entry definitions.

+

+If you want to use \AtBeginDocument to \input all your entries automatically at the start of the document, add the \AtBeginDocument command before you load the glossaries package (and babel, if you are also loading that) to avoid the creation of the glsdefs file and any associated problems that are caused by defining commands in the document environment. (See §4.8.) Alternatively, if you are using glossaries-extra, use the docdef=restricted package option.
+

+

Example 15: Loading Entries from Another File
Suppose I have a file called myentries.tex which contains:
\newglossaryentry{perl}{type={main},
+name={Perl},
+description={A scripting language}}
+
+\newglossaryentry{tex}{name={\TeX},
+description={A typesetting language},sort={TeX}}
+
+\newglossaryentry{html}{type={\glsdefaulttype},
+name={html},
+description={A mark up language}}
+
and suppose in my preamble I use the command:
\loadglsentries[languages]{myentries}
+
then this will add the entries “tex” and “html” to the glossary whose type is given by languages, but the entry “perl” will be added to the main glossary, since it explicitly sets the type to main.

+Now suppose I have a file myacronyms.tex that contains:

\newacronym{aca}{aca}{a contrived acronym}
+
then (supposing I have defined a new glossary type called altacronym)
\loadglsentries[altacronym]{myacronyms}
+
will add “aca” to the glossary type acronym, if the package option acronym has been specified, or will add “aca” to the glossary type altacronym, if the package option acronym is not specified. This is because \acronymtype is set to \glsdefaulttype if the acronym package option is not used so the optional argument of \loadglsentries will work in that case, but if the acronym option is used then \acronymtype will be redefined to acronym.

+If you want to use \loadglsentries with the acronym package option set, there are two possible solutions to this problem: +

    +
  1. 1.Change myacronyms.tex so that entries are defined in the form:
    \newacronym[type={\glsdefaulttype}]{aca}{aca}{a 
    +contrived acronym}
    +
    and do:
    \loadglsentries[altacronym]{myacronyms}
    +

    +

  2. 2.Temporarily change \acronymtype to the target glossary:
    \let\orgacronymtype\acronymtype
    +\renewcommand{\acronymtype}{altacronym}
    +\loadglsentriesmyacronyms
    +\let\acronymtype\orgacronymtype
    +
    +
+

+Note that only those entries that have been indexed in the text will appear in the relevant glossaries. Note also that \loadglsentries may only be used in the preamble.

+

+Don’t use the see key in a large file of entries that may or may not be indexed in the document. Similarly for seealso and alias with glossaries-extra. If you need them and you need a large database of entries, consider switching to bib2gls.
+

+Remember that you can use \provideglossaryentry rather than \newglossaryentry. Suppose you want to maintain a large database of acronyms or terms that you’re likely to use in your documents, but you may want to use a modified version of some of those entries. (Suppose, for example, one document may require a more detailed description.) Then if you define the entries using \provideglossaryentry in your database file, you can override the definition by simply using \newglossaryentry before loading the file. For example, suppose your file (called, say, terms.tex) contains:

\provideglossaryentry{mallard}{name={mallard},
+ description={a type of duck}}
+
but suppose your document requires a more detailed description, you can do:
\usepackage{glossaries}
+\makeglossaries
+
+\newglossaryentry{mallard}{name={mallard},
+ description={a dabbling duck where the male has a green head}}
+
+\loadglsentries{terms}
+
Now the “mallard” definition in the terms.tex file will be ignored.

+ +

+ +
+

4.7. Moving Entries to Another Glossary

+

+You can move an entry from one glossary to another using:

+\glsmoveentry{entry-label}{target glossary label}
+ where entry-label is the unique label identifying the required entry and target glossary label is the unique label identifying the glossary in which to put the entry. If you are using Options 2 or 3, entries shouldn’t be moved after the indexing files have been opened by \makeglossaries.

+

+Simply changing the value of the type field using a command like \glsfielddef won’t correctly move the entry, since the label needs to be removed from the old glossary’s internal list and added to the new glossary’s internal list to allow commands such as \glsaddall and \glsunsetall to work.
+

+Note that no check is performed to determine the existence of the target glossary. If you want to move an entry to a glossary that’s skipped by \printglossaries, then define an ignored glossary with \newignoredglossary. (See §9.) With Options 4 and 5, it’s also possible to copy an entry to another glossary with \glsxtrcopytoglossary. See the glossaries-extra manual for further details.

+

+Unpredictable results may occur if you move an entry to a different glossary from its parent or children.
+

+ +

+ +
+

4.8. Drawbacks With Defining Entries in the Document Environment

+

+Originally, \newglossaryentry (and \newacronym) could only be used in the preamble. I reluctantly removed this restriction in version 1.13, but there are issues with defining commands in the document environment instead of the preamble, which is why the restriction is maintained for newer commands. This restriction is also reimposed for \newglossaryentry by Option 1 because in that case the entries must be defined before the aux file is input. (The glossaries-extra package automatically reimposes the preamble-only restriction but provides the docdef package option to allow document definitions for Options 2 and 3 if necessary.)

+

+ With Option 4, all entry data should be supplied in bib files. From bib2gls’s point of view, the entries are defined in the bib files. From TeX’s point of view, the entries are defined in the glstex files that are input by \GlsXtrLoadResources, which is a preamble-only command.
+

+ +

+ +
+

4.8.1. Technical Issues

+

+ +

    +
  1. 1.If you define an entry mid-way through your document, but subsequently shuffle sections around, you could end up using an entry before it has been defined. This is essentially the same problem as defining a command with \newcommand in the middle of the document and then moving things around so that the command is used before it has been defined.

    +

  2. 2.Entry information is required when displaying the glossary. If this occurs at the start of the document, but the entries aren’t defined until later, then the entry details are being looked up before the entry has been defined. This means that it’s not possible to display the content of the glossary unless the entry definitions are saved on the previous LaTeX run and can be picked up at the start of the document environment on the next run (in a similar way that \label and \ref work).

    +

  3. 3.If you use a package, such as babel, that makes certain characters active at the start of the document environment, there can be a problem if those characters have a special significance when defining glossary entries. These characters include " (double-quote), ! (exclamation mark), ? (question mark), and | (pipe). They must not be active when defining a glossary entry where they occur in the sort key (and they should be avoided in the label if they may be active at any point in the document). Additionally, the comma (,) character and the equals (=) character should not be active when using commands that have key=value arguments.

    + +

+

+To overcome the first two problems, as from version 4.0 the glossaries package modifies the definition of \newglossaryentry at the beginning of the document environment so that the definitions are written to an external file (\jobname.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 glossary, even if the glossary occurs at the beginning of the document.

+There are drawbacks to this mechanism: if you modify an entry definition, you need a second run to see the effect of your modification in \printglossary (if it occurs at the start of the document); this method requires an extra \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 entry label.

+The glossaries-extra package provides a setting (but not for Options 1 or 4) that allows \newglossaryentry to occur in the document environment but doesn’t create the glsdefs file. This circumvents some problems but it means that you can’t display any of the glossaries before all the entries have been defined (so it’s all right if all the glossaries are at the end of the document but not if any occur in the front matter).

+ +

+ +
+

4.8.2. Good Practice Issues

+

4.8.1 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 entries within the document environment rather than in the preamble is that they want to write the definition as they type in their document text. This suggests a “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 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.

+ +

+ +
+

5. Referencing Entries in the Document

+

+Once you have defined a glossary entry using a command such as \newglossaryentry4) or \newacronym6), you can refer to that entry in the document with one of the provided commands that are describe in this manual. (There are some additional commands provided by glossaries-extra.) The text produced at that point in the document (the link text) is determined by the command and can also be governed by whether or not the entry has been 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 PDF bookmarks.

+The commands are broadly divided into: +

    +
  1. 1.Those that display text in the document (where the formatting can be adjusted by a style or hook) and also index the entry (so that it’s added to the glossary) are described in §5.1. This set of commands can be further sub-divided into those that mark the entry as having been used (the \gls-like commands, §5.1.2) and those that don’t (the \glstext-like commands, §5.1.3).

    +

  2. 2.Those that display text in the document without indexing or applying any additional formatting (§5.2). These typically aren’t robust or can partially expand so that they can be used in PDF bookmarks (with a few exceptions). +
+ There are additional commands specific to entries defined with \newacronym that are described in §6.1.

+ +

+ + + +
+

5.1.1. Options

+

+The keys listed below are available for the optional first argument of the \gls-like and \glstext-like commands. The glossaries-extra package provides additional keys. (See the glossaries-extra manual for further details.)

+

+hyper=booleandefault: true; initial: true
+ If true, this option can be used to enable/disable the hyperlink to the relevant entry line in the glossary. If this key is omitted, the value is determined by the current settings. For example, when used with a \gls-like command, if this is the first use and the hyperfirst=false package option has been used, then the default value is hyper=false. The hyperlink can be forced on using hyper=true unless the hyperlinks have been suppressed using \glsdisablehyper. You must load the hyperref package before the glossaries package to ensure the hyperlinks work.

+

+format=cs-name
+ This specifies how to format the associated location number within the location list (see §12.1).

+

+There is a special format glsignore which simply ignores its argument to create an invisible location.
+

+

+counter=counter-name
+ This specifies which counter to use for this location. This overrides the default counter used by the entry, the default counter associated with the glossary (supplied in the final optional argument of \newglossary) and the default counter identified by the counter package option. See also §12. The glossaries-extra package has additional options that affect the counter used, such as floats and equations. This manual uses the floats option to automatically switch the counter to table for any entries indexed in tables (such as those in Table 12.1).

+

+local=booleandefault: true; initial: false
+ This is a boolean key that only makes a difference when used with \gls-like commands that change the entry’s first use flag. If local=true, the change to the first use flag will be localised to the current scope.

+

+noindex=booleandefault: true; initial: false
+ If true, this option will suppress the indexing. Only available with glossaries-extra. This manual doesn’t use noindex for common entries. Instead it uses format=glsignore, which is preferable with bib2gls.

+

+hyperoutside=booleandefault: true; initial: true
+ If true, this will put the hyperlink outside of \glstextformat. Only available with glossaries-extra.

+

+wrgloss=positioninitial: before
+ This key determines whether to index before (wrgloss=before) or after (wrgloss=after) the link text, which alters where the whatsit occurs. Only available with glossaries-extra.

+

+textformat=csname
+ The value is the name of the control sequence (without the leading backslash) to encapsulate the link text instead of the default \glstextformat. Only available with glossaries-extra.

+

+prefix=link-prefix
+ This key locally redefines \glolinkprefix to the given value. Only available with glossaries-extra.

+

+thevalue=location
+ This key explicitly sets the location value instead of obtaining it from the location counter. Only available with glossaries-extra.

+

+theHvalue=the-H-value
+ This key explicitly sets the hyperlink location value instead of obtaining it from the location counter. Only available with glossaries-extra.

+

+prereset=valuedefault: local; initial: none
+ Determines whether or not to reset the first use flag before the link text. Only available with glossaries-extra.

+

+preunset=valuedefault: local; initial: none
+ Determines whether or not to unset the first use flag before the link text. Only available with glossaries-extra.

+

+postunset=valuedefault: global; initial: global
+ Determines whether or not to unset the first use flag after the link text. Only available with glossaries-extra.

+ +

+ +
+

5.1.2. The \gls-Like Commands (First Use Flag Queried)

+

+This section describes the \gls-like commands that unset (mark as used) the first use flag after the link text, and in most cases they use the current state of the flag to determine the text to be displayed. As described above, these commands all have a star-variant (hyper=false) and a plus-variant (hyper=true) and have an optional first argument that is a key=value list. These commands use \glsentryfmt or the equivalent definition provided by \defglsentryfmt to determine the automatically generated text and its format (see §5.1.4).

+Apart from \glsdisp, the commands described in this section also have a final optional argument insert which may be used to insert material into the automatically generated text.

+

+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 \relax or an empty set of braces {} immediately before the opening square bracket to prevent it from being interpreted as the final argument. For example:
\gls{sample}[] [Editor's comment]
+\gls{sample}{} [Editor's comment]
+\gls{sample} \relax[Editor's comment]
+
Use of a semantic command can also help avoid this problem. For example:
\newcommand{\edcom}[1][#1]
+% later:
+\gls{sample} \edcom{Editor's comment}
+

+Don’t use any of the \gls-like or \glstext-like commands in the insert argument.

+

+Take care using these commands within commands or environments that are processed multiple times as this can confuse the first use flag query and state change. This includes frames with overlays in beamer and the tabularx environment provided by tabularx. The glossaries package automatically deals with this issue in amsmath’s align environment. You can apply a patch to tabularx by placing the following command in the preamble:

+\glspatchtabularx
+ This does nothing if tabularx hasn’t been loaded. There’s no patch available for beamer. See §7 for more details.

+Most of the commands below have case-changing variants to convert the link text to sentence case or all caps. The sentence case conversion is performed by \glssentencecase and the all caps is performed by \glsuppercase. Ensure you have at least version 2.08 of mfirstuc to use the modern LaTeX3 case-changing commands instead of the now deprecated textcase package. See the mfirstuc manual for further details.

+

+\gls[options]{entry-label}[insert]modifiers: * +
+ This command typically determines the link text from the values of the text or first keys supplied when the entry was defined using \newglossaryentry. However, if the entry was defined using \newacronym and \setacronymstyle was used, then the link text will usually be determined from the long or short keys (similarly for \newabbreviation).

+The case-changing variants:

+\Gls[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLS[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+There are plural forms that are analogous to \gls:

+\glspl[options]{entry-label}[insert]modifiers: * +
+ Sentence case:
+\Glspl[options]{entry-label}[insert]modifiers: * +
+ All caps:
+\GLSpl[options]{entry-label}[insert]modifiers: * +
+ These typically determine the link text from the plural or firstplural keys supplied when the entry was defined using \newglossaryentry or, if the entry was defined with \newacronym and \setacronymstyle was used, from the longplural or shortplural keys. (Similarly for \newabbreviation.)

+

+Be careful when you use glossary entries in math mode especially if you are using hyperref as it can affect the spacing of subscripts and superscripts in math mode. For example, suppose you have defined the following entry:
\newglossaryentry{Falpha}{name={F\alpha},
+description={sample}}
+
and later you use it in math mode:
$\gls{Falpha}2$
+
This will result in \(F_{𝛼}^{2}\) instead of \(F_{𝛼}^{2}\). In this situation it’s best to bring the superscript into the hyperlink using the final insert optional argument:
$\gls{Falpha}[^2]$
+
+

+

+\glsdisp[options]{entry-label}{text}modifiers: * +
+ This behaves in the same way as \gls, except that the link text is explicitly set. There’s no final optional argument as any inserted material can be added to the link text argument. Even though the first use flag doesn’t influence the link text, it’s still unset after the link text and so may influence the post-link hook.

+For example:

\newglossaryentry{locationcounter}{
+  name={location counter},
+  description={...}
+}
+% later in the document:
+The \glsdisp{locationcounter}{counter} identifying the location.
+
This ensures that the entry is indexed and, if enabled, creates a hyperlink to the entry line in the glossary. It will also follow the display style and have the link text encapsulated with \glstextformat.

+Since the actual text is being supplied, any case-changing can be placed in the argument. For example:

\glsdisp{locationcounter}{Counters} associated with locations 
+
However, a sentence case variant is provided:
+\Glsdisp[options]{entry-label}{text}modifiers: * +
+ This essentially does:
\glsdisp[options]{entry-label}{\glssentencecase{text}}
+
The main reason for providing this command is to set up a mapping for \makefirstuc. See the mfirstuc manual for further details about mappings.

+

+Don’t use any of the \gls-like or \glstext-like commands in the link text argument of \glsdisp.
+

+ +

+ +
+

5.1.3. The \glstext-Like Commands (First Use Flag Not Queried)

+

+This section describes the commands that don’t change or reference the first use flag. As described above, these commands all have a star-variant (hyper=false) and a plus-variant (hyper=true) and have an optional first argument that is a key=value list. These commands also don’t use \glsentryfmt or the equivalent definition provided by \defglsentryfmt (see §5.1.4). They do, however, have their link text encapsulated with \glstextformat.

+Additional commands for acronyms are described in §6. (Additional commands for abbreviations are described in the glossaries-extra manual.)

+Apart from \glslink, the commands described in this section also have a final optional argument insert which may be used to insert material into the automatically generated text. See the caveat above in §5.1.2. As with the \gls-like commands described in §5.1.2, these commands also have case-changing variants.

+

+\glslink[options]{entry-label}{text}modifiers: * +
+ This command explicitly sets the link text as given in the final argument. As with \glsdisp, there’s a sentence case variant to allow a sentence case mapping to be established:
+\Glslink[options]{entry-label}{text}modifiers: * +
+ See the mfirstuc package for further details.

+

+Don’t use any of the \gls-like or \glstext-like commands in the argument of \glslink. By extension, this means that you can’t use them in the value of fields that are used to form link text.
+

+

+\glstext[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the text key as the link text.

+The case-changing variants are:

+\Glstext[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLStext[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+There’s no equivalent command for title case, but you can use the more generic command \glsentrytitlecase in combination with \glslink. For example:

\glslink{sample}{\glsentrytitlecase{sample}{text}}
+
(See §5.2.)

+

+\glsfirst[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the first key as the link text.

+The case-changing variants are:

+\Glsfirst[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSfirst[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+The value of the first key (and firstplural key) doesn’t necessarily match the link text produced by \gls (or \glspl) on first use as the link text used by \gls may be modified through entry formatting commands like \defglsentryfmt. (Similarly, the value of the text and plural keys don’t necessarily match the link text used by \gls or \glspl on subsequent use.)
+

+

+\glsplural[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the plural key as the link text.

+The case-changing variants are:

+\Glsplural[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSplural[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsfirstplural[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the firstplural key as the link text.

+The case-changing variants are:

+\Glsfirstplural[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSfirstplural[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsname[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the name key as the link text. Note that this may be different from the values of the text or first keys. In general it’s better to use \glstext or \glsfirst instead of \glsname, unless you have a particular need for the actual name.

+

+The name is displayed in the glossary using \glossentryname not \glsname.
+

+The case-changing variants are:

+\Glsname[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSname[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+In general it’s best to avoid \glsname with acronyms. Instead, consider using \acrlong, \acrshort or \acrfull. Alternatively, for abbreviations defined with glossaries-extra, use \glsxtrlong, \glsxtrshort or \glsxtrfull.
+

+

+\glssymbol[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the symbol key as the link text.

+

+The symbol is displayed in the glossary using \glossentrysymbol not \glssymbol.
+

+The case-changing variants are:

+\Glssymbol[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSsymbol[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsdesc[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the description key as the link text.

+

+The description is displayed in the glossary using \glossentrydesc not \glsdesc.
+

+The case-changing variants are:

+\Glsdesc[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSdesc[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuseri[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user1 key as the link text.

+The case-changing variants are:

+\Glsuseri[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuseri[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuserii[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user2 key as the link text.

+The case-changing variants are:

+\Glsuserii[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuserii[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuseriii[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user3 key as the link text.

+The case-changing variants are:

+\Glsuseriii[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuseriii[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuseriv[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user4 key as the link text.

+The case-changing variants are:

+\Glsuseriv[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuseriv[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuserv[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user5 key as the link text.

+The case-changing variants are:

+\Glsuserv[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuserv[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\glsuservi[options]{entry-label}[insert]modifiers: * +
+ This command always uses the value of the user6 key as the link text.

+The case-changing variants are:

+\Glsuservi[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\GLSuservi[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+ +

+ +
+

5.1.4. Changing the Format of the \gls-like Link Text

+

+

+ The glossaries-extra package provides ways of altering the display style according to the category. See the glossaries-extra manual for further details.
+

+The default entry format (display style) of the link text for the \gls-like commands is governed by:

+\glsentryfmt
+ The glossaries package defines this to simply use \glsgenentryfmt. The glossaries-extra package redefines \glsentryfmt to allow it to integrated with the abbreviation styles.

+

+The entry format is only applicable to the \gls-like commands, not the \glstext-like commands. However, both sets of commands use \glstextformat for the font.
+

+You can redefine \glsentryfmt (but beware of breaking abbreviations with glossaries-extra), but if you only want the change the display style for a given glossary, use:

+\defglsentryfmt[glossary-type]{definition}
+ instead of redefining \glsentryfmt. The optional first argument glossary-type is the glossary type. This defaults to \glsdefaulttype if omitted. The second argument is the entry format definition, which needs to use the placeholder commands described in this section.

+In the remainder of this section, definition refers to the argument of \defglsentryfmt or to the definition of \glsentryfmt.

+

+Note that \glsentryfmt is the default display style for glossary entries. Once the display style has been changed for an individual glossary using \defglsentryfmt, redefining \glsentryfmt won’t have an effect on that glossary, you must instead use \defglsentryfmt again. Note that glossaries that have been identified as lists of acronyms (via the package option acronymlists or the command \DeclareAcronymList, see §2.7) use \defglsentryfmt to set their display style. (The glossaries-extra package provides abbreviation support within its redefinition of \glsentryfmt.)
+

+Within definition you may use the following commands:

+\glslabel
+ This expands to the label of the entry being referenced.

+You can also access the entry’s glossary type using:

+\glstype
+ This is defined using \protected@edef so the replacement text is the actual glossary type rather than \glsentrytype{\glslabel}.

+

+\glsinsert
+ Expands to the final insert optional argument to \gls, \glspl and their case-changing variants (or empty if insert was omitted).

+

+\glsifplural{true}{false}
+ If the plural commands \glspl, \Glspl or \GLSpl was used, this command expands to true otherwise it expands to false.

+

+\glscapscase{no change}{sentence}{all caps}
+ If \gls, \glspl or \glsdisp were used, this expands to no change. If the sentence case commands \Gls or \Glspl were used, this expands to sentence. If the all caps commands \GLS or \GLSpl were used, this expands to all caps.

+

+\glscustomtext
+ Expands to the custom text supplied in \glsdisp. It’s always empty for \gls, \glspl and their case-changing variants. (You can use etoolbox’s \ifdefempty to determine if \glscustomtext is empty.)

+

+If \Glsdisp is used, \glscustomtext will include the sentence case command (\glssentencecase), but \glscapscase will expand to no change (since \Glsdisp simply uses \glsdisp without modifying the placeholder commands). However, the generic \glsgenentryfmt doesn’t use \glscapscase (or \glsifplural) if \glscustomtext isn’t empty.
+

+

+\glsifhyperon{true}{false}
+ This will do true if the hyperlinks are on for the current reference, otherwise it will do false. The hyperlink may be off even if it wasn’t explicitly switched off with hyper=false key or the use of a starred (*) command. It may be off because the hyperref package hasn’t been loaded or because \glsdisablehyper has been used or because the entry is in a glossary type that’s had the hyperlinks switched off (using nohypertypes) or because it’s the first use and the hyperlinks have been suppressed on first use.

+If you want to know if the calling command used to reference the entry was used with the star (*) or plus (+) variant, you can use:

+\glslinkvar{unmodified}{star case}{plus case}
+ This will do unmodified if the unmodified version was used, or will do star case if the starred version was used, or will do plus case if the plus version was used. The custom modifier provided by glossaries-extra’s \GlsXtrSetAltModifier will make \glslinkvar expand to unmodified.

+Note that this doesn’t take into account if the hyper key was used to override the default setting, so this command shouldn’t be used to guess whether or not the hyperlink is on for this reference. This command is therefore of limited use. If you want to make the star or plus behave differently, you can try \GlsXtrSetStarModifier or \GlsXtrSetPlusModifier instead, if you are using glossaries-extra.

+Note that you can also use commands such as \ifglsused within definition (see §7), but don’t use \ifglsused in the post-link hook.

+

+ The glossaries-extra package has additional commands that may be used within definition to obtain information about the calling command.
+

+The commands \glslabel, \glstype, \glsifplural, \glscapscase, \glsinsert and \glscustomtext are typically updated at the start of the \gls-like and \glstext-like commands so they can usually be accessed in the hook user commands, such as \glspostlinkhook and \glslinkpostsetkeys.

+

+This means that using commands like \gls within the fields that are accessed using the \gls-like or \glstext-like commands (such as the first, text, long or short keys) will cause a problem. The definitions of the placeholder commands can’t be scoped otherwise they won’t be available for the post-link hook, and grouping can also cause unwanted spacing issues in math mode.
+

+If you only want to make minor modifications to \glsentryfmt, you can use the generic entry formatting command:

+\glsgenentryfmt
+ This uses the above commands to display just the first, text, plural or firstplural keys (or the custom text) with the insert text appended. For example, to make the symbol appear in parentheses for the symbols glossary:
\defglsentryfmt[symbols]{\glsgenentryfmt (\glsentrysymbol{\glslabel})}
+

+The acronym styles use a similar method to adjust the formatting. For example, the long-short style implements:

\defglsentryfmt[type]{\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}}
+
For each glossary that has been identified as a list of acronyms. This uses the generic entry format command \glsgenentryfmt for general entries (that don’t have the long key set), otherwise it uses the generic acronym format:
+\glsgenacfmt
+ This uses the values from the long, short, longplural and shortplural keys, rather than using the text, plural, first and firstplural keys. The first use singular text is obtained via:
+\genacrfullformat{label}{insert}
+ instead of from the first key, and the first use plural text is obtained via:
+\genplacrfullformat{label}{insert}
+ instead of from the firstplural key. In both cases, label is the entry’s label and insert is the insert text provided in the final optional argument of commands like \gls. The default behaviour is to do the long form (or plural long form) followed by insert and a space and the short form (or plural short form) in parentheses, where the short form is in the argument of \firstacronymfont. There are also sentence case versions:
+\Genacrfullformat{label}{insert}
+ and
+\Genplacrfullformat{label}{insert}
+ See §6 for details on changing the style of acronyms.

+

+Note that \glsentryfmt (or the formatting given by \defglsentryfmt) is not used by the \glstext-like commands.
+

+

Example 16: Custom Entry Display in Text
Suppose you want a glossary of measurements and units, you can use the symbol key to store the unit:
\newglossaryentry{distance}{name={distance},
+description={The length between two points},
+symbol={km}}
+
and now suppose you want \gls{distance} to produce “distance (km)” on first use, then you can redefine \glsentryfmt as follows:
\renewcommand*{\glsentryfmt}% 
+  \glsgenentryfmt
+  \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}% 
+
+

+(Note that I’ve used \glsentrysymbol rather than \glssymbol to avoid nested hyperlinks.)

+All of the link text will be formatted according to \glstextformat (described earlier). So if you do, say:

\renewcommand{\glstextformat}[1]{\textbf{#1}}
+\renewcommand*{\glsentryfmt}{% 
+  \glsgenentryfmt
+  \ifglsused{\glslabel}{}{\space(\glsentrysymbol{\glslabel})}% 
+}
+
then \gls{distance} will produce distance (km). This is different from using the post-link hook which is outside of \glstextformat.

+For a complete document, see the sample file sample-entryfmt.tex.

+

Example 17: Custom Format for Particular Glossary
Suppose you have created a new glossary called notation and you want to change the way the entry is displayed on first use so that it includes the symbol, you can do:
\defglsentryfmt[notation]{\glsgenentryfmt
+ \ifglsused{\glslabel}{}{\space
+   (denoted \glsentrysymbol{\glslabel})}}
+
Now suppose you have defined an entry as follows:
\newglossaryentry{set}{type={notation},
+  name={set},
+  description={A collection of objects},
+  symbol={\ensuremathS}
+}
+
The first time you reference this entry it will be displayed as: “set (denoted \(S\))” (assuming \gls was used).

+Remember that if you use the symbol key, you need to use a glossary style that displays the symbol, as many of the styles ignore it.

+ +

+ +
+

5.1.5. Hooks

+

+Both the \gls-like and \glstext-like commands use:

+\glslinkpostsetkeys
+ after the options are set. This macro does nothing by default but can be redefined. (For example, to switch off the hyperlink under certain conditions.) The glossaries-extra package additionally provides \glslinkpresetkeys.

+There is also a hook (the post-link hook) that’s implemented at the end:

+\glspostlinkhook
+ This is done after the link text has been displayed and also after the first use flag has been unset (see example 29). This means that it’s too late to use \ifglsused in the definition of \glspostlinkhook. The glossaries-extra package provides \glsxtrifwasfirstuse for use in the post-link hook.

+

+ The glossaries-extra package redefines \glspostlinkhook to allow for additional hooks that can vary according to the entry’s category. If you migrate over from only using the base glossaries package to glossaries-extra and you have redefined \glspostlinkhook, consider moving your modifications to the category post-link hook to avoid breaking the extended post-link hook features. See the glossaries-extra manual for further details.
+

+ +

+ + + + + +
+

6. Acronyms and Other Abbreviations

+

+

+The term acronyms is used here to describe the base glossary package’s mechanism for dealing with acronyms, initialisms, contractions and anything else that may have a shortened form for brevity. The term abbreviations is used to describe the enhanced mechanism provided by the glossaries-extra package, which is incompatible with the base acronym mechanism.
+

+Acronyms internally use \newglossaryentry, so you can reference them with \gls and \glspl as with other entries. Whilst it is possible to simply use \newglossaryentry explicitly with the first and text keys set to provide a full form on first use and a shortened form on subsequent use, using \newacronym establishes a consistent format. It also makes it possible to shift the insert optional argument of the \gls-like commands inside the full form, so that it is placed before the parentheses.

+The way the acronym is displayed on first use is governed by the acronym style that’s identified with \setacronymstyle. This should be set before you define your acronyms. For example:

\documentclass{article}
+\usepackage{glossaries}
+\setacronymstyle{long-short}
+\newacronym{html}{HTML}{hypertext markup language}
+\newacronym{xml}{XML}{extensible markup language}
+\begin{document}
+First use: \gls{html} and \gls{xml}.
+
+Next use: \gls{html} and \gls{xml}.
+\end{document}
+
+Example 22: Simple document with acronyms 📥🖹 📥🖺

+Example document that defines some acronym entries and references them in the text..

+

+Acronyms are defined using:

+\newacronym[key=value list]{entry-label}{short}{long}
+ This creates a glossary entry with the given label. This automatically sets type={\acronymtype} but if the acronym should go in another glossary you can set the type in the optional argument key=value list, which is added to the end of the key=value list in \newglossaryentry.

+The \newacronym command also uses the long, longplural, short and shortplural keys in \newglossaryentry to store the long and short forms and their plurals.

+

+ If you use \newacronym with glossaries-extra, you need to first set the abbreviation style for the acronym category with:
\setabbreviationstyle[acronym]{style-name}
+
+

+Note that the same restrictions on entry-label in \newglossaryentry also apply to \newacronym (see §4). Since \newacronym is defining the entry with \newglossaryentry, you can use \glsreset to reset the first use flag.

+

+Remember to declare the specified glossary type as a list of acronyms (via the package option acronymlists or the command \DeclareAcronymList) if you have multiple lists of acronyms. See §2.7. Alternatively, use glossaries-extra to have better support for a mixed glossaries.
+

+The optional argument key=value list allows you to specify additional information. Any key that can be used in the second argument of \newglossaryentry can also be used here in key=value list, but be careful about overriding any keys that are set by the acronym style, such as name, short and long.

+For example, you may need to supply description (when used with one of the styles that require a description, described in §6.2) or you can override plural forms of short or long using the shortplural or longplural keys. For example:

\newacronym[longplural={diagonal matrices}]
+  {dm}{DM}{diagonal matrix}
+
If the first use uses the plural form, \glspl{dm} will display: diagonal matrices (DMs).

+As with plural, if longplural is missing, it’s obtained by appending \glspluralsuffix to the singular form. The short plural shortplural is obtained (if not explicitly set in key=value list) by appending:

+\glsacrpluralsuffixinitial: \glspluralsuffix
+ 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 discussed earlier in §1.5.2).

+

+ A different approach is used by glossaries-extra, which has category attributes to determine whether or not to append a suffix when forming the default value of shortplural.
+

+

+Since \newacronym implicitly sets type={\acronymtype}, if you want to load a file containing acronym definitions using \loadglsentries, the optional argument that specifies the glossary will not have an effect unless you explicitly set type={\glsdefaulttype} in the optional argument to \newacronym. See §4.6.
+

+The following defines the acronym IDN and then uses it in the document text. It then resets the first use flag and uses it again.

\setacronymstyle{long-short}
+\newacronym{idn}{IDN}{identification number}
+\begin{document}
+First use: \gls{idn}. Next use: \gls{idn}.
+
+\glsreset{idn}% reset first use
+The \gls{idn}['s] prefix is a capital letter.
+Next use:
+the \gls{idn}['s] prefix is a capital letter.
+\end{document}
+
The reset (\glsreset) makes the next instance of \gls behave as first use. Note also the way the final insert optional argument is treated.
+Example 23: Defining and Using an Acronym 📥🖹 📥🖺

+Example document that defines an acronym and references it in the text..

+ If the acronym had simply been defined with:
\newglossaryentry{idn}{
+  nameIDN,
+  firstidentification number (IDN),
+  descriptionidentification number
+}
+
then the first use of \gls{idn}['s] would have placed in the insert after the parentheses:
+The identification number (IDN)’s prefix is a capital letter.
+

+If you want to use one of the small caps acronym styles, described in §6.2, you need to use lowercase characters for the shortened form:

\setacronymstyle{long-sc-short}
+\newacronym{idn}{idn}{identification number}
+

+

+Avoid nested definitions.
+

+Recall from the warning in §4 that you should avoid using the \gls-like and \glstext-like commands within the value of keys like text and first due to complications arising from nested links. The same applies to acronyms defined using \newacronym.

+For example, suppose you have defined:

\newacronym{ssi}{SSI}{server side includes}
+\newacronym{html}{HTML}{hypertext markup language}
+
you may be tempted to do:
\newacronym{shtml}{S\gls{html}}{\gls{ssi} enabled \gls{html}}
+
Don’t! This will break the case-changing commands, such as \Gls, it will cause inconsistencies on first use, and, if hyperlinks are enabled, will cause nested hyperlinks, and it will index the nested entries every time the dependent entry is indexed, which creates unnecessary locations. It will also confuse the commands used by the entry formatting (such as \glslabel).

+Instead, consider doing:

\newacronym
+ [description={\gls{ssi} enabled \gls{html}}]
+ {shtml}{SHTML}{SSI enabled HTML}
+
or if the font needs to match the style:
\newacronym
+ [description={\gls{ssi} enabled \gls{html}}]
+ {shtml}{SHTML}{\acronymfont{SSI} enabled \acronymfont{HTML}}
+
Alternatively:
\newacronym
+ [description={\gls{ssi} enabled \gls{html}}]
+ {shtml}{SHTML}
+ {server side includes enabled hypertext markup language}
+
Similarly for the \glstext-like commands.

+

+ Other approaches are available with glossaries-extra. See the sections “Nested Links” and “Multi (or Compound) Entries” in the glossaries-extra user manual.
+

+ +

+ +
+

6.1. Displaying the Long, Short and Full Forms (Independent of First Use)

+

+It may be that you want the long, short or full form regardless of whether or not the acronym has already been used in the document. You can do so with the commands described in this section.

+The \acr… commands described below are part of the set of \glstext-like commands. That is, they index and can form hyperlinks, and they don’t modify or test the first use flag. However, unlike the other \glstext-like commands, their display is governed by \defglsentryfmt with \glscustomtext set to the appropriate link text. So, for example,

\acrshort{label}[insert]
+
is similar to:
\glsdisp{% 
+ \acronymfont{\glsentryshort{label}}insert}
+
except that the first use flag isn’t unset.

+All caveats that apply to the \glstext-like commands also apply to the following commands. (Including the above warning about nested links.)

+

+ If you are using glossaries-extra, don’t use the commands described in this section. The glossaries-extra package provides analogous \glsxtr… or \glsfmt… commands. For example, \glsxtrshort instead of \acrshort or, if needed in a heading, \glsfmtshort. (Similarly for the case-changing variants.)
+

+The optional arguments are the same as those for the \glstext-like commands, and there are similar star (*) and plus (+) variants that switch off or on the hyperlinks. As with the \glstext-like commands, the link text is placed in the argument of \glstextformat.

+

+\acrshort[options]{entry-label}[insert]modifiers: * +
+ This sets the link text to the short form (within the argument of \acronymfont) for the acronym given by entry-label. The short form is as supplied by the short key, which \newacronym implicitly sets.

+There are also analogous case-changing variants:

+\Acrshort[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRshort[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+There are also plural versions:

+\acrshortpl[options]{entry-label}[insert]modifiers: * +
+ As \acrshort but uses the shortplural value.
+\Acrshortpl[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRshortpl[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\acrlong[options]{entry-label}[insert]modifiers: * +
+ This sets the link text to the long form for the acronym given by entry-label. The long form is as supplied by the long key, which \newacronym implicitly sets.

+There are also analogous case-changing variants:

+\Acrlong[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRlong[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+Again there are also plural versions:

+\acrlongpl[options]{entry-label}[insert]modifiers: * +
+ As \acrlong but uses the longplural value.
+\Acrlongpl[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRlongpl[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+

+\acrfull[options]{entry-label}[insert]modifiers: * +
+ This sets the link text to show the full form according to the format governed by the acronym style. This may not necessarily be the same format as that produced on the first use of \gls. For example, the footnote style has the long form in a footnote on the first use of \gls but \acrfull has the long form in parentheses instead.

+There are also analogous case-changing variants:

+\Acrfull[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRfull[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+The plural version is:

+\acrfullpl[options]{entry-label}[insert]modifiers: * +
+ with case-changing variants:
+\Acrfullpl[options]{entry-label}[insert]modifiers: * +
+ (sentence case) and
+\ACRfullpl[options]{entry-label}[insert]modifiers: * +
+ (all caps).

+If you find the above commands too cumbersome to write, you can use the shortcuts package option to activate the shorter command names listed in Table 6.1.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 5: Synonyms provided by the shortcuts package option
Shortcut Command Equivalent Command
\acs \acrshort
\Acs \Acrshort
\acsp \acrshortpl
\Acsp \Acrshortpl
\acl \acrlong
\Acl \Acrlong
\aclp \acrlongpl
\Aclp \Acrlongpl
\acf \acrfull
\Acf \Acrfull
\acfp \acrfullpl
\Acfp \Acrfullpl
\ac \gls
\Ac \Gls
\acp \glspl
\Acp \Glspl
+

+It is also possible to access the long and short forms without indexing using commands analogous to \glsentrytext (described in §5.2). These don’t include the acronym font commands, such as \acronymfont.

+

+\glsentrylong{entry-label}
+ Expands to the long form (that is, the value of the long key, which is internally set by \newacronym). The corresponding sentence case command is:
+\Glsentrylong{entry-label}
+

+

+\glsentrylongpl{entry-label}
+ Expands to the long plural form (that is, the value of the longplural). The corresponding sentence case command is:
+\Glsentrylongpl{entry-label}
+

+

+\glsentryshort{entry-label}
+ Expands to the short form (that is, the value of the short key, which is internally set by \newacronym). The corresponding sentence case command is:
+\Glsentryshort{entry-label}
+

+An similar command is available for the full form:

+\glsentryfull{entry-label}
+ This command is redefined by the acronym style. Unlike \glsentrylong and \glsentryshort, this does include \acronymfont, so if you need to use it in a section heading, you may need to disable it in PDF bookmarks:
\pdfstringdefDisableCommands{% provided by hyperref
+ \let\acronymfont\@firstofone
+ \let\firstacronymfont\@firstofone
+}
+

+

+\Glsentryfull{entry-label}
+ This is like \glsentryfull but applies sentence case.

+The analogous plural commands are:

+\glsentryfullpl{entry-label}
+ (no case change) and
+\Glsentryfullpl{entry-label}
+ (sentence case).

+ +

+ +
+

6.2. Changing the Acronym Style

+

+

+ If you are using glossaries-extra, don’t use the commands described in this section. Use \setabbreviationstyle to set the abbreviation style. This uses a different (but more consistent) naming scheme. For example, long-noshort instead of dua. See the “Abbreviations” chapter in the glossaries-extra manual for further details.
+

+The acronym style is set using:

+\setacronymstyle{style-name}
+ where style name is the name of the required style. The style must be set before the acronyms are defined otherwise you will end up with inconsistencies.

+For example:

\usepackage[acronym]{glossaries}
+
+\makeglossaries
+
+\setacronymstyle{long-sc-short}
+
+\newacronym{html}{html}{hypertext markup language}
+\newacronym{xml}{xml}{extensible markup language}
+

+Unpredictable results will occur if you try to use multiple styles since each acronym style redefines commands like \glsentryfull and \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 glossaries package is to adjust the entry format (see §5.1.4) or to provide a custom acronym style such as in Example 12.

+

+If you need multiple styles, then use the glossaries-extra package, which has better abbreviation management. See, for example, Gallery: Mixing Styles.
+

+The \setacronymstyle command will redefine \newacronym to use the newer 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 acronym styles are required, you will need to use rollback. As from v4.50, if you don’t use \setacronymstyle, the first instance of \newacronym will automatically implement:

\setacronymstyle{long-short}
+
which is the closest match to the old default. The earlier Example 23 can be adjusted to use rollback to demonstrated the difference:
\usepackage{glossaries}[=v4.46]% rollback to v4.46
+% no \setacronymstyle so old style used
+\newacronym{idn}{IDN}{identification number}
+\begin{document}
+First use: \gls{idn}. Next use: \gls{idn}.
+
+\glsreset{idn}% reset first use
+The \gls{idn}['s] prefix is a capital letter.
+Next use:
+the \gls{idn}['s] prefix is a capital letter.
+\end{document}
+
This produces:
+Example 24: Defining and Using an Acronym (Rollback) 📥🖹 📥🖺

+Example document that defines an acronym and references it in the text using deprecated style with rollback..

+ The most noticeable difference is the way the insert optional argument is treated with \gls on first use (\gls{idn}['s]). With the old way, \newacronym simply set firstidentification number (IDN) when it internally used \newglossaryentry to define the acronym. The default entry format simply appends the insert after the value of the first key.

+Unlike the original pre-4.02 behaviour of \newacronym, the styles set via \setacronymstyle don’t use the first key, but instead they use \defglsentryfmt to set a custom display style that uses the long and 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 “s”. In fact, most of the predefined styles use \glsgenacfmt and modify the definitions of commands like \genacrfullformat. If the original behaviour is still required for some reason, use rollback.

+In both the old and new implementation, the text key is set to the short form. Since the first isn’t set with the new form, it will default to the value of the text key. This means that with the new implementation, \glsfirst will produce the same result as \glstext. This is why you need to use \acrlong or \acrfull instead. Alternatively, reset the first use flag and use \gls.

+When you use \setacronymstyle the name key is set to:

+\acronymentry{entry-label}
+ and the sort key is set to
+\acronymsort{short}{long}
+ These commands are redefined by the acronym styles. However, you can redefine them again after the style has been set but before you use \newacronym. Protected expansion is performed on \acronymsort when the acronym is defined.

+ +

+ +
+

6.2.1. Predefined Acronym Styles

+

+The glossaries package provides a number of predefined acronym styles. These styles apply:

+\firstacronymfont{text}
+ to the short form on first use and
+\acronymfont{text}
+ on subsequent use. The styles modify the definition of \acronymfont and \firstacronymfont as required. Usually, \firstacronymfont{text} simply does \acronymfont{text}. If you want the short form displayed differently on first use, you can redefine \firstacronymfont after the acronym style is set.

+The predefined small caps styles that contain “sc” in their name (for example long-sc-short) redefine \acronymfont to use \textsc, which means that the short form needs to be specified in lowercase if it should be rendered in small caps. This is because small caps has small capital glyphs for lowercase letters but normal sized capital glyphs for uppercase letters, which means there’s no visual difference between a normal upright font and a small caps font if the text is in all caps.

+

+

+\setacronymstyle{long-sc-short}
+\newacronym{mathml}{MathML}{mathematical markup language}
+\begin{document}
+\acrshort{mathml}
+\end{document}
+
Example 25: Small-Caps Acronym 📥🖹 📥🖺

+Example document that uses the long-sc-short acronym style, which renders the short form in a small-capital font..

+

+

+Some fonts don’t support bold small caps, so you may need to redefine \glsnamefont (see §8) to switch to medium weight if you are using a glossary style that displays entry names in bold and you have chosen an acronym style that uses \textsc. (Alternatively, switch to a font that does support bold small caps.)
+

+The predefined glossary styles that contain “sm” in their name (for example long-sm-short) redefine \acronymfont to use \textsmaller.

+

+Note that the glossaries package doesn’t define or load any package that defines \textsmaller. If you use one of the acronym styles that set \acronymfont to \textsmaller you must explicitly load the relsize package or otherwise define \textsmaller.
+

+The remaining predefined styles redefine \acronymfont to simply do its argument without any font change.

+

+The predefined styles adjust \acrfull and \glsentryfull (and their plural and case-changing variants) to reflect the style.
+

+When acronyms are defined, \newacronym will set the sort key to:

+\acronymsort{short}{long}
+ The acronym styles redefine this to suit the style. This command must fully expand in order for the indexing application to pick up the correct sort value. If the sort key is set in the optional argument of \newacronym, it will override this.

+The name key is set to:

+\acronymentry{entry-label}
+ Again, the acronym styles redefine this to suit the style. If the name key is set in the optional argument of \newacronym, it will override this.

+The type key is set to \acronymtype. If the type key is set in the optional argument of \newacronym, it will override this.

+The shortplural is set to the short form appended by:

+\acrpluralsuffixinitial: \glsacrpluralsuffix
+ This is redefined by the acronym styles to the appropriate suffix. In most cases, it will simply be defined to \glspluralsuffix, but the small caps styles define it to:
+\glsupacrpluralsuffix
+ This uses:
+\glstextup{text}
+ to cancel the effect of the small caps font command \textsc.

+If the shortplural key is set in the optional argument of \newacronym, it will override this default.

+The longplural is set to the long form appended by \glspluralsuffix. If the longplural key is set in the optional argument of \newacronym, it will override this default.

+Some styles set the 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 description in the optional argument of \newacronym.

+ +

+ +
+

6.2.1.1. Long (Short)

+

+With the “long (short)” styles, acronyms are displayed in the form:

long (\firstacronymfont{short})
+
on first use and
\acronymfont{short}
+
on subsequent use.

+They also set \acronymsort so that it just expands to its first argument short. This means that the acronyms are sorted according to their short form. In addition, \acronymentry{label} is set to just the short form (enclosed in \acronymfont) and the description key is set to the long form.

+

+long-short
+ This is the default style that will be implemented if \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 first use and also with \acrfull. This redefines \acronymfont to simply do its argument.

+

+long-sc-short
+ This is like long-short but uses small caps for the short form, so it redefines \acronymfont to use \textsc and \acrpluralsuffix to \glsacrpluralsuffix.

+

+long-sm-short
+ This is like long-short but uses \textsmaller for the short form, so it redefines \acronymfont to use \textsmaller. This style will require relsize to be loaded.

+

+long-sp-short
+ This is like long-short but instead of simply using a space between the long and short form, it uses:
+\glsacspace{label}
+ This measures the short form for the given entry and, if the width is smaller than 3em, it will use non-breaking space (~). Otherwise it will use \space.

+

+ Although the glossaries-extra package doesn’t support the base acronym styles, it does redefine \glsacspace to use \glsacspacemax instead of the hard-coded 3em, as \glsacspace may also be useful in abbreviation styles.
+

+

Example 26: Adapting a Predefined Acronym Style
Suppose I want to use the footnote-sc-desc style, but I want the name key set to the short form followed by the long form in parentheses and the sort key set to the short form. Then I need to specify the footnote-sc-desc style:
\setacronymstyle{footnote-sc-desc}
+
and then redefine \acronymsort and \acronymentry:
\renewcommand*{\acronymsort}[2]{#1}% sort by short form
+\renewcommand*{\acronymentry}[1]{% short (long) name
+  \acronymfont{\glsentryshort{#1}}\space (\glsentrylong{#1})}% 
+
(I’ve used \space for extra clarity, but you can just use an actual space instead.)

+Note that the default Computer Modern fonts don’t support bold small caps, so another font is required. For example:

\usepackage[T1]{fontenc}
+
The alternative is to redefine \acronymfont so that it always switches to medium weight to ensure the small caps setting is used. For example:
\renewcommand*{\acronymfont}[1]{\textmd{\scshape #1}}
+

+The sample file sampleFnAcrDesc.tex illustrates this example.

+ +

+ +
+

6.2.1.2. Short (Long)

+

+With the “short (long)” styles, acronyms are displayed in the form:

\firstacronymfont{short} (long )
+
on first use and
\acronymfont{short}
+
on subsequent use.

+They also set \acronymsort{short}{long} to just short. This means that the acronyms are sorted according to their short form. In addition, \acronymentry{label} is set to just the short form (enclosed in \acronymfont) and the description key is set to the long form.

+

+short-long
+ This shows the short form followed by the long form in parentheses on first use and also with \acrfull. This redefines \acronymfont to simply do its argument.

+

+sc-short-long
+ This is like short-long but uses small caps for the short form, so it redefines \acronymfont to use \textsc and \acrpluralsuffix to \glsacrpluralsuffix.

+

+sm-short-long
+ This is like short-long but uses \textsmaller for the short form, so it redefines \acronymfont to use \textsmaller. This style will require relsize to be loaded.

+ +

+ +
+

6.2.1.3. Long (Short) User Supplied Description

+

+

+long-short-desc
+ This is like long-short but the description key must be provided in the optional argument of \newacronym. The sort value command \acronymsort is redefined to expand to its second argument (long), and \acronymentry is redefined to show the long form followed by the short form in parentheses.

+

+long-sc-short-desc
+ This is like long-short-desc except that it uses small caps, as long-sc-short.

+

+long-sm-short-desc
+ This is like long-short-desc except that it uses \textsmaller, as long-sm-short.

+

+long-sp-short-desc
+ This is like long-short-desc except that it uses \glsacspace, as long-sp-short.

+ +

+ +
+

6.2.1.4. Short (Long) User Supplied Description

+

+

+short-long-desc
+ This is like short-long but the description key must be provided in the optional argument of \newacronym. The sort value command \acronymsort is redefined to expand to its second argument (long), and \acronymentry is redefined to show the long form followed by the short form in parentheses.

+

+sc-short-long-desc
+ This is like short-long-desc except that it uses small caps, as long-sc-short.

+

+sm-short-long-desc
+ This is like short-long-desc except that it uses \textsmaller, as long-sm-short.

+ +

+ +
+

6.2.1.5. Do Not Use Acronym (DUA)

+

+With these styles, the \gls-like commands always display the long form regardless of whether the entry has been first useused or not. However, \acrfull and \glsentryfull will display the long form followed by the short form, as per the long-short style.

+

+dua
+ The sort value command \acronymsort expands to just its second argument (the long form), and \acronymentry shows just the long form.

+

+dua-desc
+ The sort value command \acronymsort expands to just its second argument (the long form), and \acronymentry shows just the long form.

+ +

+ +
+

6.2.1.6. Footnote

+

+With these styles, the \gls-like commands show the short form followed by the long form in a footnote on first use. The footnote is simply added with \footnote. The \acrfull set of commands show the short form followed by the long form in parentheses (as per styles like short-long). The definitions of \acronymsort and \acronymentry are as for the “short (long)” styles described in §6.2.1.2.

+

+The footnote styles automatically set hyperfirst=false to prevent nested hyperlinks.
+

+

+footnote
+ This defines \acronymentry, \acronymsort and \acronymfont in the same way as the short-long style

+

+footnote-sc
+ This defines \acronymentry, \acronymsort, \acronymfont and \acrpluralsuffix in the same way as the sc-short-long style

+

+footnote-sm
+ This defines \acronymentry, \acronymsort and \acronymfont in the same way as the sm-short-long style

+

+footnote-desc
+ This defines \acronymentry, \acronymsort and \acronymfont in the same way as the short-long-desc style

+

+footnote-sc-desc
+ This defines \acronymentry, \acronymsort and \acronymfont in the same way as the sc-short-long-desc style

+

+footnote-sm-desc
+ This defines \acronymentry, \acronymsort and \acronymfont in the same way as the sm-short-long-desc style

+ +

+ +
+

6.2.2. Defining A Custom Acronym Style

+

+You may find that the predefined acronym styles that come with the glossaries package don’t suit your requirements. In this case you can define your own style using:

+\newacronymstyle{name}{format def}{style defs}
+ where style name is the name of the new style (avoid active characters). The second argument, format def, is equivalent to the definition argument of \defglsentryfmt. You can simply use \glsgenacfmt or you can customize the display using commands like \ifglsused, \glsifplural and \glscapscase. (See §5.1.4 for further details.)

+If the style is likely to be used with a mixed glossary (that is, entries in that glossary are defined both with \newacronym and \newglossaryentry) then you can test if the entry is an acronym and use \glsgenacfmt if it is or \glsgenentryfmt if it isn’t. For example, the long-short style sets format def as

\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}
+
(You can use \ifglshasshort instead of \ifglshaslong to test if the entry is an acronym if you prefer.)

+The third argument, style defs, can be used to redefine the commands that affect the display style, such as \acronymfont and \genacrfullformat.

+

+Bear in mind that you will need to use ## rather than to reference parameters in command definitions within style defs.
+

+Note that \setacronymstyle redefines \glsentryfull and \acrfullfmt to use \genacrfullformat (and similarly for the plural and case-changing variants). If this isn’t appropriate for the style (as in the case of styles like footnote and dua) \newacronymstyle should redefine these commands within style defs.

+Within \newacronymstyle’s style defs argument you can also redefine:

+\GenericAcronymFields
+ This should expand to the list of additional fields to be set in \newglossaryentry, when it’s internally called by \newacronym. You can use the following token registers to access information passed to the arguments of \newacronym.

+

+\glskeylisttok
+ Contains the key=value list options.

+

+\glslabeltok
+ Contains the entry-label.

+

+\glsshorttok
+ Contains the short form argument.

+

+\glslongtok
+ Contains the long form argument.

+As with all token registers, you can obtain the value of the register with \theregister. For example, the long-short style does:

\renewcommand*{\GenericAcronymFields}{% 
+   description={\the\glslongtok}}
+
which sets the description field to the long form of the acronym whereas the long-short-desc style does:
\renewcommand*{\GenericAcronymFields}{}
+
since the description needs to be specified by the user.

+It may be that you want to define a new acronym style that’s based on an existing style. Within format def of the new style, you can use

+\GlsUseAcrEntryDispStyle{style-name}
+ to use the format def definition from the style given by style name.

+Within display defs of the new style, you can use

+\GlsUseAcrStyleDefs{style-name}
+ to use the display defs from the style given by style name.

+For example, the long-sc-short acronym style is based on the long-short style with minor modifications:

\newacronymstyle{long-sc-short}% 
+{% use the same display as long-short
+  \GlsUseAcrEntryDispStyle{long-short}% 
+}% 
+{% use the same definitions as long-short
+  \GlsUseAcrStyleDefs{long-short}% 
+  % Minor modifications:
+  \renewcommand{\acronymfont}[1]{\textsc{##1}}% 
+  \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% 
+}
+

+

Example 27: Defining a Custom Acronym Style
Suppose I want my acronym on first use 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 on first use to display:
\textsc{short}\footnote{long: description}
+
on subsequent use:
\textsc{short}
+
and in the list of acronyms, each entry will be displayed in the form:
long (short) description
+

+Let’s suppose it’s possible that I may have a mixed glossary. I can check this in the second argument (format def) of \newacronymstyle using:

\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}
+
This will use \glsgenentryfmt if the entry isn’t an acronym, otherwise it will use \glsgenacfmt. The third argument (display defs) of \newacronymstyle needs to redefine \genacrfullformat etc so that the first use displays the short form in the text with the long form in a footnote followed by the description. This is done as follows:
% No case change, singular first use:
+\renewcommand*{\genacrfullformat}[2]{% 
+ \firstacronymfont{\glsentryshort{##1}}##2% 
+ \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% 
+}% 
+% Sentence case, singular first use:
+\renewcommand*{\Genacrfullformat}[2]{% 
+ \firstacronymfont{\Glsentryshort{##1}}##2% 
+ \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% 
+}% 
+% No case change, plural first use:
+\renewcommand*{\genplacrfullformat}[2]{% 
+ \firstacronymfont{\glsentryshortpl{##1}}##2% 
+ \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% 
+}% 
+% Sentence case, plural first use:
+\renewcommand*{\Genplacrfullformat}[2]{% 
+ \firstacronymfont{\Glsentryshortpl{##1}}##2% 
+ \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% 
+}
+
If you think it inappropriate for the short form to be capitalised at the start of a sentence you can change the above to:
% No case change, singular first use:
+\renewcommand*{\genacrfullformat}[2]{% 
+ \firstacronymfont{\glsentryshort{##1}}##2% 
+ \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% 
+}% 
+% No case change, plural first use:
+\renewcommand*{\genplacrfullformat}[2]{% 
+ \firstacronymfont{\glsentryshortpl{##1}}##2% 
+ \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% 
+}% 
+\let\Genacrfullformat\genacrfullformat
+\let\Genplacrfullformat\genplacrfullformat
+
Another variation is to use \Glsentrylong and \Glsentrylongpl in the footnote instead of \glsentrylong and \glsentrylongpl.

+Now let’s suppose that commands such as \glsentryfull and \acrfull shouldn’t use a footnote, but instead use the format: long (short). This means that the style needs to redefine \glsentryfull, \acrfullfmt and their plural and case-changing variants.

+First, the non-linking commands:

\renewcommand*{\glsentryfull}[1]{% 
+  \glsentrylong{##1}\space
+    (\acronymfont{\glsentryshort{##1}})% 
+}% 
+\renewcommand*{\Glsentryfull}[1]{% 
+  \Glsentrylong{##1}\space
+    (\acronymfont{\glsentryshort{##1}})% 
+}% 
+\renewcommand*{\glsentryfullpl}[1]{% 
+  \glsentrylongpl{##1}\space
+    (\acronymfont{\glsentryshortpl{##1}})% 
+}% 
+\renewcommand*{\Glsentryfullpl}[1]{% 
+  \Glsentrylongpl{##1}\space
+    (\acronymfont{\glsentryshortpl{##1}})% 
+}
+
Now for the linking commands:
\renewcommand*{\acrfullfmt}[3]{% 
+  \glslink[##1]{##2}% 
+   \glsentrylong{##2}##3\space
+    (\acronymfont{\glsentryshort{##2}})% 
+  % 
+}% 
+\renewcommand*{\Acrfullfmt}[3]{% 
+  \glslink[##1]{##2}% 
+   \Glsentrylong{##2}##3\space
+    (\acronymfont{\glsentryshort{##2}})% 
+  % 
+}% 
+\renewcommand*{\ACRfullfmt}[3]{% 
+  \glslink[##1]{##2}% 
+   \glsuppercase{% 
+     \glsentrylong{##2}##3\space
+       (\acronymfont{\glsentryshort{##2}})% 
+   }% 
+  % 
+}% 
+\renewcommand*{\acrfullplfmt}[3]{% 
+  \glslink[##1]{##2}% 
+   \glsentrylongpl{##2}##3\space
+     (\acronymfont{\glsentryshortpl{##2}})% 
+  % 
+}% 
+\renewcommand*{\Acrfullplfmt}[3]{% 
+  \glslink[##1]{##2}% 
+   \Glsentrylongpl{##2}##3\space
+     (\acronymfont{\glsentryshortpl{##2}})% 
+  % 
+}% 
+\renewcommand*{\ACRfullplfmt}[3]{% 
+  \glslink[##1]##2% 
+   \glsuppercase{% 
+     \glsentrylongpl{##2}##3        (\acronymfont{\glsentryshortpl{##2}})% 
+   }% 
+  % 
+}
+
(This may cause problems with long hyperlinks, in which case adjust the definitions so that, for example, only the short form is inside the argument of \glslink.)

+The style also needs to redefine \acronymsort so that the acronyms are sorted according to the long form:

\renewcommand*{\acronymsort}[2]{##2}
+
If you prefer them to be sorted according to the short form you can change the above to:
\renewcommand*{\acronymsort}[2]{##1}
+
The acronym font needs to be set to \textsc and the plural suffix adjusted so that the “s” suffix in the plural short form doesn’t get converted to small caps:
\renewcommand*{\acronymfont}[1]{\textsc{##1}}% 
+\renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% 
+
There are a number of ways of dealing with the format in the list of acronyms. The simplest way is to redefine \acronymentry to the long form followed by the upper case short form in parentheses:
\renewcommand*{\acronymentry}[1]{% 
+  \Glsentrylong{##1}\space
+    (\glsuppercase\glsentryshort{##1})}
+
(I’ve used \Glsentrylong instead of \glsentrylong to capitalise the name in the glossary.)

+An alternative approach is to set \acronymentry to just the long form and redefine \GenericAcronymFields to set the symbol key to the short form and use a glossary style that displays the symbol in parentheses after the name (such as the tree style) like this:

\renewcommand*{\acronymentry}[1]{\Glsentrylong{##1}}% 
+\renewcommand*{\GenericAcronymFields}{% 
+   symbol={\protect\glsuppercase{\the\glsshorttok}}}% 
+
I’m going to use the first approach and set \GenericAcronymFields to do nothing:
\renewcommand*{\GenericAcronymFields}{}% 
+

+Finally, this style needs to switch off hyperlinks on first use to avoid nested links:

\glshyperfirstfalse
+
Putting this all together:
\newacronymstyle{custom-fn}% new style name
+{% entry format
+ \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% 
+}% 
+{% 
+ \renewcommand*{\GenericAcronymFields}{}% 
+ \glshyperfirstfalse
+ % No case change, singular first use:
+ \renewcommand*{\genacrfullformat}[2]{% 
+  \firstacronymfont{\glsentryshort{##1}}##2% 
+  \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% 
+ }% 
+ % Sentence case, singular first use:
+ \renewcommand*{\Genacrfullformat}[2]{% 
+  \firstacronymfont{\Glsentryshort{##1}}##2% 
+  \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% 
+ }% 
+ % No case change, plural first use:
+ \renewcommand*{\genplacrfullformat}[2]{% 
+  \firstacronymfont{\glsentryshortpl{##1}}##2% 
+  \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% 
+ }% 
+ % Sentence case, plural first use:
+ \renewcommand*{\Genplacrfullformat}[2]{% 
+  \firstacronymfont{\Glsentryshortpl{##1}}##2% 
+  \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% 
+ }% 
+ % non-linking commands
+ \renewcommand*{\glsentryfull}[1]{% 
+   \glsentrylong{##1}\space
+     (\acronymfont{\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\Glsentryfull}[1]{% 
+   \Glsentrylong{##1}\space
+     (\acronymfont{\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\glsentryfullpl}[1]{% 
+   \glsentrylongpl{##1}\space
+     (\acronymfont{\glsentryshortpl{##1}})% 
+ }% 
+ \renewcommand*{\Glsentryfullpl}[1]{% 
+   \Glsentrylongpl{##1}\space
+     (\acronymfont{\glsentryshortpl{##1}})% 
+ }% 
+ % linking commands
+ \renewcommand*{\acrfullfmt}[3]{% 
+   \glslink[##1]{##2}% 
+    \glsentrylong{##2}##3\space
+     (\acronymfont{\glsentryshort{##2}})% 
+   % 
+ }% 
+ \renewcommand*{\Acrfullfmt}[3]{% 
+   \glslink[##1]{##2}% 
+    \Glsentrylong{##2}##3\space
+     (\acronymfont{\glsentryshort{##2}})% 
+   % 
+ }% 
+ \renewcommand*{\ACRfullfmt}[3]{% 
+   \glslink[##1]{##2}% 
+    \glsuppercase{% 
+      \glsentrylong{##2}##3\space
+        (\acronymfont{\glsentryshort{##2}})% 
+    }% 
+   % 
+ }% 
+ \renewcommand*{\acrfullplfmt}[3]{% 
+   \glslink[##1]{##2}% 
+    \glsentrylongpl{##2}##3\space
+      (\acronymfont{\glsentryshortpl{##2}})% 
+   % 
+ }% 
+ \renewcommand*{\Acrfullplfmt}[3]{% 
+   \glslink[##1]{##2}% 
+    \Glsentrylongpl{##2}##3\space
+      (\acronymfont{\glsentryshortpl{##2}})% 
+   % 
+ }% 
+ \renewcommand*{\ACRfullplfmt}[3]{% 
+   \glslink[##1]##2% 
+    \glsuppercase{% 
+      \glsentrylongpl{##2}##3         (\acronymfont{\glsentryshortpl{##2}})% 
+    }% 
+   % 
+ }% 
+ % font
+ \renewcommand*{\acronymfont}[1]{\textsc{##1}}% 
+ \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% 
+ % sort
+ \renewcommand*{\acronymsort}[2]{##2}% 
+ % name
+ \renewcommand*{\acronymentry}[1]{% 
+   \Glsentrylong{##1}\space
+     (\glsuppercase\glsentryshort{##1})}% 
+}
+

+Now I need to specify that I want to use this new style:

\setacronymstyle{custom-fn}
+
I also need to use a glossary style that suits this acronym style, for example altlist:
\setglossarystyle{altlist}
+

+Once the acronym style has been set, I can define my acronyms:

\newacronym[description={set of tags for use in  developing hypertext documents}]{html}{html}{Hyper 
+Text Markup Language}
+
+\newacronym[description={language used to describe the  layout of a document written in a markup language}]{css}
+{css}{Cascading Style Sheet}
+

+The sample file sample-custom-acronym.tex illustrates this example.

+

Example 28: Italic and Upright Abbreviations
Suppose I want to have some acronyms in italic and some that just use the surrounding font. Hard-coding this into the short argument of \newacronym can cause complications.

+This example uses \glsaddstoragekey to add an extra field that can be used to store the formatting declaration (such as \em).

\glsaddstoragekey{font}{}{\entryfont}
+
This defines a new field/key called font, which defaults to nothing if it’s not explicitly set. This also defines a command called \entryfont that’s analogous to \glsentrytext. A new style is then created to format acronyms that access this field.

+There are two ways to do this. The first is to create a style that doesn’t use \glsgenacfmt but instead provides a modified version that doesn’t use \acronymfont but instead uses

{\entryfont{\glslabel}short}.
+
The full format given by commands such as \genacrfullformat need to be similarly adjusted. For example:
\renewcommand*{\genacrfullformat}[2]{% 
+ \glsentrylong{##1}##2\space
+ ({\entryfont{##1}\glsentryshort{##1}})% 
+}% 
+
This will deal with commands like \gls but not commands like \acrshort which still use \acronymfont. Another approach is to redefine \acronymfont to look up the required font declaration. Since \acronymfont doesn’t take the entry label as an argument, the following will only work if \acronymfont is used in a context where the label is provided by \glslabel. This is true in \gls, \acrshort and \acrfull. The redefinition is now:
\renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}##1}}% 
+
So the new style can be defined as:
\newacronymstyle{long-font-short}
+{% 
+ \GlsUseAcrEntryDispStyle{long-short}% 
+}% 
+{% 
+ \GlsUseAcrStyleDefs{long-short}% 
+ \renewcommand*{\genacrfullformat}[2]{% 
+  \glsentrylong{##1}##2\space
+  ({\entryfont{##1}\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\Genacrfullformat}[2]{% 
+  \Glsentrylong{##1}##2\space
+  ({\entryfont{##1}\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\genplacrfullformat}[2]{% 
+  \glsentrylongpl{##1}##2\space
+  ({\entryfont{##1}\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\Genplacrfullformat}[2]{% 
+  \Glsentrylongpl{##1}##2\space
+  ({\entryfont{##1}\glsentryshort{##1}})% 
+ }% 
+ \renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}##1}}% 
+ \renewcommand*{\acronymentry}[1]{{\entryfont{##1}\glsentryshort{##1}}}% 
+}
+
Remember the style needs to be set before defining the entries:
\setacronymstyle{long-font-short}
+

+The complete document is contained in the sample file sample-font-abbr.tex.

+Some writers and publishing houses have started to drop full stops (periods) from uppercase initials but may still retain them for lowercase abbreviations, while others may still use them for both upper and lowercase. This can cause complications. Chapter 12 of The TeXbook discusses the spacing between words but, briefly, the default behaviour of TeX is to assume that an uppercase character followed by a full stop and space is an abbreviation, so the space is the default inter-word space whereas a lowercase character followed by a full stop and space is a word occurring at the end of a sentence, which requires an inter-sentence space (which may or may not be the same as an inter-word space). In the event that this isn’t true, you need to make a manual adjustment using \␣ (backslash space) in place of just a space character for an inter-word mid-sentence space and use \@ before the full stop to indicate the end of the sentence.

+For example:

I was awarded a B.Sc. and a Ph.D. (From the same place.)
+
is typeset as
+I was awarded a B.Sc. and a Ph.D. (From the same place.)
+ The spacing is more noticeable with the typewriter font:
\ttfamily
+I was awarded a B.Sc. and a Ph.D. (From the same place.)
+
is typeset as
+I was awarded a B.Sc. and a Ph.D. (From the same place.)
+ The lowercase letter at the end of “B.Sc.” is confusing TeX into thinking that the full stop after it marks the end of the sentence. Whereas the uppercase letter at the end of “Ph.D.” has confused TeX into thinking that the following full stop is just part of the abbreviation. These can be corrected:
I was awarded a B.Sc.\ and a Ph.D\@. (From the same place.)
+

+This situation is a bit problematic for glossaries. The full stops can form part of the short argument of \newacronym and the B.Sc.\␣ part can be dealt with by remembering to add \␣ (for example, \gls{bsc}\␣ but the end of sentence case is more troublesome as you need to omit the sentence terminating full stop (to avoid two dots) which can make the source code look a little strange but you also need to adjust the space factor, which is usually done by inserting \@ before the full stop.

+The next example shows one way of achieving this.

+

+ The glossaries-extra package provides a much simpler way of doing this, which you may prefer to use. See sample-initialisms.shtmlGallery: Initialisms.
+

+

Example 29: Abbreviations with Full Stops (Periods)
The post-link hook (\glspostlinkhook) is called at the very end of the \gls-like and \glstext-like commands. This can be redefined to check if the following character is a full stop. The amsgen package (which is automatically loaded by glossaries) provides an internal command called \new@ifnextchar that can be used to determine if the given character appears next. (For more information see the amsgen documentation. Alternatively, LaTeX3 may provide a better way of doing this.)

+It’s possible that I may also want acronyms or contractions (without full stops) in my document, so I need some way to differentiate between them. Here I’m going to use the same method as in Example 12 where a new field is defined to indicate the type of abbreviation:

\glsaddstoragekey{abbrtype}{word}{\abbrtype}
+
+\newcommand*{\newabbr}[1][]{\newacronym[abbrtype=initials,#1]}
+
Now I just use \newacronym for the acronyms, for example,
\newacronym{laser}{laser}{light amplification by stimulated
+emission of radiation}
+
and my new command \newabbr for initials, for example,
\newabbr{eg}{e.g.}{exempli gratia}
+\newabbr{ie}{i.e.}{id est}
+\newabbr{bsc}{B.Sc.}{Bachelor of Science}
+\newabbr{ba}{B.A.}{Bachelor of Arts}
+\newabbr{agm}{A.G.M.}{annual general meeting}
+
Within \glspostlinkhook the entry’s label can be accessed using \glslabel and \ifglsfieldeq can be used to determine if the current entry has the new abbrtype field set to “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 full stop. 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 \makeatletter and \makeatother:

\makeatletter
+\renewcommand{\glspostlinkhook}{% 
+ \ifglsfieldeq{\glslabel}{abbrtype}{initials}% 
+ {\new@ifnextchar.\doendsentence\doendword}
+ {}% 
+}
+\makeatother
+
In the event that a full stop is found then \doendsentence is performed, but it will be followed by the full stop, which needs to be discarded. Otherwise \doendword will be done, but it won’t be followed by a full stop so there’s nothing to discard. The definitions for these commands are:
\newcommand{\doendsentence}[1]{\spacefactor=10000 }
+\newcommand{\doendword}{\spacefactor=1000 }
+
Now, I can just do \gls{bsc} mid-sentence and \gls{phd}. at the end of the sentence. The terminating full stop will be discarded in the latter case, but it won’t be discarded in, say, \gls{laser}. as that doesn’t have the abbrtype field set to “initials”.

+This also works on first use when the style is set to one of the long (short) styles but it will fail with the short (long) styles as in this case the terminating full stop shouldn’t be discarded. Since \glspostlinkhook is used after the first use flag has been unset for the entry, this can’t be fixed by simply checking with \ifglsused. One possible solution to this is to redefine \glslinkpostsetkeys to check for the first use flag and define a macro that can then be used in \glspostlinkhook.

+The other thing to consider is what to do with plurals. One possibility is to check for plural use within \doendsentence (using \glsifplural) and put the full stop back if the plural has been used.

+The complete document is contained in the sample file sample-dot-abbr.tex.

+ +

+ +
+

6.3. Displaying the List of Acronyms

+

+The list of acronyms is just like any other type of glossary and can be displayed on its own using the appropriate \printglossary command, according to the indexing method.

+For example, Option 1:

\printnoidxglossary[type=\acronymtype]
+

+Options 2 or 3:

\printglossary[type=\acronymtype]
+
Or if you have used the acronym or acronyms package option:
\printacronyms
+
See §2.7.)

+Alternatively, the list of acronyms can be displayed with all the other glossaries using \printnoidxglossaries (Option 1) or \printglossaries (Options 2 or 3).

+The remaining indexing methods require glossaries-extra, which has its own abbreviation commands that are incompatible with the base acronym commands.

+

+Care must be taken to choose a glossary style that’s appropriate to your acronym style. Alternatively, you can define your own custom style (see §13.2 for further details).
+

+ +

+ +
+

6.4. Upgrading From the glossary Package

+

+

+The old glossary package was made obsolete in 2007, when the first version of 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 “Upgrading from the glossary package to the glossaries package”.
+

+Users of the obsolete glossary package may recall that the syntax used to define new acronyms has changed with the replacement glossaries package. In addition, the old glossary package created the command \acr-name when defining the acronym acr-name.

+In order to facilitate migrating from the old glossary package to the new one, the glossaries package provides the command:

+\oldacronym[label]{short}{long}{key=value list}
+ This uses the same syntax as the glossary package’s method of defining acronyms. It is equivalent to:
\newacronym[key=value list]{label}{short}{long}
+
In addition, \oldacronym also defines the commands \label, which is equivalent to \gls{label}, and \label*, which is equivalent to the sentence case \Gls{label}. If label is omitted, short is used. Since commands names must consist only of alphabetical characters, label must also only consist of alphabetical characters. Note that \label doesn’t allow you to use the first optional argument of \gls or \Gls―you will need to explicitly use \gls or \Gls to change the settings.

+

+Recall that, in general, LaTeX ignores spaces following command names consisting of alphabetical characters. This is also true for \label unless you additionally load the xspace package, but be aware that there are some issues with using xspace. (See David Carlisle’s explanation in Drawbacks of xspace.)
+

+The glossaries package doesn’t load the xspace package since there are both advantages and disadvantages to using \xspace in \label. If you don’t use the xspace package, then you need to explicitly force a space using \␣ (backslash space). On the other hand, you can follow the \label command with the optional insert text in square brackets (the final optional argument to \gls). If you use the 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 to achieve that).

+To illustrate this, suppose I define the acronym “abc” as follows:

\oldacronym{abc}{example acronym}{}
+
This will create the command \abc and its starred version \abc*. Table 6.2 illustrates the effect of \abc (on subsequent use) according to whether or not the xspace package has been loaded. As can be seen from the final row in the table, the xspace package prevents the optional argument from being recognised.

+

+ + + + + + + + + + + + + + + + + + +
Table 6: The effect of using xspace with \oldacronym
Code With xspace Without xspace
\abc. abc. abc.
\abc xyz abc xyz abcxyz
\abc\ xyz abc xyz abc xyz
\abc* xyz Abc xyz Abc xyz
\abc['s] xyz abc [’s] xyz abc’s xyz
+

+ +

+ +
+

7. Unsetting and Resetting Entry Flags

+

+When using the \gls-like commands it is possible that you may want to use the value given by the first key, even though you have already used the glossary entry. Conversely, you may want to use the value given by the text key, even though you haven’t used the glossary entry.

+The former can be achieved by one of the following commands:

+\glsreset{entry-label}
+ which globally resets the first use flag and
+\glslocalreset{entry-label}
+ which locally resets the first use flag.

+The latter can be achieved by one of the following commands:

+\glsunset{entry-label}
+ which globally unsets the first use flag and
+\glslocalunset{entry-label}
+ which locally unsets the first use flag.

+The above commands are for the specific entry identified by the argument entry-label. You can also reset or unset all entries for a given glossary or multiple glossaries using:

+\glsresetall[glossary labels list]
+ which globally resets the first use flags and
+\glslocalresetall[glossary labels list]
+ which locally resets the first use flags or
+\glsunsetall[glossary labels list]
+ which globally unsets the first use flags and
+\glslocalunsetall[glossary labels list]
+ which locally unsets the first use flags.

+The optional argument glossary labels list should be a comma-separated list of glossary labels. If omitted, the list of all non-ignored glossaries is assumed.

+For example, to reset all entries in the main glossary and the acronym list:

\glsresetall[main,acronym]
+

+

+ The glossaries-extra package additional provides the options preunset and prereset for the \gls-like commands, that will unset or reset the first use flag before the link text, which will make the \gls-like command behave as though it was the subsequent use or first use, irrespective of whether or not the entry has actually been used.
+

+You can determine whether an entry’s first use flag is set with \ifglsused. With bib2gls, you may need to use \GlsXtrIfUnusedOrUndefined instead.

+

+Be careful when using \gls-like commands within an environment or command argument that gets processed multiple times as it can cause unwanted side-effects when the first use displayed text is different from subsequent use.
+

+For example, the frame environment in beamer processes its argument for each overlay. This means that the first use flag will be unset on the first overlay and subsequent overlays will use the subsequent use form.

+Consider the following example:

\documentclass{beamer}
+
+\usepackage{glossaries}
+
+\newacronym{svm}{SVM}{support vector machine}
+
+\begin{document}
+
+\begin{frame}
+ \frametitle{Frame 1}
+
+ \begin{itemize}
+  \item<+-> \gls{svm}
+  \item<+-> Stuff.
+ \end{itemize}
+\end{frame}
+
+\end{document}
+

+On the first overlay, \gls{svm} produces “support vector machine (SVM)” and then unsets the first use flag. When the second overlay is processed, \gls{svm} now produces “SVM”, which is unlikely to be the desired effect. I don’t know anyway around this and I can only offer the following suggestions.

+ +

    +
  1. 1.Unset all acronyms at the start of the document and explicitly use \acrfull when you want the full version to be displayed:
    \documentclass{beamer}
    +
    +\usepackage{glossaries}
    +
    +\newacronym{svm}{SVM}{support vector machine}
    +
    +\glsunsetall
    +
    +\begin{document}
    +
    +\begin{frame}
    + \frametitle{Frame 1}
    +
    + \begin{itemize}
    +  \item<+-> \acrfull{svm}
    +  \item<+-> Stuff.
    + \end{itemize}
    +\end{frame}
    +
    +\end{document}
    +

    +

  2. 2.Explicitly reset each acronym on first use:
    \begin{frame}
    + \frametitle{Frame 1}
    +
    + \begin{itemize}
    +  \item<+-> \glsreset{svm}\gls{svm}
    +  \item<+-> Stuff.
    + \end{itemize}
    +\end{frame}
    +
    Alternatively, with glossaries-extra:
    \documentclass{beamer}
    +
    +\usepackage{glossaries-extra}
    +
    +\newabbreviation{svm}{SVM}{support vector machine}
    +
    +\begin{document}
    +
    +\begin{frame}
    + \frametitle{Frame 1}
    +
    + \begin{itemize}
    +  \item<+-> \gls[prereset]{svm}
    +  \item<+-> Stuff.
    + \end{itemize}
    +\end{frame}
    +
    +\end{document}
    +

    +

  3. 3.Use the glossaries-extra package’s unset buffering mechanism:
    \documentclass{beamer}
    +
    +\usepackage{glossaries-extra}
    +
    +\newabbreviation{svm}{SVM}{support vector machine}
    +
    +\begin{document}
    +
    +\GlsXtrStartUnsetBuffering
    +\GlsXtrUnsetBufferEnableRepeatLocal
    +\begin{frame}
    +\GlsXtrResetLocalBuffer
    + \frametitle{Frame 1}
    +
    + \begin{itemize}
    +  \item<+-> \gls{svm}
    +  \item<+-> Stuff.
    + \end{itemize}
    +\end{frame}
    +\GlsXtrStopUnsetBuffering
    +
    +\end{document}
    +
    See the glossaries-extra manual for further details. +
+

+These are non-optimal, but the beamer class is too complex for me to provide a programmatic solution. Other potentially problematic environments are some tabular-like environments (but not 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 amsmath environments, such as align, also process their contents multiple times, but the glossaries package now checks for this. For tabularx, you need to explicitly patch it by placing \glspatchtabularx in the preamble (or anywhere before the problematic use of tabularx).

+ +

+ +
+

7.1. Counting the Number of Times an Entry has been Used (First Use Flag Unset)

+

+It’s possible to keep track of how many times an entry is used. That is, how many times the first use flag is unset. Note that the supplemental glossaries-extra package improves this function and also provides per-unit counting, which isn’t available with the glossaries package.

+

+This function is disabled by default as it adds extra overhead to the document build time and also switches \newglossaryentry (and therefore \newacronym) into a preamble-only command.
+

+To enable this function, use:

+\glsenableentrycount
+ before defining your entries. This adds two extra (internal) fields to entries: currcount and prevcount.

+The currcount field keeps track of how many times \glsunset is used within the document. A local unset (using \glslocalunset) performs a local rather than global increment to currcount. Remember that not all commands use \glsunset. Only the \gls-like commands do this.

+The behaviour of the reset commands depend on the conditional:

+\ifglsresetcurrcount true\else false\fiinitial: \iffalse
+ If true, the reset commands \glsreset and \glslocalreset will reset the value of the currcount field back to 0. This conditional can be set to true with:
+\glsresetcurrcounttrue
+ and to false with:
+\glsresetcurrcountfalse
+ The default is false, as from version 4.50.

+The prevcount field stores the final value of the currcount field from the previous run. This value is read from the aux file at the beginning of the document environment.

+You can access these fields using

+\glsentrycurrcount{entry-label}
+ for the currcount field, and
+\glsentryprevcount{entry-label}
+ for the prevcount field.

+

+These commands are only defined if you have used \glsenableentrycount.
+

+For example:

\documentclass{article}
+\usepackage{glossaries}
+\makeglossaries
+
+\glsenableentrycount
+
+\newglossaryentry{apple}{name={apple},description={a fruit}}
+
+\begin{document}
+Total usage on previous run: \glsentryprevcount{apple}.
+
+\gls{apple}. \gls{apple}.  \glsadd{apple}\glsentrytext{apple}.
+\glslink{apple}{apple}.  \glsdisp{apple}{apple}. \Gls{apple}.
+
+Number of times apple has been used: \glsentrycurrcount{apple}.
+\end{document}
+
On the first LaTeX run, \glsentryprevcount{apple} produces 0. At the end of the document, \glsentryprevcount{apple} produces 4. This is because the only commands that have incremented the entry count are those that use \glsunset. That is: \gls, \glsdisp and \Gls. The other commands used in the above example, \glsadd, \glsentrytext and \glslink, don’t use \glsunset so they don’t increment the entry count. On the next LaTeX run, \glsentryprevcount{apple} now produces 4 as that was the value of the currcount field for the “apple” entry at the end of the document on the previous run.

+When you enable the entry count using \glsenableentrycount, you also enable the following commands:

+\cgls[options]{entry-label}[insert]modifiers: * +
+ (no case-change, singular, analogous to \gls)
+\cglspl[options]{entry-label}[insert]modifiers: * +
+ (no case-change, plural, analogous to \glspl)
+\cGls[options]{entry-label}[insert]modifiers: * +
+ (first letter uppercase, singular, analogous to \Gls), and
+\cGlspl[options]{entry-label}[insert]modifiers: * +
+ (first letter uppercase, plural, analogous to \Glspl).

+

+ All caps versions are only available with glossaries-extra.
+

+If you don’t use \glsenableentrycount, these commands behave like their counterparts \gls, \glspl, \Gls and \Glspl, respectively, but there will be a warning that you haven’t enabled entry counting.

+If you have enabled entry counting with \glsenableentrycount then these commands test if \glsentryprevcount{entry-label} equals 1. If it doesn’t then the analogous \gls etc will be used. If it is 1, then the first optional argument will be ignored and

cs format{entry-label}{insert}\glsunset{entry-label}
+
will be performed, where cs format is a command that takes two arguments. The command used depends whether you have used \cgls, \cglspl, \cGls or \cGlspl.

+The formatting command cs format will be one of the following:

+\cglsformat{entry-label}{insert}
+ This command is used by \cgls and defaults to
\glsentrylong{entry-label}insert
+
if the entry given by entry-label has a long form or
\glsentryfirst{entry-label}insert
+
otherwise.

+

+\cglsplformat{entry-label}{insert}
+ This command is used by \cglspl and defaults to
\glsentrylongpl{entry-label}insert 
+
if the entry given by entry-label has a long form or
\glsentryfirstplural{label}insert
+
otherwise.

+

+\cGlsformat{entry-label}{insert}
+ This command is used by \cGls and defaults to
\Glsentrylong{entry-label}insert
+
if the entry given by entry-label has a long form or
\Glsentryfirst{entry-label}insert
+
otherwise.

+

+\cGlsplformat{entry-label}{insert}
+ This command is used by \cGlspl and defaults to
\Glsentrylongpl{entry-label}
{entry-label}insert +
if the entry given by entry-label has a long form or
\Glsentryfirstplural{entry-label}insert
+
otherwise.

+This means that if the previous count for the given entry was 1, the entry won’t be hyperlinked with the \cgls-like commands and those commands won’t index (that is, they won’t add a line to the external glossary file). If you haven’t used any of the other commands that index (such as \glsadd or the \glstext-like commands) then the entry won’t appear in the glossary.

+Remember that since these commands use \glsentryprevcount you need to run LaTeX twice to ensure they work correctly. The document build requires a second LaTeX call before running the indexing application. For example, if the document is in a file called myDoc.tex, then the document build needs to be:

pdflatex myDoc
+pdflatex myDoc
+makeglossaries myDoc
+pdflatex myDoc
+

+In the following document, the acronyms that have only been used once (on the previous run) only have their long form shown with \cgls.

\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[acronym]{glossaries}
+\makeglossaries
+
+\glsenableentrycount
+
+\setacronymstyle{long-short}
+
+\newacronym{html}{HTML}{hypertext markup language}
+\newacronym{css}{CSS}{cascading style sheets}
+\newacronym{xml}{XML}{extensible markup language}
+\newacronym{sql}{SQL}{structured query language}
+\newacronym{rdbms}{RDBMS}{relational database management system}
+\newacronym{rdsms}{RDSMS}{relational data stream management system}
+
+\begin{document}
+These entries are only used once: \cgls{sql}, \cgls{rdbms},
+\cgls{xml}. These entries are used multiple times:
+\cgls{html}, \cgls{html}, \cgls{css}, \cgls{css}, \cgls{css},
+\cgls{rdsms}, \cgls{rdsms}.
+
+\printglossaries
+\end{document}
+
After a complete document build the list of acronyms 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 hyperlink.
+Example 30: Don’t index entries that are only used once 📥🖹 📥🖺

+Example document that only includes the entries that have been used more than once in the document.

+

+

+ With bib2gls there’s an analogous record counting set of commands. See glossaries-extra and bib2gls manuals for further details.
+

+ +

+ +
+

8. Displaying a Glossary

+

+All defined glossaries may be displayed using the appropriate command, such as \printglossary, that matches the indexing method. These commands are collectively referred to as the \printglossary set of commands.

+

+With Options 2, 3 or 4, if the glossary does not appear after you re-LaTeX your document, check the makeindex, xindy or bib2gls log files (glg or the log-ext argument of \newglossary), as applicable, to see if there is a problem. With Option 1, you just need two LaTeX runs to make the glossaries appear, but you may need further runs to make the number lists up-to-date. If you have used the automake option, check the log file for “runsystem” lines (see the information about the automake option in §2.5 for further details).
+

+Option 1 (must be used with \makenoidxglossaries in the document preamble):

+\printnoidxglossary[options]
+ This displays the glossary identified by the type option in options or, if omitted, the glossary identified by \glsdefaulttype. This command iterates over a list of entry labels, which it will have to first sort with sort=standard. The list will only include those entries that have been indexed and the appropriate glossary markup is added within the loop. This makes it unsuitable for the tabular-like glossary styles, such as long and super.

+The following is an iterative command:

+\printnoidxglossaries
+ which internally uses \printnoidxglossary for each non-ignored glossary.

+Options 2 and 3 (must be used with \makeglossaries in the document preamble):

+\printglossary[options]
+ This displays the glossary identified by the type option in options or, if omitted, the glossary identified by \glsdefaulttype. This command internally inputs the associated glossary file (created by the relevant indexing application) if it exists. The glossary file contains the markup to typeset the glossary. See §1.6 for information on how to create the glossary file.

+The following is an iterative command:

+\printglossaries
+ which internally uses \printglossary for each non-ignored glossary.

+

+While the external glossary files are missing, \printglossary will just do \null for each missing glossary to assist dictionary style documents that just use \glsaddall without inserting any text. This use of \null ensures that all indexing information is written before the final page is shipped out. Once the external glossary files are present \null will no longer be used. This can cause a spurious blank page on the first LaTeX run before the glossary files have been created. Once these files are present, \null will no longer be used and so shouldn’t cause interference for the final document. With glossaries-extra, placeholder text is used instead.
+

+Options 4 and 5 (glossaries-extra only):

+\printunsrtglossary[options]
+ This displays the glossary identified by the type option in options or, if omitted, the glossary identified by \glsdefaulttype. This command is similar to \printnoidxglossary, in that it iterates over a list of entry labels, 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 glossary’s internal label list).

+The reason this command works with bib2gls is because bib2gls writes the entry definitions in the glstex file in the order obtained by the sort resource option, and bib2gls will only include the entries that match the required selection criteria.

+With Option 5 (that is, without bib2gls) the result will be in the order the entries were defined in the tex file. There’s no attempt to gather child entries (see §4.5). This means that if you don’t define child entries immediately after their parent, you will have a strange result (depending on the glossary style).

+As with \printnoidxglossary, the glossary markup is inserted during the loop but, unlike that command, \printunsrtglossary performs the loop outside of the glossary style, which means that there are no issues with the tabular-like styles. See the glossaries-extra manual for further details.

+The following is an iterative command:

+\printunsrtglossaries
+ which internally uses \printunsrtglossary for each non-ignored glossary.

+The glossaries-extra package also provides

+\printunsrtinnerglossary[options]{pre-code}{post-code}
+ 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: Inner or Nested Glossaries. See the glossaries-extra package for further details.

+All the individual glossary commands \printglossary have an optional argument. Available options are listed in §8.1.

+After the options have been set, the following command will be defined:

+\currentglossary
+ This expands to the label of the current glossary (identified by the type option). It may be used within glossary style hooks, if required.

+ +

+ +
+

8.1. \printglossary Options

+

+These options may be used in the optional argument of the \printglossary 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 glossary. They may then be redefined by applicable options.

+type Identifies the glossary to display. The value should be the glossary label. Note that you can only display an ignored glossary with \printunsrtglossary or \printunsrtinnerglossary, otherwise glossary-label should correspond to a glossary that was defined with \newglossary or \altnewglossary.

+title Sets the glossary’s title (\glossarytitle). This option isn’t available with \printunsrtinnerglossary.

+toctitle Sets the glossary’s table of contents title (\glossarytoctitle). This option isn’t available with \printunsrtinnerglossary.

+style The glossary style to use with this glossary (overriding the current style that was either set with the style package option or with \setglossarystyle). This option isn’t available with \printunsrtinnerglossary.

+numberedsection This may be used to override the numberedsection package option, and has the same syntax as that option (see §2.2). This option isn’t available with \printunsrtinnerglossary.

+nonumberlist This may be used to override the nonumberlist package option. Note that, unlike the valueless package option, this option is boolean.

+nogroupskip This may be used to override the nogroupskip package option. Only relevant if the glossary style uses the conditional \ifglsnogroupskip to test for this option.

+nopostdot This may be used to override the nopostdot package option. This option is only applicable if the glossary style uses \glspostdescription.

+entrycounter This may be used to override the entrycounter package option. Note that one of the package options entrycounter=true or subentrycounter=true must be used to make \glsrefentry work correctly. The setting can then be switched off with this option for individual glossaries where the setting shouldn’t apply.

+subentrycounter This may be used to override the subentrycounter package option. Note that one of the package options entrycounter=true or subentrycounter=true must be used to make \glsrefentry work correctly. The setting can then be switched off with this option for individual glossaries where the setting shouldn’t apply.

+

+If you want to set both the entrycounter and subentrycounter settings, and you haven’t already enabled them with the entrycounter and subentrycounter package options, make sure you specify entrycounter first (but bear in mind \glsrefentry won’t work). In general, it’s best to enable these settings via the package options and switch them off for the glossaries where they don’t apply.
+

+sort This key is only available with \printnoidxglossary.

+

+If you use the sort=use or sort=def values make sure that you select a glossary style that doesn’t have a visual indicator between groups, as the grouping no longer makes sense. Consider using the nogroupskip option.
+

+If you don’t get an error with sort=use and sort=def but you do get an error with one of the other sort options, then you probably need to use the sanitizesort=true package option or make sure none of the entries have fragile commands in their sort field.

+

+sort=use
+ Order of use. There’s no actual sorting in this case. The order is obtained from the indexing information in the aux file.

+

+sort=def
+ Order of definition. There’s no actual sorting in this case. The order is obtained from the glossary’s internal list of labels.

+

+The above two settings don’t perform any actual sorting. The following settings sort using simple character code comparisons and are therefore unsuitable for non-ASCII documents.

+For a locale-sensitive sort, you must use either xindy (Option 3) or bib2gls (Option 4). Note that bib2gls provides many other sort options.

+

+

+sort=nocase
+ Case-insensitive order.

+

+sort=case
+ Case-sensitive order.

+

+sort=word
+ Word order.

+

+sort=letter
+ Letter order.

+

+sort=standard
+ Word or letter order according to the order package option.

+The word and letter order sort methods use datatool’s \dtlwordindexcompare and \dtlletterindexcompare handlers. The case-insensitive sort method uses datatool’s \dtlicompare handler. The case-sensitive sort method uses datatool’s \dtlcompare handler. See the datatool documentation for further details.

+label This key is only available with glossaries-extra and labels the glossary with \label{label}. This is an alternative to the package option numberedsection=autolabel. This option isn’t available with \printunsrtinnerglossary.

+target This key is only available with glossaries-extra and can be used to switch off the automatic hypertarget for each entry. (This refers to the target used by commands like \gls and \glslink.)

+This option is useful with \printunsrtglossary as it allows the same list (or sub-list) of entries to be displayed multiple times without causing duplicate hypertarget names.

+prefix This key is only available with 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 \glolinkprefix but note this will also affect the target for any entry referenced within the glossary with commands like \gls, \glslink or \glshyperlink.

+targetnameprefix This key is only available with glossaries-extra. This is similar to the prefix option, but it alters the prefix of the hypertarget anchors without changing \glolinkprefix (so it won’t change the hyperlinks for any entries referenced in the glossary).

+groups This key is only available with \printunsrtglossary and \printunsrtinnerglossary. If true, the “unsrt” function that creates the code for typesetting the glossary will insert letter group headers whenever a change is detected in the letter group label between entries of the same hierarchical level. See the glossaries-extra manual for further details.

+leveloffset This key is only available with \printunsrtglossary and \printunsrtinnerglossary. It can be used to locally adjust the hierarchical level used by the glossary style. See the glossaries-extra manual for further details and also Gallery: Inner or Nested Glossaries.

+flatten This key is only available with \printunsrtglossary and \printunsrtinnerglossary. It can be used to locally remove the hierarchical level used by the glossary style. See the glossaries-extra manual for further details.

+ +

+ +
+

8.2. Glossary Markup

+

+This section describes the commands that are used to display the glossary. If you want to suppress the number lists you can use the nonumberlist option. If you want to save the number lists for some other purpose outside of the glossary, you can use the savenumberlist option. If you want information about an entry’s parent then you can use \ifglshasparent (to determine if the entry has a parent) or \glsentryparent (to expand to the parent’s label). The hierarchical level is provided in \subglossentry (and is 0 with \glossentry) but it’s also stored in the level internal field.

+If you’re trying to work out how to parse the glossary in order to gather indexing information, consider using bib2gls instead, which stores all the indexing information, such as location lists and letter group labels, in internal fields. It can also store lists of sibling entries or child entries. If you really want to input the glossary file in order to gather information obtained by makeindex or xindy without actually displaying anything (by redefining the markup commands to not produce any text), use \input rather than \printglossary.

+The glossary is always started with:

\glossarysection[\glossarytoctitle]{\glossarytitle}
+
This creates the heading. This command sets the page header with:
\glsglossarymark{\glossarytoctitle}
+
If this is unsuitable for your chosen class file or page style package, you will need to redefine \glsglossarymark. If \phantomsection is defined (hyperref) then \glossarysection will start with:
\glsclearpage
+\phantomsection
+

+

+\glossarysection[toc title]{title}
+ By default, this command uses either \chapter* or \section*, depending on whether or not \chapter is defined. This can be overridden by the section package option or the \setglossarysection command. Numbered sectional units can be obtained using the numberedsection package option. If the default unnumbered section setting is on, then the toc-title will only be added to the table of contents if the toc option is set. If numberedsection is on, the addition to the table of contents is left to the sectional command.

+

+Further information about these options and commands is given in §2.2.
+

+

+\glsglossarymarkglossary title
+ This sets the page header, if supported by the current page style. Originally the command \glossarymark was provided for this purpose, but this command is also provided by other packages and classes, notably memoir which has a different syntax. Therefore the command \glossarymark will only be defined if it doesn’t already exist. In which case, \glsglossarymark will simply use \glossarymark.

+If memoir has been loaded, \glsglossarymark will be defined to use \markboth otherwise, if some other class or package has defined \glossarymark, \glsglossarymark will be defined to use \@mkboth (using the same definition as the glossaries package’s version of \glossarymark).

+If ucmark=true, the case change will be applied using \memUChead if memoir has been loaded, otherwise it will use \glsuppercase.

+So if you want to redefine the way the header mark is set for the glossaries, you need to redefine \glsglossarymark not \glossarymark. For example, to only change the right header:

\renewcommand{\glsglossarymark}[1]{\markright{#1}}
+
or to prevent it from changing the headers:
\renewcommand{\glsglossarymark}[1]{}
+
If you want \glsglossarymark to use all caps in the header, use the ucmark option described below.

+With hyperref and unnumbered section headings, \phantomsection is need to create an appropriate anchor (see the hyperref manual). This will need the page cleared for \chapter*, which is done with:

+\glsclearpage
+ If the section=chapter setting is on then \glsclearpage will use \cleardoublepage, if it’s defined and if the \if@openright conditional (provided by classes with an openright option such as book and report) isn’t defined or is defined and is true, otherwise \clearpage is used.

+Occasionally you may find that another package defines \cleardoublepage when it is not required. This may cause an unwanted blank page to appear before each glossary If you only want a single page cleared, you can redefine \glsclearpage. For example:

\renewcommand*{\glsclearpage}{\clearpage}
+
Note that this will no longer take the section package option into account.

+

+\glossarytitle
+ This expands to the title that should be used by the glossary section header. It’s initialised to the title provided in \newglossary when the glossary was defined. The title option will redefined this command.

+

+\glossarytoctitle
+ This expands to the table of contents title that’s supplied in the optional argument of the glossary section command. It will only be added to the table of contents is the toc package option is on, but it may also be used in the page header (depending on the definition of \glsglossarymark and the current page style).

+The \glossarytoctitle command is initialised to \glossarytitle. The toctitle option will redefine this command. If neither the title nor toctitle are used, \glossarytoctitle will be defined via:

+\glssettoctitle{glossary-type}
+ By default, this will redefine \glossarytoctitle to the title provided in \newglossary when the glossary was defined.

+This means that if neither title nor toctitle are set, the glossary’s associated title will be used for both. If only title is used, then it will also apply to the table of contents title, and if only toctitle is used, then \glossarytoctitle will be defined to that value but \glossarytitle will be the glossary’s associated title.

+After the heading, but before the main body of the glossary, is the glossary preamble which is given by:

+\glossarypreamble
+ You can redefine this before the glossary is shown. For example:
\renewcommand{\glossarypreamble}{Numbers in italic 
+indicate primary definitions.}
+
A glossary may have its own specific preamble. If it has one defined, then the \printglossary set of commands will locally redefine \glossarypreamble to that preamble instead. Since this change is scoped, the previous definition will be restored after the \printglossary command.

+You can globally assign a preamble to a specific glossary with:

+\setglossarypreamble[type]{text}
+ If type is omitted, \glsdefaulttype is used. For example:
\setglossarypreamble{Numbers in italic 
+indicate primary definitions.}
+
This will set the given preamble text for just the main glossary, not for any other glossary. The glossaries-extra package additionally provides:
+\apptoglossarypreamble[type]{text}
+ which locally appends text to the preamble for the specific glossary and
+\pretoglossarypreamble[type]{text}
+ which locally prepends text to the preamble for the specific glossary.

+There is also a postamble at the end of each glossary which is given by:

+\glossarypostamble
+ This is less useful than a preamble and so there’s no analogous command to \setglossarypreamble.

+

+The preamble and postamble occur outside of theglossary and so shouldn’t be influenced by the glossary style.
+

+

Example 31: Switch to Two Column Mode for Glossary
Suppose you are using the superheaderborder style, and you want the glossary to be in two columns (you can’t use the longheaderborder style for this example as you can’t use the longtable environment in two column mode), but after the glossary you want to switch back to one column mode, you could do:
\renewcommand*{\glossarysection}[2][]{% 
+  \twocolumn[{\chapter*{#2}}]% 
+  \setlength\glsdescwidth{0.6\linewidth}% 
+  \glsglossarymark{\glossarytoctitle}% 
+}
+
+\renewcommand*{\glossarypostamble}{\onecolumn}
+
(You may prefer to use the mcolalttree style if you’re not interested in the column headers or borders.)

+The actual glossary content is contained within the theglossary environment, which will typically be in the form:

\begin{theglossary}\glossaryheader
+\glsgroupheading{group-label}\relax\glsresetentrylist
+\glossentry{entry-label}{number-list}
+\subglossentry{level}{entry-label}{number-list}
+% …
+\glsgroupskip
+\glsgroupheading{group-label}\relax\glsresetentrylist
+\glossentry{entry-label}{number-list}
+\subglossentry{level}{entry-label}{number-list}
+% …
+\end{theglossary}
+

+The entire number list for each entry is encapsulated with:

+\glossaryentrynumbers{locations}
+ This command allows \glsnonextpages, \glsnextpages, and the nonumberlist and savenumberlist options to work. The \glossaryentrynumbers command is reset by:
+\glsresetentrylist
+

+With Option 1, this command is preceded by:

+\glsnoidxprenumberlist{entry-label}
+ The default behaviour is to use the value of the prenumberlist internal field. This command is not used with Options 2 and 3.

+If you want to suppress the number list for a particular entry, you can add the following to the entry’s description:

+\glsnonextpages
+ Within the glossary, this will redefine \glossaryentrynumbers to ignore its argument and then reset itself. This means that the next number list will be suppressed. Note that if the entry doesn’t have a number list (for example, it’s a parent entry that only appears in the glossary because it has an indexed descendent entry) then the next number list will be for the first child entry that’s been indexed. This command does nothing outside of the glossary.

+Similarly, if you want to override the nonumberlist option to ensure that the next number list is shown, then use:

+\glsnextpages
+ This command does nothing outside of the glossary.

+

+The nonumberlist key that may be used when defining an entry, works by automatically adding \glsnonextpages or \glsnextpages to the indexing information before \glossentry or \subglossentry with Options 2 and 3. With Option 1, the relevant command is put in the prenumberlist internal field, but since \printnoidxglossary only uses \glsnoidxprenumberlist and \glossaryentrynumbers when the loclist field is set, it won’t affect sub-entries.
+

+The theglossary environment, and the other commands (\glossaryheader, \glsgroupskip, \glsgroupheading, \glossentry and \subglossentry) are all redefined by glossary styles and are described in §13.2.

+ +

+ +
+

9. Defining New Glossaries

+

+A new glossary can be defined using:

+\newglossary[log-ext]{glossary-label}{in-ext}{out-ext}{title}[counter]
+ where glossary-label is the label to assign to this glossary. This label is used to reference the glossary in the value of the type key when defining entries or, the similarly named, type option in the \printglossary commands.

+

+As with labels in general, glossary-label must not contain any active characters.
+

+The arguments in-ext and out-ext specify the extensions of the input and output (from TeX’s point of view) files for that glossary, title is the default title for this new glossary, and the final optional argument counter specifies which location counter to use for the associated number lists (see also §12). If not specified, the default location counter will be the one identified in the counter option, if that option is used, otherwise it will be the page counter.

+The first optional argument log-ext specifies the extension for the indexing application’s transcript file (this information is used by makeglossaries which picks up the information from the aux file and also by the automake option). If omitted, glg is used.

+The file extensions only apply to Options 2 and 3. For the other options, the indexing information is written to the aux file for Options 1 and 4. No input file is required for Option 1 and Option 4 always has the glstex file extension. Since the file extensions are only relevant for Options 2 and 3, there is a starred version that omits those arguments:

+\newglossary*{glossary-label}{title}[counter]
+ This is equivalent to
\newglossary[glossary-label-glg]{glossary-label}{glossary-label-gls}{glossary-label-glo}{title}[counter]
+
or you can use:
+\altnewglossary{glossary-label}{tag}{title}[counter]
+ which is equivalent to
\newglossary[tag-glg]{glossary-label}{tag-gls}{tag-glo}{title}[counter]
+
Note that in both cases distinct file extensions are defined so these commands are still useful with Options 2 and 3.

+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 glossary that doesn’t create any associated files. This is referred to as an ignored glossary and it’s ignored by commands that iterate over all the glossaries, such as \printglossaries. To define an ignored glossary, use \newignoredglossary where glossary-label is the glossary label (as above). This glossary type will automatically be added to the nohypertypes list, since there are no hypertargets for the entries in an ignored glossary. (The sample file sample-entryfmt.tex defines an ignored glossary.)

+An ignored glossary can’t be displayed with \printnoidxglossary or \printglossary but can be displayed with \printunsrtglossary and \printunsrtinnerglossary.

+

+ The glossaries-extra package provides a starred version \newignoredglossary* that doesn’t suppress hyperlinks (since ignored glossaries can be useful with bib2gls). There is also an analogous \provideignoredglossary command.
+

+You can test if a glossary is an ignored one using:

+\ifignoredglossary{glossary-label}{true}{false}modifier: *
+ This does true if glossary-label was defined as an ignored glossary, otherwise it does false.

+Note that the main (default) glossary is automatically created as:

\newglossary{main}{gls}{glo}{\glossaryname}
+
so it can be identified by the label main (unless the nomain package option is used). If the doc package has been loaded (which uses the gls and glo extensions for the change log) then the main glossary will instead be defined as:
\newglossary[glg2]{main}{gls2}{glo2}{\glossaryname}
+
If you are using a class or package that similarly requires gls and glo as file extensions, you will need to use the nomain option and define your own custom glossary, but be aware of other possible conflicts, such as different definitions of commands and environments like \printglossary or theglossary.

+The acronym (or acronyms) package option is equivalent to:

\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
+
so it can be identified by the label acronym. If you are not sure whether the acronym option has been used, you can identify the list of acronyms by the command:
+\acronymtypeinitial: \glsdefaulttype
+ The default definition is simply \glsdefaulttype. The acronym or acronyms option will redefine \acronymtype to acronym. If you want additional glossaries for use with acronyms, remember to declare them with acronymlists.

+The symbols package option creates a new glossary with the label symbols using:

\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}
+
The numbers package option creates a new glossary with the label numbers using:
\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}
+
The index package option creates a new glossary with the label index using:
\newglossary[ilg]{index}{ind}{idx}{\indexname}
+

+

+With Options 2 and 3 all glossaries must be defined before \makeglossaries to ensure that the relevant output files are opened.

+See §1.5.1 if you want to redefine \glossaryname, especially if you are using a language package. (Similarly for \glssymbolsgroupname and \glsnumbersgroupname.) If you want to redefine \indexname, just follow the advice in How to change LaTeX’s “fixed names”.

+

+ +

+ +
+

10. Adding an Entry to the Glossary Without Generating Text

+

+It is possible to \indexindexing an entry without

+\glsadd[options]{entry-label}
+ This is similar to the \glstext-like commands, only it doesn’t produce any text. Therefore, there is no hyper key available in options but all the other base options that can be used with the \glstext-like commands can be passed to \glsadd. The glossaries-extra package provides addition options, such as textformat, that aren’t applicable when there’s no link text, so they are also not available. This ensures that the given entry is listed in the glossary and that the current location is included in the entry’s number list.

+This command is particularly useful to create an explicit range that covers an entire section or block of text that might otherwise end up with a long, ragged number list. For example, suppose I have defined an entry with the label “set”:

\newglossaryentry{set}{name={set},
+ description={a collection}}
+
Suppose I have a section about sets spanning from page 3 to page 8 with repeated use of \gls{set} on pages 3, 5, 7 and 8. This will result in the number list “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 number list was simply “3–8”.

+This can be done with an explicit range:

\glsadd[format=(]{set}
+Lots of text about sets spanning page 3 to page 8.
+\glsadd[format=)]{set}
+
See §12.1 for more information about the location encap.

+To add all entries that have been defined, use:

+\glsaddall[options]
+ The optional argument is the same as for \glsadd, except there is also a key types which can be used to specify which glossaries to use. This should be a comma-separated list. For example, if you only want to add all the entries belonging to the list of acronyms (specified by the glossary type \acronymtype) and a list of notation (specified by the glossary type notation) then you can do:
\glsaddall[types={\acronymtype,notation}]
+

+

+ If you are using bib2gls with glossaries-extra, you can’t use \glsaddall. Instead use the selection=all resource option to select all entries in the given bib files.
+

+

+Note that \glsadd and \glsaddall add the current location to the number list. In the case of \glsaddall, all entries in the listed glossaries will have the same location in the number list (the location at the point in the document where \glsaddall was used, which will be page 1 if it occurs in the preamble). If you want to use \glsaddall, it’s best to suppress the number list with the nonumberlist package option. (See sections 2.3 and 12.)
+

+If you want to ensure that all entry are added to the glossary, but only want the locations of entries that have actually been used in the document, then you can use:

+\glsaddallunused[glossary types]
+ Note that in this case, the optional argument is simply a list of glossary labels. The options available to \glsadd and \glsaddall aren’t available here. If the optional argument is omitted, the list of all non-ignored glossaries is assumed.

+This command implements:

\glsadd[format=glsignore]{entry-label}
+
for each entry in each glossary listed in the optional argument if the entry has been marked as used. Since \glsignore discards its argument, this effectively creates an invisible location. This is necessary because makeindex and xindy require an associated location for each line in the indexing file. (They are indexing applications not glossary applications, so they expect page numbers.)

+This means that \glsaddallunused adds \glsignore{location} to the number list of all the unused entries. If any of those number lists have other locations (for example, the first use flags was reset before \glsaddallunused or only the \glstext-like commands were used or if any indexing occurs after \glsaddallunused) then this will cause spurious commas or en-dashes in the number list that have been placed before or after the invisible location.

+

+If you want to use \glsaddallunused, it’s best to place the command at the end of the document to ensure that all the commands you intend to use have already been used and make sure to use the \gls-like commands and don’t issue any resets (\glsreset etc).
+

+

+ Since bib2gls was designed specifically for glossaries-extra, it recognises glsignore as a special format that indicates the location shouldn’t be added to the location list but the entry should be selected.

+Alternatively, the selection=all resource option can be used, which will ensure all entries are selected but only those indexed with one or more non-ignored locations will have a location list.

+

+Base glossaries package only:

\documentclass{article}
+\usepackage{glossaries}
+\makeglossaries
+\newglossaryentry{cat}{name={cat},description={feline}}
+\newglossaryentry{dog}{name={dog},description={canine}}
+\begin{document}
+\gls{cat}.
+\printglossaries
+\glsaddallunused % <- make sure dog is also listed
+\end{document}
+
Corresponding glossaries-extra and bib2gls document code:
\documentclass{article}
+\usepackage[record]{glossaries-extra}
+\GlsXtrLoadResources[src=entries,selection=all]
+\begin{document}
+\gls{cat}.
+\printunsrtglossaries
+\end{document}
+
With the file entries.bib:
@entry{cat,name={cat},description={feline}}
+@entry{dog,name={dog},description={canine}}
+

+

Example 32: Dual Entries
The example file sample-dual.tex makes use of \glsadd to allow for an entry that should appear both in the main glossary and in the list of acronyms. This example sets up the list of acronyms using the acronym package option:
\usepackage[acronym]{glossaries}
+
A new command (\newdualentry) is then defined to make it easier to define dual entries:
\newcommand*{\newdualentry}[5][]{% 
+  \newglossaryentry{main-#2}{name={#4},% 
+  text={#3\glsadd{#2}},% 
+  description={#5},% 
+  #1
+  }% 
+  \newacronym{#2}{#3\glsadd{main-#2}}{#4}% 
+}
+
This has the following syntax:
\newdualentry[options]{label}{abbrv}{long}{description}
+
You can then define a new dual entry:
\newdualentry{svm}% label
+  {SVM}% abbreviation
+  {support vector machine}% long form
+  {Statistical pattern recognition technique}% description
+
Now you can reference the acronym with \gls{svm} or you can reference the entry in the main glossary with \gls{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 lookup.

+

+ Note that with 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 \glsadd with bib2gls. (Although it can still be useful, for example with Option 6.)
+

+ +

+ +
+

11. Cross-Referencing Entries

+

+

+You must use \makeglossaries (Options 2 or 3) or \makenoidxglossaries (Option 1) before defining any entries that cross-reference other entries. If any of the entries that you have cross-referenced don’t appear in the glossary, check that you have put \makeglossaries/\makenoidxglossaries before all entry definitions. The glossaries-extra package provides better cross-reference handling.
+

+There are several ways of cross-referencing entry in the glossaries:

+ +

    +
  1. 1. You can use commands such as \gls in the entries description. For example:
    \newglossaryentry{apple}{name={apple},
    +description={firm, round fruit. See also \gls{pear}}}
    +
    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 makeglossaries:
    pdflatex filename
    +makeglossaries filename
    +pdflatex filename
    +makeglossaries filename
    +pdflatex filename
    +
    This is because the \gls in the description won’t be detected until the glossary has been created (unless the description is used elsewhere in the document with \glsentrydesc). Take care not to use \glsdesc (or \Glsdesc) in this case as it will cause a nested link.

    +

  2. 2. After you have defined the entry, use
    +\glssee[tag]{entry-label}{xr-list}
    + where xr-list is a comma-separated list of entry labels to be cross-referenced, entry-label is the label of the entry doing the cross-referencing and tag is the “see” tag. (The default value of tag is \seename.)

    +This command is essentially performing:

    \glsadd[format=cross-ref-encap]{entry-label}
    +
    where cross-ref-encap is a special form of location encap that includes tag and xr-list. Remember from §10 that makeindex always requires a location. This special location encap discards the provided location (which \glssee sets to “Z” to push the cross-reference to the end of the number list) and replaces it with the cross-reference in the form see name(s).

    +This means that \glssee indexes entry-label so that entry-label appears in the glossary but it doesn’t index any of the entries listed in xr-list.

    +For example:

    \glssee[see also]{series}{FourierSeries,TaylorsTheorem}
    +
    This indexes the entry identified by the label “series” and adds a location to the “series” number list that looks something like:
    see also \glsentryname{FourierSeries} \&
    +\glsentryname{TaylorsTheorem}
    +
    (The actual format is performed with \glsseeformat.)

    +

  3. 3. As described in §4, you can use the see key when you define the entry. For example:
    \newglossaryentry{MaclaurinSeries}{name={Maclaurin series},
    +description={Series expansion},
    +see={TaylorsTheorem}}
    +
    This key was provided as a simple shortcut that does:
    \newglossaryentry{MaclaurinSeries}{name={Maclaurin series},
    +description={Series expansion}}
    +\glssee{MaclaurinSeries}{TaylorsTheorem}
    +
    This means that “MaclaurinSeries” will automatically be added to the glossary with something like
    \emph{see} \glsentryname{TaylorsTheorem}
    +
    in its number list, but “TaylorsTheorem” will need to be indexed elsewhere to ensure that it also appears in the glossary otherwise, it would end up with the preamble location (page 1) in its number list, assuming that the entry was defined in the preamble.

    +You therefore need to ensure that you use the cross-referenced term with the commands described in §5.1 or §10.

    +The “see” tag is produce using \seename, but can be overridden in specific instances using square brackets at the start of the see value. For example:

    \newglossaryentry{MaclaurinSeries}{name={Maclaurin series},
    +description={Series expansion},
    +see=[see also]{TaylorsTheorem}}
    +
    Take care if you want to use the optional argument of commands such as \newacronym or \newterm as the value will need to be grouped. For example:
    \newterm{seal}
    +\newterm[see={[see also]seal}]{sea lion}
    +
    Similarly if the value contains a list. For example:
    \glossaryentry{lemon}
    +{
    +  name={lemon},
    +  description={Yellow citrus fruit}
    +}
    +\glossaryentry{lime}
    +{
    +  name={lime},
    +  description={Green citrus fruit}
    +}
    +\glossaryentry{citrus}
    +{
    +  name={citrus},
    +  description={Plant in the Rutaceae family},
    +  see={lemon,lime}
    +}
    +
    +
+

+In both cases 2 and 3 above, the cross-referenced information appears in the number list, whereas in case 1, the cross-referenced information appears in the description. (See the sample-crossref.tex example file that comes with this package.) This means that in cases 2 and 3, the cross-referencing information won’t appear if you have suppressed the number list. In this case, you will need to activate the number list for the given entries using nonumberlistfalse. Alternatively, if you just use the see key instead of \glssee, you can automatically activate the number list using the seeautonumberlist package option.

+

+ bib2gls provides much better support for cross-references, including the ability to only show the cross-reference in the location list (save-locations={see}) without the actual locations. See, for example, index.php?label=bib2gls-xrGallery: Cross-References (bib2gls).
+

+ +

+ +
+

11.1. Customising Cross-Reference Text

+

+When you use either the see key or the \glssee command, the cross-referencing information will be typeset in the glossary (within the number list) according to:

+\glsseeformat[tag]{xr-list}{location}
+ The default definition:
\emph{tag} \glsseelist{xr-list}
+
Note that the location argument is always ignored. (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:
\renewcommand*{\glsseeformat}[3][\seename]{\textbf{#1} 
+ \glsseelist{#2}}
+

+The list of labels is formatted by:

+\glsseelist{label-list}
+ This iterates through the comma-separated list of entry labels label-list and formats each entry in the list. The entries are separated by:
+\glsseesepinitial: ,
+ between all but the last pair, and
+\glsseelastsepinitial: ,
+ between the last pair.

+Each entry item in the list is formatted with:

+\glsseeitem{entry-label}
+ This does:
\glshyperlink[\glsseeitemformat{#1}]{#1}
+
which creates a hyperlink, if enabled, to the cross-referenced entry. The hyperlink text is given by:
+\glsseeitemformat{entry-label}
+ This does:
\ifglshasshort{entry-label}
+ {\glsentrytext{entry-label}}% acronym
+ {\glsentryname{entry-label}}% non-acronym
+
which uses the text field for acronyms and the name field otherwise.

+

+When \glssee was first introduced in v1.17, the cross-referenced entry was displayed with just \glsentryname, but this caused problems because back then the name field had to be sanitized because it was written to the glossary file, which caused strange results if the name contained any commands. So in v3.0, the default definition was switched to using \glsentrytext to avoid the issue. In v3.08a, the information written to the glossary file was changed and the 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 glossary, except for acronyms 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 textcase package, the original use of name was restored for non-acronyms, which brings it into line with glossaries-extra.

+

+For example, to make the cross-referenced list use small caps with the text (not name) field:

\renewcommand{\glsseeitemformat}[1]{% 
+  \textsc{\glsentrytext{#1}}}
+

+

+ The glossaries-extra package redefines \glsseeitemformat to use \glsfmttext for abbreviations and \glsfmtname otherwise. Additionally, it provides \glsxtrhiername which can be used as an alternative for hierarchical entries. See the glossaries-extra manual for further details.
+

+

+You can use \glsseeformat and \glsseelist in the main body of the text, but they won’t automatically add the cross-referenced entries to the glossary. If you want them added with that location, you can do:
Some information (see also 
+\glsseelist{FourierSeries,TaylorsTheorem}% 
+\glsadd{FourierSeries}\glsadd{TaylorsTheorem}).
+
+

+ +

+ +
+

12. Number Lists

+

+Each entry in the glossary has an associated number list (or location list). By default, these numbers (the entry locations) refer to the pages on which that entry has been indexed (using any of the commands described in §5.1 and §10) and will also include any cross-references obtained with \glssee (or the see key).

+The locations in the number list are separated with:

+\delimN
+

+The number list can be suppressed using the nonumberlist package option, or an alternative counter can be set as the default using the counter package option. The glossaries-extra package additionally provides the equations and floats options that can be used to automatically switch the location counter in certain environments.

+

+ With bib2gls you can prevent the number list from being created with the save-locations=false resource option, or only include the cross-references with the save-locations=see option.
+

+Number lists are more common with indexes rather than glossaries (although you can use the glossaries package for indexes as well). However, Options 2 and 3 makes use of makeindex or xindy to hierarchically sort and collate the entries. These applications are readily available with most modern TeX distributions, but because they are both designed as indexing applications they both require that terms either have a valid location or a cross-reference.

+

+Even if you use nonumberlist, the locations must still be provided and acceptable to the indexing application or they will cause an error during the indexing stage, which will interrupt the document build. Empty locations are not permitted with Options 2 and 3. See §12.5.
+

+If you’re not interested in the locations, each entry only needs to be indexed once, so consider using indexonlyfirst, which can improve the document build time by only indexing the first use of each term.

+The \glsaddall command (see §10), which is used to automatically index all entries, iterates over all defined entries (in non-ignored glossaries) and does \glsadd{entry-label} for each entry (where entry-label is that entry’s label). This means that \glsaddall automatically adds the same location to every entry’s number list, which looks weird if the number list hasn’t been suppressed.

+With Option 4, the indexing is performed by bib2gls, which was specifically designed for the glossaries-extra package. So it will allow empty or unusual locations. (As from bib2gls v3.0, empty locations will be converted to ignored locations.) Additionally, the selection=all resource option option will select all entries without adding an unwanted location to the number list. If bib2gls can deduce a numerical value for a location, it will attempt to form a range over consecutive locations, otherwise it won’t try to form a range and the location will just form an individual item in the list.

+Option 1 also allows any location but it doesn’t form ranges. Any empty locations or location with the glsignore format will result in an invisible location in the number list.

+ +

+ +
+

12.1. Encap Values (Location Formats)

+

+The location encap or format is the encapsulating command used to format an entry location. That is, it’s a command that takes an argument that will be the location.

+

+If you aren’t using hyperref then you can use the control sequence name of any text-block command that takes a single argument. For example, format=emph. If you require hyperlinks then it’s more complicated.
+

+The encap usually refers to the control sequence name without the leading backslash (such as textbf) and is essentially the same as the makeindex encap value that can be provided within the standard \index command.

+

+Be careful not to use a declaration (such as \bfseries) instead of a text-block command (such as \textbf) as the effect is not guaranteed to be localised, either within the number list or throughout the glossary.
+

+There is a special format:

+\glsignore{text}
+ which simply ignores its argument. With Options 1, 2 and 3 this creates an empty (invisible) location which can lead to spurious commas or en-dashes if the number list contains other locations. However, with bib2gls, this format identifies the location as a special ignored location which won’t be added to the location list but will influence selection.

+If you want to apply more than one style to a given location (for example, bold and italic) you will need to create a command that applies both formats. For example:

\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}}
+
and use that command.

+In this document, standard location formatrefer to the standard text block commands such as \textbf or \emph or any of the commands listed in Table 12.1.

+

+If you use xindy instead of makeindex, you must use \GlsAddXdyAttribute to identify any non-standard formats that you want to use with the format key. So if you use xindy with the above example \textbfem, you would need to add:
\GlsAddXdyAttribute{textbfem}
+
See §14 for further details.
+

+If you are using hyperlinks and you want to change the font of the hyperlinked location  don’t use \hyperpage (provided by the hyperref package) as the locations may not refer to a page number and the location argument may contain the range delimiter \delimR. Instead, the glossaries package provides hyperlink-supported encaps listed in Table 12.1. These commands all use \glshypernumber (described below) and so shouldn’t be used in other contexts.

+The \hyperxx can also be used without hyperref, since \glshypernumber will simply do its argument if \hyperlink hasn’t been defined. In which case, only the font change will be applied.

+

+ + + + + + + + + + + + + + + + + + + + +
Table 7: Predefined Hyperlinked Location Formats
hyperrm serif (\textrm) hyperlink
hypersf sans-serif (\textsf) hyperlink
hypertt monospaced (\texttt) hyperlink
hyperbf bold (\textbf) hyperlink
hypermd medium weight (\textmd) hyperlink
hyperit italic (\textit) hyperlink
hypersl slanted (\textsl) hyperlink
hyperup upright (\textup) hyperlink
hypersc small caps (\textsc) hyperlink
hyperemph emphasized (\emph) hyperlink
+

+

+If you want to make a new location format that supports hyperlinks, you will need to define a command which takes one argument and use that with the location encapsulated with \glshypernumber or the appropriate \hyperxx command. For example, if you want the location number to be in a bold sans-serif font, you can define a command called, say, \hyperbsf:

\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
+
and then use hyperbsf as the value for the format key.

+

+When defining a custom location format command that uses one of the \hyperxx commands, make sure that the argument of \hyperxx is just the location. Any formatting must be outside of \hyperxx (as in the above \hyperbfsf example).
+

+Remember that if you use xindy, you will need to add this to the list of location xindy attributes:

\GlsAddXdyAttribute{hyperbsf}
+

+Complications can arise if you use different encap values for the same location. For example, suppose on page 10 you have both the default glsnumberformat and hyperbf encaps. While it may seem apparent that hyperbf should override glsnumberformat in this situation, the indexing application may not know it. This is therefore something you need to be careful about if you use the format key or if you use a command that implicitly sets it.

+In the case of xindy, it only accepts one encap (according to the order of precedence given in the xindy module) and discards the others for identical locations (for the same entry). This can cause a problem if a discarded location forms the start or end of a range.

+In the case of makeindex, it accepts different encaps for the same location, but warns about it (multiple encaps). This leads to a number list with the same location repeated in different formats. If you use the makeglossaries Perl script with Option 2 it will detect makeindex’s warning and attempt to fix the problem, ensuring that the glsnumberformat encap always has the least precedence unless it includes a range identifier. Other conflicting encaps will have the last one override earlier ones for the same location with range identifiers taking priority. If you actually want the repeat, you can disable this feature with the -e switch.

+No discard occurs with Option 1 so again you get the same location repeated in different formats. With Option 4, bib2gls will discard according to order of precedence, giving priority to start and end ranges. (See the bib2gls manual for further details.)

+The default location format is:

+\glsnumberformat{location(s)}
+ This will simply do its argument location(s) if hyperref hasn’t been loaded, otherwise it will use:
+\glshypernumber{location(s)}
+ This will create a hyperlink to the location or will simply do its argument if hyperref hasn’t been loaded. The location(s) argument may contain multiple locations. If so, they must be separated with \delimR or \delimN. (Usually \delimN won’t occur. The \delimR separator may occur with ranges and makeindex.) Any other markup is likely to cause a problem (see §12.5).

+Each location within \glshypernumber will have a hyperlink created with:

\hyperlink{anchor}{text}
+
where the text is the location encapsulated with:
+\glswrglosslocationtextfmt{location}
+ This just does its argument by default.

+The anchor is constructed from the location but requires the prefix and location counter, which first have to be set with:

+\setentrycounter[prefix]{counter}
+ This command will be automatically inserted before the location in the number list by the appropriate indexing method. In the case of makeindex, this will be inserted at the start of the encap information, but with xindy the counter will form part of the attribute and a helper command has to be provided that uses \setentrycounter. With Option 1 the command occurs inside the definition of \glsnoidxdisplayloc.

+The counter will be stored in:

+\glsentrycounterinitial: \glscounter
+ and may be used in the hooks described below. Note that the prefix can’t be referenced as \glswrglossdisableanchorcmds is also used when obtaining the prefix during indexing.

+The anchor is then constructed as follows: +

    +
  1. 1.Use the \glswrglossdisableanchorcmds hook to disable problematic commands (scoped).
  2. 2.Expand (protected)
    counterprefix\glswrglosslocationtarget{location}
    +
  3. 3.Sanitize the result. +
+ For example:
\setentrycounter[]{page}% page counter and empty prefix
+\glshypernumber{1}
+
will essentially do:
\hyperlink{page.1}1
+
whereas
\setentrycounter[1]{equation}% 
+\glshypernumber{2}
+
will essentially do:
\hyperlink{equation.1.2}2
+

+The initial hook to disable the problematic commands is:

+\glswrglossdisableanchorcmds
+ By default, this is defined to:
\let\glstexorpdfstring\@secondoftwo
+
If hyperref is loaded the definition will also include:
\let\texorpdfstring\@secondoftwo
+\pdfstringdefPreHook
+
The location is encapsulated with:
+\glswrglosslocationtarget{location}
+ This must expand but may be used to make adjustments. The default definition is to simply expand to its argument. The \glswrglossdisableanchorcmds hook may be used to alter the definition if some condition is required, but bear in mind that \glswrglosslocationtarget won’t be used when the prefix is obtained during 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 §12.5 for an example.

+The use of \setentrycounter to set the prefix and counter is necessary because the hypertarget can’t be included in the indexing information supplied to makeindex or xindy, because neither the makeindex nor xindy syntax supports it. Unfortunately, not all definitions of \theHcounter can be split into a prefix and location that can be recombined in this way. This problem can occur, for example, with counter=equation when it depends on the chapter counter. This can result in warnings in the form:

name{target-name} has been referenced but does not exist, replaced by a fixed one
+
The sampleEq.tex sample file deals with this issue by redefining \theHequation as follows:
\renewcommand*\theHequation{\theHchapter.\arabic{equation}}
+

+

+ This issue is avoided with bib2gls and record=nameref as that syntax allows the hyperlink target to be supplied with the indexing information.
+

+ +

+ +
+

12.2. Range Formations

+

+There are two types of ranges: explicit and implicit. Neither are supported with Option 1. Both are supported by Options 2, 3 and 4. Implicit ranges can be switched off using the appropriate option for the required indexing application. The start and end of a range is separated with:

+\delimR
+ Options 2 and 3 can merge implicit and explicit ranges that overlap. With Option 4, 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 \index, the characters ( and ) can be used at the start of the format value to specify the beginning and ending of a number range. They must be in matching pairs with the same encap. For example,

\gls[format=(emph]{sample}
+
on one page to start the range and later:
\gls[format=)emph]{sample}
+
to close the range. This will create an explicit range in the number list that’s encapsulated with \emph. If the default glsnumberformat should be used, you can omit it and just have the ( and ) characters.

+Implicit ranges are formed by concatenating a sequence of three or more consecutive locations. For example, if an entry is indexed on pages 3, 4, 5, and 6, this will be compacted into “3–6”.

+With Option 3, you can vary the minimum sequence length using \GlsSetXdyMinRangeLength where the argument is either the minimum number or the keyword none, which indicates that no implicit ranges should be formed. See §14.3 for further details.

+

+ With Option 4, the minimum number for form implicit ranges is given by the min-loc-range resource option. Again, the value is either the minimum number or the keyword none, which indicates that no implicit ranges should be formed. It’s also possible to compact a ragged sequence into a range with max-loc-diff. For example, with max-loc-diff=2, the sequence “2, 4, 5, 6, 8” can be compressed into the range “2–8”. Another range-related option is compact-ranges which allows ranges to be more compact by omitting matching initial digits at the end of the range. For example, “184–189” can be compacted into “184–9”.
+

+With both makeindex and xindy (Options 2 and 3), you can replace the separator and the closing number at the end of the range using:

+\glsSetSuffixF{suffix}
+ to set the suffix for two consecutive locations and
+\glsSetSuffixFF{suffix}
+ to set the suffix for three or more consecutive locations. Option 4 provides a similar feature with the suffixF and suffixFF resource options.

+For example:

\glsSetSuffixF{f.}
+\glsSetSuffixFF{ff.}
+
Note that if you use xindy (Option 3), you will also need to set the minimum range length to 1 if you want to change these suffixes:
\GlsSetXdyMinRangeLength{1}
+
If you use the hyperref package, you will need to use \nohyperpage in the suffix to ensure that the hyperlinks work correctly. For example:
\glsSetSuffixF{\nohyperpage{f.}}
+\glsSetSuffixFF{\nohyperpage{ff.}}
+

+

+Note that \glsSetSuffixF and \glsSetSuffixFF must be used before \makeglossaries and have no effect if \noist is used.
+

+ +

+ +
+

12.3. Locations

+

+Each location in an entry’s number list is the result of indexing the entry at the point in the document that corresponds to the location (typically where a command such as \gls occurred). By default, this is the page number, but can be changed with the counter package option, the counter optional argument in \newglossary, the counter key in \newglossaryentry or the counter option in the \gls-like and \glstext-like commands (or in \glsadd).

+The syntax of the location must be valid for the given indexing application if you use Options 2 or 3. In the case of makeindex, the syntax is quite restricted. The location may be a digit (\arabic), upper or lowercase Roman numerals (\Roman or \roman) or upper or lowercase ASCII letters (\Alph or \alph). The syntax also allows composite locations formed by combining the allowed digits, numerals and letters with a compositor (which can be identified with \glsSetCompositor).

+The following locations are valid, assuming the default full stop compositor: +

+ The following are invalid: +
    +
  • “I-3.2”: mixed compositors not permitted;
  • “X7”: a separator must be used in composite locations;
  • “Ø”: letters must be ASCII;
  • \textsc{iv}: commands not permitted in locations;
  • “”: locations can’t be empty. +
+

+

+Invalid locations will be rejected by makeindex, which will result in the entry being dropped from the glossary if it has no valid locations.
+

+In the case of xindy, the location syntax must be declared in the xdy style file. This covers both the way that the location appears in the indexing file as a result of protected expansion but also the counter used to obtain the location, and is described in more detail in §14.3. The standard digit (\arabic), upper or lowercase Roman numerals (\Roman or \roman) or upper or lowercase ASCII letters (\Alph or \alph) are automatically added for the page counter.

+If a location doesn’t match any declared syntax, a warning will be written to xindy’s transcript file (glg):

WARNING: location-reference "{prefix}{location}" did not match any location-class! (ignored)
+
As with makeindex when it encounters an invalid location, xindy will drop that location, which will result in the entry being dropped from the glossary if it has no valid locations.

+Additional problems can occur with xindy if any of xindy’s special characters occur in the location. This includes the backslash \ character, which is particularly problematic if any robust or protected commands are written in the location as \csname will have to be written to the file as \\csname. This is quite difficult to do without prematurely expanding \thepage.

+If esclocationstrue, an attempt will be made to hack commands like \@arabic and \@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.

+

+Any commands that end up in the location can interfere with \glsdohypertarget when it tries to create hyperlinks.
+

+The following hook is used during the protected write:

+\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 number list, but you may be able to correct this with a custom encap or (if \glshypernumber creates a hyperlink) a custom definition of \glswrglosslocationtextfmt. See §12.5 for an example.

+

+The \glswrglossdisablelocationcmds hook occurs after \protected@write sets \thepage to \relax. By the time \thepage actually gets expanded when it’s written to the indexing file, any changes made within the hook will be lost.
+

+Both Options 1 and 4 write the indexing information in the aux file and will accept any location syntax (that’s valid in a LaTeX document). In the case of Option 4, 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 range (if required), otherwise it will accept the location but not form any implicit ranges.

+With Options 14 (except with record=nameref) the location anchor isn’t included in the indexing information. If a hyperlink is required for the location, the target (anchor name) has to be constructed from the location. The hyperref package provides \hyperpage for normal indexes (with \index), but this forms the anchor from page.location which isn’t suitable with glossaries as the location counter may not be the default page. Therefore the counter is saved within the encap. A prefix is also necessary if \theHcounter is defined and isn’t equivalent to \thecounter.

+The assumption here is that \theHcounter expands to the equivalent of prefix\thecounter. If \theHcounter and \thecounter are equivalent then prefix will be empty.

+The prefix is found as follows: +

    +
  1. 1.Use the \glswrglossdisableanchorcmds hook to disable problematic commands (scoped).

    +

  2. 2.Perform a protected expansion on \theHcounter (Hloc) and \thecounter (loc). If Hloc ends with loc, so that Hloc is prefixloc, then the prefix is the prefix substring.

    +In this step, \thepage may be incorrect, due to TeX’s asynchronous output routine, but it will be incorrect in both Hloc and 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, \thepage should then expand correctly. +

+

+Unfortunately, not all definitions of \theHcounter will expand in the form prefix\thecounter. In which case a warning will occur:

Hyper target `Hloc' can't be formed by prefixing
+location `loc'. You need to modify the definition of \theHcounter
+otherwise you will get the warning: "`name{counter.loc}' has been
+referenced but does not exist"
+
If you need the location hyperlink, you will either have to redefine \theHcounter or switch to Option 4 and record=nameref.

+ +

+ +
+

12.4. Page Precedence

+

+The page precedence indicates the location ordering within the number list based on the location syntax. For example, if an entry has been indexed on pages 5, 7, i and ii, then the number list will be “i, ii, 5, 7” with the default order of precedence.

+With makeindex, the default precedence is rnaRA, which indicates: lowercase Roman (\roman), numeric (\arabic), lowercase alphabetic (\alph), uppercase Roman (\Roman), and uppercase alphabetic (\Alph). This order can be changed by adding the page_precedence parameter to the ist file. There’s no specific command provided for this, so you will need to use the \GlsSetWriteIstHook to add this. For example:

\GlsSetWriteIstHook{% 
+ \write\glswrite{page_precedence "arnAR"}% 
+}
+

+With xindy, the precedence is given by the order the location classes are listed in define-location-class-order within the xdy style file. This order can either be changed in a custom xdy file or can be set with \GlsSetXdyLocationClassOrder.

+Since neither Options 1 and 4 recognise specific location classes, they have no concept of page precedence. They will both create location lists 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 bib2gls, it’s possible to gather the locations into sub-groups according to the associated counter or split off locations with identified primary formats. See the bib2gls manual for further details.

+ +

+ +
+

12.5. Problematic Locations

+

+The default location counter is the page counter, the value of which is obtained with \thepage. Due to TeX’s asynchronous output routine, \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 aux and toc files (and to indexing files).

+This works fine with Options 1 and 4 since neither of those options have any restrictions on the location syntax (provided that it’s valid LaTeX code). With bib2gls, if it can’t work out a numeric value for the location then it simply won’t be able to form a range. Additionally, bib2gls v3.0+, converts an empty location into an ignored location, which means the entry will still be selected so that it can be included in the glossary, but it won’t cause a spurious comma or en-dash as there won’t be an invisible location in the number list.

+The only problematic locations with Options 1 and 4 are where hyperlinks are required but the target name can’t be formed from the prefix, counter and location information (see §12.3). The best solution with bib2gls in this case is to use record=nameref, which saves the actual target name in the indexing record. With Option 1 you will have to redefine \theHcounter as appropriate.

+With Options 2 and 3, the location must expand to content that is compatible with the indexing application’s syntax. The syntax for makeindex is quite restrictive and is described in §12.3.

+For example, \thepart is normally formatted as an uppercase Roman numeral. There’s no Roman numeral for 0 so if the part counter is 0 (that is, before the first \part) then \thepart will expand to nothing. This can be demonstrated in the following document:

\documentclass{article}
+\usepackage[counter=part]{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={}}
+\begin{document}
+\gls{sample}% part = 0
+\part{Sample Part}
+\section{Sample Section}
+\gls{sample}.
+\printglossaries
+\end{document}
+
In the above, the first instance of \gls{sample} will have an empty location. This will cause makeindex to reject the location with the following message in the transcript (assuming the document file is called myDoc.tex):
!! Input index error (file = myDoc.glo, line = 1):
+   -- Illegal page number  or page_precedence rnaRA.
+
If makeglossaries encounters this warning, it will replace the empty location with “0” and change the location encap to glsignore. In the above example, this will lead to an invisible location in the number list, but that’s exactly what an empty location would do if makeindex allowed it.

+Similarly, if the page compositor hasn’t been correctly identified, then it can also result in an invalid location. For example:

\documentclass{article}
+\usepackage[counter=section]{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={}}
+% default compositor is '.' not '-'
+\renewcommand{\thesection}{\thepart-\arabic{section}}
+\begin{document}
+\part{Sample Part}
+\section{Sample Section}
+\gls{sample}.
+\printglossaries
+\end{document}
+
This will cause makeindex to reject the location with the following message in the transcript:
!! Input index error (file = myDoc.glo, line = 1):
+   -- Illegal Roman number: position 2 in I-1.
+
If makeglossaries encounters this warning, it will replace any invalid content (the hyphen, in this case) with the page compositor specified in the ist file.

+In both of the above examples, using makeglossaries will help the document build to complete without the entries disappearing from the glossary, however the resulting number list may look strange. If you are using nonumberlist then this isn’t a problem.

+If you don’t use makeglossaries but explicitly call makeindex then you won’t have those corrections, and some or all of your entries may be omitted from the glossary. In which case, you will have to adjust the location so that it fits makeindex’s syntax even if you have nonumberlist. In the case of the invalid page compositor problem, you can simply use \glsSetCompositor to set the correct compositor. In the case of empty locations you will need to chose a different location counter.

+Other problems occur with commands that don’t fully expand, which results in LaTeX markup in the location in the indexing file. For example, if babel is used with spanish, lowercase Roman numerals (which may occur in the front matter) will expand to the internal command \es@scroman, as in the following:

\documentclass{book}
+\usepackage[T1]{fontenc}
+\usepackage[spanish]{babel}
+\usepackage{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={un ejemplo}}
+\begin{document}
+\frontmatter
+\chapter{Foreword}
+\gls{sample}% problem location
+\mainmatter
+\chapter{Sample}
+\gls{sample}
+\printglossaries
+\end{document}
+
The first instance of \gls occurs in the front matter on page i, which in this case is formatted in faked small caps with \es@scroman. This can be found in the glo file, which contains:
\glossaryentry{sample?\glossentry{sample}|setentrycounter[]{page}"\glsnumberformat}{\es@scroman {i}}
+\glossaryentry{sample?\glossentry{sample}|setentrycounter[]{page}"\glsnumberformat}{1}
+
Each line in the glo file corresponds to a single indexing instance (created with \gls in this case).

+The double-quote (") is makeindex’s escape character (which can be changed with \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 makeindex, except in the ist file, but is for xindy).

+The indexing data is contained in the arguments of:

+\glossaryentry{data}{location}
+ This isn’t a defined command but is simply used as a keyword in the indexing file. By default, makeindex expects \indexentry. The custom ist style file created by \makeglossaries identifies \glossaryentry as the keyword:
keyword "\\glossaryentry"
+

+The syntax for the second argument location is as described in §12.3. The syntax for the first argument data is in the form:

sort?text|encap
+
or for sub-entries:
parent sort?parent text!sort?text|encap
+
The question mark (?) is the “actual character” and separates the sort value from the actual text that’s written to the gls file (which is input by \printglossary).

+By default, makeindex uses @ as the actual character but this caused a problem for early versions of glossaries where there was a greater chance of internal commands occurring in the glo file. The custom ist file identifies ? as the actual character:

actual '?'
+

+You may remember from §12.1 that the format option specifies the encap, which I claimed was essentially the same as the encap with \index, but as can be seen from the above example, that’s not strictly speaking true. The real encap has to include \setentrycounter so that (if hyperlinks are supported) the appropriate target name can be constructed.

+The way that makeindex works is that it will write

\encap{location}
+
in the gls (or equivalent) file. What glossaries actually needs for the hyperlinks to work is:
\setentrycounter[prefix]{counter}\cs{location}
+
where cs is the real formatting command name (identified in the format option).

+So from makeindex’s point of view, the real encap in the above example is the literal string:

setentrycounter[]{page}\glsnumberformat
+

+In the above example, the location has ended up as \es@scroman {i} which is invalid, as makeindex requires the location to consist solely of digits, Roman numerals or alphabetic, optionally separated by a compositors.

+That means that this example will trigger a message from makeindex which will be written to the glg transcript file:

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).
+
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 makeglossaries instead of running makeindex explicitly, then makeglossaries will search the glg transcript for the “(n entries accepted, m rejected)” line, and if m is greater than 0 it will attempt to diagnose and fix the problem.

+Messages about the “second argument” (as in “Illegal space within numerals in second argument”) indicate that the problem is with the location, so makeglossaries will search the locations for content that matches \csname +{num} (with any or no spaces after the command name and optionally preceded by \protect). If it finds a match, it will shift csname into the encap with the following message:

Encap/location issue: potential LaTeX commands in location detected. Attempting to remedy.
+Reading myDoc.glo...
+Invalid location '\es@scroman  {i}' detected for entry 'sample'. Replaced with 'i'
+Writing myDoc.glo...
+Retrying
+
The altered glo file now contains:
\glossaryentry{sample?\glossentry{sample}|setentrycounter[]{page}"\glslocationcstoencap{glsnumberformat}{es@scroman}}{i}
+\glossaryentry{sample?\glossentry{sample}|setentrycounter[]{page}"\glsnumberformat}{1}
+
and makeglossaries will re-run makeindex.

+Following this correction, the number list for the “sample” entry now contains:

\setentrycounter[]{page}\glslocationcstoencap{glsnumberformat}{es@scroman}{i}\delimN
+\setentrycounter[]{page}\glsnumberformat{1}
+
The corrected location needs to be encapsulated with both the designated encap (glsnumberformat in this case) and the formatting command that needs to be applied to the location. This is done via:
+\glslocationcstoencap{encap-csname}{location-csname}
+ This is simply defined to do:
\csuse{location-csname}{\csuse{encap-csname}{location}}
+
This puts the intended encap (glsnumberformat in this case) closer to the location to enable it to work better with hyperlinks, although this may not always work, particularly if the command with the name location-csname expects a numerical argument.

+In the above example, the location command is \es@scroman which is provided by babel-spanish and performs fake small caps. Internal commands provided by other packages for their own private use can’t be relied upon. So the glossaries package can’t assume they will stay the same, and the above example document may produce a different result with different versions of babel. However, in this case (provided you use makeglossaries), the document will correctly end up with the number list i, 1” for the “sample” entry in the glossary, which matches the document page numbering. If you use makeindex explicitly, the number list will simply be “1”.

+This become more complicated if hyperref is added to the document (before glossaries). Now \glsnumberformat uses \glshypernumber, which needs to take into account that its argument may contain a range with the start and end location separated by \delimR (the range delimiter), and it needs to create a separate hyperlink for each location component.

+Here’s a modified example that has an implicit range in the front matter and an explicit range in the main matter.

\documentclass{book}
+\usepackage[T1]{fontenc}
+\usepackage[spanish]{babel}
+\usepackage[colorlinks]{hyperref}
+\usepackage{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={un ejemplo}}
+\begin{document}
+\frontmatter
+\chapter{Foreword}
+\gls{sample}
+\newpage
+\gls{sample}
+\newpage
+\gls{sample}
+\mainmatter
+\chapter{Sample}
+\gls[format=(hyperbf]{sample}
+\newpage
+Some text
+\newpage
+\gls[format=)hyperbf]{sample}
+\printglossaries
+\end{document}
+
This again has problematic locations, but makeglossaries can shift the \es@scroman into the encap as before. The resulting gls file has the following number list for the “sample” entry:
\setentrycounter[]{page}% prefix and counter
+\glslocationcstoencap{glsnumberformat}{es@scroman}{i\delimR iii}\delimN 
+\setentrycounter[]{page}% prefix and counter
+\hyperbf{1\delimR 3}
+
Both ranges have been compacted so that the range, including the \delimR separator, is in the argument of the encap command.

+The default definition of \glslocationcstoencap means that the first range is formatted according to:

\es@scroman{\glshypernumber{i\delimR iii}}
+
This allows \glshypernumber to detect the delimiter and split up the range so that it can apply a separate hyperlink to the start and end locations, so that it effectively becomes:
\es@scroman{\hyperlink{target1}{i}\delimR
+\hyperlink{target2}{iii}}
+
In this type of situation, the most problematic document is one where the location-csname can’t handle \hyperlink in its argument and needs to be shifted into the hyperlink text. In the above example document, no actual error occurs, but there are warnings from pdfTeX:
pdfTeX warning (dest): name{page.iii} has been referenced but does not exist, replaced by a fixed one
+[...]
+pdfTeX warning (dest): name{page.i} has been referenced but does not exist, replaced by a fixed one
+
This is due to the way that \glshypernumber forms the target name. Since the actual target name isn’t saved in the indexing data, it has to be reconstituted from available information: the prefix, the counter and the location. So the targets become page.i for location “i” and page.iii for location “iii”. This usually works for common page formats, but it doesn’t in this case. Adding debug to hyperref’s package options reveals the following information in the transcript:
Package hyperref Info: Anchor `page.I'
+[...]
+Package hyperref Info: Anchor `page.II'
+
So the correct anchors are “page.I” and “page.II”.

+The case change occurs as a result of the fake small caps, but since \es@scroman is outside of \glshypernumber, the case change isn’t part of the location and so doesn’t affect the anchor name.

+I can redefine \glslocationcstoencap to swap them around:

\renewcommand{\glslocationcstoencap}[3]{\csuse{#1}{\csuse{#2}{#3}}}
+
However, now the transcript shows:
pdfTeX warning (dest): name{page.\\protect\040\\es@scroman\040\040{i--iii}} has been referenced but does not exist, replaced by a fixed one
+
This is because \es@scroman doesn’t fully expand.

+The \glswrglossdisableanchorcmds hook provides a workaround for the problematic command:

\appto\glswrglossdisableanchorcmds{\csletcs{es@scroman}{text_uppercase:n}}
+
This will cause \es@scroman to be locally redefined to just convert its argument to uppercase while the anchor is being constructed. Unfortunately this patch is only partially successful as the transcript now has:
pdfTeX warning (dest): name{page.I-- III} has been referenced but does not exist, replaced by a fixed one
+
The problem now is that \glshypernumber can’t split on the range delimiter, so the location is now “I--III”.

+If the number list doesn’t contain any ranges, then the above redefinition of \glslocationcstoencap and the addition to \glswrglossdisableanchorcmds will fix the hyperlink.

+Instead of redefining \glslocationcstoencap and altering \glswrglossdisableanchorcmds, a solution that works with ranges can be achieved by redefining \glswrglosslocationtarget to convert its argument to uppercase. You can do this with:

\renewcommand{\glswrglosslocationtarget}[1]{\glsuppercase{#1}}
+

+This will successfully construct the anchor names page.I and page.III. It won’t affect the anchors for the main matter as digits aren’t affected by the case-changing command.

+If you’re not using makeglossaries and are either calling makeindex explicitly or via makeglossaries-lite or with the automake option, then you will need to find another way of converting problematic location into a form that won’t be discarded by makeindex. This is quite difficult if the problematic content is inside \thepage since its delayed expansion means that any attempt at locally changing the problematic within \glswrglossdisablelocationcmds will be lost.

+The earlier example can be rewritten to (sort of!) work without makeglossaries:

\documentclass{book}
+\usepackage[T1]{fontenc}
+\usepackage[spanish]{babel}
+\usepackage[colorlinks]{hyperref}
+\usepackage{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={un ejemplo}}
+
+\newcommand{\locthepage}{\Roman{page}}
+\newcommand{\delayedlocthepage}{\expandonce{\locthepage}}
+\appto\glswrglossdisablelocationcmds{\let\thepage\delayedlocthepage}
+
+\begin{document}
+\frontmatter
+\chapter{Foreword}
+\gls{sample}
+\newpage
+\gls{sample}
+\newpage
+\gls{sample}
+\mainmatter
+\renewcommand{\locthepage}{\arabic{page}}
+\chapter{Sample}
+\gls[format=(hyperbf]{sample}
+\newpage
+Some text
+\newpage
+\gls[format=)hyperbf]{sample}
+\printglossaries
+\end{document}
+
Note that the custom \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 glo file, so 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 uppercase in the glossary.

+The above problems are all due to makeindex having a restrictive location syntax. With xindy, you can define location classes for custom locations. Unfortunately, the backslash \ is a special character for 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 xindy indexing file must have their initial backslash escaped. This is quite tricky to do given the delayed expansion of \thepage. If it’s expanded early in order to pre-process it then the page number could end up being incorrect.

+The sample file samplexdy.tex provides a custom page format that uses a robust command called \tallynum, which ends up in the glo file. With the default esclocations=false setting, the location for the first page is written to the file as:

:locref "{}{\tallynum {1}}"
+
This results in the following message from xindy:
WARNING: location-reference "{}{tallynum {1}}" did not match any location-class! (ignored)
+
Note that the backslash has gone from the start of tallynum. As with makeindex, invalid locations are dropped.

+If you use makeglossaries rather than running xindy directly, makeglossaries will detect the warning and provide some diagnostic information:

You may have forgotten to add a location 
+class with \GlsAddXdyLocation or you may have 
+the format incorrect or you may need 
+the package option esclocations=true.
+
In this case, you need to use the package option esclocations=true. This will use a hack to provide a way to escape the backslash without prematurely expanding the actual value of the page counter. As this is a hack, it may not work and can result in obscure error messages.

+Returning to the earlier babel-spanish example, if it’s converted to use xindy instead of makeindex, a similar problem arises. For example, simply adding the xindy package option:

\documentclass{book}
+\usepackage[T1]{fontenc}
+\usepackage[spanish]{babel}
+\usepackage[colorlinks]{hyperref}
+\usepackage[xindy]{glossaries}
+\makeglossaries
+\newglossaryentry{sample}{name={sample},description={un ejemplo}}
+\begin{document}
+\frontmatter
+\chapter{Foreword}
+\gls{sample}
+\newpage
+\gls{sample}
+\newpage
+\gls{sample}
+\mainmatter
+\chapter{Sample}
+\gls[format=(hyperbf]{sample}
+\newpage
+Some text
+\newpage
+\gls[format=)hyperbf]{sample}
+\printglossaries
+\end{document}
+
The glo file now contains locations with \es@scroman, but as with the \tallynum example, the leading backslash hasn’t been escaped:
:locref "{}{\es@scroman  {i}}"
+
This needs esclocations=true to escape the backslash.
\usepackage[xindy,esclocations]{glossaries}
+
Note that this produces a different result in the glo file:
:locref "{}{\\protect \\es@scroman  {i}}"
+
This results from the partial protected expansion used on \thepage before the special characters are escaped. If you inspect the xdy file created by \makeglossaries, you should find the following:
(define-location-class "roman-page-numbers"
+   ( :sep "{}{"  :sep "\protect \es@scroman {" "roman-numbers-lowercase" :sep "}" :sep "}" )
+   :min-range-length 2
+)
+
This is because the non-default behaviour of \roman has been detected and a custom location class has automatically been supplied. (Whereas with the samplexdy.tex sample file, it was necessary to provide the custom class to support \tallynum with \GlsAddXdyLocation.)

+ +

+ +
+

12.6. Iterating Over Locations

+

+

+Not available with Options 2 and 3. The commands described here rely on the locations being stored in the loclist internal field in an etoolbox internal list format, which is what happens with Option 1.
+

+The \printnoidxglossary command displays the location list using:

+\glsnoidxloclist{list cs}

+

+
+ where list cs is a temporary command that contains the value of the loclist field. This uses \forlistloop to iterate over all the locations in the list with the handler macro:
+\glsnoidxloclisthandler{location}

+

+
+ This keeps track of the previous element in the list to determine whether or not to insert the \delimN separator. Note that it doesn’t attempt to determine whether or not any of the locations are ranges.

+

+ The \printunsrtglossary command will also use \glsnoidxloclist if the loclist field has been set but the location field hasn’t, but in general it’s better to instruct bib2gls to save the formatted location list (which is the default).
+

+You can iterate over an entry’s loclist field using:

+\glsnumberlistloop{entry-label}{handler}{xr handler cs}
+ where entry-label is the entry’s label and handler cs is a handler control sequence with the syntax:
handler cs{prefix}{counter}{format}{location}
+
where prefix is the hypertarget prefix, counter is the name of the location counter, format is the location encap (for example, textbf) and location is the location.

+The third argument xr handler cs is the control sequence that will be applied to any cross-references in the list. This handler should have the syntax:

xr handler cs[tag]{xr list}{empty}
+
where tag is the cross-referenced textual tag (for example, “see”) and xr list is a comma-separated list of entry labels. The final argument empty will always be empty, but it allows for \glsseeformat to be used as the handler.

+

+ This method is designed for Option 1, but bib2gls also saves individual locations in the loclist field (in addition to the formatted location list which is stored in the location field). However, the format for each item in the internal list varies depending on whether record=only or record=nameref was used. See the glossaries-extra manual for further details.
+

+For example, if on page 12 I have:

\gls[format=textbf]{apple}
+
and on page 18 I have:
\gls[format=emph]{apple}
+
then
\glsnumberlistloop{apple}{\myhandler}
+
will be equivalent to:
\myhandler{}{page}{textbf}{12}% 
+\myhandler{}{page}{emph}{18}% 
+
There is a predefined handler that’s used to display the number list in \printnoidxglossary:
+\glsnoidxdisplayloc{prefix}{counter}{format}{location}
+ This simply does:
\setentrycounter[prefix]{counter}% 
+\csuse{format}{location}
+
which sets up the hyperlink information needed for \glshypernumber (in case it’s required by the encap) and encapsulates the location, with the provided formatting command.

+Internally, \glsnumberlistloop uses etoolbox’s \forlistloop with the handler:

+\glsnoidxnumberlistloophandler{location item}
+ The default behaviour is simply to do its argument, which (for Option 1) will be in the form:
\glsnoidxdisplayloc{prefix}{counter}{format}{location}
+
The \glsnumberlistloop works by temporarily redefining \glsnoidxdisplayloc to handler and \glsseeformat to xr handler cs.

+

+ With glossaries-extra, you can use the more general purpose \glsxtrfieldforlistloop and provide your own handler that can be customized to suit record=only or record=nameref.
+

+ +

+ +
+

13. Glossary Styles

+

+The markup used in the glossary is described in §8.2. §13.2 describes how to define a new glossary style. Commands that may be used in styles, but should not be redefined by styles, are described in §§13.2.1 & 13.2.2. The commands that should be redefined by the glossary style are described in §13.2.3.

+Glossary styles typically use \glossentryname to display the entry’s name, but some may use the sentence case version \Glossentryname instead. Both encapsulate the name with:

+\glsnamefont{text}
+ which takes one argument: the entry name (obtained with \glsentryname or \Glsentryname).

+By default, \glsnamefont simply displays its argument in whatever the surrounding font happens to be, but bear in mind that the glossary style may switch the font.

+

+

+For example, the tree style displays the name as follows:

\glstreenamefmt{\glstarget{entry-label}{\glossentryname{entry-label}}}
+
which is essentially (ignoring the hyperlink target):
\glstreenamefmt{\glsnamefont{\glsentryname{entry-label}}}
+
Since \glstreenamefmt is defined to display its argument in bold, the name will end up in bold unless \glsnamefont is redefined to change it.

+The list style displays the name in the option argument of \item:

\item[\glsentryitem{entry-label}\glstarget{entry-label}{\glossentryname{entry-label}}]
+
which is essentially (ignoring the entry counter and hyperlink target):
\item[\glsnamefont{\glsentryname{entry-label}}]
+
This occurs within the 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 long style displays the name in the first column of a longtable:

\glsentryitem{entry-label}\glstarget{entry-label}{\glossentryname{entry-label}} &
+
So the only font change will come from \glsnamefont, which doesn’t apply any change by default.

+Glossary styles will typically display the description with \glossentrydesc but may not show the symbol. If the symbol is shown, it should be displayed with \glossentrysymbol.

+There’s no analogous font command for the description or symbol, but the glossaries-extra package provides the glossdescfont and glosssymbolfont attributes to change the font according to the entry’s category.

+Some styles may supply their own helper commands (such as \glstreenamefmt) to make it easier to adjust the formatting without having to define a new glossary style.

+

Example 33: Changing the Font Used to Display Entry Names in the Glossary
Suppose you want all the entry names to appear in medium weight small caps in your glossaries, then you can do:
\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}}
+

+

+ The glossaries-extra-stylemods package provides additional hooks that can be used to make other minor adjustments.
+

+Some styles support groups. These may simply insert a vertical gap between groups, but some may also include a heading with the group title. The base glossaries package only has a simple mechanism for obtaining the title from the group label via \glsgetgrouptitle, which will test if \group-labelgroupname exists where the group-label is glssymbols, glsnumbers or a single character.

+

+ The glossaries-extra package has commands \glsxtrsetgrouptitle and \glsxtrlocalsetgrouptitle to set the group title, which take precedence over \group-labelgroupname.
+

+ +

+ +
+

13.1. Predefined Styles

+

+The predefined styles can accommodate numbered top level (level 0) and level 1 entries. See the package options entrycounter, counterwithin and subentrycounter described in §2.3. There is a summary of available styles in Table 13.1. You can view samples of all the predefined styles at dickimaw-books.com/gallery/glossaries-styles/. Note that glossaries-extra provides additional styles in the supplementary packages glossary-bookindex, glossary-topic and glossary-longextra. See the glossaries-extra manual for further details.

+

+Note that the group styles (such as listgroup) will have unexpected results if used with the sort=def or sort=use options. If you don’t sort your entries alphabetically, it’s best to set the nogroupskip package option to prevent odd vertical gaps appearing.
+

+The group title is obtained using \glsgetgrouptitle{label}, which is described in §13.2.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 8: Glossary Styles. An asterisk in the style name indicates anything that matches that doesn’t match any previously listed style (for example, long3col* matches long3col, long3colheader, long3colborder and 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 there is no limit, but note that makeindex (Option 2) imposes a limit of 2 sub-levels. If the 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.
Style Maximum Level Homograph Symbol
listdotted 0
sublistdotted 1
list* 1
altlist* 1
long*3col* 1
long4col* 1
altlong*4col* 1
long* 1
super*3col* 1
super4col* 1
altsuper*4col* 1
super* 1
*index* 2
treenoname*
*alttree*
*tree*
inline 1
+

+

+The tabular-like styles that allow multi-line descriptions and number lists use the length:

+\glsdescwidth
+ to set the width of the description column and the length
+\glspagelistwidth
+ to set the width of the number list column.

+

+These lengths will not be available if you use both the nolong and nosuper package options or if you use the nostyles package option unless you explicitly load the relevant package.
+

+These will need to be changed using \setlength if the glossary is too wide. Note that the long4col and super4col styles (and their header and border variations) don’t use these lengths as they are designed for single line entries. Instead you should use the analogous altlong4col and 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 \newline instead of \\ (but consider using a ragged style with narrow columns).

+

+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 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 alttree style instead.
+

+Note that if you use the style key in the optional argument to \printglossary, it will override any previous style settings for the given glossary, so if, for example, you do

\renewcommand*{\glsgroupskip}{}% no effect
+\printglossary[style=long]
+
then the new definition of \glsgroupskip will not have an affect for this glossary, as \glsgroupskip is redefined by style=long. Likewise, \setglossarystyle will also override any previous style definitions, so, again
\renewcommand*{\glsgroupskip}% no effect
+\setglossarystyle{long}
+
will reset \glsgroupskip back to its default definition for the named glossary style (long in this case). If you want to modify the styles, either use \newglossarystyle (described in the next section) or make the modifications after \setglossarystyle. For example:
\setglossarystyle{long}
+\renewcommand*{\glsgroupskip}{}
+
In this case, it’s better to use nogroupskip to suppress the gap between groups for the default styles instead of redefining \glsgroupskip.

+All the styles except for the three- and four-column styles and the listdotted style use the post-description hook:

+\glspostdescription
+ after the description. This simply displays a full stop by default. To eliminate this full stop (or replace it with something else, say, a comma) you will need to redefine \glspostdescription before the glossary is displayed. Alternatively, you can suppress it for a given entry by placing \nopostdesc in the entry’s description. Note that \longnewglossaryentry puts \nopostdesc at the end of the description. The glossaries-extra package provides a starred version that doesn’t.

+Alternatively, you can use the package option nopostdot to suppress this full stop. This is implemented by default with glossaries-extra. You can switch it back on with nopostdot=false or postdot=or you can use postpunc for a different punctuation character.

+

+ The glossaries-extra-stylemods package provides some adjustments to some of the predefined styles listed here, allowing for greater flexibility. See the glossaries-extra documentation for further details.
+

+ +

+ +
+

13.1.1. List Styles

+

+

+\usepackage{glossary-list}

+

automatically loaded with \usepackage{glossaries}
+
+

+The glossary styles described in this section are all defined in the package glossary-list. Since they all use the description environment, they are governed by the same parameters as that environment. These styles all ignore the entry’s symbol. Note that these styles will automatically be available unless you use the nolist or nostyles package options.

+

+Note that, except for the listdotted style, these list styles are incompatible with classicthesis. They may also be incompatible with other classes or packages that modify the description environment.
+

+There is an initialisation hook that provides a patch if the gettitlestring package is loaded, since this is used by hyperref.

+\glslistinit
+ Note that this automatically implements:
\GetTitleStringSetup{expand}
+
This patch should ensure that the combination of hyperref and entrycounter will correctly expand the entry name to the aux file. The name is expanded using:
+\glslistexpandedname{entry-label}
+ This uses \glsunexpandedfieldvalue. If you need the name to fully expand, you can redefine this. For example:
\newcommand{\glslistexpandedname}[1]{\glsentryname{#1}}
+

+If nogroupskip=false, the \glsgroupskip command creates a vertical space using:

+\indexspace
+ This command is defined by some other packages, so it’s only defined by glossary-list if it hasn’t already been defined.

+For the styles that should group headings, the group title is encapsulated with:

+\glslistgroupheaderfmt{title}
+ This simply does its argument by default, but it occurs inside the optional argument of \item so may appear bold from the item font change.

+For the styles that have a navigation line, the line is formatted according to:

+\glslistnavigationitem{navigation items}
+ This puts its argument inside the optional argument of \item, which can cause a problem if the navigation line is too long, in which case you will need to redefine \glslistnavigationitem. For example:
\renewcommand*{\glslistnavigationitem}[1]{\item \textbf{#1}}
+
You may prefer to use the tree-like styles, such as treehypergroup instead.

+

+list
+ The list style uses the description environment. The entry name is placed in the optional argument of the \item command (so it will usually appear in bold by default). The description follows, and then the associated number list 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 \indexspace with the default nogroupskip=true.

+The closest matching non-list style is the index style.

+

+listgroup
+ The listgroup style is like list but the groups have headings obtained using \glsgetgrouptitle, which is described in §13.2.

+

+listhypergroup
+ The listhypergroup style is like listgroup but has a navigation line at the start of the glossary with links to each group that is present in the glossary, which is displayed in the glossary header with \glslistnavigationitem. This requires an additional run through LaTeX to ensure the group information is up to date. Within the navigation line, each group item is separated by \glshypernavsep.

+

+altlist
+ The altlist style is like list but the description starts on the line following the name. (As with the list style, the symbol is ignored.) Each child entry starts a new line, but as with the list style, the name associated with each child entry is ignored.

+The closest matching non-list style is the index style with the following adjustment:

\renewcommand{\glstreepredesc}{% 
+ \glstreeitem\parindent\hangindent}
+

+

+altlistgroup
+ The altlistgroup style is like altlist but the glossary groups have headings.

+

+altlisthypergroup
+ The altlisthypergroup style is like altlistgroup but has a set of links to the glossary groups. The navigation line is the same as that for listhypergroup, described above.

+

+listdotted
+ This style uses the description environment.1 Each entry starts with \item[], followed by the name followed by a dotted line, followed by the description. Note that this style ignores both the number list and the symbol. The length
+\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 index style with

\renewcommand{\glstreepredesc}{\dotfill}
+\renewcommand{\glstreechildpredesc}{\dotfill}
+
Note that this doesn’t use \glslistdottedwidth and causes the description to be flush-right and will display the symbol, if provided. (It also doesn’t suppress the number list, but that can be achieved with the nonumberlist option.)

+

+sublistdotted
+ This is a variation on the listdotted style designed for hierarchical glossaries. The main entries have just the name displayed. The sub entries are displayed in the same manner as listdotted. Unlike the listdotted style, this style is incompatible with classicthesis.

+ +

+ +
+

13.1.2. Longtable Styles

+

+

+\usepackage{glossary-long}

+

automatically loaded with \usepackage{glossaries}
+
+

+The glossary styles described in this section are all defined in the package glossary-long. Since they all use the longtable environment, they are governed by the same parameters as that environment. Note that these styles will automatically be available unless you use the nolong or nostyles package options. These styles fully justify the description and number list columns. If you want ragged right formatting instead, use the analogous styles described in §13.1.3. If you want to incorporate rules from the booktabs package, try the styles described in §13.1.4.

+Groups are separated with a blank row unless nogroupskip is used before the style is set. For example:

\usepackage[nogroupskip]{glossaries}
+\setglossarystyle{long}
+
Both may be combined in the same option list. For example:
\usepackage[nogroupskip,style=long]{glossaries}
+
Or
\printglossary[nogroupskip,style=longragged]
+
The following doesn’t work:
\setglossarystyle{long}
+\printglossary[nogroupskip]% too late
+
This is because the \ifglsnogroupskip conditional needs to be outside of \glsgroupskip with tabular-like styles, so the conditional is in the style definition to determine the appropriate definition of \glsgroupskip.

+

+ There are additional styles that use the longtable environment provided with the glossary-longextra package, but that requires glossaries-extra.
+

+

+long
+

+The long style uses the longtable environment (defined by the longtable package). It has two columns: the first column contains the entry’s name and the second column contains the description followed by the number list. 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 \glsdescwidth. Child entries have a similar format to the parent entries except that their name is suppressed.

+

+longborder
+

+The longborder style is like long but has horizontal and vertical lines around it.

+

+longheader
+

+The longheader style is like long but has a header row. You may prefer the long-booktabs style instead.

+

+longheaderborder
+

+The longheaderborder style is like longheader but has horizontal and vertical lines around it. The long-booktabs style is generally better.

+

+long3col
+

+The long3col style is like 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 number list. 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 \glsdescwidth, and the width of the third column is governed by the length \glspagelistwidth.

+

+long3colborder
+

+The long3colborder style is like the long3col style but has horizontal and vertical lines around it.

+

+long3colheader
+

+The long3colheader style is like long3col but has a header row. You may prefer the long3col-booktabs style instead.

+

+long3colheaderborder
+

+The long3colheaderborder style is like long3colheader but has horizontal and vertical lines around it. The long3col-booktabs style is generally better.

+

+long4col
+

+The long4col style is like 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 altlong4col for multi-line descriptions.

+

+long4colborder
+

+The long4colborder style is like the long4col style but has horizontal and vertical lines around it.

+

+long4colheader
+

+The long4colheader style is like long4col but has a header row. You may prefer the long4col-booktabs style instead.

+

+long4colheaderborder
+

+The long4colheaderborder style is like long4colheader but has horizontal and vertical lines around it.

+

+altlong4col
+

+The altlong4col style is like long4col but allows multi-line descriptions and number lists. The width of the description column is governed by the length \glsdescwidth and the width of the number list column is governed by the length \glspagelistwidth. The widths of the name and symbol columns are governed by the widest entry in the given column.

+

+altlong4colborder
+

+The altlong4colborder style is like the long4colborder but allows multi-line descriptions and number lists.

+

+altlong4colheader
+

+The altlong4colheader style is like long4colheader but allows multi-line descriptions and number lists. You may prefer the altlong4col-booktabs style instead.

+

+altlong4colheaderborder
+

+The altlong4colheaderborder style is like long4colheaderborder but allows multi-line descriptions and number lists.

+ +

+ +
+

13.1.3. Longtable Styles (Ragged Right)

+

+

+\usepackage{glossary-longragged}

+

load explicitly or with \usepackage[stylemods=longragged]{glossaries-extra}
+
+

+The glossary styles described in this section are all defined in the package glossary-longragged. These styles are analogous to those defined in glossary-long but the multiline columns are left justified instead of fully justified. Since these styles all use the longtable environment, they are governed by the same parameters as that environment. The glossary-longragged package additionally requires the array package. Note that these styles will only be available if you explicitly load glossary-longragged:

\usepackage{glossaries}
+\usepackage{glossary-longragged}
+\setglossarystyle{longragged3col}
+
Note that you can’t set these styles using the style package option since the styles aren’t defined until after the glossaries package has been loaded. If you want to incorporate rules from the booktabs package, try the styles described in §13.1.4.

+With glossaries-extra, you can load both the package and style with the style and stylemods options. For example:

\usepackage[style=longragged3col,stylemods=longragged]{glossaries-extra}
+

+As with the glossary-long styles, groups are separated with a blank row unless nogroupskip is used before the style is set. For example:

\usepackage[nogroupskip]{glossaries}
+\usepackage{glossary-longragged}
+\setglossarystyle{longragged}
+
Or
\printglossary[nogroupskip,style=longragged]
+

+

+longragged
+

+The longragged style has two columns: the first column contains the entry’s name and the second column contains the (left-justified) description followed by the number list. 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 \glsdescwidth. Child entries have a similar format to the parent entries except that their name is suppressed.

+

+longraggedborder
+

+The longraggedborder style is like longragged but has horizontal and vertical lines around it.

+

+longraggedheader
+

+The longraggedheader style is like longragged but has a header row. You may prefer the longragged-booktabs style instead.

+

+longraggedheaderborder
+

+The longraggedheaderborder style is like longraggedheader but has horizontal and vertical lines around it.

+

+longragged3col
+

+The longragged3col style is like 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) number list. 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 \glsdescwidth, and the width of the third column is governed by the length \glspagelistwidth.

+

+longragged3colborder
+

+The longragged3colborder style is like the longragged3col style but has horizontal and vertical lines around it.

+

+longragged3colheader
+

+The longragged3colheader style is like longragged3col but has a header row. You may prefer the longragged3col-booktabs style instead.

+

+longragged3colheaderborder
+

+The longragged3colheaderborder style is like longragged3colheader but has horizontal and vertical lines around it.

+

+altlongragged4col
+

+The altlongragged4col style is like 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 \glsdescwidth and the width of the number list column is governed by the length \glspagelistwidth. The widths of the name and symbol columns are governed by the widest entry in the given column.

+

+altlongragged4colborder
+

+The altlongragged4colborder style is like the altlongragged4col but has horizontal and vertical lines around it.

+

+altlongragged4colheader
+

+The altlongragged4colheader style is like altlongragged4col but has a header row. You may prefer the altlongragged4col-booktabs style instead.

+

+altlongragged4colheaderborder
+

+The altlongragged4colheaderborder style is like altlongragged4colheader but has horizontal and vertical lines around it.

+ +

+ +
+

13.1.4. Longtable Styles (booktabs)

+

+

+\usepackage{glossary-longbooktabs}

+

load explicitly or with \usepackage[stylemods=longbooktabs]{glossaries-extra}
+
+

+The glossary styles described in this section are all defined in the package glossary-longbooktabs.

+Since these styles all use the longtable environment, they are governed by the same parameters as that environment. The glossary-longbooktabs package automatically loads the glossary-long13.1.2) and glossary-longragged13.1.3) packages. Note that these styles will only be available if you explicitly load glossary-longbooktabs:

\usepackage{glossaries}
+\usepackage{glossary-longbooktabs}
+
Note that you can’t set these styles using the style package option since the styles aren’t defined until after the glossaries package has been loaded.

+With glossaries-extra, you can load both the package and style with the style and stylemods options. For example:

\usepackage[style=long3col-booktabs,stylemods=longbooktabs]{glossaries-extra}
+

+As with the glossary-long styles, groups are separated with a blank row unless nogroupskip is used before the style is set. For example:

\usepackage[nogroupskip]{glossaries}
+\usepackage{glossary-longbooktabs}
+\setglossarystyle{long-booktabs}
+
Or
\printglossary[nogroupskip,style=long-booktabs]
+

+These styles are similar to the “header” styles in the glossary-long and glossary-longragged packages, but they add the rules provided by the booktabs package, \toprule, \midrule and \bottomrule. Additionally these styles patch the 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 longtable in your document, you can scope the effect by only setting the style through the style key in the optional argument of \printglossary.

+Alternatively, you can restore the original longtable behaviour with:

+\glsrestoreLToutput
+

+The penalty check is tested with:

+\glsLTpenaltycheck
+ The default definition is:
\ifnum\outputpenalty=-50\vskip-\normalbaselineskip\relax\fi
+

+With the default nogroupskip=false, \glsgroupskip will be defined to use:

+\glspenaltygroupskip
+ to insert the vertical gap. This is defined as:
\noalign{\penalty-50\vskip\normalbaselineskip}
+

+

+long-booktabs
+

+This style is similar to the longheader style but adds rules above and below the header (\toprule and \midrule) and inserts a rule at the bottom of the table (\bottomrule).

+

+long3col-booktabs
+

+This style is similar to the long3colheader style but adds rules as per long-booktabs.

+

+long4col-booktabs
+

+This style is similar to the long4colheader style but adds rules as above.

+

+altlong4col-booktabs
+

+This style is similar to the altlong4colheader style but adds rules as above.

+

+longragged-booktabs
+

+This style is similar to the longraggedheader style but adds rules as above.

+

+longragged3col-booktabs
+

+This style is similar to the longragged3colheader style but adds rules as above.

+

+altlongragged4col-booktabs
+

+This style is similar to the altlongragged4colheader style but adds rules as above.

+ +

+ +
+

13.1.5. Supertabular Styles

+

+

+\usepackage{glossary-super}

+

automatically loaded with \usepackage{glossaries}
+
+

+The glossary styles described in this section are all defined in the package glossary-super. Since they all use the supertabular environment, they are governed by the same parameters as that environment. Note that these styles will automatically be available unless you use the nosuper or nostyles package options. In general, the longtable environment is better, but there are some circumstances where it is better to use supertabular. (For example, with the flowfram package.) These styles fully justify the description and number list columns. If you want ragged right formatting instead, use the analogous styles described in §13.1.6.

+As with the glossary-long styles, groups are separated with a blank row unless nogroupskip is used before the style is set. For example:

\usepackage[nogroupskip]{glossaries}
+\setglossarystyle{super}
+
Or
\usepackage[nogroupskip,style=super]{glossaries}
+
Or
\printglossary[nogroupskip,style=super]
+

+

+Sometimes the supertabular style doesn’t put page breaks in the right place. If you have unexpected output, try the glossary-long styles instead. Alternatively, try the alttree style.
+

+

+super
+

+The super style uses the supertabular environment (defined by the supertabular package). It has two columns: the first column contains the entry’s name and the second column contains the description followed by the number list. 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 \glsdescwidth. Child entries have a similar format to the parent entries except that their name is suppressed.

+

+superborder
+

+The superborder style is like super but has horizontal and vertical lines around it.

+

+superheader
+

+The superheader style is like super but has a header row.

+

+superheaderborder
+

+The superheaderborder style is like superheader but has horizontal and vertical lines around it.

+

+super3col
+

+The super3col style is like 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 number list. 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 \glsdescwidth. The width of the third column is governed by the length \glspagelistwidth.

+

+super3colborder
+

+The super3colborder style is like the super3col style but has horizontal and vertical lines around it.

+

+super3colheader
+

+The super3colheader style is like super3col but has a header row.

+

+super3colheaderborder
+

+The super3colheaderborder style is like the super3colheader style but has horizontal and vertical lines around it.

+

+super4col
+

+The super4col style is like 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 altsuper4col for multi-line descriptions.

+

+super4colborder
+

+The super4colborder style is like the super4col style but has horizontal and vertical lines around it.

+

+super4colheader
+

+The super4colheader style is like super4col but has a header row.

+

+super4colheaderborder
+

+The super4colheaderborder style is like the super4colheader style but has horizontal and vertical lines around it.

+

+altsuper4col
+

+The altsuper4col style is like super4col but allows multi-line descriptions and number lists. The width of the description column is governed by the length \glsdescwidth and the width of the number list column is governed by the length \glspagelistwidth. The width of the name and symbol columns is governed by the widest entry in the given column.

+

+altsuper4colborder
+

+The altsuper4colborder style is like the super4colborder style but allows multi-line descriptions and number lists.

+

+altsuper4colheader
+

+The altsuper4colheader style is like super4colheader but allows multi-line descriptions and number lists.

+

+altsuper4colheaderborder
+

+The altsuper4colheaderborder style is like super4colheaderborder but allows multi-line descriptions and number lists.

+ +

+ +
+

13.1.6. Supertabular Styles (Ragged Right)

+

+

+\usepackage{glossary-superragged}

+

load explicitly or with \usepackage[stylemods=superragged]{glossaries-extra}
+
+

+The glossary styles described in this section are all defined in the package glossary-superragged. These styles are analogous to those defined in glossary-super but the multiline columns are left justified instead of fully justified. Since these styles all use the supertabular environment, they are governed by the same parameters as that environment. The glossary-superragged package additionally requires the array package. Note that these styles will only be available if you explicitly load glossary-superragged:

\usepackage{glossaries}
+\usepackage{glossary-superragged}
+
Note that you can’t set these styles using the style package option since the styles aren’t defined until after the glossaries package has been loaded.

+With glossaries-extra, you can load both the package and style with the style and stylemods options. For example:

\usepackage[style=superragged3col,stylemods=superragged]{glossaries-extra}
+

+As with the glossary-long styles, groups are separated with a blank row unless nogroupskip is used before the style is set. For example:

\usepackage[nogroupskip]{glossaries}
+\usepackage{glossary-superragged}
+\setglossarystyle{superragged}
+
Or
\printglossary[nogroupskip,style=superragged]
+

+

+superragged
+

+The superragged style uses the supertabular environment (defined by the supertabular package). It has two columns: the first column contains the entry’s name and the second column contains the (left justified) description followed by the number list. 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 \glsdescwidth. Child entries have a similar format to the parent entries except that their name is suppressed.

+

+superraggedborder
+

+The superraggedborder style is like superragged but has horizontal and vertical lines around it.

+

+superraggedheader
+

+The superraggedheader style is like superragged but has a header row.

+

+superraggedheaderborder
+

+The superraggedheaderborder style is like superraggedheader but has horizontal and vertical lines around it.

+

+superragged3col
+

+The superragged3col style is like 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) number list. 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 \glsdescwidth. The width of the third column is governed by the length \glspagelistwidth.

+

+superragged3colborder
+

+The superragged3colborder style is like the superragged3col style but has horizontal and vertical lines around it.

+

+superragged3colheader
+

+The superragged3colheader style is like superragged3col but has a header row.

+

+superragged3colheaderborder
+

+The superragged3colheaderborder style is like the above but has horizontal and vertical lines around it.

+

+altsuperragged4col
+

+The altsuperragged4col style is like 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.

+

+altsuperragged4colborder
+

+The altsuperragged4colborder style is like the altsuperragged4col style but has horizontal and vertical lines around it.

+

+altsuperragged4colheader
+

+The altsuperragged4colheader style is like altsuperragged4col but has a header row.

+

+altsuperragged4colheaderborder
+

+The altsuperragged4colheaderborder style is like the above but has horizontal and vertical lines around it.

+ +

+ +
+

13.1.7. Tree-Like Styles

+

+

+\usepackage{glossary-tree}

+

automatically loaded with \usepackage{glossaries}
+
+

+The glossary styles described in this section are all defined in the package 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 entry’s symbol if it has been set. Note that these styles will automatically be available unless you use the notree or nostyles package options.

+These styles all format the entry name using:

+\glstreenamefmt{text}
+ This defaults to \textbf{text}, but note that text will include \glsnamefont so the bold setting in \glstreenamefmt may be counteracted by another font change in \glsnamefont (or in \acronymfont). The tree-like styles that also display the header use
+\glstreegroupheaderfmt{text}
+ to format the heading. This defaults to \glstreenamefmt{text}. The tree-like styles that display navigation links to the groups (such as indexhypergroup), format the navigation line using
+\glstreenavigationfmt{text}
+ which defaults to \glstreenamefmt{text}.

+Note that this is different from \glslistnavigationitem, provided with the styles such as listhypergroup, as that also includes \item.

+With the exception of the alttree style (and those derived from it), the space before the description for top-level entries is produced with

+\glstreepredesc
+ This defaults to \space.

+With the exception of the treenoname and alttree styles (and those derived from them), the space before the description for child entries is produced with

+\glstreechildpredesc
+ This defaults to \space.

+

+Most of these styles are not designed for multi-paragraph descriptions. (The tree style isn’t too bad for multi-paragraph top-level entry descriptions, or you can use the index style with the adjustment shown below.)
+

+

+index
+

+The 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. Groups are separated using \indexspace.

+Each main level item is started with

+\glstreeitem
+ The level 1 entries are started with
+\glstreesubitem
+

+The level 2 entries are started with

+\glstreesubsubitem
+

+Note that the index style automatically sets

\let\item\glstreeitem
+\let\subitem\glstreesubitem
+\let\subsubitem\glstreesubsubitem
+
at the start of the theglossary environment for backward compatibility.

+The index style isn’t suitable for multi-paragraph descriptions, but this limitation can be overcome by redefining the above commands. For example:

\renewcommand{\glstreeitem}{% 
+ \parindent0pt\par\hangindent40pt
+ \everypar{\parindent50pt\hangindent40pt}}
+

+

+indexgroup
+

+The indexgroup style is similar to the index style except that each group has a heading obtained using \glsgetgrouptitle.

+

+indexhypergroup
+

+The indexhypergroup style is like indexgroup but has a set of links to the glossary groups. The navigation line is the same as that for listhypergroup, described above, but is formatted using \glstreenavigationfmt.

+

+tree
+

+The tree style is similar to the index style except that it can have arbitrary hierarchical levels. (Note that 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

+\glstreeindentinitial: 10pt
+ This value can be changed with \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 alttree style instead. (See below.)

+

+treegroup
+

+The treegroup style is similar to the tree style except that each group has a heading.

+

+treehypergroup
+

+The treehypergroup style is like treegroup but has a set of links to the glossary groups. The navigation line is the same as that for listhypergroup, described above, but is formatted using \glstreenavigationfmt.

+

+treenoname
+

+The treenoname style is like the tree style except that the name for each sub-entry is ignored.

+

+treenonamegroup
+

+The treenonamegroup style is similar to the treenoname style except that each group has a heading.

+

+treenonamehypergroup
+

+The treenonamehypergroup style is like treenonamegroup but has a set of links to the glossary groups. The navigation line is the same as that for listhypergroup, described above, but is formatted using \glstreenavigationfmt.

+

+alttree
+

+The alttree style is similar to the tree style except that the indentation for each level is determined by the width of the text specified by

+\glssetwidest[level]{name}
+ The optional argument level indicates the hierarchical level, where 0 indicates the top-most level, 1 indicates the first level sub-entries, etc. If \glssetwidest hasn’t been used for a given sub-level, the level 0 widest text is used instead. If level is omitted, 0 is assumed.

+

+If you use the alttree style without setting the widest top level (level 0) 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.
+

+This requires keeping track of which entry has the widest name, which may not be practical for large glossaries. Instead you can use:

+\glsfindwidesttoplevelname[glossary labels]
+ This iterates over all entries in the glossaries identified by the comma-separated list glossary labels and determines the widest top level (level 0) entry. If the optional argument is omitted, all non-ignored glossaries are assumed.

+For example, to have the same name width for all glossaries:

\glsfindwidesttoplevelname
+\setglossarystyle{alttree}
+\printglossaries
+
Alternatively, to compute the widest entry for each glossary before it’s displayed:
\renewcommand{\glossarypreamble}{% 
+  \glsfindwidesttoplevelname[\currentglossary]}
+\setglossarystyle{alttree}
+\printglossaries
+

+

+These commands only affects the alttree styles, including those listed below and the ones in the glossary-mcols package.
+

+

+ The \glssetwidest command also affects the styles provided by glossary-topic. The glossaries-extra-stylemods package provides additional commands. With bib2gls, you may prefer the set-widest resource option.
+

+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 \makebox, created with:

+\glstreenamebox{width}{text}
+ where width is the width of the box (calculated from the widest name) and text is the contents of the box. For example, to make the name right-aligned:
\renewcommand*{\glstreenamebox}[2]{% 
+  \makebox[#1][r]{#2}% 
+}
+

+

+alttreegroup
+

+The alttreegroup is like the alttree style except that each group has a heading.

+

+alttreehypergroup
+

+The alttreehypergroup style is like alttreegroup but has a set of links to the glossary groups.

+ +

+ +
+

13.1.8. Multicols Style

+

+

+\usepackage{glossary-mcols}

+

load explicitly or with \usepackage[stylemods=mcols]{glossaries-extra}
+
+

+The glossary-mcols package provides tree-like glossary styles that are in the multicols environment (defined by the multicol package). The style names are as their analogous tree styles (as defined in §13.1.7) but are prefixed with “mcol”. For example, the mcolindex style is essentially the index style but put in a multicols environment. For the complete list, see Table 13.2. The glossary-tree package is automatically loaded by glossary-mcols (even if the notree package option is used when loading glossaries). The formatting commands \glstreenamefmt, \glstreegroupheaderfmt and \glstreenavigationfmt are all used by the corresponding glossary-mcols styles.

+Note that these styles will only be available if you explicitly load glossary-mcols:

\usepackage{glossaries}
+\usepackage{glossary-mcols}
+
Note that you can’t set these styles using the style package option since the styles aren’t defined until after the glossaries package has been loaded.

+With glossaries-extra, you can load both the package and style with the style and stylemods options. For example:

\usepackage[style=mcolindex,stylemods=mcols]{glossaries-extra}
+

+The default number of columns is 2, but can be changed by redefining:

+\glsmcolsinitial: 2
+ For example, for a three column glossary:
\usepackage{glossary-mcols}
+\renewcommand*{\glsmcols}{3}
+\setglossarystyle{mcolindex}
+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 9: Multicolumn Styles
glossary-mcols Style Analogous Tree Style
mcolindex index
mcolindexgroup indexgroup
mcolindexhypergroup or mcolindexspannav indexhypergroup
mcoltree tree
mcoltreegroup treegroup
mcoltreehypergroup or mcoltreespannav treehypergroup
mcoltreenoname treenoname
mcoltreenonamegroup treenonamegroup
mcoltreenonamehypergroup or mcoltreenonamespannav treenonamehypergroup
mcolalttree alttree
mcolalttreegroup alttreegroup
mcolalttreehypergroup or mcolalttreespannav alttreehypergroup
+

+The styles with a navigation line, such as mcoltreehypergroup, now have a variant (as from v4.22) with “hypergroup” replaced with “spannav” in the style name. The original “hypergroup” styles place the navigation line at the start of the first column. The newer “spannav” styles put the navigation line in the optional argument of the multicols environment so that it spans across all the columns.

+ +

+ +
+

13.1.9. In-Line Style

+

+

+\usepackage{glossary-inline}

+

load explicitly or with \usepackage[stylemods=inline]{glossaries-extra}
+
+

+This section covers the glossary-inline package that supplies the inline style. This is a glossary style that is designed for in-line use (as opposed to block styles, such as lists or tables). This style doesn’t display the number list.

+Note that this style will only be available if you explicitly load glossary-inline:

\usepackage{glossaries}
+\usepackage{glossary-inline}
+

+With glossaries-extra, you can load both the package and style with the style and stylemods options. For example:

\usepackage[style=inline,stylemods=inline]{glossaries-extra}
+

+You will most likely need to redefine \glossarysection with this style. For example, suppose you are required to have your glossaries and list of acronyms in a footnote, you can do:

\usepackage{glossary-inline}
+\renewcommand*{\glossarysection}[2][]{\textbf{#1}: }
+\setglossarystyle{inline}
+
Then where you need to include your glossaries as a footnote you can do:
\footnote{\printglossaries}
+

+

+inline
+ This is the only style provided by glossary-inline.

+The group skip command \glsgroupskip is defined to do nothing, regardless of the nogroupskip option. Likewise, \glsgroupheading is defined to do nothing. If you want to create a custom style base on the inline style that shows a heading, then add \glsinlinedopostchild to the definition of \glsgroupheading in case a group heading follows a child entry.

+

+Don’t redefine \glsinlinedopostchild. It’s provided as a user command to make it easier to add it to the start of a custom definition of \glossaryheader to enable group headings. If you need to adjust the content between a sub-entry and the next entry, redefine \glsinlinepostchild instead.
+

+The inline style is governed by the following commands.

+

+\glsinlineseparatorinitial: ;\space
+ This is used between top level (level 0) entries.

+

+\glsinlinesubseparatorinitial: ,\space
+ This is used between sub-entries.

+

+\glsinlineparentchildseparatorinitial: :\space
+ This is used between a top level (level 0) parent entry and its first sub-entry.

+

+\glspostinline
+ This is used at the end of the glossary. The default definition is:
\glspostdescription\space
+
This is the only place that the post-description hook is used in this style.

+

+\glsinlinenameformat{entry-label}{name}
+ This is used to create the target, where name is provided in the form \glossentryname{entry-label} and entry-label is the entry’s label. The default definition is:
\glstarget{entry-label}{name}
+

+For example, if you want the name to appear in small caps:

\renewcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{\textsc{#2}}}
+

+This style needs to know if an entry has any children. This test is performed with:

+\glsinlineifhaschildren{entry-label}{true}{false}
+ The default definition simply uses \ifglshaschildren, which is inefficient as it has to iterate through all entries (in the same glossary as entry-label) to determine which ones have the given entry as a parent. This can be time-consuming for large glossaries, but the assumption here is that an inline glossary is unlikely to be used with a large set of entries. However, if you are using bib2gls with the save-child-count resource option, it’s more efficient to use \GlsXtrIfHasNonZeroChildCount instead (particularly if you are using \printunsrtglossary with a filtered subset). For example:
\renewcommand{\glsinlineifhaschildren}[3]{% 
+ \GlsXtrIfHasNonZeroChildCount{#1}{#2}{#3}% 
+}
+

+Sub-entry names are formatted according to:

+\glsinlinesubnameformat{entry-label}{name}
+ which has the same syntax as \glsinlinenameformat but a different definition:
\glstarget{entry-label}{}
+
which means that the sub-entry name is ignored.

+If the description is empty or has been suppressed (according to \ifglshasdesc and \ifglsdescsuppressed, respectively) then:

+\glsinlineemptydescformat{symbol}{location list}
+ (which does nothing by default) is used, otherwise the description is formatted according to:
+\glsinlinedescformat{description}{symbol}{location list}
+ This defaults to just \spacedescription so the symbol and location list are ignored.

+For example, if you want a colon between the name and the description:

\renewcommand*{\glsinlinedescformat}[3]{: #1}
+

+The sub-entry description is formatted according to:

+\glsinlinesubdescformat{description}{symbol}{location list}
+ This defaults to just description.

+

+\glsinlinepostchild
+ This hook is used at the start of a top level (level 0) entry that immediate follows a sub-entry. It does nothing by default.

+ +

+ +
+

13.2. Defining your own glossary style

+

+The markup used in the glossary is described in §8.2. Commands that may be used by styles, but should not be redefined by styles, are described in §§13.2.1 & 13.2.2. The commands that should be redefined by the glossary style are described in §13.2.3.

+

+Commands like \printglossary are designed to produce content in the 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 indexing information (such as locations) then a much better approach is to use 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 makeindex or xindy then simply \input the indexing file instead of using \printglossary.
+

+If the predefined glossary styles don’t fit your requirements, you can define your own style using:

+\newglossarystyle{style-name}{definitions}
+ where style-name is the name of the new glossary style (to be used in the style option or \setglossarystyle). An existing style can be redefined with:
+\renewglossarystyle{style-name}{definitions}
+ In both cases, the second argument definitions needs to redefine all of the commands listed in §13.2.3.

+

+Bear in mind that parameters will need to be referenced with ## rather than .
+

+A style may inherit from an existing style by starting definitions with \setglossarystyle and then just redefine the commands that are different from the inherited style.

+For example, the indexgroup style is basically the same as the index style, except for the definition of \glsgroupheading, so the style is simply defined as:

\newglossarystyle{indexgroup}{% 
+ \setglossarystyle{index}% inherit index
+% alter the command that's different:
+ \renewcommand*{\glsgroupheading}[1]{% 
+   \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% 
+   \indexspace
+ }% 
+}
+

+ +

+ +
+

13.2.1. Commands For Use in Glossary Styles

+

+These commands are typically used in style definitions but should not be modified by the style. See §13.2.2 for hyperlinks to group headings.

+In order to support the entrycounter=option, a style needs to use:

+\glsentryitem{label}
+ at the place where the associated number should appear if the option is set. If entrycounter=true, \glsentryitem will do:
\glsstepentry{label}\glsentrycounterlabel
+
otherwise it will do \glsresetsubentrycounter (which ensures the sub-entry counter is reset if it has been enabled with subentrycounter).

+For example, the list style defines \glossentry as follows:

\renewcommand*{\glossentry}[2]{% 
+  \item[\glsentryitem{##1}% 
+      \glstarget{##1}{\glossentryname{##1}}]
+   \glossentrydesc{##1}\glspostdescription\space ##2}
+

+In order to support the subentrycounter=option, a style needs to use:

+\glssubentryitem{label}
+ at the place where the associated number should appear if the option is set. If subentrycounter=true, this will do:
\glsstepsubentry{label}\glssubentrycounterlabel
+
otherwise it does nothing. This will typically only be used with level 1 and omitted for deeper hierarchical levels.

+For example, the index style has:

\renewcommand{\subglossentry}[3]{% 
+  \ifcase##1    % level 0
+    \item
+  \or
+    % level 1
+    \subitem
+    \glssubentryitem{##2}% 
+  \else
+    % all other levels
+    \subsubitem
+  \fi
+  \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% 
+  \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% 
+  \glstreechildpredesc\glossentrydesc{##2}\glspostdescription\space ##3% 
+}
+
The test for level 0 is redundant in this case as \glossentry will be used for top level (level 0) entries, but is provided for completeness. Note that \glssubentryitem is only used for level 1.

+The style will typically also create the target to enable hyperlinks from an entry reference within the document (created with commands like \gls) to the entry line in the glossary.

+The target is created with:

+\glstarget{entry-label}{text}
+ If hyperlinks aren’t enabled, this simply does the second argument text, otherwise it will create a target with the name prefixentry-label, where the prefix is obtained by expanding:
+\glolinkprefixinitial: glo:
+ The glossaries-extra package has options, such as prefix, that can be used to override this.

+

+\glossentryname{entry-label}
+ This is used in glossary styles to display the name encapsulated with \glsnamefont. Unlike \glsentryname, this command will trigger a warning if the entry hasn’t been defined. The sentence case version is:
+\Glossentryname{entry-label}
+ Both commands internally use \glsnamefont so there’s no need to explicitly use that command in a style.

+

+ With glossaries-extra, the glossnamefont and glossname category attributes can be used to adjust font and, for \glossentryname, case-changing. If you just use \glsentryname, the style won’t be influenced by those attributes.
+

+

+\glossentrydesc{entry-label}
+ This is used in glossary styles to display the description. Unlike \glsentrydesc, this command will trigger a warning if the entry hasn’t been defined. The sentence case version is:
+\Glossentrydesc{entry-label}
+

+

+ With glossaries-extra the glossdescfont and glossdesc category attributes can be used to adjust font and, for \glossentrydesc, case-changing. If you just use \glsentrydesc, the style won’t be influenced by those attributes.
+

+

+\glossentrysymbol{entry-label}
+ This is used in glossary styles to display the symbol. Unlike \glsentrysymbol, this command will trigger a warning if the entry hasn’t been defined. The sentence case version is:
+\Glossentrysymbol{entry-label}
+

+

+ With glossaries-extra you can use the glosssymbolfont category attribute to adjust font. If you just use \glsentrysymbol, the style won’t be influenced by that attribute.
+

+glossary styles that support groups can obtain the group title with:

+\glsgetgrouptitle{group-label}
+ This gets the title associated with the group identified by group-label and displays it. The title is determined as follows: +
    +
  • if group-label is a single character or either glsnumbers or glssymbols and the command \group-labelgroupname exists, then that command is used as the title.

    +

  • otherwise the title is the same as the group label. +
+

+

+ The glossaries-extra package provides improved support for group titles, but redefines \glsgetgrouptitle to accommodate the enhanced features.
+

+ +

+ +
+

13.2.2. Hyper Group Navigation

+

+

+\usepackage{glossary-hypernav}

+

automatically loaded with \usepackage{glossaries}
+
+

+There is no need to load this package. It will automatically be loaded by glossaries. If hyperref hasn’t been loaded, these commands will still be available but simply won’t form hyperlinks or targets, so they can be used in glossary styles without any need to check for hyperlink support. (However, the result might look a bit strange if the reader expects the navigation text to be hyperlinks.)

+

+\glsnavhypertarget[glossary-label]{group-label}{group-title}
+ Creates a hyper target for a group. The glossary-label argument is the label that identifies the glossary. If omitted, \currentglossary is assumed. The group-label argument is the label that identifies the group. This additionally writes information to the aux file so that on the next LaTeX run, \glsnavigation will have a list of groups for the glossary.

+For example, the indexhypergroup includes a group target in the header:

\renewcommand*{\glsgroupheading}[1]{% 
+  \item\glstreegroupheaderfmt
+    {\glsnavhypertarget{#1}{\glsgetgrouptitle{#1}}}% 
+  \indexspace
+}
+

+

+\glsnavhyperlink[glossary-label]{group-label}{group-title}
+ Creates a hyperlink to the given group, where the target name is obtained from:
+\glsnavhyperlinkname[glossary-label]{group-label}
+ The glossary-label argument is the label that identifies the glossary. If omitted, \currentglossary is assumed. Typically, styles don’t need to explicitly use this command as they can use the following command instead.

+

+\glsnavigation
+ Displays a simple navigation list, where each item in the list has a hyperlink created with \glsnavhyperlink to a group, where the group title is obtained with \glsgetgrouptitle. The items are separated with:
+\glshypernavsep
+ The default definition is \space\textbar\space which creates a vertical bar with a space on either side.

+

+\glssymbolnav
+ Just produces a simple set of navigation links for the symbol and number groups and ends with the \glshypernavsep separator. Unlike \glsnavigation, there’s no check to determine if the glossary has those groups. This command is a historical artefact leftover from early versions. There should be little need for it now as \glsnavigation should include all the groups that are in the glossary.

+ +

+ +
+

13.2.3. Glossary Style Commands

+

+The commands listed in this section should all be redefined by every glossary style. However, a style may be based on another style, in which case the style definitions should start with \setglossarystyle and then only redefine the commands that should differ from the inherited style.

+Note that \printglossary sets \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.

+

+\begin{theglossary}content\end{theglossary}

+

+
+ The actual content of the glossary is placed inside the theglossary environment. For example, the list style redefines this to start and end the description environment:
\renewenvironment{theglossary}% 
+  {\glslistinit\begin{description}}{\end{description}}
+
Immediately after \begin{theglossary} comes the header:
+\glossaryheader

+

+
+ For example, the longheader style has:
\renewcommand*{\glossaryheader}{% 
+ \bfseries \entryname & \bfseries \descriptionname\tabularnewline\endhead}
+
(Note that this is not the same as the preamble which occurs before the start of the theglossary environment and is not part of the style.)

+The rest of the contents of the theglossary environment is divided into letter group blocks. Each block starts with the group heading:

+\glsgroupheading{group-label}

+

+
+ Note that the argument is a label that identifies the group. Some glossary styles redefine this command to do nothing, which means there’s no group title displayed. Others, such as glossary styles, will obtain the group title from the group-label and format the title to fit the style.

+

+The group-label is typically obtained by the indexing application, based on the sort value.
+

+With Options 1, 2 and 3, groups only related to top level (level 0) entries.

+

+ The glossaries-extra package additionally provides \glssubgroupheading to support sub-groups, which are only available with Options 4 and 5. Glossary styles should only include a redefinition of \glssubgroupheading if the style is specifically designed for use with glossaries-extra as the command won’t be available with just the base glossaries package. (A default definition will be provided if this command isn’t set with glossaries-extra.)
+

+After the group heading, each top level (level 0) entry line within the group is formatted with:

+\glossentry{entry-label}{number-list}

+

+
+ The first argument is the entry’s label. The second is the number list that was collated by the indexing application.

+The number-list argument may be empty or \relax, or may contain the number list encapsulated with \glossaryentrynumbers, possibly prefixed with a pre-number list hook. If number-list is an unbraced \relax, that typically indicates that Options 2 or 3 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 number-list argument is more likely to be a result of Options 1, 4 or 5, in which case nothing can be inferred about whether or not the entry was actually indexed.

+Each sub-entry line is formatted with:

+\subglossentry{level}{entry-label}{number-list}

+

+
+ where level is the hierarchical level. The other arguments are the same as for \glossentry. Some glossary styles redefine this command to simply use \glossentry, in which case the glossary will have a flat (no-hierarchy) appearance, but the indexing application will still take the hierarchy into account when ordering the entries.

+

+The glossary styles should redefine \glossentry and \subglossentry to fit the style, but they should not redefine the markup in number-list. If the style doesn’t support number lists, then the number-list argument should simply be ignored.
+

+The glossary styles will typically redefine \glossentry to use \glsentryitem to support the entrycounter option, \glstarget to create the hyperlink target, and will use \glossentryname to format the name.

+Similarly, \subglossentry will typically start with \glssubentryitem to support the subentrycounter option. Again \glstarget is needed to create the hyperlink target. The entry name may be displayed with \glossentryname or may be omitted to support homographs.

+Between each letter group block (that is, before all instances of \glsgroupheading except for the first one) is the group skip:

+\glsgroupskip

+

+
+ Some glossary styles redefine this to do nothing, but some may define it to create a vertical gap in order to visually separate the letter groups. Most of the predefined styles use the \ifglsnogroupskip conditional within this command to determine whether or not to add the gap.

+For example, the list style defines \glsgroupskip as follows:

\renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}
This has the conditional inside the definition of \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 long-booktabs style has:
\ifglsnogroupskip
+  \renewcommand*{\glsgroupskip}{}% 
+\else
+  \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% 
+\fi
+
This requires the conditional to be set before the style definitions are performed.

+

Example 34: Creating a completely new style

+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 glossary should be placed in the itemize environment, so theglossary should start and end that environment. Let’s also suppose that you don’t want anything between the glossary groups (so \glsgroupheading and \glsgroupskip should do nothing) and suppose you don’t want anything to appear immediately after \begin{theglossary} (so \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 number list should appear within square brackets at the end. Then you can create this new glossary style, called, say, mylist, as follows:

\newglossarystyle{mylist}{% 
+ % put the glossary in the itemize environment:
+ \renewenvironment{theglossary}% 
+   {\begin{itemize}}{\end{itemize}}% 
+ % no header after \begin{theglossary}
+ \renewcommand*{\glossaryheader}{}% 
+ % no visual distinction between glossary groups:
+ \renewcommand*{\glsgroupheading}[1]{}% 
+ \renewcommand*{\glsgroupskip}{}% 
+ % set how each entry should appear:
+ \renewcommand*{\glossentry}[2]{% 
+ \item % bullet point
+ \glstarget{##1}{\glossentryname{##1}}% the entry name
+ \space (\glossentrysymbol{##1})% the symbol in brackets
+ \space \glossentrydesc{##1}% the description
+ \space [##2]% the number list in square brackets
+ }% 
+ % set how sub-entries appear:
+ \renewcommand*{\subglossentry}[3]{% 
+   \glossentry{##2}{##3}}% 
+ }
+
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 \glsentryitem or \glssubentryitem so it won’t be affected by the entrycounter, counterwithin or subentrycounter package options.

+Variations: +

+

+

Example 35: Creating a new glossary style based on an existing style

+If you want to define a new style that is a slightly modified version of an existing style, you can use \setglossarystyle within the second argument of \newglossarystyle followed by whatever alterations you require. For example, suppose you want a style like the list style but you don’t want the extra vertical space created by \indexspace between groups, then you can create a new glossary style called, say, mylist as follows:

\newglossarystyle{mylist}{% 
+ \setglossarystyle{list}% base this style on the list style
+ % make nothing happen between groups:
+ \renewcommand{\glsgroupskip}{}%  
+}
+
(In this case, you can actually achieve the same effect using the list style in combination with the package option nogroupskip.)

+

Example 36: Example: creating a glossary style that uses the user1, …, user6 keys

+Suppose each entry not only has an associated symbol, but also units (stored in user1) and dimension (stored in user2). Then you can define a glossary style that displays each entry in a longtable as follows:

\newglossarystyle{long6col}{% 
+ % put the glossary in a longtable environment:
+ \renewenvironment{theglossary}% 
+  {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}% 
+  {\end{longtable}}% 
+ % Set the table's header:
+ \renewcommand*{\glossaryheader}{% 
+  \bfseries Term & \bfseries Description & \bfseries Symbol &
+  \bfseries Units & \bfseries Dimensions & \bfseries Page List
+  \\\endhead}% 
+ % No heading between groups:
+  \renewcommand*{\glsgroupheading}[1]{}% 
+ % top level (level 0) entries displayed in a row optionally numbered:
+ \renewcommand*{\glossentry}[2]{% 
+   \glsentryitem{##1}% Entry number if required
+   \glstarget{##1}{\glossentryname{##1}}% Name
+   & \glossentrydesc{##1}% Description
+   & \glossentrysymbol{##1}% Symbol
+   & \glsentryuseri{##1}% Units
+   & \glsentryuserii{##1}% Dimensions
+   & ##2% Page list
+   \tabularnewline % end of row
+ }% 
+ % Similarly for sub-entries (no sub-entry numbers)
+ \renewcommand*{\subglossentry}[3]{% 
+    % ignoring first argument (sub-level)
+    \glstarget{##2}{\glossentryname{##2}}% Name
+    & \glossentrydesc{##2}% Description
+    & \glossentrysymbol{##2}% Symbol
+    & \glsentryuseri{##2}% Units
+    & \glsentryuserii{##2}% Dimensions
+    & ##3% Page list
+    \tabularnewline % end of row
+ }% 
+ % Nothing between groups:
+ \renewcommand*{\glsgroupskip}{}% 
+}
+

+ +

+ +
+

14. Xindy (Option 3)

+

+If you want to use xindy to sort the glossary, you must use the package option xindy:

\usepackage[xindy]{glossaries}
+
This ensures that the information is written to the indexing files using xindy’s raw syntax.

1.6 covers how to use the external indexing application, and §12.3 covers the issues involved in the location syntax. This section covers the commands provided by the glossaries package that allow you to adjust the xindy style file (xdy) and parameters.

+To assist writing information to the xindy style file, the glossaries package provides the following commands:

+\glsopenbrace
+ which expands to (a literal open brace) and
+\glsclosebrace
+ which expands to (a literal closing brace). This is needed because \{ and \} don’t expand to a simple brace character when written to a file.

+

+\glspercentchar
+ Expands to (a literal percent).

+

+\glstildechar
+ Expands to ~ (a literal tilde).

+For example, a newline character is specified in a xindy style file using ~n so you can use \glstildechar n to write this correctly (or you can do \string~ (literal)n).

+

+\glsbackslash
+ Expands to \ (a literal tilde).

+In addition, if you are using a package that makes " (double-quote) active you can use:

+\glsquote{text}
+ which will produce "text", where " is a literal character. Alternatively, you can use \string" to write the double-quote character. This document assumes that the double quote character has not been made active, so the examples just use " for clarity.

+If you want greater control over the xindy style file than is available through the LaTeX commands provided by the glossaries package, you will need to edit the xindy style file. In which case, you must use \noist to prevent the style file from being overwritten by \makeglossaries package. For additional information about xindy, read the xindy documentation. I’m sorry I can’t provide any assistance with writing xindy style files. If you need help, I recommend you ask on the xindy mailing list.

+ +

+ +
+

14.1. Required Styles

+

+The xdy file created by \makeglossaries starts with identifying the required styles. By default, the tex style is automatically added, so the xdy file should contain:

; required styles
+   
+(require "tex.xdy")
+
Any additional styles can be identified in the preamble (before \makeglossaries) with:
+\GlsAddXdyStyle{style-name}

+

+
+ 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 tex.xdy) with:
+\GlsSetXdyStyles{style name list}

+

+
+ The argument should be a comma-separated list where, again, you need to make sure there are no spurious spaces.

+ +

+ +
+

14.2. Language and Encodings

+

+

+The commands in this section are only relevant if you use makeglossaries or automake. If you are calling xindy explicitly you need to set the -L and -C switches appropriately.
+

+When you use xindy, you need to specify the language and encoding used (unless you have written your own custom xindy style file that defines the relevant alphabet and sort rules). If you use makeglossaries, this information is obtained from the document’s auxiliary (aux) file. The makeglossaries script attempts to find the xindy language name given your document settings, which may not match the babel or polyglossia name, using set of known mappings.

+

+Language mappings aren’t supported with makeglossaries-lite or automake.
+

+The default is to use \languagename. The information is written to the aux file at the start of \printglossary, which means that it should match the language in the document at that point.

+In the event that makeglossaries gets the language name wrong or if xindy doesn’t support that language, then you can specify the required language using:

+\GlsSetXdyLanguage[glossary-type]{language}

+

+
+ where language is the name of the language. The optional argument can be used if you have multiple glossaries in different languages. If glossary type is omitted, \glsdefaulttype is assumed. If a language hasn’t been set for a particular glossary then the language will be as for the default glossary.

+

+The xindy codepage may not simply be the file encoding but may also include sorting rules.
+

+The default codepage will be obtained from the value of \inputencodingname. If that command isn’t defined or is empty, utf8 is assumed. As with \languagename, the input encoding name obtained with \inputencodingname may not match the xindy codepage name, which may include additional information, such as ij-as-ij (with Dutch) or din5007 (with German).

+Again, makeglossaries will try to adjust the codepage for known cases, but it may get it wrong. Neither makeglossaries-lite nor the automake option will make those adjustments.

+If the default is incorrect, you can specify the correct codepage using:

+\GlsSetXdyCodePage{codepage}

+

+
+ where code-page is the name of the codepage. Note there’s only one codepage for all glossaries as it’s rare to switch encoding mid-document. For example:
\GlsSetXdyLanguage{dutch}
+\GlsSetXdyCodePage{ij-as-y-utf8}
+
This can also be implemented as a package option:
\usepackage[xindy=language=dutch,codepage=ij-as-y-utf8]{glossaries}
+

+In the event that you want one glossary sorted with ij-as-y and another with ij-as-ij you will need to call xindy explicitly for each glossary.

+

+Some xindy modules only support one encoding for a particular language. For example, the Latin language module only supports UTF-8
+

+If you write your own custom xindy style file that includes the language settings, you need to set the language to nothing:

\GlsSetXdyLanguage{}
+
(and remember to use \noist to prevent the style file from being overwritten).

+ +

+ +
+

14.3. Locations and Number lists

+

+If you use xindy, the glossaries package needs to know which counters you will be using in the number list in order to correctly format the xindy style file. Counters specified using the counter package option or the counter option of \newglossary are automatically taken care of, but if you plan to use a different counter in the counter key for the \gls-like or \glstext-like commands, then you need to identify these counters before \makeglossaries using:

+\GlsAddXdyCounters{counter list}

+

+
+ where counter list is a comma-separated list of counter names.

+Xindy attributes normally correspond to the encap when using the standard \index command where the locations are all page numbers, but the glossaries package needs to incorporate the location counter as well. For example, if the hyperbf encap is used with the section counter, then the xindy attribute will be sectionhyperbf. This is in contrast to using makeindex, where the counter is incorporated in the encap with \setentrycounter.

+The most likely xindy attributes (such as pagehyperbf) are automatically added to the xdy style file, but if you want to use another encap, you need to add it with:

+\GlsAddXdyAttribute{name}

+

+
+ where name is the name of the encap, as used in the format key.

+Note that \GlsAddXdyAttribute will define commands in the form:

+\glsXcounterXformat{H-prefix}{location}

+

+
+ where counter is the location counter and format is the encap (identified by the name argument of \GlsAddXdyAttribute).

+This command is provided for each counter that has been identified either by the counter package option, the counter option for \newglossary or in the argument of \GlsAddXdyCounters. Each command has a definition in the form:

\setentrycounter[H-prefix]{counter}\format{location}
+
This ensures that, if required, location hyperlinks can be supported.

+

+The \glsXcounterXformat commands may need redefining for unusual locations where the default definition won’t work with hyperlinks (see Example 39).
+

+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 attributes are listed. Consider defining semantic commands to use for primary references. For example:

\newcommand*{\primary}[1]{\hyperbf{1}}
+\GlsAddXdyAttribute{primary}
+
Then in the document:
A \gls[format=primary]{duck} is an aquatic bird.
+There are lots of different types of \gls{duck}.
+
This will give the format=primary instance preference over the next use that doesn’t use the format key.

+

Example 37: Custom Font for Displaying a Location
Suppose I want a bold, italic, hyperlinked location. I first need to define a command that will do this:
\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{1}}}
+
but with xindy, I also need to add this as an allowed attribute:
\GlsAddXdyAttribute{hyperbfit}
+
Now I can use it in the optional argument of commands like \gls:
Here is a \gls[formathyperbfit]{sample} entry.
+
(where “sample” is the label of the required entry).

+

+Note that \GlsAddXdyAttribute has no effect if \noist is used or if \makeglossaries is omitted. \GlsAddXdyAttribute must be used before \makeglossaries. Additionally, \GlsAddXdyCounters must come before \GlsAddXdyAttribute.
+

+If the locations include robust or protected formatting commands, then you need to add a location style using the appropriate xindy syntax using:

+\GlsAddXdyLocation[H-prefix]{name}{definition}

+

+
+ where name is the name of the location style and definition is the xindy definition. The optional argument H-prefix is needed if \theHcounter either isn’t defined or is different from \thecounter. Be sure to also read §12.3 for some issues that you may encounter.

+

+Note that \GlsAddXdyLocation has no effect if \noist is used or if \makeglossaries is omitted. \GlsAddXdyLocation must be used before \makeglossaries.
+

+

Example 38: Custom Numbering System for Locations
Suppose I decide to use a somewhat eccentric numbering system for sections where I redefine \thesection as follows:
\renewcommand*{\thesection}{[\thechapter]\arabic{section}}
+
If I haven’t used the package option counter=section, then I need to specify that the section counter will be used as a location counter:
\GlsAddXdyCounters{section}
+
Next I need to add the location syntax:
\GlsAddXdyLocation{section}{:sep "[" "arabic-numbers" :sep "]"
+  "arabic-numbers"
+}
+
This assumes that \thechapter is defined as \arabic{chapter}.

+Note that if I have further decided to use the hyperref package and want to redefine \theHsection as:

\renewcommand*{\theHsection}{\thepart.\thesection}
+\renewcommand*{\thepart}{\Roman{part}}
+
then I need to modify the \GlsAddXdyLocation code above to:
\GlsAddXdyLocation["roman-numbers-uppercase"]{section}{:sep "[" 
+  "arabic-numbers" :sep "]" "arabic-numbers"
+}
+
Since \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:
\GlsAddXdyLocation{zero.section}{:sep "[" 
+  "arabic-numbers" :sep "]" "arabic-numbers"
+}
+
This example is illustrated in the sample file samplexdy2.tex.

+

Example 39: Locations as Dice
This example will cause xindy special characters to appear in the location, which means that location escaping will need to be enabled:
\usepackage[xindy,esclocations]{glossaries}
+\glswrallowprimitivemodstrue
+

+Suppose I want a rather eccentric page numbering system that’s represented by the number of dots on dice. The stix package provides \dicei, …, \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 \dicen command is used otherwise it does \dicevi the required number of times with the leftover in a final \dicen. For example, the number 16 is represented by \dicevi\dicevi\diceiv (\(6+6+4=16\)). I’ve called this command \tallynum to match the example given earlier in §12.3:

\newrobustcmd{\tallynum}[1]{% 
+ \ifnum\number1<7
+  $\csname dice\romannumeral1\endcsname$% 
+ \else
+  $\dicevi$% 
+  \expandafter\tallynum\expandafter{\numexpr1-6}% 
+ \fi
+}
+
Here’s the counter command:
\newcommand{\tally}[1]{\tallynum{\arabic{1}}}
+
The page counter representation (\thepage) needs to be changed to use this command:
\renewcommand*{\thepage}{\tally{page}}
+
The \tally command expands to \tallynum {number} so this needs a location class that exactly matches this format:
\GlsAddXdyLocation{tally}{% 
+ :sep "\string\tallynum\space\glsopenbrace"
+ "arabic-numbers"
+ :sep "\glsclosebrace"
+}
+
The space between \tallynum and {number} is significant to xindy so \space is required.

+The sample file samplexdy.tex, which comes with the glossaries package, uses the default page counter for locations, and it uses the default \glsnumberformat and a custom \hyperbfit format. A new xindy location called “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 \glsXcounterXformat commands:

\renewcommand{\glsXpageXglsnumberformat}[2]{% 
+ \linkpagenumber2% 
+}
+
+\renewcommand{\glsXpageXhyperbfit}[2]{% 
+ \textbf{\em\linkpagenumber2}% 
+}
+
+\newcommand{\linkpagenumber}[2]{\hyperlink{page.2}{1{2}}}
+
Note that the second argument of \glsXpageXglsnumberformat is in the form \tallynum{number} so the line
\linkpagenumber2% 
+
does
\linkpagenumber\tallynum{number}
+
so \tallynum is the first argument of \linkpagenumber and number is the second argument.

+

+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.
+

+

Example 40: Locations as Words not Digits
This example will cause xindy special characters to appear in the location, which means that location escaping will need to be enabled:
\usepackage[xindy,esclocations]{glossaries}
+\glswrallowprimitivemodstrue
+

+Suppose I want the page numbers written as words rather than digits and I use the fmtcount package to do this. I can redefine \thepage as follows:

\renewcommand*{\thepage}{\Numberstring{page}}
+
This used to get expanded to
\protect \Numberstringnum {n}
+
where n is the Arabic page number. This means that I needed to define a new location with the form:
\GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space
+  \string\Numberstringnum\space\glsopenbrace"
+  "arabic-numbers" :sep "\glsclosebrace"}
+
and if I’d used the \linkpagenumber command from the previous example, it would need three arguments (the first being \protect):
\newcommand{\linkpagenumber}[3]{\hyperlink{page.3}{12{3}}}
+

+The internal definition of \Numberstring has since changed so that it now expands to

\Numberstringnum {n}
+
(no \protect). This means that the location class definition must be changed to:
\GlsAddXdyLocation{Numberstring}{% no \protect now!
+  :sep "\string\Numberstringnum\space\glsopenbrace"
+  "arabic-numbers" :sep "\glsclosebrace"}
+
and \linkpagenumber goes back to only two arguments:
\newcommand{\linkpagenumber}[2]{\hyperlink{page.2}{1{2}}}
+
The other change is that \Numberstring uses
\the\value{counter}
+
instead of
\expandafter\the\csname c@counter\endcsname
+
so it hides \c@page from the location escaping mechanism (see §12.3). This means that the page number may be incorrect if the indexing occurs during the output routine.

+A more recent change to fmtcount (v3.03) now puts three instances of \expandafter before \the\value which no longer hides \c@page from the location escaping mechanism, so the page numbers should once more be correct. Further changes to the fmtcount package may cause a problem again.

+

+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.
+

+Instead of directly using \Numberstring in the definition of \thepage, I can provide a custom command in the same form as the earlier \tally command:

\newcommand{\customfmt}[1]{\customfmtnum{\arabic{1}}}
+\newrobustcmd{\customfmtnum}[1]{\Numberstringnum{1}}
+
This ensures that the location will always be written to the indexing file in the form:
:locref "\glsopenbrace\glsclosebrace\glsopenbrace\string\\customfmtnum {n}\glsclosebrace"
+
So the location class can be defined as:
\GlsAddXdyLocation{customfmt}{
+ :sep "\string\customfmtnum\space\glsopenbrace"
+ "arabic-numbers" 
+ :sep "\glsclosebrace"}
+

+The sample file samplexdy3.tex illustrates this.

+In the number list, the locations are sorted according to the list of provided location classes. The default ordering is: +

    +
  1. 1.roman-page-numbers (i, ii, …);
  2. 2.arabic-page-numbers (1, 2, …);
  3. 3.arabic-section-numbers (for example, 1.1 if the compositor is a full stop or 1-1 if the compositor is a hyphen);
  4. 4.alpha-page-numbers (a, b, …);
  5. 5.Roman-page-numbers (I, II, …);
  6. 6.Alpha-page-numbers (A, B, …);
  7. 7.Appendix-page-numbers (for example, A.1 if the Alpha compositor, see \glsSetAlphaCompositor, is a full stop or A-1 if the Alpha compositor is a hyphen);
  8. 8.user defined location names (as specified by \GlsAddXdyLocation in the order in which they were defined);
  9. 9.see (cross-referenced entries). +
+

+

+ With glossaries-extra seealso is appended to the end of the list.
+

+This ordering can be changed using:

+\GlsSetXdyLocationClassOrder{location names}

+

+
+ where each location name is delimited by double quote marks and separated by white space. For example:
\GlsSetXdyLocationClassOrder{
+  "arabic-page-numbers"
+  "arabic-section-numbers"
+  "roman-page-numbers"
+  "Roman-page-numbers"
+  "alpha-page-numbers"
+  "Alpha-page-numbers"
+  "Appendix-page-numbers"
+  "see"
+}
+
(Remember to add "seealso" if you’re using glossaries-extra.)

+

+Note that \GlsSetXdyLocationClassOrder has no effect if \noist is used or if \makeglossaries is omitted. \GlsSetXdyLocationClassOrder must be used before \makeglossaries.
+

+If a number list 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:

+\GlsSetXdyMinRangeLength{value}

+

+
+ The value may be the keyword none, to indicate no range formation, or a number. For example:
\GlsSetXdyMinRangeLength{3}
+
See the xindy manual for further details on range formations.

+

+Note that \GlsSetXdyMinRangeLength has no effect if \noist is used or if \makeglossaries is omitted. \GlsSetXdyMinRangeLength must be used before \makeglossaries.
+ See also §12.2.

+ +

+ +
+

14.4. Glossary Groups

+

+The glossary is divided into groups according to the first letter of the sort key. The glossaries package also adds a number group by default, unless you suppress it in the xindy package option. For example:

\usepackage[xindy=glsnumbers=false]{glossaries}
+
Any entry that doesn’t go in one of the letter groups or the number group is placed in the default group. If you want xindy to sort the number group numerically (rather than by a string sort) then you need to use xindy’s numeric-sort module:
\GlsAddXdyStyle{numeric-sort}
+

+With the default glsnumbers=true, the number group will be placed before the “A” letter group. This is done in the define-letter-group block in the xdy file:

(define-letter-group "glsnumbers"
+   :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
+   :before "A")
+

+If you are not using a Roman alphabet, you need to change this with:

+\GlsSetXdyFirstLetterAfterDigits{letter}modifier: *

+

+
+{letter} where letter is the first letter of your alphabet. This will change :before "A" to :before "letter".

+A starred version of this command was added to v4.33 which sanitized letter before writing it to the xdy file to protect it from expansion with inputenc. This shouldn’t be necessary with recent LaTeX kernels.

+Alternatively you can use:

+\GlsSetXdyNumberGroupOrder{relative location}modifier: *

+

+
+ This will change :before "A" to relative location. Again, a starred version was provided to sanitize the argument, which should no longer be necessary unless " (double-quote) is active.

+For example:

\GlsSetXdyNumberGroupOrder{:after "Z"}
+
will put the number group after the “Z” letter group.

+

+Note that these commands have no effect if \noist is used or if \makeglossaries is omitted. \GlsSetXdyFirstLetterAfterDigits must be used before \makeglossaries.
+

+

+ +

+ +
+

15. Utilities

+

+This section describes the utility commands provided with the base glossaries package.

+

+ The glossaries-extra package provides extra utility commands, such as \glsxtrusefield and \glsxtrfieldformatlist. See the glossaries-extra manual for further details.
+

+ +

+ +
+

15.1. hyperref

+

+The hyperref package needs to be loaded before glossaries to ensure that the commands provided by hyperref are only used if they have been defined.

+

+\glsdisablehyper
+ This disables the creation of hyperlinks and targets by commands such as \glshyperlink, the \gls-like and \glstext-like commands and \glstarget. This setting is the default if hyperref hasn’t been loaded.

+The commands that normally create a hyperlink will use:

+\glsdonohyperlink{target}{text}
+

+The internal command used by \glstarget to create a target is just set to \@secondoftwo.

+

+\glsenablehyper

+

+
+ This enables the creation of hyperlinks and targets, and is the default if hyperref has been loaded.

+The internal command used by \glstarget to create a target is set to:

+\glsdohypertarget{target}{text}
+ This will include the debugging information if debug=showtargets has been used, but also measures the height of text so that it can place the actual target at the top of text rather than along the baseline. This helps to prevent text from scrolling off the top of the page out of sight.

+The corresponding command that’s used to link to this target is:

+\glsdohyperlink{target}{text}
+ This includes the debugging information, if applicable, and creates a link with \hyperlink.

+

+\glstexorpdfstring{TeX}{PDF}
+ If you’re not sure whether or not the hyperref package will be loaded, this command will use \texorpdfstring if that command has been defined, otherwise it will simply expand to TeX.

+ +

+ +
+

15.2. Case-Changing

+

+These commands may be used to perform a case change.

+

+Ensure you have at least mfirstuc v2.08 installed to take advantage of improved case-changing. If you also use glossaries-extra, make sure you have at least v1.49. See the mfirstuc manual for further details.
+

+

+\glsuppercase{text}
+

+An expandable command that converts text to uppercase (all caps). This is used by commands such as \GLS and \GLStext and is affected by \glsmfuexcl.

+

+\glslowercase{text}
+

+An expandable command that converts text to lowercase. This isn’t used by the glossaries package, but you may find it useful with acronym or abbreviation font commands for small caps styles. This command is affected by \glsmfuexcl.

+

+\MFUsentencecase{text}
+

+This command is used by sentence case commands, such as \Glsentrytext, when expanding in a PDF bookmark.

+This command is actually defined by mfirstuc v2.08+, but if an old version of mfirstuc is installed, the glossaries package will provide the same command. This command is affected by \glsmfuexcl.

+

+\glssentencecase{text}
+

+Converts text to sentence case. This is used by commands such as \Gls and \Glstext, and also by commands like \Glsentrytext in the document text.

+The default definition is to use the robust \makefirstuc provided by the mfirstuc package. If you need an expandable command, use \MFUsentencecase instead.

+Note that \makefirstuc internally uses \glsmakefirstuc, which is provided by mfirstuc. The default definition is:

\newcommand*{\glsmakefirstuc}[1]{\MFUsentencecase{\unexpanded{1}}}
+
The mfirstuc=expanded package option will redefine this command without \unexpanded.

+The reason for the use of \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 \MFUsentencecase expands its argument before applying the case change. With previous versions of mfirstuc, \glsmakefirstuc would simply apply the case change to the first token.

+Suppose a document created with mfirstuc v2.07 had something like:

\newglossaryentry{sample}{
+  name={sample},
+  description={an example with a \fragilecommand}
+}
+
and a glossary style is used that performs automated sentence-casing for the description (for example, with the topic style, provided by glossaries-extra), then this would essentially do:
\makefirstuc{an example with a \fragilecommand}
+
With old versions of mfirstuc, this would simply end up as:
\MakeTextUppercasean example with a \fragilecommand
+
so the fragile command is unaffected.

+However, with mfirstuc v2.08 and mfirstuc=expanded this would end up as:

\MFUsentencecasean example with a \fragilecommand
+
and the underlying \text_titlecase_first:n will expand the entire argument, which will break the fragile command.

+The use of \unexpanded prevents this from happening, but if you don’t have fragile commands and you want the content to be expanded, then use mfirstuc=expanded.

+

+\glscapitalisewords{content}
+

+Converts text to title case. The default definition is to use the robust \capitalisewords provided by mfirstuc. You may need to redefine this command to use \capitalisefmtwords instead.

+

+\glsmfuexcl{cs}
+

+This uses \MFUexcl with mfirstuc v2.08+, otherwise its defined in the same way (so it won’t affect \makefirstuc but will affect commands like \glsuppercase).

+

+\glsmfublocker{cs}
+

+This uses \MFUblocker with mfirstuc v2.08+, otherwise it simply uses \glsmfuexcl.

+

+\glsmfuaddmap{cs1}{cs2}
+

+This uses \MFUaddmap with mfirstuc v2.08+, otherwise it simply does

\glsmfuexcl{cs}
+\glsmfublocker{Cs}
+

+This uses \MFUblocker if defined, otherwise it simply uses \glsmfuexcl.

+ +

+ +
+

15.3. Loops

+

+

+Some of the commands described here take a comma-separated list as an argument. As with LaTeX’s \@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 §2.7.2 of “LaTeX for Administrative Work”.)
+

+

+\forallglossaries[types]{cs}{body}
+ This iterates through types, a comma-separated list of glossary labels (as supplied when the glossary was defined). At each iteration the command cs is defined to the glossary label for the current iteration and body is performed. If types is omitted, the default is to iterate over all non-ignored glossaries.

+

+\forallacronyms{cs}{body}

+

+
+ This is like \forallglossaries but only iterates over the lists of acronyms (that have previously been declared using \DeclareAcronymList or the 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 \forallglossaries.

+

+ The glossaries-extra package provides an analogous command \forallabbreviationlists.
+

+

+\forglsentries[type]{cs}{body}
+ This iterates through all entries in the glossary given by type. At each iteration the command cs is defined to the entry label for the current iteration and body is performed. If type is omitted, \glsdefaulttype is used.

+

+\forallglsentries[types]{cs}{body}
+ This is just a nested loop that essentially does:
\forallglossaries[types]{type-cs}{% outer loop   \forglsentries[type-cs]{cs}{body}% inner loop }
+
If types is omitted, the default is the list of all non-ignored glossaries. (The current glossary label can be obtained using \glsentrytype{cs} within body.)

+

+ The glossaries-extra package provides commands like \glsxtrforcsvfield to iterate over any fields that contain comma-separated lists.
+

+ +

+ +
+

15.4. Conditionals

+

+

+ The glossaries-extra package provides many more conditional commands.
+

+

+\ifglossaryexists{glossary-type}{true}{false}modifier: *
+

+This checks if the glossary given by glossary-type exists (that is, if it has been defined). If it does exist true part is performed, otherwise false part.

+The unstarred form will treat ignored glossaries as non-existent. The starred form will consider them as existing. So both forms will do true if glossary-type was defined by \newglossary, but only the starred form will do true if glossary-type was defined with \newignoredglossary.

+For example, given:

\newignoredglossary{common}
+
then
\ifglossaryexists{common}{true}{false}
+\ifglossaryexists*{common}{true}{false}
+
will produce “false true”.

+

+\ifglsentryexists{entry-label}{true}{false}
+

+This checks if the glossary entry given by entry-label exists. If it does exist then true is performed, otherwise this does false. Simply uses etoolbox’s \ifcsundef so can expand.

+

+\glsdoifexists{entry-label}{code}
+ Does code if the entry given by entry-label exists. If it doesn’t exist, an undefined error is generated.

+

+\glsdoifnoexists{entry-label}{code}
+ Does code if the entry given by entry-label doesn’t exist. If it does exist, an already defined error is generated.

+

+\glsdoifexistsorwarn{entry-label}{code}
+ As \glsdoifexists but issues a warning rather than an error if the entry doesn’t exist.

+

+\glsdoifexistsordo{entry-label}{true}{false}
+ Does code if the entry given by entry-label exists otherwise it generates an undefined error and does else code.

+

+ The undefined/already defined errors can be converted to warnings with undefaction=warn.
+

+

+\ifglsused{entry-label}{true}{false}
+

+Tests the entry’s first use flag. If the entry has been used, true will be done, otherwise (if the entry has been defined) false will be done. If the entry isn’t defined, then an undefined error will occur and neither true nor false will be done (see §7).

+This means that \ifglsused is unreliable with bib2gls as no entries are defined on the first LaTeX run, which means there’s no way of determining if it has been used, so glossaries-extra provides a similar command:

+\GlsXtrIfUnusedOrUndefined{entry-label}{true}{false}
+ In this case, true will be done if the entry hasn’t been used or hasn’t been defined, which is essentially the logical negation of \ifglsused for defined entries.

+

+Some of the following \ifglshasxxx commands use \glsdoifexists. In those cases, the true or false parts are only performed if the entry exists. Neither are done if the entry doesn’t exist.
+

+

+\ifglshaschildren{entry-label}{true}{false}
+

+This does true if any entries in the same glossary as entry-label had parent={entry-label}. This is inefficient and time-consuming if there are a large number of entries defined. Uses \glsdoifexists.

+

+ If you use bib2gls, a more efficient method is to use the save-child-count resource option and test the value of the childcount field with \GlsXtrIfHasNonZeroChildCount.
+

+

+\ifglshasparent{entry-label}{true}{false}
+

+This does true if the parent field is non-empty for the entry identified by entry-label. Uses \glsdoifexists.

+

+\ifglshassymbol{entry-label}{true}{false}
+

+A robust command that does true if the symbol field is non-empty and not \relax for the entry identified by entry-label.

+

+\ifglshaslong{entry-label}{true}{false}
+

+A robust command that does true if the long field is non-empty and not \relax for the entry identified by entry-label.

+

+\ifglshasshort{entry-label}{true}{false}
+

+A robust command that does true if the short field is non-empty and not \relax for the entry identified by entry-label.

+

+\ifglshasdesc{entry-label}{true}{false}
+

+Expands to true if the description is empty for the entry identified by entry-label, otherwise expands to false. Compare with:

+\ifglsdescsuppressed{entry-label}{true}{false}
+ This expands to true if description={\nopostdesc} for the entry identified by entry-label otherwise expands to false.

+There are also commands available for arbitrary fields. Some may allow the field to be identified by its corresponding key (such as description) but some require the internal field label (such as desc). See Table 4.1 for the internal field labels that correspond to each key. If you provide your own keys, for example with \glsaddkey, then the internal label will be the same as the key.

+

+\ifglsfieldvoid{field-label}{entry-label}{true}{false}
+ Expands to true if the field identified by its internal field label field-label is void for the entry identified by entry-label, otherwise it expands to false. The void test is performed with etoolbox’s \ifcsvoid. This means that an undefined field or an undefined entry will be considered void. An empty field value or a field set to \relax are also considered void.

+

+\ifglshasfield{field}{entry-label}{true}{false}

+

+
+

+This robust command tests the value of the field given by field for the entry identified by entry-label. The field argument may either be the key associated with the field or the internal field label.

+If the field value is empty or \relax, then false is performed, otherwise true is performed. If the field supplied is unrecognised false part is performed and a warning is issued. If the entry is undefined, an undefined error occurs.

+Within true, you can access the field’s value with:

+\glscurrentfieldvalue
+ This command is initially defined to empty but has no relevance outside of the true argument. This saves re-accessing the field if the test is true. For example:
\ifglshasfield{useri}{sample}{, \glscurrentfieldvalue}{}
+
will insert a comma, space and the field value if the user1 key has been set for the entry whose label is “sample”.

+

+\ifglsfieldeq{entry-label}{field-label}{string}{true}{false}
+ This robust command does true if the entry identified by entry-label has the field identified by its internal field label (not the key) field-label defined and set to the given string. The test is performed by etoolbox’s \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 §4.4). For example:

\documentclass{article}
+
+\usepackage{glossaries}
+
+\newcommand*{\foo}{FOO}
+
+\newglossaryentry{sample1}{name={sample1},description={an example},
+user1={FOO}}
+\newglossaryentry{sample2}{name={sample2},description={an example},
+user1={\foo}}
+\begin{document}
+\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}.
+
+\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}.
+\end{document}
+
This will produce “TRUE” in both cases since expansion is on for the user1 key, so \foo was expanded to “FOO” when “sample2” was defined. If the tests are changed to:
\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
+
+\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
+
then this will produce “FALSE” in both cases. Now suppose expansion is switched off for the user1 key:
\documentclass{article}
+
+\usepackage{glossaries}
+
+\newcommand*{\foo}{FOO}
+
+\glssetnoexpandfield{useri}
+
+\newglossaryentry{sample1}{name={sample1},description={an example},
+user1={FOO}}
+\newglossaryentry{sample2}{name={sample2},description={an example},
+user1={\foo}}
+\begin{document}
+\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}.
+
+\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}.
+\end{document}
+
This now produces “TRUE” for the first case (comparing “FOO” with “FOO”) and “FALSE” for the second case (comparing \foo with “FOO”).

+The reverse happens in the following:

\documentclass{article}
+
+\usepackage{glossaries}
+
+\newcommand*{\foo}{FOO}
+
+\glssetnoexpandfield{useri}
+
+\newglossaryentry{sample1}{name={sample1},description={an example},
+user1={FOO}}
+\newglossaryentry{sample2}{name={sample2},description={an example},
+user1={\foo}}
+\begin{document}
+\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
+
+\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
+\end{document}
+
This now produces “FALSE” for the first case (comparing “FOO” with \foo) and “TRUE” for the second case (comparing \foo with \foo).

+You can test if the value of a field is equal to the replacement text of a command using:

+\ifglsfielddefeq{entry-label}{field-label}{cs}{true}{false}
+ This robust command is essentially like \ifglsfieldeq but internally uses etoolbox’s \ifdefstrequal command to perform the comparison. The argument cs argument must be a macro.

+For example:

\documentclass{article}
+
+\usepackage{glossaries}
+
+\newcommand*{\foo}{FOO}
+
+\glssetnoexpandfield{useri}
+
+\newglossaryentry{sample1}{name={sample1},description={an example},
+user1={FOO}}
+\newglossaryentry{sample2}{name={sample2},description={an example},
+user1={\foo}}
+
+\begin{document}
+\ifglsfielddefeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
+
+\ifglsfielddefeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
+\end{document}
+
Here, the first case produces “TRUE” since the value of the useri field (“FOO”) is the same as the replacement text (definition) of \foo (“FOO”). We have the result FOO is equal to FOO.

+The second case produces “FALSE” since the value of the useri field (\foo) is not the same as the replacement text (definition) of \foo (“FOO”). No expansion has been performed on the value of the useri field. We have the result \foo is not equal to FOO.

+If we add:

\newcommand{\FOO}{\foo}
+\ifglsfielddefeq{sample2}{useri}{\FOO}{TRUE}{FALSE}.
+
we now get “TRUE” since the value of the useri field (\foo) is the same as the replacement text (definition) of \FOO (\foo). We have the result \foo is equal to \foo.

+There is a similar command that requires the control sequence name (without the leading backslash) instead of the actual control sequence:

+\ifglsfieldcseq{entry-label}{field-label}{cs-name}{true}{false}
+ This robust command is like ifglsfielddefeq but internally uses etoolbox’s \ifcsstrequal command instead of \ifdefstrequal.

+ +

+ +
+

15.5. Fetching and Updating the Value of a Field

+

+In addition to the commands described in §5.2, the commands described in this section may also be used to fetch field information.

+

+ The glossaries-extra package has additional commands, such as \glsxtrusefield.
+

+

+\glsentrytype{entry-label}
+ Expands to the value of the entry’s type field, which is the label of the glossary the entry has been assigned to. No existence check is performed.

+

+\glsentryparent{entry-label}
+ Expands to the value of the entry’s parent field, which is the label identifying the entry’s parent. No existence check is performed.

+

+\glsentrysort{entry-label}
+ Expands to the entry’s 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 internal field sortvalue which contains the escaped sort value, which may not necessarily be the same as the sort value.

+

+\glsfieldfetch{entry-label}{field-label}{cs}
+{label}{field}{cs}

+This robust command fetches the value of the field identified by its internal field labelfield-label for the entry identified by entry-label and stores it in the given command cs. An error will occur if the entry doesn’t exist or if the field hasn’t been defined.

+

+\glsletentryfield{cs}{entry-label}{field-label}
+

+This command simply assigns the supplied command cs to the value of the field identified by its internal field labelfield-label for the entry identified by entry-label. This differs from \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 cs will be undefined. You can then use etoolbox’s \ifdef or \ifundef on cs.

+For example, to store the description for the entry whose label is “apple” in the control sequence \tmp:

\glsletentryfield{\tmp}{apple}{desc}
+\ifdef{\tmp}description: \tmp{no description}
+
An alternative is to use \ifglshasfield or, with glossaries-extra, \glsxtrifhasfield.

+

+\glsunexpandedfieldvalue{entry-label}{field-label}
+ This command is provided for use in expandable contexts where the field value is required but the contents should not be expanded. The field-label argument must be the internal field label. 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 text field, it won’t modify the value given by the name, plural, first or any other related key.

+

+There are some fields that should only be set when the entry is defined and will cause unexpected results if changed later. For example, type (which additionally needs to add the entry’s label to the corresponding glossary’s internal list), parent (which needs to calculate the hierarchical level and setup the indexing syntax appropriately), and sort (which may need pre-processing and is required to setup the indexing syntax).
+

+In all the four related commands below, entry-label identifies the entry and field-label is the internal field label. The 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 glossaries-extra.

+

+\glsfielddef{entry-label}{field}{value}
+ This robust command uses \def to change the value of the field (so it will be localised by any grouping).

+

+\glsfieldedef{entry-label}{field}{value}
+ This robust command uses \protected@csedef to change the value of the field (so it will be localised by any grouping).

+\glsfieldgdef This uses \gdef to change the value of the field (so it will have a global effect).

+

+\glsfieldxdef{entry-label}{field}{value}
+ This robust command uses \protected@csxdef to change the value of the field (so it will be localised by any grouping).

+ +

+ +
+

16. Prefixes or Determiners

+

+

+\usepackage[options]{glossaries-prefix}

+

automatically loaded with \usepackage[prefix]{glossaries-extra}
+
+

+The glossaries-prefix package that comes with the glossaries package provides additional keys that can be used as prefixes. For example, if you want to specify determiners (such as “a”, “an” or “the”). The glossaries-prefix package automatically loads the glossaries package and has the same package options.

+

+ The glossaries-prefix package can automatically be loaded with glossaries-extra via the prefix package option.
+

+The extra keys for \newglossaryentry are as follows:

+

+prefix={text}
+

+The prefix associated with the text key. This defaults to nothing.

+

+prefixplural={text}
+

+The prefix associated with the plural key. This defaults to nothing.

+

+prefixfirst={text}
+

+The prefix associated with the first key. If omitted, this defaults to the value of the prefix key.

+

+prefixfirstplural={text}
+

+The prefix associated with the firstplural key. If omitted, this defaults to the value of the prefixplural key.

+

Example 41: Defining Determiners
Here’s the start of my example document:
\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[toc,acronym]{glossaries-prefix}
+
Note that I’ve simply replaced glossaries from previous sample documents with glossaries-prefix. Now for a sample definition:
\newglossaryentry{sample}{namesample,
+  description={an example},
+  prefix={a~},
+  prefixplural={the\space}
+}
+
(Single letter words, such as “a” and “I” should typically not appear at the end of a line, hence the non-breakable space ~ after “a” in the 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:

\newglossaryentry{oeil}{name={oeil},
+  plural={yeux},
+  description={eye},
+  prefix={l'},
+  prefixplural={les\space}}
+

+

+Where a space is required at the end of the prefix, you must use a spacing command, such as \space, \ (backslash space) or ~ due to the automatic spacing trimming performed in key=value options.
+

+In the event that you always require a space between the prefix and the term, then you can instead redefine \glsprefixsep to do a space. For example:

\renewcommand{\glsprefixsep}{\space}
+

+The prefixes can also be used with acronyms. For example:

\newacronym
+ [
+   prefix={an\space},prefixfirst={a~}
+ ]{svm}{SVM}{support vector machine}
+

+The glossaries-prefix package provides convenient commands to use these prefixes with commands such as \gls. Note that the prefix is not considered part of the link text, 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-like command. (See §5.1 for further details.)

+

+\glsprefixsepinitial: empty
+ The separator used between the appropriate prefix and the corresponding \gls-like command.

+Each of the following commands \pgls essentially does prefix\glsprefixsepgls if the appropriate prefix field has been set, otherwise it simply does gls, where gls is the corresponding \gls-like command.

+The all caps commands \PGLS will convert the prefix to all caps (using \glsuppercase) and use the all caps \gls-like counterpart.

+The sentence case commands \PGls are slightly more complicated. If the appropriate prefix field has been set, then the prefix will have the case change applied and the non-case \gls-like command will be used (\gls or \glspl). If the appropriate prefix field hasn’t been set, then the sentence case \gls-like command is used (\Gls or \Glspl).

+The usual \gls-like optional argument and star (*) and plus (+) modifiers can be used with these commands, in which case they will be applied to the applicable \gls-like command.

+

+\pgls[options]{entry-label}[insert]modifiers: * +
+ Does prefix\glsprefixsep\gls if prefix is non-empty otherwise just uses \gls.

+The prefix will be the value of the prefixfirst key on first use or the prefix key on subsequent use.

+

+\pglspl[options]{entry-label}[insert]modifiers: * +
+ Does prefix\glsprefixsep\glspl if prefix is non-empty otherwise just uses \glspl.

+The prefix will be the value of the prefixfirstplural key on first use or the prefixplural key on subsequent use.

+

+\Pgls[options]{entry-label}[insert]modifiers: * +
+ Does prefix\glsprefixsep\gls if prefix is non-empty otherwise just uses \Gls.

+As \pgls, the prefix fields are prefixfirst on first use or the prefix on subsequent use, but the prefix will now be obtained from the sentence case commands \Glsentryprefix and \Glsentryprefixfirst.

+

+\Pglspl[options]{entry-label}[insert]modifiers: * +
+ Does prefix\glsprefixsep\glspl if prefix is non-empty otherwise just uses \Glspl.

+As \pglspl, the prefix fields are prefixfirstplural on first use or the prefixplural on subsequent use, but the prefix will now be obtained from the sentence case commands \Glsentryprefixplural and \Glsentryprefixfirstplural.

+

+\PGLS[options]{entry-label}[insert]modifiers: * +
+ Does:
\glsuppercase{prefix\glsprefixsep}\GLS
+
if prefix is non-empty otherwise just uses \GLS.

+The prefix will be the value of the prefixfirst key on first use or the prefix key on subsequent use.

+

+\PGLSpl[options]{entry-label}[insert]modifiers: * +
+ Does:
\glsuppercase{prefix\glsprefixsep}\GLSpl
+
if prefix is non-empty otherwise just uses \GLSpl.

+The prefix will be the value of the prefixfirstplural key on first use or the prefixplural key on subsequent use.

+

+ The glossaries-extra package provides additional commands, such as \pglsxtrshort, for use in section headings.
+

+

Example 42: Using Prefixes
Continuing from Example 41, now that I’ve defined my entries, I can use them in the text via the above commands:
First use: \pgls{svm}. Next use: \pgls{svm}.
+Singular: \pgls{sample}, \pgls{oeil}.
+Plural: \pglspl{sample}, \pglspl{oeil}.
+
which produces:
+First use: a support vector machine (SVM). Next use: an SVM. Singular: a sample, l’oeil. Plural: the samples, les yeux.
+ For a complete document, see sample-prefix.tex.

+This package also provides the commands described below, none of which perform any check to determine the entry’s existence.

+

+\ifglshasprefix{entry-label}{true}{false}
+ Expands to true if the prefix field is non-empty, otherwise expands to false.

+

+\ifglshasprefixplural{entry-label}{true}{false}
+ Expands to true if the prefixplural field is non-empty, otherwise expands to false.

+

+\ifglshasprefixfirst{entry-label}{true}{false}
+ Expands to true if the prefixfirst field is non-empty, otherwise expands to false.

+

+\ifglshasprefixfirstplural{entry-label}{true}{false}
+ Expands to true if the prefixfirstplural field is non-empty, otherwise expands to false.

+

+\glsentryprefix{entry-label}
+ Expands to the value if the prefix field.

+

+\glsentryprefixplural{entry-label}
+ Expands to the value if the prefixplural field.

+

+\glsentryprefixfirst{entry-label}
+ Expands to the value if the prefixfirst field.

+

+\glsentryprefixfirstplural{entry-label}
+ Expands to the value if the prefixfirstplural field.

+There are also variants that convert to sentence case. As with command like \Glsentrytext, these will use \MFUsentencecase to expand in PDF bookmarks, but will use \glssentencecase in the document.

+

+\Glsentryprefix{entry-label}
+ As \glsentryprefix with sentence case applied.

+

+\Glsentryprefixplural{entry-label}
+ As \glsentryprefixplural with sentence case applied.

+

+\Glsentryprefixfirst{entry-label}
+ As \glsentryprefixfirst with sentence case applied.

+

+\Glsentryprefixfirstplural{entry-label}
+ As \glsentryprefixfirstplural with sentence case applied.

+

Example 43: Adding Determiner to Glossary Style
You can use the above commands to define a new glossary style that uses the determiner. For example, the following style is a slight modification of the list style that inserts the prefix before the name:
\newglossarystyle{plist}{% 
+ \setglossarystyle{list}% 
+ \renewcommand*{\glossentry}[2]{% 
+  \item[\glsentryitem{1}% 
+      \glsentryprefix{1}% 
+      \glstarget{1}{\glossentryname{1}}]
+   \glossentrydesc{1}\glspostdescription\space 2}% 
 }
-\newglossaryentry{function}{name={function},
-  description={a rule that assigns every element in the
-  domain \gls{set} to an element in the range \gls{set}},
-  symbol={\ensuremath{f(x)}}
+
If you want to change the prefix separator (\glsprefixsep) then the following is better:
\newglossarystyle{plist}{% 
+ % 
+ \renewcommand*{\glossentry}[2]{% 
+   \item[\glsentryitem{1}% 
+        \ifglshasprefix{1}{\glsentryprefix{1}\glsprefixsep}{}% 
+        \glstarget{1}{\glossentryname{1}}]
+     \glossentrydesc{1}\glspostdescription\space 2}% 
 }
-
-

-
-\newcommand*{\termdef}[1]{% -
  \section{\glsxtrglossentry{#1} \glsentrysymbol{#1}}% -
  \begin{quote}\em\Glsentrydesc{#1}.\end{quote}% -
} -
-
- - -
-\begin{document}
-\tableofcontents
-\section{Introduction}
-Sample document about \glspl{function} and \glspl{set}.
-\termdef{set}
-More detailed information about \glspl{set} with examples.
-\termdef{function}
-More detailed information about \glspl{function} with examples.
-\end{document}
-
-

Or you can use bib2gls if you want to manage a large database of terms. For example (requires glossaries-extra -v1.42, see below):

-
-\documentclass{article} -
-
\usepackage[colorlinks]{hyperref} -
\usepackage[record, -
   nostyles% <- no glossary styles are required -
  ]{glossaries-extra} -
-
\GlsXtrLoadResources[src=terms,sort=none,save-locations=false] -
-
\newcommand*{\termdef}[1]{% -
  \section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}% -
  \glsadd{#1}% <- index this entry -
  \begin{quote}\em\Glsentrydesc{#1}.\end{quote}% -
} -
-
- - -
-\begin{document}
-\tableofcontents
-\section{Introduction}
-Sample document about \glspl{function} and \glspl{set}.
-\termdef{set}
-More detailed information about \glspl{set} with examples.
-\termdef{function}
-More detailed information about \glspl{function} with examples.
-\end{document}
-
-

Where the file terms.bib contains:

-
-@entry{set, -
  name={set}, -
  description={a collection of any kind of objects}, -
  symbol={\ensuremath{\mathcal{S}}} -
} -
@entry{function, -
  name={function}, -
  description={a rule that assigns every element in the domain -
  \gls{set} to an element in the range \gls{set}}, -
  symbol={\ensuremath{f(x)}} -
} -
-
The advantage in this approach (with \loadglsentries or bib2gls) is that you can use an existing database -of entries shared across multiple documents, ensuring consistent notation for all of them. -

In both cases, there’s no need to load all the glossary styles packages, as they’re not required, so I’ve used -the nostyles package option to prevent them from being loaded. -

In the first case, you need the sort=none package option (as in Option 5) and then define the terms in the -preamble. No external tool is required. Just run LaTeX as normal. (Twice to ensure that the table of contents is -up to date.) -


-   
pdflatex myDoc -
pdflatex myDoc -
- - -
-

In the second case, you need the record package option (as in Option 4) since bib2gls is needed to select the -required entries, but you don’t need a sorted list:

-
-\GlsXtrLoadResources[src={terms},sort=none] -
-
This will ensure that any entries indexed in the document (through commands like \gls or \glsadd) will be -selected by bib2gls, but it will skip the sorting step. (The chances are you probably also won’t need location -lists either. If so, you can add the option save-locations=false.) -

Remember that for this second case you need to run bib2gls as per Option 4: -


-   
pdflatex myDoc -
bib2gls myDoc -
pdflatex myDoc -
pdflatex myDoc -
-
-

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

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

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

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

The \glossentrysymbol command performs an existence check, which triggers a warning if the entry is undefined. -(All entries will be undefined before the first bib2gls call.) You need at least glossaries-extra v1.42 to use this command in -a section title.1.4 -If hyperref has been loaded, this will use \texorpdfstring to allow a simple expansion for the PDF bookmarks -(see the glossaries-extra user manual for further details). -

If you want to test if the symbol field has been set, you need to use \ifglshassymbol outside of the section -title. For example:

- - -
-\ifglshassymbol{#1}% -
{\section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}} -
{\section{\glsxtrglossentry{#1}}} -
-
-

In both of the above examples, the section titles start with a lowercase character (because the name value is -all lowercase in entry definitions). You can apply automatic case-change with the glossname attribute. For -example:

-
-\glssetcategoryattribute{general}{glossname}{firstuc} -
-
or (for title-case)
-
-\glssetcategoryattribute{general}{glossname}{title} -
-
However, this won’t apply the case-change in the table of contents or bookmarks. -

In the second example, you can instead use bib2gls to apply a case-change:

-
-\GlsXtrLoadResources[src=terms, -
 sort=none,save-locations=false, -
 replicate-fields={name=text}, -
 name-case-change=firstuc
-
] -
-
(Or name-case-change=title for title-case.) This copies the name value to the text field and -then applies a case-change to the name field (leaving the text field unchanged). The name in the -section titles now starts with a capital but the link text produced by commands like \gls is still -lowercase. -

In the first example (without bib2gls) you need to do this manually. For example:

-
-\newglossaryentry{set}{name={Set},text={set}, -
  description={a collection of any kind of objects}, -
  symbol={\ensuremath{\mathcal{S}}} -
} - - -
-
-

Note that if you use the default save-locations=true with bib2gls, it’s possible to combine Options 4 -and 6 to have both standalone definitions and an index. Now I do need a glossary style. In this case I’m going -to use bookindex, which is provided in the glossary-bookindex package (bundled with glossaries-extra). I don’t -need any of the other style packages, so I can still keep the nostyles option and just load glossary-bookindex: -

-
-\usepackage[record=nameref,% <- using bib2gls -
 nostyles,% <- don't load default style packages -
 stylemods=bookindex,% <- load glossary-bookindex.sty -
 style=bookindex% <- set the default style to 'bookindex' -
]{glossaries-extra} -
-
I also need to sort the entries, so the resource command is now:
-
-\GlsXtrLoadResources[src=terms,% definitions in terms.bib -
 sort=en-GB,% sort by this locale -
 replicate-fields={name=text}, -
 name-case-change={firstuc} -
] -
-
At the end of the document, I can add the glossary:
-
-\printunsrtglossary[title=Index,target=false] -
-
Note that I’ve had to switch off the hypertargets with target=false (otherwise there would be duplicate -targets). If you want letter group headings you need to use the --group switch: -


-   
bib2gls --group myDoc -
-
-or if you are using arara:

-
-% arara: bib2gls: { group: on } -
-
- - -

The bookindex style doesn’t show the description, so only the name and location is displayed. Remember -that the name has had a case-conversion so it now starts with an initial capital. If you feel this is inappropriate -for the index, you can adjust the bookindex style so that it uses the text field instead. For example: -

-
-\renewcommand*{\glsxtrbookindexname}[1]{% -
  \glossentrynameother{#1}{text}} -
-
See the glossaries-extra user manual for further details about this style. -

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

If there are extra terms that need to be included in the index that don’t have a description, you can define -them with @index in the bib file. For example:

-
-@index{element} -
@index{member,alias={element}} -
-
They can be used in the document as usual: - - -
-The objects that make up a set are the \glspl{element}
-or \glspl{member}.
-
-

See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further -details. -

The glossaries package comes with a number of sample documents that illustrate the various functions. These -are listed in §18 Sample Documents. -

-

-

Top

1.3 Dummy Entries for Testing

-

In addition to the sample files described above, glossaries also provides some files containing lorum -ipsum dummy entries. These are provided for testing purposes and are on TeX’s path (in -tex/latex/glossaries/test-entries) so they can be included via \input or \loadglsentries. The -glossaries-extra package provides bib versions of all these files for use with bib2gls. The files are as -follows: -

-

-example-glossaries-brief.tex

-

These entries all have brief descriptions. For example: - - -

-
-     \newglossaryentry{lorem}{name={lorem},description={ipsum}}
-
-

-

-

-example-glossaries-long.tex

-

These entries all have long descriptions. For example: - - -

-
-     \newglossaryentry{loremipsum}{name={lorem ipsum},
-     description={dolor sit amet, consectetuer adipiscing
-     elit. Ut purus elit, vestibulum ut, placerat ac,
-     adipiscing vitae, felis. Curabitur dictum gravida
-     mauris.}}
-
-

-

-

-example-glossaries-multipar.tex

-

These entries all have multi-paragraph descriptions. For example: - - -

-
-     \longnewglossaryentry{loremi-ii}{name={lorem 1--2}}%
-     {%
-     Lorem ipsum ...
-     Nam dui ligula...
-     }
-
-

-

-

-example-glossaries-symbols.tex

-

These entries all use the symbol key. For example: - - -

-
-     \newglossaryentry{alpha}{name={alpha},
-     symbol={\ensuremath{\alpha}},
-     description={Quisque ullamcorper placerat ipsum.}}
-
-

-

-

-example-glossaries-symbolnames.tex

-

Similar to the previous file but the symbol key isn’t used. Instead the symbol is stored in the name key. - For example: - - -

-
-     \newglossaryentry{sym.alpha}{sort={alpha},
-     name={\ensuremath{\alpha}},
-     description={Quisque ullamcorper placerat ipsum.}}
-
-

-

-

-example-glossaries-images.tex

-

These entries use the user1 key to store the name of an image file. (The images are provided by the mwe - package and should be on TeX’s path.) One entry doesn’t have an associated image to help test for - a missing key. The descriptions are long to allow for tests with the text wrapping around the image. For - example: - - -

-
-     \longnewglossaryentry{sedfeugiat}{name={sed feugiat},
-     user1={example-image}}%
-     {%
-     Cum sociis natoque...
-     Etiam...
-     }
-
-

-

-

-example-glossaries-acronym.tex

-

These entries are all abbreviations. For example: - - -

-
-     \newacronym[type=\glsdefaulttype]{lid}{LID}{lorem ipsum
-     dolor}
-
-

-

If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation - with the category key set to acronym (rather than the default abbreviation). This means that you need - to set the abbreviation style for the acronym category. For example: - - -

-
-     \setabbreviationstyle[acronym]{long-short}
-
-

-

-

-

-example-glossaries-acronym-desc.tex

-

This file contains entries that are all abbreviations that use the description key. For example: - - -

-
-     \newacronym[type=\glsdefaulttype,
-       description={fringilla a, euismod sodales,
-       sollicitudin vel, wisi}]{ndl}{NDL}{nam dui ligula}
-
-

-

If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation - with the category key set to acronym (rather than the default abbreviation). This means that you need - to set the abbreviation style for the acronym category. For example: - - -

-
-     \setabbreviationstyle[acronym]{long-short-desc}
-
-

-

-

-

-example-glossaries-acronyms-lang.tex

-

These entries are all abbreviations, where some of them have a translation supplied in the user1 key. For - example: - - -

-
-     \newacronym[type=\glsdefaulttype,user1={love itself}]
-      {li}{LI}{lorem ipsum}
-
-

-

If you use the glossaries-extra extension package, then \newacronym is redefined to use \newabbreviation - with the category key set to acronym (rather than the default abbreviation). This means that you need - to set the abbreviation style for the acronym category. For example: - - -

-
-     \setabbreviationstyle[acronym]{long-short-user}
-
-

-

-

-

-example-glossaries-parent.tex

-

These are hierarchical entries where the child entries use the name key. For example: - - -

-
-     \newglossaryentry{sedmattis}{name={sed mattis},
-     description={erat sit amet}
-     \newglossaryentry{gravida}{parent={sedmattis},
-       name={gravida},description={malesuada}}
-
-

-

-

-example-glossaries-childnoname.tex

-

These are hierarchical entries where the child entries don’t use the name key. For example: - - -

-
-     \newglossaryentry{scelerisque}{name={scelerisque},
-       description={at}}
-     \newglossaryentry{vestibulum}{parent={scelerisque},
-       description={eu, nulla}}
-
-

-

-

-example-glossaries-longchild.tex

-

(New to v4.47.) These entries all have long descriptions and there are some child entries. For - example: - - -

-
-     \newglossaryentry{longsedmattis}{name={sed mattis},
-      description={erat sit amet dolor sit amet, consectetuer adipiscing elit.
-      Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
-      Curabitur dictum gravida mauris.}}
-     \newglossaryentry{longgravida}{parent={longsedmattis},name={gravida},
-      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.}}
-
-

-

-

-example-glossaries-childmultipar.tex

-

(New to v4.47.) This consists of parent entries with single paragraph descriptions and child entries with - multi-paragraph descriptions. Some entries have the user1 key set to the name of an image file provided - by the mwe package. For example: - - -

-
-     \newglossaryentry{hiersedmattis}{name={sed mattis},user1={example-image},
-      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.}}
-     \longnewglossaryentry{hierloremi-ii}
-     {name={lorem 1--2},parent={hiersedmattis}}%
-     {%
-     Lorem ipsum ...
-     Nam dui ligula...
-     }
-
-

-

-

-example-glossaries-cite.tex

-

These entries use the user1 key to store a citation key (or comma-separated list of citation keys). The - citations are defined in xampl.bib, which should be available on all modern TeX distributions. One entry - doesn’t have an associated citation to help test for a missing key. For example: - - -

-
-     \newglossaryentry{fusce}{name={fusce},
-     description={suscipit cursus sem},user1={article-minimal}}
-
-

-

-

-example-glossaries-url.tex

-

These entries use the user1 key to store an URL associated with the entry. For example: - - -

-
-     \newglossaryentry{aenean-url}{name={aenean},
-      description={adipiscing auctor est},
-      user1={http://uk.tug.org/}}
-
-

-

The sample file glossary-lipsum-examples.tex in the doc/latex/glossaries/samples directory uses all -these files. See also glossaries gallery. -


glossaries-extraThe glossaries-extra package provides the additional test file: -

-

-example-glossaries-xr.tex

-

These entries use the see key provided by the base glossaries package and also the alias and seealso - keys that require glossaries-extra. For example: - - -

-
-     \newglossaryentry{alias-lorem}{name={alias-lorem},
-      description={ipsum},alias={lorem}}
-     \newglossaryentry{amet}{name={amet},description={consectetuer},
-      see={dolor}}
-     \newglossaryentry{arcu}{name={arcu},description={libero},
-      seealso={placerat,vitae,curabitur}}
-
-

-

-

-

Top

1.4 Multi-Lingual Support

-

The glossaries package uses the tracklang package to determine the document languages. Unfortunately, because -there isn’t a standard language identification framework provided with LaTeX, tracklang isn’t always able to -detect the selected languages either as a result of using an unknown interface or where the interface doesn’t -provide a way of detecting the language. See Localisation with tracklang.tex for further details. -
-

-

As from version 1.17, the glossaries package can be used with xindy as well as makeindex. If you are writing in a -language that uses an extended Latin alphabet or non-Latin alphabet it’s best to use Option 3 (xindy) or -Option 4 (bib2gls) as makeindex (Option 2) is hard-coded for the non-extended Latin alphabet and Option 1 -can only perform limited ASCII comparisons. -

This means that with Options 3 or 4 you are not restricted to the A, …, Z letter groups. If you want to use -xindy, remember to use the xindy package option. For example: - - -

-
-\documentclass[french]{article}
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
-\usepackage{babel}
-\usepackage[xindy]{glossaries}
-
-

If you want to use bib2gls, you need to use the record option with glossaries-extra and supply the definitions in -bib files. (See the bib2gls user manual for further details.) -

Note that although a non-Latin character, such as é, looks like a plain character in your tex file, with -standard LaTeX it’s actually a macro and can therefore cause expansion problems. You may need to switch off -the field expansions with \glsnoexpandfields. This issue doesn’t occur with XeLaTeX or LuaLaTeX. -
-

-

With inputenc, if you use a non-Latin character (or other expandable) character at the start of an entry -name, you must place it in a group, or it will cause a problem for commands that convert the first letter to -upper case (e.g. \Gls). For example:

-
-\newglossaryentry{elite}{name={{é}lite}, -
description={select group or class}} -
-
For further details, see the “UTF-8” section in the mfirstuc user manual. -

If you are using xindy or bib2gls, the application needs to know the encoding of the tex file. This -information is added to the aux file and can be picked up by makeglossaries and bib2gls. If you use xindy -explicitly instead of via makeglossaries, you may need to specify the encoding using the -C option. Read the -xindy manual for further details of this option. -

As from v4.24, if you are writing in German (for example, using the ngerman -package1.5 -or babel with the ngerman package option), and you want to use makeindex’s -g option, you’ll need to change -makeindex’s quote character using: -


\GlsSetQuote{character}

-

-Note that ⟨character⟩ may not be one of ? (question mark), | (pipe) or ! (exclamation mark). For -example: - - -

-
-\GlsSetQuote{+}
-
-

This must be done before \makeglossaries and any entry definitions. It’s only applicable for makeindex. This -option in conjunction with ngerman will also cause makeglossaries to use the -g switch when invoking -makeindex. -

Be careful of babel’s shorthands. These aren’t switched on until the start of the document, so any entries -defined in the preamble won’t be able to use those shorthands. However, if you define the entries in the -document and any of those shorthands happen to be special characters for makeindex or xindy (such as the -double-quote) then this will interfere with code that tries to escape any of those characters that occur in the -sort key.
-

-

In general, it’s best not to use babel’s shorthands in entry definitions. For example: - - -

-
-\documentclass{article}
-\usepackage[ngerman]{babel}
-\usepackage{glossaries}
-\GlsSetQuote{+}
-\makeglossaries
-\newglossaryentry{rna}{name={ribonukleins\"aure},
-  sort={ribonukleins"aure},
-  description={eine Nukleins\"aure}}
-\begin{document}
-\gls{rna}
-\printglossaries
-\end{document}
-
-

-

The ngerman package has the shorthands on in the preamble, so they can be used in definitions if -\GlsSetQuote has been used to change the makeindex quote character. Example: - - -

-
-\documentclass{article}
-\usepackage[ngerman]{babel}
-\usepackage{glossaries}
-\GlsSetQuote{+}
-\makeglossaries
-\newglossaryentry{rna}{name={ribonukleins"aure},
-  description={eine Nukleins"aure}}
-\begin{document}
-\gls{rna}
-\printglossaries
-\end{document}
-
-

-

-

-

Top

1.4.1 Changing the Fixed Names

-

The fixed names are produced using the commands listed in table 1.2. If you aren’t using a -language package such as babel or polyglossia that uses caption hooks, you can just redefine these commands as -appropriate. If you are using babel or polyglossia, you need to use their caption hooks to change the defaults. -See changing the words babel uses or read the babel or polyglossia documentation. If you have -loaded babel, then glossaries will attempt to load translator, unless you have used the notranslate, -translate=false or translate=babel package options. If the translator package is loaded, the translations -are provided by dictionary files (for example, glossaries-dictionary-English.dict). See the -translator package for advice on changing translations provided by translator dictionaries. If you -can’t work out how to modify these dictionary definitions, try switching to babel’s interface using -translate=babel: - - -

-
-\documentclass[english,french]{article}
-\usepackage{babel}
-\usepackage[translate=babel]{glossaries}
-
-

and then use babel’s caption hook mechanism. Note that if you pass the language options directly to babel -rather that using the document class options or otherwise passing the same options to translator, then translator -won’t pick up the language and no dictionaries will be loaded and babel’s caption hooks will be used -instead. -

-
- - -


- - -
Table 1.2: Customised Text
- - -
- - - - - - - - -
Command Name

Translator - Key - Word

Purpose

\glossaryname

Glossary

Title - of - the - main - glossary.

\acronymname

Acronyms

Title - of - the - list - of - acronyms - (when - used - with - package - option - acronym).

\entryname

Notation - (glossaries)

Header - for - first - column - in - the - glossary - (for - 2, - 3 - or - 4 - column - glossaries - that - support - headers).

\descriptionname

Description - (glossaries)

Header - for - second - column - in - the - glossary - (for - 2, - 3 - or - 4 - column - glossaries - that - support - headers).

\symbolname

Symbol - (glossaries)

Header - for - symbol - column - in - the - glossary - for - glossary - styles - that - support - this - option.

\pagelistname

Page - List - (glossaries)

Header - for - page - list - column - in - the - glossary - for - glossaries - that - support - this - option.

\glssymbolsgroupname

Symbols - (glossaries)

Header - for - symbols - section - of - the - glossary - for - glossary - styles - that - support - this - option.

\glsnumbersgroupname

Numbers - (glossaries)

Header - for - numbers - section - of - the - glossary - for - glossary - styles - that - support - this - option.

- -
- - -

-
-

As from version 4.12, multilingual support is provided by separate language modules that need to be -installed in addition to installing the 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 http://www.dickimaw-books.com/contact.html. The translator -dictionary files for 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:

-
    -
  • -

    Using babel and translator: - - -

    -
    -     \documentclass[english,french]{article}
    -     \usepackage{babel}
    -     \usepackage{glossaries}
    -
    -

    (translator is automatically loaded). -

  • -
  • -

    Using babel: - - -

    -
    -     \documentclass[english,french]{article}
    -     \usepackage{babel}
    -     \usepackage[translate=babel]{glossaries}
    -
    -

    (translator isn’t loaded). The glossaries-extra package has translate=babel as the default if babel has been - loaded. -

  • -
  • -

    Using polyglossia: - - -

    -
    -     \documentclass{article}
    -     \usepackage{polyglossia}
    -     \setmainlanguage{english}
    -     \usepackage{glossaries}
    -
    -

    -

    -
-

Due to the varied nature of glossaries, it’s likely that the predefined translations may not be -appropriate. If you are using the babel package and the glossaries package option translate=babel, you -need to be familiar with the advice given in changing the words babel uses. If you are using the -translator package, then you can provide your own dictionary with the necessary modifications (using -\deftranslation) and load it using \usedictionary. If you simply want to change the title of a glossary, you -can use the title key in commands like \printglossary (but not the iterative commands like -\printglossaries). -

Note that the translator dictionaries are loaded at the beginning of the document, so it won’t have any effect -if you put \deftranslation in the preamble. It should be put in your personal dictionary instead (as in the -example below). See the translator documentation for further details. (Now with beamer documentation.) -
-

-

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 “Nomenclature” and the page list should be labelled “Location”, -then you can create a file called, say, - - -

-
-myinstitute-glossaries-dictionary-English.dict
-
-

that contains the following: - - -

-
-\ProvidesDictionary{myinstitute-glossaries-dictionary}{English}
-\deftranslation{Glossary}{Nomenclature}
-\deftranslation{Page List (glossaries)}{Location}
-
-

You can now load it using: - - -

-
-\usedictionary{myinstitute-glossaries-dictionary}
-
-

(Make sure that myinstitute-glossaries-dictionary-English.dict can be found by TeX.) If you want to -share your custom dictionary, you can upload it to CTAN. -

If you are using babel and don’t want to use the translator interface, you can use the package option -translate=babel. For example: - - -

-
-\documentclass[british]{article}
-\usepackage{babel}
-\usepackage[translate=babel]{glossaries}
-\addto\captionsbritish{%
-    \renewcommand*{\glossaryname}{List of Terms}%
-    \renewcommand*{\acronymname}{List of Acronyms}%
+
The conditional is also useful if you want the style to use an uppercase letter at the start of the entry item:
\newglossarystyle{plist}{% 
+  \setglossarystyle{list}% 
+  \renewcommand*{\glossentry}[2]{% 
+    \item[\glsentryitem{1}% 
+        \glstarget{1}% 
+        {% 
+          \ifglshasprefix{1}% 
+          {\Glsentryprefix{1}\glsprefixsep\glossentryname{1}}% 
+          {\Glossentryname{1}}% 
+        }]
+     \glossentrydesc{1}\glspostdescription\space 2}% 
 }
-
-

-

Note that xindy and bib2gls provide much better multi-lingual support than makeindex, so I recommend -that you use Options 3 or 4 if you have glossary entries that contain non-Latin characters. See §14 -Xindy (Option 3) for further details on xindy, and see the bib2gls user manual for further details of that -application. -

-

Top

1.4.2 Creating a New Language Module

-

The glossaries package now uses the 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 tracklang -documentation. -

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

Here’s an example of glossaries-dictionary-English.dict: - - -

-
-\ProvidesDictionary{glossaries-dictionary}{English}
-\providetranslation{Glossary}{Glossary}
-\providetranslation{Acronyms}{Acronyms}
-\providetranslation{Notation (glossaries)}{Notation}
-\providetranslation{Description (glossaries)}{Description}
-\providetranslation{Symbol (glossaries)}{Symbol}
-\providetranslation{Page List (glossaries)}{Page List}
-\providetranslation{Symbols (glossaries)}{Symbols}
-\providetranslation{Numbers (glossaries)}{Numbers}
-
-

You can use this as a template for your dictionary file. Change English to the translator name for your -language (so that it matches the file name glossaries-dictionary-Lang.dict) and, for each -\providetranslation, change the second argument to the appropriate translation. -

Here’s an example of glossaries-english.ldf: - - -

-
-\ProvidesGlossariesLang{english}
-\glsifusedtranslatordict{English}
-{%
-  \addglossarytocaptions{\CurrentTrackedLanguage}%
-  \addglossarytocaptions{\CurrentTrackedDialect}%
+

+ +

+ +
+

17. Accessibility Support

+

+

+\usepackage[options]{glossaries-accsupp}

+

automatically loaded with \usepackage[accsupp]{glossaries-extra}
+
+

+Limited accessibility support is provided by the accompanying glossaries-accsupp package, but note that this package is experimental. This package automatically loads the glossaries package. Any options are passed to glossaries (if it hasn’t already been loaded). For example:

\usepackage[acronym]{glossaries-accsupp}
+
This will load glossaries with the acronym package option as well as loading glossaries-accsupp.

+

+ If you are using the glossaries-extra extension package, you need to load glossaries-extra with the accsupp package option. For example:
+\usepackage[abbreviations,accsupp]{glossaries-extra}
+
This will load glossaries-extra (with the abbreviations option), glossaries and glossaries-accsupp and make appropriate patches to integrate the accessibility support with the extension commands.
+

+ +

+ +
+

17.1. Accessibility Keys

+

+The glossaries-accsupp package defines additional keys that may be used when defining glossary entries. If a key isn’t set, then there will be not accessibility support for the corresponding field.

+

+access={text}
+

+The value of this key is the replacement text corresponding to the name key.

+

+textaccess={text}
+

+The value of this key is the replacement text corresponding to the text key.

+

+firstaccess={text}
+

+The value of this key is the replacement text corresponding to the first key.

+

+pluralaccess={text}
+

+The value of this key is the replacement text corresponding to the plural key.

+

+firstpluralaccess={text}
+

+The value of this key is the replacement text corresponding to the firstplural key.

+

+symbolaccess={text}
+

+The value of this key is the replacement text corresponding to the symbol key.

+

+symbolpluralaccess={text}
+

+The value of this key is the replacement text corresponding to the symbolplural key.

+

+descriptionaccess={text}
+

+The value of this key is the replacement text corresponding to the description key. The corresponding internal field label is descaccess.

+

+descriptionpluralaccess={text}
+

+The value of this key is the replacement text corresponding to the descriptionplural key. The corresponding internal field label is descpluralaccess.

+

+longaccess={text}
+

+The value of this key is the replacement text corresponding to the long key.

+

+longpluralaccess={text}
+

+The value of this key is the replacement text corresponding to the longplural key.

+

+shortaccess={text}
+

+The value of this key is the replacement text corresponding to the short key.

+If you define acronyms with \newacronym, the shortaccess field will automatically be set to:

+\glsdefaultshortaccess{long}{short}
+ This just expands to long. If redefined, this command must be fully expandable. It expands when the acronym is defined.

+

+shortpluralaccess={text}
+

+The value of this key is the replacement text corresponding to the shortplural key.

+

+user1access={text}
+

+The value of this key is the replacement text corresponding to the user1 key. The corresponding internal field label is useriaccess.

+

+user2access={text}
+

+The value of this key is the replacement text corresponding to the user2 key. The corresponding internal field label is useriiaccess.

+

+user3access={text}
+

+The value of this key is the replacement text corresponding to the user3 key. The corresponding internal field label is useriiiaccess.

+

+user4access={text}
+

+The value of this key is the replacement text corresponding to the user4 key. The corresponding internal field label is userivaccess.

+

+user5access={text}
+

+The value of this key is the replacement text corresponding to the user5 key. The corresponding internal field label is uservaccess.

+

+user6access={text}
+

+The value of this key is the replacement text corresponding to the user6 key. The corresponding internal field label is userviaccess.

+For example:

\newglossaryentry{tex}{name={\TeX},description={Document  preparation language},access={TeX}}
+
Now the link text produced by \gls{tex} will be:
\BeginAccSupp{ActualText={TeX}}\TeX\EndAccSupp
+
which is produced via \glsaccessibility. If you want to use another accessibility package, see §17.5.

+The sample file sampleaccsupp.tex illustrates the glossaries-accsupp package.

+ +

+ +
+

17.2. Incorporating Accessibility Support

+

+The \gls-like and \glstext-like commands have their link text adjusted to incorporate the accessibility support, if provided. A helper command is used to identify the replacement text that depends on the field name:

+\glsfieldaccsupp{replacement}{content}{field-label}{entry-label}
+ This will use
+\glsfield-labelaccsupp{replacement}{content}
+ if it’s defined otherwise it will just use:
+\glsaccsupp{replacement}{content}
+ Note that field-label is the internal field label which may not match the corresponding key. For example, the shortpl field label corresponds to the shortplural key.

+

+ With glossaries-extra, there’s a prior test for the existence of the command \glsxtrcategoryfieldaccsupp.
+

+There are two commands pre-defined:

+\glsshortaccsupp{replacement}{content}
+ which is defined as:
\glsaccessibility{E}{replacement}{content}
+
and
+\glsshortplaccsupp{replacement}{content}
+ which is simply defined to use \glsshortaccsupp.

+These helper commands all internally use:

+\glsaccessibility[options]{PDF element}{value}{content}
+ The default definition uses commands provided by the accsupp package. If you want to experiment with another accessibility package, see §17.5. The options are passed to the underlying accessibility support command.

+The PDF element argument is the appropriate PDF element tag. The PDF specification identifies three different types of replacement text: +

+
Alt
+ +
Description of some content that’s non-textual (for example, an image). A word break is assumed after the content.
+

+

ActualText
+

+ +

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.
+

+

E
+

+ +

Expansion of an abbreviation to avoid ambiguity (for example, “St” could be short for “saint” or “street”).
+ +
+

+

+Many PDF viewers don’t actually support any type of replacement text. Some may support “ActualText” but not “Alt” or “E”. PDFBox’s “PDFDebugger” tool can be used to inspect the PDF content to make sure that the replacement text has been correctly set.
+

+You can define your own custom helper commands for specific fields that require them. For example:

\newcommand{\glssymbolaccsupp}[2]{% 
+ \glsaccessibility[method=hex,unicode]{ActualText}{1}{2}% 
 }
-{%
-  \@ifpackageloaded{polyglossia}%
-  {%
-    \newcommand*{\glossariescaptionsenglish}{%
-      \renewcommand*{\glossaryname}{\textenglish{Glossary}}%
-      \renewcommand*{\acronymname}{\textenglish{Acronyms}}%
-      \renewcommand*{\entryname}{\textenglish{Notation}}%
-      \renewcommand*{\descriptionname}{\textenglish{Description}}%
-      \renewcommand*{\symbolname}{\textenglish{Symbol}}%
-      \renewcommand*{\pagelistname}{\textenglish{Page List}}%
-      \renewcommand*{\glssymbolsgroupname}{\textenglish{Symbols}}%
-      \renewcommand*{\glsnumbersgroupname}{\textenglish{Numbers}}%
-    }%
-  }%
-  {%
-    \newcommand*{\glossariescaptionsenglish}{%
-      \renewcommand*{\glossaryname}{Glossary}%
-      \renewcommand*{\acronymname}{Acronyms}%
-      \renewcommand*{\entryname}{Notation}%
-      \renewcommand*{\descriptionname}{Description}%
-      \renewcommand*{\symbolname}{Symbol}%
-      \renewcommand*{\pagelistname}{Page List}%
-      \renewcommand*{\glssymbolsgroupname}{Symbols}%
-      \renewcommand*{\glsnumbersgroupname}{Numbers}%
-    }%
-  }%
-  \ifcsdef{captions\CurrentTrackedDialect}
-  {%
-    \csappto{captions\CurrentTrackedDialect}%
-    {%
-      \glossariescaptionsenglish
-    }%
-  }%
-  {%
-    \ifcsdef{captions\CurrentTrackedLanguage}
-    {
-      \csappto{captions\CurrentTrackedLanguage}%
-      {%
-        \glossariescaptionsenglish
-                                                                                      
-                                                                                      
-      }%
-    }%
-    {%
-    }%
-  }%
-  \glossariescaptionsenglish
+
This definition requires the replacement text to be specified with the hexadecimal character code. For example:
\newglossaryentry{int}{name={int},description={integral},
+  symbol={\ensuremath{\int}},symbolaccess={222B}
 }
-\renewcommand*{\glspluralsuffix}{s}
-\renewcommand*{\glsacrpluralsuffix}{\glspluralsuffix}
-\renewcommand*{\glsupacrpluralsuffix}{\glstextup{\glspluralsuffix}}
-
-

This is a somewhat longer file, but again you can use it as a template. Replace English with the translator -language label ⟨Lang⟩ used for the dictionary file and replace english with the root language name ⟨lang⟩. Within -the definition of \glossariescaptionslang⟩, replace the English text (such as “Glossaries”) with the -appropriate translation. -

The suffixes used to generate the plural forms when the plural hasn’t been specified are given by -\glspluralsuffix (for general entries). For abbreviations defined with \newacronym, \glsupacrpluralsuffix -is used for acronyms where the suffix needs to be set using \glstextup to counteract the effects of \textsc and -\glsacrpluralsuffix for other acronym styles. 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 glossaries -configuration. -

Therefore these plural suffix command definitions aren’t included in the caption mechanism as that’s -typically not switched on until the start of the document. 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 plural, longplural, shortplural etc keys to override exceptions. -
-

-

If you want to add a regional variation, create a file called glossaries-iso lang-iso country.ldf, -where ⟨iso lang⟩ is the ISO language code and ⟨iso country⟩ is the ISO country code. For example, -glossaries-en-GB.ldf. This file can load the root language file and make the appropriate changes, for -example: - - -

-
- \ProvidesGlossariesLang{en-GB}
- \RequireGlossariesLang{english}
- \glsifusedtranslatordict{British}
- {%
-   \addglossarytocaptions{\CurrentTrackedLanguage}%
-   \addglossarytocaptions{\CurrentTrackedDialect}%
- }
- {%
-   \@ifpackageloaded{polyglossia}%
-   {%
-     % Modify \glossariescaptionsenglish as appropriate for
-     % polyglossia
-   }%
-   {%
-     % Modify \glossariescaptionsenglish as appropriate for
-     % non-polyglossia
-   }%
- }
-
-

-

If the translations includes non-Latin characters, it’s necessary to provide code that’s independent of the -input encoding. Remember that while some users may use UTF-8, others may use Latin-1 or any other -supported encoding, but while users won’t appreciate you enforcing your preference on them, it’s useful to -provide a UTF-8 version for XeLaTeX and LuaLaTeX users. -

The glossaries-irish.ldf file provides this as follows: - - -

-
-\ProvidesGlossariesLang{irish}
-\glsifusedtranslatordict{Irish}
-{%
-  \addglossarytocaptions{\CurrentTrackedLanguage}%
-  \addglossarytocaptions{\CurrentTrackedDialect}%
+

+

+ The glossaries-extra package provides additional support.
+

+ +

+ +
+

17.3. Incorporating the Access Field Values

+

+These robust commands are all in the form

\glsfieldaccessdisplay{text}{entry-label}
+
They may be used to apply the supplied accessibility information to text. If the relevant access field hasn’t been set, these simply do text.

+

+The glossaries-extra package provides convenient wrapper commands such as:
\newcommand*{\glsaccessname}[1]{% 
+ \glsnameaccessdisplay{\glsentryname{1}}1% 
 }
-{%
-  \ifdefstring{\inputencodingname}{utf8}
-  {\input{glossaries-irish-utf8.ldf}}%
-  {%
-    \ifdef{\XeTeXinputencoding}% XeTeX defaults to UTF-8
-    {\input{glossaries-irish-utf8.ldf}}%
-    {\input{glossaries-irish-noenc.ldf}}
-  }
-  \ifcsdef{captions\CurrentTrackedDialect}
-  {%
-    \csappto{captions\CurrentTrackedDialect}%
-    {%
-      \glossariescaptionsirish
-    }%
-  }%
-  {%
-    \ifcsdef{captions\CurrentTrackedLanguage}
-    {
-      \csappto{captions\CurrentTrackedLanguage}%
-      {%
-        \glossariescaptionsirish
-      }%
-    }%
-    {%
-    }%
-  }%
-  \glossariescaptionsirish
+
See the glossaries-extra manual for further details.

+

+\glsnameaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the access field to text.

+

+\glstextaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the textaccess field to text.

+

+\glspluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the pluralaccess field to text.

+

+\glsfirstpluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the firstpluralaccess field to text.

+

+\glssymbolaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the symbolaccess field to text.

+

+\glssymbolpluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the symbolpluralaccess field to text.

+

+\glsdescriptionaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the descaccess field (which corresponds to the descriptionaccess key) to text.

+

+\glsdescriptionpluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the descpluralaccess field (which corresponds to the descriptionpluralaccess key) to text.

+

+\glsshortaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the shortaccess field to text.

+

+\glsshortpluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the shortpluralaccess field to text.

+

+\glslongaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the longaccess field to text.

+

+\glslongpluralaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the longpluralaccess field to text.

+

+\glsuseriaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the useriaccess field (which corresponds to the user1access key) to text.

+

+\glsuseriiaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the useriiaccess field (which corresponds to the user2access key) to text.

+

+\glsuseriiiaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the useriiiaccess field (which corresponds to the user3access key) to text.

+

+\glsuserivaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the userivaccess field (which corresponds to the user4access key) to text.

+

+\glsuservaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the uservaccess field (which corresponds to the user5access key) to text.

+

+\glsuserviaccessdisplay{text}{entry-label}
+ Applies the accessibility information from the userviaccess field (which corresponds to the user6access key) to text.

+ +

+ +
+

17.4. Obtaining the Access Field Values

+

+There are commands analogous to \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 PDF string, use the expandable \MFUsentencecase or \glsuppercase if any case change is required.

+

+\glsentryaccess{entry-label}
+ Expands to the value of the access field.

+

+\glsentrytextaccess{entry-label}
+ Expands to the value of the textaccess field.

+

+\glsentryfirstaccess{entry-label}
+ Expands to the value of the firstaccess field.

+

+\glsentrypluralaccess{entry-label}
+ Expands to the value of the pluralaccess field.

+

+\glsentryfirstpluralaccess{entry-label}
+ Expands to the value of the firstpluralaccess field.

+

+\glsentrysymbolaccess{entry-label}
+ Expands to the value of the symbolaccess field.

+

+\glsentrysymbolpluralaccess{entry-label}
+ Expands to the value of the symbolpluralaccess field.

+

+\glsentrydescaccess{entry-label}
+ Expands to the value of the descaccess field, which corresponds to the descriptionaccess key.

+

+\glsentrydescpluralaccess{entry-label}
+ Expands to the value of the descpluralaccess field, which corresponds to the descriptionpluralaccess key.

+

+\glsentryshortaccess{entry-label}
+ Expands to the value of the shortaccess field.

+

+\glsentryshortpluralaccess{entry-label}
+ Expands to the value of the shortpluralaccess field.

+

+\glsentrylongaccess{entry-label}
+ Expands to the value of the longaccess field.

+

+\glsentrylongpluralaccess{entry-label}
+ Expands to the value of the longpluralaccess field.

+

+\glsentryuseriaccess{entry-label}
+ Expands to the value of the useriaccess field, which corresponds to the user1access key.

+

+\glsentryuseriiaccess{entry-label}
+ Expands to the value of the useriiaccess field, which corresponds to the user2access key.

+

+\glsentryuseriiiaccess{entry-label}
+ Expands to the value of the useriiiaccess field, which corresponds to the user3access key.

+

+\glsentryuserivaccess{entry-label}
+ Expands to the value of the userivaccess field, which corresponds to the user4access key.

+

+\glsentryuservaccess{entry-label}
+ Expands to the value of the uservaccess field, which corresponds to the user5access key.

+

+\glsentryuserviaccess{entry-label}
+ Expands to the value of the userviaccess field, which corresponds to the user6access key.

+ +

+ +
+

17.5. Developer’s Note

+

+Currently there’s only support for accsupp. If you want to experiment with another package that provides accessibility support, define the following command before glossaries-accsupp is loaded:

+\gls@accsupp@engineinitial: accsupp
+ If this command has its default definition of accsupp when glossaries-accsupp loads then the accsupp package will automatically be loaded, otherwise it won’t and you’ll need to redefine \gls@accessibility to use the appropriate accessibility commands.

+

+\gls@accessibility{options}{PDF element}{value}{content}
+ This command is used internally by \glsaccessibility. The default definition if \gls@accsupp@engine is defined to accsupp does:
\BeginAccSupp{options,PDF element={value}}content\EndAccSupp{}
+
Otherwise it simply does content.

+ +

+ +
+

18. Sample Documents

+

+The glossaries package is provided with some sample documents that illustrate the various functions. These should be located in the samples subdirectory (folder) of the glossaries documentation directory. This location varies according to your operating system and TeX distribution. You can use texdoc to locate the main glossaries documentation. For example:

texdoc -l glossaries
This should display a list of all the files in the glossaries documentation directory with their full pathnames. (The GUI version of texdoc may also provide you with the information.)

+If you can’t find the sample files on your computer, they are also available from your nearest CTAN mirror at http://mirror.ctan.org/macros/latex/contrib/glossaries/samples/. Each sample file listed below has a hyperlink to the file’s location on the CTAN mirror.

+The glossaries-extra package and bib2gls provide some additional sample files. There are also examples in the Dickimaw Books Gallery.

+If you prefer to use UTF-8 aware engines (xelatex or lualatex) remember that you’ll need to switch from fontenc & inputenc to fontspec where appropriate.

+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 “Package: ”.) Where hyperref is loaded you will get warnings about non-existent references that look something like:

pdfTeX warning (dest): name{glo:aca} has been 
+referenced but does not exist, replaced by a fixed one
+
These warnings may be ignored on the first LaTeX run. (The destinations won’t be defined until the glossary has been created.)

+ +

+ +
+

18.1. Basic

+

+

🗋📥 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: +
    +
  1. 1.Run minimalgls.tex through LaTeX either by typing
    pdflatex minimalgls
    +
    in a terminal or by using the relevant button or menu item in your text editor or front-end. This will create the required associated files but you will not see the glossary in the document.

    +

  2. 2.If you have Perl installed, run makeglossaries on the document (§1.6). This can be done on a terminal by typing:
    makeglossaries minimalgls
    +
    otherwise use makeglossaries-lite:
    makeglossaries-lite minimalgls
    +
    If for some reason you want to call makeindex explicitly, you can do this in a terminal by typing (all on one line):
    makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
    +
    See §1.6.4 for further details on using makeindex explicitly.

    +Note that if the file name contains spaces, you will need to use the double-quote character to delimit the name.

    +

  3. 3.Run minimalgls.tex through LaTeX again (as step 1) +
+ You should now have a complete document. The number following each entry in the glossary is the location number. By default, this is the page number where the entry was referenced.

+The acronym package option creates a second glossary with the label acronym (which can be referenced with \acronymtype). If you decide to enable this option then there will be a second set of indexing files that need to be processed by makeindex. If you use makeglossaries or makeglossaries-lite you don’t need to worry about it, as those scripts automatically detect which files need to be processed and will run makeindex (or xindy) the appropriate number of times.

+If for some reason you don’t want to use makeglossaries or makeglossaries-lite and you want the acronym package option then the complete build process is:

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
+

+There are three other files that can be used as minimal working examples: mwe-gls.tex, mwe-acr.tex and mwe-acr-desc.tex.

+

+If you want to try out the glossaries-extra extension package, you need to replace the package loading line:
\usepackage[acronym]{glossaries}
+
with:
\usepackage[acronym,postdot,stylemods]{glossaries-extra}
+
Note the different default package options. (You may omit the acronym package option in both cases if you only want a single glossary.) The glossaries-extra package internally loads the base glossaries package so you don’t need to explicitly load both (in fact, it’s better to let glossaries-extra load glossaries).

+Next, replace:

\setacronymstyle{long-short}
+
with:
\setabbreviationstyle[acronym]{long-short}
+
The optional argument acronym identifies the category that this style should be applied to. The \newacronym command provided by the base glossaries package is redefined by glossaries-extra to use \newabbreviation with the category set to acronym.

+If you prefer to replace \newacronym with \newabbreviation then the default category is abbreviation so the style should instead be:

\setabbreviationstyle[abbreviation]{long-short}
+
This is actually the default category if the optional argument is omitted, so you can simply do:
\setabbreviationstyle{long-short}
+
The long-short style is the default for the abbreviation category so you can omit this line completely if you replace \newacronym. (The default style for the acronym category is short-nolong, which only shows the short form on first use.)

+As mentioned earlier, the acronym package option creates a new glossary with the label acronym. This is independent of the acronym category. You can use the acronym package option with either \newacronym or \newabbreviation.

+You may instead prefer to use the abbreviations package option, which creates a new glossary with the label abbreviations:

\usepackage[abbreviations,postdot,stylemods]{glossaries-extra}
+
This can again be used with either \newacronym or \newabbreviation, but the file extensions are different. This isn’t a problem if you are using makeglossaries or makeglossaries-lite. If you are explicitly calling makeindex (or xindy) then you need to modify the file extensions. See the glossaries-extra user manual for further details.

+If you use both the acronym and abbreviations package options then \newacronym will default to the acronym glossary and \newabbreviation will default to the abbreviations glossary.

+

+If you want to try bib2gls, you first need to convert the document to use glossaries-extra as described above. Then add the record package option. For example:
\usepackage[record,postdot,stylemods]{glossaries-extra}
+
Next you need to convert the entry definitions into the bib format required by bib2gls. This can easily be done with convertgls2bib. For example:
convertgls2bib --preamble-only minimalgls.tex entries.bib
+
This will create a file called entries.bib. Next, replace:
\makeglossaries
+
with:
\GlsXtrLoadResources[src={entries}]
+
Now remove all the entry definitions in the document preamble(\longnewglossaryentry, \newglossaryentry and \newacronym or \newabbreviation).

+The abbreviation style command must go before \GlsXtrLoadResources. For example (if you are using \newacronym):

\setabbreviationstyle[acronym]{long-short}
+\GlsXtrLoadResources[src={entries}]
+
Finally, replace:
\printglossaries
+
with:
\printunsrtglossaries
+
The document build is now:
pdflatex minimalgls
+bib2gls minimalgls
+pdflatex minimalgls
+

+sampleDB.tex This document illustrates how to load external files containing the glossary entry definitions. It also illustrates how to define a new glossary type. This document has the number list suppressed and uses \glsaddall to add all the entries to the glossaries without referencing each one explicitly. (Note that it’s more efficient to use glossaries-extra and bib2gls if you have a large number of entries.) To create the document do:

pdflatex sampleDB
+makeglossaries sampleDB
+pdflatex sampleDB
+
or
pdflatex sampleDB
+makeglossaries-lite sampleDB
+pdflatex sampleDB
+
The glossary definitions are stored in the accompanying files database1.tex and database2.tex. If for some reason you want to call makeindex explicitly you must have a separate call for each glossary: +
    +
  1. 1.Create the main glossary (all on one line):
    makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo
    +
  2. 2.Create the secondary glossary (all on one line):
    makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn
    +
    Note that both makeglossaries and makeglossaries-lite do this all in one call, so they not only make it easier because you don’t need to supply all the switches and remember all the extensions but they also call makeindex the appropriate number of times. +
+

+

+If you want to switch to using bib2gls with glossaries-extra, you can convert database1.tex and database2.tex to bib files using convertgls2bib:
convertgls2bib database1.tex database1.bib
+convertgls2bib database2.tex database2.bib
+
The document code then needs to be:
\documentclass{article}
+
+\usepackage[colorlinks,plainpages=false]{hyperref}
+\usepackage[record,postdot]{glossaries-extra}
+
+\newglossary*{punc}{Punctuation Characters}
+
+\GlsXtrLoadResources[src={database1},
+ selection=all,sort=en]
+\GlsXtrLoadResources[src={database2},type=punc,
+ selection=all,sort=letter-case]
+
+\begin{document}
+\printunsrtglossaries
+\end{document}
+
Note that the nonumberlist package option has been omitted. It’s not needed because there are no locations in this amended document (whereas in the original sampleDB.tex locations are created with \glsaddall). The starred \newglossary* is used since the makeindex/xindy extensions are now irrelevant.

+Instead of using makeglossaries you need to use bib2gls when you build the document:

pdflatex sampleDB
+bib2gls sampleDB
+pdflatex sampleDB
+
Note that one bib2gls call processes all the indexing (rather than one call per glossary). Unlike makeindex and xindy, bib2gls processes each resource set in turn, but the resource sets aren’t linked to a specific glossary. Multiple glossaries 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 letter groups, you need to use the --group switch:

bib2gls --group sampleDB
+
and use an appropriate glossary style.

+See also bib2gls gallery: sorting, glossaries-extra and bib2gls: An Introductory Guide and the bib2gls user manual.

+ +

+ +
+

18.2. Acronyms and First Use

+

+sampleAcr.tex This document has some sample acronyms. It also adds the glossary to the table of contents, so an extra run through LaTeX is required to ensure the document is up to date:

pdflatex sampleAcr
+makeglossaries sampleAcr
+pdflatex sampleAcr
+pdflatex sampleAcr
+
(or use makeglossaries-lite).

+Note that if the 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 makeglossaries and LaTeX call are required. In this particular example, the glossary is at the end of the document so it’s not a problem. It’s also not a problem for a glossary at the start of the document if the page numbering is reset at the end of the glossary. For example, if the glossary is at the end of the front matter in a book-style document.

+This document uses \ifglsused to determine whether to use “a” or “an” in:

… is \ifglsused{svm}{an}{a} \gls{svm} …
This clumsy bit of code can be tidied up with the glossaries-prefix package. Since that package automatically loads glossaries and passes all its options to the base package it’s possible to do a simple replacement of:
\usepackage[style=long,toc]{glossaries}
+
with:
\usepackage[style=long,toc]{glossaries-prefix}
+
The definition of “svm” now needs an adjustment:
\newacronym[description={statistical pattern recognition  technique~\protect\cite{svm}},
+prefixfirst={a~},prefix={an\space}
+]{svm}{svm}{support vector machine}
+
The clumsy text can now simply be changed to:
… is \pgls{svm} …

+

+If you want to convert this sample document to use glossaries-extra, you may want the patched version of the styles provided in glossary-long, in which case you can also add stylemods:
\usepackage[stylemods,style=long]{glossaries-extra}
+
If you want to suppress all the other glossary style packages with nostyles, then you need to specify exactly which package (or packages) that you do want:
\usepackage[nostyles,stylemods=long,style=long]{glossaries-extra}
+
(Now that glossaries-extra is being used, there are more available “long” styles in the glossary-longextra package, which you may prefer.)

+If you want to use glossaries-prefix, you can simply add the prefix package option.

+Note that the toc package option has been dropped. This is the default with glossaries-extra, so it doesn’t need to be specified now. The document build is now shorter:

pdflatex sampleAcr
+makeglossaries sampleAcr
+pdflatex sampleAcr
+
The third LaTeX call is no longer required to make the table of contents up-to-date. This is because glossaries-extra provides boilerplate text on the first LaTeX call when the indexing files are missing. This means that the glossary header is added to the toc file on the first LaTeX call, whereas with just the base glossaries package, the header isn’t present until the second LaTeX call. (As with just the base glossaries package, if the 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 glossaries package.)

+The other different default setting is the post-description punctuation. The base package has nopostdot=false as the default. This means that a full stop (period) is automatically inserted after the description in the glossary. The extension package has nopostdottrue as the default. If you want the original behaviour then you can use nopostdot=false or the shorter synonym postdot.

+The glossaries-extra package has different abbreviation handling that’s far more flexible than that provided by the base glossaries package. The style now needs to be set with \setabbreviationstyle instead of \setacronymstyle:

\setabbreviationstyle[acronym]{long-short-sc}
+\newacronym{svm}{svm}{support vector machine}
+
(Note the different style name long-short-sc instead of long-sc-short and the optional argument acronym.) If you prefer to replace \newacronym with \newabbreviation then omit the optional argument:
\setabbreviationstyle{long-short-sc}
+\newabbreviation{svm}{svm}{support vector machine}
+
(The optional argument of \setabbreviationstyle is the category to which the style should be applied. If it’s omitted, abbreviation is assumed. You can therefore have different styles for different categories.)

+Finally, you need to replace \acrshort, \acrlong and \acrfull and their variants with \glsxtrshort, \glsxtrlong and \glsxtrfull etc.

+

🗋📥 sampleAcrDesc.tex
+ This is similar to the previous example, except that the acronyms have an associated description. As with the previous example, the glossary is added to the table of contents, so an extra run through LaTeX is required:
pdflatex sampleAcrDesc
+makeglossaries sampleAcrDesc
+pdflatex sampleAcrDesc
+pdflatex sampleAcrDesc
+
This document uses the acronym package option, which creates a new glossary used by \newacronym. This leaves the default main glossary available for general terms. However, in this case there are no general terms so the main glossary is redundant. The nomain package option will prevent its creation. Obviously, if you decide to add some terms with \newglossaryentry you will need to remove the nomain option as the main glossary will now be required.

+

+As with the previous example, if you want to convert this document to use glossaries-extra you need to make a few modifications. The most obvious one is to replace glossaries with glossaries-extra in the \usepackage argument. Again you can omit toc as this is the default for glossaries-extra. As in the previous example, you may want to use the patched styles. This document uses altlist which is provided by glossary-list, so the style can be patched with stylemods.
\usepackage[acronym,nomain,style=altlist,stylemods]{glossaries-extra}
+
You may prefer to replace the acronym option with abbreviations, but this will change the file extensions. If you use makeglossaries or makeglossaries-lite you don’t need to worry about it.

+Again the style command needs to be changed:

\setabbreviationstyle[acronym]{long-short-sc-desc}
+
(Note the change in style name long-short-sc-desc instead of long-sc-short-desc and the optional argument acronym.)

+As with the previous example, if you prefer to use \newabbreviation instead of \newacronym then you need to omit the optional argument:

\setabbreviationstyle{long-short-sc-desc}
+
The original document uses:
\renewcommand*{\glsseeitemformat}[1]{% 
+ \acronymfont{\glsentrytext{#1}}}
+
to ensure that the cross-references (from the see key) use the acronym font. The new abbreviation styles don’t use \acronymfont so this isn’t appropriate with glossaries-extra. If you’re using at least version 1.42 of glossaries-extra, you don’t need to do anything as it automatically redefines \glsseeitemformat to take the style formatting into account. If you have an earlier version you can redefine this command as follows:
\renewcommand*{\glsseeitemformat}[1]{% 
+ \ifglshasshort{#1}{\glsfmttext{#1}}{\glsfmtname{#1}}% 
 }
-
-

(Again you can use this as a template. Replace irish with your root language label and Irish with the -translator dictionary label.) -

There are now two extra files: glossaries-irish-noenc.ldf (no encoding information) and -glossaries-irish-utf8.ldf (UTF-8). -

These both define \glossariescaptionsirish but the *-noenc.ldf uses LaTeX accent commands: - - -

-
-\@ifpackageloaded{polyglossia}%
-{%
-  \newcommand*{\glossariescaptionsirish}{%
-    \renewcommand*{\glossaryname}{\textirish{Gluais}}%
-    \renewcommand*{\acronymname}{\textirish{Acrainmneacha}}%
-    \renewcommand*{\entryname}{\textirish{Ciall}}%
-    \renewcommand*{\descriptionname}{\textirish{Tuairisc}}%
-    \renewcommand*{\symbolname}{\textirish{Comhartha}}%
-    \renewcommand*{\glssymbolsgroupname}{\textirish{Comhartha\'{\i}}}%
-    \renewcommand*{\pagelistname}{\textirish{Leathanaigh}}%
-    \renewcommand*{\glsnumbersgroupname}{\textirish{Uimhreacha}}%
-  }%
-}%
-{%
-  \newcommand*{\glossariescaptionsirish}{%
-    \renewcommand*{\glossaryname}{Gluais}%
-    \renewcommand*{\acronymname}{Acrainmneacha}%
-    \renewcommand*{\entryname}{Ciall}%
-    \renewcommand*{\descriptionname}{Tuairisc}%
-    \renewcommand*{\symbolname}{Comhartha}%
-    \renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%
-    \renewcommand*{\pagelistname}{Leathanaigh}%
-    \renewcommand*{\glsnumbersgroupname}{Uimhreacha}%
-  }%
+
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:
\renewcommand*{\glsseeitemformat}[1]{\glsfmtname{#1}}
+

+The glossaries-extra package provides two additional cross-referencing keys seealso and alias, so see={[see also]{svm}} can be replaced with a more appropriate key:

\newacronym[description={Statistical pattern recognition  technique using the ``kernel trick''},
+seealso={svm},
+]{ksvm}{ksvm}{kernel support vector machine}
+

+Finally, as with the previous example, you need to replace \acrshort, \acrlong and \acrfull etc with \glsxtrshort, \glsxtrlong and \glsxtrfull etc.

+

+If you want to convert this document so that it uses bib2gls, you first need to convert it to use glossaries-extra, as above, but remember that you now need the record option:
\usepackage[acronym,nomain,style=altlist,record,postdot,stylemods]
+{glossaries-extra}
+
Now you need to convert the acronym definitions to the bib format required by bib2gls. This can be done with:
convertgls2bib --preamble-only sampleAcrDesc.tex entries.bib
+
If you retained \newacronym from the original example file, then the new entries.bib file will contain entries defined with @acronym. For example:
@acronym{ksvm,
+  description={Statistical pattern recognition technique   using the ``kernel trick''},
+  seealso={svm},
+  short={ksvm},
+  long={kernel support vector machine}
 }
-
-

whereas the *-utf8.ldf replaces the accent commands with the appropriate UTF-8 characters. -

-

-

Top

1.5 Generating the Associated Glossary Files

-

This section is only applicable if you have chosen Options 2 or 3. You can ignore this section if you have -chosen any of the other options. If you want to alphabetically sort your entries always remember to -use the sort key if the name contains any LaTeX commands (except if you’re using bib2gls). -
-

-

If this section seriously confuses you, and you can’t work out how to run external tools like makeglossaries or -makeindex, you can try using the automake package option, described in §2.5 Sorting Options, -but you will need TeX’s shell escape enabled. See also Incorporating makeglossaries or makeglossaries-lite or -bib2gls into the document build. -

In order to generate a sorted glossary with compact number lists, it is necessary to use an external indexing - - -application as an intermediate step (unless you have chosen Option 1, which uses TeX to do the sorting or -Option 5, which doesn’t perform any sorting). It is this application that creates the file containing -the code required to typeset the glossary. If this step is omitted, the glossaries will not appear in -your document. The two indexing applications that are most commonly used with LaTeX are -makeindex and xindy. As from version 1.17, the glossaries package can be used with either of these -applications. Previous versions were designed to be used with makeindex only. With the glossaries-extra -package, you can also use bib2gls as the indexing application. (See the glossaries-extra and bib2gls -user manuals for further details.) Note that xindy and bib2gls have much better multi-lingual -support than makeindex, so xindy or bib2gls are recommended if you’re not writing in English. -Commands that only have an effect when xindy is used are described in §14 Xindy (Option -3). -

This is a multi-stage process, but there are methods of automating document compilation using applications -such as latexmk and arara. With arara you can just add special comments to your document source: -

-
-% arara: pdflatex -
% arara: makeglossaries -
% arara: pdflatex -
-
With latexmk you need to set up the required dependencies.
-

-

The glossaries package comes with the Perl script makeglossaries which will run makeindex or xindy -on all the glossary files using a customized style file (which is created by \makeglossaries). See -§1.5.1 Using the makeglossaries Perl Script for further details. Perl is stable, cross-platform, -open source software that is used by a number of TeX-related applications (including xindy and latexmk). -Most Unix-like operating systems come with a Perl interpreter. TeX Live also comes with a Perl -interpreter. 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 makeglossaries or xindy. Further information is -available at http://www.perl.org/about.html and MiKTeX and Perl scripts (and one Python -script). -

The advantages of using makeglossaries:

-
    -
  • -

    It automatically detects whether to use makeindex or xindy and sets the relevant application - switches. -

  • -
  • -

    One call of makeglossaries will run makeindex/xindy for each glossary type. -

  • -
  • - - -

    If things go wrong, makeglossaries will scan the messages from makeindex or xindy and attempt - to diagnose the problem in relation to the 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 makeindex or xindy messages. -

  • -
  • -

    If makeindex warns about multiple encap values, makeglossaries will detect this and attempt to - correct the problem.1.6 - This correction is only provided by makeglossaries when makeindex is used since xindy uses the - order of the attributes list to determine which format should take precedence. (see §14.2 - Locations and Number lists.) -

    -
-

As from version 4.16, the glossaries package also comes with a Lua script called makeglossaries-lite. This -is a trimmed-down alternative to the 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 makeglossaries-lite so it’s an alternative to makeglossaries if you want to use Option 2 -(makeindex). -

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

Whilst I strongly recommended that you use the makeglossaries Perl script or the makeglossaries-lite -Lua script, it is possible to use the glossaries package without using those applications. However, note that some -commands and package options have no effect if you explicitly run makeindex/xindy. These are listed in -table 1.3. -

If you are choosing not to use makeglossaries because you don’t want to install Perl, you will only be able -to use makeindex as xindy also requires Perl. (Other useful Perl scripts include epstopdf and latexmk, so it’s -well-worth the effort to install Perl.)
-

-

Note that if any of your entries use an entry that is not referenced outside the glossary, you will need to do an -additional makeglossaries, makeindex or xindy run, as appropriate. For example, suppose you have defined the following -entries:1.7 - - -

-
-\newglossaryentry{citrusfruit}{name={citrus fruit},
-description={fruit of any citrus tree. (See also
-\gls{orange})}}
-\newglossaryentry{orange}{name={orange},
-description={an orange coloured fruit.}}
-
-

and suppose you have \gls{citrusfruit} in your document but don’t reference the orange entry, then the -orange entry won’t appear in your glossary until you first create the glossary and then do another run of -makeglossaries, makeindex or xindy. For example, if the document is called myDoc.tex, then you must -do: -


-   
pdflatex myDoc -
makeglossaries myDoc -
pdflatex myDoc -
makeglossaries myDoc -
pdflatex myDoc -
-
-(In the case of Option 4, bib2gls will scan the description for instances of commands like \gls to ensure they -are selected but an extra bib2gls call is required to ensure the locations are included, if locations lists are -required. See the and bib2gls manual for further details.) -

Likewise, an additional 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 -number lists in the glossary may need updating. -

The examples in this document assume that you are accessing makeglossaries, xindy or makeindex via a -terminal. Windows users can use the MSDOS Prompt which is usually accessed via the Start->All Programs -menu or Start->All Programs->Accessories menu. -

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

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

-
- - -


- - -
Table 1.3: Commands and package options that have no effect when using xindy or makeindex explicitly
-
- - - - -
Command or Package Option makeindex xindy
order=letter use -l use -M ord/letorder
order=word default default
xindy={language=lang,codename=code} N/A use -Llang-Ccode
\GlsSetXdyLanguage{lang} N/A use -Llang
\GlsSetXdyCodePage{code} N/A use -Ccode
-
- - -

-
-

Top

1.5.1 Using the makeglossaries Perl Script

-

The makeglossaries script picks up the relevant information from the auxiliary (aux) file and will either call -xindy or makeindex, depending on the supplied information. Therefore, you only need to pass the document’s -name without the extension to makeglossaries. For example, if your document is called myDoc.tex, type the -following in your terminal: -


-   
pdflatex myDoc -
makeglossaries myDoc -
pdflatex myDoc -
-
-You may need to explicitly load makeglossaries into Perl: -


-   
perl makeglossaries myDoc -
-
-

Windows users: TeX Live on Windows has its own internal Perl interpreter and provides -makeglossaries.exe as a convenient wrapper for the makeglossaries Perl script. MiKTeX also -provides a wrapper makeglossaries.exe but doesn’t provide a Perl interpreter, which is still -required even if you run MiKTeX’s makeglossaries.exe, so with MiKTeX you’ll need to install -Perl.1.8 -There’s more information about this at http://tex.stackexchange.com/q/158796/19862 on the TeX.SX -site. -

The makeglossaries script attempts to fork the makeindex/xindy process using open() on the piped -redirection 2>&1 | and parses the processor output to help diagnose problems. If this method fails -makeglossaries will print an “Unable to fork” warning and will retry without redirection. If you run -makeglossaries on an operating system that doesn’t support this form of redirection, then you can use the -Q -switch to suppress this warning or you can use the -k switch to make makeglossaries automatically use the -fallback method without attempting the redirection. Without this redirection, the -q (quiet) switch doesn’t -work as well. -

You can specify in which directory the aux, glo etc files are located using the -d switch. For -example: -


-   
pdflatex -output-directory myTmpDir myDoc -
makeglossaries -d myTmpDir myDoc -
-
-Note that makeglossaries assumes by default that makeindex/xindy is on your operating system’s path. If -this isn’t the case, you can specify the full pathname using -mpath/to/makeindex⟩ for makeindex or -x -⟨path/to/xindy⟩ for xindy. - - -

As from makeglossaries v2.18, if you are using makeindex, there’s a check for makeindex’s multiple encap -warning. This is where different encap values (location formats) are used on the same location for the same -entry. For example: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\makeglossaries
-\newglossaryentry{sample}{name={sample},description={an example}}
-\begin{document}
-\gls{sample}, \gls[format=textbf]{sample}.
-\printglossaries
-\end{document}
-
-

If you explicitly use makeindex, this will cause a warning and the location list will be “1, 1”. That is, the page -number will be repeated with each format. As from v2.18, makeglossaries will check for this warning -and, if found, will attempt to correct the problem by removing duplicate locations and retrying. -There’s no similar check for xindy as xindy won’t produce any warning and will simply discard -duplicates. -

For a complete list of options do makeglossaries --help. -

When upgrading the glossaries package, make sure you also upgrade your version of makeglossaries. The -current version is 4.49.
-

-

-

-

Top

1.5.2 Using the makeglossaries-lite Lua Script

-

The Lua alternative to the 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 makeglossaries-lite script is therefore limited by this and some of the -options available to the makeglossaries Perl script aren’t available here. (In particular the -d -option.) -

Note that TeX Live on Unix-like systems creates a symbolic link called makeglossaries-lite (without the -lua extension) to the actual makeglossaries-lite.lua script, so you may not need to supply the extension. -
-

-

The makeglossaries-lite script can be invoked in the same way as makeglossaries. For example, if your -document is called myDoc.tex, then do -


-   
makeglossaries-lite.lua myDoc -
- - -
-or -


-   
makeglossaries-lite myDoc -
-
-

Some of the options available with the Perl makeglossaries script are also available with the Lua -makeglossaries-lite script. For a complete list of available options, do -


-   
makeglossaries-lite.lua --help -
-
-

-

-

Top

1.5.3 Using xindy explicitly (Option 3)

-

Xindy comes with TeX Live. It has also been added to MikTeX, but if you don’t have it installed, see How to -use Xindy with MikTeX on TeX on StackExchange. -

If you want to use xindy to process the glossary files, you must make sure you have used the xindy package -option: - - -

-
-\usepackage[xindy]{glossaries}
-
-

This is required regardless of whether you use xindy explicitly or whether it’s called implicitly via applications -such as makeglossaries. This causes the glossary entries to be written in raw xindy format, so you need to use --I xindy not -I tex. -

To run xindy type the following in your terminal (all on one line): -


-   
xindy -L ⟨language⟩ -C ⟨encoding⟩ -I xindy -M ⟨style⟩ -t ⟨base⟩.glg -o ⟨base⟩.gls ⟨base⟩.glo -
-
-where ⟨language⟩ is the required language name, ⟨encoding⟩ is the encoding, ⟨base⟩ is the name of the document -without the tex extension and ⟨style⟩ is the name of the xindy style file without the xdy extension. The default -name for this style file is ⟨basexdy but can be changed via \setStyleFile{style}. You may need to specify the -full path name depending on the current working directory. If any of the file names contain spaces, you must -delimit them using double-quotes. -

For example, if your document is called myDoc.tex and you are using UTF8 encoding in English, then type -the following in your terminal: -


-   
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo -
-
-

Note that this just creates the main glossary. You need to do the same for each of the other glossaries -(including the list of acronyms if you have used the acronym package option), substituting glg, gls and glo -with the relevant extensions. For example, if you have used the acronym package option, then you would need to -do: -


-   
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn -
-
-For additional glossaries, the extensions are those supplied when you created the glossary with -\newglossary. -

Note that if you use makeglossaries instead, you can replace all those calls to xindy with just one call to -makeglossaries: -


-   
makeglossaries myDoc -
-
-Note also that some commands and package options have no effect if you use xindy explicitly instead of using -makeglossaries. These are listed in table 1.3. - - -

-

-

Top

1.5.4 Using makeindex explicitly (Option 2)

-

If you want to use makeindex explicitly, you must make sure that you haven’t used the xindy package option or -the glossary entries will be written in the wrong format. To run makeindex, type the following in your -terminal: -


-   
makeindex -s ⟨style⟩.ist -t ⟨base⟩.glg -o ⟨base⟩.gls ⟨base⟩.glo -
-
-where ⟨base⟩ is the name of your document without the tex extension and ⟨styleist is the name of the -makeindex style file. By default, this is ⟨baseist, but may be changed via \setStyleFile{style}. Note -that there are other options, such as -l (letter ordering). See the makeindex manual for further -details. -

For example, if your document is called myDoc.tex, then type the following at the terminal: -


-   
makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo -
-
-Note that this only creates the main glossary. If you have additional glossaries (for example, if you have used the -acronym package option) then you must call makeindex for each glossary, substituting glg, gls and glo with -the relevant extensions. For example, if you have used the acronym package option, then you need to type the -following in your terminal: -


-   
makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn -
-
-For additional glossaries, the extensions are those supplied when you created the glossary with -\newglossary. -

Note that if you use makeglossaries instead, you can replace all those calls to makeindex with just one call -to makeglossaries: -


-   
makeglossaries myDoc -
-
-Note also that some commands and package options have no effect if you use makeindex explicitly instead of -using makeglossaries. These are listed in table 1.3. -

-

-

Top

1.6 Note to Front-End and Script Developers

-

The information needed to determine whether to use xindy, makeindex or bib2gls is stored in the aux file. -This information can be gathered by a front-end, editor or script to make the glossaries where appropriate. This -section describes how the information is stored in the auxiliary file. - - -

-

-

Top

1.6.1 MakeIndex and Xindy

-

The file extensions used by each defined (but not ignored) glossary are given by -


\@newglossary{label}{log}{out-ext}{in-ext}

-

-where ⟨in-ext⟩ is the extension of the indexing application’s input file (the output file from the glossaries package’s -point of view), ⟨out-ext⟩ is the extension of the indexing application’s output file (the input file from the glossaries -package’s point of view) and ⟨log⟩ is the extension of the indexing application’s transcript file. The label for the -glossary is also given. This isn’t required with makeindex, but with xindy it’s needed to pick up the associated -language and encoding (see below). For example, the information for the default main glossary is written -as: - - -

-
-\@newglossary{main}{glg}{gls}{glo}
-
-

If glossaries-extra’s hybrid method has been used (with \makeglossaries[sub-list]), then the sub-list of -glossaries that need to be processed will be identified with:

-
-\glsxtr@makeglossaries{list} -
-
-

The indexing application’s style file is specified by -


\@istfilename{filename}

-

-The file extension indicates whether to use makeindex (ist) or xindy (xdy). Note that the glossary information -is formatted differently depending on which indexing application is supposed to be used, so it’s important to call -the correct one. -

For example, with arara you can easily determine whether to run makeglossaries:

-
-% arara: makeglossaries if found("aux", "@istfilename") -
-
It’s more complicated if you want to explicitly run makeindex or xindy -

Note that if you choose to explicitly call makeindex or xindy then the user will miss out on the diagnostic -information and the encap-clash fix that makeglossaries also provides.
-

-

Word or letter ordering is specified by: -


\@glsorder{order}

-

-where ⟨order⟩ can be either word or letter. -

If xindy should be used, the language and code page for each glossary is specified by -


\@xdylanguage{label}{language}
\@gls@codepage{label}{code}

-

-where ⟨label⟩ identifies the glossary, ⟨language⟩ is the root language (e.g. english) and ⟨code⟩ is the encoding -(e.g. utf8). These commands are omitted if makeindex should be used. -

If Option 1 has been used, the aux file will contain -


\@gls@reference{type}{label}{location}

-

-for every time an entry has been referenced. - - -

-

-

Top

1.6.2 Entry Labels

-

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

The glossaries-extra package also provides docdef=atom, which will create the glsdefs file but will act like -docdef=restricted.
-

-

-

-

Top

1.6.3 Bib2Gls

-

bib2glsIf Option 4 has been used, the aux file will contain one or more instances of

-
-\glsxtr@resource{options}{basename} -
-
where ⟨basename⟩ is the basename of the glstex file that needs to be created by bib2gls. If src= -{bib list} isn’t present in ⟨options⟩ then ⟨basename⟩ also indicates the name of the associated bib -file. -

For example, with arara you can easily determine whether or not to run bib2gls:

-
-% arara: bib2gls if found("aux", "glsxtr@resource") -
-
(It gets more complicated if both \glsxtr@resource and \@istfilename are present as that indicates the -hybrid record=hybrid option.) -

Remember that with bib2gls, the entries will never be defined on the first LaTeX call (because their -definitions are contained in the glstex file created by bib2gls). You can also pick up labels from the records in -aux file, which will be in the form:

-
-\glsxtr@record{label}{h-prefix}{counter}{format}{loc} -
-
or (with record=nameref)
- - -
-\glsxtr@record@nameref{label}{href prefix}{counter}{format}{location}{title} -{href anchor}{href value} -
-
or (with \glssee)
-
-\glsxtr@recordsee{label}{xr list} -
-
You can also pick up the commands defined with \glsxtrnewglslike, which are added to the aux file for -bib2gls’s benefit:
-
-\@glsxtr@newglslike{label-prefix}{cs} -
-
If \GlsXtrSetAltModifier is used, then the modifier is identified with:
-
-\@glsxtr@altmodifier{character} -
-
Label prefixes (for the \dgls set of commands) are identified with:
-
-\@glsxtr@prefixlabellist{list} -
-
- - -

-

Top

2. Package Options

-

This section describes the available glossaries package options. You may omit the =true for boolean options. -(For example, acronym is equivalent to acronym=true). -

The glossaries-extra package has additional options described in the 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 glossaries-extra may have additional package options or new values -for existing settings that aren’t listed here.
-

-

Note that ⟨key⟩=⟨value⟩ package options can’t be passed via the document class options. (This includes options -where the ⟨value⟩ part may be omitted, such as acronym.) This is a general limitation not restricted to the -glossaries package. Options that aren’t ⟨key⟩=⟨value⟩ (such as makeindex) may be passed via the document class -options.
-

-

-

Top

2.1 General Options

-

-

-

nowarn

-

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

-

-

nolangwarn

-

This suppresses the warning generated by a missing language module. -

-

-

noredefwarn

-

If you load glossaries with a class or another package that already defines glossary related commands, by default -glossaries will warn you that it’s redefining those commands. If you are aware of the consequences of using -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 nowarn option described above. (This option is -automatically switched on by glossaries-extra.) - - -

-

-

debug={value}

-

Introduced in version 4.24. The default setting is debug=false. The following values are available: false, true, -showtargets (v4.32+) and showaccsupp (v4.45+). If no value is given, debug=true is assumed. -

The glossaries-extra package provides extra values showwrgloss, that may be used to show where the indexing -is occurring, and all, which switches on all debugging options. See the glossaries-extra manual for further details. -
-

-

All values other than debug=false switch on the debug mode (and will automatically cancel the nowarn -option). The debug=showtargets option will additionally use: -


\glsshowtarget{target name}

-

-to show the hypertarget or hyperlink name when \glsdohypertarget is used by commands like -\glstarget and when \glsdohyperlink is used by commands like \gls. In math mode or inner -mode, this puts the target name in square brackets just before the link or anchor. In outer mode it -uses: -


\glsshowtargetouter{label}

-

-which by default places the target name in the margin. The font is given by: -


\glsshowtargetfont

-

-The default definition is \ttfamily\small. This command is included in the definition of -\glsshowtargetouter, so if you want to redefine that command remember to include the font. For -example: - - -

-
-\renewcommand*{\glsshowtargetouter}[1]{%
- {\glsshowtargetfont [#1]}}
-
-

-

Similarly, the debug=showaccsupp will add the accessibility support information using: -


\glsshowaccsupp{options}{tag}{replacement text}

-

-This internally uses \glsshowtarget. This option is provided for use with glossaries-accsupp. -

The purpose of the debug mode can be demonstrated with the following example document: -

-
-\documentclass{article} -
\usepackage{glossaries} -
\newglossaryentry{sample1}{name={sample1},description={example}} -
\newglossaryentry{sample2}{name={sample2},description={example}} -
\glsadd{sample2}% <- does nothing here -
\makeglossaries -
\begin{document} -
\gls{sample1}. -
\printglossaries -
\end{document} -
-
In this case, only the sample1 entry has been indexed, even though \glsadd{sample2} appears in the source -code. This is because \glsadd{sample2} has been used before the associated file is opened by -\makeglossaries. Since the file isn’t open yet, the information can’t be written to it, which is why the sample2 -entry doesn’t appear in the glossary. -

Without \makeglossaries the indexing is suppressed with Options 2 and 3 but, other than that, -commands like \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 -glossaries to format the entries (e.g. abbreviation expansion) but not display any lists of terms, abbreviations, -symbols etc (or the user may prefer to use the unsorted Options 5 or 6). It’s also possible that the user may -want to temporarily comment out \makeglossaries in order to suppress the indexing while working on a draft -version to speed compilation, or the user may prefer to use Options 1 or 4 for indexing, which don’t use -\makeglossaries. -

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

The debug mode, enabled with the debug option, - - -

-
-\usepackage[debug]{glossaries}
-
-

will write information to the log file when the indexing can’t occur because the associated file isn’t open. The -message is written in the form -

-

Package glossaries Info: wrglossary(⟨type⟩)(⟨text⟩) on input line ⟨line number⟩.

-

where ⟨type⟩ is the glossary label and ⟨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 \glsadd -or \glsaddall, try switching on the debug option and see if any information has been written to the log -file. -

-

-

savewrites={boolean}

-

This is a boolean option to minimise the number of write registers used by the glossaries package. The default is -savewrites=false. With Options 2 and 3, one write register is required per (non-ignored) glossary and one for the -style file. -

With all options except Options 1 and 4, another write register is required if the docdefs file is needed to -save document definitions. With both Options 1 and 4, no write registers are required (document definitions -aren’t permitted and indexing information is written to the aux file). If you really need document definitions -but you want to minimise the number of write registers then consider using docdef=restricted with -glossaries-extra. -

There are only a limited number of write registers, and if you have a large number of glossaries -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 savewrites is set, the glossary information will be -stored in token registers until the end of the document when they will be written to the external -files. -

This option can significantly slow document compilation and may cause the indexing to fail. Page numbers -in the number list will be incorrect on page boundaries due to TeX’s asynchronous output routine. As an -alternative, you can use the scrwfile package (part of the KOMA-Script bundle) and not use this option. -
-

-

By way of comparison, sample-multi2.tex provided with bib2gls has a total of -15 glossaries. With Options 2 or 3, this would require 46 associated files and 16 write -registers.2.1 -With bib2gls, no write registers are required and there are only 10 associated files for that particular document -(9 resource files and 1 transcript file). - - -

If you want to use TeX’s \write18 mechanism to call makeindex or xindy from your document and use -savewrites, you must create the external files with \glswritefiles before you call makeindex/xindy. Also set -\glswritefiles to nothing or \relax before the end of the document to avoid rewriting the files. For -example: - - -

-
-\glswritefiles
-\write18{makeindex -s \istfilename\space
--t \jobname.glg -o \jobname.gls \jobname}
-\let\glswritefiles\relax
-
-

-

In general, this package option is best avoided. -

-

-

translate={value}

-

This can take the following values: -

-

-true

-

If babel has been loaded and the translator package is installed, translator will be loaded and the - translations will be provided by the translator package interface. You can modify the translations - by providing your own dictionary. If the translator package isn’t installed and babel is loaded, - the glossaries-babel package will be loaded and the translations will be provided using babel’s - \addto\captionlanguage⟩ mechanism. If polyglossia has been loaded, glossaries-polyglossia will be - loaded. -

-

-false

-

Don’t provide translations, even if babel or polyglossia has been loaded. (Note that babel provides - the command \glossaryname so that will still be translated if you have loaded babel.) -

-

-babel

-

Don’t load the translator package. Instead load glossaries-babel. -

I recommend you use translate=babel if you have any problems with the translations or with PDF - bookmarks, but to maintain backward compatibility, if babel has been loaded the default is translate=true. -
-

- - -

-
-

If translate is specified without a value, translate=true is assumed. If translate isn’t specified, -translate=true is assumed if babel, polyglossia or translator have been loaded. Otherwise translate=false is -assumed. -

With glossaries-extra, if babel is detected then translate=babel is automatically passed to the base glossaries -package.
-

-

See §1.4.1 Changing the Fixed Names for further details. -

-

-

notranslate

-

This is equivalent to translate=false and may be passed via the document class options. -

-

-

hyperfirst={boolean}

-

This is a boolean option that specifies whether each term has a hyperlink on first use. The default is -hyperfirst=true (terms on first use have a hyperlink, unless explicitly suppressed using starred versions of -commands such as \gls* or by identifying the glossary with nohypertypes, described above). Note that -nohypertypes overrides hyperfirst=true. This option only affects commands that check the first use flag, such as -the \gls-like commands (for example, \gls or \glsdisp), but not the \glstext-like commands (for example, -\glslink or \glstext). -

The hyperfirst setting applies to all glossary types (unless identified by nohypertypes or defined -with \newignoredglossary). It can be overridden on an individual basis by explicitly setting the -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 apply this to just the acronyms (where the first use explains the meaning of -the acronym) but not for ordinary glossary entries (where the first use is identical to subsequent uses). In this -case, you can use hyperfirst=false and apply \glsunsetall to all the regular (non-acronym) glossaries. For -example: - - -

-
- \usepackage[acronym,hyperfirst=false]{glossaries}
- % acronym and glossary entry definitions
- % at the end of the preamble
- \glsunsetall[main]
-
-

-

Alternatively you can redefine the hook -


\glslinkcheckfirsthyperhook

-

-which is used by the commands that check the first use flag, such as \gls. Within the definition of this -command, you can use \glslabel to reference the entry label and \glstype to reference the glossary type. You -can also use \ifglsused to determine if the entry has been used. You can test if an entry is an acronym by -checking if it has the long key set using \ifglshaslong. For example, to switch off the hyperlink on first use -just for acronyms: - - -

-
-\renewcommand*{\glslinkcheckfirsthyperhook}{%
- \ifglsused{\glslabel}{}%
- {%
-   \ifglshaslong{\glslabel}{\setkeys{glslink}{hyper=false}}{}%
- }%
+
If you switched to \newabbreviation then the entries will instead be defined with @abbreviation.

+Next replace \makeglossaries with the resource command, but note that the abbreviation style must be set first:

\setabbreviationstyle[acronym]{long-short-sc-desc}
+\GlsXtrLoadResources[src={entries},% terms defined in entries.bib
+ abbreviation-sort-fallback=long]
+
Another possibility is to make @acronym behave as though it was actually @abbreviation:
\setabbreviationstyle{long-short-sc-desc}
+\GlsXtrLoadResources[src={entries},abbreviation-sort-fallback=long,
+ entry-type-aliases={acronym=abbreviation}]
+
Note that the category is now abbreviation not acronym so the optional argument of \setabbreviationstyle needs to be removed.

+If the sort field is missing (which should usually be the case), then both @acronym and @abbreviation will fallback on the short field (not the name field, which is usually set by the style and therefore not visible to 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 bib2gls manual for further details and other examples.

+Remember to delete any \newacronym or \newabbreviation in the tex file. Finally replace \printglossary with \printunsrtglossary. The document build is now:

pdflatex sampleAcrDesc
+bib2gls sampleAcrDesc
+pdflatex sampleAcrDesc
+

+Note that it’s now much easier to revert back to the descriptionless style used in sampleAcr.tex:

\setabbreviationstyle[acronym]{long-short-sc}
+\GlsXtrLoadResources[src={entries},ignore-fields={description}]
+
With the other options it would be necessary to delete all the description fields from the abbreviation definitions in order to omit them, but with bib2gls you can simply instruct bib2gls to ignore the description. This makes it much easier to have a large database of abbreviations for use across multiple documents that may or may not require the description.

+

🗋📥 sampleDesc.tex
+ This is similar to the previous example, except that it defines the acronyms as normal entries using \newglossaryentry instead of \newacronym. As with the previous example, the glossary is added to the table of contents, so an extra run through LaTeX is required:
pdflatex sampleDesc
+makeglossaries sampleDesc
+pdflatex sampleDesc
+pdflatex sampleDesc
+
This sample file demonstrates the use of the first and text keys but in general it’s better to use \newacronym instead as it’s more flexible. For even greater flexibility use \newabbreviation provided by glossaries-extra. For other variations, such as showing the symbol on first use, you may prefer to make use of the post-link category hook. For examples, see the section “Changing the Formatting” in glossaries-extra and bib2gls: An Introductory Guide.

+

🗋📥 sampleFnAcrDesc.tex
+ This document has some sample acronyms that use the footnote-sc-desc acronym style. As with the previous example, the glossary is added to the table of contents, so an extra run through LaTeX is required:
pdflatex sampleFnAcrDesc
+makeglossaries sampleFnAcrDesc
+pdflatex sampleFnAcrDesc
+pdflatex sampleFnAcrDesc
+
+If you want to convert this sample document to use glossaries-extra, then you just need to follow the same steps as for sampleAcr.tex with a slight modification. This time the short-sc-footnote-desc abbreviation style is needed:
\setabbreviationstyle[acronym]{short-sc-footnote-desc}
+
The command redefinitions (performed with \renewcommand) should now all be deleted as they are no longer applicable.

+You may prefer to use the short-sc-postfootnote-desc style instead. There are subtle differences between the postfootnote and footnote set of styles. Try changing the abbreviation style to short-sc-footnote and compare the position of the footnote marker with the two styles.

+This modified sample file now has a shorter build:

pdflatex sampleFnAcrDesc
+makeglossaries sampleFnAcrDesc
+pdflatex sampleFnAcrDesc
+
This is because the glossaries-extra package produces boilerplate text when the indexing file is missing (on the first LaTeX run) which adds the glossary title to the table of contents (toc) file.

+

🗋📥 sampleCustomAcr.tex
+ This document has some sample acronyms with a custom acronym style. It also adds the glossary to the table of contents, so an extra run through LaTeX is required:
pdflatex sampleCustomAcr
+makeglossaries sampleCustomAcr
+pdflatex sampleCustomAcr
+pdflatex sampleCustomAcr
+
This is a slight variation on the previous example where the name is in the form long (short) instead of short (long), and the sort key is set to the long form instead of the short form. On first use, the footnote text is in the form long: description (instead of just the long form). This requires defining a \newacronym style that inherits from the footnote-sc-desc style.

+

+The conversion to glossaries-extra starts in much the same way as the previous examples:
\usepackage[acronym,nomain,postdot,stylemods,style=altlist]
+{glossaries-extra}
+
The abbreviation styles have associated helper commands that may be redefined to make minor modifications. These redefinitions should be done before the abbreviations are defined.

+The short-sc-footnote-desc abbreviation style is the closest match to the requirement, so replace the \setacronymstyle command with:

\setabbreviationstyle[acronym]{short-sc-footnote-desc}
+
Again, you may prefer 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 long (short):

\renewcommand*{\glsxtrfootnotedescname}{% 
+  \protect\glslongfont{\the\glslongtok}% 
+  \protect\glsxtrfullsep{\the\glslabeltok}% 
+  \protect\glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}% 
 }
-
-

-

Note that this hook isn’t used by the commands that don’t check the first use flag, such as -\glstext. (You can, instead, redefine \glslinkpostsetkeys, which is used by both the \gls-like and -\glstext-like commands.) -

The glossaries-extra package provides a method of disabling the first use hyperlink according to the entry’s -associated category. For example, if you only to switch off the first use hyperlink for abbreviations and -acronyms then you simply need to set the nohyperfirst attribute for the abbreviation and acronym -categories. (Instead of using the nohyperfirst package option.) See the glossaries-extra manual for further -details. -

-

-

writeglslabels

-

This is a valueless option that will create a file called \jobname.glslabels at the end of the document. This file -simply contains a list of all defined entry labels (including those in any ignored glossaries). It’s provided for the -benefit of text editors that need to know labels for auto-completion. If you also want the name, use -writeglslabelnames. (See also glossaries-extra’s docdef=atom package option.) -

Note that with bib2gls the file will only contain the entries that bib2gls has selected from the bib files. -
-

-

-

-

writeglslabelnames

-

Similar to the above but writes both the label and name (separated by a tab). -

-

-

undefaction={value} (glossaries-extra.sty)

-

The value may be one of: - - -

-

-error

-

generate an error if a referenced entry is undefined (default, and the only available setting with - just glossaries); -

-

-warn

-

only warn if a referenced entry is undefined (automatically activated with Option 4).

-

-

-

docdef={value} (glossaries-extra.sty)

-

This option governs the use of \newglossaryentry. Available values: -

-

-false

-

\newglossaryentry is not permitted in the document environment (default with glossaries-extra - and for Option 1 with just the base glossaries package); -

-

-restricted

-

\newglossaryentry is only permitted in the document environment if it occurs before - \printglossary (not available for some indexing options); -

-

-atom

-

as restricted but creates the docdefs file for use by atom (without the limitations of docdef=true); -

-

-true

-

\newglossaryentry is permitted in the document environment where it would normally be - permitted by the base glossaries package. This will create the docdefs file if \newglossaryentry - is found in the document environment.

- - -

-

-

Top

2.2 Sectioning, Headings and TOC Options

-

-

-

toc={boolean}

-

Add the glossaries to the table of contents. Note that an extra LaTeX run is required with this option. -Alternatively, you can switch this function on and off using -


\glstoctrue

-

-and -


\glstocfalse

-

-The default value is toc=false for the base glossaries package and toc=true for glossaries-extra. -

-

-

numberline={boolean}

-

When used with the above toc=true option, this will add \numberline{} in the final argument of -\addcontentsline. This will align the table of contents entry with the numbered section titles. Note that this -option has no effect if the toc option is omitted. If toc is used without numberline, the title will be aligned with -the section numbers rather than the section titles. -

-

-

section={value}

-

This option indicates the sectional unit to use for the glossary. The value should be the control -sequence name without the leading backslash or following star (e.g. just chapter not \chapter or -chapter*). -

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

Example: - - -

-
-\usepackage[section=subsection]{glossaries}
-
-

You can omit the value if you want to use \section, i.e.  - - -

-
-\usepackage[section]{glossaries}
-
-

is equivalent to - - -

-
-\usepackage[section=section]{glossaries}
-
-

You can change this value later in the document using -


\setglossarysection{name}

-

-where ⟨name⟩ is the sectional unit. -

The start of each glossary adds information to the page header via -


\glsglossarymark{glossary title}

-

-By default this uses \@mkboth2.2 -but you may need to redefine it. For example, to only change the right header: - - -

-
-\renewcommand{\glsglossarymark}[1]{\markright{#1}}
-
-

or to prevent it from changing the headers: - - -

-
-\renewcommand{\glsglossarymark}[1]{}
-
-

If you want \glsglossarymark to use \MakeUppercase in the header, use the ucmark option described -below. -

Occasionally you may find that another package defines \cleardoublepage when it is not required. This -may cause an unwanted blank page to appear before each glossary. This can be fixed by redefining -\glsclearpage: - - -

-
-\renewcommand*{\glsclearpage}{\clearpage}
-
-

-

-

-

ucmark={boolean}

-

This is a boolean option. The default is ucmark=false, unless memoir has been loaded, in which case the default -is ucmark=true. -

If set, \glsglossarymark uses -\MakeTextUppercase2.3. -You can test whether this option has been set or not using -


\ifglsucmarktrue part\else false part\fi

-

-For example: - - -

-
-\renewcommand{\glsglossarymark}[1]{%
-  \ifglsucmark
-    \markright{\MakeTextUppercase{#1}}%
-  \else
-    \markright{#1}%
-  \fi}
-
-

If memoir has been loaded and ucmark is set, then memoir’s \memUChead is used. -

-

-

numberedsection={value}

-

The glossaries are placed in unnumbered sectional units by default, but this can be changed using -numberedsection. This option can take one of the following values:

-
    -
  • -

    false: no number, i.e. use starred form of sectioning command (e.g. \chapter* or \section*); -

  • -
  • -

    nolabel: use a numbered section, i.e. the unstarred form of sectioning command (e.g. \chapter or - \section), but the section not labelled; -

  • -
  • -

    autolabel: numbered with automatic labelling. Each glossary uses the unstarred form of a sectioning - command (e.g. \chapter or \section) and is assigned a label (via \label). The label is formed - from -


    \glsautoprefix type

    -

    - where ⟨type⟩ is the label identifying that glossary. The default value of \glsautoprefix is empty. For - example, if you load glossaries using: - - -

    -
    -     \usepackage[section,numberedsection=autolabel]
    -       {glossaries}
    -
    -

    then each glossary will appear in a numbered section, and can be referenced using something - like: - - -

    -
    -     The main glossary is in section~\ref{main} and
    -     the list of acronyms is in section~\ref{acronym}.
    -
    -

    If you can’t decide whether to have the acronyms in the main glossary or a separate list of acronyms, you - can use \acronymtype which is set to main if the acronym option is not used and is set to acronym if the - acronym option is used. For example: - - -

    -
    -     The list of acronyms is in section~\ref{\acronymtype}.
    -
    -

    You can redefine the prefix if the default label clashes with another label in your document. For - example: - - -

    -
    -     \renewcommand*{\glsautoprefix}{glo:}
    -
    -

    will add glo: to the automatically generated label, so you can then, for example, refer to the list of - acronyms as follows: - - -

    -
    -     The list of acronyms is in
    -     section~\ref{glo:\acronymtype}.
    -
    -

    Or, if you are undecided on a prefix: - - -

    -
    -     The list of acronyms is in
    -     section~\ref{\glsautoprefix\acronymtype}.
    -
    -

    -

  • -
  • -

    nameref: this is like autolabel but uses an unnumbered sectioning command (e.g. \chapter* or - \section*). It’s designed for use with the nameref package. For example: - - -

    -
    -     \usepackage{nameref}
    -     \usepackage[numberedsection=nameref]{glossaries}
    -
    -

    Now \nameref{main} will display the (TOC) section title associated with the main glossary. As above, - you can redefine \glsautoprefix to provide a prefix for the label.

-

-

-

Top

2.3 Glossary Appearance Options

-

-

-

savenumberlist={boolean}

-

This is a boolean option that specifies whether or not to gather and store the number list for each entry. The -default is savenumberlist=false. (See \glsentrynumberlist and \glsdisplaynumberlist in §5.2 -Using Glossary Terms Without Links.) This is always true if you use Option 1. -

If you use the record option (with either no value or record=only or record=nameref) then this package option -has no effect. With bib2gls, the number lists are automatically saved with the default save-locations=true -and save-loclist=true resource settings.
-

-

-

-

entrycounter={boolean}

-

This is a boolean option. (Default is entrycounter=false.) If set, each main (level 0) glossary entry will be -numbered when using the standard glossary styles. This option creates the counter glossaryentry. -

If you use this option, you can reference the entry number within the document using -


\glsrefentry{label}

-

-where ⟨label⟩ is the label associated with that glossary entry. The labelling systems uses ⟨prefix⟩⟨label⟩, where ⟨label⟩ is -the entry’s label and ⟨prefix⟩ is given by -


\GlsEntryCounterLabelPrefix

-

-(which defaults to glsentry-). - - -

If you use \glsrefentry, you must run LaTeX twice after creating the glossary files using -makeglossaries, makeindex or xindy to ensure the cross-references are up-to-date.
-

-

-

-

counterwithin={value}

-

This is a ⟨key⟩=⟨value⟩ option where ⟨value⟩ is the name of a counter. If used, this option will automatically set -entrycounter=true and the glossaryentry counter will be reset every time ⟨value⟩ is incremented. -

The glossaryentry counter isn’t automatically reset at the start of each glossary, except when glossary section -numbering is on and the counter used by counterwithin is the same as the counter used in the glossary’s -sectioning command.
-

-

If you want the counter reset at the start of each glossary, you can modify the glossary preamble -(\glossarypreamble) to use -


\glsresetentrycounter

-

-which sets glossaryentry to zero: - - -

-
-\renewcommand{\glossarypreamble}{%
-  \glsresetentrycounter
+
This command expands when the abbreviations are defined so take care to \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:
\renewcommand*{\glsxtrfootnotedescsort}{\the\glslongtok}
+
The footnote for all the footnote abbreviation styles is produced with:
\glsxtrabbrvfootnote{label}{text}
+
where text is the singular or plural long form, depending on what command was used to reference the abbreviation (\gls, \glspl etc). This can simply be redefined as:
\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{% 
+  #2: \glsentrydesc{#1}}}
+
This will mimic the result from the original sample document. Note that newer versions of glossaries-extra may have additional helper commands associated with certain abbreviation styles.

+You may prefer to replace #2 with a reference to a specific field (or fields). For example:

\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{% 
+ \Glsfmtlong{#1} (\glsfmtshort{#1}): \glsentrydesc{#1}.}}
+
As with the earlier sampleAcrDesc.tex, you need to remove or change the redefinition of \glsseeitemformat since \acronymfont is no longer appropriate.

+In the original sampleCustomAcr.tex source code, I started the description with a capital:

\newacronym[description={Statistical pattern recognition  technique using the ``kernel trick''},
+see={[see also]{svm}},
+]{ksvm}{ksvm}{kernel support vector machine}
+
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 glossary. The solution to this problem is easy with glossaries-extra. I start the description with a lowercase letter and set the glossdesc category attribute to firstuc to convert the description to sentence case in the glossary:
\glssetcategoryattribute{acronym}{glossdesc}{firstuc}
+
The abbreviation definitions are modified slightly:
\newacronym[description={statistical pattern recognition  technique using the ``kernel trick''},
+seealso={svm},
+]{ksvm}{ksvm}{kernel support vector machine}
+
Note the use of the seealso key, which is only available with glossaries-extra.

+If you prefer to use \newabbreviation instead of \newacronym, then the category needs to be abbreviation rather than acronym:

\glssetcategoryattribute{abbreviation}{glossdesc}{firstuc}
+
and the style command needs to be adjusted so that it omits the optional argument. For example:
\setabbreviationstyle{short-sc-postfootnote-desc}
+

+

🗋📥 sample-FnDesc.tex
+ This example defines a custom entry formatdisplay format that puts the description in a footnote on first use.
pdflatex sample-FnDesc
+makeglossaries sample-FnDesc
+pdflatex sample-FnDesc
+
In order to prevent nested hyperlinks, this document uses the hyperfirst=false package option (otherwise the footnote marker hyperlink would be inside the hyperlink around the link text which would result in a nested hyperlink).

+

+The glossaries-extra package has category post-link hooks that make it easier to adjust the formatting. The post-link hook is placed after the hyperlink around the link text, so a hyperlink created by \footnote in the post-link hook won’t cause a nested link. This means that the hyperfirst=false option isn’t required:
\usepackage[postdot,stylemods]{glossaries-extra}
+

+

+Never use commands like \gls or \glsdesc in the post-link hook as you can end up with infinite recursion. Use commands that don’t themselves have a post-link hook, such as \glsentrydesc or \glossentrydesc, instead.
+

+In the original sample-FnDesc.tex file, the entry format was adjusted with:

\renewcommand*{\glsentryfmt}{% 
+  \glsgenentryfmt
+  \ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}}
+
This can be changed to:
\glsdefpostlink
+{general}% category label
+{\glsxtrifwasfirstuse{\footnote{\glsentrydesc{\glslabel}}}{}}
+
This sets the post-link hook for the general category (which is the default category for entries defined with \newglossaryentry). If I added some abbreviations (which have a different category) then this change wouldn’t apply to them.

+The first paragraph in the document is:

First use: \gls{sample}.
+
So the PDF will have the word “sample” (the link text created by \gls{sample}) as a hyperlink to the entry in the glossary followed by the footnote marker, which is a hyperlink to the footnote. This is then followed by the sentence terminator. “First use: sample¹.”

+It would look tidier if the footnote marker could be shifted after the full stop. “First use: sample.¹” This can easily be achieved with a minor modification:

\glsdefpostlink
+{general}% category label
+{\glsxtrifwasfirstuse
+ {\glsxtrdopostpunc{\footnote{\glsentrydesc{\glslabel}}}}% 
+ {}% 
 }
-
-

or if you are using \setglossarypreamble, add it to each glossary preamble, as required. For -example: - - -

-
-\setglossarypreamble[acronym]{%
-  \glsresetentrycounter
-  The preamble text here for the list of acronyms.
+
You may prefer to use \glossentrydesc instead of \glsentrydesc. This will obey the glossdesc category attribute. If you append \glspostdescription, you can also pick up the postdot package option. For example:
\glssetcategoryattribute{general}{glossdesc}{firstuc}
+
+\glsdefpostlink
+{general}% category label
+{\glsxtrifwasfirstuse
+ {\glsxtrdopostpunc{\footnote{% 
+   \glossentrydesc{\glslabel}\glspostdescription}}}% 
+ {}% 
 }
-\setglossarypreamble{%
-  \glsresetentrycounter
-  The preamble text here for the main glossary.
+
Alternatively, you could just use \Glsentrydesc and explicitly append the full stop.

+

🗋📥 sample-custom-acronym.tex
+ This document illustrates how to define your own acronym style if the predefined styles don’t suit your requirements.
pdflatex sample-custom-acronym
+makeglossaries sample-custom-acronym
+pdflatex sample-custom-acronym
+
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 first use. The long form is used for the sort value. The short form is displayed in small caps in the main part of the document but in uppercase in the list of acronyms. (So it’s a slight variation of some of the examples above.) The name is set to the long form (starting with an initial capital) followed by the all caps short form in parentheses. The final requirement is that the inline form should show the long form followed by the short form in parentheses.

+

+As with sampleFnAcrDesc.tex, the short-sc-footnote-desc and short-sc-postfootnote-desc abbreviation styles 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 abbreviation style, but it can mostly inherit from the short-sc-footnote-desc or short-sc-postfootnote-desc style:
\newabbreviationstyle{custom-fn}% 
+{% 
+  \GlsXtrUseAbbrStyleSetup{short-sc-footnote-desc}% 
+}% 
+{% 
+  \GlsXtrUseAbbrStyleFmts{short-sc-footnote-desc}% 
+  \renewcommand*{\glsxtrinlinefullformat}[2]{% 
+    \glsfirstlongfootnotefont{\glsaccesslong{##1}% 
+       \ifglsxtrinsertinside##2\fi}% 
+     \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% 
+    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% 
+  }% 
+  \renewcommand*{\glsxtrinlinefullplformat}[2]{% 
+    \glsfirstlongfootnotefont{\glsaccesslongpl{##1}% 
+       \ifglsxtrinsertinside##2\fi}    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% 
+    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% 
+  }  \renewcommand*{\Glsxtrinlinefullformat}[2]{% 
+    \glsfirstlongfootnotefont{\Glsaccesslong{##1}% 
+       \ifglsxtrinsertinside##2\fi}% 
+     \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% 
+    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% 
+  }% 
+  \renewcommand*{\Glsxtrinlinefullplformat}[2]{% 
+    \glsfirstlongfootnotefont{\Glsaccesslongpl{##1}% 
+       \ifglsxtrinsertinside##2\fi}% 
+    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% 
+    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% 
+  }% 
 }
-
-

-

-

-

subentrycounter={boolean}

-

This is a boolean option. (Default is subentrycounter=false.) If set, each level 1 glossary entry will be numbered -when using the standard glossary styles. This option creates the counter glossarysubentry. The counter is reset -with each main (level 0) entry. Note that this package option is independent of entrycounter. You can reference -the number within the document using \glsrefentry{label} where ⟨label⟩ is the label associated with the -sub-entry. -

-

-

style={value}

-

This is a ⟨key⟩=⟨value⟩ option. (Default is style=list, unless classicthesis has been loaded, in which case the default is -style=index.) Its value should be the name of the glossary style to use. This key may only be used for styles -defined in glossary-list, glossary-long, glossary-super or glossary-tree. Alternatively, you can set the style -using -


\setglossarystyle{style name}

-

-(See §13 Glossary Styles for further details.) -

-

-

nolong

-

This prevents the glossaries package from automatically loading glossary-long (which means that the 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 glossary styles defined in the glossary-long package -(unless you explicitly load glossary-long). - - -

-

-

nosuper

-

This prevents the glossaries package from automatically loading glossary-super (which means that the -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 glossary styles defined in the -glossary-super package (unless you explicitly load glossary-super). -

-

-

nolist

-

This prevents the glossaries package from automatically loading 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 glossary styles -defined in the glossary-list package (unless you explicitly load glossary-list). Note that since the default style is list -(unless classicthesis has been loaded), you will also need to use the style option to set the style to something -else. -

-

-

notree

-

This prevents the glossaries package from automatically loading 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 glossary styles -defined in the glossary-tree package (unless you explicitly load glossary-tree). Note that if classicthesis has been -loaded, the default style is index, which is provided by glossary-tree. -

-

-

nostyles

-

This prevents all the predefined styles from being loaded. If you use this option, you need to load a glossary -style package (such as glossary-mcols). Also if you use this option, you can’t use the style package option. Instead -you must either use \setglossarystyle{style} or the style key in the optional argument to \printglossary. -Example: - - -

-
-\usepackage[nostyles]{glossaries}
-\usepackage{glossary-mcols}
-\setglossarystyle{mcoltree}
-
-

-

-

-

nonumberlist

-

This option will suppress the associated number lists in the glossaries (see also §12 Number Lists). -Note that if you use Options 2 or 3 (makeindex or xindy) then the locations must still be valid. This -package option merely prevents the number list from being displayed, but both makeindex and xindy -still require a location or cross-reference for each term that’s indexed. Remember that number list -includes any cross-references, so suppressing the number list will also hide the cross-references (see -below). -

-

-

seeautonumberlist

-

If you suppress the number lists with nonumberlist, described above, this will also suppress any -cross-referencing information supplied by the see key in \newglossaryentry or \glssee. If you -use seeautonumberlist, the see key will automatically implement nonumberlist=false for that -entry. (Note this doesn’t affect \glssee.) For further details see §11 Cross-Referencing -Entries. -

-

-

counter={value}

-

This is a ⟨key⟩=⟨value⟩ option. (Default is counter=page.) The value should be the name of the default counter to -use in the number lists (see §12 Number Lists). -

-

-

nopostdot={boolean}

-

This is a boolean option. If no value is specified, true is assumed. When set to true, this option suppresses the -default post description dot used by some of the predefined styles. - - -

The default setting is nopostdot=false for the base glossaries package and nopostdot=true for -glossaries-extra. -

The glossaries-extra package provides postdot, which is equivalent to nopostdot=false, and also postpunc, -which allows you to choose a different punctuation character.
-

-

-

-

nogroupskip={boolean}

-

This is a boolean option. If no value is specified, true is assumed. When set to true, this option suppresses the -default vertical gap between letter groups used by some of the predefined styles. The default setting is -nogroupskip=false. -

If you are using bib2gls without the --group (or -g) switch then you don’t need to use nogroupskip=true as -there won’t be any letter groups.
-

-

-

-

stylemods={list} (glossaries-extra.sty)

-

Load the glossaries-extra-stylemods package, which patches the predefined styles. The ⟨list⟩ argument is -optional. If present, this will also load glossary-element.sty for each ⟨element⟩ in the comma-separated -⟨list⟩. -

-

-

Top

2.4 Indexing Options

-

-

-

seenoindex={value}

-

Introduced in version 4.24, this option may take one of three values: error, warn or ignore. The see key -automatically indexes the cross-referenced entry using \glssee. This means that if this key is -used in an entry definition before the relevant glossary file has been opened, the indexing can’t be -performed. Since this is easy to miss, the glossaries package by default issues an error message if the -see key is used before \makeglossaries. This option allows you to change the error into just a -warning (seenoindex=warn) or ignore it (seenoindex=ignore) if, for example, you want to temporarily -comment out \makeglossaries to speed up the compilation of a draft document by omitting the -indexing. - - -

-

-

esclocations={boolean}

-

This is a boolean option. The default is esclocations=true, which is needed for Options 2 and 3. With Option 1 -\makenoidxglossaries changes it to esclocations=false. With Option 4 (bib2gls), this setting is -ignored. -

Both makeindex and xindy are fussy about the location formats (makeindex more so than xindy) so the -glossaries package tries to ensure that special characters are escaped and allows for the location to be substituted -for a format that’s more acceptable to the indexing application. 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 glossary file before passing it to the relevant indexing application) then use esclocations=false to -avoid the complex escaping of location values. (See “Writing information to associated files” in the documented -code for further details.) -

This isn’t an issue for Options 1 or 4 as the locations are written to the aux file so no syntax conversion is -required. -

-

-

indexonlyfirst={boolean}

-

This is a boolean option that specifies whether to only add information to the external glossary file on first use. -The default is indexonlyfirst=false, which will add a line to the file every time one of the \gls-like or -\glstext-like commands are used. Note that \glsadd will always add information to the external glossary -file2.4 (since -that’s the purpose of that command). -

Resetting the first use flag with commands like \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 first use flag before -an entry has been indexed will prevent it from being indexed (unless specifically indexed with \glsadd). -
-

-

You can customise this by redefining -


\glswriteentry{label}{wr-code}

-

-where ⟨label⟩ is the entry’s label and ⟨wr-code⟩ is the code that writes the entry’s information to the external file. -The default definition of \glswriteentry is: - - -

-
-\newcommand*{\glswriteentry}[2]{%
-  \ifglsindexonlyfirst
-    \ifglsused{#1}{}{#2}%
-  \else
-    #2%
-  \fi
+
(See the glossaries-extra user manual for further details.)

+This new custom style now needs to be set:

\setabbreviationstyle[acronym]{custom-fn}
+
Remember that if you decide to use \newabbreviation instead of \newacronym then the category will be abbreviation not acronym:
\setabbreviationstyle{custom-fn}
+
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:
\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{#2:
+\glsentrydesc{#1}.}}
+
As with sampleCustomAcr.tex, if you specifically want the singular long form then you can ignore the second argument. For example:
\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote
+ {\Glsfmtlong{#1}: \glsentrydesc{#1}.}}
+

+The 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 all caps not small caps and the long form should start with a capital letter.

\renewcommand*{\glsxtrfootnotedescname}{% 
+  \protect\glsfirstlongfootnotefont
+    {\makefirstuc{\the\glslongtok}}
+  (\protect\glsuppercase{\the\glsshorttok})% 
 }
-
-

This checks the indexonlyfirst package option (using \ifglsindexonlyfirst) and does ⟨wr-code⟩ if this is false -otherwise it only does ⟨wr-code⟩ of the entry hasn’t been used. -

For example, suppose you only want to index the first use for entries in the acronym glossary and not in the -main (or any other) glossary: - - -

-
-\renewcommand*{\glswriteentry}[2]{%
- \ifthenelse{\equal{\glsentrytype{#1}}{acronym}}
- {\ifglsused{#1}{}{#2}}%
- {#2}%
+
The inherited abbreviation style uses the short form as the sort value by default. This needs to be changed to the long form:
\renewcommand*{\glsxtrfootnotedescsort}{\the\glslongtok}
+

+

+ If you want to switch to using bib2gls, remember to set the abbreviation style before the resource command and change the default sort fallback field to long, as with sampleAcrDesc.tex.
+

+

🗋📥 sample-dot-abbr.tex
+ This document illustrates how to use the base post-link hook to adjust the space factor after acronyms.
pdflatex sample-dot-abbr
+makeglossaries sampledot-abbrf
+pdflatex sample-dot-abbr
+
This example creates a custom storage key that provides a similar function to glossaries-extra’s category key.

+

+This example is much simpler with glossaries-extra. The custom storage key, which is defined using:
\glsaddstoragekey{abbrtype}{word}{\abbrtype}
+
can now be removed.

+The category key is set to “initials” for the initialisms (which are defined with the custom \newacr command). The abbreviation styles can be set with:

\setabbreviationstyle[acronym]{long-short}
+\setabbreviationstyle[initials]{long-short}
+
The discardperiod category attribute will discard any full stop (period) following commands like \gls:
\glssetcategoryattribute{initials}{discardperiod}{true}
+
(If you want to use the noshortplural attribute then you will also need to set the pluraldiscardperiod attribute.)

+The first use is governed by the retainfirstuseperiod category attribute. If set, the period won’t be discarded if it follows the first use of commands like \gls. This is useful for styles where the first use doesn’t end with the short form. In this case, the first use of the long-short style ends with a closing parenthesis, so the end of sentence might be clearer if the period is retained:

\glssetcategoryattribute{initials}{retainfirstuseperiod}{true}
+

+The insertdots category attribute can automatically insert dots into the short form with a final space factor adjustment:

\glssetcategoryattribute{initials}{insertdots}{true}
+

+The custom helper command defined in the example needs to be slightly modified:

\newcommand*{\newabbr}[1][]{% 
+ \newabbreviation[category=initials,#1]}
+
The definitions need to be slightly modified to work with the insertdots attribute:
\newabbr{eg}{eg}{eg}
+\newabbr{ie}{ie}{ie}
+\newabbr{bsc}{B{Sc}}{Bachelor of Science}
+\newabbr{ba}{BA}{BA}
+\newabbr{agm}{AGM}{AGM}
+
(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 “Sc”.)

+The “laser” definition remains unchanged:

\newacronym{laser}{laser}{light amplification by stimulated
+emission of radiation}
+
The remaining code in the document preamblemust now be removed. (It will interfere with glossaries-extra’s category post-link hooks.) No change is required in the document body.

+See the glossaries-extra user manual for further details about category attributes and post-link hooks.

+

🗋📥 sample-font-abbr.tex
+ This document illustrates how to have different fonts for acronyms within the style. The document build is:
pdflatex sample-font-abbr
+makeglossaries sample-font-abbr
+pdflatex sample-font-abbr
+
The acronym mechanism provided by the base 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 \glsaddstoragekey that’s used to hold the font declaration (such as \em).
\glsaddstoragekey{font}{}{\entryfont}
+
A new custom acronym style is defined that fetches the font information from this new key so that it can be applied to the acronym. Some helper commands are also provided to define the different types of acronyms:
\newcommand*{\newitabbr}[1][]{\newacronym[font=\em,#1]}
+\newcommand*{\newupabbr}{\newacronym}
+
+\newitabbr{eg}{e.g.}{exempli gratia}
+\newupabbr{bsc}{BSc}{Bachelor of Science}
+
This makes the first use of \gls{eg} appear as “exempli gratia (e.g.)” whereas the first use of \gls{bsc} is “Bachelor of Science (BSc)”.

+

+This example document is much simpler with glossaries-extra. First the \usepackage command needs adjusting:
\usepackage[postdot,stylemods]{glossaries-extra}
+
The custom storage key can now be removed and also the custom acronym style. Now replace the \setacronymstyle line with:
\setabbreviationstyle[acronym]{long-short-em}
+
and change the definition of the helper commands:
\newcommand*{\newitabbr}{\newacronym}
+\newcommand*{\newupabbr}{\newabbreviation}
+
Note that the font=\em, part has been removed from the definition of the first command and the second command uses \newabbreviation instead of \newacronym. This means that \newitabbr will default to category={acronym} and \newupabbr will default to category={abbreviation}. The default style for the abbreviation category is long-short, which is the required style for this example. This just means that only the acronym category needs to have the style set (with the above \setabbreviationstyle command).

+Finally, the \acrshort, \acrlong and \acrfull commands need to be replaced with \glsxtrshort, \glsxtrlong and \glsxtrfull.

+You may notice that the spacing after “e.g.” and “i.e.” isn’t correct. This is similar to the sample-dot-abbr.tex example where the space factor needs adjusting. In this case I’ve inserted the dots manually (rather than relying on the insertdots attribute). You can either remove the dots and use insertdots with discardperiod:

\glssetcategoryattribute{acronym}{insertdots}{true}
+\glssetcategoryattribute{acronym}{discardperiod}{true}
+
+\newitabbr{eg}{eg}{exempli gratia}
+\newitabbr{ie}{ie}{id est}
+
Or you can manually insert the space factor adjustment with \@ and only use the discardperiod attribute:
\glssetcategoryattribute{acronym}{discardperiod}{true}
+
+\newitabbr{eg}{e.g.\@}{exempli gratia}
+\newitabbr{ie}{i.e.\@}{id est}
+

+You don’t have to use the acronym category. You may prefer a different label that fits better semantically. For example:

\setabbreviationstyle[latinabbr]{long-short-em}
+\newcommand*{\newlatinabbr}[1][]{\newabbreviation[category={latinabbr},#1]}
+\glssetcategoryattribute{latinabbr}{insertdots}{true}
+\glssetcategoryattribute{latinabbr}{discardperiod}{true}
+
+\newlatinabbr{eg}{e.g.\@}{exempli gratia}
+\newlatinabbr{ie}{i.e.\@}{id est}
+

+ + + +

+

18.3. Non-Page Locations

+

+

🗋📥 sampleEq.tex
+ This document illustrates how to change the entry location to something other than the page number. In this case, the equation counter is used since all glossary entries appear inside an equation environment. To create the document do:
pdflatex sampleEq
+makeglossaries sampleEq
+pdflatex sampleEq
+
The glossaries package provides some location formats, such as hyperrm and hyperbf, that allow the locations in the number list to hyperlink to the appropriate place in the document (if hyperref has been used). Since it’s not possible to include the hyperlink name in the indexing information with makeindex and xindy, the 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 equation counter in certain classes, such as the report class (which is used in this example). This means that it’s necessary to redefine \theHequation so that it has a format that fits the requirement:

\renewcommand*\theHequation{\theHchapter.\arabic{equation}}
+
If you don’t do this, the equation locations in the glossary won’t form valid hyperlinks.

+Each glossary entry represents a mathematical symbol. This means that with Options 1, 2 and 3 it’s necessary to use the sort key. For example:

\newglossaryentry{Gamma}{name={\ensuremath{\Gamma(z)}},
+description={Gamma function},sort={Gamma}}
+

+

+If you want to switch to using bib2gls, the first change you need to make is to switch from explicitly loading glossaries to loading glossaries-extra with the record package option. If record=only (or record without a value) is used, then the above redefinition of \theHequation is still required. If record=nameref is used instead then the redefinition of \theHequation isn’t required. You may also want to use the stylemods and postdot options:
\usepackage[record=nameref,stylemods,postdot,
+ ucmark,style=long3colheader,counter=equation]{glossaries-extra}
+
The entries now need to be converted into the bib format required by bib2gls, which can be done with convertgls2bib:
convertgls2bib --preamble-only sampleEq.tex entries.bib
+
This will create a file called entries.bib that starts:
% Encoding: UTF-8
+@entry{Gamma,
+  name={\ensuremath{\Gamma(z)}},
+  description={Gamma function}
 }
-
-

Here I’ve used \ifthenelse to ensure the arguments of \equal are fully expanded before the comparison is -made. -

With the glossaries-extra package it’s possible to only index first use for particular categories. For example, if -you only want this enabled for abbreviations and acronyms then you can set the indexonlyfirst attribute for the -abbreviation and acronym categories. (Instead of using the indexonlyfirst package option.) See the -glossaries-extra manual for further details. -

-

-

indexcrossrefs={boolean} (glossaries-extra.sty)

-

If true, this will automatically index (\glsadd) any cross-referenced entries that haven’t been marked as used at -the end of the document. Increases document build time. See glossaries-extra manual for further -details. -

Note that bib2gls can automatically find dependent entries when it parses the bib file. Use the selection -option to \GlsXtrLoadResources to determine the selection of dependencies.
-

-

-

-

autoseeindex={boolean} (glossaries-extra.sty)

-

If true, makes the see and seealso keys automatically index the cross-reference (with \glssee) when the entry -is defined (default, and the only option with just the base glossaries package). -

With bib2gls, use the selection option to \GlsXtrLoadResources to determine the selection of -dependencies.
-

-

-

-

record={value} (glossaries-extra.sty)

-

If not off, this option indicates that bib2gls is required. If the value is omitted, only is assumed. Permitted -values: - - -

-

-off

-

bib2gls isn’t being used; -

-

-only

-

bib2gls is being used to fetch entries from a bib file, to sort the entries and collate the number - lists, where the location information is the same as for Options 13; -

-

-nameref

-

like 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; -

-

-hybrid

-

a hybrid approach where bib2gls is used to fetch entries from a bib file but makeindex or xindy - are used for the indexing. This requires a more complicated document build and isn’t recommended.

-

See glossaries-extra manual for further details. -

-

-

equations={boolean} (glossaries-extra.sty)

-

If true, this option will cause the default location counter to automatically switch to equation when inside a -numbered equation environment. -

-

-

floats={boolean} (glossaries-extra.sty)

-

If true, this option will cause the default location counter to automatically switch to the corresponding counter -when inside a float. (Remember that with floats it’s the \caption command that increments the counter so the -location will be incorrect if an entry is indexed within the float before the caption.) - - -

-

-

indexcounter (glossaries-extra.sty)

-

This valueless option is primarily intended for use with bib2gls and hyperref allowing the page location -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 glossaries-extra manual for further -details. -

-

-

Top

2.5 Sorting Options

-

This section is mostly for Options 2 and 3. Only the sort and order options are applicable for -Option 1. -

With Options 46, only sort=none is applicable (and this is automatically implemented by -record=only and record=nameref). With bib2gls, the sort method is provided in the optional argument of -\GlsXtrLoadResources not with the sort package option. There’s no sorting with Options 5 and 6. -
-

-

-

-

sanitizesort={boolean}

-

This is a boolean option that determines whether or not to sanitize the sort value when writing to the external -glossary file. For example, suppose you define an entry as follows: - - -

-
-\newglossaryentry{hash}{name={\#},sort={#},
- description={hash symbol}}
-
-

The sort value (#) must be sanitized before writing it to the glossary file, 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: - - -

-
-\newcommand{\mysortvalue}{AAA}
-\newglossaryentry{sample}{%
-  name={sample},
-  sort={\mysortvalue},
-  description={an example}}
-
-

and you actually want \mysortvalue expanded, so that the entry is sorted according to AAA, then use the -package option sanitizesort=false. -

The default for Options 2 and 3 is sanitizesort=true, and the default for Option 1 is sanitizesort=false. -

-

-

sort={value}

-

If you use Options 2 or 3, this package option is the only way of specifying how to sort the glossaries. Only -Option 1 allows you to specify sort methods for individual glossaries via the sort key in the optional argument -of \printnoidxglossary. If you have multiple glossaries in your document and you are using Option 1, -only use the package options sort=def or sort=use if you want to set this sort method for all your -glossaries. -

This is a ⟨key⟩=⟨value⟩ option where ⟨value⟩ may be one of the following:

-
    -
  • -

    standard : entries are sorted according to the value of the sort key used in \newglossaryentry (if - present) or the name key (if sort key is missing); -

  • -
  • -

    def : entries are sorted in the order in which they were defined (the sort key in \newglossaryentry - is ignored); -

  • -
  • -

    use : entries are sorted according to the order in which they are used in the document (the sort - key in \newglossaryentry is ignored). -

    Both sort=def and sort=use set the sort key to a six digit number via -


    \glssortnumberfmt{number}

    -

    - (padded with leading zeros, where necessary). This can be redefined, if required, before the entries are - defined (in the case of sort=def) or before the entries are used (in the case of sort=use). - - -

  • -
  • -

    none : this setting is new to version 4.30 and is only for documents that don’t use \makeglossaries - (Options 2 or 3) or \makenoidxglossaries (Option 1). 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 option can’t be used with \printglossary or \printnoidxglossary (or the iterative - versions \printglossaries or \printnoidxglossaries). It may be used with glossaries-extra’s - \printunsrtglossary (Option 5).

-

Note that the group styles (such as listgroup) are incompatible with the sort=use and sort=def options. -

The default is sort=standard. When the standard sort option is in use, you can hook into the sort mechanism -by redefining: -


\glsprestandardsort{sort cs}{type}{label}

-

-where ⟨sort cs⟩ is a temporary control sequence that stores the sort value (which was either explicitly set via the -sort key or implicitly set via the name key) before any escaping of the makeindex/xindy special characters is -performed. By default \glsprestandardsort just does: -


\glsdosanitizesort

-

-which sanitizes ⟨sort cs⟩ if the sanitizesort package option is set (or does nothing if the package option -sanitizesort=false is used). -

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

Redefining \glsprestandardsort won’t affect any entries that have already been defined and will have no -effect at all if you are using sort=def or sort=use.
-

- -

Example 1 (Mixing Alphabetical and Order of Definition Sorting) -

Suppose I have three glossaries: main, acronym and notation, and let’s suppose I want the main and -acronym glossaries to be sorted alphabetically, but the notation type should be sorted in order of -definition. -

For Option 1, the sort option can be used in \printnoidxglossary: - - -

-
-\printnoidxglossary[sort=word]
-\printnoidxglossary[type=acronym,sort=word]
-\printnoidxglossary[type=notation,sort=def]
-
-

-

For Options 2 or 3, I can set the sort to standard (which is the default, but can be explicitly set via the -package option sort=standard), and I can either define all my main and acronym entries, then redefine -\glsprestandardsort to set ⟨sort cs⟩ to an incremented integer, and then define all my notation entries. -Alternatively, I can redefine \glsprestandardsort to check for the glossary type and only modify ⟨sort cs⟩ if -⟨type⟩ is notation. -

The first option can be achieved as follows: - - -

-
-\newcounter{sortcount}
-\renewcommand{\glsprestandardsort}[3]{%
-  \stepcounter{sortcount}%
-  \edef#1{\glssortnumberfmt{\arabic{sortcount}}}%
+
You may prefer to change @entry to @symbol. (This should be easy to do with your text editor’s search and replace function.)

+Note that the sort key has been omitted. This is because it typically shouldn’t be used. The difference between using @entry and @symbol is that with @entry the sort value will be obtained from the name but with @symbol the sort value will be obtained from the label. If you explicitly use the sort key then you will break this behaviour. (If you try this example out, notice the difference in the ordering if you switch between @entry and @symbol. See also bib2gls gallery: sorting.)

+Next replace \makeglossaries with:

\GlsXtrLoadResources[src={entries}]
+
If you have used record=nameref then you can remove the redefinition of \theHequation. Next remove all the lines defining the glossary entries (since they’re now defined in the bib file).

+Finally, replace \printglossary with \printunsrtglossary:

\printunsrtglossary[title={Index of Special Functions and Notations}]
+
The rest of the document remains unchanged (unless you want to use \glsxtrfmt as described in the following example).

+

🗋📥 sampleEqPg.tex
+ This is similar to the previous example, but the number lists are a mixture of page numbers and equation numbers. This example adds the glossary to the table of contents, so an extra LaTeX run is required:
pdflatex sampleEqPg
+makeglossaries sampleEqPg
+pdflatex sampleEqPg
+pdflatex sampleEqPg
+
As with the previous example, entries are defined like this:
\newglossaryentry{Gamma}name={\ensuremath{\Gamma(z)}},
+description={Gamma function},sort={Gamma}
+
The counter=equation package option is used to set the default indexing counter to equation. This means that it has to be changed for indexing outside of any numbered equation. For example:
\glslink[format=hyperbf,counter=page]{Gamma}{gamma function}
+
I’ve set the format to hyperbf to indicate that this is a primary reference. (Note that I’m using hyperbf not textbf in order to include a hyperlink in the location.)

+The link text here is almost identical to the description. The only difference is that the description starts with a capital (sentence case). If it started with a lowercase character instead, I could simply use \glsdesc instead of \glslink. If I change the entry descriptions so that they all start with a lowercase letter then I would need to create a custom glossary style that used \Glossentrydesc instead of \glossentrydesc.

+

+If I switch to using glossaries-extra I wouldn’t need a new glossary style. Instead I could just use the glossdesc category attribute to perform the case change. Remember that the first change to make is to replace glossaries with glossaries-extra:
\usepackage[style=long3colheader,postdot,stylemods,
+            counter=equation]{glossaries-extra}
+
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:
\newglossaryentry{Gamma}{name={\ensuremath{\Gamma(z)}},
+description={gamma function},sort={Gamma}}
+
The glossdesc category attribute needs setting:
\glssetcategoryattribute{general}{glossdesc}{firstuc}
+
This means that I can now use \glsdesc instead of \glslink.

+It’s a bit cumbersome typing [format=hyperbf,counter=page] for each primary reference, but glossaries-extra provides a convenient way of having a third modifier for commands like \gls and \glstext. This needs to be a single punctuation character (but not * or + which are already in use). For example:

\GlsXtrSetAltModifier{!}{format=hyperbf,counter=page}
+
Now \glsdesc!{Gamma} is equivalent to:
\glsdesc[format=hyperbf,counter=page]{Gamma}
+
So the text at the start of the “Gamma Functions” chapter is now just:
The \glsdesc!{Gamma} is defined as
+
which is much more compact. Similar changes can be made for the other instance of \glslink where the link text is just the description:
The \glsdesc!{erf} is defined as
+

+There are three other instances of \glslink, such as:

\glslink{Gamma}{\Gamma(x+1)}
+
If I just use \gls{Gamma} then I would get \(𝛤(z)\) as the link text. 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 glossaries package, one simple solution that works for this example is to save just the function symbol in the symbol field, for example:

\newglossaryentry{Gamma}{name={\ensuremath{\Gamma(z)}},
+symbol={\ensuremath{\Gamma}},
+description={gamma function},sort={Gamma}}
+
and then use:
\glssymbol{Gamma}[(\Gamma(x+1))]
+
(which includes the function parameter inside the link text) or just:
\glssymbol{Gamma}(\Gamma(x+1))
+
(which has the function parameter after the link text). This is a convenient approach where the extra material can simply follow the symbol, and it can also be used with glossaries-extra.

+The glossaries-extra package provides another possibility. It requires a command that takes a single argument, for example:

\newcommand{\Gammafunction}[1]{\Gamma(#1)}
+
The control sequence name (the command name without the leading backslash) is stored in the field identified by the command \GlsXtrFmtField (this should be the internal field name not the key name, see Table 4.1). The default is useri which corresponds to the user1 key. This means that the “Gamma” entry would need to be defined with user1={Gammafunction}. With this approach, each function entry would need a separate associated command.

+Another approach is to store the parameterless function in the symbol key (as earlier) and have a more generic command that uses this symbol. This requires the entry label, which can be obtained with \glslabel within the link text:

\newcommand{\entryfunc}[1]{\glsentrysymbol{\glslabel}(#1)}
+
(Obviously, this command can’t be used outside of the link text or post-link hooks since it uses \glslabel.)

+So the entry now needs the parameterless function in symbol and the control sequence name of this generic command in user1. For example:

\newglossaryentry{Gamma}{name={\ensuremath{\Gamma(z)}},
+symbol={\ensuremath{\Gamma}},user1={entryfunc},
+description={gamma function},sort={Gamma}}
+
(This doesn’t need to be done for the “C” and “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:

\newcommand{\func}[2]{#1(#2)}
+\newcommand{\entryfunc}[1]{\func{\glsentrysymbol{\glslabel}}{#1}}
+\newcommand{\newfunc}[5][]{% 
+ \newglossaryentry{#2}{name={\ensuremath{\func{#3}{#4}}},
+   symbol={#3},
+   user1={entryfunc},
+   description={#5},
+   sort={#2},#1
+ }% 
 }
-
-

The second option can be achieved as follows: - - -

-
-\newcounter{sortcount}
-\renewcommand{\glsprestandardsort}[3]{%
-  \ifdefstring{#2}{notation}%
-  {%
-     \stepcounter{sortcount}%
-     \edef#1{\glssortnumberfmt{\arabic{sortcount}}}%
-  }%
-  {%
-     \glsdosanitizesort
-  }%
+
The entries can now be defined using this custom \newfunc command. For example:
\newfunc{Gamma}{\Gamma}{z}{gamma function}
+\newfunc[sort={gamma1}]{gamma}{\gamma}{\alpha,x}{lower 
+  incomplete gamma function}
+\newfunc[sort={Gamma2}]{iGamma}{\Gamma}{\alpha,x}{upper 
+  incomplete gamma function}
+

+Note that in \newfunc the symbol key doesn’t have its value encapsulated with \ensuremath so \glssymbol will need to explicitly be placed in math mode. If you switch to a glossary style that displays the symbol, you will either need to adjust the definition of \newfunc to use \ensuremath in the symbol field or you can add the encapsulation with the glosssymbolfont category attribute.

+Now \glslink{Znu}{Z_\nu} can simply be replaced with \glssymbol{Znu} (no parameter is required in this case). For the other cases, where the parameter is different from that given in the text field (which is obtained from the name), you can use \glsxtrfmt. For example, \glslink{Gamma}{\Gamma(x+1)} can now be replaced with:

\glsxtrfmt{Gamma}{x+1}
+
This effectively works like \glslink but omits the post-link hook. (See the glossaries-extra user manual for further details.)

+

+Don’t use \glsxtrfmt within the argument of another \glsxtrfmt command (or inside any other link text).
+

+Similarly \glslink{Gamma}{\Gamma(\alpha)} can now be replaced with:

\glsxtrfmt{Gamma}{\alpha}
+
Note that it’s still possible to use:
\glssymbol{Gamma}[(\alpha)]
+
You may prefer to define a helper command that makes it easier to switch between your preferred method. For example:
\newcommand*{\Fn}[3][]{\glssymbol[#1]{#2}[(#3)]}
+
or:
\newcommand*{\Fn}[3][]{\glsxtrfmt[#1]{#2}{#3}}
+

+

+If you want to convert this example so that it works with bib2gls, first convert it to use glossaries-extra (as described above), and then follow the instructions from sampleEq.tex. The convertgls2bib application recognises \newcommand so it will be able to parse the custom \newfunc commands.

+Note that bib2gls allows you to separate the locations in the number list into different groups according to the counter used for the location. This can be done with the loc-counters resource option. It’s also possible to identify primary formats (such as hyperbf used in this example) using the primary-location-formats option. The primary locations can then be given a more prominent position in the number list. See the bib2gls user manual for further details.

+

🗋📥 sampleSec.tex
+ This document also illustrates how to change the location to something other than the page number. In this case, the section counter is used. This example adds the glossary to the table of contents, so an extra LaTeX run is required:
pdflatex sampleSec
+makeglossaries sampleSec
+pdflatex sampleSec
+pdflatex sampleSec
+
Note that there are conflicting location formats, which trigger a warning from makeindex:
## Warning (input = sampleSec.glo, line = 6; output = sampleSec.gls, line = 9):
+   -- Conflicting entries: multiple encaps for the same page under same key.
+
+## Warning (input = sampleSec.glo, line = 2; output = sampleSec.gls, line = 10):
+   -- Conflicting entries: multiple encaps for the same page under same key.
+
This is the result of indexing an entry multiple times for the same location with different values of the format key (encaps). (makeindex assumes that the location is a page number)

+In this case, it’s caused by three references to the “ident” entry in section 2.1:

\gls[format=hyperit]{ident}
+\glspl{ident} % default format=glsnumberformat
+\gls*[format=hyperbf]{ident}
+

+If you use the makeglossaries Perl script it will detect the warnings in the makeindex transcript file and attempt to fix the conflict by removing entries from the glo file:

Multiple encaps detected. Attempting to remedy.
+Reading sampleSec.glo...
+Writing sampleSec.glo...
+Retrying
+
(Range formats have highest precedence. The default glsnumberformat has the lowest precedence.)

+If you use makeglossaries-lite or call makeindex directly then the problem won’t be fixed and the glossary will end up with the rather odd number list for the identity matrix entry consisting of three references to section 2.1: the first in the default font, followed by bold (hyperbf) and then italic (hyperit), which results in 2.1, 2.1, 2.1. If you use makeglossaries then only the bold entry (2.1) will be present. However, if you don’t want the problem corrected, call makeglossaries with the -e switch.

+If you switch to xindy:

\usepackage[xindy,style=altlist,toc,counter=section]{glossaries}
+
then the conflict will be resolved using the number format attribute list order of priority. In this case, 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:
\newcommand*{\primary}[1]{\hyperit{#1}}
+\GlsAddXdyAttribute{primary}
+
and change \gls[format=hyperit] to \gls[format=primary] etc. This will give format=primary the highest priority. (It’s also better practice to provide this kind of semantic command.)

+With bib2gls, you can supply rules to deal with location format conflicts, as illustrated below.

+

+In order to switch to bib2gls, first replace glossaries with glossaries-extra, and add the record package option. Remember that glossaries-extra has a different set of defaults and you may also want to patch the predefined base styles. For example:
\usepackage[style=altlist,postdot,stylemods,counter=section]
+{glossaries-extra}
+

+The entry definitions now need to be converted into bib2gls format and saved in a bib file (say, entries.bib). You can use convertgls2bib:

convertgls2bib --preamble-only sampleSec.tex entries.bib
+

+Next replace \makeglossaries with:

\GlsXtrLoadResources[src={entries}]
+
and remove all the \newglossaryentry commands.

+Finally, replace \printglossaries with \printunsrtglossaries. The document build is now:

pdflatex sampleSec
+bib2gls sampleSec
+pdflatex sampleSec
+
As with the original example, there’s still a location format conflict, which bib2gls warns about:
Warning: Entry location conflict for formats: hyperbf and hyperit
+Discarding: {ident}{}{section}{hyperbf}{2.1}
+Conflicts with: {ident}{}{section}{hyperit}{2.1}
+
This means that it has discarded the bold location and kept the italic one. (As with makeglossaries, range formats have the highest priority and 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:

\newcommand*{\hyperbfit}[1]{\textbf{\hyperit{#1}}}
+
Now bib2gls needs to be invoked with the appropriate mapping with the --map-format or -m switch:
bib2gls -m "hyperbf:hyperbfit,hyperit:hyperbfit" sampleSec
+
If you are using arara the directive should be:
% arara: bib2gls: { mapformats: [ [hyperbf, hyperbfit],
+% arara: -->  [hyperit, hyperbfit] ] }
+

+If you try out this example, notice the difference between record=only and record=nameref. If you use the latter, the locations will now be the section titles rather than the section numbers. If you use the record=nameref setting you can customize the location by defining the command:

\glsxtrcounterlocfmt{location}{title}
+

+In this case the counter is section, so the command should be \glsxtrsectionlocfmt. It takes two arguments: the first is the location and the second is the title. For example:

\newcommand*{\glsxtrsectionlocfmt}[2]{\S#1 #2}
+
(The only command of this type that is defined by default is the one for the equation counter, \glsxtrequationlocfmt.) Make sure that you have at least version 1.42 of glossaries-extra.

+ +

+ +
+

18.4. Multiple Glossaries

+

+See also sampleSort.tex in §18.5, which has three glossaries.

+

🗋📥 sampleNtn.tex
+ This document illustrates how to create an additional glossary type. This example adds the glossary to the table of contents, so an extra LaTeX run is required:
pdflatex sampleNtn
+makeglossaries sampleNtn
+pdflatex sampleNtn
+pdflatex sampleNtn
+
Note that if you want to call makeindex explicitly instead of using the makeglossaries or makeglossaries-lite scripts then you need to call makeindex twice: +
    +
  1. 1.Create the main glossary (all on one line):
    makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
    +
  2. 2.Create the secondary glossary (all on one line):
    makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn
    +
    +
+ This document creates a new glossary using:
\newglossary[nlg]{notation}{not}{ntn}{Notation}
+
This defines a glossary that can be identified with the label “notation” with the default title “Notation”. The other arguments are the file extensions required with Options 2 and 3. For those two options, the glossaries package needs to know the input and output files required by makeindex or xindy.

+(The optional argument is the file extension of the indexing transcript file, which glossaries doesn’t need to know about (unless automake is used), but it writes the information to the aux file for the benefit of makeglossaries and makeglossaries-lite.)

+If you switch to a different indexing option then these file extensions aren’t required, in which case it’s simpler to use the starred form:

\newglossary*{notation}{Notation}
+

+This example uses a label prefixing system to differentiate between the different types of entries. (If you use babel with a language that makes : (colon) active you will need to change the prefix.) For example, the term “set” is defined as:

\newglossaryentry{gls:set}{name={set},
+description={A collection of distinct objects}}
+
and the set notation is defined as:
\newglossaryentry{not:set}{type={notation},
+name={\ensuremath{\mathcal{S}}},
+description={A \gls{gls:set}},sort={S}}
+
Notice that the latter description contains \gls. This means you shouldn’t use \glsdesc with this entry otherwise you will end up with nested links.

+

+The glossaries-extra package provides a command for use in within field values to prevent nested link text:
\glsxtrp{field}{label}
+
There are convenient shortcuts for common fields: \glsps{label} (for the short field) and \glspt{label} (for the text field). So the set notation definition can be modified:
\newglossaryentry{not:set}{type={notation},
+name={\ensuremath{\mathcal{S}}},
+description={A \glspt{gls:set}},sort={S}}
+
This will stop the inner reference from causing interference if you use \glsdesc. It will also suppress indexing within the glossary but will have a hyperlink (if hyperref is used).

+The glossaries-extra package provides a way of defining commands like \gls that automatically insert a prefix. For example:

\glsxtrnewgls{not:}{\sym}
+\glsxtrnewglslike{gls:}{\term}{\termpl}{\Term}{\Termpl}
+
(there’s no point providing commands for plural or case-changing with symbols). Now \gls{not:set} can be replaced with \sym{set} and \gls{gls:set} can be replaced with \term{set}.

+

+These two commands are primarily provided for the benefit of bib2gls as the information is written to the aux file. This allows bib2gls to recognise the custom commands if they have been used in the bib files. When combined with label-prefix and ext-prefixes (see below) this makes it much simpler to change the prefixes if necessary.

+If you want to convert this document to use bib2gls, remember that you need the record or record=nameref option. For example:

\usepackage[record,postdot,stylemods]{glossaries-extra}
+
As with earlier examples, convertgls2bib can be used to convert the entry definitions into the required bib format. You may prefer to split the entries into separate files according to type. (Requires at least 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:
convertgls2bib --split-on-type --preamble-only sampleNtn.tex entries.bib
+
This will create a file called entries.bib that contains the entries that didn’t have a type assigned in the original file, such as:
@entry{gls:set,
+  name={set},
+  description={A collection of distinct objects}
 }
-
-

(\ifdefstring is defined by the etoolbox package.) For a complete document, see the sample file -sampleSort.tex.

-
-

-

____________________________

- -

Example 2 (Customizing Standard Sort (Options 2 or 3)) -

Suppose you want a glossary of people and you want the names listed as ⟨first-name⟩ ⟨surname⟩ in the glossary, -but you want the names sorted by ⟨surname⟩, ⟨first-name⟩. You can do this by defining a command called, say, -\name{first-name}{surname} that you can use in the name key when you define the entry, but -hook into the standard sort mechanism to temporarily redefine \name while the sort value is being -set. -

First, define two commands to set the person’s name: - - -

-
-\newcommand{\sortname}[2]{#2, #1}
-\newcommand{\textname}[2]{#1 #2}
-
-

and \name needs to be initialised to \textname: - - -

-
-\let\name\textname
-
-

Now redefine \glsprestandardsort so that it temporarily sets \name to \sortname and expands the sort -value, then sets \name to \textname so that the person’s name appears as ⟨first-name⟩ ⟨surname⟩ in the -text: - - -

-
-\renewcommand{\glsprestandardsort}[3]{%
- \let\name\sortname
- \edef#1{\expandafter\expandonce\expandafter{#1}}%
- \let\name\textname
- \glsdosanitizesort
+
It will also create a file called notation.bib that contains the entries that had the type set to “notation” in the original file, such as:
@entry{not:set,
+  name={\ensuremath{\mathcal{S}}},
+  description={A \glspt{gls:set}}
 }
-
-

(The somewhat complicate use of \expandafter etc helps to protect fragile commands, but care is still -needed.) -

Now the entries can be defined: - - -

-
-\newglossaryentry{joebloggs}{name={\name{Joe}{Bloggs}},
-  description={some information about Joe Bloggs}}
-\newglossaryentry{johnsmith}{name={\name{John}{Smith}},
-  description={some information about John Smith}}
-
-

For a complete document, see the sample file samplePeople.tex.

-
-

-

____________________________

-

-

-

order={value}

-

This may take two values: word or letter. The default is word ordering. -

Note that with Options 2 and 3, the order option has no effect if you don’t use makeglossaries. -
-

-

If you use Option 1, this setting will be used if you use sort=standard in the optional argument of -\printnoidxglossary: - - -

-
-\printnoidxglossary[sort=standard]
-
-

Alternatively, you can specify the order for individual glossaries: - - -

-
-\printnoidxglossary[sort=word]
-\printnoidxglossary[type=acronym,sort=letter]
-
-

-

With bib2gls, use the break-at option in \GlsXtrLoadResources instead of order.
-

-

-

-

makeindex

-

(Option 2) The glossary information and indexing style file will be written in makeindex format. If you use -makeglossaries, it will automatically detect that it needs to call makeindex. If you don’t use makeglossaries, -you need to remember to use makeindex not xindy. The indexing style file will been given a ist -extension. -

You may omit this package option if you are using Option 2 as this is the default. It’s available in case you -need to override the effect of an earlier occurrence of xindy in the package option list. -

-

-

xindy

-

(Option 3) The glossary information and indexing style file will be written in xindy format. If you use -makeglossaries, it will automatically detect that it needs to call xindy. If you don’t use makeglossaries, -you need to remember to use xindy not makeindex. The indexing style file will been given a xdy -extension. -

This package option may additionally have a value that is a ⟨key⟩=⟨value⟩ comma-separated list to override the -language and codepage. For example: - - -

-
-\usepackage[xindy={language=english,codepage=utf8}]
-  {glossaries}
-
-

You can also specify whether you want a number group in the glossary. This defaults to true, but can be -suppressed. For example: - - -

-
-\usepackage[xindy={glsnumbers=false}]{glossaries}
-
-

If no value is supplied to this package option (either simply writing xindy or writing xindy={}) then the -language, codepage and number group settings are unchanged. See §14 Xindy (Option 3) for further -details on using xindy with the glossaries package. -

-

-

xindygloss

-

(Option 3) This is equivalent to xindy={} (that is, the xindy option without any value supplied) and may be -used as a document class option. The language and code page can be set via \GlsSetXdyLanguage and -\GlsSetXdyCodePage (see §14.1 Language and Encodings.) -

-

-

xindynoglsnumbers

-

(Option 3) This is equivalent to xindy={glsnumbers=false} and may be used as a document class -option. -

-

-

automake={value}

-

This is option was introduced to version 4.08 as a boolean option. As from version 4.42 it may now take three -values: false (default), true or immediate. If no option is supplied, immediate is assumed. The -option automake=true will attempt to run makeindex or xindy using TeX’s \write18 mechanism -at the end of the document. The option automake=immediate will attempt to run makeindex or -xindy at the start of \makeglossaries using \immediate (before the glossary files have been -opened). -

In the case of automake=true, the associated files are created at the end of the document ready -for the next LaTeX run. Since there is a possibility of commands such as \gls occurring on the -last page of the document, it’s not possible to use \immediate to close the associated file or with -\write18 since the writing of the final indexing lines may have been delayed. In certain situations -this can mean that the \write18 fails. In such cases, you will need to use automake=immediate -instead. -

With automake=immediate, you will get a warning on the first LaTeX run as the associated glossary files -don’t exist yet. - - -

Since this mechanism can be a security risk, some TeX distributions disable it completely, in which case this -option won’t have an effect. (If this option doesn’t appear to work, search the log file for “runsystem” and see if -it is followed by “enabled” or “disabled”.) -

Some distributions allow \write18 in a restricted mode. This mode has a limited number of trusted -applications, which usually includes makeindex but may not include xindy. So if you have the restricted mode -on, automake should work with makeindex but may not work with xindy. -

However even in unrestricted mode this option may not work with xindy as xindy uses language names that -don’t always correspond with babel’s language names. (The makeglossaries script applies mappings to assist -you.) Note that you still need at least two LaTeX runs to ensure the document is up-to-date with this -setting. -

Since this package option attempts to run the indexing application on every LaTeX run, its use should be -considered a last resort for those who can’t work out how to incorporate the indexing application into their -document build. The default value for this option is automake=false. -

-

-

disablemakegloss

-

This valueless option indicates that \makeglossaries and \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 §1.2 Indexing Options and automatically performs \makeglossaries or -\makenoidxglossaries but you don’t want this. (For example, you want to use a different indexing method or -you want to disable indexing while working on a draft document.) -

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

-

-

restoremakegloss

-

Cancels the effect of disablemakegloss. This option may be used in \setupglossaries. It issues a -warning if \makeglossaries or \makenoidxglossaries has already been used whilst enabled. For -example, suppose the class customclass.cls automatically loads glossaries and does \makeglossaries -but you need an extra glossary, which has to be defined before \makeglossaries, then you can -do: - - -

-
-\documentclass[disablemakegloss]{customclass}
-\newglossary*{functions}{Functions}
-\setupglossaries{restoremakegloss}
-\makeglossaries
-
-

or - - -

-
-\PassOptionsToPackage{disablemakegloss}{glossaries}
-\documentclass{customclass}
-\newglossary*{functions}{Functions}
-\setupglossaries{restoremakegloss}
-\makeglossaries
-
-

-

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 record=only or record=nameref -options with glossaries-extra then you can’t use \makeglossaries or \makenoidxglossaries regardless of -restoremakegloss. -

-

-

Top

2.6 Glossary Type Options

-

-

-

nohypertypes={list}

-

Use this option if you have multiple glossaries and you want to suppress the entry hyperlinks for a particular -glossary or glossaries. The value of this option should be a comma-separated list of glossary types where \gls -etc shouldn’t have hyperlinks by default. Make sure you enclose the value in braces if it contains any commas. -Example: - - -

-
-\usepackage[acronym,nohypertypes={acronym,notation}]
-  {glossaries}
-\newglossary[nlg]{notation}{not}{ntn}{Notation}
-
-

The values must be fully expanded, so don’t try nohypertypes=\acronymtype. You may also -use -


\GlsDeclareNoHyperList{list}

-

-instead or additionally. See §5.1 Links to Glossary Entries for further details. -

-

-

nomain

-

This suppresses the creation of the main glossary and associated glo file, if unrequired. Note that if you use this -option, you must create another glossary in which to put all your entries (either via the acronym (or acronyms) -package option described in §2.7 Acronym and Abbreviation Options or via the symbols, -numbers or index options described in §2.9 Other Options or via \newglossary described in -§9 Defining New Glossaries). -

If you don’t use the main glossary and you don’t use this option, makeglossaries will produce a warning. -
-

-

-
-Warning: File 'filename.glo' is empty. -
Have you used any entries defined in glossary -
'main'? -
Remember to use package option 'nomain' if -
you don't want to use the main glossary. -
-
If you did actually want to use the main glossary and you see this warning, check that you have referenced the -entries in that glossary via commands such as \gls. -

-

-

symbols

-

This valueless option defines a new glossary type with the label symbols via - - -

-
-\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}
-
-

It also defines -


\printsymbols[options]

-

-which is a synonym for

-
-\printglossary[type=symbols,options] -
-
-

If you use Option 1, you need to use:

-
-\printnoidxglossary[type=symbols,options] -
-
to display the list of symbols. -

Remember to use the nomain package option if you’re only interested in using this symbols glossary and -don’t intend to use the main glossary.
-

-

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

-

-

-

numbers

-

This valueless option defines a new glossary type with the label numbers via - - -

-
-\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}
-
-

It also defines -


\printnumbers[options]

-

-which is a synonym for

-
-\printglossary[type=numbers,options] -
-
-

If you use Option 1, you need to use:

-
-\printnoidxglossary[type=numbers,options] -
-
to display the list of numbers. -

Remember to use the nomain package option if you’re only interested in using this numbers glossary and -don’t intend to use the main glossary.
-

-

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

-

-

-

index

-

This valueless option defines a new glossary type with the label index via - - -

-
-\newglossary[ilg]{index}{ind}{idx}{\indexname}%
-
-

It also defines -


\newterm[options]{term}

-

-which is a synonym for

-
-\newglossaryentry{term}[type=index,name={term},% -
description=\nopostdesc,options] -
-
and -


\printindex[options]

-

-which is a synonym for

-
-\printglossary[type=index,options] -
-
-

If you use Option 1, you need to use:

-
-\printnoidxglossary[type=index,options] -
-
to display this glossary. -

Remember to use the nomain package option if you’re only interested in using this index glossary and -don’t intend to use the main glossary. Note that you can’t mix this option with \index. Either use -glossaries for the indexing or use a custom indexing package, such as makeidx, index or imakeidx. (You -can, of course, load one of those packages and load glossaries without the index package option.) -
-

-

Since the index isn’t designed for terms with descriptions, you might also want to disable the hyperlinks for -this glossary using the package option nohypertypes=index or the command -
\GlsDeclareNoHyperList{index} -
-

The example file sample-index.tex illustrates the use of the index package option. - - -

-

-

noglossaryindex

-

This valueless option switches off index if index has been passed implicitly (for example, through global -document options). This option can’t be used in \setupglossaries. -

-

-

Top

2.7 Acronym and Abbreviation Options

-

-

-

acronym={boolean}

-

If true, this creates a new glossary with the label acronym. This is equivalent to: - - -

-
-\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
-
-

It will also define -


\printacronyms[options]

-

-that’s equivalent to

-
-\printglossary[type=acronym,options] -
-
(unless that command is already defined before the beginning of the document or the package option -compatible-3.07 is used). -

If you are using Option 1, you need to use

-
-\printnoidxglossary[type=acronym,options] -
-
to display the list of acronyms. -

If the acronym package option is used, \acronymtype is set to acronym otherwise it is set to -main.2.5 -Entries that are defined using \newacronym are placed in the glossary whose label is given by \acronymtype, -unless another glossary is explicitly specified. -

Remember to use the nomain package option if you’re only interested in using this acronym glossary. (That -is, you don’t intend to use the main glossary.)
-

-

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

Make sure you have at least v1.42 of glossaries-extra if you use the acronym (or acronyms) package option -with the extension package to avoid a bug that interferes with the abbreviation style.

-

-

-

-

acronyms

-

This is equivalent to acronym=true and may be used in the document class option list. - - -

-

-

abbreviations (glossaries-extra.sty)

-

This valueless option creates a new glossary type using: - - -

-
-\newglossary[glg-abr]{abbreviations}{gls-abr}{glo-abr}{\abbreviationsname}
-
-

The label can be accessed with \glsxtrabbrvtype, which is analogous to \acronymtype. See glossaries-extra -manual for further details. -

-

-

acronymlists={value}

-

By default, only the \acronymtype glossary is considered to be a list of acronyms. If you have other lists of -acronyms, you can specify them as a comma-separated list in the value of acronymlists. For example, if you use -the acronym package option but you also want the main glossary to also contain a list of acronyms, you can -do: - - -

-
-\usepackage[acronym,acronymlists={main}]{glossaries}
-
-

No check is performed to determine if the listed glossaries exist, so you can add glossaries you haven’t defined -yet. For example: - - -

-
-\usepackage[acronym,acronymlists={main,acronym2}]
-  {glossaries}
-\newglossary[alg2]{acronym2}{acr2}{acn2}%
-  {Statistical Acronyms}
-
-

You can use -


\DeclareAcronymList{list}

-

-instead of or in addition to the acronymlists option. This will add the glossaries given in ⟨list⟩ to the list of -glossaries that are identified as lists of acronyms. To replace the list of acronym lists with a new list -use: -


\SetAcronymLists{list}

-

-

You can determine if a glossary has been identified as being a list of acronyms using: -


\glsIfListOfAcronyms{label}{true part}{false part}

-

-

This option and associated commands are incompatible with glossaries-extra’s abbreviation mechanism. -
-

-

-

-

shortcuts

-

This option provides shortcut commands for acronyms. See §6 Acronyms and Other Abbreviations -for further details. Alternatively you can use: -


\DefineAcronymSynonyms

-

-

The glossaries-extra package provides additional shortcuts.
-

-

-

-

Top

2.8 Deprecated Acronym Style Options

-

The package options listed in this section are now deprecated but are kept for backward-compatibility. Use - - -\setacronymstyle instead. See §6 Acronyms and Other Abbreviations for further -details. -

-

-

description

-

This option changes the definition of \newacronym to allow a description. This option may be replaced -by - - -

-
-\setacronymstyle{long-short-desc}
-
-

or (with smallcaps) - - -

-
-\setacronymstyle{long-sc-short-desc}
-
-

or (with smaller) - - -

-
-\setacronymstyle{long-sm-short-desc}
-
-

or (with footnote) - - -

-
-\setacronymstyle{footnote-desc}
-
-

or (with footnote and smallcaps) - - -

-
-\setacronymstyle{footnote-sc-desc}
-
-

or (with footnote and smaller) - - -

-
-\setacronymstyle{footnote-sm-desc}
-
-

or (with dua) - - -

-
-\setacronymstyle{dua-desc}
-
-

-

-

-

smallcaps

-

This option changes the definition of \newacronym and the way that acronyms are displayed. This option may -be replaced by: - - -

-
-\setacronymstyle{long-sc-short}
-
-

or (with description) - - -

-
-\setacronymstyle{long-sc-short-desc}
-
-

or (with description and footnote) - - -

-
-\setacronymstyle{footnote-sc-desc}
-
-

-

-

-

smaller

-

This option changes the definition of \newacronym and the way that acronyms are displayed. -

If you use this option, you will need to include the relsize package or otherwise define \textsmaller or -redefine \acronymfont.
-

-This option may be replaced by: - - -

-
-\setacronymstyle{long-sm-short}
-
-

or (with description) - - -

-
-\setacronymstyle{long-sm-short-desc}
-
-

or (with description and footnote) - - -

-
-\setacronymstyle{footnote-sm-desc}
-
-

-

-

-

footnote

-

This option changes the definition of \newacronym and the way that acronyms are displayed. This option may -be replaced by: - - -

-
-\setacronymstyle{footnote}
-
-

or (with smallcaps) - - -

-
-\setacronymstyle{footnote-sc}
-
-

or (with smaller) - - -

-
-\setacronymstyle{footnote-sm}
-
-

or (with description) - - -

-
-\setacronymstyle{footnote-desc}
-
-

or (with smallcaps and description) - - -

-
-\setacronymstyle{footnote-sc-desc}
-
-

or (with smaller and description) - - -

-
-\setacronymstyle{footnote-sm-desc}
-
-

-

-

-

dua

-

This option changes the definition of \newacronym so that acronyms are always expanded. This option may be -replaced by: - - -

-
-\setacronymstyle{dua}
-
-

or (with description) - - -

-
-\setacronymstyle{dua-desc}
-
-

-

-

-

Top

2.9 Other Options

-

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

-

-

accsupp (glossaries-extra.sty)

-

Load the glossaries-accsupp package. -

-

-

prefix (glossaries-extra.sty)

-

Load the glossaries-prefix package. -

-

-

nomissingglstext={boolean} (glossaries-extra.sty)

-

This option may be used to suppress the boilerplate text generated by \printglossary if the glossary file is -missing. -

-

-

compatible-2.07={boolean}

-

Compatibility mode for old documents created using version 2.07 or below. - - -

-

-

compatible-3.07={boolean}

-

Compatibility mode for old documents created using version 3.07 or below. -

-

-

kernelglossredefs={value}

-

As a legacy from the precursor glossary package, the standard glossary commands provided by the LaTeX kernel -(\makeglossary and \glossary) are redefined in terms of the glossaries package’s commands. However, they -were never documented in this user manual, and the conversion guide (“Upgrading from the glossary package to -the glossaries package”) explicitly discourages their use. -

The use of those kernel commands (instead of the appropriate commands documented in this user guide) are -deprecated, and you will now get a warning if you try using them. -

In the event that you require the original form of these kernel commands, for example, if you need to use the -glossaries package with another class or package that also performs glossary-style indexing, then you can restore -these commands to their previous definition (that is, their definitions prior to loading the glossaries package) -with the package option kernelglossredefs=false. You may also need to use the nomain option in the event of file -extension conflicts. (In which case, you must provide a new default glossary for use with the glossaries -package.) -

This option may take one of three values: true (redefine with warnings, default), false (restore previous -definitions) or nowarn (redefine without warnings, not recommended). -

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

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

-

-

Top

2.10 Setting Options After the Package is Loaded

-

Some of the options described above may also be set after the glossaries package has been loaded -using -


\setupglossaries{key-val list}

-

-The following package options can’t be used in \setupglossaries: xindy, xindygloss, xindynoglsnumbers, -makeindex, nolong, nosuper, nolist, notree, nostyles, nomain, compatible-2.07, translate, notranslate, acronym. These -options have to be set while the package is loading, except for the xindy sub-options which can -be set using commands like \GlsSetXdyLanguage (see §14 Xindy (Option 3) for further -details). - - -

If you need to use this command, use it as soon as possible after loading glossaries otherwise you might end -up using it too late for the change to take effect. For example, if you try changing the acronym styles (such as -smallcaps) after you have started defining your acronyms, you are likely to get unexpected results. If you try -changing the sort option after you have started to define entries, you may get unexpected results. -
-

-

With glossaries-extra, use \glossariesextrasetup instead.
-

- - -

-

-

Top

3. Setting Up

-

In the preamble you need to indicate which method you want to use to generate the glossary -(or glossaries). The available options with both glossaries and glossaries-extra are summarized in -§1.2 Indexing Options. This chapter documents Options 13, which are provided by the -base package. See the glossaries-extra and bib2gls manuals for the full documentation of the other -options. -

If you don’t need to display any glossaries, for example, if you are just using the glossaries package to enable -consistent formatting, then skip ahead to §4 Defining Glossary Entries. -

-

Top

3.1 Option 1

-

The command -


\makenoidxglossaries

-

-must be placed in the preamble. This sets up the internal commands required to make Option 1 work. If you -omit \makenoidxglossaries none of the glossaries will be displayed. -

-

-

Top

3.2 Options 2 and 3

-

The command -


\makeglossaries

-

-must be placed in the preamble in order to create the customised makeindex (ist) or xindy (xdy) style file (for -Options 2 or 3, respectively) and to ensure that glossary entries are written to the appropriate output files. If -you omit \makeglossaries none of the glossary files will be created. -

If you are using glossaries-extra, \makeglossaries has an optional argument that allows you to -have a hybrid of Options 1 or 2 or Options 1 or 3. See glossaries-extra manual for further details. -
-

-

Note that some of the commands provided by the glossaries package must not be used after -\makeglossaries as they are required when creating the customised style file. If you attempt to use those -commands after \makeglossaries you will generate an error. Similarly, there are some commands that must -not be used before \makeglossaries. -

You can suppress the creation of the customised xindy or makeindex style file using -


\noist

-

-That this command must not be used after \makeglossaries. -

Note that if you have a custom xdy file created when using glossaries version 2.07 or below, you will need to -use the compatible-2.07 package option with it.
- - -

-

The default name for the customised style file is given by \jobname.ist (Option 2) or \jobname.xdy -(Option 3). This name may be changed using: -


\setStyleFile{name}

-

-where ⟨name⟩ is the name of the style file without the extension. Note that this command must not be used after -\makeglossaries. -

Each glossary entry is assigned a number list that lists all the locations in the document where that entry -was used. By default, the location refers to the page number but this may be overridden using the -counter package option. The default form of the location number assumes a full stop compositor -(e.g. 1.2), but if your location numbers use a different compositor (e.g. 1-2) you need to set this -using -


\glsSetCompositor{symbol}

-

-For example: - - -

-
-\glsSetCompositor{-}
-
-

This command must not be used after \makeglossaries. -

If you use Option 3, you can have a different compositor for page numbers starting with an upper case -alphabetical character using: -


\glsSetAlphaCompositor{symbol}

-

-This command has no effect if you use Option 2. For example, if you want number lists containing a mixture of -A-1 and 2.3 style formats, then do: - - -

-
-\glsSetCompositor{.}\glsSetAlphaCompositor{-}
-
-

See §12 Number Lists for further information about number lists. - - -

-

-

Top

4. Defining Glossary Entries

-

If you want to use bib2gls, entries must be defined in bib files using the syntax described in the bib2gls -user manual.
-

-

Acronyms are covered in §6 Acronyms and Other Abbreviations but they use the same -underlying mechanism as all the other entries, so it’s a good idea to read this chapter first. The keys provided -for \newglossaryentry can also be used in the optional argument of \newacronym, although some of them, -such as first and plural, interfere with the acronym styles. -

All glossary entries must be defined before they are used, so it is better to define them in the preamble to -ensure this. In fact, some commands such as \longnewglossaryentry may only be used in the -preamble. See §4.8 Drawbacks With Defining Entries in the Document Environment for a -discussion of the problems with defining entries within the document instead of in the preamble. (The -glossaries-extra package has an option that provides a restricted form of document definitions that avoids -some of the issues discussed in §4.8 Drawbacks With Defining Entries in the Document -Environment.) -

Option 1 enforces the preamble-only restriction on \newglossaryentry. Option 4 requires that definitions -are provided in bib format. Option 5 requires either preamble-only definitions or the use of the glossaries-extra -package option docdef=restricted.
-

-

Only those entries that are indexed in the document (using any of the commands described in §5.1 -Links to Glossary Entries, §10 Adding an Entry to the Glossary Without Generating Text or -§11 Cross-Referencing Entries) will appear in the glossary. See §8 Displaying a -Glossary to find out how to display the glossary. -

New glossary entries are defined using the command: -


\newglossaryentry{label}{key=value list}

-

-This is a short command, so values in ⟨key-val list⟩ can’t contain any paragraph breaks. Take care to enclose -values containing any commas (,) or equal signs (=) with braces to hide them from the key=value list -parser. -

If you have a long description that needs to span multiple paragraphs, use -


\longnewglossaryentry{label}{key=value list}{long description}

-

-instead. Note that this command may only be used in the preamble. Be careful of unwanted spaces. -\longnewglossaryentry will remove trailing spaces in the description (via \unskip) but won’t remove leading -spaces. This command also appends \nopostdesc to the end of the description, which suppresses the -post-description hook. The glossaries-extra package provides a starred version of \longnewglossaryentry that -doesn’t append either \unskip or \nopostdesc. -

There are also commands that will only define the entry if it hasn’t already been defined: -


\provideglossaryentry{label}{key=value list}

-

-and -


\longprovideglossaryentry{label}{key=value list}{long description}

- - -

-(These are both preamble-only commands.) -

For all the above commands, the first argument, ⟨label⟩, must be a unique label with which to identify this -entry. This can’t contain any non-expandable commands or active characters. The reason for this restriction -is that the label is used to construct internal commands that store the associated information -(similarly to commands like \label) and therefore must be able to expand to a valid control sequence -name. -

Note that although an extended Latin character or other non-Latin character, such as é or -ß, looks like a plain character in your .tex file, it’s actually a macro (an active character) and -therefore can’t be used in the label. (This applies to LaTeX rather than XeLaTeX.) Also be careful of -babel’s options that change certain punctuation characters (such as : or -) to active characters. -
-

-

The second argument, ⟨key=value list⟩, is a ⟨key⟩=⟨value⟩ list that supplies the relevant information about this -entry. There are two required fields: description and either name or parent. The description is set in the third -argument of \longnewglossaryentry and \longprovideglossaryentry. With the other commands it’s set via -the description key. As is typical with ⟨key⟩=⟨value⟩ lists, values that contain a comma or equal sign must be -enclosed in braces. Available fields are listed below. Additional fields are provided by the supplementary -packages glossaries-prefix (§16 Prefixes or Determiners) and glossaries-accsupp (§17 -Accessibility Support) and also by glossaries-extra. You can also define your own custom keys (see §4.3 -Additional Keys). -

-

-name

-

The name of the entry (as it will appear in the glossary). If this key is omitted and the parent key - is supplied, this value will be the same as the parent’s name. -

If the name key contains any commands, you must also use the sort key (described below) if - you intend sorting the entries alphabetically, otherwise the entries can’t be sorted correctly. -
-

-

-

-description

-

A brief description of this term (to appear in the glossary). Within this value, you can use: -


\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 description={\nopostdesc}. If you want a paragraph break in - the description use: -


\glspar

- - -

- or, better, use \longnewglossaryentry. However, note that not all glossary styles support multi-line - descriptions. If you are using one of the tabular-like glossary styles that permit multi-line descriptions, use - \newline not \\ if you want to force a line break. -

With glossaries-extra, use \glsxtrnopostpunc instead of \nopostdesc to suppress the post-description - punctuation.
-

-

-

-parent

-

The label of the parent entry. Note that the parent entry must be defined before its sub-entries. See - §4.5 Sub-Entries for further details. -

-

-descriptionplural

-

The plural form of the description, if required. If omitted, the value is set to the same as the description - key. -

-

-text

-

How this entry will appear in the document text when using \gls (or one of its upper case variants). If - this field is omitted, the value of the name key is used. -

This key is automatically set by \newacronym. Although it is possible to override it by using text in the - optional argument of \newacronym, it will interfere with the acronym style and cause unexpected - results. -

-

-first

-

How the entry will appear in the document text on first use with \gls (or one of its upper - case variants). If this field is omitted, the value of the text key is used. Note that if you use - \glspl, \Glspl, \GLSpl, \glsdisp before using \gls, the first value won’t be used with - \gls. -

You may prefer to use abbreviations (§6 Acronyms and Other Abbreviations) or the - category post-link hook (\glsdefpostlink) provided by glossaries-extra if you would like to - automatically append content on first use in a consistent manner. See, for example, Gallery: Units - (glossaries-extra.sty). -

Although it is possible to use first in the optional argument of \newacronym, it can interfere with the - acronym style and cause unexpected results. - - -

-

-plural

-

How the entry will appear in the document text when using \glspl (or one of its upper case variants). If - this field is omitted, the value is obtained by appending \glspluralsuffix to the value of the text field. - The default value of \glspluralsuffix is the letter “s”. -

Although it is possible to use plural in the optional argument of \newacronym, it can interfere with the - acronym style and cause unexpected results. Use shortplural instead, if the default value is - inappropriate. -

-

-firstplural

-

How the entry will appear in the document text on first use with \glspl (or one of its upper case - variants). If this field is omitted, the value is obtained from the plural key, if the first key is omitted, or - by appending \glspluralsuffix to the value of the first field, if the first field is present. Note that if - you use \gls, \Gls, \GLS, \glsdisp before using \glspl, the firstplural value won’t be used with - \glspl. -

Although it is possible to use firstplural in the optional argument of \newacronym, it can interfere with - the acronym style and cause unexpected results. Use shortplural and longplural instead, if the default - value is inappropriate. -

Note: prior to version 1.13, the default value of firstplural was always taken by appending “s” to the - first key, which meant that you had to specify both plural and firstplural, even if you hadn’t used - the first key. -

-

-symbol

-

This field is provided to allow the user to specify an associated symbol. If omitted, the value is set to - \relax. Note that not all glossary styles display the symbol. -

-

-symbolplural

-

This is the plural form of the symbol (as passed to \glsdisplay and \glsdisplayfirst by \glspl, - \Glspl and \GLSpl). If omitted, the value is set to the same as the symbol key. -

-

-sort

-

This value indicates the text to be used by the sort comparator when ordering all the entries. If omitted, - the value is given by the name field unless one of the package options sort=def and sort=use have been used. - With Option 2 it’s best to use the sort key if the name contains commands (e.g. \ensuremath{\alpha}) - - - and with Options 1 and 3, it’s strongly recommended as the indexing may fail if you don’t (see - below). -

You can also override the sort key by redefining \glsprestandardsort (see §2.5 Sorting - Options). -

The sort key shouldn’t be used with bib2gls. It has a system of fallbacks that allow different types of - entries to obtain the sort value from the most relevant field. See the bib2gls manual for further details - and see also bib2gls gallery: sorting.
-

-

Option 1 by default strips the standard LaTeX accents (that is, accents generated by core - LaTeX commands) from the name key when it sets the sort key. So with Option 1: - - -

-
-     \newglossaryentry{elite}{%
-       name={{\'e}lite},
-       description={select group of people}
-     }
-
-

This is equivalent to: - - -

-
-     \newglossaryentry{elite}{%
-       name={{\'e}lite},
-       description={select group of people},
-       sort={elite}
-     }
-
-

Unless you use the package option sanitizesort=true, in which case it’s equivalent to: - - -

-
-     \newglossaryentry{elite}{%
-       name={{\'e}lite},
-       description={select group of people},
-       sort={\'elite}
-     }
-
-

This will place the entry before the “A” letter group since the sort value starts with a symbol. -

Similarly if you use the inputenc package:

-
- \newglossaryentry{elite}{% -
  name={{é}lite}, -
  description={select group of people} -
} -
-
This is equivalent to
-
- \newglossaryentry{elite}{% -
  name={{é}lite}, -
  description={select group of people}, -
  sort=elite -
} -
-
Unless you use the package option sanitizesort=true, in which case it’s equivalent to:
-
- \newglossaryentry{elite}{% -
  name={{é}lite}, -
  description={select group of people}, -
  sort=élite -
} -
-
Again, this will place the entry before the “A” group. -

With Options 2 and 3, the default value of sort will either be set to the name key (if sanitizesort=true) or - it will set it to the expansion of the name key (if sanitizesort=false). - - -

Take care with xindy (Option 3): if you have entries with the same sort value they will be treated as - the same entry. If you use xindy and aren’t using the def or use sort methods, always use - the sort key for entries where the name just consists of a control sequence (for example - name={\alpha}). -

Take care if you use Option 1 and the name contains fragile commands. You will either need to explicitly - set the sort key or use the sanitizesort=true package option (unless you use the def or use sort methods). -

-

-

-

-type

-

This specifies the label of the glossary in which this entry belongs. If omitted, the default - glossary is assumed unless \newacronym is used (see §6 Acronyms and Other - Abbreviations). -

-

-user1, …, user6

-

Six keys 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 \glsaddkey or \glsaddstoragekey (see §4.3 Additional - Keys). -

-

-nonumberlist

-

A boolean key. If the value is missing or is true, this will suppress the number list just for this - entry. Conversely, if you have used the package option nonumberlist, you can activate the - number list just for this entry with nonumberlist=false. (See §12 Number - Lists.) -

-

-see

-

This key essentially provides a convenient shortcut that performs

-
- \glssee[tag]{label}{xr-label list} -
- - -
after the entry has been defined. (See §11 Cross-Referencing Entries.) It was originally designed - for synonyms that may not occur in the document text but needed to be included in the glossary in order - to redirect the reader. Note that it doesn’t index the cross-referenced entry (or entries) as that would - interfere with their number lists. -

Using the see key will automatically add this entry to the glossary, but will not automatically add the - cross-referenced entry.
-

-

For example: - - -

-
-     \newglossaryentry{courgette}{name={courgette},
-       description={variety of small marrow}}
-     \newglossaryentry{zucchini}{name={zucchini},
-       description={(North American)},
-       see={courgette}}
-
-

This defines two entries (courgette and zucchini) and automatically adds a cross-reference from zucchini - to courgette. (That is, it adds “see courgette” to zucchini’s number list.) This doesn’t automatically index - courgette since this would create an unwanted location in courgette’s number list. (Page 1, if the - definitions occur in the preamble.) -

Note that while it’s possible to put the cross-reference in the description instead, for example: - - -

-
-     \newglossaryentry{zucchini}{name={zucchini},
-       description={(North American) see \gls{courgette}}}
-
-

this won’t index the zucchini entry, so if zucchini isn’t indexed elsewhere (with commands like \gls or - \glsadd) then it won’t appear in the glossary even if courgette does. -

The referenced entry should be supplied as the value to this key. If you want to override - the “see” tag, you can supply the new tag in square brackets before the label. For example - see=[see also]{anotherlabel}. Note that if you have suppressed the number list, the cross-referencing - information won’t appear in the glossary, as it forms part of the number list. You can override this for - individual glossary entries using nonumberlist=false (see above). Alternatively, you can use the - seeautonumberlist package option. For further details, see §11 Cross-Referencing - Entries. -

For Options 2 and 3, \makeglossaries must be used before any occurrence of \newglossaryentry that - contains the see key. This key should not be used with entries defined in the document environment. -
-

- Since it’s useful to suppress the indexing while working on a draft document, consider using the - seenoindex package option to warn or ignore the see key while \makeglossaries is commented - out. -

If you use the see key, you may want to consider using the glossaries-extra package which additionally - provides a seealso and alias key. If you want to avoid the automatic indexing triggered by the see key, - consider using Option 4. See also the FAQ item Why does the see key automatically index the - entry? -

The analogous bib2gls see field (and seealso) have a slightly different meaning. The selection - resource option determines the behaviour.
-

-

-

-seealso

-

This key is only available with glossaries-extra and is similar to see but it doesn’t allow for the optional - tag. The glossaries-extra package provides \seealsoname and seealso={list} is essentially like - see=[\seealsoname]list⟩ (Options 3 and 4 may treat these differently). -

-

-alias

- - -

This key is only available with glossaries-extra and is another form of cross-referencing. An entry can be - aliased to another entry with alias={label}. This behaves like see={label} but also alters the - behaviour of commands like \gls so that they index the entry given by ⟨label⟩ instead of the original entry. - (See, for example, Gallery: Aliases.) -

More variations with the key are available with bib2gls.
-

-

-

-category

-

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

-
-

The following keys are reserved for \newacronym (see §6 Acronyms and Other Abbreviations) -and also for \newabbreviation (see the glossaries-extra manual): long, longplural, short and -shortplural. -

There are also special internal field names used by bib2gls. See the bib2gls manual for further details. -
-

-

The supplementary packages glossaries-prefix (§16 Prefixes or Determiners) and glossaries-accsupp -(§17 Accessibility Support) provide additional keys. -

Avoid using any of the \gls-like or \glstext-like commands within the text, first, short or long keys -(or their plural equivalent) or any other key that you plan to access through those commands. (For example, the -symbol key if you intend to use \glssymbol.) Otherwise you end up with nested links, which can cause -complications and they won’t work with the case-changing commands. You can use them within the value of -keys that won’t be accessed through those commands. For example, the description key if you don’t -use \glsdesc. Additionally, they’ll confuse the entry formatting commands, such as \glslabel. -
-

-

Note that if the name starts with non-Latin character, you must group the character, otherwise it will cause -a problem for commands like \Gls and \Glspl. For example: - - -

-
-\newglossaryentry{elite}{name={{\'e}lite},
-description={select group or class}}
-
-

Note that the same applies if you are using the inputenc package:

-
-\newglossaryentry{elite}{name={{é}lite}, -
description={select group or class}} -
-
(This doesn’t apply for XeLaTeX or LuaLaTeX documents. For further details, see the “UTF-8” section in the -mfirstuc user manual.) -

Note that in both of the above examples, you will also need to supply the sort key if you are -using Option 2 whereas xindy (Option 3) is usually able to sort non-Latin characters correctly. -Option 1 discards accents from standard LaTeX extended Latin characters unless you use the -sanitizesort=true. -

-

Top

4.1 Plurals

-

You may have noticed from above that you can specify the plural form when you define a term. If you omit this, -the plural will be obtained by appending -


\glspluralsuffix

-

-to the singular form. This command defaults to the letter “s”. For example: - - -

-
-\newglossaryentry{cow}{name=cow,description={a fully grown
-female of any bovine animal}}
-
-

defines a new entry whose singular form is “cow” and plural form is “cows”. However, if you are writing in -archaic English, you may want to use “kine” as the plural form, in which case you would have to -do: - - -

-
-\newglossaryentry{cow}{name=cow,plural=kine,
-description={a fully grown female of any bovine animal}}
-
-

-

If you are writing in a language that supports multiple plurals (for a given term) then use the plural key for -one of them and one of the user keys to specify the other plural form. For example: - - -

-
-\newglossaryentry{cow}{%
-  name=cow,%
-  description={a fully grown female of any bovine animal
-               (plural cows, archaic plural kine)},%
-  user1={kine}}
-
-

You can then use \glspl{cow} to produce “cows” and \glsuseri{cow} to produce “kine”. You can, of course, -define an easy to remember synonym. For example: - - -

-
-\let\glsaltpl\glsuseri
-
-

Then you don’t have to remember which key you used to store the second plural. Alternatively, you can define -your own keys using \glsaddkey, described in §4.3 Additional Keys. -

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

-

-

Top

4.2 Other Grammatical Constructs

-

You can use the six user keys to provide alternatives, such as participles. For example: - - -

-
-\let\glsing\glsuseri
-\let\glsd\glsuserii
-\newcommand*{\ingkey}{user1}
-\newcommand*{\edkey}{user2}
-\newcommand*{\newword}[3][]{%
-  \newglossaryentry{#2}{%
-   name={#2},%
-   description={#3},%
-   \edkey={#2ed},%
-   \ingkey={#2ing},#1%
-  }%
+
Note that the type field has been removed. The above entry in the notation.bib file references a term in the entries.bib file. It’s possible to strip all the prefixes from the bib files and get 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 extn. prefixes:
@entry{set,
+  name={\ensuremath{\mathcal{S}}},
+  description={A \glspt{ext1.set}}
 }
-
-

With the above definitions, I can now define terms like this: - - -

-
-\newword{play}{to take part in activities for enjoyment}
-\newword[\edkey={ran},\ingkey={running}]{run}{to move fast using
-the legs}
-
-

and use them in the text: - - -

-
-Peter is \glsing{play} in the park today.
-Jane \glsd{play} in the park yesterday.
-Peter and Jane \glsd{run} in the park last week.
-
-

-

Alternatively, you can define your own keys using \glsaddkey, described below in §4.3 Additional -Keys. -

-

-

Top

4.3 Additional Keys

-

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

For example, if you want to add a key that indicates the associated unit for a term, you might want to -reference this unit in your document. In this case use \glsaddkey described in §4.3.1 Document Keys. -If, on the other hand, you want to add a key to indicate to a glossary style or acronym style that this entry -should be formatted differently to other entries, then you can use \glsaddstoragekey described in -§4.3.2 Storage Keys. -

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

-

-

Top

4.3.1 Document Keys

-

A custom key that can be used in the document is defined using: -


\glsaddkey{key}{default value}{no link cs}{no link ucfirst cs}{link cs}{link ucfirst -cs}{link allcaps cs}

-

-where: -

-

-⟨key

-

is the new key to use in \newglossaryentry (or similar commands such as - \longnewglossaryentry); - - -

-

-⟨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 \glslabel, but you will have to switch on expansion via the starred version of - \glsaddkey and protect fragile commands); -

-

-⟨no link cs

-

is the control sequence to use analogous to commands like \glsentrytext; -

-

-⟨no link ucfirst cs

-

is the control sequence to use analogous to commands like \Glsentrytext; -

-

-⟨link cs

-

is the control sequence to use analogous to commands like \glstext; -

-

-⟨link ucfirst cs

-

is the control sequence to use analogous to commands like \Glstext; -

-

-⟨link allcaps cs

-

is the control sequence to use analogous to commands like \GLStext.

-

The starred version of \glsaddkey switches on expansion for this key. The unstarred version doesn’t override the -current expansion setting. - -

Example 3 (Defining Custom Keys) -

Suppose I want to define two new keys, ed and ing, that default to the entry text followed by “ed” and -“ing”, respectively. The default value will need expanding in both cases, so I need to use the starred -form: - - -

-
- % Define "ed" key:
- \glsaddkey*
-  {ed}% key
-  {\glsentrytext{\glslabel}ed}% default value
-  {\glsentryed}% command analogous to \glsentrytext
-  {\Glsentryed}% command analogous to \Glsentrytext
-  {\glsed}% command analogous to \glstext
-  {\Glsed}% command analogous to \Glstext
-  {\GLSed}% command analogous to \GLStext
- % Define "ing" key:
- \glsaddkey*
-  {ing}% key
-  {\glsentrytext{\glslabel}ing}% default value
-  {\glsentrying}% command analogous to \glsentrytext
-  {\Glsentrying}% command analogous to \Glsentrytext
-  {\glsing}% command analogous to \glstext
-  {\Glsing}% command analogous to \Glstext
-  {\GLSing}% command analogous to \GLStext
-
-

Now I can define some entries: - - -

-
- % No need to override defaults for this entry:
- \newglossaryentry{jump}{name={jump},description={}}
- % Need to override defaults on these entries:
- \newglossaryentry{run}{name={run},%
-   ed={ran},%
-   ing={running},%
-   description={}}
- \newglossaryentry{waddle}{name={waddle},%
-   ed={waddled},%
-   ing={waddling},%
-   description={}}
-
-

-

These entries can later be used in the document: - - -

-
-The dog \glsed{jump} over the duck.
-The duck was \glsing{waddle} round the dog.
-The dog \glsed{run} away from the duck.
-
-

For a complete document, see the sample file sample-newkeys.tex.

-
-

-

____________________________

-

-

-

Top

4.3.2 Storage Keys

-

A custom key that can be used for simply storing information is defined using: -


\glsaddstoragekey{key}{default value}{no link cs}

-

-where the arguments are as the first three arguments of \glsaddkey, described above in §4.3.1 -Document Keys. -

This is essentially the same as \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 §15.3 Fetching and -Updating the Value of a Field. - -

Example 4 (Defining Custom Storage Key (Acronyms and Initialisms)) -

Suppose I want to define acronyms and other forms of abbreviations, such as initialisms, but I want them all -in the same glossary and I want the acronyms on first use to be displayed with the short form followed by the -long form in parentheses, but the opposite way round for other forms of abbreviations. (The glossaries-extra -package provides a simpler way of achieving this.) -

Here I can define a new key that determines whether the term is actually an acronym rather -than some other form of abbreviation. I’m going to call this key abbrtype (since type already -exists): - - -

-
-\glsaddstoragekey
- {abbrtype}% key/field name
- {word}% default value if not explicitly set
- {\abbrtype}% custom command to access the value if required
-
-

-

Now I can define a style that looks up the value of this new key to determine how to display the full -form: - - -

-
-\newacronymstyle
- {mystyle}% style name
- {% Use the generic display
-   \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}%
- }
- {% Put the long form in the description
-   \renewcommand*{\GenericAcronymFields}{%
-       description={\the\glslongtok}}%
-   % For the full format, test the value of the "abbrtype" key.
-   % If it's set to "word" put the short form first with
-   % the long form in brackets.
-   \renewcommand*{\genacrfullformat}[2]{%
-    \ifglsfieldeq{##1}{abbrtype}{word}
-    {% is a proper acronym
-      \protect\firstacronymfont{\glsentryshort{##1}}##2\space
-       (\glsentrylong{##1})%
-    }
-    {% is another form of abbreviation
-     \glsentrylong{##1}##2\space
-      (\protect\firstacronymfont{\glsentryshort{##1}})%
-    }%
-  }%
-  % first letter upper case version:
-   \renewcommand*{\Genacrfullformat}[2]{%
-    \ifglsfieldeq{##1}{abbrtype}{word}
-    {% is a proper acronym
-      \protect\firstacronymfont{\Glsentryshort{##1}}##2\space
-       (\glsentrylong{##1})%
-    }
-    {% is another form of abbreviation
-     \Glsentrylong{##1}##2\space
-      (\protect\firstacronymfont{\glsentryshort{##1}})%
-    }%
-  }%
-  % plural
-   \renewcommand*{\genplacrfullformat}[2]{%
-    \ifglsfieldeq{##1}{abbrtype}{word}
-    {% is a proper acronym
-      \protect\firstacronymfont{\glsentryshortpl{##1}}##2\space
-       (\glsentrylong{##1})%
-    }
-    {% is another form of abbreviation
-     \glsentrylongpl{##1}##2\space
-      (\protect\firstacronymfont{\glsentryshortpl{##1}})%
-    }%
-  }%
-                                                                                      
-                                                                                      
-  % plural and first letter upper case
-  \renewcommand*{\Genplacrfullformat}[2]{%
-    \ifglsfieldeq{##1}{abbrtype}{word}
-    {% is a proper acronym
-      \protect\firstacronymfont{\Glsentryshortpl{##1}}##2\space
-       (\glsentrylong{##1})%
-    }
-    {% is another form of abbreviation
-     \Glsentrylongpl{##1}##2\space
-      (\protect\firstacronymfont{\glsentryshortpl{##1}})%
-    }%
-  }%
-  % Just use the short form as the name part in the glossary:
-  \renewcommand*{\acronymentry}[1]{%
-     \acronymfont{\glsentryshort{##1}}}%
-  % Sort by the short form:
-  \renewcommand*{\acronymsort}[2]{##1}%
-  % Just use the surrounding font for the short form:
-  \renewcommand*{\acronymfont}[1]{##1}%
-  % Same for first use:
-  \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}%
-  % Default plural suffix if the plural isn't explicitly set
-  \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}%
- }
-
-

Remember that the new style needs to be set before defining any terms: - - -

-
-\setacronymstyle{mystyle}
-
-

-

Since it’s a bit confusing to use \newacronym for something that’s not technically an acronym, let’s define a -new command for initialisms: - - -

-
-\newcommand*{\newinitialism}[4][]{%
-  \newacronym[abbrtype=initialism,#1]{#2}{#3}{#4}%
+
The corresponding term in the entries.bib file is now:
@entry{set,
+  name={set},
+  description={A collection of distinct objects}
 }
-
-

Now the entries can all be defined: - - -

-
-\newacronym{radar}{radar}{radio detecting and ranging}
-\newacronym{laser}{laser}{light amplification by stimulated
-emission of radiation}
-\newacronym{scuba}{scuba}{self-contained underwater breathing
-apparatus}
-\newinitialism{dsp}{DSP}{digital signal processing}
-\newinitialism{atm}{ATM}{automated teller machine}
-
-

On first use, \gls{radar} will produce “radar (radio detecting and ranging)” but \gls{dsp} will produce -“DSP (digital signal processing)”. -

For a complete document, see the sample file sample-storage-abbr.tex.

-
-

-

____________________________

-

In the above example, if \newglossaryentry is explicitly used (instead of through \newacronym) the -abbrtype key will be set to its default value of “word” but the \ifglshaslong test in the custom acronym style -will be false (since the long key hasn’t been set) so the display style will switch to that given by -\glsgenentryfmt and they’ll be no test performed on the abbrtype field. - -

Example 5 (Defining Custom Storage Key (Acronyms and Non-Acronyms with -Descriptions)) -

The previous example can be modified if the description also needs to be provided. Here I’ve changed -“word” to “acronym”: - - -

-
-\glsaddstoragekey
- {abbrtype}% key/field name
- {acronym}% default value if not explicitly set
- {\abbrtype}% custom command to access the value if required
-
-

This may seem a little odd for non-abbreviated entries defined using \newglossaryentry directly, but -\ifglshaslong can be used to determine whether or not to reference the value of this new abbrtype -field. -

The new acronym style has a minor modification that forces the user to specify a description. In the -previous example, the line: - - -

-
-   \renewcommand*{\GenericAcronymFields}{%
-     description={\the\glslongtok}}%
-
-

needs to be changed to: - - -

-
-   \renewcommand*{\GenericAcronymFields}{}%
-
-

Additionally, to accommodate the change in the default value of the abbrtype key, all instances -of - - -

-
-    \ifglsfieldeq{##1}{abbrtype}{word}
-
-

need to be changed to: - - -

-
-    \ifglsfieldeq{##1}{abbrtype}{acronym}
-
-

-

Once this new style has been set, the new acronyms can be defined using the optional argument to set the -description: - - -

-
-\newacronym[description={system for detecting the position and
-speed of aircraft, ships, etc}]{radar}{radar}{radio detecting
-and ranging}
-
-

-

No change is required for the definition of \newinitialism but again the optional argument is required to -set the description: - - -

-
-\newinitialism[description={mathematical manipulation of an
-information signal}]{dsp}{DSP}{digital signal processing}
-
-

-

We can also accommodate contractions in a similar manner to the initialisms: - - -

-
-\newcommand*{\newcontraction}[4][]{%
-  \newacronym[abbrtype=contraction,#1]{#2}{#3}{#4}%
+

+Now you can replace \makeglossaries with:

\GlsXtrLoadResources[src={entries},label-prefix={gls:}]
+\GlsXtrLoadResources[src={notation},type=notation,
+ label-prefix={not:},ext-prefixes={gls:}]
+
Remove all the \newglossaryentry definitions and replace \printglossaries with \printunsrtglossaries.

+Regardless of how many resource sets the document contains, only one bib2gls call is required:

pdflatex sampleNtn
+bib2gls sampleNtn
+pdflatex sampleNtn
+

+You may notice that the ordering in the notations list has changed from the original. This is because the sort field was automatically removed by convertgls2bib, so the entries are now sorted according to the name field (since they are defined with @entry). You can use your text editor’s search and replace function to replace all instances of @entry with @symbol in the notations.bib file so that, for example, the “set” definition becomes:

@symbol{set,
+  name={\ensuremath{\mathcal{S}}},
+  description={A \glspt{ext1.set}}
 }
-
-

The contractions can similarly been defined using this new command: - - -

-
-\newcontraction[description={front part of a ship below the
-deck}]{focsle}{fo'c's'le}{forecastle}
-
-

-

Since the custom acronym style just checks if abbrtype is acronym, the contractions will be treated the -same as the initialisms, but the style could be modified by a further test of the abbrtype value if -required. -

To test regular non-abbreviated entries, I’ve also defined a simple word: - - -

-
-\newglossaryentry{apple}{name={apple},description={a fruit}}
-
-

-

Now for a new glossary style that provides information about the abbreviation (in addition to the -description): - - -

-
-\newglossarystyle
- {mystyle}% style name
- {% base it on the "list" style
-   \setglossarystyle{list}%
-   \renewcommand*{\glossentry}[2]{%
-     \item[\glsentryitem{##1}%
-          \glstarget{##1}{\glossentryname{##1}}]
-       \ifglshaslong{##1}%
-       { (\abbrtype{##1}: \glsentrylong{##1})\space}{}%
-       \glossentrydesc{##1}\glspostdescription\space ##2}%
- }
-
-

This uses \ifglshaslong to determine whether or not the term is an abbreviation. If it has an abbreviation, -the full form is supplied in parentheses and \abbrtype (defined by \glsaddstoragekey earlier) is used to -indicate the type of abbreviation. -

With this style set, the apple entry is simply displayed in the glossary as -

-

-apple

-

a fruit.

-

but the abbreviations are displayed in the form -

-

-laser

-

(acronym: light amplification by stimulated emission of radiation) device that creates a narrow - beam of intense light.

-

(for acronyms) or -

-

-DSP

-

(initialism: digital signal processing) mathematical manipulation of an information signal.

-

(for initalisms) or -

-

-fo’c’s’le

-

(contraction: forecastle) front part of a ship below the deck.

- - -

(for contractions). -

For a complete document, see sample-storage-abbr-desc.tex.

-
-

-

____________________________

-

-

-

Top

4.4 Expansion

-

When you define new glossary entries expansion is performed by default, except for the name, description, -descriptionplural, symbol, symbolplural and sort keys (these keys all have expansion suppressed via -\glssetnoexpandfield). -

You can switch expansion on or off for individual keys using -


\glssetexpandfield{field}

-

-or -


\glssetnoexpandfield{field}

-

-respectively, where ⟨field⟩ is the field tag corresponding to the key. In most cases, this is the same as the name of -the key except for those listed in table 4.1. -

-
- - -


- - -
Table 4.1: Key to Field Mappings
-
- - - - - - - - - - -
Key Field
sort sortvalue
firstplural firstpl
description desc
descriptionplural descplural
user1 useri
user2 userii
user3 useriii
user4 useriv
user5 userv
user6 uservi
longplural longpl
shortplural shortpl
-
- - -

-
-

Any keys that haven’t had the expansion explicitly set using \glssetexpandfield or \glssetnoexpandfield -are governed by -


\glsexpandfields

-

-and -


\glsnoexpandfields

-

-

If your entries contain any fragile commands, I recommend you switch off expansion via \glsnoexpandfields. -(This should be used before you define the entries.) -

-

Top

4.5 Sub-Entries

-

As from version 1.17, it is possible to specify sub-entries. These may be used to order the glossary into -categories, in which case the sub-entry will have a different name to its parent entry, or it may be used to -distinguish different definitions for the same word, in which case the sub-entries will have the same name as the -parent entry. Note that not all glossary styles support hierarchical entries and may display all the entries in a -flat format. Of the styles that support sub-entries, some display the sub-entry’s name whilst others don’t. -Therefore you need to ensure that you use a suitable style. (See §13 Glossary Styles for a list of -predefined styles.) As from version 3.0, level 1 sub-entries are automatically numbered in the predefined styles if -you use the subentrycounter package option (see §2.3 Glossary Appearance Options for -further details). -

Note that the parent entry will automatically be added to the glossary if any of its child entries are used in -the document. If the parent entry is not referenced in the document, it will not have a number list. Note also -that makeindex has a restriction on the maximum sub-entry depth. -

-

-

Top

4.5.1 Hierarchical Categories

-

To arrange a glossary with hierarchical categories, you need to first define the category and then define the -sub-entries using the relevant category entry as the value of the parent key. - -

Example 6 (Hierarchical Categories—Greek and Roman Mathematical -Symbols) -

Suppose I want a glossary of mathematical symbols that are divided into Greek letters and Roman letters. -Then I can define the categories as follows: - - -

-
-\newglossaryentry{greekletter}{name={Greek letters},
-description={\nopostdesc}}
-\newglossaryentry{romanletter}{name={Roman letters},
-description={\nopostdesc}}
-
-

-

Note that in this example, the category entries don’t need a description so I have set the descriptions to -\nopostdesc. This gives a blank description and suppresses the description terminator. -

I can now define my sub-entries as follows: - - -

-
-\newglossaryentry{pi}{name={\ensuremath{\pi}},sort={pi},
-description={ratio of the circumference of a circle to
-the diameter},
-parent=greekletter}
-\newglossaryentry{C}{name={\ensuremath{C}},sort={C},
-description={Euler's constant},
-parent=romanletter}
-
-

For a complete document, see the sample file sampletree.tex.

-
-

-

____________________________

-

-

-

Top

4.5.2 Homographs

-

Sub-entries that have the same name as the parent entry, don’t need to have the name key. For example, the -word “glossary” can mean a list of technical words or a collection of glosses. In both cases the plural is -“glossaries”. So first define the parent entry: - - -

-
-\newglossaryentry{glossary}{name=glossary,
-description={\nopostdesc},
-plural={glossaries}}
-
-

Again, the parent entry has no description, so the description terminator needs to be suppressed using -\nopostdesc. -

Now define the two different meanings of the word: - - -

-
-\newglossaryentry{glossarylist}{
-description={list of technical words},
-sort={1},
-parent={glossary}}
-\newglossaryentry{glossarycol}{
-description={collection of glosses},
-sort={2},
-parent={glossary}}
-
-

Note that if I reference the parent entry, the location will be added to the parent’s number list, whereas if I -reference any of the child entries, the location will be added to the child entry’s number list. Note also that since -the sub-entries have the same name, the sort key is required unless you are using the sort=use or sort=def -package options (see §2.5 Sorting Options). You can use the subentrycounter package option to -automatically number the first-level child entries. See §2.3 Glossary Appearance Options 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 -plural key was not required for the child entries. However, if the sub-entries have different plurals, they will -need to be specified. For example: - - -

-
-\newglossaryentry{bravo}{name={bravo},
-description={\nopostdesc}}
-\newglossaryentry{bravocry}{description={cry of approval
-(pl.\ bravos)},
-sort={1},
-plural={bravos},
-parent=bravo}
-\newglossaryentry{bravoruffian}{description={hired
-ruffian or killer (pl.\ bravoes)},
-sort={2},
-plural={bravoes},
-parent=bravo}
-
-

-

-

-

Top

4.6 Loading Entries From a File

-

You can store all your glossary entry definitions in another file and use: -


\loadglsentries[type]{filename}

-

-where ⟨filename⟩ is the name of the file containing all the \newglossaryentry or \longnewglossaryentry -commands. The optional argument ⟨type⟩ is the name of the glossary to which those entries should -belong, for those entries where the type key has been omitted (or, more specifically, for those entries -whose type has been specified by \glsdefaulttype, which is what \newglossaryentry uses by -default). -

This is a preamble-only command. You may also use \input to load the file but don’t use \include. If you -find that your file is becoming unmanageably large, you may want to consider switching to bib2gls and use an -application such as JabRef to manage the entry definitions. -

If you want to use \AtBeginDocument to \input all your entries automatically at the start of the document, -add the \AtBeginDocument command before you load the glossaries package (and babel, if you are also loading -that) to avoid the creation of the glsdefs file and any associated problems that are caused by defining -commands in the document environment. (See §4.8 Drawbacks With Defining Entries in the Document -Environment.)
-

- - - -

Example 7 (Loading Entries from Another File) -

Suppose I have a file called myentries.tex which contains: - - -

-
-\newglossaryentry{perl}{type=main,
-name={Perl},
-description={A scripting language}}
-\newglossaryentry{tex}{name={\TeX},
-description={A typesetting language},sort={TeX}}
-\newglossaryentry{html}{type=\glsdefaulttype,
-name={html},
-description={A mark up language}}
-
-

and suppose in my document preamble I use the command: - - -

-
-\loadglsentries[languages]{myentries}
-
-

then this will add the entries tex and html to the glossary whose type is given by languages, -but the entry perl will be added to the main glossary, since it explicitly sets the type to main. -

-
-

-

____________________________

-

Note: if you use \newacronym (see §6 Acronyms and Other Abbreviations) the type is set -as type=\acronymtype unless you explicitly override it. For example, if my file myacronyms.tex -contains: - - -

-
-\newacronym{aca}{aca}{a contrived acronym}
-
-

then (supposing I have defined a new glossary type called altacronym) - - -

-
-\loadglsentries[altacronym]{myacronyms}
-
-

will add aca to the glossary type acronym, if the package option acronym has been specified, -or will add aca to the glossary type altacronym, if the package option acronym is not -specified.4.1 -

If you have used the acronym package option, there are two possible solutions to this problem: -

    -
  1. -

    Change myacronyms.tex so that entries are defined in the form: - - -

    -
    -     \newacronym[type=\glsdefaulttype]{aca}{aca}{a
    -     contrived acronym}
    -
    -

    and do: - - -

    -
    -     \loadglsentries[altacronym]{myacronyms}
    -
    -

    -

  2. -
  3. -

    Temporarily change \acronymtype to the target glossary: - - -

    -
    -     \let\orgacronymtype\acronymtype
    -     \renewcommand{\acronymtype}{altacronym}
    -     \loadglsentries{myacronyms}
    -     \let\acronymtype\orgacronymtype
    -
    -

-

Note that only those entries that have been used in the text will appear in the relevant glossaries. Note also -that \loadglsentries may only be used in the preamble. -

Remember that you can use \provideglossaryentry rather than \newglossaryentry. Suppose you want -to maintain a large database of acronyms or terms that you’re likely to use in your documents, but you may -want to use a modified version of some of those entries. (Suppose, for example, one document may require a -more detailed description.) Then if you define the entries using \provideglossaryentry in your database file, -you can override the definition by simply using \newglossaryentry before loading the file. For example, -suppose your file (called, say, terms.tex) contains: - - -

-
-\provideglossaryentry{mallard}{name=mallard,
- description={a type of duck}}
-
-

but suppose your document requires a more detailed description, you can do: - - -

-
-\usepackage{glossaries}
-\makeglossaries
-\newglossaryentry{mallard}{name=mallard,
- description={a dabbling duck where the male has a green head}}
-\loadglsentries{terms}
-
-

Now the mallard definition in the terms.tex file will be ignored. -

-

-

Top

4.7 Moving Entries to Another Glossary

-

As from version 3.02, you can move an entry from one glossary to another using: -


\glsmoveentry{label}{target glossary label}

-

-where ⟨label⟩ is the unique label identifying the required entry and ⟨target glossary label⟩ is the unique label -identifying the glossary in which to put the entry. -

Note that no check is performed to determine the existence of the target glossary. If you want to move an -entry to a glossary that’s skipped by \printglossaries, then define an ignored glossary with -\newignoredglossary. (See §9 Defining New Glossaries.) -

Unpredictable results may occur if you move an entry to a different glossary from its parent or children. -
-

-

-

-

Top

4.8 Drawbacks With Defining Entries in the Document Environment

-

Originally, \newglossaryentry (and \newacronym) could only be used in the preamble. I reluctantly removed -this restriction in version 1.13, but there are issues with defining commands in the document environment -instead of the preamble, which is why the restriction is maintained for newer commands. This restriction is also -reimposed for \newglossaryentry by the new Option 1. (The glossaries-extra package automatically reimposes -this restriction for Options 2 and 3 but provides a package option to allow document definitions if -necessary.) - - -

-

-

Top

4.8.1 Technical Issues

-

-

    -
  1. -

    If you define an entry mid-way through your document, but subsequently shuffle sections around, - you could end up using an entry before it has been defined. -

  2. -
  3. -

    Entry information is required when displaying the glossary. If this occurs at the start of the - document, but the entries aren’t defined until later, then the entry details are being looked up - before the entry has been defined. This means that it’s not possible to display the content of the - glossary unless the entry definitions are saved on the previous LaTeX run and can be picked up - at the start of the document environment on the next run (in a similar way that \label and \ref - work). -

  4. -
  5. -

    If you use a package, such as babel, that makes certain characters active at the start of the document - environment, there will be a problem if those characters have a special significance when defining - glossary entries. These characters include the double-quote " character, the exclamation mark ! - character, the question mark ? character, and the pipe | character. They must not be active when - defining a glossary entry where they occur in the sort key (and they should be avoided in the label - if they may be active at any point in the document). Additionally, the comma , character and the - equals = character should not be active when using commands that have ⟨key⟩=⟨value⟩ arguments. -

    -
-

To overcome the first two problems, as from version 4.0 the glossaries package modifies the definition of -\newglossaryentry at the beginning of the document environment so that the definitions are written to an -external file (\jobname.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 glossary, even if the glossary occurs at the beginning of the -document. -

There are drawbacks to this mechanism: if you modify an entry definition, you need a second run to see the -effect of your modification in \printglossary (if it occurs at the start of the document); this method requires -an extra \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 multiple define the same entry label. - - -

The glossaries-extra package provides a setting (but only for Options 2 and 3) that allows \newglossaryentry -to occur in the document environment but doesn’t create the glsdefs file. This circumvents some problems but -it means that you can’t display any of the glossaries before all the entries have been defined (so -it’s all right if all the glossaries are at the end of the document but not if any occur in the front -matter). -

-

-

Top

4.8.2 Good Practice Issues

-

The above section covers technical issues that can cause your document to have compilation errors or produce -incorrect output. This section focuses on good writing practice. The main reason cited by users wanting to -define entries within the document environment rather than in the preamble is that they want to -write the definition as they type in their document text. This suggests a “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 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. - - -

-

-

Top

5. Referencing Entries in the Document

-

Once you have defined a glossary entry using a command like \newglossaryentry (§4 -Defining Glossary Entries) or \newacronym (§6 Acronyms and Other Abbreviations), you can refer -to that entry in the document with one of the provided commands that are describe in this manual. (There are -some additional commands provided by glossaries-extra.) The text produced at that point in the document is -determined by the command and can also be governed by whether or not the entry has been 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 PDF bookmarks. -

The commands are broadly divided into: -

    -
  1. -

    Those that display text in the document (where the formatting can be adjusted by a style or - hook) and also index the entry (so that it’s added to the document) are described in §5.1 - Links to Glossary Entries. This set of commands can be further sub-divided into those that mark - the entry as having been used (the \gls-like commands, §5.1.1 The \gls-Like Commands - (First Use Flag Queried)) and those that don’t (the \glstext-like commands, §5.1.2 - The \glstext-Like Commands (First Use Flag Not Queried)). -

  2. -
  3. -

    Those that display text in the document without indexing or applying any additional formatting - (§5.2 Using Glossary Terms Without Links).

-

There are additional commands specific to entries defined with \newacronym that are described in -§6.1 Displaying the Long, Short and Full Forms (Independent of First Use). -

-

Top

5.1 Links to Glossary Entries

-

The text which appears at the point in the document when using any of the commands described in -§5.1.1 The \gls-Like Commands (First Use Flag Queried) or §5.1.2 The \glstext-Like -Commands (First Use Flag Not Queried) is referred to as the link text (even if there are no hyperlinks). These -commands also add a line to an external file that is used to generate the relevant entry in the glossary. This -information includes an associated location that is added to the number list for that entry. By default, the -location refers to the page number. For further information on number lists, see §12 Number -Lists. These external files need to be post-processed by makeindex or xindy unless you have chosen Options 1 -or 4. If you don’t use \makeglossaries these external files won’t be created. (Options 1 and 4 write the -information to the aux file.) -

Note that repeated use of these commands for the same entry can cause the number list 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 §5.2 Using Glossary Terms Without Links or you can use the supplemental -glossaries-extra package, which provides a means to suppress the automated indexing of the commands listed in - - -this chapter. -

I strongly recommend that you don’t use the commands defined in this chapter in the arguments of -sectioning or caption commands or any other command that has a moving argument. -

Aside from problems with expansion issues, PDF bookmarks and possible nested hyperlinks in the table of -contents (or list of whatever) any use of the commands described in §5.1.1 The \gls-Like Commands -(First Use Flag Queried) will have their first use flag unset when they appear in the table of contents (or list of -whatever).

-

-

The above warning is particularly important if you are using the glossaries package in conjunction with the -hyperref package. Instead, use one of the expandable commands listed in §5.2 Using Glossary Terms -Without Links (such as \glsentrytext but not the non-expandable case changing versions like -\Glsentrytext). Alternatively, provide an alternative via the optional argument to the sectioning/caption -command or use hyperref’s \texorpdfstring. Examples: - - -

-
-\chapter{An overview of \glsentrytext{perl}}
-\chapter[An overview of Perl]{An overview of \gls{perl}}
-\chapter{An overview of \texorpdfstring{\gls{perl}}{Perl}}
-
-

-

If you want to retain the formatting that’s available through commands like \acrshort (for example, if you -are using one of the small caps styles), then you might want to consider the glossaries-extra package which -provides commands for this purpose.
-

-

If you want the link text to produce a hyperlink to the corresponding entry details in the glossary, you -should load the hyperref package before the glossaries package. That’s what I’ve done in this document, so if you -see a hyperlinked term, such as link text, you can click on the word or phrase and it will take you to a brief -description in this document’s glossary. -

If you use the hyperref package, I strongly recommend you use pdflatex rather than latex to compile your -document, if possible. The DVI format of LaTeX has limitations with the hyperlinks that can cause a problem -when used with the glossaries package. Firstly, the DVI format can’t break a hyperlink across a line -whereas PDFLaTeX can. This means that long glossary entries (for example, the full form of an -acronym) won’t be able to break across a line with the DVI format. Secondly, the DVI format doesn’t -correctly size hyperlinks 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 DVI format, it won’t come out the correct -size. -

These are limitations of the DVI format not of the glossaries package.

-

-

It may be that you only want terms in certain glossaries to have hyperlinks, but not for other -glossaries. In this case, you can use the package option nohypertypes to identify the glossary lists -that shouldn’t have hyperlinked link text. See §2.1 General Options for further -details. -

The way the link text is displayed depends on -


\glstextformat{text}

-

-For example, to make all link text appear in a sans-serif font, do: - - -

-
-\renewcommand*{\glstextformat}[1]{\textsf{#1}}
-
-

Further customisation can be done via \defglsentryfmt or by redefining \glsentryfmt. See §5.1.3 -Changing the format of the link text for further details. -

Each entry has an associated conditional referred to as the first use flag. Some of the commands described in -this chapter automatically unset this flag and can also use it to determine what text should be displayed. These -types of commands are the \gls-like commands and are described in §5.1.1 The \gls-Like -Commands (First Use Flag Queried). The commands that don’t reference or change the first use flag are -\glstext-like commands and are described in §5.1.2 The \glstext-Like Commands (First Use Flag -Not Queried). See §7 Unsetting and Resetting Entry Flags for commands that unset (mark the -entry as having been used) or reset (mark the entry as not used) the first use flag without referencing the -entries. -

The \gls-like and \glstext-like commands all take a first optional argument that is a comma-separated -list of ⟨key⟩=⟨value⟩ options, described below. They also have a star-variant, which inserts hyper=false at the -start of the list of options and a plus-variant, which inserts hyper=true at the start of the list of options. For -example \gls*{sample} is the same as \gls[hyper=false]{sample} and \gls+{sample} is the same as -\gls[hyper=true]{sample}, whereas just \gls{sample} will use the default hyperlink setting which depends -on a number of factors (such as whether the entry is in a glossary that has been identified in the -nohypertypes list). You can override the hyper key in the variant’s optional argument, for example, -\gls*[hyper=true]{sample} but this creates redundancy and is best avoided. The glossaries-extra package -provides the option to add a third custom variant. -

Avoid nesting these commands. For example don’t do \glslink{label}{\gls{label2}} as this is likely to -cause problems. By implication, this means that you should avoid using any of these commands within the -text, first, short or long keys (or their plural equivalent) or any other key that you plan to -access through these commands. (For example, the symbol key if you intend to use \glssymbol.) -
-

-

The keys listed below are available for the optional first argument. The glossaries-extra package provides -additional keys. (See the glossaries-extra manual for further details.) -

-

-hyper

-

This is a boolean key which can be used to enable/disable the hyperlink to the relevant entry in - the glossary. If this key is omitted, the value is determined by current settings, as indicated above. - For example, when used with a \gls-like command, if this is the first use and the hyperfirst=false - package option has been used, then the default value is hyper=false. The hyperlink can be forced - on using hyper=true unless the hyperlinks have been suppressed using \glsdisablehyper. You - must load the hyperref package before the glossaries package to ensure the hyperlinks work. -

- - -

-format

-

This specifies how to format the associated location number for this entry in the glossary. This value is - equivalent to the makeindex encap value, and (as with \index) the value needs to be the name of a - command without the initial backslash. As with \index, the characters ( and ) can also be used to specify - the beginning and ending of a number range and they must be in matching pairs. (For example, - \gls[format={(}]{sample} on one page to start the range and later \gls[format={)}]{sample} to - close the range.) Again as with \index, the command should be the name of a command - which takes an argument (which will be the associated location). Be careful not to use a - declaration (such as bfseries) instead of a text block command (such as textbf) as the - effect is not guaranteed to be localised. If you want to apply more than one style to a given - entry (e.g. bold and italic) you will need to create a command that applies both formats, - e.g.  - - -

-
-     \newcommand*{\textbfem}[1]{\textbf{\emph{#1}}}
-
-

and use that command. -

In this document, the standard formats refer to the standard text block commands such as \textbf or - \emph or any of the commands listed in table 5.1. You can combine a range and format using - (format⟩ to start the range and )format⟩ to end the range. The ⟨format⟩ part must match. For example, - format={(emph} and format={)emph}. -

If you use xindy instead of makeindex, you must specify any non-standard formats that you want to use - with the format key using \GlsAddXdyAttribute{name}. So if you use xindy with the above example, - you would need to add: - - -

-
-     \GlsAddXdyAttribute{textbfem}
-
-

See §14 Xindy (Option 3) for further details.

-

-

If you are using hyperlinks and you want to change the font of the hyperlinked location, don’t use - \hyperpage (provided by the hyperref package) as the locations may not refer to a page number. Instead, - the glossaries package provides number formats listed in table 5.1. These commands are - designed to work with the particular location formats created by makeindex and xindy and shouldn’t be - used in other contexts. -

-
-


-
Table 5.1: Predefined Hyperlinked Location Formats
-
- - - - - - - - -
hyperrm serif hyperlink
hypersf sans-serif hyperlink
hypertt monospaced hyperlink
hyperbf bold hyperlink
hypermd medium weight hyperlink
hyperit italic hyperlink
hypersl slanted hyperlink
hyperup upright hyperlink
hypersc small caps hyperlink
hyperemph emphasized hyperlink
-
-

-
-

Note that if the \hyperlink command hasn’t been defined, the hyperxx⟩ formats are equivalent to the - analogous textxx⟩ font commands (and hyperemph is equivalent to emph). If you want to make a new - format, you will need to define a command which takes one argument and use that. For example, if you - want the location number to be in a bold sans-serif font, you can define a command called, say, - \hyperbsf: - - -

-
-     \newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
-
-

and then use hyperbsf as the value for the format - key.5.1 -

When defining a custom location format command that uses one of the \hyperxx commands, make sure - that the argument of \hyperxx is just the location. Any formatting must be outside of \hyperxx (as in - the above \hyperbfsf example).
-

-

Remember that if you use xindy, you will need to add this to the list of location attributes: - - -

-
-     \GlsAddXdyAttribute{hyperbsf}
-
-

-

-

-counter

-

This specifies which counter to use for this location. This overrides the default counter used by this entry. - (See also §12 Number Lists.) -

-

-local

-

This is a boolean key that only makes a difference when used with \gls-like commands that change the - entry’s first use flag. If local=true, the change to the first use flag will be localised to the current scope. - The default is local=false. -

-

-noindex

-

This is a boolean key that suppresses the indexing. Only available with glossaries-extra. -

-

-hyperoutside

-

This is a boolean key that determines whether to put the hyperlink outside of \glstextformat. Only - available with glossaries-extra. -

-

-wrgloss

-

This key determines whether to index before (wrgloss=before) or after (wrgloss=after) the link text. - Only available with glossaries-extra. -

-

-textformat

-

This key identifies the name of the control sequence to encapsulate the link text instead of the default - \glstextformat. Only available with glossaries-extra. - - -

-

-prefix

-

This key locally redefines \glolinkprefix to the given value. Only available with glossaries-extra. -

-

-thevalue

-

This key explicitly sets the location. Only available with glossaries-extra. -

-

-theHvalue

-

This key explicitly sets the hyperlink location. Only available with glossaries-extra. -

-
-

The link text isn’t scoped by default with just the base glossaries package. Any unscoped declarations in the -link text may affect subsequent text.
-

-

-

-

Top

5.1.1 The \gls-Like Commands (First Use Flag Queried)

-

This section describes the commands that unset (mark as used) the first use flag on completion, and in most -cases they use the current state of the flag to determine the text to be displayed. As described above, these -commands all have a star-variant (hyper=false) and a plus-variant (hyper=true) and have an optional first -argument that is a ⟨key⟩=⟨value⟩ list. These commands use \glsentryfmt or the equivalent definition provided by -\defglsentryfmt to determine the automatically generated text and its format (see §5.1.3 Changing -the format of the link text). -

Apart from \glsdisp, the commands described in this section also have a final optional argument ⟨insert⟩ -which may be used to insert material into the automatically generated text. -

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 set of braces {} -immediately before the opening square bracket to prevent it from being interpreted as the final argument. For -example: - - -

-
-\gls{sample} {}[Editor's comment]
-
-

-

Don’t use any of the \gls-like or \glstext-like commands in the ⟨insert⟩ argument.

-

-

Take care using these commands within commands or environments that are processed multiple times as this -can confuse the first use flag query and state change. This includes frames with overlays in beamer and the -tabularx environment provided by tabularx. The glossaries package automatically deals with this issue in -amsmath’s align environment. You can apply a patch to tabularx by placing the following command (new to -v4.28) in the preamble: -


\glspatchtabularx

-

-This does nothing if tabularx hasn’t been loaded. There’s no patch available for beamer. See §7 -Unsetting and Resetting Entry Flags for more details. -


\gls[options]{label}[insert]

-

-This command typically determines the link text from the values of the text or first keys supplied when the -entry was defined using \newglossaryentry. However, if the entry was defined using \newacronym and -\setacronymstyle was used, then the link text will usually be determined from the long or short -keys. -

There are two upper case variants: -


\Gls[options]{label}[insert]

-

-and -


\GLS[options]{label}[insert]

-

-which make the first letter of the link text or all the link text upper case, respectively. For the former, the -uppercasing of the first letter is performed by \makefirstuc. -

The first letter uppercasing command \makefirstuc has limitations which must be taken into -account if you use \Gls or any of the other commands that convert the first letter to uppercase. -
-

-The upper casing is performed as follows:

-
    -
  • -

    If the first thing in the link text is a command follow by a group, the upper casing is performed on the - first object of the group. For example, if an entry has been defined as - - -

    -
    -     \newglossaryentry{sample}{
    -      name={\emph{sample} phrase},
    -      sort={sample phrase},
    -      description={an example}}
    -
    -

    Then \Gls{sample} will set the link text to5.2 - - -

    -
    -     \emph{\MakeUppercase sample} phrase
    -
    -

    which will appear as Sample phrase. -

  • -
  • -

    If the first thing in the link text isn’t a command or is a command but isn’t followed by a group, then the - upper casing will be performed on that first thing. For example, if an entry has been defined - as: - - -

    -
    -     \newglossaryentry{sample}{
    -       name={\oe-ligature},
    -       sort={oe-ligature},
    -       description={an example}
    -     }
    -
    -

    Then \Gls{sample} will set the link text to - - -

    -
    -     \MakeUppercase \oe-ligature
    -
    -

    which will appear as Œ-ligature. -

  • -
  • -

    If you have mfirstuc v2.01 or above, an extra case is added. If the first thing is \protect it will be - discarded and the above rules will then be tried. -

    -
-

(Note the use of the sort key in the above examples.) -

There are hundreds of LaTeX packages that altogether define thousands of commands with -various syntax and it’s impossible for mfirstuc to take them all into account. The above rules are -quite simplistic and are designed for link text that starts with a text-block command (such as -\emph) or a command that produces a character (such as \oe). This means that if your link text -starts with something that doesn’t adhere to mfirstuc’s assumptions then things are likely to go -wrong. -

For example, starting with a math-shift symbol: - - -

-
-\newglossaryentry{sample}{
-  name={$a$},
-  sort={a},
-  description={an example}
+
Now these @symbol entries will be sorted according to their label. (The original label in the bib file, not the prefixed label.) This will put them in the same order as the original document. (See the “Examples” chapter of the bib2gls user manual for examples of varying the sorting and also bib2gls gallery: sorting.)

+

🗋📥 sample-dual.tex
+ This document illustrates how to define an entry that both appears in the list of acronyms and in the main glossary. To create the document do:
pdflatex sample-dual
+makeglossaries sample-dual
+pdflatex sample-dual
+
This defines a custom command \newdualentry that defines two entries at once (a normal entry and an acronym). It uses \glsadd to ensure that if one is used then the other is automatically indexed:
\newcommand*{\newdualentry}[5][]{% 
+  % main entry:
+  \newglossaryentry{main-#2}{name={#4},% 
+  text={#3\glsadd{#2}},% 
+  description={#5},% 
+  #1% additional options for main entry
+  }% 
+  % acronym:
+  \newacronym{#2}{#3\glsadd{main-#2}}{#4}% 
 }
-
-

This falls into case 2 above, so the link text will be set to - - -

-
-\MakeUppercase $a$
-
-

This attempts to uppercase the math-shift $, which will go wrong. In this case it’s not appropriate to perform -any case-changing, but it may be that you want to use \Gls programmatically without checking if -the text contains any maths. In this case, the simplest solution is to insert an empty brace at the -start: - - -

-
-\newglossaryentry{sample}{
-  name={{}$a$},
-  sort={a},
-  description={an example}
+
A sample dual entry is defined with this command:
\newdualentry{svm}% label
+  {SVM}% short form
+  {support vector machine}% long form
+  {Statistical pattern recognition technique}% description
+
This defines an acronym with the label “svm” that can be referenced with \gls{svm} but it also defines an entry with the label “main-svm”. This isn’t used in the document with \gls but it’s automatically added from the \glsadd{main-svm} code in the short form of “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 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 entries across multiple lists. For example, this user manual defines all described commands (such as \gls) as glossary entries. They appear in the 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 index (where just the name and location list is shown).

+

+If you want to switch over to bib2gls, first change to glossaries-extra:
\usepackage[record,postdot,stylemods,acronym]{glossaries-extra}
+
Next, the definition needs to be converted to the bib format required by bib2gls. If you do:
convertgls2bib --preamble-only sample-dual.tex entries.bib
+
then convertgls2bib will report the following:
Overriding default definition of \newdualentry with custom 
+definition. (Change \newcommand to \providecommand if you want 
+\newdualentry[options]{label}{short}{long}{description}
+converted to @dualabbreviationentry.)
+
This is because convertgls2bib has its own internal definition of \newdualentry, but if it encounters a new definition that will override its default. If you want to retain convertgls2bib’s definition (recommended) then just replace \newcommand with \providecommand in the document source and rerun convertgls2bib.

+With \providecommand, the new entries.bib file created by convertgls2bib contains:

@dualabbreviationentry{svm,
+  short={SVM},
+  description={Statistical pattern recognition technique},
+  long={support vector machine}
 }
-
-

Now the link text will be set to - - -

-
-\MakeUppercase{}$a$
-
-

and the \uppercase becomes harmless. -

Another issue occurs when the link text starts with a command followed by an argument (case 1) but the -argument is a label, identifier or something else that shouldn’t have a case-change. A common example is when -the link text starts with one of the commands described in this chapter. (But you haven’t done that, have you? -What with the warning not to do it at the beginning of the chapter.) Or when the link text starts with one of -the non-linking commands described in §5.2 Using Glossary Terms Without Links. For -example: - - -

-
-\newglossaryentry{sample}{name={sample},description={an example}}
-\newglossaryentry{sample2}{
-   name={\glsentrytext{sample} two},
-   sort={sample two},
-   description={another example}
- }
-
-

Now the link text will be set to: - - -

-
-\glsentrytext{\MakeUppercase sample} two
-
-

This will generate an error because there’s no entry with the label “\MakeUppercase sample”. The best -solution here is to write the term out in the text field and use the command in the name field. If you don’t use -\glsname anywhere in your document, you can use \gls in the name field: - - -

-
-\newglossaryentry{sample}{name={sample},description={an example}}
-\newglossaryentry{sample2}{
-   name={\gls{sample} two},
-   sort={sample two},
-   text={sample two},
-   description={another example}
- }
-
-

-

If the link text starts with a command that has an optional argument or with multiple arguments where the -actual text isn’t in the first argument, then \makefirstuc will also fail. For example: - - -

-
-\newglossaryentry{sample}{
- name={\textcolor{blue}{sample} phrase},
- sort={sample phrase},
- description={an example}}
-
-

Now the link text will be set to: - - -

-
-\textcolor{\MakeUppercase blue}{sample} phrase
-
-

This won’t work because \MakeUppercase blue isn’t a recognised colour name. In this case you will have to -define a helper command where the first argument is the text. For example: - - -

-
-\newglossaryentry{sample}{
-\newcommand*{\blue}[1]{\textcolor{blue}{#1}}
- name={\blue{sample} phrase},
- sort={sample phrase},
- description={an example}}
-
-

In fact, since the whole design ethos of LaTeX is the separation of content and style, it’s better to use a -semantic command. For example: - - -

-
-\newglossaryentry{sample}{
-\newcommand*{\keyword}[1]{\textcolor{blue}{#1}}
- name={\keyword{sample} phrase},
- sort={sample phrase},
- description={an example}}
-
-

For further details see the mfirstuc user manual. -

There are plural forms that are analogous to \gls: -


\glspl[options]{label}[insert]

-

-


\Glspl[options]{label}[insert]

-

-


\GLSpl[options]{label}[insert]

-

-These typically determine the link text from the plural or firstplural keys supplied when the entry was -defined using \newglossaryentry or, if the entry is an abbreviation and \setacronymstyle was used, from the -longplural or shortplural keys. -

Be careful when you use glossary entries in math mode especially if you are using hyperref as it can affect -the spacing of subscripts and superscripts. For example, suppose you have defined the following -entry: - - -

-
-\newglossaryentry{Falpha}{name={F_\alpha},
-description=sample}
-
-

and later you use it in math mode: - - -

-
-$\gls{Falpha}^2$
-
-

This will result in Fα2 instead of Fα2. In this situation it’s best to bring the superscript into the hyperlink -using the final ⟨insert⟩ optional argument: - - -

-
-$\gls{Falpha}[^2]$
-
-

-

-


\glsdisp[options]{label}{link text}

-

-This behaves in the same way as the above commands, except that the ⟨link text⟩ is explicitly set. There’s no final -optional argument as any inserted material can be added to the ⟨link text⟩ argument. -

Don’t use any of the \gls-like or \glstext-like commands in the ⟨link text⟩ argument of \glsdisp. -
-

-

-

-

Top

5.1.2 The \glstext-Like Commands (First Use Flag Not Queried)

-

This section describes the commands that don’t change or reference the first use flag. As described above, these -commands all have a star-variant (hyper=false) and a plus-variant (hyper=true) and have an optional first -argument that is a ⟨key⟩=⟨value⟩ list. These commands also don’t use \glsentryfmt or the equivalent -definition provided by \defglsentryfmt (see §5.1.3 Changing the format of the link text). -Additional commands for abbreviations are described in §6 Acronyms and Other -Abbreviations. -

Apart from \glslink, the commands described in this section also have a final optional argument ⟨insert⟩ -which may be used to insert material into the automatically generated text. See the caveat above in -§5.1.1 The \gls-Like Commands (First Use Flag Queried). -


\glslink[options]{label}{link text}

-

-This command explicitly sets the link text as given in the final argument. -

Don’t use any of the \gls-like or \glstext-like commands in the argument of \glslink. By -extension, this means that you can’t use them in the value of fields that are used to form link text. -
-

-


\glstext[options]{label}[insert]

-

-This command always uses the value of the text key as the link text. -

There are also analogous commands: -


\Glstext[options]{text}[insert]

-

- - -


\GLStext[options]{text}[insert]

-

-These convert the first character or all the characters to uppercase, respectively. See the note on \Gls above for -details on the limitations of converting the first letter to upper case. -

There’s no equivalent command for title-casing, but you can use the more generic command -\glsentrytitlecase in combination with \glslink. For example: - - -

-
-\glslink{sample}{\glsentrytitlecase{sample}{text}}
-
-

(See §5.2 Using Glossary Terms Without Links.) -


\glsfirst[options]{label}[insert]

-

-This command always uses the value of the first key as the link text. -

There are also analogous uppercasing commands: -


\Glsfirst[options]{text}[insert]

-

-


\GLSfirst[options]{text}[insert]

-

-

The value of the first key (and firstplural key) doesn’t necessarily match the text produced by \gls (or -\glspl) on first use as the link text used by \gls may be modified through commands like \defglsentry. -(Similarly, the value of the text and plural keys don’t necessarily match the link text used by \gls or \glspl -on subsequent use.)
-

-


\glsplural[options]{label}[insert]

-

-This command always uses the value of the plural key as the link text. -

There are also analogous uppercasing commands: -


\Glsplural[options]{text}[insert]

-

-


\GLSplural[options]{text}[insert]

-

-


\glsfirstplural[options]{label}[insert]

-

-This command always uses the value of the firstplural key as the link text. -

There are also analogous uppercasing commands: -


\Glsfirstplural[options]{text}[insert]

-

-


\GLSfirstplural[options]{text}[insert]

-

-


\glsname[options]{label}[insert]

-

-This command always uses the value of the name key as the link text. Note that this may be different from the - - -values of the text or first keys. In general it’s better to use \glstext or \glsfirst instead of -\glsname. -

There are also analogous uppercasing commands: -


\Glsname[options]{text}[insert]

-

-


\GLSname[options]{text}[insert]

-

-

In general it’s best to avoid \Glsname with acronyms. Instead, consider using \Acrlong, \Acrshort or -\Acrfull.
-

-


\glssymbol[options]{label}[insert]

-

-This command always uses the value of the symbol key as the link text. -

There are also analogous uppercasing commands: -


\Glssymbol[options]{text}[insert]

-

-


\GLSsymbol[options]{text}[insert]

-

-


\glsdesc[options]{label}[insert]

-

-This command always uses the value of the description key as the link text. -

There are also analogous uppercasing commands: -


\Glsdesc[options]{text}[insert]

-

-


\GLSdesc[options]{text}[insert]

-

-

If you want the title case version you can use - - -

-
-\glslink{sample}{\glsentrytitlecase{sample}{desc}}
-
-

-


\glsuseri[options]{label}[insert]

-

-This command always uses the value of the user1 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuseri[options]{text}[insert]

-

-


\GLSuseri[options]{text}[insert]

-

-


\glsuserii[options]{text}[insert]

-

-This command always uses the value of the user2 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuserii[options]{text}[insert]

-

-


\GLSuserii[options]{text}[insert]

-

-


\glsuseriii[options]{text}[insert]

-

-This command always uses the value of the user3 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuseriii[options]{text}[insert]

-

-


\GLSuseriii[options]{text}[insert]

-

-


\glsuseriv[options]{text}[insert]

-

-This command always uses the value of the user4 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuseriv[options]{text}[insert]

-

-


\GLSuseriv[options]{text}[insert]

- - -

-


\glsuserv[options]{text}[insert]

-

-This command always uses the value of the user5 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuserv[options]{text}[insert]

-

-


\GLSuserv[options]{text}[insert]

-

-


\glsuservi[options]{text}[insert]

-

-This command always uses the value of the user6 key as the link text. -

There are also analogous uppercasing commands: -


\Glsuservi[options]{text}[insert]

-

-


\GLSuservi[options]{text}[insert]

-

-

-

-

Top

5.1.3 Changing the format of the link text

-

The glossaries-extra package provides ways of altering the format according to the category. See the -glossaries-extra manual for further details.
-

-

The default format of the link text for the \gls-like commands is governed -by5.3: -


\glsentryfmt

-

-This may be redefined but if you only want the change the display style for a given glossary, then you need to -use -


\defglsentryfmt[type]{definition}

-

-instead of redefining \glsentryfmt. The optional first argument ⟨type⟩ is the glossary type. This defaults to -\glsdefaulttype if omitted. The second argument is the entry format definition. -

Note that \glsentryfmt is the default display format for entries. Once the display format has been changed -for an individual glossary using \defglsentryfmt, redefining \glsentryfmt won’t have an effect on that -glossary, you must instead use \defglsentryfmt again. Note that glossaries that have been identified as -lists of acronyms (via the package option acronymlists or the command \DeclareAcronymList, see -§2.7 Acronym and Abbreviation Options) use \defglsentryfmt to set their display style. - - -
-

-

Within the ⟨definition⟩ argument of \defglsentryfmt, or if you want to redefine \glsentryfmt, you may use -the following commands: -


\glslabel

-

-This is the label of the entry being referenced. As from version 4.08, you can also access the glossary entry type -using: -


\glstype

-

-This is defined using \edef so the replacement text is the actual glossary type rather than -\glsentrytype{\glslabel}. -


\glscustomtext

-

-This is the custom text supplied in \glsdisp. It’s always empty for \gls, \glspl and their upper case variants. -(You can use etoolbox’s \ifdefempty to determine if \glscustomtext is empty.) -


\glsinsert

-

-The custom text supplied in the final optional argument to \gls, \glspl and their upper case -variants. -


\glsifplural{true text}{false text}

-

-If \glspl, \Glspl or \GLSpl was used, this command does ⟨true text⟩ otherwise it does ⟨false text⟩. -


\glscapscase{no case}{first uc}{all caps}

-

-If \gls, \glspl or \glsdisp were used, this does ⟨no case⟩. If \Gls or \Glspl were used, this does ⟨first uc⟩. If -\GLS or \GLSpl were used, this does ⟨all caps⟩. -


\glsifhyperon{hyper true}{hyper false}

-

-This will do ⟨hyper true⟩ if the hyperlinks are on for the current reference, otherwise it will do ⟨hyper false⟩. The -hyperlink may be off even if it wasn’t explicitly switched off with the hyper key or the use of a starred -command. It may be off because the hyperref package hasn’t been loaded or because \glsdisablehyper -has been used or because the entry is in a glossary type that’s had the hyperlinks switched off -(using nohypertypes) or because it’s the first use and the hyperlinks have been suppressed on first -use. -

The \glsifhyperon command should be used instead of \glsifhyper, which is now deprecated (and no -longer documented).
-

-

If you want to know if the command used to reference this entry was used with the star or plus variant, you -can use: -


\glslinkvar{unmodified}{star}{plus}

-

-This will do ⟨unmodified⟩ if the unmodified version was used, or will do ⟨star⟩ if the starred version was used, or -will do ⟨plus⟩ if the plus version was used. Note that this doesn’t take into account if the hyper key was used to - - -override the default setting, so this command shouldn’t be used to guess whether or not the hyperlink is on for -this reference. -

Note that you can also use commands such as \ifglsused within the definition of \glsentryfmt (see -§7 Unsetting and Resetting Entry Flags). -

The commands \glslabel, \glstype, \glsifplural, \glscapscase, \glsinsert and \glscustomtext are -typically updated at the start of the \gls-like and \glstext-like commands so they can usually be accessed in -the hook user commands, such as \glspostlinkhook and \glslinkpostsetkeys. -

This means that using commands like \gls within the fields that are accessed using the \gls-like or -\glstext-like commands (such as the first, text, long or short keys) will cause a problem. The entry -formatting performed by \glsentryfmt and related commands isn’t scoped (otherwise if would -cause problems for \glspostlinkhook which may need to look ahead as well as look behind). This -means that any nested commands will, at the very least, change the label stored in \glslabel. -
-

-

If you only want to make minor modifications to \glsentryfmt, you can use -


\glsgenentryfmt

-

-This uses the above commands to display just the first, text, plural or firstplural keys (or the custom -text) with the insert text appended. -

Alternatively, if you want to change the entry format for abbreviations (defined via \newacronym) you can -use: -


\glsgenacfmt

-

-This uses the values from the long, short, longplural and shortplural keys, rather than using the text, -plural, first and firstplural keys. The first use singular text is obtained via: -


\genacrfullformat{label}{insert}

-

-instead of from the first key, and the first use plural text is obtained via: -


\genplacrfullformat{label}{insert}

-

-instead of from the firstplural key. In both cases, ⟨label⟩ is the entry’s label and ⟨insert⟩ is the insert text -provided in the final optional argument of commands like \gls. The default behaviour is to do the long form (or -plural long form) followed by ⟨insert⟩ and a space and the short form (or plural short form) in parentheses, where -the short form is in the argument of \firstacronymfont. There are also first letter upper case -versions: -


\Genacrfullformat{label}{insert}

-

-and -


\Genplacrfullformat{label}{insert}

-

-By default these perform a protected expansion on their no-case-change equivalents and then use -\makefirstuc to convert the first character to upper case. If there are issues caused by this expansion, you -will need to redefine those commands to explicitly use commands like \Glsentrylong (which is -what the predefined acronym styles, such as long-short, do). Otherwise, you only need to redefine -\genacrfullformat and \genplacrfullformat to change the behaviour of \glsgenacfmt. See - - -§6 Acronyms and Other Abbreviations for further details on changing the style of -acronyms. -

Note that \glsentryfmt (or the formatting given by \defglsentryfmt) is not used by the -\glstext-like commands.
-

-

As from version 4.16, both the \gls-like and \glstext-like commands use -


\glslinkpostsetkeys

-

-after the ⟨options⟩ are set. This macro does nothing by default but can be redefined. (For example, to switch off -the hyperlink under certain conditions.) This version also introduces -


\glspostlinkhook

-

-which is done after the link text has been displayed and also after the first use flag has been unset (see -example 18). - -

Example 8 (Custom Entry Display in Text) -

Suppose you want a glossary of measurements and units, you can use the symbol key to store the -unit: - - -

-
-\newglossaryentry{distance}{name=distance,
-description={The length between two points},
-symbol={km}}
-
-

and now suppose you want \gls{distance} to produce “distance (km)” on first use, then you can redefine -\glsentryfmt as follows: - - -

-
-\renewcommand*{\glsentryfmt}{%
-  \glsgenentryfmt
-  \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}%
+
If \newcommand is retained, it will instead contain:
@entry{main-svm,
+  name={support vector machine},
+  description={Statistical pattern recognition technique},
+  text={SVM\glsadd{svm}}
 }
-
-

-

(Note that I’ve used \glsentrysymbol rather than \glssymbol to avoid nested hyperlinks.) -

Note also that all of the link text will be formatted according to \glstextformat (described earlier). So if -you do, say: - - -

-
-\renewcommand{\glstextformat}[1]{\textbf{#1}}
-\renewcommand*{\glsentryfmt}{%
-  \glsgenentryfmt
-  \ifglsused{\glslabel}{}{\space(\glsentrysymbol{\glslabel})}%
+
+@acronym{svm,
+  short={SVM\glsadd{main-svm}},
+  long={support vector machine}
 }
-
-

then \gls{distance} will produce “distance (km)”. -

For a complete document, see the sample file sample-entryfmt.tex.

-
-

-

____________________________

- -

Example 9 (Custom Format for Particular Glossary) -

Suppose you have created a new glossary called notation and you want to change the way the entry is -displayed on first use so that it includes the symbol, you can do: - - -

-
-\defglsentryfmt[notation]{\glsgenentryfmt
- \ifglsused{\glslabel}{}{\space
-   (denoted \glsentrysymbol{\glslabel})}}
-
-

Now suppose you have defined an entry as follows: - - -

-
-\newglossaryentry{set}{type=notation,
-  name=set,
-  description={A collection of objects},
-  symbol={$S$}
+
In the first case, bib2gls creates two linked entries using its primary-dual mechanism. In the second case, bib2gls creates two entries that simply reference each other.

+Assuming that your entries.bib file just contains @dualabbreviationentry, now replace \makeglossaries with:

\GlsXtrLoadResources[src={entries},% entries.bib
+  type=acronym,dual-type=main,dual-prefix={main-}]
+

+Then remove the definition of \newdualentry and the entry definition. Finally, replace \printglossaries with \printunsrtglossaries. The document build is:

pdflatex sample-dual
+bib2gls sample-dual
+pdflatex sample-dual
+

+If, instead, your entries.bib file contains separate @entry and @acronym, then you need:

\setabbreviationstyle[acronym]{long-short}
+\GlsXtrLoadResources[src={entries}]
+
If you need number lists, the document build is now
pdflatex sample-dual
+bib2gls sample-dual
+pdflatex sample-dual
+bib2gls sample-dual
+pdflatex sample-dual
+
and this time bib2gls complains about the use of \glsadd within the short and text fields as this can be problematic. (The extra bib2gls and LaTeX calls are to ensure the number list is up to date for the “main-svm” entry, which can only be indexed with \glsadd after “svm” has been defined.)

+Dual entries make much more sense when one entry is for a glossary with the description displayed but no number list (or just a primary location), and the other is for the index without the description but with a number list. This can be created by replacing @dualabbreviationentry with @dualindexabbreviation:

@dualindexabbreviation{svm,
+  description={Statistical pattern recognition technique},
+  short={SVM},
+  long={support vector machine}
 }
-
-

The first time you reference this entry it will be displayed as: “set (denoted S)” (assuming \gls was -used). -

Alternatively, if you expect all the symbols to be set in math mode, you can do: - - -

-
-\defglsentryfmt[notation]{\glsgenentryfmt
- \ifglsused{\glslabel}{}{\space
-   (denoted $\glsentrysymbol{\glslabel}$)}}
-
-

and define entries like this: - - -

-
-\newglossaryentry{set}{type=notation,
-  name=set,
-  description={A collection of objects},
-  symbol={S}
+
This can be mixed with @index terms for example:
@index{machlearn,
+   name={machine learning}
 }
-
-

-
-

-

____________________________

-

Remember that if you use the symbol key, you need to use a glossary style that displays the symbol, as many -of the styles ignore it. -

-

-

Top

5.1.4 Enabling and disabling hyperlinks to glossary entries

-

If you load the hyperref or html packages prior to loading the glossaries package, the \gls-like and -\glstext-like commands will automatically have hyperlinks to the relevant glossary entry, unless the hyper -option has been switched off (either explicitly or through implicit means, such as via the nohypertypes package -option). -

You can disable or enable links using: -


\glsdisablehyper

-

-and -


\glsenablehyper

-

-respectively. The effect can be localised by placing the commands within a group. Note that you should only use -\glsenablehyper if the commands \hyperlink and \hypertarget have been defined (for example, by the -hyperref package). -

You can disable just the first use links using the package option hyperfirst=false. Note that this option only -affects the \gls-like commands that recognise the first use flag. - -

Example 10 (First Use With Hyperlinked Footnote Description) -

Suppose I want the first use to have a hyperlink to the description in a footnote instead of hyperlinking to -the relevant place in the glossary. First I need to disable the hyperlinks on first use via the package option -hyperfirst=false: - - -

-
-\usepackage[hyperfirst=false]{glossaries}
-
-

Now I need to redefine \glsentryfmt (see §5.1.3 Changing the format of the link text): - - -

-
-\renewcommand*{\glsentryfmt}{%
-  \glsgenentryfmt
-  \ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}%
+
The document needs modifying:
\documentclass{article}
+
+\usepackage[record,postdot,
+ nostyles,stylemods=bookindex,list,% only want bookindex and list styles
+ acronym]{glossaries-extra}
+
+\setabbreviationstyle{long-short-desc}
+\GlsXtrLoadResources[src={entries},% entries.bib
+ dual-type=acronym,
+ label-prefix={idx.},dual-prefix={},
+ combine-dual-locations={primary}]
+
+\glsxtrnewglslike{idx.}{\idx}{\idxpl}{\Idx}{\Idxpl}
+
+\begin{document}
+\gls{svm} and \idx{machlearn}.
+
+\printunsrtglossary[type=\acronymtype,style=altlist]
+\printunsrtglossary[style=bookindex,title={Index}]
+\end{document}
+
See the bib2gls manual for further details.

+

🗋📥 sample-langdict.tex
+ This document illustrates how to use the glossaries package to create English to French and French to English dictionaries. To create the document do:
pdflatex sample-langdict
+makeglossaries sample-langdict
+pdflatex sample-langdict
+
This example uses the nomain package option to prevent the creation of the main glossary. This means that the document must provide its own glossaries:
\newglossary[glg]{english}{gls}{glo}{English to French}
+\newglossary[flg]{french}{flx}{flo}{French to English}
+
This means that if you want to call makeindex explicitly you need to take these new extensions into account:
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
+
As with the previous example, this document provides a custom command that defines two related entries:
\newcommand*{\newword}[4]{% 
+  \newglossaryentry{en-#1}{type={english},name={#2},description={#3 #4}}% 
+  \newglossaryentry{fr-#1}{type={french},name={#3 #4},text={#4},sort={#4},
+    description={#2}}% 
 }
-
-

-

Now the first use won’t have hyperlinked text, but will be followed by a footnote. See the sample file -sample-FnDesc.tex for a complete document.

-
-

-

____________________________

-

Note that the hyperfirst option applies to all defined glossaries. It may be that you only want to disable the -hyperlinks on first use for glossaries that have a different form on first use. This can be achieved by noting that -since the entries that require hyperlinking for all instances have identical first and subsequent text, they can be -unset via \glsunsetall (see §7 Unsetting and Resetting Entry Flags) so that the hyperfirst option -doesn’t get applied. - -

Example 11 (Suppressing Hyperlinks on First Use Just For Acronyms) -

Suppose I want to suppress the hyperlink on first use for acronyms but not for entries in the main glossary. -I can load the glossaries package using: - - -

-
-\usepackage[hyperfirst=false,acronym]{glossaries}
-
-

Once all glossary entries have been defined I then do: - - -

-
-\glsunsetall[main]
-
-

-

-
-

-

____________________________

-

For more complex requirements, you might find it easier to switch off all hyperlinks via \glsdisablehyper -and put the hyperlinks (where required) within the definition of \glsentryfmt (see §5.1.3 Changing -the format of the link text) via \glshyperlink (see §5.2 Using Glossary Terms Without -Links). - -

Example 12 (Only Hyperlink in Text Mode Not Math Mode) -

This is a bit of a contrived example, but suppose, for some reason, I only want the \gls-like commands to -have hyperlinks when used in text mode, but not in math mode. I can do this by adding the glossary to the list -of nohypertypes and redefining \glsentryfmt: - - -

-
-\GlsDeclareNoHyperList{main}
-\renewcommand*{\glsentryfmt}{%
-  \ifmmode
-    \glsgenentryfmt
-  \else
-    \glsifhyperon
-    {\glsgenentryfmt}% hyperlink already on
-    {\glshyperlink[\glsgenentryfmt]{\glslabel}}%
-  \fi
+
This has the syntax:
\newword{label}{english}{determiner}{french}
+
(Note that this trivial example doesn’t take plurals into account.) This custom command will define two terms with labels en-label (for the English term) and fr-label (for the French term). So
\newword{cat}{cat}{le}{chat}
+
is equivalent to:
\newglossaryentry{en-cat}{type={english},name={cat},description={le chat}}
+\newglossaryentry{fr-cat}{type={french},name={le chat},sort={chat},
+  description={cat}}
+

+Unlike the previous example (sample-dual.tex), there’s no link between these two entries. If the document only uses \gls{en-cat}, then the “en-cat” entry will appear in the english glossary but the “fr-cat” entry won’t appear in the french one.

+

+If you want to switch to bib2gls then you first need to convert the document so that it uses glossaries-extra, but include the prefix option to ensure that glossaries-prefix is also loaded:
\usepackage[record,prefix,postdot,stylemods,nomain]{glossaries-extra}
+
You don’t need to worry about file extensions now, so it’s simpler to use the starred \newglossary*:
\newglossary*{english}{English to French}
+\newglossary*{french}{French to English}
+
Next the entries need to be converted to the bib format required by bib2gls:
convertgls2bib --preamble-only --ignore-type sample-langdict.tex entries.bib
+
This creates the file entries.bib that contains entries defined like:
@entry{en-cat,
+  name={cat},
+  description={le chat}
 }
-
-

Note that this doesn’t affect the \glstext-like commands, which will have the hyperlinks off unless they’re -forced on using the plus variant. -

See the sample file sample-nomathhyper.tex for a complete document.

-
-

-

____________________________

- -

Example 13 (One Hyper Link Per Entry Per Chapter) -

Here’s a more complicated example that will only have the hyperlink on the first time an entry is used per -chapter. This doesn’t involve resetting the first use flag. Instead it adds a new key using \glsaddstoragekey -(see §4.3.2 Storage Keys) that keeps track of the chapter number that the entry was last used -in: - - -

-
-\glsaddstoragekey{chapter}{0}{\glschapnum}
-
-

This creates a new user command called \glschapnum that’s analogous to \glsentrytext. The default value -for this key is 0. I then define my glossary entries as usual. -

Next I redefine the hook \glslinkpostsetkeys (see §5.1.3 Changing the format of the link text) -so that it determines the current chapter number (which is stored in \currentchap using \edef). This value is -then compared with the value of the entry’s chapter key that I defined earlier. If they’re the same, this entry -has already been used in this chapter so the hyperlink is switched off using xkeyval’s \setkeys command. -If the chapter number isn’t the same, then this entry hasn’t been used in the current chapter. -The chapter field is updated using \glsfieldxdef (§15.3 Fetching and Updating the -Value of a Field) provided the user hasn’t switched off the hyperlink. (This test is performed using -\glsifhyperon. - - -

-
-\renewcommand*{\glslinkpostsetkeys}{%
- \edef\currentchap{\arabic{chapter}}%
- \ifnum\currentchap=\glschapnum{\glslabel}\relax
-  \setkeys{glslink}{hyper=false}%
- \else
-  \glsifhyperon{\glsfieldxdef{\glslabel}{chapter}{\currentchap}}{}%
- \fi
+
+@entry{fr-cat,
+  name={le chat},
+  description={cat},
+  text={chat}
 }
-
-

Note that this will be confused if you use \gls etc when the chapter counter is 0. (That is, before the first -\chapter.) -

See the sample file sample-chap-hyperfirst.tex for a complete document.

-
-

-

____________________________

-

-

-

Top

5.2 Using Glossary Terms Without Links

-

The commands described in this section display entry details without adding any information to the glossary. -They don’t use \glstextformat, they don’t have any optional arguments, they don’t affect the first use -flag and, apart from \glshyperlink, they don’t produce hyperlinks. -

Commands that aren’t expandable will be ignored by PDF bookmarks, so you will need to provide an -alternative via hyperref’s \texorpdfstring if you want to use them in sectioning commands. (This isn’t specific -to the glossaries package.) See the hyperref documentation for further details. All the commands that convert the -first letter to upper case aren’t expandable. The other commands depend on whether their corresponding keys -were assigned non-expandable values.
-

-

If you want to title case a field, you can use: -


\glsentrytitlecase{label}{field}

-

-where ⟨label⟩ is the label identifying the glossary entry, ⟨field⟩ is the field label (see table 4.1). This -internally uses: -


\glscapitalisewords{text}

-

-which defaults to \capitalisewords{text}. If your field contains formatting commands, you will need to -redefine this to use \capitalisefmtwords. See the mfirstuc manual for further details. -

For example: - - -

-
-\glsentrytitlecase{sample}{desc}
-
-

(If you want title-casing in your glossary style, you might want to investigate the glossaries-extra package.) This -command will trigger an error if the entry is undefined. -

Note that this command has the same limitations as \makefirstuc which is used by commands like \Gls -and \Glsentryname to upper-case the first letter (see the notes about \Gls in §5.1.1 The \gls-Like -Commands (First Use Flag Queried)). -


\glsentryname{label}

-

-


\Glsentryname{label}

-

-These commands display the name of the glossary entry given by ⟨label⟩, as specified by the name key. -\Glsentryname makes the first letter upper case. Neither of these commands check for the existence of ⟨label⟩. -The first form \glsentryname is expandable (unless the name contains unexpandable commands). Note that -this may be different from the values of the text or first keys. In general it’s better to use \glsentrytext or -\glsentryfirst instead of \glsentryname. -

In general it’s best to avoid \Glsentryname with abbreviations. Instead, consider using \Glsentrylong, -\Glsentryshort or \Glsentryfull.
-

-


\glossentryname{label}

-

-This is like \glsnamefont{\glsentryname{label}} but also checks for the existence of ⟨label⟩. This command is -not expandable. It’s used in the predefined glossary styles, so if you want to change the way the -name is formatted in the glossary, you can redefine \glsnamefont to use the required fonts. For -example: - - -

-
-\renewcommand*{\glsnamefont}[1]{\textmd{\sffamily #1}}
-
-

-


\Glossentryname{label}

-

-This is like \glossentryname but makes the first letter of the name upper case. -


\glsentrytext{label}

-

-


\Glsentrytext{label}

-

-These commands display the subsequent use text for the glossary entry given by ⟨label⟩, as specified by the text -key. \Glsentrytext makes the first letter upper case. The first form is expandable (unless the text contains -unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glsentryplural{label}

-

-


\Glsentryplural{label}

-

-These commands display the subsequent use plural text for the glossary entry given by ⟨label⟩, as specified by the -plural key. \Glsentryplural makes the first letter upper case. The first form is expandable (unless the value -of that key contains unexpandable commands). The second form is not expandable. Neither checks for the -existence of ⟨label⟩. -


\glsentryfirst{label}

-

-


\Glsentryfirst{label}

-

-These commands display the first use text for the glossary entry given by ⟨label⟩, as specified by the first key. -\Glsentryfirst makes the first letter upper case. The first form is expandable (unless the value of that key -contains unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glsentryfirstplural{label}

-

-


\Glsentryfirstplural{label}

-

-These commands display the plural form of the first use text for the glossary entry given by ⟨label⟩, as specified -by the firstplural key. \Glsentryfirstplural makes the first letter upper case. The first form is expandable -(unless the value of that key contains unexpandable commands). The second form is not expandable. Neither -checks for the existence of ⟨label⟩. - - -


\glsentrydesc{label}

-

-


\Glsentrydesc{label}

-

-These commands display the description for the glossary entry given by ⟨label⟩. -

\Glsentrydesc makes the first letter upper case. The first form is expandable (unless the value of that key -contains unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glossentrydesc{label}

-

-This is like \glsentrydesc{label} but also checks for the existence of ⟨label⟩. This command is not expandable. -It’s used in the predefined glossary styles to display the description. -


\Glossentrydesc{label}

-

-This is like \glossentrydesc but converts the first letter to upper case. This command is not -expandable. -


\glsentrydescplural{label}

-

-


\Glsentrydescplural{label}

-

-These commands display the plural description for the glossary entry given by ⟨label⟩. \Glsentrydescplural -makes the first letter upper case. The first form is expandable (unless the value of that key contains -unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glsentrysymbol{label}

-

-


\Glsentrysymbol{label}

-

-These commands display the symbol for the glossary entry given by ⟨label⟩. -

\Glsentrysymbol makes the first letter upper case. The first form is expandable (unless the value of that -key contains unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glsletentryfield{cs}{label}{field}

-

-This command doesn’t display anything. It merely fetches the value associated with the given field (where the -available field names are listed in table 4.1) and stores the result in the control sequence ⟨cs⟩. -For example, to store the description for the entry whose label is “apple” in the control sequence -\tmp: - - -

-
-\glsletentryfield{\tmp}{apple}{desc}
-
-

-


\glossentrysymbol{label}

-

-This is like \glsentrysymbol{label} but also checks for the existence of ⟨label⟩. This command is not expandable. -It’s used in some of the predefined glossary styles to display the symbol. -


\Glossentrysymbol{label}

-

-This is like \glossentrysymbol but converts the first letter to upper case. This command is not -expandable. -


\glsentrysymbolplural{label}

-

-


\Glsentrysymbolplural{label}

-

-These commands display the plural symbol for the glossary entry given by ⟨label⟩. \Glsentrysymbolplural -makes the first letter upper case. The first form is expandable (unless the value of that key contains -unexpandable commands). The second form is not expandable. Neither checks for the existence of -⟨label⟩. -


\glsentryuseri{label}

-

-


\Glsentryuseri{label}

-

-


\glsentryuserii{label}

-

-


\Glsentryuserii{label}

-

-


\glsentryuseriii{label}

-

-


\Glsentryuseriii{label}

-

-


\glsentryuseriv{label}

-

-


\Glsentryuseriv{label}

- - -

-


\glsentryuserv{label}

-

-


\Glsentryuserv{label}

-

-


\glsentryuservi{label}

-

-


\Glsentryuservi{label}

-

-These commands display the value of the user keys for the glossary entry given by ⟨label⟩. The lower case forms -are expandable (unless the value of the key contains unexpandable commands). The commands beginning with -an upper case letter convert the first letter of the required value to upper case and are not expandable. None of -these commands check for the existence of ⟨label⟩. -


\glshyperlink[link text]{label}

-

-This command provides a hyperlink to the glossary entry given by ⟨labelbut does not add -any information to the glossary file. The link text is given by \glsentrytext{label} by -default5.4, -but can be overridden using the optional argument. Note that the hyperlink will be suppressed if you have used -\glsdisablehyper or if you haven’t loaded the hyperref package. -

If you use \glshyperlink, you need to ensure that the relevant entry has been added to the glossary using -any of the commands described in §5.1 Links to Glossary Entries or §10 Adding an -Entry to the Glossary Without Generating Text otherwise you will end up with an undefined link. -
-

-

The next two commands are only available with Option 1 or with the savenumberlist package -option: -


\glsentrynumberlist{label}

-

-


\glsdisplaynumberlist{label}

-

-Both display the number list for the entry given by ⟨label⟩. When used with Option 1 a rerun is required to -ensure this list is up-to-date, when used with Options 2 or 3 a run of makeglossaries (or makeindex/xindy) -followed by one or two runs of LaTeX is required. -

The first command, \glsentrynumberlist, simply displays the number list as is. The second command, -\glsdisplaynumberlist, formats the list using: -


\glsnumlistsep

-

-as the separator between all but the last two elements and -


\glsnumlistlastsep

- - -

-between the final two elements. The defaults are ,␣ and ␣\&␣, respectively. -

\glsdisplaynumberlist is fairly experimental. It works with Options 1 and 4, but for Options 2 -or 3 it only works when the default counter format is used (that is, when the format key is set to -glsnumberformat). This command will only work with hyperref if you choose Options 1 or 4. If you try using -this command with Options 2 or 3 and hyperref, \glsentrynumberlist will be used instead. -
-

-

For further information see “Displaying entry details without adding information to the glossary” in the -documented code (glossaries-code.pdf). - - -

-

-

Top

6. Acronyms and Other Abbreviations

-

The glossaries-extra package provides superior abbreviation handling. You may want to consider using that -package instead of the commands described here.
-

-

Note that although this chapter uses the term “acronym”, you can also use the commands -described here for initialisms or contractions (as in the case of some of the examples given below). If -the glossary title is no longer applicable (for example, it should be “Abbreviations” rather than -“Acronyms”) then you can change the title either by redefining \acronymname (see §1.4 -Multi-Lingual Support) or by using the title key in the optional argument of \printglossary (or -\printacronyms). Alternatively consider using the glossaries-extra package’s abbreviations option instead. -
-

-

Acronyms use the same underlying mechanism as terms defined with \newglossaryentry so you can -reference them with \gls and \glspl. The way the acronym is displayed on first use is governed by the -acronym style, which should be set before you define your acronyms. For example: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\setacronymstyle{long-short}
-\newacronym{html}{HTML}{hypertext markup language}
-\newacronym{xml}{XML}{extensible markup language}
-\begin{document}
-First use: \gls{html} and \gls{xml}.
-Next use: \gls{html} and \gls{xml}.
-\end{document}
-
-

If you don’t specify a style, you will have a less-flexible, but backward-compatible, “long (short)” style with just -the base glossaries package or the short-nolong style (which only displays the short form on first use) with -glossaries-extra. -

Acronyms are defined using: -


\newacronym[key-val list]{label}{abbrv}{long}

-

-

This creates an entry with the given label in the glossary given by \acronymtype. You can specify a different -glossary using the type key within the optional argument. The \newacronym command also uses the long, -longplural, short and shortplural keys in \newglossaryentry to store the long and abbreviated forms and -their plurals. -

If you use \newacronym with glossaries-extra, you need to first set the style with:

-
-\setabbreviationstyle[acronym]{style-name} -
-
-

-

Note that the same restrictions on the entry ⟨label⟩ in \newglossaryentry also apply to \newacronym (see -§4 Defining Glossary Entries). Since \newacronym works like \newglossaryentry, you can use -\glsreset to reset the first use flag. -

If you haven’t identified the specified glossary type as a list of acronyms (via the package option acronymlists -or the command \DeclareAcronymList, see §2.7 Acronym and Abbreviation Options) -\newacronym will add it to the list and reset the display style for that glossary via \defglsentryfmt. If you -have a mixture of acronyms and regular entries within the same glossary, care is needed if you want to change -the display style: you must first identify that glossary as a list of acronyms and then use \defglsentryfmt (not -redefine \glsentryfmt) before defining your entries. Alternatively, use glossaries-extra to have better support for -a mixed glossary.
-

-

The optional argument {key-val list} allows you to specify additional information. Any key that can be used -in the second argument of \newglossaryentry can also be used here in ⟨key-val list⟩. For example, description - - -(when used with one of the styles that require a description, described in §6.2 Changing the -Acronym Style) or you can override plural forms of ⟨abbrv⟩ or ⟨long⟩ using the shortplural or longplural keys. -For example: - - -

-
-\newacronym[longplural={diagonal matrices}]%
-  {dm}{DM}{diagonal matrix}
-
-

If the first use uses the plural form, \glspl{dm} will display: diagonal matrices (DMs). If you want to use the -longplural or shortplural keys, I recommend you use \setacronymstyle to set the display style rather than -using one of the pre-version 4.02 acronym styles (described in §2.8 Deprecated Acronym -Style Options). -

As with plural, if longplural is missing, it’s obtained by appending \glspluralsuffix to the singular -form. The short plural shortplural is obtained (if not explicitly set) by appending \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 discussed -earlier). -

A different approach is used by glossaries-extra, which has category attributes to determine whether or not -to append a suffix when forming the default value of shortplural.
-

-

Since \newacronym sets type=\acronymtype, if you want to load a file containing acronym definitions using -\loadglsentries[type]{filename}, the optional argument ⟨type⟩ will not have an effect unless you explicitly set -the type as type=\glsdefaulttype in the optional argument to \newacronym. See §4.6 Loading -Entries From a File.
-

- -

Example 14 (Defining an Abbreviation) -

The following defines the abbreviation IDN: - - -

-
-\setacronymstyle{long-short}
-\newacronym{idn}{IDN}{identification number}
-
-

\gls{idn} will produce “identification number (IDN)” on first use and “IDN” on subsequent uses. If you want -to use one of the small caps acronym styles, described in §6.2 Changing the Acronym Style, -you need to use lower case characters for the shortened form: - - -

-
-\setacronymstyle{long-sc-short}
-\newacronym{idn}{idn}{identification number}
-
-

Now \gls{idn} will produce “identification number (idn)” on first use and “idn” on subsequent uses. -

-
-

-

____________________________

-

Avoid nested definitions.
-

-

Recall from the warning in §4 Defining Glossary Entries that you should avoid -using the \gls-like and \glstext-like commands within the value of keys like text and first -due to complications arising from nested links. The same applies to abbreviations defined using -\newacronym. -

For example, suppose you have defined: - - -

-
-\newacronym{ssi}{SSI}{server side includes}
-\newacronym{html}{HTML}{hypertext markup language}
-
-

you may be tempted to do: - - -

-
-\newacronym{shtml}{S\gls{html}}{\gls{ssi} enabled \gls{html}}
-
-

Don’t! This will break the case-changing commands, such as \Gls, it will cause inconsistencies on first use, and, -if hyperlinks are enabled, will cause nested hyperlinks. It will also confuse the commands used by the entry -formatting (such as \glslabel). -

Instead, consider doing: - - -

-
-\newacronym
- [description={\gls{ssi} enabled \gls{html}}]
- {shtml}{SHTML}{SSI enabled HTML}
-
-

or - - -

-
-\newacronym
- [description={\gls{ssi} enabled \gls{html}}]
- {shtml}{SHTML}
- {server side includes enabled hypertext markup language}
-
-

Similarly for the \glstext-like commands. -

Other approaches are available with glossaries-extra. See the section “Nested Links” in the glossaries-extra -user manual.
-

-

-

Top

6.1 Displaying the Long, Short and Full Forms (Independent of First Use)

-

It may be that you want the long, short or full form regardless of whether or not the acronym has already been -used in the document. You can do so with the commands described in this section. -

The \acrcommands described below are part of the set of \glstext-like commands. That is, they -index and can form hyperlinks, but they don’t modify the first use flag. However, their display is -governed by \defentryfmt with \glscustomtext set as appropriate. All caveats that apply to the -\glstext-like commands also apply to the following commands. (Including the above warning about nested -links.) -

If you are using glossaries-extra, don’t use the commands described in this section. The glossaries-extra -package provides analogous \glsxtror \glsfmtcommands. For example, \glsxtrshort instead of -\acrshort or, if needed in a heading, \glsfmtshort. (Similarly for the case-changing variants.) -
-

-

The optional arguments are the same as those for the \glstext-like commands, and there are similar star -and plus variants that switch off or on the hyperlinks. As with the \glstext-like commands, the link text is -placed in the argument of \glstextformat. -


\acrshort[options]{label}[insert]

-

-This sets the link text to the short form (within the argument of \acronymfont) for the entry given by ⟨label⟩. -The short form is as supplied by the short key, which \newacronym implicitly sets. -

There are also analogous upper case variants: -


\Acrshort[options]{label}[insert]

-

-


\ACRshort[options]{label}[insert]

-

-There are also plural versions: -


\acrshortpl[options]{label}[insert]

-

- - -


\Acrshortpl[options]{label}[insert]

-

-


\ACRshortpl[options]{label}[insert]

-

-The short plural form is as supplied by the shortplural key, which \newacronym implicitly sets. -


\acrlong[options]{label}[insert]

-

-This sets the link text to the long form for the entry given by ⟨label⟩. The long form is as supplied by the long -key, which \newacronym implicitly sets. -

There are also analogous upper case variants: -


\Acrlong[options]{label}[insert]

-

-


\ACRlong[options]{label}[insert]

-

-Again there are also plural versions: -


\acrlongpl[options]{label}[insert]

-

-


\Acrlongpl[options]{label}[insert]

-

-


\ACRlongpl[options]{label}[insert]

-

-The long plural form is as supplied by the longplural key, which \newacronym implicitly sets. -

The commands below display the full form of the acronym, but note that this isn’t necessarily the same as -the form used on first use. These full-form commands are shortcuts that use the above commands, rather than -creating the link text from the complete full form. These full-form commands have star and plus variants and -optional arguments that are passed to the above commands. -


\acrfull[options]{label}[insert]

-

-This is a shortcut for -


\acrfullfmt{options}{label}{insert}

-

-which by default does

-
-\acrfullformat -
 {\acrlong[options]{label}{insert}} -
 {\acrshort[options]{label}} -
-
where -


\acrfullformat{long}{short}

- - -

-by default does ⟨long⟩ (⟨short⟩). This command is now deprecated for new acronym styles but is used by default -for backward compatibility if \setacronymstyle (§6.2 Changing the Acronym -Style) hasn’t been used. (For further details of these format commands see the documented code, -glossaries-code.pdf.) -

There are also analogous upper case variants: -


\Acrfull[options]{label}[insert]

-

-


\ACRfull[options]{label}[insert]

-

-and plural versions: -


\acrfullpl[options]{label}[insert]

-

-


\Acrfullpl[options]{label}[insert]

-

-


\ACRfullpl[options]{label}[insert]

-

-

If you find the above commands too cumbersome to write, you can use the shortcuts package option to -activate the shorter command names listed in table 6.1. -

-
- - -


- - -
Table 6.1: Synonyms provided by the package option shortcuts
-
- - - - - - - - - - - - - - - -
Shortcut Command Equivalent Command
\acs \acrshort
\Acs \Acrshort
\acsp \acrshortpl
\Acsp \Acrshortpl
\acl \acrlong
\Acl \Acrlong
\aclp \acrlongpl
\Aclp \Acrlongpl
\acf \acrfull
\Acf \Acrfull
\acfp \acrfullpl
\Acfp \Acrfullpl
\ac \gls
\Ac \Gls
\acp \glspl
\Acp \Glspl
-
- - -

-
-

It is also possible to access the long and short forms without adding information to the glossary using -commands analogous to \glsentrytext (described in §5.2 Using Glossary Terms Without -Links). -

The commands that convert the first letter to upper case come with the same caveats as those for analogous -commands like \Glsentrytext (non-expandable, can’t be used in PDF bookmarks, care needs to be taken if the -first letter is an accented character etc). See §5.2 Using Glossary Terms Without Links. -
-

-

The long form can be accessed using: -


\glsentrylong{label}

-

-or, with the first letter converted to upper case: -


\Glsentrylong{label}

-

-Plural forms: -


\glsentrylongpl{label}

-

-


\Glsentrylongpl{label}

-

-

Similarly, to access the short form: -


\glsentryshort{label}

-

-or, with the first letter converted to upper case: -


\Glsentryshort{label}

-

-Plural forms: -


\glsentryshortpl{label}

-

-


\Glsentryshortpl{label}

-

-

And the full form can be obtained using: -


\glsentryfull{label}

-

-


\Glsentryfull{label}

-

-


\glsentryfullpl{label}

- - -

-


\Glsentryfullpl{label}

-

-These again use \acrfullformat by default, but the new styles described in the section below use different -formatting commands. -

-

Top

6.2 Changing the Acronym Style

-

If you are using glossaries-extra, don’t use the commands described in this section. Use \setabbreviationstyle to -set the style. This uses a different (but more consistent) naming scheme. For example, long-noshort instead of -dua. See the “Acronym Style Modifications” section and the “Abbreviations” chapter in the glossaries-extra -manual for further details.
-

-

The acronym style is set using: -


\setacronymstyle{style name}

-

-where ⟨style name⟩ is the name of the required style. -

You must use \setacronymstyle before you define the acronyms with \newacronym.
-

-

For example: - - -

-
-\usepackage[acronym]{glossaries}
-\makeglossaries
-\setacronymstyle{long-sc-short}
-\newacronym{html}{html}{hypertext markup language}
-\newacronym{xml}{xml}{extensible markup language}
-
-

Unpredictable results can occur if you try to use multiple styles. -

If you need multiple abbreviation styles, then use the glossaries-extra package, which has better abbreviation -management. See, for example, Gallery: Mixing Styles.
-

-

Unlike the backward-compatible default behaviour of \newacronym, the styles set via \setacronymstyle -don’t use the first or text keys, but instead they use \defglsentryfmt to set a custom format -that uses the long and 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 “s”. In -fact, most of the predefined styles use \glsgenacfmt and modify the definitions of commands like -\genacrfullformat. -

Note that when you use \setacronymstyle the name key is set to -


\acronymentry{label}

-

-and the sort key is set to -


\acronymsort{short}{long}

-

-These commands are redefined by the acronym styles. However, you can redefine them again after the style has -been set but before you use \newacronym. Protected expansion is performed on \acronymsort when the entry is -defined. -

-

-

Top

6.2.1 Predefined Acronym Styles

-

The glossaries package provides a number of predefined styles. These styles apply -


\firstacronymfont{text}

-

-to the short form on first use and -


\acronymfont{text}

-

-on subsequent use. The styles modify the definition of \acronymfont as required, but \firstacronymfont is -only set once by the package when it’s loaded. By default \firstacronymfont{text} is the same as - - -\acronymfont{text}. If you want the short form displayed differently on first use, you can redefine -\firstacronymfont independently of the acronym style. -

The predefined styles that contain sc in their name (for example long-sc-short) redefine \acronymfont to use -\textsc, which means that the short form needs to be specified in lower case. -

-

Some fonts don’t support bold small caps, so you may need to redefine \glsnamefont (see -§8 Displaying a Glossary) to switch to medium weight if you are using a glossary -style that displays entry names in bold and you have chosen an acronym style that uses \textsc. -
-

-

The predefined styles that contain sm in their name (for example long-sm-short) redefine \acronymfont to -use \textsmaller. -

-

Note that the glossaries package doesn’t define or load any package that defines \textsmaller. If you use -one of the acronym styles that set \acronymfont to \textsmaller you must explicitly load the relsize package -or otherwise define \textsmaller.
-

-

The remaining predefined styles redefine \acronymfont{text} to simply do its argument ⟨text⟩. -

In most cases, the predefined styles adjust \acrfull and \glsentryfull (and their plural and upper case -variants) to reflect the style. The only exceptions to this are the dua and footnote styles (and their variants). -
-

-

The following styles are supplied by the glossaries package:

-
    -
  • -

    long-short, long-sc-short, long-sm-short, long-sp-short: -

    With these three styles, acronyms are displayed in the form -


    long(\firstacronymfont{short})

    -

    - on first use and -


    \acronymfont{short}

    -

    - on subsequent use. They also set \acronymsort{short}{long} to just ⟨short⟩. This means that the - acronyms are sorted according to their short form. In addition, \acronymentry{label} is set to - just the short form (enclosed in \acronymfont) and the description key is set to the long - form. -

    The long-sp-short style was introduced in version 4.16 and uses -


    \glsacspace{label}

    -

    - for the space between the long and short forms. This defaults to a non-breakable space (~) if - - - (\acronymfont{short}) is less than 3em, otherwise it uses a normal space. This may be redefined as - required. For example, to always use a non-breakable space: - - -

    -
    -     \renewcommand*{\glsacspace}[1]{~}
    -
    -

    -

  • -
  • -

    short-long, sc-short-long, sm-short-long: -

    These three styles are analogous to the above three styles, except the display order is swapped - to -


    \firstacronymfont{short} (long)

    -

    - on first use. -

    Note, however, that \acronymsort and \acronymentry are the same as for the ⟨long⟩ (⟨short⟩) styles above, - so the acronyms are still sorted according to the short form. -

  • -
  • -

    long-short-desc, long-sc-short-desc, long-sm-short-desc, long-sp-short-desc: -

    These are like the long-short, long-sc-short, long-sm-short and long-sp-short styles described above, except - that the description key must be supplied in the optional argument of \newacronym. They also redefine - \acronymentry to {long} (\acronymfont{short}) and redefine \acronymsort{short}{long} to just ⟨long⟩. - This means that the acronyms are sorted according to the long form, and in the list of acronyms - the name field has the long form followed by the short form in parentheses. I recommend - you use a glossary style such as altlist with these acronym styles to allow for the long name - field. -

  • -
  • -

    short-long-desc, sc-short-long-desc, sm-short-long-desc: -

    These styles are analogous to the above three styles, but the first use display style is: -


    \firstacronymfont{short} (long)

    -

    - The definitions of \acronymsort and \acronymentry are the same as those for long-short-desc - etc. -

  • -
  • -

    dua, dua-desc: - - -

    With these styles, the \gls-like commands always display the long form regardless of whether - the entry has been used or not. However, \acrfull and \glsentryfull will display ⟨long⟩ - (\acronymfont{short}). In the case of dua, the name and sort keys are set to the short - form and the description is set to the long form. In the case of dua-desc, the name and sort - keys are set to the long form and the description is supplied in the optional argument of - \newacronym. -

  • -
  • -

    footnote, footnote-sc, footnote-sm: -

    With these three styles, on first use the \gls-like commands display: -


    \firstacronymfont{short}\footnote{long}

    -

    - However, \acrfull and \glsentryfull are set to \acronymfont{short} (⟨long⟩). On subsequent use the - display is: -


    \acronymfont{short}

    -

    - The sort and name keys are set to the short form, and the description is set to the long - form. -

    In order to avoid nested hyperlinks on first use the footnote styles automatically implement - hyperfirst=false for the acronym lists.
    -

    -

  • -
  • -

    footnote-desc, footnote-sc-desc, footnote-sm-desc: -

    These three styles are similar to the previous three styles, but the description has to be supplied in the - optional argument of \newacronym. The name key is set to the long form followed by the short form in - parentheses and the sort key is set to the long form. This means that the acronyms will be sorted - according to the long form. In addition, since the name will typically be quite wide it’s best to choose a - glossary style that can accommodate this, such as altlist. -

    -
- -

Example 15 (Adapting a Predefined Acronym Style) -

Suppose I want to use the footnote-sc-desc style, but I want the name key set to the short form followed by -the long form in parentheses and the sort key set to the short form. Then I need to specify the footnote-sc-desc -style: - - -

-
-\setacronymstyle{footnote-sc-desc}
-
-

and then redefine \acronymsort and \acronymentry: - - -

-
-\renewcommand*{\acronymsort}[2]{#1}% sort by short form
-\renewcommand*{\acronymentry}[1]{%
-  \acronymfont{\glsentryshort{#1}}\space (\glsentrylong{#1})}%
-
-

(I’ve used \space for extra clarity, but you can just use an actual space instead.) -

Note that the default Computer Modern fonts don’t support bold small caps, so another font is required. For -example: - - -

-
-\usepackage[T1]{fontenc}
-
-

The alternative is to redefine \acronymfont so that it always switches to medium weight to ensure the small -caps setting is used. For example: - - -

-
-\renewcommand*{\acronymfont}[1]{\textmd{\scshape #1}}
-
-

-

The sample file sampleFnAcrDesc.tex illustrates this example.

-
-

-

____________________________

-

-

-

Top

6.2.2 Defining A Custom Acronym Style

-

You may find that the predefined acronyms styles that come with the glossaries package don’t suit your -requirements. In this case you can define your own style using: -


\newacronymstyle{style name}{display}{definitions}

-

-where ⟨style name⟩ is the name of the new style (avoid active characters). The second argument, ⟨display⟩, is -equivalent to the mandatory argument of \defglsentryfmt. You can simply use \glsgenacfmt or you can -customize the display using commands like \ifglsused, \glsifplural and \glscapscase. (See -§5.1.3 Changing the format of the link text for further details.) If the style is likely to be used with a -mixed glossary (that is entries in that glossary are defined both with \newacronym and \newglossaryentry) -then you can test if the entry is an acronym and use \glsgenacfmt if it is or \glsgenentryfmt if it isn’t. For -example, the long-short style sets ⟨display⟩ as - - -

-
-\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}%
-
-

(You can use \ifglshasshort instead of \ifglshaslong to test if the entry is an acronym if you -prefer.) -

The third argument, ⟨definitions⟩, can be used to redefine the commands that affect the display style, such as -\acronymfont or, if ⟨display⟩ uses \glsgenacfmt, \genacrfullformat and its variants. -

Note that \setacronymstyle redefines \glsentryfull and \acrfullfmt to use \genacrfullformat (and -similarly for the plural and upper case variants). If this isn’t appropriate for the style (as in the -case of styles like footnote and dua) \newacronymstyle should redefine these commands within -⟨definitions⟩. -

Within \newacronymstyle’s ⟨definitions⟩ argument you can also redefine -


\GenericAcronymFields

-

-This is a list of additional fields to be set in \newacronym. You can use the following token registers to access -the entry label, long form and short form: \glslabeltok, \glslongtok and \glsshorttok. As with all -TeX registers, you can access their values by preceding the register with \the. For example, the long-short style -does: - - -

-
-\renewcommand*{\GenericAcronymFields}{%
-   description={\the\glslongtok}}%
-
-

which sets the description field to the long form of the acronym whereas the long-short-desc style -does: - - -

-
-\renewcommand*{\GenericAcronymFields}{}%
-
-

since the description needs to be specified by the user. -

It may be that you want to define a new acronym style that’s based on an existing style. Within ⟨display⟩ you -can use -


\GlsUseAcrEntryDispStyle{style name}

-

-to use the ⟨display⟩ definition from the style given by ⟨style name⟩. Within ⟨definitions⟩ you can use -


\GlsUseAcrStyleDefs{style name}

-

-to use the ⟨definitions⟩ from the style given by ⟨style name⟩. For example, the long-sc-short acronym style is -based on the long-short style with minor modifications (remember to use ## instead of # within -⟨definitions⟩): - - -

-
-\newacronymstyle{long-sc-short}%
-{% use the same display as "long-short"
-  \GlsUseAcrEntryDispStyle{long-short}%
-}%
-{% use the same definitions as "long-short"
-  \GlsUseAcrStyleDefs{long-short}%
-  % Minor modifications:
-  \renewcommand{\acronymfont}[1]{\textsc{##1}}%
-  \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}%
+
(Note that the sort and type fields have been omitted.)

+This would be more flexible, and much briefer, if these entries were defined using bib2gls’s dual entry system combined with the glossaries-prefix package:

@dualentry{cat,
+  name={chat},
+  description={cat},
+  prefix={le},
+  prefixplural={les}
 }
-
-

(\glstextup is used to cancel the effect of \textsc. This defaults to \textulc, if defined, otherwise \textup. -For example, the plural of svm should be rendered as svms rather than svms.) - -

Example 16 (Defining a Custom Acronym Style) -

Suppose I want my acronym on first use 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 -on first use to display: -
\textsc{abbrv}\footnote{long⟩: ⟨description} -
-on subsequent use: -
\textsc{abbrv} -
-and in the list of acronyms, each entry will be displayed in the form: -
long⟩ (⟨short⟩) ⟨description⟩ -
-

Let’s suppose it’s possible that I may have a mixed glossary. I can check this in the second argument of -\newacronymstyle using: - - -

-
-\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}%
-
-

This will use \glsgenentryfmt if the entry isn’t an acronym, otherwise it will use \glsgenacfmt. The third -argument (⟨definitions⟩) of \newacronymstyle needs to redefine \genacrfullformat etc so that the first -use displays the short form in the text with the long form in a footnote followed by the description. This is done -as follows (remember to use ## instead of #): - - -

-
- % No case change, singular first use:
-  \renewcommand*{\genacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshort{##1}}##2%
-   \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}%
-  }%
- % First letter upper case, singular first use:
-  \renewcommand*{\Genacrfullformat}[2]{%
-   \firstacronymfont{\Glsentryshort{##1}}##2%
-   \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}%
-  }%
- % No case change, plural first use:
-  \renewcommand*{\genplacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshortpl{##1}}##2%
-   \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}%
-  }%
- % First letter upper case, plural first use:
-  \renewcommand*{\Genplacrfullformat}[2]{%
-   \firstacronymfont{\Glsentryshortpl{##1}}##2%
-   \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}%
-  }%
-
-

If you think it inappropriate for the short form to be capitalised at the start of a sentence you can change the -above to: - - -

-
- % No case change, singular first use:
-  \renewcommand*{\genacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshort{##1}}##2%
-   \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}%
-  }%
- % No case change, plural first use:
-  \renewcommand*{\genplacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshortpl{##1}}##2%
-   \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}%
-  }%
- \let\Genacrfullformat\genacrfullformat
- \let\Genplacrfullformat\genplacrfullformat
-
-

Another variation is to use \Glsentrylong and \Glsentrylongpl in the footnote instead of \glsentrylong -and \glsentrylongpl. -

Now let’s suppose that commands such as \glsentryfull and \acrfull shouldn’t use a footnote, but -instead use the format: ⟨long⟩ (⟨short⟩). This means that the style needs to redefine \glsentryfull, \acrfullfmt -and their plural and upper case variants. -

First, the non-linking commands: - - -

-
-  \renewcommand*{\glsentryfull}[1]{%
-    \glsentrylong{##1}\space
-      (\acronymfont{\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\Glsentryfull}[1]{%
-    \Glsentrylong{##1}\space
-      (\acronymfont{\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\glsentryfullpl}[1]{%
-    \glsentrylongpl{##1}\space
-      (\acronymfont{\glsentryshortpl{##1}})%
-  }%
-  \renewcommand*{\Glsentryfullpl}[1]{%
-    \Glsentrylongpl{##1}\space
-      (\acronymfont{\glsentryshortpl{##1}})%
-  }%
-
-

Now for the linking commands: - - -

-
-  \renewcommand*{\acrfullfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \glsentrylong{##2}##3\space
-      (\acronymfont{\glsentryshort{##2}})%
-    }%
-  }%
-  \renewcommand*{\Acrfullfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \Glsentrylong{##2}##3\space
-      (\acronymfont{\glsentryshort{##2}})%
-    }%
-  }%
-  \renewcommand*{\ACRfullfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \MakeTextUppercase{%
-       \glsentrylong{##2}##3\space
-         (\acronymfont{\glsentryshort{##2}})%
-     }%
-    }%
-  }%
-  \renewcommand*{\acrfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \glsentrylongpl{##2}##3\space
-       (\acronymfont{\glsentryshortpl{##2}})%
-    }%
-  }%
-  \renewcommand*{\Acrfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \Glsentrylongpl{##2}##3\space
-       (\acronymfont{\glsentryshortpl{##2}})%
-    }%
-  }%
-  \renewcommand*{\ACRfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \MakeTextUppercase{%
-       \glsentrylongpl{##2}##3\space
-         (\acronymfont{\glsentryshortpl{##2}})%
-     }%
-    }%
-  }%
-
-

(This may cause problems with long hyperlinks, in which case adjust the definitions so that, for example, only -the short form is inside the argument of \glslink.) -

The style also needs to redefine \acronymsort so that the acronyms are sorted according to the long -form: - - -

-
-  \renewcommand*{\acronymsort}[2]{##2}%
-
-

If you prefer them to be sorted according to the short form you can change the above to: - - -

-
-  \renewcommand*{\acronymsort}[2]{##1}%
-
-

The acronym font needs to be set to \textsc and the plural suffix adjusted so that the “s” suffix in the plural -short form doesn’t get converted to small caps: - - -

-
-  \renewcommand*{\acronymfont}[1]{\textsc{##1}}%
-  \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}%
-
-

There are a number of ways of dealing with the format in the list of acronyms. The simplest way is to redefine -\acronymentry to the long form followed by the upper case short form in parentheses: - - -

-
- \renewcommand*{\acronymentry}[1]{%
-   \Glsentrylong{##1}\space
-     (\MakeTextUppercase{\glsentryshort{##1}})}%
-
-

(I’ve used \Glsentrylong instead of \glsentrylong to capitalise the name in the glossary.) -

An alternative approach is to set \acronymentry to just the long form and redefine \GenericAcronymFields to -set the symbol key to the short form and use a glossary style that displays the symbol in parentheses after the -name (such as the tree style) like this: - - -

-
- \renewcommand*{\acronymentry}[1]{\Glsentrylong{##1}}%
- \renewcommand*{\GenericAcronymFields}{%
-    symbol={\protect\MakeTextUppercase{\the\glsshorttok}}}%
-
-

I’m going to use the first approach and set \GenericAcronymFields to do nothing: - - -

-
- \renewcommand*{\GenericAcronymFields}{}%
-
-

-

Finally, this style needs to switch off hyperlinks on first use to avoid nested links: - - -

-
- \glshyperfirstfalse
-
-

Putting this all together: - - -

-
-\newacronymstyle{custom-fn}% new style name
-{%
-  \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}%
-}%
-{%
- \renewcommand*{\GenericAcronymFields}{}%
- \glshyperfirstfalse
-  \renewcommand*{\genacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshort{##1}}##2%
-   \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}%
-  }%
-  \renewcommand*{\Genacrfullformat}[2]{%
-   \firstacronymfont{\Glsentryshort{##1}}##2%
-   \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}%
-  }%
-  \renewcommand*{\genplacrfullformat}[2]{%
-   \firstacronymfont{\glsentryshortpl{##1}}##2%
-   \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}%
-  }%
-  \renewcommand*{\Genplacrfullformat}[2]{%
-   \firstacronymfont{\Glsentryshortpl{##1}}##2%
-   \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}%
-  }%
-  \renewcommand*{\glsentryfull}[1]{%
-    \glsentrylong{##1}\space
-      (\acronymfont{\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\Glsentryfull}[1]{%
-    \Glsentrylong{##1}\space
-      (\acronymfont{\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\glsentryfullpl}[1]{%
-    \glsentrylongpl{##1}\space
-      (\acronymfont{\glsentryshortpl{##1}})%
-  }%
-  \renewcommand*{\Glsentryfullpl}[1]{%
-    \Glsentrylongpl{##1}\space
-      (\acronymfont{\glsentryshortpl{##1}})%
-  }%
-  \renewcommand*{\acrfullfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \glsentrylong{##2}##3\space
-      (\acronymfont{\glsentryshort{##2}})%
-    }%
-  }%
-  \renewcommand*{\Acrfullfmt}[3]{%
-                                                                                      
-                                                                                      
-    \glslink[##1]{##2}{%
-     \Glsentrylong{##2}##3\space
-      (\acronymfont{\glsentryshort{##2}})%
-    }%
-  }%
-  \renewcommand*{\ACRfullfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \MakeTextUppercase{%
-       \glsentrylong{##2}##3\space
-         (\acronymfont{\glsentryshort{##2}})%
-     }%
-    }%
-  }%
-  \renewcommand*{\acrfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \glsentrylongpl{##2}##3\space
-       (\acronymfont{\glsentryshortpl{##2}})%
-    }%
-  }%
-  \renewcommand*{\Acrfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \Glsentrylongpl{##2}##3\space
-       (\acronymfont{\glsentryshortpl{##2}})%
-    }%
-  }%
-  \renewcommand*{\ACRfullplfmt}[3]{%
-    \glslink[##1]{##2}{%
-     \MakeTextUppercase{%
-       \glsentrylongpl{##2}##3\space
-         (\acronymfont{\glsentryshortpl{##2}})%
-     }%
-    }%
-  }%
-  \renewcommand*{\acronymfont}[1]{\textsc{##1}}%
-  \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}%
-  \renewcommand*{\acronymsort}[2]{##2}%
-  \renewcommand*{\acronymentry}[1]{%
-   \Glsentrylong{##1}\space
-     (\MakeTextUppercase{\glsentryshort{##1}})}%
+
Similarly for the “chair” entry:
@dualentry{chair,
+  name={chaise},
+  description={chair},
+  prefix={la},
+  prefixplural={les}
 }
-
-

-

Now I need to specify that I want to use this new style: - - -

-
-\setacronymstyle{custom-fn}
-
-

I also need to use a glossary style that suits this acronym style, for example altlist: - - -

-
-\setglossarystyle{altlist}
-
-

-

Once the acronym style has been set, I can define my acronyms: - - -

-
-\newacronym[description={set of tags for use in
-developing hypertext documents}]{html}{html}{Hyper
-Text Markup Language}
-\newacronym[description={language used to describe the
-layout of a document written in a markup language}]{css}
-{css}{Cascading Style Sheet}
-
-

-

The sample file sample-custom-acronym.tex illustrates this example.

-
-

-

____________________________

- -

Example 17 (Italic and Upright Abbreviations) -

Suppose I want to have some abbreviations in italic and some that just use the surrounding font. -Hard-coding this into the ⟨short⟩ argument of \newacronym can cause complications. -

This example uses \glsaddstoragekey to add an extra field that can be used to store the formatting -declaration (such as \em). - - -

-
-\glsaddstoragekey{font}{}{\entryfont}
-
-

This defines a new field/key called font, which defaults to nothing if it’s not explicitly set. This also defines a -command called \entryfont that’s analogous to \glsentrytext. A new style is then created to format -abbreviations that access this field. -

There are two ways to do this. The first is to create a style that doesn’t use \glsgenacfmt -but instead provides a modified version that doesn’t use \acronymfont{short} but instead uses -{\entryfont{\glslabel}short}. The full format given by commands such as \genacrfullformat need to be -similarly adjusted. For example: - - -

-
-  \renewcommand*{\genacrfullformat}[2]{%
-   \glsentrylong{##1}##2\space
-   ({\entryfont{##1}\glsentryshort{##1}})%
-  }%
-
-

This will deal with commands like \gls but not commands like \acrshort which still use \acronymfont. -Another approach is to redefine \acronymfont to look up the required font declaration. Since \acronymfont -doesn’t take the entry label as an argument, the following will only work if \acronymfont is used in a context -where the label is provided by \glslabel. This is true in \gls, \acrshort and \acrfull. The redefinition is -now: - - -

-
-\renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}#1}}%
-
-

So the new style can be defined as: - - -

-
-\newacronymstyle{long-font-short}
-{%
-  \GlsUseAcrEntryDispStyle{long-short}%
+

+With @dualentry, the English and French terms are now automatically linked from 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 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).

+

\GlsXtrLoadResources[src={entries},% entries.bib
+ append-prefix-field={space},
+ category={same as type},dual-category={same as type},
+ label-prefix={en-},dual-prefix={fr-},
+ type=english,dual-type=french,
+ sort=en,dual-sort=fr]
+
+\newcommand{\FrEncap}[1]{% 
+ \foreignlanguage{french}{\glsentryprefix{\glscurrententrylabel}#1}}
+\newcommand{\EnEncap}[1]{\foreignlanguage{english}{#1}}
+
+\glssetcategoryattribute{english}{glossnamefont}{EnEncap}
+\glssetcategoryattribute{english}{glossdescfont}{FrEncap}
+\glssetcategoryattribute{french}{glossnamefont}{FrEncap}
+\glssetcategoryattribute{french}{glossdescfont}{EnEncap}
+

+Remember to remove \makeglossaries, the definition of \newword and the entry definitions from the document preamble, and replace \printglossary with:

\printunsrtglossary
+

+Other refinements that you might like to make include using \glsxtrnewglslike so you don’t have to worry about the label prefix (“en-” and “fr-”). See the glossaries-extra manual for further details.

+

🗋📥 sample-index.tex
+ This document uses the glossaries package to create both a glossary and an index. This requires two makeglossaries (or makeglossaries-lite) calls to ensure the document is up to date:
pdflatex sample-index
+makeglossaries sample-index
+pdflatex sample-index
+makeglossaries sample-index
+pdflatex sample-index
+

+ + + +

+

18.5. Sorting

+

+

🗋📥 samplePeople.tex
+ This document illustrates how you can hook into the standard sort mechanism to adjust the way the sort key is set. This requires an additional run to ensure the table of contents is up-to-date:
pdflatex samplePeople
+makeglossaries samplePeople
+pdflatex samplePeople
+pdflatex samplePeople
+
This provides two commands for typesetting a name:
\newcommand{\sortname}[2]{#2, #1}
+\newcommand{\textname}[2]{#1 #2}
+
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:
\let\name\textname
+
This command defaults to the display name command (\textname) but is temporarily redefined to the sort name command (\sortname) within the sort field assignment hook:
\renewcommand{\glsprestandardsort}[3]{% 
+ \let\name\sortname
+ \edef#1{\expandafter\expandonce\expandafter{#1}}% 
+ \let\name\textname
+ \glsdosanitizesort
 }
-{%
-  \GlsUseAcrStyleDefs{long-short}%
-  \renewcommand*{\genacrfullformat}[2]{%
-   \glsentrylong{##1}##2\space
-   ({\entryfont{##1}\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\Genacrfullformat}[2]{%
-   \Glsentrylong{##1}##2\space
-   ({\entryfont{##1}\glsentryshort{##1}})%
-  }%
-  \renewcommand*{\genplacrfullformat}[2]{%
-   \glsentrylongpl{##1}##2\space
-   ({\entryfont{##1}\glsentryshortpl{##1}})%
-  }%
-  \renewcommand*{\Genplacrfullformat}[2]{%
-   \Glsentrylongpl{##1}##2\space
-   ({\entryfont{##1}\glsentryshortpl{##1}})%
-  }%
-  \renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}##1}}%
-  \renewcommand*{\acronymentry}[1]{{\entryfont{##1}\glsentryshort{##1}}}%
+
The people are defined using the custom \name command:
\newglossaryentry{joebloggs}{name={\name{Joe}{Bloggs}},
+ description={\nopostdesc}}
+
Since \name is temporarily changed while the sort key is being assigned, the sort value for this entry ends up as “Bloggs, Joe”, but the name appears in the document as “Joe Bloggs”.

+

+If you want to use bib2gls, you first need to convert the document to use glossaries-extra but make sure you include the record option:
\usepackage[record,stylemods,style=listgroup]{glossaries-extra}
+
Next it’s necessary to convert the entry definitions to the bib format required by bib2gls. You can simply do:
convertgls2bib --preamble-only samplePeople people.bib
+
which will create a file called people.bib that contains definitions like:
@entry{joebloggs,
+  name={\name{Joe}{Bloggs}},
+  description={\nopostdesc}
 }
-
-

Remember the style needs to be set before defining the entries: - - -

-
-\setacronymstyle{long-font-short}
-
-

-

The complete document is contained in the sample file sample-font-abbr.tex.

-
-

-

____________________________

-

Some writers and publishing houses have started to drop full stops (periods) from upper case initials but -may still retain them for lower case abbreviations, while others may still use them for both upper and lower -case. This can cause complications. Chapter 12 of The TeXbook discusses the spacing between words but, -briefly, the default behaviour of TeX is to assume that an upper case character followed by a full stop and -space is an abbreviation, so the space is the default inter-word space whereas a lower case character followed by -a full stop and space is a word occurring at the end of a sentence. In the event that this isn’t true, you -need to make a manual adjustment using (back slash space) in place of just a space character -for an inter-word mid-sentence space and use \@ before the full stop to indicate the end of the -sentence. -

For example: - - -

-
-I was awarded a B.Sc. and a Ph.D. (From the same place.)
-
-

is typeset as -
I was awarded a B.Sc. and a Ph.D. (From the same place.) -
-The spacing is more noticeable with the typewriter font: - - -

-
-\ttfamily
-I was awarded a B.Sc. and a Ph.D. (From the same place.)
-
-

is typeset as -
I was awarded a B.Sc. and a Ph.D. (From the same place.) -
-The lower case letter at the end of “B.Sc.” is confusing TeX into thinking that the full stop after it marks the -end of the sentence. Whereas the upper case letter at the end of “Ph.D.” has confused TeX into thinking that -the following full stop is just part of the abbreviation. These can be corrected: - - -

-
-I was awarded a B.Sc.\ and a Ph.D\@. (From the same place.)
-
-

-

This situation is a bit problematic for glossaries. The full stops can form part of the ⟨short⟩ argument of -\newacronym and the B.Sc.\␣ part can be dealt with by remembering to add \␣ (for example, -\gls{bsc}\␣) but the end of sentence case is more troublesome as you need to omit the sentence -terminating full stop (to avoid two dots) which can make the source code look a little strange -but you also need to adjust the space factor, which is usually done by inserting \@ before the full -stop. -

The next example shows one way of achieving this. (Note that the supplemental glossaries-extra -package provides a much simpler way of doing this, which you may prefer to use. See Gallery: -Initialisms.) - -

Example 18 (Abbreviations with Full Stops (Periods)) -

As from version 4.16, there’s now a hook (\glspostlinkhook) that’s called at the very end of the -\gls-like and \glstext-like commands. This can be redefined to check if the following character is a full stop. -The amsgen package (which is automatically loaded by glossaries) provides an internal command called -\new@ifnextchar that can be used to determine if the given character appears next. (For more information see -the amsgen documentation.) -

It’s possible that I may also want acronyms or contractions in my document, so I need some way to -differentiate between them. Here I’m going to use the same method as in example 4 where a new field is defined -to indicate the type of abbreviation: - - -

-
-\glsaddstoragekey{abbrtype}{word}{\abbrtype}
-\newcommand*{\newabbr}[1][]{\newacronym[abbrtype=initials,#1]}
-
-

Now I just use \newacronym for the acronyms, for example, - - -

-
-\newacronym{laser}{laser}{light amplification by stimulated
-emission of radiation}
-
-

and my new command \newabbr for initials, for example, - - -

-
-\newabbr{eg}{e.g.}{exempli gratia}
-\newabbr{ie}{i.e.}{id est}
-\newabbr{bsc}{B.Sc.}{Bachelor of Science}
-\newabbr{ba}{B.A.}{Bachelor of Arts}
-\newabbr{agm}{A.G.M.}{annual general meeting}
-
-

Within \glspostlinkhook the entry’s label can be accessed using \glslabel and \ifglsfieldeq can be used -to determine if the current entry has the new abbrtype field set to “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 full stop. 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 \makeatletter and \makeatother: - - -

-
-\makeatletter
-\renewcommand{\glspostlinkhook}{%
- \ifglsfieldeq{\glslabel}{abbrtype}{initials}%
- {\new@ifnextchar.\doendsentence\doendword}
- {}%
+
However, you may prefer to use the --index-conversion (-i) switch:
convertgls2bib -i --preamble-only samplePeople people.bib
+
This will discard the description field and use @index instead of @entry if the description is either empty or simply set to \nopostdesc or \glsxtrnopostpunc. The people.bib file now contains definitions like:
@index{joebloggs,
+  name={\name{Joe}{Bloggs}}
 }
-\makeatother
-
-

In the event that a full stop is found \doendsentence is performed but it will be followed by the full stop, -which needs to be discarded. Otherwise \doendword will be done but it won’t be followed by a full stop so -there’s nothing to discard. The definitions for these commands are: - - -

-
-\newcommand{\doendsentence}[1]{\spacefactor=10000{}}
-\newcommand{\doendword}{\spacefactor=1000{}}
-
-

Now, I can just do \gls{bsc} mid-sentence and \gls{phd}. at the end of the sentence. The terminating full -stop will be discarded in the latter case, but it won’t be discarded in, say, \gls{laser}. as that doesn’t have -the abbrtype field set to “initials”. -

This also works on first use when the style is set to one of the ⟨long⟩ (⟨short⟩) styles but it will fail with the -⟨short⟩ (⟨long⟩) styles as in this case the terminating full stop shouldn’t be discarded. Since \glspostlinkhook is -used after the first use flag has been unset for the entry, this can’t be fixed by simply checking with -\ifglsused. One possible solution to this is to redefine \glslinkpostsetkeys to check for the first use -flag and define a macro that can then be used in \glspostlinkhook. -

The other thing to consider is what to do with plurals. One possibility is to check for plural use -within \doendsentence (using \glsifplural) and put the full stop back if the plural has been -used. -

The complete document is contained in the sample file sample-dot-abbr.tex.

-
-

-

____________________________

-

-

-

Top

6.3 Displaying the List of Acronyms

-

The list of acronyms is just like any other type of glossary and can be displayed on its own using: -

-

-Option 1:

-

-

-
-
- \printnoidxglossary[type=\acronymtype] -
-
- - -
-

-Options 2 and 3:

-

-

-
-
- \printglossary[type=\acronymtype] -
-
-

(If you use the acronym package option you can also use

-
- \printacronyms[options] -
-
as a synonym for
-
- \printglossary[type=\acronymtype,options] -
-
See §2.7 Acronym and Abbreviation Options.) -
-

Alternatively the list of acronyms can be displayed with all the other glossaries using: -

-

-Option 1:

-

\printnoidxglossaries -

-

-Options 2 and 3:

-

\printglossaries

-

However, care must be taken to choose a glossary style that’s appropriate to your acronym style. -Alternatively, you can define your own custom style (see §13.2 Defining your own glossary style -for further details). - - -

-

-

Top

6.4 Upgrading From the glossary Package

-

Users of the obsolete glossary package may recall that the syntax used to define new acronyms has changed with -the replacement glossaries package. In addition, the old glossary package created the command \acr-name⟩ when -defining the acronym ⟨acr-name⟩. -

In order to facilitate migrating from the old package to the new one, the glossaries -package6.1 -provides the command: -


\oldacronym[label]{abbrv}{long}{key-val list}

-

-This uses the same syntax as the glossary package’s method of defining acronyms. It is equivalent to: - -
\newacronym[key-val list]{label}{abbrv}{long} -
-In addition, \oldacronym also defines the commands \label⟩, which is equivalent to \gls{label}, and \label*, -which is equivalent to \Gls{label}. If ⟨label⟩ is omitted, ⟨abbrv⟩ is used. Since commands names must consist only -of alphabetical characters, ⟨label⟩ must also only consist of alphabetical characters. Note that \label⟩ doesn’t allow -you to use the first optional argument of \gls or \Gls — you will need to explicitly use \gls or \Gls to change -the settings. -

Recall that, in general, LaTeX ignores spaces following command names consisting of alphabetical -characters. This is also true for \label⟩ unless you additionally load the xspace package, but be aware that there -are some issues with using xspace.6.2
-

- -

The glossaries package doesn’t load the xspace package since there are both advantages and disadvantages to -using \xspace in \label⟩. If you don’t use the xspace package you need to explicitly force a space -using \␣ (backslash space) however you can follow \label⟩ with additional text in square brackets -(the final optional argument to \gls). If you use the 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). -

To illustrate this, suppose I define the acronym “abc” as follows: - - -

-
-\oldacronym{abc}{example acronym}{}
-
-

This will create the command \abc and its starred version \abc*. Table 6.2 illustrates the effect of -\abc (on subsequent use) according to whether or not the xspace package has been loaded. As can be seen -from the final row in the table, the xspace package prevents the optional argument from being -recognised. -

-
- - -


- - -
Table 6.2: The effect of using xspace with \oldacronym
-
Regardless of which approach you used to create the bib file, you now need to edit it to provide a definition of the custom \name command for bib2gls’s use:
@preamble{"\providecommand{\name}[2]{#2, #1}"}
+
Note the use of \providecommand instead of \newcommand.

+In the document (samplePeople.tex) you now need to delete \makeglossaries, the definitions of \sortname, \textname, \name, \glsprestandardsort, and all the entry definitions. Then add the following to the document preamble:

\newcommand{\name}[2]{#1 #2}
+\GlsXtrLoadResources[src={people}]
+
Next, use your text editor’s search and replace function to substitute all instances of \glsentrytext in the chapter headings with \glsfmttext. For example:
\chapter{\glsfmttext{joebloggs}}
+
Finally, replace \printglossaries with:
\printunsrtglossaries
+
The document build is now:
pdflatex samplePeople
+bib2gls samplePeople
+pdflatex samplePeople
+pdflatex samplePeople
+
The third LaTeX call is required to ensure that the PDF bookmarks are up to date, as the entries aren’t defined until after the bib2gls run (which is why you have to use \glsfmttext instead of \glsentrytext).

+This again leads to a list sorted by surname. The reason this works is because bib2gls only sees the definition of \name provided in @preamble, but the document uses the definition of \name provided before \GlsXtrLoadResources. The use of \providecommand in @preamble prevents \name from being redefined within the document.

+See also the “Examples” chapter of the bib2gls user manual, which provides another “people” example and Aliases.

+

🗋📥 sampleSort.tex
+ This is another document that illustrates how to hook into the standard sort mechanism. An additional run is required to ensure the table of contents is up-to-date:
pdflatex sampleSort
+makeglossaries sampleSort
+pdflatex sampleSort
+pdflatex sampleSort
+
This document has three glossaries (main, acronym and a custom notation), so if you want to use makeindex explicitly you will need to have three makeindex calls with the appropriate file extensions:
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
+
It’s much simpler to just use makeglossaries or 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:

\newcounter{sortcount}
+
The sort hook is then redefined to increment this counter and assign the sort key to that numerical value, but only for the notation glossary. The other two glossaries have their sort keys assigned as normal:
\renewcommand{\glsprestandardsort}[3]% 
+  \ifdefstring{#2}{notation}% 
+  {% 
+     \stepcounter{sortcount}% 
+     \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% 
+  }% 
+  {% 
+     \glsdosanitizesort
+  }% 
+
+
This means that makeindex will sort the notation in numerical order.

+

+If you want to convert this document to use glossaries-extra, a much simpler approach is available with its hybrid method. First change the package loading line to:
\usepackage[postdot,stylemods,acronym]{glossaries-extra}
+
Either remove \setacronymstyle and replace all instances of \newacronym with \newabbreviation or replace:
\setacronymstyle{long-short}
+
with:
\setabbreviationstyle[acronym]{long-short}
+

+The custom counter and redefinition of \glsprestandardsort can now be removed. The file extensions for the custom notation glossary are no longer relevant so the glossary definition can be changed to:

\newglossary*{notation}{Notation}
+
The \makeglossaries command now needs to be adjusted to indicate which glossaries need to be processed by makeindex:
\makeglossaries[main,acronym]
+
Finally, \printglossaries needs to be replaced with:
\printglossary
+\printacronyms
+\printnoidxglossary[type=notation,sort=def]
+
Note that the notation glossary, which hasn’t been listed in the optional argument of \makeglossaries, must be displayed with \printnoidxglossary.

+This means that makeindex only needs to process the main and acronym glossaries. No actual sorting is performed for the notation glossary because, when used with sort=def, \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 glossaries extend beyond a page break):

pdflatex sampleSort
+makeglossaries sampleSort
+pdflatex sampleSort
+
This time makeglossaries will include the message:
only processing subset 'main,acronym'
+
This means that although makeglossaries has noticed the notation glossary, it will be skipped.

+If you are explicitly calling makeindex then you need to drop the call for the notation glossary:

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
+

+

+If you prefer to use bib2gls, the package loading line needs to be changed to:
\usepackage[record,postdot,stylemods,acronym]{glossaries-extra}
+
Next the entry definitions need to be convert to the bib format required by 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 --split-on-type or -t switch:

convertgls2bib -t --preamble-only sampleSort.tex entries.bib
+
This will create three files: +
+
entries.bib
->
- - - - -
Code With xspace Without xspace
\abc. abc. abc.
\abc xyz abc xyz abcxyz
\abc\ xyz abc xyz abc xyz
\abc* xyz Abc xyz Abc xyz
\abc[’s] xyz abc [’s] xyz abc’s xyz
-
- - -

-
- - -

-

Top

7. Unsetting and Resetting Entry Flags

-

When using the \gls-like commands it is possible that you may want to use the value given by the first -key, even though you have already used the glossary entry. Conversely, you may want to use the value given by -the text key, even though you haven’t used the glossary entry. The former can be achieved by one of the -following commands: -


\glsreset{label}

-

-


\glslocalreset{label}

-

-while the latter can be achieved by one of the following commands: -


\glsunset{label}

-

-


\glslocalunset{label}

-

-You can also reset or unset all entries for a given glossary or list of glossaries using: -


\glsresetall[glossary list]

-

-


\glslocalresetall[glossary list]

-

-


\glsunsetall[glossary list]

-

-


\glslocalunsetall[glossary list]

-

-where ⟨glossary list⟩ is a comma-separated list of glossary labels. If omitted, all defined glossaries are assumed -(except for the ignored ones). For example, to reset all entries in the main glossary and the list of -acronyms: - - -

-
-\glsresetall[main,acronym]
-
-

-

You can determine whether an entry’s first use flag is set using: -


\ifglsused{label}{true part}{false part}

-

-where ⟨label⟩ is the label of the required entry. If the entry has been used, ⟨true part⟩ will be done, otherwise ⟨false -part⟩ will be done. -

Note that \ifglsused is unreliable with bib2gls as the entry isn’t defined on the first LaTeX run, -which means there’s no way of determining if it has been used, so glossaries-extra provides a similar -command: -


\GlsXtrIfUnusedOrUndefined{label}{true part}{false part}

-

-

Be careful when using \gls-like commands within an environment or command argument that gets -processed multiple times as it can cause unwanted side-effects when the first use displayed text is different from -subsequent use.
-

-

For example, the frame environment in beamer processes its argument for each overlay. This means that the -first use flag will be unset on the first overlay and subsequent overlays will use the non-first use -form. -

Consider the following example: - - -

-
-\documentclass{beamer}
-\usepackage{glossaries}
-\newacronym{svm}{SVM}{support vector machine}
-\begin{document}
-\begin{frame}
- \frametitle{Frame 1}
- \begin{itemize}
-  \item<+-> \gls{svm}
-  \item<+-> Stuff.
- \end{itemize}
-\end{frame}
-\end{document}
-
-

-

On the first overlay, \gls{svm} produces “support vector machine (SVM)” and then unsets the first use flag. -When the second overlay is processed, \gls{svm} now produces “SVM”, which is unlikely to be the desired -effect. I don’t know anyway around this and I can only offer two suggestions. -

Firstly, unset all acronyms at the start of the document and explicitly use \acrfull when you want the full -version to be displayed: - - -

-
-\documentclass{beamer}
-\usepackage{glossaries}
-\newacronym{svm}{SVM}{support vector machine}
-\glsunsetall
-\begin{document}
-\begin{frame}
- \frametitle{Frame 1}
- \begin{itemize}
-  \item<+-> \acrfull{svm}
-  \item<+-> Stuff.
- \end{itemize}
-\end{frame}
-\end{document}
-
-

-

Secondly, explicitly reset each acronym on first use: - - -

-
-\begin{frame}
- \frametitle{Frame 1}
- \begin{itemize}
-  \item<+-> \glsreset{svm}\gls{svm}
-  \item<+-> Stuff.
- \end{itemize}
-\end{frame}
-
-

These are non-optimal, but the beamer class is too complex for me to provide a programmatic solution. Other -potentially problematic environments are some tabular-like environments (but not 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 amsmath environments, such as align, also process their contents multiple times, but the glossaries -package now checks for this. For tabularx, you need to explicitly patch it by placing \glspatchtabularx in the -preamble (or anywhere before the problematic use of tabularx). -

If you need to use commands like \gls in any problematic context that interferes with the first use flag, -then you can try using the buffering system provided with glossaries-extra. See the “First Use Flag” section of -the glossaries-extra manual.
-

-

-

Top

7.1 Counting the Number of Times an Entry has been Used (First Use Flag Unset)

-

As from version 4.14, it’s now possible to keep track of how many times an entry is used. That is, -how many times the first use flag is unset. Note that the supplemental glossaries-extra package -improves this function and also provides per-unit counting, which isn’t available with the glossaries -package. -

This function is disabled by default as it adds extra overhead to the document build time and -also switches \newglossaryentry (and therefore \newacronym) into a preamble-only command. -
-

-

To enable this function, use -


\glsenableentrycount

-

-before defining your entries. This adds two extra (internal) fields to entries: currcount and prevcount. -

The currcount field keeps track of how many times \glsunset is used within the document. A local unset -(using \glslocalunset) performs a local rather than global increment to currcount. Remember that -not all commands use \glsunset. Only the \gls-like commands do this. The reset commands -\glsreset and \glslocalreset reset this field back to zero (where \glslocalreset performs a local -change). - - -

The prevcount field stores the final value of the currcount field from the previous run. This value is read -from the aux file at the beginning of the document environment. -

You can access these fields using -


\glsentrycurrcount{label}

-

-for the currcount field, and -


\glsentryprevcount{label}

-

-for the prevcount field. -

These commands are only defined if you have used \glsenableentrycount.
-

-

For example: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\makeglossaries
-\glsenableentrycount
-\newglossaryentry{apple}{name=apple,description={a fruit}}
-\begin{document}
-Total usage on previous run: \glsentryprevcount{apple}.
-\gls{apple}. \gls{apple}. \glsadd{apple}\glsentrytext{apple}.
-\glslink{apple}{apple}. \glsdisp{apple}{apple}. \Gls{apple}.
-Number of times apple has been used: \glsentrycurrcount{apple}.
-\end{document}
-
-

On the first LaTeX run, \glsentryprevcount{apple} produces 0. At the end of the document, -\glsentrycurrcount{apple} produces 4. This is because the only commands that have incremented the entry -count are those that use \glsunset. That is: \gls, \glsdisp and \Gls. The other commands used in the above -example, \glsadd, \glsentrytext and \glslink, don’t use \glsunset so they don’t increment the -entry count. On the next LaTeX run, \glsentryprevcount{apple} now produces 4 as that was -the value of the currcount field for the apple entry at the end of the document on the previous -run. -

When you enable the entry count using \glsenableentrycount, you also enable the following -commands: -


\cgls[options]{label}[insert]

-

-(no case-change, singular) -


\cglspl[options]{label}[insert]

-

-(no case-change, plural) -


\cGls[options]{label}[insert]

-

-(first letter uppercase, singular), and -


\cGlspl[options]{label}[insert]

-

-(first letter uppercase, plural). These all have plus and starred variants like the analogous \gls, \glspl, \Gls -and \Glspl commands. -

If you don’t use \glsenableentrycount, these commands behave like \gls, \glspl, \Gls and \Glspl, -respectively, only there will be a warning that you haven’t enabled entry counting. If you have enabled entry -counting with \glsenableentrycount then these commands test if \glsentryprevcount{label} equals 1. If it -doesn’t then the analogous \gls etc will be used. If it does, then the first optional argument will be ignored and -

- - -
-⟨cs format{label}{insert}\glsunset{label} -
-
will be performed, where ⟨cs format⟩ is a command that takes two arguments. The command used depends -whether you have used \cgls, \cglspl, \cGls or \cGlspl. -


\cglsformat{label}{insert}

-

-This command is used by \cgls and defaults to

-
-\glsentrylong{label}insert⟩ -
-
if the entry given by ⟨label⟩ has a long form or
-
-\glsentryfirst{label}insert⟩ -
-
otherwise. -


\cglsplformat{label}{insert}

-

-This command is used by \cglspl and defaults to

-
-\glsentrylongpl{label}insert⟩ -
-
if the entry given by ⟨label⟩ has a long form or
-
-\glsentryfirstplural{label}insert⟩ -
-
otherwise. -


\cGlsformat{label}{insert}

-

-This command is used by \cGls and defaults to

-
-\Glsentrylong{label}insert⟩ -
-
if the entry given by ⟨label⟩ has a long form or
- - -
-\Glsentryfirst{label}insert⟩ -
-
otherwise. -


\cGlsplformat{label}{insert}

-

-This command is used by \cGlspl and defaults to

-
-\Glsentrylongpl{label}insert⟩ -
-
if the entry given by ⟨label⟩ has a long form or
-
-\Glsentryfirstplural{label}insert⟩ -
-
otherwise. -

This means that if the previous count for the given entry was 1, the entry won’t be hyperlinked with the -\cgls-like commands and they won’t add a line to the external glossary file. If you haven’t used any of the -other commands that add information to the glossary file (such as \glsadd or the \glstext-like commands) -then the entry won’t appear in the glossary. -

Remember that since these commands use \glsentryprevcount you need to run LaTeX twice to ensure -they work correctly. The document build order is now (at least): (pdf)latex, (pdf)latex, makeglossaries, -(pdf)latex. - -

Example 19 (Don’t index entries that are only used once) -

In this example, the abbreviations that have only been used once (on the previous run) only have their long -form shown with \cgls. - - -

-
-\documentclass{article}
-\usepackage[colorlinks]{hyperref}
-\usepackage[acronym]{glossaries}
-\makeglossaries
-\glsenableentrycount
-\setacronymstyle{long-short}
-\newacronym{html}{HTML}{hypertext markup language}
-\newacronym{css}{CSS}{cascading style sheets}
-\newacronym{xml}{XML}{extensible markup language}
-\newacronym{sql}{SQL}{structured query language}
-\newacronym{rdbms}{RDBMS}{relational database management system}
-\newacronym{rdsms}{RDSMS}{relational data stream management system}
-\begin{document}
-These entries are only used once: \cgls{sql}, \cgls{rdbms},
-\cgls{xml}. These entries are used multiple times:
-\cgls{html}, \cgls{html}, \cgls{css}, \cgls{css}, \cgls{css},
-\cgls{rdsms}, \cgls{rdsms}.
-\printglossaries
-\end{document}
-
-

After a complete document build (latex, latex, makeglossaries, latex) the list of abbreviations 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 hyperlink.

-
-

-

____________________________

-

Remember that if you don’t like typing \cgls you can create a synonym. For example - - -

-
-\let\ac\cgls
-
-

-

With bib2gls there’s an analogous record counting set of commands. See glossaries-extra and bib2gls -manuals for further details.
-

- - -

-

-

Top

8. Displaying a Glossary

-

All defined glossaries may be displayed using: -

-

-Option 1:

-

(Must be used with \makenoidxglossaries in the preamble.) -


\printnoidxglossaries

-

- which internally uses \printnoidxglossary for each glossary. -

-

-Options 2 and 3:

-

(Must be used with \makeglossaries in the preamble.) -


\printglossaries

-

- which internally uses \printglossary for each glossary. -

-

-Options 46:

-

(glossaries-extra only) -


\printunsrtglossaries

-

- which internally uses \printunsrtglossary for each glossary.

-

These commands will display all the glossaries in the order in which they were defined. -

Note that, in the case of Options 2 and 3, no glossaries will appear until you have either used the Perl script -makeglossaries or Lua script makeglossaries-lite or have directly used makeindex or xindy (as described -in §1.5 Generating the Associated Glossary Files). In the case of Option 4, no glossary will -appear until you have used bib2gls. -

While the external files are missing, \printglossary will just do \null for each missing glossary to assist -dictionary style documents that just use \glsaddall without inserting any text. This use of \null ensures that -all indexing information is written before the final page is shipped out. Once the external files are present \null -will no longer be used. This can cause a spurious blank page on the first LaTeX run before the glossary files -have been created. Once these files are present, \null will no longer be used and so shouldn’t cause interference -for the final document.
-

-

If you use glossaries-extra, it will insert a heading and boilerplate text when the external files are missing. -See the glossaries-extra manual for further details.
- - -

-

If the glossary still does not appear after you re-LaTeX your document, check the makeindex, xindy or -bib2gls log files, as applicable, to see if there is a problem. With Option 1, you just need two -LaTeX runs to make the glossaries appear, but you may need further runs to make the number lists -up-to-date. -

An individual glossary can be displayed using: -

-

-Option 1:

-

-


\printnoidxglossary[options]

-

- (Must be used with \makenoidxglossaries in the preamble.) -

-

-Options 2 and 3:

-

-


\printglossary[options]

-

- (Must be used with \makeglossaries in the preamble.) -

-

-Options 46:

-

-


\printunsrtglossary[options]

-

- (May be used with or without bib2gls.)

-

where ⟨options⟩ is a ⟨key⟩=⟨value⟩ list of options. (Again, when the associated external file is missing, \null is inserted -into the document.) -

The glossaries-extra package also provides -


\printunsrtinnerglossary[options]{pre code}{post code}

-

-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: Inner or Nested Glossaries. See the glossaries-extra package for further -details.

-

-

The following keys are available in {options}: -

- - -

-type

-

The value of this key specifies which glossary to print. If omitted, the default glossary is assumed. For - example, to print the list of acronyms: - - -

-
-     \printglossary[type=\acronymtype]
-
-

Note that you can’t display an ignored glossary, so don’t try setting type to the name of a glossary - that was defined using \newignoredglossary, described in §9 Defining New - Glossaries. (You can display an ignored glossary with \printunsrtglossary provided by - glossaries-extra.) -

-

-title

-

This is the glossary’s title (overriding the title specified when the glossary was defined). -

-

-toctitle

-

This is the title to use for the table of contents (if the toc package option has been used). It may also - be used for the page header, depending on the page style. If omitted, the value of title is - used. -

-

-style

-

This specifies which glossary style to use for this glossary, overriding the effect of the style package option - or \glossarystyle. -

-

-numberedsection

-

This specifies whether to use a numbered section for this glossary, overriding the effect of the - numberedsection package option. This key has the same syntax as the numberedsection package option, - described in §2.2 Sectioning, Headings and TOC Options. -

-

-nonumberlist

-

This is a boolean key. If true (nonumberlist=true) the numberlist is suppressed for this glossary. If false - (nonumberlist=false) the numberlist is displayed for this glossary. -

- - -

-nogroupskip

-

This is a boolean key. If true the vertical gap between groups is suppressed for this glossary. -

-

-nopostdot

-

This is a boolean key. If true the full stop after the description is suppressed for this glossary. -

-

-entrycounter

-

This is a boolean key. Behaves similar to the package option of the same name. The corresponding package - option must be used to make \glsrefentry work correctly. -

-

-subentrycounter

-

This is a boolean key. Behaves similar to the package option of the same name. If you want to set both - entrycounter and subentrycounter, make sure you specify entrycounter first. The corresponding - package option must be used to make \glsrefentry work correctly. -

-

-sort

-

This key is only available for Option 1. Possible values are: word (word order), letter (letter order), - standard (word or letter ordering taken from the order package option), use (order of use), def (order of - definition) nocase (case-insensitive) or case (case-sensitive). Note that the word and letter comparisons - (that is, everything other than sort=use and sort=def) just use a simple character code comparison. For - a locale-sensitive sort, you must use either xindy (Option 3) or bib2gls (Option 4). Note that bib2gls - provides many other sort options. -

If you use the use or def values make sure that you select a glossary style that doesn’t have a visual - indicator between groups, as the grouping no longer makes sense. Consider using the nogroupskip option. -
-

-

The - word - and - letter - order - sort - methods - use - - - datatool’s - \dtlwordindexcompare - and - \dtlletterindexcompare - handlers. - The - case-insensitive - sort - method - uses - datatool’s - \dtlicompare - handler. - The - case-sensitive - sort - method - uses - datatool’s - \dtlcompare - handler. - See - the - datatool - documentation - for - further - details. -

If you don’t get an error with sort=use and sort=def but you do get an error with one of the other sort - options, then you probably need to use the sanitizesort=true package option or make sure none of the - entries have fragile commands in their sort field. -

-

-label={label}

-

This key is only available with glossaries-extra and labels the glossary with \label{label}. This is an - alternative to the package option numberedsection=autolabel -

-

-target={boolean}

-

This boolean key is only available with glossaries-extra and can be used to switch off the - automatic hypertarget for each entry. (This refers to the target used by commands like \gls and - \glslink.) -

This option is useful with \printunsrtglossary as it allows the same list (or sub-list) of entries to be - - - displayed multiple times without causing duplicate hypertarget names. -

-

-prefix={prefix}

-

This key is only available with 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 \glolinkprefix but - note this will also affect the target for any entry referenced within the glossary with commands like \gls, - \glslink or \glshypertarget. -

-

-targetnameprefix={prefix}

-

This key is only available with glossaries-extra. This is similar to the prefix option, but it alters the prefix of - the hypertarget anchors without changing \glslinkprefix (so it won’t change the hyperlinks for any - entries referenced in the glossary). -

-

-groups={boolean}

-

This boolean key is only available with glossaries-extra and, if true, will attempt to perform group - formation. See the glossaries-extra manual for further details. -

-

-leveloffset={n}

-

This key is only available with \printunsrtglossary. It can be used to locally adjust the hierarchical - level used by the glossary style. See the glossaries-extra manual for further details.

-

By default, the glossary is started either by \chapter* or by \section*, depending on whether or not -\chapter is defined. This can be overridden by the section package option or the \setglossarysection -command. Numbered sectional units can be obtained using the numberedsection package option. Each glossary -sets the page header via the command -


\glsglossarymark{title}

-

-If this mechanism is unsuitable for your chosen class file or page style package, you will need to redefine -\glsglossarymark. Further information about these options and commands is given in §2.2 -Sectioning, Headings and TOC Options. -

Information can be added to the start of the glossary (after the title and before the main body of the -glossary) by redefining -


\glossarypreamble

-

-For example: - - -

-
-\renewcommand{\glossarypreamble}{Numbers in italic
-indicate primary definitions.}
-
-

This needs to be done before the glossary is displayed. -

If you want a different preamble per glossary you can use -


\setglossarypreamble[type]{preamble text}

-

-If ⟨type⟩ is omitted, \glsdefaulttype is used. -

For example: - - -

-
-\setglossarypreamble{Numbers in italic
-indicate primary definitions.}
-
-

This will print the given preamble text for the main glossary, but not have any preamble text for any other -glossaries. -

There is an analogous command to \glossarypreamble called -


\glossarypostamble

-

-which is placed at the end of each glossary. - -

Example 20 (Switch to Two Column Mode for Glossary) -

Suppose you are using the superheaderborder -style8.1, -and you want the glossary to be in two columns, but after the glossary you want to switch back to one column -mode, you could do: - - -

-
-\renewcommand*{\glossarysection}[2][]{%
-  \twocolumn[{\chapter*{#2}}]%
-  \setlength\glsdescwidth{0.6\linewidth}%
-  \glsglossarymark{\glossarytoctitle}%
+
This contains the entries that were defined with \newglossaryentry. For example:
@entry{gls:set,
+  name={set},
+  description={A collection of distinct objects}
 }
-\renewcommand*{\glossarypostamble}{\onecolumn}
-
-

-

-
-

-

____________________________

-

Within each glossary, each entry name is formatted according to -


\glsnamefont{name}

-

-which takes one argument: the entry name. This command is always used regardless of the glossary style. By -default, \glsnamefont simply displays its argument in whatever the surrounding font happens to be. -This means that in the list-like glossary styles (defined in the glossary-list style file) the name will -appear in bold, since the name is placed in the optional argument of \item, whereas in the tabular -styles (defined in the glossary-long and glossary-super style files) the name will appear in the normal -font. The hierarchical glossary styles (defined in the glossary-tree style file) also set the name in -bold. -

If you want to change the font for the description, or if you only want to change the name -font for some types of entries but not others, you might want to consider using the glossaries-extra -package. - -

Example 21 (Changing the Font Used to Display Entry Names in the -Glossary) -

Suppose you want all the entry names to appear in medium weight small caps in your glossaries, then you -can do: - - -

-
-\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}}
-
-

-
-

-

____________________________

-

The glossaries-extra package provides additional hooks that can be used to make other minor adjustments. -
-

-

The letter group titles (which are displayed for styles like indexgroup) can be changed either by redefining the -corresponding \group-labelgroupname commands, such as \glssymbolsgroupname, (see §1.4.1 -Changing the Fixed Names) or by using the glossaries-extra commands \glsxtrsetgrouptitle and -\glsxtrlocalsetgrouptitle. The ⟨group-label⟩ is typically obtained by the indexing application. - - -

-

-

Top

9. Defining New Glossaries

-

A new glossary can be defined using: -


\newglossary[log-ext]{name}{in-ext}{out-ext} -{title}[counter]

-

-where ⟨name⟩ is the label to assign to this glossary. The arguments ⟨in-ext⟩ and ⟨out-ext⟩ specify the extensions to -give to the input and output files for that glossary, ⟨title⟩ is the default title for this new glossary and the final -optional argument ⟨counter⟩ specifies which counter to use for the associated number lists (see also -§12 Number Lists). The first optional argument specifies the extension for the makeindex -(Option 2) or xindy (Option 3) transcript file (this information is only used by makeglossaries which picks -up the information from the auxiliary file). If you use Option 1, the ⟨log-ext⟩, ⟨in-ext⟩ and ⟨out-ext⟩ arguments are -ignored. -

The glossary label ⟨name⟩ must not contain any active characters. It’s generally best to stick with just -characters that have category code 11 (typically the non-extended Latin characters for standard LaTeX). -
-

-

There is also a starred version (new to v4.08): -


\newglossary*{name}{title}[counter]

-

-which is equivalent to

-
-\newglossary[name-glg]{name}{name-gls}{name-glo}{title}[counter] -
-
or you can also use: -


\altnewglossary{name}{tag}{title}[counter]

-

-which is equivalent to

-
-\newglossary[tag-glg]{name}{tag-gls}{tag-glo}{title}[counter] -
-
-

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 glossary that doesn’t create any associated files. This is referred to as an “ignored -glossary” and it’s ignored by commands that iterate over all the glossaries, such as \printglossaries. To -define an ignored glossary, use -


\newignoredglossary{name}

-

-where ⟨name⟩ is the name of the glossary (as above). This glossary type will automatically be added to the -nohypertypes list, since there are no hypertargets for the entries in an ignored glossary. (The sample file -sample-entryfmt.tex defines an ignored glossary.) - - -

The glossaries-extra package provides a starred version of this command that allows hyperlinks (since -ignored glossaries can be useful with bib2gls). There is also an analogous \provideignoredglossary -command.
-

-

You can test if a glossary is an ignored one using: -


\ifignoredglossary{name}{true}{false}

-

-This does ⟨true⟩ if ⟨name⟩ was defined as an ignored glossary, otherwise it does ⟨false⟩. -

Note that the main (default) glossary is automatically created as: - - -

-
-\newglossary{main}{gls}{glo}{\glossaryname}
-
-

so it can be identified by the label main (unless the nomain package option is used). Using the acronym package -option is equivalent to: - - -

-
-\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
-
-

so it can be identified by the label acronym. If you are not sure whether the acronym option has been used, you -can identify the list of acronyms by the command \acronymtype which is set to acronym, if the acronym -option has been used, otherwise it is set to main. Note that if you are using the main glossary -as your list of acronyms, you need to declare it as a list of acronyms using the package option -acronymlists. -

The symbols package option creates a new glossary with the label symbols using: - - -

-
-\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}
-
-

The numbers package option creates a new glossary with the label numbers using: - - -

-
-\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}
-
-

The index package option creates a new glossary with the label index using: - - -

-
-\newglossary[ilg]{index}{ind}{idx}{\indexname}
-
-

-

Options 2 and 3: all glossaries must be defined before \makeglossaries to ensure that the relevant output -files are opened. -

See §1.4.1 Changing the Fixed Names if you want to redefine \glossaryname, especially if you -are using babel or translator. (Similarly for \glssymbolsgroupname and \glsnumbersgroupname.) If you -want to redefine \indexname, just follow the advice in How to change LaTeX’s “fixed names”. -

-

- - -

-

-

Top

10. Adding an Entry to the Glossary Without Generating Text

-

It is possible to add a line to the glossary file without generating any text at that point in the document -using: -


\glsadd[options]{label}

-

-This is similar to the \glstext-like commands, only it doesn’t produce any text (so therefore, there is no hyper -key available in ⟨options⟩ but all the other options that can be used with \glstext-like commands can be passed -to \glsadd). -

This command essentially works like \index (provided by the LaTeX kernel) in that it doesn’t produce text -but it does add a line with an associated location to the glossary file. In this case, the “encap” (the page -encapsulator information) is specified with the format key. (See §12.1 Encap Values (Location -Formats).) -

For example, to add a page range to the glossary number list for the entry whose label is given by -set: - - -

-
-\glsadd[format=(]{set}
-Lots of text about sets spanning many pages.
-\glsadd[format=)]{set}
-
-

-

To add all entries that have been defined, use: -


\glsaddall[options]

-

-The optional argument is the same as for \glsadd, except there is also a key types which can be -used to specify which glossaries to use. This should be a comma-separated list. For example, if -you only want to add all the entries belonging to the list of acronyms (specified by the glossary -type \acronymtype) and a list of notation (specified by the glossary type notation) then you can -do: - - -

-
-\glsaddall[types={\acronymtype,notation}]
-
-

-

If you are using bib2gls with glossaries-extra, you can’t use \glsaddall. Instead use the selection=all -resource option to select all entries in the given bib files.
-

-

Note that \glsadd and \glsaddall add the current location to the number list. In the case of \glsaddall, -all entries in the glossary will have the same location in the number list. If you want to use \glsaddall, it’s -best to suppress the number list with the nonumberlist package option. (See sections 2.3 and 12.) -
-

-

There is now a variation of \glsaddall that skips any entries that have been marked as used: -


\glsaddallunused[list]

-

-This command uses \glsadd[format=glsignore] which will ignore this location in the number list. (See -§12.1 Encap Values (Location Formats).) The optional argument ⟨list⟩ is a comma-separated list of -glossary types. If omitted, it defaults to the list of all defined glossaries. -

If you want to use \glsaddallunused, it’s best to place the command at the end of the document to ensure -that all the commands you intend to use have already been used. Otherwise you could end up with a spurious -comma or dash in the location list.
-

-

With glossaries-extra and bib2gls, glsignore indicates an “ignored location” which influences selection but -isn’t added to the location list. In this case, if you use selection=all then only those entries that have been -explicitly indexed in the document will have location lists. The other entries that were selected as a result of -selection=all won’t have location lists.
-

-

Base glossaries package only: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\makeglossaries
-\newglossaryentry{cat}{name={cat},description={feline}}
-\newglossaryentry{dog}{name={dog},description={canine}}
-\begin{document}
-\gls{cat}.
-\printglossaries
-\glsaddallunused % <- make sure dog is also listed
-\end{document}
-
-

Corresponding glossaries-extra and bib2gls document code: - - -

-
-\documentclass{article}
-\usepackage[record]{glossaries-extra}
-\GlsXtrLoadResources[src={entries},selection=all]
-\begin{document}
-\gls{cat}.
-\printunsrtglossaries
-\end{document}
-
-

With the file entries.bib: - - -

-
-@entry{cat,name={cat},description={feline}}
-@entry{dog,name={dog},description={canine}}
-
-

- -

Example 22 (Dual Entries) -

The example file sample-dual.tex makes use of \glsadd to allow for an entry that should appear both in -the main glossary and in the list of acronyms. This example sets up the list of acronyms using the acronym -package option: - - -

-
-\usepackage[acronym]{glossaries}
-
-

A new command is then defined to make it easier to define dual entries: - - -

-
-\newcommand*{\newdualentry}[5][]{%
-  \newglossaryentry{main-#2}{name={#4},%
-  text={#3\glsadd{#2}},%
-  description={#5},%
-  #1
-  }%
-  \newacronym{#2}{#3\glsadd{main-#2}}{#4}%
+
+

+

abbreviations.bib
+ +
This contains the entries that were defined with \newacronym. For example:
@acronym{zfc,
+  short={ZFC},
+  long={Zermelo-Fraenkel set theory}
 }
-
-

This has the following syntax:

-
-\newdualentry[options]{label}{abbrv}{long}{description} -
-
You can then define a new dual entry: - - -
-\newdualentry{svm}% label
-  {SVM}% abbreviation
-  {support vector machine}% long form
-  {Statistical pattern recognition technique}% description
-
-

Now you can reference the acronym with \gls{svm} or you can reference the entry in the main glossary with -\gls{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 -lookup. -

Note that with 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 \glsadd with bib2gls. (Although it can still be useful, as shown in Option 6.) -
-

-

-
-

-

____________________________

- - -

-

Top

11. Cross-Referencing Entries

-

You must use \makeglossaries (Options 2 or 3) or \makenoidxglossaries (Option 1) before -defining any terms that cross-reference entries. If any of the terms that you have cross-referenced -don’t appear in the glossary, check that you have put \makeglossaries/\makenoidxglossaries -before all entry definitions. The glossaries-extra package provides better cross-reference handling. -
-

-

There are several ways of cross-referencing entries in the glossary: -

    -
  1. -

    You can use commands such as \gls in the entries description. For example: - - -

    -
    -     \newglossaryentry{apple}{name=apple,
    -     description={firm, round fruit. See also \gls{pear}}}
    -
    -

    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 makeglossaries: -

    
    -     
    pdflatex filename -
    makeglossaries filename -
    pdflatex filename -
    makeglossaries filename -
    pdflatex filename -
    -
    - This is because the \gls in the description won’t be detected until the glossary has been created (unless - the description is used elsewhere in the document with \glsentrydesc). Take care not to use \glsdesc - (or \Glsdesc) in this case as it will cause a nested link. -

  2. -
  3. -

    As described in §4 Defining Glossary Entries, you can use the see key when you define - the entry. For example: - - -

    -
    -     \newglossaryentry{MaclaurinSeries}{name={Maclaurin
    -     series},
    -     description={Series expansion},
    -     see={TaylorsTheorem}}
    -
    -

    Note that in this case, the entry with the see key will automatically be added to the glossary, but the - cross-referenced entry won’t. You therefore need to ensure that you use the cross-referenced term with the - commands described in §5.1 Links to Glossary Entries or §10 Adding an Entry to the - Glossary Without Generating Text. -

    The “see” tag is produce using \seename, but can be overridden in specific instances using square brackets - at the start of the see value. For example: - - -

    -
    -     \newglossaryentry{MaclaurinSeries}{name={Maclaurin
    -     series},
    -     description={Series expansion},
    -     see=[see also]{TaylorsTheorem}}
    -
    -

    Take care if you want to use the optional argument of commands such as \newacronym or \newterm as - the value will need to be grouped. For example: - - -

    -
    -     \newterm{seal}
    -     \newterm[see={[see also]seal}]{sea lion}
    -
    -

    Similarly if the value contains a list. For example: - - -

    -
    -     \glossaryentry{lemon}{
    -       name={lemon},
    -       description={Yellow citrus fruit}
    -     }
    -     \glossaryentry{lime}
    -     {
    -       name={lime},
    -       description={Green citrus fruit}
    -     }
    -     \glossaryentry{citrus}
    -     {
    -       name={citrus},
    -       description={Plant in the Rutaceae family},
    -       see={lemon,lime}
    -     }
    -
    -

    -

  4. -
  5. -

    After you have defined the entry, use -


    \glssee[tag]{label}{xr label list}

    -

    - where ⟨xr label list⟩ is a comma-separated list of entry labels to be cross-referenced, ⟨label⟩ is the label of the - entry doing the cross-referencing and ⟨tag⟩ is the “see” tag. (The default value of ⟨tag⟩ is \seename.) For - example: - - -

    -
    -     \glssee[see also]{series}{FourierSeries,TaylorsTheorem}
    -
    -

    Note that this automatically adds the entry given by ⟨label⟩ to the glossary but doesn’t add the - cross-referenced entries (specified by ⟨xr label list⟩) to the glossary.

-

In both cases 2 and 3 above, the cross-referenced information appears in the number list, whereas in case 1, -the cross-referenced information appears in the description. (See the sample-crossref.tex example file that -comes with this package.) This means that in cases 2 and 3, the cross-referencing information won’t appear if -you have suppressed the number list. In this case, you will need to activate the number list for -the given entries using nonumberlist=false. Alternatively, if you just use the see key instead -of \glssee, you can automatically activate the number list using the seeautonumberlist package -option. -

bib2gls provides much better support for cross-references. See, for example, Gallery: Cross-References -(bib2gls).
-

-

-

Top

11.1 Customising Cross-reference Text

-

When you use either the see key or the command \glssee, the cross-referencing information will be typeset in -the glossary according to: -


\glsseeformat[tag]{label-list}{location}

-

-The default definition of \glsseeformat is: -
\emph{tag} \glsseelist{label-list} -
-Note that the location is always ignored.11.1 -For example, if you want the tag to appear in bold, you can -do:11.2 - - -

-
-\renewcommand*{\glsseeformat}[3][\seename]{\textbf{#1}
- \glsseelist{#2}}
-
-

-

The list of labels is dealt with by \glsseelist, which iterates through the list and typesets each entry in -the label. The entries are separated by -


\glsseesep

-

-or (for the last pair) -


\glsseelastsep

-

-These default to “,\space” and “\space\andname\space” respectively. The list entry text is displayed -using: -


\glsseeitemformat{label}

-

-This defaults to \glsentrytext{label}.11.3 -For example, to make the cross-referenced list use small caps: - - -

-
-\renewcommand{\glsseeitemformat}[1]{%
-  \textsc{\glsentrytext{#1}}}
-
-

-

The glossaries-extra package redefines \glsseeitemformat and additionally provides \glsxtrhiername -which can be used as an alternative to \glsentrytext. See the glossaries-extra manual for further details. -
-

-

You can use \glsseeformat and \glsseelist in the main body of the text, but they won’t automatically -add the cross-referenced entries to the glossary. If you want them added with that location, you can -do: - - -

-
-Some information (see also
-\glsseelist{FourierSeries,TaylorsTheorem}%
-\glsadd{FourierSeries}\glsadd{TaylorsTheorem}).
-
-

-

- - -

-

-

Top

12. Number Lists

-

Each entry in the glossary has an associated number list. By default, these numbers refer to the pages on -which that entry has been indexed (using any of the commands described in §5.1 Links to Glossary -Entries and §10 Adding an Entry to the Glossary Without Generating Text). The number list -can be suppressed using the nonumberlist package option, or an alternative counter can be set as -the default using the counter package option. The number list is also referred to as the location -list. -

Number lists are more common with indexes rather than glossaries (although you can use the glossaries -package for indexes as well). However, the glossaries package makes use of makeindex or xindy to hierarchically -sort and collate the entries since they are readily available with most modern TeX distributions. Since these are -both designed as indexing applications they both require that terms either have a valid location or a -cross-reference. Even if you use nonumberlist, the locations must still be provided and acceptable to the indexing -application or they will cause an error during the indexing stage, which will interrupt the document build. -However, if you’re not interested in the locations, each entry only needs to be indexed once, so consider using -indexonlyfirst, which can improve the document build time by only indexing the first use of each -term. -

The \glsaddall command (see §10 Adding an Entry to the Glossary Without Generating Text), -which is used to automatically index all entries, iterates over all defined entries and does \glsadd{label} for -each entry (where ⟨label⟩ is that entry’s label). This means that \glsaddall automatically adds -the same location to every entry’s number list, which looks weird if the number list hasn’t been -suppressed. -

With Option 4, the indexing is performed by bib2gls, which was specifically designed for the glossaries-extra -package. So it will allow any location format, and its selection=all option will select all entries without -adding an unwanted location to the number list. If bib2gls can deduce a numerical value for a location, it will -attempt to form a range over consecutive locations, otherwise it won’t try to form a range and the location will -just form an individual item in the list. Option 1 also allows any location but it doesn’t form -ranges. -

-

Top

12.1 Encap Values (Location Formats)

-

Each location in the number list is encapsulated with a command formed from the encap value. By default this -is the \glsnumberformat command, which corresponds to the encap glsnumberformat, but this may be -overridden using the format key in the optional argument to commands like \gls. (See §5.1 Links to -Glossary Entries.) For example, you may want the location to appear in bold to indicate the principle use of a -term or symbol. If the encap starts with an open parenthesis ( this signifies the start of a range and if the encap -starts with close parenthesis ) this signifies the end of a range. These must always occur in matching -pairs. -

The glossaries package provides the command: -


\glsignore{text}

-

-which ignores its argument. This is the format used by \glsaddallunused to suppress the location, -which works fine as long as no other locations are added to the number list. For example, if you use -\gls{sample} on page 2 then reset the first use flag and then use \glsaddallunused on page 10, the -number list for sample will be 2, \glsignore{10} which will result in “2, ” which has a spurious - - -comma. -

This isn’t a problem with bib2gls because you would need to use selection=all instead of -\glsaddallunused, but even if you explicitly had used glsignore, for example, \gls[format=glsignore] -{label}, then bib2gls will recognise glsignore as a special encap indicating an ignored location, so it will -select the entry but not add that location to the number list. It’s a problem for all the other indexing -options. -

Complications can arise if you use different encap values for the same location. For example, suppose on -page 10 you have both the default glsnumberformat and textbf encaps. While it may seem apparent that -textbf should override glsnumberformat in this situation, the indexing application may not know it. This is -therefore something you need to be careful about if you use the format key or if you use a command that -implicitly sets it. -

In the case of xindy, it only accepts one encap (according to the order of precedence given in the xindy -module) and discards the others for identical locations (for the same entry). This can cause a problem if a -discarded location forms the start or end of a range. -

In the case of makeindex, it accepts different encaps for the same location, but warns about it. This leads to -a number list with the same location repeated in different formats. If you use the makeglossaries Perl script -with Option 2 it will detect makeindex’s warning and attempt to fix the problem, ensuring that the -glsnumberformat encap always has the least precedence unless it includes a range identifier. Other conflicting -encaps will have the last one override earlier ones for the same location with range identifiers taking -priority. -

No discard occurs with Option 1 so again you get the same location repeated in different formats. With -Option 4, bib2gls will discard according to order of precedence, giving priority to start and end range encaps. -(See the bib2gls manual for further details.) -

-

-

Top

12.2 Locations

-

Neither Option 1 nor Option 4 care about the location syntax as long as it’s valid LaTeX code (and doesn’t -contain fragile commands). In both cases, the indexing is performed by writing a line to the aux file. The write -operation is deferred to avoid the problems associated with TeX’s asynchronous output routine. (See, for -example, Finding if you’re on an odd or an even page for more details on this issue.) Unfortunately -Options 2 and 3 are far more problematic and need some complex code to deal with awkward -locations. -

If you know that your locations will always expand to a format acceptable to your chosen indexing -application then use the package option esclocations=false to bypass this operation. This setting only affects -Options 2 and 3 as the problem doesn’t arise with the other indexing options. -

Both makeindex and xindy are fussy about the syntax of the locations. In the case of makeindex, only the -numbering system obtained with \arabic, \roman, \Roman, \alph and \Alph or composites formed from them -with the same separator (set with \glsSetCompositor{char}) are accepted. (makeindex won’t accept an empty -location.) In the case of xindy, you can define your own location classes, but if the location contains a robust -command then the leading backslash must be escaped. The glossaries package tries to do this, but it’s caught -between two conflicting requirements: -

    - - -
  1. -

    The location must be fully expanded before \ can be converted to \\ (there’s no point converting - \thepage to \\thepage); -

  2. -
  3. -

    The page number can’t be expanded until the deferred write operation (so \c@page mustn’t - expand in the previous step but \the\c@page mustn’t be converted to \\the\\c@page and - \number\c@page mustn’t be converted to \\number\\c@page etc).

-

There’s a certain amount of trickery needed to deal with this conflict and the code requires the location to be in a -form that doesn’t embed the counter’s internal register in commands like \value. For example, -suppose you have a robust command called \tallynum that takes a number as the argument and an -expandable command called \tally that converts a counter name into the associated register or -number to pass to \tallynum. Let’s suppose that this command is used to represent the page -number: - - -

-
-\renewcommand{\thepage}{\tally{page}}
-
-

Now let’s suppose that a term is indexed at the beginning of page 2 at the end of a paragraph that started on -page 1. With xindy, the location \tally{page} needs to be written to the file as \\tallynum{2}. If it’s written -as \tallynum{2} then xindy will interpret \t as the character “t” (which means the location would appear as -“tallynum2”). So glossaries tries to expand \thepage without expanding \c@page and then escapes all the -backslashes, except for the page counter’s internal command. The following definitions of \tally will work: -

-
    -
  • -

    In the following, \arabic works as its internal command \c@arabic is temporarily redefined to check for - \c@page: - - -

    -
    -     \newcommand{\tally}[1]{\tallynum{\arabic{#1}}}
    -
    -

    -

  • -
  • -

    The form \expandafter\the\csname c@counter\endcsname also works (provided \the is allowed to be - temporarily redefined, see below): - - -

    -
    -     \newcommand{\tally}[1]{%
    -      \tallynum{\expandafter\the\csname c@#1\endcsname}}
    -
    -

    -

  • -
  • -

    \expandafter\the\value{counter} now also works (with the same condition as above): - - -

    -
    -     \newcommand{\tally}[1]{\tallynum{\expandafter\the\value{#1}}}
    -
    -

    -

  • -
  • -

    Another variation that will work: - - -

    -
    -     \newcommand{\tally}[1]{%
    -       \expandafter\tallynum\expandafter{\the\csname c@#1\endcsname}}
    -
    -

    -

  • -
  • -

    and also: - - -

    -
    -     \newcommand{\tally}[1]{\tallynum{\the\csname c@#1\endcsname}}
    -
    -

-

The following don’t work:

-
    -
  • -

    This definition leads to the premature expansion of \c@page to “1” when, in this case, it should be - “2”: - - -

    -
    -     \newcommand{\tally}[1]{\tallynum{\the\value{#1}}}
    -
    -

    -

  • -
  • -

    This definition leads to \\c@page in the glossary file: - - -

    -
    -     \newcommand{\tally}[1]{\tallynum{\csname c@#1\endcsname}}
    -
    -

-

If you have a numbering system where \cs name{page} expands to \internal cs name\c@page (for example, if -\tally{page} expands to \tallynum\c@page) then you need to use: -


\glsaddprotectedpagefmt{internal cs name}

-

-Note that the backslash must be omitted from ⟨internal cs name⟩ and the corresponding command must be able -to process a count register as the (sole) argument. -

For example, suppose you have a style samplenum that is implemented as follows: - - -

-
- \newcommand*{\samplenum}[1]{%
-   \expandafter\@samplenum\csname c@#1\endcsname}
- \newcommand*{\@samplenum}[1]{\two@digits{#1}}
-
-

(That is, it displays the value of the counter as a two-digit number.) Then to ensure the location is correct for -entries in page-spanning paragraphs, you need to do: - - -

-
-\glsaddprotectedpagefmt{@samplenum}
-
-

(If you are using a different counter for the location, such as section or equation, you don’t need to worry -about this provided the inner command is expandable.) -

If the inner macro (as given by \internal cs name⟩) contains non-expandable commands then you may need -to redefine \glsinternal cs namepage after using

-
-\glsaddprotectedpagefmt{internal cs name} -
-
This command doesn’t take any arguments as the location is assumed to be given by \c@page because that’s -the only occasion this command should be used. For example, suppose now my page counter format uses small -caps Roman numerals: - - -
- \newcommand*{\samplenum}[1]{%
-  \expandafter\@samplenum\csname c@#1\endcsname}
- \newcommand*{\@samplenum}[1]{\textsc{\romannumeral#1}}
-
-

Again, the inner macro needs to be identified using: - - -

-
-\glsaddprotectedpagefmt{@samplenum}
-
-

However, since \textsc isn’t fully expandable, the location is written to the file as \textsc  {i} (for page 1), -\textsc  {ii} (for page 2), etc. This format may cause a problem for the indexing application -(particularly for makeindex). To compensate for this, the \glsinternal cs namepage command -may be redefined so that it expands to a format that’s acceptable to the indexing application. For -example: - - -

-
-\renewcommand*{\gls@samplenumpage}{\romannumeral\c@page}
-
-

While this modification means that the number list in the glossary won’t exactly match the format of the page -numbers (displaying lower case Roman numbers instead of small cap Roman numerals) this method -will at least work correctly for both makeindex and xindy. If you are using xindy, the following -definition: - - -

-
- \renewcommand*{\gls@samplenumpage}{%
-   \glsbackslash\string\textsc{\romannumeral\c@page}}
-
-

combined with - - -

-
-\GlsAddXdyLocation{romansc}{:sep "\string\textsc\glsopenbrace"
- "roman-numbers-lowercase" :sep "\glsclosebrace"}
-
-

will now have lowercase Roman numerals in the location list (see §14.2 Locations and Number lists for -further details on that command). Take care of the backslashes. The location (which ends up in the -:locref attribute) needs \\ but the location class (identified with \GlsAddXdyLocation) just -has a single backslash. Note that this example will cause problems if your locations should be -hyperlinks. -

Another possibility that may work with both makeindex and xindy is to redefine \glsinternal cs namepage -(\gls@samplenumpage in this example) to just expand to the decimal page number (\number\c@page) and -redefine \glsnumberformat to change the displayed format: - - -

-
-\renewcommand*{\gls@samplenumpage}{\number\c@page}
-\renewcommand*{\glsnumberformat}[1]{\textsc{\romannumeral#1}}
-
-

-

If you redefine \glsinternal cs namepage, you must make sure that \c@page is expanded when it’s written -to the file. (So don’t, for example, hide \c@page inside a robust command.)
-

-

The mechanism that allows this to work temporarily redefines \the and \number while it processes the -location. If this causes a problem you can disallow it using -


\glswrallowprimitivemodsfalse

-

-but you will need to find some other way to ensure the location expands correctly. -

-

-

Top

12.3 Range Formations

-

Both makeindex and xindy (Options 2 and 3) concatenate a sequence of 3 or more consecutive -pages into a range. With xindy (Option 3) you can vary the minimum sequence length using -\GlsSetXdyMinRangeLength{n} where ⟨n⟩ is either an integer or the keyword none which indicates that -there should be no range formation (see §14.2 Locations and Number lists for further -details). -

Note that \GlsSetXdyMinRangeLength must be used before \makeglossaries and has no effect if \noist -is used.
-

-

With both makeindex and xindy (Options 2 and 3), you can replace the separator and the closing number -in the range using: -


\glsSetSuffixF{suffix}

-

-


\glsSetSuffixFF{suffix}

-

-where the former command specifies the suffix to use for a 2 page list and the latter specifies the suffix to use for -longer lists. For example: - - -

-
-\glsSetSuffixF{f.}
-\glsSetSuffixFF{ff.}
-
-

Note that if you use xindy (Option 3), you will also need to set the minimum range length to 1 if you want to -change these suffixes: - - -

-
-\GlsSetXdyMinRangeLength{1}
-
-

Note that if you use the hyperref package, you will need to use \nohyperpage in the suffix to ensure that the -hyperlinks work correctly. For example: - - -

-
-\glsSetSuffixF{\nohyperpage{f.}}
-\glsSetSuffixFF{\nohyperpage{ff.}}
-
-

-

Note that \glsSetSuffixF and \glsSetSuffixFF must be used before \makeglossaries and have no -effect if \noist is used.
-

-

It’s also possible to concatenate a sequence of consecutive locations into a range or have suffixes with -Option 4, but with bib2gls these implicit ranges can’t be merged with explicit ranges (created with the ( and -) encaps). See the bib2gls manual for further details. -

Option 1 doesn’t form ranges. However, with this option you can iterate over an entry’s number list -using: -


\glsnumberlistloop{label}{handler cs}{xr handler cs}

-

-where ⟨label⟩ is the entry’s label and ⟨handler cs⟩ is a handler control sequence of the form: -


handler cs{prefix}{counter}{format}{location}

-

-where ⟨prefix⟩ is the hyperref prefix, ⟨counter⟩ is the name of the counter used for the location, ⟨format⟩ is the -format used to display the location (e.g. textbf) and ⟨location⟩ is the location. The third argument -is the control sequence to use for any cross-references in the list. This handler should have the -syntax: -


xr handler cs[tag]{xr list}

-

-where ⟨tag⟩ is the cross-referenced text (e.g. “see”) and ⟨xr list⟩ is a comma-separated list of labels. (This actually -has a third argument but it’s always empty when used with Option 1.) -

For example, if on page 12 I have used - - -

-
-\gls[format=textbf]{apple}
-
-

and on page 18 I have used - - -

-
-\gls[format=emph]{apple}
-
-

then - - -

-
-\glsnumberlistloop{apple}{\myhandler}
-
-

will be equivalent to: - - -

-
-\myhandler{}{page}{textbf}{12}%
-\myhandler{}{page}{emph}{18}%
-
-

There is a predefined handler that’s used to display the number list in the glossary: -


\glsnoidxdisplayloc{prefix}{counter}{format}{location}

-

-The predefined handler used for the cross-references in the glossary is: -


\glsseeformat[tag]{xr list}{location}

-

-which is described in §11.1 Customising Cross-reference Text. -

\glsnumberlistloop is not available for Options 2 and 3.
-

-

-

-

Top

12.4 Style Hook

-

As from version 4.24, there’s a hook that’s used near the end of \writeist before the file is closed. You can set -the code to be performed then using: -


\GlsSetWriteIstHook{code}

-

-If you want the ⟨code⟩ to write any information to the file, you need to use -


\write\glswrite{style information}

-

-Make sure you use the correct format within ⟨style information⟩. For example, if you are using makeindex: - - -

-
-\GlsSetWriteIstHook{%
- \write\glswrite{page_precedence "arnAR"}%
- \write\glswrite{line_max 80}%
+
If you changed \newacronym to \newabbreviation then @abbreviation will be used instead:
@abbreviation{zfc,
+  short={ZFC},
+  long={Zermelo-Fraenkel set theory}
 }
-
-

This changes the page type precedence and the maximum line length used by makeindex. -

Remember that if you switch to xindy, this will no longer be valid code. - - -

-

-

Top

13. Glossary Styles

-

Glossaries vary from lists that simply contain a symbol with a terse description to lists of terms or phrases -with lengthy descriptions. Some glossaries may have terms with associated symbols. Some may have -hierarchical entries. There is therefore no single style that fits every type of glossary. The glossaries -package comes with a number of pre-defined glossary styles, described in §13.1 -Predefined Styles. You can choose one of these that best suits your type of glossary or, if none of -them suit your document, you can defined your own style (see §13.2 Defining -your own glossary style). There are some examples of glossary styles available at the glossaries -gallery. -

The glossary style can be set using the style key in the optional argument to \printnoidxglossary -(Option 1) or \printglossary (Options 2 and 3) or using the command: -


\setglossarystyle{style-name}

-

-(before the glossary is displayed). -

Some of the predefined glossary styles may also be set using the style package option, it depends if the -package in which they are defined is automatically loaded by the glossaries package. -

You can use the lorum ipsum dummy entries provided in the accompanying example-glossaries-*.tex -files (described in §1.3 Dummy Entries for Testing) to test the different styles. -

The glossaries-extra-stylemods package provided with glossaries-extra patches the predefined styles. There also -more styles available with glossaries-extra.
-

-

-

Top

13.1 Predefined Styles

-

The predefined styles can accommodate numbered level 0 (main) and level 1 entries. See the package options -entrycounter, counterwithin and subentrycounter described in §2.3 Glossary Appearance -Options. There is a summary of available styles in table 13.1. You can view samples of all the predefined -styles at https://www.dickimaw-books.com/gallery/glossaries-styles/. Note that glossaries-extra -provides additional styles in the supplementary packages glossary-bookindex, glossary-topic and glossary-longextra. -See the glossaries-extra manual for further details. -

Note that the group styles (such as listgroup) will have unexpected results if used with the sort=def or -sort=use options. If you don’t sort your entries alphabetically, it’s best to set the nogroupskip package option to -prevent odd vertical gaps appearing.
-

-

The group title is obtained using \glsgetgrouptitle{label}, which is described in §13.2 -Defining your own glossary style. -

-
- - -


- - -
Table 13.1: Glossary Styles. An asterisk in the style name indicates anything that matches that doesn’t -match any previously listed style (e.g. long3col* matches long3col, long3colheader, long3colborder and -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 — there is no limit, but note that -makeindex (Option 2) imposes a limit of 2 sub-levels. If the 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.
-
+

+

notation.bib
-> - - - - - - - - - - - - - -
Style Maximum Level Homograph Symbol
listdotted 0
sublistdotted 1
list* 1
altlist* 1 -
long*3col* 1 -
long4col* 1
altlong*4col* 1
long* 1
super*3col* 1
super4col* 1
altsuper*4col* 1
super* 1
*index* 2
treenoname*
*alttree*
*tree*
inline 1
- - -

-
-

The tabular-like styles that allow multi-line descriptions and page lists use the length -


\glsdescwidth

-

-to set the width of the description column and the length -


\glspagelistwidth

-

-to set the width of the page list column.13.1 -These will need to be changed using \setlength if the glossary is too wide. Note that the long4col and super4col -styles (and their header and border variations) don’t use these lengths as they are designed for single line -entries. Instead you should use the analogous altlong4col and altsuper4col styles. If you want to explicitly create -a line-break within a multi-line description in a tabular-like style it’s better to use \newline instead of -\\. -

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 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 alttree style instead. -
-

-

Note that if you use the style key in the optional argument to \printnoidxglossary (Option 1) or -\printglossary (Options 2 and 3), it will override any previous style settings for the given glossary, so if, for -example, you do - - -

-
-\renewcommand*{\glsgroupskip}{}
-\printglossary[style=long]
-
-

then the new definition of \glsgroupskip will not have an affect for this glossary, as \glsgroupskip is -redefined by style=long. Likewise, \setglossarystyle will also override any previous style definitions, so, -again - - -

-
-\renewcommand*{\glsgroupskip}{}
-\setglossarystyle{long}
-
-

will reset \glsgroupskip back to its default definition for the named glossary style (long in this case). If you -want to modify the styles, either use \newglossarystyle (described in the next section) or make the -modifications after \setglossarystyle, e.g.: - - -

-
-\setglossarystyle{long}
-\renewcommand*{\glsgroupskip}{}
-
-

As from version 3.03, you can now use the package option nogroupskip to suppress the gap between groups for -the default styles instead of redefining \glsgroupskip. -

All the styles except for the three- and four-column styles and the listdotted style use the command -


\glspostdescription

-

-after the description. This simply displays a full stop by default. To eliminate this full stop (or replace it with -something else, say, a comma) you will need to redefine \glspostdescription before the glossary is displayed. -Alternatively, you can suppress it for a given entry by placing \nopostdesc in the entry’s description. Note that -\longnewglossaryentry puts \nopostdesc at the end of the description. The glossaries-extra package provides -a starred version that doesn’t. -

As from version 3.03 you can now use the package option nopostdot to suppress this full stop. This is the -better option if you want to use the glossaries-extra package. The glossaries-extra-stylemods package provides -some adjustments some of to the predefined styles listed here, allowing for greater flexibility. See the -glossaries-extra documentation for further details. -

-

Top

13.1.1 List Styles

-

The styles described in this section are all defined in the package glossary-list. Since they all use the description -environment, they are governed by the same parameters as that environment. These styles all ignore the entry’s -symbol. Note that these styles will automatically be available unless you use the nolist or nostyles package -options. -

Note that, except for the listdotted style, these list styles are incompatible with classicthesis. They -may also be incompatible with other classes or packages that modify the description environment. -
-

-

As from v4.48, there is an initialisation hook that provides a patch if the gettitlestring package is loaded, -since this is used by hyperref. -


\glslistinit

-

-This patch should ensure that the combination of hyperref and entercounter should correctly expand the entry -name to the aux file. The name is expanded using: -


\glslistexpandedname{label}

-

-This uses \glsunexpandedfieldvalue. If you need the name to fully expand, you can redefine this. For -example: - - -

-
-\newcommand{\glslistexpandedname}[1]{\glsentryname{#1}}
-
-

-

-

-list

-

The list style uses the description environment. The entry name is placed in the optional argument - of the \item command (so it will usually appear in bold by default). The description follows, - and then the associated number list 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 \indexspace. -

The closest matching non-list style is the index style. -

-

-listgroup

-

The listgroup style is like list but the glossary groups have headings obtained using - \glsgetgrouptitle{label}, which is described in §13.2 Defining your own - glossary style. -

-

-listhypergroup

-

The listhypergroup style is like listgroup but has a navigation line at the start of the glossary with links to - each group that is present in the glossary. This requires an additional run through LaTeX to - ensure the group information is up to date. In the navigation line, each group is separated - by -


\glshypernavsep

-

- which defaults to a vertical bar with a space on either side. For example, to simply have a space separating - each group, do: - - -

-
-     \renewcommand*{\glshypernavsep}{\space}
-
-

-

Note that the hyper-navigation line is now (as from version 1.14) set inside the optional - argument to \item instead of after it to prevent a spurious space at the start. This can cause a - problem if the navigation line is too long. As from v4.22, if you need to adjust this, you can - redefine -


\glslistnavigationitem{navigation line}

-

- The default definition is \item[navigation line] but may be redefined independently of setting the style. - For example: - - -

-
-     \renewcommand*{\glslistnavigationitem}[1]{\item \textbf{#1}}
-
-

-

You may prefer to use the tree-like styles, such as treehypergroup instead. -

-

-altlist

-

The altlist style is like list but the description starts on the line following the name. (As with the list style, - the symbol is ignored.) Each child entry starts a new line, but as with the list style, the name associated - with each child entry is ignored. -

The closest matching non-list style is the index style with the following adjustment: - - -

-
-     \renewcommand{\glstreepredesc}{%
-      \glstreeitem\parindent\hangindent}
-
-

-

-

-altlistgroup

-

The altlistgroup style is like altlist but the glossary groups have headings. -

-

-altlisthypergroup

-

The altlisthypergroup style is like altlistgroup but has a set of links to the glossary groups. The navigation - line is the same as that for listhypergroup, described above. -

-

-listdotted

-

This style uses the description environment.13.2 - Each entry starts with \item[], followed by the name followed by a dotted line, followed - by the description. Note that this style ignores both the number list and the symbol. The - length -


\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 index style with - - -

-
-     \renewcommand{\glstreepredesc}{\dotfill}
-     \renewcommand{\glstreechildpredesc}{\dotfill}
-
-

Note that this doesn’t use \glslistdottedwidth and causes the description to be flush-right and will - display the symbol, if provided. (It also doesn’t suppress the number list, but that can be achieved with - the nonumberlist option.) -

-

-sublistdotted

-

This is a variation on the listdotted style designed for hierarchical glossaries. The main entries have just - the name displayed. The sub entries are displayed in the same manner as listdotted. Unlike the listdotted - style, this style is incompatible with classicthesis.

-

-

-

Top

13.1.2 Longtable Styles

-

The styles described in this section are all defined in the package glossary-long. Since they all use the longtable -environment, they are governed by the same parameters as that environment. Note that these styles will -automatically be available unless you use the nolong or nostyles package options. These styles fully justify the -description and page list columns. If you want ragged right formatting instead, use the analogous styles -described in §13.1.3 Longtable Styles (Ragged Right). If you want to incorporate rules -from the booktabs package, try the styles described in §13.1.4 Longtable Styles -(booktabs). -

-

-long

-

The long style uses the longtable environment (defined by the longtable package). It has two columns: - the first column contains the entry’s name and the second column contains the description followed - by the number list. The entry’s symbol is ignored. Sub groups are separated with a blank row. 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 \glsdescwidth. Child entries have a similar format to the parent - entries except that their name is suppressed. -

-

-longborder

-

The longborder style is like long but has horizontal and vertical lines around it. - - -

-

-longheader

-

The longheader style is like long but has a header row. -

-

-longheaderborder

-

The longheaderborder style is like longheader but has horizontal and vertical lines around it. -

-

-long3col

-

The long3col style is like 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 number list. 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 \glsdescwidth, and the width - of the third column is governed by the length \glspagelistwidth. -

-

-long3colborder

-

The long3colborder style is like the long3col style but has horizontal and vertical lines around it. -

-

-long3colheader

-

The long3colheader style is like long3col but has a header row. -

-

-long3colheaderborder

-

The long3colheaderborder style is like long3colheader but has horizontal and vertical lines around - it. -

-

-long4col

-

The long4col style is like 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 altlong4col for multi-line descriptions. - - -

-

-long4colborder

-

The long4colborder style is like the long4col style but has horizontal and vertical lines around it. -

-

-long4colheader

-

The long4colheader style is like long4col but has a header row. -

-

-long4colheaderborder

-

The long4colheaderborder style is like long4colheader but has horizontal and vertical lines around - it. -

-

-altlong4col

-

The altlong4col style is like long4col but allows multi-line descriptions and page lists. The width - of the description column is governed by the length \glsdescwidth and the width of the page - list column is governed by the length \glspagelistwidth. The widths of the name and symbol - columns are governed by the widest entry in the given column. -

-

-altlong4colborder

-

The altlong4colborder style is like the long4colborder but allows multi-line descriptions and page - lists. -

-

-altlong4colheader

-

The altlong4colheader style is like long4colheader but allows multi-line descriptions and page lists. -

-

-altlong4colheaderborder

-

The altlong4colheaderborder style is like long4colheaderborder but allows multi-line descriptions and - page lists.

- - -

-

-

Top

13.1.3 Longtable Styles (Ragged Right)

-

The styles described in this section are all defined in the package glossary-longragged. These styles are analogous -to those defined in glossary-long but the multiline columns are left justified instead of fully justified. Since these -styles all use the longtable environment, they are governed by the same parameters as that environment. The -glossary-longragged package additionally requires the array package. Note that these styles will only be available -if you explicitly load glossary-longragged: - - -

-
-\usepackage{glossaries}
-\usepackage{glossary-longragged}
-
-

Note that you can’t set these styles using the style package option since the styles aren’t defined until after the -glossaries package has been loaded. If you want to incorporate rules from the booktabs package, try the styles -described in §13.1.4 Longtable Styles (booktabs). -

-

-longragged

-

The longragged style has two columns: the first column contains the entry’s name and the second - column contains the (left-justified) description followed by the number list. The entry’s symbol is - ignored. Sub groups are separated with a blank row. 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 - \glsdescwidth. Child entries have a similar format to the parent entries except that their name - is suppressed. -

-

-longraggedborder

-

The longraggedborder style is like longragged but has horizontal and vertical lines around it. -

-

-longraggedheader

-

The longraggedheader style is like longragged but has a header row. -

-

-longraggedheaderborder

-

The longraggedheaderborder style is like longraggedheader but has horizontal and vertical lines - around it. -

-

-longragged3col

-

The longragged3col style is like 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) number list. 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 \glsdescwidth, and the width of the third column is governed by the length - \glspagelistwidth. - - -

-

-longragged3colborder

-

The longragged3colborder style is like the longragged3col style but has horizontal and vertical lines - around it. -

-

-longragged3colheader

-

The longragged3colheader style is like longragged3col but has a header row. -

-

-longragged3colheaderborder

-

The longragged3colheaderborder style is like longragged3colheader but has horizontal and vertical - lines around it. -

-

-altlongragged4col

-

The altlongragged4col style is like 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 \glsdescwidth and the width of the page list column is governed by the length - \glspagelistwidth. The widths of the name and symbol columns are governed by the widest - entry in the given column. -

-

-altlongragged4colborder

-

The altlongragged4colborder style is like the altlongragged4col but has horizontal and vertical lines - around it. -

-

-altlongragged4colheader

-

The altlongragged4colheader style is like altlongragged4col but has a header row. -

-

-altlongragged4colheaderborder

-

The altlongragged4colheaderborder style is like altlongragged4colheader but has horizontal and - vertical lines around it. -

-
- - -

-

-

Top

13.1.4 Longtable Styles (booktabs)

-

The styles described in this section are all defined in the package glossary-longbooktabs. -

Since these styles all use the longtable environment, they are governed by the same parameters as that -environment. The glossary-longbooktabs package automatically loads the glossary-long (§13.1.2 -Longtable Styles) and glossary-longragged (§13.1.3 Longtable Styles (Ragged Right)) packages. -Note that these styles will only be available if you explicitly load glossary-longbooktabs: - - -

-
-\usepackage{glossaries}
-\usepackage{glossary-longbooktabs}
-
-

Note that you can’t set these styles using the style package option since the styles aren’t defined until after the -glossaries package has been loaded. -

These styles are similar to the “header” styles in the glossary-long and glossary-ragged packages, but they add -the rules provided by the booktabs package, \toprule, \midrule and \bottomrule. Additionally these styles -patch the 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 longtable in your document, you can scope the effect by only setting -the style through the style key in the optional argument of \printglossary. (The nogroupskip package option -is checked by these styles.) -

Alternatively, you can restore the original longtable behaviour with: -


\glsrestoreLToutput

-

-For more information about the patch, see the documented code (glossaries-code.pdf). -

-

-long-booktabs

-

This style is similar to the longheader style but adds rules above and below the header (\toprule - and \midrule) and inserts a rule at the bottom of the table (\bottomrule). -

-

-long3col-booktabs

-

This style is similar to the long3colheader style but adds rules as per long-booktabs. -

-

-long4col-booktabs

-

This style is similar to the long4colheader style but adds rules as above. -

-

-altlong4col-booktabs

-

This style is similar to the altlong4colheader style but adds rules as above. -

-

-longragged-booktabs

-

This style is similar to the longraggedheader style but adds rules as above. - - -

-

-longragged3col-booktabs

-

This style is similar to the longragged3colheader style but adds rules as above. -

-

-altlongragged4col-booktabs

-

This style is similar to the altlongragged4colheader style but adds rules as above. -

-
-

-

-

Top

13.1.5 Supertabular Styles

-

The styles described in this section are all defined in the package glossary-super. Since they all use the -supertabular environment, they are governed by the same parameters as that environment. Note that these styles -will automatically be available unless you use the nosuper or nostyles package options. In general, -the longtable environment is better, but there are some circumstances where it is better to use -supertabular.13.3 -These styles fully justify the description and page list columns. If you want ragged right formatting -instead, use the analogous styles described in §13.1.6 Supertabular Styles (Ragged -Right). -

-

-super

-

The super style uses the supertabular environment (defined by the supertabular package). It has two - columns: the first column contains the entry’s name and the second column contains the description - followed by the number list. The entry’s symbol is ignored. Sub groups are separated with a blank - row. 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 \glsdescwidth. Child entries have a similar format - to the parent entries except that their name is suppressed. -

-

-superborder

-

The superborder style is like super but has horizontal and vertical lines around it. -

-

-superheader

- - -

The superheader style is like super but has a header row. -

-

-superheaderborder

-

The superheaderborder style is like superheader but has horizontal and vertical lines around it. -

-

-super3col

-

The super3col style is like 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 number list. 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 \glsdescwidth. The width of - the third column is governed by the length \glspagelistwidth. -

-

-super3colborder

-

The super3colborder style is like the super3col style but has horizontal and vertical lines around it. -

-

-super3colheader

-

The super3colheader style is like super3col but has a header row. -

-

-super3colheaderborder

-

The super3colheaderborder style is like the super3colheader style but has horizontal and vertical lines - around it. -

-

-super4col

-

The super4col style is like 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 altsuper4col for multi-line - descriptions. -

-

-super4colborder

-

The super4colborder style is like the super4col style but has horizontal and vertical lines around it. - - -

-

-super4colheader

-

The super4colheader style is like super4col but has a header row. -

-

-super4colheaderborder

-

The super4colheaderborder style is like the super4colheader style but has horizontal and vertical lines - around it. -

-

-altsuper4col

-

The altsuper4col style is like super4col but allows multi-line descriptions and page lists. The width - of the description column is governed by the length \glsdescwidth and the width of the page list - column is governed by the length \glspagelistwidth. The width of the name and symbol columns - is governed by the widest entry in the given column. -

-

-altsuper4colborder

-

The altsuper4colborder style is like the super4colborder style but allows multi-line descriptions and - page lists. -

-

-altsuper4colheader

-

The altsuper4colheader style is like super4colheader but allows multi-line descriptions and page lists. -

-

-altsuper4colheaderborder

-

The altsuper4colheaderborder style is like super4colheaderborder but allows multi-line descriptions - and page lists.

-

-

-

Top

13.1.6 Supertabular Styles (Ragged Right)

-

The styles described in this section are all defined in the package glossary-superragged. These styles are -analogous to those defined in glossary-super but the multiline columns are left justified instead of fully justified. -Since these styles all use the supertabular environment, they are governed by the same parameters as that -environment. The glossary-superragged package additionally requires the array package. Note that these styles -will only be available if you explicitly load glossary-superragged: - - -

-
-\usepackage{glossaries}
-\usepackage{glossary-superragged}
-
-

Note that you can’t set these styles using the style package option since the styles aren’t defined until after the -glossaries package has been loaded. -

-

-superragged

-

The superragged style uses the supertabular environment (defined by the supertabular package). It - has two columns: the first column contains the entry’s name and the second column contains the - (left justified) description followed by the number list. The entry’s symbol is ignored. Sub groups - are separated with a blank row. 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 \glsdescwidth. Child - entries have a similar format to the parent entries except that their name is suppressed. -

-

-superraggedborder

-

The superraggedborder style is like superragged but has horizontal and vertical lines around it. -

-

-superraggedheader

-

The superraggedheader style is like superragged but has a header row. -

-

-superraggedheaderborder

-

The superraggedheaderborder style is like superraggedheader but has horizontal and vertical lines - around it. -

-

-superragged3col

-

The superragged3col style is like 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) number list. 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 \glsdescwidth. The width of the third column is governed by the length - \glspagelistwidth. - - -

-

-superragged3colborder

-

The superragged3colborder style is like the superragged3col style but has horizontal and vertical - lines around it. -

-

-superragged3colheader

-

The superragged3colheader style is like superragged3col but has a header row. -

-

-superragged3colheaderborder

-

The superragged3colheaderborder style is like the above but has horizontal and vertical lines around - it. -

-

-altsuperragged4col

-

The altsuperragged4col style is like 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. -

-

-altsuperragged4colborder

-

The altsuperragged4colborder style is like the altsuperragged4col style but has horizontal and vertical - lines around it. -

-

-altsuperragged4colheader

-

The altsuperragged4colheader style is like altsuperragged4col but has a header row. -

-

-altsuperragged4colheaderborder

-

The altsuperragged4colheaderborder style is like the above but has horizontal and vertical lines - around it. -

-
- - -

-

-

Top

13.1.7 Tree-Like Styles

-

The styles described in this section are all defined in the package 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 entry’s symbol if it exists. Note that these styles will automatically be available unless you use the notree or -nostyles package options. -

These styles all format the entry name using: -


\glstreenamefmt{name}

-

-This defaults to \textbf{name}, but note that ⟨name⟩ includes \glsnamefont so the bold setting in -\glstreenamefont may be counteracted by another font change in \glsnamefont (or in \acronymfont). The -tree-like styles that also display the header use -


\glstreegroupheaderfmt{text}

-

-to format the heading. This defaults to \glstreenamefmt{text}. The tree-like styles that display navigation -links to the groups (such as indexhypergroup), format the navigation line using -


\glstreenavigationfmt{text}

-

-which defaults to \glstreenamefmt{text}. -

Note that this is different from \glslistnavigationitem, provided with the styles such as listhypergroup, as -that also includes \item. -

With the exception of the alttree style (and those derived from it), the space before the description for -top-level entries is produced with -


\glstreepredesc

-

-This defaults to \space. -

With the exception of the treenoname and alttree styles (and those derived from them), the space before the -description for child entries is produced with -


\glstreechildpredesc

-

-This defaults to \space. -

Most of these styles are not designed for multi-paragraph descriptions. (The tree style isn’t too bad for -multi-paragraph top-level entry descriptions, or you can use the index style with the adjustment shown below.) -
-

-

-

-index

-

The index style is similar to the way indices are usually formatted in that it has a hierarchical - structure up to three levels (the main level plus two sub-levels). The name is typeset in bold, and 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. - - - Groups are separated using \indexspace. -

Each main level item is started with -


\glstreeitem

-

- The level 1 entries are started with -


\glstreesubitem

-

-

The level 2 entries are started with -


\glstreesubsubitem

-

-

Note that the index style automatically sets - - -

-
-     \let\item\glstreeitem
-     \let\subitem\glstreesubitem
-     \let\subsubitem\glstreesubsubitem
-
-

at the start of the glossary for backward compatibility. -

The index style isn’t suitable for multi-paragraph descriptions, but this limitation can be overcome by - redefining the above commands. For example: - - -

-
-     \renewcommand{\glstreeitem}{%
-      \parindent0pt\par\hangindent40pt
-      \everypar{\parindent50pt\hangindent40pt}}
-
-

-

-

-indexgroup

-

The indexgroup style is similar to the index style except that each group has a heading obtained using - \glsgetgrouptitle{label}, which is described in §13.2 Defining your own glossary - style. -

-

-indexhypergroup

-

The indexhypergroup style is like indexgroup but has a set of links to the glossary groups. The - navigation line is the same as that for listhypergroup, described above, but is formatted using - \glstreenavigationfmt. -

-

-tree

-

The tree style is similar to the index style except that it can have arbitrary levels. (Note that makeindex is - limited to three levels, so you will need to use xindy if you want more than three levels.) Each sub-level is - indented by \glstreeindent. 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 alttree style instead. - (See below.) -

-

-treegroup

-

The treegroup style is similar to the tree style except that each group has a heading. -

-

-treehypergroup

-

The treehypergroup style is like treegroup but has a set of links to the glossary groups. The - navigation line is the same as that for listhypergroup, described above, but is formatted using - \glstreenavigationfmt. - - -

-

-treenoname

-

The treenoname style is like the tree style except that the name for each sub-entry is ignored. -

-

-treenonamegroup

-

The treenonamegroup style is similar to the treenoname style except that each group has a - heading. -

-

-treenonamehypergroup

-

The treenonamehypergroup style is like treenonamegroup but has a set of links to the glossary groups. The - navigation line is the same as that for listhypergroup, described above, but is formatted using - \glstreenavigationfmt. -

-

-alttree

-

The alttree style is similar to the tree style except that the indentation for each level is determined by the - width of the text specified by -


\glssetwidest[level]{text}

-

- The optional argument ⟨level⟩ indicates the level, where 0 indicates the top-most level, 1 indicates the first - level sub-entries, etc. If \glssetwidest hasn’t been used for a given sub-level, the level 0 widest text is - used instead. If ⟨level⟩ is omitted, 0 is assumed. -

As from v4.22, the glossary-tree package also provides -


\glsfindwidesttoplevelname[glossary list]

-

- This iterates over all parentless entries in the given glossary lists and determines the widest entry. If the - optional argument is omitted, all glossaries are assumed (as per \forallglossaries). -

For example, to have the same name width for all glossaries: - - -

-
-     \glsfindwidesttoplevelname
-     \setglossarystyle{alttree}
-     \printglossaries
-
-

Alternatively, to compute the widest entry for each glossary before it’s displayed: - - -

-
-     \renewcommand{\glossarypreamble}{%
-       \glsfindwidesttoplevelname[\currentglossary]}
-     \setglossarystyle{alttree}
-     \printglossaries
-
-

-

These commands only affects the alttree styles, including those listed below and the ones in the - glossary-mcols package. If you forget to set the widest entry name, the description will overwrite the name. -
-

-

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 \makebox. As from v4.19, this can now be adjusted by - redefining -


\glstreenamebox{width}{text}

-

- where ⟨width⟩ is the width of the box and ⟨text⟩ is the contents of the box. For example, to make the name - right-aligned: - - -

-
-     \renewcommand*{\glstreenamebox}[2]{%
-       \makebox[#1][r]{#2}%
-     }
-
-

-

-

-alttreegroup

-

The alttreegroup is like the alttree style except that each group has a heading. -

-

-alttreehypergroup

-

The alttreehypergroup style is like alttreegroup but has a set of links to the glossary groups. The navigation - line is the same as that for listhypergroup, described above. -

-
-

-

-

Top

13.1.8 Multicols Style

-

The glossary-mcols package provides tree-like styles that are in the multicols environment (defined by the multicol -package). The style names are as their analogous tree styles (as defined in §13.1.7 Tree-Like Styles) but -are prefixed with “mcol”. For example, the mcolindex style is essentially the index style but put in a multicols -environment. For the complete list, see table 13.2. The glossary-tree package is automatically loaded by -glossary-mcols (even if the notree package option is used when loading glossaries). The formatting commands -\glstreenamefmt, \glstreegroupheaderfmt and \glstreenavigationfmt are all used by the corresponding -glossary-mcols styles. -

Note that glossary-mcols is not loaded by glossaries. If you want to use any of the multicol styles in that -package you need to load it explicitly with \usepackage and set the required glossary style using -\setglossarystyle.
-

-

The default number of columns is 2, but can be changed by redefining -


\glsmcols

-

-to the required number. For example, for a three column glossary: - - -

-
-\usepackage{glossary-mcols}
-\renewcommand*{\glsmcols}{3}
-\setglossarystyle{mcolindex}
-
-

-

-
- - -


- - -
Table 13.2: Multicolumn Styles
-
This contains the entries that were defined with type={notation}. For example:
@entry{not:set,
+  name={$\mathcal{S}$},
+  description={A set},
+  text={\mathcal{S}}
+}
+
You may prefer to replace @entry with @symbol in this file. -> - - - - - - - - - -
glossary-mcols Style Analogous Tree Style
mcolindex index
mcolindexgroup indexgroup
mcolindexhypergroup or mcolindexspannav indexhypergroup
mcoltree tree
mcoltreegroup treegroup
mcoltreehypergroup or mcoltreespannav treehypergroup
mcoltreenoname treenoname
mcoltreenonamegroup treenonamegroup
mcoltreenonamehypergroup or mcoltreenonamespannav treenonamehypergroup
mcolalttree alttree
mcolalttreegroup alttreegroup
mcolalttreehypergroup or mcolalttreespannav alttreehypergroup
- - -

-
-

The styles with a navigation line, such as mcoltreehypergroup, now have a variant (as from -v4.22) with “hypergroup” replaced with “spannav” in the style name. The original “hypergroup” -styles place the navigation line at the start of the first column. The newer “spannav” styles put the -navigation line in the optional argument of the multicols environment so that it spans across all the -columns. -

-

Top

13.1.9 In-Line Style

-

This section covers the glossary-inline package that supplies the inline style. This is a style that is designed for -in-line use (as opposed to block styles, such as lists or tables). This style doesn’t display the number -list. -

You will most likely need to redefine \glossarysection with this style. For example, suppose you are -required to have your glossaries and list of acronyms in a footnote, you can do: - - -

-
- \usepackage{glossary-inline}
- \renewcommand*{\glossarysection}[2][]{\textbf{#1}: }
- \setglossarystyle{inline}
-
-

-

Note that you need to include glossary-inline with \usepackage as it’s not automatically included by the -glossaries package and then set the style using \setglossarystyle.
-

-

Where you need to include your glossaries as a footnote you can do: - - -

-
-\footnote{\printglossaries}
-
-

-

The inline style is governed by the following: -


\glsinlineseparator

-

-This defaults to “; ” and is used between main (i.e. level 0) entries. -


\glsinlinesubseparator

-

-This defaults to “, ” and is used between sub-entries. -


\glsinlineparentchildseparator

-

-This defaults to “: ” and is used between a parent main entry and its first sub-entry. -


\glspostinline

-

-This defaults to “; ” and is used at the end of the glossary. -


\glsinlinenameformat{label}{name}

-

-This is used to format the entry name and defaults to \glstarget{label}{name}, where ⟨name⟩ is provided in -the form \glossentryname{label} and ⟨label⟩ is the entry’s label. For example, if you want the name to appear in -small caps: - - -

-
-\renewcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{\textsc{#2}}}
-
-

Sub-entry names are formatted according to -


\glsinlinesubnameformat{label}{name}

-

-This defaults to \glstarget{label}{} so the sub-entry name is ignored. -

If the description has been suppressed (according to \ifglsdescsuppressed) then -


\glsinlineemptydescformat{symbol}{number list}

-

-(which defaults to nothing) is used, otherwise the description is formatted according to -


\glsinlinedescformat{description}{symbol}{number list}

-

-This defaults to just \spacedescription⟩ so the symbol and location list are ignored. If the description is missing -(according to \ifglshasdesc), then \glsinlineemptydescformat is used instead. -

For example, if you want a colon between the name and the description: - - -

-
-\renewcommand*{\glsinlinedescformat}[3]{: #1}
-
-

-

The sub-entry description is formatted according to: -


\glsinlinesubdescformat{description}{symbol}{number list}

-

-This defaults to just ⟨description⟩. -

-

-

Top

13.2 Defining your own glossary style

-

Commands like \printglossary are designed to produce content in the 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 indexing information (such as locations) then a -much better approach is to use bib2gls, which automatically stores this information in dedicated fields when -the entry is defined.
-

-

If the predefined styles don’t fit your requirements, you can define your own style using: -


\newglossarystyle{name}{definitions}

-

-where ⟨name⟩ is the name of the new glossary style (to be used in \setglossarystyle). The second argument -⟨definitions⟩ needs to redefine all of the following: -


theglossary

-

-This environment defines how the main body of the glossary should be typeset. -

Note that this does not include the section heading, the glossary preamble (defined by \glossarypreamble) -or the glossary postamble (defined by \glossarypostamble). For example, the list style uses the description -environment, so the theglossary environment is simply redefined to begin and end the description -environment. -


\glossaryheader

-

-This macro indicates what to do at the start of the main body of the glossary. Note that this is not the same as -\glossarypreamble, which should not be affected by changes in the glossary style. The list glossary style -redefines \glossaryheader to do nothing, whereas the longheader glossary style redefines \glossaryheader to -do a header row. -


\glsgroupheading{label}

-

-This macro indicates what to do at the start of each logical block within the main body of the glossary. If you -use makeindex the glossary is sub-divided into a maximum of twenty-eight logical blocks that are determined by - - -the first character of the sort key (or name key if the sort key is omitted). The sub-divisions are in the -following order: symbols, numbers, A, …, Z. If you use xindy, the sub-divisions depend on the language -settings. -

Note that the argument to \glsgroupheading is a label not the group title. The group title can be obtained -via -


\glsgetgrouptitle{label}

-

-This obtains the title as follows: if ⟨label⟩ consists of a single non-active character or ⟨label⟩ is equal to glssymbols -or glsnumbers and \labelgroupname exists, this is taken to be the title, otherwise the title is just ⟨label⟩. -(The “symbols” group has the label glssymbols, so the command \glssymbolsgroupname is used, -and the “numbers” group has the label glsnumbers, so the command \glsnumbersgrouptitle is -used.) If you are using xindy, ⟨label⟩ may be an active character (for example ø), in which case the -title will be set to just ⟨label⟩. You can redefine \glsgetgrouptitle if this is unsuitable for your -document. -

A navigation hypertarget can be created using -


\glsnavhypertarget{label}{text}

-

-This typically requires \glossaryheader to be redefined to use -


\glsnavigation

-

-which displays the navigation line. -

For further details about \glsnavhypertarget, see the documented code (glossaries-code.pdf). -

Most of the predefined glossary styles redefine \glsgroupheading to simply ignore its argument. The -listhypergroup style redefines \glsgroupheading as follows: - - -

-
-\renewcommand*{\glsgroupheading}[1]{%
-\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}
-
-

See also \glsgroupskip below. -

Note that command definitions within \newglossarystyle must use ##1 instead of #1 etc. -


\glsgroupskip

-

-This macro determines what to do after one logical group but before the header for the next logical group. The -list glossary style simply redefines \glsgroupskip to be \indexspace, whereas the tabular-like styles redefine -\glsgroupskip to produce a blank row. -

As from version 3.03, the package option nogroupskip can be used to suppress this default gap for the -predefined styles. -


\glossentry{label}{number list}

-

-This macro indicates what to do for each top-level (level 0) glossary entry. The entry label is given by ⟨label⟩ and -the associated number list is given by ⟨number list⟩. You can redefine \glossentry to use commands like -\glossentryname{label}, \glossentrydesc{label} and \glossentrysymbol{label} to display the name, -description and symbol fields, or to access other fields, use commands like \glsentryuseri{label}. (See -§5.2 Using Glossary Terms Without Links for further details.) You can also use the following -commands: -


\glsentryitem{label}

-

-This macro will increment and display the associated counter for the main (level 0) entries if the entrycounter or -counterwithin package options have been used. This macro is typically called by \glossentry before -\glstarget. The format of the counter is controlled by the macro -


\glsentrycounterlabel

-

-

Each time you use a glossary entry it creates a hyperlink (if hyperlinks are enabled) to the relevant line in -the glossary. Your new glossary style must therefore redefine \glossentry to set the appropriate target. This is -done using -


\glstarget{label}{text}

-

-where ⟨label⟩ is the entry’s label. Note that you don’t need to worry about whether the hyperref package has been -loaded, as \glstarget won’t create a target if \hypertarget hasn’t been defined. -

For example, the list style defines \glossentry as follows: - - -

-
-  \renewcommand*{\glossentry}[2]{%
-    \item[\glsentryitem{##1}%
-          \glstarget{##1}{\glossentryname{##1}}]
-       \glossentrydesc{##1}\glspostdescription\space ##2}
-
-

-

Note also that ⟨number list⟩ will always be of the form -


\glossaryentrynumbers{\relax
\setentrycounter[Hprefix]{counter name}format cmd{number(s)}}

-

-where ⟨number(s)⟩ may contain \delimN (to delimit individual numbers) and/or \delimR (to indicate a range of -numbers). There may be multiple occurrences of \setentrycounter[Hprefix]{counter name}format cmd⟩ -{number(s)}, but note that the entire number list is enclosed within the argument of \glossaryentrynumbers. -The user can redefine this to change the way the entire number list is formatted, regardless of the glossary style. -However the most common use of \glossaryentrynumbers is to provide a means of suppressing the number list -altogether. (In fact, the nonumberlist option redefines \glossaryentrynumbers to ignore its argument.) -Therefore, when you define a new glossary style, you don’t need to worry about whether the user has specified -the nonumberlist package option. -


\subglossentry{level}{label}{number list}

-

-This is used to display sub-entries. The first argument, ⟨level⟩, indicates the sub-entry level. This must be an -integer from 1 (first sub-level) onwards. The remaining arguments are analogous to those for \glossentry -described above. -


\glssubentryitem{label}

-

-This macro will increment and display the associated counter for the level 1 entries if the subentrycounter -package option has been used. This macro is typically called by \subglossentry before \glstarget. The -format of the counter is controlled by the macro -


\glssubentrycounterlabel

-

-

Note that \printglossary (which \printglossaries calls) sets -


\currentglossary

-

-to the current glossary label, so it’s possible to create a glossary style that varies according to the glossary -type. -

For further details of these commands, see “Displaying the glossary” in the documented code -(glossaries-code.pdf). - -

Example 23 (Creating a completely new style) -

If you want a completely new style, you will need to redefine all of the commands and the environment listed - - -above. -

For example, suppose you want each entry to start with a bullet point. This means that the glossary should -be placed in the itemize environment, so theglossary should start and end that environment. Let’s also suppose -that you don’t want anything between the glossary groups (so \glsgroupheading and \glsgroupskip should -do nothing) and suppose you don’t want anything to appear immediately after \begin{theglossary} (so -\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 number list should appear within -square brackets at the end. Then you can create this new glossary style, called, say, mylist, as -follows: - - -

-
- \newglossarystyle{mylist}{%
- % put the glossary in the itemize environment:
- \renewenvironment{theglossary}%
-   {\begin{itemize}}{\end{itemize}}%
- % have nothing after \begin{theglossary}:
- \renewcommand*{\glossaryheader}{}%
- % have nothing between glossary groups:
- \renewcommand*{\glsgroupheading}[1]{}%
- \renewcommand*{\glsgroupskip}{}%
- % set how each entry should appear:
- \renewcommand*{\glossentry}[2]{%
- \item % bullet point
- \glstarget{##1}{\glossentryname{##1}}% the entry name
- \space (\glossentrysymbol{##1})% the symbol in brackets
- \space \glossentrydesc{##1}% the description
- \space [##2]% the number list in square brackets
- }%
- % set how sub-entries appear:
- \renewcommand*{\subglossentry}[3]{%
-   \glossentry{##2}{##3}}%
- }
-
-

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 \glsentryitem or \glssubentryitem so it won’t be affected by the -entrycounter, counterwithin or subentrycounter package options. -

Variations:

-
    -
  • -

    You might want the entry name to be capitalised, in which case use \Glossentryname instead of - \glossentryname. -

  • -
  • -

    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 \ifglshassymbol (see §15 Utilities): - - -

    -
    -      \renewcommand*{\glossentry}[2]{%
    -      \item % bullet point
    -      \glstarget{##1}{\glossentryname{##1}}% the entry name
    -      \ifglshassymbol{##1}% check if symbol exists
    -      {%
    -        \space (\glossentrysymbol{##1})% the symbol in brackets
    -      }%
    -      {}% no symbol so do nothing
    -      \space \glossentrydesc{##1}% the description
    -      \space [##2]% the number list in square brackets
    -      }%
    -
    -

-
-

-

____________________________

- -

Example 24 (Creating a new glossary style based on an existing style) -

If you want to define a new style that is a slightly modified version of an existing style, you can use -\setglossarystyle within the second argument of \newglossarystyle followed by whatever alterations you -require. For example, suppose you want a style like the list style but you don’t want the extra vertical space -created by \indexspace between groups, then you can create a new glossary style called, say, mylist as -follows: - - -

-
-\newglossarystyle{mylist}{%
-\setglossarystyle{list}% base this style on the list style
-\renewcommand{\glsgroupskip}{}% make nothing happen
-                              % between groups
+
+ After the definition of the notation glossary (\newglossary), add: 
% abbreviation style must be set first:
+\setabbreviationstyle[acronym]{long-short}
+\GlsXtrLoadResources[src={entries,abbreviations}]
+\GlsXtrLoadResources[src={notation},% notation.bib
+ type=notation,sort=unsrt]
+
Delete the remainder of the document preamble(\makeglossaries and entry definitions).

+Finally, replace the lines that display the glossaries with:

\printunsrtglossaries
+
The build process is now:
pdflatex sampleSort
+bib2gls sampleSort
+pdflatex sampleSort
+

+In this case, I have one resource command that processes two glossaries (main and acronym) at the same time. The entries in these glossaries are ordered alphabetically. The second resource command processes the notation glossary but the entries in this glossary aren’t sorted (and so will appear in the order of definition within the bib file).

+See also sampleNtn.tex, bib2gls gallery: sorting and the bib2gls user manual for more examples.

+ + + +

+

18.6. Child Entries

+

+

🗋📥 sample.tex
+ This document illustrates some of the basics, including how to create child entries that use the same name as the parent entry. This example adds the glossary to the table of contents and it also uses \glsrefentry, so an extra LaTeX run is required:
pdflatex sample
+makeglossaries sample
+pdflatex sample
+pdflatex sample
+
You can see the difference between word and letter ordering if you add the package option order=letter. (Note that this will only have an effect if you use makeglossaries or makeglossaries-lite. If you use makeindex explicitly, you will need to use the -l switch to indicate letter ordering.)

+One of the entries has its name encapsulated with a semantic command:

\newcommand{\scriptlang}[1]{\textsf{#1}}
+
+\newglossaryentry{Perl}{name={\scriptlang{Perl}},sort={Perl},
+description={A scripting language}}
+
This means that this entry needs to have the sort key set otherwise makeindex will assign it to the “symbol” group, since it starts with a backslash (which makeindex simply treats as punctuation).

+The homograph entries “glossary” and “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 nopostdot=false setting this will lead to a spurious dot. This can be removed by adding \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 sort key:

\newglossaryentry{glossary}{name={glossary},
+ description={\nopostdesc},plural={glossaries}}
+
+\newglossaryentry{glossarycol}{
+ description={collection of glosses},
+ sort={2},
+ parent={glossary}% parent label
+}
+
+\newglossaryentry{glossarylist}{
+ description={list of technical words},
+ sort={1},
+ parent={glossary}% parent label
 }
-
-

(In this case, you can actually achieve the same effect using the list style in combination with the package -option nogroupskip.)

-
-

-

____________________________

- -

Example 25 (Example: creating a glossary style that uses the user1, …, user6 -keys) -

Suppose each entry not only has an associated symbol, but also units (stored in user1) and dimension -(stored in user2). Then you can define a glossary style that displays each entry in a longtable as -follows: - - -

-
-\newglossarystyle{long6col}{%
- % put the glossary in a longtable environment:
- \renewenvironment{theglossary}%
-  {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%
-  {\end{longtable}}%
- % Set the table's header:
- \renewcommand*{\glossaryheader}{%
-  \bfseries Term & \bfseries Description & \bfseries Symbol &
-  \bfseries Units & \bfseries Dimensions & \bfseries Page List
-  \\\endhead}%
- % No heading between groups:
-  \renewcommand*{\glsgroupheading}[1]{}%
- % Main (level 0) entries displayed in a row optionally numbered:
-  \renewcommand*{\glossentry}[2]{%
-    \glsentryitem{##1}% Entry number if required
-    \glstarget{##1}{\glossentryname{##1}}% Name
-    & \glossentrydesc{##1}% Description
-    & \glossentrysymbol{##1}% Symbol
-    & \glsentryuseri{##1}% Units
-    & \glsentryuserii{##1}% Dimensions
-    & ##2% Page list
-    \tabularnewline % end of row
-  }%
- % Similarly for sub-entries (no sub-entry numbers):
- \renewcommand*{\subglossentry}[3]{%
-    % ignoring first argument (sub-level)
-    \glstarget{##2}{\glossentryname{##2}}% Name
-    & \glossentrydesc{##2}% Description
-    & \glossentrysymbol{##2}% Symbol
-    & \glsentryuseri{##2}% Units
-    & \glsentryuserii{##2}% Dimensions
-    & ##3% Page list
-    \tabularnewline % end of row
-  }%
- % Nothing between groups:
- \renewcommand*{\glsgroupskip}{}%
+
(Remember that the entries are sorted hierarchically.) This will place “glossarylist” before “glossarycol”, but both will come immediately after their parent “glossary” entry.

+

+If you switch to using glossaries-extra, remember that the default package options are different:
\usepackage[postdot,stylemods,style=treenonamegroup,order=word,
+  subentrycounter]{glossaries-extra}
+

+You may now want to consider replacing \nopostdesc in the descriptions with \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:

\newglossaryentry{cow}{name={cow},
+  plural={cows},% not required as this is the default
+  user1={kine},
+  description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult female of any bovine animal} 
 }
-
-

-
-

-

____________________________

- - -

-

Top

14. Xindy (Option 3)

-

If you want to use xindy to sort the glossary, you must use the package option xindy: - - -

-
-\usepackage[xindy]{glossaries}
-
-

This ensures that the glossary information is written in xindy syntax. -

§1.5 Generating the Associated Glossary Files covers how to use the external indexing -application, and §12.2 Locations covers the issues involved in the location syntax. This section -covers the commands provided by the glossaries package that allow you to adjust the xindy style file (xdy) and -parameters. -

To assist writing information to the xindy style file, the glossaries package provides the following -commands: -


\glsopenbrace

-

-


\glsclosebrace

-

-which produce an open and closing brace. (This is needed because \{ and \} don’t expand to a simple brace -character when written to a file.) Similarly, you can write a percent character using: -


\glspercentchar

-

-and a tilde character using: -


\glstildechar

-

-For example, a newline character is specified in a xindy style file using ~n so you can use \glstildechar n to -write this correctly (or you can do \string~n). A backslash can be written to a file using -


\glsbackslash

-

-

In addition, if you are using a package that makes the double quote character active (e.g. ngerman) you can -use: -


\glsquote{text}

-

-which will produce "text". Alternatively, you can use \string" to write the double-quote character. This -document assumes that the double quote character has not been made active, so the examples just use " for -clarity. -

If you want greater control over the xindy style file than is available through the LaTeX commands -provided by the glossaries package, you will need to edit the xindy style file. In which case, you must use -\noist to prevent the style file from being overwritten by the glossaries package. For additional -information about xindy, read the xindy documentation. I’m sorry I can’t provide any assistance -with writing xindy style files. If you need help, I recommend you ask on the xindy mailing list -(http://xindy.sourceforge.net/mailing-list.html). -

- - -

Top

14.1 Language and Encodings

-

When you use xindy, you need to specify the language and encoding used (unless you have written your own -custom xindy style file that defines the relevant alphabet and sort rules). If you use makeglossaries, -this information is obtained from the document’s auxiliary (aux) file. The makeglossaries script -attempts to find the root language given your document settings, but in the event that it gets -it wrong or if xindy doesn’t support that language, then you can specify the required language -using: -


\GlsSetXdyLanguage[glossary type]{language}

-

-where ⟨language⟩ is the name of the language. The optional argument can be used if you have multiple glossaries -in different languages. If ⟨glossary type⟩ is omitted, it will be applied to all glossaries, otherwise the language -setting will only be applied to the glossary given by ⟨glossary type⟩. -

If the inputenc package is used, the encoding will be obtained from the value of \inputencodingname. -Alternatively, you can specify the encoding using: -


\GlsSetXdyCodePage{code}

-

-where ⟨code⟩ is the name of the encoding. For example: - - -

-
-\GlsSetXdyCodePage{utf8}
-
-

-

Note that you can also specify the language and encoding using the package option -xindy={language=lang,codepage=code}. For example: - - -

-
-\usepackage[xindy={language=english,codepage=utf8}]{glossaries}
-
-

-

If you write your own custom xindy style file that includes the language settings, you need to set the -language to nothing: - - -

-
-\GlsSetXdyLanguage{}
-
-

(and remember to use \noist to prevent the style file from being overwritten). -

The commands \GlsSetXdyLanguage and \GlsSetXdyCodePage have no effect if you don’t use -makeglossaries. If you call xindy without makeglossaries you need to remember to set the language and -encoding using the -L and -C switches.
-

-

-

-

Top

14.2 Locations and Number lists

-

If you use xindy, the glossaries package needs to know which counters you will be using in the number list in -order to correctly format the xindy style file. Counters specified using the counter package option or the ⟨counter⟩ -option of \newglossary are automatically taken care of, but if you plan to use a different counter in the -counter key for commands like \glslink, then you need to identify these counters before \makeglossaries -using: -


\GlsAddXdyCounters{counter list}

-

-where ⟨counter list⟩ is a comma-separated list of counter names. -

The most likely attributes used in the format key (textrm, hyperrm etc) are automatically added to the -xindy style file, but if you want to use another attribute, you need to add it using: -


\GlsAddXdyAttribute{name}

-

-where ⟨name⟩ is the name of the attribute, as used in the format key. -

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 attributes are listed. Consider defining semantic commands -to use for primary references. For example: - - -

-
-\newcommand*{\primary}[1]{\textbf{#1}}
-\GlsAddXdyAttribute{primary}
-
-

Then in the document: - - -

-
-A \gls[format=primary]{duck} is an aquatic bird.
-There are lots of different types of \gls{duck}.
-
-

This will give the format=primary instance preference over the next use that doesn’t use the format -key. - -

Example 26 (Custom Font for Displaying a Location) -

Suppose I want a bold, italic, hyperlinked location. I first need to define a command that will do -this: - - -

-
-\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}
-
-

but with xindy, I also need to add this as an allowed attribute: - - -

-
-\GlsAddXdyAttribute{hyperbfit}
-
-

Now I can use it in the optional argument of commands like \gls: - - -

-
-Here is a \gls[format=hyperbfit]{sample} entry.
-
-

(where sample is the label of the required entry).

-
-

-

____________________________

-

Note that \GlsAddXdyAttribute has no effect if \noist is used or if \makeglossaries is omitted. -\GlsAddXdyAttribute must be used before \makeglossaries. Additionally, \GlsAddXdyCounters must come -before \GlsAddXdyAttribute.
-

-

If the location numbers include formatting commands, then you need to add a location style in the -appropriate format using -


\GlsAddXdyLocation[prefix-location]{name}{definition}

-

-where ⟨name⟩ is the name of the format and ⟨definition⟩ is the xindy definition. The optional argument -⟨prefix-location⟩ is needed if \theHcounter⟩ either isn’t defined or is different from \thecounter⟩. Be sure to also -read §12.2 Locations for some issues that you may encounter. -

Note that \GlsAddXdyLocation has no effect if \noist is used or if \makeglossaries is omitted. -\GlsAddXdyLocation must be used before \makeglossaries.
-

- -

Example 27 (Custom Numbering System for Locations) -

Suppose I decide to use a somewhat eccentric numbering system for sections where I redefine \thesection -as follows: - - -

-
-\renewcommand*{\thesection}{[\thechapter]\arabic{section}}
-
-

If I haven’t done counter=section in the package option, I need to specify that the counter will be used as a -location number: - - -

-
-\GlsAddXdyCounters{section}
-
-

Next I need to add the location style (\thechapter is assumed to be the standard \arabic{chapter}): - - -

-
-\GlsAddXdyLocation{section}{:sep "[" "arabic-numbers" :sep "]"
-  "arabic-numbers"
+
which has the parenthetical material at the start of the description with emphasis,
\newglossaryentry{bravocry}{
+  description={cry of approval (pl.\ bravos)},
+  sort={1},
+  parent={bravo}
 }
-
-

Note that if I have further decided to use the hyperref package and want to redefine \theHsection -as: - - -

-
-\renewcommand*{\theHsection}{\thepart.\thesection}
-\renewcommand*{\thepart}{\Roman{part}}
-
-

then I need to modify the \GlsAddXdyLocation code above to: - - -

-
-\GlsAddXdyLocation["roman-numbers-uppercase"]{section}{:sep "["
-  "arabic-numbers" :sep "]" "arabic-numbers"
+
which has the parenthetical material at the end of the description without emphasis even though it’s a regular plural,
\newglossaryentry{bravoruffian}{
+  description={hired ruffian or killer (pl.\ bravoes)},
+  sort={2},
+  plural={bravoes},
+  parent={bravo}}
+
which has the parenthetical material at the end of the description without emphasis, and
\newglossaryentry{glossary}{name={glossary},
+  description={\nopostdesc},
+  plural={glossaries}}
+
which doesn’t show the plural in the description.

+With glossaries-extra, you can remove this parenthetical material and implement it using the category post-description hook instead. For example, the above definitions become:

\newglossaryentry{cow}{name={cow},
+  user1={kine},
+  description={an adult female of any bovine animal} 
 }
-
-

Since \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: - - -

-
-\GlsAddXdyLocation{zero.section}{:sep "["
-  "arabic-numbers" :sep "]" "arabic-numbers"
+
+\newglossaryentry{bravocry}{
+  description={cry of approval},
+  sort={1},
+  parent={bravo}
+}
+
+\newglossaryentry{bravoruffian}{
+  description={hired ruffian or killer},
+  sort={2},
+  plural={bravoes},
+  parent={bravo}}
+
+\newglossaryentry{glossary}{name={glossary},
+  description={\glsxtrnopostpunc},
+  plural={glossaries}}
+
The post-description hook for the general category can now be set:
\glsdefpostdesc{general}{% 
+% Has the user1 key been set?
+  \glsxtrifhasfield{useri}{\glscurrententrylabel}% 
+  {\space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel},
+    \emph{archaic} \glscurrentfieldvalue)% 
+  }% 
+  {% 
+% The user1 key hasn't been set. Is the plural the same as the
+% singular form with the plural suffix appended?
+    \GlsXtrIfXpFieldEqXpStr{plural}{\glscurrententrylabel}% 
+    {\glsentrytext{\glscurrententrylabel}\glspluralsuffix}% 
+    {% 
+% Sibling check with bib2gls (see below)
+    }% 
+    {% 
+% The plural isn't the default. Does this entry have a parent?
+      \ifglshasparent{\glscurrententrylabel}      {% 
+% This entry has a parent.
+% Are the plurals for the child and parent the same?
+        \GlsXtrIfXpFieldEqXpStr{plural}{\glscurrententrylabel}% 
+        {\glsentryplural{\glsentryparent{\glscurrententrylabel}}}% 
+        {}% child and parent plurals the same
+        {% 
+          \space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})% 
+        }% 
+      }      {\space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})}% 
+    }% 
+  }% 
 }
-
-

This example is illustrated in the sample file samplexdy2.tex.

-
-

-

____________________________

- -

Example 28 (Locations as Dice) -

Suppose I want a rather eccentric page numbering system that’s represented by the number of dots on dice. -The stix package provides \dicei, …, \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 \dicen⟩ -command is used otherwise it does \dicevi the required number of times with the leftover in a final -\dicen⟩. For example, the number 16 is represented by \dicevi\dicevi\diceiv (6 + 6 + 4 = 16). -I’ve called this command \tallynum to match the example given earlier in §12.2 -Locations: - - -

-
-\newrobustcmd{\tallynum}[1]{%
- \ifnum\number#1<7
-  $\csname dice\romannumeral#1\endcsname$%
- \else
-  $\dicevi$%
-  \expandafter\tallynum\expandafter{\numexpr#1-6}%
- \fi
+
(If you try this example out, notice the difference for the “glossary” entry if you use \nopostdesc and then replace it with \glsxtrnopostpunc.) See the glossaries-extra user manual for further details and also glossaries-extra and bib2gls: An Introductory Guide.

+The “bravo” homographs are an oddity where the singular form is identical but the plural is different (“bravos” and “bravoes”). In the original, both descriptions included the plural term. The above modifications drop the display of the regular “bravos” plural (for the “bravocry” term) and only show the “bravoes” plural (for the “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 \glsentryparent) it’s much harder to access entry’s children or siblings. The \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 bib2gls, it’s possible to save this information with the save-child-count and save-sibling-count, which not only save the total but also save the child or sibling labels in an 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:

% Sibling check with bib2gls (see below)
+
indicates where to put the extra code. If you switch to bib2gls and make sure to use save-sibling-count then you can insert the following code in the block above where that comment is:
\GlsXtrIfFieldNonZero{siblingcount}{\glscurrententrylabel}%
+{% siblingcount field value non-zero
+ \glsxtrfieldforlistloop % iterate over internal list
+ {\glscurrententrylabel} % entry label
+ {siblinglist} % label of field containing list
+ {\siblinghandler} % loop handler
+}% 
+{}% siblingcount field value 0 or empty or missing
+
This uses a custom handler that’s defined as follows:
\newcommand{\siblinghandler}[1]{% 
+  \GlsXtrIfXpFieldEqXpStr*{plural}{\glscurrententrylabel}% 
+  {\glsentryplural{#1}}% 
+  {}% current entry's plural same as sibling's plural
+  {% 
+    \space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})% 
+    \listbreak
+  }% 
 }
-
-

Here’s the counter command: - - -

-
-newcommand{\tally}[1]{\tallynum{\arabic{#1}}}
-
-

The page counter representation (\thepage) needs to be changed to use this command: - - -

-
-\renewcommand*{\thepage}{\tally{page}}
-
-

The \tally command expands to \tallynum {number} so this needs a location class that matches this -format: - - -

-
-\GlsAddXdyLocation{tally}{%
- :sep "\string\tallynum\space\glsopenbrace"
- "arabic-numbers"
- :sep "\glsclosebrace"
+
The \listbreak command is provided by etoolbox and is used for prematurely exiting a loop. The handler tests if the sibling’s plural field is identical to the current entry’s 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 “bravoes” instead of the default “bravos”. In that case, the parent entry would show the plural but the “bravoruffian” child entry wouldn’t show the plural (since this case would led to the empty code block identified with the comment “child and parent plurals the same”). The “bravoes” plural form would instead be shown for the parent, which wouldn’t look right.

+If you don’t use bib2gls or if you use it without the save-sibling-count resource option then the sibling information won’t be available.

+

+In order to switch to using bib2gls, it’s first necessary to switch to using glossaries-extra (as above). Remember that the record option is required:
\usepackage[record,postdot,stylemods,style=treenonamegroup,
+subentrycounter]{glossaries-extra}
+
Next the entry definitions need to be converted to the bib format required by bib2gls. This can be done with convertgls2bib:
convertgls2bib --preamble-only sample.tex entries.
+
The semantic command may be moved to the bib file’s preamble to ensure it’s defined:
@preamble{"\providecommand{\scriptlang}[1]{\textsf{#1}}"}
+

+The sort field typically shouldn’t be set when using bib2gls, so convertgls2bib strips it. If the sort field is missing, bib2gls will obtain it from the sort fallback for that entry type. In this case, @entry has the name field as the sort fallback. If this is also missing then its value is obtained from the parent’s name field (see bib2gls gallery: sorting for other examples).

+Therefore the “Perl” entry is simply defined as:

@entry{Perl,
+  name={\scriptlang{Perl}},
+  description={A scripting language}
 }
-
-

The space between \tallynum and {number} is significant to xindy so \space is required. -

Note that \GlsAddXdyLocation{name}{definition} will define commands in the form: -


\glsXcounterXname{Hprefix}{location}

-

-for each counter that has been identified either by the counter package option, the ⟨counter⟩ option for -\newglossary or in the argument of \GlsAddXdyCounters. The first argument ⟨Hprefix⟩ is only relevant when -used with the hyperref package and indicates that \theHcounter⟩ is given by \Hprefix.\thecounter⟩. -

The sample file samplexdy.tex, which comes with the glossaries package, uses the default page counter for -locations, and it uses the default \glsnumberformat and a custom \hyperbfit format. A new xindy location -called 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 \glsXcounterXformat⟩ -commands: - - -

-
-\renewcommand{\glsXpageXglsnumberformat}[2]{%
- \linkpagenumber#2%
+
This isn’t a problem for bib2gls. In this case, the command has been provided in the @preamble, but bib2gls strips font information so the sort value becomes “Perl”. If the definition isn’t placed in @preamble then bib2gls will simply ignore the command (as xindy does) so the sort value will still end up as “Perl”.

+The homograph entries have also had their sort fields omitted:

@entry{glossarycol,
+  parent={glossary},
+  description={collection of glosses}
+}
+
+@entry{glossarylist,
+  parent={glossary},
+  description={list of technical words}
+}
+

+This means that the sort value for both these child entries is “glossary”. When bib2gls encounters identical sort values it acts according to its identical-sort-action setting. The default action is to sort by the label using a simple string comparison. In this case, it would put “glossarycol” before “glossarylist”. In the original document, the sort value was manually chosen to ensure that the entries are ordered according to first use. This ordering can easily be obtained by changing bib2gls’s identical sort action (requires at least bib2gls v2.0):

\GlsXtrLoadResources[src={entries},identical-sort-action=use]
+
This command should replace \makeglossaries. If you want the sibling information (see earlier), then you need to remember to add 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 “glossarycol” is used first, then the ordering will be updated accordingly, but with the original example, the sort keys would need to be manually changed.

+The remainder of the document preamble(that is, the definition of \scriptlang and all the entry definitions) should now be removed.

+Finally, replace \printglossaries with \printunsrtglossaries. The document build is now:

pdflatex sample
+bib2gls --group sample
+pdflatex sample
+pdflatex sample
+
Note use of the --group (or -g) switch, which is needed to support the treenonamegroup style. The third LaTeX call is needed because the document contains \glsrefentry.

+Note that you can’t use the order=letter package option with bib2gls. Instead use the break-at=none resource option:

\GlsXtrLoadResources[src={entries},identical-sort-action=use,
+  break-at=none
+]
+

+

🗋📥 sample-inline.tex
+ This document is like sample.tex, above, but uses the inline glossary style to put the glossary in a footnote. The document build is:
pdflatex sample-inline
+makeglossaries sample-inline
+pdflatex sample-inline
+pdflatex sample-inline
+
If you want to convert this document to glossaries-extra, follow the same procedure as above. If you want to use bib2gls then you don’t need the --group switch since no letter groups are required.

+

🗋📥 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:
pdflatex sampletree
+makeglossaries sampletree
+pdflatex sampletree
+
The document uses the alttreehypergroup glossary style, which needs to know the widest name for each hierarchical level. This has been assigned manually in the document preamblewith \glssetwidest:
\glssetwidest{Roman letters} % level 0 widest name
+\glssetwidest[1]{Sigma}      % level 1 widest name
+
(Level 0 is the top-most level. That is, entries that don’t have a parent.) It’s possible to get glossaries to compute the widest top-level entry with \glsfindwidesttoplevelname but this will iterate over all top-level entries, regardless of whether or not they appear in the 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 nolong and nosuper. The reduces the overall package loading and reduces the potential of package conflict.

\usepackage[style=alttreehypergroup,nolong,nosuper]
+{glossaries}
+
(This example glossary is actually better suited for one of the topic styles provided with glossary-topic, see below.)

+This is obviously a contrived example since it’s strange to have the symbol names (such as “Sigma”) in the glossary. The purpose is to demonstrate the alttreehypergroup with an entry that’s noticeably wider than the others in the same hierarchical level. A more sensible document would have the symbol in the name key.

+

+If you want to switch to glossaries-extra, then you can instead use a combination of nostyles and stylemods:
\usepackage[style=alttreehypergroup,postdot,nostyles,
+stylemods=tree]{glossaries-extra}
+
The stylemods package not only patches the original styles provided by the base glossaries package (such as 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 \glssetwidest, you could add the following before the glossary:
\glsFindWidestUsedTopLevelName
+\glsFindWidestUsedLevelTwo
+
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.

+

+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 aux file for the next run.
+

+This example document is using top-level entries for topics without descriptions. This means that the descriptions simply contain \nopostdesc to prevent the post-description punctuation from being automatically inserted. For example:

\newglossaryentry{greekletter}{name={Greek letters},
+text={Greek letter},
+description={\nopostdesc}}
+
With glossaries-extra, you can convert this to \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 general category, but the symbol entries can be assigned to a different category. The value of the category key must be a label. For example:

\newglossaryentry{C}{name={C},
+description={Euler's constant},
+category={symbol},
+parent={romanletter}}
+

+There is some redundancy caused by a parenthetical note after the first use in some of the symbol entries. For example:

\newglossaryentry{pi}{name={pi},
+text={\ensuremath{\pi}},
+first={\ensuremath{\pi} (lowercase pi)},
+description={Transcendental number},
+parent={greekletter}}
+
With glossaries-extra this can be dealt with through the category post-link hook:
\glsdefpostlink{symbol}{% 
+  \glsxtrifwasfirstuse
+  {% first use
+    \glsxtrifhasfield{useri}{\glslabel}% 
+    { (\glscurrentfieldvalue)}{}% 
+  }%  
+  {}% not first use
 }
-\renewcommand{\glsXpageXhyperbfit}[2]{%
- \textbf{\em\linkpagenumber#2}%
+
The parenthetical material is now stored in the user1 key. For example:
\newglossaryentry{sigma}{name={Sigma},
+text={\ensuremath\Sigma},
+user1={uppercase sigma},
+description={Used to indicate summation},
+parent={greekletter}}
+
The category post-description link is also set to ensure that the symbol is displayed after the description in the glossary:
\glsdefpostdesc{symbol}{\space
+  ($\glsentrytext{\glscurrententrylabel}$)}
+
These modifications only affect entries with the category set to symbol.

+With glossaries-extra, it’s now possible to use the topic styles provided with the glossary-topic package:

\usepackage[style=topic,postdot,nostyles,stylemods={tree,topic}]
+{glossaries-extra}
+
The topic style is designed for this kind of hierarchy where all the top-level entries don’t have descriptions. This means that the \nopostdesc and \glsxtrnopostpunc commands aren’t required. The top-level entries can simply be defined as:
\newglossaryentry{greekletter}{name={Greek letters},
+text={Greek letter}, description={}}
+
+\newglossaryentry{romanletter}{name={Roman letters},
+text={Roman letter}, description={}}
+
I’ve now loaded both the glossary-tree and glossary-topic packages (via stylemods={tree,topic}). The glossary-topic package can be used without glossary-tree, in which case it will behave more like the normal tree rather than alttree styles (but with different indentation and no description in the top-level). However, if you use \glssetwidest (provided by glossary-tree) then the topic style will behave more like alttree.

+Since there’s no description for the top-level entries, the topic style ignores the widest name setting for the top-level, so I can just have the level 1 setting:

\glssetwidest[1]Sigma
+

+

+If you want to convert this document so that it uses bib2gls, you first need to convert it to using glossaries-extra, as described above, but remember that you now need the record option.
\usepackage[record,style=topic,postdot,nostyles,stylemods={tree,topic}]
+{glossaries-extra}
+
Next convert the entries to the bib format required by bib2gls:
convertgls2bib --preamble-only sampletree.tex entries.bib
+
Now replace \makeglossaries with:
\GlsXtrLoadResources[src=entries,set-widest]
+
I’ve used the set-widest option here to get bib2gls to compute the widest name. (Obviously, it can only do this if it can correctly interpret any commands contained in the name field.)

+This means that the \glssetwidest commands can now be removed completely. All the \newglossaryentry commands also need to be removed from the document preamble. Finally, \printglossaries needs to be replaced with \printunsrtglossaries. The document build is now:

pdflatex sampletree
+bib2gls sampletree
+pdflatex sampletree
+

+This produces the same result as with just glossaries-extra and makeglossaries. However, there are some modifications that can be made to the bib file to make it neater.

+The top-level entries are defined as:

@entry{greekletter,
+  name={Greek letters},
+  description={},
+  text={Greek letter}
 }
-\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}}
-
-

Note that the second argument of \glsXpageXglsnumberformat is in the format \tallynum{n} so the -line - - -

-
- \linkpagenumber#2%
-
-

does

-
- \linkpagenumber\tallynum{number} -
-
so \tallynum is the first argument of \linkpagenumber and ⟨number⟩ is the second argument. -
-

-

____________________________

-

This method is very sensitive to the internal definition of the location command.
-

- -

Example 29 (Locations as Words not Digits) -

Suppose I want the page numbers written as words rather than digits and I use the fmtcount package to do -this. I can redefine \thepage as follows: - - -

-
-\renewcommand*{\thepage}{\Numberstring{page}}
-
-

This used to get expanded to \protect \Numberstringnum {n} where ⟨n⟩ is the Arabic page number. This -means that I needed to define a new location with the form: - - -

-
-\GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space
-  \string\Numberstringnum\space\glsopenbrace"
-  "arabic-numbers" :sep "\glsclosebrace"}
-
-

and if I’d used the \linkpagenumber command from the previous example, it would need three arguments (the -first being \protect): - - -

-
-\newcommand{\linkpagenumber}[3]{\hyperlink{page.#3}{#1#2{#3}}}
-
-

-

The internal definition of \Numberstring has since changed so that it now expands to \Numberstringnum  -{n} (no \protect). This means that the location class definition must be changed to: - - -

-
-\GlsAddXdyLocation{Numberstring}{% no \protect now!
-  :sep "\string\Numberstringnum\space\glsopenbrace"
-  "arabic-numbers" :sep "\glsclosebrace"}
-
-

and \linkpagenumber goes back to only two arguments: - - -

-
-\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}}
-
-

The other change is that \Numberstring uses

-
-\the\value{counter} -
-
instead of
-
-\expandafter\the\csname c@counter\endcsname -
-
so it hides \c@page from the location escaping mechanism (see §12.2 Locations). This means -that the page number may be incorrect if the indexing occurs during the output routine. -

A more recent change to fmtcount (v3.03) now puts three instances of \expandafter before -\the\value which no longer hides \c@page from the location escaping mechanism, so the page -numbers should once more be correct. Further changes to the fmtcount package may cause a problem -again. -

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.
-

-

Instead of directly using \Numberstring in the definition of \thepage, I can provide a custom command in -the same form as the earlier \tally command: - - -

-
-\newcommand{\customfmt}[1]{\customfmtnum{\arabic{#1}}}
-\newrobustcmd{\customfmtnum}[1]{\Numberstringnum{#1}}
-
-

This ensures that the location will always be written to the indexing file in the form:

-
-:locref "{}{\\customfmtnum {n}}" -
-
So the location class can be defined as: - - -
-\GlsAddXdyLocation{customfmt}{
- :sep "\string\customfmtnum\space\glsopenbrace"
- "arabic-numbers"
- :sep "\glsclosebrace"}
-
-

-

The sample file samplexdy3.tex illustrates this.

-
-

-

____________________________

-

In the number list, the locations are sorted according to the list of provided location classes. -The default ordering is: roman-page-numbers (i, ii, …), arabic-page-numbers (1, 2, …), -arabic-section-numbers (for example, 1.1 if the compositor is a full stop or 1-1 if the compositor is a -hyphen14.1), -alpha-page-numbers (a, b, …), Roman-page-numbers (I, II, …), Alpha-page-numbers (A, B, …), -Appendix-page-numbers (for example, A.1 if the Alpha compositor is a full stop or A-1 if the Alpha compositor is a -hyphen14.2), user defined -location names (as specified by \GlsAddXdyLocation in the order in which they were defined), and finally see (cross-referenced -entries).14.3 -This ordering can be changed using: -


\GlsSetXdyLocationClassOrder{location names}

-

-where each location name is delimited by double quote marks and separated by white space. For -example: - - -

-
-\GlsSetXdyLocationClassOrder{
-  "arabic-page-numbers"
-  "arabic-section-numbers"
-  "roman-page-numbers"
-  "Roman-page-numbers"
-  "alpha-page-numbers"
-  "Alpha-page-numbers"
-  "Appendix-page-numbers"
-  "see"
+
+@entry{romanletter,
+  name={Roman letters},
+  description={},
+  text={Roman letter}
 }
-
-

(Remember to add "seealso" if you’re using glossaries-extra.) -

Note that \GlsSetXdyLocationClassOrder has no effect if \noist is used or if \makeglossaries is -omitted. \GlsSetXdyLocationClassOrder must be used before \makeglossaries.
-

-

If a number list 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: -


\GlsSetXdyMinRangeLength{n}

-

-For example: - - -

-
-\GlsSetXdyMinRangeLength{3}
-
-

The argument may also be the keyword none, to indicate that there should be no range formations. See the -xindy manual for further details on range formations. -

Note that \GlsSetXdyMinRangeLength has no effect if \noist is used or if \makeglossaries is omitted. -\GlsSetXdyMinRangeLength must be used before \makeglossaries.
-

-See also §12.3 Range Formations. -

-

-

Top

14.3 Glossary Groups

-

The glossary is divided into groups according to the first letter of the sort key. The glossaries package also adds a -number group by default, unless you suppress it in the xindy package option. For example: - - -

-
-\usepackage[xindy={glsnumbers=false}]{glossaries}
-
-

Any entry that doesn’t go in one of the letter groups or the number group is placed in the default group. If you -want xindy to sort the number group numerically (rather than by a string sort) then you need to use xindy’s -numeric-sort module: - - -

-
-\GlsAddXdyStyle{numeric-sort}
-
-

-

If you don’t use glsnumbers=false, the default behaviour is to locate the number group before the “A” -letter group. If you are not using a Roman alphabet, you need to change this using: -


\GlsSetXdyFirstLetterAfterDigits{letter}

-

-where ⟨letter⟩ is the first letter of your alphabet. Take care if you’re using inputenc as non-ASCII characters are -actually active characters that expand. (This isn’t a problem with the native UTF-8 engines and -fontspec.) The starred form will sanitize the argument to prevent expansion. Alternatively you can -use: -


\GlsSetXdyNumberGroupOrder{relative location}

-

-to change the default

-
-:before \string"letter\string" -
-
to ⟨relative location⟩. For example: - - -
-\GlsSetXdyNumberGroupOrder{:after \string"Z\string"}
-
-

will put the number group after the “Z” letter group. Again take care of active characters. There’s a starred -version that sanitizes the argument (so don’t use \string in it).

-
-\GlsSetXdyNumberGroupOrder*{:after "Ö"} -
-
-

Note that these commands have no effect if \noist is used or if \makeglossaries is omitted. -\GlsSetXdyFirstLetterAfterDigits must be used before \makeglossaries. -
-

- - -

-

-

Top

15. Utilities

-

This section describes some utility commands. Additional commands can be found in the documented code -(glossaries-code.pdf). -

The glossaries-extra package provides extra utility commands. See the “Utilities” section of the -glossaries-extra manual.
-

-

-

Top

15.1 Loops

-

Some of the commands described here take a comma-separated list as an argument. As with LaTeX’s \@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 §2.7.2 of “LaTeX for Administrative Work”.)
-

-


\forallglossaries[glossary list]{cs}{body}

-

-This iterates through ⟨glossary list⟩, a comma-separated list of glossary labels (as supplied when the glossary was -defined). At each iteration ⟨cs⟩ (which must be a control sequence) is set to the glossary label for the current -iteration and ⟨body⟩ is performed. If ⟨glossary list⟩ is omitted, the default is to iterate over all glossaries (except the -ignored ones). -


\forallacronyms{cs}{body}

-

-This is like \forallglossaries but only iterates over the lists of acronyms (that have previously been declared -using \DeclareAcronymList or the 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 -\forallglossaries. -

The glossaries-extra package provides an analogous command \forallabbreviationlists.
-

-


\forglsentries[glossary label]{cs}{body}

-

-This iterates through all entries in the glossary given by ⟨glossary label⟩. At each iteration ⟨cs⟩ (which must be a -control sequence) is set to the entry label for the current iteration and ⟨body⟩ is performed. If ⟨glossary label⟩ is -omitted, \glsdefaulttype (usually the main glossary) is used. -


\forallglsentries[glossary list]{cs}{body}

-

-This is like \forglsentries but for each glossary in ⟨glossary list⟩ (a comma-separated list of glossary labels). If -⟨glossary list⟩ is omitted, the default is the list of all defined glossaries (except the ignored ones). At each iteration -⟨cs⟩ is set to the entry label and ⟨body⟩ is performed. (The current glossary label can be obtained using -\glsentrytype{cs} within ⟨body⟩.) - - -

-

-

Top

15.2 Conditionals

-


\ifglossaryexistslabel⟩⟨true part⟩⟨false part

-

-This checks if the glossary given by ⟨label⟩ exists. If it does ⟨true part⟩ is performed, otherwise ⟨false part⟩. -The unstarred form will do ⟨false part⟩ for ignored glossaries. As from v4.46, there is now a starred -form of this command which will also consider ignored glossaries as existing. For example, given: -

-
-\newignoredglossary{common} -
-
then - - -
-\ifglossaryexists{common}{true}{false}
-\ifglossaryexists*{common}{true}{false}
-
-

will produce “false true”. -


\ifglsentryexistslabel⟩⟨true part⟩⟨false part

-

-This checks if the glossary entry given by ⟨label⟩ exists. If it does ⟨true part⟩ is performed, otherwise ⟨false part⟩. -(Note that \ifglsentryexists will always be true after the containing glossary has been displayed via -\printglossary or \printglossaries even if the entry is explicitly defined later in the document. This is -because the entry has to be defined before it can be displayed in the glossary, see §4.8.1 Technical -Issues for further details.) -


\glsdoifexists{label}{code}

-

-Does ⟨code⟩ if the entry given by ⟨label⟩ exists. If it doesn’t exist, an error is generated. (This command uses -\ifglsentryexists.) -


\glsdoifnoexists{label}{code}

-

-Does the reverse of \glsdoifexists. (This command uses \ifglsentryexists.) -


\glsdoifexistsorwarn{label}{code}

-

-As \glsdoifexists but issues a warning rather than an error if the entry doesn’t exist. -


\glsdoifexistsordo{label}{code}{else code}

-

-Does ⟨code⟩ if the entry given by ⟨label⟩ exists otherwise generate an error and do ⟨else code⟩. -


\glsdoifnoexistsordo{label}{code}{else code}

-

-Does ⟨code⟩ if the entry given by ⟨label⟩ doesn’t exist otherwise generate an error and do ⟨else code⟩. -


\ifglsusedlabel⟩⟨true part⟩⟨false part

-

-See §7 Unsetting and Resetting Entry Flags. -


\ifglshaschildrenlabel⟩⟨true part⟩⟨false part

-

-This checks if the glossary entry given by ⟨label⟩ has any sub-entries. If it does, ⟨true part⟩ is performed, otherwise -⟨false part⟩. This uses an inefficient method since this information isn’t stored. -

If you use bib2gls, a more efficient method is to use the save-child-count resource option and test the -value of the childcount field.
-

-


\ifglshasparentlabel⟩⟨true part⟩⟨false part

-

-This checks if the glossary entry given by ⟨label⟩ has a parent entry. If it does, ⟨true part⟩ is performed, otherwise -⟨false part⟩. -


\ifglshassymbol{label}{true part}{false part}

- - -

-This checks if the glossary entry given by ⟨label⟩ has had the symbol field set. If it has, ⟨true part⟩ is performed, -otherwise ⟨false part⟩. -


\ifglshaslong{label}{true part}{false part}

-

-This checks if the glossary entry given by ⟨label⟩ has had the long field set. If it has, ⟨true part⟩ is performed, -otherwise ⟨false part⟩. This should be true for any entry that has been defined via \newacronym. There is no -check for the existence of ⟨label⟩. -


\ifglshasshort{label}{true part}{false part}

-

-This checks if the glossary entry given by ⟨label⟩ has had the short field set. If it has, ⟨true part⟩ is performed, -otherwise ⟨false part⟩. This should be true for any entry that has been defined via \newacronym. There is no -check for the existence of ⟨label⟩. -


\ifglshasdesc{label}{true part}{false part}

-

-This checks if the description field is non-empty for the entry given by ⟨label⟩. If it has, ⟨true part⟩ is performed, -otherwise ⟨false part⟩. Compare with: -


\ifglsdescsuppressed{label}{true part}{false part}

-

-This checks if the description field has been set to just \nopostdesc for the entry given by ⟨label⟩. If it has, ⟨true -part⟩ is performed, otherwise ⟨false part⟩. There is no check for the existence of ⟨label⟩. -

For all other fields you can use: -


\ifglshasfield{field}{label}{true part}{false part}

-

-This tests the value of the field given by ⟨field⟩ for the entry identified by ⟨label⟩. If the value is empty or the -default value, then ⟨false part⟩ is performed, otherwise ⟨true part⟩ is performed. If the field supplied is unrecognised -⟨false part⟩ is performed and a warning is issued. Unlike the above commands, such as \ifglshasshort, an error -occurs if the entry is undefined. -

As from version 4.23, within ⟨true part⟩ you can use -


\glscurrentfieldvalue

-

-to access the field value. This command is initially defined to nothing but has no relevance outside ⟨true part⟩. -This saves re-accessing the field if the test is true. For example: - - -

-
-\ifglshasfield{useri}{sample}{, \glscurrentfieldvalue}{}
-
-

will insert a comma, space and the field value if the user1 key has been set for the entry whose label is -sample. -

You can test if the value of the field is equal to a given string using: -


\ifglsfieldeq{label}{field}{string}{true}{false}

-

-In this case the ⟨field⟩ must be the field name not the key (see table 4.1). If the field isn’t recognised, -an error will occur. This command internally uses etoolbox’s \ifcsstring to perform the comparison. The -string is not expanded during the test. -

The result may vary depending on whether or not expansion is on for the given field (when the entry was -defined). For example: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\newcommand*{\foo}{FOO}
-\newglossaryentry{sample1}{name={sample1},description={an example},
-user1={FOO}}
-\newglossaryentry{sample2}{name={sample2},description={an example},
-user1={\foo}}
-\begin{document}
-\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}.
-\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}.
-\end{document}
-
-

This will produce “TRUE” in both cases since expansion is on, so \foo was expanded to “FOO” when sample2 -was defined. If the tests are changed to: - - -

-
-\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
-\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
-
-

then this will produce “FALSE” in both cases. Now suppose expansion is switched off for the user1 -key: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\newcommand*{\foo}{FOO}
-\glssetnoexpandfield{useri}
-\newglossaryentry{sample1}{name={sample1},description={an example},
-user1={FOO}}
-\newglossaryentry{sample2}{name={sample2},description={an example},
-user1={\foo}}
-\begin{document}
-\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}.
-\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}.
-\end{document}
-
-

This now produces “TRUE” for the first case (comparing “FOO” with “FOO”) and “FALSE” for the second -case (comparing “\foo” with “FOO”). -

The reverse happens in the following: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\newcommand*{\foo}{FOO}
-\glssetnoexpandfield{useri}
-\newglossaryentry{sample1}{name={sample1},description={an example},
-user1={FOO}}
-\newglossaryentry{sample2}{name={sample2},description={an example},
-user1={\foo}}
-\begin{document}
-\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
-\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
-\end{document}
-
-

This now produces “FALSE” for the first case (comparing “FOO” with “\foo”) and “TRUE” for the second -case (comparing “\foo” with “\foo”). -

You can test if the value of a field is equal to the replacement text of a command using: -


\ifglsfielddefeq{label}{field}{command}{true}{false}

-

-This internally uses etoolbox’s \ifdefstrequal command to perform the comparison. The argument ⟨command⟩ -must be a macro. -

For example: - - -

-
-\documentclass{article}
-\usepackage{glossaries}
-\newcommand*{\foo}{FOO}
-\glssetnoexpandfield{useri}
-\newglossaryentry{sample1}{name={sample1},description={an example},
-user1={FOO}}
-\newglossaryentry{sample2}{name={sample2},description={an example},
-user1={\foo}}
-\begin{document}
-\ifglsfielddefeq{sample1}{useri}{\foo}{TRUE}{FALSE}.
-\ifglsfielddefeq{sample2}{useri}{\foo}{TRUE}{FALSE}.
-\end{document}
-
-

Here, the first case produces “TRUE” since the value of the useri field (“FOO”) is the same as the -replacement text (definition) of \foo (“FOO”). We have the result “FOO” is equal to “FOO”. -

The second case produces “FALSE” since the value of the useri field (“\foo”) is not the same as the -replacement text (definition) of \foo (“FOO”). No expansion has been performed on the value of the useri -field. We have the result “\foo” is not equal to “FOO”. -

If we add: - - -

-
-\newcommand{\FOO}{\foo}
-\ifglsfielddefeq{sample2}{useri}{\FOO}{TRUE}{FALSE}.
-
-

we now get “TRUE” since the value of the useri field (“\foo”) is the same as the replacement text (definition) -of \FOO (“\foo”). We have the result “\foo” is equal to “\foo”. -

There is a similar command that requires the control sequence name (without the leading backslash) instead -of the actual control sequence: -


\ifglsfieldcseq{label}{field}{csname}{true}{false}

-

-This internally uses etoolbox’s \ifcsstrequal command instead of \ifdefstrequal. -

-

-

Top

15.3 Fetching and Updating the Value of a Field

-

In addition to the commands described in §5.2 Using Glossary Terms Without Links, the following -may also be used to fetch field information. -


\glsentrytype{label}

-

-Expands to the entry’s glossary type. No existence check is performed. -


\glsentryparent{label}

-

-Expands to the label of the entry’s parent. No existence check is performed. -


\glsentrysort{label}

-

-Expands to the entry’s sort value. No existence check is performed. -

You can fetch the value of a given field and store it in a control sequence using: -


\glsfieldfetch{label}{field}{cs}

-

-where ⟨label⟩ is the label identifying the glossary entry, ⟨field⟩ is the field label (see table 4.1) and ⟨cs⟩ is -the control sequence in which to store the value. Remember that ⟨field⟩ is the internal label and is not necessarily -the same as the key used to set that field in the argument of \newglossaryentry (or the optional argument of -\newacronym). This command uses \glsdoifexists so an error will occur if the entry hasn’t been -defined. -

If you need to expand to the field value without expanding the contents you can use: -


\glsunexpandedfieldvalue{label}{field}

-

-where ⟨label⟩ is the label identifying the glossary entry, ⟨field⟩ is the internal field label (see table 4.1). -If the entry doesn’t exist or if the field isn’t defined or hasn’t been set this expands to nothing. -

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 text field, it won’t modify the value given by the name, plural, first or any other related -key. -

In all the four related commands below, ⟨label⟩ and ⟨field⟩ are as above and ⟨definition⟩ is the new value of the -field. -


\glsfielddef{label}{field}{definition}

-

-This uses \def to change the value of the field (so it will be localised by any grouping). -


\glsfieldedef{label}{field}{definition}

-

-This uses \edef to change the value of the field (so it will be localised by any grouping). Any fragile commands -contained in the ⟨definition⟩ must be protected. -


\glsfieldgdef{label}{field}{definition}

-

-This uses \gdef to change the value of the field. -


\glsfieldxdef{label}{field}{definition}

-

-This uses \xdef to change the value of the field. Any fragile commands contained in the ⟨definition⟩ must be -protected. - - -

-

-

Top

16. Prefixes or Determiners

-

The glossaries-prefix package that comes with the glossaries package provides additional keys that can be -used as prefixes. For example, if you want to specify determiners (such as “a”, “an” or “the”). -The glossaries-prefix package automatically loads the glossaries package and has the same package -options. -

The extra keys for \newglossaryentry are as follows: -

-

-prefix

-

The prefix associated with the text key. This defaults to nothing. -

-

-prefixplural

-

The prefix associated with the plural key. This defaults to nothing. -

-

-prefixfirst

-

The prefix associated with the first key. If omitted, this defaults to the value of the prefix key. -

-

-prefixfirstplural

-

The prefix associated with the firstplural key. If omitted, this defaults to the value of the - prefixplural key.

- -

Example 30 (Defining Determiners) -

Here’s the start of my example document: - - -

-
-\documentclass{article}
-\usepackage[colorlinks]{hyperref}
-\usepackage[toc,acronym]{glossaries-prefix}
-
-

Note that I’ve simply replaced glossaries from previous sample documents with glossaries-prefix. Now for a sample -definition16.1: - - -

-
-\newglossaryentry{sample}{name={sample},%
-  description={an example},%
-  prefix={a~},%
-  prefixplural={the\space}%
+
This is a direct translation from the \newglossaryentry commands (after switching to the topic style). There’s a more appropriate entry type:
@indexplural{greekletter,
+  text={Greek letter}
 }
-
-

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: - - -

-
-\newglossaryentry{oeil}{name={oeil},
-  plural={yeux},
-  description={eye},
-  prefix={l'},
-  prefixplural={les\space}}
-
-

Where a space is required at the end of the prefix, you must use a spacing command, such as -\space, \␣ (backslash space) or ~ due to the automatic spacing trimming performed in ⟨key⟩=⟨value⟩ -options. -

In the event that you always require a space between the prefix and the term, then you can instead -redefine -


\glsprefixsep

-

-to do a space. (This command does nothing by default.) For example: - - -

-
-\renewcommand{\glsprefixsep}{\space}
-
-

-

The prefixes can also be used with acronyms. For example: - - -

-
-\newacronym
- [%
-   prefix={an\space},prefixfirst={a~}%
- ]{svm}{SVM}{support vector machine}
-
-

-
-

-

____________________________

-

The glossaries-prefix package provides convenient commands to use these prefixes with commands such as -\gls. Note that the prefix is not considered part of the link text, 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 \gls-like command. -(See §5.1 Links to Glossary Entries for further details.) -


\pgls[options]{label}[insert]

-

-This is inserts the value of the prefix key (or prefixfirst key, on first use) in front of \gls[options]{label} -[insert]. -


\Pgls[options]{label}[insert]

-

-If the prefix key (or prefixfirst, on first use) has been set, this displays the value of that key with the first -letter converted to upper case followed by \gls[options]{label}[insert]. If that key hasn’t been set, this is -equivalent to \Gls[options]{label}[insert]. -


\PGLS[options]{label}[insert]

-

-As \pgls but converts the prefix to upper case and uses \GLS instead of \gls. -


\pglspl[options]{label}[insert]

-

-This is inserts the value of the prefixplural key (or prefixfirstplural key, on first use) in front of \glspl -[options]{label}[insert]. -


\Pglspl[options]{label}[insert]

-

-If the prefixplural key (or prefixfirstplural, on first use) has been set, this displays the value of that key -with the first letter converted to upper case followed by \glspl[options]{label}[insert]. If that key hasn’t been -set, this is equivalent to \Glspl[options]{label}[insert]. -


\PGLSpl[options]{label}[insert]

-

-As \pglspl but converts the prefix to upper case and uses \GLSpl instead of \glspl. - -

Example 31 (Using Prefixes) -

Continuing from Example 30, now that I’ve defined my entries, I can use them in the text via the above - - -commands: - - -

-
-First use: \pgls{svm}. Next use: \pgls{svm}.
-Singular: \pgls{sample}, \pgls{oeil}.
-Plural: \pglspl{sample}, \pglspl{oeil}.
-
-

which produces: -

-

First use: a support vector machine (SVM). Next use: an SVM. Singular: a sample, l’oeil. - Plural: the samples, les yeux.

-

For a complete document, see sample-prefix.tex.

-
-

-

____________________________

-

This package also provides the commands described below, none of which perform any check to determine -the entry’s existence. -


\ifglshasprefix{label}{true part}{false part}

-

-Does ⟨true part⟩ if the entry identified by ⟨label⟩ has a non-empty value for the prefix key. -

This package also provides the following commands: -


\ifglshasprefixplural{label}{true part}{false part}

-

-Does ⟨true part⟩ if the entry identified by ⟨label⟩ has a non-empty value for the prefixplural key. -


\ifglshasprefixfirst{label}{true part}{false part}

-

-Does ⟨true part⟩ if the entry identified by ⟨label⟩ has a non-empty value for the prefixfirst key. -


\ifglshasprefixfirstplural{label}{true part}{false part}

-

-Does ⟨true part⟩ if the entry identified by ⟨label⟩ has a non-empty value for the prefixfirstplural -key. -


\glsentryprefix{label}

-

-Displays the value of the prefix key for the entry given by ⟨label⟩. -


\glsentryprefixfirst{label}

-

-Displays the value of the prefixfirst key for the entry given by ⟨label⟩. -


\glsentryprefixplural{label}

-

-Displays the value of the prefixplural key for the entry given by ⟨label⟩. (No check is performed to determine if -the entry exists.) -


\glsentryprefixfirstplural{label}

- - -

-Displays the value of the prefixfirstplural key for the entry given by ⟨label⟩. (No check is performed to -determine if the entry exists.) -

There are also variants that convert the first letter to upper -case16.2: -


\Glsentryprefix{label}

-

-


\Glsentryprefixfirst{label}

-

-


\Glsentryprefixplural{label}

-

-


\Glsentryprefixfirstplural{label}

-

-

As with analogous commands such as \Glsentrytext, these commands aren’t expandable so can’t be used -in PDF bookmarks.
-

- -

Example 32 (Adding Determiner to Glossary Style) -

You can use the above commands to define a new glossary style that uses the determiner. For -example, the following style is a slight modification of the list style that inserts the prefix before the -name: - - -

-
-\newglossarystyle{plist}{%
-  \setglossarystyle{list}%
-  \renewcommand*{\glossentry}[2]{%
-    \item[\glsentryitem{##1}%
-          \glsentryprefix{##1}%
-          \glstarget{##1}{\glossentryname{##1}}]
-       \glossentrydesc{##1}\glspostdescription\space ##2}%
+
+@indexplural{romanletter,
+  text={Roman letter}
 }
-
-

If you want to change the prefix separator (\glsprefixsep) then the following is better: - - -

-
-\newglossarystyle{plist}{%
-  \setglossarystyle{list}%
-  \renewcommand*{\glossentry}[2]{%
-    \item[\glsentryitem{##1}%
-          \ifglshasprefix{##1}{\glsentryprefix{##1}\glsprefixsep}{}%
-          \glstarget{##1}{\glossentryname{##1}}]
-       \glossentrydesc{##1}\glspostdescription\space ##2}%
+
The @indexplural entry type doesn’t require the description and will set the name field to the same as the plural field. Since the plural field hasn’t been set it’s obtained by appending “s” to the text field.

+Now let’s assume that the symbol entries are defined in a more rational manner, with the actual symbol in the name field. For example:

@entry{sigma,
+  user1={uppercase sigma},
+  parent={greekletter},
+  description={Used to indicate summation},
+  name={\ensuremath{\Sigma}},
+  category={symbol}
 }
-
-

The conditional is also useful if you want the style to use an uppercase letter at the start of the entry -item: - - -

-
-\newglossarystyle{plist}{%
-  \setglossarystyle{list}%
-  \renewcommand*{\glossentry}[2]{%
-    \item[\glsentryitem{##1}%
-          \glstarget{##1}%
-          {%
-            \ifglshasprefix{##1}%
-            {\Glsentryprefix{##1}\glsprefixsep\glossentryname{##1}}%
-            {\Glossentryname{##1}}%
-          }]
-       \glossentrydesc{##1}\glspostdescription\space ##2}%
+
+@entry{C,
+  parent={romanletter},
+  name={\ensuremath{C}},
+  description={Euler's constant},
+  category={symbol}
 }
-
-

-
-

-

____________________________

- - -

-

Top

17. Accessibility Support

-

Limited accessibility support is provided by the accompanying glossaries-accsupp package, but note that this -package is experimental and it requires the accsupp package which is also listed as experimental. This package -automatically loads the glossaries package. Any options are passed to glossaries (if it hasn’t already been loaded). -For example: - - -

-
-\usepackage[acronym]{glossaries-accsupp}
-
-

This will load glossaries with the acronym package option as well as loading glossaries-accsupp. -

If you are using the glossaries-extra extension package, you need to load glossaries-extra with the accsupp -package option. For example: - - -

-
-\usepackage[abbreviations,accsupp]{glossaries-extra}
-
-

This will load glossaries-extra (with the abbreviations option), glossaries and glossaries-accsupp and make -appropriate patches to integrate the accessibility support with the extension commands. -

The glossaries-accsupp package defines additional keys that may be used when defining glossary entries. The -keys are as follows: -

-

-access

-

The - replacement - text - corresponding - to - the - name - key. -

-

-textaccess

-

The - replacement - text - corresponding - to - the - text - key. -

-

-firstaccess

-

The - replacement - text - corresponding - to - - - the - first - key. -

-

-pluralaccess

-

The - replacement - text - corresponding - to - the - plural - key. -

-

-firstpluralaccess

-

The - replacement - text - corresponding - to - the - firstplural - key. -

-

-symbolaccess

-

The - replacement - text - corresponding - to - the - symbol - key. -

-

- - -symbolpluralaccess

-

The - replacement - text - corresponding - to - the - symbolplural - key. -

-

-descriptionaccess

-

The - replacement - text - corresponding - to - the - description - key. -

-

-descriptionpluralaccess

-

The - replacement - text - corresponding - to - the - descriptionplural - key. -

-

-longaccess

-

The - replacement - text - corresponding - - - to - the - long - key - (used - by - \newacronym). -

-

-shortaccess

-

The - replacement - text - corresponding - to - the - short - key - (used - by - \newacronym). -

-

-longpluralaccess

-

The - replacement - text - corresponding - to - the - longplural - key - (used - by - \newacronym). -

-

-shortpluralaccess

-

The - - - replacement - text - corresponding - to - the - shortplural - key - (used - by - \newacronym). -

-

-user1access

-

The - replacement - text - corresponding - to - the - user1 - key. -

-

-user2access

-

The - replacement - text - corresponding - to - the - user2 - key. -

-

-user3access

-

The - replacement - text - corresponding - - - to - the - user3 - key. -

-

-user4access

-

The - replacement - text - corresponding - to - the - user4 - key. -

-

-user5access

-

The - replacement - text - corresponding - to - the - user5 - key. -

-

-user6access

-

The - replacement - text - corresponding - to - the - user6 - key.

-

For example: - - -

-
-\newglossaryentry{tex}{name={\TeX},description={Document
-preparation language},access={TeX}}
-
-

Now the link text produced by \gls{tex} will be: - - -

-
-\BeginAccSupp{ActualText={TeX}}\TeX\EndAccSupp{}
-
-

The sample file sampleaccsupp.tex illustrates the glossaries-accsupp package. -

If you prefer to use accessibility or tagpdf instead of accsupp then you’ll need to define \gls@accsupp@engine -and \gls@accessibility before loading glossaries-accsupp. See the section “Accessibility Support”in the -documented code for further details. -

The PDF specification identifies three different types of replacement text: -

-

-Alt

-

Description of some content that’s non-textual (for example, an image). A word break is assumed - after the content. -

-

-ActualText

-

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. -

-

-E

-

Expansion of an abbreviation to avoid ambiguity (for example, “St” could be short for “saint” or - “street”).

-

Many PDF viewers don’t actually support any type of replacement text. Some may support “ActualText” -but not “Alt” or “E”. PDFBox’s “PDFDebugger” tool can be used to inspect the PDF content to make sure -that the replacement text has been correctly set.
-

-

If you define abbreviations with \newacronym, the shortaccess field will automatically be set -to: -


\glsdefaultshortaccess{long}{short}

-

-With the base glossaries package this just expands to ⟨long⟩. With glossaries-extra this expands to ⟨long⟩ (⟨short⟩). -This command must be fully expandable. It expands when the abbreviation is defined. -

As from glossaries-accsupp v4.45, the helper command used to identify the replacement text depends on the -field name. Previous versions just used: -


\glsaccsupp{replacement}{content}

-

-for all fields. This is defined to use ActualText, which is appropriate for symbols but not for abbreviations. -

As from v4.45, there’s a new helper command: - - -


\glsfieldaccsupp{replacement}{content}{field}{label}

-

-This will use \glsfieldaccsupp if it’s defined otherwise it will just use \glsaccsupp. There are just two of -these field commands for short and shortplural: -


\glsshortaccsupp{replacement}{content}

-

-which is like \glsaccsupp but uses E instead of ActualText and -


\glsshortplaccsupp{replacement}{content}

-

-which just does \glsshortaccsupp{replacement}{content}. Note that ⟨field⟩ indicates the internal field name -(such as shortpl) not the key name (such as shortplural). See table 4.1. -

Rather than explicitly using \BeginAccSupp, these helper commands can use: -


\glsaccessibility[options]{tag}{value}{content}

-

-where ⟨tag⟩ is one of E, Alt or ActualText. The replacement text for ⟨content⟩ should be provided in ⟨value⟩. This -does:

-
-\BeginAccSupp{tag={value},options}content\EndAccSupp{} -
-
but it also provides debugging information if debug=showaccsupp is used. If you explicitly use \BeginAccSupp -instead of this command then the debugging support won’t be available. -

You can define your own custom helper commands for specific fields that require them. For -example: - - -

-
-\newcommand{\glssymbolaccsupp}[2]{%
- \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}%
+
The category post-description hook (provided with \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 “sigma” entry is before the “pi” entry. This is because bib2gls is obtaining the sort values from the name field, which is the sort fallback for @entry. This means that the sort values end up as \(𝛴\) and \(𝜋\) (bib2gls recognises the commands \Sigma and \pi and converts them to the Unicode characters 0x1D6F4 and 0x1D70B).

+If you change @entry to @symbol then you will once again get the order from the original example (“pi” before “Sigma”). This is because the sort fallback for @symbol is the label not the name. (Remember that the sort fallback is only used if the sort field isn’t set. If you explicitly set the sort field then no fallback is required. See bib2gls gallery: sorting.)

+You can further tidy the bib file by removing the category fields. For example:

@symbol{sigma,
+  user1={uppercase sigma},
+  parent={greekletter},
+  description={Used to indicate summation},
+  name={\ensuremath{\Sigma}}
 }
-
-

This definition requires the replacement text to be specified with the hexadecimal character code. For -example: - - -

-
-\newglossaryentry{int}{name={int},description={integral},
-  symbol={\ensuremath{\int}},symbolaccess={222B}
+
You can then assign the category in the resource set:
\GlsXtrLoadResources[src=entries,set-widest,category={same as entry}]
+
This means that all the entries defined with @symbol will have the category set to symbol and all the entries defined with @indexplural will have the category set to indexplural. (Only the symbol category is significant in this example.)

+You can make the bib files even more flexible by introducing field and entry aliases with field-aliases and entry-type-aliases. See the bib2gls manual for further details.

+ + + +

+

18.7. Cross-Referencing

+

+

🗋📥 sample-crossref.tex
+ This document illustrates how to cross-reference entries in the glossary.
pdflatex sample-crossref
+makeglossaries sample-crossref
+pdflatex sample-crossref
+
The document provides a command \alsoname to produce some fixed text, which can be changed as appropriate (usually within a language hook):
\providecommand{\alsoname}{see also}
+
I’ve used \providecommand as some packages define this command. This is used to create a “see also” cross-reference with the see key:
\newglossaryentry{apple}{name={apple},description={firm, round fruit},
+see={[\alsoname]{pear}}}
+
+\newglossaryentry{marrow}{name={marrow},
+ description={long vegetable with thin green skin and white flesh},
+ see={[\alsoname]courgette}}
+

+Note that “marrow” is included in the glossary even though it hasn’t been referenced in the text. This is because the see key automatically triggers \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 glossaries-extra (see below).

+

+This example is quite simple to convert to glossaries-extra. If you want the dot after the description, you need the nopostdot=false or postdot package option. You may also want to consider using the stylemods option.

+In order to prevent the “marrow” entry from being automatically being added to the glossary as a result of the cross-reference, you can use autoseeindex=false to prevent the automatic indexing triggered by the see key (or the seealso key provided by glossaries-extra).

+

\usepackage[autoseeindex=false,postdot,stylemods]{glossaries-extra}
+
The document build is the same, but now the “marrow” and “zucchini” entries aren’t present in the document.

+Note that the “fruit” entry is still included even though it hasn’t been used in the document. This is because it was explicitly indexed with \glssee not via the see key.

+The entries that contains see[\alsonamexr-label] can be converted to use the seealso key:

\newglossaryentry{apple}{name={apple},description={firm, round fruit},
+seealso={pear}}
+
+\newglossaryentry{marrow}{name={marrow},
+ description={long vegetable with thin green skin and white flesh},
+ seealso={courgette}}
+
(The provided \alsoname definition may be removed.)

+The original example redefines the cross-referencing format to use small caps:

\renewcommand{\glsseeitemformat}[1]{\textsc{\glsentryname{#1}}}
+
This will still produce the desired effect with glossaries-extra for this simple example but, as with sampleAcrDesc.tex, this redefinition isn’t necessary if you have at least glossaries-extra v1.42.

+

+If you want to switch to bib2gls then you first need to switch to glossaries-extra, as described above, but you now need the record option but no longer need the autoseeindex=false option:
\usepackage[record,postdot,stylemods]{glossaries-extra}
+
Next the entry definitions need to be converted to the bib format required by bib2gls.
convertgls2bib sample-crossref.tex entries.bib
+
If you have at least v2.0 then convertgls2bib will absorb the cross-referencing information supplied by:
\glssee{fruit}{pear,apple,banana}
+
into the “fruit” definition:
@entry{fruit,
+  see={pear,apple,banana},
+  name={fruit},
+  description={sweet, fleshy product of plant containing seed}
 }
-
-

-

If you are using glossaries-extra, then \glsfieldaccsupp will first test for the existence of -\glsxtrcategory⟩⟨fieldaccsupp and \glsxtrcategoryaccsupp and then for \glsfieldaccsupp. For -example: - - -

-
-\usepackage{siunitx}
-\usepackage[accsupp]{glossaries-extra}
-\glsnoexpandfields
-\newcommand{\glsxtrsymbolaccsupp}[2]{%
- \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}%
+
Now remove \makeglossaries and all the entry definition commands (including \glssee from the document preamble) and add:
\GlsXtrLoadResources[src=entries]
+
Finally, replace \printglossaries with \printunsrtglossaries. The document build is now:
pdflatex sample-crossref
+bib2gls sample-crossref
+pdflatex sample-crossref
+
The glossary now contains: apple, banana, courgette and pear. Note that it doesn’t contain fruit, zucchini or marrow.

+Now change the selection criteria:

\GlsXtrLoadResources[src=entries,
+ selection={recorded and deps and see}]
+
The glossary now includes fruit, zucchini and marrow.

+The fruit and zucchini use the see key which is a simple redirection for the reader. There’s no number list for either of these entries. Whereas marrow uses the seealso key, which is typically intended as a supplement to a number list 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:

\GlsXtrLoadResources[src=entries,
+ selection={recorded and deps and see not also}]
+
In this case, the glossary includes fruit and zucchini but not marrow.

+ +

+ +
+

18.8. Custom Keys

+

+

🗋📥 sample-newkeys.tex
+ This document illustrates how add custom keys (using \glsaddkey). There are two custom keys ed, where the default value is the text field with “ed” appended, and ing, where the default value is the text field with “ing” appended. Since the default value in both cases references the text field, the starred version \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:

\newglossaryentry{jump}{name={jump},description={}}
+
+\newglossaryentry{run}{name={run},
+ ed={ran},
+ ing={running},
+ description={}}
+
+\newglossaryentry{waddle}{name=waddle,
+ ed={waddled},
+ ing={waddling},
+ description={}}
+

+Each custom key is provided a set of commands analogous to \glsentrytext, that allows the key value to be accessed, and \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 \glsdisp. When editing the document source, it’s usually simpler to read:

The dog \glsdisp{jump}{jumped} over the duck.
+
than
The dog \glsed{jump} over the duck.
+

+

+If you want to convert this document to use bib2gls, you first need to switch to glossaries-extra, but remember that you need the record option:
\usepackage[record]{glossaries-extra}
+
Next convert the entry definitions to the bib format required by bib2gls:
convertgls2bib --index-conversion --preamble-only sample-newkeys.tex entries.bib
+
The --index-conversion switch requires at least v2.0 and will convert entries without a description (or where the description is simply \nopostdesc or \glsxtrnopostpunc) to @index instead of @entry. This means that the new entries.bib file will contain:
@index{jump,
+  name={jump}
 }
-\newcommand{\glsxtrunitaccsupp}[2]{\glsaccessibility{E}{#1}{#2}}
-\newglossaryentry{cm}{name={\si{\centi\metre}},
- access={centimetre},
- description={centimetre},
- category=unit
+
+@index{run,
+  ing = {running},
+  name={run},
+  ed = {ran}
 }
-\newglossaryentry{int}{name={\ensuremath{\int}},access={222B},
-  description={integral},category={symbol}
+
+@index{waddle,
+  ing = {waddling},
+  name={waddle},
+  ed = {waddled}
 }
-
-

The above uses the \glsxtrcategoryaccsupp form that doesn’t include the field name. Remember that if you -want to supply a command specifically for the name field then it won’t be picked up by the text, plural, -firstplural and first fields. You’d need to supply them all. For example: - - -

-
-\newcommand{\glsnameaccsupp}[2]{%
- \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}%
+
Now replace \makeglossaries with
\GlsXtrLoadResources[src=entries]
+
and delete the \newglossaryentry commands. Finally replace \printglossaries with \printunsrtglossaries.

+The document build is now:

pdflatex sample-newkeys
+bib2gls sample-newkeys
+pdflatex sample-newkeys
+
Note that there’s no need for the nonumberlist package option when you don’t use bib2gls’s --group switch.
🗋📥 sample-storage-abbr.tex
+ This document illustrates how add custom storage keys (using \glsaddstoragekey). The document build is:
pdflatex sample-storage-abbr
+makeglossaries sample-storage-abbr
+pdflatex sample-storage-abbr
+

+The custom storage key is called abbrtype which defaults to “word” if not explicitly set. Its value can be accessed with the provided custom command \abbrtype.

\glsaddstoragekey{abbrtype}{word}{\abbrtype}
+
A custom acronym style is then defined that checks the value of this key and makes certain adjustments depending on whether or not its value is the default “word”.

+This essentially forms a very similar function to the glossaries-extra package’s category key, which is also defined as a storage key:

\glsaddstoragekey{category}{general}{\glscategory}
+

+

+This document is much simpler with the glossaries-extra package:
\documentclass{article}
+\usepackage[postdot]{glossaries-extra}
+\makeglossaries
+\setabbreviationstyle[acronym]{short-long}
+\newacronym{radar}{radar}{radio detecting and ranging}
+\newacronym{laser}{laser}{light amplification by stimulated
+emission of radiation}
+\newacronym{scuba}{scuba}{self-contained underwater breathing
+apparatus}
+
+\newabbreviation{dsp}{DSP}{digital signal processing}
+\newabbreviation{atm}{ATM}{automated teller machine}
+
+\begin{document}
+First use: \gls{radar}, \gls{laser}, \gls{scuba}, \gls{dsp},
+\gls{atm}.
+
+Next use: \gls{radar}, \gls{laser}, \gls{scuba}, \gls{dsp},
+\gls{atm}.
+
+\printglossaries
+\end{document}
+

+

🗋📥 sample-storage-abbr-desc.tex
+ An extension of the previous example where the user needs to provide a description.

+

🗋📥 sample-chap-hyperfirst.tex
+ This document illustrates how to add a custom key using \glsaddstoragekey and hook into the \gls-like and \glstext-like mechanism used to determine whether or not to hyperlink an entry. The document build is:
pdflatex sample-chap-hyperfirst
+makeglossaries sample-chap-hyperfirst
+pdflatex sample-chap-hyperfirst
+
This example creates a storage key called “chapter” used to store the chapter number.
\glsaddstoragekey{chapter}{0}{\glschapnum}
+
It’s initialised to 0 and the \glslinkpostsetkeys hook is used to check this value against the current chapter number. If the values are the same then the hyperlink is switched off, otherwise the key value is updated unless the hyperlink has been switched off (through the optional argument of commands like \gls and \glstext).
\renewcommand*{\glslinkpostsetkeys}{% 
+ \edef\currentchap{\arabic{chapter}}% 
+ \ifnum\currentchap=\glschapnum{\glslabel}\relax
+  \setkeys{glslink}{hyper=false}% 
+ \else
+  \glsifhyperon{\glsfieldxdef{\glslabel}{chapter}{\currentchap}}{}% 
+ \fi
 }
-\newcommand{\glstextaccsupp}{\glsnameaccsupp}
-\newcommand{\glspluralaccsupp}{\glsnameaccsupp}
-\newcommand{\glsfirstaccsupp}{\glsnameaccsupp}
-\newcommand{\glsfirstplaccsupp}{\glsnameaccsupp}
-
-

-

See the documented code (glossaries-code.pdf) for further details. I recommend that you also read the -accsupp documentation. See also the accessibility and tagpdf packages. - - -

-

-

Top

18. Sample Documents

-

The glossaries package is provided with some sample documents that illustrate the various functions. These -should be located in the samples subdirectory (folder) of the glossaries documentation directory. This -location varies according to your operating system and TeX distribution. You can use texdoc -to locate the main glossaries documentation. For example, in a terminal or command prompt, -type: -


-   
texdoc -l glossaries -
-
-This should display a list of all the files in the glossaries documentation directory with their full pathnames. -(The GUI version of texdoc may also provide you with the information.) -

If you can’t find the sample files on your computer, they are also available from your nearest CTAN mirror -at http://mirror.ctan.org/macros/latex/contrib/glossaries/samples/. Each sample file listed below has -a hyperlink to the file’s location on the CTAN mirror. -

The glossaries-extra package and bib2gls provide some additional sample files. There are also examples in -the Dickimaw Books Gallery. -

If you prefer to use UTF-8 aware engines (xelatex or lualatex) remember that you’ll need to switch from -fontenc & inputenc to fontspec where appropriate. -

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 “Package: ”.) Where hyperref is loaded you will get -warnings about non-existent references that look something like: - - -

-
-pdfTeX warning (dest): name{glo:aca} has been
-referenced but does not exist, replaced by a fixed one
-
-

These warnings may be ignored on the first LaTeX run. (The destinations won’t be defined until the glossary -has been created.) -

-

Top

18.1 Basic

- -

-

-

🔗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: -

    -
  1. -

    Run minimalgls.tex through LaTeX either by typing -

    
    -     
    pdflatex minimalgls -
    -
    - in a terminal or by using the relevant button or menu item in your text editor or front-end. This will - create the required associated files but you will not see the glossary in the document. -

  2. -
  3. -

    If you have Perl installed, run makeglossaries on the document (§1.5 Generating the - Associated Glossary Files). This can be done on a terminal by typing: -

    
    -     
    makeglossaries minimalgls -
    -
    - otherwise do: -

    
    -                                                                                      
    -                                                                                      
    -     
    makeglossaries-lite minimalgls -
    -
    - If for some reason you want to call makeindex explicitly, you can do this in a terminal by typing (all on - one line): -

    
    -     
    makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo -
    -
    - See §1.5.4 Using makeindex explicitly (Option 2) for further details on using makeindex - explicitly. -

    Note that if the file name contains spaces, you will need to use the double-quote character to delimit the - name. -

  4. -
  5. -

    Run minimalgls.tex through LaTeX again (as step 1)

-

You should now have a complete document. The number following each entry in the glossary is the location -number. By default, this is the page number where the entry was referenced. -

The acronym package option creates a second glossary with the label acronym (which can be referenced with -\acronymtype). If you decide to enable this option then there will be a second set of glossary files that need to -be processed by makeindex. If you use makeglossaries or makeglossaries-lite you don’t need to worry -about it, as those scripts automatically detect which files need to be processed and will run makeindex (or -xindy) the appropriate number of times. -

If for some reason you don’t want to use makeglossaries or makeglossaries-lite and you want the -acronym package option then the complete build process is: -


-   
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 -
-
-

There are three other files that can be used as minimal working examples: mwe-gls.tex, mwe-acr.tex and -mwe-acr-desc.tex. -


glossaries-extraIf you want to try out the glossaries-extra extension package, you need to replace the package -loading line:

-
-\usepackage[acronym]{glossaries} - - -
-
with:
-
-\usepackage[acronym,postdot,stylemods]{glossaries-extra} -
-
Note the different default package options. (You may omit the acronym package option in both cases if -you only want a single glossary.) The glossaries-extra package internally loads the base glossaries -package so you don’t need to explicitly load both (in fact, it’s better to let glossaries-extra load -glossaries). -

Next, replace:

-
-\setacronymstyle{long-short} -
-
with:
-
-\setabbreviationstyle[acronym]{long-short} -
-
The optional argument acronym identifies the category that this style should be applied to. The \newacronym -command provided by the base glossaries package is redefined by glossaries-extra to use \newabbreviation with -the category set to acronym. -

If you prefer to replace \newacronym with \newabbreviation then the default category is abbreviation so the -style should instead be:

-
-\setabbreviationstyle[abbreviation]{long-short} -
-
This is actually the default category if the optional argument is omitted, so you can simply do: -
-
-\setabbreviationstyle{long-short} -
-
The long-short style is the default for the abbreviation category so you can omit this line completely if you -replace \newacronym. (The default style for the acronym category is short-nolong, which only shows the short -form on first use.) -

As mentioned earlier, the acronym package option creates a new glossary with the label acronym. This is -independent of the acronym category. You can use the acronym package option with either \newacronym or -\newabbreviation. -

You may instead prefer to use the abbreviations package option, which creates a new glossary with the label -abbreviations:

- - -
-\usepackage[abbreviations,postdot,stylemods]{glossaries-extra} -
-
This can again be used with either \newacronym or \newabbreviation, but the file extensions are different. -This isn’t a problem if you are using makeglossaries or makeglossaries-lite. If you are explicitly calling -makeindex (or xindy) then you need to modify the file extensions. See the glossaries-extra user manual for -further details. -

If you use both the acronym and abbreviations package options then \newacronym will default to the acronym -glossary and \newabbreviation will default to the abbreviations glossary. -

bib2glsIf you want to try bib2gls, you first need to convert the document to use glossaries-extra as -described above. Then add the record package option. For example:

-
-\usepackage[record,postdot,stylemods]{glossaries-extra} -
-
Next you need to convert the entry definitions into the bib format required by bib2gls. This can easily be -done with convertgls2bib. For example: -


-   
convertgls2bib --preamble-only minimalgls.tex entries.bib -
-
-This will create a file called entries.bib. Next, replace:

-
-\makeglossaries -
-
with:
-
-\GlsXtrLoadResources[src=entries] -
-
Now remove all the entry definitions in the preamble (\longnewglossaryentry, \newglossaryentry and -\newacronym or \newabbreviation). -

The abbreviation style command must go before \GlsXtrLoadResources. For example (if you are using -\newacronym):

-
-\setabbreviationstyle[acronym]{long-short} -
\GlsXtrLoadResources[src=entries] -
-
Finally, replace: - - -
-\printglossaries
-
-

with:

-
-\printunsrtglossaries -
-
The document build is now: -


-   
pdflatex minimalgls -
bib2gls minimalgls -
pdflatex minimalgls -
-
- -

-

-

🔗sampleDB.tex

-

This document illustrates how to load external files containing the glossary definitions. It also illustrates how to -define a new glossary type. This document has the number list suppressed and uses \glsaddall to add all the -entries to the glossaries without referencing each one explicitly. (Note that it’s more efficient to -use glossaries-extra and bib2gls if you have a large number of entries.) To create the document -do: -


-   
pdflatex sampleDB -
makeglossaries sampleDB -
pdflatex sampleDB -
-
-or -


-   
pdflatex sampleDB -
makeglossaries-lite sampleDB -
pdflatex sampleDB -
-
-The glossary definitions are stored in the accompanying files database1.tex and database2.tex. -If for some reason you want to call makeindex explicitly you must have a separate call for each -glossary: - - -

    -
  1. -

    Create the main glossary (all on one line): -

    
    -     
    makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo -
    -
    -

  2. -
  3. -

    Create the secondary glossary (all on one line): -

    
    -     
    makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn -
    -
    - Note that both makeglossaries and makeglossaries-lite do this all in one call, so they not only make - it easier because you don’t need to supply all the switches and remember all the extensions but they also - call makeindex the appropriate number of times.

-

bib2glsIf you want to switch to using bib2gls with glossaries-extra, you can convert database1.tex and -database2.tex to bib files using convertgls2bib: -


-   
convertgls2bib database1.tex database1.bib -
convertgls2bib database2.tex database2.bib -
-
-The document code then needs to be:

-
-\documentclass{article} -
-
\usepackage[colorlinks,plainpages=false]{hyperref} -
\usepackage[record,postdot]{glossaries-extra} -
-
\newglossary*{punc}{Punctuation Characters} -
-
\GlsXtrLoadResources[src={database1}, -
 selection=all,sort=en] -
\GlsXtrLoadResources[src={database2},type=punc, - - -
 selection=all,sort=letter-case] -
-
\begin{document} -
\printunsrtglossaries -
\end{document} -
-
Note that the nonumberlist package option has been omitted. It’s not needed because there are no -locations in this amended document (whereas in the original sampleDB.tex locations are created with -\glsaddall). The starred \newglossary* is used since the makeindex/xindy extensions are now -irrelevant. -

Instead of using makeglossaries you need to use bib2gls when you build the document: -


-   
pdflatex sampleDB -
bib2gls sampleDB -
pdflatex sampleDB -
-
-Note that one bib2gls call processes all the indexing (rather than one call per glossary). Unlike makeindex and -xindy, bib2gls processes each resource set in turn, but the resource sets aren’t linked to a specific glossary. -Multiple glossaries 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 letter groups, you need to use the --group switch: -


-   
bib2gls --group sampleDB -
-
-and use an appropriate glossary style. -

See also bib2gls gallery: sorting, glossaries-extra and bib2gls: An Introductory Guide and the bib2gls user -manual. -

-

-

Top

18.2 Acronyms and First Use

- -

-

-

🔗sampleAcr.tex

-

This document has some sample abbreviations. It also adds the glossary to the table of contents, so an extra run -through LaTeX is required to ensure the document is up to date: -


-                                                                                      
-                                                                                      
-   
pdflatex sampleAcr -
makeglossaries sampleAcr -
pdflatex sampleAcr -
pdflatex sampleAcr -
-
-(or use makeglossaries-lite). -

Note that if the 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 makeglossaries and LaTeX call are required. In -this particular example, the glossary is at the end of the document so it’s not a problem. It’s also -not a problem for a glossary at the start of the document if the page numbering is reset at the -end of the glossary. For example, if the glossary is at the end of the front matter in a book-style -document. -

This document uses \ifglsused to determine whether to use “a” or “an” in:

-
- is \ifglsused{svm}{an}{a} \gls{svm}  -
-
This clumsy bit of code can be tidied up with the glossaries-prefix package. Since that package automatically -loads glossaries and passes all its options to the base package it’s possible to do a simple replacement -of: - - -
-\usepackage[style=long,toc]{glossaries}
-
-

with:

-
-\usepackage[style=long,toc]{glossaries-prefix} -
-
The definition of svm now needs an adjustment:
-
-\newacronym[description={statistical pattern recognition -
technique~\protect\cite{svm}}, -
prefixfirst={a~},prefix={an\space} -
]{svm}{svm}{support vector machine} -
-
The clumsy text can now simply be changed to:
-
- is \pgls{svm}  -
-
-


glossaries-extraIf you want to convert this sample document to use glossaries-extra, you may want the -patched version of the styles provided in glossary-long, in which case you can also add stylemods: -

-
-\usepackage[stylemods,style=long]{glossaries-extra} -
-
If you want to suppress all the other glossary style packages with nostyles, then you need to specify exactly -which package (or packages) that you do want:
-
-\usepackage[nostyles,stylemods=long,style=long]{glossaries-extra} -
-
(Now that glossaries-extra is being used, there are more available “long” styles in the glossary-longextra package, -which you may prefer.) - - -

If you want to use glossaries-prefix, you can either load it after glossaries-extra or (with at least glossaries-extra -v1.42) you can simply use the prefix package option. -

Note that the toc package option has been dropped. This is the default with glossaries-extra, so it doesn’t -need to be specified now. The document build is now shorter: -


-   
pdflatex sampleAcr -
makeglossaries sampleAcr -
pdflatex sampleAcr -
-
-The third LaTeX call is no longer required to make the table of contents up-to-date. This is because -glossaries-extra provides boilerplate text on the first LaTeX call when the glossary files are missing. This means -that the glossary header is added to the toc file on the first LaTeX call, whereas with just the base glossaries -package, the header isn’t present until the second LaTeX call. (As with just the base glossaries package, if the -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 glossaries -package.) -

The other different default setting is the post-description punctuation. The base package has nopostdot=false -as the default. This means that a full stop (period) is automatically inserted after the description in the -glossary. The extension package has nopostdot=true as the default. If you want the original behaviour then you -can use nopostdot=false or the shorter synonym postdot. -

The glossaries-extra package has different abbreviation handling that’s far more flexible than that provided -by the base glossaries package. The style now needs to be set with \setabbreviationstyle instead of -\setacronymstyle:

-
-\setabbreviationstyle[acronym]{long-short-sc} -
\newacronym{svm}{svm}{support vector machine} -
-
(Note the different style name long-short-sc instead of long-sc-short and the optional argument acronym.) If -you prefer to replace \newacronym with \newabbreviation then omit the optional argument: -
-
-\setabbreviationstyle{long-short-sc} -
\newabbreviation{svm}{svm}{support vector machine} -
-
(The optional argument of \setabbreviationstyle is the category to which the style should be -applied. If it’s omitted, abbreviation is assumed. You can therefore have different styles for different -categories.) -

Finally, you need to replace \acrshort, \acrlong and \acrfull and their variants with \glsxtrshort, -\glsxtrlong and \glsxtrfull etc. - - - -

-

-

🔗sampleAcrDesc.tex

-

This is similar to the previous example, except that the abbreviations have an associated description. As with -the previous example, the glossary is added to the table of contents, so an extra run through LaTeX is -required: -


-   
pdflatex sampleAcrDesc -
makeglossaries sampleAcrDesc -
pdflatex sampleAcrDesc -
pdflatex sampleAcrDesc -
-
-This document uses the acronym package option, which creates a new glossary used by \newacronym. This -leaves the default main glossary available for general terms. However, in this case there are no general terms so -the main glossary is redundant. The nomain package option will prevent its creation. Obviously, if you decide to -add some terms with \newglossaryentry you will need to remove the nomain option as the main glossary will -now be required. -


glossaries-extraAs with the previous example, if you want to convert this document to use glossaries-extra you -need to make a few modifications. The most obvious one is to replace glossaries with glossaries-extra in -the \usepackage argument. Again you can omit toc as this is the default for glossaries-extra. As in the previous -example, you may want to use the patched styles. This document uses altlist which is provided by glossary-list, so -the style can be patched with stylemods.

-
-\usepackage[acronym,nomain,style=altlist,stylemods]{glossaries-extra} -
-
You may prefer to replace the acronym option with abbreviations, but this will change the file -extensions. If you use makeglossaries or makeglossaries-lite you don’t need to worry about -it. -

Again the style command needs to be changed:

-
-\setabbreviationstyle[acronym]{long-short-sc-desc} -
-
(Note the change in style name long-short-sc-desc instead of long-sc-short-desc and the optional argument -acronym.) -

As with the previous example, if you prefer to use \newabbreviation instead of \newacronym then you need -to omit the optional argument:

-
-\setabbreviationstyle{long-short-sc-desc} - - -
-
The original document uses:
-
-\renewcommand*{\glsseeitemformat}[1]{% -
 \acronymfont{\glsentrytext{#1}}} -
-
to ensure that the cross-references (from the see key) use the acronym font. The new abbreviation styles don’t -use \acronymfont so this isn’t appropriate with glossaries-extra. If you’re using at least version 1.42 of -glossaries-extra, you don’t need to do anything as it automatically redefines \glsseeitemformat to take the -style formatting into account. If you have an earlier version you can redefine this command as follows: -
-
-\renewcommand*{\glsseeitemformat}[1]{% -
 \ifglshasshort{#1}{\glsfmttext{#1}}{\glsfmtname{#1}}% -
} -
-
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:
-
-\renewcommand*{\glsseeitemformat}[1]{\glsfmtname{#1}} -
-
-

The glossaries-extra package provides two additional cross-referencing keys seealso and alias, so see={[see -also]{svm}} can be replaced with a more appropriate key:

-
-\newacronym[description={Statistical pattern recognition -
technique using the ``kernel trick''}, -
seealso={svm}, -
]{ksvm}{ksvm}{kernel support vector machine} -
-
-

Finally, as with the previous example, you need to replace \acrshort, \acrlong and \acrfull etc with -\glsxtrshort, \glsxtrlong and \glsxtrfull etc. -

bib2glsIf you want to convert this document so that it uses bib2gls, you first need to convert it to use -glossaries-extra, as above, but remember that you now need the record option:

- - -
-\usepackage[acronym,nomain,style=altlist,record,postdot,stylemods] -
{glossaries-extra} -
-
Now you need to convert the abbreviation definitions to the bib format required by bib2gls. This can be done -with: -


-   
convertgls2bib --preamble-only sampleAcrDesc.tex entries.bib -
-
-If you retained \newacronym from the original example file, then the new entries.bib file will contain entries -defined with @acronym. For example:

-
-@acronym{ksvm, -
  description = {Statistical pattern recognition technique -
  using the ``kernel trick''}, -
  seealso = {svm}, -
  short = {ksvm}, -
  long = {kernel support vector machine} -
} -
-
If you switched to \newabbreviation then the entries will instead be defined with @abbreviation. -

Next replace \makeglossaries with the resource command, but note that the abbreviation style must be set -first:

-
-\setabbreviationstyle[acronym]{long-short-sc-desc} -
\GlsXtrLoadResources[src=entries,% terms defined in entries.bib -
 abbreviation-sort-fallback=long] -
-
Another possibility is to make @acronym behave as though it was actually @abbreviation:
-
-\setabbreviationstyle{long-short-sc-desc} -
\GlsXtrLoadResources[src=entries,abbreviation-sort-fallback=long, -
 entry-type-aliases={acronym=abbreviation}
] -
-
Note that the category is now abbreviation not acronym so the optional argument of \setabbreviationstyle -needs adjusting. -

If the sort field is missing (which should usually be the case), then both @acronym and @abbreviation will -fallback on the short field (not the name field, which is usually set by the style and therefore not visible to -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 -bib2gls manual for further details and other examples. -

Remember to delete any \newacronym or \newabbreviation in the tex file. Finally replace \printglossary -with \printunsrtglossary. The document build is now: -


-   
pdflatex sampleAcrDesc -
bib2gls sampleAcrDesc -
pdflatex sampleAcrDesc -
-
-

Note that it’s now much easier to revert back to the descriptionless style used in sampleAcr.tex: -

-
-\setabbreviationstyle[acronym]{long-short-sc} -
\GlsXtrLoadResources[src=entries,ignore-fields=description] -
-
With the other options it would be necessary to delete all the description fields from the abbreviation -definitions in order to omit them, but with bib2gls you can simply instruct bib2gls to ignore the description. -This makes it much easier to have a large database of abbreviations for use across multiple documents that may -or may not require the description. - -

-

-

🔗sampleDesc.tex

-

This is similar to the previous example, except that it defines the abbreviations using \newglossaryentry -instead of \newacronym. As with the previous example, the glossary is added to the table of contents, so an -extra run through LaTeX is required: -


-   
pdflatex sampleDesc -
makeglossaries sampleDesc -
pdflatex sampleDesc -
pdflatex sampleDesc -
-
-This sample file demonstrates the use of the first and text keys but in general it’s better to use \newacronym -instead as it’s more flexible. For even greater flexibility use \newabbreviation provided by glossaries-extra. For -other variations, such as showing the symbol on first use, you may prefer to make use of the post-link category -hook. For examples, see the section “Changing the Formatting” in glossaries-extra and bib2gls: An Introductory -Guide. - - - -

-

-

🔗sampleFnAcrDesc.tex

-

This document has some sample abbreviations that use the footnote-sc-desc acronym style. As with the -previous example, the glossary is added to the table of contents, so an extra run through LaTeX is -required: -


-   
pdflatex sampleFnAcrDesc -
makeglossaries sampleFnAcrDesc -
pdflatex sampleFnAcrDesc -
pdflatex sampleFnAcrDesc -
-
-
glossaries-extraIf you want to convert this sample document to use glossaries-extra, then you just need to follow -the same steps as for sampleAcr.tex with a slight modification. This time the short-sc-footnote-desc -abbreviation style is needed:

-
-\setabbreviationstyle[acronym]{short-sc-footnote-desc} -
-
The command redefinitions (performed with \renewcommand) should now all be deleted as they are no longer -applicable. -

You may prefer to use the short-sc-postfootnote-desc style instead. There are subtle differences between the -postfootnote and footnote set of styles. Try changing the abbreviation style to short-sc-footnote and compare the -location of the footnote marker with the two styles. -

This modified sample file now has a shorter build: -


-   
pdflatex sampleFnAcrDesc -
makeglossaries sampleFnAcrDesc -
pdflatex sampleFnAcrDesc -
-
-This is because the glossaries-extra package produces boilerplate text when the glossary file is missing (on the -first LaTeX run) which adds the glossary title to the table of contents (toc) file. - -

-

-

🔗sampleCustomAcr.tex

-

This document has some sample abbreviations with a custom acronym style. It also adds the glossary to the -table of contents, so an extra run through LaTeX is required: -


-   
pdflatex sampleCustomAcr -
makeglossaries sampleCustomAcr - - -
pdflatex sampleCustomAcr -
pdflatex sampleCustomAcr -
-
-This is a slight variation on the previous example where the name is in the form ⟨long⟩ (⟨short⟩) instead of ⟨short⟩ -(⟨long⟩), and the sort key is set to the long form instead of the short form. On first use, the footnote text is in -the form ⟨long⟩: ⟨description⟩ (instead of just the long form). This requires defining a new acronym style that -inherits from the footnote-sc-desc style. -


glossaries-extraThe conversion to glossaries-extra starts in much the same way as the previous examples: -

-
-\usepackage[acronym,nomain,postdot,stylemods,style=altlist] -
{glossaries-extra} -
-
The abbreviation styles have associated helper commands that may be redefined to make minor modifications. -These redefinitions should be done before the abbreviations are defined. -

The short-sc-footnote-desc abbreviation style is the closest match to the requirement, so replace the -\setacronymstyle command with:

-
-\setabbreviationstyle[acronym]{short-sc-footnote-desc} -
-
Again, you may prefer 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 ⟨long⟩ (⟨short⟩): -

-
-\renewcommand*{\glsxtrfootnotedescname}{% -
  \protect\glslongfont{\the\glslongtok}% -
  \protect\glsxtrfullsep{\the\glslabeltok}% -
  \protect\glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}% -
} -
-
This command expands when the abbreviations are defined so take care to \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:
-
-\renewcommand*{\glsxtrfootnotedescsort}{\the\glslongtok} - - -
-
The footnote for all the footnote abbreviation styles is produced with:
-
-\glsxtrabbrvfootnote{label}{text} -
-
where ⟨text⟩ is the singular or plural long form, depending on what command was used to reference the -abbreviation (\gls, \glspl etc). This can simply be redefined as:
-
-\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{% -
  #2: \glsentrydesc{#1}}} -
-
This will mimic the result from the original sample document. -

You may prefer to replace #2 with a reference to a specific field (or fields). For example:

-
-\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{% -
 \Glsfmtlong{#1} (\glsfmtshort{#1}): \glsentrydesc{#1}.}} -
-
As with the earlier sampleAcrDesc.tex, you need to remove or change the redefinition of \glsseeitemformat -since \acronymfont is no longer appropriate. -

In the original sampleCustomAcr.tex source code, I started the description with a capital: - - -

-
-\newacronym[description={Statistical pattern recognition
-technique using the ``kernel trick''},
-see={[see also]{svm}},
-]{ksvm}{ksvm}{kernel support vector machine}
-
-

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 glossary. The solution to this problem is easy with -glossaries-extra. I start the description with a lowercase letter and set the glossdesc attribute to firstuc: -

-
-\glssetcategoryattribute{acronym}{glossdesc}{firstuc} -
-
The abbreviation definitions are modified slightly:
-
-\newacronym[description={statistical pattern recognition -
technique using the ``kernel trick''}, -
seealso={svm}, -
]{ksvm}{ksvm}{kernel support vector machine} -
-
Note the use of the seealso key, which is only available with glossaries-extra. -

If you prefer to use \newabbreviation instead of \newacronym, then the category needs to be abbreviation -rather than acronym:

-
-\glssetcategoryattribute{abbreviation}{glossdesc}{firstuc} -
-
and the style command needs to be adjusted so that it omits the optional argument. For example: -
-
-\setabbreviationstyle{short-sc-postfootnote-desc} -
-
- - - -

-

-

🔗sample-FnDesc.tex

-

This example defines a custom display format that puts the description in a footnote on first use. -


-   
pdflatex sample-FnDesc -
makeglossaries sample-FnDesc -
pdflatex sample-FnDesc -
-
-In order to prevent nested hyperlinks, this document uses the hyperfirst=false package option (otherwise the -footnote marker hyperlink would be inside the hyperlink around the link text which would result in a nested -hyperlink). -


glossaries-extraThe glossaries-extra package has category post-link hooks that make it easier to adjust the -formatting. The post-link hook is placed after the hyperlink around the link text, so a hyperlink created by -\footnote in the post-link hook won’t cause a nested link. This means that the hyperfirst=false option isn’t -required:

-
-\usepackage[postdot,stylemods]{glossaries-extra} -
-
-

Never use commands like \gls or \glsdesc in the post-link hook as you can end up with infinite recursion. -Use commands that don’t themselves have a post-link hook, such as \glsentrydesc or \glossentrydesc, -instead.
-

-

In the original sample-FnDesc.tex file, the format was adjusted with:

-
-\renewcommand*{\glsentryfmt}{% -
  \glsgenentryfmt -
  \ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}% -
} -
-
This can be changed to:
-
-\glsdefpostlink -
{general}% category label -
{\glsxtrifwasfirstuse{\footnote{\glsentrydesc{\glslabel}}}{}} - - -
-
This sets the post-link hook for the general category (which is the default category for entries defined with -\newglossaryentry). If I added some abbreviations (which have a different category) then this change wouldn’t -apply to them. -

The first paragraph in the document is: - - -

-
-First use: \gls{sample}.
-
-

So the PDF will have the word “sample” (the link text created by \gls{sample}) as a hyperlink to the entry in -the glossary followed by the footnote marker, which is a hyperlink to the footnote. This is then followed by the -sentence terminator. “First use: sample1.” -

It would look tidier if the footnote marker could be shifted after the full stop. “First use: sample.1” This can -easily be achieved with a minor modification:

-
-\glsdefpostlink -
{general}% category label -
{\glsxtrifwasfirstuse -
 {\glsxtrdopostpunc{\footnote{\glsentrydesc{\glslabel}}}}% -
 {}% -
} -
-
You may prefer to use \glossentrydesc instead of \glsentrydesc. This will obey the glossdesc attribute. If -you append \glspostdescription, you can also pick up the postdot package option. For example: -
-
-\glssetcategoryattribute{general}{glossdesc}{firstuc} -
-
\glsdefpostlink -
{general}% category label -
{\glsxtrifwasfirstuse -
 {\glsxtrdopostpunc{\footnote{% -
    \glossentrydesc{\glslabel}\glspostdescription}}}% -
 {}% -
} -
-
Alternatively, you could just use \Glsentrydesc and explicitly append the full stop. - -

-

-

🔗sample-custom-acronym.tex

-

This document illustrates how to define your own acronym style if the predefined styles don’t suit your -requirements. - - -


-   
pdflatex sample-custom-acronym -
makeglossaries sample-custom-acronym -
pdflatex sample-custom-acronym -
-
-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 first use. The long form is used for the sort value. The short form is displayed in small caps in the -main part of the document but in uppercase in the list of acronyms. (So it’s a slight variation of some of the -examples above.) The name is set to the long form (starting with an initial capital) followed by the all caps short -form in parentheses. The final requirement is that the inline form should show the long form followed by the -short form in parentheses. -


glossaries-extraAs with sampleFnAcrDesc.tex, the short-sc-footnote-desc and short-sc-postfootnote-desc -abbreviation styles 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 abbreviation -style, but it can mostly inherit from the short-sc-footnote-desc or short-sc-postfootnote-desc style: -

-
-\newabbreviationstyle{custom-fn}% -
{% -
  \GlsXtrUseAbbrStyleSetup{short-sc-footnote-desc}% -
}% -
{% -
  \GlsXtrUseAbbrStyleFmts{short-sc-footnote-desc}% -
  \renewcommand*{\glsxtrinlinefullformat}[2]{% -
    \glsfirstlongfootnotefont{\glsaccesslong{##1}% -
       \ifglsxtrinsertinside##2\fi}% -
     \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% -
    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% -
  }% -
  \renewcommand*{\glsxtrinlinefullplformat}[2]{% -
    \glsfirstlongfootnotefont{\glsaccesslongpl{##1}% -
       \ifglsxtrinsertinside##2\fi}% -
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% -
    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% -
  }% -
  \renewcommand*{\Glsxtrinlinefullformat}[2]{% -
    \glsfirstlongfootnotefont{\Glsaccesslong{##1}% -
       \ifglsxtrinsertinside##2\fi}% -
     \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% -
    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% -
  }% -
  \renewcommand*{\Glsxtrinlinefullplformat}[2]{% -
    \glsfirstlongfootnotefont{\Glsaccesslongpl{##1}% - - -
       \ifglsxtrinsertinside##2\fi}% -
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% -
    \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% -
  }% -
} -
-
(See the glossaries-extra user manual for further details.) -

This new custom style now needs to be set:

-
-\setabbreviationstyle[acronym]{custom-fn} -
-
Remember that if you decide to use \newabbreviation instead of \newacronym then the category will be -abbreviation not acronym:
-
-\setabbreviationstyle{custom-fn} -
-
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: -
-
-\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote{#2: -
\glsentrydesc{#1}.}} -
-
As with sampleCustomAcr.tex, if you specifically want the singular long form then you can ignore the second -argument. For example:
-
-\renewcommand*{\glsxtrabbrvfootnote}[2]{\footnote -
 {\Glsfmtlong{#1}: \glsentrydesc{#1}.}} -
-
-

The 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 all capitals not small caps and the long form should start with -a capital letter.

- - -
-\renewcommand*{\glsxtrfootnotedescname}{% -
  \protect\glsfirstlongfootnotefont -
    {\makefirstuc{\the\glslongtok}} -
  (\protect\MakeTextUppercase{\the\glsshorttok})% -
} -
-
The inherited abbreviation style uses the short form as the sort value by default. This needs to be changed to -the long form:
-
-\renewcommand*{\glsxtrfootnotedescsort}{\the\glslongtok} -
-
-

If you want to switch to using bib2gls, remember to set the abbreviation style before the -resource command and change the default sort fallback field to long, as with sampleAcrDesc.tex. -
-

- -

-

-

🔗sample-dot-abbr.tex

-

This document illustrates how to use the base post link hook to adjust the space factor after abbreviations. -


-   
pdflatex sample-dot-abbr -
makeglossaries sampledot-abbrf -
pdflatex sample-dot-abbr -
-
-This example creates a custom storage key that provides a similar function to glossaries-extra’s category -key. -


glossaries-extraThis example is much simpler with glossaries-extra. The custom storage key, which is defined -using:

-
-\glsaddstoragekey{abbrtype}{word}{\abbrtype} -
-
can now be removed. -

The category key is set to initials for the initialisms (which are defined with the custom \newacr -command). The abbreviation styles can be set with:

- - -
-\setabbreviationstyle[acronym]{long-short} -
\setabbreviationstyle[initials]{long-short} -
-
The discardperiod attribute will discard any full stop (period) following commands like \gls:
-
-\glssetcategoryattribute{initials}{discardperiod}{true} -
-
(If you want to use the noshortplural attribute then you will also need to set the pluraldiscardperiod -attribute.) -

The first use is governed by the retainfirstuseperiod attribute. If set, the period won’t be discarded if it -follows the first use of commands like \gls. This is useful for styles where the first use doesn’t end with the -short form. In this case, the first use of the long-short style ends with a closing parenthesis, so the end of -sentence might be clearer if the period is retained:

-
-\glssetcategoryattribute{initials}{retainfirstuseperiod}{true} -
-
-

The insertdots attribute can automatically insert dots into the short form with a final space factor -adjustment:

-
-\glssetcategoryattribute{initials}{insertdots}{true} -
-
-

The custom helper command defined in the example needs to be slightly modified:

-
-\newcommand*{\newabbr}[1][]{% -
 \newabbreviation[category=initials,#1]} -
-
The definitions need to be slightly modified to work with the insertdots attribute:
-
-\newabbr{eg}{eg}{eg} -
\newabbr{ie}{ie}{ie} -
\newabbr{bsc}{B{Sc}}{Bachelor of Science} -
\newabbr{ba}{BA}{BA} -
\newabbr{agm}{AGM}{AGM} - - -
-
(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 -“Sc”.) -

The “laser” definition remains unchanged: - - -

-
-\newacronym{laser}{laser}{light amplification by stimulated
-emission of radiation}
-
-

The remaining code in the preamble must now be removed. (It will interfere with glossaries-extra’s category -post-link hooks.) No change is required in the document body. -

See the glossaries-extra user manual for further details about category attributes and post-link -hooks. - -

-

-

🔗sample-font-abbr.tex

-

This document illustrates how to have different fonts for abbreviations within the style. The document build -is: -


-   
pdflatex sample-font-abbr -
makeglossaries sample-font-abbr -
pdflatex sample-font-abbr -
-
-The acronym mechanism provided by the base 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 \glsaddstoragekey that’s -used to hold the font declaration (such as \em). - - -

-
-\glsaddstoragekey{font}{}{\entryfont}
-
-

A new custom acronym style is defined that fetches the font information from this new key so that it can be -applied to the abbreviation. Some helper commands are also provided to define the different types of -abbreviation: - - -

-
-\newcommand*{\newitabbr}[1][]{\newacronym[font=\em,#1]}
-\newcommand*{\newupabbr}{\newacronym}
-\newitabbr{eg}{e.g.}{exempli gratia}
-\newupabbr{bsc}{BSc}{Bachelor of Science}
-
-

This makes the first use of \gls{eg} appear as “exempli gratia (e.g.)” whereas the first use of \gls{bsc} is -“Bachelor of Science (BSc)”. -


glossaries-extraThis example document is much simpler with glossaries-extra. First the \usepackage -command needs adjusting:

-
-\usepackage[postdot,stylemods]{glossaries-extra} -
-
The custom storage key can now be removed and also the custom acronym style. Now replace the -\setacronymstyle line with:
-
-\setabbreviationstyle[acronym]{long-short-em} -
-
and change the definition of the helper commands:
-
-\newcommand*{\newitabbr}{\newacronym} -
\newcommand*{\newupabbr}{\newabbreviation} -
-
Note that the font=\em, part has been removed from the definition of the first command and the second -command uses \newabbreviation instead of \newacronym. This means that \newitabbr will default to -category=acronym and \newupabbr will default to category=abbreviation. The default style for the -abbreviation category is long-short, which is the required style for this example. This just means that -only the acronym category needs to have the style set (with the above \setabbreviationstyle -command). -

Finally, the \acrshort, \acrlong and \acrfull commands need to be replaced with \glsxtrshort, -\glsxtrlong and \glsxtrfull. -

You may notice that the spacing after “e.g.” and “i.e.” isn’t correct. This is similar to the sample-dot-abbr.tex -example where the space factor needs adjusting. In this case I’ve inserted the dots manually (rather than relying -on the insertdots attribute). You can either remove the dots and use insertdots with discardperiod: -

- - -
-\glssetcategoryattribute{acronym}{insertdots}{true} -
\glssetcategoryattribute{acronym}{discardperiod}{true} -
-
\newitabbr{eg}{eg}{exempli gratia} -
\newitabbr{ie}{ie}{id est} -
-
Or you can manually insert the space factor adjustment and only use the discardperiod attribute: -
-
-\glssetcategoryattribute{acronym}{discardperiod}{true} -
-
\newitabbr{eg}{e.g.\@}{exempli gratia} -
\newitabbr{ie}{i.e.\@}{id est} -
-
-

You don’t have to use the acronym category. You may prefer a different label that fits better semantically. -For example:

-
-\setabbreviationstyle[latinabbr]{long-short-em} -
\newcommand*{\newlatinabbr}[1][]{\newabbreviation[category=latinabbr,#1]} -
\glssetcategoryattribute{latinabbr}{insertdots}{true} -
\glssetcategoryattribute{latinabbr}{discardperiod}{true} -
-
\newlatinabbr{eg}{e.g.\@}{exempli gratia} -
\newlatinabbr{ie}{i.e.\@}{id est} -
-
-

-

-

Top

18.3 Non-Page Locations

- -

-

-

🔗sampleEq.tex

- - -

This document illustrates how to change the location to something other than the page number. In this case, -the equation counter is used since all glossary entries appear inside an equation environment. To create the -document do: -


-   
pdflatex sampleEq -
makeglossaries sampleEq -
pdflatex sampleEq -
-
-The glossaries package provides some location formats, such as \hyperrm and \hyperbf, that allow the -locations in the number list to hyperlink to the appropriate place in the document (if hyperref has -been used). Since it’s not possible to include the hyperlink name in the indexing information with -makeindex and xindy, the 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 equation counter in certain classes, such as the report class (which is used in this example). -This means that it’s necessary to redefine \theHequation so that it has a format that fits the -requirement: - - -

-
-\renewcommand*\theHequation{\theHchapter.\arabic{equation}}
-
-

If you don’t do this, the equation locations in the glossary won’t form valid hyperlinks. -

Each glossary entry represents a mathematical symbol. This means that with Options 13 it’s necessary to -use the sort key. For example:

-
-\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, -
description=Gamma function,sort=Gamma} -
-
-

bib2glsIf you want to switch to using bib2gls, the first change you need to make is to switch from -explicitly loading glossaries to loading glossaries-extra with the record package option. If record=only (or record -without a value) is used, then the above redefinition of \theHequation is still required. If record=nameref is used -instead then the redefinition of \theHequation isn’t required. You may also want to use the stylemods and -postdot options:

-
-\usepackage[record=nameref,stylemods,postdot, -
 ucmark,style=long3colheader,counter=equation]{glossaries-extra} -
-
The entries now need to be converted into the bib format required by bib2gls, which can be done with -convertgls2bib: -


-   
convertgls2bib --preamble-only sampleEq.tex entries.bib -
-
-This will create a file called entries.bib that starts:

-
-% Encoding: UTF-8 -
@entry{Gamma, -
  name = {\ensuremath{\Gamma(z)}}, -
  description = {Gamma function} -
} -
-
You may prefer to change @entry to @symbol. (This should be easy to do with your text editor’s search and -replace function.) - - -

Note that the sort key has been omitted. This is because it typically shouldn’t be used. The difference -between using @entry and @symbol is that with @entry the sort value will be obtained from the name but with -@symbol the sort value will be obtained from the label. If you explicitly use the sort key then you will break -this behaviour. (If you try this example out, notice the difference in the ordering if you switch between @entry -and @symbol. See also bib2gls gallery: sorting.) -

Next replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries] -
-
If you have used record=nameref then you can remove the redefinition of \theHequation. Next remove all the -lines defining the glossary entries (since they’re now defined in the bib file). -

Finally, replace \printglossary with \printunsrtglossary:

-
-\printunsrtglossary[title={Index of Special Functions and -
Notations}] -
-
The rest of the document remains unchanged (unless you want to use \glsxtrfmt as described in the following -example). - -

-

-

🔗sampleEqPg.tex

-

This is similar to the previous example, but the number lists are a mixture of page numbers and -equation numbers. This example adds the glossary to the table of contents, so an extra LaTeX run is -required: -


-   
pdflatex sampleEqPg -
makeglossaries sampleEqPg -
pdflatex sampleEqPg -
pdflatex sampleEqPg -
-
-As with the previous example, entries are defined like this: - - -

-
-\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)},
-description=Gamma function,sort=Gamma}
-
-

The counter=equation package option is used to set the default indexing counter to equation. This means that it -has to be changed for indexing outside of any numbered equation. For example: - - -

-
-\glslink[format=hyperbf,counter=page]{Gamma}{gamma function}
-
-

I’ve set the format to hyperbf to indicate that this is a primary reference. (Note that I’m using \hyperbf not -\textbf in order to include a hyperlink in the location.) -

The link text here is almost identical to the description. The only difference is that the description starts -with a capital. If it started with a lowercase character instead, I could simply use \glsdesc instead of -\glslink. If I change the entry descriptions so that they all start with a lowercase letter then I would need to -create a custom glossary style that used \Glossentrydesc instead of \glossentrydesc. -


glossaries-extraIf I switch to using glossaries-extra I wouldn’t need a new glossary style. Instead I could just -use the glossdesc attribute to perform the case change. Remember that the first change to make is to replace -glossaries with glossaries-extra:

-
-\usepackage[style=long3colheader,postdot,stylemods, -
            counter=equation]{glossaries-extra} -
-
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:
-
-\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, -
description=gamma function,sort=Gamma} -
-
The glossdesc attribute needs setting:
-
-\glssetcategoryattribute{general}{glossdesc}{firstuc} -
-
This means that I can now use \glsdesc instead of \glslink. -

It’s a bit cumbersome typing [format=hyperbf,counter=page] for each primary reference, but -glossaries-extra provides a convenient way of having a third modifier for commands like \gls and \glstext. This -needs to be a single punctuation character (but not * or + which are already in use). For example: -

-
-\GlsXtrSetAltModifier{!}{format=hyperbf,counter=page} - - -
-
Now \glsdesc!{Gamma} is equivalent to:
-
-\glsdesc[format=hyperbf,counter=page]{Gamma} -
-
So the text at the start of the “Gamma Functions” chapter is now just:
-
-The \glsdesc!{Gamma} is defined as -
-
which is much more compact. Similar changes can be made for the other instance of \glslink where the link -text is just the description:
-
-The \glsdesc!{erf} is defined as -
-
-

There are three other instances of \glslink, such as:

-
-\glslink{Gamma}{\Gamma(x+1)} -
-
If I just use \gls{Gamma} then I would get Γ(z) as the link text. 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 glossaries package, one simple solution that works for this example is to save just the function -symbol in the symbol field, for example:

-
-\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, -
symbol={\ensuremath{\Gamma}}, -
description=gamma function,sort=Gamma} -
-
and then use:
-
-\glssymbol{Gamma}[(\Gamma(x+1))] -
-
(which includes the function parameter inside the link text) or just:
- - -
-\glssymbol{Gamma}(\Gamma(x+1)) -
-
(which has the function parameter after the link text). This is a convenient approach where the extra material -can simply follow the symbol, and it can also be used with glossaries-extra. -

The glossaries-extra package provides another possibility. It requires a command that takes a single -argument, for example: - - -

-
-\newcommand{\Gammafunction}[1]{\Gamma(#1)}
-
-

The control sequence name (the command name without the leading backslash) is stored in the field identified -by the command \GlsXtrFmtField (this should be the internal field name not the key name, see -table 4.1). The default is useri which corresponds to the user1 key. This means that the Gamma -entry would need to be defined with user1=Gammafunction. With this approach, each function entry would -need a separate associated command. -

Another approach is to store the parameterless function in the symbol key (as earlier) and have a more -generic command that uses this symbol. This requires the entry label, which can be obtained with \glslabel -within the link text:

-
-\newcommand{\entryfunc}[1]{\glsentrysymbol{\glslabel}(#1)} -
-
(Obviously, this command can’t be used outside of the link text or post-link hooks since it uses -\glslabel.) -

So the entry now needs the parameterless function in symbol and the control sequence name of this generic -command in user1. For example:

-
-\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, -
symbol={\ensuremath{\Gamma}},user1=entryfunc, -
description=gamma function,sort=Gamma} -
-
(This doesn’t need to be done for the C and 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: - - -

-
-\newcommand{\func}[2]{#1(#2)}
-\newcommand{\entryfunc}[1]{\func{\glsentrysymbol{\glslabel}}{#1}}
-\newcommand{\newfunc}[5][]{%
- \newglossaryentry{#2}{name={\ensuremath{\func{#3}{#4}}},
-   symbol={#3},
-   user1={entryfunc},
-   description={#5},
-   sort={#2},#1
- }%
+
Since this key isn’t intended for use when the 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 \glsfieldxdef requires the existence of the field. The 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.

+

+If you want to switch to glossaries-extra you need to change the package loading line:
\usepackage[postdot]{glossaries-extra}
+
The custom storage key (provided with \glsaddstoragekey) can be removed, and the \glslinkpostsetkeys hook can be changed to:
\renewcommand*{\glslinkpostsetkeys}{% 
+ \edef\currentchap{\arabic{chapter}}% 
+ \GlsXtrIfFieldEqNum*{chapter}{\glslabel}{\currentchap}
+ {% 
+   \setkeys{glslink}{hyper=false}% 
+ }% 
+ {% 
+   \glsifhyperon{\xGlsXtrSetField{\glslabel}{chapter}{\currentchap}}{}% 
+ }% 
 }
-
-

The entries can now be defined using this custom \newfunc command. For example: - - -

-
-\newfunc{Gamma}{\Gamma}{z}{gamma function}
-\newfunc[sort=gamma1]{gamma}{\gamma}{\alpha,x}{lower
-  incomplete gamma function}
-\newfunc[sort=Gamma2]{iGamma}{\Gamma}{\alpha,x}{upper
-  incomplete gamma function}
-
-

-

Note that in \newfunc the symbol key doesn’t have its value encapsulated with \ensuremath so \glssymbol -will need to explicitly be placed in math mode. If you switch to a glossary style that displays the symbol, you -will either need to adjust the definition of \newfunc to use \ensuremath in the symbol field or you can add the -encapsulation with the glosssymbolfont attribute. -

Now \glslink{Znu}{Z_\nu} can simply be replaced with \glssymbol{Znu} (no parameter is required in -this case). For the other cases, where the parameter is different from that given in the text field (which is -obtained from the name), you can use \glsxtrfmt. For example, \glslink{Gamma}{\Gamma(x+1)} can now be -replaced with:

-
-\glsxtrfmt{Gamma}{x+1} -
-
This effectively works like \glslink but omits the post-link hook. (See the glossaries-extra user manual for -further details.) -

Don’t use \glsxtrfmt within the argument of another \glsxtrfmt command (or inside any other link -text).
-

-

Similarly \glslink{Gamma}{\Gamma(\alpha)} can now be replaced with:

-
-\glsxtrfmt{Gamma}{\alpha} -
-
Note that it’s still possible to use:
-
-\glssymbol{Gamma}[(\alpha)] -
-
You may prefer to define a helper command that makes it easier to switch between your preferred method. For -example: - - -
-\newcommand*{\Fn}[3][]{\glssymbol[#1]{#2}[(#3)]}
-
-

or:

-
-\newcommand*{\Fn}[3][]{\glsxtrfmt[#1]{#2}{#3}} -
-
-

bib2glsIf you want to convert this example so that it works with bib2gls, first convert it to use -glossaries-extra (as described above), and then follow the instructions from sampleEq.tex. The -convertgls2bib application recognises \newcommand so it will be able to parse the custom \newfunc -commands. -

Note that bib2gls allows you to separate the locations in the number list into different groups according to -the counter used for the location. This can be done with the loc-counters resource option. It’s also possible to -identify primary formats (such as hyperbf used in this example) using the primary-location-formats option. -The primary locations can then be given a more prominent position in the number list. See the bib2gls user -manual for further details. - -

-

-

🔗sampleSec.tex

-

This document also illustrates how to change the location to something other than the page number. In this -case, the section counter is used. This example adds the glossary to the table of contents, so an extra -LaTeX run is required: -


-   
pdflatex sampleSec -
makeglossaries sampleSec -
pdflatex sampleSec -
pdflatex sampleSec -
-
-Note that there are conflicting location formats, which trigger a warning from makeindex: - - -

-
-## Warning (input = sampleSec.glo, line = 6; output =
-sampleSec.gls, line = 9):
-   -- Conflicting entries: multiple encaps for the same page
-under same key.
-## Warning (input = sampleSec.glo, line = 2; output =
-sampleSec.gls, line = 10):
-   -- Conflicting entries: multiple encaps for the same page
-under same key.
-
-

This is the result of indexing an entry multiple times for the same -location18.1 -with different values of the format key. In this case, it’s caused by three references to the ident entry in -section 2.1: - - -

-
-\gls[format=hyperit]{ident}
-\glspl{ident} % default format=glsnumberformat
-\gls*[format=hyperbf]{ident}
-
-

-

If you use the makeglossaries Perl script it will detect the warnings in the makeindex transcript file and -attempt to fix the conflict by removing entries from the glo file: - - -

-
-Multiple encaps detected. Attempting to remedy.
-Reading sampleSec.glo...
-Writing sampleSec.glo...
-Retrying
-
-

(Range formats have highest precedence. The default glsnumberformat has the lowest precedence.) -

If you use makeglossaries-lite or call makeindex directly then the problem won’t be fixed and the -glossary will end up with the rather odd number list for the identity matrix entry consisting of three references -to section 2.1: the first in the default font, followed by bold (hyperbf) and then italic (hyperit), -which results in 2.1, 2.1, 2.1. If you use makeglossaries then only the bold entry (2.1) will be -present. -

If you switch to xindy:

-
-\usepackage[xindy,style=altlist,toc,counter=section]{glossaries} -
-
then the conflict will be resolved using the number format attribute list order of priority. In this case, -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: -
-
-\newcommand*{\primary}[1]{\hyperit{#1}} -
\GlsAddXdyAttribute{primary} -
-
and change \gls[format=hyperit] to \gls[format=primary] etc. This will give format=primary the highest -priority. (It’s also better practice to provide this kind of semantic command.) -

With bib2gls, you can supply rules to deal with location format conflicts, as illustrated below. -

bib2glsIn order to switch to bib2gls, first replace glossaries with glossaries-extra, and add the record -package option. Remember that glossaries-extra has a different set of defaults and you may also want to patch -the predefined base styles. For example:

-
-\usepackage[style=altlist,postdot,stylemods,counter=section] -
{glossaries-extra} -
-
-

The entry definitions now need to be converted into bib2gls format and saved in a bib file (say, -entries.bib). You can use convertgls2bib: - - -


-   
convertgls2bib --preamble-only sampleSec.tex entries.bib -
-
-

Next replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries] -
-
and remove all the \newglossaryentry commands. -

Finally, replace \printglossaries with \printunsrtglossaries. The document build is now: -


-   
pdflatex sampleSec -
bib2gls sampleSec -
pdflatex sampleSec -
-
-As with the original example, there’s still a location format conflict, which bib2gls warns about: - - -

-
-Warning: Entry location conflict for formats: hyperbf and hyperit
-Discarding: {ident}{}{section}{hyperbf}{2.1}
-Conflicts with: {ident}{}{section}{hyperit}{2.1}
-
-

This means that it has discarded the bold location and kept the italic one. (As with makeglossaries, range -formats have the highest priority and 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:

-
-\newcommand*{\hyperbfit}[1]{\textbf{\hyperit{#1}}} -
-
Now bib2gls needs to be invoked with the appropriate mapping with the --map-format or -m -switch: -


-   
bib2gls -m ”hyperbf:hyperbfit,hyperit:hyperbfit” sampleSec -
-
-If you are using arara the directive should be:

-
-% arara: bib2gls: { mapformats: [ [hyperbf, hyperbfit], -
% arara: --> [hyperit, hyperbfit] ] } -
-
-

If you try out this example, notice the difference between record=only and record=nameref. If you use the -latter, the locations will now be the section titles rather than the section numbers. If you use the nameref setting -you can customize the location by defining the command:

-
-\glsxtrcounterlocfmt{location}{title} -
-
-

In this case the counter is section, so the command should be \glsxtrsectionlocfmt. It takes two -arguments: the first is the location and the second is the title. For example:

-
-\newcommand*{\glsxtrsectionlocfmt}[2]{\S#1 #2} - - -
-
(The only command of this type that is defined by default is the one for the equation counter, -\glsxtrequationlocfmt.) Make sure that you have at least version 1.42 of glossaries-extra. -

-

-

Top

18.4 Multiple Glossaries

-

See also sampleSort.tex in §18.5 Sorting, which has three glossaries. - -

-

-

🔗sampleNtn.tex

-

This document illustrates how to create an additional glossary type. This example adds the glossary to the table -of contents, so an extra LaTeX run is required: -


-   
pdflatex sampleNtn -
makeglossaries sampleNtn -
pdflatex sampleNtn -
pdflatex sampleNtn -
-
-Note that if you want to call makeindex explicitly instead of using the makeglossaries or makeglossaries-lite -scripts then you need to call makeindex twice: -

    -
  1. -

    Create the main glossary (all on one line): -

    
    -     
    makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo -
    -
    -

  2. -
  3. -

    Create the secondary glossary (all on one line): -

    
    -     
    makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn -
    - - -
    -

-

This document creates a new glossary using:

-
-\newglossary[nlg]{notation}{not}{ntn}{Notation} -
-
This defines a glossary that can be identified with the label notation with the default title “Notation”. The -other arguments are the file extensions required with Options 2 and 3. For those two options, the glossaries -package needs to know the input and output files required by makeindex or xindy. -

(The optional argument is the file extension of the indexing transcript file, which glossaries doesn’t need to -know about, but it writes the information to the aux file for the benefit of makeglossaries and -makeglossaries-lite.) -

If you switch to a different indexing option then these file extensions aren’t required, in which case it’s -simpler to use the starred form:

-
-\newglossary*{notation}{Notation} -
-
-

This example uses a label prefixing system18.2 to -differentiate between the different types of entries. For example, the term “set” is defined as: - - -

-
-\newglossaryentry{gls:set}{name=set,
-description={A collection of distinct objects}}
-
-

and the set notation is defined as: - - -

-
-\newglossaryentry{not:set}{type=notation,
-name={\ensuremath{\mathcal{S}}},
-description={A \gls{gls:set}},sort={S}}
-
-

Notice that the latter description contains \gls. This means you shouldn’t use \glsdesc with this entry -otherwise you will end up with nested links. -


glossaries-extraThe glossaries-extra package provides a command for use in within field values to prevent -nested link text:

-
-\glsxtrp{field}{label} -
-
There are convenient shortcuts for common fields: \glsps{label} (for the short field) and \glspt{label} -(for the text field). So the set notation definition can be modified:
-
-\newglossaryentry{not:set}{type=notation, -
name={\ensuremath{\mathcal{S}}}, -
description={A \glspt{gls:set}},sort=S} -
-
This will stop the inner reference from causing interference if you use \glsdesc. It will also suppress indexing -within the glossary but will have a hyperlink (if hyperref is used). -

The glossaries-extra package provides a way of defining commands like \gls that automatically insert a -prefix. For example:

-
-\glsxtrnewgls{not:}{\sym} -
\glsxtrnewglslike{gls:}{\term}{\termpl}{\Term}{\Termpl} -
-
(there’s no point providing commands for plural or case-changing with symbols). Now \gls{not:set} can be -replaced with \sym{set} and \gls{gls:set} can be replaced with \term{set}. -

bib2glsThese two commands are primarily provided for the benefit of bib2gls as the information is written -to the aux file. This allows bib2gls to recognise the custom commands if they have been used in the bib files. -When combined with label-prefix and ext-prefixes (see below) this makes it much simpler to change the -prefixes if necessary. -

If you want to convert this document to use bib2gls, remember that you need the record or record=nameref -option. For example:

- - -
-\usepackage[record,postdot,stylemods]{glossaries-extra} -
-
As with earlier examples, convertgls2bib can be used to convert the entry definitions into -the required bib format. You may prefer to split the entries into separate files according to -type.18.3 -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: -


-   
convertgls2bib --split-on-type --preamble-only sampleNtn.tex entries.bib -
-
-This will create a file called entries.bib that contains the entries that didn’t have a type assigned in the -original file, such as:

-
-@entry{gls:set, -
  name = {set}, -
  description = {A collection of distinct objects} -
} -
-
It will also create a file called notation.bib that contains the entries that had the type set to notation in the -original file, such as:
-
-@entry{not:set, -
  name = {\ensuremath{\mathcal{S}}}, -
  description = {A \glspt{gls:set}} -
} -
-
Note that the type field has been removed. The above entry in the notation.bib file references a term in -the entries.bib file. It’s possible to strip all the prefixes from the bib files and get 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 extn. prefixes: -
-
-@entry{set, -
  name = {\ensuremath{\mathcal{S}}}, -
  description = {A \glspt{ext1.set}} -
} - - -
-
The corresponding term in the entries.bib file is now:
-
-@entry{set, -
  name = {set}, -
  description = {A collection of distinct objects} -
} -
-
-

Now you can replace \makeglossaries with:

-
-\GlsXtrLoadResources[src={entries},label-prefix={gls:}] -
\GlsXtrLoadResources[src={notation},type=notation, -
 label-prefix={not:},ext-prefixes={gls:}] -
-
Remove all the \newglossaryentry definitions and replace \printglossaries with \printunsrtglossaries. -

Regardless of how many resource sets the document contains, only one bib2gls call is required: -


-   
pdflatex sampleNtn -
bib2gls sampleNtn -
pdflatex sampleNtn -
-
-

You may notice that the ordering in the notations list has changed from the original. This is because the -sort field was automatically removed by convertgls2bib, so the entries are now sorted according to the name -field (since they are defined with @entry). You can use your text editor’s search and replace function to replace -all instances of @entry with @symbol in the notations.bib file so that, for example, the set definition -becomes:

-
-@symbol{set, -
  name = {\ensuremath{\mathcal{S}}}, -
  description = {A \glspt{ext1.set}} -
} -
-
Now these @symbol entries will be sorted according to their label. (The original label in the bib file, not the -prefixed label.) This will put them in the same order as the original document. (See the “Examples” -chapter of the bib2gls user manual for examples of varying the sorting and also bib2gls gallery: -sorting.) - - - -

-

-

🔗sample-dual.tex

-

This document illustrates how to define an entry that both appears in the list of acronyms and in the main -glossary. To create the document do: -


-   
pdflatex sample-dual -
makeglossaries sample-dual -
pdflatex sample-dual -
-
-This defines a custom command \newdualentry that defines two entries at once (a normal entry and -an abbreviation). It uses \glsadd to ensure that if one is used then the other is automatically -indexed: - - -

-
-\newcommand*{\newdualentry}[5][]{%
-  % main entry:
-  \newglossaryentry{main-#2}{name={#4},%
-  text={#3\glsadd{#2}},%
-  description={#5},%
-  #1% additional options for main entry
-  }%
-  % abbreviation:
-  \newacronym{#2}{#3\glsadd{main-#2}}{#4}%
+
The field name is still called “chapter” but there’s no longer an associated key or command.

+ + + +

+

18.9. Xindy (Option 3)

+

+Most of the earlier makeindex sample files can be adapted to use xindy instead by adding the xindy package option. Situations that you need to be careful about are when the sort value (obtained from the name if the sort key is omitted) contains commands (such as name={\pi}) or is identical to another value (or is identical after xindy has stripped all commands and braces). This section describes sample documents that use features which are unavailable with makeindex.

+

🗋📥 samplexdy.tex
+ The document uses UTF-8 encoding (with the inputenc package). This is information that needs to be passed to xindy, so the encoding is picked up by makeglossaries from the aux file.

+This document has an exotic numbering system which requires the package option esclocations=true. Before glossaries v4.50, this was the default setting, but the default is now esclocations=false, so this package option now needs to be set explicitly.

+By default, this document will create a xindy style file called samplexdy.xdy, but if you uncomment the lines

\setStyleFile{samplexdy-mc}
+\noist
+\GlsSetXdyLanguage{}
+
it will set the style file to samplexdy-mc.xdy instead. This provides an additional letter group for entries starting with “Mc” or “Mac”. If you use makeglossaries or makeglossaries-lite, you don’t need to supply any additional information. If you don’t use makeglossaries, you will need to specify the required information. Note that if you set the style file to samplexdy-mc.xdy you must also specify \noist, otherwise the glossaries package will overwrite samplexdy-mc.xdy and you will lose the “Mc” letter group.

+To create the document do:

pdflatex samplexdy
+makeglossaries samplexdy
+pdflatex samplexdy
+
If you don’t have Perl installed then you can’t use makeglossaries, but you also can’t use xindy! However, if for some reason you want to call xindy explicitly instead of using makeglossaries (or makeglossaries-lite): +
    +
  • if you are using the default style file samplexdy.xdy, then do (no line breaks):
    xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo
    +
  • if you are using samplexdy-mc.xdy, then do (no line breaks):
    xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo
    +
    +
+

+This document creates a new command to use with the format key in the optional argument of commands like \gls to format the location in the number list. The usual type of definition when a hyperlinked location is required should use one of the \hyperxx commands listed in Table 12.1:

\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}
+
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 hyperbfit is used in the format key. It does, however, need to be identified as an attribute so that xindy can recognise it:
\GlsAddXdyAttribute{hyperbfit}
+
This will add information to the xdy file when it’s created by \makeglossaries. If you prevent the creation of this file with \noist then you will need to add the attribute to your custom xdy file (see the provided samplexdy-mc.xdy file).

+In order to illustrate unusual location formats, this sample document provides a command called \tallynum{n} that represents its numerical argument with a die or dice where the dots add up to n:

\newrobustcmd*{\tallynum}[1]{% 
+ \ifnum\number#1<7
+  $\csname dice\romannumeral#1\endcsname$% 
+ \else
+  $\dicevi$% 
+  \expandafter\tallynum\expandafter{\numexpr#1-6}% 
+ \fi
 }
-
-

A sample dual entry is defined with this command: - - -

-
-\newdualentry{svm}% label
-  {SVM}% abbreviation
-  {support vector machine}% long form
-  {Statistical pattern recognition technique}% description
-
-

This defines an acronym with the label svm that can be referenced with \gls{svm} but it also defines an entry -with the label main-svm. This isn’t used in the document with \gls but it’s automatically added from the -\glsadd{main-svm} in the short form of 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 -main glossary to look up the description. It’s better to simply include the description in the list of -acronyms. -

bib2glsIf you want to switch over to bib2gls, first change to glossaries-extra:

-
-\usepackage[record,postdot,stylemods,acronym]{glossaries-extra} -
-
Next, the definition needs to be converted to the bib format required by bib2gls. If you do: -


-   
convertgls2bib --preamble-only sample-dual.tex entries.bib -
-
-then convertgls2bib will report the following: - - -

-
-Overriding default definition of \newdualentry with custom
-definition. (Change \newcommand to \providecommand if you want
-\newdualentry[options]{label}{short}{long}{description}
-converted to @dualabbreviationentry.)
-
-

This is because convertgls2bib has its own internal definition of \newdualentry, but if it encounters a -new definition that will override its default. If you want to retain convertgls2bib’s definition -(recommended) then just replace \newcommand with \providecommand in the document source and rerun -convertgls2bib. -

With \providecommand, the new entries.bib file created by convertgls2bib contains:

-
-@dualabbreviationentry{svm, -
  short = {SVM}, -
  description = {Statistical pattern recognition technique}, -
  long = {support vector machine} -
} -
-
If \newcommand is retained, it will instead contain:
-
-@entry{main-svm, -
  name = {support vector machine}, -
  description = {Statistical pattern recognition technique}, -
  text = {SVM\glsadd{svm}} -
} -
-
@acronym{svm, -
  short = {SVM\glsadd{main-svm}}, -
  long = {support vector machine} -
} -
-
In the first case, bib2gls creates two linked entries using its primary-dual mechanism. In the second case, -bib2gls creates two entries that simply reference each other. -

Assuming that your entries.bib file just contains @dualabbreviationentry, now replace -\makeglossaries with:

-
-\GlsXtrLoadResources[src=entries,% entries.bib -
  type=acronym,dual-type=main,dual-prefix={main-}] - - -
-
-

Then remove the definition of \newdualentry and the entry definition. Finally, replace \printglossaries -with \printunsrtglossaries. The document build is: -


-   
pdflatex sample-dual -
bib2gls sample-dual -
pdflatex sample-dual -
-
-

If, instead, your entries.bib file contains separate @entry and @acronym, then you need:

-
-\setabbreviationstyle[acronym]{long-short} -
\GlsXtrLoadResources[src=entries] -
-
If you need number lists, the document build is now -


-   
pdflatex sample-dual -
bib2gls sample-dual -
pdflatex sample-dual -
bib2gls sample-dual -
pdflatex sample-dual -
-
-and this time bib2gls complains about the use of \glsadd within the short and text fields as -this can be problematic. (The extra bib2gls and LaTeX calls are to ensure the number list is -up to date for the main-svm entry, which can only be indexed with \glsadd after svm has been -defined.) -

Dual entries make much more sense when one entry is for a glossary with the description displayed but -no number list, and the other is for the index without the description but with a number list. -This can be created with by replacing @dualabbreviationentry with @dualindexabbreviation: -

-
-@dualindexabbreviation{svm, -
  description = {Statistical pattern recognition technique}, -
  short = {SVM}, -
  long = {support vector machine} -
} -
-
This can be mixed with @index terms for example:
- - -
-@index{machlearn, -
   name={machine learning} -
} -
-
The document needs modifying:
-
-\documentclass{article} -
-
\usepackage[record,postdot, -
 nostyles,stylemods={bookindex,list},% only want bookindex and list styles -
 acronym]{glossaries-extra} -
-
\setabbreviationstyle{long-short-desc} -
\GlsXtrLoadResources[src=entries,% entries.bib -
 dual-type=acronym, -
 label-prefix={idx.},dual-prefix={}, -
 combine-dual-locations={primary}] -
-
\glsxtrnewglslike{idx.}{\idx}{\idxpl}{\Idx}{\Idxpl} -
-
\begin{document} -
\gls{svm} and \idx{machlearn}. -
-
\printunsrtglossary[type=main,style=altlist] -
\printunsrtglossary[style=bookindex,title={Index}] -
\end{document} -
-
See the bib2gls manual for further details. - -

-

-

🔗sample-langdict.tex

-

This document illustrates how to use the glossaries package to create English to French and French to English -dictionaries. To create the document do: -


-   
pdflatex sample-langdict -
makeglossaries sample-langdict -
pdflatex sample-langdict -
- - -
-This example uses the nomain package option to prevent the creation of the main glossary. This means that the -document must provide its own glossaries: - - -

-
-\newglossary[glg]{english}{gls}{glo}{English to French}
-\newglossary[flg]{french}{flx}{flo}{French to English}
-
-

This means that if you want to call makeindex explicitly you need to take these new extensions into -account: -


-   
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 -
-
-As with the previous example, this document provides a custom command that defines two related -entries: - - -

-
-\newcommand*{\newword}[4]{%
-  \newglossaryentry{en-#1}{type=english,name={#2},description={#3 #4}}%
-  \newglossaryentry{fr-#1}{type=french,name={#3 #4},text={#4},sort={#4},
-    description={#2}}%
+
This command needs to be robust to prevent it from being expanded when it’s written to any of the auxiliary files. The \dicei, …, \dicevi commands are provided by the stix package, so that needs to be loaded.

+An associated command \tally{counter} is defined that formats the value of the named counter according to \tallynum:

\newcommand*{\tally}[1]{\tallynum{\arabic{#1}}}
+
(This shouldn’t be robust as it needs the counter value to expand.) The page numbers are altered to use this format (by redefining \thepage).

+This custom location format also needs to be identified in the xdy file so that xindy can recognise it and determine how to form ranges if required.

\GlsAddXdyLocation{tally}{% tally location format
+ :sep "\string\tallynum\space\glsopenbrace"
+ "arabic-numbers" 
+ :sep "\glsclosebrace"
 }
-
-

This has the syntax:

-
-\newword{label}{english}{determiner}{french} -
-
(Note that this trivial example doesn’t take plurals into account.) This custom command will -define two terms with labels en-label⟩ (for the English term) and fr-label⟩ (for the French term). -So - - -
-\newword{cat}{cat}{le}{chat}
-
-

is equivalent to: - - -

-
-\newglossaryentry{en-cat}{type=english,name={cat},description={le chat}}
-\newglossaryentry{fr-cat}{type=french,name={le chat},sort={chat},
-  description={cat}}
-
-

-

Unlike the previous example (sample-dual.tex), there’s no link between these two entries. If the document -only uses \gls{en-cat}, then the en-cat entry will appear in the english glossary but the fr-cat entry won’t -appear in the french one. -

bib2glsIf you want to switch to bib2gls then you first need to convert the document so that it -uses glossaries-extra, but include the prefix option to ensure that glossaries-prefix is also loaded: -

-
-\usepackage[record,prefix,postdot,stylemods,nomain]{glossaries-extra} -
-
You don’t need to worry about file extensions now, so it’s simpler to use the starred form of \newglossary: -
-
-\newglossary*{english}{English to French} -
\newglossary*{french}{French to English} -
-
Next the entries need to be converted to the bib format required by bib2gls: -


-   
convertgls2bib --only-preamble sample-langdict.tex entries.bib -
-
-This creates the file entries.bib that contains entries defined like:

-
-@entry{en-cat, -
  name = {cat}, -
  description = {le chat}, -
  type = {english} -
} -
-
@entry{fr-cat, -
  name = {le chat}, - - -
  description = {cat}, -
  text = {chat}, -
  type = {french} -
} -
-
(Note that the sort field has been omitted.) -

This would be more flexible, and much briefer, if these entries were defined using bib2gls’s dual entry -system combined with the glossaries-prefix package:

-
-@dualentry{cat, -
  name = {chat}, -
  description = {cat}, -
  prefix = {le}, -
  prefixplural = {les} -
} -
-
Similarly for the “chair” entry:
-
-@dualentry{chair, -
  name = {chaise}, -
  description = {chair}, -
  prefix = {la}, -
  prefixplural = {les} -
} -
-
-

With @dualentry, the English and French terms are now automatically linked from 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 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). -

-
-
-\GlsXtrLoadResources[src=entries,% entries.bib -
 append-prefix-field={space}, -
 category={same as type},dual-category={same as type}, -
 label-prefix={en-},dual-prefix={fr-}, -
 type=english,dual-type=french, -
 sort=en,dual-sort=fr] - - -
-
\newcommand{\FrEncap}[1]{% -
 \foreignlanguage{french}{\glsentryprefix{\glscurrententrylabel}#1}} -
\newcommand{\EnEncap}[1]{\foreignlanguage{english}{#1}} -
-
\glssetcategoryattribute{english}{glossnamefont}{EnEncap} -
\glssetcategoryattribute{english}{glossdescfont}{FrEncap} -
\glssetcategoryattribute{french}{glossnamefont}{FrEncap} -
\glssetcategoryattribute{french}{glossdescfont}{EnEncap} -
-
-

Remember to remove \makeglossaries, the definition of \newword and the entry definitions from the -document preamble, and replace \printglossary with:

-
-\printunsrtglossary -
-
-

Other refinements that you might like to make include using \glsxtrnewglslike so you don’t have to worry -about the label prefix (“en-” and “fr-”). - -

-

-

🔗sample-index.tex

-

This document uses the glossaries package to create both a glossary and an index. This requires two -makeglossaries (or makeglossaries-lite) calls to ensure the document is up to date: -


-   
pdflatex sample-index -
makeglossaries sample-index -
pdflatex sample-index -
makeglossaries sample-index -
pdflatex sample-index -
-
-

-

-

Top

18.5 Sorting

- - - -

-

-

🔗samplePeople.tex

-

This document illustrates how you can hook into the standard sort mechanism to adjust the way the sort key is -set. This requires an additional run to ensure the table of contents is up-to-date: -


-   
pdflatex samplePeople -
makeglossaries samplePeople -
pdflatex samplePeople -
pdflatex samplePeople -
-
-This provides two commands for typesetting a name: - - -

-
-\newcommand{\sortname}[2]{#2, #1}
-\newcommand{\textname}[2]{#1 #2}
-
-

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: - - -

-
-\let\name\textname
-
-

This command defaults to the display name command (\textname) but is temporarily redefined to the sort -name command (\sortname) within the sort field assignment hook:

-
-\renewcommand{\glsprestandardsort}[3]{% -
 \let\name\sortname -
 \edef#1{\expandafter\expandonce\expandafter{#1}}% -
 \let\name\textname -
 \glsdosanitizesort -
} -
-
The people are defined using the custom \name command:
-
-\newglossaryentry{joebloggs}{name={\name{Joe}{Bloggs}}, -
 description={\nopostdesc}} -
-
Since \name is temporarily changed while the sort key is being assigned, the sort value for this entry ends up -as “Bloggs, Joe”, but the name appears in the document as “Joe Bloggs”. -

bib2glsIf you want to use bib2gls, you first need to convert the document to use glossaries-extra but make -sure you include the record option:

-
-\usepackage[record,stylemods,style=listgroup]{glossaries-extra} -
-
Next it’s necessary to convert the entry definitions to the bib format required by bib2gls. You can simply -do: -


-   
convertgls2bib --preamble-only samplePeople people.bib -
-
-which will create a file called people.bib that contains definitions like:

- - -
-@entry{joebloggs, -
  name = {\name{Joe}{Bloggs}}, -
  description = {\nopostdesc} -
} -
-
However, you may prefer to use the --index-conversion (-i) switch: -


-   
convertgls2bib -i --preamble-only samplePeople people.bib -
-
-This will discard the description field and use @index instead of @entry if the description is either empty or -simply set to \nopostdesc or \glsxtrnopostpunc. The people.bib file now contains definitions like: -

-
-@index{joebloggs, -
  name = {\name{Joe}{Bloggs}} -
} -
-
Regardless of which approach you used to create the bib file, you now need to edit it to provide a definition of -the custom \name command for bib2gls’s use:
-
-@preamble{"\providecommand{\name}[2]{#2, #1}"} -
-
Note the use of \providecommand instead of \newcommand. -

In the document (samplePeople.tex) you now need to delete \makeglossaries, the definitions of -\sortname, \textname, \name, \glsprestandardsort, and all the entry definitions. Then add the following to -the document preamble:

-
-\newcommand{\name}[2]{#1 #2} -
\GlsXtrLoadResources[src=people] -
-
Next, use your text editor’s search and replace function to subsitute all instances of \glsentrytext in the -chapter headings with \glsfmttext. For example:
-
-\chapter{\glsfmttext{joebloggs}} -
-
Finally, replace \printunsrtglossaries with:
- - -
-\printunsrtglossaries -
-
The document build is now: -


-   
pdflatex samplePeople -
bib2gls samplePeople -
pdflatex samplePeople -
pdflatex samplePeople -
-
-The third LaTeX call is required to ensure that the PDF bookmarks are up to date, as the entries -aren’t defined until after the bib2gls run (which is why you have to use \glsfmttext instead of -\glsentrytext). -

This again leads to a list sorted by surname. The reason this works is because bib2gls only sees the -definition of \name provided in @preamble, but the document uses the definition of \name provided before -\GlsXtrLoadResources. The use of \providecommand in @preamble prevents \name from being redefined -within the document. -

See also the “Examples” chapter of the bib2gls user manual, which provides another “people” -example. - -

-

-

🔗sampleSort.tex

-

This is another document that illustrates how to hook into the standard sort mechanism. An additional run is -required to ensure the table of contents is up-to-date: -


-   
pdflatex sampleSort -
makeglossaries sampleSort -
pdflatex sampleSort -
pdflatex sampleSort -
-
-This document has three glossaries (main, acronym and a custom notation), so if you want to -use makeindex explicitly you will need to have three makeindex calls with the appropriate file -extensions: -


-   
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 -
-
-It’s much simpler to just use makeglossaries or 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: - - -

-
-\newcounter{sortcount}
-
-

The sort hook is then redefined to increment this counter and assign the sort key to that numerical -value, but only for the notation glossary. The other two glossaries have their sort keys assigned as -normal: - - -

-
-\renewcommand{\glsprestandardsort}[3]{%
-  \ifdefstring{#2}{notation}%
-  {%
-     \stepcounter{sortcount}%
-     \edef#1{\glssortnumberfmt{\arabic{sortcount}}}%
-  }%
-  {%
-     \glsdosanitizesort
-  }%
+
Again this information is written to the xdy file by \makeglossaries so if you use \noist then you need to manually add it to your custom xdy file.

+When xindy creates the associated indexing files, the locations will be written using:

\glsXcounterXformat{hyper-prefix}{location}
+
In this case:
\glsXpageXglsnumberformat{}{\tallynum{number}}
+
or
\glsXpageXhyperbfit{}{\tallynum{number}}
+
This means that although \hyperbf is designed to create hyperlinked locations, the presence of \tallynum interferes with it. In order to make the hyperlinks work correctly, the definitions of \glsXpageXhyperbfit 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 \tally is changed so that it expands differently then these modifications won’t work.

+Remember that in both cases, the second argument #2 is in the form \tally{n}:

\renewcommand{\glsXpageXglsnumberformat}[2]{% 
+ \linkpagenumber#2% 
 }
-
-

This means that makeindex will sort the notation in numerical order. -


glossaries-extraIf you want to convert this document to use glossaries-extra, a much simpler approach is -available with its hybrid method. First change the package loading line to:

-
-\usepackage[postdot,stylemods,acronym]{glossaries-extra} -
-
Either remove \setacronymstyle and replace all instances of \newacronym with \newabbreviation or -replace: - - -
-\setacronymstyle{long-short}
-
-

with:

-
-\setabbreviationstyle[acronym]{long-short} -
-
-

The custom counter and redefinition of \glsprestandardsort can now be removed. The file extensions for -the custom notation glossary are no longer relevant so the glossary definition can be changed to: -

-
-\newglossary*{notation}{Notation} -
-
The \makeglossaries command now needs to be adjusted to indicate which glossaries need to be processed by -makeindex:
-
-\makeglossaries[main,acronym] -
-
Finally, \printglossaries needs to be replaced with:
-
-\printglossary -
\printacronyms -
\printnoidxglossary[type=notation,sort=def] -
-
Note that the notation glossary, which hasn’t been listed in the optional argument of \makeglossaries, must -be displayed with \printnoidxglossary. -

This means that makeindex only needs to process the main and acronym glossaries. No actual sorting is -performed for the notation glossary because, when used with sort=def, \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 glossaries extend beyond a -page break): -


-   
pdflatex sampleSort -
makeglossaries sampleSort - - -
pdflatex sampleSort -
-
-This time makeglossaries will include the message: - - -

-
-only processing subset 'main,acronym'
-
-

This means that although makeglossaries has noticed the notation glossary, it will be skipped. -

If you are explicitly calling makeindex then you need to drop the call for the notation glossary: -


-   
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 -
-
-

bib2glsIf you prefer to use bib2gls, the package loading line needs to be changed to:

-
-\usepackage[record,postdot,stylemods,acronym]{glossaries-extra} -
-
Next the entry definitions need to be convert to the bib format required by 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 --split-on-type or -t switch: -


-   
convertgls2bib -t --preamble-only sampleSort.tex entries.bib -
-
-This will create three files: -

-

-entries.bib

-

which contains the entries that were defined with \newglossaryentry. For example:

-
- @entry{gls:set, -
  name = set, -
  description = A collection of distinct objects -
} -
-
- - -
-

-abbreviations.bib

-

which contains the entries that were defined with \newacronym. For example:

-
- @acronym{zfc, -
  short = {ZFC}, -
  long = {Zermelo-Fraenkel set theory} -
} -
-
If you changed \newacronym to \newabbreviation then @abbreviation will be used instead: -
-
- @abbreviation{zfc, -
  short = {ZFC}, -
  long = {Zermelo-Fraenkel set theory} -
} -
-
-
-

-notation.bib

-

which contains the entries that were defined with type=notation. For example:

-
- @entry{not:set, -
  name = {$\mathcal{S}$}, -
  description = {A set}, -
  text = {\mathcal{S}} -
} -
-
You may prefer to replace @entry with @symbol in this file.
-

After the definition of the notation glossary (\newglossary), add:

- - -
-% abbreviation style must be set first: -
\setabbreviationstyle[acronym]{long-short} -
\GlsXtrLoadResources[src={entries,abbreviations}] -
\GlsXtrLoadResources[src={notation},% notation.bib -
 type=notation,sort=unsrt] -
-
Delete the remainder of the preamble (\makeglossaries and entry definitions). -

Finally, replace the lines that display the glossaries with:

-
-\printunsrtglossaries -
-
The build process is now: -


-   
pdflatex sampleSort -
bib2gls sampleSort -
pdflatex sampleSort -
-
-

In this case, I have one resource command that processes two glossaries (main and acronym) at the same -time. The entries in these glossaries are ordered alphabetically. The second resource command processes the -notation glossary but the entries in this glossary aren’t sorted (and so will appear in the order of definition -within the bib file). -

See also sampleNtn.tex, bib2gls gallery: sorting and the bib2gls user manual for more examples. -

-

-

Top

18.6 Child Entries

- -

-

-

🔗sample.tex

-

This document illustrates some of the basics, including how to create child entries that use the same name as -the parent entry. This example adds the glossary to the table of contents and it also uses \glsrefentry, so an -extra LaTeX run is required: -


-   
pdflatex sample - - -
makeglossaries sample -
pdflatex sample -
pdflatex sample -
-
-You can see the difference between word and letter ordering if you add the package option order=letter. (Note -that this will only have an effect if you use makeglossaries or makeglossaries-lite. If you use makeindex -explicitly, you will need to use the -l switch to indicate letter ordering.) -

One of the entries has its name encapsulated with a semantic command:

-
-\newcommand{\scriptlang}[1]{\textsf{#1}} -
-
\newglossaryentry{Perl}{name=\scriptlang{Perl},sort=Perl, -
description={A scripting language}} -
-
This means that this entry needs to have the sort key set otherwise makeindex will assign it -to the “symbol” letter group, since it starts with a backslash (which makeindex simply treats as -punctuation). -

The homograph entries “glossary” and “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 nopostdot=false setting this will -lead to a spurious dot. This can be removed by adding \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 sort key:

-
-\newglossaryentry{glossary}{name=glossary, -
 description={\nopostdesc},plural={glossaries}} -
-
\newglossaryentry{glossarycol}{ -
 description={collection of glosses}, -
 sort={2}, -
 parent={glossary}% parent label -
} -
-
\newglossaryentry{glossarylist}{ -
 description={list of technical words}, -
 sort={1}, -
 parent={glossary}% parent label -
} -
-
(Remember that the entries are sorted hierarchically.) This will place glossarylist before glossarycol, but -both will come immediately after their parent glossary entry. - - -


glossaries-extraIf you switch to using glossaries-extra, remember that the default package options are different: -

-
-\usepackage[postdot,stylemods,style=treenonamegroup,order=word, -
  subentrycounter]{glossaries-extra} -
-
-

You may now want to consider replacing \nopostdesc in the descriptions with \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: - - -

-
-\newglossaryentry{cow}{name=cow,
-  plural=cows,% not required as this is the default
-  user1=kine,
-  description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult
-female of any bovine animal}
+\renewcommand{\glsXpageXhyperbfit}[2]{% 
+ \textbf{\em\linkpagenumber#2}% 
 }
-
-

which has the parenthetical material at the start of the description with emphasis, - - -

-
-\newglossaryentry{bravocry}{
-  description={cry of approval (pl.\ bravos)},
-  sort={1},
-  parent={bravo}
+
These need a command that can grab the actual number and correctly encapsulate it:
\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}}
+

+If you want to try out the samplexdy-mc.xdy file, the entries starting with “Mac” or “Mc” will be placed in their own “Mc” letter group. Ideally it should be possible to do this simply with \GlsAddLetterGroup (and not require a custom xdy file) but unfortunately the “M” letter group will have already been defined and take precedence over “Mc”, which is why a custom file is required and the normal language module must be suppressed:

\setStyleFile{samplexdy-mc}
+\noist
+\GlsSetXdyLanguage{}
+

+This “Mc” group is suitable for names like “Maclaurin” but not for “Mach”. To prevent this, the sort key for that value is set to lower case:

\newglossaryentry{mach}{name={Mach, Ernst},
+first={Ernst Mach},text={Mach},
+sort={mach, Ernst},
+description={Czech/Austrian physicist and philosopher}}
+

+

+If you want to convert this document so that it uses bib2gls, you first need to switch to glossaries-extra and use the record package option:
\usepackage[record,postdot]{glossaries-extra}
+
The xindy-only commands can now all be removed (attribute \GlsAddXdyAttribute, location \GlsAddXdyLocation, language \GlsSetXdyLanguage, location encaps \glsXcounterXformat and the custom helper \linkpagenumber). Also \noist and \setStyleFile aren’t relevant with bib2gls and so should be removed.

+The definitions of \hyperbfit should be retained (as well as \tallynum, \tally and the redefinition of \thepage).

+The entries all need to be converted to the bib format required by bib2gls.

convertgls2bib --preamble-only samplexdy.tex entries.bib
+
Next replace \makeglossaries with:
\GlsXtrLoadResources[src=entries]
+
and remove all the entry definitions from the document preamble. Use the search and replace function on your text editor to replace all instances of \glsentryfirst with \glsfmtfirst, and all instances of \glsentryname with \glsfmtname.

+Finally, replace \printglossaries with \printunsrtglossaries. The document build is now:

pdflatex samplexdy
+bib2gls --group samplexdy
+pdflatex samplexdy
+

+This results in a slightly different ordering from the original document (without the “Mc” letter group). In the original example, “Mach number” was listed before “Mach, Ernest”. The modified document now has “Mach, Ernest” before “Mach number”. This difference is due to bib2gls’s default break-at=word setting, which marks word boundaries with the | (pipe) character, so the sort values for bib2gls are Mach|Earnest| and Mach|number|. See the 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 “Mc” letter group, it can be obtained by providing a custom sort rule:

\GlsXtrLoadResources[src=entries,
+   sort=custom,
+   sort-rule={}\glsxtrGeneralInitRules
+   <\glsxtrGeneralLatinAtoGrules
+   <h,H<i,I<j,J<k,K<l,L<Mc=Mac<m,M
+   <\glsxtrGeneralLatinNtoZrules
+   
+]
+
Unfortunately, as with xindy, this puts “Mach” into the “Mc” letter group. (See the 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 “Mc”/“Mac” prefixes with names that happen to start with “Mac”. For example:

@entry{mcadam,
+  name={\Mac{Mc}Adam, John Loudon},
+  description={Scottish engineer},
+  text={McAdam},
+  first={John Loudon McAdam}
+}
+
+@entry{maclaurin,
+  name={\Mac{Mac}laurin, Colin},
+  description={Scottish mathematician best known for the \gls{maclaurinseries}},
+  text={Maclaurin},
+  first={Colin Maclaurin}
+}
+
but not for “Mach”:
@entry{mach,
+  name={Mach, Ernst},
+  description={Czech/Austrian physicist and philosopher},
+  text={Mach},
+  first={Ernst Mach}
+}
+
With LaTeX, this command should simply do its argument:
\newcommand{\Mac}[1]{#1}
+
However, when bib2gls works out the sort value, it needs to be defined with something unique that won’t happen to occur at the start of another term. For example:
\providecommand{\Mac}[1]{MC}
+
(Remember that break-at=word will strip spaces and punctuation so don’t include them unless you switch to break-at=none.)

+So add the first definition of \Mac to the tex file and modify entries.bib so that it includes the second definition:

@preamble{"\providecommand{\Mac}[1]{MC}"}
+
Then modify the “Mc”/“Mac” entries as appropriate (see the above “McAdam” and “Maclaurin” examples).

+The custom sort rule needs to be modified:

\GlsXtrLoadResources[src=entries,
+   write-preamble=false,
+   sort=custom,
+   sort-rule=\glsxtrGeneralInitRules    <\glsxtrGeneralLatinAtoGrules    <h,H<i,I<j,J<k,K<l,L<MC<m,M    <\glsxtrGeneralLatinNtoZrules    
+]
+
This will create a “Mc” letter group that only includes the names that start with the custom \Mac command.

+Other alternatives include moving @preamble into a separate bib file, so that you can choose whether or not to include it. See the “Examples” chapter of the bib2gls user manual for further examples.

+

🗋📥 samplexdy2.tex
+ This document illustrates how to use the glossaries package where the location numbers don’t follow a standard syntax. This example won’t work with makeindex, which only accepts a limited set of location syntax. To create the document do:
pdflatex samplexdy2
+makeglossaries samplexdy2
+pdflatex samplexdy2
+
The explicit xindy call is:
xindy -L english -C utf8 -I xindy -M samplexdy2 -t samplexdy2.glg -o samplexdy2.gls samplexdy2.glo
+
This example uses the section counter with xindy:
\usepackage[xindy,counter=section]{glossaries}
+
The document employs an eccentric section numbering system for illustrative purposes. The section numbers are prefixed by the chapter number in square brackets:
\renewcommand*{\thesection}{[\thechapter]\arabic{section}}
+
Parts use Roman numerals:
\renewcommand*{\thepart}{\Roman{part}}
+
The section hyperlink name includes the part:
\renewcommand*{\theHsection}{\thepart.\thesection}
+
This custom numbering scheme needs to be identified in the xdy file:
\GlsAddXdyLocation["roman-numbers-uppercase"]{section}{:sep "["
+  "arabic-numbers" :sep "]" "arabic-numbers"
+}
+
If the part is 0 then \thepart will be empty (there isn’t a zero Roman numeral). An extra case is needed to catch this:
\GlsAddXdyLocation{zero.section}{:sep "["
+  "arabic-numbers" :sep "]" "arabic-numbers"
+}
+
Note that this will stop xindy giving a warning, but the location hyperlinks will be invalid if no \part is used.

+

+If you want to switch to bib2gls, you first need to switch to glossaries-extra but remember to use record instead of xindy:
\usepackage[record,counter=section]{glossaries-extra}
+
Next remove the \GlsAddXdyLocation commands and convert the entry definitions to the bib format required by bib2gls:
convertgls2bib --preamble-only samplexdy2.tex entries.bib
+
Now replace \makeglossaries with:
\GlsXtrLoadResources[src=entries]
+
and remove the \newglossaryentry commands. Finally, replace \printglossaries with \printunsrtglossaries.

+The document build is:

pdflatex samplexdy2
+bib2gls samplexdy2
+pdflatex samplexdy2
+

+With unusual numbering systems, it’s sometimes better to use record=nameref:

\usepackage[record=nameref,counter=section]{glossaries-extra}
+
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:
\newcommand*{\glsxtrsectionlocfmt}[2]{#1}
+
(Make sure you have at least v1.42 of glossaries-extra.) See also the earlier sampleSec.tex.

+

🗋📥 samplexdy3.tex
+ This document is very similar to samplexdy.tex but uses the command \Numberstring from the fmtcount package to format the page numbers instead of the \tally command from the earlier example.

+

🗋📥 sampleutf8.tex
+ This is another example that uses xindy. Unlike makeindex, xindy recognises non-Latin characters (provided the correct encoding is passed to xindy via the -C switch). This document uses UTF-8 encoding. To create the document do:
pdflatex sampleutf8
+makeglossaries sampleutf8
+pdflatex sampleutf8
+
The explicit xindy call is (no line breaks):
xindy -L english -C utf8 -I xindy -M sampleutf8 -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
+

+If you remove the xindy option from sampleutf8.tex and do:

pdflatex sampleutf8
+makeglossaries sampleutf8
+pdflatex sampleutf8
+
or
pdflatex sampleutf8
+makeglossaries-lite sampleutf8
+pdflatex sampleutf8
+
you will see that the entries that start with an extended Latin character now appear in the symbols group, and the word “manœuvre” is now after “manor” instead of before it. If you want to explicitly call makeindex (no line breaks):
makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
+

+

+If you want to switch to bib2gls, you first need to switch to glossaries-extra but replace xindy with record:
\usepackage[record,postdot,stylemods,style=listgroup]{glossaries-extra}
+
Note that you don’t need the nonumberlist option with bib2gls. You can instruct bib2gls to simply not save the number lists, but in this case there won’t be any locations as there’s no actual indexing.

+The entries need to be converted to the bib format required by bib2gls:

convertgls2bib --preamble-only --texenc UTF-8 --bibenc UTF-8 sampleutf8.tex entries.bib
+
Note the first line of the entries.bib file:
% Encoding: UTF-8
+
This is the encoding of the bib file. It doesn’t have to match the encoding of the tex file, but it’s generally better to be consistent. When bib2gls parses this file, it will look for this encoding line. (If the --texenc and --bibenc switches aren’t used, convertgls2bib will assume your Java default encoding. See the bib2gls manual for further details.)

+Next replace \makeglossaries with:

\GlsXtrLoadResources[src=entries,selection=all]
+
and remove all the \newglossaryentry commands.

+Iterative commands like \glsaddall don’t work with bib2gls. Instead, you can select all entries using the selection=all option. This is actually better than \glsaddall, which enforces the selection of all entries by indexing each entry. As a result, with makeindex and xindy (and Option 1), every entry will have the same location (which is the location of the \glsaddall command, in this case page 1). With selection=all, bib2gls will automatically selection all entries even if they don’t have any records (indexing information) so in this case there are no number lists.

+Finally, replace \printglossaries with \printunsrtglossaries. The build process is now:

pdflatex sampleutf8
+bib2gls --group sampleutf8
+pdflatex sampleutf8
+
bib2gls picks up the encoding of the tex file from the aux file:
\glsxtr@texencoding{utf8}
+
If you experience any encoding issues, check the aux file for this command and check the bib file for the encoding comment line. Also check bib2gls’s glg transcript file for encoding messages, which should look like:
TeX character encoding: UTF-8
+

+The document language, if it has been set, is also added to the aux file when the record option is used. In this case, no language package has been used, so 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 sort key with a locale tag identifier. For example:

\GlsXtrLoadResources[src=entries,selection=all,sort=de-CH-1996]
+
(Swiss German new orthography) or:
\GlsXtrLoadResources[src=entries,selection=all,sort=is]
+
(Icelandic).

+ +

+ +
+

18.10. No Indexing Application (Option 1)

+

+

🗋📥 sample-noidxapp.tex
+ This document illustrates how to use the glossaries package without an external indexing application (Option 1). To create the complete document, you need to do:
pdflatex sample-noidxapp
+pdflatex sample-noidxapp
+
With old LaTeX kernels and old versions of mfirstuc, it was necessary to group the accent command that occurs at the start of the name:
\newglossaryentry{elite}{% 
+  name={{\'e}lite},% mfirstuc v2.07
+  description={select group of people}
+}
+
This used to be necessary to allow the term to work with \Gls. With a new kernel and latest versions of glossaries and mfirstuc, this should no longer be necessary.
\newglossaryentry{elite}{% 
+  name={\'elite},% mfirstuc v2.08
+  description={select group of people}
+}
+

+Notice also how the number lists can’t be compacted into ranges. For example, the list “1, 2, 3” would be converted to “1–3” with a proper indexing application (Options 2 or 3 or, with glossaries-extra, Option 4).

+The larger the list of entries, the longer the document build time. This method is very inefficient for large glossaries. See Gallery: glossaries performance for a comparison.

+

🗋📥 sample-noidxapp-utf8.tex
+ As the previous example, except that it uses the inputenc package. In this case, the sort key is used for the entries with UTF-8 characters in the names. To create the complete document, you need to do:
pdflatex sample-noidxapp-utf8
+pdflatex sample-noidxapp-utf8
+
This method is unsuitable for sorting languages with extended Latin alphabets or non-Latin alphabets. Use Options 3 or 4 instead.

+ +

+ +
+

18.11. Other

+

+

🗋📥 sample4col.tex
+ This document illustrates a four column glossary where the entries have a symbol in addition to the name and description. To create the complete document, you need to do:
pdflatex sample4col
+makeglossaries sample4col
+pdflatex sample4col
+
or
pdflatex sample4col
+makeglossaries-lite sample4col
+pdflatex sample4col
+
The vertical gap between entries is the gap created at the start of each letter group. This can be suppressed using the nogroupskip package option. (If you switch to bib2gls, simply omit the --group command line option.)

+This example uses the long4colheaderborder. This style doesn’t allow multi-line descriptions. You may prefer to use altlong4colheaderborder with long descriptions. However, in either case a style that uses booktabs is preferable. For example, long4col-booktabs or altlongragged4col-booktabs. Note that this requires glossary-longbooktabs, which needs to be explicitly loaded. The style can only be set once this package has been loaded:

\usepackage{glossaries}
+\usepackage{glossary-longbooktabs}
+\setglossarystyle{altlongragged4col-booktabs}
+

+

+The glossaries-extra package provides a more compact way of doing this with the stylemods option:
\usepackage[style=altlongragged4col-booktabs,stylemods=longbooktabs]
+{glossaries-extra}
+
The glossaries-extra package provides additional styles, including more “long” styles with the glossary-longextra package. For example, the long-name-desc-sym-loc style:
\usepackage[style=long-name-desc-sym-loc,stylemods=longextra]
+{glossaries-extra}
+
If you use the stylemods option with an argument, you may prefer to use it with nostyles to prevent unwanted styles from being automatically loaded. For example:
\usepackage[style=long-name-desc-sym-loc,nostyles,stylemods=longextra]
+{glossaries-extra}
+
See also the gallery of predefined styles.

+

🗋📥 sample-numberlist.tex
+ This document illustrates how to reference the number list in the document text. This requires an additional LaTeX run:
pdflatex sample-numberlist
+makeglossaries sample-numberlist
+pdflatex sample-numberlist
+pdflatex sample-numberlist
+
This uses the savenumberlist package option, which enables \glsentrynumberlist and \glsdisplaynumberlist (with limitations). The location counter is set to chapter, so the number list refers to the chapter numbers.
\usepackage[savenumberlist,counter=chapter]{glossaries}
+
The number list can’t be obtained until makeindex (or xindy) has created the indexing file. The number list is picked up when this file is input by \printglossary and is then saved in the aux file so that it’s available on the next LaTeX run.

+This document contains both commands:

This is a \gls{sample} document. \Glspl{sample}
+are discussed in chapters \glsdisplaynumberlist{sample}
+(or \glsentrynumberlist{sample}).
+
Without hyperref, the first list shows as “1–3, 5 & 6” and the second list shows as “1–3, 5, 6”.

+Note that you can’t use \glsdisplaynumberlist with hyperref and Options 2 or 3. If you do, you will get the warning:

Package glossaries Warning: \glsdisplaynumberlist doesn't work with hyperref.
+Using \glsentrynumberlist instead
+
Now both lists show as “1–3, 5, 6”.

+If you switch to Option 1 (replace \makeglossaries with \makenoidxglossaries and replace \printglossaries with \printnoidxglossaries), then the document build is simply:

pdflatex sample-numberlist
+pdflatex sample-numberlist
+
Now \glsdisplaynumberlist works with hyperref, however there are no ranges, so the first list shows as “1, 2, 3, 5, & 6” and the second list shows as “1, 2, 3, 4, 5, 6”.

+

+If you want to switch to bib2gls, you first need to switch to glossaries-extra (at least v1.42) but remember to include the record option:
\usepackage[record,counter=chapter]{glossaries-extra}
+
Note that the savenumberlist option is no longer required. Next convert the entry to the bib format required by bib2gls:
convertgls2bib sample-numberlist.tex entries.bib
+
Replace \makeglossaries with:
\GlsXtrLoadResources[src=entries]
+
and remove the \newglossaryentry command from the document preamble. Finally, replace \printglossaries with \printunsrtglossaries. The build process is now:
pdflatex sample-numberlist
+bib2gls sample-numberlist
+pdflatex sample-numberlist
+
Now both ranges and hyperlinks work. The first list shows “1–3, 5, & 6” and the second list shows “1–3, 5, 6”. You can also use:
\glsxtrfieldformatlist{sample}{loclist}
+
which will show the complete list without ranges “1, 2, 3, 5 & 6”.

+This method works much better than using the savenumberlist option because bib2gls saves the formatted number list in the location field (which is provided by glossaries-extra for the benefit of bib2gls) and the unformatted number list in the loclist internal field (which is also used by Option 1).

+With Options 2 and 3, both makeindex and xindy simply create a file containing the commands to typeset the glossary, which is input by \printglossary. This means that it’s quite hard to gather information obtained by the indexing application.

+bib2gls, on the other hand, doesn’t write a file containing the glossary. It writes a file containing the entry definitions and uses internal fields to save the indexing information. The glossary is then displayed with \printunsrtglossary, which simply iterates over all defined entries and fetches the required information from those internal fields.

+The \glsdisplaynumberlist and \glsentrynumberlist commands are redefined by glossaries-extra-bib2gls to simply access the location field. However, if you want a complete list without ranges you can use:

\glsxtrfieldformatlist{sample}{loclist}
+
In this example, this produces “1, 2, 3, 5 & 6”.

+Note the difference if you use the record=nameref package option instead of just record.

+

🗋📥 sample-nomathhyper.tex
+ This document illustrates how to selectively enable and disable entry hyperlinks in \glsentryfmt. The document build is:
pdflatex sample-nomathhyper
+makeglossaries sample-nomathhyper
+pdflatex sample-nomathhyper
+
This disables the hyperlinks for the main glossary with:
\GlsDeclareNoHyperList{main}
+
and then redefines \glsentryfmt so that it adds a hyperlink if not in maths mode and the hyperlinks haven’t been forced off (with the hyper=false key).

+

+If you want to switch to glossaries-extra, then you can instead use the hook that comes before the keys are set. The preamble is much simpler:
\usepackage{glossaries-extra}
+
+\makeglossaries
+
+\renewcommand{\glslinkpresetkeys}{% 
+ \ifmmode \setkeys{glslink}{hyper=false}\fi
 }
-
-

which has the parenthetical material at the end of the description without emphasis even though it’s a regular -plural, - - -

-
-\newglossaryentry{bravoruffian}{
-  description={hired ruffian or killer (pl.\ bravoes)},
-  sort={2},
-  plural={bravoes},
-  parent=bravo}
-
-

which has the parenthetical material at the end of the description without emphasis, and - - -

-
-\newglossaryentry{glossary}{name=glossary,
-  description={\nopostdesc},
-  plural={glossaries}}
-
-

which doesn’t show the plural in the description. -

With glossaries-extra, you can remove this parenthetical material and implement it using the category -post-description hook instead. For example, the above definitions become: - - -

-
-\newglossaryentry{cow}{name=cow,
-  user1=kine,
-  description={an adult female of any bovine animal}
+
+% entry definition
+

+

🗋📥 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 siunitx package to typeset units.) The document build is:
pdflatex sample-entryfmt
+makeglossaries sample-entryfmt
+pdflatex sample-entryfmt
+
This redefines \glsentryfmt to add the symbol on first use:
\renewcommand*{\glsentryfmt}{% 
+  \glsgenentryfmt
+  \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}% 
 }
-\newglossaryentry{bravocry}{
-  description={cry of approval},
-  sort={1},
-  parent={bravo}
+
Note the use of \glsentrysymbol not \glssymbol (which would result in nested link text).

+

+If you want to switch to the glossaries-extra package, you can make use of the category post-link hook instead:
\usepackage[stylemods,style=tree]{glossaries-extra}
+
+\makeglossaries
+
+\glsdefpostlink{unit}{\glsxtrpostlinkAddSymbolOnFirstUse}
+
+\newglossaryentry{distance}{
+category={unit},
+name={distance},
+description={The length between two points},
+symbol={km}}
+
Note that in this case the symbol is now outside of the hyperlink.

+

🗋📥 sample-prefix.tex
+ This document illustrates the use of the glossaries-prefix package. An additional run is required to ensure the table of contents is up-to-date:
pdflatex sample-prefix
+makeglossaries sample-prefix
+pdflatex sample-prefix
+pdflatex sample-prefix
+
Remember that the default separator between the prefix and \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 xkeyval package (which is used to parse the key=value lists) trims leading and trailing space from the values, so an ordinary space character will be lost.
\newglossaryentry{sample}{name={sample},
+  description={an example},
+  prefix={a~},
+  prefixplural={the\space}}
+
+\newglossaryentry{oeil}{name={oeil},
+  plural={yeux},
+  description={eye},
+  prefix={l'},
+  prefixplural={les\space}}
+

+

+If you want to convert this example to use glossaries-extra, then (as from v1.42) you can use the prefix option:
\usepackage[prefix,postdot,acronym]{glossaries-extra}
+
(Alternatively load glossaries-prefix after glossaries-extra.) The rest of the document is the same as for the base glossaries package, unless you want to switch to using bib2gls.

+

+If you want to switch to bib2gls, first switch to glossaries-extra (as above) but make sure you include the record package option:
\usepackage[record,prefix,postdot,acronym]{glossaries-extra}
+
Next convert the entries into the bib format required by bib2gls:
convertgls2bib --preamble-only sample-prefix.tex entries.bib
+
Replace \makeglossaries with
\setabbreviationstyle[acronym]{long-short}
+\GlsXtrLoadResources[src=entries]
+
remove the entry definitions from the document preamble, and replace
\printglossary[style=plist]
+\printacronyms
+
with
\printunsrtglossary[style=plist]
+\printunsrtacronyms
+
The document build is now:
pdflatex sample-prefix
+bib2gls sample-prefix
+pdflatex sample-prefix
+

+With bib2gls v2.0+, you don’t need to manually insert the spaces at the end of the prefixes. Instead you can instruct bib2gls to insert them. To try this out, remove the trailing \space and non-breaking space (~) from the entries.bib file:

@entry{sample,
+  prefix={a},
+  name={sample},
+  description={an example},
+  prefixplural={the}
 }
-\newglossaryentry{bravoruffian}{
-  description={hired ruffian or killer},
-  sort={2},
-  plural={bravoes},
-  parent=bravo}
-
-

-
-\newglossaryentry{glossary}{name=glossary, -
  description={\glsxtrnopostpunc}, -
  plural={glossaries}} -
-
The post-description hook for the general category can now be set:
-
-\glsdefpostdesc{general}{% -
% Has the user1 key been set? -
  \glsxtrifhasfield{useri}{\glscurrententrylabel}% -
  {\space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel}, -
    \emph{archaic} \glscurrentfieldvalue)% -
  }% -
  {% -
% The user1 key hasnflt been set. Is the plural the same as the -
% singular form with the plural suffix appended? -
    \GlsXtrIfXpFieldEqXpStr{plural}{\glscurrententrylabel}% -
    {\glsentrytext{\glscurrententrylabel}\glspluralsuffix}% -
    {% -
% Sibling check with bib2gls (see below) -
    }% - - -
    {% -
% The plural isnflt the default. Does this entry have a parent? -
      \ifglshasparent{\glscurrententrylabel}% -
      {% -
% This entry has a parent. -
% Are the plurals for the child and parent the same? -
        \GlsXtrIfXpFieldEqXpStr{plural}{\glscurrententrylabel}% -
        {\glsentryplural{\glsentryparent{\glscurrententrylabel}}}% -
        {}% child and parent plurals the same -
        {% -
          \space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})% -
        }% -
      }% -
      {\space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})}% -
    }% -
  }% -
} -
-
(If you try this example out, notice the difference for the glossary entry if you use \nopostdesc and then -replace it with \glsxtrnopostpunc.) See the glossaries-extra user manual for further details and also -glossaries-extra and bib2gls: An Introductory Guide. -

The “bravo” homographs are an oddity where the singular form is identical but the plural is different -(“bravos” and “bravoes”). In the original, both descriptions included the plural term. The above modifications -drop the display of the regular “bravos” plural (for the bravocry term) and only show the “bravoes” plural (for -the 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 \glsentryparent) it’s much harder to -access entry’s children or siblings. The \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 bib2gls, it’s possible to save this information with the save-child-count and save-sibling-count, -which not only save the total but also save the child or sibling labels in an 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:

-
-% Sibling check with bib2gls (see below) -
-
indicates where to put the extra code. If you switch to bib2gls and make sure to use save-sibling-count -then you can insert the following code in the block above where that comment is:
- - -
-\GlsXtrIfFieldNonZero{siblingcount}{\glscurrententrylabel}% -
{% siblingcount field value non-zero -
 \glsxtrfieldforlistloop % iterate over internal list -
 {\glscurrententrylabel}% entry label -
 {siblinglist}% label of field containing list -
 {\siblinghandler}% loop handler -
}% -
{}% siblingcount field value 0 or empty or missing -
-
This uses a custom handler that’s defined as follows:
-
-\newcommand{\siblinghandler}[1]{% -
  \GlsXtrIfXpFieldEqXpStr*{plural}{\glscurrententrylabel}% -
  {\glsentryplural{#1}}% -
  {}% current entryfls plural same as siblingfls plural -
  {% -
    \space(\emph{pl.}\ \glsentryplural{\glscurrententrylabel})% -
    \listbreak -
  }% -
} -
-
The \listbreak command is provided by etoolbox and is used for prematurely exiting a loop. The handler -tests if the sibling’s plural field is identical to the current entry’s 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 “bravoes” instead of -the default “bravos”. In that case, the parent entry would show the plural but the bravoruffian child entry -wouldn’t show the plural (since this case would led to the empty code block identified with the comment “child -and parent plurals the same”). The “bravoes” plural form would instead be shown for the parent, which -wouldn’t look right. -

If you don’t use bib2gls or if you use it without the save-sibling-count resource option then the sibling -information won’t be available. -

bib2glsIn order to switch to using bib2gls, it’s first necessary to switch to using glossaries-extra (as above). -Remember that the record option is required:

-
-\usepackage[record,postdot,stylemods,style=treenonamegroup, -
subentrycounter]{glossaries-extra} -
-
Next the entry definitions need to be converted to the bib format required by bib2gls. This can be done with -convertgls2bib:
- - -
-convertgls2bib --preamble-only sample.tex entries. -
-
The semantic command may be moved to the bib file to ensure it’s defined:
-
-@preamble{"\providecommand{\scriptlang}[1]{\textsf{#1}}"} -
-
-

The sort field typically shouldn’t be set when using bib2gls, so convertgls2bib strips it. If the sort field -is missing, bib2gls will obtain it from the sort fallback for that entry type. In this case, @entry has the name -field as the sort fallback. If this is also missing then its value is obtained from the parent’s name field (see -bib2gls gallery: sorting for other examples). -

Therefore the “Perl” entry is simply defined as:

-
-@entry{Perl, -
  name = {\scriptlang{Perl}}, -
  description = {A scripting language} -
} -
-
This isn’t a problem for bib2gls. In this case, the command has been provided in the @preamble, but bib2gls -strips font information so the sort value becomes Perl. If the definition isn’t placed in @preamble then -bib2gls will simply ignore the command (as xindy does) so the sort value will still end up as -Perl. -

The homograph entries have also had their sort fields omitted:

-
-@entry{glossarycol, -
  parent = {glossary}, -
  description = {collection of glosses} -
} -
-
@entry{glossarylist, -
  parent = {glossary}, -
  description = {list of technical words} -
} -
-
- - -

This means that the sort value for both these child entries is “glossary”. When bib2gls encounters identical -sort values it acts according to its identical-sort-action setting. The default action is to sort by the label -using a simple string comparison. In this case, it would put glossarycol before glossarylist. In the original -document, the sort value was manually chosen to ensure that the entries are ordered according to first use. -This ordering can easily be obtained by changing bib2gls’s identical sort action (requires at least bib2gls -v2.0):

-
-\GlsXtrLoadResources[src={entries},identical-sort-action=use] -
-
This command should replace \makeglossaries. If you want the sibling information (see earlier), then you -need to remember to add 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 glossarycol -is used first, then the ordering will be updated accordingly, but with the original example, the sort keys would -need to be manually changed. -

The remainder of the preamble (that is, the definition of \scriptlang and all the entry definitions) should -now be removed. -

Finally, replace \printglossaries with \printunsrtglossaries. The document build is now: -


-   
pdflatex sample -
bib2gls --group sample -
pdflatex sample -
pdflatex sample -
-
-Note use of the --group (or -g) switch, which is needed to support the treenonamegroup style. The third -LaTeX call is needed because the document contains \glsrefentry. -

Note that you can’t use the order=letter package option with bib2gls. Instead use the break-at=none -resource option:

-
-\GlsXtrLoadResources[src={entries},identical-sort-action=use, -
  break-at=none -
] -
-
- -

-

-

🔗sample-inline.tex

-

This document is like sample.tex, above, but uses the inline glossary style to put the glossary in a footnote. -The document build is: - - -


-   
pdflatex sample-inline -
makeglossaries sample-inline -
pdflatex sample-inline -
pdflatex sample-inline -
-
-If you want to convert this document to glossaries-extra, follow the same procedure as above. If you want to use -bib2gls then you don’t need the --group switch since no letter groups are required. - -

-

-

🔗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: -


-   
pdflatex sampletree -
makeglossaries sampletree -
pdflatex sampletree -
-
-The document uses the alttreehypergroup glossary style, which needs to know the widest name for each -hierarchical level. This has been assigned manually in the preamble with \glssetwidest: - - -

-
-\glssetwidest{Roman letters} % level 0 widest name
-\glssetwidest[1]{Sigma}      % level 1 widest name
-
-

(Level 0 is the top-most level. That is, entries that don’t have a parent.) It’s possible to get glossaries to -compute the widest top-level entry with \glsfindwidesttoplevelname but this will iterate over all top-level -entries, regardless of whether or not they appear in the 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 nolong and nosuper. The reduces the overall package loading.

-
-\usepackage[style=alttreehypergroup,nolong,nosuper] -
{glossaries} -
-
(This example glossary is actually better suited for one of the topic styles provided with glossary-topic, see -below.) -

This is obviously a contrived example since it’s strange to have the symbol names (such as “Sigma”) in the -glossary. The purpose is to demonstrate the alttreehypergroup with an entry that’s noticeably wider than the -others in the same hierarchical level. A more sensible document would have the symbol in the name -key. -


glossaries-extraIf you want to switch to glossaries-extra, then you can instead use a combination of nostyles -and stylemods:

-
-\usepackage[style=alttreehypergroup,postdot,nostyles, -
stylemods=tree
]{glossaries-extra} -
-
The stylemods package not only patches the original styles provided by the base glossaries package (such -as 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 \glssetwidest, you could add the following before the glossary: -
-
-\glsFindWidestUsedTopLevelName -
\glsFindWidestUsedLevelTwo - - -
-
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. -

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 -aux file for the next run.
-

-

This example document is using top-level entries for topics without descriptions. This means that the -descriptions simply contain \nopostdesc to prevent the post-description punctuation from being automatically -inserted. For example: - - -

-
-\newglossaryentry{greekletter}{name={Greek letters},
-text={Greek letter},
-description={\nopostdesc}}
-
-

With glossaries-extra, you can convert this to \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 general -category, but the symbol entries can be assigned to a different category. The value of the category key must be -a label. For example:

-
-\newglossaryentry{C}{name={C}, -
description={Euler's constant}, -
category=symbol, -
parent=romanletter} -
-
-

There is some redundancy caused by a parenthetical note after the first use in some of the symbol entries. -For example: - - -

-
-\newglossaryentry{pi}{name={pi},
-text={\ensuremath{\pi}},
-first={\ensuremath{\pi} (lowercase pi)},
-description={Transcendental number},
-parent=greekletter}
-
-

With glossaries-extra this can be dealt with through the category post-link hook:

-
-\glsdefpostlink{symbol}{% -
  \glsxtrifwasfirstuse -
  {% first use -
    \glsxtrifhasfield{useri}{\glslabel}% -
    { (\glscurrentfieldvalue)}{}% -
  }% -
  {}% not first use -
} -
-
The parenthetical material is now stored in the user1 key. For example:
-
-\newglossaryentry{sigma}{name=Sigma, -
text={\ensuremath\Sigma}, -
user1={uppercase sigma}, -
description={Used to indicate summation}, -
parent=greekletter} -
-
The category post-description link is also set to ensure that the symbol is displayed after the description in the -glossary:
-
-\glsdefpostdesc{symbol}{\space -
  ($\glsentrytext{\glscurrententrylabel}$)} -
-
These modifications only affect entries with the category set to symbol. -

With glossaries-extra, it’s now possible to use the topic styles provided with the glossary-topic package: -

- - -
-\usepackage[style=topic,postdot,nostyles,stylemods={tree,topic}] -
{glossaries-extra} -
-
The topic style is designed for this kind of hierarchy where all the top-level entries don’t have descriptions. This -means that the \nopostdot and \glsxtrnopostpunc commands aren’t required. The top-level entries can -simply be defined as:
-
-\newglossaryentry{greekletter}{name={Greek letters}, -
text={Greek letter}, description={}} -
-
\newglossaryentry{romanletter}{name={Roman letters}, -
text={Roman letter}, description={}} -
-
I’ve now loaded both the glossary-tree and glossary-topic packages (via stylemods={tree,topic}). The -glossary-topic package can be used without glossary-tree, in which case it will behave more like the normal tree -rather than alttree styles (but with different indentation and no description in the top-level). However, -if you use \glssetwidest (provided by glossary-tree) then the topic style will behave more like -alttree. -

Since there’s no description for the top-level entries, the topic style ignores the widest name setting for the -top-level, so I can just have the level 1 setting: - - -

-
-\glssetwidest[1]{Sigma}
-
-

-

bib2glsIf you want to convert this document so that it uses bib2gls, you first need to convert it -to using glossaries-extra, as described above, but remember that you now need the record option. -

-
-\usepackage[record,style=topic,postdot,nostyles,stylemods={tree,topic}] -
{glossaries-extra} -
-
Next convert the entries to the bib format required by bib2gls: -


-   
convertgls2bib --preamble-only sampletree.tex entries.bib -
-
-Now replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries,set-widest] -
-
I’ve used the set-widest option here to get bib2gls to compute the widest name. (Obviously, it can only do -this if it can correctly interpret any commands contained in the name field.) -

This means that the \glssetwidest commands can now be removed completely. All the \newglossaryentry -commands also need to be removed from the preamble. Finally, \printunsrtglossaries needs to be replaced -with \printunsrtglossaries. The document build is now: -


-   
pdflatex sampletree -
bib2gls sampletree -
pdflatex sampletree -
-
-

This produces the same result as with just glossaries-extra and makeglossaries. However, there are some -modifications that can be made to the bib file to make it neater. -

The top-level entries are defined as:

- - -
-@entry{greekletter, -
  name = {Greek letters}, -
  description = {}, -
  text = {Greek letter} -
} -
-
@entry{romanletter, -
  name = {Roman letters}, -
  description = {}, -
  text = {Roman letter} -
} -
-
This is a direct translation from the \newglossaryentry commands (after switching to the topic style). There’s -a more appropriate entry type:
-
-@indexplural{greekletter, -
  text = {Greek letter} -
} -
-
@indexplural{romanletter, -
  text = {Roman letter} -
} -
-
The @indexplural entry type doesn’t require the description and will set the name field to the same as the -plural field. Since the plural field hasn’t been set it’s obtained by appending “s” to the text -field. -

Now let’s assume that the symbol entries are defined in a more rational manner, with the actual symbol in -the name field. For example:

-
-@entry{sigma, -
  user1 = {uppercase sigma}, -
  parent = {greekletter}, -
  description = {Used to indicate summation}, -
  name = {\ensuremath{\Sigma}}, -
  category = {symbol} -
} -
-
@entry{C, -
  parent = {romanletter}, -
  name = {\ensuremath{C}}, -
  description = {Euler's constant}, - - -
  category = {symbol} -
} -
-
The category post-description hook (provided with \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 sigma -entry is before the pi entry. This is because bib2gls is obtaining the sort values from the name field, -which is the sort fallback for @entry. This means that the sort values end up as Σ and π (bib2gls -recognises the commands \Sigma and \pi and converts them to the Unicode characters 0x1D6F4 and -0x1D70B). -

If you change @entry to @symbol then you will once again get the order from the original example (pi before -Sigma). This is because the sort fallback for @symbol is the label not the name. (Remember that the sort -fallback is only used if the sort field isn’t set. If you explicitly set the sort field then no fallback is required. See -bib2gls gallery: sorting.) -

You can further tidy the bib file by removing the category fields. For example:

-
-@symbol{sigma, -
  user1 = {uppercase sigma}, -
  parent = {greekletter}, -
  description = {Used to indicate summation}, -
  name = {\ensuremath{\Sigma}} -
} -
-
You can then assign the category in the resource set:
-
-\GlsXtrLoadResources[src=entries,set-widest,category={same as entry}] -
-
This means that all the entries defined with @symbol will have the category set to symbol and all the entries -defined with @indexplural will have the category set to indexplural. (Only the symbol category is significant -in this example.) -

You can make the bib files even more flexible by introducing field and entry aliases with field-aliases and -entry-type-aliases. See the bib2gls manual for further details. -

-

-

Top

18.7 Cross-Referencing

- - - -

-

-

🔗sample-crossref.tex

-

This document illustrates how to cross-reference entries in the glossary. -


-   
pdflatex sample-crossref -
makeglossaries sample-crossref -
pdflatex sample-crossref -
-
-The document provides a command \alsoname to produce some fixed text, which can be changed as -appropriate (usually within a language hook): - - -

-
-\providecommand{\alsoname}{see also}
-
-

I’ve used \providecommand as some packages define this command. This is used to create a “see also” -cross-reference with the see key: - - -

-
-\newglossaryentry{apple}{name=apple,description={firm, round fruit},
-see=[\alsoname]{pear}}
-\newglossaryentry{marrow}{name={marrow},
- description={long vegetable with thin green skin and white flesh},
- see={[\alsoname]courgette}}
-
-

-

Note that “marrow” is included in the glossary even though it hasn’t been referenced in the text. This is -because the see key automatically triggers \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 glossaries-extra (see -below). -


glossaries-extraThis example is quite simple to convert to glossaries-extra. If you want the dot after the -description, you need the nopostdot=false or postdot package option. You may also want to consider using the -stylemods option. -

In order to prevent the “marrow” entry from being automatically being added to the glossary as a result of -the cross-reference, you can use autoseeindex=false to prevent the automatic indexing triggered by the see key -(or the seealso key provided by glossaries-extra). -

-
-
-\usepackage[autoseeindex=false,postdot,stylemods]{glossaries-extra} -
-
The document build is the same, but now the “marrow” and “zucchini” entries aren’t present in the -document. -

Note that the “fruit” entry is still included even though it hasn’t been used in the document. This is because -it was explicitly indexed with \glssee not via the see key. -

The entries that contains see=[\alsoname] can be converted to use the seealso key:

-
-\newglossaryentry{apple}{name=apple,description={firm, round fruit}, -
seealso={pear}} -
-
\newglossaryentry{marrow}{name={marrow}, -
 description={long vegetable with thin green skin and white flesh}, -
 seealso={courgette}} - - -
-
(The provided \alsoname definition may be removed.) -

The original example redefines the cross-referencing format to use small caps:

-
-\renewcommand{\glsseeitemformat}[1]{\textsc{\glsentryname{#1}}} -
-
This will still produce the desired effect with glossaries-extra for this simple example but, as with -sampleAcrDesc.tex, this redefinition isn’t necessary if you have at least glossaries-extra v1.42. -

bib2glsIf you want to switch to bib2gls then you first need to switch to glossaries-extra, as -described above, but you now need the record option but no longer need the autoseeindex=false option: -

-
-\usepackage[record,postdot,stylemods]{glossaries-extra} -
-
Next the entry definitions need to be converted to the bib format required by bib2gls. -


-   
convertgls2bib sample-crossref.tex entries.bib -
-
-If you have at least v2.0 then convertgls2bib will absorb the cross-referencing information supplied -by: - - -

-
-\glssee{fruit}{pear,apple,banana}
-
-

into the fruit definition:

-
-@entry{fruit, -
  see = {pear,apple,banana}, -
  name = {fruit}, -
  description = {sweet, fleshy product of plant containing seed} -
} -
-
Now remove \makeglossaries and all the entry definition commands (including \glssee from the preamble) -and add:
-
-\GlsXtrLoadResources[src=entries.bib] -
-
Finally, replace \printglossaries with \printunsrtglossaries. The document build is now: -


-   
pdflatex sample-crossref -
bib2gls sample-crossref -
pdflatex sample-crossref -
-
-The glossary now contains: apple, banana, courgette and pear. Note that it doesn’t contain fruit, zucchini or -marrow. -

Now change the selection criteria:

-
-\GlsXtrLoadResources[src=entries.bib, -
 selection={recorded and deps and see}] -
-
The glossary now includes fruit, zucchini and marrow. -

The fruit and zucchini use the see key which is a simple redirection for the reader. There’s no number list -for either of these entries. Whereas marrow uses the seealso key, which is typically intended as a -supplement to a number list 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:

- - -
-\GlsXtrLoadResources[src=entries.bib, -
 selection={recorded and deps and see not also}] -
-
In this case, the glossary includes fruit and zucchini but not marrow. -

-

-

Top

18.8 Custom Keys

- -

-

-

🔗sample-newkeys.tex

-

This document illustrates how add custom keys (using \glsaddkey). There are two custom keys ed, where the -default value is the text field with “ed” appended, and ing, where the default value is the text field with “ing” -appended. Since the default value in both cases references the text field, the starred version \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: - - -

-
-\newglossaryentry{jump}{name={jump},description={}}
-\newglossaryentry{run}{name={run},%
- ed={ran},%
- ing={running},
- description={}}
-\newglossaryentry{waddle}{name={waddle},%
- ed={waddled},%
- ing={waddling},%
- description={}}
-
-

-

Each custom key is provided a set of commands analogous to \glsentrytext, that allows the key value to -be accessed, and \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 \glsdisp. When editing the document source, it’s -usually simpler to read: - - -

-
-The dog \glsdisp{jump}{jumped} over the duck.
-
-

than - - -

-
-The dog \glsed{jump} over the duck.
-
-

-

bib2glsIf you want to convert this document to use bib2gls, you first need to switch to glossaries-extra, but -remember that you need the record option:

-
-\usepackage[record]glossaries-extra -
-
Next convert the entry definitions to the bib format required by bib2gls: -


-   
convertgls2bib --index-conversion --preamble-only sample-newkeys.tex entries.bib -
-
-The --index-conversion switch requires at least v2.0 and will convert entries without a description (or where -the description is simply \nopostdesc or \glsxtrnopostpunc) to @index instead of @entry. This means that -the new entries.bib file will contain:

-
-@index{jump, -
  name = {jump} -
} -
-
@index{run, -
  ing = {running}, -
  name = {run}, -
  ed = {ran} -
} -
-
@index{waddle, -
  ing = {waddling}, -
  name = {waddle}, -
  ed = {waddled} -
} -
-
Now replace \makeglossaries with
-
-\GlsXtrLoadResources[src=entries] - - -
-
and delete the \newglossaryentry commands. Finally replace \printglossaries with \printunsrtglossaries. -

The document build is now: -


-   
pdflatex sample-newkeys -
bib2gls sample-newkeys -
pdflatex sample-newkeys -
-
-Note that there’s no need for the nonumberlist package option when you don’t use bib2gls’s --group -switch. - -

-

-

🔗sample-storage-abbr.tex

-

This document illustrates how add custom storage keys (using \glsaddstoragekey). The document build -is: -


-   
pdflatex sample-storage-abbr -
makeglossaries sample-storage-abbr -
pdflatex sample-storage-abbr -
-
-

The custom storage key is called abbrtype which defaults to word if not explicitly set. Its value can be -accessed with the provided custom command \abbrtype.

-
-\glsaddstoragekey{abbrtype}{word}{\abbrtype} -
-
A custom abbreviation style is then defined that checks the value of this key and makes certain adjustments -depending on whether or not its value is the default word. -

This essentially forms a very similar function to the glossaries-extra package’s category key, which is also -defined as a storage key:

-
-\glsaddstoragekey{category}{general}{\glscategory} -
-
-


glossaries-extraThis document is much simpler with the glossaries-extra package:

- - -
-\documentclass{article} -
\usepackage[postdot]{glossaries-extra} -
\makeglossaries -
\setabbreviationstyle[acronym]{short-long} -
\newacronym{radar}{radar}{radio detecting and ranging} -
\newacronym{laser}{laser}{light amplification by stimulated -
emission of radiation} -
\newacronym{scuba}{scuba}{self-contained underwater breathing -
apparatus} -
-
\newabbreviation{dsp}{DSP}{digital signal processing} -
\newabbreviation{atm}{ATM}{automated teller machine} -
-
\begin{document} -
-
First use: \gls{radar}, \gls{laser}, \gls{scuba}, \gls{dsp}, -
\gls{atm}. -
-
Next use: \gls{radar}, \gls{laser}, \gls{scuba}, \gls{dsp}, -
\gls{atm}. -
-
\printglossaries -
\end{document} -
-
- -

-

-

🔗sample-storage-abbr-desc.tex

-

An extension of the previous example where the user needs to provide a description. - -

-

-

🔗sample-chap-hyperfirst.tex

-

This document illustrates how to add a custom key using \glsaddstoragekey and hook into the \gls-like and -\glstext-like mechanism used to determine whether or not to hyperlink an entry. The document build -is: -


-   
pdflatex sample-chap-hyperfirst - - -
makeglossaries sample-chap-hyperfirst -
pdflatex sample-chap-hyperfirst -
-
-This example creates a storage key called chapter used to store the chapter number.

-
-\glsaddstoragekey{chapter}{0}{\glschapnum} -
-
It’s initialised to 0 and the \glslinkpostsetkeys hook is used to check this value against the current chapter -number. If the values are the same then the hyperlink is switched off, otherwise the key value is updated unless -the hyperlink has been switched off (through the optional argument of commands like \gls and \glstext). -
-
-\renewcommand*{\glslinkpostsetkeys}{% -
 \edef\currentchap{\arabic{chapter}}% -
 \ifnum\currentchap=\glschapnum{\glslabel}\relax -
  \setkeys{glslink}{hyper=false}% -
 \else -
  \glsifhyperon{\glsfieldxdef{\glslabel}{chapter}{\currentchap}}{}% -
 \fi -
} -
-
Since this key isn’t intended for use when the 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 \glsfieldxdef requires the -existence of the field. The 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. -


glossaries-extraIf you want to switch to glossaries-extra you need to change the package loading line: -

-
-\usepackage[postdot]{glossaries-extra} -
-
The custom storage key (provided with \glsaddstoragekey) can be removed, and the \glslinkpostsetkeys -hook can be changed to:
-
-\renewcommand*{\glslinkpostsetkeys}{% -
 \edef\currentchap{\arabic{chapter}}% -
 \GlsXtrIfFieldEqNum*{chapter}{\glslabel}{\currentchap} - - -
 {% -
   \setkeys{glslink}{hyper=false}% -
 }% -
 {% -
   \glsifhyperon{\xGlsXtrSetField{\glslabel}{chapter}{\currentchap}}{}% -
 }% -
} -
-
The field name is still called chapter but there’s no longer an associated key or command. -

-

-

Top

18.9 Xindy (Option 3)

-

Most of the earlier makeindex sample files can be adapted to use xindy instead by adding the xindy package -option. Situations that you need to be careful about are when the sort value (obtained from the name if the sort -key is omitted) contains commands (such as name={\pi}) or is identical to another value (or is identical after -xindy has stripped all commands and braces). This section describes sample documents that use features which -are unavailable with makeindex. - -

-

-

🔗samplexdy.tex

-

The document uses UTF8 encoding (with the inputenc package). This is information that needs to be passed to -xindy, so the encoding is picked up by makeglossaries from the aux file. -

By default, this document will create a xindy style file called samplexdy.xdy, but if you uncomment the -lines - - -

-
-\setStyleFile{samplexdy-mc}
-\noist
-\GlsSetXdyLanguage{}
-
-

it will set the style file to samplexdy-mc.xdy instead. This provides an additional letter group for entries -starting with “Mc” or “Mac”. If you use makeglossaries or makeglossaries-lite, you don’t need to supply -any additional information. If you don’t use makeglossaries, you will need to specify the required -information. Note that if you set the style file to samplexdy-mc.xdy you must also specify \noist, -otherwise the glossaries package will overwrite samplexdy-mc.xdy and you will lose the “Mc” letter -group. -

To create the document do: -


-   
pdflatex samplexdy -
makeglossaries samplexdy -
pdflatex samplexdy -
-
-If you don’t have Perl installed then you can’t use makeglossaries, but you also can’t use xindy! However, if -for some reason you want to call xindy explicitly instead of using makeglossaries (or makeglossaries-lite): -

-
    -
  • -

    if you are using the default style file samplexdy.xdy, then do (no line breaks): -

    
    -     
    xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo -
    -
    -

  • -
  • -

    if you are using samplexdy-mc.xdy, then do (no line breaks): -

    
    -     
    xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo -
    -
    -

-

This document creates a new command to use with the format key in the optional argument of commands -like \gls to format the location in the number list. The usual type of definition when a hyperlinked location is -required should use one of the \hyperxx commands listed in table 5.1: - - -

-
-\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}
-
-

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 hyperbfit -is used in the format key. It does, however, need to be identified as an attribute so that xindy can recognise -it: - - -

-
-\GlsAddXdyAttribute{hyperbfit}
-
-

This will add information to the xdy file when it’s created by \makeglossaries. If you prevent the creation of -this file with \noist then you will need to add the attribute to your custom xdy file (see the provided -samplexdy-mc.xdy file). -

In order to illustrate unusual location formats, this sample document provides a command called -\tallynum{n} that represents its numerical argument with a die or dice where the dots add up to -⟨n⟩: - - -

-
-\newrobustcmd*{\tallynum}[1]{%
- \ifnum\number#1<7
-  $\csname dice\romannumeral#1\endcsname$%
- \else
-  $\dicevi$%
-  \expandafter\tallynum\expandafter{\numexpr#1-6}%
- \fi
+
+@entry{oeil,
+  plural={yeux},
+  prefix={l'},
+  name={oeil},
+  description={eye},
+  prefixplural={les}
 }
-
-

This command needs to be robust to prevent it from being expanded when it’s written to any of the auxiliary -files. The \dicei, …, \dicevi commands are provided by the stix package, so that needs to be -loaded. -

An associated command \tally{counter} is defined that formats the value of the named ⟨counter⟩ according -to \tallynum: - - -

-
-\newcommand*{\tally}[1]{\tallynum{\arabic{#1}}}
-
-

(This shouldn’t be robust as it needs the counter value to expand.) The page numbers are altered to use this -format (by redefining \thepage). -

This custom location format also needs to be identified in the xdy file so that xindy can recognise it and -determine how to form ranges if required. - - -

-
-\GlsAddXdyLocation{tally}{% tally location format
- :sep "\string\tallynum\space\glsopenbrace"
- "arabic-numbers"
- :sep "\glsclosebrace"
+
+@acronym{svm,
+  prefixfirst={a},
+  prefix={an},
+  short={SVM},
+  long={support vector machine}
 }
-
-

Again this information is written to the xdy file by \makeglossaries so if you use \noist then you need to -manually add it to your custom xdy file. -

When xindy creates the associated glossary files, the locations will be written using:

-
-\glsXcounterXformat{hyper-prefix}{location} -
-
In this case:
-
-\glsXpageXglsnumberformat{}{\tallynum{number}} -
-
or
-
-\glsXpageXhyperbfit{}{\tallynum{number}} -
-
This means that although \hyperbf is designed to create hyperlinked locations, the presence of \tallynum -interferes with it. In order to make the hyperlinks work correctly, the definitions of \glsXpageXhyperbfit 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 \tally is changed so that it expands differently then these modifications won’t -work. -

Remember that in both cases, the second argument #2 is in the form \tally{n}: - - -

-
-\renewcommand{\glsXpageXglsnumberformat}[2]{%
- \linkpagenumber#2%
+
Now add the append-prefix-field={space or nbsp} resource option:
\GlsXtrLoadResources[src=entries,append-prefix-field={space or nbsp}]
+
See the bib2gls manual for further details.

+

🗋📥 sampleaccsupp.tex
+ This document uses the glossaries-accsupp package (see §17). That package automatically loads glossaries and passes all options to the base package. So you can load both packages at once with just:
\usepackage[acronym]{glossaries-accsupp}
+
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 accsupp’s \BeginAccSupp and \EndAccSupp commands. See the accsupp package for further details of those commands.

+Note that this example document is provided to demonstrate glossaries-accsupp as succinctly as possible. The resulting document isn’t fully accessible as it’s not tagged. See the accessibility and tagpdf packages for further information about tagging documents.

+It’s not essential to use glossaries-accsupp. You can simply insert the replacement text directly into the field values. For example:

\newglossaryentry{Drive}{
+ name={\BeginAccSupp{Actual=Drive}Dr.\EndAccSupp{}},
+ description={Drive}
 }
-\renewcommand{\glsXpageXhyperbfit}[2]{%
- \textbf{\em\linkpagenumber#2}%
+\newglossaryentry{image}{name={sample image},
+ description={an example image},
+ user1={\protect\BeginAccSupp{Alt={a boilerplate image used in   examples}}\protect\includegraphics   [height=20pt]{example-image}\protect\EndAccSupp{}}
 }
-
-

These need a command that can grab the actual number and correctly encapsulate it: - - -

-
-\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}}
-
-

-

If you want to try out the samplexdy-mc.xdy file, the entries starting with “Mac” or “Mc” will be placed in -their own “Mc” letter group. Ideally it should be possible to do this simply with \GlsAddLetterGroup (and not -require a custom xdy file) but unfortunately the “M” letter group will have already been defined and take -precedence over “Mc”, which is why a custom file is required and the normal language module must be -suppressed: - - -

-
-\setStyleFile{samplexdy-mc}
-\noist
-\GlsSetXdyLanguage{}
-
-

-

This “Mc” group is suitable for names like “Maclaurin” but not for “Mach”. To prevent this, the sort key -for that value is set to lower case: - - -

-
-\newglossaryentry{mach}{name={Mach, Ernst},
-first={Ernst Mach},text={Mach},
-sort={mach, Ernst},
-description={Czech/Austrian physicist and philosopher}}
-
-

-

bib2glsIf you want to convert this document so that it uses bib2gls, you first need to switch to -glossaries-extra and use the record package option:

-
-\usepackage[record,postdot]{glossaries-extra} -
-
The xindy-only commands can now all be removed (attribute \GlsAddXdyAttribute, location -\GlsAddXdyLocation, language \GlsSetXdyLanguage, location encapsulators \glsXcounterXformat and the -custom helper \linkpagenumber). Also \noist and \setStyleFile aren’t relevant with bib2gls and so should -be removed. -

The definitions of \hyperbfit should be retained (as well as \tallynum, \tally and the redefinition of -\thepage). -

The entries all need to be converted to the bib format required by bib2gls. -


-   
convertgls2bib --preamble-only samplexdy.tex entries.bib -
-
-Next replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries] -
-
and remove all the entry definitions from the preamble. Use the search and replace function on your text editor -to replace all instances of \glsentryfirst with \glsfmtfirst, and all instances of \glsentryname with -\glsfmtname. -

Finally, replace \printglossaries with \printunsrtglossaries. The document build is now: -


-   
pdflatex samplexdy -
bib2gls --group samplexdy -
pdflatex samplexdy -
-
- - -

This results in a slightly different ordering from the original document (without the “Mc” letter group). In -the original example, “Mach number” was listed before “Mach, Ernest”. The modified document now has -“Mach, Ernest” before “Mach number”. This difference is due to bib2gls’s default break-at=word setting, -which marks word boundaries with the pipe (|) character, so the sort values for bib2gls are Mach|Earnest| -and Mach|number|. See the 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 “Mc” letter group, it can be obtained by providing a custom sort rule:

-
-\GlsXtrLoadResources[src=entries, -
   sort=custom, -
   sort-rule={\glsxtrcontrolrules -
   ;\glsxtrspacerules;\glsxtrnonprintablerules -
   ;\glsxtrcombiningdiacriticrules,\glsxtrhyphenrules -
   <\glsxtrgeneralpuncrules<\glsxtrdigitrules -
   <a,A<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K<l,L<Mc=Mac<m,M<o,O -
   <p,P<q,Q<r,R<s,S<t,T<u,U<v,V<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z -
   } -
] -
-
Unfortunately, as with xindy, this puts “Mach” into the “Mc” letter group. -

One way to get around this problem is to define a custom command to help identify genuine “Mc”/“Mac” -prefixes with names that happen to start with “Mac”. For example:

-
-@entry{mcadam, -
  name = {\Mac{Mc}Adam, John Loudon}, -
  description = {Scottish engineer}, -
  text = {McAdam}, -
  first = {John Loudon McAdam} -
} -
-
@entry{maclaurin, -
  name = {\Mac{Mac}laurin, Colin}, -
  description ={Scottish mathematician best known for the -
\gls{maclaurinseries}}, -
  text = {Maclaurin}, -
  first = {Colin Maclaurin} -
} -
-
but not for “Mach”:
- - -
-@entry{mach, -
  name = {Mach, Ernst}, -
  description = {Czech/Austrian physicist and philosopher}, -
  text = {Mach}, -
  first = {Ernst Mach} -
} -
-
With LaTeX, this command should simply do its argument: - - -
-\newcommand{\Mac}[1]{#1}
-
-

However, when bib2gls works out the sort value, it needs to be defined with something unique that won’t -happen to occur at the start of another term. For example: - - -

-
-\providecommand{\Mac}[1]{MC}
-
-

(Remember that break-at=word will strip spaces and punctuation so don’t include them unless you switch to -break-at=none.) -

So add the first definition of \Mac to the tex file and modify entries.bib so that it includes the second -definition:

-
-@preamble{"\providecommand{\Mac}[1]{MC}"} -
-
Then modify the “Mc”/“Mac” entries as appropriate (see the above “McAdam” and “Maclaurin” -examples). -

The custom sort rule needs to be modified:

-
-\GlsXtrLoadResources[src=entries, -
   write-preamble=false, -
   sort=custom, -
   sort-rule={\glsxtrcontrolrules -
   ;\glsxtrspacerules;\glsxtrnonprintablerules -
   ;\glsxtrcombiningdiacriticrules,\glsxtrhyphenrules -
   <\glsxtrgeneralpuncrules<\glsxtrdigitrules -
   <a,A<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K<l,L<MC<m,M<o,O -
   <p,P<q,Q<r,R<s,S<t,T<u,U<v,V<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z -
   } -
] -
-
This will create a “Mc” letter group that only includes the names that start with the custom \Mac -command. -

Other alternatives include moving @preamble into a separate bib file, so that you can choose -whether or not to include it. See the “Examples” chapter of the bib2gls user manual for further -examples. - -

-

-

🔗samplexdy2.tex

-

This document illustrates how to use the glossaries package where the location numbers don’t follow a standard -format. This example will only work with xindy. To create the document do: - - -


-   
pdflatex samplexdy2 -
makeglossaries samplexdy2 -
pdflatex samplexdy2 -
-
-The explicit xindy call is: -


-   
xindy -L english -C utf8 -I xindy -M samplexdy2 -t samplexdy2.glg -o samplexdy2.gls samplexdy2.glo -
-
-This example uses the section counter with xindy: - - -

-
-\usepackage[xindy,counter=section]{glossaries}
-
-

The document employs an eccentric section numbering system for illustrative purposes. The section numbers -are prefixed by the chapter number in square brackets: - - -

-
-\renewcommand*{\thesection}{[\thechapter]\arabic{section}}
-
-

Parts use Roman numerals: - - -

-
-\renewcommand*{\thepart}{\Roman{part}}
-
-

The section hyperlink name includes the part: - - -

-
-\renewcommand*{\theHsection}{\thepart.\thesection}
-
-

This custom numbering scheme needs to be identified in the xdy file: - - -

-
-\GlsAddXdyLocation["roman-numbers-uppercase"]{section}{:sep "["
-  "arabic-numbers" :sep "]" "arabic-numbers"
+
However, this can cause interference (especially with case-changing). With glossaries-accsupp it’s possible to obtain the field values without the accessibility information if required. (If in the future \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 acronym style is set using:

\setacronymstyle{long-short}
+
The first acronym is straightforward:
\newacronym{eg}{e.g.}{for example}
+
The shortaccess replacement text is automatically set to the long form. The next acronym is awkward as the long form contains formatting commands which can’t be included in the replacement text. This means that the shortaccess key must be supplied:
\newacronym[shortaccess={TiKZ ist kein Zeichenprogramm}]
+{tikz}{Ti\emph{k}Z}{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm}
+
In the above two cases, the short form obtained in \gls will use the “E” PDF element.

+By way of comparison, there are some entries that are technically abbreviations but are defined using \newglossaryentry instead of \newacronym. The replacement text is provided in the access key:

\newglossaryentry{Doctor}{name={Dr},description={Doctor},access={Doctor}}
+\newglossaryentry{Drive}{name={Dr.},plural={Drvs},description={Drive},
+  access={Drive}}
+
These will use the “ActualText” PDF element (not “E”).

+The next entry is a symbol (the integration symbol \(\int \)). This could be defined simply as:

\newglossaryentry{int}{name={int},description={integral},
+ symbol={\ensuremath{\int}}}
+
and then referenced in the text like this:
Symbol: \gls{int} (\glssymbol{int}).
+
This results in the text “Symbol: integral (\(\int \)).” However if you copy and paste this from the PDF you will find the resulting text is “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 \BeginAccSupp command needs to have the options adjusted.

+In order to determine whether to use “E”, “ActualText” or “Alt” for a particular field, glossaries-accsupp will check if the command \glsfield-labelaccsupp exists (where field-label is the internal field label, see Table 4.1). Only two of these commands are predefined: \glsshortaccsupp and \glsshortplaccsupp, which is why the shortaccess field uses “E”. If the given command doesn’t exist then the generic \glsaccsupp command is used instead.

+This means that in order to simply set symbolaccess to the hexadecimal character code, I need to provide a command called \glssymbolaccsupp:

\newcommand{\glssymbolaccsupp}[2]{% 
+ \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% 
 }
-
-

If the part is 0 then \thepart will be empty (there isn’t a zero Roman numeral). An extra case is needed to -catch this: - - -

-
-\GlsAddXdyLocation{zero.section}{:sep "["
-  "arabic-numbers" :sep "]" "arabic-numbers"
+
Now I can adjust the definition of the “int” entry:
\newglossaryentry{int}{name={int},description={integral},
+  symbol={\ensuremath{\int}},symbolaccess={222B}
 }
-
-

Note that this will stop xindy giving a warning, but the location hyperlinks will be invalid if no \part is -used. -

bib2glsIf you want to switch to bib2gls, you first need to switch to glossaries-extra but remember to use -record instead of xindy:

-
-\usepackage[record,counter=section]{glossaries-extra} -
-
Next remove the \GlsAddXdyLocation commands and convert the entry definitions to the bib format required -by bib2gls: -


-   
convertgls2bib --preamble-only samplexdy2.tex entries.bib -
-
-Now replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries] -
-
and remove the \newglossaryentry commands. Finally, replace \printglossaries with -\printunsrtglossaries. -

The document build is: -


-   
pdflatex samplexdy2 -
bib2gls samplexdy2 -
pdflatex samplexdy2 -
-
-

With unusual numbering systems, it’s sometimes better to use record=nameref:

-
-\usepackage[record=nameref,counter=section]{glossaries-extra} - - -
-
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:
-
-\newcommand*{\glsxtrsectionlocfmt}[2]{#1} -
-
(Make sure you have at least v1.42 of glossaries-extra.) See also the earlier sampleSec.tex. - -

-

-

🔗samplexdy3.tex

-

This document is very similar to samplexdy.tex but uses the command \Numberstring from the -fmtcount package to format the page numbers instead of the \tally command from the earlier -example. - -

-

-

🔗sampleutf8.tex

-

This is another example that uses xindy. Unlike makeindex, xindy can cope with non-Latin characters. This -document uses UTF-8 encoding. To create the document do: -


-   
pdflatex sampleutf8 -
makeglossaries sampleutf8 -
pdflatex sampleutf8 -
-
-The explicit xindy call is (no line breaks): -

-


-
xindy --L -english --C -utf8 --I -xindy --M -sampleutf8 --t - - -sampleutf8.glg --o -sampleutf8.gls -sampleutf8.glo -
-
-

If you remove the xindy option from sampleutf8.tex and do: -


-   
pdflatex sampleutf8 -
makeglossaries sampleutf8 -
pdflatex sampleutf8 -
-
-or -


-   
pdflatex sampleutf8 -
makeglossaries-lite sampleutf8 -
pdflatex sampleutf8 -
-
-you will see that the entries that start with an extended Latin character now appear in the symbols group, and -the word “manœuvre” is now after “manor” instead of before it. If you want to explicitly call makeindex (no -line breaks): -


-   
makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo -
-
-

bib2glsIf you want to switch to bib2gls, you first need to switch to glossaries-extra but replace xindy with -record:

-
-\usepackage[record,postdot,stylemods,style=listgroup]{glossaries-extra} -
-
Note that you don’t need the nonumberlist option with bib2gls. You can instruct bib2gls to -simply not save the number lists, but in this case there won’t be any locations as there’s no actual -indexing. -

The entries need to be converted to the bib format required by bib2gls: -


-   
convertgls2bib --preamble-only --texenc UTF-8 --bibenc UTF-8 sampleutf8.tex entries.bib -
-
-Note the first line of the entries.bib file:

- - -
-% Encoding: UTF-8 -
-
This is the encoding of the bib file. It doesn’t have to match the encoding of the tex file, but it’s generally -better to be consistent. When bib2gls parses this file, it will look for this encoding line. (If the --texenc and ---bibenc switches aren’t used, convertgls2bib will assume your system’s default encoding. See the bib2gls -manual for further details.) -

Next replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries,selection=all] -
-
and remove all the \newglossaryentry commands. -

Iterative commands like \glsaddall don’t work with bib2gls. Instead, you can select all entries using the -selection=all option. This is actually better than \glsaddall, which enforces the selection of all entries by -indexing each entry. As a result, with makeindex and xindy (and Option 1), every entry will have the same -location (which is the location of the \glsaddall command, in this case page 1). With selection=all, -bib2gls will automatically selection all entries even if they don’t have any records (indexing information) so in -this case there are no number lists. -

Finally, replace \printglossaries with \printunsrtglossaries. The build process is now: -


-   
pdflatex sampleutf8 -
bib2gls --group sampleutf8 -
pdflatex sampleutf8 -
-
-bib2gls picks up the encoding of the tex file from the aux file:

-
-\glsxtr@texencoding{utf8} -
-
If you experience any encoding issues, check the aux file for this command and check the bib file for the -encoding comment line. Also check bib2gls’s glg transcript file for encoding messages, which should look -like: - - -
-TeX character encoding: UTF-8
-
-

-

The document language, if it has been set, is also added to the aux file when the record option is used. In -this case, no language package has been used, so 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 sort key with a locale tag identifier. For example: -

-
-\GlsXtrLoadResources[src=entries,selection=all,sort=de-CH-1996] -
-
(Swiss German new orthography) or:
-
-\GlsXtrLoadResources[src=entries,selection=all,sort=is] -
-
(Icelandic). -

-

-

Top

18.10 No Indexing Application (Option 1)

- -

-

-

🔗sample-noidxapp.tex

-

This document illustrates how to use the glossaries package without an external indexing application -(Option 1). To create the complete document, you need to do: -


-   
pdflatex sample-noidxapp -
pdflatex sample-noidxapp -
-
-Note the need to group the accent command that occurs at the start of the name:

- - -
-\newglossaryentry{elite}{% -
  name={{\'e}lite}, -
  description={select group of people} -
} -
-
This is necessary to allow the term to work with \Gls. Notice also how the number lists can’t be compacted -into ranges. For example, the list “1, 2, 3” would be converted to “1–3” with a proper indexing application -(Options 2 or 3 or, with glossaries-extra, Option 4). -

The larger the list of entries, the longer the document build time. This method is very inefficient for large -glossaries. See Gallery: glossaries performance for a comparison. - -

-

-

🔗sample-noidxapp-utf8.tex

-

As the previous example, except that it uses the inputenc package. To create the complete document, you need -to do: -


-   
pdflatex sample-noidxapp-utf8 -
pdflatex sample-noidxapp-utf8 -
-
-This method is unsuitable for sorting languages with extended Latin alphabets or non-Latin alphabets. Use -Options 3 or 4 instead. -

-

-

Top

18.11 Other

- -

-

-

🔗sample4col.tex

-

This document illustrates a four column glossary where the entries have a symbol in addition to the name and -description. To create the complete document, you need to do: -


-   
pdflatex sample4col -
makeglossaries sample4col -
pdflatex sample4col - - -
-
-or -


-   
pdflatex sample4col -
makeglossaries-lite sample4col -
pdflatex sample4col -
-
-The vertical gap between entries is the gap created at the start of each group. This can be suppressed using the -nogroupskip package option. (If you switch to bib2gls, simply omit the --group command line -option.) -

This example uses the long4colheaderborder. This style doesn’t allow multi-line descriptions. You may prefer -to use altlong4colheaderborder with long descriptions. However, in either case a style that uses booktabs is -preferable. For example, long4col-booktabs or altlongragged4col-booktabs. Note that this requires -glossary-longbooktabs, which needs to be explicitly loaded. The style can only be set once this package has been -loaded:

-
-\usepackage{glossaries} -
\usepackage{glossary-longbooktabs} -
\setglossarystyle{altlongragged4col-booktabs} -
-
-


glossaries-extraThe glossaries-extra package provides a more compact way of doing this with the stylemods -option:

-
-\usepackage[style=altlongragged4col-booktabs,stylemods=longbooktabs] -
{glossaries-extra} -
-
The glossaries-extra package provides additional styles, including more “long” styles with the glossary-longextra -package. For example, the long-name-desc-sym-loc style:
-
-\usepackage[style=long-name-desc-sym-loc,stylemods=longextra] -
{glossaries-extra} -
-
If you use the stylemods option with an argument, you may prefer to use it with nostyles to prevent unwanted -styles from being automatically loaded. For example:
- - -
-\usepackage[style=long-name-desc-sym-loc,nostyles,stylemods=longextra] -
{glossaries-extra} -
-
See also the gallery of predefined styles. - -

-

-

🔗sample-numberlist.tex

-

This document illustrates how to reference the number list in the document text. This requires an additional -LaTeX run: -


-   
pdflatex sample-numberlist -
makeglossaries sample-numberlist -
pdflatex sample-numberlist -
pdflatex sample-numberlist -
-
-This uses the savenumberlist package option, which enables \glsentrynumberlist and \glsdisplaynumberlist -(with limitations). The location counter is set to chapter, so the number list refers to the chapter -numbers. - - -

-
-\usepackage[savenumberlist,counter=chapter]{glossaries}
-
-

The number list can’t be obtained until makeindex (or xindy) has created the glossary file. The number list is -picked up when this file is input by \printglossary and is then saved in the aux file so that it’s available on -the next LaTeX run. -

This document contains both commands:

-
-This is a \gls{sample} document. \Glspl{sample} -
are discussed in chapters~\glsdisplaynumberlist{sample} -
(or \glsentrynumberlist{sample}). -
-
Without hyperref, the first list shows as “1–3, 5 & 6” and the second list shows as “1–3, 5, 6”. -

Note that you can’t use \glsdisplaynumberlist with hyperref and Options 2 or 3. If you do, you will get -the warning: - - -

-
-Package glossaries Warning: \glsdisplaynumberlist doesn't work with
-hyperref.
-Using \glsentrynumberlist instead
-
-

Now both lists show as “1–3, 5, 6”. -

If you switch to Option 1 (replace \makeglossaries with \makenoidxglossaries and replace -\printglossaries with \printnoidxglossaries), then the document build is simply: -


-   
pdflatex sample-numberlist -
pdflatex sample-numberlist -
-
-Now \glsdisplaynumberlist works with hyperref, however there are no ranges, so the first list shows as “1, 2, -3, 5, & 6” and the second list shows as “1, 2, 3, 4, 5, 6”. -

bib2glsIf you want to switch to bib2gls, you first need to switch to glossaries-extra (at least v1.42) but -remember to include the record option:

-
-\usepackage[record,counter=chapter]{glossaries-extra} -
-
Note that the savenumberlist option is no longer required. Next convert the entry to the bib format required by -bib2gls: -


-   
convertgls2bib sample-numberlist.tex entries.bib -
-
-Replace \makeglossaries with:

-
-\GlsXtrLoadResources[src=entries.bib] -
-
and remove the \newglossaryentry command from the document preamble. Finally, replace -\printglossaries with \printunsrtglossaries. The build process is now: -


-   
pdflatex sample-numberlist -
bib2gls sample-numberlist -
pdflatex sample-numberlist -
-
-Now both ranges and hyperlinks work. The first list shows “1–3, 5, & 6” and the second list shows “1–3, 5, 6”. -You can also use:

- - -
-\glsxtrfieldformatlist{sample}{loclist} -
-
which will show the complete list without ranges “1, 2, 3, 5 & 6”. -

This method works much better than using the savenumberlist option because bib2gls saves the formatted -number list in the location field (which is an internal field provided by glossaries-extra for the benefit of -bib2gls) and the unformatted number list in the loclist internal field (which is also used by -Option 1). -

With Options 2 and 3, both makeindex and xindy simply create a file containing the commands to typeset -the glossary, which is input by \printglossary. This means that it’s quite hard to gather information obtained -by the indexing application. -

bib2gls, on the other hand, doesn’t write a file containing the glossary. It writes a file containing the entry -definitions and uses internal fields to save the indexing information. The glossary is then displayed with -\printunsrtglossary, which simply iterates over all defined entries and fetches the required information from -those internal fields. -

The \glsdisplaynumberlist and \glsentrynumberlist commands are redefined by glossaries-extra-bib2gls -to simply access the location field. However, if you want a complete list without ranges you can use: -

-
-\glsxtrfieldformatlist{sample}{loclist} -
-
In this example, this produces “1, 2, 3, 5 & 6”. -

Note the difference if you use the record=nameref package option instead of just record. - -

-

-

🔗sample-nomathhyper.tex

-

This document illustrates how to selectively enable and disable entry hyperlinks in \glsentryfmt. The -document build is: -


-   
pdflatex sample-nomathhyper -
makeglossaries sample-nomathhyper -
pdflatex sample-nomathhyper -
-
-This disables the hyperlinks for the main glossary with:

-
-\GlsDeclareNoHyperList{main} - - -
-
and then redefines \glsentryfmt so that it adds a hyperlink if not in maths mode and the hyperlinks haven’t -been forced off (with the hyper=false key). -


glossaries-extraIf you want to switch to glossaries-extra, then you can instead use the hook that comes before -the keys are set. The preamble is much simpler:

-
-\usepackage{glossaries-extra} -
-
\makeglossaries -
-
\renewcommand{\glslinkpresetkeys}{% -
 \ifmmode \setkeys{glslink}{hyper=false}\fi -
} -
-
% entry definition -
-
- -

-

-

🔗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 siunitx package to typeset units.) The document build -is: -


-   
pdflatex sample-entryfmt -
makeglossaries sample-entryfmt -
pdflatex sample-entryfmt -
-
-This redefines \glsentryfmt to add the symbol on first use:

-
-\renewcommand*{\glsentryfmt}{% -
  \glsgenentryfmt -
  \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}% -
} -
-
Note the use of \glsentrysymbol not \glssymbol (which would result in nested link text). -


glossaries-extraIf you want to switch to the glossaries-extra package, you can make use of the category -post-link hook instead:

- - -
-\usepackage[stylemods,style=tree]{glossaries-extra} -
-
\makeglossaries -
-
\glsdefpostlink{unit}{\glsxtrpostlinkAddSymbolOnFirstUse} -
-
\newglossaryentry{distance}{ -
category={unit}, -
name=distance, -
description={The length between two points}, -
symbol={km}} -
-
Note that in this case the symbol is now outside of the hyperlink. - -

-

-

🔗sample-prefix.tex

-

This document illustrates the use of the glossaries-prefix package. An additional run is required to ensure the -table of contents is up-to-date: -


-   
pdflatex sample-prefix -
makeglossaries sample-prefix -
pdflatex sample-prefix -
pdflatex sample-prefix -
-
-Remember that the default separator between the prefix and \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 xkeyval package (which is used to parse the -⟨key=value⟩ lists) trims leading and trailing space from the values, so an ordinary space character will be lost. -

-
-\newglossaryentry{sample}{name={sample}, -
  description={an example}, -
  prefix={a~}, -
  prefixplural={the\space}% -
} -
-
\newglossaryentry{oeil}{name={oeil}, -
  plural={yeux}, - - -
  description={eye}, -
  prefix={l'}, -
  prefixplural={les\space}} -
-
-


glossaries-extraIf you want to convert this example to use glossaries-extra, then (as from v1.42) you can use -the prefix option:

-
-\usepackage[prefix,postdot,acronym]{glossaries-extra} -
-
(Alternatively load glossaries-prefix after glossaries-extra.) The rest of the document is the same as for the base -glossaries package, unless you want to switch to using bib2gls. -

bib2glsIf you want to switch to bib2gls, first switch to glossaries-extra (as above) but make sure you -include the record package option:

-
-\usepackage[record,prefix,postdot,acronym]{glossaries-extra} -
-
Next convert the entries into the bib format required by bib2gls: -


-   
convertgls2bib --preamble-only sample-prefix.tex entries.bib -
-
-Replace \makeglossaries with

-
-\setabbreviationstyle[acronym]{long-short} -
\GlsXtrLoadResources[src=entries] -
-
remove the entry definitions from the preamble, and replace
-
-\printglossary[style=plist] -
\printacronyms -
-
with
-
-\printunsrtglossary[style=plist] -
\printunsrtacronyms - - -
-
The document build is now: -


-   
pdflatex sample-prefix -
bib2gls sample-prefix -
pdflatex sample-prefix -
-
-

With bib2gls v2.0+, you don’t need to manually insert the spaces at the end of the prefixes. Instead you -can instruct bib2gls to insert them. To try this out, remove the trailing ~ and \space from the entries.bib -file:

-
-@entry{sample, -
  prefix = {a}, -
  name = {sample}, -
  description = {an example}, -
  prefixplural = {the} -
} -
-
@entry{oeil, -
  plural = {yeux}, -
  prefix = {l'}, -
  name = {oeil}, -
  description = {eye}, -
  prefixplural = {les} -
} -
-
@acronym{svm, -
  prefixfirst = {a}, -
  prefix = {an}, -
  short = {SVM}, -
  long = {support vector machine} -
} -
-
Now add the append-prefix-field={space or nbsp} resource option:
-
-\GlsXtrLoadResources[src=entries,append-prefix-field={space or nbsp}] -
-
See the bib2gls manual for further details. - - - -

-

-

🔗sampleaccsupp.tex

-

This document uses the glossaries-accsupp package (see §17 Accessibility Support). That package -automatically loads glossaries and passes all options to the base package. So you can load both packages at once -with just: - - -

-
-\usepackage[acronym]{glossaries-accsupp}
-
-

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 accsupp’s \BeginAccSupp and \EndAccSupp -commands. See the accsupp package for further details of those commands. -

Note that this example document is provided to demonstrate glossaries-accsupp as succinctly as possible. The -resulting document isn’t fully accessible as it’s not tagged. See the accessibility and tagpdf packages for further -information about tagging documents. -

It’s not essential to use glossaries-accsupp. You can simply insert the replacement text directly into the field -values. For example: - - -

-
-\newglossaryentry{Drive}{
- name={\BeginAccSupp{Actual=Drive}Dr.\EndAccSupp{}},
- description={Drive}
+

+The final entry has an image stored in the user1 key. (The image file is provided with the mwe package.) This should use “Alt” instead of “ActualText” so I need to define \glsuseriaccsupp:

\newcommand{\glsuseriaccsupp}[2]{% 
+  \glsaccessibility{Alt}{#1}{#2}% 
 }
-\newglossaryentry{image}{name={sample image},
- description={an example image},
- user1={\protect\BeginAccSupp{Alt={a boilerplate image used in
-  examples}}\protect\includegraphics
-  [height=20pt]{example-image}\protect\EndAccSupp{}}
+
The image description is provided in the user1access key:
\newglossaryentry{sampleimage}{name={sample image},
+ description={an example image},
+ user1={\protect\includegraphics[height=20pt]{example-image}},
+ user1access={a boilerplate image used in examples}
 }
-
-

However, this can cause interference (especially with case-changing). With glossaries-accsupp it’s possible to -obtain the field values without the accessibility information if required. (If in the future \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 acronym style is set using: - - -

-
-\setacronymstyle{long-short}
-
-

The first abbreviation is straightforward: - - -

-
-\newacronym{eg}{e.g.}{for example}
-
-

The shortaccess replacement text is automatically set to the long form. The next abbreviation is awkward as -the long form contains formatting commands which can’t be included in the replacement text. This means that -the shortaccess key must be supplied:

-
-\newacronym[shortaccess={TiKZ ist kein Zeichenprogramm}] -
{tikz}{Ti\emph{k}Z}{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm} -
-
In the above two cases, the short form obtained in \gls will use the “E” PDF element. -

By way of comparison, there are some entries that are technically abbreviations but are defined using -\newglossaryentry instead of \newacronym. The replacement text is provided in the access key: -

-
-\newglossaryentry{Doctor}{name=Dr,description={Doctor},access={Doctor}} -
\newglossaryentry{Drive}{name={Dr.},plural={Drvs},description={Drive}, -
  access={Drive}} -
-
These will use PDF’s “ActualText” element (not “E”). -

The next entry is a symbol (the integration symbol - ). This could be defined simply as: - - -

-
-\newglossaryentry{int}{name={int},description={integral},
- symbol={\ensuremath{\int}}}
-
-

and then referenced in the text like this: - - -

-
-Symbol: \gls{int} (\glssymbol{int}).
-
-

This results in the text “Symbol: integral ( - ).” However if you copy and paste this from the PDF you will -find the resulting text is “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 \BeginAccSupp command needs to have the -options adjusted. -

In order to determine whether to use “E”, “ActualText” or “Alt” for a particular field, glossaries-accsupp will -check if the command \glsfieldaccsupp exists (where ⟨field⟩ is the internal field label, see table 4.1). -Only two of these commands are predefined: \glsshortaccsupp and \glsshortplaccsupp, which is why the -shortaccess field uses “E”. If the given command doesn’t exist then the generic \glsaccsupp command is used -instead. -

This means that in order to simply set symbolaccess to the hexadecimal character code, I need to provide a -command called \glssymbolaccsupp:

-
-\newcommand{\glssymbolaccsupp}[2]{% -
 \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% -
} -
-
Now I can adjust the definition of the int entry:
-
-\newglossaryentry{int}{name={int},description={integral}, -
  symbol={\ensuremath{\int}},symbolaccess={222B} -
} -
-
-

The final entry has an image stored in the user1 key. (The image file is provided with the mwe -package.) This should use “Alt” instead of “ActualText” so I need to define \glsuseriaccsupp: -

-
-\newcommand{\glsuseriaccsupp}[2]{% -
  \glsaccessibility{Alt}{#1}{#2}% -
} - - -
-
The image description is provided in the user1access key:
-
-\newglossaryentry{sampleimage}{name={sample image}, -
 description={an example image}, -
 user1={\protect\includegraphics[height=20pt]{example-image}}, -
 user1access={a boilerplate image used in examples} -
} -
-
(Note the need to protect the fragile \includegraphics. The alternative is to use \glsnoexpandfields before -defining the command. See §4.4 Expansion.) -

If you try this example and inspect the -PDF18.4 then -you will find content like: - - -

-
-/Span << /ActualText (Doctor) >> BDC
-  BT
-    /F8 9.9626 Tf
-    73.102 697.123 Td
-    [ (Dr) ] TJ
-  ET
+
(Note the need to protect the fragile \includegraphics. The alternative is to use \glsnoexpandfields before defining the command. See §4.4.)

+The 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 PDFBox. If you do this you will find content like:

+/Span << /ActualText (Doctor) >> BDC
+  BT
+    /F8 9.9626 Tf
+    73.102 697.123 Td
+    [ (Dr) ] TJ
+  ET
 EMC
-
-

This shows that “ActualText” was used for \gls{Doctor}. The integral symbol ( - ) created with -\glssymbol{int} is: - - -

-
-/Span << /ActualText (\376\377"+) >> BDC
-  BT
-    /F1 9.9626 Tf
-    97.732 650.382 Td
-    [ (R) ] TJ
-  ET
+
This shows that “ActualText” was used for \gls{Doctor}. The integral symbol (\(\int \)) created with \glssymbol{int} is:
+/Span << /ActualText (\376\377"+) >> BDC
+  BT
+    /F1 9.9626 Tf
+    97.732 650.382 Td
+    [ (R) ] TJ
+  ET
 EMC
-
-

Again, “ActualText” has been used, but the character code has been supplied. The image created with -\glsuseri{sampleimage} is: - - -

-
-/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
+
Again, “ActualText” has been used, but the character code has been supplied. The image created with \glsuseri{sampleimage} is:
+/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
-
-

This shows that “Alt” has been used. -

The first use of \gls{eg} produces the long form (not reproduced here) followed by the short -form: - - -

-
-/Span << /E (for example) >> BDC
-  BT
-    /F8 9.9626 Tf
-    161.687 563.624 Td
-    [ (e.g.) ] TJ
-  ET
+
This shows that “Alt” has been used.

+The first use of \gls{eg} produces the long form (not reproduced here) followed by the short form:

+/Span << /E (for example) >> BDC
+  BT
+    /F8 9.9626 Tf
+    161.687 563.624 Td
+    [ (e.g.) ] TJ
+  ET
 EMC
-
-

The subsequent use also has the “E” element: - - -

-
-/Span << /E (for example) >> BDC
-  BT
-    /F8 9.9626 Tf
-    118.543 551.669 Td
-    [ (e.g.) ] TJ
-  ET
+
The subsequent use also has the “E” element:
+/Span << /E (for example) >> BDC
+  BT
+    /F8 9.9626 Tf
+    118.543 551.669 Td
+    [ (e.g.) ] TJ
+  ET
 EMC
-
-

Similarly for \acrshort{eg}. You can also use the 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 -\BeginAccSupp. -

If the \setacronymstyle command is removed (or commented out) then the result would be different. The -first use of \gls uses “E” for the short form but the subsequent use has “ActualText” instead. This is because -without \setacronymstyle the original acronym mechanism is used, which is less sophisticated than the newer -acronym mechanism that’s triggered with \setacronymstyle. -

If you want to convert this example so that it uses glossaries-extra, make sure you have at least version 1.42 -of the extension package.
-

-


glossaries-extraIf you want to convert this example so that it uses glossaries-extra, you need to replace the -explicit loading of glossaries-accsupp with an implicit load through the accsupp package option: -

-
-\usepackage[abbreviations,accsupp]{glossaries-extra} -
-
I’m switching from \newacronym to \newabbreviation, which means that the default category is abbreviation -and also the file extensions are different. If you are using makeglossaries or 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 \setacronymstyle{long-short} needs to be replaced with:

-
-\setabbreviationstyle{long-short} -
-
This is actually the default so you can simply delete the \setacronymstyle line. Substitute the two instances -of \newacronym with \newabbreviation. For example:
-
-\newabbreviation{eg}{e.g.}{for example} - - -
-
Note that for the tikz entry you can now remove the explicit assignment of shortaccess with glossaries-extra -v1.42 as it will strip formatting commands like \emph:
-
-\newabbreviation -
 {tikz}{Ti\emph{k}Z}{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm} -
-
It’s also necessary to replace \acrshort, \acrlong and \acrfull with \glsxtrshort, \glsxtrlong and -\glsxtrfull. -

You may notice a slight difference from the original example. The shortaccess field now shows ⟨long⟩ (⟨short⟩) -instead of just ⟨long⟩. This is because glossaries-extra redefines \glsdefaultshortaccess to include the short -form. -

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 “Doctor” and “Drive” entries should really be defined as abbreviations but they shouldn’t be -expanded on first use. The short-nolong style can achieve this and it happens to be the default style -for the acronym category. This means that you can simply replace the “Doctor” definition with: -

-
-\newacronym{Doctor}{Dr}{Doctor} -
-
The first use of \gls{Doctor} is just “Dr”. This means that the “E” element will be used instead -of “ActualText”. Now I don’t need to supply the accessibility text as its obtained from the long -form. -

The “Drive” 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: - - -

-
-\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}
-
-

This looks odd when reading the document source and it’s easy to forgot. This is very similar to the situation -in the sample-dot-abbr.tex example. I can again use the discardperiod attribute, but I need to assign a -different category so that it doesn’t interfere with the “Doctor” 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 (general, abbreviation, acronym, index, -symbol and number are used by various commands provided by glossaries-extra). -

In this case, I’ve decided to have a category called shortdotted to indicate an abbreviation that ends with a -dot but only the short form is shown on first use:

-
-\setabbreviationstyle[shortdotted]{short-nolong-noreg} -
\glssetcategoryattribute{shortdotted}{discardperiod}{true} -
\newabbreviation[category=shortdotted]{Drive}{Dr.\@}{Drive} -
-
In the sample-dot-abbr.tex example, I also used the insertdots attribute to automatically insert the dots and -add the space factor (which is adjusted if discardperiod discards a period). In this case I’m inserting the dot -manually so I’ve also added the space factor with \@ in case the abbreviation is used mid-sentence. For -example: - - -
-\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}. Next sentence.
-\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive} end of sentence.
-
-

(The spacing is more noticeable if you first switch to a monospaced font with \ttfamily.) -

The “e.g.” abbreviation similarly ends with a dot. It’s not usual to write “for example (e.g.)” in a -document, so it really ought to have the same 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:

-
-\setabbreviationstyle[longshortdotted]{long-short} -
\glssetcategoryattribute{longshortdotted}{discardperiod}{true} -
\newabbreviation[category=longshortdotted]{e.g.}{e.g.\@}{for -
example} -
-
-

To further illustrate categories, let’s suppose the symbol and image should be in the name field instead of the -symbol and user1 fields. Now the \glssymbolaccsupp and \glsuseriaccsupp commands won’t be used. I -can’t deal with both cases if I just provide \glsnameaccsupp. -

I could provide category-field versions, such as \glsxtrsymbolnameaccsupp, but remember that this only -covers accessing the name field, which is typically only done in the glossary. I would also need similar commands -for the first, firstplural, text and 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 \glsxtrcategoryaccsupp version: -

-
-\newcommand{\glsxtrsymbolaccsupp}[2]{% -
 \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% -
} -
\newcommand{\glsxtrimageaccsupp}[2]{% -
  \glsaccessibility{Alt}{#1}{#2}% -
} -
-
\newglossaryentry{int}{category=symbol, -
  name={\ensuremath{\int}},access={222B}, -
  description={integral} -
} -
-
\newglossaryentry{sampleimage}{category=image, - - -
 description={an example image}, -
 name={\protect\includegraphics[height=20pt]{example-image}}, -
 access={a boilerplate image used in examples} -
} -
-
If it’s necessary to provide support for additional fields, then the category-field command -\glsxtrcategory⟩⟨fieldaccsupp could be used to override the more general category command -\glsxtrcategoryaccsupp. - -

-

-

🔗sample-ignored.tex

-

This document defines an ignored glossary for common terms that don’t need a definition. The document build -is: -


-   
pdflatex sample-ignored -
makeglossaries sample-ignored -
pdflatex sample-ignored -
-
-A new “ignored” glossary is defined with:

-
-\newignoredglossary{common} -
-
There are no associated files with an ignored glossary. An entry is defined with this as its glossary -type: - - -
-\newglossaryentry{commonex}{type=common,name={common term}}
-
-

Note that the description key isn’t required. This term may be referenced with \gls (which is useful for -consistent formatting) but it won’t be indexed. - -

-

-

🔗sample-entrycount.tex

-

This document uses \glsenableentrycount and \cgls (described in §7.1 Counting the -Number of Times an Entry has been Used (First Use Flag Unset)) so that acronyms only used once don’t -appear in the list of acronyms. The document build is: -


-   
pdflatex sample-entrycount -
pdflatex sample-entrycount -
makeglossaries sample-entrycount -
pdflatex sample-entrycount -
-
-Note the need to call LaTeX twice before makeglossaries, and then a final LaTeX call is required at the -end. -

The glossaries-extra package has additions that extend this mechanism and comes with some other sample -files related to entry counting.
-

-

If you switch to bib2gls you can use record counting instead. See the bib2gls manual for further details. -
-

- - -

-

-

Top

19. Troubleshooting

-

In addition to the sample files listed in §18 Sample Documents, the glossaries package comes with -some minimal example files, minimalgls.tex, mwe-gls.tex, mwe-acr.tex and mwe-acr-desc.tex, which can -be used for testing. These should be located in the samples subdirectory (folder) of the glossaries documentation -directory. The location varies according to your operating system and TeX installation. For example, on my -Linux partition it can be found in /usr/local/texlive/2014/texmf-dist/doc/latex/glossaries/. The -makeglossariesgui application can also be used to test for various problems. Further information on -debugging LaTeX code is available at http://www.dickimaw-books.com/latex/minexample/. -

If you have any problems, please first consult the glossaries FAQ. If that doesn’t help, try posting your query -to somewhere like the comp.text.tex newsgroup, the LaTeX Community Forum or TeX on StackExchange. -Bug reports can be submitted via my package bug report form. - - -

-

-

Top

Index

- Symbols -
\’  1
-\@  2, 3, 4, 5, 6
-\@gls@codepage  7
-\@gls@reference  8
-\@glsorder  9
-\@glsxtr@altmodifier  10
-\@glsxtr@newglslike  11
-\@glsxtr@prefixlabellist  12
-\@istfilename  13
-\@newglossary  14
-\@xdylanguage  15
-

A -\AA  16
-abbreviation styles:
-    footnote  17
-    long-noshort  18
-    long-short  19, 20, 21
-    long-short-sc  22
-    long-short-sc-desc  23
-    postfootnote  24
-    short-nolong  25, 26, 27
-    short-sc-footnote  28
-    short-sc-footnote-desc  29, 30, 31, 32
-    short-sc-postfootnote-desc  33, 34, 35, 36
-\Ac  37
-\ac  38
-accessibility package  39, 40, 41
-accsupp package  42, 43, 44, 45, 46
-\Acf  47
-\acf  48
-\Acfp  49
- - -\acfp  50
-\Acl  51
-\acl  52
-\Aclp  53
-\aclp  54
-\Acp  55
-\acp  56
-\ACRfull  57
-\Acrfull  58, 59
-\acrfull  60, 61, 62, 63, 64, 65, 66, 67, 68
-\acrfullfmt  69, 70, 71
-\acrfullformat  72, 73
-\ACRfullpl  74
-\Acrfullpl  75, 76
-\acrfullpl  77, 78
-\ACRlong  79
-\Acrlong  80, 81
-\acrlong  82, 83, 84, 85, 86
-\ACRlongpl  87
-\Acrlongpl  88, 89
-\acrlongpl  90, 91
-acronym styles:
-    dua  92, 93, 94, 95, 96
-    dua-desc  97, 98
-    footnote  99, 100, 101
-    footnote-desc  102
-    footnote-sc  103
-    footnote-sc-desc  104, 105, 106, 107, 108
-    footnote-sm  109
-    footnote-sm-desc  110
-    long-sc-short  111, 112, 113, 114, 115
-    long-sc-short-desc  116, 117
-    long-short  118, 119, 120, 121, 122, 123
-    long-short-desc  124, 125, 126
-    long-sm-short  127, 128, 129
-    long-sm-short-desc  130
-    long-sp-short  131, 132, 133
-    long-sp-short-desc  134
-    sc-short-long  135
-    sc-short-long-desc  136
-    short-long  137
-    short-long-desc  138
-    sm-short-long  139
-    sm-short-long-desc  140
-\acronymentry  141, 142, 143, 144, 145, 146
-\acronymfont  147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157
- - -\acronymname  158, 159
-\acronymsort  160, 161, 162, 163, 164
-\acronymtype  165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177
-\ACRshort  178
-\Acrshort  179, 180
-\acrshort  181, 182, 183, 184, 185, 186, 187
-\ACRshortpl  188
-\Acrshortpl  189, 190
-\acrshortpl  191, 192
-\Acs  193
-\acs  194
-\Acsp  195
-\acsp  196
-\addcontentsline  197
-\alsoname  198
-\altnewglossary  199
-amsgen package  200, 201, 202, 203, 204
-amsmath package  205, 206
-\andname  207
-arara  208, 209, 210, 211, 212, 213, 214, 215, 216
-array package  217, 218
-\AtBeginDocument  219
-atom  220
-auto-completion  221
-

B -babel package  222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252
-beamer class  253, 254, 255, 256
-beamer package  257
-\BeginAccSupp  258, 259, 260, 261
-bib2gls  262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497
-    --group  498, 499, 500, 501, 502
-    --map-format  503
-    -g  504
-    -m  505
-bib2gls entry types
-    @abbreviation  506, 507, 508, 509, 510, 511, 512
-    @acronym  513, 514, 515, 516, 517, 518, 519, 520
-    @dualabbreviationentry  521, 522, 523
-    @dualentry  524, 525, 526
-    @dualindexabbreviation  527, 528
-    @entry  529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569
-    @index  570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580
- - -    @indexplural  581, 582, 583, 584
-    @preamble  585, 586, 587, 588, 589, 590, 591, 592
-    @symbol  593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606
-booktabs package  607, 608, 609, 610
-\bottomrule  611
-

C -categories
-    abbreviation  612, 613, 614, 615, 616, 617, 618, 619, 620
-    acronym  621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633
-    general  634, 635, 636, 637
-    index  638
-    number  639
-    symbol  640, 641, 642
-category attributes  643
-    discardperiod  644, 645, 646, 647, 648
-    glossdesc  649, 650, 651, 652, 653
-    glossdescfont  654
-    glossname  655
-    glosssymbolfont  656
-    hyperoutside  657
-    indexonlyfirst  658
-    insertdots  659, 660, 661, 662, 663
-    nohyperfirst  664
-    noshortplural  665
-    pluraldiscardperiod  666
-    retainfirstuseperiod  667
-    textformat  668
-\cGls  669
-\cgls  670, 671
-\cGlsformat  672
-\cglsformat  673
-\cGlspl  674
-\cglspl  675
-\cGlsplformat  676
-\cglsplformat  677
-\chapter  678, 679
-\chapter*  680, 681
-classicthesis package  682, 683, 684, 685, 686
-convertgls2bib  687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704
-\currentglossary  705
-

D -datatool package  706, 707, 708, 709, 710
- - -datatool-base package  711
-\DeclareAcronymList  712, 713, 714, 715
-\defentryfmt  716
-\defglsentry  717, 718
-\defglsentryfmt  719, 720, 721, 722, 723, 724, 725, 726, 727
-\DefineAcronymSynonyms  728
-\delimN  729
-\delimR  730
-\descriptionname  731
-\dgls  732
-\dicei  733
-doc package  734, 735, 736, 737
-\dtlcompare  738
-\dtlicompare  739
-\dtlletterindexcompare  740
-\dtlwordindexcompare  741
-

E -\edef  742
-\emph  743
-encap  744
-\EndAccSupp  745, 746
-\ensuremath  747, 748
-entry location  749
-\entryname  750
-environments:
-    theglossary  751
-etoolbox package  752, 753, 754, 755, 756, 757, 758, 759
-Extended Latin Alphabet  760
-extended Latin character  761, 762, 763, 764, 765, 766, 767
-

F -file types
-    alg  768
-    aux  769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795
-    bib  796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845
-    dict  846
-    docdefs  847, 848, 849
-    glg  850, 851, 852, 853
-    glg2  854
-    glo  855, 856, 857, 858, 859, 860, 861
-    glo2  862
-    gls  863, 864
- - -    gls2  865
-    glsdefs  866, 867, 868, 869
-    glslabels  870
-    glstex  871, 872
-    ist  873, 874, 875, 876, 877, 878, 879
-    ldf  880
-    lua  881
-    tex  882, 883, 884, 885, 886, 887, 888, 889, 890
-    toc  891, 892
-    xdy  893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908
-first use  909
-    flag  910
-    text  911
-\firstacronymfont  912, 913, 914, 915, 916, 917, 918
-flowfram package  919
-fmtcount package  920, 921, 922, 923
-fontspec package  924
-\footnote  925, 926, 927, 928, 929, 930, 931, 932, 933, 934
-\forallabbreviationlists  935
-\forallacronyms  936
-\forallglossaries  937
-\forallglsentries  938
-\foreignlanguage  939, 940
-\forglsentries  941
-

G -\Genacrfullformat  942
-\genacrfullformat  943, 944, 945, 946, 947, 948
-\GenericAcronymFields  949, 950, 951
-\Genplacrfullformat  952
-\genplacrfullformat  953, 954
-gettitlestring package  955
-\glolinkprefix  956, 957
-glossaries package  958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975
-glossaries-accsupp package  976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991
-glossaries-babel package  992, 993
-glossaries-extra-bib2gls package  994
-glossaries-extra-stylemods package  995, 996, 997
-glossaries-polyglossia package  998
-glossaries-prefix package  999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008
-\glossariesextrasetup  1009
-glossary counters:
-    glossaryentry  1010
-    glossarysubentry  1011
-glossary package  1012, 1013, 1014, 1015
- - -glossary styles:
-    altlist  1016, 1017, 1018, 1019, 1020, 1021
-    altlistgroup  1022, 1023
-    altlisthypergroup  1024
-    altlong4col  1025, 1026, 1027
-    altlong4col-booktabs  1028
-    altlong4colborder  1029
-    altlong4colheader  1030, 1031
-    altlong4colheaderborder  1032, 1033
-    altlongragged4col  1034, 1035, 1036
-    altlongragged4col-booktabs  1037, 1038
-    altlongragged4colborder  1039
-    altlongragged4colheader  1040, 1041, 1042
-    altlongragged4colheaderborder  1043
-    altsuper4col  1044, 1045, 1046
-    altsuper4colborder  1047
-    altsuper4colheader  1048
-    altsuper4colheaderborder  1049
-    altsuperragged4col  1050, 1051, 1052
-    altsuperragged4colborder  1053
-    altsuperragged4colheader  1054
-    altsuperragged4colheaderborder  1055
-    alttree  1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065
-    alttreegroup  1066, 1067, 1068
-    alttreehypergroup  1069, 1070, 1071, 1072
-    bookindex  1073, 1074, 1075
-    index  1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087
-    indexgroup  1088, 1089, 1090, 1091
-    indexhypergroup  1092, 1093, 1094
-    inline  1095, 1096, 1097
-    list  1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110
-    listdotted  1111, 1112, 1113, 1114, 1115
-    listgroup  1116, 1117, 1118, 1119
-    listhypergroup  1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127
-    long  1128, 1129, 1130, 1131, 1132, 1133
-    long-booktabs  1134, 1135
-    long-name-desc-sym-loc  1136
-    long3col  1137, 1138, 1139, 1140, 1141
-    long3col-booktabs  1142
-    long3colborder  1143, 1144
-    long3colheader  1145, 1146, 1147, 1148
-    long3colheaderborder  1149, 1150
-    long4col  1151, 1152, 1153, 1154, 1155
-    long4col-booktabs  1156, 1157
-    long4colborder  1158, 1159
-    long4colheader  1160, 1161, 1162, 1163
- - -    long4colheaderborder  1164, 1165, 1166
-    longborder  1167
-    longheader  1168, 1169, 1170, 1171
-    longheaderborder  1172, 1173
-    longragged  1174, 1175, 1176, 1177
-    longragged-booktabs  1178
-    longragged3col  1179, 1180, 1181, 1182
-    longragged3col-booktabs  1183
-    longragged3colborder  1184
-    longragged3colheader  1185, 1186, 1187
-    longragged3colheaderborder  1188
-    longraggedborder  1189
-    longraggedheader  1190, 1191, 1192
-    longraggedheaderborder  1193
-    mcolalttree  1194
-    mcolalttreegroup  1195
-    mcolalttreehypergroup  1196
-    mcolalttreespannav  1197
-    mcolindex  1198, 1199
-    mcolindexgroup  1200
-    mcolindexhypergroup  1201
-    mcolindexspannav  1202
-    mcoltree  1203
-    mcoltreegroup  1204
-    mcoltreehypergroup  1205, 1206
-    mcoltreenoname  1207
-    mcoltreenonamegroup  1208
-    mcoltreenonamehypergroup  1209
-    mcoltreenonamespannav  1210
-    mcoltreespannav  1211
-    super  1212, 1213, 1214, 1215
-    super3col  1216, 1217, 1218, 1219
-    super3colborder  1220
-    super3colheader  1221, 1222
-    super3colheaderborder  1223
-    super4col  1224, 1225, 1226, 1227, 1228
-    super4colborder  1229, 1230
-    super4colheader  1231, 1232, 1233
-    super4colheaderborder  1234, 1235
-    superborder  1236
-    superheader  1237, 1238
-    superheaderborder  1239, 1240
-    superragged  1241, 1242, 1243, 1244
-    superragged3col  1245, 1246, 1247, 1248
-    superragged3colborder  1249
-    superragged3colheader  1250
- - -    superragged3colheaderborder  1251
-    superraggedborder  1252
-    superraggedheader  1253, 1254
-    superraggedheaderborder  1255
-    topic  1256, 1257, 1258, 1259
-    tree  1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267
-    treegroup  1268, 1269, 1270
-    treehypergroup  1271, 1272, 1273
-    treenoname  1274, 1275, 1276, 1277
-    treenonamegroup  1278, 1279, 1280, 1281
-    treenonamehypergroup  1282, 1283
-glossary-bookindex package  1284, 1285, 1286
-glossary-inline package  1287, 1288
-glossary-list package  1289, 1290, 1291, 1292, 1293, 1294, 1295
-glossary-list.sty package  1296
-glossary-long package  1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305
-glossary-longbooktabs package  1306, 1307, 1308, 1309
-glossary-longextra package  1310, 1311
-glossary-longextra package  1312
-glossary-longragged package  1313, 1314, 1315, 1316
-glossary-mcols package  1317, 1318, 1319, 1320, 1321, 1322, 1323
-glossary-ragged package  1324
-glossary-super package  1325, 1326, 1327, 1328, 1329, 1330
-glossary-superragged package  1331, 1332, 1333
-glossary-topic package  1334, 1335
-glossary-topic package  1336, 1337, 1338
-glossary-tree package  1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350
-glossaryentry (counter)  1351, 1352, 1353, 1354
-\glossaryentrynumbers  1355, 1356, 1357, 1358
-\glossaryheader  1359, 1360, 1361
-\glossaryname  1362, 1363
-\glossarypostamble  1364, 1365
-\glossarypreamble  1366, 1367, 1368, 1369
-\glossarysection  1370
-\glossarystyle  1371
-glossarysubentry (counter)  1372
-\glossentry  1373, 1374, 1375
-\Glossentrydesc  1376, 1377
-\glossentrydesc  1378, 1379, 1380, 1381, 1382, 1383
-\Glossentryname  1384, 1385
-\glossentryname  1386, 1387, 1388
-\glossentrynameother  1389
-\Glossentrysymbol  1390
-\glossentrysymbol  1391, 1392, 1393, 1394, 1395, 1396
-\GLS  1397, 1398, 1399, 1400
-\Gls  1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412
- - -\gls  1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445
-\gls*  1446
-\glsabbrvfont  1447
-\glsaccessibility  1448, 1449, 1450, 1451, 1452
-\Glsaccesslong  1453
-\glsaccesslong  1454
-\Glsaccesslongpl  1455
-\glsaccesslongpl  1456
-\glsaccessshort  1457, 1458
-\glsaccessshortpl  1459, 1460
-\glsaccsupp  1461, 1462
-\glsacrpluralsuffix  1463
-\glsacspace  1464
-\glsadd  1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472
-\glsaddall  1473, 1474, 1475, 1476
-\glsaddall options
-    types  1477
-\glsaddallunused  1478
-\glsaddkey  1479, 1480, 1481, 1482, 1483
-\GlsAddLetterGroup  1484
-\glsaddprotectedpagefmt  1485
-\glsaddstoragekey  1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493
-\GlsAddXdyAttribute  1494, 1495, 1496
-\GlsAddXdyCounters  1497, 1498
-\GlsAddXdyLocation  1499, 1500
-\glsautoprefix  1501
-\glsbackslash  1502
-\glscapitalisewords  1503
-\glscapscase  1504, 1505, 1506
-\glscategory  1507
-\glsclearpage  1508
-\glsclosebrace  1509
-\glscurrententrylabel  1510, 1511, 1512, 1513, 1514, 1515, 1516
-\glscurrentfieldvalue  1517, 1518, 1519
-\glscustomtext  1520, 1521, 1522
-\GlsDeclareNoHyperList  1523, 1524, 1525
-\glsdefaultshortaccess  1526, 1527
-\glsdefaulttype  1528, 1529, 1530, 1531, 1532, 1533
-\glsdefpostdesc  1534, 1535, 1536
-\glsdefpostlink  1537, 1538, 1539, 1540, 1541, 1542
-\GLSdesc  1543
-\Glsdesc  1544, 1545
-\glsdesc  1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555
-\glsdescwidth  1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567
-\glsdisablehyper  1568, 1569, 1570, 1571, 1572
- - -\glsdisp  1573, 1574, 1575, 1576, 1577, 1578
-\glsdisplay  1579, 1580
-\glsdisplayfirst  1581, 1582
-\glsdisplaynumberlist  1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590
-\glsdoifexists  1591
-\glsdoifexistsordo  1592
-\glsdoifexistsorwarn  1593
-\glsdoifnoexists  1594
-\glsdoifnoexistsordo  1595
-\glsdosanitizesort  1596, 1597
-\glsenableentrycount  1598, 1599
-\glsenablehyper  1600
-\glsentrycounterlabel  1601
-\GlsEntryCounterLabelPrefix  1602
-\glsentrycurrcount  1603
-\Glsentrydesc  1604, 1605, 1606, 1607, 1608
-\glsentrydesc  1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619
-\Glsentrydescplural  1620
-\glsentrydescplural  1621
-\Glsentryfirst  1622
-\glsentryfirst  1623, 1624
-\Glsentryfirstplural  1625
-\glsentryfirstplural  1626
-\glsentryfmt  1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638
-\Glsentryfull  1639
-\glsentryfull  1640, 1641, 1642, 1643, 1644, 1645
-\Glsentryfullpl  1646
-\glsentryfullpl  1647
-\glsentryitem  1648, 1649
-\Glsentrylong  1650, 1651, 1652, 1653
-\glsentrylong  1654, 1655, 1656
-\Glsentrylongpl  1657, 1658
-\glsentrylongpl  1659, 1660
-\Glsentryname  1661, 1662
-\glsentryname  1663, 1664, 1665, 1666, 1667
-\glsentrynumberlist  1668, 1669, 1670, 1671, 1672
-\glsentryparent  1673, 1674
-\Glsentryplural  1675
-\glsentryplural  1676, 1677, 1678
-\Glsentryprefix  1679
-\glsentryprefix  1680, 1681
-\Glsentryprefixfirst  1682
-\glsentryprefixfirst  1683
-\Glsentryprefixfirstplural  1684
-\glsentryprefixfirstplural  1685
-\Glsentryprefixplural  1686
- - -\glsentryprefixplural  1687
-\glsentryprevcount  1688
-\Glsentryshort  1689
-\glsentryshort  1690
-\Glsentryshortpl  1691
-\glsentryshortpl  1692
-\glsentrysort  1693
-\Glsentrysymbol  1694
-\glsentrysymbol  1695, 1696, 1697, 1698, 1699, 1700
-\Glsentrysymbolplural  1701
-\glsentrysymbolplural  1702
-\Glsentrytext  1703, 1704, 1705, 1706, 1707
-\glsentrytext  1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716
-\glsentrytitlecase  1717, 1718
-\glsentrytype  1719
-\Glsentryuseri  1720
-\glsentryuseri  1721, 1722
-\Glsentryuserii  1723
-\glsentryuserii  1724
-\Glsentryuseriii  1725
-\glsentryuseriii  1726
-\Glsentryuseriv  1727
-\glsentryuseriv  1728
-\Glsentryuserv  1729
-\glsentryuserv  1730
-\Glsentryuservi  1731
-\glsentryuservi  1732
-\glsexpandfields  1733
-\glsfieldaccsupp  1734
-\glsfielddef  1735
-\glsfieldedef  1736
-\glsfieldfetch  1737
-\glsfieldgdef  1738
-\glsfieldxdef  1739, 1740, 1741, 1742
-\glsfindwidesttoplevelname  1743, 1744
-\glsFindWidestUsedLevelTwo  1745
-\glsFindWidestUsedTopLevelName  1746
-\GLSfirst  1747
-\Glsfirst  1748
-\glsfirst  1749
-\glsfirstabbrvscfont  1750, 1751, 1752, 1753
-\glsfirstlongfootnotefont  1754, 1755, 1756, 1757, 1758
-\GLSfirstplural  1759
-\Glsfirstplural  1760
-\glsfirstplural  1761
-\glsfmtfirst  1762
- - -\Glsfmtlong  1763, 1764
-\glsfmtname  1765, 1766, 1767
-\glsfmtshort  1768
-\glsfmttext  1769, 1770, 1771, 1772
-\glsgenacfmt  1773, 1774, 1775, 1776, 1777, 1778, 1779
-\glsgenentryfmt  1780, 1781, 1782, 1783, 1784
-\glsgetgrouptitle  1785
-\glsglossarymark  1786, 1787, 1788, 1789, 1790
-\glsgroupheading  1791, 1792
-\glsgroupskip  1793, 1794, 1795
-\glshyperlink  1796, 1797, 1798
-\glshypernavsep  1799
-\glsifhyper  1800
-\glsifhyperon  1801, 1802, 1803
-\glsIfListOfAcronyms  1804
-\glsifplural  1805, 1806, 1807, 1808
-\glsinlinedescformat  1809
-\glsinlineemptydescformat  1810
-\glsinlinenameformat  1811
-\glsinlineparentchildseparator  1812, 1813
-\glsinlineseparator  1814, 1815
-\glsinlinesubdescformat  1816
-\glsinlinesubnameformat  1817
-\glsinlinesubseparator  1818, 1819
-\glsinsert  1820, 1821
-\glslabel  1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835
-\glslabeltok  1836, 1837
-\glsletentryfield  1838
-\glslink  1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848
-\glslink options
-    counter  1849, 1850
-    format  1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864
-    hyper  1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872
-    hyperoutside  1873
-    local  1874
-    noindex  1875
-    prefix  1876
-    textformat  1877
-    theHvalue  1878
-    thevalue  1879
-    wrgloss  1880
-\glslinkcheckfirsthyperhook  1881
-\glslinkpostsetkeys  1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890
-\glslinkprefix  1891
-\glslinkpresetkeys  1892
-\glslinkvar  1893
- - -\glslistdottedwidth  1894
-\glslistexpandedname  1895
-\glslistinit  1896
-\glslistnavigationitem  1897
-\glslocalreset  1898
-\glslocalresetall  1899
-\glslocalunset  1900
-\glslocalunsetall  1901
-\glslongfont  1902
-\glslongtok  1903, 1904, 1905, 1906, 1907
-\glsmcols  1908
-\glsmoveentry  1909
-\GLSname  1910
-\Glsname  1911
-\glsname  1912
-\glsnamefont  1913, 1914, 1915
-\glsnavhypertarget  1916
-\glsnavigation  1917
-\glsnoexpandfields  1918
-\glsnoidxdisplayloc  1919
-\glsnumberformat  1920, 1921, 1922, 1923, 1924, 1925
-\glsnumberlistloop  1926
-\glsnumbersgroupname  1927
-\glsnumbersgrouptitle  1928
-\glsnumlistlastsep  1929
-\glsnumlistsep  1930
-\glsopenbrace  1931
-\glspagelistwidth  1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939
-\glspar  1940
-\glspatchtabularx  1941
-\glspercentchar  1942
-\GLSpl  1943, 1944, 1945, 1946, 1947
-\Glspl  1948, 1949, 1950, 1951, 1952, 1953, 1954
-\glspl  1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966
-\GLSplural  1967
-\Glsplural  1968
-\glsplural  1969
-\glspluralsuffix  1970, 1971, 1972, 1973, 1974, 1975
-\glspostdescription  1976, 1977, 1978
-\glspostinline  1979, 1980
-\glspostlinkhook  1981, 1982, 1983, 1984, 1985
-\glsprefixsep  1986
-\glsprestandardsort  1987, 1988, 1989
-\glsps  1990
-\glspt  1991, 1992, 1993, 1994, 1995
-\glsquote  1996
- - -\glsrefentry  1997, 1998, 1999, 2000, 2001, 2002
-\glsreset  2003, 2004, 2005
-\glsresetall  2006
-\glsresetentrycounter  2007
-\glsrestoreLToutput  2008
-\glssee  2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
-\glsseeformat  2017, 2018
-\glsseeitemformat  2019, 2020, 2021, 2022, 2023, 2024, 2025
-\glsseelastsep  2026
-\glsseelist  2027
-\glsseesep  2028
-\glsSetAlphaCompositor  2029, 2030
-\glssetcategoryattribute  2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050
-\glsSetCompositor  2051, 2052
-\glssetexpandfield  2053
-\glssetnoexpandfield  2054
-\GlsSetQuote  2055, 2056
-\glsSetSuffixF  2057
-\glsSetSuffixFF  2058
-\glssetwidest  2059, 2060, 2061, 2062, 2063
-\GlsSetWriteIstHook  2064
-\GlsSetXdyCodePage  2065, 2066, 2067
-\GlsSetXdyFirstLetterAfterDigits  2068
-\GlsSetXdyLanguage  2069, 2070, 2071, 2072
-\GlsSetXdyLocationClassOrder  2073
-\GlsSetXdyMinRangeLength  2074, 2075
-\GlsSetXdyNumberGroupOrder  2076
-\glsshortaccsupp  2077, 2078
-\glsshortplaccsupp  2079, 2080
-\glsshorttok  2081, 2082, 2083
-\glsshowaccsupp  2084
-\glsshowtarget  2085, 2086
-\glsshowtargetfont  2087
-\glsshowtargetouter  2088
-\glssortnumberfmt  2089
-\glssubentrycounterlabel  2090
-\glssubentryitem  2091, 2092
-\GLSsymbol  2093
-\Glssymbol  2094
-\glssymbol  2095, 2096, 2097, 2098, 2099, 2100
-\glssymbolaccsupp  2101
-\glssymbolsgroupname  2102, 2103, 2104
-\glstarget  2105, 2106
-\GLStext  2107, 2108
-\Glstext  2109, 2110
-\glstext  2111, 2112, 2113, 2114
- - -\glstextformat  2115, 2116, 2117, 2118, 2119, 2120
-\glstextup  2121
-\glstildechar  2122
-\glstocfalse  2123
-\glstoctrue  2124
-\glstreechildpredesc  2125
-\glstreegroupheaderfmt  2126
-\glstreeindent  2127
-\glstreeitem  2128
-\glstreenamebox  2129
-\glstreenamefmt  2130
-\glstreenavigationfmt  2131
-\glstreepredesc  2132
-\glstreesubitem  2133
-\glstreesubsubitem  2134
-\glstype  2135, 2136, 2137
-\glsunexpandedfieldvalue  2138, 2139
-\glsunset  2140
-\glsunsetall  2141, 2142
-\GlsUseAcrEntryDispStyle  2143
-\GlsUseAcrStyleDefs  2144
-\GLSuseri  2145
-\Glsuseri  2146
-\glsuseri  2147
-\glsuseriaccsupp  2148
-\GLSuserii  2149
-\Glsuserii  2150
-\glsuserii  2151
-\GLSuseriii  2152
-\Glsuseriii  2153
-\glsuseriii  2154
-\GLSuseriv  2155
-\Glsuseriv  2156
-\glsuseriv  2157
-\GLSuserv  2158
-\Glsuserv  2159
-\glsuserv  2160
-\GLSuservi  2161
-\Glsuservi  2162
-\glsuservi  2163
-\glswrallowprimitivemodsfalse  2164
-\glswrite  2165
-\glswriteentry  2166
-\glsxtr@makeglossaries  2167
-\glsxtr@record  2168
-\glsxtr@record@nameref  2169
- - -\glsxtr@recordsee  2170
-\glsxtr@resource  2171, 2172
-\glsxtr@texencoding  2173
-\glsxtrabbrvfootnote  2174, 2175, 2176, 2177, 2178
-\glsxtrabbrvtype  2179, 2180, 2181
-\glsxtrbookindexname  2182
-\glsxtrcombiningdiacriticrules  2183, 2184
-\glsxtrcontrolrules  2185, 2186
-\glsxtrdigitrules  2187, 2188
-\glsxtrdopostpunc  2189, 2190
-\glsxtrequationlocfmt  2191
-\glsxtrfieldforlistloop  2192
-\glsxtrfieldformatlist  2193, 2194
-\glsxtrfmt  2195, 2196, 2197, 2198, 2199, 2200, 2201
-\GlsXtrFmtField  2202
-\glsxtrfootnotedescname  2203, 2204
-\glsxtrfootnotedescsort  2205, 2206
-\glsxtrfull  2207, 2208, 2209, 2210
-\glsxtrfullsep  2211, 2212, 2213, 2214, 2215
-\glsxtrgeneralpuncrules  2216, 2217
-\glsxtrglossentry  2218, 2219, 2220
-\glsxtrhiername  2221
-\glsxtrhyphenrules  2222, 2223
-\GlsXtrIfFieldEqNum  2224
-\GlsXtrIfFieldNonZero  2225
-\glsxtrifhasfield  2226, 2227
-\GlsXtrIfUnusedOrUndefined  2228
-\glsxtrifwasfirstuse  2229, 2230, 2231, 2232
-\GlsXtrIfXpFieldEqXpStr  2233, 2234, 2235
-\Glsxtrinlinefullformat  2236
-\glsxtrinlinefullformat  2237
-\Glsxtrinlinefullplformat  2238
-\glsxtrinlinefullplformat  2239
-\GlsXtrLoadResources  2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285
-\GlsXtrLoadResources options
-    abbreviation-sort-fallback  2286
-    append-prefix-field  2287
-    break-at  2288, 2289, 2290, 2291, 2292
-    category  2293
-    combine-dual-locations  2294
-    dual-category  2295
-    dual-prefix  2296, 2297, 2298
-    dual-sort  2299
-    dual-type  2300, 2301, 2302
-    entry-type-aliases  2303
- - -    ext-prefixes  2304
-    field-aliases  2305
-    identical-sort-action  2306
-    ignore-fields  2307
-    label-prefix  2308
-    loc-counters  2309
-    name-case-change  2310
-    primary-location-formats  2311
-    replicate-fields  2312, 2313
-    save-child-count  2314, 2315
-    save-locations  2316, 2317, 2318
-    save-loclist  2319
-    save-sibling-count  2320, 2321, 2322, 2323
-    save-locations  2324, 2325
-    selection  2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333
-    set-widest  2334
-    sort  2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346
-    sort-rule  2347
-    src  2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389
-    type  2390, 2391, 2392
-\glsxtrlocalsetgrouptitle  2393
-\glsxtrlong  2394, 2395, 2396, 2397
-\glsxtrnewgls  2398
-\glsxtrnewglslike  2399, 2400, 2401, 2402
-\glsxtrnewnumber  2403
-\glsxtrnewsymbol  2404, 2405, 2406, 2407
-\glsxtrnonprintablerules  2408, 2409
-\glsxtrnopostpunc  2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417
-\glsxtrp  2418
-\glsxtrparen  2419, 2420, 2421, 2422, 2423
-\glsxtrpostlinkAddSymbolOnFirstUse  2424
-\glsxtrsectionlocfmt  2425, 2426, 2427
-\GlsXtrSetAltModifier  2428, 2429
-\glsxtrsetgrouptitle  2430
-\glsxtrshort  2431, 2432, 2433, 2434, 2435
-\glsxtrspacerules  2436, 2437
-\GlsXtrUseAbbrStyleFmts  2438
-\GlsXtrUseAbbrStyleSetup  2439
-

H -html package  2440
-\hyperbf  2441, 2442, 2443, 2444, 2445, 2446
-\hyperbfit  2447
-\hyperbsf  2448
- - -\hyperemph  2449
-\hyperit  2450, 2451, 2452
-\hyperlink  2453, 2454
-\hypermd  2455
-\hyperpage  2456
-hyperref package  2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491
-\hyperrm  2492, 2493, 2494
-\hypersc  2495
-\hypersf  2496
-\hypersl  2497
-\hypertarget  2498
-\hypertt  2499
-\hyperup  2500
-

I -\ifglossaryexists  2501
-\ifglsdescsuppressed  2502
-\ifglsentryexists  2503
-\ifglsfieldcseq  2504
-\ifglsfielddefeq  2505
-\ifglsfieldeq  2506, 2507
-\ifglshaschildren  2508, 2509
-\ifglshasdesc  2510
-\ifglshasfield  2511
-\ifglshaslong  2512, 2513, 2514, 2515, 2516
-\ifglshasparent  2517
-\ifglshasprefix  2518
-\ifglshasprefixfirst  2519
-\ifglshasprefixfirstplural  2520
-\ifglshasprefixplural  2521
-\ifglshasshort  2522, 2523, 2524
-\ifglshassymbol  2525, 2526, 2527
-\ifglsucmark  2528
-\ifglsused  2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538
-\ifglsxtrinsertinside  2539, 2540, 2541, 2542, 2543, 2544, 2545, 2546
-\ifignoredglossary  2547
-imakeidx package  2548
-\include  2549
-\includegraphics  2550, 2551
-\index  2552, 2553, 2554, 2555
-index package  2556
-\indexname  2557
-\indexspace  2558, 2559, 2560, 2561
-\input  2562, 2563
- - -inputenc package  2564, 2565, 2566, 2567, 2568, 2569, 2570
-\inputencodingname  2571
-internal fields:
-    childcount  2572
-    location  2573, 2574, 2575
-    loclist  2576
-    siblingcount  2577, 2578
-    useri  2579
-\item  2580, 2581
-

J -\jobname  2582, 2583
-

L -\label  2584
-latex  2585, 2586
-latexmk  2587, 2588, 2589
-latexrelease package  2590
-Latin alphabet  2591, 2592, 2593
-Latin character  2594, 2595, 2596, 2597, 2598, 2599, 2600
-link text  2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667
-\listbreak  2668
-\loadglsentries  2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677
-location list  see number list
-\longnewglossaryentry  2679, 2680, 2681, 2682
-\longprovideglossaryentry  2683
-longtable package  2684, 2685
-

M -\makeatletter  2686
-\makeatother  2687
-\makefirstuc  2688, 2689, 2690, 2691
-makeglossaries  2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791
-    -d  2792
-    -k  2793
-    -m  2794
-    -Q  2795
-    -q  2796
-    -x  2797
-\makeglossaries  2798, 2799, 2800, 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2834
- - -makeglossaries-lite  2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861
-makeglossariesgui  2862, 2863, 2864
-makeidx package  2865
-makeindex  2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2943, 2944, 2945, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 2996, 2997, 2998, 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014
-    -g  3015, 3016, 3017
-    -l  3018, 3019, 3020, 3021, 3022
-\makenoidxglossaries  3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033
-\MakeTextUppercase  3034, 3035
-\markboth  3036
-memoir class  3037, 3038, 3039, 3040
-\memUChead  3041
-mfirstuc package  3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049
-\mfirstucMakeUppercase  3050
-\midrule  3051
-multicol package  3052
-mwe package  3053, 3054, 3055
-

N -nameref package  3056
-\newabbreviation  3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088
-\newabbreviationstyle  3089
-\newacronym  3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152
-\newacronymstyle  3153, 3154, 3155
-\newdualentry  3156, 3157
-\newglossary  3158, 3159, 3160, 3161, 3162, 3163, 3164
-\newglossary*  3165, 3166, 3167, 3168
-\newglossaryentry  3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200
-\newglossaryentry options
-    access  3201, 3202
-    alias  3203, 3204, 3205, 3206
-    category  3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221
-    description  3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244
-    descriptionaccess  3245
-    descriptionplural  3246, 3247, 3248, 3249
-    descriptionpluralaccess  3250
-    entrycounter  3251, 3252
-    first  3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283
-    firstaccess  3284
- - -    firstplural  3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303
-    firstpluralaccess  3304
-    format  3305
-    long  3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319
-    longaccess  3320
-    longplural  3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332
-    longpluralaccess  3333
-    name  3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394
-    nonumberlist  3395
-    parent  3396, 3397, 3398, 3399
-    plural  3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424
-    pluralaccess  3425
-    prefix  3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434
-    prefixfirst  3435, 3436, 3437, 3438, 3439
-    prefixfirstplural  3440, 3441, 3442, 3443
-    prefixplural  3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451
-    see  3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480
-    seealso  3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491
-    short  3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507
-    shortaccess  3508, 3509, 3510, 3511, 3512, 3513, 3514
-    shortplural  3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529
-    shortpluralaccess  3530
-    sort  3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592
-    subentrycounter  3593
-    symbol  3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613
-    symbolaccess  3614, 3615
-    symbolplural  3616, 3617, 3618
-    symbolpluralaccess  3619
-    text  3620, 3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, 3643, 3644, 3645, 3646, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654
-    textaccess  3655
-    type  3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664
-    user1  3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682
-    user1access  3683, 3684
-    user2  3685, 3686, 3687, 3688, 3689
-    user2access  3690
-    user3  3691, 3692, 3693, 3694
-    user3access  3695
-    user4  3696, 3697, 3698, 3699
-    user4access  3700
-    user5  3701, 3702, 3703, 3704
-    user5access  3705
- - -    user6  3706, 3707, 3708, 3709, 3710
-    user6access  3711
-\newglossarystyle  3712, 3713, 3714, 3715
-\newignoredglossary  3716, 3717, 3718, 3719, 3720, 3721
-\newline  3722, 3723
-\newterm  3724, 3725
-ngerman package  3726, 3727, 3728, 3729
-\nohyperpage  3730
-\noist  3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742
-Non-Latin Alphabet  3743
-non-Latin character  3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3752, 3753, 3754
-\nopostdesc  3755, 3756, 3757, 3758, 3759, 3760, 3761, 3762, 3763, 3764, 3765, 3766, 3767
-\nopostdot  3768
-\null  3769, 3770
-\number  3771
-number list  3772, 3773, 3774, 3775, 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3785, 3786, 3787, 3788, 3789, 3790, 3791, 3792, 3793, 3794, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, 3853, 3854, 3855, 3856, 3857, 3858, 3859, 3860, 3861, 3862
-\numberline  3863
-

O -\oldacronym  3864, 3865
-

P -package options:
-    abbreviations  3866, 3867, 3868, 3869, 3870, 3871, 3872, 3873
-    accsupp  3874, 3875, 3876
-    acronym  3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3894, 3895, 3896, 3897, 3898, 3899, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911
-        true  3912, 3913
-    acronymlists  3914, 3915, 3916, 3917, 3918, 3919, 3920
-    acronyms  3921, 3922, 3923
-    automake  3924, 3925, 3926, 3927
-        false  3928
-        immediate  3929, 3930, 3931
-        true  3932, 3933
-    autoseeindex  3934
-        false  3935, 3936
-    compatible-2.07  3937, 3938, 3939
-    compatible-3.07  3940, 3941, 3942
-    counter  3943, 3944, 3945, 3946, 3947
-        equation  3948
-        page  3949
-    counterwithin  3950, 3951, 3952, 3953, 3954
-    debug  3955, 3956, 3957, 3958
- - -        all  3959
-        false  3960, 3961
-        showaccsupp  3962, 3963, 3964
-        showtargets  3965
-        showwrgloss  3966
-        true  3967
-    description (deprecated)  3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976
-    disablemakegloss  3977, 3978
-    docdef  3979
-        atom  3980, 3981
-        false  3982
-        restricted  3983, 3984, 3985, 3986
-        true  3987, 3988
-    dua (deprecated)  3989, 3990
-    entercounter  3991
-    entrycounter  3992, 3993, 3994, 3995, 3996
-        false  3997
-        true  3998
-    equations  3999
-    esclocations  4000
-        false  4001, 4002, 4003
-        true  4004
-    floats  4005
-    footnote (deprecated)  4006, 4007, 4008, 4009, 4010, 4011
-    hyperfirst  4012, 4013, 4014, 4015
-        false  4016, 4017, 4018, 4019, 4020, 4021, 4022
-        true  4023, 4024
-    index  4025, 4026, 4027, 4028, 4029, 4030, 4031
-    indexcounter  4032
-    indexcrossrefs  4033
-    indexonlyfirst  4034, 4035, 4036, 4037
-        false  4038
-    kernelglossredefs  4039
-        false  4040
-    makeindex  4041, 4042, 4043
-    noglossaryindex  4044
-    nogroupskip  4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052
-        false  4053
-    nohyperfirst  4054
-    nohypertypes  4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063
-        index  4064
-    nolangwarn  4065, 4066
-    nolist  4067, 4068, 4069
-    nolong  4070, 4071, 4072, 4073, 4074
-    nomain  4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086
-    nomissingglstext  4087
- - -    nonumberlist  4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100
-    nopostdot  4101, 4102
-        false  4103, 4104, 4105, 4106, 4107, 4108
-        true  4109, 4110, 4111, 4112
-    noredefwarn  4113
-    nostyles  4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126
-    nosuper  4127, 4128, 4129, 4130, 4131
-    notranslate  4132, 4133, 4134
-    notree  4135, 4136, 4137, 4138
-    nowarn  4139, 4140, 4141
-    numberedsection  4142, 4143, 4144, 4145, 4146, 4147
-        autolabel  4148, 4149, 4150
-        false  4151
-        nameref  4152
-        nolabel  4153
-    numberline  4154, 4155
-    numbers  4156, 4157, 4158
-    order  4159, 4160, 4161, 4162
-        letter  4163, 4164, 4165, 4166, 4167, 4168
-        word  4169, 4170
-    p
-        record  4171
-    postdot  4172, 4173, 4174, 4175, 4176, 4177
-    postpunc  4178
-    prefix  4179, 4180, 4181, 4182
-    record  4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203
-        hybrid  4204, 4205
-        nameref  4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216
-        only  4217, 4218, 4219, 4220, 4221, 4222
-    record  4223, 4224
-    restoremakegloss  4225, 4226
-    sanitizesort  4227, 4228, 4229
-        false  4230, 4231, 4232, 4233, 4234, 4235
-        true  4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244
-    savenumberlist  4245, 4246, 4247, 4248, 4249
-        false  4250
-    savewrites  4251, 4252, 4253
-        false  4254
-    section  4255, 4256
-    seeautonumberlist  4257, 4258, 4259, 4260
-    seenoindex  4261, 4262
-        ignore  4263
-        warn  4264
-    shortcuts  4265, 4266
-    smallcaps (deprecated)  4267, 4268, 4269, 4270, 4271, 4272
-    smaller (deprecated)  4273, 4274, 4275, 4276, 4277
- - -    sort  4278, 4279
-        def  4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290
-        none  4291, 4292, 4293, 4294, 4295, 4296
-        standard  4297, 4298, 4299
-        use  4300, 4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310
-    style  4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318
-        index  4319
-        list  4320
-    stylemods  4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332
-    subentrycounter  4333, 4334, 4335, 4336, 4337, 4338
-        false  4339
-    symbols  4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347
-    toc  4348, 4349, 4350, 4351, 4352, 4353, 4354
-        false  4355
-        true  4356, 4357
-    translate  4358, 4359, 4360, 4361
-        babel  4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369
-        false  4370, 4371, 4372, 4373
-        true  4374, 4375, 4376, 4377
-    ucmark  4378, 4379, 4380
-        false  4381
-        true  4382
-    undefaction  4383
-    writeglslabelnames  4384, 4385, 4386
-    writeglslabels  4387, 4388
-    xindy  4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405
-    xindygloss  4406, 4407
-    xindynoglsnumbers  4408, 4409
-page (counter)  4410, 4411
-page type precedence  4412
-\pagelistname  4413
-pdflatex  4414, 4415
-\PGLS  4416
-\Pgls  4417
-\pgls  4418, 4419
-\PGLSpl  4420
-\Pglspl  4421
-\pglspl  4422
-\pi  4423
-polyglossia package  4424, 4425, 4426, 4427, 4428, 4429, 4430
-\primary  4431
-\printacronyms  4432, 4433, 4434
-\printglossaries  4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443
-\printglossary  4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459
-\printglossary options
-    entrycounter  4460
- - -    groups  4461
-    label  4462
-    leveloffset  4463
-    nogroupskip  4464
-    nonumberlist  4465
-    nopostdot  4466
-    numberedsection  4467
-    prefix  4468
-    style  4469, 4470, 4471, 4472, 4473
-    subentrycounter  4474
-    target  4475, 4476
-    targetnameprefix  4477
-    title  4478, 4479, 4480, 4481, 4482
-    toctitle  4483
-    type  4484, 4485
-\printindex  4486
-\printnoidxglossaries  4487, 4488
-\printnoidxglossary  4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501
-\printnoidxglossary options
-    sort  4502, 4503, 4504, 4505, 4506
-\printnumbers  4507
-\printsymbols  4508
-\printunsrtacronyms  4509
-\printunsrtglossaries  4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526
-\printunsrtglossaries  4527
-\printunsrtglossary  4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544
-\printunsrtinnerglossary  4545
-\providecommand  4546, 4547
-\provideglossaryentry  4548, 4549
-\provideignoredglossary  4550
-

R -relsize package  4551, 4552, 4553
-\Roman  4554
-

S -\S  4555
-sanitize  4556, 4557, 4558, 4559, 4560
-scrwfile package  4561
-\section*  4562, 4563
-\seealsoname  4564, 4565
-\seename  4566, 4567, 4568
-\setabbreviationstyle  4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603
- - -\setabbreviationstyle  4604
-\SetAcronymLists  4605
-\setacronymstyle  4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615
-\setentrycounter  4616, 4617
-\setglossarypreamble  4618, 4619
-\setglossarysection  4620, 4621
-\setglossarystyle  4622, 4623, 4624, 4625, 4626, 4627, 4628
-\setStyleFile  4629, 4630, 4631
-\setupglossaries  4632
-\Sigma  4633
-siunitx package  4634, 4635
-small caps  4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645
-\space  4646
-standard LaTeX extended Latin character  4647, 4648
-stix package  4649, 4650
-\subglossentry  4651
-supertabular package  4652, 4653, 4654
-\symbolname  4655
-

T -tabularx package  4656, 4657, 4658, 4659
-tagpdf package  4660, 4661, 4662
-\texorpdfstring  4663, 4664
-\textbf  4665, 4666
-textcase package  4667, 4668, 4669
-\textrm  4670
-\textsc  4671, 4672, 4673, 4674, 4675, 4676, 4677
-\textsmaller  4678, 4679, 4680, 4681
-\textulc  4682
-\textup  4683
-\the  4684, 4685
-theglossary (environment)  4686
-\theHequation  4687
-\thepage  4688, 4689
-\toprule  4690
-tracklang package  4691, 4692, 4693
-translator package  4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718
-

U -\usepackage  4719
-UTF-8  4720
-

W - - -\write18  4721, 4722
-\writeist  4723
-

X -xfor package  4724
-\xGlsXtrSetField  4725
-xindy  4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 4817, 4818, 4819, 4820, 4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4891, 4892, 4893, 4894, 4895, 4896, 4897, 4898, 4899, 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910
-    -C  4911, 4912, 4913, 4914, 4915
-    -I  4916, 4917
-    -L  4918, 4919, 4920, 4921
-    -M  4922
-xindy attributes  4923, 4924, 4925, 4926, 4927
-    :locref  4928
-xkeyval package  4929, 4930, 4931
-\xspace  4932
-xspace package  4933, 4934, 4935, 4936, 4937, 4938, 4939
-

- - -

1.1That is, if the entry has been referenced using any of the commands described in §5.1 Links to Glossary Entries -and §10 Adding an Entry to the Glossary Without Generating Text or via \glssee (or the see key) or commands such as -\acrshort or \glsxtrshort.

-

1.2Except for Klingon, which is supported by xindy, but not by the CLDR.

-

1.3You can just use the base 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 \glsentryname{label} or \Glsentryname{label} to display the entry -name.

1.4\glossentrysymbol is defined by the base glossaries package but is redefined by glossaries-extra.

-

1.5deprecated, use babel instead

-

1.6Added to version makeglossaries 2.18.

-

1.7As from v3.01 \gls is no longer fragile and doesn’t need protecting.

-

1.8The batch file makeglossaries.bat has been removed since the TeX distributions for Windows provide -makeglossaries.exe.

-

2.1These figures don’t include standard files and registers provided by the kernel or hyperref, such as aux and -out.

2.2unless memoir is loaded, which case it uses \markboth

-

2.3Actually it uses \mfirstucMakeUppercase which is set to textcase’s \MakeTextUppercase by the glossaries package. This -makes it consistent with \makefirstuc. (The textcase package is automatically loaded by glossaries.)

-

2.4bug fix in v4.16 has corrected the code to ensure this.

-

2.5Actually it sets \acronymtype to \glsdefaulttype if the acronym package option is not used, but \glsdefaulttype usually -has the value main unless the nomain option has been used.

-

4.1This is because \acronymtype is set to \glsdefaulttype if the acronym package option is not used.

-

5.1See also “Displaying the glossary” in the documented code, glossaries-code.pdf.

-

5.2I’ve used \MakeUppercase in all the examples for clarity, but it will actually use \mfirstucMakeUppercase.

-

5.3\glsdisplayfirst and \glsdisplay are now deprecated. Backwards compatibility should be preserved but you may need to -use the compatible-3.07 option

-

5.4versions before 3.0 used \glsentryname as the default, but this could cause problems when name had been -sanitized.

6.1as from version 1.18

-

6.2See David Carlisle’s explanation in Drawbacks of xspace

-

8.1you can’t use the longheaderborder style for this example as you can’t use the longtable environment in two column -mode.

11.1makeindex will always assign a location number, even if it’s not needed, so it needs to be discarded.

-

11.2If you redefine \glsseeformat, keep the default value of the optional argument as \seename as both see and \glssee -explicitly write [\seename] in the output file if no optional argument is given.

-

11.3In versions before 3.0, \glsentryname was used, but this could cause problems when the name key was -sanitized.

13.1These lengths will not be available if you use both the nolong and nosuper package options or if you use the nostyles package -option unless you explicitly load the relevant package.

-

13.2This style was supplied by Axel Menzel.

-

13.3e.g. with the flowfram package.

-

14.1see \glsSetCompositor described in §3 Setting Up

-

14.2see \glsSetAlphaCompositor described in §3 Setting Up

-

14.3With glossaries-extra seealso is appended to the end of the list.

-

16.1Single letter words, such as “a” and “I” should typically not appear at the end of a line, hence the non-breakable space after -“a” in the prefix field.

-

16.2The earlier caveats about initial non-Latin characters apply.

-

18.1makeindex assumes that the location is a page number

-

18.2If you use babel with a language that makes the colon character : active you will need to change the prefix.

-

18.3Requires at least bib2gls v2.0.

-

18.4You can either uncompress the PDF file and view it in a text editor or you can use a tool such as the PDFDebugger -provided with PDFBox.

+ Similarly for \acrshort{eg}. You can also use the 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 \BeginAccSupp.

+If the \setacronymstyle command is removed (or commented out) then the result would be different. The first use of \gls uses “E” for the short form but the subsequent use has “ActualText” instead. This is because without \setacronymstyle the original acronym mechanism is used, which is less sophisticated than the newer acronym mechanism that’s triggered with \setacronymstyle.

+

+If you want to convert this example so that it uses glossaries-extra, make sure you have at least version 1.42 of the extension package.
+

+

+If you want to convert this example so that it uses glossaries-extra, you need to replace the explicit loading of glossaries-accsupp with an implicit load through the accsupp package option:
\usepackage[abbreviations,accsupp]{glossaries-extra}
+
I’m switching from \newacronym to \newabbreviation, which means that the default category is abbreviation and also the file extensions are different. If you are using makeglossaries or 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 \setacronymstyle{long-short} needs to be replaced with:

\setabbreviationstyle{long-short}
+
This is actually the default so you can simply delete the \setacronymstyle line. Substitute the two instances of \newacronym with \newabbreviation. For example:
\newabbreviation{eg}{e.g.}{for example}
+
Note that for the “tikz” entry you can now remove the explicit assignment of shortaccess with glossaries-extra v1.42 as it will strip formatting commands like \emph:
\newabbreviation
+ {tikz}{Ti\emph{k}Z}{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm}
+
It’s also necessary to replace \acrshort, \acrlong and \acrfull with \glsxtrshort, \glsxtrlong and \glsxtrfull.

+You may notice a slight difference from the original example if you use a version of glossaries-extra between 1.42 and 1.48. The shortaccess field shows long (short) instead of just long. This is because glossaries-extra v1.42 redefined \glsdefaultshortaccess to include the short form. The original definition was restored in 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 “Doctor” and “Drive” entries should really be defined as abbreviations but they shouldn’t be expanded on first use. The short-nolong style can achieve this and it happens to be the default style for the acronym category. This means that you can simply replace the “Doctor” definition with:

\newacronym{Doctor}{Dr}{Doctor}
+
The first use of \gls{Doctor} is just “Dr”. This means that the “E” PDF element will be used instead of “ActualText”. Now I don’t need to supply the accessibility text as its obtained from the long form.

+The “Drive” 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:

\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}
+
This looks odd when reading the document source and it’s easy to forgot. This is very similar to the situation in the sample-dot-abbr.tex example. I can again use the discardperiod category attribute, but I need to assign a different category so that it doesn’t interfere with the “Doctor” 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 (general, abbreviation, acronym, index, symbol and number are used by various commands provided by glossaries-extra).

+In this case, I’ve decided to have a category called shortdotted to indicate an abbreviation that ends with a dot but only the short form is shown on first use:

\setabbreviationstyle[shortdotted]{short-nolong-noreg}
+\glssetcategoryattribute{shortdotted}{discardperiod}{true}
+\newabbreviation[category={shortdotted}]{Drive}{Dr.\@}{Drive}
+
In the sample-dot-abbr.tex example, I also used the insertdots attribute to automatically insert the dots and add the space factor (which is adjusted if discardperiod discards a period). In this case I’m inserting the dot manually so I’ve also added the space factor with \@ in case the abbreviation is used mid-sentence. For example:
\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}. Next sentence.
+
+\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive} end of sentence.
+
(The spacing is more noticeable if you first switch to a monospaced font with \ttfamily.)

+The “e.g.” abbreviation similarly ends with a dot. It’s not usual to write “for example (e.g.)” in a document, so it really ought to have the same 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:

\setabbreviationstyle[longshortdotted]{long-short}
+\glssetcategoryattribute{longshortdotted}{discardperiod}{true}
+\newabbreviation[category={longshortdotted}]{e.g.}{e.g.\@}{for example}
+

+To further illustrate categories, let’s suppose the symbol and image should be in the name field instead of the symbol and user1 fields. Now the \glssymbolaccsupp and \glsuseriaccsupp commands won’t be used. I can’t deal with both cases if I just provide \glsnameaccsupp.

+I could provide category+field versions, such as \glsxtrsymbolnameaccsupp, but remember that this only covers accessing the name field, which is typically only done in the glossary. I would also need similar commands for the first, firstplural, text and 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 \glsxtrcategoryaccsupp version:

\newcommand{\glsxtrsymbolaccsupp}[2]{% 
+ \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% 
+}
+\newcommand{\glsxtrimageaccsupp}[2]{% 
+  \glsaccessibility{Alt}{#1}{#2}% 
+}
+
+\newglossaryentry{int}{category={symbol},
+  name={\ensuremath{\int}},access={222B},
+  description={integral}
+}
+
+\newglossaryentry{sampleimage}{category={image},
+ description={an example image},
+ name={\protect\includegraphics[height=20pt]{example-image}},
+ access={a boilerplate image used in examples}
+}
+
If it’s necessary to provide support for additional fields, then the category+field command \glsxtrcategoryfieldaccsupp could be used to override the more general category command \glsxtrcategoryaccsupp.

+

🗋📥 sample-ignored.tex
+ This document defines an ignored glossary for common terms that don’t need a definition. The document build is:
pdflatex sample-ignored
+makeglossaries sample-ignored
+pdflatex sample-ignored
+
A new ignored glossary is defined with:
\newignoredglossary{common}
+
There are no associated files with an ignored glossary. An entry is defined with this as its glossary type:
\newglossaryentry{commonex}{type={common},name={common term}}
+
Note that the description key isn’t required. This term may be referenced with \gls (which is useful for consistent formatting) but it won’t be indexed.

+

🗋📥 sample-entrycount.tex
+ This document uses \glsenableentrycount and \cgls (described in §7.1) so that acronyms only used once don’t appear in the list of acronyms. The document build is:
pdflatex sample-entrycount
+pdflatex sample-entrycount
+makeglossaries sample-entrycount
+pdflatex sample-entrycount
+
Note the need to call LaTeX twice before makeglossaries, and then a final LaTeX call is required at the end.

+

+ The glossaries-extra package has additions that extend this mechanism and comes with some other sample files related to entry counting.
+

+

+ If you switch to bib2gls you can use record counting instead. See the bib2gls manual for further details.
+

+ + + +

+

19. Troubleshooting

+

+In addition to the sample files listed in §18, the glossaries package comes with some minimal example files, minimalgls.tex, mwe-gls.tex, mwe-acr.tex and mwe-acr-desc.tex, which can be used for testing. These should be located in the samples subdirectory (folder) of the glossaries documentation directory. The location varies according to your operating system and TeX installation. For example, on Linux it may be in /usr/local/texlive/2022/texmf-dist/doc/latex/glossaries/. The makeglossariesgui application can also be used to test for various problems. Further information on debugging LaTeX code is available at http://www.dickimaw-books.com/latex/minexample/.

+If you have any problems, please first consult the glossaries FAQ. If that doesn’t help, try posting your query to somewhere like the comp.text.tex newsgroup, the LaTeX Community Forum or TeX on StackExchange. Bug reports can be submitted via my package bug report form.

+ +

+ +
+
II. Summaries and Index
+

+ +

+ +
+

Symbols

+ +
+
+
A counter is being described.
+
📌
+
The syntax and usage of a command, environment or option etc.
+
🗑
+
A command, environment or option that is now deprecated.
+
+
An important message.
+
🛈
+
Prominent information.
+
🖹
+
LaTeX code to insert into your document.
+
🔖
+
The definition of an option value.
+
🖺
+
How the example code should appear in the PDF.
+
🎚
+
An option that takes a value.
+
🔎
+
A command-line application invocation that needs to be entered into a terminal or command prompt. See also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.
+
🔘︎
+
A boolean option that is initially false.
+
🔘
+
A boolean option that is initially true.
+
🔎
+
Text in a transcript or log file or written to STDOUT or STDERR.
+
𝍢
+
An option that doesn’t take a value.
+
+
A warning.
+ +
+ +
+ +
+

Terms

+ +
+
American Standard Code for Information Interchange (ASCII)
+
A single-byte character encoding. Related blog article: Binary Files, Text Files and File Encodings.
+
Case change
+
There are four types of case-changing commands provided by the glossaries package: +
+
all caps
+ +
For example, \GLS and \GLStext. All letters in the given text are converted to uppercase (capitals). The actual case-conversion is performed by \glsuppercase.
+
sentence case
+ +
For example, \Gls and \Glstext. Only the first letter is converted to uppercase. The case-conversion for the \gls-like and \glstext-like commands is performed via \glssentencecase, which is simply defined to use the robust \makefirstuc. Commands such as \Glsentrytext also use \glssentencecase in the document but use the expandable \MFUsentencecase in PDF bookmarks.
+
title case
+ +
For example, \glsentrytitlecase. The first letter of each word is converted to uppercase. The case-conversion is performed using \glscapitalisewords in the document text, but commands designed for use in section headings, use the expandable \MFUsentencecase in PDF bookmarks.
+
lowercase
+ +
The command \glslowercase is provided for use in modifying acronym or abbreviation commands to convert the short form to lowercase for small caps styles, but isn’t actually used by any of the commands provided by glossaries. This command should be preferred to the robust \MakeLowercase if expansion is required.
+ +
+ Ensure that you have at least mfirstuc v2.08 for improved case-changing performed by new LaTeX3 commands. See the mfirstuc manual for further details.
+
Command-line interface (CLI)
+
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 a command prompt or terminal.
+
Entry line
+
The line in the glossary where the 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 inline style. The exact formatting depends on the glossary style, but usually includes the name and description. If hyperlinks are enabled, the \gls-like and \glstext-like commands will create a hyperlink to this line.
+
Entry location
+
The location of the entry in the document (obtained from the location counter or from the thevalue option). This defaults to the page number on which the entry has been referenced with any of the \gls-like, \glstext-like or \glsadd commands. An entry may have multiple locations that form a list. See also §12.3.
+
Extended Latin alphabet
+
An alphabet consisting of Latin characters and extended Latin characters.
+
Extended Latin character
+
A character that’s created by combining Latin characters to form ligatures (e.g. æ) or by applying diacritical marks to a Latin character or characters (e.g. á).
+
Field
+
Entry data is stored in fields. These may have a corresponding key used to set the value, such as name or description.
+
First use
+
The first time an entry is used by a command that unsets the first use flag (or the first time since the flag was reset).
+
First use flag
+
A conditional that keeps track of whether or not an entry has been referenced by any of the \gls-like 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).
+
First use text
+
The link text that is displayed on first use of the \gls-like commands.
+
Group (letters, numbers, symbols)
+
A logical division within a glossary that is typically a by-product of the indexing application’s sorting algorithm. Glossary styles may or may not start each group with a title (such as “Symbols” or “A”) or a vertical space. See also Gallery: Logical Glossary Divisions (type vs group vs parent).
+
Graphical user interface (GUI)
+
An application that has windows, buttons or menus.
+
Glossary
+
Technically a glossary is an alphabetical list of words relating to a particular topic. For the purposes of describing the glossaries and glossaries-extra packages, a glossary is either the list produced by commands like \printglossary or \printunsrtglossary (which may or may not be ordered alphabetically) or a glossary is a set of entry labels where the set is identified by the glossary label or type.
+
\gls-like
+
Commands like \gls and \glsdisp that change the first use flag. These commands index the entry (if indexing is enabled), create a hyperlink to the entry’s glossary listing (if enabled) and unset the first use flag. These commands end with the post-link hook.
+
\glstext-like
+
Commands like \glstext and \glslink that don’t change the first use flag. These commands index the entry (if indexing is enabled) and create a hyperlink to the entry’s glossary listing (if enabled). These commands end with the post-link hook.
+
Hierarchical level
+
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 level internal field. It can be accessed using commands like \glsfieldfetch or \glsxtrusefield, but neither the level nor the parent values should be altered as it will cause inconsistencies in the sorting and glossary formatting. See also §4.5.
+
Homograph
+
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.
+
Ignored glossary
+
A glossary that has been defined using a command like \newignoredglossary. These glossaries are omitted by iterative commands, such as \printglossaries and \printunsrtglossaries. An ignored glossary can only be displayed with \printunsrtglossary.
+
Ignored location (or record)
+
A location that uses glsignore as the encap. With bib2gls, this indicates that the entry needs to be selected but the location isn’t added to the location list. With other methods, this will simply create an invisible location, which can result in unwanted commas if the location list has other items. With bib2gls v3.0+, empty locations will be converted to ignored locations.
+
Indexing application
+
An application (piece of software) separate from TeX/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 glossary entry. There are two main indexing applications that are used with TeX: makeindex and xindy. (There is also a new application called xindex, but this isn’t supported by glossaries or glossaries-extra.) The glossaries-extra package additionally supports bib2gls. These are all CLI applications.
+
Indexing file
+
A file that’s input (read) by an indexing application, such as the style file (ist or xdy) or the files containing the indexing data (the sort value, hierarchical information, location encap and entry location). These files are output files from the point of view of the 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 indexing application. These are output files from the indexing application’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.
+
Indexing (or recording)
+
The process of saving the entry location and any associated information that is required in the glossary. In the case of makeindex and xindy, the entry location, encap, entry item and sort value are written to a supplementary file associated with the glossary that is subsequently read by makeindex/xindy. In the case of bib2gls and the “noidx” method, the entry location, encap and label is written to the aux file.
+
Internal field
+
An internal field may refer to a key that shouldn’t be used in the bib file (internal field (bib2gls)), such as the group field, or it may refer to the label used to internally represent the field (which may or may not match the key used to set the field or may not have an associated key), such as useri which corresponds to the user1 key, or it may refer to a 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 .
+
Internal field (bib2gls)
+
A field that is used or assigned by bib2gls that should typically not be used in the bib file.
+
Internal field label
+
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 Table 4.1.
+
Latin alphabet
+
The alphabet consisting of Latin characters.
+
Latin character
+
One of the letters “a”, …, “z”, “A”, …, “Z”.
+
Link text
+
The text produced by gls-like and glstext-like commands that have the potential to be a hyperlink.
+
Location counter
+
The counter used to obtain the entry location.
+
Location encap (format)
+
A command used to encapsulate an entry location. The control sequence name (without the leading backslash) is identified by the format key. The default encap is glsnumberformat. See §12.1 for further details.
+
Location list
+
A list of entry locations (also called a number list). May be suppressed for all glossaries with the package option nonumberlist or for individual glossaries with nonumberlist. With bib2gls, the list may also be suppressed with save-locations=false.
+
Non-Latin alphabet
+
An alphabet consisting of non-Latin characters.
+
Non-Latin character
+
An extended Latin character or a character that isn’t a Latin character.
+
Post-description hook
+
A hook (glspostdescription) included in some glossary styles that is used after the description is displayed. The glossaries-extra package modifies this command to provide additional hooks.
+
Post-link hook
+
A hook (command) that is used after link text to allow code to be automatically added. The base glossaries package provides a general purpose hook glspostlinkhook. The glossaries-extra package modifies this command to provide additional hooks.
+
Print “unsrt” glossary commands
+
The set of commands used for displaying a glossary or partial glossary that have “unsrt” in the name, such as \printunsrtglossary. See the glossaries-extra manual for further details.
+
Resource file
+
The glstex file created by bib2gls and loaded by \GlsXtrLoadResources.
+
Resource set
+
All the settings (resource options) and entries associated with a particular instance of \GlsXtrLoadResources.
+
Sanitize
+
Converts command names into character sequences. That is, a command called, say, foo, is converted into the sequence of characters: , f, o, o. Depending on the font, the backslash character may appear as a dash when used in the main document text, so foo will appear as: —foo.

+Earlier versions of 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 sort key.

+
Shell escape
+
TeX has the ability to run 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―and potentially dangerous―code from begin 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 log file for “runsystem” before using the unrestricted mode.
+
Small capitals (small caps)
+
The LaTeX kernel provides textsc{text} to produce small capitals. This uses a font where lowercase letters have a small capital design. Uppercase letters have the standard height and there’s no noticeable difference with uppercase characters in corresponding non-small caps fonts. This means that for a small caps appearance, you need to use lowercase letters in the text argument. The relsize package provides textsmaller{text} which simulates small caps by reducing the size of the font, so in this case the contents of text should be uppercase (otherwise the effect is simply smaller 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.
+
Standard LaTeX extended Latin character
+
An extended Latin character that can be created by a core LaTeX command, such as o (ø) or 'e (é). That is, the character can be produced without the need to load a particular package.
+
Subsequent use
+
Using an entry that unsets the first use flag when it has already been unset.
+
Unicode Transformation Format (8-bit) (UTF-8)
+
A variable-width 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: Binary Files, Text Files and File Encodings.
+
Whatsit
+
A command whose execution is delayed or an OS-specific special command. This includes writing to external files (which is what indexing does).
+ +
+ +
+ +
+

Glossary Entry Keys Summary

+These are options that can be passed to commands that define entries, such as \newglossaryentry or \newacronym.

+

+

+Accessibility text corresponding to the name field. §17.1; 375

+

alias={xr-label}🎚 glossaries-extra v1.12
+

+Behaves in a similar manner to see={[\seealsoname]xr-label} but also sets up aliasing which makes the link text hyperlink to xr-label instead. §4; 135

+

category=category-labelinitial: general 🎚 glossaries-extra
+

+The entry’s category (must be a simple label). §4; 135

+

counter={counter-name}🎚 glossaries v3.0+
+

+If set, the value indicates the location counter to use by default when indexing this entry (overrides the counter associated with the glossary or the counter package option). §4; 135

+

+

+The entry’s description, as displayed in the glossary. If required in the text, use \glsdesc (if indexing and hyperlinks are required) or \glsentrydesc. Glossary styles should use \glossentrydesc and \glspostdescription to incorporate the post-description hook. §4; 128

+

+

+Accessibility text corresponding to the description field. §17.1; 376

+

descriptionplural={text}🎚 glossaries v1.12+
+

+The plural form of the entry’s description, if applicable. If omitted, this is set to the same value as the description, since descriptions tend not to be a singular entity. §4; 129

+

+

+Accessibility text corresponding to the descriptionplural field. §17.1; 376

+

first={first}🎚 glossaries
+

+The entry’s text, as displayed on first use of \gls-like commands. Note that using an acronym style or post-link hooks is a more flexible approach. If omitted, this value is assumed to be the same as the text key. §4; 129

+

+

+Accessibility text corresponding to the first field. §17.1; 376

+

+

+The entry’s plural form, as displayed on first use of plural \gls-like commands, such as \glspl. If this key is omitted, then the value will either be the same as the plural field, if the first key wasn’t used, or the value will be taken from the first key with \glspluralsuffix appended. §4; 130

+

+

+Accessibility text corresponding to the firstplural field. §17.1; 376

+

group={group-label}🎚 glossaries-extra v1.11+
+

+The group label that identifies which letter group the entry belongs to. This key is only available with the record=only and record=nameref options, and is set by bib2gls, if invoked with --group or -g. Although this has a key, this is considered an internal key assigned by 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 \glsxtrsetgrouptitle, although this is more commonly done implicitly within the glstex file. See also Gallery: Logical Glossary Divisions (type vs group vs parent).

+

location={location-list}🎚 glossaries-extra

+

(requires record)
+
+

+The formatted location list used by the “unsrt” family of commands. This key is only available with the record option and is set by bib2gls unless save-locationsfalse is set. Although it has an associated key, it’s usually considered an internal field.

+

long={long-form}🎚 glossaries v3.0+
+

+A field that is set by \newacronym (and \newabbreviation) to the entry’s long (unabbreviated) form. It typically shouldn’t be used explicitly with \newglossaryentry as \newacronym (and \newabbreviation) makes other modifications to ensure that when the entry is referenced with the \gls-like commands, it will obey the appropriate acronym style (or abbreviation style). If you are using bib2gls then this field should be used in the bib file when defining abbreviations. §4; 135

+

+

+Accessibility text corresponding to the long field. §17.1; 377

+

longplural={long-form}🎚 glossaries v3.0+
+

+As long but the plural form. §4; 135

+

+

+Accessibility text corresponding to the longplural field. §17.1; 377

+

name={text}🎚 glossaries
+

+The entry’s name, as displayed in the glossary. This typically isn’t used outside of the glossary (the text and plural keys are used instead). However, if there is a need to specifically display the entry name, use \glsname (if indexing and hyperlinks are required) or \glsentryname. Glossary styles should use \glossentryname rather than explicitly using \glsentryname. §4; 128

+

nonumberlist={boolean}default: true; initial: false 🎚 glossaries v1.17+
+

+If set, suppress the location list for this entry. This is done by adding \glsnonextpages or \glsnextpages to the indexing information for Options 2 and 3 or to the prenumberlist field for Option 1. §4; 133

+

parent=parent-label🎚 glossaries v1.17+
+

+The label of the entry’s parent (from which the entry’s hierarchical level is obtained). §4; 129

+

plural={text}🎚 glossaries
+

+The entry’s plural form, as displayed on subsequent use of plural \gls-like commands, such as \glspl. This should be the appropriate plural form of the value provided by the text key. If omitted, this value is assumed to be the value of the text key with \glspluralsuffix appended. §4; 129

+

+

+Accessibility text corresponding to the plural field. §17.1; 376

+

prefix={text}🎚 glossaries-prefix v3.14a+
+

+The subsequent use singular prefix. §16; 367

+

prefixfirst={text}🎚 glossaries-prefix v3.14a+
+

+The first use singular prefix. §16; 367

+

+

+The first use plural prefix. §16; 367

+

prefixplural={text}🎚 glossaries-prefix v3.14a+
+

+The subsequent use plural prefix. §16; 367

+

see={[tag]xr-list}🎚 glossaries v1.17+
+

+With the base glossaries package this simply triggers an automatic cross-reference with \glssee. The glossaries-extra package additionally saves the value. Use autoseeindex=false to prevent the automatic cross-reference. The tag defaults to \seename and xr-list should be a comma-separated list of entries that have already been defined. §4; 133

+

seealso={xr-list}🎚 glossaries-extra v1.16+
+

+Behaves in a similar manner to see={[\seealsoname]xr-list}. §4; 135

+

short={short-form}🎚 glossaries v3.0+
+

+A field that is set by \newacronym to the entry’s short (abbreviated) form. It typically shouldn’t be used explicitly with \newglossaryentry as \newacronym (and \newabbreviation) makes other modifications to ensure that when the entry is referenced with the \gls-like commands, it will obey the appropriate acronym style (or abbreviation style). If you are using bib2gls then this field should be used in the bib file when defining abbreviations. §4; 135

+

+

+Accessibility text corresponding to the short field. §17.1; 377

+

shortplural={short-form}🎚 glossaries v3.0+
+

+As short but the plural form. The default is obtained by appending the acronym or abbreviation plural suffix. §4; 135

+

+

+Accessibility text corresponding to the shortplural field. §17.1; 377

+

sort=valueinitial: entry name 🎚 glossaries
+

+Specifies the value to use for sorting (overrides the default). This key is usually required for xindy if the 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. Don’t use the sort field with bib2gls . §4; 130

+

symbol={symbol}initial: \relax 🎚 glossaries
+

+The entry’s associated symbol (optional), which can be displayed with \glssymbol (if indexing and hyperlinks are required) or with \glsentrysymbol. §4; 130

+

+

+Accessibility text corresponding to the symbol field. §17.1; 376

+

symbolplural={symbol plural}🎚 glossaries v1.12+
+

+The plural form of the symbol, if applicable, which can be displayed with \glssymbolplural (if indexing and hyperlinks are required) or with \glsentrysymbolplural. If omitted, this value is set to the same as the symbol key (since symbols usually don’t have a plural form). §4; 130

+

+

+Accessibility text corresponding to the symbolplural field. §17.1; 376

+

text={text}🎚 glossaries
+

+The entry’s text, as displayed on subsequent use of \gls-like commands. If omitted, this value is assumed to be the same as the name key. §4; 129

+

+

+Accessibility text corresponding to the text field. §17.1; 376

+

+

+Assigns the entry to the glossary identified by glossary-label. §4; 132

+

user1={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuseri (if indexing and hyperlinks are required) or with \glsentryuseri. §4; 132

+

+

+Accessibility text corresponding to the user1 field. §17.1; 377

+

user2={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuserii (if indexing and hyperlinks are required) or with \glsentryuserii. §4; 132

+

+

+Accessibility text corresponding to the user2 field. §17.1; 377

+

user3={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuseriii (if indexing and hyperlinks are required) or with \glsentryuseriii. §4; 132

+

+

+Accessibility text corresponding to the user3 field. §17.1; 377

+

user4={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuseriv (if indexing and hyperlinks are required) or with \glsentryuseriv. §4; 132

+

+

+Accessibility text corresponding to the user4 field. §17.1; 378

+

user5={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuserv (if indexing and hyperlinks are required) or with \glsentryuserv. §4; 132

+

+

+Accessibility text corresponding to the user5 field. §17.1; 378

+

user6={text}🎚 glossaries v2.04+
+

+A generic field, which can be displayed with \glsuservi (if indexing and hyperlinks are required) or with \glsentryuservi. §4; 133

+

+

+Accessibility text corresponding to the user6 field. §17.1; 378

+ +

+ +
+

\gls-Like and \glstext-Like Options Summary

+Most (but not all) of these options can be used in the optional argument of all the \gls-like, \glstext-like and \glsadd commands.

+

counter=counter-name🎚 glossaries
+

+The location counter. §5.1.1; 162

+

format=cs-name🎚 glossaries
+

+The encap or control sequence name (without the leading backslash) that should be used to encapsulate the entry location. §5.1.1; 161

+

hyper=booleandefault: true; initial: true 🔘 glossaries
+

+Determines whether or not the link text should have a hyperlink (provided hyperlinks are supported). §5.1.1; 161

+

hyperoutside=booleandefault: true; initial: true 🔘 glossaries-extra v1.21+
+

+Determines whether the hyperlink should be inside or outside of \glstextformat. §5.1.1; 162

+

local=booleandefault: true; initial: false 🔘︎ glossaries v3.04+
+

+If true use \glslocalunset to unset the first use flag, otherwise use \glsunset (only applies to \gls-like commands). §5.1.1; 162

+

noindex=booleandefault: true; initial: false 🔘︎ glossaries-extra
+

+If true this option will suppress indexing. If you are using bib2gls, you may want to consider using format=glsignore to prevent a location but ensure that the entry is selected. §5.1.1; 162

+

postunset=valuedefault: global; initial: global 🎚 glossaries-extra v1.49+
+

+Determines whether or not to unset the first use flag after the link text. The value may be one of: global, local or none (only applies to \gls-like commands). §5.1.1; 163

+

prefix=link-prefix🎚 glossaries-extra v1.31+
+

+The prefix to use for the entry’s hyperlink target. §5.1.1; 163

+

prereset=valuedefault: local; initial: none 🎚 glossaries-extra v1.49+
+

+Determines whether or not to reset the entry before the link text. Allowed values: none (no reset), local (localise the reset) and global. §5.1.1; 163

+

preunset=valuedefault: local; initial: none 🎚 glossaries-extra v1.49+
+

+Determines whether or not to unset the entry before the link text. Allowed values: none (no unset), local (localise the unset) and global. §5.1.1; 163

+

textformat=csname🎚 glossaries-extra v1.30+
+

+The name of the control sequence to use instead of \glstextformat to encapsulate the link text. §5.1.1; 162

+

theHvalue=the-H-value🎚 glossaries-extra v1.19+
+

+Set the hyper location to this value instead of obtaining it from \theHcounter. §5.1.1; 163

+

thevalue=location🎚 glossaries-extra v1.19+
+

+Set the location to this value instead of obtaining it from the location counter. §5.1.1; 163

+

types={glossary list}🎚 glossaries
+

+Only available with \glsaddall, the value is the list of glossaries to iterate over. §10; 255

+

wrgloss=positioninitial: before 🎚 glossaries-extra v1.14+
+

+Determines whether to do the indexing before or after the link text. Allowed values: before and after. §5.1.1; 162

+ +

+ +
+

\printglossary Options Summary

+Most (but not all) of these options can be used in the optional argument of all the \printglossary commands.

+

entrycounter=booleandefault: true; initial: false 🔘︎ glossaries v4.08+
+

+If true, enable the entry counter. §8.1; 242

+

flatten=booleandefault: true; initial: false 🔘︎ glossaries-extra v1.49+
+

+If true, treats all entries as though they have the same hierarchical level (the value of leveloffset). This option is only available for the “unsrt” commands. §8.1; 244

+

groups=booleandefault: true; initial: true 🔘 glossaries-extra v1.44+
+

+Enables letter group formation. This option is only available for the “unsrt” commands. Note that no groups will be formed when invoking bib2gls with the default --no-group, regardless of this setting. §8.1; 244

+

label=label🎚 glossaries-extra v1.39+
+

+Adds \label{label} to the start of the glossary (after the title). §8.1; 243

+

leveloffset=offsetinitial: 0 🎚 glossaries-extra v1.44+
+

+Set or increment the hierarchical level offset. If offset starts with ++ then the current offset is incremented by the given amount otherwise the current offset is set to offset. For example, an entry with a normal hierarchical level of 1 will be treated as though it has hierarchical level \(1+offset\). This option is only available for the “unsrt” commands. §8.1; 244

+

nogroupskip=booleandefault: true; initial: false 🔘︎ glossaries v3.08a+
+

+If true, suppress the gap implemented by some glossary styles between groups. §8.1; 242

+

nonumberlist=booleandefault: true; initial: false 🔘︎ glossaries v1.14+
+

+Suppress the location list. Note that nonumberlist=true will have no effect with the save-locationsfalse resource option as there won’t be any location lists to display. Likewise if \printunsrtglossary is used without bib2gls. §8.1; 242

+

nopostdot=booleandefault: true; initial: false 🔘︎ glossaries v4.08+
+

+If true, suppress the post-description punctuation. §8.1; 242

+

numberedsection=valuedefault: nolabel; initial: false 🎚 glossaries v1.14+
+

+Indicates whether or not glossary section headers will be numbered and also if they should automatically be labelled. The numberedsection package option will change the default setting to match. §8.1; 242

+

prefix=prefix🎚 glossaries-extra v1.31+
+

+Redefines \glolinkprefix to prefix. §8.1; 244

+

sort=method🎚 glossaries v4.04+
+

+Only available with \printnoidxglossary, this indicates how the glossary should be ordered. §8.1; 242

+

sort=case
+

+Case-sensitive sort. 243

+

sort=def
+

+Order of definition. 243

+

sort=letter
+

+Letter order. 243

+

sort=nocase
+

+Case-insensitive sort. 243

+

+

+Word or letter order according to the order package option. 243

+

sort=use
+

+Order of use. 242

+

sort=word
+

+Word order. 243

+

style=style-name🎚
+

+Use the style-name glossary style. §8.1; 241

+

subentrycounter=booleandefault: true; initial: false 🔘︎ glossaries v4.08+
+

+If true, enable the sub-entry counter. §8.1; 242

+

target=booleandefault: true; initial: true 🔘 glossaries-extra v1.12+
+

+If true, each entry in the glossary should have a hypertarget created, if supported by the glossary style and if hyperlinks are enabled. §8.1; 244

+

+

+Inserts prefix at the start of the hypertarget names. §8.1; 244

+

title=text🎚
+

+Sets the glossary title (overriding the default). §8.1; 241

+

toctitle=text🎚 glossaries v3.03+
+

+Sets the glossary toc title (overriding the default). §8.1; 241

+

type=glossary-labeldefault: \glsdefaulttype 🎚
+

+Identifies the glossary to display. §8.1; 241

+ +

+ +
+

Acronym Style Summary

+The style should be set with \setacronymstyle before the first instance of \newacronym.

+

+

+Both the first use and subsequent use only show the long form and the description must be supplied. §6.2.1.5; 209

+

+

+Both the first use and subsequent use only show the long form. §6.2.1.5; 209

+

+

+First use shows short followed by the long form in a footnote and the description must be supplied. §6.2.1.6; 210

+

+

+First use shows short in smallcaps followed by the long form in a footnote and the description must be supplied. §6.2.1.6; 210

+

+

+First use shows short in smallcaps followed by the long form in a footnote. §6.2.1.6; 210

+

+

+First use shows short in a smaller font followed by the long form in a footnote and the description must be supplied. §6.2.1.6; 210

+

+

+First use shows short in a smaller font followed by the long form in a footnote. §6.2.1.6; 210

+

+

+First use shows short followed by the long form in a footnote. §6.2.1.6; 210

+

+

+First use shows long (short) with the short form in smallcaps and the description must be supplied. §6.2.1.3; 208

+

+

+First use shows long (short) with the short form in smallcaps. §6.2.1.1; 206

+

+

+First use shows long (short) where the description must be supplied. §6.2.1.3; 208

+

+

+First use shows long (short). §6.2.1.1; 206

+

+

+First use shows long (short) with the short form in a smaller font and the description must be supplied. §6.2.1.3; 208

+

+

+First use shows long (short) with the short form in a smaller font. §6.2.1.1; 206

+

+

+First use shows long (short) where the space may be converted to a non-breaking space and the description must be supplied. §6.2.1.3; 208

+

+

+First use shows long (short) where the space may be converted to a non-breaking space. §6.2.1.1; 206

+

+

+First use shows short (long) with the short form in smallcaps and a description must be supplied. §6.2.1.4; 209

+

+

+First use shows short (long) with short form in smallcaps. §6.2.1.2; 208

+

+

+First use shows short (long) and a description must be supplied. §6.2.1.4; 208

+

+

+First use shows short (long). §6.2.1.2; 207

+

+

+First use shows short (long) with the short form in a smaller font and a description must be supplied. §6.2.1.4; 209

+

+

+First use shows short (long) with short form in a smaller font. §6.2.1.2; 208

+ +

+ +
+

Glossary Styles Summary

+The default style may be set with \setglossarystyle or with the style package option. The default style can be overridden for individual glossaries with the style option. For a summary of all available styles, see Gallery: Predefined Styles.

+

+

+A list style using the description environment with the entry’s description starting on a new line. §13.1.1; 298

+

+

+A list style using the description environment with the entry’s description starting on a new line with letter group headings. §13.1.1; 298

+

+

+A list style using the description environment with the entry’s description starting on a new line with letter group headings and a navigation line. §13.1.1; 298

+

+

+A tabular style using longtable with 4 columns allowing for multi-lined descriptions, a header row and rules. §13.1.4; 307

+

+

+A tabular style using longtable with 4 columns allowing a multiline description. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns allowing a multiline description with border lines. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns allowing a multiline description with a header row. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns allowing a multiline description with a header row and border lines. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns, a header row and rules, and ragged right formatting for the description. §13.1.4; 308

+

+

+A tabular style using longtable with 4 columns and ragged right formatting for the description. §13.1.3; 305

+

+

+A tabular style using longtable with 4 columns and ragged right formatting for the description and border lines. §13.1.3; 305

+

+

+A tabular style using longtable with 4 columns and ragged right formatting for the description, and a header row. §13.1.3; 305

+

+

+A tabular style using longtable with 4 columns and ragged right formatting for the description, border lines and a header row. §13.1.3; 305

+

+

+A tabular style using supertabular with 4 columns allowing multiline descriptions. §13.1.5; 311

+

+

+ §13.1.5; 311

+

+

+A tabular style using supertabular with 4 columns and a header row allowing multiline descriptions. §13.1.5; 311

+

+

+A tabular style using supertabular with 4 columns, a header row and border lines allowing multiline descriptions. §13.1.5; 311

+

+

+A tabular style using supertabular with 4 columns and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 4 columns and border lines, and ragged right formatting for the description. §13.1.6; 314

+

+

+A tabular style using supertabular with 4 columns and a header row, and ragged right formatting for the description. §13.1.6; 314

+

+

+A tabular style using supertabular with 4 columns, a header row and border lines, and ragged right formatting for the description. §13.1.6; 314

+

+

+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 \glssetwidest. §13.1.7; 317

+

+

+A hierarchical style with letter 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 \glssetwidest. §13.1.7; 319

+

+

+A hierarchical style with letter 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 \glssetwidest. §13.1.7; 319

+

bookindexglossary-bookindex v1.21+
+

+Designed for indexes, the description isn’t shown.

+

+

+A style similar to standard indexes but also shows the description and, if set, the symbol. §13.1.7; 315

+

+

+A style similar to standard indexes with letter group headings but also shows the description and, if set, the symbol. §13.1.7; 316

+

+

+A style similar to standard indexes with letter group headings and a navigation line but also shows the description and, if set, the symbol. §13.1.7; 316

+

+

+An inline homograph style. §13.1.9; 322

+

+

+A list style using the description environment. §13.1.1; 297

+

+

+A list style with a dotted leader between the name and description. §13.1.1; 298

+

+

+A list style using the description environment with letter group headings. §13.1.1; 298

+

+

+A list style using the description environment with letter group headings and a navigation line. §13.1.1; 298

+

+

+A tabular style using longtable with 2 columns a header row and rules. §13.1.4; 307

+

long-name-desc-sym-locglossary-longextra v1.21+
+

+Tabular style with 4 columns.

+

long-name-descglossary-longextra v1.37+
+

+Tabular style with 2 columns.

+

+

+A tabular style using longtable with 2 columns. §13.1.2; 300

+

+

+A tabular style using longtable with 3 columns a header row and rules. §13.1.4; 307

+

+

+A tabular style using longtable with 3 columns. §13.1.2; 301

+

+

+A tabular style using longtable with 3 columns and border lines. §13.1.2; 301

+

+

+A tabular style using longtable with 3 columns and a header row. §13.1.2; 301

+

+

+A tabular style using longtable with 3 columns, a header row and border lines. §13.1.2; 301

+

+

+A tabular style using longtable with 4 columns a header row and rules. §13.1.4; 307

+

+

+A tabular style using longtable with 4 columns. §13.1.2; 301

+

+

+A tabular style using longtable with 4 columns and border lines. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns and a header row. §13.1.2; 302

+

+

+A tabular style using longtable with 4 columns, a header row and border lines. §13.1.2; 302

+

+

+A tabular style using longtable with 2 columns and border lines. §13.1.2; 300

+

+

+A tabular style using longtable with 2 columns and a header row. §13.1.2; 301

+

+

+A tabular style using longtable with 2 columns, a header row and border lines. §13.1.2; 301

+

+

+A tabular style using longtable with 2 columns, a header row and rules, and ragged right formatting for the description. §13.1.4; 308

+

+

+A tabular style using longtable with 2 columns and ragged right formatting for the description. §13.1.3; 304

+

+

+A tabular style using longtable with 3 columns, a header row and rules, and ragged right formatting for the description. §13.1.4; 308

+

+

+A tabular style using longtable with 3 columns and ragged right formatting for the description. §13.1.3; 304

+

+

+A tabular style using longtable with 3 columns and ragged right formatting for the description and border lines. §13.1.3; 304

+

+

+A tabular style using longtable with 3 columns and ragged right formatting for the description, and a header row. §13.1.3; 305

+

+

+A tabular style using longtable with 3 columns and ragged right formatting for the description, border lines and a header row. §13.1.3; 305

+

+

+A tabular style using longtable with 2 columns and ragged right formatting for the description and border lines. §13.1.3; 304

+

+

+A tabular style using longtable with 2 columns and ragged right formatting for the description, and a header row. §13.1.3; 304

+

+

+A tabular style using longtable with 2 columns and ragged right formatting for the description, border lines and a header row. §13.1.3; 304

+

+

+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 \glssetwidest. §13.1.8; Table 13.2

+

+

+A multicolumn hierarchical style with letter 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 \glssetwidest. §13.1.8; Table 13.2

+

+

+A hierarchical style with letter 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 \glssetwidest. §13.1.8; Table 13.2

+

+

+A hierarchical style with letter 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 \glssetwidest. §13.1.8; Table 13.2

+

+

+A multicolumn style similar to standard indexes but also shows the description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn style similar to standard indexes with letter group headings but also shows the description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn style similar to standard indexes with letter group headings and a navigation line at the start of the first column but also shows the description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn style similar to standard indexes with letter group headings and a navigation line spanning all columns but also shows the description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn hierarchical style that shows the name, description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn hierarchical style with letter group headings that shows the name, description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn hierarchical style with letter group headings and navigation line at the start of the first column that shows the name, description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A multicolumn homograph style that shows the top-level name, description and, if set, the symbol, but omits the name for sub-entries. §13.1.8; Table 13.2

+

+

+A multicolumn homograph style with letter group headings that shows the top-level name, description and, if set, the symbol, but omits the name for sub-entries. §13.1.8; Table 13.2

+

+

+A multicolumn homograph style with letter 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. §13.1.8; Table 13.2

+

+

+A multicolumn homograph style with letter 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. §13.1.8; Table 13.2

+

+

+A multicolumn hierarchical style with letter group headings and navigation line spanning all columns that shows the name, description and, if set, the symbol. §13.1.8; Table 13.2

+

+

+A list style with just the name for top-level entries and a dotted leader between the name and description for sub-entries. §13.1.1; 299

+

+

+A tabular style using supertabular with 2 columns. §13.1.5; 309

+

+

+A tabular style using supertabular with 3 columns. §13.1.5; 309

+

+

+A tabular style using supertabular with 3 columns and border lines. §13.1.5; 310

+

+

+A tabular style using supertabular with 3 columns and a header row. §13.1.5; 310

+

+

+A tabular style using supertabular with 3 columns, a header row and border lines. §13.1.5; 310

+

+

+A tabular style using supertabular with 4 columns. §13.1.5; 310

+

+

+A tabular style using supertabular with 4 columns and border lines. §13.1.5; 310

+

+

+A tabular style using supertabular with 4 columns and a header row. §13.1.5; 310

+

+

+A tabular style using supertabular with 4 columns, a header row and border lines. §13.1.5; 310

+

+

+A tabular style using supertabular with 2 columns and border lines. §13.1.5; 309

+

+

+A tabular style using supertabular with 2 columns and a header row. §13.1.5; 309

+

+

+A tabular style using supertabular with 2 columns, a header row and border lines. §13.1.5; 309

+

+

+A tabular style using supertabular with 2 columns and ragged right formatting for the description. §13.1.6; 312

+

+

+A tabular style using supertabular with 3 columns and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 3 columns and border lines, and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 3 columns and a header row, and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 3 columns, a header row and border lines, and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 2 columns and border lines, and ragged right formatting for the description. §13.1.6; 312

+

+

+A tabular style using supertabular with 2 columns and a header row, and ragged right formatting for the description. §13.1.6; 313

+

+

+A tabular style using supertabular with 2 columns, a header row and border lines, and ragged right formatting for the description. §13.1.6; 313

+

topicglossary-topic v1.40+
+

+Designed for paragraph length top-level descriptions.

+

topicmcolsglossary-topic v1.40+
+

+Designed for paragraph length top-level descriptions with sub-entries in multiple columns.

+

+

+A hierarchical style that shows the name, description and, if set, the symbol. §13.1.7; 316

+

+

+A hierarchical style with letter group headings that shows the name, description and, if set, the symbol. §13.1.7; 317

+

+

+A hierarchical style with letter group headings and navigation line that shows the name, description and, if set, the symbol. §13.1.7; 317

+

+

+A homograph style that shows the top-level name, description and, if set, the symbol, but omits the name for sub-entries. §13.1.7; 317

+

+

+A homograph style with letter group headings that shows the top-level name, description and, if set, the symbol, but omits the name for sub-entries. §13.1.7; 317

+

+

+A homograph style with letter group headings and navigation line that shows the top-level name, description and, if set, the symbol, but omits the name for sub-entries. §13.1.7; 317

+ +

+ +
+

Command Summary

+ +
+ +
+

@

+
\@gls@codepage{code-page}glossaries v1.17+
+

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. The code-page indicates the xindy codepage. §1.7.1; 66

+

\@gls@reference{type}{label}{location}glossaries v4.04+
+

+This command is written to the aux file to provide the information for \printnoidxglossary. §1.7.1; 66

+

\@glsorder{order}
+

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. The order should be either letter or word. §1.7.1; 66

+

\@glsxtr@altmodifier{character}glossaries-extra v1.37+
+

+This command is written to the aux file to provide the \GlsXtrSetAltModifier information for bib2gls. §1.7.3; 68

+

\@glsxtr@newglslike{label-prefix}{cs}glossaries-extra v1.37+
+

+This command is written to the aux file to provide the \glsxtrnewglslike information for bib2gls. §1.7.3; 68

+

+

+This command is written to the aux file to provide the \dgls information for bib2gls. §1.7.3; 68

+

\@istfilename{filename}
+

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. The filename is the name of the style file. §1.7.1; 65

+

\@newglossary{glossary-label}{log}{out-ext}{in-ext}
+

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. The arguments indicate the file extensions associated with the given glossary. §1.7.1; 65

+

\@xdylanguage{glossary-label}{language}glossaries v1.17+
+

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. The language is the language to pass to xindy for the given glossary. §1.7.1; 66

+ +

+ +
+

A

+
\abbreviationsnameinitial: Abbreviations; glossaries-extra

+

(language-sensitive)
+
+

+Expands to the title of the abbreviations glossary. The default is “Abbreviations” or \acronymname if babel has been detected.

+

\Ac{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Gls defined by the shortcuts package option. §6.1; Table 6.1

+

\ac{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \gls defined by the shortcuts package option. §6.1; Table 6.1

+

\Acf{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrfull defined by the shortcuts package option. §6.1; Table 6.1

+

\acf{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrfull defined by the shortcuts package option. §6.1; Table 6.1

+

\Acfp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrfullpl defined by the shortcuts package option. §6.1; Table 6.1

+

\acfp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrfullpl defined by the shortcuts package option. §6.1; Table 6.1

+

\Acl{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrlong defined by the shortcuts package option. §6.1; Table 6.1

+

\acl{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrlong defined by the shortcuts package option. §6.1; Table 6.1

+

\Aclp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrlongpl defined by the shortcuts package option. §6.1; Table 6.1

+

\aclp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrlongpl defined by the shortcuts package option. §6.1; Table 6.1

+

\Acp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Glspl defined by the shortcuts package option. §6.1; Table 6.1

+

\acp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \glspl defined by the shortcuts package option. §6.1; Table 6.1

+

\ACRfull[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrfull but all caps. §6.1; 198

+

\Acrfull[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrfull but sentence case. §6.1; 198

+

\acrfull[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the acronym identified by entry-label. The text produced shows the full form, formatted according to the acronym style. With glossaries-extra, use \glsxtrfull instead. For the first optional argument, see \glslink options. §6.1; 198

+

\ACRfullfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \ACRfull to format the full form. This command is redefined by acronym styles.

+

\Acrfullfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \Acrfull to format the full form. This command is redefined by acronym styles.

+

\acrfullfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \acrfull to format the full form. This command is redefined by acronym styles.

+

🗑 \acrfullformat{long text}{short text}glossaries
+

+Deprecated with the introduction of \setacronymstyle but used in the initial definition of commands like \glsentryfmt before they are redefined by the acronym style. This may be removed in a future release.

+

\ACRfullpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrfullpl but all caps. §6.1; 198

+

\Acrfullpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrfullpl but sentence case. §6.1; 198

+

\acrfullpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrfull but shows the full plural form of an acronym. With glossaries-extra, use \glsxtrfullpl instead. For the first optional argument, see \glslink options. §6.1; 198

+

\ACRfullplfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \ACRfullpl to format the full form. This command is redefined by acronym styles.

+

\Acrfullplfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \Acrfullpl to format the full form. This command is redefined by acronym styles.

+

\acrfullplfmt{options}{entry-label}{insert}glossaries v4.02+
+

+Used by \acrfullpl to format the full form. This command is redefined by acronym styles.

+

🗑 \acrlinkfullformat{internal long cs}{internal short cs}{options}{entry-label}{insert}glossaries
+

+Deprecated with the introduction of \setacronymstyle but used in the initial definition of commands like \acrfullfmt before they are redefined by the acronym style. This may be removed in a future release.

+

\ACRlong[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrlong but converts the link text to all caps. §6.1; 197

+

\Acrlong[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrlong but converts the link text to sentence case. §6.1; 197

+

\acrlong[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the acronym identified by entry-label. The text produced is obtained from the long value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. With glossaries-extra, use \glsxtrlong instead. For the first optional argument, see \glslink options. §6.1; 197

+

\ACRlongpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrlongpl but converts the link text to all caps. §6.1; 198

+

\Acrlongpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrlongpl but converts the link text to sentence case. §6.1; 197

+

\acrlongpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the acronym identified by entry-label. The text produced is obtained from the longplural value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. With glossaries-extra, use \glsxtrlongpl instead. For the first optional argument, see \glslink options. §6.1; 197

+

\acrnameformat{short text}{long text}glossaries
+

+Used by acronym styles that require an additional description to determine what information is displayed in the name.

+

\acronymentry{entry-label}glossaries v4.02+
+

+Used by acronym styles to format the acronym name. §6.2; §6.2.1; 203204

+

+

+Used to encapsulate the acronym short form on subsequent use. §6.2.1; 203

+

\acronymnameinitial: Acronyms; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as the default title for the glossary created by the acronyms option. §1.5.1; Table 1.2

+

\acronymsort{short}{long}glossaries
+

+Used by acronym styles in the acronym sort key. §6.2; §6.2.1; 203204

+

+

+Expands to the label of the default acronym glossary. The acronym or acronyms package option will redefine this to acronym. The glossaries-extra package’s abbreviations option will redefine this to \glsxtrabbrvtype if acronyms/acronym isn’t used. §9; 253

+

+

+Suffix used in the default shortplural value by \newacronym. §6.2.1; 205

+

\ACRshort[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrshort but converts the link text to all caps. §6.1; 196

+

\Acrshort[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrshort but converts the link text to sentence case. §6.1; 196

+

\acrshort[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the acronym identified by entry-label. The text produced is obtained from the short value, formatted according to the acronym style. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. With glossaries-extra, use \glsxtrshort instead. For the first optional argument, see \glslink options. §6.1; 196

+

\ACRshortpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrshortpl but converts the link text to all caps. §6.1; 197

+

\Acrshortpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \acrshortpl but converts the link text to sentence case. §6.1; 197

+

\acrshortpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the acronym identified by entry-label. The text produced is obtained from the shortplural value, formatted according to the acronym style. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. With glossaries-extra, use \glsxtrshortpl instead. For the first optional argument, see \glslink options. §6.1; 197

+

\Acs{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrshort defined by the shortcuts package option. §6.1; Table 6.1

+

\acs{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrshort defined by the shortcuts package option. §6.1; Table 6.1

+

\Acsp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \Acrshortpl defined by the shortcuts package option. §6.1; Table 6.1

+

\acsp{options}{entry-label}{inset}modifiers: * +
+

+A synonym for \acrshortpl defined by the shortcuts package option. §6.1; Table 6.1

+

\addglossarytocaptions{language}glossaries
+

+Adds the redefinition of \glossaryname to \captionslanguage if translator has been loaded (does nothing if translator hasn’t been loaded).

+

\altnewglossary{glossary-label}{tag}{title}[counter]glossaries v2.06+
+

+A shortcut that supplies file extensions based on the tag argument:

\newglossary[tag-glg]{tag}{tag-gls}{tag-glo}{title}[counter]
§9; 252

+

\andnameinitial: \&; glossaries
+

+Provided by glossaries if it hasn’t already been defined.

+

\apptoglossarypreamble[type]{text}glossaries-extra v1.12+
+

+Locally appends text to the preamble for the glossary identified by type. If type is omitted, \glsdefaulttype is assumed. §8.2; 248

+ +

+ +
+

B

+
\bibglsdelimNinitial: \delimN; bib2gls
+

+Delimiter used between locations in the location list, except for the last pair.

+

\bibglslastDelimNinitial: \delimN; bib2gls
+

+Delimiter used between the last pair of locations in the location list.

+ +

+ +
+

C

+
\capitalisefmtwords{text}mfirstuc v2.03+
+

+Converts text to title case, where 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 mfirstuc documentation for further details, either:

texdoc mfirstuc
or visit ctan.org/pkg/mfirstuc.

+

\capitalisewords{text}mfirstuc v1.06+
+

+Converts text to title case. Limitations apply, see the mfirstuc documentation for further details, either:

texdoc mfirstuc
or visit ctan.org/pkg/mfirstuc.

+

\cGls[options]{entry-label}[insert]modifiers: * + glossaries v4.14+
+

+Like \Gls but hooks into the entry counting mechanism. §7.1; 235

+

\cgls[options]{entry-label}[insert]modifiers: * + glossaries v4.14+
+

+Like \gls but hooks into the entry counting mechanism. §7.1; 234

+

\cGlsformat{entry-label}{insert}glossaries v4.14+
+

+Format used by \cGls if the entry was only used once on the previous run. §7.1; 236

+

\cglsformat{entry-label}{insert}glossaries v4.14+
+

+Format used by \cgls if the entry was only used once on the previous run. §7.1; 235

+

\cGlspl[options]{entry-label}[insert]modifiers: * + glossaries v4.14+
+

+Like \Glspl but hooks into the entry counting mechanism. §7.1; 235

+

\cglspl[options]{entry-label}[insert]modifiers: * + glossaries v4.14+
+

+Like \glspl but hooks into the entry counting mechanism. §7.1; 235

+

\cGlsplformat{entry-label}{insert}glossaries v4.14+
+

+Format used by \cGlspl if the entry was only used once on the previous run. §7.1; 236

+

\cglsplformat{entry-label}{insert}glossaries v4.14+
+

+Format used by \cglspl if the entry was only used once on the previous run. §7.1; 236

+

+

+Defined by the \printglossary commands to the current glossary label. §8; 241

+

🗑 \CustomAcronymFieldsglossaries v2.06
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \newacronymstyle and \setacronymstyle.

+

🗑 \CustomNewAcronymDefglossaries v2.06
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \newacronymstyle and \setacronymstyle.

+ +

+ +
+

D

+ +

+Identifies the list of glossaries as lists of acronyms. §2.7; 114

+

🗑 \DefaultNewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \defglsdisplay
+

+This was originally used to define a format the way the link text was displayed on first use by the \gls-like commands. Deprecated in v3.11a and removed in v4.50. Use rollback if backward-compatibility required, but it’s better to switch to \defglsentryfmt.

+

🗑 \defglsdisplayfirst
+

+This was originally used to define a format the way the link text was displayed on first use by the \gls-like commands. Deprecated in v3.11a and removed in v4.50. Use rollback if backward-compatibility required, but it’s better to switch to \defglsentryfmt.

+

\defglsentryfmt[glossary-type]{definition}glossaries v3.11a+
+

+Defines the display format used by the \gls-like commands for entries assigned to the glossary identified by glossary-type (\glsdefaulttype if omitted). §5.1.4; 174

+

+

+Provides the shortcut commands for acronyms. §2.7; 115

+

+

+Used as a separator between locations. §12; 265

+

+

+Used between the start and end of a location range. §12.2; 271

+

🗑 \DescriptionDUANewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \DescriptionFootnoteNewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\descriptionnameinitial: Description; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as a column header for some of the tabular-like glossary styles. §1.5.1; Table 1.2

+

🗑 \DescriptionNewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\dgls[options]{entry-label}[insert]modifiers: * + glossaries-extra-bib2gls v1.37+
+

+Does \gls[options]{prefix{entry-label}}[insert] for the first prefix in the prefix list that matches a defined entry.

+

\DTLformatlist{csv-list}datatool-base v2.28+
+

+Formats the comma-separated list csv-list. One-level expansion is performed on csv-list. See the datatool documentation for further details, either:

texdoc datatool
or visit ctan.org/pkg/datatool.

+

\DTLifinlist{element}{csv-list}{true}{false}datatool-base
+

+Does true if element is contained in the comma-separated list csv-list, otherwise does false. One-level expansion is performed on csv-list, but not on element. See the datatool documentation for further details, either:

texdoc datatool
or visit ctan.org/pkg/datatool.

+

🗑 \DUANewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+ +

+ +
+

E

+
\entrynameinitial: Notation; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as a column header for some of the tabular-like glossary styles. §1.5.1; Table 1.2

+ +

+ +
+

F

+
\firstacronymfont{text}glossaries v1.14+
+

+Used to encapsulate the acronym short form on first use. §6.2.1; 203

+

🗑 \FootnoteNewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\forallabbreviationlists{cs}{body}glossaries-extra v1.42+
+

+Iterates overall all lists of abbreviations, defines the command cs to the current label and does body.

+

\forallacronyms{cs}{body}glossaries v4.08+

+

(don’t use with glossaries-extra)
+
+

+Iterates overall all glossaries that have been declared lists of acronyms, defines the command cs to the current label and does body. §15.3; 356

+

\forallglossaries[types]{cs}{body}glossaries
+

+Iterates overall all the glossary labels given in the types argument, defines the command cs to the current label and does body. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §15.3; 356

+

\forallglsentries[types]{cs}{body}glossaries
+

+Does \forglsentries for each glossary. The optional argument types is a comma-separated list of glossary labels. If omitted, all non-ignored glossaries is assumed. §15.3; 356

+

\forglsentries[type]{cs}{body}glossaries
+

+Iterates over all entries in the given glossary and, at each iteration, defines the command cs to the current entry label and does body. The optional argument type is the glossary label and defaults to \glsdefaulttype if omitted. This command can’t be used with bib2gls since there are no defined entries until bib2gls has selected them and added them to the glstex file. §15.3; 356

+ +

+ +
+

G

+
\Genacrfullformat{label}{insert}glossaries v4.02+
+

+As \genacrfullformat but sentence case. §5.1.4; 178

+

\genacrfullformat{label}{insert}glossaries v4.02+
+

+Used by \glsgenacfmt to display the acronym singular full form on first use. Redefined by acronym styles. §5.1.4; 177

+

+

+Expands to the additional keys that need to be provided to \newglossaryentry when called by \newacronym. For example, the description key. §6.2.2; 211

+

\Genplacrfullformat{label}{insert}glossaries v4.02+
+

+As \genplacrfullformat but sentence case. §5.1.4; 178

+

\genplacrfullformat{label}{insert}glossaries v4.02+
+

+Used by \glsgenacfmt to display the acronym plural full form on first use. Redefined by acronym styles. §5.1.4; 178

+ +

+ +
+

Glo

+
\glolinkprefixinitial: glo:
+

+Expands to the prefix used for entry targets. §13.2.1; 327

+

\glossariesextrasetup{options}glossaries-extra
+

+Change allowed options that are defined or modified by the glossaries-extra package. Note that some options can only be passed as package options.

+

\glossaryentry{data}{location}
+

+This isn’t actually defined as a command but is used as a keyword for makeindex. §12.5; 279

+

+

+Encapsulations the number list in the glossary and is also used to save the number list with the savenumberlist option. This command is redefined by options such as nonumberlist or commands like \glsnonextpages. §8.2; 249

+

+

+Does the header code after \begin{theglossary}. §13.2.3; 331

+

🗑 \glossarymarkglossary titleglossaries v1.0+
+

+Only provided if it hasn’t already been defined for backward-compatibility. Use \glsglossarymark instead. §8.2; 245

+

\glossarynameinitial: Glossary; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as the default title for glossaries without a specified title. May already be defined by a language package. §1.5.1; Table 1.2

+

+

+Used at the end of the glossary. §8.2; 248

+

+

+Used at the start of the glossary. This will be locally redefined to the preamble associated with the current glossary, if one has been set. §8.2; 247

+

\glossarysection[toc title]{title}
+

+Used to display the glossary heading. §8.2; 245

+

🗑 \glossarystyle{style-name}glossaries v1.0–v4.49
+

+Sets the default glossary style to style-name. Deprecated in v3.08a and removed in v4.50. Now only available with rollback. Use \setglossarystyle instead.

+

+

+Defined by \printglossary to the current glossary’s title. §8.2; 246

+

+

+Defined by \printglossary to the current glossary’s title for the table of contents (if toctrue). §8.2; 246

+

\glossentry{entry-label}{number-list}glossaries v3.08a+

+

(glossary style command)
+
+

+Redefined by the glossary styles to display top level (level 0) entries. §13.2.3; 332

+

\Glossentrydesc{entry-label}glossaries v3.08a+
+

+As \glossentrydesc but sentence case. §13.2.1; 328

+

\glossentrydesc{entry-label}glossaries v3.08a+
+

+Used within glossary styles to display the description. §13.2.1; 328

+

\Glossentryname{entry-label}glossaries v3.08a+
+

+As \glossentryname but sentence case. §13.2.1; 328

+

\glossentryname{entry-label}glossaries v3.08a+
+

+Used within glossary styles to display the name encapsulated with \glsnamefont. §13.2.1; 327

+

\glossentrynameother{entry-label}{field-label}glossaries-extra v1.22+
+

+Behaves like \glossentryname but uses the given field (identified by its internal label) instead of name.

+

\Glossentrysymbol{entry-label}glossaries v3.08a+
+

+As \glossentrysymbol but sentence case. §13.2.1; 328

+

\glossentrysymbol{entry-label}glossaries v3.08a+
+

+Used within glossary styles to display the symbol. §13.2.1; 328

+ +

+ +
+

Gls

+
\GLS[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \gls but converts the link text to all caps. §5.1.2; 165

+

\Gls[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \gls but converts the link text to sentence case. §5.1.2; 165

+

\gls[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced depends on whether or not this is the first use. The insert argument may be inserted at the end of the link text or may be inserted at a different point (for example, after the long form on first use for some acronym or abbreviation styles. For the first optional argument, see \glslink options. §5.1.2; 165

+

\gls@accessibility{options}{PDF element}{value}{content}glossaries-accsupp v4.45+
+

+Used by \glsaccessibility to provide the accessibility support. §17.5; 386

+

\gls@accsupp@engineinitial: accsupp; glossaries-accsupp v4.45+
+

+Expands to the accessibility support engine. This command may be defined before glossaries-accsupp is loaded. §17.5; 386

+

\glsabbrvfont{text}glossaries-extra
+

+Font formatting command for the short form, initialised by the abbreviation style.

+

\glsaccessibility[options]{PDF element}{value}{content}glossaries-accsupp v4.45+
+

+Applies value as the accessibility attribute PDF element for the given content. This internally uses the accessibility support provided by accsupp. §17.2; 379

+

\Glsaccesslong{entry-label}glossaries-extra
+

+The sentence case version of \glsaccesslong.

+

\glsaccesslong{entry-label}glossaries-extra
+

+If accessibility support was enabled when glossaries-extra was loaded (accsupp) this will display the value of the long key with the accessibility support enabled for that key (longaccess). If there is no accessibility support, this just uses \glsentrylong.

+

\Glsaccesslongpl{entry-label}glossaries-extra
+

+The sentence case version of \glsaccesslongpl.

+

\glsaccesslongpl{entry-label}glossaries-extra
+

+If accessibility support was enabled when glossaries-extra was loaded (accsupp) this will display the value of the longplural key with the accessibility support enabled for that key (longpluralaccess). If there is no accessibility support, this just uses \glsentrylongpl.

+

\glsaccessname{entry-label}glossaries-extra
+

+If accessibility support was enabled when glossaries-extra was loaded (accsupp) this will display the value of the name key with the accessibility support enabled for that key (access). If there is no accessibility support, this just uses \glsentryname.

+

\glsaccessshort{entry-label}glossaries-extra
+

+If accessibility support was enabled when glossaries-extra was loaded (accsupp) this will display the value of the short key with the accessibility support enabled for that key (shortaccess). If there is no accessibility support, this just uses \glsentryshort.

+

\glsaccessshortpl{entry-label}glossaries-extra
+

+If accessibility support was enabled when glossaries-extra was loaded (accsupp) this will display the value of the shortplural key with the accessibility support enabled for that key (shortpluralaccess). If there is no accessibility support, this just uses \glsentryshortpl.

+

\glsaccsupp{replacement}{content}glossaries-accsupp
+

+Applies replacement as the ActualText for content using \glsaccessibility. §17.2; 379

+

+

+Short plural suffix, this command is changed by acronym styles. §6; 193

+

\glsacspace{label}glossaries v4.16+
+

+Uses a non-breakable space if the short form is less than 3em. This command is redefined by glossaries-extra to use \glsacspacemax instead of the hard-coded 3em. §6.2.1.1; 206

+

\glsacspacemaxglossaries-extra
+

+Expands to the maximum width used by \glsacspace. This is a macro not a register. The default is 3em.

+

\glsadd[options]{entry-label}glossaries
+

+Indexes the entry identified by entry-label. §10; 254

+

\glsaddall[options]glossaries
+

+Iterates over all non-ignored glossaries (or all those listed in the types option) and indexes each entry in the glossary. The optional argument options are passed to \glsadd. This command can’t be used with bib2gls. Use the selection=all resource option instead. §10; 255

+

\glsaddallunused[glossary types]glossaries v3.08a+
+

+Iterates over all glossaries listed in glossary types (all all non-ignored glossaries if omitted) and indexes each entry (with format=glsignore) that hasn’t been used. This command can’t be used with bib2gls. Use the selection=all resource option instead. §10; 255

+

\glsaddkey{key}{default value}{no link cs}{no link ucfirst cs}{link cs}{link ucfirst cs}{link allcaps cs}glossaries v3.12a+
+

+Defines a new glossary entry key with the given default value and commands that are analogous to \glsentrytext (no link cs), \Glsentrytext (no link ucfirst cs), \glstext (link cs), \Glstext (link ucfirst cs), \GLStext (link allcaps cs). The starred version switches on field expansion for the given key. §4.3.1; 139

+

\GlsAddLetterGroup{name}{xindy code}glossaries v1.17+

+

(xindy only)
+
+

+Adds a new xindy letter group, identified by name and defined by xindy code. This information is written to the xdy file that’s created by \makeglossaries.

+

\glsaddstoragekey{key}{default value}{no link cs}glossaries v4.16+
+

+Provides a new glossary entry key with a default value and a command for simply accessing the value (without indexing or hyperlinks). The starred version switches on field expansion for the given key. §4.3.2; 141

+

\GlsAddXdyAttribute{name}glossaries v1.17+

+

(xindy only)
+
+

+Adds the xindy attributes associated with name to the xdy style file. §14.3; 341

+

\GlsAddXdyCounters{counter list}glossaries v3.0+

+

(xindy only)
+
+

+Identifies all the location counters required in the document. §14.3; 341

+

\GlsAddXdyLocation[H-prefix]{name}{definition}glossaries v1.17+

+

(xindy only)
+
+

+Adds the given location syntax to the xdy style file. §14.3; 343

+

\GlsAddXdyStyle{style-name}glossaries v1.17+

+

(xindy only)
+
+

+Adds a required xindy file to the xdy style file. §14.1; 338

+

+

+Expands to the prefix for the label used by numberedsection=autolabel and numberedsection=nameref. §2.2; 80

+

+

+Expands to \ (a literal backslash). §14; 338

+

\glscapitalisewords{content}glossaries v4.48+
+

+Just does \capitalisewords but may be redefined to use \capitalisefmtwords, if required. §15.2; 355

+

\glscapscase{no change}{sentence}{all caps}glossaries v3.11a+
+

+Defined by the \gls-like commands to expand to no change if the calling command wasn’t a case-changing command (\gls or \glspl), to sentence for sentence case commands (\Gls or \Glspl) or to all caps for all caps commands (\GLS or \GLSpl). §5.1.4; 175

+

\glscategory{entry-label}glossaries-extra
+

+Expands to the entry’s category.

+

+

+Used to clear the page at the start of a glossary. §8.2; 246

+

+

+Expands to (a literal closing brace). §14; 337

+

\glscounterinitial: page; glossaries
+

+The default counter as specified by the counter option. §2.3; 89

+

\glscurrententrylabelglossaries v3.02+
+

+Assigned at the start of each entry item within the glossary. This command may be used by glossary hooks, such as \glspostdescription, to reference the current entry.

+

+

+Conditional commands such as \ifglshasfield set this to the field’s value for use within the true code. §15.4; 360

+

+

+Placeholder command that expands to the text provided in \glsdisp. §5.1.4; 175

+

+

+Identifies the list of glossaries that should have hyperlinks suppressed. §2.6; 109

+

\glsdefaultshortaccess{long}{short}glossaries-accsupp v4.45+
+

+The default value for the shortaccess key when defining acronyms with \newacronym. §17.1; 377

+

\glsdefaulttypeinitial: main; glossaries
+

+Expands to the label of the default glossary, which is normally main but if nomain is used, it will be the label of the first glossary to be defined.

+

\glsdefpostdesc{category}{definition}glossaries-extra v1.31+
+

+Defines post-description hook associated with the category identified by the label category.

+

\glsdefpostlink{category}{definition}glossaries-extra v1.31+
+

+Defines post-link hook associated with the category identified by the label category.

+

\glsdefs@newdocentry{entry-label}{key=value list}glossaries-extra v4.47+
+

+This command is written to the glsdefs file to define the given entry using the definition provided in the document environment on the previous LaTeX run.

+

\GLSdesc[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsdesc but converts the link text to all caps. §5.1.3; 171

+

\Glsdesc[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsdesc but converts the link text to sentence case. Use \Glossentrydesc within custom glossary styles instead of this command. §5.1.3; 171

+

\glsdesc[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the description value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. Use \glossentrydesc within custom glossary styles instead of this command. §5.1.3; 171

+

\GLSdescplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glsdescplural but converts the link text to all caps.

+

\Glsdescplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glsdescplural but converts the link text to sentence case.

+

\glsdescplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glsdesc but for the descriptionplural field.

+

\glsdescriptionaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the descriptionaccess replacement text (if set). §17.3; 381

+

+

+Does text with the descriptionpluralaccess replacement text (if set). §17.3; 382

+

+

+A length register used to set the width of the description column for tabular-like styles. §13.1; 293

+

+

+Disables hyperlinks (may be scoped to localise the effect). §15.1; §5.1.6; 180352

+

\Glsdisp[options]{entry-label}{text}modifiers: * + glossaries v4.50+
+

+As \glsdisp but converts text to sentence case. §5.1.2; 167

+

\glsdisp[options]{entry-label}{text}modifiers: * + glossaries v1.19+
+

+References the entry identified by entry-label with the given text as the link text. This command unsets the first use flag (use \glslink instead, if the first use flag should not be altered). This command is considered a \gls-like command. For the first optional argument, see \glslink options. §5.1.2; 166

+

🗑 \glsdisplay
+

+This was originally used to format the way the link text was displayed on first use by the \gls-like commands. Deprecated in v3.11a and removed in v4.50. Use rollback if backward-compatibility required, but it’s better to switch to \glsentryfmt.

+

🗑 \glsdisplayfirst
+

+This was originally used to format the way the link text was displayed on first use by the \gls-like commands. Deprecated in v3.11a and removed in v4.50. Use rollback if backward-compatibility required, but it’s better to switch to \glsentryfmt.

+

\glsdisplaynumberlist{entry-label}glossaries v3.02+
+

+Formats the location list for the given entry. Redefined by glossaries-extra-bib2gls to obtain the location list from the location field. §5.2; 189

+

\glsdohyperlink{target}{text}glossaries v4.08+
+

+Creates a hyperlink to the given target using \hyperlink, and includes the debugging information if debug=showtargets. §15.1; 353

+

\glsdohypertarget{target}{text}glossaries v4.08+
+

+Creates a hypertarget, and includes the debugging information if debug=showtargets. This uses \hypertarget but measures the height of text so that the target can be placed at the top of text instead of along the baseline. §15.1; 352

+

\glsdoifexists{entry-label}{code}glossaries
+

+Does code if the entry given by entry-label exists. If the entry doesn’t exist, this will generate an error. §15.4; 357

+

\glsdoifexistsordo{entry-label}{true}{false}glossaries v4.19+
+

+Similar to \ifglsentryexists, this does true if the entry given by entry-label exists. If the entry doesn’t it exist, this does false and generates an error. §15.4; 358

+

\glsdoifexistsorwarn{entry-label}{code}glossaries v4.03+
+

+Like \glsdoifexists, but always warns (no error) if the entry doesn’t exist. §15.4; 358

+

\glsdoifnoexists{entry-label}{code}glossaries
+

+Does code if the entry given by entry-label does not exist. If the entry does exist, this will generate an error. §15.4; 358

+

\glsdonohyperlink{target}{text}glossaries v4.20+
+

+Used instead of \glsdohyperlink when hyperlinks are disabled. This simply expands to text. §15.1; 352

+

\glsdosanitizesort

+

(only available with sort=standard)
+
+

+Sanitizes the sort value if sanitizesort=true. §2.5; 98

+

+

+Enables entry counting. §7.1; 233

+

+

+Enables hyperlinks (may be scoped to localise the effect). §15.1; §5.1.6; 180352

+

+

+Expands to the value of the access field. §17.4; 383

+

+

+Defined by \setentrycounter to its counter argument. §12.1; 269

+

+

+Sets \ifglsentrycounter to false. §2.3; 84

+

+

+Displays the formatted value of the glossaryentry counter or does nothing if entrycounter=false. §2.3; 83

+

\GlsEntryCounterLabelPrefixinitial: glsentry-; glossaries v4.38+
+

+Expands to the prefix used by \glsrefentry. §2.3; 82

+

+

+Sets \ifglsentrycounter to true. §2.3; 84

+

\glsentrycurrcount{entry-label}glossaries v4.14+
+

+Expands to the current entry count running total or 0 if not available (needs to be enabled with \glsenableentrycount). §7.1; 233

+

\Glsentrydesc{entry-label}glossaries
+

+Partially robust command that displays the value of the description field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 186

+

\glsentrydesc{entry-label}glossaries
+

+Simply expands to the value of the description field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the description field doesn’t contain any fragile commands. §5.2; 186

+

+

+Expands to the value of the descaccess field. §17.4; 384

+

\Glsentrydescplural{entry-label}glossaries v1.12+
+

+Partially robust command that displays the value of the descriptionplural field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 186

+

\glsentrydescplural{entry-label}glossaries v1.12+
+

+Simply expands to the value of the descriptionplural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the descriptionplural field doesn’t contain any fragile commands. §5.2; 186

+

+

+Expands to the value of the descpluralaccess field. §17.4; 384

+

\Glsentryfirst{entry-label}glossaries
+

+Partially robust command that displays the value of the first field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 186

+

\glsentryfirst{entry-label}glossaries
+

+Simply expands to the value of the first field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the first field doesn’t contain any fragile commands. §5.2; 185

+

+

+Expands to the value of the firstaccess field. §17.4; 383

+

+

+Partially robust command that displays the value of the firstplural field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 186

+

+

+Simply expands to the value of the firstplural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the firstplural field doesn’t contain any fragile commands. §5.2; 186

+

+

+Expands to the value of the firstpluralaccess field. §17.4; 384

+

+

+The default display format used by the \gls-like commands. This command is redefined by the glossaries-extra package. §5.1.4; 174

+

\GLSentryfull{entry-label}glossaries
+

+As \glsentryfull but all caps.

+

\Glsentryfull{entry-label}glossaries
+

+As \glsentryfull but sentence case. §6.1; 200

+

\glsentryfull{entry-label}glossaries
+

+Displays the singular full form of the acronym identified by entry-label, without hyperlinks or indexing. This command is redefined by acronym styles to match the style format. §6.1; 200

+

\GLSentryfullpl{entry-label}glossaries
+

+As \glsentryfullpl but all caps.

+

\Glsentryfullpl{entry-label}glossaries
+

+As \glsentryfullpl but sentence case. §6.1; 200

+

\glsentryfullpl{entry-label}glossaries
+

+Displays the plural full form of the acronym identified by entry-label, without hyperlinks or indexing. This command is redefined by acronym styles to match the style format. §6.1; 200

+

\glsentryitem{label}glossaries v3.0+
+

+Used for top level (level 0) entries in glossary styles to increment and display the entry counter if entrycounter=true. §13.2.1; 326

+

\Glsentrylong{entry-label}glossaries v3.0+
+

+Displays the value of the long field with sentence case applied. Does nothing if the entry hasn’t been defined. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §6.1; 199

+

\glsentrylong{entry-label}glossaries v3.0+
+

+Simply expands to the value of the long field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the long field doesn’t contain any fragile commands. §6.1; 199

+

+

+Expands to the value of the longaccess field. §17.4; 385

+

\Glsentrylongpl{entry-label}glossaries v3.0+
+

+Displays the value of the longplural field with sentence case applied. Does nothing if the entry hasn’t been defined. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §6.1§7.1; 199236

+

\glsentrylongpl{entry-label}glossaries v3.0+
+

+Simply expands to the value of the longplural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the longplural field doesn’t contain any fragile commands. §6.1; 199

+

+

+Expands to the value of the longpluralaccess field. §17.4; 385

+

\Glsentryname{entry-label}glossaries
+

+Partially robust command that displays the value of the name field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 185

+

\glsentryname{entry-label}glossaries
+

+Simply expands to the value of the name key. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the name key doesn’t contain any fragile commands. §5.2; 185

+

\glsentrynumberlist{entry-label}glossaries v3.02+
+

+Displays the location list for the given entry. Redefined by glossaries-extra-bib2gls to obtain the location list from the location field. §5.2; 188

+

\glsentryparent{entry-label}glossaries v4.45+
+

+Expands to the value of the parent field. Expands to nothing if the parent field hasn’t been set and expands to \relax if the entry hasn’t been defined. §15.5; 364

+

\Glsentryplural{entry-label}glossaries
+

+Partially robust command that displays the value of the plural field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 185

+

\glsentryplural{entry-label}glossaries
+

+Simply expands to the value of the plural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the plural field doesn’t contain any fragile commands. §5.2; 185

+

+

+Expands to the value of the pluralaccess field. §17.4; 384

+

\Glsentryprefix{entry-label}glossaries-prefix v3.14a+
+

+As \glsentryprefix but sentence case. §16; 372

+

\glsentryprefix{entry-label}glossaries-prefix v3.14a+
+

+Expands to the value of the prefix field. §16; 372

+

\Glsentryprefixfirst{entry-label}glossaries-prefix v3.14a+
+

+As \glsentryprefixfirst but sentence case. §16; 372

+

\glsentryprefixfirst{entry-label}glossaries-prefix v3.14a+
+

+Expands to the value of the prefixfirst field. §16; 372

+

+

+As \glsentryprefixfirstplural but sentence case. §16; 373

+

+

+Expands to the value of the prefixfirstplural field. §16; 372

+

\Glsentryprefixplural{entry-label}glossaries-prefix v3.14a+
+

+As \glsentryprefixplural but sentence case. §16; 372

+

\glsentryprefixplural{entry-label}glossaries-prefix v3.14a+
+

+Expands to the value of the prefixplural field. §16; 372

+

\glsentryprevcount{entry-label}glossaries v4.14+
+

+Expands to the final entry count total from the previous LaTeX run or if 0 if not available (needs to be enabled with \glsenableentrycount). §7.1; 234

+

\Glsentryshort{entry-label}glossaries v3.0+
+

+Displays the value of the short field with sentence case applied. Does nothing if the entry hasn’t been defined. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §6.1; 200

+

\glsentryshort{entry-label}glossaries v3.0+
+

+Simply expands to the value of the short field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the short field doesn’t contain any fragile commands. §6.1; 200

+

+

+Expands to the value of the shortaccess field. §17.4; 384

+

\Glsentryshortpl{entry-label}glossaries v3.0+
+

+Displays the value of the shortplural field with sentence case applied. Does nothing if the entry hasn’t been defined. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command.

+

\glsentryshortpl{entry-label}glossaries v3.0+
+

+Simply expands to the value of the shortplural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the shortplural field doesn’t contain any fragile commands.

+

+

+Expands to the value of the shortpluralaccess field. §17.4; 384

+

\glsentrysort{entry-label}glossaries
+

+Simply expands to the value of the sort key. Does nothing if the entry hasn’t been defined. §15.5; 364

+

\Glsentrysymbol{entry-label}glossaries
+

+Partially robust command that displays the value of the symbol field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 187

+

\glsentrysymbol{entry-label}glossaries
+

+Simply expands to the value of the symbol field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the symbol field doesn’t contain any fragile commands. §5.2; 186

+

+

+Expands to the value of the symbolaccess field. §17.4; 384

+

\Glsentrysymbolplural{entry-label}glossaries v1.12+
+

+Partially robust command that displays the value of the symbolplural field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 187

+

\glsentrysymbolplural{entry-label}glossaries v1.12+
+

+Simply expands to the value of the symbolplural field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the symbolplural field doesn’t contain any fragile commands. §5.2; 187

+

+

+Expands to the value of the symbolpluralaccess field. §17.4; 384

+

\Glsentrytext{entry-label}glossaries
+

+Partially robust command that displays the value of the text field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 185

+

\glsentrytext{entry-label}glossaries
+

+Simply expands to the value of the text field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the text field doesn’t contain any fragile commands. §5.2; 185

+

+

+Expands to the value of the textaccess field. §17.4; 383

+

\glsentrytitlecase{entry-label}{field}glossaries v4.22+
+

+Applies title case to the given field using \glscapitalisewords or sentence case in PDF bookmarks. §5.2; 184

+

\glsentrytype{entry-label}glossaries
+

+Simply expands to the value of the type key. Does nothing if the entry hasn’t been defined. §15.5; 364

+

\Glsentryuseri{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user1 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 187

+

\glsentryuseri{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user1 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user1 field doesn’t contain any fragile commands. §5.2; 187

+

\glsentryuseriaccess{entry-label}glossaries-accsupp v4.45+
+

+Expands to the value of the user1access field. §17.4; 385

+

\Glsentryuserii{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user2 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 187

+

\glsentryuserii{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user2 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user2 field doesn’t contain any fragile commands. §5.2; 187

+

\glsentryuseriiaccess{entry-label}glossaries-accsupp v4.45+
+

+Expands to the value of the user2access field. §17.4; 385

+

\Glsentryuseriii{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user3 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 187

+

\glsentryuseriii{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user3 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user3 field doesn’t contain any fragile commands. §5.2; 187

+

+

+Expands to the value of the user3access field. §17.4; 385

+

\Glsentryuseriv{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user4 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 188

+

\glsentryuseriv{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user4 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user4 field doesn’t contain any fragile commands. §5.2; 188

+

\glsentryuserivaccess{entry-label}glossaries-accsupp v4.45+
+

+Expands to the value of the user4access field. §17.4; 385

+

\Glsentryuserv{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user5 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 188

+

\glsentryuserv{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user5 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user5 field doesn’t contain any fragile commands. §5.2; 188

+

\glsentryuservaccess{entry-label}glossaries-accsupp v4.45+
+

+Expands to the value of the user5access field. §17.4; 385

+

\Glsentryuservi{entry-label}glossaries v2.04+
+

+Partially robust command that displays the value of the user6 field with sentence case applied. As from glossaries v4.50, this command can expand in PDF bookmarks. Outside of PDF bookmarks it will expand to a robust internal command. §5.2; 188

+

\glsentryuservi{entry-label}glossaries v2.04+
+

+Simply expands to the value of the user6 field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the user6 field doesn’t contain any fragile commands. §5.2; 188

+

\glsentryuserviaccess{entry-label}glossaries-accsupp v4.45+
+

+Expands to the value of the user6access field. §17.4; 385

+

+

+Expand values when assigning fields during entry definition (except for specific fields that are overridden by \glssetnoexpandfield). §4.4; 147

+

\glsfield-labelaccsupp{replacement}{content}
+

+If defined, used by \glsfieldaccsupp for the accessibility support for the internal field label given by field-label. §17.2; 379

+

\glsfieldaccsupp{replacement}{content}{field-label}{entry-label}glossaries-accsupp v4.45+
+

+If glossaries-extra has been loaded, this command will first check for the existence of the command \glsxtrcategoryfieldaccsupp. If that command doesn’t exist or if glossaries-extra hasn’t been loaded, it then checks for the existence of \glsfieldaccsupp (for example, \glsshortaccsupp). Failing that it will use \glsaccsupp. Whichever command is found first, cs{replacement}{content} is performed. §17.2; 378

+

\glsfielddef{entry-label}{field}{value}glossaries v4.16+
+

+Locally assigns the value to the given field (identified by the internal field label field) for the entry identified by entry-label. Produces an error (or warning with undefaction=warn) if the entry or field doesn’t exist. Note that this doesn’t update any associated fields. §15.5; 366

+

\glsfieldedef{entry-label}{field}{value}glossaries v4.16+
+

+Locally assigns the full expansion of value to the given field (identified by the internal field label field) for the entry identified by entry-label. Produces an error (or warning with undefaction=warn) if the entry or field doesn’t exist. Note that this doesn’t update any associated fields. §15.5; 366

+

\glsfieldfetch{entry-label}{field-label}{cs}glossaries v4.16+
+

+Fetches the value of the given field for the given entry and stores it in the command cs. Triggers an error if the given field (identified by its internal field label) hasn’t been defined. Uses \glsdoifexists. §15.5; 364

+

\glsfieldgdef{entry-label}{field}{value}glossaries v4.16+
+

+As \glsfielddef but does a global assignment.

+

\glsfieldxdef{entry-label}{field}{value}glossaries v4.16+
+

+As \glsfieldedef but does a global assignment. §15.5; 366

+

\glsfindwidesttoplevelname[glossary labels]glossary-tree v4.22+
+

+Finds and sets the widest name for all top-level entries in the given glossaries. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §13.1.7; 318

+

\glsFindWidestUsedLevelTwo[glossary labels]glossaries-extra-stylemods v1.05+
+

+Finds and sets the widest name for all entries that have been marked as used with hierarchical level less than or equal to 2 in the given glossaries.

+

\glsFindWidestUsedTopLevelName[glossary labels]glossaries-extra-stylemods v1.05+
+

+Finds and sets the widest name for all top-level entries that have been marked as used in the given glossaries.

+

\GLSfirst[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsfirst but converts the link text to all caps. §5.1.3; 169

+

\Glsfirst[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsfirst but converts link text to sentence case. §5.1.3; 168

+

\glsfirst[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the first value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. If you have defined the entry with \newacronym consider using \acrfull (or \glsxtrfull with glossaries-extra) for the full form or \acrlong (or \glsxtrlong with glossaries-extra) for the long form instead. §5.1.3; 168

+

\glsfirstabbrvscfont{text}glossaries-extra v1.17+
+

+Short form font used by the small caps “sc” abbreviation styles on first use.

+

\glsfirstaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the firstaccess replacement text (if set).

+

\glsfirstlongfootnotefont{text}glossaries-extra v1.05+
+

+Formatting command for the first use long form used by the footnote abbreviation styles.

+

\GLSfirstplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsfirstplural but converts the link text to all caps. §5.1.3; 170

+

\Glsfirstplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsfirstplural but converts the link text to sentence case. §5.1.3; 169

+

\glsfirstplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the firstplural value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. If you have defined the entry with \newacronym consider using \acrfullpl (or \glsxtrfullpl with glossaries-extra) for the full form or \acrlongpl (or \glsxtrlongpl with glossaries-extra) for the long form instead. For the first optional argument, see \glslink options. §5.1.3; 169

+

\glsfirstpluralaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the firstpluralaccess replacement text (if set). §17.3; 381

+

\glsfmtfirst{entry-label}
+

+For use within captions or section titles to display the formatted first.

+

\Glsfmtlong{entry-label}glossaries-extra
+

+For use within captions or section titles to display the formatted sentence case long form.

+

\glsfmtname{entry-label}
+

+For use within captions or section titles to display the formatted name.

+

\glsfmtshort{entry-label}glossaries-extra
+

+For use within captions or section titles to display the formatted short form.

+

\glsfmttext{entry-label}glossaries-extra
+

+For use within captions or section titles to display the formatted text.

+

+

+The generic acronym display format used by the \gls-like commands. §5.1.4; 177

+

+

+The generic display format used by the \gls-like commands. §5.1.4; 177

+

\glsgetgrouptitle{group-label}glossaries
+

+Robust command that determines the title associated with group-label and displays it. §13.2.1; 329

+

\glsgroupheading{group-label}glossaries

+

(glossary style command)
+
+

+Redefined by glossary styles to show, if applicable, the title associated with the letter group identified by group-label. §13.2.3; 331

+

+

+Redefined by glossary styles to produce a vertical gap between letter groups, if applicable. §13.2.3; 333

+

\glsglossarymarkglossary titleglossaries v2.02+
+

+Sets the header mark for the glossary. §8.2; 245

+

\glshyperfirstfalseglossaries
+

+Sets \ifglshyperfirst to false.

+

\glshyperfirsttrueglossaries
+

+Sets \ifglshyperfirst to true.

+

\glshyperlink[text]{entry-label}glossaries v1.17+
+

+Creates a hyperlink to the given entry with the hyperlink text provided in the optional argument. If omitted, the default is \glsentrytext{entry-label}. §5.2; 184

+

+

+Used as a separator by \glsnavigation. §13.2.2; 330

+

\glshypernumber{location(s)}glossaries
+

+This will encapsulate each location with a hyperlink, if supported. This may be used as a location encap. The argument may be a single location or locations delimited by \delimR or \delimN. This command should not be used outside of location lists as it requires additional information in order to correctly form the hyperlinks. §12.1; 269

+

🗑 \glsifhyper
+

+This was originally used in \glsgenentryfmt to test if the hyper option was set. Deprecated in v4.08 and removed in v4.50. Use \glsifhyperon instead.

+

\glsifhyperon{true}{false}glossaries v4.08+
+

+Defined by the \gls-like commands to expand to true if the hyperlink setting is on for the current reference. Otherwise it expands to false. §5.1.4; 176

+

\glsIfListOfAcronyms{glossary-label}{true}{false}glossaries v2.04+
+

+Does true, if the glossary-label has been identified as a list of acronyms. §2.7; 115

+

\glsifplural{true}{false}glossaries v3.11a+
+

+Defined by the \gls-like commands to expand to true if the calling command was a plural form (for example, \glspl) and to false for the other commands. §5.1.4; 175

+

\glsifusedtranslatordict{Lang}{true}{false}glossaries v4.12+
+

+Does true if translate=true and the glossaries-dictionary-Lang.dict file has been loaded, otherwise does false.

+

\glsignore{text}glossaries v4.12+
+

+Does nothing. When used as a location encap, this signifies to bib2gls that the entry is required but the location shouldn’t be added to the location list. With other indexing methods, this simply creates an invisible location. §12.1; 266

+

+

+Indicates what indexing option has been chosen. §1.3; 9

+

+

+Sets \ifglsindexonlyfirst to false. §2.4; 93

+

+

+Sets \ifglsindexonlyfirst to true. §2.4; 93

+

\glsinlinedescformat{description}{symbol}{location list}glossary-inline v3.03+
+

+Formats the description, symbol and location list for top-level entries. §13.1.9; 324

+

+

+Hook at the start of \glossentry that finishes off the previous child entry, if the current top level (level 0) entry follows a child entry. This command is redefined within \glossentry to use \glsinlinepostchild after a top level (level 0) entry if that entry has any children. §13.1.9; 322

+

\glsinlineemptydescformat{symbol}{location list}glossary-inline v3.03+
+

+Used to format the symbol and location list when the description is suppressed. §13.1.9; 324

+

\glsinlineifhaschildren{entry-label}{true}{false}glossary-inline v4.50+
+

+Used to test if the entry has any children. §13.1.9; 323

+

\glsinlinenameformat{entry-label}{name}glossary-inline v3.03+
+

+Creates the target for top level (level 0) entries and may be used to adjust the format of the name. §13.1.9; 323

+

+

+Separator used between a top level (level 0) parent and its first child entry. §13.1.9; 322

+

+

+Hook used between a top level (level 0) entry and its first sub-entry. §13.1.9; 324

+

+

+Separator used between top level (level 0) entries. §13.1.9; 322

+

\glsinlinesubdescformat{description}{symbol}{location list}glossary-inline v3.03+
+

+Formats the description, symbol and location list for child entries. §13.1.9; 324

+

\glsinlinesubnameformat{entry-label}{name}glossary-inline v3.03+
+

+Creates the target for sub entries and may be used to adjust the format of the name. §13.1.9; 323

+

+

+Separator used between sub-entries. §13.1.9; 322

+

+

+Placeholder command that expands to the insert final optional argument of the \gls-like commands. §5.1.4; 175

+

+

+A token register used by \newacronym (and \newabbreviation) to store the key=value list supplied in the optional argument. §6.2.2; 211

+

+

+Placeholder command that expands to the entry label. §5.1.4; 175

+

+

+A token register used by \newacronym (and \newabbreviation) to store the entry label. §6.2.2; 211

+

\glsletentryfield{cs}{entry-label}{field-label}glossaries v4.07+
+

+Fetches the value of the given field (identified by its internal label field-label) for the entry given by entry-label and stores it in the command cs. §15.5; 365

+

\Glslink[options]{entry-label}{text}modifiers: * + glossaries v4.50+
+

+As \glslink but converts text to sentence case. §5.1.3; 167

+

\glslink[options]{entry-label}{text}modifiers: * +
+

+References the entry identified by entry-label with the given text as the link text. This command does not alter or depend on the first use flag (use \glsdisp instead, if the first use flag needs to be unset). This command is considered a \glstext-like command. For the first optional argument, see \glslink options. §5.1.3; 167

+

+

+Hook used when checking whether or not to switch off hyperlinks on first use. §2.1; 75

+

+

+Hook implemented after setting the options passed to the \gls-like and \glstext-like commands. §5.1.5; 180

+

\glslinkpresetkeysglossaries-extra v1.26+
+

+Hook implemented before setting the options passed to the \gls-like and \glstext-like commands.

+

\glslinkvar{unmodified}{star case}{plus case}glossaries v4.08+
+

+Defined by the \gls-like commands test if the unmodified, starred (*) or plus (+) command was used. §5.1.4; 176

+

+

+A length register used by listdotted. §13.1.1; 299

+

\glslistexpandedname{entry-label}glossary-list v4.48+
+

+Used by \glslistinit to provide better integration with gettitlestring. §13.1.1; 297

+

+

+Used to encapsulate the group title. §13.1.1; 297

+

+

+Used to disable problematic commands at the start the list styles to provide better integration with gettitlestring. §13.1.1; 296

+

\glslistnavigationitem{navigation items}glossary-list v4.22+
+

+Used in styles like listhypergroup to display the navigation line. §13.1.1; 297

+

\glslocalreset{entry-label}glossaries
+

+Locally resets the first use flag. §7; 228

+

\glslocalresetall[glossary labels list]glossaries
+

+Locally resets the first use flag for all entries in whose labels are listed in the glossary labels list comma-separated list. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §7; 228

+

\glslocalunset{entry-label}glossaries
+

+Locally unsets the first use flag. §7; 228

+

\glslocalunsetall[glossary labels list]glossaries
+

+Locally unsets the first use flag for all entries in whose labels are listed in the glossary labels list comma-separated list. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §7; 229

+

\glslocationcstoencap{encap-csname}{location-csname}glossaries v4.50+
+

+Used by makeglossaries when repairing problematic locations with makeindex. §12.5; 281

+

\glslongaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the longaccess replacement text (if set). §17.3; 382

+

\glslongfont{text}glossaries-extra
+

+Font formatting command for the long form, initialised by the abbreviation style.

+

\glslongpluralaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the longpluralaccess replacement text (if set). §17.3; 382

+

+

+A token register used by \newacronym (and \newabbreviation) to store the supplied long form. §6.2.2; 212

+

\glslowercase{text}glossaries v4.50+
+

+Converts text to lowercase using the modern LaTeX3 case-changing command, which is expandable. §15.2; 353

+

+

+Penalty check used by \glspatchLToutput. §13.1.4; 307

+

\glsmakefirstuc{text}mfirstuc v1.05+
+

+Used by \makefirstuc to perform the actual case-change. As from mfirstuc v2.08+ this just uses \MFUsentencecase. Despite the “gls” prefix in the command name, this command is provided by mfirstuc, but dates back to when mfirstuc was part of the glossaries package.

+

\glsmcolsinitial: 2; glossary-mcols v3.05+
+

+Expands to the number of columns for the “mcol” styles. §13.1.8; 320

+

\glsmfuaddmap{cs1}{cs2}glossaries v4.50+ & glossaries-extra v1.49+
+

+If mfirstuc v2.08+ is installed, this will use \MFUaddmap, otherwise it will use \glsmfuexcl instead. See §15.2 for further details. §15.2; 355

+

\glsmfublocker{cs}glossaries v4.50+ & glossaries-extra v1.49+
+

+If mfirstuc v2.08+ is installed, this will use \MFUblocker, otherwise it will use \glsmfuexcl instead. See §15.2 for further details. §15.2; 355

+

\glsmfuexcl{cs}glossaries v4.50+ & glossaries-extra v1.49+
+

+If mfirstuc v2.08+ is installed, this will use \MFUexcl, otherwise it will implement something similar. §15.2; 355

+

\glsmoveentry{entry-label}{target glossary label}glossaries v3.02+
+

+Moves the entry identified by entry-label to the glossary identified by target glossary label. §4.7; 155

+

\GLSname[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsname but converts the link text to all caps. §5.1.3; 170

+

\Glsname[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsname but converts the link text to sentence case. Use \Glossentryname within custom glossary styles instead of this command. §5.1.3; 170

+

\glsname[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the name value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. Use \glossentryname within custom glossary styles instead of this command. §5.1.3; 170

+

\glsnameaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the access replacement text (if set). §17.3; 381

+

+

+Used by \glossentryname to apply a font change to the name. §13; 291

+

\glsnavhyperlink[glossary-label]{group-label}{group-title}glossary-hypernav
+

+Creates a hyperlink to the given group, where the target name is obtained from \glsnavhyperlinkname. §13.2.2; 330

+

\glsnavhyperlinkname[glossary-label]{group-label}glossary-hypernav v4.29+
+

+Expands to the anchor for the given group. §13.2.2; 330

+

\glsnavhypertarget[glossary-label]{group-label}{group-title}glossary-hypernav
+

+Used to create a hyper target for a group in order to support styles that have navigation links to glossary groups. §13.2.2; 329

+

+

+Displays a simple glossary group navigation line with the items separated by \glshypernavsep. §13.2.2; 330

+

+

+Does nothing outside of \printglossary. Within the glossary, this redefines \glossaryentrynumbers to do its argument and then reset itself. §8.2; 250

+

+

+Don’t expand values when assigning fields during entry definition (except for specific fields that are overridden by \glssetexpandfield). §4.4; 148

+

\glsnoidxdisplayloc{prefix}{counter}{format}{location}glossaries v4.04+
+

+Used to display an individual location within the number list when \printnoidxglossary formats the number list. §12.6; 290

+

+

+Handler macro used by \glsdisplaynumberlist with Option 1. §5.2; 189

+

\glsnoidxloclist{list cs}glossaries v4.04+

+

(Options 1 and 4)
+
+

+Displays the location list by iterating over the loclist field with the \glsnoidxloclisthandler handler. §12.6; 288

+

\glsnoidxloclisthandler{location}glossaries v4.04+

+

+
+

+Handler macro used by \glsnoidxloclist. §12.6; 288

+

\glsnoidxnumberlistloophandler{location item}glossaries v4.04+
+

+List loop handler used by \glsnumberlistloop. §12.6; 290

+

\glsnoidxprenumberlist{entry-label}glossaries v4.50+
+

+Used before the number list for Option 1. By default it expands to the value of the prenumberlist internal field, if set. §8.2; 249

+

+

+Does nothing outside of \printglossary. Within the glossary, this redefines \glossaryentrynumbers to ignore its argument and then reset itself. §8.2; 249

+

\glsnumberformat{location(s)}glossaries
+

+The default format for entry locations. If hyperlinks are defined, this will use \glshypernumber otherwise it will simply display its argument, which may be a single location, or locations delimited by \delimR or \delimN. §12.1; 268

+

\glsnumberlistloop{entry-label}{handler}{xr handler cs}glossaries v4.04+
+

+Iterates over the loclist internal field. §12.6; 288

+

\glsnumbersgroupnameinitial: Numbers; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. The title associated with the glsnumbers letter group. Also used as the title for the glossary created with the numbers package option. §1.5.1; Table 1.2

+

+

+Separator used by \glsdisplaynumberlist between the last two locations. §5.2; 189

+

\glsnumlistsepinitial: ,; glossaries v3.02+
+

+Separator used by \glsdisplaynumberlist between all but the last two locations. §5.2; 189

+

+

+Expands to (a literal open brace). §14; 337

+

+

+A length register used to set the width of the location list column for tabular-like styles. §13.1; 293

+

+

+Paragraph break (for instances where \par can’t be used directly). §4; 128

+

\glspatchLToutputglossary-longbooktabs v4.21+
+

+Applies a patch to longtable to check for instances of the group skip occurring at a page break.

+

+

+Patches tabularx (if it has been loaded) to prevent the first use flag from being unset while tabularx is calculating the column widths. §5.1.2; 164

+

+

+The definition of \glsgroupskip with nogroupskip=false for the glossary-longbooktabs styles. §13.1.4; 307

+

+

+Expands to (a literal percent character). §14; 337

+

\GLSpl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glspl but converts the link text to all caps. §5.1.2; 165

+

\Glspl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glspl but converts the link text to sentence case. §5.1.2; 165

+

\glspl[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \gls but uses the relevant plural form. §5.1.2; 165

+

\GLSplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsplural but converts the link text to all caps. §5.1.3; 169

+

\Glsplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glsplural but converts the link text to sentence case. §5.1.3; 169

+

\glsplural[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the plural value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. If you have defined the entry with \newacronym consider using \acrshortpl (or \glsxtrshortpl with glossaries-extra) instead. §5.1.3; 169

+

\glspluralaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the pluralaccess replacement text (if set). §17.3; 381

+

+

+Suffix used to obtain default plurals. §4.1; 137

+

+

+A hook that is usually placed after the description in glossary styles. Some of the styles provided with the glossaries package don’t use this hook. The glossaries-extra-stylemods redefines those styles to include the hook. The default definition of this command tests for the nopostdot option, but the postpunc option redefines the command to implement the chosen punctuation. §2.3§13.1; 90295

+

+

+Used at the end of the theglossary environment. §13.1.9; 322

+

\glspostinlinedescformat{description}{symbol}{location list}glossary-inline v3.03+
+

+Formats the top-level entry’s description, symbol and location list.

+

\glspostinlinesubdescformat{description}{symbol}{location list}glossary-inline v3.03+
+

+Formats the child entry’s description, symbol and location list.

+

+

+A post-link hook used after all the \gls-like and \glstext-like commands. This is redefined by glossaries-extra to use \glsxtrpostlinkhook. §5.1.5; 180

+

\glsprefixsepinitial: empty; glossaries-prefix v4.45
+

+Separator between the prefix and the term. §16; 369

+

\glsprestandardsort{sort cs}{type}{entry-label}glossaries v3.13a+
+

+Hook used with sort=standard to adjust the default sort value (with \makeglossaries or \makenoidxglossaries only). §2.5; 98

+

\glsps{entry-label}glossaries-extra v1.07+
+

+Shortcut for \glsxtrp{short}{entry-label}.

+

\glspt{entry-label}glossaries-extra v1.07+
+

+Shortcut for \glsxtrp{text}{entry-label}.

+

+

+Expands to "text", where the " is a literal character. §14; 338

+

\glsrefentry{label}glossaries v3.0+
+

+For use with entrycounter and subentrycounter, this references the value of the glossaryentry or glossarysubentry counter associated with the glossary entry identified by label. If entrycounter=false and subentrycounter=false, this simply uses \gls otherwise it uses \ref. §2.3; 82

+

\glsreset{entry-label}glossaries
+

+Globally resets the first use flag. §7; 228

+

\glsresetall[glossary labels list]glossaries
+

+Globally resets the first use flag for all entries in whose labels are listed in the glossary labels list comma-separated list. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §7; 228

+

+

+Sets the \ifglsresetcurrcount conditional to \iffalse. §7.1; 233

+

+

+Sets the \ifglsresetcurrcount conditional to \iftrue. §7.1; 233

+

+

+Resets glossaryentry back to zero if entrycounter=true. §2.3; 83

+

+

+Resets \glossaryentrynumbers. §8.2; 249

+

+

+Resets glossarysubentry back to zero if entrycounter=true. §2.3; 85

+

+

+Reverses the effect of \glspatchLToutput. §13.1.4; 307

+

\glssee[tag]{entry-label}{xr-list}glossaries v1.17+
+

+Indexes the entry identified by entry-label as a general cross-reference to the entries identified in the comma-separated list xr-list. The optional argument is the textual tag that’s inserted before the cross-reference list and defaults to \seename. §11; 259

+

\glsseeformat[tag]{xr-list}{location}glossaries v1.17+
+

+Used to format the see cross-reference in the location list. This requires a location argument for makeindex even though it isn’t required. The default definition is \emph{tag} \glsseelist{xr-list}. §11.1; 262

+

\glsseeitem{entry-label}glossaries v1.17+
+

+Used by \glsseelist to format each entry item. This adds a hyperlink, if enabled, to the appropriate entry line in the glossary with the text obtained with \glsseeitemformat. §11.1; 263

+

\glsseeitemformat{entry-label}glossaries v3.0+
+

+Used by \glsseeitem to produce the hyperlink text. §11.1; 263

+

\glsseelastsepinitial: ,; glossaries v1.17+
+

+Used by \glsseelist as a separator between the final pair. §11.1; 263

+

\glsseelist{label-list}glossaries v1.17+
+

+Iterates over a comma-separated list of entry labels label-list and formats them. Each label in the list is encapsulated with \glsseeitem. The separators are \glsseelastsep (between the penultimate and last items) and \glsseesep (between all the other items). §11.1; 263

+

\glsseesepinitial: ,; glossaries v1.17+
+

+Used by \glsseelist as a separator between each entry except the last pair. §11.1; 263

+

\glssentencecase{text}glossaries v4.50+ & glossaries-extra v1.49+
+

+Used by sentence case commands, such as \Gls, to perform the case change. This is simply defined to use \makefirstuc. §15.2; 354

+

\glsSetAlphaCompositor{character}glossaries v1.17+

+

(xindy only)
+
+

+Sets the compositor for locations that start with an uppercase alphabetical character. §3.2; 125

+

\glssetcategoryattribute{category}{attribute}{value}glossaries-extra
+

+Locally sets the given attribute to value for the given category.

+

\glsSetCompositor{character}glossaries v1.17+
+

+Sets the location compositor for the indexing style file created by \makeglossaries. §3.2; 124

+

\glssetexpandfield{field}glossaries v3.13a+
+

+Indicates that the given field should always have its value expanded when the entry is defined. This overrides \glsnoexpandfields. §4.4; 147

+

\glssetnoexpandfield{field}glossaries v3.13a+
+

+Indicates that the given field should always have its value expanded when the entry is defined. This overrides \glsexpandfields. §4.4; 147

+

\GlsSetQuote{character}glossaries v4.24+

+

(makeindex only)
+
+

+Set makeindex’s quote character (used for escaping special characters) to character. §1.5; 43

+

\glsSetSuffixF{suffix}glossaries v1.17+
+

+The suffix for two consecutive locations. §12.2; 272

+

\glsSetSuffixFF{suffix}glossaries v1.17+
+

+The suffix for three or more consecutive locations. §12.2; 272

+

\glssettoctitle{glossary-type}glossaries
+

+Used by \printglossary to set the table of contents title for the given glossary if a title hasn’t been supplied with toctitle or title. §8.2; 247

+

\glssetwidest[level]{name}glossary-tree
+

+Indicates that name is the widest name for the given hierarchical level. §13.1.7; 318

+

+

+Adds code to the indexing style file. §3.2; 123

+

\GlsSetXdyCodePage{codepage}glossaries v1.17+

+

+
+

+Sets the xindy codepage. This information is written to the aux file for makeglossaries to pick up. It has no effect if xindy is called explicitly. §14.2; 340

+

\GlsSetXdyFirstLetterAfterDigits{letter}modifier: * glossaries v1.17+

+

(xindy only)
+
+

+Identifies the first letter group to occur after the number group. §14.4; 350

+

\GlsSetXdyLanguage[glossary-type]{language}glossaries v1.17+

+

+
+

+Sets the xindy language for the given glossary. This information is written to the aux file for makeglossaries to pick up. It has no effect if xindy is called explicitly. §14.2; 339

+

\GlsSetXdyLocationClassOrder{location names}glossaries v1.17+

+

(xindy only)
+
+

+May be used to change the ordering of location class names. §14.3; 349

+

\GlsSetXdyMinRangeLength{value}glossaries v1.17+

+

(xindy only)
+
+

+Sets the minimum number of consecutive locations to form an implicit range. The value may be “none” to indicate no range formation. §14.3; 349

+

\GlsSetXdyNumberGroupOrder{relative location}modifier: * glossaries v4.33+

+

(xindy only)
+
+

+Sets the relative location of the number group. §14.4; 351

+

\GlsSetXdyStyles{style name list}glossaries v1.17+

+

(xindy only)
+
+

+Resets the list of required xindy files. §14.1; 338

+

\glsshortaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the shortaccess replacement text (if set). §17.3; 382

+

\glsshortaccsupp{replacement}{content}glossaries-accsupp v4.45+
+

+Applies replacement as the expansion (E) attribute for content using \glsaccessibility for the short field. §17.2; 379

+

\glsshortplaccsupp{replacement}{content}glossaries-accsupp v4.45+
+

+Applies replacement as the expansion (E) attribute for content using \glsaccessibility for the shortplural field. §17.2; 379

+

\glsshortpluralaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the shortpluralaccess replacement text (if set). §17.3; 382

+

+

+A token register used by \newacronym (and \newabbreviation) to store the supplied short form. §6.2.2; 211

+

\glsshowaccsupp{options}{PDF element}{value}glossaries v4.45+
+

+Used by \glsshowtarget in outer mode. §2.1; 71

+

\glsshowtarget{target name}glossaries v4.32+
+

+Used with debug=showtargets to show the target. §2.1; 70

+

\glsshowtargetfontinitial: \ttfamily\footnotesize; glossaries v4.45+
+

+Used by \glsshowtargetfonttext and \glsshowtargetouter to set the font. §2.1; 71

+

+

+Used by \glsshowtargetinner to set the font. §2.1; 71

+

\glsshowtargetinner{target name}glossaries v4.50+
+

+Used by \glsshowtarget in math mode and inner mode. §2.1; 70

+

\glsshowtargetouter{target name}glossaries v4.45+
+

+Used by \glsshowtarget in outer mode. §2.1; 71

+

\glsshowtargetsymbol{target name}glossaries v4.45+
+

+Used by \glsshowtargetouter to mark the target. §2.1; 71

+

\glssortnumberfmt{number}glossaries v3.0+
+

+Expands to the given number zero-padded to six digits. §2.5; 98

+

\glsstepentry{label}glossaries v3.0+
+

+Increments glossaryentry with \refstepcounter if entrycounter=true. §2.3; 83

+

\glsstepsubentry{label}glossaries v3.0+
+

+Increments glossarysubentry with \refstepcounter if subentrycounter=true. §2.3; 85

+

+

+Sets \ifglssubentrycounter to false. §2.3; 86

+

+

+Displays the formatted value of the glossarysubentry counter or does nothing if subentrycounter=false. §2.3; 86

+

+

+Sets \ifglssubentrycounter to true. §2.3; 86

+

\glssubentryitem{label}glossaries v3.0+
+

+Used for level 1 entries in glossary styles to increment and display the sub-entry counter if subentrycounter=true. §13.2.1; 326

+

\glssubgroupheading{previous level}{level}{parent-label}{group-label}glossaries-extra v1.49+

+

(glossary style command)
+
+

+Used to format sub-group headings.

+

\GLSsymbol[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glssymbol but converts the link text to all caps. §5.1.3; 171

+

\Glssymbol[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glssymbol but converts the link text to sentence case. Use \Glossentrysymbol within custom glossary styles instead of this command. §5.1.3; 171

+

\glssymbol[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the symbol value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. Use \glossentrysymbol within custom glossary styles instead of this command. §5.1.3; 170

+

\glssymbolaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the symbolaccess replacement text (if set). §17.3; 381

+

+

+Produces a simple navigation set of links for just the symbols and number groups separated by \glshypernavsep. §13.2.2; 330

+

\GLSsymbolplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glssymbolplural but converts the link text to all caps.

+

\Glssymbolplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glssymbolplural but converts the link text to sentence case.

+

\glssymbolplural[options]{entry-label}[insert]modifiers: * + glossaries v1.12+
+

+As \glssymbol but for the symbolplural field.

+

+

+Does text with the symbolpluralaccess replacement text (if set). §17.3; 381

+

\glssymbolsgroupnameinitial: Symbols; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. The title associated with the glssymbols letter group. Also used as the title for the glossary created with the symbols package option. §1.5.1; Table 1.2

+

\glstarget{entry-label}{text}glossaries v1.18+
+

+Used by glossary styles to create a hypertarget (if enabled) for the entry (identified by entry-label). The text is usually \glossentryname{entry-label}, but it can be something else. §13.2.1; 327

+

\glstexorpdfstring{TeX}{PDF}glossaries v4.50+
+

+If hyperref has been loaded, this uses \texorpdfstring otherwise it just expands to TeX. §15.1; 353

+

\GLStext[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glstext but converts the link text to all caps. §5.1.3; 168

+

\Glstext[options]{entry-label}[insert]modifiers: * + glossaries
+

+As \glstext but converts the first character of the link text to sentence case. §5.1.3; 168

+

\glstext[options]{entry-label}[insert]modifiers: * + glossaries
+

+References the entry identified by entry-label. The text produced is obtained from the text value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. If you have defined the entry with \newacronym consider using \acrshort for the short form (or \glsxtrshort with glossaries-extra). For the first optional argument, see \glslink options. §5.1.3; 168

+

\glstextaccessdisplay{text}{entry-label}glossaries-accsupp
+

+Does text with the textaccess replacement text (if set). §17.3; 381

+

\glstextformat{text}glossaries v1.04+
+

+Used by the \gls-like and \glstext-like commands to format the link text. §5.1; 160

+

\glstextup{text}glossaries v3.09a+
+

+If \textulc is defined, this will use that command, otherwise it will use \textup to cancel the effect of the small caps font command \textsc. §6.2.1; 205

+

+

+Expands to ~ (a literal tilde character). §14; 337

+

+

+Sets \ifglstoc to false. §2.2; 78

+

+

+Sets \ifglstoc to true. §2.2; 78

+

+

+Space inserted before child descriptions. §13.1.7; 315

+

+

+Used to format the group title for the treegroup and indexgroup styles. §13.1.7; 314

+

+

+Length register used by the tree style. §13.1.7; 317

+

+

+Used to indent the top-level entries for the index styles. §13.1.7; 315

+

\glstreenamebox{width}{text}glossary-tree v4.19+
+

+Creates the box for the name with styles like alttree. §13.1.7; 319

+

\glstreenamefmt{text}glossary-tree v4.08+
+

+Used to format the name for the tree and index styles. §13.1.7; 314

+

+

+Used to format the navigation element for styles like treehypergroup. §13.1.7; 315

+

+

+Space inserted before top-level descriptions. §13.1.7; 315

+

+

+Used to indent the level 1 entries for the index styles. §13.1.7; 316

+

+

+Used to indent the level 2 entries for the index styles. §13.1.7; 316

+

+

+Placeholder command that expands to the entry’s glossary type. §5.1.4; 175

+

\glsucmarkfalseglossaries v3.02+
+

+Sets \ifglsucmark to false.

+

\glsucmarktrueglossaries v3.02+
+

+Sets \ifglsucmark to true.

+

\glsunexpandedfieldvalue{entry-label}{field-label}glossaries v4.48+
+

+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 internal field label. Expands to nothing with no error or warning if the entry or field aren’t defined. §15.5; 365

+

\glsunset{entry-label}glossaries
+

+Globally unsets the first use flag. §7; 228

+

\glsunsetall[glossary labels list]glossaries
+

+Globally unsets the first use flag for all entries in whose labels are listed in the glossary labels list comma-separated list. If the optional argument is omitted, the list of all non-ignored glossaries is assumed. §7; 229

+

+

+Suffix used to obtain the default shortplural value with the base small caps acronym styles. §6.2.1; 205

+

\glsuppercase{text}glossaries v4.50+
+

+Converts text to uppercase using the modern LaTeX3 case-changing command, which is expandable. §15.2; 353

+

\GlsUseAcrEntryDispStyle{style-name}glossaries v4.02+
+

+Implements the entry format part of the given acronym style (the code supplied in the format def argument of \newacronymstyle). §6.2.2; 212

+

\GlsUseAcrStyleDefs{style-name}glossaries v4.02+
+

+Implements the style definitions part of the given acronym style (the code supplied in the display defs argument of \newacronymstyle). §6.2.2; 212

+

\GLSuseri[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseri but converts the link text to all caps. §5.1.3; 172

+

\Glsuseri[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseri but converts the link text to sentence case. §5.1.3; 171

+

\glsuseri[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user1 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 171

+

\glsuseriaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user1access replacement text (if set). §17.3; 382

+

\GLSuserii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuserii but converts the link text to all caps. §5.1.3; 172

+

\Glsuserii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuserii but converts the link text to sentence case. §5.1.3; 172

+

\glsuserii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user2 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 172

+

\glsuseriiaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user2access replacement text (if set). §17.3; 382

+

\GLSuseriii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseriii but converts the link text to all caps. §5.1.3; 172

+

\Glsuseriii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseriii but converts the link text to sentence case. §5.1.3; 172

+

\glsuseriii[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user3 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 172

+

\glsuseriiiaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user3access replacement text (if set). §17.3; 382

+

\GLSuseriv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseriv but converts the link text to all caps. §5.1.3; 173

+

\Glsuseriv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuseriv but converts the link text to sentence case. §5.1.3; 173

+

\glsuseriv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user4 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 172

+

\glsuserivaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user4access replacement text (if set). §17.3; 383

+

\GLSuserv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuserv but converts the link text to all caps. §5.1.3; 173

+

\Glsuserv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuserv but converts the link text to sentence case. §5.1.3; 173

+

\glsuserv[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user5 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 173

+

\glsuservaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user5access replacement text (if set). §17.3; 383

+

\GLSuservi[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuservi but converts the link text to all caps. §5.1.3; 173

+

\Glsuservi[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+As \glsuservi but converts the link text to sentence case. §5.1.3; 173

+

\glsuservi[options]{entry-label}[insert]modifiers: * + glossaries v2.04+
+

+References the entry identified by entry-label. The text produced is obtained from the user6 value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options. §5.1.3; 173

+

\glsuserviaccessdisplay{text}{entry-label}glossaries-accsupp v4.45+
+

+Does text with the user6access replacement text (if set). §17.3; 383

+

+

+Sets \ifglswrallowprimitivemods to false. §2.4; 92

+

+

+Sets \ifglswrallowprimitivemods to true. §2.4; 92

+

+

+Hook used to locally disable problematic commands whilst constructing the anchor for \glshypernumber. §12.1; 270

+

+

+Hook used to locally disable problematic commands whilst writing the location to the indexing file with Options 2 and 3. §12.3; 275

+

+

+Must be expandable. May be used to alter the location suffix whilst constructing the anchor for \glshypernumber. §12.1; 270

+

+

+Used to encapsulate the location in the hyperlink text for \glshypernumber. §12.1; 269

+

+

+The write register used to create the indexing style file. §3.2; 123

+

\glswritedefhookglossaries v3.10a
+

+Hook used when writing entries to the glsdefs file after all the key=value information has been written and before the end brace that closes the final argument of \glsdefs@newdocentry.

+

\glswriteentry{label}{indexing code}glossaries v4.16+
+

+Does indexing code unless indexonlyfirst=true and the entry identified by label has been marked as used. §2.4; 93

+

\glsXcounterXformat{H-prefix}{location}

+

(xindy only)
+
+

+Used with xindy for location formats. §14.3; 341

+ +

+ +
+

Glsxtr

+ +

+This command is written to the aux file for the benefit of makeglossaries and makeglossaries-lite. §1.7.1; 65

+

\glsxtr@record{label}{h-prefix}{counter}{format}{loc}glossaries-extra v1.08+
+

+This command is written to the aux file to provide the indexing information for bib2gls. §1.7.3; 67

+

\glsxtr@record@nameref{label}{href prefix}{counter}{format}{location}{title}{href anchor}{href value}glossaries-extra v1.37+
+

+This command is written to the aux file to provide the indexing information for bib2gls when the record=nameref option is used. §1.7.3; 67

+

\glsxtr@recordsee{label}{xr list}glossaries-extra v1.14+
+

+This command is written to the aux file to provide the \glssee information for bib2gls. §1.7.3; 68

+

\glsxtr@resource{options}{basename}glossaries-extra v1.08+
+

+This command is written to the aux file to provide the resource options for bib2gls. §1.7.3; 67

+

\glsxtr@texencoding{encoding}glossaries-extra v1.11+
+

+This command is written to the aux file to provide the file encoding information for bib2gls.

+

\glsxtrabbrvfootnote{entry-label}{text}glossaries-extra v1.07+
+

+Command that produces the footnote for the footnote abbreviation styles, such as footnote and postfootnote.

+

\glsxtrabbrvtypeinitial: \glsdefaulttype; glossaries-extra
+

+Expands to the label of the default abbreviation glossary. The abbreviations package option will redefine this to abbreviations.

+

\glsxtrbookindexname{entry-label}glossary-bookindex v1.21+
+

+Used by the bookindex style to display a top-level entry’s name.

+

\glsxtrcategoryaccsupp{replacement}{content}
+

+If defined, used by \glsfieldaccsupp for the accessibility support for the category identified by category.

+

\glsxtrcategoryfieldaccsupp{replacement}{content}
+

+If defined, used by \glsfieldaccsupp for the accessibility support for the category identified by category and the internal field label given by field.

+

\glsxtrcopytoglossary{entry-label}{glossary-type}modifier: * glossaries-extra v1.12+
+

+Copies the entry to the internal glossary list for the given glossary. The starred version performs a global change. The unstarred version can be localised. Only for use with the “unsrt” family of commands.

+

\glsxtrcounterlocfmt{location}{title}
+

+If defined, used with record=name to format locations associated with counter.

+

\glsxtrdopostpunc{code}tokenglossaries-extra v1.49+
+

+If token is a recognised punctuation character this does the punctuation character and then code, otherwise if does code followed by token.

+

\glsxtrfieldforlistloop{entry-label}{field}{handler-cs}glossaries-extra v1.12+
+

+Iterates over the given field’s value using etoolbox’s \forlistcsloop.

+

\glsxtrfieldformatlist{entry-label}{field-label}glossaries-extra v1.42+
+

+Formats the value of the given field, which should be an etoolbox internal list, using the same list handler macro as datatool’s \DTLformatlist.

+

\glsxtrfmt[options]{entry-label}{text}glossaries-extra v1.12+
+

+Behaves like \glslink[options]{entry-label}{\csname{text}insert} where the control sequence name csname is obtained from a designated field.

+

\GlsXtrFmtFieldinitial: useri; glossaries-extra v1.12+
+

+Expands to the name of the used by \glsxtrfmt.

+

\glsxtrfootnotedescnameglossaries-extra v1.42+
+

+Expands to the name value for styles like short-footnote-desc.

+

\glsxtrfootnotedescsortglossaries-extra v1.42+
+

+Expands to the sort value for footnote styles like short-footnote-desc.

+

\glsxtrforcsvfield{entry-label}{field-label}{handler cs}modifier: * glossaries-extra v1.24+
+

+Iterates over the comma-separated list stored in the given field (identified by its internal label) for the entry identified by entry-label and performs handler cs{element} for each element of the list.

+

\GLSxtrfull[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrfull but converts the link text to all caps.

+

\Glsxtrfull[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrfull but converts the link text to sentence case.

+

\glsxtrfull[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+References the abbreviation identified by entry-label. The text produced is obtained from the short and long values, formatted according to the abbreviation style associated with the entry’s category. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. The format produced by this command may not match the format produced by the first use of \gls{entry-label}, depending on the abbreviation style.

+

\GLSxtrfullpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrfullpl but converts the link text to all caps.

+

\Glsxtrfullpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrfullpl but converts the link text to sentence case.

+

\glsxtrfullpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrfull but for the plural form.

+

\glsxtrfullsep{entry-label}glossaries-extra
+

+Separator used by the parenthetical inline full and also for some display full forms.

+

\glsxtrGeneralInitRulesglossaries-extra-bib2gls v1.49+
+

+A shortcut that expands to the ignorable rules, combining diacritic rules, hyphen rules, general punctuation rules, digit rules, and fraction rules.

+

\glsxtrGeneralLatinAtoGrulesglossaries-extra-bib2gls v1.49+
+

+Expands to the A–G subset of General Latin I sort rules.

+

\glsxtrGeneralLatinNtoZrulesglossaries-extra-bib2gls v1.49+
+

+Expands to the N–Z subset of General Latin I sort rules.

+

\glsxtrgetgrouptitle{group-label}{cs}glossaries-extra v1.14+
+

+Obtains the title corresponding to the group identified by group-label and stores the result in the control sequence cs.

+

\glsxtrglossentry{entry-label}glossaries-extra v1.21+
+

+Used for standalone entries to display the name with \glossentryname, with appropriate hooks.

+

\glsxtrhiername{entry-label}glossaries-extra v1.37+
+

+Displays the entry’s hierarchical name.

+

\GlsXtrIfFieldEqNum{field-label}{entry-label}{number}{true}{false}modifier: * glossaries-extra v1.31+
+

+Compares the numeric value stored in the given field with number.

+

\GlsXtrIfFieldEqStr{field-label}{entry-label}{value}{true}{false}modifier: * glossaries-extra v1.21+
+

+Tests if the entry given by entry-label has the field identified by its internal label field-label set to value.

+

\GlsXtrIfFieldNonZero{field-label}{entry-label}{true}{false}modifier: * glossaries-extra v1.31+
+

+Tests if the numeric value stored in the given field is non-zero.

+

\GlsXtrIfFieldUndef{field-label}{entry-label}{true}{false}glossaries-extra v1.23+
+

+Expandable command that tests if the given field (identified by its internal label) is undefined for the entry given by entry-label. Internally uses etoolbox’s \ifcsundef command.

+

\glsxtrifhasfield{field-label}{entry-label}{true}{false}modifier: * glossaries-extra v1.19+
+

+Tests if the field identified by its internal label field-label for the entry given by entry-label is defined and is not empty. This is like \ifglshasfield but doesn’t produce a warning if the entry or field doesn’t exist. This sets \glscurrentfieldvalue to the field value and does true if its defined and not empty, otherwise it does false. The unstarred version adds implicit grouping to make nesting easier. The starred version doesn’t (to make assignments easier).

+

\GlsXtrIfHasNonZeroChildCount{entry-label}{true}{false}modifier: * glossaries-extra-bib2gls v1.47+
+

+Tests if the value in the childcount field is non-zero (using \GlsXtrIfFieldNonZero). This requires the save-child-count resource option.

+

\GlsXtrIfUnusedOrUndefined{entry-label}{true}{false}glossaries-extra v1.34+
+

+Does true if the entry hasn’t been defined or hasn’t been marked as used, otherwise does true. Note that this command will generate an error or warning (according to undefaction) if the entry hasn’t been defined, but will still do true. §15.4; 358

+

\glsxtrifwasfirstuse{true}{false}glossaries-extra
+

+Initialised by the \gls-like and \glstext-like commands, this expands to true if the calling command was considered the first use, otherwise it expands to false. This command may be used within the post-link hook (where it’s too late to test the first use flag with \ifglsused).

+

\GlsXtrIfXpFieldEqXpStr{field-label}{entry-label}{value}{true}{false}modifier: * glossaries-extra v1.31+
+

+Like \GlsXtrIfFieldEqStr but first (protected) expands both the field value and the supplied value.

+

\glsxtrIgnorableRulesglossaries-extra-bib2gls v1.49+
+

+A shortcut that expands to the control rules, space rules and non-printable rules.

+

\Glsxtrinlinefullformat{entry-label}{insert}
+

+Used by \Glsxtrfull to display the sentence case inline full form (defined by the abbreviation style).

+

\glsxtrinlinefullformat{entry-label}{insert}glossaries-extra
+

+Used by \glsxtrfull to display the inline full form (defined by the abbreviation style).

+

\Glsxtrinlinefullplformat{entry-label}{insert}glossaries-extra
+

+Used by \Glsxtrfullpl to display the plural sentence case inline full form (defined by the abbreviation style).

+

\glsxtrinlinefullplformat{entry-label}{insert}glossaries-extra
+

+Used by \glsxtrfullpl to display the plural inline full form (defined by the abbreviation style).

+

\GlsXtrLoadResources[options]glossaries-extra v1.11+
+

+For use with bib2gls, this both sets up the resource options (which bib2gls can detect from the aux file) and inputs the glstex file created by bib2gls.

+

\glsxtrlocalsetgrouptitle{group-label}{group-title}glossaries-extra v1.24+
+

+Locally assigns the given title group-title to the group identified by group-label.

+

\GLSxtrlong[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrlong but converts the link text to all caps.

+

\Glsxtrlong[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrlong but converts the link text to sentence case.

+

\glsxtrlong[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+References the abbreviation identified by entry-label. The text produced is obtained from the long value, formatted according to the abbreviation style associated with the entry’s category. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag.

+

\GLSxtrlongpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrlongpl but converts the link text to all caps.

+

\Glsxtrlongpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrlongpl but converts the link text to sentence case.

+

\glsxtrlongpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrlong but the text produced is obtained from the longplural value.

+

\glsxtrnewgls[default-options]{prefix}{cs}glossaries-extra v1.21+
+

+Defines the command cs[options]{entry-label} to behave like \gls[default-options,options]{prefixentry-label}.

+

\glsxtrnewglslike[default-options]{prefix}{\gls-like cs}{\glspl-like cs}{\Gls-like cs}{\Glspl-like cs}glossaries-extra v1.21+
+

+Like \glsxtrnewgls but provides plural and sentence case commands as well.

+

\glsxtrnewnumber[key=value list]{entry-label}{num}glossaries-extra

+

(requires \usepackage[numbers]{glossaries-extra})
+
+

+Defines a new glossary entry with the given label, type set to numbers, the category set to number, the name set to num and the sort set to entry-label. The optional argument is a comma-separated list of glossary entry keys, which can be used to override the defaults.

+

\glsxtrnewsymbol[key=value list]{entry-label}{sym}glossaries-extra

+

(requires \usepackage[symbols]{glossaries-extra})
+
+

+Defines a new glossary entry with the given label, type set to symbols, the category set to symbol, the name set to sym and the sort set to entry-label. The optional argument is a comma-separated list of glossary entry keys, which can be used to override the defaults.

+

\glsxtrnopostpuncglossaries-extra v1.22+
+

+When placed at the end of the description, this switches off the post-description punctuation (inserted automatically via options such as postdot) but doesn’t suppress the post-description hook. Does nothing outside of the glossary.

+

\glsxtrp{field}{entry-label}glossaries-extra v1.07+
+

+For use in headings and captions (instead of the \gls-like or \glstext-like commands). This command is designed to expand to the field value if used in a PDF bookmark and can also expand to a more appropriate command if it ends up in the page header. Note that there’s no option argument.

+

\glsxtrparen{text}glossaries-extra v1.17+
+

+Used to encapsulate text in parentheses.

+

\glsxtrpostlinkAddSymbolOnFirstUseglossaries-extra
+

+May be used within a post-link hook to display the symbol in parentheses on first use.

+

\glsxtrpostlinkhookglossaries-extra v1.0+
+

+An additional post-link hook that supports categories.

+

\GlsXtrResetLocalBufferglossaries-extra v1.49+
+

+If local unset for repeat entries has been enabled with \GlsXtrUnsetBufferEnableRepeatLocal, this will locally reset all entries that are in the buffer that hadn’t been marked as used before the function was enabled.

+

\GlsXtrSetAltModifier{token}{options}
+

+Sets token as a modifier for the \gls-like and \glstext-like commands that will automatically implement the given options.

+

\GlsXtrSetField{entry-label}{field-label}{value}glossaries-extra v1.12+
+

+Assigns value to the field identified by its internal label field-label for the entry identified by entry-label. An error (or warning with undefaction=warn) occurs if the entry hasn’t been defined.

+

\glsxtrsetgrouptitle{group-label}{group-title}glossaries-extra v1.14+
+

+Globally assigns the given title group-title to the group identified by group-label.

+

\GlsXtrSetPlusModifier{options}glossaries-extra v1.49+
+

+Overrides the options that should be implemented by the plus (+) modifier for \gls-like and \glstext-like commands.

+

\GlsXtrSetStarModifier{options}glossaries-extra v1.49+
+

+Overrides the options that should be implemented by the star (*) modifier for \gls-like and \glstext-like commands.

+

\GLSxtrshort[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrshort but converts the link text to all caps.

+

\Glsxtrshort[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrshort but converts the link text to sentence case.

+

\glsxtrshort[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+References the abbreviation identified by entry-label. The text produced is obtained from the short value, formatted according to the abbreviation style associated with the entry’s category. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. For the first optional argument, see \glslink options.

+

\Glsxtrshortpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrshortpl but converts the link text to sentence case.

+

\glsxtrshortpl[options]{entry-label}[insert]modifiers: * + glossaries-extra
+

+As \glsxtrshort but the text produced is obtained from the shortplural value.

+

\GlsXtrStartUnsetBufferingmodifier: * glossaries-extra v1.30+
+

+Enables unset buffering. The starred version doesn’t check for duplicates.

+

\GlsXtrStopUnsetBufferingmodifier: * glossaries-extra v1.30+
+

+Stops buffering. The starred version performs a global unset.

+

\GlsXtrUnsetBufferEnableRepeatLocalglossaries-extra v1.49+
+

+Allows repeat entries within the buffering code to be locally unset before the link text.

+

\GlsXtrUseAbbrStyleFmts{style-name}glossaries-extra
+

+Implements the display definitions code for the given abbreviation style.

+

\GlsXtrUseAbbrStyleSetup{style-name}glossaries-extra
+

+Implements the setup code for the given abbreviation style.

+

\glsxtrusefield{entry-label}{field-label}glossaries-extra v1.12+
+

+Expands to the value of the given field (identified by its internal label field-label) for the entry given by entry-label. Expands to \relax if the entry or field are undefined.

+ +

+ +
+

H

+
\hyperbf{location(s)}glossaries
+

+If hyperlinks are supported this does \textbf{\glshypernumber{location(s)}} otherwise it just does \textbf{location(s)}. Table 12.1

+

\hyperemph{location(s)}glossaries
+

+If hyperlinks are supported this does \emph{\glshypernumber{location(s)}} otherwise it just does \emph{location(s)}. Table 12.1

+

\hyperit{location(s)}glossaries
+

+If hyperlinks are supported this does \textit{\glshypernumber{location(s)}} otherwise it just does \textit{location(s)}. Table 12.1

+

\hypermd{location(s)}glossaries
+

+If hyperlinks are supported this does \textmd{\glshypernumber{location(s)}} otherwise it just does \textmd{location(s)}. Table 12.1

+

\hyperrm{location(s)}glossaries
+

+If hyperlinks are supported this does \textrm{\glshypernumber{location(s)}} otherwise it just does \textrm{location(s)}. Table 12.1

+

\hypersc{location(s)}glossaries
+

+If hyperlinks are supported this does \textsc{\glshypernumber{location(s)}} otherwise it just does \textsc{location(s)}. Table 12.1

+

\hypersf{location(s)}glossaries
+

+If hyperlinks are supported this does \textsf{\glshypernumber{location(s)}} otherwise it just does \textsf{location(s)}. Table 12.1

+

\hypersl{location(s)}glossaries
+

+If hyperlinks are supported this does \textsl{\glshypernumber{location(s)}} otherwise it just does \textsl{location(s)}. Table 12.1

+

\hypertt{location(s)}glossaries
+

+If hyperlinks are supported this does \texttt{\glshypernumber{location(s)}} otherwise it just does \texttt{location(s)}. Table 12.1

+

\hyperup{location(s)}glossaries
+

+If hyperlinks are supported this does \textup{\glshypernumber{location(s)}} otherwise it just does \textup{location(s)}. Table 12.1

+ +

+ +
+

I

+
\ifglossaryexists{glossary-type}{true}{false}modifier: * glossaries
+

+If the glossary given by glossary-type exists, this does true, otherwise it does false. The unstarred form treats ignored glossaries as non-existent. The starred form (v4.46+) will do true if glossary-type matches an ignored glossary. §15.4; 357

+

\ifglsdescsuppressed{entry-label}{true}{false}glossaries v3.08a+
+

+Does true if the entry’s description field is just \nopostdesc otherwise does false. §15.4; 360

+

\ifglsentrycounter true\else false\fiinitial: \iffalse; glossaries v3.0+
+

+Conditional corresponding to the entrycounter option. §2.3; 83

+

\ifglsentryexists{entry-label}{true}{false}
+

+Does true if the entry given by entry-label exists, otherwise does false. §15.4; 357

+

\ifglsfieldcseq{entry-label}{field-label}{cs-name}{true}{false}glossaries v4.16+
+

+Tests if the value of the given field is equal to the replacement text of the command given by the control sequence name cs-name using etoolbox’s \ifcsstrequal. Triggers an error if the given field (identified by its internal field label) hasn’t been defined. Uses \glsdoifexists. §15.4; 364

+

\ifglsfielddefeq{entry-label}{field-label}{cs}{true}{false}glossaries v4.16+
+

+Tests if the value of the given field is equal to the replacement text of the given command cs using etoolbox’s \ifdefstrequal. Triggers an error if the given field (identified by its internal field label) hasn’t been defined. Uses \glsdoifexists. §15.4; 363

+

\ifglsfieldeq{entry-label}{field-label}{string}{true}{false}glossaries v4.16+
+

+Tests if the value of the given field is equal to the given string using etoolbox’s \ifcsstring. Triggers an error if the given field (identified by its internal field label) hasn’t been defined. Uses \glsdoifexists. §15.4; 361

+

\ifglsfieldvoid{field-label}{entry-label}{true}{false}glossaries v4.50+
+

+An expandable test to determine if the entry is undefined or the field is undefined or empty. The field-label must be the field’s internal label. Internally uses etoolbox’s \ifcsvoid command. §15.4; 360

+

\ifglshaschildren{entry-label}{true}{false}glossaries v3.02+
+

+Does true if the given entry has child entries otherwise does false. Note that this has to iterate over the set of defined entries for the entry’s glossary to find one that has the entry identified in its parent field. A more efficient approach can be achieved with bib2gls and the save-child-count resource option. §15.4; 359

+

\ifglshasdesc{entry-label}{true}{false}glossaries v3.08a+
+

+Does true if the entry’s description field is set otherwise does false. §15.4; 360

+

\ifglshasfield{field}{entry-label}{true}{false}glossaries v4.03+

+

(robust)
+
+

+If the field identified by either its key or its internal field label field for the entry identified by entry-label is set and non-empty, this sets \glscurrentfieldvalue to the field value and does true otherwise it does false. §15.4; 360

+

\ifglshaslong{entry-label}{true}{false}glossaries v3.11a+
+

+Does true if the entry’s long field is set otherwise does false. §15.4; 359

+

\ifglshasparent{entry-label}{true}{false}glossaries v3.02+
+

+Does true if the entry’s parent field is set otherwise does false. §15.4; 359

+

\ifglshasprefix{entry-label}{true}{false}glossaries-prefix v4.45+
+

+Expands to true if the prefix field is non-empty. §16; 371

+

\ifglshasprefixfirst{entry-label}{true}{false}glossaries-prefix v4.45+
+

+Expands to true if the prefixfirst field is non-empty. §16; 371

+

\ifglshasprefixfirstplural{entry-label}{true}{false}glossaries-prefix v4.45+
+

+Expands to true if the prefixfirstplural field is non-empty. §16; 372

+

\ifglshasprefixplural{entry-label}{true}{false}glossaries-prefix v4.45+
+

+Expands to true if the prefixplural field is non-empty. §16; 371

+

\ifglshasshort{entry-label}{true}{false}glossaries v3.11a+
+

+Does true if the entry’s short field is set otherwise does false. §15.4; 359

+

\ifglshassymbol{entry-label}{true}{false}glossaries v3.08a+
+

+Does true if the entry’s symbol field is set otherwise does false. §15.4; 359

+

\ifglshyperfirst true\else false\fiinitial: \iftrue; glossaries
+

+Conditional corresponding to the hyperfirst option.

+

\ifglsindexonlyfirst true\else false\fiinitial: \iffalse; glossaries v3.02+
+

+Conditional corresponding to the indexonlyfirst option. §2.4; 92

+

\ifglsnogroupskip true\else false\fiinitial: \iffalse; glossaries v3.03+
+

+Conditional set by the nogroupskip option. §2.3; 90

+

\ifglsresetcurrcount true\else false\fiinitial: \iffalse; glossaries v4.50+
+

+Conditional that determines whether or not the reset commands should reset the entry count stored in currcount to zero. §7.1; 233

+

\ifglssubentrycounter true\else false\fiinitial: \iffalse; glossaries v3.0+
+

+Conditional corresponding to the subentrycounter option. §2.3; 86

+

\ifglstoc true\else false\fiinitial: \iffalse; glossaries
+

+Conditional corresponding to the toc option. §2.2; 78

+

\ifglsucmark true\else false\fiinitial: varies; glossaries v3.02+
+

+Conditional corresponding to the ucmark option. §2.2; 79

+

\ifglsused{entry-label}{true}{false}glossaries
+

+Does true if the entry has been marked as used, does false if the entry is marked as unused, and does neither if the entry hasn’t been defined (but will generate an error). §15.4; 358

+

\ifglswrallowprimitivemods true\else false\fiinitial: \iffalse; glossaries v4.22+
+

+If esclocations=true and this conditional is true, then some primitives will be locally redefined while indexing occurs in order to escape special characters in the location without prematurely expanding \thepage. §2.4; 92

+

\ifglsxindy true\else false\fiinitial: \iffalse; glossaries v1.17+
+

+Conditional that, if true, indicates that xindy should be used. §2.5; 102

+

\ifglsxtrinsertinside true\else false\fiinitial: \iffalse; glossaries-extra v1.02
+

+A conditional used by the predefined abbreviation styles to determine whether the insert part should go inside or outside of the style’s font formatting commands.

+

\ifignoredglossary{glossary-label}{true}{false}modifier: * glossaries v4.08+
+

+Does true if the glossary identified by glossary-label has been defined as an ignored glossary, otherwise does false. §9; 252

+

+

+Provided by various packages, including glossary-list and glossary-tree, this creates a vertical space. §13.1.1; 297

+ +

+ +
+

L

+
\loadglsentries[type]{filename}glossaries
+

+Locally assigns \glsdefaulttype to type and inputs filename. If the optional argument is omitted, the default glossary is assumed. Note that if any entries with filename have the type key set (including implicitly in commands like \newabbreviation), then this will override the type given in the optional argument. §4.6; 152

+

\longnewglossaryentry{entry-label}{key=value list}{description}glossaries v3.11a+
+

+Defines a new glossary entry with the given label. The second argument is a comma-separated list of glossary entry keys. The third argument is the description, which may include paragraph breaks. §4; 127

+

\longprovideglossaryentry{entry-label}{key=value list}{description}glossaries v3.14a+
+

+As \longnewglossaryentry but does nothing if the entry is already defined. §4; 127

+ +

+ +
+

M

+
\makefirstuc{text}mfirstuc
+

+Robust command that converts the first character of text to uppercase (sentence case) unless text starts with a command, in which case it will attempt to apply the case change to the first character of the first argument following the command, if the command is followed by a group. As from mfirstuc v2.08, this command internally uses \MFUsentencecase to perform the actual case change. See the mfirstuc documentation for further details, either:

texdoc mfirstuc
or visit ctan.org/pkg/mfirstuc.

+

\makeglossariesglossaries

+

(Options 2 and 3 only)
+
+

+Opens the associated indexing files that need to be processed by makeindex or xindy. This command has an optional argument with glossaries-extra. §3.2; 122

+

+

+Sets up all non-ignored glossaries so that they can be displayed with \printnoidxglossary. §3.1; 122

+

\mfirstucMakeUppercase{text}mfirstuc
+

+This command was used by \makefirstuc to convert its argument to all caps and was redefined by glossaries to use \MakeTextUppercase, but with mfirstuc v2.08+ and glossaries v4.50+ this command is instead defined to use the LaTeX3 all caps command, which is expandable. This command is no longer used by \makefirstuc (which instead uses \MFUsentencecase). The glossaries (v4.50+) and glossaries-extra (v1.49+) packages now use \glsuppercase for the all caps commands, such as \Gls.

+

\MFUaddmap{cs1}{cs2}mfirstuc v2.08+
+

+Identifies a mapping from the command cs1 to command cs2 for \makefirstuc and also identifies cs2 as a blocker. Mappings and blockers aren’t supported by \MFUsentencecase, so both cs1 and cs2 are identified as exclusions for \MFUsentencecase.

+

\MFUblocker{cs}mfirstuc v2.08+
+

+Locally identifies cs as a blocker command for \makefirstuc and an exclusion for \MFUsentencecase (which doesn’t support blockers).

+

\MFUexcl{cs}mfirstuc v2.08+
+

+Locally identifies cs as an exclusion command, which will be recognised by both \makefirstuc and \MFUsentencecase.

+

\MFUsentencecase{text}mfirstuc v2.08+
+

+Fully expands text and converts the first letter to uppercase. Unlike \makefirstuc, this command is expandable, but only recognises commands identified as exclusions. See the mfirstuc documentation for further details. This command is provided by glossaries-extra v1.49+ if an old version of mfirstuc is detected. §15.2; 353

+ +

+ +
+

N

+
\newabbreviation[key=value list]{label}{short}{long}glossaries-extra
+

+Defines a new entry that represents an abbreviation. This internally uses \newglossaryentry and any provided options (glossary entry keys) given in key=value list will be appended. The category is set to abbreviation by default, but may be overridden in options. The appropriate style should be set before the abbreviation is defined with \setabbreviationstyle.

+

\newabbreviationstyle{style-name}{setup}{display definitions}glossaries-extra
+

+Defines an abbreviation style, which can be set with \setabbreviationstyle.

+

\newacronym[key=value list]{entry-label}{short}{long}glossaries
+

+This command is provided by the base glossaries package to define a new acronym but it’s redefined by glossaries-extra to use \newabbreviation with the category key set to acronym. With just the base glossaries package, use \setacronymstyle to set the style. With glossaries-extra, use \setabbreviationstyle[acronym]{style} to set the style that governs \newacronym. §6; 192

+

\newacronymhookglossaries
+

+Hook used by \newacronym just before the entry is defined by \newglossaryentry.

+

\newacronymstyle{name}{format def}{style defs}glossaries v4.02+
+

+Defines an acronym style for use with the base glossaries package’s acronym mechanism. These styles are not compatible with glossaries-extra. The format def part is the code used as the entry format definition within \defglsentryfmt. The style defs is the code that redefines the acronym formatting commands, such as \genacrfullformat, and the additional fields command \GenericAcronymFields. §6.2.2; 210

+

\newglossary[log-ext]{glossary-label}{in-ext}{out-ext}{title}[counter]glossaries
+

+Defines a glossary identified by glossary-label (which can be referenced by the type key when defining an entry). The title will be used when displaying the glossary (using commands like \printglossary), but this title can be overridden by the title option. The optional counter indicates which counter should be used by default for the location when indexing any entries that have been assigned to this glossary. (This can be overridden by the counter option.) The other arguments are file extensions for use with makeindex or xindy. These arguments aren’t relevant for other indexing options (in which case, you may prefer to use \newglossary*). §9; 251

+

\newglossary*{glossary-label}{title}[counter]glossaries v4.08+
+

+A shortcut that supplies file extensions based on the glossary label:

\newglossary[glossary-label-glg]{glossary-label}{glossary-label-gls}{glossary-label-glo}{title}[counter]
§9; 251

+

\newglossaryentry{entry-label}{key=value list}glossaries
+

+Defines a new glossary entry with the given label. The second argument is a comma-separated list of glossary entry keys. §4; 126

+

\newglossarystyle{style-name}{definitions}glossaries
+

+Defines a new glossary style called style-name. §13.2; 325

+

\newignoredglossary{glossary-label}glossaries v4.08+
+

+Defines a glossary that should be ignored by iterative commands, such as \printglossaries. This glossary has no associated indexing files and has hyperlinks disabled. You can use an ignored glossary for common terms or acronyms or abbreviations 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-like commands). An ignored glossary can’t be displayed with \printglossary but may be displayed with the “unsrt” family of commands, such as \printunsrtglossary. The glossaries-extra package provides a starred form of this command.

+

\newterm[key=value list]{entry-label}glossaries v4.02+

+

(requires index package option)
+
+

+Defines a new glossary entry with the given label, type set to index, the name set to entry-label and the description set to \nopostdesc. The optional argument is a comma-separated list of glossary entry keys, which can be used to override the defaults. §2.6; 111

+

+

+Prevents \makeglossaries from creating the default indexing application style file. §3.2; 124

+

+

+When placed at the end of the description, this switches off the post-description hook (including the post-description punctuation). Does nothing outside of the glossary. §4; 128

+ +

+ +
+

O

+
\oldacronym[label]{short}{long}{key=value list}glossaries v1.18+
+

+Defines an acronym using the syntax of the old glossary package. §6.4; 226

+ +

+ +
+

P

+
\pagelistnameinitial: Page List; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as the page list column header for some of the tabular-like glossary styles. §1.5.1; Table 1.2

+

\PGLS[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+As \pgls but all caps. §16; 370

+

\Pgls[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+As \pgls but sentence case. §16; 370

+

\pgls[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+Similar to \gls but inserts the appropriate prefix, if provided. §16; 369

+

\PGLSpl[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+As \pgls but all caps. §16; 370

+

\Pglspl[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+As \pgls but sentence case. §16; 370

+

\pglspl[options]{entry-label}[insert]modifiers: * + glossaries-prefix v3.14a+
+

+Similar to \glspl but inserts the appropriate prefix, if provided. §16; 370

+

\pglsxtrshort[options]{entry-label}[insert]modifiers: * + glossaries-extra v1.49+

+

+
+

+As \glsxtrshort but inserts the prefix field and separator in front if set.

+

\pretoglossarypreamble[type]{text}glossaries-extra v1.12+
+

+Locally prepends text to the preamble for the glossary identified by type. If type is omitted, \glsdefaulttype is assumed. §8.2; 248

+

\printabbreviations[options]glossaries-extra

+

(requires \usepackage[abbreviations]{glossaries-extra})
+
+

+Shortcut for \printglossary[type=\glsxtrabbrvtype].

+

\printacronyms[options]glossaries v3.08a+

+

(requires the acronyms package option)
+
+

+Shortcut for \printglossary[type=\acronymtype]. §2.7; 113

+

+

+Iterates over all non-ignored glossaries and does \printglossary[type=type] for each glossary. §8; 240

+

+

+Displays the glossary by inputting a file created by makeindex or xindy. Must be used with \makeglossaries and either makeindex or xindy. §8; 239

+

\printindex[options] v4.02+

+

(requires the index package option)
+
+

+Shortcut provided by the index package option that simply does \printglossary[type=index]. §2.6; 111

+

+

+Iterates over all non-ignored glossaries and does \printnoidxglossary[type=type] for each glossary. §8; 239

+

\printnoidxglossary[options]glossaries v4.04+
+

+Displays the glossary by obtaining the indexing information from the aux file and using TeX to sort and collate. Must be used with \makenoidxglossaries or with the glossaries not identified in the optional argument of \makeglossaries when using the hybrid method. This method can be very slow and has limitations. §8; 239

+

\printnumbers[options]glossaries v4.02+

+

(requires the numbers package option)
+
+

+Shortcut for \printglossary[type=numbers]. §2.6; 110

+

\printsymbols[options]glossaries v4.02+

+

(requires the symbols package option)
+
+

+Shortcut for \printglossary[type=symbols]. §2.6; 110

+

\printunsrtacronyms[options]glossaries-extra-bib2gls v1.40+

+

(requires \usepackage[acronyms,record]{glossaries-extra})
+
+

+Shortcut for \printunsrtglossary[type=\acronymtype].

+

+

+Iterates over all non-ignored glossaries and does \printunsrtglossary[type=type] for each glossary. §8; 241

+

+

+Displays the glossary by iterating over all entries associated with the given glossary (in the order in which they were added to the glossary). Group headers will only be inserted if the group key has been defined and has been set (typically with the record option and bib2gls). Location lists will only be shown if the location or loclist fields have been set (typically by bib2gls). §8; 240

+

\printunsrtinnerglossary[options]{pre-code}{post-code}glossaries-extra v1.44+
+

+Similar to \printunsrtglossary but doesn’t contain the code that starts and ends the glossary (such as beginning and ending the theglossary environment). See the glossaries-extra manual for further details. §8; 241

+

\provideglossaryentry{entry-label}{key=value list}glossaries v3.14a
+

+As \newglossaryentry but does nothing if the entry is already defined. §4; 127

+

\provideignoredglossary{glossary-label}modifier: * glossaries-extra v1.12+
+

+As \newignoredglossary but does nothing if the glossary has already been defined.

+

\ProvidesGlossariesLang{language}[version]glossaries v4.12+
+

+Used at the start of a glossaries language definition file (ldf) to declare the file and version details.

+ +

+ +
+

R

+
\renewacronymstyle{name}{format def}{display defs}glossaries v4.02+
+

+As \newacronymstyle but redefines an existing acronym style.

+

\renewglossarystyle{style-name}{definitions}glossaries v3.02+
+

+Redefines the glossary style called style-name. §13.2; 325

+

\RequireGlossariesLang{language}glossaries v4.12+
+

+Indicates that the language definition file (ldf) corresponding to the given language should be loaded, if it hasn’t already been loaded.

+ +

+ +
+

S

+
\seealsonameinitial: see also; glossaries-extra v1.16+

+

(language-sensitive)
+
+

+Used as a cross-reference tag. The default value is \alsoname, if that command has been defined, or “see also”.

+

\seenameinitial: see; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. May already be defined by a language package.

+

\setabbreviationstyle[category]{style-name}glossaries-extra
+

+Sets the current abbreviation style to style-name for the category identified by category. If the optional argument is omitted, abbreviation is assumed.

+

\SetAcronymLists{list}glossaries v2.04+
+

+Sets the list of acronym lists (overriding any that have previously been identified). §2.7; 114

+

🗑 \SetAcronymStyleglossaries v2.04
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\setacronymstyle{style-name}glossaries v4.02+
+

+Sets the acronym style. Don’t use with glossaries-extra. §6.2; 201

+

🗑 \SetCustomStyleglossaries v2.06
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \newacronymstyle and \setacronymstyle.

+

🗑 \SetDefaultAcronymStyleglossaries v2.04
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle{long-short}.

+

🗑 \SetDescriptionAcronymDisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDescriptionAcronymStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDescriptionDUAAcronymDisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDescriptionDUAAcronymStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDescriptionFootnoteAcronymDisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDescriptionFootnoteAcronymStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDUADisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetDUAStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \newacronymstyle and \setacronymstyle.

+

\setentrycounter[prefix]{counter}glossaries
+

+Sets up the hypertarget prefix and location counter for use with \glshypernumber. §12.1; 269

+

🗑 \SetFootnoteAcronymDisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetFootnoteAcronymStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\setglossarypreamble[type]{text}glossaries v3.07+
+

+Globally sets the preamble for the glossary identified by type to text. If type is omitted, \glsdefaulttype is assumed. §8.2; 247

+

+

+Equivalent to the package option section=name. §2.2; 79

+

\setglossarystyle{style-name}glossaries v3.08a+
+

+Sets the default glossary style to style-name. §2.3; 87

+

🗑 \SetSmallAcronymDisplayStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

🗑 \SetSmallAcronymStyleglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\setStyleFile{name}glossaries v1.17+
+

+Sets the file name of the makeindex or xindy style file that’s created by \makeglossaries. §3.2; 123

+

\setupglossaries{options}glossaries v3.11a+
+

+Change allowed options that are defined by the base glossaries package. Note that some options can only be passed as package options. To change options defined or modified by the glossaries-extra package, use \glossariesextrasetup. §2.10; 121

+

🗑 \SmallNewAcronymDefglossaries
+

+Deprecated with the introduction of \setacronymstyle. Removed in v4.50. Use rollback if backward-compatibility required or use \setacronymstyle.

+

\subglossentry{level}{entry-label}{number-list}glossaries v3.08a+

+

(glossary style command)
+
+

+Redefined by the glossary styles to display child entries. §13.2.3; 332

+

\symbolnameinitial: Symbol; glossaries

+

(language-sensitive)
+
+

+Provided by glossaries if it hasn’t already been defined. Used as a column header for some of the tabular-like glossary styles. §1.5.1; Table 1.2

+ +

+ +
+

T

+
\theglossaryentryglossaries v3.0+

+

(requires entrycounter=true)
+
+

+Displays the value of the glossaryentry counter. §2.3; 83

+

+

+Displays the value of the glossarysubentry counter. §2.3; 86

+ +

+ +
+

W

+ +

+Writes the makeindex/xindy style file. This command is used by \makeglossaries and then disabled. §3.2; 123

+ +

+ +
+

X

+
\xcapitalisefmtwords{text}mfirstuc v2.03+
+

+Passes the argument to \capitalisefmtwords but with the first token in text expanded. The starred version uses the starred version of \capitalisefmtwords.

+

\xGlsXtrSetField{entry-label}{field-label}{value}glossaries-extra v1.12+
+

+As \GlsXtrSetField but expands the value and uses a global assignment.

+ +

+ +
+

Environment Summary

+ +

+Redefined by the glossary styles to format the glossary according to the style specifications. The entire glossary content (not including the section header, preamble and postamble) is contained within this environment. §13.2.3; 331

+ +

+ +
+

Package Option Summary

+
\usepackage[options]{glossaries-extra}
+

+Extension package that loads glossaries, provides additional commands, and modifies some of the base glossaries commands to integrate them with the new commands or to make them more flexible.

+

+

+Provides a new glossary with the label abbreviations and title given by \abbreviationsname, redefines \glsxtrabbrvtype to abbreviations, redefines \acronymtype to \glsxtrabbrvtype (unless the acronym or acronyms option has been used), and provides \printabbreviations. §2.7; 113

+

+

+Loads glossaries-accsupp. §2.9; 119

+

autoseeindex=booleandefault: true; initial: true 🔘
+

+Indicates whether or not to enable automatic indexing of see and seealso fields. §2.4; 94

+

docdef=valuedefault: true; initial: false 🎚
+

+Determines whether or not \newglossaryentry is permitted in the document environment. §2.1; 77

+

docdef=atom
+

+As restricted but creates the glsdefs file for atom’s autocomplete support. 77

+

docdef=false
+

+Don’t allow \newglossaryentry in the document environment. 77

+

docdef=restricted
+

+Allow \newglossaryentry in the document environment, but only before any glossaries. 77

+

docdef=true
+

+Allow \newglossaryentry in the document environment if the base glossaries package would allow it. 77

+

equations=booleandefault: true; initial: false 🔘︎
+

+Automatically switch the location counter to equation when inside a numbered equation environment. §2.4; 95

+

floats=booleandefault: true; initial: false 🔘︎
+

+Automatically switch the location counter to the corresponding counter when inside a floating environment. §2.4; 95

+

+

+Defines the index counter wrglossary and implements counter=wrglossary. §2.4; 95

+

indexcrossrefs=booleandefault: true; initial: true 🔘
+

+If true, automatically indexes cross references at the end of the document. §2.4; 94

+

nomissingglstext=booleandefault: true; initial: false 🔘︎
+

+Determines whether or not to display warning text if the external indexing file hasn’t been generated due to an incomplete build. §2.9; 119

+

postdot𝍢 glossaries-extra v1.12+
+

+A shortcut for nopostdot=false.

+

postpunc=value🎚 glossaries-extra v1.21+
+

+An alternative to postdot, this can be used to insert a different punctuation character after the description.

+

+

+Loads glossaries-prefix. §2.9; 119

+

record=valuedefault: only; initial: off 🎚
+

+Indicates whether or not bib2gls is being used (in which case entry indexing is performed by adding bib2gls records in the aux file). §2.4; 94

+

record=hybrid
+

+Performs a mixture of bib2gls records in the aux file (to select entries from a bib file) and makeindex/xindy indexing in their associated files. This option is best avoided. 95

+

record=nameref
+

+Entry indexing is performed by adding bib2gls nameref records in the aux file. Glossaries should be displayed with the “unsrt” family of commands. 95

+

record=off
+

+Entry indexing is performed as per the base glossaries package, using either \makeglossaries or \makenoidxglossaries. 95

+

record=only
+

+Entry indexing is performed by adding bib2gls records in the aux file. Glossaries should be displayed with the “unsrt” family of commands. 95

+

stylemods=listdefault: default 🎚
+

+Loads glossaries-extra-stylemods with the given options. If stylemods=default then no options are passed to glossaries-extra-stylemods. §2.3; 90

+

undefaction=valueinitial: error 🎚
+

+Indicates whether to trigger an error or warning if an unknown entry label is referenced. §2.1; 76

+

undefaction=error
+

+Trigger an error if an unknown entry label is referenced. 76

+

undefaction=warn
+

+Trigger a warning if an unknown entry label is referenced. 77

+

\usepackage[options]{glossaries}
+

+Base package. This package will be implicitly loaded by glossaries-prefix, glossaries-accsupp and glossaries-extra. §1; 2

+

acronym=booleandefault: true; initial: false 🔘︎
+

+If true, provides a new glossary with the label acronym and title given by \acronymname, redefines \acronymtype to acronym, and provides \printacronyms. §2.7; 112

+

acronymlists={label-list}🎚 glossaries v2.04+
+

+Identifies the glossaries that contain acronyms (defined with the base glossaries packages acronym mechanism). §2.7; 114

+

+

+Provides a new glossary with the label acronym, redefines \acronymtype to acronym, and provides \printacronyms. §2.7; 113

+

automake=valuedefault: immediate; initial: false 🎚 glossaries v4.08+
+

+Indicates whether or not to attempt to use TeX’s shell escape to run an indexing application. §2.5; 104

+

automake=delayedglossaries v4.50+
+

+Use the shell escape to run makeindex or xindy at the end of the document. 106106

+

automake=falseglossaries v4.08+
+

+Don’t use the shell escape. 106

+

automake=immediateglossaries v4.42+
+

+Use the shell escape to run makeindex or xindy before \makeglossaries opens the associated indexing files. 106

+

automake=liteglossaries v4.50+
+

+Use the shell escape to run makeglossaries-lite before \makeglossaries opens the associated indexing files. §2.5; 107107

+

automake=makeglossglossaries v4.50+
+

+Use the shell escape to run makeglossaries before \makeglossaries opens the associated indexing files. §2.5; 107107

+

automake=truealias: delayed; glossaries v4.08+🗑
+

+Deprecated synonym for automake=delayed. 106

+

automakeglossalias: makegloss 𝍢 glossaries v4.50+
+

+Synonym for automake=makegloss. §2.5; 107

+

+

+Synonym for automake=lite. §2.5; 107

+

+

+Option removed in version 4.50. Now only available with rollback. §2.9; 119

+

+

+Option removed in version 4.50. Now only available with rollback. §2.9; 119

+

counter=counter-nameinitial: page 🎚
+

+Sets the default location counter. §2.3; 89

+

counterwithin=parent-counter🎚 glossaries v3.0+
+

+Sets the parent counter for glossaryentry. §2.3; 84

+

debug=valueinitial: false 🎚 glossaries v4.24+
+

+Adds markers to the document for debugging purposes. §2.1; 70

+

debug=falseglossaries v4.24+
+

+Disable debugging actions. 70

+

+

+Implements debug=true and also shows accessibility information in the document. 71

+

+

+Implements debug=true and also shows target markers in the document. 70

+

debug=trueglossaries v4.24+
+

+Writes wrglossary(type)(indexing info) to the log file if there is an attempt to index an entry before the associated indexing file has been opened (makeindex and xindy only). With glossaries-extra, this setting will also display the label of any undefined entries that are referenced in the document. 70

+

+

+Deprecated in version 4.02 (2013-12-05) and removed in version 4.50. Now only available with rollback. §2.8; 115

+

+

+Disables \makeglossaries. §2.5; 107

+

+

+Deprecated in version 4.02 (2013-12-05) and removed in version 4.50. Now only available with rollback. §2.8; 118

+

entrycounter=booleandefault: true; initial: false 🔘︎ glossaries v3.0+
+

+Enables the entry counter for top-level entries. §2.3; 82

+

esclocations=booleandefault: true; initial: false 🔘︎ glossaries v4.33+
+

+If true, escapes locations before indexing. §2.4; 91

+

+

+Deprecated in version 4.02 (2013-12-05) and removed in version 4.50. Now only available with rollback. §2.8; 117

+

hyperfirst=booleandefault: true; initial: true 🔘 glossaries v2.03+
+

+If false, this option will suppress hyperlinks on first use for the \gls-like commands. §2.1; 75

+

+

+Provides a new glossary with the label index and the title \indexname, and provides \printindex and \newterm. §2.6; 111

+

indexonlyfirst=booleandefault: true; initial: false 🔘︎ glossaries v3.02+
+

+Indicates whether or not to only index the first use. §2.4; 92

+

kernelglossredefs=valuedefault: true; initial: false 🎚 glossaries v4.41+
+

+Indicates whether or not to redefined the kernel glossary commands \glossary and \makeglossary. §2.9; 120

+

kernelglossredefs=false
+

+Don’t redefine \glossary and \makeglossary. 120

+

kernelglossredefs=nowarn
+

+Redefine \glossary and \makeglossary without any warnings. 120

+

kernelglossredefs=true
+

+Redefine \glossary and \makeglossary but their use will trigger a warning. 120

+

+

+Implements translate=babel and adds the supplied languages to tracklang’s list of tracked languages. §2.1; 74

+

+

+Indicates that the indexing should be performed by makeindex (default). §2.5; 102

+

mfirstuc=valueinitial: unexpanded 🎚 glossaries v4.50+
+

+The value may be either expanded or unexpanded and performs the same function as mfirstuc’s expanded and unexpanded package options. Note that there’s no value corresponding to mfirstuc’s other package option. §2.9; 119

+

nogroupskip=booleandefault: true; initial: false 🔘︎ glossaries v3.03+
+

+If true, suppress the gap between letter groups in the glossaries by default. §2.3; 90

+

+

+Counteracts the index option. §2.6; 112

+

nohypertypes={list}🎚 glossaries v3.05+
+

+Identifies the list of glossaries that should have hyperlinks suppressed. §2.6; 108

+

+

+Suppresses the warning if no language support is found. §2.1; 69

+

+

+Don’t load glossary-list, which is normally loaded automatically. Note that if glossaries is loaded before glossaries-extra, then this option should be passed directly to glossaries not glossaries-extra otherwise it will be too late to implement. §2.3; 87

+

+

+Don’t load glossary-long, which is normally loaded automatically. Note that if glossaries is loaded before glossaries-extra, then this option should be passed directly to glossaries not glossaries-extra otherwise it will be too late to implement. §2.3; 87

+

+

+Prevents the definition of the main glossary. You will need to define another glossary to use instead. For example, with the acronyms package option. §2.6; 109

+

+

+Set no location lists as the default for all glossaries. May be overridden for individual glossaries with nonumberlist=true. §2.3; 88

+

nopostdot=booleandefault: true; initial: true 🔘 glossaries v3.03+
+

+If true, suppresses the automatic insertion of a full stop after each entry’s description in the glossary (for styles that support this). The default is nopostdot=true for glossaries-extra and nopostdot=false for just glossaries. §2.3; 89

+

+

+Suppresses a warning if theglossary or \printglossary have already been defined (which indicates that the document class or another package also provides a mechanism for creating a glossary that could potentially conflict with glossaries). This option is automatically implemented with glossaries-extra. §2.1; 69

+

+

+Don’t load the default set of predefined styles. Note that if glossaries is loaded before glossaries-extra, then this option should be passed directly to glossaries not glossaries-extra otherwise it will be too late to implement. §2.3; 88

+

+

+Don’t load glossary-super, which is normally loaded automatically. Note that if glossaries is loaded before glossaries-extra, then this option should be passed directly to glossaries not glossaries-extra otherwise it will be too late to implement. §2.3; 87

+

+

+Equivalent to translate=false. §2.1; 74

+

+

+Don’t load glossary-tree, which is normally loaded automatically. Note that if glossaries is loaded before glossaries-extra, then this option should be passed directly to glossaries not glossaries-extra otherwise it will be too late to implement. §2.3; 88

+

+

+Suppresses warnings. §2.1; 69

+

numberedsection=valuedefault: nolabel; initial: false 🎚 glossaries v1.1+
+

+Indicates whether or not glossary section headers will be numbered and also if they should automatically be labelled. §2.2; 79

+

numberedsection=autolabel
+

+Use numbered sectional units for glossaries and automatically add a label based on the glossary label. 80

+

numberedsection=false
+

+Use unnumbered sectional units for glossaries. 80

+

numberedsection=nameref
+

+Use unnumbered sectional units for glossaries and automatically add a label based on the glossary label. 81

+

numberedsection=nolabel
+

+Use numbered sectional units for glossaries but no label. 80

+

numberline=booleandefault: true; initial: false 🔘︎ glossaries v1.1+
+

+If true (and toc=true), includes \numberline when adding a glossary to the table of contents. §2.2; 78

+

+

+Provides a new glossary with the label numbers and the title \glsnumbersgroupname, and provides \printnumbers. With glossaries-extra, this additionally defines \glsxtrnewnumber. §2.6; 110

+

orderinitial: word 𝍢 glossaries v1.17+
+

+Indicates whether word or letter order should be used. With Options 2 and 3, this information is written to the aux file, where it can be picked up by makeglossaries. This option will have no effect if you call makeindex or xindy explicitly. §2.5; 101

+

order=letter
+

+Letter order (“seal” before “sea lion”). 101

+

order=word
+

+Word order (“sea lion” before “seal”). 101

+

+

+Cancels the effect of disablemakegloss. §2.5; 107

+

sanitizesort=booleandefault: true; initial: varies 🔘︎
+

+Indicates whether the default sort value should be sanitized (only applicable with sort=standard). §2.5; 96

+

savenumberlist=booleandefault: true; initial: false 🔘︎ glossaries v3.02+

+

(Options 2 and 3 only)
+
+

+If true, save number lists. Only applicable with Options 2 and 3 as Options 1 and 4 have the number list stored in the loclist field and Option 4 also has the formatted number list in the location field. §2.3; 82

+

savewrites=booleandefault: true; initial: false 🔘︎ glossaries v3.0+
+

+If true, indexing information is stored until the end of the document to reduce the number of write registers. §2.1; 73

+

section=namedefault: section 🎚
+

+Indicates which section heading command to use for the glossary. The value may be one of the standard sectioning command’s control sequence name (without the leading backslash), such as chapter or section. §2.2; 78

+

+

+Automatically adds nonumberlist={false} to any entries with the see key set. §2.3; 89

+

seenoindex=valueinitial: error 🎚 glossaries v4.24+
+

+Indicates what to do if the see key is used before the associated indexing files have been opened by \makeglossaries. §2.4; 91

+

seenoindex=error
+

+Triggers an error if the see key is used before \makeglossaries. 91

+

seenoindex=ignore
+

+Does nothing if the see key is used before \makeglossaries. 91

+

seenoindex=warn
+

+Triggers a warning if the see key is used before \makeglossaries. 91

+

shortcuts={boolean}default: false; initial: false 🎚
+

+Defines various shortcut commands. Has additional values with glossaries-extra. §2.7; 115

+

+

+Deprecated in version 4.02 (2013-12-05) and removed in version 4.50. Now only available with rollback. §2.8; 116

+

+

+Deprecated in version 4.02 (2013-12-05) and removed in version 4.50. Now only available with rollback. §2.8; 117

+

sort=valueinitial: standard 🎚 glossaries v3.0+
+

+Indicates how the sort key should automatically be assigned if not explicitly provided (for \makeglossaries and \makenoidxglossaries only). §2.5; 97

+

sort=clearglossaries v4.50+
+

+Sets the sort key to an empty value. Use this option if no indexing is required for a slightly faster build. 97

+

sort=def
+

+Use the (zero-padded) order of definition as the default for the sort key. 97

+

sort=noneglossaries v4.30+
+

+Don’t process the sort key. Use this option if no indexing is required for a slightly faster build. 97

+

+

+Use the value of the name key as the default for the sort key and implement the \glsprestandardsort hook. 98

+

sort=use
+

+Use the (zero-padded) order of use as the default for the sort key. 98

+

style=style-nameinitial: varies 🎚
+

+Sets the default glossary style to style-name. §2.3; 86

+

subentrycounter=booleandefault: true; initial: false 🔘︎ glossaries v3.0+
+

+Enables the entry counter for level 1 entries. §2.3; 85

+

+

+Provides a new glossary with the label symbols and the title \glssymbolsgroupname, and provides \printsymbols. With glossaries-extra, this additionally defines \glsxtrnewsymbol. §2.6; 109

+

toc=booleandefault: true; initial: varies 🔘︎
+

+If true, each glossary will be automatically added to the table of contents. The default is toc=false with glossaries and toc=true with glossaries-extra. §2.2; 77

+

translate=valuedefault: true; initial: varies 🎚 glossaries v1.1+
+

+Indicates how multilingual support should be provided, if applicable. §2.1; 73

+

translate=babel
+

+Uses babel’s language hooks to implement multilingual support (default for glossaries-extra if babel has been detected). 74

+

translate=false
+

+Don’t implement multilingual support (default if no language package has been detected). 74

+

translate=true
+

+Uses translator’s language hooks to implement multilingual support (default for glossaries if a language package has been detected). 74

+

ucmark=booleandefault: true; initial: varies 🔘︎ glossaries v3.02+
+

+Indicates whether or not to use all caps in the glossary header. §2.2; 79

+

+

+Creates a file called \jobname.glslabels that contains all defined entry labels and names (for the benefit of auto-completion tools). §2.1; 76

+

+

+Creates a file called \jobname.glslabels that contains all defined entry labels (for the benefit of auto-completion tools). §2.1; 76

+

xindy={options}🎚 glossaries v1.17+

+

+
+

+Indicates that the indexing should be performed by xindy. §2.5; 102

+

codepage={value}🎚
+

+Sets the xindy codepage. Defaults to utf8 if \inputencodingname isn’t defined. Only applicable if you use makeglossaries or automake. §2.5; 103

+

glsnumbers={boolean}default: true; initial: true 🎚
+

+Indicates whether or not to add the glsnumbers letter group. §2.5; 103

+

language={value}🎚
+

+Sets the xindy language module. Only applicable if you use makeglossaries or automake. §2.5; 102

+

+

+Equivalent to xindy with no value. §2.5; 104

+

+

+Equivalent to xindy={glsnumbers=false}. §2.5; 104

- +

+ +
+

Index

+ + +
+ +
+

Symbols

+
\\128, 274295
+
\}337
+
\{337
+
{20, 337597
+
}20, 337562
+
%337598
+ +
, (comma)126, 128156
+
: (colon)127423
+
! (exclamation mark)43156
+
? (question mark)43, 156280
+
. (full stop or period) +
+ +
~ (literal)337, 338612
+
~ (non-breaking space) +
+
~n337
+
\'1215
+
' (apostrophe)131
+
" (double-quote)43, 127, 156, 279, 338, 351601
+
\ (literal backslash)131, 274, 286, 338561
+
) (range end)254, 271272, +
+
( (range start)254, 271272, +
+
\$
+ +
* (star modifier)161, 163, 167, 176, 196, 369591
+
\&189, 546597
+ +
\#96
+
#96, 211, 325381
+
##211325
+
+ (plus modifier)161, 163, 167, 176, 182, 196, 369591
+
= (equals)126, 128156
+
| (pipe)43, 156467
+
\␣Table 6.2; 222226 passim, 368, 444446
+
(space)189, 263, 597603
+ +
+ +
+

@

+
\@222, 223, 411488
+
@ (at)280
+
\@arabic274
+
\@firstofone200
+
\@for355
+
\@gobble
+ + + + + + + +
\@mkboth245
+ +
\@roman274
+ + +
+ +
+

A

+
abbreviation style (glossaries-extra)22, 38, 39, 113, 136, 174, 192, 201, 206, 391, 397408 passim, 503, 506, 623, 628, 631649
+
footnote400621
+
long-em-short-em
+
long-noshort201
+
long-short-desc39429
+
long-short-em410
+
long-short-sc-desc397398
+
long-short-sc396399
+
long-short-user39
+
long-short390, 408410
+
postfootnote400621
+
short-footnote-desc623
+
short-long22
+
short-nolong-noreg488
+
short-nolong390488
+
short-sc-footnote-desc400, 401405
+
short-sc-footnote400
+
short-sc-postfootnote-desc400, 401405
+ + + + +
accessibility package483
+
accessibility attribute557, 606607
+
accsupp package379, 386, 482557
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
acronym format +
+
acronym style49, 50, 115, 126130 passim, 136146 passim, 177, 191194 passim, 198206 passim, 210, 212, 220, 225, 400, 405, 409, 410, 460, 483, 502506 passim, 517, 540545, 553, 559, 571, 585, 614, 615, 642648
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\addcontentsline78
+ +
align environment164232
+
all caps79, 164, 175, 353, 369405
+
\Alph16, 273276 passim
+
\alph16, 273276 passim
+
\alpha12166
+
\alsoname455, 456649
+ +
amsgen package7223
+
amsmath package164232
+ +
\appto284
+ +
\arabic16, 273276 passim, 343437
+
arara6, 17, 22, 25, 35, 53, 60, 66, 67421
+
array package303311
+
ASCII12, 131, 243, 273, 274494
+
\AtBeginDocument152
+
atom77
+ +
auto-completion67, 76665
+ +
+ +
+

B

+
babel package8, 16, 4247, 74, 102, 127, 152, 156, 278, 282, 339, 423, 538665
+
\babelprovide842
+
beamer class164, 229232
+
\BeginAccSupp482486 passim
+
\bfseries266
+
bib2gls22
+
-g +
+
--group25, 35, 90, 393, 448, 460, 467, 473, 475503
+
-m +
+
--map-format421
+
--no-group513
+ + +
book class246
+
booktabs package299, 303, 306475
+
\bottomrule306307
+ +
+ +
+

C

+
\c15
+ + +
\caption95159
+
\captionslanguage47, 50, 74545
+ +
categories501, 623, 628631
+
abbreviation38, 39, 76, 94, 389, 390, 396, 399, 403, 406, 410, 487, 488, 641649
+
acronym38, 39, 76, 94, 192, 389, 390, 396399, 403, 406, 410, 411, 488642
+
general404, 444, 450, 460488
+
index488
+
number488
+
symbol451, 455488
+
category attributes33, 34, 76, 94, 109, 182, 193, 291, 292, 328, 329, 402, 404, 408417 passim, 488604
+
discardperiod408411 passim, 488
+
glossdesc33, 328, 402, 404414
+
glossdescfont33, 292, 328433
+
glossname34, 291328
+
glossnamefont291, 328433
+
glosssymbolfont292, 329417
+
indexonlyfirst94
+
insertdots408410488
+
nohyper109
+
nohyperfirst76182
+
noshortplural408
+
pluraldiscardperiod408
+
retainfirstuseperiod408
+ + + + + + + + +
\chapter7881 passim, 159, 183, 245248 passim, 436
+
chapter counter271, 343476
+
\cite8
+
classicthesis package7, 8688, 296299
+
\cleardoublepage246
+
\clearpage246
+
CLI6, 15, 19, 495, 497499
+
codepage66, 103, 339, 340, 537605,
see also encoding
+
+
composite location +
+
compositor124, 125, 273280 passim, 348604
+
convertgls2bib390, 392, 412, 418, 420, 424427 passim, 446, 447, 457472
+
--bibenc472
+ +
--ignore-type431
+
--index-conversion435459
+
--preamble-only390, 398, 412, 420, 424, 427, 431, 435, 439, 446, 452, 459, 466, 470, 472481
+
--split-on-type424439
+ +
--texenc472
+
\csletcs284
+ +
\CurrentTrackedDialect4851
+
\CurrentTrackedLanguage4851
+ + + +
+ +
+

D

+
datatool-base package550551
+
datatool package243, 550, 551622
+ +
\def366
+ + + + + + +
\delimR§12.2; 188, 189, 267271 passim, 282, 283, 549, 586597
+
description environment7, 86, 292, 296299 passim, 331, 521, 525526
+ + + + + +
\dicei344464
+
\diceii344
+
\diceiii344
+
\diceiv344
+
\dicev344
+
\dicevi344
+
display style (or format) +
+
doc package120252
+
document environmentTable 1.1; 9, 77, 152157 passim, 233, 563656
+
\dtlcompare243
+ +
\dtlicompare243
+ +
\dtlletterindexcompare243
+
\dtlwordindexcompare243
+ +
DVI (device independent file format)160
+ +
+ +
+

E

+ + +
encoding15, 21, 43, 50, 51, 6366 passim, 103, 339, 340, 463, 471473, 494, 499621,
see also codepage
+
+
\EndAccSupp482483
+
\ensuremath30, 130417
+
entry +
+ +
entry line82, 85, 158161 passim, 166, 327, 332, 495603
+
entry location265, 266, 273, 495, 497498
+ +
equation counter95, 271, 411414 passim, 421656
+
equation environment411
+
\es@scroman278287 passim
+
etoolbox package100, 175, 189, 288, 290, 357365 passim, 445, 446, 622, 626635
+ + + + + + + + + + + + + + + + +
extended Latin alphabetTable 1.1; 6, 12, 19, 42, 475495
+
extended Latin character472, 495, 498499, +
+ +
+ +
+

F

+
field495
+
file extensions65,
see also file formats
+
+
file formats
+
acn253
+
acr253
+
alg253
+
aux56, 57, 65, 107, 155, 189, 251, 276, 329, 497646
+
bib22, 67, 255497
+
glg6365, 106, 239, 251280
+
glg2253
+
glo17, 21, 57, 6365, 252279
+
glo2253
+
gls17, 21, 6365, 252280
+
gls2253
+
glsdefs67, 77, 152, 156, 563619
+
glslabels665
+
glstex67, 251498
+
idx253
+
ilg253
+
ind253
+
ist15, 17, 66, 122, 123, 276279 passim
+
ldf648
+
log105, 239659
+
nlg253
+
nlo253
+
nls253
+
slg253
+
slo253
+
sls253
+
tex43
+
toc78
+
xdy21, 59, 66, 122, 123, 274, 276, 287, 337351
+
first use129, 130, 177, 181, 195, 370495
+
first use flag160163 passim, 196, 232, 358, 495, 591, 592, 601614
+
first use text495
+ +
flowfram package308
+
fmtcount package346, 347471
+
fontenc package387
+
fontspec package387
+
\footnote181, 209403
+ + + + + +
\foreignlanguage433
+ +
\forlistcsloop622
+
\forlistloop189, 288290
+
format
+ +
acronym +
+
entry +
+
glossary +
+ + +
frame environment229
+
\frontmatter279
+
full stop (.)89, 222225, 273, 295, 296, 395, 408661
+ +
+ +
+

G

+
\gdef366
+ + + + + +
gettitlestring package296591
+
\GetTitleStringSetup296
+ +
group (letters, numbers, symbols)12, 2029 passim, 35, 42, 97, 98, 103, 104, 131, 244, 292, 293, 297299, 303308 passim, 312325 passim, 329335 passim, 350, 393, 442, 463475 passim, 495, 503, 513, 514, 521526 passim, 530536 passim, 560, 585, 591, 595, 597, 605612 passim, 625631 passim, 647661
+
GUI387496
+ +
+ +
+

Glo

+ +
glossaries-accsupp package§17; 71, 119, 128, 136, 375, 378, 386, 482487 passim, 501509 passim, 557, 559, 563584 passim, 592, 594, 599, 606611 passim, 615618, 656658
+
glossaries-babel package74
+
glossaries-dictionary-English.dict48
+
glossaries-dictionary-Lang.dict47, 48587
+
glossaries-english.ldf48
+
glossaries-extra-bib2gls package478, 550, 566, 573, 624627 passim, 647
+
glossaries-extra-stylemods package90, 292, 296, 319, 582, 600657
+ + + + + + + + + + + + + + +
postdot5, 90, 296, 395, 404, 412, 429, 456, 629657,
see also nopostdot & postpunc
+
+ + +
record§2.4; Table 1.1; 9, 2226 passim, 33, 42, 67, 82, 94, 95, 108, 271, 275277, 289, 290, 390, 398, 412, 413, 420424 passim, 429, 435, 446, 452, 456, 459, 466, 470473, 477481 passim, 503, 620, 622, 647657
+ + + + +
stylemods§2.3; 5, 7, 8690 passim, 303, 306, 311, 312, 319321, 395, 396, 412, 429, 449, 452, 456, 475, 476657
+ + + +
glossaries-frencha
+
glossaries-german.ldf8
+
glossaries-germana
+
glossaries-irish.ldf50
+
glossaries-iso-lang-iso-region.ldf50
+
glossaries-lang.ldf47
+
glossaries-languagea
+
glossaries-polyglossia package74
+ + +
acronym§2.7; Table 1.2; 63, 64, 69, 80, 109114 passim, 121, 153, 225, 253, 257, 375, 388390, 396, 544, 656658
+ + +
automake§2.5; 52, 103106 passim, 239, 251, 285, 339, 340, 422658
+ + + + + + + + + + +
counter§2.3; 89, 92, 124, 135, 162, 251, 265, 271, 273, 340343 passim, 414, 501, 562, 657659
+ + + + + + + + + +
entrycounter§2.3; 8285, 242, 291296 passim, 326, 333, 334, 568, 571, 601, 602, 608, 635, 653660
+ + + +
index§2.6; 109112 passim, 253, 643, 646, 660661
+ + + + + + + + +
nogroupskip§2.3; 90, 242, 293299 passim, 303308 passim, 312, 322, 335, 475, 598, 637661
+ + + + + + + + + +
nostyles§2.3; 3035 passim, 86, 88, 121, 293299 passim, 308, 314, 395, 429, 449, 476662
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
sort§2.5; 30, 9699 passim, 664
+ +
def9, 13, 97, 98, 130, 132, 293664
+ + +
use913 passim, 97, 98, 130, 132, 293664
+ + +
symbols§2.6; 5, 13, 1721 passim, 109, 253, 610, 629, 647664
+ +
translate§2.1; 8, 4447 passim, 73, 121, 660, 662665
+ + + + + + +
xindy§2.5; Table 1.3; 20, 42, 63, 64, 102105 passim, 121, 286, 337, 350, 462, 470472665
+ + + + + + +
\glossary120660
+
glossary-bookindex package35, 293, 524621
+ + + + + +
glossary-longextra package293, 300, 395, 476526
+ + + + +
glossary-topic package293, 319, 449452 passim, 535
+ +
glossary2, 8, 128, 155, 239, 251, 356496
+ + + + + + +
glossary package120, 191, 226644
+ +
glossary entry fields
+
childcount359626
+
childlist
+ + +
descaccess376, 382, 384569
+ +
descpluralaccess377, 382, 384569
+ +
level149, 244496
+
loclist188, 189, 250, 288, 289, 478, 596, 597, 647663
+ +
prenumberlist133, 249, 250, 504596
+ + +
siblingcount445446
+
siblinglist445
+ + +
useriaccess377, 382385
+ +
useriiaccess377, 382385
+ +
useriiiaccess378, 383385
+ +
userivaccess378, 383385
+ +
uservaccess378, 383385
+ +
userviaccess378, 383386
+
glossary entry keys501
+ + +
category§4; 38, 39, 76, 135, 174, 180, 408, 410, 450455 passim, 460, 488, 501, 629, 641642
+ + + + + +
first§4; 126130 passim, 136, 161, 165170 passim, 177, 178, 186, 191, 194, 202, 228, 365, 367, 376, 399, 489, 502, 569, 583584
+ + + + + +
long§4; 75, 135, 136, 144147 passim, 161, 165, 177, 192, 197202 passim, 359, 377, 407, 503, 504, 542, 558, 571, 572, 623, 628636
+ + + +
name§4; 13, 20, 24, 30, 3439 passim, 52, 96100 passim, 127132, 147150 passim, 170, 185, 192, 203206, 217, 263, 264, 365, 368, 376, 399, 405, 407, 413, 417, 425, 447454 passim, 462, 474, 480, 483, 489, 495, 501, 504, 506, 507, 556, 558, 572, 573, 584, 594, 595, 629, 644664
+ +
parent§4; 127129, 148151 passim, 359, 364, 365, 496, 504, 573636
+
plural§4; 50, 126130 passim, 137, 138, 151, 165, 169, 177, 185, 192, 365, 367, 376, 444, 446, 453, 480, 489, 502, 504, 505, 573599
+ +
prefix§16; 367372 passim, 480, 505, 574, 636645
+ + + +
see§4; 41, 72, 8994 passim, 133135, 154, 160, 260265 passim, 397, 455457, 501, 505, 603, 656, 663664
+ + + + + +
sort§4; Table 4.1; 13, 20, 24, 44, 52, 9698, 128132 passim, 137, 147, 151, 156, 203206 passim, 242, 364, 365, 399, 401, 405, 407, 412, 413, 425, 432435 passim, 442, 447, 448, 454, 462, 466, 468, 475, 499, 506, 544, 576, 629664
+ + + + +
text§4; 34, 36, 129, 130, 136, 161, 165170 passim, 177, 185, 191, 194, 202, 228, 263, 264, 365, 367, 376, 399, 417, 423, 429, 453, 458, 489, 502, 504, 507, 577, 584611
+ +
type§4; 17, 21, 113, 132, 142, 152155 passim, 192, 193, 205, 251, 364, 365, 424, 432, 440, 507, 577, 629, 639644 passim
+ + + + + + + + + + + + +
glossary file +
+
glossary, ignored +
+
glossary styles86, 149, 248521
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
list§13.1.1; 7, 86, 87, 291, 297, 298, 326, 331335 passim, 373, 429, 525591
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

Gls

+ + + +
\gls-like160, 163496
+
\gls-like and \glstext-like options510
+ +
format§5.1.1; 161, 162, 190, 266271 passim, 280, 341, 342, 414, 419, 420, 464, 498, 510, 511560
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glsadd§10; 33, 72, 9294, 134, 234, 237, 254258 passim, 265, 273, 426, 429, 495, 510559
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glsdescwidth§13.1; 248, 293, 300305 passim, 309313 passim, 565
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glsentryfull§6.1; 200204 passim, 209215 passim, 570571
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glspagelistwidth§13.1; 293, 301305 passim, 309313 passim, 598
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glssee§11; 68, 8994 passim, 133, 259265 passim, 455457, 505, 602620
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\glstext-like160496
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

Glsxtr

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

H

+
hierarchical level129, 148496
+
homographTable 13.1; 149, 150, 333, 496, 525, 531, 532536
+ + + +
\hyperlink181, 267, 269, 283, 353566
+
hyperlink6, 30, 70, 75, 76, 109, 160162, 166, 176, 180, 184, 195, 196, 209, 237, 266269 passim, 273, 277, 352, 461, 495498
+ +
\hyperpage267275
+
hyperref packagec, 7, 24, 33, 34, 73, 81, 96, 159161, 165, 176, 180184 passim, 189, 190, 200, 245, 246, 266275 passim, 282, 283, 296, 329, 343, 352, 353, 387, 412, 423, 477, 567611
+ + + + +
\hypertarget181566
+
hypertarget70
+ + + +
+ +
+

I

+
\if@openright246
+
\ifcsstrequal364
+
\ifcsstring361
+
\ifcsundef357626
+
\ifcsvoid360635
+
\ifdef365
+
\ifdefstrequal363364
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ifundef365
+
ignored glossary252, 496643
+
ignored location (or record)266, 277496
+
imakeidx package112
+
\include152
+
\includegraphics483485
+
\index112, 254, 266, 271, 275, 280341
+
\indexentry279
+
indexing application497
+
indexing file18, 53, 65, 83, 91, 96, 106, 119123 passim, 155, 158, 184, 188, 189, 237240 passim, 244, 251256 passim, 264, 274279 passim, 286, 325, 337, 388, 395, 400, 465, 476, 497, 619, 640, 643, 657659663
+
indexing (or recording)8, 9196, 158, 162, 196, 237497
+
\indexname253660
+ +
\input36, 152, 244325
+
inputenc package136, 351, 387, 463475
+
\inputencodingname51, 103339
+
inter-sentence space222
+
inter-word space222
+
internal field497, +
+
internal field (bib2gls)497503
+
internal field label147, 184, 360365 passim, 376379, 484, 497, 556, 581, 582, 590, 614, 621626 passim, 630636 passim
+
invisible location +
+
\item291, 297, 299, 315316
+
itemize environment333
+ +
+ +
+

J

+
\jobname76, 123, 156665
+ +
+ +
+

L

+
\label8085 passim, 127, 156, 243513
+
\languagename102, 103339
+
latex (DVI)160
+
latexmk5354
+
latexrelease package7
+
Latin alphabet15, 42, 103497, +
+
Latin character495, 497498, +
+ +
link text158, 159, 163, 164498
+
\listbreak446
+
\loadglsentries§4.6; 11, 14, 19, 2732 passim, 36, 152154, 193639
+
location counter95, 135, 162, 163, 188, 251, 265, 269, 274278 passim, 289, 340343 passim, 418, 495, 498, 501, 510, 512, 561, 642, 651, 656659 passim
+
location, empty (or invisible)54, 162, 255, 256, 265, 266, 274278 passim, 470497, +
+
location encap (format)54, 57, 66, 161, 190, 254, 260, 266271 passim, 275283 passim, 289, 290, 341, 412, 418420, 466, 496, 497, 498, 510, 586, 587597
+
location, ignored/invisible +
+
location list12, 16, 19, 26, 28, 53, 55, 73, 82, 88, 89, 95, 124, 125, 133, 134, 149, 151, 158160, 183, 188, 189, 239, 244, 249256 passim, 260284 passim, 290, 293, 297313 passim, 321, 332, 333, 340, 348, 349, 391, 412, 413, 418, 419, 428, 429, 457, 458, 464, 472478 passim, 498, 554, 596663
+
location range
+ + +
longtable environment248, 292, 299308 passim, 335, 521529 passim, 598
+
longtable package87300
+
lowercase34, 194, 203, 222, 276, 278, 353, 402, 414, 494, 499593
+ +
+ +
+

M

+
\mainmatter279
+
\makeatletter224
+
\makeatother224
+
\makebox319
+ +
\makeglossaries§3.2; 5, 9, 1421 passim, 27, 43, 53, 65, 6972 passim, 91, 97, 102, 106108, 122124, 134, 155, 158, 239, 253, 259, 273, 279, 287, 338343 passim, 349351, 398, 413, 420, 425, 428, 433440 passim, 448, 452, 457, 459, 464466, 470, 473, 477, 481, 560, 601, 604, 640, 644647 passim, 652, 653, 657664 passim
+
makeglossaries-lite§1.6.2; 1721 passim, 54, 60, 102107 passim, 285, 339, 340, 388396 passim, 419, 422, 433, 437, 441, 463, 487, 537, 538, 620658
+ + + + + + + + + + + + + + + +
makeglossaries§1.6.1; 1722 passim, 43, 5266 passim, 83, 92, 102109 passim, 124, 125, 251, 259, 268, 277286 passim, 339, 340, 388396 passim, 419422 passim, 433, 437441 passim, 453, 463, 487, 490, 537, 538, 592, 605, 606, 620, 659663
+ + +
-e§1.6.1; 5458 passim, 124, 268419
+ + + + + + + + + + + + + + + + +
makeglossariesgui54491
+
\makeglossary120660
+
makeidx package112
+
makeindex14, 122, 497, 640, 646660
+
-c5961
+
-g16, 43, 5962
+
-lTable 1.3; 18, 5964 passim, 441
+
-o1764
+
-p5962
+
-r5962
+
-s17, 18, 58, 5964
+
-t64
+
\MakeLowercase494
+ +
\MakeTextUppercase640
+
\MakeUppercase
+
\mark-both
+
\markboth245
+
\markright246
+
math mode70, 159, 165, 166, 177, 182, 417608
+
memoir class79245
+
\memUChead245
+
mfirstuc packagea, 7, 34, 43, 119, 136, 137, 164168 passim, 183, 184, 353355, 474, 494, 546, 547, 593, 594, 640, 641, 654661
+ + + + + +
\midrule306307
+ +
multicol package319
+
multicols environment319321
+
multiple encaps54, 57, 268419, +
+
mwe-acr.tex491
+
mwe-acr-desc.tex491
+
mwe-gls.tex491
+
mwe package38, 40485
+ +
+ +
+

N

+
\nameref81
+
nameref package81
+ + +
\newacronym§6; 38, 39, 49, 113118 passim, 126136 passim, 144, 148, 152158 passim, 165, 191211 passim, 220, 223, 233, 261, 377, 389391, 396406 passim, 410, 438, 440, 483, 487, 501506 passim, 517, 544, 553, 563, 583, 584, 589, 593, 599, 607, 611642
+ +
\newacronymstyle§6.2.2; 210213 passim, 548, 615, 642, 648651 passim
+
\newdualentry257, 426428
+
\newglossary§9; 9, 56, 6064 passim, 89, 109, 135, 162, 239, 241, 246, 247, 251, 273, 340, 341, 357, 440642
+ +
\newglossaryentry§4; Table 1.1; 30, 72, 77, 89, 96, 98, 126, 134, 139, 144, 145, 152158 passim, 165, 191, 192, 202, 211, 233, 273, 367, 368, 391, 396, 399, 404, 420, 425, 439, 453, 459, 470, 473, 478483 passim, 501506 passim, 553, 641, 642, 643, 648656
+ + +
\newline128295
+ +
\newwrite156
+
\NoCaseChange
+
\nofiles108
+
\nohyperpage273
+
\noist§3.2; 124, 273, 338343 passim, 349351, 463466644
+
non-breaking space (~)206, 368, 480481
+
non-Latin alphabetTable 1.1; 6, 12, 19, 42, 103, 475498
+
non-Latin character42, 47, 50, 136, 137, 471498
+ +
\null240
+
number list +
+
\numberline78662
+
\Numberstring347, 348471
+ +
+ +
+

O

+ +
\onecolumn248
+
openright246
+
Option 1 (“noidx”)Table 1.1; 812 passim, 16, 42, 53, 66, 77, 82, 96101 passim, 110113 passim, 122, 126, 131133, 148, 155, 189, 225, 239, 249251, 259, 266271 passim, 275, 277, 288290, 473478 passim, 504, 596640
+ + + + + + +
+ +
+

P

+
page counter92, 251, 274276, 286, 345414
+
page compositor +
+
page listTable 1.2; 160644, +
+ + +
\par598
+
\part277470
+
part counter277
+
\PassOptionsToPackage107
+
PDF (Portable Document Format)6, 324, 379383 passim, 404, 484485
+
PDF bookmarks34, 35, 74, 158, 159, 183185, 200, 354, 372, 436, 494, 568580 passim, 629
+
PDF element379, 483, 484488
+
pdflatex160
+
\pdfstringdefDisableCommands200
+
\pdfstringdefPreHook270
+
period (.) +
+ + + + + + + +
\phantomsection245246
+
polyglossia package8, 44, 46, 74, 102339
+
post-description hook295, 498, 501, 563, 629644
+
post-link hook166, 176180 passim, 223, 403407 passim, 496, 498, 502, 563, 600, 626630
+ +
preamble
+
bib446
+
document16, 28, 44, 46, 122, 126, 127, 152, 155233
+
glossary84, 247, 248, 331, 546, 555, 645, 652655
+ +
\printglossary options8490 passim, 513
+ + + + + + + + + + +
sort§8.1; 97101 passim, 242, 438514
+ + + + + + + + + + + + + + +
print “unsrt” glossary commands498, 503, 622, 643657
+ + +
\PrintChanges120
+ +
\printglossary§8; a, 1519 passim, 46, 77, 119, 120, 156, 189, 239, 240, 244, 252, 253, 280, 324, 325, 339, 399, 413, 433, 476, 478, 496, 642, 643, 646, 647661
+ + +
\printnoidxglossary§8; 13, 97101 passim, 189, 239242 passim, 250, 252, 288, 290, 438, 514, 537, 596, 640646
+ + + +
\printunsrtglossaries§8; 2529 passim, 241, 420, 425, 428, 448, 453, 457, 459, 467473 passim, 478, 496647
+
\printunsrtglossary§8; 2228 passim, 33, 97, 126, 240244 passim, 252, 288, 323, 399, 413, 430, 478, 496, 498, 514, 643, 647648
+ + +
\protect92281
+
\protected@csedef366
+
\protected@csxdef366
+
\protected@edef175
+
\protected@write275
+
\providecommand427, 435, 436455
+ + + + +
+ +
+

R

+
ranges (locations)Table 1.1; 13, 16, 26, 59, 62, 188, 189, 254, 266277 passim, 282284, 288, 349, 350, 550606
+
\ref8, 82, 156601
+
\refstepcounter83, 85608
+
\relax123, 124, 130, 164, 275, 332, 359, 360, 506, 573632
+
relsize package204208 passim, 499
+ + +
report class246412
+ +
resource file498
+
resource options498, 514, 559560, +
+
abbreviation-sort-fallback398
+
append-prefix-field433482
+
break-at101, 448, 467468
+
category433
+
combine-dual-locations429
+
compact-ranges272
+
dual-category433
+
dual-prefix429433
+
dual-sort433
+
dual-type429433
+
entry-type-aliases455
+
ext-prefixes424
+
field-alias
+
field-aliases455
+
group
+
identical-sort-action447
+
ignore-fields399
+
label-prefix424, 429433
+
loc-counters418
+
max-loc-diff272
+
min-loc-range272
+
name-case-change3435
+
primary-location-formats418
+
replicate-fields3435
+
save-child-count323, 359, 445, 626636
+
save-locations3335, 82, 89, 262, 265, 498, 503514
+
save-loclist82
+
save-sibling-count445448 passim
+
selection25, 94, 135, 255, 256, 266, 473, 559560
+
set-widest319452
+
sort-field
+
sort-rule469
+
sort25, 3335, 97, 240, 433, 469473
+
src22, 25, 3335, 67, 398, 399, 429, 433469
+
suffixF272
+
suffixFF272
+
type433
+
write-preamble469
+
resource set498
+
\Roman16, 273276 passim, 344
+
\roman16, 273276 passim, 288
+ +
+ +
+

S

+
\S421
+ + + + + + + + + + + + + + + + + + + + +
sample-si.tex
+ + +
sample files
+ + +
sampleAcr.tex393, 399400
+ +
sampleacronyms.tex
+ +
sampleDB.tex152, 391393
+ + + + + + + + + + + + + +
sanitize96, 98499
+
scrwfile package73
+
\section30, 7881 passim, 245
+
section counter341, 343, 418, 421469
+ + +
sentence case164, 175, 183, 354, 369, 372641
+ + + + + + + + + + + + + + + + + + + + +
\setmainlanguage8
+
\setotherlanguage8
+ + + + +
shell escape15, 52, 73, 104107, 499, 658659
+
shellesc package105
+
siunitx package3479
+
small capitals (small caps)49, 194, 203209, 216, 279284 passim, 323, 353, 405, 407, 456, 494, 499, 583, 612614
+ +
\space206
+
space factor223
+
\spacefactor224
+
standard LaTeX extended Latin character12, 131499
+
standard location format267
+
stix package344464
+
\string338
+ + +
\subitem316
+
subsequent use129, 370499
+
\subsubitem316
+
supertabular environment308312 passim, 523, 524, 532535
+
supertabular package7, 87, 309312
+ + +
+ +
+

T

+
table counter162
+
table environment
+
table of contents78, 126, 159, 241, 245246
+
tabular environment232, 565598
+
tabularx environment164, 232598
+
tabularx package164, 232598
+
tagpdf package483
+
test files
+
texdoc387
+
texindy1558
+
\texorpdfstring34, 159, 270, 353611
+
\textbar330
+
\textbfTable 12.1; 266, 267, 289, 314414
+
textcase packagea, 165264
+
\textitTable 12.1
+
\textmdTable 12.1
+
\textrmTable 12.1
+
\textscTable 12.1; 49, 203208 passim, 216, 274, 499612
+
\textsfTable 12.1
+
\textslTable 12.1
+
\textsmaller204209 passim, 499
+
\textttTable 12.1
+
\textulc612
+
\textupTable 12.1; 612
+
\the212
+
\thecounter275, 277, 343, 345470
+ + + +
\theHcounter271, 275277, 343, 412, 413511
+
\thepage92, 106, 274276, 285287, 346, 348, 464, 466638
+
title case34, 168, 184, 355, 494, 546, 547577
+
\toprule306307
+
tracklang package8, 42, 47, 74, 75660
+
translator package8, 4451 passim, 74, 545665
+
\twocolumn248
+ +
+ +
+

U

+
\unskip127
+
uppercase203, 222, 276, 277, 284, 286, 353, 373, 405, 494, 499, 604, 614, 640641, +
+
URL (Uniform Resource Locator)41
+
UTF-812, 15, 43, 5052, 63, 103, 127, 131, 137, 340, 387, 463, 471, 475499
+ +
+ +
+

W

+
whatsit162500
+
wrglossary counter657
+
\write124
+ - +
+
+

X

+ + +
xindex15, 58497
+
xindy18, 122, 337351, 497, 506, 640, 646665
+ +
-I21, 63463
+ +
-MTable 1.3; 21, 22, 5963 passim, 463
+
-o21, 63463
+
-t21, 63463
+ +
xkeyval package183480
+
\xspace226
+
xspace packageTable 6.2; 226227
+
xtab package787
+

+

+


+1This style was supplied by Axel Menzel. + + diff --git a/macros/latex/contrib/glossaries/glossaries-user.pdf b/macros/latex/contrib/glossaries/glossaries-user.pdf index c69d8fb532..28434f8b5c 100644 Binary files a/macros/latex/contrib/glossaries/glossaries-user.pdf and b/macros/latex/contrib/glossaries/glossaries-user.pdf differ diff --git a/macros/latex/contrib/glossaries/glossaries-user.tex b/macros/latex/contrib/glossaries/glossaries-user.tex index 1e489709b6..7b9fd3fe22 100644 --- a/macros/latex/contrib/glossaries/glossaries-user.tex +++ b/macros/latex/contrib/glossaries/glossaries-user.tex @@ -1,1012 +1,11823 @@ -\documentclass[report,inlinetitle,noprint,wbprompt,x11names]{nlctdoc} - -\usepackage[inner=0.25in,outer=0.5in,includemp]{geometry} - -\usepackage{array} -\usepackage{alltt} -\usepackage{pifont} -\usepackage{textcomp} -\usepackage{amssymb} -\usepackage{accsupp} -\ifpdf - \usepackage{lmodern} - \usepackage{mathpazo} - \usepackage[scaled=.88]{helvet} - \usepackage{courier} - \usepackage{metalogo} -\else - \newcommand{\grimace}{{\fontencoding {U}\fontfamily{futs}\selectfont \char77}} - \providecommand{\XeLaTeX}{XeLaTeX} - \providecommand{\XeTeX}{XeTeX} - \providecommand{\LuaLaTeX}{LuaLaTeX} -\fi -\usepackage[colorlinks, - bookmarks, - linkcolor=blue, - urlcolor=Magenta4, - hyperindex=false, - pdfauthor={Nicola L.C. Talbot}, - pdftitle={User Manual for glossaries.sty}, - pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref} -\usepackage{xr-hyper} +% 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. If they haven't already +% been uploaded to CTAN, they will be shortly. + +\documentclass[titlepage=false,oneside,toc=listof, + fontsize=12pt,captions=tableheading]{scrbook} + +\usepackage{relsize} +\usepackage{mfirstuc-english} \usepackage[ - xindy, - nonumberlist, - toc, - nopostdot, - nogroupskip, - style=altlist -]{glossaries} -\usepackage{glossary-inline} + deephierarchy, + numberedsection, + abbreviations, + %debug=showwrgloss, + %showtargets=annoteleft + ]{nlctuserguide} -\pagestyle{headings} +\hypersetup{pdfauthor={Nicola Talbot}, + pdftitle={glossaries manual}, + bookmarksdepth=5} -\glsnoexpandfields +\GetTitleStringSetup{expand} -\renewcommand*{\glsseeformat}[3][\seename]{% - (\xmakefirstuc{#1} \glsseelist{#2}.)% -} - -\renewcommand*{\glossarypreamble}{% -\emph{This glossary style was setup using:} -\begin{ttfamily} -\begin{tabbing} -\cs{usepackage}[\=xindy,\\ -\+\>nonumberlist,\\ - toc,\\ - nopostdot,\\ - style=altlist,\\ - nogroupskip]\{glossaries\} -\end{tabbing} -\end{ttfamily} -} - -\renewcommand{\nlctdocmainencap}{} - -\makeglossaries - -\renewcommand{\importantfmt}{} -\renewcommand{\importantsymbolfont}[1]{\textcolor{red}{\bfseries\Huge#1}} - -\newcommand*{\xtrfont}[1]{\textcolor{teal}{#1}} - -\newcommand*{\codecomment}[1]{\emph{\rmfamily\color{gray}#1}} - -\makeatletter -\@nlctdoc@if@usingtexht -{ - % Need an extra line break in the html version - % (Don't have time to fiddle with cfg files!) - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{#1}\glstarget{#1}{\glossentryname{#1}}]\mbox{}\newline - \glossentrydesc{#1}\glspostdescription\space #2\newline}% - \newcommand*{\htmldoc}[2]{\href{#2.html}{\qt{#1}}} - \newcommand{\glsxtrnote}{\HCode{
}\gls{glossaries-extra}\HCode{}} - \newcommand{\bibglsnote}{\HCode{}\gls{bib2gls}\HCode{}} - \newenvironment{xtr}% - {\par - \HCode{

}}% - {\HCode{
}\par\noindent} - \newenvironment{bib2gls}% - {\par - \HCode{
}}% - {\HCode{
}\par\noindent} - - \newcommand{\commandpromptnote}{} - \newcommand{\maincommandpromptnote}{} - \newenvironment{important*}{\begin{important}\importantpar}{\end{important}} - \renewcommand{\S}{\HCode{&\#167;}} - \newcommand{\strong}[1]{\HCode{}#1\HCode{}} - \newcommand*{\linkanchor}[1]{\HCode{&\#128279;}} -} -{ - \externaldocument{glossaries-code} - \renewcommand{\idxmarker}{\textsuperscript{\xtrfont{\textdagger}}} - \newcommand*{\htmldoc}[2]{\qt{#1}} - \newcommand{\glsxtrnote}{% - \leavevmode\marginpar{\glslink{glossaries-extra}{\xtrfont{\footnotesize\styfmt{glossaries-extra.sty}}}}% - } - \newcommand{\bibglsnote}{% - \leavevmode\marginpar{{\footnotesize\glslink{bib2gls}{\xtrfont{\appfmt{bib2gls}}}}}% - } - \newenvironment{xtr}[1][\glsxtrnote]% - {% - \def\xtrmarginnote{#1}% - \setlength{\fboxrule}{4pt}% - \setlength\defwidth{\linewidth}% - \addtolength\defwidth{-2\fboxsep}% - \addtolength\defwidth{-2\fboxrule}% - \begin{lrbox}{\defsbox}% - \begin{minipage}[t]{\defwidth}% - \setlength\parindent{1em}% - \noindent\ignorespaces - }% - {% - \end{minipage}% - \end{lrbox}% - \par\vskip10pt\noindent - \xtrmarginnote - \fcolorbox{teal}{white}{\usebox{\defsbox}}\par\vskip10pt - \noindent\ignorespacesafterend - } - \newenvironment{bib2gls}{\begin{xtr}[\bibglsnote]}{\end{xtr}} - \newcommand{\commandpromptnote}{The \texttt{\bfseries\$} symbol in the instructions - indicates the command prompt. It should be omitted when copying the text. } - \newcommand{\maincommandpromptnote}{The command prompt is indicated with - \texttt{\bfseries\$} in this documentation. Don't type that character when - copying examples. } - - \def\verbatim@font{\MacroFont} - - \newenvironment{important*}% - {% - \renewcommand{\importantsymbolfont}[1]{\textcolor{red}{\bfseries\huge##1}}% - \begin{important}\importantpar[-2][-1ex]% - }% - {\end{important}} - \newcommand{\strong}{\textbf} - \newcommand{\linkanchor}[1]{} -} -\renewcommand*{\@isty}[1]{\index{#1 package=\styfmt{#1} - package|hyperpage}} -\renewcommand*{\s@isty}[1]{\index{#1 package=\doidxmarker\styfmt{#1} - package|hyperpage}} -\renewcommand*{\@icls}[1]{\index{#1 class=\clsfmt{#1} - class|hyperpage}} -\renewcommand*{\s@icls}[1]{\index{#1 class=\doidxmarker\clsfmt{#1} - class|hyperpage}} - -\renewrobustcmd*{\iterm}[1]{\index{#1|hyperpage}} - -\makeatother -\renewcommand*{\main}[1]{\hyperpage{#1}} -\newcommand*{\htextbf}[1]{\textbf{\hyperpage{#1}}} -\newcommand*{\itermdef}[1]{\index{#1|htextbf}} - -\newcommand{\itempar}[1]{\item[{#1}]\mbox{}\par} - -\newcommand{\Index}[1]{#1\index{#1|hyperpage}} - -\newcommand{\xtrpkgoptdef}[1]{\hypertarget{pkgopt:#1}{\pkgopt*{#1}}} -\newcommand{\pkgoptdef}[1]{\hypertarget{pkgopt:#1}{\pkgopt{#1}}} -\newcommand{\deppkgoptdef}[1]{\hypertarget{pkgopt:#1}{\deprecatedpkgopt{#1}}} - -\newcommand{\pkgoptsec}[2][]{% - \pdfbookmark[2]{#2}{pkgopt.#2} - \ifstrempty{#1}% - {\subsection*{\protect\pkgoptdef{#2}}}% - {\subsection*{\protect\pkgoptdef{#2}\pkgoptfmt{=\protect\marg{#1}}}}% -} - -\newcommand{\deppkgoptsec}[2][]{% - \pdfbookmark[2]{#2}{pkgopt.#2} - \ifstrempty{#1}% - {\subsection*{\protect\deppkgoptdef{#2}}}% - {\subsection*{\protect\deppkgoptdef{#2}\pkgoptfmt{=\marg{#1}}}}% -} - -\newcommand{\xtrpkgoptsec}[2][]{% - \pdfbookmark[2]{#2 (glossaries-extra.sty)}{pkgopt.#2} - \ifstrempty{#1}% - {\subsection*{\protect\xtrfont{\protect\xtrpkgoptdef{#2} (glossaries-extra.sty)}}}% - {\subsection*{\protect\xtrfont{\protect\xtrpkgoptdef{#2}\pkgoptfmt{=\protect\marg{#1}} - (glossaries-extra.sty)}}}% -} - -\newcommand{\glslike}{\hyperref[sec:gls-like]{\cs{gls}-like}} -\newcommand{\glstextlike}{\hyperref[sec:glstext-like]{\cs{glstext}-like}} - -\newcommand{\gallery}[2]{\href{https://www.dickimaw-books.com/gallery/#1}{#2}} -\newcommand{\galleryurl}[1]{\gallery{#1}{\nolinkurl{https://www.dickimaw-books.com/gallery/#1}}} -\newcommand{\gallerytopic}[1]{\gallery{\##1}{\styfmt{#1} gallery}} - -\newcommand*{\bibglsgallery}[2][\gallerytitle]{% - \def\gallerytitle{#2}% - \gallery{index.php?label=bib2gls-#2}{\appfmt{bib2gls} gallery: \gallerytitle}} - -\newcommand*{\bibglsbegin}{% - \href{http://mirrors.ctan.org/support/bib2gls/bib2gls-begin.pdf}{\styfmt{glossaries-extra} and \appfmt{bib2gls}: An Introductory Guide}} - -\IndexPrologue{\chapter*{\indexname} - \addcontentsline{toc}{chapter}{\indexname}% - \markboth{\indexname}{\indexname} - \par\idxmarker Requires \gls{glossaries-extra}. -} - -\longnewglossaryentry{indexingapp}% -{ - name={Indexing application}, - text={indexing application} -}% -{% - An application (piece of software) separate from - \TeX/\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 glossary entry. - There are two main indexing applications that are used with \TeX: - \gls{makeindex} and \gls{xindy}. These are both - \gls{cli} applications. -} - -\longnewglossaryentry{cli} -{ - name={Command Line Interface (CLI)}, - first={command line interface (CLI)}, - text={CLI} -} -{% - 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 - \href{http://www.dickimaw-books.com/latex/novices/html/terminal.html}{a command - prompt or terminal}. \maincommandpromptnote -} - -\longnewglossaryentry{xindy}{% - name={\appfmt{xindy}\index{xindy=\appfmt{xindy}|htextbf}}, - sort={xindy}, - text={\appfmt{xindy}\iapp{xindy}} -}% -{% - A flexible \gls{indexingapp} with multilingual - support written in Perl. See \opt3. -} - -\newglossaryentry{makeindex}{% -name={\appfmt{makeindex}\index{makeindex=\appfmt{makeindex}|htextbf}},% -sort={makeindex},% -text={\appfmt{makeindex}\iapp{makeindex}},% -description={An \gls{indexingapp}. See \opt2.} -} - -\newglossaryentry{bib2gls}{% -name={\appfmt{bib2gls}\index{bib2gls=\doidxmarker\appfmt{bib2gls}|htextbf}},% -sort={bib2gls},% -text={\appfmt{bib2gls}\iapp*{bib2gls}},% -description={An \gls{indexingapp} that combines two functions in -one: (1) fetches entry definition from a \filetype{bib} file -based on information provided in the \filetype{aux} file (similar -to \appfmt{bibtex}); (2) hierarchically sorts and collates location -lists (similar to \gls{makeindex} and \gls{xindy}). -This application is designed for use with \gls{glossaries-extra} -and can't be used with just the base \styfmt{glossaries} package. -See \opt4.} -} - -\newglossaryentry{convertgls2bib}{% -name={\appfmt{convertgls2bib}\index{convertgls2bib=\doidxmarker\appfmt{convertgls2bib}|htextbf}},% -sort={convertgls2bib},% -text={\appfmt{convertgls2bib}\iapp*{convertgls2bib}},% -description={An application provided with \gls{bib2gls} that -converts \filetype{tex} files containing entry definitions to -\filetype{bib} files suitable for use with \gls{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 -\gls{convertgls2bib} only has a limited set of known commands. You -can limit it so that it only parses the preamble with the -\texttt{-{}-preamble-only} switch (requires at least \gls{bib2gls} -v2.0).} -} - -\newglossaryentry{makeglossaries}{% -name={\appfmt{makeglossaries}\index{makeglossaries=\appfmt{makeglossaries}|htextbf}},% -sort={makeglossaries},% -text={\appfmt{makeglossaries}\iapp{makeglossaries}},% -description={A custom designed Perl script interface -to \gls{xindy} and \gls{makeindex} provided with the \styfmt{glossaries} -package. \TeX\ distributions on Windows convert the original -\texttt{makeglossaries} script into an executable -\texttt{makeglossaries.exe} for convenience (but Perl is still -required).} -} - -\newglossaryentry{makeglossaries-lite.lua}{% -name={\appfmt{makeglossaries-lite}\index{makeglossaries-lite=\appfmt{makeglossaries-lite}|htextbf}},% -sort={makeglossaries-lite},% -text={\appfmt{makeglossaries-lite}\iapp{makeglossaries-lite}},% -description={A custom designed Lua script interface -to \gls{xindy} and \gls{makeindex} provided with the \styfmt{glossaries} -package. This is a cut-down alternative to the Perl -\gls{makeglossaries} script. If you have Perl installed, use the -Perl script instead. This script is actually distributed with the -file name \texttt{makeglossaries-lite.lua}, but \TeX~Live -(on Unix-like systems) creates a symbolic link -called \texttt{makeglossaries-lite} (without the \texttt{.lua} -extension) to the actual \texttt{makeglossaries-lite.lua} script.} -} - -\longnewglossaryentry{makeglossariesgui}{% -name={\appfmt{makeglossariesgui}\index{makeglossariesgui=\appfmt{makeglossariesgui}|htextbf}},% -sort={makeglossariesgui},% -text={\appfmt{makeglossariesgui}\iapp{makeglossariesgui}}% -}% -{% - A Java GUI alternative to \gls{makeglossaries} that - also provides diagnostic tools. Available separately on - \href{http://ctan.org/pkg/makeglossariesgui}{CTAN}. -} - -\newglossaryentry{numberlist}{% -name={Number list\itermdef{number list}},% -sort={number list},% -text={number list\iterm{number list}},% -description={A list of \glslink{entrylocation}{entry locations} (also -called a location list). The number list can be suppressed using the -\pkgopt{nonumberlist} package option.} -} - -\newglossaryentry{entrylocation}{% -name={Entry location\itermdef{entry location}},% -sort={entry location},% -text={entry location\iterm{entry location}},% -description={The location of the entry in the document. This -defaults to the page number on which the entry appears. An entry may -have multiple locations.} -} +\renewcommand*{\thispackagename}{glossaries} +\renewcommand{\cmdnotefmt}[1]{} -\newglossaryentry{locationlist}{% -name={Location list},% -text={location list}, -sort={location list},% -description={A list of \glslink{entrylocation}{entry locations}. -See \gls{numberlist}.}% -} - -\newglossaryentry{linktext}{% -name={Link text\itermdef{link text}}, -sort={link text},% -text={link text\iterm{link text}}, -description={The text produced by commands such as \ics{gls}. It may -or may not be a hyperlink to the glossary.} -} - -\newglossaryentry{smallcaps}{% - name={Small caps\itermdef{small caps}}, - sort={small caps}, - text={small caps\iterm{small caps}}, - description={Small capitals. The \LaTeX\ kernel provides - \ics{textsc}\marg{text} to produce small capitals. This uses a - font where lowercase letters have a small capital design. - Uppercase letters have the standard height and there's no - noticeable difference with uppercase characters in corresponding non-small caps fonts. - This means that for a small caps appearance, you need to use lowercase letters in the - \meta{text} argument. The \isty{relsize} package provides - \ics{textsmaller}\marg{text} which simulates small caps by reducing the size - of the font, so in this case the contents of \meta{text} should be - uppercase (otherwise the effect is simply smaller 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.} -} - -\let\glsd\glsuseri -\let\glsation\glsuserii - -\longnewglossaryentry{firstuse}{% -name={First use\ifirstuse}, -sort={first use},% -text={first use},% -user1={first used}} -{% - The first time a glossary entry is used (from the start of the - document or after a reset) with one of the - following commands: \ics{gls}, \ics{Gls}, \ics{GLS}, \ics{glspl}, - \ics{Glspl}, \ics{GLSpl} or \ics{glsdisp}. - \glsseeformat{firstuseflag,firstusetext}{} -} - -\longnewglossaryentry{firstuseflag}{% -name={First use flag\ifirstuseflag}, -sort={first use flag},% -text={first use flag}% -} -{% - A conditional that determines whether or not the entry - has been used according to the rules of \gls{firstuse}. Commands - to unset or reset this conditional are described in - \sectionref{sec:glsunset}. -} - -\newglossaryentry{firstusetext}{% -name={First use text\ifirstusetext}, -sort={first use text},% -text={first use text},% -description={The text that is displayed on \gls{firstuse}, which is -governed by the \gloskey{first} and \gloskey{firstplural} keys of -\ics{newglossaryentry}. (May be overridden by -\ics{glsdisp} or by \ics{defglsentry}.)}% -} - -\longnewglossaryentry{sanitize}{% -name={Sanitize\itermdef{sanitize}},% -sort={sanitize}, -text={sanitize\iterm{sanitize}},% -user1={sanitized\protect\iterm{sanitize}},% -user2={sanitization\protect\iterm{sanitize}}% -}% -{% - Converts command names into character sequences. That is, a command called, - say, \cs{foo}, is converted into the sequence of characters: - \cs{}, \texttt{f}, \texttt{o}, \texttt{o}. Depending on the font, - the backslash character may appear as a dash when used in the - main document text, so \cs{foo} will appear as: ---foo. - - Earlier versions of \styfmt{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. -} - -\newglossaryentry{latinchar}{% - name={Latin Character\itermdef{Latin character}}, - text={Latin character\iterm{Latin character}}, - sort={Latin character}, - description={One of the letters \texttt{a}, \ldots, \texttt{z}, - \texttt{A}, \ldots, \texttt{Z}\@. - See also \gls{exlatinchar}.} -} - -\newglossaryentry{exlatinchar}{% - name={Extended Latin Character\itermdef{extended Latin character}}, - text={extended Latin character\iterm{extended Latin character}}, - sort={extended Latin character}, - description={A character that's created by combining \glspl{latinchar} - to form ligatures (e.g.\ \ae) or by applying diacritical marks - to a~\gls*{latinchar} or characters (e.g.\ \'a). - See also \gls{nonlatinchar}.} -} - -\newglossaryentry{latexexlatinchar}{% - name={Standard \LaTeX\ Extended Latin Character\itermdef{standard -\LaTeX\ extended Latin character}}, - text={standard \LaTeX\ extended Latin character\iterm{standard -\LaTeX\ extended Latin character}}, - sort={standard LaTeX extended Latin character}, - description={An \gls{exlatinchar} that can be created by a~core -\LaTeX\ command, such as \cs{o} (\o) or \cs{'}\texttt{e} (\'e). - That is, the character can be produced without the need to load - a~particular package.} -} - -\newglossaryentry{nonlatinchar}{% - name={Non-Latin Character\itermdef{non-Latin character}}, - text={non-Latin character\iterm{non-Latin character}}, - sort={non-Latin character}, - description={An \gls{exlatinchar} or a~character that isn't - a~\gls{latinchar}.} -} - -\newglossaryentry{latinalph}{% - name={Latin Alphabet\itermdef{Latin alphabet}}, - text={Latin alphabet\iterm{Latin alphabet}}, - sort={Latin alphabet}, - description={The alphabet consisting of \glspl{latinchar}. - See also \gls{exlatinalph}.} -} - -\newglossaryentry{exlatinalph}{% - name={Extended Latin Alphabet\itermdef{Extended Latin Alphabet}}, - text={extended Latin alphabet}, - sort={extended Latin alphabet}, - description={An alphabet consisting of \glspl{latinchar} - and \glspl{exlatinchar}.} -} - -\newglossaryentry{nonlatinalph}{% - name={Non-Latin Alphabet\itermdef{Non-Latin Alphabet}}, - text={non-Latin alphabet}, - sort={non-Latin alphabet}, - description={An alphabet consisting of \glspl{nonlatinchar}.} -} - -\newglossaryentry{UTF-8}{% - name={UTF-8\itermdef{UTF-8}}, - text={UTF-8}, - sort={UTF-8}, - description={A variable-width character encoding. 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 causes -complications. Related blog article: \href{https://www.dickimaw-books.com/blog/binary-files-text-files-and-file-encodings/}{Binary Files, Text Files and File Encodings}.} -} - -\newglossaryentry{glossaries-extra}{% - name={\styfmt{glossaries-extra}}, - sort={glossaries-extra}, - description={A separate package that extends the - \styfmt{glossaries} package, providing new features or improving - existing features. If you want to use \styfmt{glossaries-extra}, - you must have both the \styfmt{glossaries} package and the - \styfmt{glossaries-extra} package installed.} -} - - -\doxitem{Option}{option}{package options} -\doxitem{GlsKey}{key}{glossary keys} -\doxitem{Style}{style}{glossary styles} -\doxitem{Counter}{counter}{glossary counters} - -\setcounter{IndexColumns}{2} - -\newcommand*{\tick}{\ding{51}} - -\newcommand*{\yes}{\ding{52}} -\newcommand*{\no}{\ding{56}} - -\newcommand*{\proyes}{\textcolor{green}{\yes}} -\newcommand*{\prono}{\textcolor{red}{\no}} - -\newcommand*{\conyes}{\textcolor{red}{\yes}} -\newcommand*{\conno}{\textcolor{green}{\no}} - -\makeatletter -\newcommand{\fnsymmark}[1]{#1} -\newcommand*{\fnsym}[1]{\textsuperscript{\fnsymmark{% - \ifcase#1\or \textasteriskcentered \or \textdagger - \or \textdaggerdbl \or \textsection - \or $\lozenge$\or \textparagraph - \or \#\or {\fontfamily{cmr}\selectfont\textreferencemark}% - \or \@nlctdoc@if@usingtexht{\HCode{&\#x2051;}}{\shortstack{*\\[-1.5ex]*}}% - \or $\star$% - \or \ding{94}% - \else - \number#1 - \fi -}}}% -\newrobustcmd*{\optionlabel}[1]{\@glstarget{option#1}{Option~#1}} - -\newcommand*{\plabel}[2][]{\linkanchor{#2}\protected@edef\@currentlabelname{#1}\label{#2}} -\makeatother - -\newcounter{option} -\newcommand{\optionsec}[2][\opttitle]{% - \def\opttitle{\appfmt{#2}}% - \refstepcounter{option}% - \pdfbookmark[2]{Option~\theoption\space (#2)}{option\theoption}% - \subsection*{\linkanchor{option\theoption}\optionlabel{\theoption} (#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}} + +\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{\printglossoptdef}[1]{\inlineglsdef[optdef]{opt.printgloss.#1}} + +\newcommand{\inlineglostyledef}[1]{\inlineglsdef[optdef]{opt.glostyle.#1}} +\newcommand{\glostyledef}[1]{\optiondef{glostyle.#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[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, } -\newcommand*{\opt}[1]{\hyperlink{option#1}{Option~#1}} -\newcommand*{\optsor}[2]{Options~\hyperlink{option#1}{#1} -or~\hyperlink{option#2}{#2}} -\newcommand*{\optsand}[2]{Options~\hyperlink{option#1}{#1} -and~\hyperlink{option#2}{#2}} -\newcommand*{\optsto}[2]{Options~\hyperlink{option#1}{#1}--\hyperlink{option#2}{#2}} - -\renewcommand*{\idxmarkedfont}{\xtrfont} - -\newcommand*{\ifirstuse}{\iterm{first use}} -\newcommand*{\ifirstuseflag}{\iterm{first use>flag}} -\newcommand*{\ifirstusetext}{\iterm{first use>text}} - -\newcommand*{\firstuse}{\gls{firstuse}} -\newcommand*{\firstuseflag}{\gls{firstuseflag}} -\newcommand*{\firstusetext}{\gls{firstusetext}} - - -\newcommand*{\istkey}[1]{\appfmt{#1}\index{makeindex=\appfmt{makeindex}>#1=\texttt{#1}|hyperpage}} -\newcommand*{\locfmt}[1]{\texttt{#1}\SpecialMainIndex{#1}} -\newcommand*{\mkidxspch}{\index{makeindex=\appfmt{makeindex}>special characters|hyperpage}} - -\newcommand*{\mkidxopt}[1]{\texttt{-#1}\index{makeindex=\appfmt{makeindex}>#1=\texttt{-#1}|hyperpage}} - -\newcommand*{\xdyopt}[1]{\texttt{-#1}\index{xindy=\appfmt{xindy}>#1=\texttt{-#1}|hyperpage}} - -\newcommand*{\mkglsopt}[1]{\texttt{-#1}\index{makeglossaries=\appfmt{makeglossaries}>#1=\texttt{-#1}|hyperpage}} - -\newcommand*{\bibglsopt}[1]{\xtrfont{\texttt{-{}#1}}\index{bib2gls=\doidxmarker\appfmt{bib2gls}>#1=\texttt{-{}#1}|hyperpage}} -\newcommand*{\bibglslongopt}[1]{\bibglsopt{-#1}} - -\renewcommand{\csoptfmt}{\texttt} - -\newcommand*{\igloskey}[2][newglossaryentry]{\icsopt{#1}{#2}} -\newcommand*{\gloskey}[2][newglossaryentry]{\csopt{#1}{#2}} - -\newcommand*{\ixtrgloskey}[2][newglossaryentry]{\icsopt*{#1}{#2}} -\newcommand*{\xtrgloskey}[2][newglossaryentry]{\xtrfont{\csopt*{#1}{#2}}} - -\newcommand*{\printglosskey}[2][]{\icsopt{printglossary}{#2}% - \ifstrempty{#1}{\csoptfmt{#2}}{\csoptfmt{#2=#1}}% +\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}% + \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 } -\newcommand*{\printnoidxglosskey}[2][]{\icsopt{printnoidxglossary}{#2}% - \ifstrempty{#1}{\csoptfmt{#2}}{\csoptfmt{#2=#1}}% +\newcommand{\summaryentryglossarystyle}[1]{% + {% + \renewcommand*{\glostylefmt}[1]{\texttt{##1}}% + \genericsummaryentryoption{#1}% + }% } -\newcommand*{\xtrprintglosskey}[2][]{\icsopt*{printglossary}{#2}% - \xtrfont{\ifstrempty{#1}{\csoptfmt{#2}}{\csoptfmt{#2=#1}}}% +\newcommand{\summaryentryacronymstyle}[1]{% + {% + \renewcommand*{\acrstylefmt}[1]{\texttt{##1}}% + \genericsummaryentryoption{#1}% + }% } -\newcommand*{\iresourceopt}[1]{\icsopt+{GlsXtrLoadResources}{#1}} -\newcommand*{\resourceopt}[2][]{% - \xtrfont{\csoptfmt{#2}}\ifstrempty{#1}{}{\csoptfmt{\dequals#1}}% - \icsopt+{GlsXtrLoadResources}{#2}% +\renewcommand{\nlctuserguideletterrules}{% + \glsxtrGeneralLatinAtoGrules + \string#1=\texttt{@#1}|hyperpage}} - -\newcommand*{\xtrcs}[1]{\xtrfont{\cs{#1}}} - -\newcommand*{\field}[1]{\csoptfmt{#1}\index{internal fields:>#1=\protect\csoptfmt{#1}|main}} -\newcommand*{\xtrfield}[1]{\xtrfont{\csoptfmt{#1}}\index{internal fields:>#1=\doidxmarker\protect\csoptfmt{#1}|main}} - -\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles:>#1={\protect\ttfamily#1}|main}} - -\newcommand*{\xtrglostyle}[1]{\xtrfont{\textsf{#1}}\index{glossary styles:>#1=\doidxmarker{\protect\ttfamily#1}|main}} - -\newcommand*{\acrstyle}[1]{\textsf{#1}\index{acronym styles:>#1={\protect\ttfamily#1}|main}} -\newcommand*{\abbrstyle}[1]{\xtrfont{\textsf{#1}}\index{abbreviation styles:=\doidxmarker abbreviation styles:>#1={\protect\ttfamily#1}|main}} -\newcommand*{\cat}[1]{\xtrfont{\textsf{#1}}\index{categories=\doidxmarker categories>#1={\protect\ttfamily#1}|main}} - -\makeatletter -\@nlctdoc@if@usingtexht -{ - \newcommand*{\icatattrs}[1][]{\index{category attributes=\doidxmarker category attributes#1|main}} - \newcommand*{\ixindyattrs}[1][]{\index{xindy attributes=xindy attributes#1|main}} - \index{attributes|see{category attributes or xindy attributes}} -} +\nlctuserguidegls[selection=all,max-loc-diff=3] { -\newcommand{\icatattrs}[1][]{\index{category attributes=\protect\doidxmarker\protect\glsdohypertarget{catattr}{category attributes}:#1|main}} - -\newcommand*{\ixindyattrs}[1][]{\index{xindy attributes=\protect\glsdohypertarget{xindyattr}{xindy attributes}#1|main}} + \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\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-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-xr.tex + \gfile{example\dhyphen glossaries\dhyphen xr.tex}% + {\providedby{\sty{glossaries-extra} v1.16+}}% + % 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-.ldf + \gfilemeta{glossaries\dhyphen}{lang}{.ldf}{} + % glossaries-dictionary-.dict + \gfilemeta{glossaries\dhyphen dictionary\dhyphen }{Lang}{.dict}{} + % glossaries--.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{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 + case-change. 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{datatool}{}% datatool.sty + \gpkg{datatool\dhyphen base}{}% datatool-base.sty + % \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}{} + \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}}% + } + \gapp{xindy}% + {% + \common + \syntax{\meta{options} \meta{\idx{indexingfile}}}% + \desc{a flexible \idx{indexingapp} with multilingual support + written in Perl. See \option{xdy}} + } + \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. + 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{documentpreamble} 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}} + } + % \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: 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{inset}} + \desc{a synonym for \gls{gls} defined by the + \opt{shortcuts} package option} + } + % \Ac + \gcmdsp{Ac}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Gls} defined by the + \opt{shortcuts} package option} + } + % \acp + \gcmdsp{acp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{glspl} defined by the + \opt{shortcuts} package option} + } + % \Acp + \gcmdsp{Acp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Glspl} defined by the + \opt{shortcuts} package option} + } + % \acs + \gcmdsp{acs}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrshort} defined by the + \opt{shortcuts} package option} + } + % \Acs + \gcmdsp{Acs}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Acrshort} defined by the + \opt{shortcuts} package option} + } + % \acsp + \gcmdsp{acsp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrshortpl} defined by the + \opt{shortcuts} package option} + } + % \Acsp + \gcmdsp{Acsp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Acrshortpl} defined by the + \opt{shortcuts} package option} + } + % \acl + \gcmdsp{acl}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrlong} defined by the + \opt{shortcuts} package option} + } + % \aclp + \gcmdsp{aclp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrlongpl} defined by the + \opt{shortcuts} package option} + } + % \Acl + \gcmdsp{Acl}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Acrlong} defined by the + \opt{shortcuts} package option} + } + % \Aclp + \gcmdsp{Aclp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Acrlongpl} defined by the + \opt{shortcuts} package option} + } + % \acf + \gcmdsp{acf}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrfull} defined by the + \opt{shortcuts} package option} + } + % \acfp + \gcmdsp{acfp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{acrfullpl} defined by the + \opt{shortcuts} package option} + } + % \Acf + \gcmdsp{Acf}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \desc{a synonym for \gls{Acrfull} defined by the + \opt{shortcuts} package option} + } + % \Acfp + \gcmdsp{Acfp}% + {% + \syntax{\margm{options}\margm{entry-label}\margm{inset}} + \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{\meta{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} + } + % \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} + } + % \glsXX + \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{glossarypreamble} 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{glossarypreamble} 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{glossarypreamble} 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{glossarypreamble} + 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\-glossaries}% + {% + \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\-noidx\-glossaries}% + {% + \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\-unsrt\-glossaries}% + {% + \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}} + } + % \printunsrtinnerglossary + \gxtrcmd{print\-unsrt\-inner\-glossary}% + {% + \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\-glossary}% + {% + \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\-noidx\-glossary}% + {% + \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} + }% + % \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} + } + % \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} + } + % \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} + } + % \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}} + } + % \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}} + } + % \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}} + } + % \glsxtrlocfmt + \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} + } + % 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} + } + % \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) + % \glsaccsupp + \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}} + } + % \glsxtraccsupp + \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}} + } + % \glsxtraccsupp + \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} + } + % 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} + } + % \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 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{glossarypreamble} 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 + \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 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 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}. The default is \optval{toc}{false} with + \sty{glossaries} and \optval{toc}{true} with \sty{glossaries-extra}} + } + % 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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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}} + \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 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 + \gxtrglosfield{child\-count}% + {% + \desc{used with the \resourceopt{save-child-count} resource + option to store the entry's child count} + } + % 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 + % 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 + % 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 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+{bibpreamble} (\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- + \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{glossarypreamble} + { + \name{glossary} + \field{first}{glossary preamble} + \field{text}{preamble} + \field{parent}{idx.preamble} + } + \gidx{documentpreamble} + { + \common + \name{document} + \field{first}{document preamble} + \field{text}{preamble} + \field{parent}{idx.preamble} + } + \gidx{bibpreamble} + { + \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}} + % COMMANDS: GENERAL + \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\-contents\-line}{}% \addcontentsline + \gcmd{en\-sure\-math}{}% \ensuremath + \gcmd{def}{}% \def + \gcmd{gdef}{}% \gdef + \gcmd{space}{\common}% \space + \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{makebox}{}% \makebox + \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 + \gcmdmeta{theH}{counter}{}{}% \theH + \gcmd{At\-Be\-gin\-Doc\-u\-ment}{}% \AtBeginDocument + \gcmd{cite}{}% \cite + \gcmd{ref}{}% \ref + \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{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 + \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}% \ + {% + \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{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 internal \idx{field} may refer to a key that shouldn't be + used in the \ext{bib} file (\idx{bib2glsinternalfield}), such as + the \gloskey{group} field, or it 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. + There are two main indexing applications that are used with \TeX: + \app+{makeindex} and \app+{xindy}. (There is also a new + application called \app{xindex}, but this isn't supported by + \sty{glossaries} or \sty{glossaries-extra}.) The \sty{glossaries-extra} + package additionally supports \app{bib2gls}. 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}} + } + \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 + for use in modifying \idx{acronym} or \idx{abbreviation} commands to convert + the short form to \idx{lowercase} for \idx{smallcaps} styles, + but isn't actually used by any of the commands provided by + \sty{glossaries}. This command should be preferred to + the robust \gls{MakeLowercase} if expansion is required.\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{\TeX\ has 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 begin 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} + \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} + } + % 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{label=bib2gls-#2}{\appfmt{bib2gls} gallery: \gallerytitle}} -\index{attributes|see{\protect\hyperlink{catattr}{category attributes} (\styfmt{glossaries-extra}) or \protect\hyperlink{xindyattr}{xindy attributes}\protect\hfill}} -} +\newcommand*{\bibglsbegin}{% + \ctansupportmirror{bib2gls/bib2gls-begin.pdf}{\styfmt{glossaries-extra} and \appfmt{bib2gls}: An Introductory Guide}} -\makeatletter -\newcommand*{\optfmt}[1]{\textsf{#1}} -\newcommand*{\attr}[1]{\xtrfont{\optfmt{#1}}\icatattrs[>#1=\optfmt{#1}]{}} -\newcommand*{\xindyattr}[1]{\texttt{#1}\ixindyattrs[>#1=\texttt{#1}]{}} +\newcommand{\glsxtrnote}{\sidenote{\sty{glossaries-extra}}} +\newcommand{\bibglsnote}{\sidenote{\app{bib2gls}}} -\newrobustcmd{\mirrorsamplefile}[1]{% - \href{http://mirrors.ctan.org/macros/latex/contrib/glossaries/samples/#1}{\nolinkurl{#1}}% -} +\newenvironment{xtr} +{\begin{information}[title={\sty{glossaries-extra}}]} +{\end{information}} -\newcounter{sample} -\newcommand{\exitem}[2][sample]{% - \par - \pdfbookmark[2]{#1#2.tex}{exfile.#1#2}% - \refstepcounter{sample}% - \subsection*{\plabel[#1#2.tex]{ex:#1#2}\mirrorsamplefile{#1#2.tex}}% -} +\newenvironment{bib2gls} +{\begin{information}[title={\app{bib2gls}}]} +{\end{information}} -\newcommand*{\samplefile}[2][sample]{% - \hyperref[ex:#1#2]{\texttt{#1#2.tex}}} +\title{User Manual for glossaries.sty v4.50} +\author{Nicola L.C. Talbot\\% + \href{http://www.dickimaw-books.com/contact}{\nolinkurl{dickimaw-books.com/contact}}} +\date{2022-10-14} \begin{document} -\MakeShortVerb{"} -\DeleteShortVerb{\|} - - \title{User Manual for glossaries.sty v4.49} - \author{Nicola L.C. Talbot\\% - \href{http://www.dickimaw-books.com/contact}{\nolinkurl{dickimaw-books.com/contact}}} +\maketitle - \date{2021-11-01} - \maketitle +\htmlavailable \begin{abstract} -The \styfmt{glossaries} package provides a means to define terms or -abbreviations or symbols that can be referenced within your document. -Sorted lists with collated \glslink{entrylocation}{locations} can be -generated either using \TeX\ or using a supplementary \gls{indexingapp}. -Sample documents are provided with the \styfmt{glossaries} package. +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 \gls{glossaries-extra} which, if required, +the extension package \sty+{glossaries-extra} which, if required, needs to be installed separately. New features will be added to -\gls*{glossaries-extra}. Versions of the \styfmt{glossaries} +\sty{glossaries-extra}. Versions of the \sty{glossaries} package after v4.21 will mostly be just bug fixes or minor -maintenance. Note that \gls{glossaries-extra} provides an extra indexing option -(\gls{bib2gls}) which isn't available with just the base \styfmt{glossaries} package. +maintenance. The most significant update 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. + +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 separately install -the relevant language module. Each language module is distributed -under the name \texttt{glossaries-}\meta{language}, where \meta{language} is the -root language name. For example, \texttt{glossaries-french} -or \texttt{glossaries-german}. If a language module is required, -the \styfmt{glossaries} package will automatically try to load it and -will give a warning if the module isn't found. See +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 \pkgopt{nolangwarn} package option to suppress the warning +the \opt{nolangwarn} package option to suppress the warning and provide your own translations. (For example, use -the \gloskey[printglossary]{title} key in \cs{printglossary}.) - -The \styfmt{glossaries} package requires a number of other packages -including, but not limited to, \sty{tracklang}, \sty{mfirstuc}, -\sty{etoolbox}, -\sty{xkeyval} (at least version dated 2006/11/18), \sty{textcase}, -\sty{xfor}, \sty{datatool-base} (part of the \sty{datatool} bundle) and \sty{amsgen}. These -packages are all available in the latest \TeX~Live and Mik\TeX\ -distributions. If any of them are missing, please update your -\TeX\ distribution using your update manager. -For help on this see, for example, -\href{http://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How -do I update my \TeX\ distribution?} -or (for Linux users) -\href{http://tex.stackexchange.com/questions/14925/updating-tex-on-linux}{Updating -\TeX\ on Linux}. - -Note that occasionally you may find that certain packages need to be -loaded \emph{after} packages that are required by \styfmt{glossaries}. For -example, a package \meta{X} might need to be loaded after \sty{amsgen}. In -which case, load the required package first (for example, -\sty{amsgen}), then \meta{X}, and finally load \styfmt{glossaries}. +the \printglossopt{title} key in \gls{printglossary}.) \begin{important} -Documents have wide-ranging styles when it comes to presenting glossaries +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 glossary. They may just have symbols with +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 \styfmt{glossaries} package is +complicated descriptions. The \sty{glossaries} package is flexible enough to accommodate such varied requirements, but this flexibility comes at a price: a~big manual. -\aargh\ If you're freaking out at the size of this manual, start with -\texttt{glossariesbegin.pdf} (\qt{The glossaries package: a guide -for beginnners}). You should find it in the same directory as this -document or try \texttt{texdoc glossariesbegin.pdf}. Once you've got -to grips with the basics, then come back to this manual to find out -how to adjust the settings. +\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} -\noindent -The \styfmt{glossaries} bundle includes the following documentation: -\begin{description} -\item[\url{glossariesbegin.pdf}] -If you are a complete beginner, start with -\htmldoc{The glossaries package: a guide for -beginners}{glossariesbegin}. +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} -\item[glossaries-user.pdf] -This document is the main user guide for the \styfmt{glossaries} +\itemtitle{User Manual for glossaries.sty (\filefmt{glossaries-user.pdf)}} + +\begin{itemdesc} +This document is the main user guide for the \sty{glossaries} package. +\end{itemdesc} + +\itemtitle{Documented Code for glossaries (\url{glossaries-code.pdf})} -\item[\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 v4.49}. +\qt{Documented Code for glossaries v4.50}. +\end{itemdesc} -\item[CHANGES] Change log. +\itemtitle{\url{CHANGES}} +\begin{itemdesc} +Change log. +\end{itemdesc} -\item[README.md] Package summary. +\itemtitle{\url{README.md}} -\end{description} +\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 \href{http://www.dickimaw-books.com/faqs/glossariesfaq.html}{\styfmt{glossaries} -FAQ} +\item \faqspkg{glossaries} \item \gallerytopic{glossaries} \item -\gallery{glossaries-styles/}{a summary of all glossary styles provided by \styfmt{glossaries} and -\gls*{glossaries-extra}} +\galleryref{glossaries-styles/}{a summary of all glossary styles provided by \styfmt{glossaries} and +\styfmt{glossaries-extra}} \item -\gallery{glossaries-performance.shtml}{\styfmt{glossaries} +\galleryref{glossaries-performance.shtml}{\styfmt{glossaries} performance} (comparing document build times for the different -options provided by \styfmt{glossaries} and \gls{glossaries-extra}). +options provided by \styfmt{glossaries} and \styfmt{glossaries-extra}). -\item \href{http://www.dickimaw-books.com/latex/thesis/}{Using LaTeX to Write a PhD Thesis} +\item \dickimawhref{latex/thesis/}{Using LaTeX to Write a PhD Thesis} (chapter 6). \item -\href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build} +\dickimawhref{latex/buildglossaries/}{Incorporating +\appfmt{makeglossaries} or \appfmt{makeglossaries-lite} or +\appfmt{bib2gls} into the document build} -\item The -\href{http://ctan.org/pkg/glossaries-extra}{\styfmt{glossaries-extra} package} +\item The \ctanref{pkg/glossaries-extra}{\styfmt{glossaries-extra} package} -\item \href{http://ctan.org/pkg/bib2gls}{\appfmt{bib2gls}} +\item \ctanref{pkg/bib2gls}{\appfmt{bib2gls}} \end{itemize} -\begin{important*} -If you use \sty{hyperref} and \styfmt{glossaries}, you must load -\sty{hyperref} \emph{first} (although \sty{hyperref} should be -loaded after most other packages). Similarly the \sty{doc} package must -also be loaded before \styfmt{glossaries}. (If \sty{doc} is loaded, -the file extensions for the default main glossary are changed to -\filetype{gls2}, \filetype{glo2} and \filetype{glg2} to avoid -conflict with \sty{doc}'s changes -glossary.)\hypertarget{pdflatexnote}{}% - -If you are using \sty{hyperref}, it's best to use \app{pdflatex} -rather than \app{latex} (DVI format) as \appfmt{pdflatex} deals with -hyperlinks much better. If you use the DVI format, you will -encounter problems where you have long hyperlinks or hyperlinks in -subscripts or superscripts. This is an issue with the DVI format not -with \styfmt{glossaries}. If you really need to use the DVI format -and have a problem with hyperlinks in maths mode, I recommend you use -\gls{glossaries-extra} with the \attr{hyperoutside} and -\attr{textformat} attributes set to appropriate values -for problematic entries. -\end{important*} - -\strong{The \styfmt{glossaries} package replaces the \styfmt{glossary} -package which is now obsolete.} Please see the document -\qtdocref{Upgrading from the glossary package to the glossaries -package}{glossary2glossaries} for assistance in upgrading. - -\clearpage -\pdfbookmark[0]{Contents}{contents} +\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 -\clearpage -\pdfbookmark[0]{List of Examples}{examples} -\listofexamples -\clearpage -\pdfbookmark[0]{List of Tables}{tables} \listoftables +\listofexamples +\mainmatter -\clearpage -\printglossaries - -\glsresetall +\renewrobustcmd{\texidxoptiondef}[1]{% + \maintexidxoptiondef{#1}% +} +\part{User Guide} +\label{userguide} - \chapter{Introduction} +\chapter{Introduction} \label{sec:intro} -The \styfmt{glossaries} package is provided to assist generating -lists of terms, symbols or abbreviations. (For convenience, these -lists are all referred to as glossaries in this manual. The terms, -symbols and abbreviations are collectively referred to as entries.) +\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 glossary and define multiple -glossaries. It also supports glossary styles that +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 glossary entry. +for each \idx{glossaryentry}. There is provision for loading a database of glossary entries. Only -those entries indexed\footnote{That is, if the entry has been -referenced using any of the commands described in -\sectionref{sec:glslink} and \sectionref{sec:glsadd} or via -\ics{glssee} (or the \gloskey{see} key) or commands such as -\ics{acrshort} or \ics*{glsxtrshort}.}\ in the document will be displayed in the glossary. -(Unless you use \opt5, which doesn't use any indexing but will +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 glossary in the document. You may be +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 abbreviations, or you may +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 (\opt6). +to easily link to the relevant description (\option{standalone}). The simplest document is one without a glossary: -\begin{verbatim} -\documentclass{article} -\usepackage[ - sort=none % no sorting or indexing required +\begin{codebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}[ + \opteqvalref{sort}{none} \comment{no sorting or \idx{indexing} required} ] -{glossaries} - -\newglossaryentry - {cafe}% label - {% definition: - name={caf\'e}, - description={small restaurant selling refreshments} +\marg{glossaries} +\codepar +\gls{newglossaryentry} + \marg{cafe}\comment{label} + \marg{\comment{definition:} + \gloskeyval{name}{caf\'e}, + \gloskeyval{description}{small restaurant selling refreshments} } - -\setacronymstyle{long-short} - -\newacronym - {html}% label - {HTML}% short form - {hypertext markup language}% long form - -\newglossaryentry - {pi}% label - {% definition: - name={\ensuremath{\pi}}, - description={Archimedes' Constant} +\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} } - -\newglossaryentry - {distance}% label - {% definition: - name={distance}, - description={the length between two points}, - symbol={m} +\codepar +\gls{newglossaryentry} + \marg{distance}\comment{label} + \marg{\comment{definition:} + \gloskeyval{name}{distance}, + \gloskeyval{description}{the length between two points}, + \gloskeyval{symbol}{m} } - -\begin{document} -First use: \gls{cafe}, \gls{html}, \gls{pi}. -Next use: \gls{cafe}, \gls{html}, \gls{pi}. - -\Gls{distance} (\glsentrydesc{distance}) is measured in -\glssymbol{distance}. -\end{document} -\end{verbatim} +\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}[^^J + \opteqvalref{sort}{none} \comment{no sorting or indexing required} +] +\marg{glossaries} +\codepar +\gls{newglossaryentry}^^J% +\marg{cafe}\comment{label} +\marg{\comment{definition:} + \gloskeyval{name}{caf\'e},^^J + \gloskeyval{description}{small restaurant selling refreshments}^^J% +} +\codepar +\gls{setacronymstyle}\marg{\acrstyle{long-short}} +\gls{newacronym}^^J% +\marg{html}\comment{label} +\marg{HTML}\comment{short form} +\marg{hypertext markup language}\comment{long form} +\codepar +\gls{newglossaryentry}^^J% +\marg{pi}\comment{label} +\marg{\comment{definition:} + \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},^^J + \gloskeyval{description}{Archimedes' Constant}^^J% +} +\codepar +\comment{This is a trivial example. For a real document I recommend +you use siunitx for units} +\gls{newglossaryentry}^^J + \marg{distance}\comment{label} + \marg{\comment{definition:} + \gloskeyval{name}{distance},^^J + \gloskeyval{description}{the length between two points},^^J + \gloskeyval{symbol}{m}^^J + } +} +{% +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 \gls{glossaries-extra} package, which is distributed as a -separate bundle, extends the capabilities of -the \styfmt{glossaries} package. The simplest document with a glossary can be -created with \gls{glossaries-extra} (which internally loads the -\styfmt{glossaries} package): -\begin{verbatim} -\documentclass{article} -\end{verbatim} -\begin{alltt} -\cs{usepackage}[ - sort=none,% no sorting or indexing required - \xtrfont{abbreviations},% create list of abbreviations - symbols,% create list of symbols - \xtrfont{postdot}, % append a full stop after the descriptions - \xtrfont{stylemods},style=index % set the default glossary style -]\mgroup{glossaries-extra} -\end{alltt} -\begin{verbatim} -\newglossaryentry % provided by glossaries.sty - {cafe}% label - {% definition: - name={caf\'e}, - description={small restaurant selling refreshments} +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): +\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 default 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} } -\end{verbatim} -\begin{alltt} -\% provided by glossaries-extra.sty: -\ics*{setabbreviationstyle}\mgroup{long-short} - -\ics*{newabbreviation} \% provided by glossaries-extra.sty - \mgroup{html}\% label - \mgroup{HTML}\% short form - \mgroup{hypertext markup language}\% long form - -\% provided by glossaries-extra.sty 'symbols' option: -\ics*{glsxtrnewsymbol} - [description=\mgroup{Archimedes' constant}]\% options - \mgroup{pi}\% label - \mgroup{\cs{ensuremath}\mgroup{\cs{pi}}}\% symbol -\end{alltt} -\begin{verbatim} -\newglossaryentry % provided by glossaries.sty - {distance}% label - {% definition: - name={distance}, - description={the length between two points}, - symbol={m} +\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},^^J + \gloskeyval{description}{small restaurant selling refreshments}^^J% +} +\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}.^^J% +\gls{printunsrtglossaries} \comment{list all defined entries} +} +\end{resultbox} -\begin{document} -First use: \gls{cafe}, \gls{html}, \gls{pi}. -Next use: \gls{cafe}, \gls{html}, \gls{pi}. - -\Gls{distance} is measured in \glssymbol{distance}. -\end{verbatim} -\begin{alltt} -\ics*{printunsrtglossaries} \% list all defined entries -\cs{end}\mgroup{document} -\end{alltt} -Note the difference in the way the abbreviation (HTML) and symbol -(\ensuremath{\pi}) are defined in the two above examples. The -\pkgopt*{abbreviations}, \pkgopt*{postdot} and \pkgopt*{stylemods} -options are specific to \gls{glossaries-extra}. Other options are -passed to the base \styfmt{glossaries} package. +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 teal, such as -\xtrcs{newabbreviation} and \pkgopt*{stylemods}, are only available with -the \gls{glossaries-extra} package. There are also some commands and options (such -as \cs{makeglossaries} and \pkgopt{symbols}) that are provided by the -base \styfmt{glossaries} package but are redefined by the -\gls{glossaries-extra} package. See the \gls{glossaries-extra} user +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 \styfmt{glossaries} package is its flexibility, however +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 @@ -1014,121 +11825,245 @@ size of the manual, try starting off with the much shorter \begin{important} There's a~common misconception that you have to have Perl installed -in order to use the \styfmt{glossaries} package. Perl is \emph{not} +in order to use the \sty{glossaries} package. Perl is \emph{not} a~requirement (as demonstrated by the above examples) but it does -increase the available options, particularly if you use an \gls{exlatinalph} -or a~\gls{nonlatinalph}. +increase the available options, particularly if you use an \idx{exlatinalph} +or a~\idx{nonlatinalph}. \end{important} -This document uses the \styfmt{glossaries} package. For example, -when viewing the PDF version of this document in a -hyperlinked-enabled PDF viewer (such as Adobe Reader or Okular) if -you click on the word \qt{\gls{xindy}} you'll be taken to the entry -in the glossary where there's a brief description of -the term \qt{\gls*{xindy}}. This is the way the \styfmt{glossaries} -mechanism works. An \gls{indexingapp} is used to generate the -sorted list of terms. The \glspl{indexingapp} are \gls{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. - -Neither of the above two examples require an \gls{indexingapp}. The -first is just using the \styfmt{glossaries} package for consistent +This document 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 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 \gls{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 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 \opt5). +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 dummy glossary files that -may be used for testing. +\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 \gls{indexingapp} to create the sorted glossaries for your document -(\optsor23). +(\optionsor{mkidx,xdy}). \end{itemize} -There are some sample documents provided with this package. They are -described in \sectionref{sec:samples}. +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}. + +The \sty{glossaries} package comes with a number of sample +documents that illustrate the various functions. These are listed in +\sectionref{sec:samples}. \section{Rollback} \label{sec:rollback} -There is one rollback release: v4.46 (2020-03-19) for -\styfmt{glossaries.sty} and \styfmt{glossary-list.sty}. -The other associated packages haven't been changed since that -release (apart from the version numbers, which are always updated -for each new release, regardless of whether or not the file has -otherwise been changed). If you rollback to v4.46 using: -\begin{verbatim} -\usepackage{glossaries}[=v4.46] -\end{verbatim} -then the 4.46 version of \sty{glossary-list.sty} will automatically be -loaded. If you use \pkgopt{nostyles} and subsequently load -\sty{glossary-list} you will also need to add the rollback version: -\begin{verbatim} -\usepackage[nostyles]{glossaries}[=v4.46] -\usepackage{glossary-list}[=v4.46] -\end{verbatim} +The following rollback releases are available: + +\begin{itemize} +\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. +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}. This +needs to know the document languages that have to be supported. It +currently (version 1.6 at the time of writing) can't detect the use +of \gls{babelprovide}. The \sty{tracklang} package is able to pick +up known language labels from the document class options, for +example: +\begin{codebox} +\cmd{documentclass}[german]\marg{article} +\cmd{usepackage}[\optval{translate}{true}]\marg{glossaries} +\end{codebox} +The above doesn't load \sty{babel} or \sty{polyglossia} or +\sty{translator}, but the \optval{translate}{true} setting will +ensure that \sty{tracklang} is loaded and the language-sensitive +command provided by \sty{glossaries} will use the definitions in +\file{glossaries-german.ldf} (which needs to be installed +separately, see \sectionref{sec:languages}) because \sty{tracklang} +can pick up the \optfmt{german} document class option. + +The \sty{tracklang} package is also able to pick up languages passed +as package options to \sty{babel} or \sty{translator}, provided they +were loaded before \sty{tracklang}. For example, +\begin{codebox} +\cmd{usepackage}[french]\marg{babel} +\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries} +\end{codebox} +The \sty{tracklang} package used to be able to detect languages +identified by \sty{polyglossia}['s] \gls{setmainlanguage} and +\gls{setotherlanguage}, but \sty{tracklang} v1.5 can't with newer +versions of \sty{polyglossia}. You will need to upgrade to +\sty{tracklang} v1.6+ to allow this to work again. + +In the event that \sty{tracklang} can't pick up the required +languages, it's also possible to identify them with the +\opt{languages} option. For example: +\begin{codebox} +\cmd{usepackage}[nil]\marg{babel} +\gls{babelprovide}\marg{french} +\cmd{usepackage}[\optval{languages}{french}]\marg{glossaries} +\end{codebox} \section{Indexing Options} \label{sec:indexingoptions} -The basic idea behind the \styfmt{glossaries} package is that you -first define your entries (terms, symbols or abbreviations). Then -you can reference these within your document (like \cs{cite} or -\cs{ref}). You can also, optionally, display a~list of the entries -you have referenced in your document (the glossary). This last part, -displaying the glossary, is the part that most new users find +\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 -\styfmt{glossaries} package (\optsto13). The \gls{glossaries-extra} extension -package provides two extra options for lists (\optsand45) as well as an option for -standalone descriptions within the document body (\opt6). +\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 \optsto15 is given in \tableref{tab:options}. -\opt6 is omitted from the table as it doesn't produce a list. For a +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 -\gallery{glossaries-performance.shtml}{\styfmt{glossaries} -performance page}. +\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 value of: +\cmddef{glsindexingsetting} +This 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 -\styfmt{glossaries}, I recommend that you don't force the user into -a particular indexing method by adding an unconditional \cs{makeglossaries} +\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 \cs{makeglossaries} (such as -\cs{newglossary}) and they can't switch off the indexing whilst -working on a draft document. +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, \optsand56 aren't actually indexing options as no -indexing is performed. In the case of \opt5, all defined entries are -listed in order of definition. In the case of \opt6, the entry +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 indexing options. +completeness and for comparison with the actual \idx{indexing} options. \begin{table}[htbp] \caption{Glossary Options: Pros and Cons} \label{tab:options} - {% - \renewcommand{\fnsymmark}[1]{\rlap{#1}}% - \setlength{\tabcolsep}{3pt}% + \settabcolsep{3pt}% \centering \begin{tabular}{@{}>{\raggedright\small}p{0.35\textwidth}ccccc@{}} - & \bfseries \opt1 & \bfseries \opt2 & \bfseries \opt3 - & \bfseries \opt4 & \bfseries \opt5\\ - Requires \gls{glossaries-extra}? & + \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\\ @@ -1150,530 +12085,760 @@ completeness and for comparison with the actual indexing options. Are entries with identical sort values treated as separate unique entries? & \proyes & \proyes & \prono\fnsym{4} & \proyes & \proyes\\ - Can automatically form ranges in the location lists? & + Can automatically form \idxpl{range} in the \idxpl{locationlist}? & \prono & \proyes & \proyes & \proyes & \prono\\ - Can have non-standard locations in the location lists? & + Can have non-standard \locations\ in the \idxpl{locationlist}? & \proyes & \prono & \proyes\fnsym{5} & \proyes & \proyes\fnsym{6}\\ Maximum hierarchical depth (style-dependent) & - $\infty$\fnsym{7} & 3 & $\infty$ & $\infty$ & $\infty$\\ - \ics{glsdisplaynumberlist} reliable? & + \unlimited\fnsym{7} & 3 & \unlimited & \unlimited & \unlimited\\ + \gls{glsdisplaynumberlist} reliable? & \proyes & \prono & \prono & \proyes & \prono\\ - \ics{newglossaryentry} allowed in \env{document} environment? + \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 \pkgopt{sanitizesort} package option & - \texttt{false} & \texttt{true} & \texttt{true} - & \texttt{true}\fnsym{11} - & \texttt{true}\fnsym{11} + Default value of \opt{sanitizesort} package option & + \optfmt{false} & \optfmt{true} & \optfmt{true} + & \optfmt{true}\fnsym{11} + & \optfmt{true}\fnsym{11} \end{tabular} \par - }\par - \smallskip - \hrulefill\par - \smallskip\footnotesize - \fnsym{1} Strips standard \LaTeX\ accents -(that is, accents generated by core \LaTeX\ commands) so, -for example, \ics{AA} is treated the same as A.\par - \fnsym{2} Only with the hybrid method provided with \gls{glossaries-extra}.\par - \fnsym{3} Provided \pkgopt[none]{sort} is used.\par - \fnsym{4} Entries with the same sort value are merged.\par - \fnsym{5} Requires some setting up.\par - \fnsym{6} The locations must be set explicitly -through the custom \xtrfield{location} field provided by -\styfmt{glossaries-extra}.\par - \fnsym{7} Unlimited but unreliable.\par - \fnsym{8} Entries are defined in \filetype{bib} -format. \cs{newglossaryentry} should not be used explicitly.\par - \fnsym{9} Provided \pkgopt+{true}{docdef} or - \pkgopt+{restricted}{docdef} but not recommended.\par - \fnsym{10} Provided \pkgopt+{false}{docdef} or - \pkgopt+{restricted}{docdef}.\par - \fnsym{11} Irrelevant with \pkgopt[none]{sort}. (The \pkgopt+{only}{record} - option automatically switches this on.) -\par + \tablefns + {% + \fnsymtext{1}{Strips standard \LaTeX\ accents + (that is, accents generated by core \LaTeX\ commands) so, + for example, \csfmt{AA} is treated the same as A.} + \fnsymtext{2}{Only with the hybrid method provided with \sty{glossaries-extra}.} + \fnsymtext{3}{Provided \opteqvalref{sort}{none} is used.} + \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} -\optionsec[\TeX]{TeX} +\subsection{\idxoptiondef{noidx}}\label{option1} This option isn't generally recommended for reasons given below. +It's best used with \opteqvalref{sort}{use} (order of use) or +\opteqvalref{sort}{def} (order of definition). Example Document: -\begin{verbatim} -\documentclass{article} -\usepackage{glossaries} -\end{verbatim} -\begin{alltt} -\strong{\ics{makenoidxglossaries}} \% use TeX to sort -\end{alltt} -\begin{verbatim} -\newglossaryentry{sample}{name={sample}, - description={an example}} -\begin{document} -\gls{sample}. -\end{verbatim} -\begin{alltt} -\strong{\ics{printnoidxglossary}} -\cs{end}\mgroup{document} -\end{alltt} +\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 preamble with \ics{loadglsentries} (\emph{after} -\ics{makenoidxglossaries}). - -This option doesn't require an external \gls{indexingapp} but, with +and load it in the \idx{documentpreamble} 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}^^J% +\gls{makenoidxglossaries} \comment{use TeX to sort} +\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J + \gloskeyval{description}{a brightly coloured tropical bird}}^^J% +\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J + \gloskeyval{description}{a waterbird}}^^J% +\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J + \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J% +\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J + \gloskeyval{description}{a flightless black and white seabird}}^^J% +\comment{a symbol:} +\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J + \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J% +\comment{an acronym:} +\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J +\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}.^^J% + \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J% + Next use: \gls{gls}\marg{arpanet}.^^J% + \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. + +This option doesn't require an external \idx{indexingapp} but, with the default alphabetic sorting, it's very slow with severe limitations. If you want a sorted list, it doesn't work well for -\glspl{exlatinalph} or \glspl{nonlatinalph} and there's no guarantee -that it will work with \gls{UTF-8}. However, if you use -the \pkgopt[false]{sanitizesort} package option (the default for -Option~1) then the \glslink{latexexlatinchar}{standard \LaTeX\ +\idxpl{exlatinalph} or \idxpl{nonlatinalph}. +However, if you use the \optval{sanitizesort}{false} package option (the default for +\option{noidx}) then the \idxc{latexexlatinchar}{standard \LaTeX\ accent commands} will be ignored, so if an entry's name is set to -\verb|{\'e}lite| then the sort value will default to \texttt{elite} if -\pkgopt[false]{sanitizesort} is used and will default to -\verb|\'elite| if \pkgopt[true]{sanitizesort} is used. If you have -any other kinds of commands that don't expand to ASCII characters, -such as \cs{alpha} or \cs{si}, then you must use -\pkgopt[true]{sanitizesort} or change the sort method -(\pkgopt[use]{sort} or \pkgopt[def]{sort}) in the package options +\code{\gls+{cs.apos}elite} then the sort value will default to \code{elite} if +\optval{sanitizesort}{false} is used and will default to +the literal string \verb|\'elite| if \optval{sanitizesort}{true} is used. + +\begin{warning} +Previously, it was also possible to strip accents from \idx{utf8} characters, +but that's not possible following updates to the \LaTeX\ +kernel. The kernel updates are beneficial as they make it +possible to use \idx{utf8} characters in labels, but the trick of +stripping accents was a hack that no longer works. +\end{warning} + +If you have any other kinds of commands that don't expand to \idx{ascii} characters, +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. For example: -\begin{alltt} -\ics{newglossaryentry}\mgroup{alpha}\mgroup{name=\mgroup{\cs{ensuremath}\mgroup{\cs{alpha}}}, - \strong{sort=\mgroup{alpha}},description=\mgroup{...}} -\end{alltt} +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 \gls{glossaries-extra} package has a modified \pkgopt{symbols} -package option that provides \ics*{glsxtrnewsymbol}, which automatically sets the +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 the \pkgopt[def]{sort} or -\pkgopt[use]{sort} setting. For any +This option works best with the \opteqvalref{sort}{def} or +\opteqvalref{sort}{use} setting. For any other setting, be prepared for a long document build time, especially if you have a lot of entries defined. \strong{This option is intended as a last resort for alphabetical sorting.} This option allows a mixture of sort methods. (For example, sorting by word order for one glossary and order of use for another.) -This option is not suitable for hierarchical glossaries and does -not form ranges in the \glspl{numberlist}. If you really can't use an -\gls{indexingapp} consider using \opt{5} instead. +This option is not suitable for \hierarchical\ glossaries and does +not form \idxpl{range} in the \idxpl{locationlist}. If you really can't use an +\idx{indexingapp} consider using \option{unsrt} instead. Summary: \begin{enumerate} \item Add -\begin{verbatim} -\makenoidxglossaries -\end{verbatim} - to your preamble (before you start defining your entries, as described in - \sectionref{sec:newglosentry}). +\begin{codebox*} +\gls{makenoidxglossaries} +\end{codebox*} + to your \idx{documentpreamble} (before you start defining your + entries, as described in \sectionref{sec:newglosentry}). \item Put -\begin{verbatim} -\printnoidxglossary -\end{verbatim} +\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{verbatim} -\printnoidxglossaries -\end{verbatim} +\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{PDF\LaTeX} button in your editor. + the \qt{typeset} or \qt{build} or \qt{\pdfLaTeX} button in your editor. \end{enumerate} -\optionsec{makeindex} - -Example document: -\begin{verbatim} -\documentclass{article} -\usepackage{glossaries} -\end{verbatim} -\begin{alltt} -\strong{\ics{makeglossaries}} \% open glossary files -\end{alltt} -\begin{verbatim} -\newglossaryentry{sample}{name={sample}, - description={an example}} -\begin{document} -\gls{sample}. -\end{verbatim} -\begin{alltt} -\strong{\ics{printglossary}} -\cs{end}\mgroup{document} -\end{alltt} +\subsection{\idxoptiondef{mkidx}}\label{option2} + +\glsadd{app.makeindex}Example document: +\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 preamble with \ics{loadglsentries} (\emph{after} -\ics{makeglossaries}). +and load it in the \idx{documentpreamble} 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}^^J% +\gls{makeglossaries} \comment{open \idxpl{indexingfile}} +\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J + \gloskeyval{description}{a brightly coloured tropical bird}}^^J% +\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J + \gloskeyval{description}{a waterbird}}^^J% +\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J + \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J% +\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J + \gloskeyval{description}{a flightless black and white seabird}}^^J% +\comment{a symbol:} +\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J + \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J% +\comment{an acronym:} +\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J +\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}.^^J% + \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J% + Next use: \gls{gls}\marg{arpanet}.^^J% + \gls{printglossary} +} +\end{resultbox} -This option uses a~\gls{cli} application called \gls{makeindex} to sort +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 \gls{latinalph}. It can't -correctly sort accent commands (such as \cs{'} or \cs{c}) and fails -with \gls{UTF-8} characters, especially for any sort values that start -with a \gls{UTF-8} character (as it separates the octets resulting in an -invalid file encoding). This process involves making \LaTeX\ write -the glossary information to a temporary file which \gls{makeindex} -reads. Then \gls{makeindex} writes a~new file containing the code -to typeset the glossary. Then \cs{printglossary} reads this file in +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. +\end{information} + This option works best if you want to sort entries according to the English alphabet and you don't want to install Perl or Java. This -method can also work with the restricted shell escape since -\gls{makeindex} is considered a trusted application. (So you should -be able to use the \pkgopt{automake} package option provided the -shell escape hasn't been completely disabled.) +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 ranges in the \gls{numberlist} but only -accepts limited number formats: \cs{arabic}, \cs{roman}, -\cs{Roman}, \cs{alph} and \cs{Alph}. +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 glossaries must be sorted according to the same method: +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 glossary and letter ordering -for another you'll have to explicitly call \gls{makeindex} for -each glossary type. +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 \gls{glossaries-extra} package allows a hybrid mix of -\optsand12 to provide word\slash letter ordering with \opt2 and order -of use\slash definition with \opt1. See the \gls{glossaries-extra} -documentation for further details. See also the -\gls{glossaries-extra} alternative to \samplefile{Sort} in -\sectionref{sec:samplessort}. +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 \gls{makeindex}['s] \mkidxopt{g} option - you must change the quote character using \ics{GlsSetQuote}. For example: -\begin{verbatim} -\GlsSetQuote{+} -\end{verbatim} - This must be used before \cs{makeglossaries}. + \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 made in the preamble. + the shorthands in definitions that occur in the \idx+{documentpreamble}. \item Add -\begin{verbatim} -\makeglossaries -\end{verbatim} -to your preamble (before you start +\begin{codebox*} +\gls{makeglossaries} +\end{codebox*} +to your \idx{documentpreamble} (before you start defining your entries, as described in \sectionref{sec:newglosentry}). \item Put -\begin{verbatim} -\printglossary -\end{verbatim} +\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{verbatim} -\printglossaries -\end{verbatim} +\begin{codebox*} +\gls{printglossaries} +\end{codebox*} \item Run \LaTeX\ on your document. This creates files with the - extensions \filetype{glo} and \filetype{ist} (for example, if your - \LaTeX\ document is called \texttt{myDoc.tex}, then you'll have - two extra files called \texttt{myDoc.glo} and \texttt{myDoc.ist}). + 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 - \gls{glossaries-extra} you'll see the section heading and some + \sty{glossaries-extra} you'll see the section heading and some boilerplate text.) - If you have used package options such as \pkgopt{symbols} there + 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 \gls{makeindex} with the \texttt{.glo} file as the - input file and the \texttt{.ist} file as the style so that - it creates an output file with the extension \texttt{.gls}. If - you have access to a terminal or a command prompt (for example, the - MSDOS command prompt for Windows users or the bash console for - Unix-like users) then you need to run the command: -\begin{prompt} -makeindex -s myDoc.ist -o myDoc.gls myDoc.glo -\end{prompt} - (Replace \texttt{myDoc} with the base name of your \LaTeX\ - document file. Avoid spaces in the file name if possible. - The \textbf{\ttfamily\$} symbol indicates the command prompt and should be omitted.) + \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 glossary \gloskey{type}. +The file extensions vary according to the \idx{glossary} \gloskey{type}. See \sectionref{sec:makeindexapp} for further details. -\gls{makeindex} must be called for each set of files. +\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 - \gls{makeindex} via your text editor, but each editor has a - different method of doing this. See \href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating + \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 \gls{makeindex} indirectly via the -\gls{makeglossaries} script: -\begin{prompt} + Alternatively, run \app{makeindex} indirectly via the +\app{makeglossaries} script: +\begin{terminal} makeglossaries myDoc -\end{prompt} +\end{terminal} Note that the file extension isn't supplied in this case. - (Replace \gls{makeglossaries} with \gls{makeglossaries-lite.lua} if + (Replace \app{makeglossaries} with \app{makeglossaries-lite} if you don't have Perl installed.) This will pick up all the file extensions from the - \filetype{aux} file and run \gls{makeindex} the appropriate number + \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{alltt} -\% arara: pdflatex -\% arara: makeglossaries -\% arara: pdflatex -\end{alltt} - (Replace \texttt{makeglossaries} with \texttt{makeglossarieslite} in the +\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{prompt} -makeindex -l -s myDoc.ist -o myDoc.gls myDoc.glo -\end{prompt} +\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 - \gls*{makeindex} explicitly.) If you use \gls{makeglossaries} - or \gls{makeglossaries-lite.lua} then use the \pkgopt[letter]{order} + \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 -\pkgopt{toc} option (unless you're using \gls{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 glossary file has -been created. - -\optionsec{xindy} - -Example document: -\begin{alltt} -\cs{documentclass}\mgroup{article} -\cs{usepackage}[\strong{xindy}]\mgroup{glossaries} -\strong{\ics{makeglossaries}} \% open glossary files -\end{alltt} -\begin{verbatim} -\newglossaryentry{sample}{name={sample}, - description={an example}} -\begin{document} -\gls{sample}. -\end{verbatim} -\begin{alltt} -\strong{\ics{printglossary}} -\cs{end}\mgroup{document} -\end{alltt} +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} + +\glsadd{app.xindy}Example document: +\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 preamble with \ics{loadglsentries} (\emph{after} -\ics{makeglossaries}). +and load it in the \idx{documentpreamble} 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}^^J% +\gls{makeglossaries} \comment{open \idxpl{indexingfile}} +\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J + \gloskeyval{description}{a brightly coloured tropical bird}}^^J% +\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J + \gloskeyval{description}{a waterbird}}^^J% +\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J + \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J% +\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J + \gloskeyval{description}{a flightless black and white seabird}}^^J% +\comment{a symbol:} +\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J + \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J% +\comment{an acronym:} +\gls{setacronymstyle}\marg{\acrstyle{short-long}}^^J +\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}.^^J% + \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J% + Next use: \gls{gls}\marg{arpanet}.^^J% + \gls{printglossary} +} +\end{resultbox} -This option uses a~\gls{cli} application called -\gls{xindy} to sort the entries. This application is more flexible than -\texttt{makeindex} and is able to sort \glspl{exlatinalph} or -\glspl{nonlatinalph}, however it does still have some limitations. +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. -The \gls{xindy} application comes with both \TeX~Live and -MiK\TeX, but since \gls{xindy} is a Perl script, you will also need +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 -\opt2, this option involves making \LaTeX\ write the glossary -information to a~temporary file which \gls{xindy} reads. Then -\gls{xindy} writes a~new file containing the code to typeset the -glossary. Then \cs{printglossary} reads this file in on the next run. +\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 \styfmt{glossaries} +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 location lists, but it can +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 \gls*{xindy} + \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 \gls*{xindy} forbids empty sort values; - \item \gls*{xindy} automatically strips control sequences, the math-shift - character \verb|$| and braces \verb|{}| from the 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 \gls*{xindy} forbids. + collapse to an empty string which \app{xindy} forbids. \end{itemize} In these problematic cases, you must set the \gloskey{sort} field -explicitly. For example: -\begin{alltt} -\cs{newglossaryentry}\mgroup{alpha}\mgroup{name=\mgroup{\cs{ensuremath}\mgroup{\cs{alpha}}}, - \strong{sort=\mgroup{alpha},}description=\mgroup{...}} -\end{alltt} +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 \gls{glossaries-extra} package has a modified \pkgopt{symbols} -package option that provides \ics*{glsxtrnewsymbol}, which automatically sets the +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 glossaries must be sorted according to the same method -(word/letter ordering, order of use, or order of definition). +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 \gls{glossaries-extra} package allows a hybrid mix of -\optsand13 to provide word\slash letter ordering with \opt3 and order -of use\slash definition with \opt1. See the \gls{glossaries-extra} -documentation for further details. +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 \pkgopt{xindy} option to the \styfmt{glossaries} + \item Add the \opt{xindy} option to the \sty{glossaries} package option list: -\begin{verbatim} -\usepackage[xindy]{glossaries} -\end{verbatim} +\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 group: -\begin{verbatim} -\usepackage[xindy={glsnumbers=false}]{glossaries} -\end{verbatim} - or use either \cs{GlsSetXdyFirstLetterAfterDigits}\marg{letter} (to indicate the -first letter group to follow the digits) or - \cs{GlsSetXdyNumberGroupOrder}\marg{spec} to indicate where the number - group should be placed (see \sectionref{sec:xindy}). - - \item Add \cs{makeglossaries} to your preamble (before you start + 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{documentpreamble} (before you start defining your entries, as described in \sectionref{sec:newglosentry}). \item Run \LaTeX\ on your document. This creates files with the - extensions \filetype{glo} and \filetype{xdy} (for example, if your - \LaTeX\ document is called \texttt{myDoc.tex}, then you'll have - two extra files called \texttt{myDoc.glo} and \texttt{myDoc.xdy}). + 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 - \gls{glossaries-extra} extension package, you'll see the section + \sty{glossaries-extra} extension package, you'll see the section header and some boilerplate text.) - If you have used package options such as \pkgopt{symbols} there + 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 \gls{xindy} with the \texttt{.glo} file as the - input file and the \texttt{.xdy} file as a~module so that - it creates an output file with the extension \texttt{.gls}. You - also need to set the language name and input encoding. If - you have access to a terminal or a command prompt (for example, the - MSDOS command prompt for Windows users or the bash console for - Unix-like users) then you need to run the command (all on one + \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{prompt} -xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo -\end{prompt} - (Replace \texttt{myDoc} with the base name of your \LaTeX\ +\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 - \texttt{english} with the name of your language and \texttt{utf8} - with your input encoding, for example, - \xdyopt{L}\texttt{ german }\xdyopt{C}\texttt{ din5007-utf8}.) + \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. -\gls{xindy} must be called for each set of files. +\app{xindy} must be called for each set of files. \end{important} - It's much simpler to use \gls{makeglossaries} instead: -\begin{prompt} + It's much simpler to use \app{makeglossaries} instead: +\begin{terminal} makeglossaries myDoc -\end{prompt} +\end{terminal} Note that the file extension isn't supplied in this case. This will pick up all the file extensions from the - \filetype{aux} file and run \gls{xindy} the appropriate number + \ext{aux} file and run \app{xindy} the appropriate number of times with all the necessary switches. - There's no benefit in using \gls{makeglossaries-lite.lua} with \gls{xindy}. - (Remember that \gls{xindy} is a Perl script so if you can use - \gls{xindy} then you can also use \gls{makeglossaries}, and if - you don't want to use \gls{makeglossaries} because you don't - want to install Perl, then you can't use \gls{xindy} either.) + 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 \gls{xindy} or \gls{makeglossaries} via your text editor, - but each editor has a different method of doing this. See \href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating + 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 \appfmt{arara} and add the follow comment + Again, a convenient method is to use \app{arara} and add the follow comment lines to the start of your document: -\begin{alltt} -\% arara: pdflatex -\% arara: makeglossaries -\% arara: pdflatex -\end{alltt} +\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 - \pkgopt[letter]{order} package option: -\begin{verbatim} -\usepackage[xindy,order=letter]{glossaries} -\end{verbatim} + \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 \gls{makeglossaries}. If you are explicitly using \gls{xindy} - then you'll need to add \texttt{-M ord/letorder} to the options list. + 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 - \gls*{xindy} explicitly. + \app{xindy} explicitly. \item Once you have successfully completed the previous step, you can now run \LaTeX\ on your document again. As with - \gls{makeindex} (\opt2), you may need to repeat the previous + \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} -\optionsec{bib2gls} +\subsection{\idxoptiondef{b2g}}\label{option4} \glsxtrnote -This option is only available with the \gls{glossaries-extra} extension package. -This method uses \gls{bib2gls} to both fetch entry definitions from -\filetype{bib} files and to hierarchically sort and collate. +\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. Example document: -\begin{alltt} -\cs{documentclass}\mgroup{article} -\cs{usepackage}[\xtrfont{record=nameref}]\mgroup{glossaries-extra} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{entries}] -\cs{begin}\mgroup{document} -\cs{gls}\mgroup{sample}, \cs{gls}\mgroup{alpha}, \cs{gls}\mgroup{html}. -\ics*{printunsrtglossary} -\cs{end}\mgroup{document} -\end{alltt} -where the file \texttt{entries.bib} contains: -\begin{alltt} -\atentry{entry}\mgroup{sample, - name=\mgroup{sample}, - description=\mgroup{an example} +\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{symbol}\mgroup{alpha, - name=\mgroup{\cs{ensuremath}\mgroup{\cs{alpha}}}, - description=\mgroup{...} +\atentry{entry}\marg{puffin, + \gloskeyval{name}{puffin}, + \gloskeyval{description}{a seabird with a brightly coloured bill} } -\atentry{abbreviation}\mgroup{html, - short=\mgroup{HTML}, - long=\mgroup{hypertext markup language} +\atentry{entry}\marg{penguin, + \gloskeyval{name}{penguin}, + \gloskeyval{description}{a flightless black and white seabird} } -\end{alltt} +\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. +\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}^^J% +\atentry{entry}\marg{parrot,^^J + \gloskeyval{name}{parrot}, ^^J + \gloskeyval{description}{a brightly coloured tropical bird}^^J% +}^^J% +\atentry{entry}\marg{duck,^^J + \gloskeyval{name}{duck}, ^^J + \gloskeyval{description}{a waterbird}^^J% +}^^J% +\atentry{entry}\marg{puffin,^^J + \gloskeyval{name}{puffin},^^J + \gloskeyval{description}{a seabird with a brightly coloured bill}^^J% +}^^J% +\atentry{entry}\marg{penguin,^^J + \gloskeyval{name}{penguin}, ^^J + \gloskeyval{description}{a flightless black and white seabird}^^J% +}^^J% +\atentry{symbol}\marg{alpha,^^J + \gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J + \gloskeyval{description}{a variable}^^J% +}^^J% +\atentry{abbreviation}\marg{arpanet,^^J + \gloskeyval{short}{ARPANET},^^J + \gloskeyval{long}{Advanced Research Projects Agency Network}^^J% +}^^J% +\cend{filecontents*}^^J% +\cmd{usepackage}[\opt{record},style=indexgroup]\marg{glossaries-extra}^^J% +\gls{setabbreviationstyle}\marg{short-long}^^J% +\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}.^^J% + \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J% + Next use: \gls{gls}\marg{arpanet}.^^J% + \gls{printunsrtglossary} +} +\end{resultbox} -All entries must be provided in one or more \filetype{bib} files. -See the \gls{bib2gls} user manual for the required format. +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}. \begin{important} Note that the \gloskey{sort} key should not be used. Each entry type @@ -1684,489 +12849,589 @@ mechanism if you explicitly use the \gloskey{sort} key. See \bibglsgallery{sorting} for examples. \end{important} -The \gls{glossaries-extra} package needs to be loaded with the -\pkgopt*{record} package option: -\begin{alltt} -\cs{usepackage}[\xtrfont{record}]\mgroup{glossaries-extra} -\end{alltt} +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{alltt} -\cs{usepackage}[\xtrfont{record=only}]\mgroup{glossaries-extra} -\end{alltt} -or (with at least \gls{glossaries-extra} v1.37 and \gls{bib2gls} v1.8): -\begin{alltt} -\cs{usepackage}[\xtrfont{record=nameref}]\mgroup{glossaries-extra} -\end{alltt} -The \pkgopt+{nameref}{record} option is the best method. - -(It's possible to use a hybrid of this method and \optsor23 with -\pkgopt+{hybrid}{record} but in general there is little need -for this and it complicates the build process.) - -Each resource set is loaded with \ics*{GlsXtrLoadResources}\oarg{options}. +\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{alltt} -\ics*{GlsXtrLoadResources} -[\% definitions in entries1.bib and entries2.bib: - \resourceopt{src}=\mgroup{entries1,entries2}, - \resourceopt{sort}=\mgroup{de-CH-1996}\% sort according to this locale -] -\end{alltt} -The \filetype{bib} files are identified as a comma-separated list in the +\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 -glossaries or one glossary may be split across multiple resource +\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 -\resourceopt[all]{selection}. (There are also ways of filtering the +\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 \gls{bib2gls} user manual for further details.) +truncating the list. See the \app{bib2gls} user manual for further details.) -The glossary is displayed using: -\begin{alltt} -\ics*{printunsrtglossary} -\end{alltt} +The \idx{glossary} is displayed using: +\begin{codebox*} +\gls{printunsrtglossary} +\end{codebox*} Alternatively all glossaries can be displayed using the iterative command: -\begin{alltt} -\ics*{printunsrtglossaries} -\end{alltt} +\begin{codebox*} +\gls{printunsrtglossaries} +\end{codebox*} The document is built using: -\begin{prompt} +\begin{terminal} pdflatex myDoc bib2gls myDoc pdflatex myDoc -\end{prompt} -If letter groups are required, you need the \bibglslongopt{group} switch: -\begin{prompt} -bib2gls -{}-group myDoc -\end{prompt} +\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{alltt} -\% arara: bib2gls: \mgroup{ group: on } -\end{alltt} -(You will also need an appropriate glossary style.) +\begin{codebox} +\araraline{bib2gls: \marg{ group: on }} +\end{codebox} +(You will also need an appropriate \idx{glossarystyle}.) -Unlike \optsand23, this method doesn't create a file containing -the typeset glossary but simply determines which entries are +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 letter group. This option allows +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 glossary differently to another block in the -same glossary. See \bibglsgallery{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 Common Locale Data Repository, which provides more extensive language support than -\gls{xindy}.\footnote{Except for Klingon, which is supported by -\gls{xindy}, but not by the CLDR.}\ The locations in the -\gls{numberlist} may be in any format. If \gls{bib2gls} can deduce a -numerical value it will attempt to form ranges otherwise it will -simply list the locations. +\app{xindy}. (Except for Klingon, which is supported by +\app{xindy}, but not by the 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 \gls{glossaries-extra} with the \pkgopt+{record} package + \item Use \sty{glossaries-extra} with the \opt{record} package option: -\begin{verbatim} -\usepackage[record]{glossaries-extra} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{record}]\marg{glossaries-extra} +\end{codebox} - \item Use \cs*{GlsXtrLoadResources} to identify the \filetype{bib} -file(s) and \gls{bib2gls} options: -\begin{verbatim} -\GlsXtrLoadResources[src={terms.bib,abbreviations.bib},sort=en] -\end{verbatim} + \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{alltt} -\cs*{printunsrtglossary} -\end{alltt} +\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{alltt} -\cs*{printunsrtglossaries} -\end{alltt} +\begin{codebox*} +\gls{printunsrtglossaries} +\end{codebox*} \item Run \LaTeX\ on your document. -\item Run \gls{bib2gls} with just the document base name. +\item Run \app{bib2gls} with just the document base name. \item Run \LaTeX\ on your document. \end{enumerate} -See \bibglsbegin\ or the \gls{bib2gls} user manual for further +See \bibglsbegin\ or the \app{bib2gls} user manual for further details of this method, and -also \href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating +also \dickimawhref{latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build}. -\optionsec[no sorting]{no sorting} +\subsection{\idxoptiondef{unsrt}}\label{option5} \glsxtrnote This option is only available with the extension package -\gls{glossaries-extra}. No \gls{indexingapp} is required. +\sty{glossaries-extra}. No \idx{indexingapp} is required. Example document: -\begin{verbatim} -\documentclass{article} -\usepackage[sort=none]{glossaries-extra} -\newglossaryentry{sample}{name={sample}, - description={an example}} -\newglossaryentry{alpha}{name={\ensuremath{\alpha}}, - description={...}} -\begin{document} -\gls{sample}. -\end{verbatim} -\begin{alltt} -\ics*{printunsrtglossary} -\cs{end}\mgroup{document} -\end{alltt} - -This method is best used with the package option \pkgopt[none]{sort} -(as shown above). There's no \qt{activation} command (such as \cs{makeglossaries} -for \optsand23). In general it's best to use a style that doesn't -show letter group headings. If you do want letter headings then you -must ensure that you have defined your entries in alphabetical -order, and use \XeLaTeX\ or \LuaLaTeX\ if you require \gls{UTF-8} letter -groups. - -All entries must be defined before the glossary is displayed -(preferably in the preamble) in the required order, and child +\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{documentpreamble} 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}^^J% +\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},^^J + \gloskeyval{description}{a brightly coloured tropical bird}}^^J% +\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},^^J + \gloskeyval{description}{a waterbird}}^^J% +\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},^^J + \gloskeyval{description}{a seabird with a brightly coloured bill}}^^J% +\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},^^J + \gloskeyval{description}{a flightless black and white seabird}}^^J% +\comment{a symbol:} +\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},^^J + \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}^^J% +\comment{an abbreviation:} +\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}^^J% +\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}.^^J% + \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.^^J% + Next use: \gls{gls}\marg{arpanet}.^^J% + \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 glossary styles -indent entries that have a parent but it's the \gls{indexingapp} +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.) You can -place all your entry definitions in a separate file -and load it in the preamble with \ics{loadglsentries}. - -The glossary is displayed using: -\begin{alltt} -\ics*{printunsrtglossary} -\end{alltt} +responsibility to define the entries in the correct order. + +The \sty{glossaries-extra} package requires entries to be defined in the +\idx+{documentpreamble} 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{alltt} -\ics*{printunsrtglossaries} -\end{alltt} -This will display \emph{all} defined entries, regardless of -whether or not they have been used in the document. The -\glspl{numberlist} have to be set explicitly otherwise they won't -appear. Note that this uses the same command for displaying the -glossary as \opt4. This is because \gls{bib2gls} takes advantage -of this method by defining the wanted entries in the required order and -setting the locations (and letter group information, if required). +\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: sample and $\alpha$ (in that order). Note that -the \texttt{alpha} entry has been included even though it wasn't -referenced in the document. +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{prompt} +\begin{terminal} pdflatex myDoc -\end{prompt} +\end{terminal} unless the glossary needs to appear in the table of contents, in which case a second run is required: -\begin{prompt} +\begin{terminal} pdflatex myDoc pdflatex myDoc -\end{prompt} +\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 \gls{glossaries-extra} documentation for further details of this method. +See the \sty{glossaries-extra} documentation for further details of this method. -\optionsec[standalone]{standalone} +\subsection{\idxoptiondef{standalone}}\label{option6} \glsxtrnote -This option is only available with the \gls{glossaries-extra} -extension package.\footnote{You can just use the base -\styfmt{glossaries} package for the first case, but it's less +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 \ics{glsentryname}\marg{label} or -\ics{Glsentryname}\marg{label} to display the entry name.} Instead +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 document preamble (or in an external file loaded with -\ics{loadglsentries}), as with \opt5, for example: -\begin{verbatim} -\documentclass{article} - -\usepackage[colorlinks]{hyperref} -\usepackage[sort=none, - nostyles% <- no glossary styles are required - ]{glossaries-extra} - -\newglossaryentry{set}{name={set}, - description={a collection of any kind of objects}, - symbol={\ensuremath{\mathcal{S}}} +You can either define entries in the \idx{documentpreamble} (or in an +external file loaded with \gls{loadglsentries}), as with +\option{unsrt}, for example: +\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}}} } - -\newglossaryentry{function}{name={function}, - description={a rule that assigns every element in the - domain \gls{set} to an element in the range \gls{set}}, - symbol={\ensuremath{f(x)}} +\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)}} } -\end{verbatim} -\begin{alltt} -\cs{newcommand}*\mgroup{\cs{termdef}}[1]\mgroup{\% - \cs{section}\mgroup{\ics*{glsxtrglossentry}\mgroup{\#1} \ics{glsentrysymbol}\mgroup{\#1}}\% - \cs{begin}\mgroup{quote}\cs{em}\ics{Glsentrydesc}\mgroup{\#1}.\cs{end}\mgroup{quote}\% +\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{} } -\end{alltt} -\begin{verbatim} -\begin{document} -\tableofcontents - -\section{Introduction} -Sample document about \glspl{function} and \glspl{set}. - -\termdef{set} - -More detailed information about \glspl{set} with examples. - -\termdef{function} - -More detailed information about \glspl{function} with examples. - -\end{document} -\end{verbatim} -Or you can use \gls{bib2gls} if you want to manage a large -database of terms. For example (requires \gls{glossaries-extra} v1.42, see below): -\begin{alltt} -\cs{documentclass}\mgroup{article} - -\cs{usepackage}[colorlinks]\mgroup{hyperref} -\cs{usepackage}[\xtrfont{record}, - nostyles\% <- no glossary styles are required - ]\mgroup{glossaries-extra} - -\ics*{GlsXtrLoadResources}[\resourceopt{src}=terms,\resourceopt{sort}=none,\resourceopt{save-locations}=false] - -\cs{newcommand}*\mgroup{\cs{termdef}}[1]\mgroup{\% - \cs{section}\mgroup{\ics*{glsxtrglossentry}\mgroup{\#1} \strong{\ics{glossentrysymbol}}\mgroup{\#1}}\% - \ics{glsadd}\mgroup{\#1}\% <- index this entry - \cs{begin}\mgroup{quote}\cs{em}\ics{Glsentrydesc}\mgroup{\#1}.\cs{end}\mgroup{quote}\% +\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}^^J% +\cmd{usepackage}[\optval{sort}{none},^^J + \opt{nostyles}\comment{<- no glossary styles are required} + ]\marg{glossaries-extra} +\codepar +\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},^^J + \gloskeyval{description}{a collection of any kind of objects},^^J + \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}^^J% } -\end{alltt} -\begin{verbatim} -\begin{document} -\tableofcontents - -\section{Introduction} -Sample document about \glspl{function} and \glspl{set}. - -\termdef{set} - -More detailed information about \glspl{set} with examples. - -\termdef{function} - -More detailed information about \glspl{function} with examples. - -\end{document} -\end{verbatim} -Where the file \texttt{terms.bib} contains: -\begin{alltt} -\atentry{entry}\mgroup{set, - name=\mgroup{set}, - description=\mgroup{a collection of any kind of objects}, - symbol=\mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}} +\codepar +\gls{newglossaryentry}\marg{function}\marg{\gloskeyval{name}{function},^^J + \gloskeyval{description}{a rule that assigns every element in the ^^J + domain \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},^^J + \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}} +}^^J% +\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}^^J% +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} + +Or you can use \app{bib2gls} if you want to manage a large +database of terms. For example: +\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{} } -\atentry{entry}\mgroup{function, - name=\mgroup{function}, - description=\mgroup{a rule that assigns every element in the domain - \cs{gls}\mgroup{set} to an element in the range \cs{gls}\mgroup{set}}, - symbol=\mgroup{\cs{ensuremath}\mgroup{f(x)}} +\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}}} } -\end{alltt} -The advantage in this approach (with \ics{loadglsentries} or -\gls{bib2gls}) is that you can use an existing database of +\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 glossary styles +In both cases, there's no need to load all the \idxpl{glossarystyle} packages, as they're not required, so I've used the -\pkgopt{nostyles} package option to prevent them from being loaded. +\opt{nostyles} package option to prevent them from being loaded. -In the first case, you need the \pkgopt[none]{sort} package option -(as in \opt5) and then define the terms in the preamble. No external tool is -required. Just run \LaTeX\ as normal. (Twice to ensure that the +In the first case, you just need to define the terms (preferably in +the \idx{documentpreamble} or in a file that's input in the +\idx{documentpreamble}). +No external tool is required. Just run \LaTeX\ as normal. (Twice to ensure that the table of contents is up to date.) -\begin{prompt} +\begin{terminal} pdflatex myDoc pdflatex myDoc -\end{prompt} +\end{terminal} -In the second case, you need the \pkgopt*{record} package -option (as in \opt4) since \gls{bib2gls} is needed to select the +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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{terms},\strong{\xtrfont{sort}=none}] -\end{alltt} -This will ensure that any entries indexed in the document (through -commands like \ics{gls} or \ics{glsadd}) will be selected by -\gls{bib2gls}, but it will skip the sorting step. -(The chances are you probably also won't need location lists either. -If so, you can add the option \resourceopt[false]{save-locations}.) - -Remember that for this second case you need to run \gls{bib2gls} as per \opt4: -\begin{prompt} +\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{prompt} +\end{terminal} -For both cases (with or without \gls{bib2gls}), instead of listing -all the entries using \xtrcs{printunsrtglossary}, you use -\ics*{glsxtrglossentry}\marg{label} where you want the name (and +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 \gls{linktext} created by commands like \cs{gls} to link +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 \ics{glsentrydesc}\marg{label} or -\ics{Glsentrydesc}\marg{label}, as in the above examples. In both -examples, I've defined a custom command \cs{termdef} to simplify the +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 \cs{glsentrydesc} or \cs{Glsentrydesc}, you can use -\ics{glossentrydesc}\marg{label}, which will obey attributes such as -\attr{glossdesc} and \attr{glossdescfont}. See the \gls{glossaries-extra} +(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 -\ics{glsentrysymbol}\marg{label} or \ics{glossentrysymbol}\marg{label}. -In the first example, I've used \cs{glsentrysymbol}. In the -second I've used \ics{glossentrysymbol}. The latter is -necessary with \gls{bib2gls} if the symbol needs to go in a +\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, \cs{glsentrysymbol} will silently do nothing +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 -\filetype{aux} file, which triggers an error. +\ext{aux} file, which triggers an error. -The \ics{glossentrysymbol} command performs an existence check, +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 \gls{bib2gls} call.) You need at -least \gls{glossaries-extra} v1.42 to use this command in a section -title.\footnote{\cs{glossentrysymbol} is defined by the base -\styfmt{glossaries} package but is redefined by -\gls{glossaries-extra}.} If \sty{hyperref} has been loaded, this -will use \ics{texorpdfstring} to allow a simple expansion for the -PDF bookmarks (see the \gls{glossaries-extra} user manual for +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 \ics{ifglshassymbol} outside of the section title. For +need to use \gls{ifglshassymbol} outside of the section title. For example: -\begin{alltt} -\cs{ifglshassymbol}\mgroup{\#1}\% -\mgroup{\cs{section}\mgroup{\xtrcs{glsxtrglossentry}\mgroup{\#1} \cs{glossentrysymbol}\mgroup{\#1}}} -\mgroup{\cs{section}\mgroup{\xtrcs{glsxtrglossentry}\mgroup{\#1}}} -\end{alltt} - -In both of the above examples, the section titles start with a lowercase -character (because the \gloskey{name} value is all lowercase in -entry definitions). You can apply automatic case-change with the -\attr{glossname} attribute. For example: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{general}\mgroup{glossname}\mgroup{firstuc} -\end{alltt} +\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{alltt} -\ics*{glssetcategoryattribute}\mgroup{general}\mgroup{glossname}\mgroup{title} -\end{alltt} -However, this won't apply the case-change in the table of contents -or bookmarks. - -In the second example, you can instead use \gls{bib2gls} to apply a -case-change: -\begin{alltt} -\cs{GlsXtrLoadResources}[\resourceopt{src}=terms, - \resourceopt{sort}=none,\resourceopt{save-locations}=false\strong{, - \resourceopt{replicate-fields}=\mgroup{name=text}, - \xtrfont{name-case-change}=firstuc} -] -\end{alltt} -(Or \resourceopt[title]{name-case-change} 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 case-change to the \gloskey{name} field (leaving the +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 \gls{linktext} produced by commands like -\ics{gls} is still lowercase. +starts with a capital but the \idx{linktext} produced by commands like +\gls{gls} is still \idx{lowercase}. -In the first example (without \gls{bib2gls}) you need to do this +In the first example (without \app{bib2gls}) you can do this manually. For example: -\begin{alltt} -\cs{newglossaryentry}\mgroup{set}\mgroup{name=\mgroup{\strong{S}et},\strong{text=\mgroup{set}}, - description=\mgroup{a collection of any kind of objects}, - symbol=\mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}} +\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{alltt} - -Note that if you use the default \resourceopt[true]{save-locations} -with \gls{bib2gls}, it's possible to combine \optsand46 to have both standalone -definitions and an index. Now I do need a glossary style. In this -case I'm going to use \xtrglostyle{bookindex}, which is provided in +\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 -\gls{glossaries-extra}). I don't need any of the other style -packages, so I can still keep the \pkgopt{nostyles} option and just +\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{alltt} -\cs{usepackage}[\xtrfont{record=nameref},\% <- using bib2gls - nostyles,\% <- don't load default style packages - \xtrfont{stylemods=bookindex},\% <- load glossary-bookindex.sty - style=\xtrfont{bookindex}\% <- set the default style to 'bookindex' -]\mgroup{glossaries-extra} -\end{alltt} +\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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=terms,\% definitions in terms.bib - \resourceopt{sort}=en-GB,\% sort by this locale - \resourceopt{replicate-fields}=\mgroup{name=text}, - \xtrfont{name-case-change}=\mgroup{firstuc} -] -\end{alltt} -At the end of the document, I can add the glossary: -\begin{alltt} -\ics*{printunsrtglossary}[title=Index,target=false] -\end{alltt} +\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 -\xtrprintglosskey[false]{target} (otherwise there would be duplicate -targets). If you want letter group headings you need to use the -\bibglslongopt{group} switch: -\begin{prompt} -bib2gls -{}-group myDoc -\end{prompt} +\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{alltt} -\% arara: bib2gls: \mgroup{ group: on } -\end{alltt} +\begin{codebox} +\araraline{bib2gls: \marg{ group: on }} +\end{codebox} -The \xtrglostyle{bookindex} style doesn't show the +The \glostyle{bookindex} style doesn't show the description, so only the name and location is displayed. Remember -that the name has had a case-conversion so it now starts with an +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 \xtrglostyle{bookindex} style so that it uses +you can adjust the \glostyle{bookindex} style so that it uses the \gloskey{text} field instead. For example: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrbookindexname}}[1]\mgroup{\% - \ics*{glossentrynameother}\mgroup{\#1}\mgroup{text}} -\end{alltt} -See the \gls{glossaries-extra} user manual for further details about +\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 @@ -2176,403 +13441,395 @@ 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 \filetype{bib} file. For example: -\begin{alltt} -\atentry{index}\mgroup{element} -\atentry{index}\mgroup{member,\xtrgloskey{alias}=\mgroup{element}} -\end{alltt} +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{verbatim} -The objects that make up a set are the \glspl{element} -or \glspl{member}. -\end{verbatim} -See \bibglsbegin\ or the \gls{bib2gls} user manual for further +\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. -The \styfmt{glossaries} package comes with a number of sample -documents that illustrate the various functions. These are listed in -\sectionref{sec:samples}. - \section{Dummy Entries for Testing} \label{sec:lipsum} -In addition to the sample files described above, \sty{glossaries} -also provides some files containing lorum ipsum dummy entries. These +\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 -\texttt{tex\slash latex\slash glossaries\slash test-entries}) so -they can be included via \ics{input} or \ics{loadglsentries}. The -\gls{glossaries-extra} package provides \filetype{bib} versions of -all these files for use with \gls{bib2gls}. The files are as +\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: -\begin{description} -\item[example-glossaries-brief.tex] These entries all have brief -descriptions. For example: -\begin{verbatim} -\newglossaryentry{lorem}{name={lorem},description={ipsum}} -\end{verbatim} - -\item[example-glossaries-long.tex] These entries all have long -descriptions. For example: -\begin{verbatim} -\newglossaryentry{loremipsum}{name={lorem ipsum}, -description={dolor sit amet, consectetuer adipiscing +\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-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{verbatim} +\end{codebox} -\item[example-glossaries-multipar.tex] These entries all have -multi-paragraph descriptions. For example: -\begin{verbatim} -\longnewglossaryentry{loremi-ii}{name={lorem 1--2}}% -{% +\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{verbatim} - -\item[example-glossaries-symbols.tex] These entries all use the -\gloskey{symbol} key. For example: -\begin{verbatim} -\newglossaryentry{alpha}{name={alpha}, -symbol={\ensuremath{\alpha}}, -description={Quisque ullamcorper placerat ipsum.}} -\end{verbatim} - -\item[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{verbatim} -\newglossaryentry{sym.alpha}{sort={alpha}, -name={\ensuremath{\alpha}}, -description={Quisque ullamcorper placerat ipsum.}} -\end{verbatim} - -\item[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{verbatim} -\longnewglossaryentry{sedfeugiat}{name={sed feugiat}, -user1={example-image}}% -{% +\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-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{verbatim} +\end{codebox} -\item[example-glossaries-acronym.tex] These entries are all -abbreviations. For example: -\begin{verbatim} -\newacronym[type=\glsdefaulttype]{lid}{LID}{lorem ipsum +\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{verbatim} +\end{codebox} \begin{xtr} -If you use the \gls{glossaries-extra} extension package, then -\ics{newacronym} is redefined to use \ics*{newabbreviation} -with the \xtrgloskey{category} key set to \texttt{acronym} (rather -than the default \texttt{abbreviation}). This means that you need to -set the abbreviation style for the \texttt{acronym} category. For +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{verbatim} -\setabbreviationstyle[acronym]{long-short} -\end{verbatim} +\begin{codebox} +\gls{setabbreviationstyle}\oarg{acronym}\marg{\abbrstyle{long-short}} +\end{codebox} \end{xtr} -\item[example-glossaries-acronym-desc.tex] This file contains -entries that are all -abbreviations that use the \gloskey{description} key. +\filedef{example-glossaries-acronym-desc.tex} +This file contains entries that are all +\idxpl{acronym} that use the \gloskey{description} key. For example: -\begin{verbatim} -\newacronym[type=\glsdefaulttype, - description={fringilla a, euismod sodales, - sollicitudin vel, wisi}]{ndl}{NDL}{nam dui ligula} -\end{verbatim} +\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 \gls{glossaries-extra} extension package, then -\ics{newacronym} is redefined to use \ics*{newabbreviation} -with the \xtrgloskey{category} key set to \texttt{acronym} (rather -than the default \texttt{abbreviation}). This means that you need to -set the abbreviation style for the \texttt{acronym} category. For +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{verbatim} -\setabbreviationstyle[acronym]{long-short-desc} -\end{verbatim} +\begin{codebox*} +\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-desc}} +\end{codebox*} \end{xtr} -\item[example-glossaries-acronyms-lang.tex] These entries are all -abbreviations, where some of them have a~translation supplied in the -\gloskey{user1} key. +\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{verbatim} -\newacronym[type=\glsdefaulttype,user1={love itself}] - {li}{LI}{lorem ipsum} -\end{verbatim} +\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 \gls{glossaries-extra} extension package, then -\ics{newacronym} is redefined to use \ics*{newabbreviation} -with the \xtrgloskey{category} key set to \texttt{acronym} (rather -than the default \texttt{abbreviation}). This means that you need to -set the abbreviation style for the \texttt{acronym} category. For +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{verbatim} -\setabbreviationstyle[acronym]{long-short-user} -\end{verbatim} +\begin{codebox*} +\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-user}} +\end{codebox*} \end{xtr} -\item[example-glossaries-parent.tex] These are hierarchical entries -where the child entries use the \gloskey{name} key. +\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{verbatim} -\newglossaryentry{sedmattis}{name={sed mattis}, -description={erat sit amet} - -\newglossaryentry{gravida}{parent={sedmattis}, - name={gravida},description={malesuada}} -\end{verbatim} - -\item[example-glossaries-childnoname.tex] These are hierarchical entries -where the child entries don't use the \gloskey{name} key. -For example: -\begin{verbatim} -\newglossaryentry{scelerisque}{name={scelerisque}, - description={at}} - -\newglossaryentry{vestibulum}{parent={scelerisque}, - description={eu, nulla}} -\end{verbatim} - -\item[example-glossaries-longchild.tex] (New to v4.47.) These entries all -have long descriptions and there are some child entries. For example: -\begin{verbatim} -\newglossaryentry{longsedmattis}{name={sed mattis}, - description={erat sit amet dolor sit amet, consectetuer adipiscing elit. +\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.}} - -\newglossaryentry{longgravida}{parent={longsedmattis},name={gravida}, - description={malesuada libero, nonummy eget, consectetuer id, vulputate a, +\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{verbatim} +\end{codebox} -\item[example-glossaries-childmultipar.tex] (New to v4.47.) This -consists of parent entries with single paragraph descriptions and +\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{verbatim} -\newglossaryentry{hiersedmattis}{name={sed mattis},user1={example-image}, - description={Erat sit amet dolor sit amet, consectetuer adipiscing elit. +\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.}} - -\longnewglossaryentry{hierloremi-ii} -{name={lorem 1--2},parent={hiersedmattis}}% -{% +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{verbatim} +\end{codebox} -\item[example-glossaries-cite.tex] These entries use the +\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 \texttt{xampl.bib}, +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{verbatim} -\newglossaryentry{fusce}{name={fusce}, -description={suscipit cursus sem},user1={article-minimal}} -\end{verbatim} - -\item[example-glossaries-url.tex] These entries use the -\gloskey{user1} key to store an URL associated with the entry. -For example: -\begin{verbatim} -\newglossaryentry{aenean-url}{name={aenean}, - description={adipiscing auctor est}, - user1={http://uk.tug.org/}} -\end{verbatim} -\end{description} +\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 -\texttt{doc\slash latex\slash glossaries\slash samples} directory +\filefmt{doc/latex/glossaries/samples} directory uses all these files. See also \gallerytopic{glossaries}. \glsxtrnote -The \gls{glossaries-extra} package provides the additional test -file: -\begin{description} -\item[example-glossaries-xr.tex] These entries use the \gloskey{see} -key provided by the base \styfmt{glossaries} package and also the -\xtrgloskey{alias} and \xtrgloskey{seealso} keys that require -\gls{glossaries-extra}. For example: -\begin{verbatim} -\newglossaryentry{alias-lorem}{name={alias-lorem}, - description={ipsum},alias={lorem}} - -\newglossaryentry{amet}{name={amet},description={consectetuer}, - see={dolor}} - -\newglossaryentry{arcu}{name={arcu},description={libero}, - seealso={placerat,vitae,curabitur}} -\end{verbatim} -\end{description} +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 \styfmt{glossaries} package uses the \styfmt{tracklang} package +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, \styfmt{tracklang} isn't always able to detect the selected +\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. -See -\href{https://www.dickimaw-books.com/latex/tracklang/}{Localisation -with \texttt{tracklang.tex}} for further details. +In particular, \sty{tracklang} can't pick up languages specified +using \sty{babel}['s] \gls{babelprovide}. In the event that +\sty{tracklang} can't detect the language, use the \opt{languages} +package option. +See \sectionref{sec:pkgintegration} and also +\dickimawhref{latex/tracklang/}{Localisation +with \filefmt{tracklang.tex}} for further details. \end{important} -As from version 1.17, the \styfmt{glossaries} package can be -used with \gls{xindy} as well as \gls{makeindex}. If you -are writing in a language that uses an \gls{exlatinalph} or -\gls{nonlatinalph} it's best to use \opt3 (\gls*{xindy}) -or \opt4 (\gls{bib2gls}) -as \gls*{makeindex} (\opt2) is hard-coded for the non-extended -\gls{latinalph} and \opt1 can only perform limited ASCII comparisons. - -This means that with \optsor34 you are not restricted to the A, -\ldots, Z letter groups. If you want to use \gls*{xindy}, remember -to use the \pkgopt{xindy} package option. For example: -\begin{verbatim} -\documentclass[french]{article} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{babel} -\usepackage[xindy]{glossaries} -\end{verbatim} -If you want to use \gls*{bib2gls}, you need to use the -\pkgopt*{record} option with \gls{glossaries-extra} and supply the -definitions in \filetype{bib} files. (See the \gls{bib2gls} user +As from version 1.17, the \sty{glossaries} package can be +used with \app{xindy} as well as \app{makeindex}. If you +are writing in a language that uses an \idx{exlatinalph} or +\idx{nonlatinalph} it's best to use \option{xdy} (\app{xindy}) +or \option{b2g} (\app{bib2gls}) +as \app{makeindex} (\option{mkidx}) is hard-coded for the non-extended +\idx{latinalph} and \option{noidx} can only perform limited ASCII comparisons. + +This means that with \optionsor{xdy,b2g} you are not restricted to the A, +\ldots, Z letter groups. If you want to use \app{xindy}, remember +to use the \opt{xindy} package option. For example: +\begin{codebox} +\cmd{documentclass}[french]\marg{article} +\cmd{usepackage}[utf8]\marg{inputenc} +\cmd{usepackage}[T1]\marg{fontenc} +\cmd{usepackage}\marg{babel} +\cmd{usepackage}[\opt{xindy}]\marg{glossaries} +\end{codebox} +If you are using a non-Latin script, you may need the +\optval{xindynoglsnumbers} option or use +\gls{GlsSetXdyFirstLetterAfterDigits} to indicate the first +\idx{lettergroup} that should follow the number \idx{group}. + +If you want to use \app{bib2gls}, you need to use the +\opt{record} option with \sty{glossaries-extra} and supply the +definitions in \ext{bib} files. (See the \app{bib2gls} user manual for further details.) \begin{important} -Note that although a~\gls{nonlatinchar}, such as \'e, looks like a plain -character in your \filetype{tex} file, with standard \LaTeX\ it's actually a~macro and can therefore -cause expansion problems. You may need to switch off the field -expansions with \cs{glsnoexpandfields}. This issue doesn't occur -with \XeLaTeX\ or Lua\LaTeX. +Note that although a~\idx{nonlatinchar}, such as \'e, looks like a +plain character in your \ext{tex} file, with standard \LaTeX\ 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+). \end{important} -With \sty{inputenc}, if you use a~\gls{nonlatinchar} (or other expandable) -character at the start of an entry name, you must place it in a group, -or it will cause a problem for commands that convert the first letter -to upper case (e.g.\ \ics{Gls}). For example: -\begin{alltt} -\cs{newglossaryentry}\mgroup{elite}\mgroup{name=\mgroup{\mgroup{\'e}lite}, -description=\mgroup{select group or class}} -\end{alltt} -For further details, see the \qt{UTF-8} section in the -\sty{mfirstuc} user manual. - -If you are using \gls{xindy} or \gls{bib2gls}, the application needs -to know the encoding of the \filetype{tex} file. This information -is added to the \filetype{aux} file and can be picked up by -\gls{makeglossaries} and \gls{bib2gls}. If you use -\gls{xindy} explicitly instead of via \gls*{makeglossaries}, -you may need to specify the encoding using the \xdyopt{C} -option. Read the \gls*{xindy} manual for further details of this +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+. +\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}. If you use +\app{xindy} explicitly instead of via \gls{makeglossaries}, +you may need to specify the \idx{encoding} using the \xdyopt{C} +option. Read the \app{xindy} manual for further details of this option. -As from v4.24, if you are writing in German (for example, using the \sty{ngerman} -package\footnote{deprecated, use \styfmt{babel} instead} or -\sty{babel} with the \pkgoptfmt{ngerman} package option), -and you want to use \gls{makeindex}['s] \mkidxopt{g} option, you'll -need to change \gls{makeindex}['s] quote character using: -\begin{definition}[\DescribeMacro\GlsSetQuote] -\cs{GlsSetQuote}\marg{character} -\end{definition} -Note that \meta{character} may not be one of \verb"?" (question -mark), \verb"|" (pipe) or \verb"!" (exclamation mark). +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} 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{verbatim} -\GlsSetQuote{+} -\end{verbatim} -This must be done before \ics{makeglossaries} and any entry +\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 \sty{ngerman} will also cause +in conjunction with \optfmt{ngerman} will also cause \app{makeglossaries} to use the \mkidxopt{g} switch when invoking \app{makeindex}. \begin{important} -Be careful of \sty{babel}'s shorthands. These aren't switched +Be careful of \sty{babel}['s] shorthands. These aren't switched on until the start of the document, so any entries defined -in the preamble won't be able to use those shorthands. +in the \idx+{documentpreamble} won't be able to use those shorthands. However, if you define the entries in the document and any of those shorthands happen to be special characters for -\gls{makeindex} or \gls{xindy} (such as the double-quote) +\app{makeindex} or \app{xindy} (such as the double-quote) then this will interfere with code that tries to escape any of those characters that occur in the \gloskey{sort} key. \end{important} In general, it's best not to use \sty{babel}'s shorthands in entry definitions. For example: -\begin{verbatim} -\documentclass{article} - -\usepackage[ngerman]{babel} -\usepackage{glossaries} - -\GlsSetQuote{+} - -\makeglossaries - -\newglossaryentry{rna}{name={ribonukleins\"aure}, - sort={ribonukleins"aure}, - description={eine Nukleins\"aure}} - -\begin{document} -\gls{rna} - -\printglossaries -\end{document} -\end{verbatim} - -The \sty{ngerman} package has the shorthands on in the preamble, so -they can be used in definitions if \cs{GlsSetQuote} has been used to -change the \gls{makeindex} quote character. Example: -\begin{verbatim} -\documentclass{article} - -\usepackage[ngerman]{babel} -\usepackage{glossaries} - -\GlsSetQuote{+} - -\makeglossaries - -\newglossaryentry{rna}{name={ribonukleins"aure}, - description={eine Nukleins"aure}} - -\begin{document} -\gls{rna} - -\printglossaries -\end{document} -\end{verbatim} +\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} @@ -2586,19 +13843,20 @@ caption hooks to change the defaults. See \href{https://texfaq.org/FAQ-latexword 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 -\pkgopt{notranslate}, \pkgopt[false]{translate} or \pkgopt[babel]{translate} +\opt{notranslate}, \optval{translate}{false} or +\optval{translate}{babel} package options. If the \sty{translator} package is loaded, the translations are provided by dictionary files (for example, -\texttt{glossaries-dictionary-English.dict}). See the +\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 \pkgopt[babel]{translate}: -\begin{verbatim} -\documentclass[english,french]{article} -\usepackage{babel} -\usepackage[translate=babel]{glossaries} -\end{verbatim} +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 @@ -2610,28 +13868,30 @@ caption hooks will be used instead. \caption{Customised Text} \label{tab:predefinednames} \centering -\setlength{\tabcolsep}{3pt} +\settabcolsep{3pt} \begin{tabular}{@{}l>{\raggedright}p{0.3\linewidth}>{\raggedright}p{0.4\linewidth}@{}} \bfseries Command Name & \bfseries Translator Key Word & -\bfseries Purpose\cr -\ics{glossaryname} & \texttt{Glossary} & Title of the main glossary.\cr -\ics{acronymname} & \texttt{Acronyms} & Title of the list of acronyms -(when used with package option \pkgopt{acronym}).\cr -\ics{entryname} & \texttt{Notation (glossaries)} & +\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).\cr -\ics{descriptionname} & \texttt{Description (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).\cr -\ics{symbolname} & \texttt{Symbol (glossaries)} & Header for symbol -column in the glossary for glossary styles that support this option.\cr -\ics{pagelistname} & \texttt{Page List (glossaries)} & -Header for page list column in the glossary for glossaries that support -this option.\cr -\ics{glssymbolsgroupname} & \texttt{Symbols (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.\cr -\ics{glsnumbersgroupname} & \texttt{Numbers (glossaries)} & Header for +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} @@ -2639,12 +13899,12 @@ this option. As from version 4.12, multilingual support is provided by separate language modules that need to be installed in addition to installing -the \styfmt{glossaries} package. You only need to install the +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{http://www.dickimaw-books.com/contact.html}. The -\sty{translator} dictionary files for \styfmt{glossaries} are now +\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. @@ -2652,218 +13912,215 @@ documentation for that language module. Examples of use: \begin{itemize} \item Using \sty{babel} and \sty{translator}: -\begin{verbatim} -\documentclass[english,french]{article} -\usepackage{babel} -\usepackage{glossaries} -\end{verbatim} +\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{verbatim} -\documentclass[english,french]{article} -\usepackage{babel} -\usepackage[translate=babel]{glossaries} -\end{verbatim} -(\sty{translator} isn't loaded). The \gls{glossaries-extra} package -has \pkgopt[babel]{translate} as the default if \sty{babel} has been +\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{verbatim} -\documentclass{article} -\usepackage{polyglossia} -\setmainlanguage{english} -\usepackage{glossaries} -\end{verbatim} +\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 glossaries, it's likely that the +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 \styfmt{glossaries} package option \pkgopt[babel]{translate}, you need to be familiar with the advice given in +\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 \cs{deftranslation}) and load it using -\cs{usedictionary}. If you simply want to change the title of a -glossary, you can use the \gloskey[printglossary]{title} key in -commands like \cs{printglossary} (but not the iterative commands -like \cs{printglossaries}). +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 \cs{deftranslation} -in the preamble. It should be put in your personal dictionary +document, so it won't have any effect if you put \csfmt{deftranslation} +in the \idx+{documentpreamble}. It should be put in your personal dictionary instead (as in the example below). See the \sty{translator} -documentation for further details. (Now with \sty{beamer} -documentation.) +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 page list should be labelled +\qt{Nomenclature} and the \idx{locationlist} should be labelled \qt{Location}, then you can create a file called, say, -\begin{verbatim} -myinstitute-glossaries-dictionary-English.dict -\end{verbatim} +\filefmt{myinstitute-glossaries-dictionary-English.dict} that contains the following: -\begin{verbatim} -\ProvidesDictionary{myinstitute-glossaries-dictionary}{English} -\deftranslation{Glossary}{Nomenclature} -\deftranslation{Page List (glossaries)}{Location} -\end{verbatim} +\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{verbatim} -\usedictionary{myinstitute-glossaries-dictionary} -\end{verbatim} -(Make sure that \texttt{myinstitute-glossaries-dictionary-English.dict} +\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 \pkgopt[babel]{translate}. For example: -\begin{verbatim} -\documentclass[british]{article} - -\usepackage{babel} -\usepackage[translate=babel]{glossaries} - -\addto\captionsbritish{% - \renewcommand*{\glossaryname}{List of Terms}% - \renewcommand*{\acronymname}{List of Acronyms}% +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{verbatim} +\end{codebox*} -Note that \gls{xindy} and \gls{bib2gls} provide much better multi-lingual support -than \gls{makeindex}, so I~recommend that you use \optsor34 -if you have glossary entries that contain -\glspl{nonlatinchar}. See \sectionref{sec:xindy} for further -details on \gls{xindy}, and see the \gls{bib2gls} user manual for +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 \styfmt{glossaries} package now uses the \sty{tracklang} package +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: \texttt{glossaries\dhyphen}\meta{lang}\texttt{.}\filetype{ldf} and -\texttt{glossaries-dictionary-}\meta{Lang}\texttt{.}\filetype{dict} where +files called: \file{glossaries-lang.ldf} and +\file{glossaries-dictionary-Lang.dict} where \meta{lang} is the root language name (for example, -\texttt{english}) and \meta{Lang} is the language name used by -\sty{translator} (for example, \texttt{English}). - -Here's an example of \texttt{glossaries-dictionary-English.dict}: -\begin{verbatim} -\ProvidesDictionary{glossaries-dictionary}{English} - -\providetranslation{Glossary}{Glossary} -\providetranslation{Acronyms}{Acronyms} -\providetranslation{Notation (glossaries)}{Notation} -\providetranslation{Description (glossaries)}{Description} -\providetranslation{Symbol (glossaries)}{Symbol} -\providetranslation{Page List (glossaries)}{Page List} -\providetranslation{Symbols (glossaries)}{Symbols} -\providetranslation{Numbers (glossaries)}{Numbers} -\end{verbatim} +\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 -\texttt{English} to the \sty{translator} name for your language -(so that it matches the file name -\texttt{glossaries\dhyphen dictionary\dhyphen }\meta{Lang}\texttt{.dict}) -and, for each \cs{providetranslation}, change the second argument to +\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 \texttt{glossaries-english.ldf}: -\begin{verbatim} -\ProvidesGlossariesLang{english} - -\glsifusedtranslatordict{English} -{% - \addglossarytocaptions{\CurrentTrackedLanguage}% - \addglossarytocaptions{\CurrentTrackedDialect}% +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{} } -{% - \@ifpackageloaded{polyglossia}% - {% - \newcommand*{\glossariescaptionsenglish}{% - \renewcommand*{\glossaryname}{\textenglish{Glossary}}% - \renewcommand*{\acronymname}{\textenglish{Acronyms}}% - \renewcommand*{\entryname}{\textenglish{Notation}}% - \renewcommand*{\descriptionname}{\textenglish{Description}}% - \renewcommand*{\symbolname}{\textenglish{Symbol}}% - \renewcommand*{\pagelistname}{\textenglish{Page List}}% - \renewcommand*{\glssymbolsgroupname}{\textenglish{Symbols}}% - \renewcommand*{\glsnumbersgroupname}{\textenglish{Numbers}}% - }% - }% - {% - \newcommand*{\glossariescaptionsenglish}{% - \renewcommand*{\glossaryname}{Glossary}% - \renewcommand*{\acronymname}{Acronyms}% - \renewcommand*{\entryname}{Notation}% - \renewcommand*{\descriptionname}{Description}% - \renewcommand*{\symbolname}{Symbol}% - \renewcommand*{\pagelistname}{Page List}% - \renewcommand*{\glssymbolsgroupname}{Symbols}% - \renewcommand*{\glsnumbersgroupname}{Numbers}% - }% - }% - \ifcsdef{captions\CurrentTrackedDialect} - {% - \csappto{captions\CurrentTrackedDialect}% - {% - \glossariescaptionsenglish - }% - }% - {% - \ifcsdef{captions\CurrentTrackedLanguage} - { - \csappto{captions\CurrentTrackedLanguage}% - {% - \glossariescaptionsenglish - }% - }% - {% - }% - }% - \glossariescaptionsenglish +\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} } -\renewcommand*{\glspluralsuffix}{s} -\renewcommand*{\glsacrpluralsuffix}{\glspluralsuffix} -\renewcommand*{\glsupacrpluralsuffix}{\glstextup{\glspluralsuffix}} -\end{verbatim} +\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 \texttt{English} with the \sty{translator} +template. Replace \code{English} with the \sty{translator} language label \meta{Lang} used for the dictionary file and -replace \texttt{english} with the root language name \meta{lang}. Within the -definition of \cs{glossariescaptions}\meta{lang}, replace the +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. -\importantpar -\label{pluralsuffix}% +\plabel[plural suffix]{pluralsuffix}% The suffixes used to generate the plural forms when the plural -hasn't been specified are given by \cs{glspluralsuffix} (for general -entries). For abbreviations defined with \cs{newacronym}, -\cs{glsupacrpluralsuffix} is used for acronyms where the suffix -needs to be set using \cs{glstextup} to counteract the effects of -\cs{textsc} and \cs{glsacrpluralsuffix} for other acronym styles. +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 \styfmt{glossaries} configuration. +on the \sty{glossaries} configuration. \begin{important} -Therefore these plural suffix command definitions -aren't included in the caption mechanism as that's typically not switched on -until the start of the document. \strong{This means that the suffix in -effect will be for the last loaded language that redefined these +Therefore these plural suffix command definitions aren't included in +the \gls{captionslanguage} hook as that's typically not switched used +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 @@ -2871,156 +14128,155 @@ exceptions. \end{important} If you want to add a regional variation, create a file called -\texttt{glossaries-}\meta{iso lang}\texttt{-}\meta{iso -country}\texttt{.ldf}, where \meta{iso lang} is the ISO language -code and \meta{iso country} is the ISO country code. For example, -\texttt{glossaries-en-GB.ldf}. This file can load the root +\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{verbatim} - \ProvidesGlossariesLang{en-GB} - \RequireGlossariesLang{english} - \glsifusedtranslatordict{British} - {% - \addglossarytocaptions{\CurrentTrackedLanguage}% - \addglossarytocaptions{\CurrentTrackedDialect}% +\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{} } - {% - \@ifpackageloaded{polyglossia}% - {% - % Modify \glossariescaptionsenglish as appropriate for - % polyglossia - }% - {% - % Modify \glossariescaptionsenglish as appropriate for - % non-polyglossia - }% + \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{verbatim} - -If the translations includes \glspl{nonlatinchar}, it's necessary to -provide code that's independent of the input encoding. Remember that -while some users may use \gls{UTF-8}, others may use Latin-1 or any other -supported encoding, but while users won't appreciate you enforcing -your preference on them, it's useful to provide a \gls{UTF-8} version for -\XeLaTeX\ and \LuaLaTeX\ users. - -The \texttt{glossaries-irish.ldf} file provides this as follows: -\begin{verbatim} -\ProvidesGlossariesLang{irish} - -\glsifusedtranslatordict{Irish} -{% - \addglossarytocaptions{\CurrentTrackedLanguage}% - \addglossarytocaptions{\CurrentTrackedDialect}% +\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{} } -{% - \ifdefstring{\inputencodingname}{utf8} - {\input{glossaries-irish-utf8.ldf}}% - {% - \ifdef{\XeTeXinputencoding}% XeTeX defaults to UTF-8 - {\input{glossaries-irish-utf8.ldf}}% - {\input{glossaries-irish-noenc.ldf}} +\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}} } - \ifcsdef{captions\CurrentTrackedDialect} - {% - \csappto{captions\CurrentTrackedDialect}% - {% - \glossariescaptionsirish - }% - }% - {% - \ifcsdef{captions\CurrentTrackedLanguage} - { - \csappto{captions\CurrentTrackedLanguage}% - {% - \glossariescaptionsirish - }% - }% - {% - }% - }% - \glossariescaptionsirish + \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{verbatim} -(Again you can use this as a template. Replace \texttt{irish} with -your root language label and \texttt{Irish} with the +\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: \nolinkurl{glossaries-irish-noenc.ldf} -(no encoding information) -and \nolinkurl{glossaries-irish-utf8.ldf} (\gls{UTF-8}). - -These both define \cs{glossariescaptionsirish} but the \texttt{*-noenc.ldf} uses -\LaTeX\ accent commands: -\begin{verbatim} -\@ifpackageloaded{polyglossia}% -{% - \newcommand*{\glossariescaptionsirish}{% - \renewcommand*{\glossaryname}{\textirish{Gluais}}% - \renewcommand*{\acronymname}{\textirish{Acrainmneacha}}% - \renewcommand*{\entryname}{\textirish{Ciall}}% - \renewcommand*{\descriptionname}{\textirish{Tuairisc}}% - \renewcommand*{\symbolname}{\textirish{Comhartha}}% - \renewcommand*{\glssymbolsgroupname}{\textirish{Comhartha\'{\i}}}% - \renewcommand*{\pagelistname}{\textirish{Leathanaigh}}% - \renewcommand*{\glsnumbersgroupname}{\textirish{Uimhreacha}}% - }% -}% -{% - \newcommand*{\glossariescaptionsirish}{% - \renewcommand*{\glossaryname}{Gluais}% - \renewcommand*{\acronymname}{Acrainmneacha}% - \renewcommand*{\entryname}{Ciall}% - \renewcommand*{\descriptionname}{Tuairisc}% - \renewcommand*{\symbolname}{Comhartha}% - \renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}% - \renewcommand*{\pagelistname}{Leathanaigh}% - \renewcommand*{\glsnumbersgroupname}{Uimhreacha}% - }% +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{verbatim} -whereas the \texttt{*-utf8.ldf} replaces the accent commands with -the appropriate \gls{UTF-8} characters. - +\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 \optsor23. You can +This section is only applicable if you have chosen \optionsor{mkidx,b2g}. You can ignore this section if you have chosen any of the other options. 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 \gls{bib2gls}). +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 \gls{makeglossaries} or \gls{makeindex}, you can try using -the \pkgopt{automake} package option, described in -\sectionref{sec:pkgopts-sort}, but you will need \TeX's shell escape -enabled. See also -\href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating +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}. -In order to generate a sorted glossary with compact -\glspl{numberlist}, it is necessary to use an external -\gls{indexingapp} as an intermediate step (unless you have chosen -\opt1, which uses \TeX\ to do the sorting or \opt5, which doesn't +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 (unless you have chosen +\option{noidx}, which uses \TeX\ to do the sorting or \option{unsrt}, which doesn't perform any sorting). It is this application that creates the file containing the code required to typeset the -glossary. \strong{If this step is omitted, the glossaries will not -appear in your document.} The two \glspl*{indexingapp} that are most -commonly used with \LaTeX\ are \gls{makeindex} and \gls{xindy}. As +\idx{glossary}. \strong{If this step is omitted, the +\idxpl{glossary} will not +appear in your document.} The two \idxpl{indexingapp} that are most +commonly used with \LaTeX\ are \app{makeindex} and \app{xindy}. As from version 1.17, the \styfmt{glossaries} package can be used with either of these applications. Previous versions were designed to be -used with \gls*{makeindex} only. With the \gls{glossaries-extra} package, you -can also use \gls{bib2gls} as the indexing application. (See -the \gls{glossaries-extra} and \gls{bib2gls} user manuals for -further details.) Note that \gls*{xindy} and \gls*{bib2gls} have much -better multi-lingual support than \gls*{makeindex}, so \gls*{xindy} -or \gls*{bib2gls} are recommended if you're not writing in English. -Commands that only have an effect when \gls*{xindy} is used are +used with \app{makeindex} only. With the \sty{glossaries-extra} package, you +can also use \app{bib2gls} as the \idx{indexingapp}. (See +the \sty{glossaries-extra} and \app{bib2gls} user manuals for +further details.) Note that \app{xindy} and \app{bib2gls} have much +better multi-lingual support than \app{makeindex}, so \app{xindy} +or \app{bib2gls} are recommended if you're not writing in English. +Commands that only have an effect when \app{xindy} is used are described in \sectionref{sec:xindy}. \begin{important} @@ -3028,2319 +14284,2901 @@ 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{alltt} -\% arara: pdflatex -\% arara: makeglossaries -\% arara: pdflatex -\end{alltt} +\begin{codebox} +\araraline{pdflatex} +\araraline{makeglossaries} +\araraline{pdflatex} +\end{codebox} With \app{latexmk} you need to set up the required dependencies. \end{important} -The \styfmt{glossaries} package comes with the Perl script -\gls{makeglossaries} which will run \gls{makeindex} or \gls{xindy} -on all the glossary files using a customized style file (which is -created by \ics{makeglossaries}). See +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 -\gls*{xindy} and \app{latexmk}). Most Unix-like -operating systems come with a~Perl interpreter. \TeX~Live also comes -with a~Perl interpreter. MiK\TeX\ doesn't come with a~Perl -interpreter so if you are a~Windows MiK\TeX\ user you will need to -install Perl if you want to use \gls{makeglossaries} or \gls{xindy}. +\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 -\href{http://tex.stackexchange.com/questions/158796/miktex-and-perl-scripts-and-one-python-script}{MiKTeX and Perl scripts (and one Python script)}. +\texseref{questions/158796}{MikTeX and Perl scripts (and one Python script)}. -The advantages of using \gls*{makeglossaries}: +The advantages of using \app{makeglossaries}: \begin{itemize} -\item It automatically detects whether to use \gls*{makeindex} or -\gls*{xindy} and sets the relevant application switches. +\item It automatically detects whether to use \app{makeindex} or +\app{xindy} and sets the relevant application switches. -\item One call of \gls*{makeglossaries} will run -\gls*{makeindex}\slash\gls*{xindy} for each glossary type. +\item One call of \app{makeglossaries} will run +\app{makeindex}\slash\app{xindy} for each \idx{glossary} type. -\item If things go wrong, \gls{makeglossaries} will scan the -messages from \gls{makeindex} or \gls{xindy} and attempt to diagnose -the problem in relation to the \styfmt{glossaries} package. This +\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 \gls*{makeindex} or -\gls*{xindy} messages. +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 \gls{makeindex} warns about multiple encap values, -\gls{makeglossaries} will detect this and attempt to correct the -problem.\footnote{Added to version \gls{makeglossaries} 2.18.} This -correction is only provided by \gls{makeglossaries} when -\gls{makeindex} is used since \gls{xindy} uses the order of the -\ixindyattrs attributes list to determine which format should take precedence. -(see \sectionref{sec:xindyloc}.) +\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}. \end{itemize} +The first two items also apply to \app{makeglossaries-lite}. -As from version 4.16, the \styfmt{glossaries} package also comes -with a~Lua script called \gls{makeglossaries-lite.lua}. This is a -\emph{trimmed-down} alternative to the \gls{makeglossaries} Perl +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 Lua\TeX\ (and therefore have +modern \TeX\ distributions come with \LuaTeX\ (and therefore have a~Lua interpreter) you don't need to install anything else in order -to use \gls{makeglossaries-lite.lua} so it's an alternative to -\gls{makeglossaries} if you want to use \opt2 (\gls{makeindex}). +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 glossaries +If things go wrong and you can't work out why your \idxpl{glossary} aren't being generated correctly, you can use -\gls{makeglossariesgui} as a diagnostic tool. Once you've +\app{makeglossariesgui} as a diagnostic tool. Once you've fixed the problem, you can then go back to using -\gls{makeglossaries} or \gls{makeglossaries-lite.lua}. +\app{makeglossaries} or \app{makeglossaries-lite}. -Whilst I strongly recommended that you use the \gls{makeglossaries} -Perl script or the \gls{makeglossaries-lite.lua} Lua script, it is -possible to use the \styfmt{glossaries} package without using those +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 \gls{makeindex}\slash\gls{xindy}. +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 \gls*{makeglossaries} because you +If you are choosing not to use \app{makeglossaries} because you don't want to install Perl, you will only be able to use -\gls*{makeindex} as \gls*{xindy} also requires Perl. (Other useful -Perl scripts include \appfmt{epstopdf} and \appfmt{latexmk}, so it's +\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.) \end{important} -Note that if any of your entries use an entry -that is not referenced outside the glossary, you will need to -do an additional \gls{makeglossaries}, \gls{makeindex} -or \gls{xindy} run, as appropriate. For example, -suppose you have defined the following entries:\footnote{As from -v3.01 \ics{gls} is no longer fragile and doesn't need protecting.} -\begin{verbatim} -\newglossaryentry{citrusfruit}{name={citrus fruit}, -description={fruit of any citrus tree. (See also -\gls{orange})}} +Below, references to \app{makeglossaries} can usually be substituted +with \app{makeglossaries-lite}, except where noted otherwise. -\newglossaryentry{orange}{name={orange}, -description={an orange coloured fruit.}} -\end{verbatim} -and suppose you have \verb|\gls{citrusfruit}| in your document -but don't reference the \texttt{orange} entry, then the -\texttt{orange} entry won't appear in your glossary until -you first create the glossary and then do another run -of \gls{makeglossaries}, \gls{makeindex} or \gls{xindy}. -For example, if the document is called \texttt{myDoc.tex}, then +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{prompt} +\begin{terminal} pdflatex myDoc makeglossaries myDoc pdflatex myDoc makeglossaries myDoc pdflatex myDoc -\end{prompt} -(In the case of \opt4, \gls{bib2gls} will scan the description for -instances of commands like \cs{gls} to ensure they are selected but -an extra \gls{bib2gls} call is required to ensure the locations are -included, if locations lists are required. See the -and \gls{bib2gls} manual for further details.) - -Likewise, an additional \gls{makeglossaries} and \LaTeX\ run +\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 +and \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 \glspl{numberlist} in the glossary may +means that the \idxpl{numberlist} in the glossary may need updating. The examples in this document assume that you are accessing -\gls{makeglossaries}, \gls{xindy} or \gls{makeindex} via a terminal. -Windows users can use the MSDOS Prompt which is usually accessed via -the \menu{Start}\submenu{All Programs} menu or -\menu{Start}\submenu{All Programs}\submenu{Accessories} menu. +\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 -\href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating +\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.\ \filetype{glg} or \filetype{alg}) for messages. +(e.g.\ \ext{glg} or \ext{alg}) for messages. \begin{table}[htbp] -\caption[Commands and package options that have no effect when -using xindy or makeindex explicitly]{Commands and package options that have no effect when -using \gls{xindy} or \gls{makeindex} explicitly} +\caption{Commands and package options that have no effect when +using \apptext{xindy} or \apptext{makeindex} explicitly} \label{tab:makeglossariesCmds} -\vskip\baselineskip +\centering \begin{tabular}{@{}lll@{}} -\bfseries Command or Package Option & \gls{makeindex} & -\gls{xindy}\\ -\pkgopt[letter]{order} & use \mkidxopt{l} & - use \xdyopt{M}\texttt{ ord/letorder}\\ -\pkgopt[word]{order} & default & default\\ -\pkgopt{xindy}=\{\pkgoptfmt{language=}\meta{lang}\pkgoptfmt{,codename=}\meta{code}\} & -N/A & use \xdyopt{L} \meta{lang} \xdyopt{C} \meta{code}\\ -\ics{GlsSetXdyLanguage}\marg{lang} & N/A & -use \xdyopt{L} \meta{lang}\\ -\ics{GlsSetXdyCodePage}\marg{code} & N/A & -use \xdyopt{C} \meta{code} +\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\\ +\optval{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 makeglossaries Perl Script} +\subsection{Using the \apptext{makeglossaries} Perl Script} \label{sec:makeglossariesapp} -The \gls{makeglossaries} script picks up the relevant information -from the auxiliary (\filetype{aux}) file and will either call -\gls{xindy} or \gls{makeindex}, depending on the supplied +\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 \gls*{makeglossaries}. For example, if your -document is called \texttt{myDoc.tex}, type the following in your +without the extension to \app{makeglossaries}. For example, if your +document is called \filefmt{myDoc.tex}, type the following in your terminal: -\begin{prompt} +\begin{terminal} pdflatex myDoc makeglossaries myDoc pdflatex myDoc -\end{prompt} -You may need to explicitly load \gls{makeglossaries} into Perl: -\begin{prompt} -perl makeglossaries myDoc -\end{prompt} - -Windows users: \TeX~Live on Windows has its own internal Perl -interpreter and provides \texttt{makeglossaries.exe} as a~convenient -wrapper for the \gls{makeglossaries} Perl script. MiKTeX also -provides a~wrapper \texttt{makeglossaries.exe} but doesn't provide -a~Perl interpreter, which is still required even if you run MiKTeX's -\texttt{makeglossaries.exe}, so with MiKTeX you'll need to install -Perl.\footnote{The batch file \texttt{makeglossaries.bat} has been -removed since the \TeX\ distributions for Windows provide -\texttt{makeglossaries.exe}.} There's more information about this at -\url{http://tex.stackexchange.com/q/158796/19862} on the TeX.SX -site. - -The \gls{makeglossaries} script attempts to fork the -\gls{makeindex}\slash\gls{xindy} process using \texttt{open()} on the -piped redirection \verb"2>&1 |" and parses the processor output to -help diagnose problems. If this method fails \gls{makeglossaries} -will print an \qt{Unable to fork} warning and will retry without -redirection. If you run \gls{makeglossaries} on an operating system -that doesn't support this form of redirection, then you can use the -\mkglsopt{Q} switch to suppress this warning or you can use the -\mkglsopt{k} switch to make \gls{makeglossaries} automatically use -the fallback method without attempting the redirection. Without this -redirection, the \mkglsopt{q} (quiet) switch doesn't work as well. - -You can specify in which directory the \filetype{aux}, -\filetype{glo} etc files are located using the \texttt{-d} switch. -For example: -\begin{prompt} -pdflatex -output-directory myTmpDir myDoc -makeglossaries -d myTmpDir myDoc -\end{prompt} -Note that \gls*{makeglossaries} assumes by default that -\gls*{makeindex}\slash\gls*{xindy} is on your operating system's -path. If this isn't the case, you can specify the full pathname -using \mkglsopt{m} \meta{path/to/makeindex} for \gls*{makeindex} -or \mkglsopt{x} \meta{path/to/xindy} for \gls*{xindy}. - -As from \gls{makeglossaries} v2.18, if you are using -\gls{makeindex}, there's a check for \gls*{makeindex}['s] multiple -encap warning. This is where different encap values (location formats) are -used on the same location for the same entry. For example: -\begin{verbatim} -\documentclass{article} +\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} 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)}. -\usepackage{glossaries} -\makeglossaries +\begin{important} +When upgrading the \sty{glossaries} package, make sure you also +upgrade your version of \app{makeglossaries}. The current version is +4.50. +\end{important} -\newglossaryentry{sample}{name={sample},description={an example}} +Some of the options are only applicable to \app{makeindex} and some +are only applicable to \app{xindy}. -\begin{document} -\gls{sample}, \gls[format=textbf]{sample}. -\printglossaries -\end{document} -\end{verbatim} -If you explicitly use \gls{makeindex}, this will cause a warning and -the location list will be \qt{1, \textbf{1}}. That is, the page +\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, -\gls{makeglossaries} will check for this warning and, if found, will +\app{makeglossaries} will check for this warning and, if found, will attempt to correct the problem by removing duplicate locations and -retrying. There's no similar check for \gls{xindy} as \gls*{xindy} -won't produce any warning and will simply discard duplicates. +retrying. If you actually want the duplicate location, you can +prevent \app{makeglossaries} from checking and correcting the +duplicates with \mkglsopt{e}. -For a complete list of options do \texttt{makeglossaries -{}-help}. - -\begin{important} -When upgrading the \styfmt{glossaries} package, make sure you also -upgrade your version of \gls{makeglossaries}. The current version is -4.49. -\end{important} +There's no similar check for \app{xindy} as \app{xindy} +won't produce any warning and will simply discard duplicates. -\subsection{Using the makeglossaries-lite Lua Script} +\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} -The Lua alternative to the \gls{makeglossaries} Perl script requires +\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 Lua\TeX. Lua is +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 \gls{makeglossaries-lite.lua} +scripting languages, such as Perl. The \app{makeglossaries-lite} script is therefore limited by this and some of the options -available to the \gls{makeglossaries} Perl script aren't available -here. (In particular the \mkglsopt{d} option.) - -\begin{important} -Note that \TeX~Live on Unix-like systems creates a -symbolic link called \texttt{makeglossaries-lite} (without the -\filetype{lua} extension) to the actual -\texttt{makeglossaries-lite.lua} script, so you may not need to -supply the extension. -\end{important} - -The \gls{makeglossaries-lite.lua} script can be invoked in the same way -as \gls{makeglossaries}. For example, if your document is called -\texttt{myDoc.tex}, then do -\begin{prompt} -makeglossaries-lite.lua myDoc -\end{prompt} -or -\begin{prompt} +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{prompt} - -\emph{Some} of the options available with the Perl -\gls{makeglossaries} script are also available with the Lua \gls{makeglossaries-lite.lua} -script. For a complete list of available options, do -\begin{prompt} -makeglossaries-lite.lua -{}-help -\end{prompt} - - -\subsection[Using xindy explicitly (Option~3)]{Using -\gls{xindy} explicitly (\ifpdf \opt3\else Option 3\fi)} +\end{terminal} +Note that the \app{arara} rule doesn't contain the hyphen: +\begin{codebox} +\araraline{makeglossarieslite} +\end{codebox} + +Some of the options are only applicable to \app{makeindex} and some +are only applicable to \app{xindy}. + +\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} -\Gls{xindy} comes with \TeX~Live. It has also been added -to Mik\TeX, but if you don't have it installed, see -\href{http://tex.stackexchange.com/questions/71167/how-to-use-xindy-with-miktex}{How -to use Xindy with MikTeX} on -\urlfootref{http://www.stackexchange.com/}{\TeX\ on StackExchange}. +\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 \gls{xindy} to process the glossary +If you want to use \app{xindy} to process the glossary files, you must make sure you have used the -\pkgopt{xindy} package option: -\begin{verbatim} -\usepackage[xindy]{glossaries} -\end{verbatim} -This is required regardless of whether you use \gls{xindy} +\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 \gls{makeglossaries}. This causes the glossary -entries to be written in raw \gls*{xindy} format, so you need to -use \xdyopt{I}\texttt{ xindy} \emph{not} \xdyopt{I}\texttt{ tex}. +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 \gls{xindy} type the following in your terminal +To run \app{xindy} type the following in your terminal (all on one line): -\begin{prompt} -xindy -L \meta{language} -C \meta{encoding} -I xindy -M \meta{style} -t \meta{base}.glg -o \meta{base}.gls \meta{base}.glo -\end{prompt} +\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 encoding, \meta{base} is the name of the document without the -\filetype{tex} extension and \meta{style} is the name of the -\gls{xindy} style file without the \filetype{xdy} extension. -The default name for this style file is \meta{base}\filetype{xdy} -but can be changed via \ics{setStyleFile}\marg{style}. You may need +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 \meta{base}\ext{xdy} +but can be changed via \gls{setStyleFile}. You may need to specify the full path name depending on the current working directory. If any of the file names contain spaces, you must delimit them using double-quotes. -For example, if your document is called \texttt{myDoc.tex} and -you are using UTF8 encoding in English, then type the +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{prompt} +\begin{terminal} xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo -\end{prompt} - -Note that this just creates the main glossary. You need to do -the same for each of the other glossaries (including the -list of acronyms if you have used the \pkgopt{acronym} -package option), substituting \filetype{glg}, \filetype{gls} -and \filetype{glo} with the relevant extensions. For example, -if you have used the \pkgopt{acronym} package option, then +\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{prompt} +\begin{terminal} xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn -\end{prompt} -For additional glossaries, the extensions are those supplied -when you created the glossary with \ics{newglossary}. - -Note that if you use \gls{makeglossaries} instead, you can -replace all those calls to \gls{xindy} with just one call -to \gls*{makeglossaries}: -\begin{prompt} +\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{prompt} +\end{terminal} Note also that some commands and package options have no effect if -you use \gls{xindy} explicitly instead of using -\gls*{makeglossaries}. These are listed in +you use \app{xindy} explicitly instead of using +\app{makeglossaries}. These are listed in \tableref{tab:makeglossariesCmds}. - -\subsection[Using makeindex explicitly (Option~2)]{Using -\gls{makeindex} explicitly (\ifpdf \opt2\else Option 2\fi)} +\subsection{Using +\apptext{makeindex} explicitly (Option \glsfmttext{idx.opt.mkidx})} \label{sec:makeindexapp} -If you want to use \gls{makeindex} explicitly, you must -make sure that you haven't used the \pkgopt{xindy} package -option or the glossary entries will be written in the wrong -format. To run \gls*{makeindex}, type the following in +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{prompt} -makeindex -s \meta{style}.ist -t \meta{base}.glg -o \meta{base}.gls \meta{base}.glo -\end{prompt} +\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 -\filetype{tex} extension and \meta{style}\filetype{ist} is the -name of the \gls{makeindex} style file. By default, this is -\meta{base}\filetype{ist}, but may be changed via -\ics{setStyleFile}\marg{style}. Note that there are other options, -such as \mkidxopt{l} (letter ordering). See the \gls*{makeindex} +\ext{tex} extension and \meta{style}\ext{ist} is the +name of the \app{makeindex} style file. By default, this is +\meta{base}\ext{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 \texttt{myDoc.tex}, then +For example, if your document is called \filefmt{myDoc.tex}, then type the following at the terminal: -\begin{prompt} +\begin{terminal} makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo -\end{prompt} -Note that this only creates the main glossary. If you have -additional glossaries (for example, if you have used the -\pkgopt{acronym} package option) then you must call -\gls{makeindex} for each glossary, substituting -\filetype{glg}, \filetype{gls} and \filetype{glo} with the +\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 -\pkgopt{acronym} package option, then you need to type the +\opt{acronym} package option, then you need to type the following in your terminal: -\begin{prompt} +\begin{terminal} makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn -\end{prompt} +\end{terminal} For additional glossaries, the extensions are those supplied -when you created the glossary with \ics{newglossary}. +when you created the glossary with \gls{newglossary}. -Note that if you use \gls{makeglossaries} instead, you can -replace all those calls to \gls{makeindex} with just one call -to \gls*{makeglossaries}: -\begin{prompt} +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{prompt} +\end{terminal} Note also that some commands and package options have no effect if -you use \gls*{makeindex} explicitly instead of using -\gls{makeglossaries}. These are listed in +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 \gls{xindy}, -\gls{makeindex} or \gls{bib2gls} is stored in the \filetype{aux} +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 glossaries where appropriate. This section +script to make the \idxpl{glossary} where appropriate. This section describes how the information is stored in the auxiliary file. \subsection{MakeIndex and Xindy} \label{sec:notedev.makeindex.xindy} -The file extensions used by each defined (but not ignored) glossary are given by -\begin{definition}[\DescribeMacro{\@newglossary}] -\cs{@newglossary}\marg{label}\marg{log}\marg{out-ext}\marg{in-ext} -\end{definition} +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{\gls{indexingapp}['s]} input file (the output file from the -\styfmt{glossaries} package's point of view), \meta{out-ext} is the -extension of the \emph{\gls*{indexingapp}['s]} output file (the -input file from the \styfmt{glossaries} package's point of view) and -\meta{log} is the extension of the \gls*{indexingapp}['s] transcript -file. The label for the glossary is also given. This isn't required -with \gls{makeindex}, but with \gls{xindy} it's needed to pick up -the associated language and encoding (see below). For -example, the information for the default main glossary is written -as: -\begin{verbatim} -\@newglossary{main}{glg}{gls}{glo} -\end{verbatim} -If \gls{glossaries-extra}['s] hybrid method has been used (with -\cs{makeglossaries}\oarg{sub-list}), then the sub-list -of glossaries that need to be processed will be identified with: -\begin{alltt} -\ics*{glsxtr@makeglossaries}\marg{list} -\end{alltt} - -The \gls{indexingapp}['s] style file is specified by -\begin{definition}[\DescribeMacro{\@istfilename}] -\cs{@istfilename}\marg{filename} -\end{definition} -The file extension indicates whether to use \gls{makeindex} -(\filetype{ist}) or \gls{xindy} (\filetype{xdy}). Note that -the glossary information is formatted differently depending on -which \gls*{indexingapp} is supposed to be used, so it's +\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 \gls{makeglossaries}: -\begin{alltt} -\% arara: makeglossaries if found("aux", "@istfilename") -\end{alltt} -It's more complicated if you want to explicitly run \gls{makeindex} -or \gls{xindy} +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 \gls{makeindex} or -\gls{xindy} then the user will miss out on the diagnostic -information and the encap-clash fix that \gls{makeglossaries} also -provides. +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: -\begin{definition}[\DescribeMacro{\@glsorder}] -\cs{@glsorder}\marg{order} -\end{definition} -where \meta{order} can be either \texttt{word} or \texttt{letter}. - -If \gls{xindy} should be used, the language and code page -for each glossary is specified by -\begin{definition}[\DescribeMacro{\@xdylanguage}\DescribeMacro{\@gls@codepage}] -\cs{@xdylanguage}\marg{label}\marg{language}\\ -\cs{@gls@codepage}\marg{label}\marg{code} -\end{definition} -where \meta{label} identifies the glossary, \meta{language} is -the root language (e.g.\ \texttt{english}) and \meta{code} -is the encoding (e.g.\ \texttt{utf8}). These commands are omitted -if \gls{makeindex} should be used. - -If \opt1 has been used, the \filetype{aux} file will contain -\begin{definition}[\DescribeMacro\@gls@reference] -\cs{@gls@reference}\marg{type}\marg{label}\marg{location} -\end{definition} +\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 auto-completion, the -\pkgopt{writeglslabels} package option will create a file containing -the labels of all defined entries (regardless of whether or not the -entry has been used in the document). As from v4.47, there is a -similar option \pkgopt{writeglslabelnames} that writes both the +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 \gls{glossaries-extra} -package also provides \pkgopt+{atom}{docdef}, which will create the -\filetype{glsdefs} file but will act like \pkgopt+{restricted}{docdef}. +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 \opt4 has been used, the \filetype{aux} file will contain one or more instances of -\begin{alltt} -\ics*{glsxtr@resource}\marg{options}\marg{basename} -\end{alltt} -where \meta{basename} is the basename of the \filetype{glstex} file -that needs to be created by \gls{bib2gls}. If \texttt{src\dequals\marg{bib -list}} isn't present in \meta{options} then \meta{basename} also -indicates the name of the associated \filetype{bib} file. +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 \gls{bib2gls}: -\begin{alltt} -\% arara: bib2gls if found("aux", "glsxtr@resource") -\end{alltt} -(It gets more complicated if both \ics*{glsxtr@resource} and -\cs{@istfilename} are present as that indicates the hybrid -\pkgopt+{hybrid}{record} option.) - -Remember that with \gls{bib2gls}, the entries will never be defined +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 \filetype{glstex} file created by \gls{bib2gls}). You can -also pick up labels from the records in \filetype{aux} file, which +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: -\begin{alltt} -\ics*{glsxtr@record}\marg{label}\marg{h-prefix}\marg{counter}\marg{format}\marg{loc} -\end{alltt} -or (with \pkgopt+{nameref}{record}) -\begin{alltt} -\ics*{glsxtr@record@nameref}\marg{label}\marg{href prefix}\marg{counter}\marg{format}\marg{location}\marg{title}\marg{href anchor}\marg{href value} -\end{alltt} -or (with \cs{glssee}) -\begin{alltt} -\ics*{glsxtr@recordsee}\marg{label}\marg{xr list} -\end{alltt} +\cmddef{glsxtr@record} +or (with \optval{record}{nameref}): +\cmddef{glsxtr@record@nameref} +or (with \gls{glssee}): +\cmddef{glsxtr@recordsee}\marg{label}\marg{xr list} You can also pick up the commands defined with -\ics*{glsxtrnewglslike}, which are added to the \filetype{aux} file -for \gls{bib2gls}['s] benefit: -\begin{alltt} -\ics*{@glsxtr@newglslike}\marg{label-prefix}\marg{cs} -\end{alltt} -If \ics*{GlsXtrSetAltModifier} is used, then the modifier is +\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: -\begin{alltt} -\ics*{@glsxtr@altmodifier}\marg{character} -\end{alltt} -Label prefixes (for the \ics*{dgls} set of commands) are identified +\cmddef{@glsxtr@altmodifier} +Label prefixes (for the \gls{dgls} set of commands) are identified with: -\begin{alltt} -\ics*{@glsxtr@prefixlabellist}\marg{list} -\end{alltt} +\cmddef{@glsxtr@prefixlabellist} \chapter{Package Options} \label{sec:pkgopts} -This section describes the available \styfmt{glossaries} package -options. You may omit the \texttt{=true} for boolean options. (For -example, \pkgopt{acronym} is equivalent to \pkgopt[true]{acronym}). +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 \gls{glossaries-extra} package has additional options described -in the \gls*{glossaries-extra} manual. The extension package also +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 \gls{glossaries-extra} may have additional package +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 \meta{key}=\meta{value} package options can't be passed via the -document class options. (This includes options where the -\meta{value} part may be omitted, such as \pkgopt{acronym}.) This is -a general limitation not restricted to the \styfmt{glossaries} -package. Options that aren't \meta{key}=\meta{value} (such as -\pkgopt{makeindex}) may be passed via the document class options. +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} -\pkgoptsec{nowarn} This suppresses all warnings generated by -the \styfmt{glossaries} package. Don't use this option if you're new to using -\styfmt{glossaries} as the warnings are designed to help detect -common mistakes (such as forgetting to use \ics{makeglossaries}). -Note that if you use \pkgopt{debug} with any value other than -\pkgoptfmt{false} it will override this option. +\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. -\pkgoptsec{nolangwarn} This suppresses the warning generated by -a missing language module. +\optiondef{nolangwarn} +This suppresses the warning generated by a missing language module. -\pkgoptsec{noredefwarn} If you load \styfmt{glossaries} with +\optiondef{noredefwarn} +If you load \sty{glossaries} with a~class or another package that already defines glossary related -commands, by default \styfmt{glossaries} will warn you that it's +commands, by default \sty{glossaries} will warn you that it's redefining those commands. If you are aware of the consequences of -using \styfmt{glossaries} with that class or package and you don't +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 -\pkgopt{nowarn} option described above. (This option is -automatically switched on by \gls{glossaries-extra}.) - -\pkgoptsec[value]{debug} Introduced in version 4.24. The default -setting is \pkgopt[false]{debug}. The following values are -available: \pkgoptfmt{false}, \pkgoptfmt{true}, -\pkgoptfmt{showtargets} (v4.32+) and \pkgoptfmt{showaccsupp} -(v4.45+). If no value is given, \pkgopt[true]{debug} is assumed. +\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 \gls{glossaries-extra} package provides extra values -\pkgoptval*{showwrgloss}{debug}, that may be used to show where -the indexing is occurring, and \pkgoptval*{all}{debug}, which -switches on all debugging options. See the \gls{glossaries-extra} +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} -All values other than \pkgopt[false]{debug} switch on the debug mode -(and will automatically cancel the \pkgopt{nowarn} option). The -\pkgopt[showtargets]{debug} option will additionally use: -\begin{definition}[\DescribeMacro\glsshowtarget] -\cs{glsshowtarget}\marg{target name} -\end{definition} -to show the hypertarget or hyperlink name when -\cs{glsdohypertarget} is used by commands like \cs{glstarget} -and when \cs{glsdohyperlink} is used by commands like \cs{gls}. -In math mode or inner mode, this puts the target name in square -brackets just before the link or anchor. In outer mode it uses: -\begin{definition}[\DescribeMacro\glsshowtargetouter] -\cs{glsshowtargetouter}\marg{label} -\end{definition} -which by default places the target name in the margin. The font is -given by: -\begin{definition}[\DescribeMacro\glsshowtargetfont] -\cs{glsshowtargetfont} -\end{definition} -The default definition is \verb|\ttfamily\small|. This command is -included in the definition of \cs{glsshowtargetouter}, so if you -want to redefine that command remember to include the font. For -example: -\begin{verbatim} -\renewcommand*{\glsshowtargetouter}[1]{% - {\glsshowtargetfont [#1]}} -\end{verbatim} - -Similarly, the \pkgopt[showaccsupp]{debug} will add the -accessibility support information using: -\begin{definition}[\DescribeMacro\glsshowaccsupp] -\cs{glsshowaccsupp}\marg{options}\marg{tag}\marg{replacement text} -\end{definition} -This internally uses \ics{glsshowtarget}. This option is provided -for use with \sty{glossaries-accsupp}. - The purpose of the debug mode can be demonstrated with the following example document: -\begin{alltt} -\cs{documentclass}\mgroup{article} -\cs{usepackage}\mgroup{glossaries} -\cs{newglossaryentry}\mgroup{sample1}\mgroup{name=\mgroup{sample1},description=\mgroup{example}} -\cs{newglossaryentry}\mgroup{sample2}\mgroup{name=\mgroup{sample2},description=\mgroup{example}} -\strong{\ics{glsadd}}\mgroup{sample2}\% <- does nothing here -\strong{\ics{makeglossaries}} -\cs{begin}\mgroup{document} -\cs{gls}\mgroup{sample1}. -\cs{printglossaries} -\cs{end}\mgroup{document} -\end{alltt} -In this case, only the \texttt{sample1} entry has been indexed, even -though \verb|\glsadd{sample2}| appears in the source code. -This is because \verb|\glsadd{sample2}| has been used before the -associated file is opened by \ics{makeglossaries}. Since the file +\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 \texttt{sample2} entry doesn't appear in the glossary. +the \qt{sample2} entry doesn't appear in the \idx{glossary}. -Without \cs{makeglossaries} the indexing is suppressed with \optsand23 but, other -than that, commands like \cs{gls} behave as usual. +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 \styfmt{glossaries} -to format the entries (e.g.\ abbreviation expansion) but not display -any lists of terms, abbreviations, symbols etc (or the user may -prefer to use the unsorted \optsor56). -It's also possible that the user may want to temporarily comment out -\cs{makeglossaries} in order to suppress the indexing while working -on a draft version to speed compilation, or the user may -prefer to use \optsor14 for indexing, which don't use \cs{makeglossaries}. - -Therefore \cs{makeglossaries} can't be used to enable -\cs{newglossaryentry} and commands like \cs{gls} and \cs{glsadd}. +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 \pkgopt{debug} option, -\begin{verbatim} -\usepackage[debug]{glossaries} -\end{verbatim} -will write information to the log file when the indexing +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{quote} +\begin{transcript} Package glossaries Info: wrglossary(\meta{type})(\meta{text}) on input line \meta{line number}. -\end{quote} +\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 \cs{glsadd} -or \cs{glsaddall}, try switching on the \pkgopt{debug} option +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. -\pkgoptsec[boolean]{savewrites} This is a boolean option to minimise the -number of write registers used by the \styfmt{glossaries} package. -The default is \pkgopt[false]{savewrites}. With \optsand23, one -write register is required per (non-ignored) glossary and one for +\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. -With all options except \optsand14, another write register is -required if the \filetype{docdefs} file is needed to save document -definitions. With both \optsand14, no write registers are required -(document definitions aren't permitted and indexing information is -written to the \filetype{aux} file). If you really need document +\begin{information} +In general, this package option is best avoided. +\end{information} + +With all options except \options{noidx,b2g}14, 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 \pkgopt+{restricted}{docdef} with -\gls{glossaries-extra}. +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 glossaries or if you are using a class or other +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 \pkgopt{savewrites} is -set, the glossary information will be stored in token registers +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 indexing to fail. Page numbers in the \gls{numberlist} +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, \nolinkurl{sample-multi2.tex} -provided with \gls{bib2gls} has a total of 15 glossaries. With -\optsor23, this would require 46 associated files and 16 -write registers.\footnote{These figures don't include standard files +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 -\filetypefmt{aux} and \filetypefmt{out}.} With -\gls{bib2gls}, no write registers are required and there are only 10 +\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). -\importantpar[-2][-1ex] -If you want to use \TeX's \ics{write18} mechanism to call -\gls{makeindex} or \gls{xindy} from your document and use -\pkgopt{savewrites}, you must create the external files with -\cs{glswritefiles} before you call \gls*{makeindex}/\gls*{xindy}. Also set -\cs{glswritefiles} to nothing or \cs{relax} before the end of the -document to avoid rewriting the files. For example: -\begin{verbatim} -\glswritefiles -\write18{makeindex -s \istfilename\space --t \jobname.glg -o \jobname.gls \jobname} -\let\glswritefiles\relax -\end{verbatim} - -\noindent -In general, this package option is best avoided. +\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} -\pkgoptsec[value]{translate} This can take the following values: - - \begin{description} - \item[{\pkgoptval{true}{translate}}] 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 \styfmt{babel}'s - \cs{addto}\cs{caption}\meta{language} mechanism. If - \sty{polyglossia} has been loaded, \sty{glossaries-polyglossia} - will be loaded. - - \item[{\pkgoptval{false}{translate}}] Don't provide translations, even - if \sty{babel} or \sty{polyglossia} has been loaded. - (Note that \sty{babel} provides the command \ics{glossaryname} - so that will still be translated if you have loaded \sty{babel}.) - - \item[{\pkgoptval{babel}{translate}}] Don't load the \sty{translator} -package. Instead load \sty{glossaries-babel}. +\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 \pkgopt[babel]{translate} if you have any -problems with the translations or with PDF bookmarks, but to maintain backward +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 -\pkgopt[true]{translate}. +\opteqvalref{translate}{true}. \end{important} - \end{description} - - If \pkgopt{translate} is specified without a value, - \pkgopt[true]{translate} is assumed. If \pkgopt{translate} isn't -specified, \pkgopt[true]{translate} is assumed if \sty{babel}, -\sty{polyglossia} or \sty{translator} have been loaded. Otherwise -\pkgopt[false]{translate} is assumed. - -\begin{xtr} -With \gls{glossaries-extra}, if \sty{babel} is detected then -\pkgopt[babel]{translate} is automatically passed to the base -\sty{glossaries} package. -\end{xtr} - See \sectionref{sec:fixednames} for further details. -\pkgoptsec{notranslate} This is equivalent to -\pkgopt[false]{translate} and may be passed via the document class -options. - -\pkgoptsec[boolean]{hyperfirst} This is a boolean option that specifies -whether each term has a hyperlink on \firstuse. The default is -\pkgopt[true]{hyperfirst} (terms on \gls{firstuse} have a hyperlink, -unless explicitly suppressed using starred versions of commands -such as \ics{gls*} or by identifying the glossary with -\pkgopt{nohypertypes}, described above). Note that -\pkgopt{nohypertypes} overrides \pkgopt[true]{hyperfirst}. -This option only affects commands that check the \firstuseflag, such -as the \glslike\ commands (for example, \ics{gls} or -\ics{glsdisp}), but not the \glstextlike\ commands -(for example, \ics{glslink} or \ics{glstext}). - -The \pkgopt{hyperfirst} setting applies to -all glossary types (unless identified by \pkgopt{nohypertypes} or -defined with \ics{newignoredglossary}). It can be overridden on an -individual basis by explicitly setting the \gloskey[glslink]{hyper} key +\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{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 apply this to just the acronyms -(where the first use explains the meaning of the acronym) but not -for ordinary glossary entries (where the first use is identical to -subsequent uses). In this case, you can use \pkgopt[false]{hyperfirst} and -apply \cs{glsunsetall} to all the regular (non-acronym) glossaries. +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{verbatim} - \usepackage[acronym,hyperfirst=false]{glossaries} - % acronym and glossary entry definitions - - % at the end of the preamble - \glsunsetall[main] -\end{verbatim} +\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 -\begin{definition}[\DescribeMacro\glslinkcheckfirsthyperhook] -\cs{glslinkcheckfirsthyperhook} -\end{definition} -which is used by the commands that check the \firstuseflag, such -as \ics{gls}. Within the definition of this command, you can use -\ics{glslabel} to reference the entry label and \ics{glstype} to -reference the glossary type. You can also use \ics{ifglsused} -to determine if the entry has been used. You can test if an entry is -an acronym by checking if it has the \gloskey{long} key set using -\ics{ifglshaslong}. For example, to switch off the hyperlink on -first use just for acronyms: -\begin{verbatim} -\renewcommand*{\glslinkcheckfirsthyperhook}{% - \ifglsused{\glslabel}{}% - {% - \ifglshaslong{\glslabel}{\setkeys{glslink}{hyper=false}}{}% - }% +\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{verbatim} +\end{codebox} Note that this hook isn't used by the commands that don't check the -\firstuseflag, such as \ics{glstext}. (You can, instead, redefine -\ics{glslinkpostsetkeys}, which is used by both the \glslike\ and -\glstextlike\ commands.) - -The \gls{glossaries-extra} package provides a method of disabling -the \gls{firstuse} hyperlink according to the entry's associated -category. For example, if you only to switch off the \gls{firstuse} -hyperlink for abbreviations and acronyms then you simply need to set -the \attr{nohyperfirst} attribute for the \texttt{abbreviation} -and \texttt{acronym} categories. (Instead of using the -\pkgopt{nohyperfirst} package option.) See the -\gls{glossaries-extra} manual for further details. - -\pkgoptsec{writeglslabels} This is a valueless option that -will create a file called \cs{jobname}\texttt{.}\filetype{glslabels} at the end -of the document. This file simply contains a list of all defined -entry labels (including those in any ignored glossaries). It's -provided for the benefit of text editors that need to know labels -for \Index{auto-completion}. If you also want the name, use -\pkgopt{writeglslabelnames}. (See also \gls{glossaries-extra}['s] -\pkgopt+{atom}{docdef} package option.) +\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 \gls{bib2gls} the file will only contain the entries -that \gls{bib2gls} has selected from the \filetype{bib} files. +Note that with \app{bib2gls} the file will only contain the entries +that \app{bib2gls} has selected from the \ext{bib} files. \end{bib2gls} -\pkgoptsec{writeglslabelnames} Similar to the above but writes both +\optiondef{writeglslabelnames} +Similar to \opt{writeglslabels} but writes both the label and name (separated by a tab). -\xtrpkgoptsec[value]{undefaction} +\optiondef{undefaction} -The value may be one of: -\begin{description} - \item[\pkgoptfmt{error}] generate an error if a referenced entry is - undefined (default, and the only available setting with just - \styfmt{glossaries}); - \item[\pkgoptfmt{warn}] only warn if a referenced entry is - undefined (automatically activated with \opt4). -\end{description} +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). -\xtrpkgoptsec[value]{docdef} +\optionvaldef{undefaction}{warn} +Only warns if a referenced entry is undefined (automatically +activated with \option{b2g}). -This option governs the use of \cs{newglossaryentry}. Available +\optiondef{docdef} + +Only available with \sty{glossaries-extra}, this +option governs the use of \gls{newglossaryentry}. Available values: -\begin{description} -\item[\pkgoptfmt{false}] \cs{newglossaryentry} is not permitted in -the \env{document} environment (default with \gls{glossaries-extra} -and for \opt1 with just the base \styfmt{glossaries} package); -\item[\pkgoptfmt{restricted}] \cs{newglossaryentry} is only permitted in +\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 -\cs{printglossary} (not available for some indexing options); +\gls{printglossary} (not available for some indexing options, such +as \options{b2g}). -\item[\pkgoptfmt{atom}] as \pkgoptfmt{restricted} but creates the -\filetype{docdefs} file for use by \app{atom} (without the -limitations of \pkgopt+{true}{docdef}); +\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}). -\item[\pkgoptfmt{true}] \cs{newglossaryentry} is permitted in the +\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 \styfmt{glossaries} package. This will create the -\filetype{docdefs} file if \cs{newglossaryentry} is found in the +the base \sty{glossaries} package. This will create the +\ext+{glsdefs} file if \gls{newglossaryentry} is found in the \env{document} environment. -\end{description} \section{Sectioning, Headings and TOC Options} \label{sec:pkgopts-sec} -\pkgoptsec[boolean]{toc} Add the glossaries to the table of contents. +\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 -\begin{definition}[\DescribeMacro{\glstoctrue}] -\cs{glstoctrue} -\end{definition} +\cmddef{glstoctrue} and -\begin{definition}[\DescribeMacro{\glstocfalse}] -\cs{glstocfalse} -\end{definition} -The default value is \pkgopt[false]{toc} for the base -\styfmt{glossaries} package and \pkgopt[true]{toc} for -\gls{glossaries-extra}. - -\pkgoptsec[boolean]{numberline} When used with the above -\pkgopt[true]{toc} option, this will -add \ics{numberline}\verb|{}| in the final argument of -\ics{addcontentsline}. This will align the table of contents entry -with the numbered section titles. Note that this option has no -effect if the \pkgopt{toc} option is omitted. If \pkgopt{toc} is -used without \pkgopt{numberline}, the title will be aligned with -the section numbers rather than the section titles. - -\pkgoptsec[value]{section} - -This option indicates the sectional unit to use for the glossary. -The value should be the control sequence \emph{name} without the -leading backslash or following star (e.g.\ just \texttt{chapter} -not \cs{chapter} or \texttt{chapter*}). +\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}. + +\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*}). The default behaviour is for the glossary heading to use -\cs{chapter}, if that command exists, or \cs{section} otherwise. The -starred or unstarred form is determined by the \pkgopt{numberedsection} option. +\gls{chapter}, if that command exists, or \gls{section} otherwise. The +starred or unstarred form is determined by the \opt{numberedsection} option. Example: -\begin{verbatim} -\usepackage[section=subsection]{glossaries} -\end{verbatim} -You can omit the value if you want to use \cs{section}, i.e.\ -\begin{verbatim} -\usepackage[section]{glossaries} -\end{verbatim} +\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{verbatim} -\usepackage[section=section]{glossaries} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\optval{section}{section}]\marg{glossaries} +\end{codebox} You can change this value later in the document using -\begin{definition}[\DescribeMacro{\setglossarysection}] -\cs{setglossarysection}\marg{name} -\end{definition} +\cmddef{setglossarysection} where \meta{name} is the sectional unit. -The start of each glossary adds information to the page header via -\begin{definition}[\DescribeMacro{\glsglossarymark}] -\cs{glsglossarymark}\marg{glossary title} -\end{definition} -By default this uses \cs{@mkboth}\footnote{unless \cls{memoir} is -loaded, which case it uses \ics{markboth}} but you may -need to redefine it. -For example, to only change the right header: -\begin{verbatim} -\renewcommand{\glsglossarymark}[1]{\markright{#1}} -\end{verbatim} -or to prevent it from changing the headers: -\begin{verbatim} -\renewcommand{\glsglossarymark}[1]{} -\end{verbatim} -If you want \cs{glsglossarymark} to use \cs{MakeUppercase} in the header, use the -\pkgopt{ucmark} option described below. +The start of each \idx{glossary} adds information to the page header via +\gls{glsglossarymark} (see \sectionref{sec:glossmarkup}). -Occasionally you may find that another package defines -\cs{cleardoublepage} when it is not required. This may cause an -unwanted blank page to appear before each glossary. This can -be fixed by redefining \DescribeMacro\glsclearpage\cs{glsclearpage}: -\begin{verbatim} -\renewcommand*{\glsclearpage}{\clearpage} -\end{verbatim} +\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}. -\pkgoptsec[boolean]{ucmark} This is a boolean option. The default is -\pkgopt[false]{ucmark}, unless \cls{memoir} has been loaded, in -which case the default is \pkgopt[true]{ucmark}. - -If set, \ics{glsglossarymark} uses -\ics{MakeTextUppercase}\footnote{Actually it uses -\ics{mfirstucMakeUppercase} which is set to \sty{textcase}'s \cs{MakeTextUppercase} -by the -\styfmt{glossaries} package. This makes it consistent with -\ics{makefirstuc}. (The \sty{textcase} package is automatically -loaded by \styfmt{glossaries}.)}. -You can test whether this option has been set or not using -\begin{definition} -\ics{ifglsucmark} \meta{true part}\cs{else} \meta{false part}\cs{fi} -\end{definition} +You can test if this option has been set using: +\cmddef{ifglsucmark} For example: -\begin{verbatim} -\renewcommand{\glsglossarymark}[1]{% - \ifglsucmark - \markright{\MakeTextUppercase{#1}}% - \else - \markright{#1}% - \fi} -\end{verbatim} -If \cls{memoir} has been loaded and \pkgopt{ucmark} is set, then -\cls{memoir}'s \ics{memUChead} is used. - -\pkgoptsec[value]{numberedsection} -The glossaries are placed in unnumbered sectional units by default, -but this can be changed using \pkgopt{numberedsection}. This option can take +\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: -\begin{itemize} -\item \pkgoptval{false}{numberedsection}: no number, i.e.\ use starred form -of sectioning command (e.g.\ \cs{chapter*} or \cs{section*}); - -\item \pkgoptval{nolabel}{numberedsection}: -use a numbered section, i.e.\ the unstarred form of sectioning -command (e.g.\ \cs{chapter} or \cs{section}), but -the section not labelled; - -\item \pkgoptval{autolabel}{numberedsection}: numbered with automatic -labelling. Each glossary uses the unstarred form of a sectioning -command (e.g.\ \cs{chapter} or \cs{section}) and is assigned a label -(via \ics{label}). The label is formed from -\begin{definition}[\DescribeMacro{\glsautoprefix}] -\cs{glsautoprefix} \meta{type} -\end{definition} -where -\meta{type} is the label identifying that glossary. The default -value of \cs{glsautoprefix} is empty. For example, if you load \styfmt{glossaries} -using: -\begin{verbatim} -\usepackage[section,numberedsection=autolabel] - {glossaries} -\end{verbatim} -then each glossary will appear in a numbered section, and can + +\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{verbatim} -The main glossary is in section~\ref{main} and -the list of acronyms is in section~\ref{acronym}. -\end{verbatim} +\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 -\ics{acronymtype} which is set to \texttt{main} if the -\pkgopt{acronym} option is not used and is set to \texttt{acronym} -if the \pkgopt{acronym} option is used. For example: -\begin{verbatim} -The list of acronyms is in section~\ref{\acronymtype}. -\end{verbatim} +\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{verbatim} -\renewcommand*{\glsautoprefix}{glo:} -\end{verbatim} -will add \texttt{glo:} to the automatically generated label, so +\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{verbatim} +\begin{codebox} The list of acronyms is in -section~\ref{glo:\acronymtype}. -\end{verbatim} +section\sym{nbsp}\gls{ref}\marg{glo:\gls{acronymtype}}. +\end{codebox} Or, if you are undecided on a prefix: -\begin{verbatim} +\begin{codebox} The list of acronyms is in -section~\ref{\glsautoprefix\acronymtype}. -\end{verbatim} +section\sym{nbsp}\gls{ref}\marg{\gls{glsautoprefix}\gls{acronymtype}}. +\end{codebox} -\item \pkgoptval{nameref}{numberedsection}: this is like -\pkgoptval{autolabel}{numberedsection} but uses an unnumbered -sectioning command (e.g.\ \ics{chapter*} or \ics{section*}). It's +\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{verbatim} -\usepackage{nameref} -\usepackage[numberedsection=nameref]{glossaries} -\end{verbatim} -Now \verb|\nameref{main}| will display the (TOC) section title -associated with the \texttt{main} glossary. As above, you can -redefine \cs{glsautoprefix} to provide a prefix for the label. -\end{itemize} +\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} -\pkgoptsec[boolean]{savenumberlist} This is a boolean option that -specifies whether or not to gather and store the \gls{numberlist} -for each entry. The default is \pkgopt[false]{savenumberlist}. (See -\ics{glsentrynumberlist} and \ics{glsdisplaynumberlist} in -\sectionref{sec:glsnolink}.) This is always true if you -use \opt1. +\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 \pkgopt*{record} option (with either no value or -\pkgopt+{only}{record} or \pkgopt+{nameref}{record}) then this -package option has no effect. With \gls{bib2gls}, the -\glspl{numberlist} are automatically saved with the default -\resourceopt[true]{save-locations} and -\resourceopt[true]{save-loclist} resource settings. +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} -\pkgoptsec[boolean]{entrycounter} This is a boolean option. (Default -is \pkgopt[false]{entrycounter}.) If set, each main (level~0) -glossary entry will be numbered when using the standard glossary -styles. This option creates the counter -\DescribeCounter{glossaryentry}\ctrfmt{glossaryentry}. - -If you use this option, you can reference the entry number -within the document using -\begin{definition}[\DescribeMacro{\glsrefentry}] -\cs{glsrefentry}\marg{label} -\end{definition} +\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. -The labelling systems uses \meta{prefix}\meta{label}, where -\meta{label} is the entry's label and \meta{prefix} is given by -\begin{definition}[\DescribeMacro\GlsEntryCounterLabelPrefix] -\cs{GlsEntryCounterLabelPrefix} -\end{definition} -(which defaults to \texttt{glsentry-}). +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 \cs{glsrefentry}, you must run \LaTeX\ twice after -creating the glossary files using \gls{makeglossaries}, -\gls{makeindex} or \gls{xindy} to ensure the cross-references are -up-to-date. +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} -\pkgoptsec[value]{counterwithin} This is a \meta{key}=\meta{value} -option where \meta{value} is the name of a counter. If used, this -option will automatically set \pkgopt[true]{entrycounter} and the -\ctr{glossaryentry} counter will be reset every time \meta{value} is -incremented. +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 \pkgopt{counterwithin} is the same as the +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 glossary, you can -modify the glossary preamble (\ics{glossarypreamble}) to use -\begin{definition}[\DescribeMacro{\glsresetentrycounter}] -\cs{glsresetentrycounter} -\end{definition} -which sets \ctr{glossaryentry} to zero: -\begin{verbatim} -\renewcommand{\glossarypreamble}{% - \glsresetentrycounter +If you want the counter reset at the start of each \idx{glossary}, you can +modify the \idxf{glossarypreamble} (\gls{glossarypreamble}) to use +\gls{glsresetentrycounter}. For example: +\begin{codebox} +\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{\comment{} + \gls{glsresetentrycounter} } -\end{verbatim} -or if you are using \ics{setglossarypreamble}, add it to each -glossary preamble, as required. For example: -\begin{verbatim} -\setglossarypreamble[acronym]{% - \glsresetentrycounter +\end{codebox} +or if you are using \gls{setglossarypreamble}, add it to each +\idxf{glossarypreamble}, as required. For example: +\begin{codebox} +\gls{setglossarypreamble}\oarg{\glostype{acronym}}\marg{\comment{} + \gls{glsresetentrycounter} The preamble text here for the list of acronyms. } -\setglossarypreamble{% - \glsresetentrycounter - The preamble text here for the main glossary. +\gls{setglossarypreamble}\marg{\comment{} + \gls{glsresetentrycounter} + The preamble text here for the \glostype{main} glossary. } -\end{verbatim} - -\pkgoptsec[boolean]{subentrycounter} This is a boolean option. (Default -is \pkgopt[false]{subentrycounter}.) If set, each level~1 -glossary entry will be numbered when using the standard glossary -styles. This option creates the counter -\DescribeCounter{glossarysubentry}\ctrfmt{glossarysubentry}. -The counter is reset with each main (level~0) entry. Note that this -package option is independent of \pkgopt{entrycounter}. You can +\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 -\ics{glsrefentry}\marg{label} where \meta{label} is the label -associated with the sub-entry. - -\pkgoptsec[value]{style} This is a \meta{key}=\meta{value} option. -(Default is \pkgopt[list]{style}, unless \sty{classicthesis} -has been loaded, in which case the default is \pkgopt[index]{style}.) Its value should be the name of -the glossary style to use. This key may only be used for styles -defined in \sty{glossary-list}, \sty{glossary-long}, -\sty{glossary-super} or \sty{glossary-tree}. Alternatively, you can -set the style using -\begin{definition} -\cs{setglossarystyle}\marg{style name} -\end{definition} +\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.) -\pkgoptsec{nolong} This prevents the \styfmt{glossaries} package +\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 -glossary styles defined in the \styfmt{glossary-long} package (unless +\idxpl{glossarystyle} defined in the \sty{glossary-long} package (unless you explicitly load \sty{glossary-long}). -\pkgoptsec{nosuper} This prevents the \styfmt{glossaries} package +\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 -glossary styles defined in the \styfmt{glossary-super} package +\idxpl{glossarystyle} defined in the \sty{glossary-super} package (unless you explicitly load \sty{glossary-super}). -\pkgoptsec{nolist} This prevents the \styfmt{glossaries} package +\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 -glossary styles defined in the \styfmt{glossary-list} package +\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 \pkgopt{style} option to set the style to +also need to use the \opt{style} option to set the style to something else. -\pkgoptsec{notree} This prevents the \styfmt{glossaries} package +\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 -glossary styles defined in the \styfmt{glossary-tree} package +\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}. -\pkgoptsec{nostyles} This prevents all the predefined styles +\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 -glossary style package (such as \sty{glossary-mcols}). Also if you -use this option, you can't use the \pkgopt{style} package option. -Instead you must either use \ics{setglossarystyle}\marg{style} or the -\gloskey[printglossary]{style} key in the optional argument to -\ics{printglossary}. Example: -\begin{verbatim} -\usepackage[nostyles]{glossaries} -\usepackage{glossary-mcols} -\setglossarystyle{mcoltree} -\end{verbatim} +\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}). -\pkgoptsec{nonumberlist} This option will suppress the -associated \glspl{numberlist} in the glossaries (see also -\sectionref{sec:numberlists}). Note that if you use \optsor23 -(\gls{makeindex} or \gls{xindy}) then the locations must still be -valid. This package option merely prevents the \gls{numberlist} -from being displayed, but both \gls{makeindex} and \gls{xindy} -still require a location or cross-reference for each term that's -indexed. Remember that \gls{numberlist} includes any -cross-references, so suppressing the \gls{numberlist} will also hide -the cross-references (see below). - -\pkgoptsec{seeautonumberlist} If you suppress the -\glspl{numberlist} with \pkgopt{nonumberlist}, described above, this +\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 \ics{newglossaryentry} or \ics{glssee}. If you -use \pkgopt{seeautonumberlist}, the \gloskey{see} key will -automatically implement \gloskey{nonumberlist=false} for that entry. -(Note this doesn't affect \cs{glssee}.) For further details see +\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}. -\pkgoptsec[value]{counter} This is a \meta{key}=\meta{value} option. -(Default is \pkgopt[page]{counter}.) The value should be the name of -the default counter to use in the \glspl{numberlist} -(see \sectionref{sec:numberlists}). +\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}. -\pkgoptsec[boolean]{nopostdot} This is a boolean option. If no value is -specified, \pkgoptval{true}{nopostdot} is assumed. When set to -\pkgoptval{true}{nopostdot}, this option suppresses the default post -description dot used by some of the predefined styles. +\optiondef{nopostdot} +If true, this option suppresses the default terminating +\idx{fullstop} in \idxpl{glossarystyle} that use the +post-description hook: +\cmddef{glspostdescription} -The default setting is \pkgopt[false]{nopostdot} for the base -\styfmt{glossaries} package and \pkgopt[true]{nopostdot} for -\gls{glossaries-extra}. +The default setting is \optval{nopostdot}{false} for the base +\sty{glossaries} package and \optval{nopostdot}{true} for +\sty{glossaries-extra}. \begin{xtr} -The \gls{glossaries-extra} package provides \pkgopt*{postdot}, which -is equivalent to \pkgopt[false]{nopostdot}, and also -\pkgopt*{postpunc}, which allows you to choose a different +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} -\pkgoptsec[boolean]{nogroupskip} This is a boolean option. If no value is -specified, \pkgoptfmt{true} is assumed. When set to \pkgoptfmt{true}, this -option suppresses the default vertical gap between letter groups used by -some of the predefined styles. The default setting is -\pkgopt[false]{nogroupskip}. +\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 \gls{bib2gls} without the \texttt{-{}-group} (or -\texttt{-g}) switch then you don't need to use -\pkgoptfmt{nogroupskip\dequals true} as there won't be any letter -groups. +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} -\xtrpkgoptsec[list]{stylemods} +\optiondef{stylemods} -Load the \sty{glossaries-extra-stylemods} package, which patches the -predefined styles. The \meta{list} argument is optional. If present, +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}. +\meta{element} in the comma-separated \meta{list}. See the +\sty{glossaries-extra} manual for further details. \section{Indexing Options} \label{sec:pkgopts-indexing} -\pkgoptsec[value]{seenoindex} Introduced in version 4.24, this option -may take one of three values: \pkgoptfmt{error}, \pkgoptfmt{warn} or -\pkgoptfmt{ignore}. The \gloskey{see} key automatically indexes the -cross-referenced entry using \ics{glssee}. This means that if this +\glsadd[format=(]{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 -glossary file has been opened, the indexing can't be performed. -Since this is easy to miss, the \styfmt{glossaries} package by +\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 \ics{makeglossaries}. This option allows you to change the -error into just a warning (\pkgopt[warn]{seenoindex}) or -ignore it (\pkgopt[ignore]{seenoindex}) if, for example, you want -to temporarily comment out \cs{makeglossaries} to speed up the -compilation of a draft document by omitting the indexing. - -\pkgoptsec[boolean]{esclocations} This is a boolean option. The -default is \pkgopt[true]{esclocations}, which is needed for -\optsand23. With \opt1 \ics{makenoidxglossaries} changes it to -\pkgopt[false]{esclocations}. With \opt4 (\gls{bib2gls}), this -setting is ignored. - -Both \gls{makeindex} and \gls{xindy} are fussy about the location -formats (\gls{makeindex} more so than \gls{xindy}) so the -\styfmt{glossaries} package tries to ensure that special characters -are escaped and allows for the location to be substituted for a -format that's more acceptable to the indexing application. 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. +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 glossary +acceptable format (or you're prepared to post-process the \idx{glossary} file before passing it to the relevant indexing application) then -use \pkgopt[false]{esclocations} to avoid the complex escaping of -location values. (See \ifpdf section~\ref*{sec:wrgloss} \fi -\qt{Writing information to associated files} in the documented code -for further details.) - -This isn't an issue for \optsor14 as the locations are written to -the \filetype{aux} file so no syntax conversion is required. - -\pkgoptsec[boolean]{indexonlyfirst} This is a boolean option that specifies -whether to only add information to the external glossary file on -\gls{firstuse}. The default is \pkgopt[false]{indexonlyfirst}, -which will add a line to the file every time one of the -\glslike\ or \glstextlike\ commands are used. Note that \ics{glsadd} -will always add information to the external glossary -file\footnote{bug fix in v4.16 has corrected the code to ensure -this.}\ (since that's the purpose of that command). +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 \gls{firstuseflag} with commands like -\ics{glsreset} after an entry has been indexed will cause that entry to be +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 \gls{firstuseflag} before an entry has been +Likewise unsetting the \idx{firstuseflag} before an entry has been indexed will prevent it from being indexed (unless specifically -indexed with \cs{glsadd}). +indexed with \gls{glsadd}). \end{important} -You can customise this by redefining -\begin{definition}[\DescribeMacro\glswriteentry] -\cs{glswriteentry}\marg{label}\marg{wr-code} -\end{definition} -where \meta{label} is the entry's label and \meta{wr-code} is the +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 \cs{glswriteentry} is: -\begin{verbatim} -\newcommand*{\glswriteentry}[2]{% - \ifglsindexonlyfirst - \ifglsused{#1}{}{#2}% - \else - #2% - \fi -} -\end{verbatim} -This checks the \pkgopt{indexonlyfirst} package option (using -\cs{ifglsindexonlyfirst}) and does \meta{wr-code} if this is -\pkgoptfmt{false} otherwise it only does \meta{wr-code} of the entry -hasn't been used. - -For example, suppose you only want to index the first use for -entries in the \texttt{acronym} glossary and not in the -\texttt{main} (or any other) glossary: -\begin{verbatim} -\renewcommand*{\glswriteentry}[2]{% - \ifthenelse{\equal{\glsentrytype{#1}}{acronym}} - {\ifglsused{#1}{}{#2}}% - {#2}% +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{verbatim} -Here I've used \cs{ifthenelse} to ensure the arguments of -\cs{equal} are fully expanded before the comparison is made. - -With the \gls{glossaries-extra} package it's possible to only index -\gls{firstuse} for particular categories. For example, if you only -want this enabled for abbreviations and acronyms then you can set -the \attr{indexonlyfirst} attribute for the \texttt{abbreviation} -and \texttt{acronym} categories. (Instead of using the -\pkgopt{indexonlyfirst} package option.) See the -\gls{glossaries-extra} manual for further details. - -\xtrpkgoptsec[boolean]{indexcrossrefs} - -If \pkgoptfmt{true}, this will automatically index (\ics{glsadd}) any +\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. Increases document build time. See -\gls{glossaries-extra} manual for further details. +of the document. Note that this increases the document build time. See +\sty{glossaries-extra} manual for further details. \begin{bib2gls} -Note that \gls{bib2gls} can automatically find dependent entries -when it parses the \filetype{bib} file. Use the \xtrfont{selection} option to -\ics*{GlsXtrLoadResources} to determine the selection of -dependencies. +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} -\xtrpkgoptsec[boolean]{autoseeindex} +\optiondef{autoseeindex} + +This option is only available with \sty{glossaries-extra}. +The base \sty{glossaries} package always implements +\optval{autoseeindex}{true}. -If \pkgoptfmt{true}, makes the \gloskey{see} and -\xtrgloskey{seealso} keys automatically index the cross-reference -(with \ics{glssee}) when the entry is defined (default, and the only -option with just the base \styfmt{glossaries} package). +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 \gls{bib2gls}, use the \xtrfont{selection} option to -\ics*{GlsXtrLoadResources} to determine the selection of -dependencies. +With \app{bib2gls}, use the \resourceopt{selection} resource option +to determine the selection of dependencies. \end{bib2gls} -\xtrpkgoptsec[value]{record} +\optiondef{record} -If not \pkgoptfmt{off}, this option indicates that \gls{bib2gls} -is required. If the value is omitted, \pkgoptfmt{only} is assumed. Permitted values: -\begin{description} -\item[\pkgoptfmt{off}] \gls{bib2gls} isn't being used; +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. -\item[\pkgoptfmt{only}] \gls{bib2gls} is being used to fetch entries -from a \filetype{bib} file, to sort the entries and collate the -\glspl{numberlist}, where the location information is the same as -for \optsto13; +\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}. -\item[\pkgoptfmt{nameref}] like \pkgoptfmt{only} but provides extra +\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; +locations. -\item[\pkgoptfmt{hybrid}] a hybrid approach where \gls{bib2gls} -is used to fetch entries from a \filetype{bib} file but -\gls{makeindex} or \gls{xindy} are used for the indexing. This +\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. -\end{description} -See \gls{glossaries-extra} manual for further details. -\xtrpkgoptsec[boolean]{equations} +\optiondef{equations} -If \pkgoptfmt{true}, this option will cause the default location -counter to automatically switch to \texttt{equation} when inside a +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. -\xtrpkgoptsec[boolean]{floats} +\optiondef{floats} -If \pkgoptfmt{true}, this option will cause the default location -counter to automatically switch to the corresponding counter when inside a -float. (Remember that with floats it's the \cs{caption} command that +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.) +is \indexed\ within the float before the caption.) -\xtrpkgoptsec{indexcounter} +\optiondef{indexcounter} +This option is only available with \sty{glossaries-extra}. This valueless option is primarily intended for use with -\gls{bib2gls} and \sty{hyperref} allowing the page location -hyperlink target to be set to the relevant point within the page +\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 \gls{glossaries-extra} manual for +with other indexing methods. See \sty{glossaries-extra} manual for further details. +\glsadd[format=)]{indexing}% \section{Sorting Options} \label{sec:pkgopts-sort} -This section is mostly for \optsand23. Only the \pkgopt{sort} and -\pkgopt{order} options are applicable for \opt1. +This section is mostly for \options{mkidx,xdy}. Only the \opt{sort} and +\opt{order} options are applicable for \option{noidx}. \begin{xtr} -With \optsto46, only \pkgopt[none]{sort} is applicable (and this is -automatically implemented by \pkgopt+{only}{record} and -\pkgopt+{nameref}{record}). With \gls{bib2gls}, the sort method -is provided in the optional argument of \ics*{GlsXtrLoadResources} -not with the \pkgoptfmt{sort} package option. There's no sorting -with \optsand56. +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} -\pkgoptsec[boolean]{sanitizesort} This is a boolean option that -determines whether or not to \gls{sanitize} the sort value when -writing to the external glossary file. For example, suppose you +\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{verbatim} -\newglossaryentry{hash}{name={\#},sort={#}, - description={hash symbol}} -\end{verbatim} -The sort value (\verb|#|) must be sanitized before writing it to the -glossary file, otherwise \LaTeX\ will try to interpret it as a +\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{verbatim} -\newcommand{\mysortvalue}{AAA} -\newglossaryentry{sample}{% - name={sample}, - sort={\mysortvalue}, - description={an example}} -\end{verbatim} -and you actually want \cs{mysortvalue} expanded, so that the entry -is sorted according to \texttt{AAA}, then use the package option -\pkgopt[false]{sanitizesort}. - -The default for \optsand23 is \pkgopt[true]{sanitizesort}, and the -default for \opt1 is \pkgopt[false]{sanitizesort}. - -\pkgoptsec[value]{sort} If you use \optsor23, this package option is -the only way of specifying how to sort the glossaries. Only \opt1 -allows you to specify sort methods for individual glossaries -via the \gloskey[printnoidxglossary]{sort} key in the optional -argument of \ics{printnoidxglossary}. If you have multiple -glossaries in your document and you are using \opt1, only use +\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{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 -\pkgopt[def]{sort} or \pkgopt[use]{sort} if you want to set this -sort method for \emph{all} your glossaries. - -This is a \meta{key}=\meta{value} option where -\meta{value} may be one of the following: -\begin{itemize} -\item \pkgoptval{standard}{sort} : entries are sorted according to -the value of the \gloskey{sort} key used in \ics{newglossaryentry} -(if present) or the \gloskey{name} key (if \gloskey{sort} key is -missing); - -\item \pkgoptval{def}{sort} : entries are sorted in the order in -which they were defined (the \gloskey{sort} key in -\cs{newglossaryentry} is ignored); - -\item \pkgoptval{use}{sort} : entries are sorted according to the -order in which they are used in the document (the \gloskey{sort} key -in \cs{newglossaryentry} is ignored). - -Both \pkgopt[def]{sort} and \pkgopt[use]{sort} set the sort key to a -six digit number via -\begin{definition}[\DescribeMacro\glssortnumberfmt] -\cs{glssortnumberfmt}\marg{number} -\end{definition} -(padded with leading zeros, where necessary). This can be -redefined, if required, before the entries are defined (in the -case of \pkgopt[def]{sort}) or before the entries are used -(in the case of \pkgopt[use]{sort}). - -\item \pkgoptval{none}{sort} : this setting is new to version 4.30 -and is only for documents that don't use \cs{makeglossaries} (\optsor23) -or \cs{makenoidxglossaries} (\opt1). 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 option -can't be used with \cs{printglossary} or \cs{printnoidxglossary} -(or the iterative versions \cs{printglossaries} or -\cs{printnoidxglossaries}). It may be used with -\gls{glossaries-extra}'s \cs{printunsrtglossary} (\opt5). -\end{itemize} -Note that the group styles (such as \glostyle{listgroup}) are -incompatible with the \pkgopt[use]{sort} and \pkgopt[def]{sort} +\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. -The default is \pkgopt[standard]{sort}. When the standard sort -option is in use, you can hook into the sort mechanism by +\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: -\begin{definition}[\DescribeMacro{\glsprestandardsort}] -\cs{glsprestandardsort}\marg{sort cs}\marg{type}\marg{label} -\end{definition} +\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 -\gls{makeindex}\slash\gls{xindy} special characters is performed. -By default \cs{glsprestandardsort} just does: -\begin{definition}[\DescribeMacro{\glsdosanitizesort}] -\cs{glsdosanitizesort} -\end{definition} -which \gls{sanitize}[s] \meta{sort cs} if the \pkgopt{sanitizesort} package -option is set (or does nothing if the package option -\pkgopt[false]{sanitizesort} is used). - -The other arguments, \meta{type} and \meta{label}, are the -glossary type and the entry label for the current entry. Note that +\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 \ics{newglossaryentry}. +be in the form used in the first argument of \gls{newglossaryentry}. \begin{important} -Redefining \cs{glsprestandardsort} won't affect any entries that +Redefining \gls{glsprestandardsort} won't affect any entries that have already been defined and will have no effect at all if you -are using \pkgopt[def]{sort} or \pkgopt[use]{sort}. +use another \opt{sort} setting. \end{important} \begin{example}{Mixing Alphabetical and Order of Definition Sorting}{ex:diffsorts} -Suppose I have three glossaries: \texttt{main}, -\texttt{acronym} and \texttt{notation}, and let's suppose -I want the \texttt{main} and \texttt{acronym} glossaries to be -sorted alphabetically, but the \texttt{notation} type should be +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 \opt1, the \gloskey[printnoidxglossary]{sort} option can be -used in \ics{printnoidxglossary}: -\begin{verbatim} -\printnoidxglossary[sort=word] -\printnoidxglossary[type=acronym,sort=word] -\printnoidxglossary[type=notation,sort=def] -\end{verbatim} - -For \optsor23, I can set the sort to \texttt{standard} -(which is the default, but can be explicitly set via the -package option \pkgopt[standard]{sort}), and I can either define -all my \texttt{main} and \texttt{acronym} entries, then -redefine \cs{glsprestandardsort} to set \meta{sort cs} to +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 -\texttt{notation} entries. Alternatively, I can redefine -\cs{glsprestandardsort} to check for the glossary type and only -modify \meta{sort cs} if \meta{type} is \texttt{notation}. - -The first option can be achieved as follows: -\begin{verbatim} -\newcounter{sortcount} - -\renewcommand{\glsprestandardsort}[3]{% - \stepcounter{sortcount}% - \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% +\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{verbatim} -The second option can be achieved as follows: -\begin{verbatim} -\newcounter{sortcount} - -\renewcommand{\glsprestandardsort}[3]{% - \ifdefstring{#2}{notation}% - {% - \stepcounter{sortcount}% - \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% - }% - {% - \glsdosanitizesort - }% +\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{verbatim} -(\cs{ifdefstring} is defined by the \sty{etoolbox} package.) +\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 2 or 3)}{ex:customsort} -Suppose you want a glossary of people and you want the names listed +\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, -\cs{name}\marg{first-name}\marg{surname} that you can use in the +\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 \cs{name} while 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{verbatim} -\newcommand{\sortname}[2]{#2, #1} -\newcommand{\textname}[2]{#1 #2} -\end{verbatim} -and \cs{name} needs to be initialised to \cs{textname}: -\begin{verbatim} -\let\name\textname -\end{verbatim} -Now redefine \cs{glsprestandardsort} so that it temporarily sets -\cs{name} to \cs{sortname} and expands the sort value, then sets -\cs{name} to \cs{textname} so that the person's name appears as +\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{verbatim} -\renewcommand{\glsprestandardsort}[3]{% - \let\name\sortname - \edef#1{\expandafter\expandonce\expandafter{#1}}% - \let\name\textname - \glsdosanitizesort +\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{verbatim} -(The somewhat complicate use of \cs{expandafter} etc helps to +\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{verbatim} -\newglossaryentry{joebloggs}{name={\name{Joe}{Bloggs}}, - description={some information about Joe Bloggs}} - -\newglossaryentry{johnsmith}{name={\name{John}{Smith}}, - description={some information about John Smith}} -\end{verbatim} +\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} -\pkgoptsec[value]{order} This may take two values: -\pkgoptval{word}{order} or \pkgoptval{letter}{order}. The default -is word ordering. +\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 \optsand23, the \pkgopt{order} option has no effect if you don't use -\gls{makeglossaries}. +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 \opt1, this setting will be used if you use -\gloskey[printnoidxglossary]{sort}\texttt{=standard} in -the optional argument of \ics{printnoidxglossary}: -\begin{verbatim} -\printnoidxglossary[sort=standard] -\end{verbatim} -Alternatively, you can specify the order for individual glossaries: -\begin{verbatim} -\printnoidxglossary[sort=word] -\printnoidxglossary[type=acronym,sort=letter] -\end{verbatim} +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 \gls{bib2gls}, use the \resourceopt{break-at} option -in \ics*{GlsXtrLoadResources} instead of \pkgoptfmt{order}. +With \app{bib2gls}, use the \resourceopt{break-at} option +in \gls{GlsXtrLoadResources} instead of \opt{order}. \end{bib2gls} -\pkgoptsec{makeindex} (\opt2) The glossary information and -indexing style file will be written in \gls{makeindex} format. If -you use \gls{makeglossaries}, it will automatically detect that it -needs to call \gls*{makeindex}. If you don't use -\gls*{makeglossaries}, you need to remember to use \gls*{makeindex} -not \gls{xindy}. The indexing style file will been given -a~\filetype{ist} extension. +\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 \opt2 as this is the +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 \pkgopt{xindy} in the package option list. - -\pkgoptsec{xindy} (\opt3) The glossary information and indexing style -file will be written in \gls{xindy} format. If you use -\gls{makeglossaries}, it will automatically detect that it needs to -call \gls*{xindy}. If you don't use \gls*{makeglossaries}, you need to -remember to use \gls*{xindy} not \gls{makeindex}. The indexing style -file will been given a \filetype{xdy} extension. - -This package option may additionally have a value that -is a \meta{key}=\meta{value} comma-separated list to override the -language and codepage. For example: -\begin{verbatim} -\usepackage[xindy={language=english,codepage=utf8}] - {glossaries} -\end{verbatim} -You can also specify whether you want a number group in the -glossary. This defaults to true, but can be suppressed. For example: -\begin{verbatim} -\usepackage[xindy={glsnumbers=false}]{glossaries} -\end{verbatim} -If no value is supplied to this package option (either simply -writing \texttt{xindy} or writing \verb|xindy={}|) then the -language, codepage and number group settings are unchanged. See -\sectionref{sec:xindy} for further details on using \gls{xindy} with -the \styfmt{glossaries} package. - -\pkgoptsec{xindygloss} (\opt3) This is equivalent to -\verb|xindy={}| (that is, the \pkgopt{xindy} option without any value -supplied) and may be used as a document class option. The language -and code page can be set via \ics{GlsSetXdyLanguage} and -\ics{GlsSetXdyCodePage} (see \sectionref{sec:langenc}.) - -\pkgoptsec{xindynoglsnumbers} (\opt3) This is equivalent to -\verb|xindy={glsnumbers=false}| and may be used as a document class -option. +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} -\pkgoptsec[value]{automake} This is option was introduced to -version 4.08 as a boolean option. As from version 4.42 it may now -take three values: \texttt{false} (default), \texttt{true} -or \texttt{immediate}. If no option is supplied, \texttt{immediate} -is assumed. -The option \pkgopt[true]{automake} will attempt to run \gls{makeindex} or \gls{xindy} using -\TeX's \ics{write18} mechanism at the end of the document. -The option \pkgopt[immediate]{automake} will attempt to -run \gls{makeindex} or \gls{xindy} at the start of -\ics{makeglossaries} using \cs{immediate} (before the glossary files have been opened). - -In the case of \pkgopt[true]{automake}, the associated files -are created at the end of the document ready for the next \LaTeX\ -run. Since there is a possibility of commands such as \cs{gls} -occurring on the last page of the document, it's not possible -to use \cs{immediate} to close the associated file or with -\cs{write18} since the writing of the final indexing lines may -have been delayed. In certain situations this can mean that -the \cs{write18} fails. In such cases, you will need to use -\pkgopt[immediate]{automake} instead. - -With \pkgopt[immediate]{automake}, you will get a warning on -the first \LaTeX\ run as the associated glossary files don't exist -yet. - -Since this mechanism can be a security risk, some \TeX\ -distributions disable it completely, in which case this option won't -have an effect. (If this option doesn't appear to work, search the -log file for \qt{runsystem} and see if it is followed by -\qt{enabled} or \qt{disabled}.) - -Some distributions allow \cs{write18} in a restricted mode. -This mode has a~limited number of trusted applications, which -usually includes \gls{makeindex} but may not include \gls{xindy}. So -if you have the restricted mode on, \pkgopt{automake} should work -with \gls*{makeindex} but may not work with \gls{xindy}. - -However even in unrestricted mode this option may not work with -\gls*{xindy} as \gls*{xindy} uses language names that don't always -correspond with \sty{babel}'s language names. (The -\gls{makeglossaries} script applies mappings to assist you.) -Note that you still need at least two \LaTeX\ runs to ensure the document -is up-to-date with this setting. - -Since this package option attempts to run the \gls{indexingapp} on -every \LaTeX\ run, its use should be considered a last resort for -those who can't work out how to incorporate the \gls*{indexingapp} -into their document build. The default value for this option is -\pkgopt[false]{automake}. - -\pkgoptsec{disablemakegloss} This valueless option -indicates that \ics{makeglossaries} and \ics{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 -\ics{makeglossaries} or \ics{makenoidxglossaries} but you don't want -this. (For example, you want to use a different indexing method or -you want to disable indexing while working on a draft -document.) +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 \cs{PassOptionsToPackage} before \sty{glossaries} is +or passed using \gls{PassOptionsToPackage} before \sty{glossaries} is loaded. Note that this does nothing if -\ics{makeglossaries} or \ics{makenoidxglossaries} has already +\gls{makeglossaries} or \gls{makenoidxglossaries} has already been used whilst enabled. -\pkgoptsec{restoremakegloss} Cancels the effect of -\pkgopt{disablemakegloss}. This option may be used in -\cs{setupglossaries}. It issues a warning if \ics{makeglossaries} or -\ics{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 \styfmt{glossaries} and does \cs{makeglossaries} -but you need an extra glossary, which has to be defined before -\cs{makeglossaries}, then you can do: -\begin{verbatim} -\documentclass[disablemakegloss]{customclass} -\newglossary*{functions}{Functions} -\setupglossaries{restoremakegloss} -\makeglossaries -\end{verbatim} +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{verbatim} -\PassOptionsToPackage{disablemakegloss}{glossaries} -\documentclass{customclass} -\newglossary*{functions}{Functions} -\setupglossaries{restoremakegloss} -\makeglossaries -\end{verbatim} +\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 \pkgopt+{only}{record} -or \pkgopt+{nameref}{record} options with \gls{glossaries-extra} -then you can't use \cs{makeglossaries} or \cs{makenoidxglossaries} -regardless of \pkgopt{restoremakegloss}. +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} -\pkgoptsec[list]{nohypertypes} Use this option if you have multiple -glossaries and you want to suppress the entry hyperlinks for a -particular glossary or glossaries. The value of this option should -be a comma-separated list of glossary types where \ics{gls} etc -shouldn't have hyperlinks by default. Make sure you enclose the +\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{verbatim} -\usepackage[acronym,nohypertypes={acronym,notation}] - {glossaries} -\newglossary[nlg]{notation}{not}{ntn}{Notation} -\end{verbatim} -The values must be fully expanded, so \strong{don't} try -\texttt{nohypertypes\discretionary{}{}{}=\ics{acronymtype}}. You may also use -\begin{definition} -\ics{GlsDeclareNoHyperList}\marg{list} -\end{definition} +\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. -\pkgoptsec{nomain} This suppresses the creation of the main -glossary and associated \filetype{glo} file, if unrequired. Note that -if you use this option, you must create another glossary in which to -put all your entries (either via the \pkgopt{acronym} (or -\pkgopt{acronyms}) package option described in -\sectionref{sec:pkgopts-acronym} or via the \pkgopt{symbols}, -\pkgopt{numbers} or \pkgopt{index} options described in -\sectionref{sec:pkgopts-other} or via \ics{newglossary} described in -\sectionref{sec:newglossary}). +\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} -\begin{important} -If you don't use the main glossary and you don't use this option, -\gls{makeglossaries} will produce a warning. -\end{important} -\begin{alltt} -Warning: File '\emph{filename}.glo' is empty. -Have you used any entries defined in glossary -'main'? -Remember to use package option 'nomain' if -you don't want to use the main glossary. -\end{alltt} -If you did actually want to use the main glossary and you see this -warning, check that you have referenced the entries in that glossary -via commands such as \ics{gls}. - -\pkgoptsec{symbols} This valueless option defines a new glossary type with -the label \texttt{symbols} via -\begin{verbatim} -\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname} -\end{verbatim} +\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 -\begin{definition}[\DescribeMacro\printsymbols] -\cs{printsymbols}\oarg{options} -\end{definition} +\cmddef{printsymbols} which is a synonym for -\begin{alltt} -\ics{printglossary}[type=symbols,\meta{options}] -\end{alltt} - -If you use \opt1, you need to use: -\begin{alltt} -\ics{printnoidxglossary}[type=symbols,\meta{options}] -\end{alltt} +\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 \pkgopt{nomain} package option if you're only -interested in using this \texttt{symbols} glossary and don't intend -to use the \texttt{main} glossary. +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 \gls{glossaries-extra} package has a slightly modified -version of this option which additionally provides \ics*{glsxtrnewsymbol} +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 -\gls{glossaries-extra} manual for further details. +\sty{glossaries-extra} manual for further details. \end{xtr} -\pkgoptsec{numbers} This valueless option defines a new glossary type with -the label \texttt{numbers} via -\begin{verbatim} -\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname} -\end{verbatim} +\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 -\begin{definition}[\DescribeMacro\printnumbers] -\cs{printnumbers}\oarg{options} -\end{definition} +\cmddef{printnumbers} which is a synonym for -\begin{alltt} -\ics{printglossary}[type=numbers,\meta{options}] -\end{alltt} - -If you use \opt1, you need to use: -\begin{alltt} -\ics{printnoidxglossary}[type=numbers,\meta{options}] -\end{alltt} +\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 \pkgopt{nomain} package option if you're only -interested in using this \texttt{numbers} glossary and don't intend -to use the \texttt{main} glossary. +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 \gls{glossaries-extra} package has a slightly modified -version of this option which additionally provides \ics*{glsxtrnewnumber} +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 -\gls{glossaries-extra} manual for further details. +\sty{glossaries-extra} manual for further details. \end{xtr} -\pkgoptsec{index} This valueless option defines a new glossary type with -the label \texttt{index} via -\begin{verbatim} -\newglossary[ilg]{index}{ind}{idx}{\indexname}% -\end{verbatim} +\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 -\begin{definition}[\DescribeMacro\newterm] -\cs{newterm}\oarg{options}\marg{term} -\end{definition} +\cmddef{newterm} which is a synonym for -\begin{alltt} -\ics{newglossaryentry}\marg{term}[type=index,name=\marg{term},% -description=\ics{nopostdesc},\meta{options}] -\end{alltt} +\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 -\begin{definition}[\DescribeMacro\printindex] -\cs{printindex}\oarg{options} -\end{definition} +\cmddef{printindex} which is a synonym for -\begin{alltt} -\ics{printglossary}[type=index,\meta{options}] -\end{alltt} +\begin{compactcodebox} +\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{index}},\meta{options}} +\end{compactcodebox} -If you use \opt1, you need to use: -\begin{alltt} -\ics{printnoidxglossary}[type=index,\meta{options}] -\end{alltt} -to display this glossary. +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 \pkgopt{nomain} package option if you're only -interested in using this \texttt{index} glossary and don't intend to -use the \texttt{main} glossary. Note that you -can't mix this option with \ics{index}. Either use -\styfmt{glossaries} for the indexing or use a~custom indexing -package, such as \sty{makeidx}, \sty{index} or \sty{imakeidx}. +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 \styfmt{glossaries} without the \pkgopt{index} package option.) +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 hyperlinks for this glossary using -the package option \pkgopt[index]{nohypertypes} or the command -\begin{display} -\ics{GlsDeclareNoHyperList}\verb|{index}| -\end{display} +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 -\pkgopt{index} package option. - -\pkgoptsec{noglossaryindex} This valueless option switches off \pkgopt{index} -if \pkgopt{index} has been passed implicitly (for example, -through global document options). This option can't be used -in \cs{setupglossaries}. +\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} +\section{\Glsfmttext{idx.acronym} and \Glsfmttext{idx.abbreviation} Options} \label{sec:pkgopts-acronym} -\pkgoptsec[boolean]{acronym} If true, this creates a new glossary with the -label \texttt{acronym}. This is equivalent to: -\begin{verbatim} -\newglossary[alg]{acronym}{acr}{acn}{\acronymname} -\end{verbatim} -It will also define -\begin{definition}[\DescribeMacro\printacronyms] -\cs{printacronyms}\oarg{options} -\end{definition} +\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{alltt} -\ics{printglossary}[type=acronym,\meta{options}] -\end{alltt} -(unless that command is already defined before the beginning of the -document or the package option \pkgopt{compatible-3.07} is used). - -If you are using \opt1, you need to use -\begin{alltt} -\ics{printnoidxglossary}[type=acronym,\meta{options}] -\end{alltt} +\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 \pkgopt{acronym} package option is used, \ics{acronymtype} -is set to \texttt{acronym} otherwise it is set to -\texttt{main}.\footnote{Actually it sets \ics{acronymtype} to -\ics{glsdefaulttype} if the \pkgopt{acronym} package option is -not used, but \ics{glsdefaulttype} usually has the value -\texttt{main} unless the \pkgopt{nomain} option has been used.} -Entries that are defined using \ics{newacronym} are placed in -the glossary whose label is given by \ics{acronymtype}, unless -another glossary is explicitly specified. +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 \pkgopt{nomain} package option if you're only -interested in using this \texttt{acronym} glossary. (That is, you -don't intend to use the \texttt{main} glossary.) +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 \gls{glossaries-extra} extension package comes with an analogous -\pkgopt*{abbreviations} option, which creates a new glossary with -the label \texttt{abbreviations} and sets the command -\ics*{glsxtrabbrvtype} to this. If the \pkgopt{acronym} option hasn't -also been used, then \ics{acronymtype} will be set to -\ics*{glsxtrabbrvtype}. This enables both \ics{newacronym} and -\ics*{newabbreviation} to use the same glossary. - -Make sure you have at least v1.42 of \gls{glossaries-extra} if you -use the \pkgopt{acronym} (or \pkgopt{acronyms}) package option with +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 -abbreviation style. +\idx{abbrvstyle}. \end{xtr} -\pkgoptsec{acronyms} This is equivalent to -\pkgopt[true]{acronym} and may be used in the document class option -list. +\optiondef{acronyms} +This is equivalent to \optval{acronym}{true} and may be used in the +document class option list. -\xtrpkgoptsec{abbreviations} +\optiondef{abbreviations} -This valueless option creates a new glossary type using: -\begin{verbatim} -\newglossary[glg-abr]{abbreviations}{gls-abr}{glo-abr}{\abbreviationsname} -\end{verbatim} -The label can be accessed with \ics*{glsxtrabbrvtype}, which is -analogous to \cs{acronymtype}. See \gls{glossaries-extra} manual for +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. -\pkgoptsec[value]{acronymlists} By default, only the \cs{acronymtype} -glossary is considered to be a list of acronyms. If you have other -lists of acronyms, you can specify them as a comma-separated list -in the value of \pkgopt{acronymlists}. For example, if you use the -\pkgopt{acronym} package option but you also want the \texttt{main} -glossary to also contain a list of acronyms, you can do: -\begin{verbatim} -\usepackage[acronym,acronymlists={main}]{glossaries} -\end{verbatim} -No check is performed to determine if the listed glossaries exist, -so you can add glossaries you haven't defined yet. For example: -\begin{verbatim} -\usepackage[acronym,acronymlists={main,acronym2}] - {glossaries} -\newglossary[alg2]{acronym2}{acr2}{acn2}% - {Statistical Acronyms} -\end{verbatim} +\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 -\begin{definition}[\DescribeMacro\DeclareAcronymList] -\cs{DeclareAcronymList}\marg{list} -\end{definition} -instead of or in addition to the \pkgopt{acronymlists} option. -This will add the glossaries given in \meta{list} to the list of glossaries -that are identified as lists of acronyms. To replace the list of acronym lists -with a new list use: -\begin{definition}[\DescribeMacro\SetAcronymLists] -\cs{SetAcronymLists}\marg{list} -\end{definition} - -You can determine if a glossary has been identified as being a list -of acronyms using: -\begin{definition}[\DescribeMacro\glsIfListOfAcronyms] -\cs{glsIfListOfAcronyms}\marg{label}\marg{true part}\marg{false part} -\end{definition} +\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 \gls{glossaries-extra}['s] -abbreviation mechanism. +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} -\pkgoptsec{shortcuts} This option provides shortcut commands -for acronyms. See \sectionref{sec:acronyms} for further details. +\optiondef{shortcuts} +This option provides shortcut commands +for \idxpl{acronym}. See \sectionref{sec:acronyms} for further details. Alternatively you can use: -\begin{definition}[\DescribeMacro\DefineAcronymSynonyms] -\cs{DefineAcronymSynonyms} -\end{definition} +\cmddef{DefineAcronymSynonyms} \begin{xtr} -The \gls{glossaries-extra} package provides additional shortcuts. +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 are now deprecated but -are kept for backward-compatibility. Use \ics{setacronymstyle} -instead. See \sectionref{sec:acronyms} for further details. +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. -\deppkgoptsec{description} This option changes the definition of -\ics{newacronym} to allow a description. -This option may be replaced by -\begin{verbatim} -\setacronymstyle{long-short-desc} -\end{verbatim} -or (with \deprecatedpkgopt{smallcaps}) -\begin{verbatim} -\setacronymstyle{long-sc-short-desc} -\end{verbatim} -or (with \deprecatedpkgopt{smaller}) -\begin{verbatim} -\setacronymstyle{long-sm-short-desc} -\end{verbatim} -or (with \deprecatedpkgopt{footnote}) -\begin{verbatim} -\setacronymstyle{footnote-desc} -\end{verbatim} -or (with \deprecatedpkgopt{footnote} and \deprecatedpkgopt{smallcaps}) -\begin{verbatim} -\setacronymstyle{footnote-sc-desc} -\end{verbatim} -or (with \deprecatedpkgopt{footnote} and \deprecatedpkgopt{smaller}) -\begin{verbatim} -\setacronymstyle{footnote-sm-desc} -\end{verbatim} -or (with \deprecatedpkgopt{dua}) -\begin{verbatim} -\setacronymstyle{dua-desc} -\end{verbatim} +If you want to change the \idx{acronymstyle}, use \gls{setacronymstyle} +instead. See \sectionref{sec:acronyms} for further details. -\deppkgoptsec{smallcaps} This option changes the definition of -\ics{newacronym} and the way that acronyms are displayed. +\optiondef{description} +This option changed the definition of \gls{newacronym} to allow a description. This option may be replaced by: -\begin{verbatim} -\setacronymstyle{long-sc-short} -\end{verbatim} -or (with \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{long-sc-short-desc} -\end{verbatim} -or (with \deprecatedpkgopt{description} and \deprecatedpkgopt{footnote}) -\begin{verbatim} -\setacronymstyle{footnote-sc-desc} -\end{verbatim} - -\deppkgoptsec{smaller} This option changes the definition of -\ics{newacronym} and the way that acronyms are displayed. -\begin{important} -If you use this option, you will need to include the \sty{relsize} -package or otherwise define \ics{textsmaller} or redefine -\ics{acronymfont}. -\end{important} +\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{verbatim} -\setacronymstyle{long-sm-short} -\end{verbatim} -or (with \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{long-sm-short-desc} -\end{verbatim} -or (with \deprecatedpkgopt{description} and \deprecatedpkgopt{footnote}) -\begin{verbatim} -\setacronymstyle{footnote-sm-desc} -\end{verbatim} - -\deppkgoptsec{footnote} This option changes the definition of -\ics{newacronym} and the way that acronyms are displayed. +\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{verbatim} -\setacronymstyle{footnote} -\end{verbatim} -or (with \deprecatedpkgopt{smallcaps}) -\begin{verbatim} -\setacronymstyle{footnote-sc} -\end{verbatim} -or (with \deprecatedpkgopt{smaller}) -\begin{verbatim} -\setacronymstyle{footnote-sm} -\end{verbatim} -or (with \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{footnote-desc} -\end{verbatim} -or (with \deprecatedpkgopt{smallcaps} and \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{footnote-sc-desc} -\end{verbatim} -or (with \deprecatedpkgopt{smaller} and \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{footnote-sm-desc} -\end{verbatim} - -\deppkgoptsec{dua} This option changes the definition of -\ics{newacronym} so that acronyms are always expanded. +\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{verbatim} -\setacronymstyle{dua} -\end{verbatim} -or (with \deprecatedpkgopt{description}) -\begin{verbatim} -\setacronymstyle{dua-desc} -\end{verbatim} +\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} @@ -5348,756 +17186,886 @@ or (with \deprecatedpkgopt{description}) Other available options that don't fit any of the above categories are described below. -\xtrpkgoptsec{accsupp} +\optiondef{accsupp} -Load the \sty{glossaries-accsupp} package. +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. -\xtrpkgoptsec{prefix} +\optiondef{prefix} -Load the \sty{glossaries-prefix} package. +Only available with \sty{glossaries-extra}, this option +loads the \sty{glossaries-prefix} package. -\xtrpkgoptsec[boolean]{nomissingglstext} +\optiondef{nomissingglstext} This option may be used to suppress the boilerplate text generated -by \cs{printglossary} if the glossary file is missing. - -\pkgoptsec[boolean]{compatible-2.07} Compatibility mode for old documents -created using version 2.07 or below. - -\pkgoptsec[boolean]{compatible-3.07} Compatibility mode for old documents -created using version 3.07 or below. - -\pkgoptsec[value]{kernelglossredefs} As a legacy from the precursor -\sty{glossary} package, the standard glossary commands provided -by the \LaTeX\ kernel (\cs{makeglossary} and \cs{glossary}) are -redefined in terms of the \styfmt{glossaries} package's commands. -However, they were never documented in this user manual, and the -conversion guide (\htmldoc{Upgrading from the glossary package to the -glossaries package}{glossary2glossaries}) explicitly discourages -their use. - -The use of those kernel commands (instead of the appropriate -commands documented in this user guide) are deprecated, and you will -now get a warning if you try using them. - -In the event that you require the original form of these kernel -commands, for example, if you need to use the \styfmt{glossaries} -package with another class or package that also performs -glossary-style indexing, then you can restore these commands to -their previous definition (that is, their definitions prior to -loading the \styfmt{glossaries} package) with the package option -\pkgopt[false]{kernelglossredefs}. You may also need to use the -\pkgopt{nomain} option in the event of file extension conflicts. -(In which case, you must provide a new default glossary for use with -the \sty{glossaries} package.) - -This option may take one of three values: \pkgoptfmt{true} -(redefine with warnings, default), \pkgoptfmt{false} (restore -previous definitions) or \pkgoptfmt{nowarn} (redefine without -warnings, not recommended). +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. + +\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 \cs{makeglossary} and \cs{glossary}. Other packages +kernel are \gls{makeglossary} and \gls{cs.glossary}. Other packages or classes may provide additional glossary-related commands or -environments that conflict with \styfmt{glossaries} (such as -\cs{printglossary} and \env{theglossary}). These non-kernel commands +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 \cs{printglossary} and \env{theglossary}.) +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 \styfmt{glossaries} package does -check for the \sty{doc} package and patches \cs{PrintChanges}.) +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 -\styfmt{glossaries} package has been loaded using -\begin{definition}[\DescribeMacro{\setupglossaries}] -\cs{setupglossaries}\marg{key-val list} -\end{definition} +\sty{glossaries} package has been loaded using +\cmddef{setupglossaries} The following package options \strong{can't} be used in -\cs{setupglossaries}: \pkgopt{xindy}, \pkgopt{xindygloss}, -\pkgopt{xindynoglsnumbers}, \pkgopt{makeindex}, -\pkgopt{nolong}, \pkgopt{nosuper}, \pkgopt{nolist}, -\pkgopt{notree}, \pkgopt{nostyles}, \pkgopt{nomain}, -\pkgopt{compatible-2.07}, \pkgopt{translate}, \pkgopt{notranslate}, -\pkgopt{acronym}. These options have to be set while the package is -loading, except for the \pkgopt{xindy} sub-options which can be set -using commands like \ics{GlsSetXdyLanguage} (see +\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 \styfmt{glossaries} otherwise you might -end up using it too late for the change to take effect. For example, -if you try changing the acronym styles (such as \deprecatedpkgopt{smallcaps}) -after you have started defining your acronyms, you are likely to get -unexpected results. If you try changing the sort option after you have +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 \gls{glossaries-extra}, use \ics*{glossariesextrasetup} +With \sty{glossaries-extra}, use \gls{glossariesextrasetup} instead. \end{xtr} +\renewcommand{\cmddefbookmarkleveloffset}{1} \chapter{Setting Up} \label{sec:setup} -In the preamble you need to indicate which method you want to use to -generate the glossary (or glossaries). The available options with -both \styfmt{glossaries} and \gls{glossaries-extra} are +In the \idx+{documentpreamble} 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 \optsto13, which are provided by the base package. See the -\gls{glossaries-extra} and \gls{bib2gls} manuals for the full +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 glossaries, for example, if you are -just using the \styfmt{glossaries} package to enable consistent +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 1]{\ifpdf\opt1\else Option 1\fi} +\section{Option \glsfmttext{idx.opt.noidx}} \label{sec:setupopt1} The command -\begin{definition}[\DescribeMacro{\makenoidxglossaries}] -\cs{makenoidxglossaries} -\end{definition} -must be placed in the preamble. This sets up the internal commands -required to make \opt1 work. -\strong{If you omit \cs{makenoidxglossaries} none of -the glossaries will be displayed.} - -\section[Options 2 and 3]{\ifpdf\optsand23\else Options 2 and 3\fi} +\cmddef{makenoidxglossaries} +must be placed in the \idxf{documentpreamble}. 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 -\begin{definition}[\DescribeMacro{\makeglossaries}] -\cs{makeglossaries} -\end{definition} -must be placed in the preamble in order to create the customised -\gls{makeindex} (\filetype{ist}) or \gls{xindy} (\filetype{xdy}) -style file (for \optsor23, respectively) and to ensure that glossary -entries are written to the appropriate output files. -\strong{If you omit \cs{makeglossaries} none of -the glossary files will be created.} +\cmddef{makeglossaries} +must be placed in the \idxf{documentpreamble} 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 \gls{glossaries-extra}, \cs{makeglossaries} has an -optional argument that allows you to have a hybrid of \optsor12 or -\optsor13. See \gls{glossaries-extra} manual for further details. +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} -\importantpar -Note that some of the commands provided by the \styfmt{glossaries} -package must not be used after \cs{makeglossaries} as they are +\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 \cs{makeglossaries} you will generate +to use those commands after \gls{makeglossaries} you will generate an error. Similarly, there are some commands that must not be used before -\cs{makeglossaries}. - -You can suppress the creation of the customised \gls{xindy} -or \gls{makeindex} style file using -\begin{definition}[\DescribeMacro{\noist}] -\cs{noist} -\end{definition} -That this command must not be used after \cs{makeglossaries}. -\begin{important} -Note that if you have a custom \filetype{xdy} file created when using -\styfmt{glossaries} version 2.07 or below, you will need to use the -\pkgopt{compatible-2.07} package option with it. +\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 -\ics{jobname}\texttt{.}\filetype{ist} (\opt2) or -\ics{jobname}\texttt{.}\filetype{xdy} (\opt3). This name may be +\code{\gls{jobname}.\ext+{ist}} (\option{mkidx}) or +\code{\gls{jobname}.\ext+{xdy}} (\option{xdy}). This name may be changed using: -\begin{definition}[\DescribeMacro{\setStyleFile}] -\cs{setStyleFile}\marg{name} -\end{definition} +\cmddef{setStyleFile} where \meta{name} is the name of the style file without the -extension. Note that this command must not be used after -\cs{makeglossaries}. - -Each glossary entry is assigned a \gls{numberlist} that lists all -the locations in the document where that entry was used. By default, -the location refers to the page number but this may be overridden -using the \pkgopt{counter} package option. The default form of -the location number assumes a full stop compositor (e.g.\ 1.2), -but if your location numbers use a different compositor (e.g. 1-2) -you need to set this using -\begin{definition}[\DescribeMacro{\glsSetCompositor}] -\cs{glsSetCompositor}\marg{symbol} -\end{definition} -For example: -\begin{verbatim} -\glsSetCompositor{-} -\end{verbatim} -This command must not be used after \cs{makeglossaries}. +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}. -If you use \opt3, you can have a different compositor for page +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: -\begin{definition}[\DescribeMacro{\glsSetAlphaCompositor}] -\cs{glsSetAlphaCompositor}\marg{symbol} -\end{definition} -This command has no effect if you use \opt2. For example, if you want -\glspl{numberlist} containing a mixture of A-1 and 2.3 style +\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{verbatim} -\glsSetCompositor{.}\glsSetAlphaCompositor{-} -\end{verbatim} +\begin{codebox} +\gls{glsSetCompositor}\marg{.}\gls{glsSetAlphaCompositor}\marg{-} +\end{codebox} See \sectionref{sec:numberlists} for further information about -\glspl{numberlist}. +\idxpl{numberlist}. -\chapter{Defining Glossary Entries} +\chapter{Defining \Glsfmtplural{idx.glossaryentry}} \label{sec:newglosentry} \begin{bib2gls} -If you want to use \gls{bib2gls}, entries must be defined in -\filetype{bib} files using the syntax described in the \gls{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} -Acronyms are covered in \sectionref{sec:acronyms} but they use the -same underlying mechanism as all the other entries, so it's a good +\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 -\cs{newglossaryentry} can also be used in the optional argument of -\cs{newacronym}, although some of them, such as \gloskey{first} and -\gloskey{plural}, interfere with the acronym styles. - -All glossary entries must be defined before they are used, so it is -better to define them in the preamble to ensure this. In fact, some -commands such as \cs{longnewglossaryentry} -may only be used in the preamble. See \sectionref{sec:docdefs} for -a discussion of the problems with defining entries within the -document instead of in the preamble. (The \gls{glossaries-extra} +\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{documentpreamble} to ensure this. In fact, some +commands such as \gls{longnewglossaryentry} +may only be used in the \idx{documentpreamble}. See \sectionref{sec:docdefs} for +a discussion of the problems with defining \idxpl{entry} within the +document instead of in the \idx{documentpreamble}. (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} -\opt1 enforces the preamble-only restriction on -\ics{newglossaryentry}. \opt4 requires that definitions are provided -in \filetype{bib} format. \opt5 requires either preamble-only -definitions or the use of the \gls{glossaries-extra} package option -\optfmt{docdef=restricted}. +\option{noidx} enforces the \idx+{documentpreamble}-only restriction on +\gls{newglossaryentry}. \option{b2g} requires that definitions are provided +in \ext{bib} format. \options{unsrt,standalone} work best with either +\idx{documentpreamble}-only +definitions or the use of the \sty{glossaries-extra} package option +\optval{docdef}{restricted}. \end{important} -Only those entries that are indexed in the document +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 glossary. See +\sectionref{sec:crossref}) will appear in the \idx{glossary}. See \sectionref{sec:printglossary} to find out how to display the -glossary. +\idx{glossary}. - -New glossary entries are defined using the command: -\begin{definition}[\DescribeMacro{\newglossaryentry}] -\cs{newglossaryentry}\marg{label}\marg{key=value list} -\end{definition} -This is a short command, so values in \meta{key-val list} can't +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 (\texttt{,}) or equal signs (\texttt{=}) with braces to hide them -from the key=value list parser. +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 -\begin{definition}[\DescribeMacro{\longnewglossaryentry}] -\cs{longnewglossaryentry}\marg{label}\marg{key=value -list}\marg{long description} -\end{definition} -instead. Note that this command may only be used in the preamble. -Be careful of unwanted spaces. \cs{longnewglossaryentry} -will remove trailing spaces in the description (via \cs{unskip}) -but won't remove leading spaces. This command also appends -\cs{nopostdesc} to the end of the description, which suppresses the -post-description hook. The \gls{glossaries-extra} package provides -a starred version of \cs{longnewglossaryentry} that doesn't append -either \cs{unskip} or \cs{nopostdesc}. - -There are also commands that will only define the entry if it +needs to span multiple paragraphs, use the following instead: +\cmddef{longnewglossaryentry} +Note that this command may only be used in the +\idx+{documentpreamble} (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: -\begin{definition}[\DescribeMacro\provideglossaryentry] -\cs{provideglossaryentry}\marg{label}\marg{key=value list} -\end{definition} +\cmddef{provideglossaryentry} and -\begin{definition}[\DescribeMacro\longprovideglossaryentry] -\cs{longprovideglossaryentry}\marg{label}\marg{key=value -list}\marg{long description} -\end{definition} -(These are both preamble-only commands.) - -For all the above commands, the first argument, \meta{label}, must be -a~unique label with which to identify this entry. \strong{This can't contain -any non-expandable commands or active characters.} The reason for +\cmddef{longprovideglossaryentry} +(These are both \idx+{documentpreamble}-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 \cs{label}) and therefore must be able to expand to a valid -control sequence name. +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} -Note that although an \gls{exlatinchar} or other \gls{nonlatinchar}, -such as \'e or \ss, looks like a plain character in your -\texttt{.tex} file, it's actually a~macro (an active character) and -therefore can't be used in the label. (This applies to \LaTeX\ -rather than \XeLaTeX.) Also be careful of -\sty{babel}'s options that change certain punctuation characters -(such as \texttt{:} or \texttt{-}) to active characters. +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, \meta{key=value list}, is -a \meta{key}=\meta{value} list that supplies the relevant +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 -\cs{longnewglossaryentry} and \cs{longprovideglossaryentry}. With +\gls{longnewglossaryentry} and \gls{longprovideglossaryentry}. With the other commands it's set via the \gloskey{description} key. -As is typical with \meta{key}=\meta{value} lists, values that contain -a comma or equal sign must be enclosed in braces. Available fields + +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 \gls{glossaries-extra}. +(\sectionref{sec:accsupp}) and also by \sty{glossaries-extra}. You can also define your own custom keys (see \sectionref{sec:addkey}). -\begin{description} -\item[{\gloskey{name}}] The name of the entry (as it will appear in -the glossary). If this key is omitted and the \gloskey{parent} +\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 entries -alphabetically, otherwise the entries can't be sorted correctly. +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} -\item[{\gloskey{description}}] A brief description of this term (to -appear in the glossary). Within this value, you can use: -\begin{definition}[\DescribeMacro{\nopostdesc}] -\cs{nopostdesc} -\end{definition} -to suppress the -description terminator for this entry. For example, if this +\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 \texttt{description\dequals\mgroup{\cs{nopostdesc}}}. If you want a paragraph +can do \gloskeyval{description}{\gls{nopostdesc}}. If you want a paragraph break in the description use: -\begin{definition}[\DescribeMacro{\glspar}] -\cs{glspar} -\end{definition} -or, better, use \cs{longnewglossaryentry}. -However, note that not all glossary styles support multi-line -descriptions. If you are using one of the tabular-like glossary -styles that permit multi-line descriptions, use \ics{newline} -not \verb"\\" if you want to force a line break. +\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 \gls{glossaries-extra}, use \ics*{glsxtrnopostpunc} instead of -\cs{nopostdesc} to suppress the post-description punctuation. +With \sty{glossaries-extra}, use \gls{glsxtrnopostpunc} instead of +\gls{nopostdesc} to suppress the post-description punctuation. \end{xtr} -\item[{\gloskey{parent}}] The label of the parent entry. Note that -the parent entry must be defined before its sub-entries. +\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. -\item[{\gloskey{descriptionplural}}] The plural form of the -description, if required. If omitted, the value -is set to the same as the \gloskey{description} key. +\begin{important} +The parent \idx{entry} must be defined before it's referenced in +the \gloskey{parent} key of another \idx{entry}. +\end{important} -\item[{\gloskey{text}}] How this entry will appear in the document text -when using \ics{gls} (or one of its upper case variants). If this +\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 \cs{newacronym}. Although it is +This key is automatically set by \gls{newacronym}. Although it is possible to override it by using \gloskey{text} in the optional -argument of \cs{newacronym}, it will interfere with the acronym -style and cause unexpected results. - -\item[{\gloskey{first}}] How the entry will appear in the document text -on \firstuse\ with \ics{gls} (or one of its upper case -variants). If this field is omitted, the value of the \gloskey{text} -key is used. Note that if you use \ics{glspl}, \ics{Glspl}, -\ics{GLSpl}, \ics{glsdisp} before using \ics{gls}, the -\gloskey{first} value won't be used with \ics{gls}. - -You may prefer to use abbreviations (\sectionref{sec:acronyms}) -or the category post-link hook (\ics*{glsdefpostlink}) provided by -\gls{glossaries-extra} if you would like to automatically append -content on \firstuse\ in a consistent manner. See, for example, -\gallery{index.php?label=sample-units}{Gallery: Units -(\styfmt{glossaries-extra.sty})}. +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 \cs{newacronym}, it can interfere with the acronym -style and cause unexpected results. +argument of \gls{newacronym}, it can interfere with the +\idx{acronymstyle} and cause unexpected results. -\item[{\gloskey{plural}}] How the entry will appear in the document text -when using \ics{glspl} (or one of its upper case variants). If this +\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 -\ics{glspluralsuffix} to the value of the \gloskey{text} field. The -default value of \ics{glspluralsuffix} is the letter \qt{s}. +\gls{glspluralsuffix} to the value of the \gloskey{text} field. Although it is possible to use \gloskey{plural} in the optional -argument of \cs{newacronym}, it can interfere with the acronym -style and cause unexpected results. Use \gloskey{shortplural} +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. -\item[{\gloskey{firstplural}}] How the entry will appear in the -document text on \firstuse\ with \ics{glspl} (or one of its -upper case variants). If this field is omitted, the value is obtained +\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 \ics{glspluralsuffix} to the value of the +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 \ics{gls}, \ics{Gls}, \ics{GLS}, \cs{glsdisp} before -using \ics{glspl}, the \gloskey{firstplural} value won't be used -with \ics{glspl}. +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 \cs{newacronym}, it can interfere with the acronym -style and cause unexpected results. Use \gloskey{shortplural} +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. -\importantpar -Note: prior to version 1.13, the default value of +\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} -\item[{\gloskey{symbol}}] This field is provided to allow the user +\optiondef{gloskey.symbol} +This field is provided to allow the user to specify an associated symbol. If omitted, the value is set to -\cs{relax}. Note that not all glossary styles display the symbol. +\gls{relax}. Note that not all \idxpl{glossarystyle} display the symbol. -\item[{\gloskey{symbolplural}}] This is the plural form of the -symbol (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst} -by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value +\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. -\item[{\gloskey{sort}}] This value indicates the text to be used by -the sort comparator when ordering all the entries. If omitted, the value is given -by the \gloskey{name} field unless one of the package options -\pkgopt[def]{sort} and \pkgopt[use]{sort} have been used. -With \opt2 it's best to use the \gloskey{sort} key if the -\gloskey{name} contains commands (e.g.\ \verb|\ensuremath{\alpha}|) -and with \optsand13, it's strongly recommended as the indexing may -fail if you don't (see below). +\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 -\ics{glsprestandardsort} (see \sectionref{sec:pkgopts-sort}). +\gls{glsprestandardsort} (see \sectionref{sec:pkgopts-sort}). \begin{bib2gls} -The \gloskey{sort} key shouldn't be used with \gls{bib2gls}. It has -a system of fallbacks that allow different types of entries to +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 -\gls{bib2gls} manual for further details and see also +\app{bib2gls} manual for further details, and see also \bibglsgallery{sorting}. \end{bib2gls} -\opt1 by default strips the \glslink{latexexlatinchar}{standard +\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 -\opt1: -\begin{verbatim} -\newglossaryentry{elite}{% - name={{\'e}lite}, - description={select group of people} +\option{noidx}: +\begin{codebox} +\gls{newglossaryentry}\marg{elite}\marg{ + \gloskeyval{name}{\gls{cs.apos}elite}, + \gloskeyval{description}{select group of people} } -\end{verbatim} +\end{codebox} This is equivalent to: -\begin{verbatim} -\newglossaryentry{elite}{% - name={{\'e}lite}, - description={select group of people}, - sort={elite} -} -\end{verbatim} -Unless you use the package option \pkgopt[true]{sanitizesort}, in -which case it's equivalent to: -\begin{verbatim} -\newglossaryentry{elite}{% - name={{\'e}lite}, - description={select group of people}, - sort={\'elite} -} -\end{verbatim} -This will place the entry before the \qt{A} letter group since the -sort value starts with a symbol. - -Similarly if you use the \sty{inputenc} package: -\begin{alltt} -\cs{newglossaryentry}\mgroup{elite}\mgroup{\% - name=\mgroup{\mgroup{\'e}lite}, - description=\mgroup{select group of people} +\begin{codebox} +\gls{newglossaryentry}\marg{elite}\marg{ + \gloskeyval{name}{\gls{cs.apos}elite}, + \gloskeyval{description}{select group of people} + \gloskeyval{sort}{elite} } -\end{alltt} -This is equivalent to -\begin{alltt} -\cs{newglossaryentry}\mgroup{elite}\mgroup{\% - name=\mgroup{\mgroup{\'e}lite}, - description=\mgroup{select group of people}, - sort=elite -} -\end{alltt} -Unless you use the package option \pkgopt[true]{sanitizesort}, in +\end{codebox} +Unless you use the package option \optval{sanitizesort}{true}, in which case it's equivalent to: -\begin{alltt} -\cs{newglossaryentry}\mgroup{elite}\mgroup{\% - name=\mgroup{\mgroup{\'e}lite}, - description=\mgroup{select group of people}, - sort=\'elite +\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{alltt} -Again, this will place the entry before the \qt{A} group. - -With \optsand23, the default value of \gloskey{sort} will either be -set to the \gloskey{name} key (if \pkgopt[true]{sanitizesort}) or it +\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 -\pkgopt[false]{sanitizesort}). +\optval{sanitizesort}{false}). \begin{important} -Take care with \gls{xindy} (\opt3): if you have entries with the same +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 \gls{xindy} and aren't using the \texttt{def} -or \texttt{use} sort methods, \strong{always} use the \gloskey{sort} -key for entries where the name just consists of a control sequence -(for example \texttt{name=\{\cs{alpha}\}}). +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 \opt1 and the \gloskey{name} contains fragile +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 \pkgopt[true]{sanitizesort} package option (unless -you use the \texttt{def} or \texttt{use} sort methods). +key or use the \optval{sanitizesort}{true} package option (unless +you use the \optvalref{sort}{def} or \optvalref{sort}{use} sort methods). \end{important} -\item[{\gloskey{type}}] This specifies the label of the glossary in -which this entry belongs. If omitted, the default glossary is -assumed unless \ics{newacronym} is used (see +\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}). -\item[{\gloskey{user1}, \ldots, \gloskey{user6}% -\igloskey{user2}\igloskey{user3}\igloskey{user4}\igloskey{user5}}] -Six keys provided for any additional information the user may want +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 \ics{glsaddkey} or \ics{glsaddstoragekey} (see \sectionref{sec:addkey}). +add new keys using \gls{glsaddkey} or \gls{glsaddstoragekey} +(see \sectionref{sec:addkey}). + +\optiondef{gloskey.user1} +The first user key. -\item[{\gloskey{nonumberlist}}] A boolean key. If the value is -missing or is \texttt{true}, this will suppress the \gls{numberlist} just for -this entry. Conversely, if you have used the package option -\pkgopt{nonumberlist}, you can activate the \gls*{numberlist} just -for this entry with \gloskey{nonumberlist=false}. +\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}.) -\item[{\gloskey{see}}] +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{alltt} -\cs{glssee}\oarg{tag}\marg{label}\marg{xr-label list} -\end{alltt} -after the entry has been defined. (See \sectionref{sec:crossref}.) +\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 glossary in order to -redirect the reader. Note that it doesn't index the cross-referenced -entry (or entries) as that would interfere with their \glspl{numberlist}. +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 entry -to the glossary}, but will not automatically add the -cross-referenced entry. +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{verbatim} -\newglossaryentry{courgette}{name={courgette}, - description={variety of small marrow}} -\newglossaryentry{zucchini}{name={zucchini}, - description={(North American)}, - see={courgette}} -\end{verbatim} +\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 \gls{numberlist}.) This -doesn't automatically index courgette since this would create an -unwanted location in courgette's \gls{numberlist}. (Page~1, if the -definitions occur in the preamble.) +\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{documentpreamble}.) Note that while it's possible to put the cross-reference in the description instead, for example: -\begin{verbatim} -\newglossaryentry{zucchini}{name={zucchini}, - description={(North American) see \gls{courgette}}} -\end{verbatim} -this won't index the zucchini entry, so if zucchini isn't indexed -elsewhere (with commands like \cs{gls} or \cs{glsadd}) then it won't -appear in the glossary even if courgette does. - -The referenced entry should be supplied as the value to this key. +\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 -\verb|see=[see also]{anotherlabel}|. \strong{Note that if you have -suppressed the \gls{numberlist}, the cross-referencing information -won't appear in the glossary, as it forms part of the -\gls*{numberlist}.} You can override this for individual -glossary entries using \gloskey{nonumberlist=false} (see above). -Alternatively, you can use the \pkgopt{seeautonumberlist} package -option. For further details, see \sectionref{sec:crossref}. +\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 \optsand23, \ics{makeglossaries} must be used before any occurrence of -\ics{newglossaryentry} that contains the \gloskey{see} key. This key -should not be used with entries defined in the \env{document} environment. +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 indexing while working on a draft -document, consider using the \pkgopt{seenoindex} package option to -warn or ignore the \gloskey{see} key while \cs{makeglossaries} is + +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 -\gls{glossaries-extra} package which additionally -provides a \texttt{seealso} and \texttt{alias} key. If you want to -avoid the automatic indexing triggered by the \gloskey{see} key, -consider using \opt4. See also the FAQ item -\href{https://www.dickimaw-books.com/faq.php?action=view&category=glossaries&itemlabel=whyseekeyautoindex}{Why does the see key automatically index the entry?} +\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 \gls{bib2gls} \gloskey{see} field (and \xtrgloskey{seealso}) have a -slightly different meaning. The \resourceopt{selection} resource option -determines the behaviour. +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} -\item[{\xtrgloskey{seealso}}] -This key is only available with \gls{glossaries-extra} and is +\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 \gls{glossaries-extra} package provides \ics*{seealsoname} and -\texttt{seealso=\marg{list}} is essentially like -\texttt{see=[\ics*{seealsoname}]\meta{list}} (\optsand34 may treat -these differently). +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). -\item[{\xtrgloskey{alias}}] -This key is only available with \gls{glossaries-extra} and is +\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 \texttt{alias=\marg{label}}. This behaves like -\texttt{see=\marg{label}} but also alters the behaviour of commands -like \cs{gls} so that they index the entry given by \meta{label} -instead of the original entry. (See, for example, -\gallery{index.php?label=aliases}{Gallery: Aliases}.) +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 key are available with \gls{bib2gls}. +More variations with the \gloskey{alias} key are available with \app{bib2gls}. \end{bib2gls} -\item[\xtrgloskey{category}] -This key is only available with \gls{glossaries-extra} and is used -to assign a category to the entry. The value should be a label that +\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 -\gls{glossaries-extra} manual for further details. - -\end{description} - -The following keys are reserved for \ics{newacronym} (see -\sectionref{sec:acronyms}) and also for \ics*{newabbreviation} (see the -\gls{glossaries-extra} manual): \gloskey{long}, \gloskey{longplural}, -\gloskey{short} and \gloskey{shortplural}. +\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 \gls{bib2gls}. -See the \gls{bib2gls} manual for further details. +There are also special internal field names used by \app{bib2gls}. +See the \app{bib2gls} manual for further details. \end{bib2gls} -The supplementary packages \styfmt{glossaries-prefix} (\sectionref{sec:prefix}) and -\styfmt{glossaries-accsupp} (\sectionref{sec:accsupp}) provide additional keys. +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 \glslike\ or \glstextlike\ commands within +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 -\cs{glssymbol}.) Otherwise you end up with nested links, which -can cause complications and they won't work with the case-changing -commands. You can use them within the value of keys +\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 \cs{glsdesc}. -Additionally, they'll confuse the entry formatting commands, such as -\cs{glslabel}. +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} -Note that if the name starts with -\gls{nonlatinchar}, you must group the character, otherwise it will -cause a problem for commands like \ics{Gls} and \ics{Glspl}. +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{verbatim} -\newglossaryentry{elite}{name={{\'e}lite}, -description={select group or class}} -\end{verbatim} -Note that the same applies if you are using the \sty{inputenc} -package: -\begin{alltt} -\cs{newglossaryentry}\mgroup{elite}\mgroup{name=\mgroup{\mgroup{\'e}lite}, -description=\mgroup{select group or class}} -\end{alltt} -(This doesn't apply for \XeLaTeX\ or \LuaLaTeX\ documents. -For further details, see the \qt{UTF-8} section in the -\sty{mfirstuc} user manual.) - -Note that in both of the above examples, you will also need to -supply the \gloskey{sort} key if you are using \opt2 -whereas \gls{xindy} (\opt3) is usually able to sort -\glspl{nonlatinchar} -correctly. \opt1 discards accents from -\glspl{latexexlatinchar} unless you use the \pkgopt[true]{sanitizesort}. - +\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 a term. If you omit this, the plural will be -obtained by appending -\begin{definition}[\DescribeMacro{\glspluralsuffix}] -\cs{glspluralsuffix} -\end{definition} -to the singular form. This command defaults to the letter \qt{s}. +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{verbatim} -\newglossaryentry{cow}{name=cow,description={a fully grown +\begin{codebox} +\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},\gloskeyval{description}{a fully grown female of any bovine animal}} -\end{verbatim} -defines a new entry whose singular form is \qt{cow} and plural form +\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{verbatim} -\newglossaryentry{cow}{name=cow,plural=kine, -description={a fully grown female of any bovine animal}} -\end{verbatim} +\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{verbatim} -\newglossaryentry{cow}{% - name=cow,% - description={a fully grown female of any bovine animal - (plural cows, archaic plural kine)},% - user1={kine}} -\end{verbatim} -You can then use \verb|\glspl{cow}| to produce \qt{cows} and -\verb|\glsuseri{cow}| to produce \qt{kine}. You can, of course, +\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{verbatim} -\let\glsaltpl\glsuseri -\end{verbatim} +\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. Alternatively, you can define your own keys using -\ics{glsaddkey}, described in \sectionref{sec:addkey}. +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 \cs{glspluralsuffix} as required. However, this must be -done \emph{before} the entries are defined. For languages that don't +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). @@ -6107,153 +18075,146 @@ key where necessary). You can use the six user keys to provide alternatives, such as participles. For example: -\begin{verbatim} -\let\glsing\glsuseri -\let\glsd\glsuserii - -\newcommand*{\ingkey}{user1} -\newcommand*{\edkey}{user2} - -\newcommand*{\newword}[3][]{% - \newglossaryentry{#2}{% - name={#2},% - description={#3},% - \edkey={#2ed},% - \ingkey={#2ing},#1% +\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{verbatim} +\end{codebox} With the above definitions, I can now define terms like this: -\begin{verbatim} -\newword{play}{to take part in activities for enjoyment} -\newword[\edkey={ran},\ingkey={running}]{run}{to move fast using +\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{verbatim} +\end{codebox} and use them in the text: -\begin{verbatim} -Peter is \glsing{play} in the park today. - -Jane \glsd{play} in the park yesterday. - -Peter and Jane \glsd{run} in the park last week. -\end{verbatim} +\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 -\ics{glsaddkey}, described below in \sectionref{sec:addkey}. +\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 now also define your own custom keys using the +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 \cs{glsaddkey} described in +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 glossary style or acronym style that this entry -should be formatted differently to other entries, then you can use -\cs{glsaddstoragekey} described in \sectionref{sec:glsaddstoragekey}. +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 \cs{glsentrytext}). This can be used in an expandable +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 \cs{glsaddkey} or -\cs{glsaddstoragekey} before glossary entries are defined. +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: -\begin{definition}[\DescribeMacro\glsaddkey] -\cs{glsaddkey}\marg{key}% -\marg{default value}% -\marg{no link cs}% -\marg{no link ucfirst cs}% -\marg{link cs}% -\marg{link ucfirst cs}% -\marg{link allcaps cs} -\end{definition} -where: +\cmddef{glsaddkey} +where the arguments are as follows: \begin{description} -\item[\meta{key}] is the new key to use in \ics{newglossaryentry} -(or similar commands such as \ics{longnewglossaryentry}); +\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 \cs{glslabel}, but you will have to switch on -expansion via the starred version of \cs{glsaddkey} and protect +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 \ics{glsentrytext}; +to commands like \gls{glsentrytext}; \item[\meta{no link ucfirst cs}] is the control sequence to use analogous -to commands like \ics{Glsentrytext}; +to commands like \gls{Glsentrytext}; \item[\meta{link cs}] is the control sequence to use analogous -to commands like \ics{glstext}; +to commands like \gls{glstext}; \item[\meta{link ucfirst cs}] is the control sequence to use analogous -to commands like \ics{Glstext}; +to commands like \gls{Glstext}; \item[\meta{link allcaps cs}] is the control sequence to use analogous -to commands like \ics{GLStext}. +to commands like \gls{GLStext}. \end{description} -The starred version of \cs{glsaddkey} switches on expansion for this +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, \texttt{ed} and \texttt{ing}, +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{verbatim} - % Define "ed" key: - \glsaddkey* - {ed}% key - {\glsentrytext{\glslabel}ed}% default value - {\glsentryed}% command analogous to \glsentrytext - {\Glsentryed}% command analogous to \Glsentrytext - {\glsed}% command analogous to \glstext - {\Glsed}% command analogous to \Glstext - {\GLSed}% command analogous to \GLStext - - % Define "ing" key: - \glsaddkey* - {ing}% key - {\glsentrytext{\glslabel}ing}% default value - {\glsentrying}% command analogous to \glsentrytext - {\Glsentrying}% command analogous to \Glsentrytext - {\glsing}% command analogous to \glstext - {\Glsing}% command analogous to \Glstext - {\GLSing}% command analogous to \GLStext -\end{verbatim} -Now I can define some entries: -\begin{verbatim} - % No need to override defaults for this entry: - - \newglossaryentry{jump}{name={jump},description={}} - - % Need to override defaults on these entries: - - \newglossaryentry{run}{name={run},% - ed={ran},% - ing={running},% - description={}} - - \newglossaryentry{waddle}{name={waddle},% - ed={waddled},% - ing={waddling},% - description={}} -\end{verbatim} - -These entries can later be used in the document: -\begin{verbatim} -The dog \glsed{jump} over the duck. - -The duck was \glsing{waddle} round the dog. - -The dog \glsed{run} away from the duck. -\end{verbatim} +\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} @@ -6262,248 +18223,251 @@ For a complete document, see the sample file \samplefile{-newkeys}. A custom key that can be used for simply storing information is defined using: -\begin{definition}[\DescribeMacro\glsaddstoragekey] -\cs{glsaddstoragekey}\marg{key}\marg{default value}\marg{no link cs} -\end{definition} +\cmddef{glsaddstoragekey} where the arguments are as the first three arguments of -\cs{glsaddkey}, described above in \sectionref{sec:glsaddkey}. +\gls{glsaddkey}, described above in \sectionref{sec:glsaddkey}. -This is essentially the same as \cs{glsaddkey} except that it +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 and other forms of abbreviations, -such as initialisms, but I want them all in the same glossary and I -want the acronyms on first use to be displayed with the short form followed by -the long form in parentheses, but the opposite way round for other -forms of abbreviations. (The \gls{glossaries-extra} package -provides a simpler way of achieving this.) +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 \texttt{abbrtype} (since \texttt{type} +going to call this key \optfmt{abbrtype} (since \gloskey{type} already exists): -\begin{verbatim} -\glsaddstoragekey - {abbrtype}% key/field name - {word}% default value if not explicitly set - {\abbrtype}% custom command to access the value if required -\end{verbatim} - -Now I can define a style that looks up the value of this new key to -determine how to display the full form: -\begin{verbatim} -\newacronymstyle - {mystyle}% style name - {% Use the generic display - \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% - } - {% Put the long form in the description - \renewcommand*{\GenericAcronymFields}{% - description={\the\glslongtok}}% - % For the full format, test the value of the "abbrtype" key. - % If it's set to "word" put the short form first with - % the long form in brackets. - \renewcommand*{\genacrfullformat}[2]{% - \ifglsfieldeq{##1}{abbrtype}{word} - {% is a proper acronym - \protect\firstacronymfont{\glsentryshort{##1}}##2\space - (\glsentrylong{##1})% - } - {% is another form of abbreviation - \glsentrylong{##1}##2\space - (\protect\firstacronymfont{\glsentryshort{##1}})% - }% - }% - % first letter upper case version: - \renewcommand*{\Genacrfullformat}[2]{% - \ifglsfieldeq{##1}{abbrtype}{word} - {% is a proper acronym - \protect\firstacronymfont{\Glsentryshort{##1}}##2\space - (\glsentrylong{##1})% - } - {% is another form of abbreviation - \Glsentrylong{##1}##2\space - (\protect\firstacronymfont{\glsentryshort{##1}})% - }% - }% - % plural - \renewcommand*{\genplacrfullformat}[2]{% - \ifglsfieldeq{##1}{abbrtype}{word} - {% is a proper acronym - \protect\firstacronymfont{\glsentryshortpl{##1}}##2\space - (\glsentrylong{##1})% - } - {% is another form of abbreviation - \glsentrylongpl{##1}##2\space - (\protect\firstacronymfont{\glsentryshortpl{##1}})% - }% - }% - % plural and first letter upper case - \renewcommand*{\Genplacrfullformat}[2]{% - \ifglsfieldeq{##1}{abbrtype}{word} - {% is a proper acronym - \protect\firstacronymfont{\Glsentryshortpl{##1}}##2\space - (\glsentrylong{##1})% +\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{} } - {% is another form of abbreviation - \Glsentrylongpl{##1}##2\space - (\protect\firstacronymfont{\glsentryshortpl{##1}})% - }% - }% - % Just use the short form as the name part in the glossary: - \renewcommand*{\acronymentry}[1]{% - \acronymfont{\glsentryshort{##1}}}% - % Sort by the short form: - \renewcommand*{\acronymsort}[2]{##1}% - % Just use the surrounding font for the short form: - \renewcommand*{\acronymfont}[1]{##1}% - % Same for first use: - \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% - % Default plural suffix if the plural isn't explicitly set - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% + \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{verbatim} +\end{codebox} Remember that the new style needs to be set before defining any -terms: -\begin{verbatim} -\setacronymstyle{mystyle} -\end{verbatim} +terms: +\begin{codebox} +\gls{setacronymstyle}\marg{mystyle} +\end{codebox} -Since it's a bit confusing to use \ics{newacronym} for something +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{verbatim} -\newcommand*{\newinitialism}[4][]{% - \newacronym[abbrtype=initialism,#1]{#2}{#3}{#4}% +\begin{codebox} +\cmd{newcommand}*\marg{\cmd{newinitialism}}[4][]\marg{\comment{} + \gls{newacronym}\oarg{abbrtype=initialism,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{} } -\end{verbatim} -Now the entries can all be defined: -\begin{verbatim} -\newacronym{radar}{radar}{radio detecting and ranging} -\newacronym{laser}{laser}{light amplification by stimulated +\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} -\newacronym{scuba}{scuba}{self-contained underwater breathing +\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing apparatus} -\newinitialism{dsp}{DSP}{digital signal processing} -\newinitialism{atm}{ATM}{automated teller machine} -\end{verbatim} -On \gls{firstuse}, \verb|\gls{radar}| will produce \qt{radar (radio -detecting and ranging)} but \verb|\gls{dsp}| will produce \qt{DSP +\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 \cs{newglossaryentry} is explicitly used -(instead of through \cs{newacronym}) the \texttt{abbrtype} key will -be set to its default value of \qt{word} but the \cs{ifglshaslong} -test in the custom acronym style will be false (since the -\gloskey{long} key hasn't been set) so the display style will switch -to that given by \cs{glsgenentryfmt} and they'll be no test -performed on the \texttt{abbrtype} field. +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{verbatim} -\glsaddstoragekey - {abbrtype}% key/field name - {acronym}% default value if not explicitly set - {\abbrtype}% custom command to access the value if required -\end{verbatim} -This may seem a little odd for non-abbreviated entries defined using -\cs{newglossaryentry} directly, but \ics{ifglshaslong} can be used +\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 -\texttt{abbrtype} field. +\optfmt{abbrtype} field. -The new acronym style has a~minor modification that forces the user +The new \idx{acronymstyle} has a~minor modification that forces the user to specify a description. In the previous example, the line: -\begin{verbatim} - \renewcommand*{\GenericAcronymFields}{% - description={\the\glslongtok}}% -\end{verbatim} +\begin{codebox} + \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{} + \gloskeyval{description}{\cmd{the}\gls{glslongtok}}}\comment{} +\end{codebox} needs to be changed to: -\begin{verbatim} - \renewcommand*{\GenericAcronymFields}{}% -\end{verbatim} +\begin{codebox} + \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{} +\end{codebox} Additionally, to accommodate the change in the default value of the -\texttt{abbrtype} key, all instances of -\begin{verbatim} - \ifglsfieldeq{##1}{abbrtype}{word} -\end{verbatim} +\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{verbatim} - \ifglsfieldeq{##1}{abbrtype}{acronym} -\end{verbatim} +\begin{codebox} + \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{acronym} +\end{codebox} -Once this new style has been set, the new acronyms can be defined +Once this new \idxc{acronymstyle}{style} has been set, the new acronyms can be defined using the optional argument to set the description: -\begin{verbatim} -\newacronym[description={system for detecting the position and -speed of aircraft, ships, etc}]{radar}{radar}{radio detecting +\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{verbatim} +\end{codebox} -No change is required for the definition of \cs{newinitialism} but +No change is required for the definition of \cmd{newinitialism} but again the optional argument is required to set the description: -\begin{verbatim} -\newinitialism[description={mathematical manipulation of an -information signal}]{dsp}{DSP}{digital signal processing} -\end{verbatim} +\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{verbatim} -\newcommand*{\newcontraction}[4][]{% - \newacronym[abbrtype=contraction,#1]{#2}{#3}{#4}% +\begin{codebox} +\cmd{newcommand}*\marg{\cmd{newcontraction}}[4][]\marg{\comment{} + \gls{newacronym}\oarg{abbrtype=contraction,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{} } -\end{verbatim} +\end{codebox} The contractions can similarly been defined using this new command: -\begin{verbatim} -\newcontraction[description={front part of a ship below the -deck}]{focsle}{fo'c's'le}{forecastle} -\end{verbatim} +\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 acronym style just checks if \texttt{abbrtype} is -\texttt{acronym}, the contractions will be treated the same as the -initialisms, but the style could be modified by a further test of -the \texttt{abbrtype} value if required. +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{verbatim} -\newglossaryentry{apple}{name={apple},description={a fruit}} -\end{verbatim} +\begin{codebox} +\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{a fruit}} +\end{codebox} -Now for a new glossary style that provides information about the +Now for a new \idx{glossarystyle} that provides information about the abbreviation (in addition to the description): -\begin{verbatim} -\newglossarystyle - {mystyle}% style name - {% base it on the "list" style - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glstarget{##1}{\glossentryname{##1}}] - \ifglshaslong{##1}% - { (\abbrtype{##1}: \glsentrylong{##1})\space}{}% - \glossentrydesc{##1}\glspostdescription\space ##2}% +\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{verbatim} -This uses \ics{ifglshaslong} to determine whether or not the term is -an abbreviation. If it has an abbreviation, the full form is -supplied in parentheses and \cs{abbrtype} (defined by -\cs{glsaddstoragekey} earlier) is used to indicate the type of +\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 \texttt{apple} entry is simply displayed in -the glossary as +With this style set, the \qt{apple} entry is simply displayed in +the glossary as: \begin{description} \item[apple] a fruit. \end{description} @@ -6531,21 +18495,17 @@ For a complete document, see \samplefile{-storage-abbr-desc}. \section{Expansion} \label{sec:expansion} -When you define new glossary entries expansion is performed by +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 -\cs{glssetnoexpandfield}). +\gls{glssetnoexpandfield}). -You can switch expansion on or off for individual keys using -\begin{definition}[\DescribeMacro\glssetexpandfield] -\cs{glssetexpandfield}\marg{field} -\end{definition} +You can switch expansion on or off for individual keys using: +\cmddef{glssetexpandfield} or -\begin{definition}[\DescribeMacro\glssetnoexpandfield] -\cs{glssetnoexpandfield}\marg{field} -\end{definition} -respectively, where \meta{field} is the field tag corresponding to +\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}. @@ -6555,407 +18515,501 @@ except for those listed in \tableref{tab:fieldmap}. \centering \begin{tabular}{ll} \bfseries Key & \bfseries Field\\ -\gloskey{sort} & \ttfamily sortvalue\\ -\gloskey{firstplural} & \ttfamily firstpl\\ -\gloskey{description} & \ttfamily desc\\ -\gloskey{descriptionplural} & \ttfamily descplural\\ -\gloskey{user1} & \ttfamily useri\\ -\gloskey{user2} & \ttfamily userii\\ -\gloskey{user3} & \ttfamily useriii\\ -\gloskey{user4} & \ttfamily useriv\\ -\gloskey{user5} & \ttfamily userv\\ -\gloskey{user6} & \ttfamily uservi\\ -\gloskey{longplural} & \ttfamily longpl\\ -\gloskey{shortplural} & \ttfamily shortpl +\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 -\cs{glssetexpandfield} or \cs{glssetnoexpandfield} are governed by -\begin{definition}[\DescribeMacro\glsexpandfields] -\cs{glsexpandfields} -\end{definition} +\gls{glssetexpandfield} or \gls{glssetnoexpandfield} are governed by +\cmddef{glsexpandfields} and -\begin{definition}[\DescribeMacro\glsnoexpandfields] -\cs{glsnoexpandfields} -\end{definition} +\cmddef{glsnoexpandfields} If your entries contain any fragile commands, I recommend you switch -off expansion via \cs{glsnoexpandfields}. (This should be used +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} -As from version 1.17, it is possible to specify sub-entries. These -may be used to order the glossary into categories, in which case the -sub-entry will have a different name to its parent entry, or it may -be used to distinguish different definitions for the same word, in -which case the sub-entries will have the same name as the parent -entry. Note that not all glossary styles support hierarchical -entries and may display all the entries in a flat format. Of the -styles that support sub-entries, some display the sub-entry's name -whilst others don't. Therefore you need to ensure that you use a -suitable style. (See \sectionref{sec:styles} for a list of predefined -styles.) As from version 3.0, level~1 sub-entries are automatically -numbered in the predefined styles if you use the -\pkgopt{subentrycounter} package option (see +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 entry will automatically be added to the -glossary if any of its child entries are used in the document. -If the parent entry is not referenced in the document, it will not -have a \gls{numberlist}. Note also that \gls{makeindex} has a -restriction on the maximum sub-entry depth. +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{Hierarchical Categories} +\subsection{Hierarchy} \label{sec:hierarchical} -To arrange a glossary with hierarchical categories, you need to -first define the category and then define the sub-entries using the -relevant category entry as the value of the \gloskey{parent} key. - -\begin{example}{Hierarchical Categories---Greek and Roman +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 glossary of mathematical symbols that +Suppose I want a \idx{glossary} of mathematical symbols that are divided into Greek letters and Roman letters. Then I can define -the categories as follows: -\begin{verbatim} -\newglossaryentry{greekletter}{name={Greek letters}, -description={\nopostdesc}} - -\newglossaryentry{romanletter}{name={Roman letters}, -description={\nopostdesc}} -\end{verbatim} - -Note that in this example, the category entries don't need a -description so I have set the descriptions to \ics{nopostdesc}. +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 sub-entries as follows: -\begin{verbatim} -\newglossaryentry{pi}{name={\ensuremath{\pi}},sort={pi}, -description={ratio of the circumference of a circle to +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}, -parent=greekletter} - -\newglossaryentry{C}{name={\ensuremath{C}},sort={C}, -description={Euler's constant}, -parent=romanletter} -\end{verbatim} +\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} +\subsection{\Glsfmtplural{homograph}} \label{sec:homographs} -Sub-entries that have the same name as the parent entry, don't need -to have the \gloskey{name} key. For example, the word \qt{glossary} +\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{verbatim} -\newglossaryentry{glossary}{name=glossary, -description={\nopostdesc}, -plural={glossaries}} -\end{verbatim} -Again, the parent entry has no description, so the description -terminator needs to be suppressed using \ics{nopostdesc}. - -Now define the two different meanings of the word: -\begin{verbatim} -\newglossaryentry{glossarylist}{ -description={list of technical words}, -sort={1}, -parent={glossary}} - -\newglossaryentry{glossarycol}{ -description={collection of glosses}, -sort={2}, -parent={glossary}} -\end{verbatim} -Note that if I reference the parent entry, the location will be -added to the parent's \gls{numberlist}, whereas if I reference any -of the child entries, the location will be added to the child -entry's number list. Note also that since the sub-entries have the -same name, the \gloskey{sort} key is required unless you are using -the \pkgopt[use]{sort} or \pkgopt[def]{sort} package options (see -\sectionref{sec:pkgopts-sort}). You -can use the \pkgopt{subentrycounter} package option to automatically -number the first-level child entries. See -\sectionref{sec:pkgopts-printglos} for further details. +\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 sub-entries +not required for the child entries. However, if the \idxpl{sub-entry} have different plurals, they will need to be specified. For example: -\begin{verbatim} -\newglossaryentry{bravo}{name={bravo}, -description={\nopostdesc}} - -\newglossaryentry{bravocry}{description={cry of approval +\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)}, -sort={1}, -plural={bravos}, -parent=bravo} - -\newglossaryentry{bravoruffian}{description={hired +\gloskeyval{sort}{1}, +\gloskeyval{plural}{bravos}, +\gloskeyval{parent}{bravo}} +\codepar +\gls{newglossaryentry}\marg{bravoruffian}\marg{\gloskeyval{description}{hired ruffian or killer (pl.\ bravoes)}, -sort={2}, -plural={bravoes}, -parent=bravo} -\end{verbatim} - +\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 glossary entry definitions in another +You can store all your \idx{glossaryentry} definitions in another file and use: -\begin{definition}[\DescribeMacro{\loadglsentries}] -\cs{loadglsentries}\oarg{type}\marg{filename} -\end{definition} +\cmddef{loadglsentries} where \meta{filename} is the name of the file containing all the -\ics{newglossaryentry} or \ics{longnewglossaryentry} commands. -The optional argument -\meta{type} is the name of the glossary to which those entries -should belong, for those entries where the \gloskey{type} key has -been omitted (or, more specifically, for those entries whose -type has been specified by \ics{glsdefaulttype}, which is what -\ics{newglossaryentry} uses by default). - -This is a~preamble-only command. You may also use \ics{input} to load -the file but don't use \ics{include}. If you find that your file is +\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+{documentpreamble}-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 -\gls{bib2gls} and use an application such as JabRef to manage the +\app{bib2gls} and use an application such as JabRef to manage the entry definitions. \begin{important} -If you want to use \ics{AtBeginDocument} to \cs{input} all your entries -automatically at the start of the document, add the -\cs{AtBeginDocument} command \emph{before} you load the +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 -\filetype{glsdefs} file and any associated problems that are caused +\ext+{glsdefs} file and any associated problems that are caused by defining commands in the \env{document} environment. -(See \sectionref{sec:docdefs}.) +(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 \texttt{myentries.tex} which contains: -\begin{verbatim} -\newglossaryentry{perl}{type=main, -name={Perl}, -description={A scripting language}} - -\newglossaryentry{tex}{name={\TeX}, -description={A typesetting language},sort={TeX}} - -\newglossaryentry{html}{type=\glsdefaulttype, -name={html}, -description={A mark up language}} -\end{verbatim} -and suppose in my document preamble I use the command: -\begin{verbatim} -\loadglsentries[languages]{myentries} -\end{verbatim} -then this will add the entries \texttt{tex} and \texttt{html} -to the glossary whose type is given by \texttt{languages}, but -the entry \texttt{perl} will be added to the main glossary, since -it explicitly sets the type to \texttt{main}. +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{documentpreamble} 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} -\importantpar -Note: if you use \ics{newacronym} (see \sectionref{sec:acronyms}) the type is set as -\verb|type=\acronymtype| unless you explicitly override it. For -example, if my file \texttt{myacronyms.tex} contains: -\begin{verbatim} -\newacronym{aca}{aca}{a contrived acronym} -\end{verbatim} -then (supposing I have defined a new glossary type called -\texttt{altacronym}) -\begin{verbatim} -\loadglsentries[altacronym]{myacronyms} -\end{verbatim} -will add \texttt{aca} to the glossary type \texttt{acronym}, if the -package option \pkgopt{acronym} has been specified, or will add -\texttt{aca} to the glossary type \texttt{altacronym}, if the -package option \pkgopt{acronym} is not specified.\footnote{This is -because \ics{acronymtype} is set to \ics{glsdefaulttype} if the -\pkgopt{acronym} package option is not used.} - -If you have used the \pkgopt{acronym} package option, -there are two possible solutions to this problem: +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 \texttt{myacronyms.tex} so that entries are defined in +\item Change \filefmt{myacronyms.tex} so that entries are defined in the form: -\begin{verbatim} -\newacronym[type=\glsdefaulttype]{aca}{aca}{a +\begin{codebox} +\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}}}\marg{aca}\marg{aca}\marg{a contrived acronym} -\end{verbatim} +\end{codebox} and do: -\begin{verbatim} -\loadglsentries[altacronym]{myacronyms} -\end{verbatim} - -\item Temporarily change \cs{acronymtype} to the target glossary: -\begin{verbatim} -\let\orgacronymtype\acronymtype -\renewcommand{\acronymtype}{altacronym} -\loadglsentries{myacronyms} -\let\acronymtype\orgacronymtype -\end{verbatim} +\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 used -in the text will appear in the relevant glossaries. -Note also that \cs{loadglsentries} may only be used in the -preamble. - -Remember that you can use \ics{provideglossaryentry} rather than -\ics{newglossaryentry}. Suppose you want to maintain a large database -of acronyms or terms that you're likely to use in your documents, -but you may want to use a modified version of some of those entries. +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{documentpreamble}. + +\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 entries using -\cs{provideglossaryentry} in your database file, you can override -the definition by simply using \cs{newglossaryentry} before loading +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, -\texttt{terms.tex}) contains: -\begin{verbatim} -\provideglossaryentry{mallard}{name=mallard, - description={a type of duck}} -\end{verbatim} +\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{verbatim} -\usepackage{glossaries} -\makeglossaries - -\newglossaryentry{mallard}{name=mallard, - description={a dabbling duck where the male has a green head}} - -\loadglsentries{terms} -\end{verbatim} -Now the \texttt{mallard} definition in the \texttt{terms.tex} file +\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} -As from version~3.02, you can move an entry from one glossary to -another using: -\begin{definition}[\DescribeMacro{\glsmoveentry}] -\cs{glsmoveentry}\marg{label}\marg{target glossary label} -\end{definition} -where \meta{label} is the unique label identifying the required -entry and \meta{target glossary label} is the unique label -identifying the glossary in which to put the entry. +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 glossary. If you want to move an entry to a glossary -that's skipped by \ics{printglossaries}, then define an ignored -glossary with \ics{newignoredglossary}. (See -\sectionref{sec:newglossary}.) +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 -glossary from its parent or children. +\idx{glossary} from its parent or children. \end{important} \section{Drawbacks With Defining Entries in the Document Environment} \label{sec:docdefs} -Originally, \ics{newglossaryentry} (and \ics{newacronym}) could only be -used in the preamble. I reluctantly removed this restriction in version 1.13, -but there are issues with defining commands in the \env{document} -environment instead of the preamble, which is why the restriction is -maintained for newer commands. This restriction is also reimposed -for \cs{newglossaryentry} by the new \opt1. (The -\gls{glossaries-extra} package automatically reimposes this restriction for -\optsand23 but provides a package option to allow document -definitions if necessary.) +Originally, \gls{newglossaryentry} (and \gls{newacronym}) could only +be used in the \idx+{documentpreamble}. 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{documentpreamble}, 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{documentpreamble}-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{documentpreamble}-only command. +\end{bib2gls} \subsection{Technical Issues} \label{sec:techissues} \begin{enumerate} - \item If you define an entry mid-way through your document, but + \item If you define an \idx{entry} mid-way through your document, but subsequently shuffle sections around, you could end up using an -entry before it has been defined. - - \item Entry information is required when displaying the glossary. -If this occurs at the start of the document, but the entries aren't -defined until later, then the entry details are -being looked up before the entry has been defined. This means that -it's not possible to display the content of the glossary unless the -entry definitions are saved on the previous \LaTeX\ run and can be +\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 \cs{label} and \cs{ref} work). +(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 will be a~problem if those characters have -a~special significance when defining glossary entries. -These characters include the double-quote \verb|"| character, the -exclamation mark \texttt{!} character, the question mark \verb|?| -character, and the pipe \verb"|" character. They -must not be active when defining a~glossary entry where they occur +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 \texttt{,} character and the equals \texttt{=} character +the comma (\sym{comma}) character and the equals (\sym{equals}) character should not be active when using commands that have -\meta{key}=\meta{value} arguments. +\keyval\ arguments. \end{enumerate} To overcome the first two problems, as from version 4.0 the -\styfmt{glossaries} package modifies the definition of -\cs{newglossaryentry} at the beginning of the \env{document} +\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 -(\cs{jobname}\texttt{.}\filetype{glsdefs}) which is then read in at the start +(\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 glossary, even if the glossary occurs at the +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 \cs{printglossary} (if it occurs at the start of the -document); this method requires an extra \cs{newwrite}, which may +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 multiple define the same entry label. +attempt to multiply define the same \idx{entry} label. -The \gls{glossaries-extra} package provides a setting (but only for -\optsand23) that allows \cs{newglossaryentry} to occur in the -document environment but doesn't create the \filetype{glsdefs} +The \sty{glossaries-extra} package provides a setting (but not for +\optionsor{noidx,b2g}) 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 glossaries before all the entries have been -defined (so it's all right if all the glossaries are at the end of +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). \subsection{Good Practice Issues} \label{sec:goodpractice} -The above section covers technical issues that can cause your document to have -compilation errors or produce incorrect output. This section -focuses on good writing practice. The main reason cited by users -wanting to define entries within the \env{document} environment rather -than in the preamble 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. +\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{documentpreamble} 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 entry +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 @@ -6967,1833 +19021,1625 @@ definition. \chapter{Referencing Entries in the Document} \label{sec:usingentries} -Once you have defined a glossary entry using a command like -\ics{newglossaryentry} (\sectionref{sec:newglosentry}) or -\ics{newacronym} (\sectionref{sec:acronyms}), you can refer to that -entry in the document with one of the provided commands that are +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 \gls{glossaries-extra}.) The text produced at that point -in the document is determined by the command and can also be +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 -\glsdisp{firstuseflag}{marked as used}. +\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 PDF bookmarks. +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 index the -entry (so that it's added to the document) are described in +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 -used (the \cs{gls}-like commands, \sectionref{sec:gls-like}) and those that don't -(the \cs{glstext}-like commands, \sectionref{sec:glstext-like}). - -\item Those that display text in the document without indexing or applying any -additional formatting (\sectionref{sec:glsnolink}). +\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 -\cs{newacronym} that are described in \sectionref{sec:longshortfull}. +\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 \gls{linktext} -(even if there are no hyperlinks). These commands also add a line to -an external file that is used to generate the relevant entry in the -glossary. This information includes an associated location that is -added to the \gls{numberlist} for that entry. By default, the -location refers to the page number. For further information on -number lists, see \sectionref{sec:numberlists}. These external -files need to be post-processed by \gls{makeindex} or \gls{xindy} -unless you have chosen \optsor14. If you don't use -\ics{makeglossaries} these external files won't be created. -(\optsand14 write the information to the \filetype{aux} file.) - -Note that repeated use of these commands for the same entry can -cause the \gls{numberlist} to become quite long, which may not be +\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 supplemental \gls{glossaries-extra} package, which -provides a means to suppress the automated indexing of the commands listed -in this chapter. +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 or any other command that has a moving argument. +commands, such as \gls+{chapter} or \gls+{caption}. -Aside from problems with expansion issues, PDF bookmarks and -possible nested hyperlinks in the table of contents (or list of +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 \firstuseflag\ unset when they appear in the table -of contents (or list of whatever). +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 -\styfmt{glossaries} package in conjunction with the \sty{hyperref} +\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 \ics{glsentrytext} \emph{but -not} the non-expandable -case changing versions like \ics{Glsentrytext}). Alternatively, provide an +\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 \ics{texorpdfstring}. Examples: -\begin{verbatim} -\chapter{An overview of \glsentrytext{perl}} -\chapter[An overview of Perl]{An overview of \gls{perl}} -\chapter{An overview of \texorpdfstring{\gls{perl}}{Perl}} -\end{verbatim} +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} -If you want to retain the formatting that's available through -commands like \cs{acrshort} (for example, if you are using one of -the small caps styles), then you might want to consider the -\gls{glossaries-extra} package which provides commands -for this purpose. +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 \gls{linktext} to produce a hyperlink to the -corresponding entry details in the glossary, you should load the -\sty{hyperref} package \emph{before} the \styfmt{glossaries} -package. That's what I've done in this document, so if you see a -hyperlinked term, such as \gls{linktext}, you can click on the word +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 glossary. +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 DVI format of \LaTeX\ has limitations with the -hyperlinks that can cause a problem when used with the -\styfmt{glossaries} package. Firstly, the DVI format can't break a -hyperlink across a line whereas PDF\LaTeX\ can. This means that long -glossary entries (for example, the full form of an acronym) won't be -able to break across a line with the DVI format. Secondly, the DVI -format doesn't correctly size hyperlinks in subscripts or +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 DVI format, it won't +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 DVI format not of the \sty{glossaries} +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 glossaries to have -hyperlinks, but not for other glossaries. In this case, you can use the -package option \pkgopt{nohypertypes} to identify the glossary lists -that shouldn't have hyperlinked \gls{linktext}. See +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 \gls{linktext} is displayed depends on -\begin{definition}[\DescribeMacro{\glstextformat}] -\cs{glstextformat}\marg{text} -\end{definition} -For example, to make all \gls{linktext} appear in a sans-serif +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{verbatim} -\renewcommand*{\glstextformat}[1]{\textsf{#1}} -\end{verbatim} -Further customisation can be done via \ics{defglsentryfmt} or by -redefining \ics{glsentryfmt}. See \sectionref{sec:glsdisplay} for +\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 -\firstuseflag. Some of the commands described in this chapter +\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 \glslike\ commands and are described in +are the \idx+{glslike} commands and are described in \sectionref{sec:gls-like}. The commands that don't reference or change -the \firstuseflag\ are \glstextlike\ commands and are described +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 \firstuseflag\ without referencing -the entries. - -The \glslike\ and \glstextlike\ commands all take a first -optional argument that is a comma-separated list of -\meta{key}=\meta{value} options, described below. They also have a -star-variant, which inserts \texttt{hyper=false} at the start of the -list of options and a plus-variant, which inserts -\texttt{hyper=true} at the start of the list of options. For example -\verb|\gls*{sample}| is the same as \verb|\gls[hyper=false]{sample}| -and \verb|\gls+{sample}| is the same as -\verb|\gls[hyper=true]{sample}|, whereas just \verb|\gls{sample}| -will use the default hyperlink setting which depends on a number of -factors (such as whether the entry is in a glossary that has been -identified in the \pkgopt{nohypertypes} list). You can override the -\gloskey[glslink]{hyper} key in the variant's optional argument, for -example, \verb|\gls*[hyper=true]{sample}| but this creates -redundancy and is best avoided. The \gls{glossaries-extra} package -provides the option to add a third custom variant. +(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 -\cs{glslink}\marg{label}\texttt{\{\cs{gls}\marg{label2}\}} +\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 -\cs{glssymbol}.) -\end{important} - -The keys listed below are available for the optional first argument. -The \gls{glossaries-extra} package provides additional keys. -(See the \gls*{glossaries-extra} manual for further details.) -\begin{description} -\item[{\gloskey[glslink]{hyper}}] This is a boolean key which can -be used to enable\slash disable the hyperlink to the relevant entry -in the glossary. If this key is omitted, the value is determined by current -settings, as indicated above. For example, when used with a \glslike\ command, if this is the first -use and the \pkgopt[false]{hyperfirst} package option has been used, -then the default value is \texttt{hyper=false}. The hyperlink can be -forced on using \texttt{hyper=true} unless the hyperlinks have been -suppressed using \ics{glsdisablehyper}. You must load the -\sty{hyperref} package before the \sty{glossaries} package to -ensure the hyperlinks work. - -\item[{\gloskey[glslink]{format}}] This specifies how to format the -associated location number for this entry in the glossary. This -value is equivalent to the \gls{makeindex} encap value, and (as -with \ics{index}) the value needs to be the name of a command -\emph{without} the initial backslash. As with \ics{index}, the -characters \verb"(" and \verb")" can also be used to specify the -beginning and ending of a number range and they must be in matching -pairs. (For example, \verb|\gls[format={(}]{sample}| on one page -to start the range and later \verb|\gls[format={)}]{sample}| to close -the range.) Again as with \ics{index}, the command should be the -name of a command which takes an argument (which will be the -associated location). Be careful not to use a declaration (such as -\texttt{bfseries}) instead of a text block command (such as -\texttt{textbf}) as the effect is not guaranteed to be localised. If -you want to apply more than one style to a given entry (e.g.\ -\textbf{bold} and \emph{italic}) you will need to create a command -that applies both formats, e.g.\ -\begin{verbatim} -\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}} -\end{verbatim} -and use that command. - -In this document, the standard formats refer to the standard text -block commands such as \ics{textbf} or \ics{emph} or any of the -commands listed in \tableref{tab:hyperxx}. You can combine a range -and format using \verb|(|\meta{format} to start the range and -\verb|)|\meta{format} to end the range. The \meta{format} part must -match. For example, \verb|format={(emph}| and \verb|format={)emph}|. - -\begin{important} -If you use \gls{xindy} instead of \gls{makeindex}, you -must specify any non-standard formats that you want to use -with the \gloskey[glslink]{format} key using -\ics{GlsAddXdyAttribute}\marg{name}. So if you use -\gls*{xindy} with the above example, you would need to add: -\begin{verbatim} -\GlsAddXdyAttribute{textbfem} -\end{verbatim} -See \sectionref{sec:xindy} for further details. -\end{important} - -If you are using hyperlinks and you want to change the font of the -hyperlinked location, don't use \ics{hyperpage} (provided by the -\sty{hyperref} package) as the locations may not refer to a page -number. Instead, the \styfmt{glossaries} package provides number -formats listed in \tableref{tab:hyperxx}. These commands are -designed to work with the particular location formats created by -\gls{makeindex} and \gls{xindy} and shouldn't be used in other -contexts. - -\begin{table}[htbp] -\caption{Predefined Hyperlinked Location Formats} -\label{tab:hyperxx} -\centering -\vskip\baselineskip -\begin{tabular}{ll} -\locfmt{hyperrm} & serif hyperlink\\ -\locfmt{hypersf} & sans-serif hyperlink\\ -\locfmt{hypertt} & monospaced hyperlink\\ -\locfmt{hyperbf} & bold hyperlink\\ -\locfmt{hypermd} & medium weight hyperlink\\ -\locfmt{hyperit} & italic hyperlink\\ -\locfmt{hypersl} & slanted hyperlink\\ -\locfmt{hyperup} & upright hyperlink\\ -\locfmt{hypersc} & small caps hyperlink\\ -\locfmt{hyperemph} & emphasized hyperlink -\end{tabular} -\par -\end{table} - -Note that if the \ics{hyperlink} command hasn't been defined, the -\texttt{hyper}\meta{xx} formats are equivalent to the analogous -\texttt{text}\meta{xx} font commands (and \texttt{hyperemph} is -equivalent to \texttt{emph}). If you want to make a new format, you -will need to define a command which takes one argument and use that. -For example, if you want the location number to be in a bold -sans-serif font, you can define a command called, say, -\ics{hyperbsf}: -\begin{verbatim} -\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}} -\end{verbatim} -and then use \texttt{hyperbsf} as the value for the \gloskey[glslink]{format} -key.\footnote{See also \ifpdf section~\ref*{sec:code:printglos} \fi -\qt{Displaying the glossary} in the documented code, -\texttt{glossaries-code.pdf}.} - -\begin{important} -When defining a custom location format command that uses one of the -\csmeta{hyper}{xx}{} commands, make sure that the argument of -\csmeta{hyper}{xx}{} is just the location. Any formatting must be -outside of \csmeta{hyper}{xx}{} (as in the above \cs{hyperbfsf} -example). -\end{important} - -Remember that if you use \gls{xindy}, you -will need to add this to the list of location \ixindyattrs attributes: -\begin{verbatim} -\GlsAddXdyAttribute{hyperbsf} -\end{verbatim} - -\item[{\gloskey[glslink]{counter}}] This specifies which counter -to use for this location. This overrides the default counter -used by this entry. (See also \sectionref{sec:numberlists}.) - -\item[{\gloskey[glslink]{local}}] This is a boolean key that only -makes a difference when used with \glslike\ commands that change the -entry's \gls{firstuseflag}. If \texttt{local=true}, the change to -the \gls*{firstuseflag} will be localised to the current scope. The -default is \texttt{local=false}. - -\item[{\xtrgloskey[glslink]{noindex}}] This is a boolean key that -suppresses the indexing. Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{hyperoutside}}] This is a boolean key that -determines whether to put the hyperlink outside of \ics{glstextformat}. -Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{wrgloss}}] This key determines -whether to index before (\texttt{wrgloss\dequals before}) or after -(\texttt{wrgloss\dequals after}) the \gls{linktext}. -Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{textformat}}] This key identifies the -name of the control sequence to encapsulate the \gls{linktext} -instead of the default \ics{glstextformat}. -Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{prefix}}] This key locally redefines -\ics{glolinkprefix} to the given value. -Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{thevalue}}] This key explicitly sets the -location. -Only available with \gls{glossaries-extra}. - -\item[{\xtrgloskey[glslink]{theHvalue}}] This key explicitly sets the -hyperlink location. -Only available with \gls{glossaries-extra}. - -\end{description} - -\begin{important} -The \gls{linktext} isn't scoped by default with just the base -\styfmt{glossaries} package. Any unscoped -declarations in the \gls{linktext} may affect subsequent text. +\gls{glssymbol}.) The \sty{glossaries-extra} package provides +\gls{glsxtrp} to use instead, which helps to mitigate against +nesting problems. \end{important} -\subsection{The \cs{gls}-Like Commands (First Use Flag Queried)} +\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 commands that unset (mark as used) the \firstuseflag\ on -completion, and in most cases they use the current state of the flag -to determine the text to be displayed. As described above, these -commands all have a star-variant (\texttt{hyper=false}) and -a plus-variant (\texttt{hyper=true}) and have an -optional first argument that is a \meta{key}=\meta{value} list. -These commands use \ics{glsentryfmt} or the equivalent definition provided by -\ics{defglsentryfmt} to determine the automatically generated text -and its format (see \sectionref{sec:glsdisplay}). - -Apart from \ics{glsdisp}, the commands described in this section +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 set of -braces \verb|{}| immediately before the opening square bracket to +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{verbatim} -\gls{sample} {}[Editor's comment] -\end{verbatim} +\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 \glslike\ or \glstextlike\ commands in the +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 first use flag +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 \envfmt{tabularx} environment provided by \sty{tabularx}. -The \styfmt{glossaries} package automatically deals with this issue -in \sty{amsmath}'s \envfmt{align} environment. You can apply a patch -to \sty{tabularx} by placing the following command (new to v4.28) in -the preamble: -\begin{definition}[\DescribeMacro\glspatchtabularx] -\cs{glspatchtabularx} -\end{definition} +\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 following command in the +\idx{documentpreamble}: +\cmddef{glspatchtabularx} 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. -\begin{definition}[\DescribeMacro{\gls}] -\cs{gls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command typically determines the \gls{linktext} from the values +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 -entry was defined using \ics{newglossaryentry}. However, if the -entry was defined using \ics{newacronym} and \ics{setacronymstyle} was -used, then the \gls*{linktext} will usually be determined from the \gloskey{long} or -\gloskey{short} keys. - -There are two upper case variants: -\begin{definition}[\DescribeMacro{\Gls}] -\cs{Gls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} +\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 -\begin{definition}[\DescribeMacro{\GLS}] -\cs{GLS}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -which make the first letter of the link text or all the link text -upper case, respectively. For the former, the uppercasing of the -first letter is performed by \ics{makefirstuc}. - -\begin{important} -The first letter uppercasing command \cs{makefirstuc} has -limitations which must be taken into account if you use \cs{Gls} or -any of the other commands that convert the first letter to -uppercase. -\end{important} -The upper casing is performed as follows: -\begin{itemize} -\item If the first thing in the \gls{linktext} is a command follow -by a group, the upper casing is performed on the first object of the -group. For example, if an entry has been defined as -\begin{verbatim} -\newglossaryentry{sample}{ - name={\emph{sample} phrase}, - sort={sample phrase}, - description={an example}} -\end{verbatim} -Then \cs{Gls}\verb|{sample}| will set the \gls{linktext} -to\footnote{I've used \cs{MakeUppercase} in all the examples for clarity, but it -will actually use \cs{mfirstucMakeUppercase}.} -\begin{verbatim} -\emph{\MakeUppercase sample} phrase -\end{verbatim} -which will appear as \emph{\MakeUppercase sample} phrase. - -\item If the first thing in the \gls{linktext} isn't a command or is -a command but isn't followed by a group, then the upper casing will -be performed on that first thing. For example, if an entry has been -defined as: -\begin{verbatim} -\newglossaryentry{sample}{ - name={\oe-ligature}, - sort={oe-ligature}, - description={an example} -} -\end{verbatim} -Then \cs{Gls}\verb|{sample}| will set the \gls{linktext} to -\begin{verbatim} -\MakeUppercase \oe-ligature -\end{verbatim} -which will appear as \MakeUppercase \oe-ligature. - -\item If you have \sty{mfirstuc} v2.01 or above, an extra case is -added. If the first thing is \cs{protect} it will be discarded and -the above rules will then be tried. - -\end{itemize} -(Note the use of the \gloskey{sort} key in the above examples.) - -There are hundreds of \LaTeX\ packages that altogether define -thousands of commands with various syntax and it's impossible for -\sty{mfirstuc} to take them all into account. The above rules are quite -simplistic and are designed for \gls{linktext} that starts with -a~text-block command (such as \cs{emph}) or a command that produces -a character (such as \cs{oe}). This means that if your \gls{linktext} -starts with something that doesn't adhere to \sty{mfirstuc}'s assumptions -then things are likely to go wrong. - -For example, starting with a math-shift symbol: -\begin{verbatim} -\newglossaryentry{sample}{ - name={$a$}, - sort={a}, - description={an example} -} -\end{verbatim} -This falls into case~2 above, so the \gls{linktext} will be set to -\begin{verbatim} -\MakeUppercase $a$ -\end{verbatim} -This attempts to uppercase the math-shift \verb|$|, which will go -wrong. In this case it's not appropriate to perform any -case-changing, but it may be that you want to use \cs{Gls} -programmatically without checking if the text contains any maths. -In this case, the simplest solution is to insert an empty brace at -the start: -\begin{verbatim} -\newglossaryentry{sample}{ - name={{}$a$}, - sort={a}, - description={an example} -} -\end{verbatim} -Now the \gls{linktext} will be set to -\begin{verbatim} -\MakeUppercase{}$a$ -\end{verbatim} -and the \cs{uppercase} becomes harmless. - -Another issue occurs when the \gls{linktext} starts with a command -followed by an argument (case~1) but the argument is a label, -identifier or something else that shouldn't have a case-change. -A common example is when the \gls{linktext} starts with one of the -commands described in this chapter. (But you haven't done that, have -you? What with the warning not to do it at the beginning of the chapter.) -Or when the \gls{linktext} starts with one of the non-linking -commands described in \sectionref{sec:glsnolink}. For example: -\begin{verbatim} -\newglossaryentry{sample}{name={sample},description={an example}} -\newglossaryentry{sample2}{ - name={\glsentrytext{sample} two}, - sort={sample two}, - description={another example} - } -\end{verbatim} -Now the \gls{linktext} will be set to: -\begin{verbatim} -\glsentrytext{\MakeUppercase sample} two -\end{verbatim} -This will generate an error because there's no entry with the label -\qt{\texttt{\cs{MakeUppercase} sample}}. The best solution here is to -write the term out in the \gloskey{text} field and use the command -in the \gloskey{name} field. If you don't use \cs{glsname} anywhere -in your document, you can use \cs{gls} in the \gloskey{name} field: -\begin{verbatim} -\newglossaryentry{sample}{name={sample},description={an example}} -\newglossaryentry{sample2}{ - name={\gls{sample} two}, - sort={sample two}, - text={sample two}, - description={another example} - } -\end{verbatim} - -If the \gls{linktext} starts with a command that has an optional -argument or with multiple arguments where the actual text isn't in -the first argument, then \cs{makefirstuc} will also fail. For -example: -\begin{verbatim} -\newglossaryentry{sample}{ - name={\textcolor{blue}{sample} phrase}, - sort={sample phrase}, - description={an example}} -\end{verbatim} -Now the \gls{linktext} will be set to: -\begin{verbatim} -\textcolor{\MakeUppercase blue}{sample} phrase -\end{verbatim} -This won't work because \verb|\MakeUppercase blue| isn't a recognised -colour name. In this case you will have to define a helper command where -the first argument is the text. For example: -\begin{verbatim} -\newglossaryentry{sample}{ -\newcommand*{\blue}[1]{\textcolor{blue}{#1}} - name={\blue{sample} phrase}, - sort={sample phrase}, - description={an example}} -\end{verbatim} -In fact, since the whole design ethos of \LaTeX\ is the separation -of content and style, it's better to use a semantic command. For -example: -\begin{verbatim} -\newglossaryentry{sample}{ -\newcommand*{\keyword}[1]{\textcolor{blue}{#1}} - name={\keyword{sample} phrase}, - sort={sample phrase}, - description={an example}} -\end{verbatim} -For further details see the \sty{mfirstuc} user manual. - -There are plural forms that are analogous to \cs{gls}: -\begin{definition}[\DescribeMacro{\glspl}] -\cs{glspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\Glspl}] -\cs{Glspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSpl}] -\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -These typically determine the link text from the \gloskey{plural} or -\gloskey{firstplural} keys supplied when the entry was -defined using \ics{newglossaryentry} or, if the entry is an -abbreviation and \cs{setacronymstyle} was used, from the \gloskey{longplural} or -\gloskey{shortplural} keys. +\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 glossary entries in math mode especially if you -are using \sty{hyperref} as it can affect the spacing of subscripts and -superscripts. For example, suppose you have defined the following +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{verbatim} -\newglossaryentry{Falpha}{name={F_\alpha}, -description=sample} -\end{verbatim} -and later you use it in math mode: -\begin{verbatim} -$\gls{Falpha}^2$ -\end{verbatim} +\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 hyperlink using +situation it's best to bring the superscript into the \idx+{hyperlink} using the final \meta{insert} optional argument: -\begin{verbatim} -$\gls{Falpha}[^2]$ -\end{verbatim} +\begin{codebox} +\$\gls{gls}\marg{Falpha}\oarg{\idx{sp}2}\$ +\end{codebox} \end{important} -\begin{definition}[\DescribeMacro{\glsdisp}] -\cs{glsdisp}\oarg{options}\marg{label}\marg{link text} -\end{definition} -This behaves in the same way as the above commands, except +\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. +\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 \glslike\ or \glstextlike\ commands in the -\meta{link text} argument of \cs{glsdisp}. +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 \cs{glstext}-Like Commands (First Use Flag Not Queried)} +\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 \firstuseflag. As described above, these commands all have a -star-variant (\texttt{hyper=false}) and a plus-variant -(\texttt{hyper=true}) and have an optional first argument -that is a \meta{key}=\meta{value} list. These commands also don't -use \ics{glsentryfmt} or the equivalent definition provided by -\ics{defglsentryfmt} (see \sectionref{sec:glsdisplay}). -Additional commands for abbreviations are described in -\sectionref{sec:acronyms}. - -Apart from \ics{glslink}, the commands described in this section +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}. +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. -\begin{definition}[\DescribeMacro{\glslink}] -\cs{glslink}\oarg{options}\marg{label}\marg{link text} -\end{definition} -This command explicitly sets the \gls{linktext} as given in the -final argument. +\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 \glslike\ or \glstextlike\ commands in the -argument of \cs{glslink}. By extension, this means that you can't -use them in the value of fields that are used to form -\gls{linktext}. +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} -\begin{definition}[\DescribeMacro{\glstext}] -\cs{glstext}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{text} key as the -\gls{linktext}. - -There are also analogous commands: -\begin{definition}[\DescribeMacro{\Glstext}] -\cs{Glstext}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLStext}] -\cs{GLStext}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -These convert the first character or all the characters to -uppercase, respectively. See the note on \cs{Gls} above for details -on the limitations of converting the first letter to upper case. - -There's no equivalent command for title-casing, but you -can use the more generic command \ics{glsentrytitlecase} -in combination with \cs{glslink}. For example: -\begin{verbatim} -\glslink{sample}{\glsentrytitlecase{sample}{text}} -\end{verbatim} +\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}.) -\begin{definition}[\DescribeMacro{\glsfirst}] -\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{first} key as the -\gls{linktext}. +\cmddef{glsfirst} +This command always uses the value of the \gloskey+{first} key as the +\idx{linktext}. -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsfirst}] -\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSfirst}] -\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +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 text produced by \ics{gls} (or \ics{glspl}) on -\firstuse\ as the \gls{linktext} used by \ics{gls} may be modified -through commands like \ics{defglsentry}. (Similarly, the value of the -\gloskey{text} and \gloskey{plural} keys don't necessarily match -the \gls*{linktext} used by \cs{gls} or \cs{glspl} on subsequent -use.) +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} -\begin{definition}[\DescribeMacro{\glsplural}] -\cs{glsplural}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{plural} key as the -\gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsplural}] -\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSplural}] -\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsfirstplural}] -\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{firstplural} key as the -\gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsfirstplural}] -\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSfirstplural}] -\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsname}] -\cs{glsname}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{name} key as the -\gls{linktext}. Note that this may be different from the values of +\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 \cs{glstext} or \cs{glsfirst} instead of \cs{glsname}. +to use \gls{glstext} or \gls{glsfirst} instead of \gls{glsname}, +unless you have a particular need for the actual name. -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsname}] -\cs{Glsname}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSname}] -\cs{GLSname}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \cs{Glsname} with acronyms. Instead, -consider using \cs{Acrlong}, \cs{Acrshort} or \cs{Acrfull}. +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} -\begin{definition}[\DescribeMacro{\glssymbol}] -\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{symbol} key as the -\gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glssymbol}] -\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSsymbol}] -\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsdesc}] -\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This command always uses the value of the \gloskey{description} key as the -\gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsdesc}] -\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSdesc}] -\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -If you want the title case version you can use -\begin{verbatim} -\glslink{sample}{\glsentrytitlecase{sample}{desc}} -\end{verbatim} - -\begin{definition}[\DescribeMacro{\glsuseri}] -\cs{glsuseri}\oarg{options}\marg{label}\oarg{insert} -\end{definition} +\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 \gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuseri}] -\cs{Glsuseri}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuseri}] -\cs{GLSuseri}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsuserii}] -\cs{glsuserii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuserii}] -\cs{Glsuserii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuserii}] -\cs{GLSuserii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsuseriii}] -\cs{glsuseriii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuseriii}] -\cs{Glsuseriii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuseriii}] -\cs{GLSuseriii}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsuseriv}] -\cs{glsuseriv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuseriv}] -\cs{Glsuseriv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuseriv}] -\cs{GLSuseriv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsuserv}] -\cs{glsuserv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \gls{linktext}. - -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuserv}] -\cs{Glsuserv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuserv}] -\cs{GLSuserv}\oarg{options}\marg{text}\oarg{insert} -\end{definition} - -\begin{definition}[\DescribeMacro{\glsuservi}] -\cs{glsuservi}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +\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 \gls{linktext}. +\gloskey+{user6} key as the \idx{linktext}. -There are also analogous uppercasing commands: -\begin{definition}[\DescribeMacro{\Glsuservi}] -\cs{Glsuservi}\oarg{options}\marg{text}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\GLSuservi}] -\cs{GLSuservi}\oarg{options}\marg{text}\oarg{insert} -\end{definition} +The \casechanging\ variants are: +\cmddef{Glsuservi} +(\idx{sentencecase}) and +\cmddef{GLSuservi} +(\idx{allcaps}). -\subsection{Changing the format of the link text} +\subsection{Changing the Format of the \glsfmttext{glslike} Link Text} \label{sec:glsdisplay} \begin{xtr} -The \gls{glossaries-extra} package provides ways of altering the -format according to the category. See the \gls{glossaries-extra} +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 format of the \gls{linktext} for the \glslike\ commands -is governed by\footnote{\ics{glsdisplayfirst} and \ics{glsdisplay} are now -deprecated. Backwards compatibility should be preserved but -you may need to use the \pkgopt{compatible-3.07} option}: -\begin{definition}[\DescribeMacro{\glsentryfmt}] -\cs{glsentryfmt} -\end{definition} -This may be redefined but if you only want the change the display style -for a given glossary, then you need to use -\begin{definition}[\DescribeMacro{\defglsentryfmt}] -\cs{defglsentryfmt}\oarg{type}\marg{definition} -\end{definition} -instead of redefining \cs{glsentryfmt}. The optional first argument -\meta{type} is the glossary type. This defaults to -\ics{glsdefaulttype} if omitted. The second argument is the -entry format definition. +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 \cs{glsentryfmt} is the default display format for -entries. Once the display format has been changed for an individual -glossary using \ics{defglsentryfmt}, redefining \cs{glsentryfmt} -won't have an effect on that glossary, you must instead use -\cs{defglsentryfmt} again. Note that glossaries that have -been identified as lists of acronyms (via the package option -\pkgopt{acronymlists} or the command \ics{DeclareAcronymList}, +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 -\cs{defglsentryfmt} to set their display style. +\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 the \meta{definition} argument of \cs{defglsentryfmt}, or if you -want to redefine \cs{glsentryfmt}, you may use the following -commands: - -\begin{definition}[\DescribeMacro{\glslabel}] -\cs{glslabel} -\end{definition} -This is the label of the entry being referenced. As from version -4.08, you can also access the glossary entry type using: -\begin{definition}[\DescribeMacro{\glstype}] -\cs{glstype} -\end{definition} -This is defined using \ics{edef} so the replacement text is the -actual glossary type rather than \verb|\glsentrytype{\glslabel}|. - -\begin{definition}[\DescribeMacro{\glscustomtext}] -\cs{glscustomtext} -\end{definition} -This is the custom text supplied in \cs{glsdisp}. It's always empty -for \ics{gls}, \ics{glspl} and their upper case variants. (You can -use \sty{etoolbox}'s \cs{ifdefempty} to determine if -\cs{glscustomtext} is empty.) - -\begin{definition}[\DescribeMacro{\glsinsert}] -\cs{glsinsert} -\end{definition} -The custom text supplied in the final optional argument to \cs{gls}, -\cs{glspl} and their upper case variants. - -\begin{definition}[\DescribeMacro{\glsifplural}] -\cs{glsifplural}\marg{true text}\marg{false text} -\end{definition} -If \cs{glspl}, \cs{Glspl} or \cs{GLSpl} was used, this command does -\meta{true text} otherwise it does \meta{false text}. - -\begin{definition}[\DescribeMacro{\glscapscase}] -\cs{glscapscase}\marg{no case}\marg{first uc}\marg{all caps} -\end{definition} -If \cs{gls}, \cs{glspl} or \cs{glsdisp} were used, this does \meta{no -case}. If \cs{Gls} or \cs{Glspl} were used, this does \meta{first -uc}. If \cs{GLS} or \cs{GLSpl} were used, this does \meta{all caps}. - -\begin{definition}[\DescribeMacro\glsifhyperon] -\cs{glsifhyperon}\marg{hyper true}\marg{hyper false} -\end{definition} -This will do \meta{hyper true} if the hyperlinks are on for the -current reference, otherwise it will do \meta{hyper false}. The -hyperlink may be off even if it wasn't explicitly switched off with -the \gloskey[glslink]{hyper} key or the use of a starred command. -It may be off because the \sty{hyperref} package hasn't been loaded -or because \ics{glsdisablehyper} has been used or because the entry -is in a glossary type that's had the hyperlinks switched off (using -\pkgopt{nohypertypes}) or because it's the \firstuse\ and the -hyperlinks have been suppressed on first use. +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} -The \cs{glsifhyperon} command should be used instead of -\ics{glsifhyper}, which is now deprecated (and no longer documented). +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} -If you want to know if the command used to reference -this entry was used with the star or plus variant, you can use: -\begin{definition}[\DescribeMacro\glslinkvar] -\cs{glslinkvar}\marg{unmodified}\marg{star}\marg{plus} -\end{definition} +\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} if the starred version was used, or -will do \meta{plus} if the plus 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 -\gloskey[glslink]{hyper} key was used to override the default +\glsopt{hyper} key was used to override the default setting, so this command shouldn't be used to guess whether or not -the hyperlink is on for this reference. +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}. -Note that you can also use commands such as \ics{ifglsused} within -the definition of \cs{glsentryfmt} (see \sectionref{sec:glsunset}). +\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 \ics{glslabel}, \ics{glstype}, \ics{glsifplural}, -\ics{glscapscase}, \ics{glsinsert} and \ics{glscustomtext} are -typically updated at the start of the \glslike\ and \glstextlike\ +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 \ics{glspostlinkhook} and \ics{glslinkpostsetkeys}. +such as \gls{glspostlinkhook} and \gls{glslinkpostsetkeys}. -\begin{important} -This means that using commands like \ics{gls} within the fields -that are accessed using the \glslike\ or \glstextlike\ commands +\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 entry formatting -performed by \cs{glsentryfmt} and related commands isn't scoped -(otherwise if would cause problems for \cs{glspostlinkhook} which -may need to look ahead as well as look behind). -This means that any nested commands will, at the very least, change -the label stored in \cs{glslabel}. -\end{important} - -If you only want to make minor modifications to \cs{glsentryfmt}, -you can use -\begin{definition}[\DescribeMacro{\glsgenentryfmt}] -\cs{glsgenentryfmt} -\end{definition} +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. - -Alternatively, if you want to change the entry format for abbreviations -(defined via \ics{newacronym}) you can use: -\begin{definition}[\DescribeMacro{\glsgenacfmt}] -\cs{glsgenacfmt} -\end{definition} +(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 first use singular text is obtained via: -\begin{definition}[\DescribeMacro{\genacrfullformat}] -\cs{genacrfullformat}\marg{label}\marg{insert} -\end{definition} -instead of from the \gloskey{first} key, and the first use plural +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: -\begin{definition}[\DescribeMacro{\genplacrfullformat}] -\cs{genplacrfullformat}\marg{label}\marg{insert} -\end{definition} +\cmddef{genplacrfullformat} instead of from the \gloskey{firstplural} key. -In both cases, \meta{label} is the entry's label and \meta{insert} +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 \ics{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 +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 \ics{firstacronymfont}. There are also first letter upper case +of \gls{firstacronymfont}. There are also \idx{sentencecase} versions: -\begin{definition}[\DescribeMacro{\Genacrfullformat}] -\cs{Genacrfullformat}\marg{label}\marg{insert} -\end{definition} +\cmddef{Genacrfullformat} and -\begin{definition}[\DescribeMacro{\Genplacrfullformat}] -\cs{Genplacrfullformat}\marg{label}\marg{insert} -\end{definition} -By default these perform a protected expansion on their no-case-change -equivalents and then use \ics{makefirstuc} to convert the first -character to upper case. If there are issues caused by this -expansion, you will need to redefine those commands to explicitly -use commands like \ics{Glsentrylong} (which is what the predefined -acronym styles, such as \acrstyle{long-short}, do). Otherwise, you -only need to redefine \ics{genacrfullformat} and -\ics{genplacrfullformat} to change the behaviour of -\ics{glsgenacfmt}. See \sectionref{sec:acronyms} for further details -on changing the style of acronyms. +\cmddef{Genplacrfullformat} +See \sectionref{sec:acronyms} for details on changing the style of \idxpl{acronym}. \begin{important} -Note that \cs{glsentryfmt} (or the formatting given by \cs{defglsentryfmt}) -is not used by the \glstextlike\ commands. +Note that \gls{glsentryfmt} (or the formatting given by \gls{defglsentryfmt}) +is not used by the \gls{glstextlike} commands. \end{important} -As from version 4.16, both the \glslike\ and \glstextlike\ commands -use -\begin{definition}[\DescribeMacro\glslinkpostsetkeys] -\cs{glslinkpostsetkeys} -\end{definition} -after the \meta{options} are set. This macro does nothing by default -but can be redefined. (For example, to switch off the hyperlink -under certain conditions.) This version also introduces -\begin{definition}[\DescribeMacro\glspostlinkhook] -\cs{glspostlinkhook} -\end{definition} -which is done after the link text has been displayed and also -\emph{after} the \firstuseflag\ has been unset (see -example~\ref{ex:dotabbr}). - \begin{example}{Custom Entry Display in Text}{ex:customfmt} -Suppose you want a glossary of measurements and +Suppose you want a \idx{glossary} of measurements and units, you can use the \gloskey{symbol} key to store the unit: -\begin{verbatim} -\newglossaryentry{distance}{name=distance, -description={The length between two points}, -symbol={km}} -\end{verbatim} -and now suppose you want \verb|\gls{distance}| to produce -\qt{distance (km)} on \firstuse, then you can redefine -\ics{glsentryfmt} as follows: -\begin{verbatim} -\renewcommand*{\glsentryfmt}{% - \glsgenentryfmt - \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}% +\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{verbatim} - -(Note that I've used \ics{glsentrysymbol} rather than \ics{glssymbol} -to avoid nested hyperlinks.) - -Note also that all of the \gls{linktext} will be formatted according -to \ics{glstextformat} (described earlier). So if you do, say: -\begin{verbatim} -\renewcommand{\glstextformat}[1]{\textbf{#1}} -\renewcommand*{\glsentryfmt}{% - \glsgenentryfmt - \ifglsused{\glslabel}{}{\space(\glsentrysymbol{\glslabel})}% +\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{verbatim} -then \verb|\gls{distance}| will produce \qt{\textbf{distance (km)}}. +\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 glossary called -\texttt{notation} and you want to change the way the entry is -displayed on \firstuse\ so that it includes the symbol, you can do: -\begin{verbatim} -\defglsentryfmt[notation]{\glsgenentryfmt - \ifglsused{\glslabel}{}{\space - (denoted \glsentrysymbol{\glslabel})}} -\end{verbatim} +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{verbatim} -\newglossaryentry{set}{type=notation, - name=set, - description={A collection of objects}, - symbol={$S$} -} -\end{verbatim} -The \glslink{firstuse}{first time} you reference this entry it will be displayed as: -\qt{set (denoted $S$)} (assuming \ics{gls} was used). - -Alternatively, if you expect all the symbols to be set in math mode, -you can do: -\begin{verbatim} -\defglsentryfmt[notation]{\glsgenentryfmt - \ifglsused{\glslabel}{}{\space - (denoted $\glsentrysymbol{\glslabel}$)}} -\end{verbatim} -and define entries like this: -\begin{verbatim} -\newglossaryentry{set}{type=notation, - name=set, - description={A collection of objects}, - symbol={S} +\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{verbatim} -\end{example} +\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 -glossary style that displays the symbol, as many of the styles +\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}. -\subsection{Enabling and disabling hyperlinks to glossary entries} +\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 \Glsfmtplural{idx.hyperlink} to Glossary Entries} \label{sec:disablehyperlinks} -If you load the \sty{hyperref} or \sty{html} packages prior to -loading the \styfmt{glossaries} package, the \glslike\ and -\glstextlike\ commands will automatically have hyperlinks -to the relevant glossary entry, unless the \gloskey[glslink]{hyper} -option has been switched off (either explicitly or through -implicit means, such as via the \pkgopt{nohypertypes} package option). - -You can disable or enable links using: -\begin{definition}[\DescribeMacro{\glsdisablehyper}] -\cs{glsdisablehyper} -\end{definition} +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: +\cmddef{glsdisablehyper} and -\begin{definition}[\DescribeMacro{\glsenablehyper}] -\cs{glsenablehyper} -\end{definition} +\cmddef{glsenablehyper} respectively. The effect can be localised by placing the commands -within a group. Note that you should only use \cs{glsenablehyper} -if the commands \ics{hyperlink} and \ics{hypertarget} have been -defined (for example, by the \sty{hyperref} package). +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 \gls{firstuse} links using the package -option \pkgopt[false]{hyperfirst}. Note that this option only -affects the \glslike\ commands that recognise the \firstuseflag. +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 \gls*{firstuse} to have a hyperlink to the +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 glossary. First I need to disable the hyperlinks on -first use via the package option \pkgopt[false]{hyperfirst}: -\begin{verbatim} -\usepackage[hyperfirst=false]{glossaries} -\end{verbatim} -Now I need to redefine \ics{glsentryfmt} (see +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{verbatim} -\renewcommand*{\glsentryfmt}{% - \glsgenentryfmt - \ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}% +\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{verbatim} +\end{codebox} -Now the first use won't have hyperlinked text, but will be followed +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 \pkgopt{hyperfirst} option applies to all defined glossaries. It -may be that you only want to disable the hyperlinks on -\gls{firstuse} for glossaries that have a different form on -\gls*{firstuse}. This can be achieved by noting that since the -entries that require hyperlinking for all instances have identical -first and subsequent text, they can be unset via \ics{glsunsetall} -(see \sectionref{sec:glsunset}) so that the \pkgopt{hyperfirst} -option doesn't get applied. +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 hyperlink on \gls{firstuse} for -acronyms but not for entries in the main glossary. I~can load -the \styfmt{glossaries} package using: -\begin{verbatim} -\usepackage[hyperfirst=false,acronym]{glossaries} -\end{verbatim} -Once all glossary entries have been defined I~then do: -\begin{verbatim} -\glsunsetall[main] -\end{verbatim} - +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 hyperlinks via \ics{glsdisablehyper} and put the hyperlinks -(where required) within the definition of \ics{glsentryfmt} (see -\sectionref{sec:glsdisplay}) via \ics{glshyperlink} (see -\sectionref{sec:glsnolink}). +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 \glslike\ commands to have -hyperlinks when used in text mode, but not in math mode. I~can do -this by adding the glossary to the list of nohypertypes and redefining -\ics{glsentryfmt}: -\begin{verbatim} -\GlsDeclareNoHyperList{main} - -\renewcommand*{\glsentryfmt}{% - \ifmmode - \glsgenentryfmt - \else - \glsifhyperon - {\glsgenentryfmt}% hyperlink already on - {\glshyperlink[\glsgenentryfmt]{\glslabel}}% - \fi +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{verbatim} -Note that this doesn't affect the \glstextlike\ commands, which will -have the hyperlinks off unless they're forced on using the plus -variant. +\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 hyperlink -on the first time an entry is used per chapter. This doesn't involve -resetting the \firstuseflag. Instead it adds a~new key using -\ics{glsaddstoragekey} (see \sectionref{sec:glsaddstoragekey}) that -keeps track of the chapter number that the entry was last used in: -\begin{verbatim} -\glsaddstoragekey{chapter}{0}{\glschapnum} -\end{verbatim} -This creates a new user command called \cs{glschapnum} that's -analogous to \cs{glsentrytext}. The default value for this key is~0. -I~then define my glossary entries as usual. - -Next I redefine the hook \ics{glslinkpostsetkeys} +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 \cs{currentchap} using -\cs{edef}). This value is then compared with the value of the -entry's \texttt{chapter} key that I defined earlier. If they're the -same, this entry has already been used in this chapter so the -hyperlink is switched off using \sty{xkeyval}'s \cs{setkeys} -command. If the chapter number isn't the same, then this entry -hasn't been used in the current chapter. The \texttt{chapter} field -is updated using \ics{glsfieldxdef} (\sectionref{sec:fetchset}) -provided the user hasn't switched off the hyperlink. -(This test is performed using \cs{glsifhyperon}. -\begin{verbatim} -\renewcommand*{\glslinkpostsetkeys}{% - \edef\currentchap{\arabic{chapter}}% - \ifnum\currentchap=\glschapnum{\glslabel}\relax - \setkeys{glslink}{hyper=false}% - \else - \glsifhyperon{\glsfieldxdef{\glslabel}{chapter}{\currentchap}}{}% - \fi +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{verbatim} -Note that this will be confused if you use \cs{gls} etc when the -chapter counter is~0. (That is, before the first \cs{chapter}.) +\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 Links} +\section{Using Glossary Terms Without Indexing} \label{sec:glsnolink} -The commands described in this section display entry details without -adding any information to the glossary. They don't use -\ics{glstextformat}, they don't have any optional arguments, they -don't affect the \firstuseflag\ and, apart from \ics{glshyperlink}, -they don't produce hyperlinks. +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} -Commands that aren't expandable will be ignored by PDF bookmarks, so -you will need to provide an alternative via \sty{hyperref}'s -\cs{texorpdfstring} if you want to use them in sectioning commands. -(This isn't specific to the \styfmt{glossaries} package.) See the -\sty{hyperref} documentation for further details. All the commands -that convert the first letter to upper case aren't expandable. -The other commands depend on whether their corresponding keys were -assigned non-expandable values. +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 title case a field, you can use: -\begin{definition}[\DescribeMacro\glsentrytitlecase] -\cs{glsentrytitlecase}\marg{label}\marg{field} -\end{definition} -where \meta{label} is the label identifying the glossary entry, -\meta{field} is the field label (see \tableref{tab:fieldmap}). -This internally uses: -\begin{definition}[\DescribeMacro\glscapitalisewords] -\cs{glscapitalisewords}\marg{text} -\end{definition} -which defaults to \cs{capitalisewords}\marg{text}. If your field -contains formatting commands, you will need to redefine this to use -\cs{capitalisefmtwords}. See the \sty{mfirstuc} manual for further -details. - -For example: -\begin{verbatim} -\glsentrytitlecase{sample}{desc} -\end{verbatim} -(If you want title-casing in your glossary style, you might want to -investigate the \gls{glossaries-extra} package.) This command will +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. -Note that this command has the same limitations as \cs{makefirstuc} which is -used by commands like \cs{Gls} and \cs{Glsentryname} to upper-case -the first letter (see the notes about \cs{Gls} in \sectionref{sec:gls-like}). - -\begin{definition}[\DescribeMacro{\glsentryname}] -\cs{glsentryname}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryname}] -\cs{Glsentryname}\marg{label} -\end{definition} -These commands display the name of the glossary entry given by -\meta{label}, as specified by the \gloskey{name} key. -\cs{Glsentryname} makes the first letter upper case. -Neither of these commands check for the existence of \meta{label}. -The first form \cs{glsentryname} is expandable (unless the name -contains unexpandable commands). Note that this may be different from the values of -the \gloskey{text} or \gloskey{first} keys. In general it's better -to use \cs{glsentrytext} or \cs{glsentryfirst} instead of -\cs{glsentryname}. - -\begin{important} -In general it's best to avoid \cs{Glsentryname} with abbreviations. Instead, -consider using \cs{Glsentrylong}, \cs{Glsentryshort} or \cs{Glsentryfull}. -\end{important} - -\begin{definition}[\DescribeMacro{\glossentryname}] -\cs{glossentryname}\marg{label} -\end{definition} -This is like \cs{glsnamefont}\{\cs{glsentryname\marg{label}}\} -but also checks for the existence of \meta{label}. This command is -not expandable. It's used in the predefined glossary styles, so if -you want to change the way the name is formatted in the glossary, -you can redefine \cs{glsnamefont} to use the required fonts. For -example: -\begin{verbatim} -\renewcommand*{\glsnamefont}[1]{\textmd{\sffamily #1}} -\end{verbatim} -\begin{definition}[\DescribeMacro{\Glossentryname}] -\cs{Glossentryname}\marg{label} -\end{definition} -This is like \cs{glossentryname} but makes the first letter of the -name upper case. - -\begin{definition}[\DescribeMacro{\glsentrytext}] -\cs{glsentrytext}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrytext}] -\cs{Glsentrytext}\marg{label} -\end{definition} -These commands display the subsequent use text for the glossary -entry given by \meta{label}, as specified by the \gloskey{text} key. -\cs{Glsentrytext} makes the first letter upper case. -The first form is expandable (unless the text contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glsentryplural}] -\cs{glsentryplural}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryplural}] -\cs{Glsentryplural}\marg{label} -\end{definition} -These commands display the subsequent use plural text for the -glossary entry given by \meta{label}, as specified by the -\gloskey{plural} key. \cs{Glsentryplural} makes the first letter -upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glsentryfirst}] -\cs{glsentryfirst}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryfirst}] -\cs{Glsentryfirst}\marg{label} -\end{definition} -These commands display the \firstusetext\ for the glossary entry -given by \meta{label}, as specified by the \gloskey{first} key. -\cs{Glsentryfirst} makes the first letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glsentryfirstplural}] -\cs{glsentryfirstplural}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryfirstplural}] -\cs{Glsentryfirstplural}\marg{label} -\end{definition} -These commands display the plural form of the \firstusetext\ for the -glossary entry given by \meta{label}, as specified by the -\gloskey{firstplural} key. \cs{Glsentryfirstplural} makes the first -letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glsentrydesc}] -\cs{glsentrydesc}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrydesc}] -\cs{Glsentrydesc}\marg{label} -\end{definition} -These commands display the description for the glossary entry given -by \meta{label}. - -\cs{Glsentrydesc} makes the first letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glossentrydesc}] -\cs{glossentrydesc}\marg{label} -\end{definition} -This is like \cs{glsentrydesc}\marg{label} -but also checks for the existence of \meta{label}. This command is -not expandable. It's used in the predefined glossary styles to -display the description. -\begin{definition}[\DescribeMacro{\Glossentrydesc}] -\cs{Glossentrydesc}\marg{label} -\end{definition} -This is like \cs{glossentrydesc} but converts the first letter to -upper case. This command is not expandable. - -\begin{definition}[\DescribeMacro{\glsentrydescplural}] -\cs{glsentrydescplural}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrydescplural}] -\cs{Glsentrydescplural}\marg{label} -\end{definition} -These commands display the plural description for the glossary entry -given by \meta{label}. \cs{Glsentrydescplural} makes the first -letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - - -\begin{definition}[\DescribeMacro{\glsentrysymbol}] -\cs{glsentrysymbol}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrysymbol}] -\cs{Glsentrysymbol}\marg{label} -\end{definition} -These commands display the symbol for the glossary entry given by -\meta{label}. - -\cs{Glsentrysymbol} makes the first letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - - -\begin{definition}[\DescribeMacro\glsletentryfield] -\cs{glsletentryfield}\marg{cs}\marg{label}\marg{field} -\end{definition} -This command doesn't display anything. It merely fetches the -value associated with the given field (where the available field names -are listed in \tableref{tab:fieldmap}) and stores the result -in the control sequence \meta{cs}. For example, to store -the description for the entry whose label is \qt{apple} in the -control sequence \verb|\tmp|: -\begin{verbatim} -\glsletentryfield{\tmp}{apple}{desc} -\end{verbatim} - -\begin{definition}[\DescribeMacro{\glossentrysymbol}] -\cs{glossentrysymbol}\marg{label} -\end{definition} -This is like \cs{glsentrysymbol}\marg{label} -but also checks for the existence of \meta{label}. This command is -not expandable. It's used in some of the predefined glossary styles to -display the symbol. -\begin{definition}[\DescribeMacro{\Glossentrysymbol}] -\cs{Glossentrysymbol}\marg{label} -\end{definition} -This is like \cs{glossentrysymbol} but converts the first letter to -upper case. This command is not expandable. - -\begin{definition}[\DescribeMacro{\glsentrysymbolplural}] -\cs{glsentrysymbolplural}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrysymbolplural}] -\cs{Glsentrysymbolplural}\marg{label} -\end{definition} -These commands display the plural symbol for the glossary entry -given by \meta{label}. \cs{Glsentrysymbolplural} makes the first -letter upper case. -The first form is expandable (unless the value of that key contains unexpandable -commands). The second form is not expandable. Neither checks for the -existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glsentryuseri}] -\cs{glsentryuseri}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuseri}] -\cs{Glsentryuseri}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryuserii}] -\cs{glsentryuserii}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuserii}] -\cs{Glsentryuserii}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryuseriii}] -\cs{glsentryuseriii}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuseriii}] -\cs{Glsentryuseriii}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryuseriv}] -\cs{glsentryuseriv}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuseriv}] -\cs{Glsentryuseriv}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryuserv}] -\cs{glsentryuserv}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuserv}] -\cs{Glsentryuserv}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryuservi}] -\cs{glsentryuservi}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryuservi}] -\cs{Glsentryuservi}\marg{label} -\end{definition} -These commands display the value of the user keys for the glossary -entry given by \meta{label}. -The lower case forms are expandable (unless the value of the key -contains unexpandable commands). The commands beginning with an -upper case letter convert the first letter of the required value to -upper case and are not expandable. None of these commands check for -the existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\glshyperlink}] -\cs{glshyperlink}\oarg{link text}\marg{label} -\end{definition} -This command provides a hyperlink to the glossary entry given by -\meta{label} \strong{but does not add any information to the -glossary file}. The link text is given by -\ics{glsentrytext}\marg{label} by default\footnote{versions before -3.0 used \ics{glsentryname} as the default, but this could cause -problems when \gloskey{name} had been \glsd{sanitize}.}, but can be -overridden using the optional argument. Note that the hyperlink will -be suppressed if you have used \ics{glsdisablehyper} or if you +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 \cs{glshyperlink}, you need to ensure that the relevant -entry has been added to the glossary using any of the commands +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 link. +otherwise you will end up with an undefined \idx{hyperlink} target. \end{important} -The next two commands are only available with \opt1 or with the -\pkgopt{savenumberlist} package option: -\begin{definition}[\DescribeMacro{\glsentrynumberlist}] -\cs{glsentrynumberlist}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsdisplaynumberlist}] -\cs{glsdisplaynumberlist}\marg{label} -\end{definition} -Both display the \gls{numberlist} for the entry given by -\meta{label}. When used with \opt1 a~rerun is required to ensure -this list is up-to-date, when used with \optsor23 -a run of \gls{makeglossaries} (or \gls{makeindex}\slash\gls{xindy}) -followed by one or two runs of \LaTeX\ is required. - -The first command, \cs{glsentrynumberlist}, simply displays -the number list as is. The second command, -\cs{glsdisplaynumberlist}, formats the list using: -\begin{definition}[\DescribeMacro{\glsnumlistsep}] -\cs{glsnumlistsep} -\end{definition} -as the separator between all but the last two elements and -\begin{definition}[\DescribeMacro{\glsnumlistlastsep}] -\cs{glsnumlistlastsep} -\end{definition} -between the final two elements. The defaults are -\verb*|, | and \verb*| \& |, respectively. +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} -\cs{glsdisplaynumberlist} is fairly experimental. It works with -\optsand14, but for \optsor23 it only works when the default counter -format is used (that is, when the \gloskey[glslink]{format} key is -set to \texttt{glsnumberformat}). This command will only work with -\sty{hyperref} if you choose \optsor14. If you try using this command -with \optsor23 and \sty{hyperref}, \cs{glsentrynumberlist} will be -used instead. +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} -For further information see \ifpdf section~\ref*{sec:code:glsnolink} -\fi \qt{Displaying entry details without adding information to the -glossary} in the documented code (\texttt{glossaries-code.pdf}). +\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{xtr} -The \gls{glossaries-extra} package provides superior -abbreviation handling. You may want to consider using that -package instead of the commands described here. -\end{xtr} +\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}. For example: +\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}^^J% +\gls{setacronymstyle}\marg{long-short}^^J% +\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}^^J% +\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} -\begin{important} -Note that although this chapter uses the term \qt{acronym}, you can also -use the commands described here for initialisms or contractions -(as in the case of some of the examples given below). -If the glossary title is no longer applicable (for example, it -should be \qt{Abbreviations} rather than \qt{Acronyms}) then -you can change the title either by redefining \ics{acronymname} (see -\sectionref{sec:languages}) or by using the \gloskey[printglossary]{title} -key in the optional argument of \ics{printglossary} (or -\ics{printacronyms}). Alternatively consider using the -\gls{glossaries-extra} package's \pkgopt*{abbreviations} -option instead. -\end{important} +\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}. -Acronyms use the same underlying mechanism as terms defined with -\cs{newglossaryentry} so you can reference them with \ics{gls} and -\ics{glspl}. The way the acronym is displayed on \gls{firstuse} is -governed by the acronym style, which should be set before you define -your acronyms. For example: -\begin{verbatim} -\documentclass{article} -\usepackage{glossaries} -\setacronymstyle{long-short} -\newacronym{html}{HTML}{hypertext markup language} -\newacronym{xml}{XML}{extensible markup language} -\begin{document} -First use: \gls{html} and \gls{xml}. -Next use: \gls{html} and \gls{xml}. -\end{document} -\end{verbatim} -If you don't specify a style, you will have a less-flexible, but -backward-compatible, \qt{long (short)} style with just the base -\styfmt{glossaries} package or the \abbrstyle{short-nolong} style -(which only displays the short form on \gls{firstuse}) -with \gls{glossaries-extra}. - -Acronyms are defined using: -\begin{definition}[\DescribeMacro{\newacronym}] -\cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long} -\end{definition} - -This creates an entry with the given -label in the glossary given by \ics{acronymtype}. You can specify a -different glossary using the \gloskey{type} key within the optional -argument. The \cs{newacronym} command also uses the \gloskey{long}, +The \gls{newacronym} command also uses the \gloskey{long}, \gloskey{longplural}, \gloskey{short} and \gloskey{shortplural} keys -in \cs{newglossaryentry} to store the long and abbreviated forms and +in \gls{newglossaryentry} to store the long and short forms and their plurals. \begin{xtr} -If you use \cs{newacronym} with \gls{glossaries-extra}, you need to -first set the style with: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\marg{style-name} -\end{alltt} +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 the entry \meta{label} -in \ics{newglossaryentry} also apply to \cs{newacronym} -(see \sectionref{sec:newglosentry}). -Since \ics{newacronym} works like \ics{newglossaryentry}, you can use -\ics{glsreset} to reset the \gls{firstuseflag}. - -\begin{important} -If you haven't identified the specified glossary type as a list of -acronyms (via the package option -\pkgopt{acronymlists} or the command \ics{DeclareAcronymList}, -see \sectionref{sec:pkgopts-acronym}) \cs{newacronym} will add it to -the list and \emph{reset the display style} for that glossary via -\ics{defglsentryfmt}. If you have a mixture of acronyms and regular -entries within the same glossary, care is needed if you want to -change the display style: you must first identify that glossary as a -list of acronyms and then use \ics{defglsentryfmt} (not redefine -\ics{glsentryfmt}) before defining your entries. Alternatively, use -\gls{glossaries-extra} to have better support for a mixed glossary. -\end{important} - -The optional argument \marg{key-val list} allows you to specify +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 \ics{newglossaryentry} can also be used here in \meta{key-val -list}. -For example, \gloskey{description} (when used with one of the styles that -require a description, described in -\sectionref{sec:setacronymstyle}) or you can -override plural forms of \meta{abbrv} or \meta{long} using the -\gloskey{shortplural} or \gloskey{longplural} keys. -For example: -\begin{verbatim} -\newacronym[longplural={diagonal matrices}]% - {dm}{DM}{diagonal matrix} -\end{verbatim} -If the \firstuse\ uses the plural form, \verb|\glspl{dm}| will -display: diagonal matrices (DMs). If you want to use -the \gloskey{longplural} or \gloskey{shortplural} keys, I recommend -you use \ics{setacronymstyle} to set the display style rather than -using one of the pre-version 4.02 acronym styles (described in -\sectionref{sec:pkgopts-old-acronym}). +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 \ics{glspluralsuffix} to the singular form. The +obtained by appending \gls{glspluralsuffix} to the singular form. The short plural \gloskey{shortplural} is obtained (if not explicitly -set) by appending \ics{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}). +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 -\styfmt{glossaries-extra}, which has \icatattrs category attributes -to determine whether or not to append a suffix when forming the -default value of \gloskey{shortplural}. +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 \cs{newacronym} sets \verb|type=\acronymtype|, -if you want to load a file containing acronym definitions using -\ics{loadglsentries}\oarg{type}\marg{filename}, the optional argument -\meta{type} will not have an effect unless you explicitly set the -type as \verb|type=\glsdefaulttype| in the optional argument to -\ics{newacronym}. See \sectionref{sec:loadglsentries}. +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} -\begin{example}{Defining an Abbreviation}{ex:newacronym} -The following defines the abbreviation IDN: -\begin{verbatim} -\setacronymstyle{long-short} -\newacronym{idn}{IDN}{identification number} -\end{verbatim} -\verb|\gls{idn}| will produce \qt{identification number (IDN)} on -\firstuse\ and \qt{IDN} on subsequent uses. If you want to use one -of the \gls{smallcaps} acronym styles, described in -\sectionref{sec:setacronymstyle}, you need to use lower case -characters for the shortened form: -\begin{verbatim} -\setacronymstyle{long-sc-short} -\newacronym{idn}{idn}{identification number} -\end{verbatim} -Now \verb|\gls{idn}| will produce \qt{identification number -(\textsc{idn})} on \firstuse\ and \qt{\textsc{idn}} on subsequent -uses. -\end{example} +The following 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}^^J% +\gls{setacronymstyle}\marg{long-short}^^J% +\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.^^J% +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 \glslike\ and \glstextlike\ commands within the value of -keys like \gloskey{text} and \gloskey{first} due to complications -arising from nested links. The same applies to abbreviations -defined using \cs{newacronym}. +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{verbatim} -\newacronym{ssi}{SSI}{server side includes} -\newacronym{html}{HTML}{hypertext markup language} -\end{verbatim} +\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{verbatim} -\newacronym{shtml}{S\gls{html}}{\gls{ssi} enabled \gls{html}} -\end{verbatim} -\strong{Don't!} This will break the case-changing commands, such -as \ics{Gls}, it will cause inconsistencies on \firstuse, and, -if hyperlinks are enabled, will cause nested hyperlinks. It will -also confuse the commands used by the entry formatting (such as -\ics{glslabel}). +\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{verbatim} -\newacronym - [description={\gls{ssi} enabled \gls{html}}] - {shtml}{SHTML}{SSI enabled HTML} -\end{verbatim} -or -\begin{verbatim} -\newacronym - [description={\gls{ssi} enabled \gls{html}}] - {shtml}{SHTML} - {server side includes enabled hypertext markup language} -\end{verbatim} -Similarly for the \glstextlike\ commands. +\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 \gls{glossaries-extra}. -See the section \qt{Nested Links} in the \styfmt{glossaries-extra} -user manual. +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 @@ -8801,1131 +20647,1304 @@ First Use)} \label{sec:longshortfull} It may be that you want the long, short or full form -regardless of whether or not the acronym has already been used in -the document. You can do so with the commands described in this -section. - -The \cs{acr\ldots} commands described below are part of the set of -\glstextlike\ commands. That is, they index and can form -hyperlinks, but they don't modify the \firstuseflag. -However, their display is governed by \ics{defentryfmt} with -\ics{glscustomtext} set as appropriate. All caveats that apply to -the \glstextlike\ commands also apply to the following commands. -(Including the above warning about nested links.) +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 \gls{glossaries-extra}, don't use the commands -described in this section. The \gls{glossaries-extra} package -provides analogous \cs{glsxtr\ldots} or \cs{glsfmt\ldots} -commands. For example, \cs{glsxtrshort} instead of \cs{acrshort} -or, if needed in a heading, \cs{glsfmtshort}. (Similarly for the -case-changing variants.) +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 \glstextlike\ -commands, and there are similar star and plus variants that switch -off or on the hyperlinks. As with the \glstextlike\ commands, the -\gls{linktext} is placed in the argument of \ics{glstextformat}. +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}. -\begin{definition}[\DescribeMacro{\acrshort}] -\cs{acrshort}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This sets the \gls{linktext} to the short form (within the argument -of \ics{acronymfont}) for the entry given by \meta{label}. The short +\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 -\ics{newacronym} implicitly sets. - -There are also analogous upper case variants: -\begin{definition}[\DescribeMacro{\Acrshort}] -\cs{Acrshort}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\ACRshort}] -\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert} -\end{definition} +\gls{newacronym} implicitly sets. + +There are also analogous \casechanging\ variants: +\cmddef{Acrshort} +(\idx{sentencecase}) and +\cmddef{ACRshort} +(\idx{allcaps}). + There are also plural versions: -\begin{definition}[\DescribeMacro\acrshortpl] -\cs{acrshortpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro\Acrshortpl] -\cs{Acrshortpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro\ACRshortpl] -\cs{ACRshortpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -The short plural form is as supplied -by the \gloskey{shortplural} key, which \ics{newacronym} implicitly sets. - -\begin{definition}[\DescribeMacro{\acrlong}] -\cs{acrlong}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This sets the \gls{linktext} to the long form for the entry given by -\meta{label}. The long form is as supplied -by the \gloskey{long} key, which \ics{newacronym} implicitly sets. - -There are also analogous upper case variants: -\begin{definition}[\DescribeMacro{\Acrlong}] -\cs{Acrlong}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\ACRlong}] -\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert} -\end{definition} +\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: -\begin{definition}[\DescribeMacro{\acrlongpl}] -\cs{acrlongpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\Acrlongpl}] -\cs{Acrlongpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\ACRlongpl}] -\cs{ACRlongpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -The long plural form is as supplied by the \gloskey{longplural} key, -which \ics{newacronym} implicitly sets. - -The commands below display the full form of the acronym, but note -that this isn't necessarily the same as the form used on \firstuse. -These full-form commands are shortcuts that use the above commands, -rather than creating the \gls{linktext} from the complete full form. -These full-form commands have star and plus variants and optional -arguments that are passed to the above commands. - -\begin{definition}[\DescribeMacro{\acrfull}] -\cs{acrfull}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This is a shortcut for -\begin{definition}[\DescribeMacro{\acrfullfmt}] -\cs{acrfullfmt}\marg{options}\marg{label}\marg{insert} -\end{definition} -which by default does -\begin{alltt} -\cs{acrfullformat} - \mgroup{\cs{acrlong}\oarg{options}\marg{label}\marg{insert}} - \mgroup{\cs{acrshort}\oarg{options}\marg{label}} -\end{alltt} -where -\begin{definition}[\DescribeMacro\acrfullformat] -\cs{acrfullformat}\marg{long}\marg{short} -\end{definition} -by default does \meta{long} (\meta{short}). This command is now -deprecated for new acronym styles but is used by default for -backward compatibility if \cs{setacronymstyle} -(\sectionref{sec:setacronymstyle}) hasn't been used. (For further -details of these format commands see \ifpdf -section~\ref*{sec:code:acronym} in \fi the documented code, -\texttt{glossaries-code.pdf}.) - -There are also analogous upper case variants: -\begin{definition}[\DescribeMacro{\Acrfull}] -\cs{Acrfull}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro{\ACRfull}] -\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -and plural versions: -\begin{definition}[\DescribeMacro\acrfullpl] -\cs{acrfullpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro\Acrfullpl] -\cs{Acrfullpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -\begin{definition}[\DescribeMacro\ACRfullpl] -\cs{ACRfullpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} +\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 \pkgopt{shortcuts} package option to activate the shorter +the \opt{shortcuts} package option to activate the shorter command names listed in \tableref{tab:shortcuts}. \begin{table}[htbp] -\caption{Synonyms provided by the package option \pkgoptfmt{shortcuts}} +\caption{Synonyms provided by the \glsfmttext{opt.shortcuts} package option} \label{tab:shortcuts} -\vskip\baselineskip \centering \begin{tabular}{ll} \bfseries Shortcut Command & \bfseries Equivalent Command\\ -\ics{acs} & \ics{acrshort}\\ -\ics{Acs} & \ics{Acrshort}\\ -\ics{acsp} & \ics{acrshortpl}\\ -\ics{Acsp} & \ics{Acrshortpl}\\ -\ics{acl} & \ics{acrlong}\\ -\ics{Acl} & \ics{Acrlong}\\ -\ics{aclp} & \ics{acrlongpl}\\ -\ics{Aclp} & \ics{Acrlongpl}\\ -\ics{acf} & \ics{acrfull}\\ -\ics{Acf} & \ics{Acrfull}\\ -\ics{acfp} & \ics{acrfullpl}\\ -\ics{Acfp} & \ics{Acrfullpl}\\ -\ics{ac} & \ics{gls}\\ -\ics{Ac} & \ics{Gls}\\ -\ics{acp} & \ics{glspl}\\ -\ics{Acp} & \ics{Glspl} +\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 -adding information to the glossary using commands analogous to -\ics{glsentrytext} (described in \sectionref{sec:glsnolink}). +\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*} -\begin{important} -The commands that convert the first letter to upper case come with -the same caveats as those for analogous commands like -\ics{Glsentrytext} (non-expandable, can't be used in PDF bookmarks, -care needs to be taken if the first letter is an accented character -etc). See \sectionref{sec:glsnolink}. -\end{important} +\cmddef{Glsentryfull} +This is like \gls{glsentryfull} but applies \idx{sentencecase}. -The long form can be accessed using: -\begin{definition}[\DescribeMacro{\glsentrylong}] -\cs{glsentrylong}\marg{label} -\end{definition} -or, with the first letter converted to upper case: -\begin{definition}[\DescribeMacro{\Glsentrylong}] -\cs{Glsentrylong}\marg{label} -\end{definition} -Plural forms: -\begin{definition}[\DescribeMacro{\glsentrylongpl}] -\cs{glsentrylongpl}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentrylongpl}] -\cs{Glsentrylongpl}\marg{label} -\end{definition} - -Similarly, to access the short form: -\begin{definition}[\DescribeMacro{\glsentryshort}] -\cs{glsentryshort}\marg{label} -\end{definition} -or, with the first letter converted to upper case: -\begin{definition}[\DescribeMacro{\Glsentryshort}] -\cs{Glsentryshort}\marg{label} -\end{definition} -Plural forms: -\begin{definition}[\DescribeMacro{\glsentryshortpl}] -\cs{glsentryshortpl}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryshortpl}] -\cs{Glsentryshortpl}\marg{label} -\end{definition} - -And the full form can be obtained using: -\begin{definition}[\DescribeMacro{\glsentryfull}] -\cs{glsentryfull}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryfull}] -\cs{Glsentryfull}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glsentryfullpl}] -\cs{glsentryfullpl}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\Glsentryfullpl}] -\cs{Glsentryfullpl}\marg{label} -\end{definition} -These again use \ics{acrfullformat} by default, but -the new styles described in the section below use different -formatting commands. +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 \gls{glossaries-extra}, don't use the commands -described in this section. Use \ics*{setabbreviationstyle} to set -the style. This uses a different (but more consistent) naming +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{Acronym Style Modifications} section and -the \qt{Abbreviations} chapter in the \gls{glossaries-extra} manual -for further details. +\acrstyle{dua}. See the \qt{Abbreviations} chapter in the +\sty{glossaries-extra} manual for further details. \end{xtr} -The acronym style is set using: -\begin{definition}[\DescribeMacro{\setacronymstyle}] -\cs{setacronymstyle}\marg{style name} -\end{definition} +The \idx+{acronymstyle} is set using: +\cmddef{setacronymstyle} where \meta{style name} is the name of the required style. - -\begin{important} -You must use \cs{setacronymstyle} \emph{before} you define the -acronyms with \cs{newacronym}. -\end{important} +The style must be set before the \idxpl{acronym} are defined +otherwise you will end up with inconsistencies. For example: -\begin{verbatim} -\usepackage[acronym]{glossaries} - -\makeglossaries - -\setacronymstyle{long-sc-short} - -\newacronym{html}{html}{hypertext markup language} -\newacronym{xml}{xml}{extensible markup language} -\end{verbatim} -Unpredictable results can occur if you try to use multiple styles. +\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 abbreviation styles, then -use the \gls{glossaries-extra} package, which has better -abbreviation management. See, for example, -\gallery{index.php?label=sample-name-font}{Gallery: Mixing Styles}. +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} -Unlike the backward-compatible default behaviour of \cs{newacronym}, the -styles set via \cs{setacronymstyle} don't use the \gloskey{first} -or \gloskey{text} keys, but instead they use \ics{defglsentryfmt} to -set a~custom format that uses the \gloskey{long} and \gloskey{short} +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. The earlier +\exampleref{ex:newacronym} can be adjusted to use rollback to +demonstrated 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.^^J% +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 \ics{glsgenacfmt} and modify the definitions of commands -like \ics{genacrfullformat}. - -Note that when you use \cs{setacronymstyle} the \gloskey{name} key -is set to -\begin{definition}[\DescribeMacro{\acronymentry}] -\cs{acronymentry}\marg{label} -\end{definition} +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 -\begin{definition}[\DescribeMacro{\acronymsort}] -\cs{acronymsort}\marg{short}\marg{long} -\end{definition} -These commands are redefined by the acronym styles. However, you can +\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 -\cs{newacronym}. Protected expansion is performed on \cs{acronymsort} -when the entry is defined. +\gls{newacronym}. Protected expansion is performed on \gls{acronymsort} +when the \idx{acronym} is defined. \subsection{Predefined Acronym Styles} \label{sec:predefinedacrstyles} -The \styfmt{glossaries} package provides a~number of predefined -styles. These styles apply -\begin{definition}[\DescribeMacro{\firstacronymfont}] -\cs{firstacronymfont}\marg{text} -\end{definition} -to the short form on first use and -\begin{definition}[\DescribeMacro{\acronymfont}] -\cs{acronymfont}\marg{text} -\end{definition} -on subsequent use. The styles modify the definition of -\cs{acronymfont} as required, but \ics{firstacronymfont} is only set -once by the package when it's loaded. By default -\ics{firstacronymfont}\marg{text} is the same as -\ics{acronymfont}\marg{text}. -If you want the short form displayed differently on first use, you -can redefine \ics{firstacronymfont} independently of the acronym -style. - -The predefined styles that contain \texttt{sc} in their name (for -example \acrstyle{long-sc-short}) redefine \cs{acronymfont} to use -\ics{textsc}, which means that the short form needs to be specified -in lower case. \ifpdf Remember that \verb|\textsc{abc}| produces -\textsc{abc} but \verb|\textsc{ABC}| produces \textsc{ABC}.\fi +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}. +\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}^^J% +\gls{setacronymstyle}\marg{long-sc-short}^^J% +\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 \gls{smallcaps}, so you may need to redefine -\ics{glsnamefont} (see \sectionref{sec:printglossary}) to switch to -medium weight if you are using a glossary style that displays entry -names in bold and you have chosen an acronym style that uses -\ics{textsc}. +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 styles that contain \texttt{sm} in their name -(for example \acrstyle{long-sm-short}) redefine \cs{acronymfont} to -use \ics{textsmaller}. +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 \styfmt{glossaries} package doesn't define or load any package that -defines \ics{textsmaller}. If you use one of the acronym styles that -set \ics{acronymfont} to \cs{textsmaller} you must +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 -\cs{textsmaller}. +\gls{textsmaller}. \end{important} -The remaining predefined styles redefine \cs{acronymfont}\marg{text} -to simply do its argument \meta{text}. +The remaining predefined styles redefine \gls{acronymfont} +to simply do its argument without any font change. \begin{important} -In most cases, the predefined styles adjust \ics{acrfull} and -\ics{glsentryfull} (and their plural and upper case variants) to -reflect the style. The only exceptions to this are the -\acrstyle{dua} and \acrstyle{footnote} styles (and their variants). +The predefined styles adjust \gls+{acrfull} and +\gls+{glsentryfull} (and their plural and \casechanging\ variants) to +reflect the style. \end{important} -The following styles are supplied by the \styfmt{glossaries} -package: -\begin{itemize} -\item \acrstyle{long-short}, \acrstyle{long-sc-short}, -\acrstyle{long-sm-short}, \acrstyle{long-sp-short}: - -With these three styles, acronyms are displayed in the form -\begin{definition} -\meta{long} (\ics{firstacronymfont}\marg{short}) -\end{definition} -on first use and -\begin{definition} -\ics{acronymfont}\marg{short} -\end{definition} -on subsequent use. -They also set \cs{acronymsort}\marg{short}\marg{long} to just -\meta{short}. This means that the acronyms are sorted according to -their short form. In addition, \cs{acronymentry}\marg{label} is set -to just the short form (enclosed in \cs{acronymfont}) and the +When \idxpl{acronym} are defined, \gls{newacronym} will set the \gloskey{sort} key to: +\cmddef{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: +\cmddef{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. -The \acrstyle{long-sp-short} style was introduced in version~4.16 -and uses -\begin{definition}[\DescribeMacro\glsacspace] -\cs{glsacspace}\marg{label} -\end{definition} -for the space between the long and short forms. This defaults to -a~non-breakable space (\verb|~|) if -(\cs{acronymfont}\marg{short}) is less than 3em, otherwise it uses -a~normal space. This may be redefined as required. For example, to -always use a~non-breakable space: -\begin{verbatim} -\renewcommand*{\glsacspace}[1]{~} -\end{verbatim} - -\item \acrstyle{short-long}, \acrstyle{sc-short-long}, -\acrstyle{sm-short-long}: - -These three styles are analogous to the above three styles, except -the display order is swapped to -\begin{definition} -\ics{firstacronymfont}\marg{short} (\meta{long}) -\end{definition} -on first use. - -Note, however, that \ics{acronymsort} and \ics{acronymentry} are the -same as for the \meta{long} (\meta{short}) styles above, so the -acronyms are still sorted according to the short form. - -\item \acrstyle{long-short-desc}, \acrstyle{long-sc-short-desc}, -\acrstyle{long-sm-short-desc}, \acrstyle{long-sp-short-desc}: - -These are like the \acrstyle{long-short}, \acrstyle{long-sc-short}, -\acrstyle{long-sm-short} and \acrstyle{long-sp-short} styles described above, except that the -\gloskey{description} key must be supplied in the optional argument -of \ics{newacronym}. They also redefine \ics{acronymentry} to -\marg{long} (\cs{acronymfont}\marg{short}) and redefine -\ics{acronymsort}\marg{short}\marg{long} to just \meta{long}. -This means that the acronyms are sorted according to the long form, -and in the list of acronyms the name field has the long form -followed by the short form in parentheses. I~recommend you use -a~glossary style such as \glostyle{altlist} with these acronym -styles to allow for the long name field. - -\item \acrstyle{short-long-desc}, \acrstyle{sc-short-long-desc}, -\acrstyle{sm-short-long-desc}: - -These styles are analogous to the above three styles, but the first -use display style is: -\begin{definition} -\cs{firstacronymfont}\marg{short} (\meta{long}) -\end{definition} -The definitions of \cs{acronymsort} and \cs{acronymentry} are the -same as those for \acrstyle{long-short-desc} etc. - -\item \acrstyle{dua}, \acrstyle{dua-desc}: - -With these styles, the \glslike\ commands always display the long form -regardless of whether the entry has been used or not. However, \ics{acrfull} -and \ics{glsentryfull} will display \meta{long} (\cs{acronymfont}\marg{short}). In the case -of \acrstyle{dua}, the \gloskey{name} and \gloskey{sort} keys are set to -the short form and the description is set to the long form. In the -case of \acrstyle{dua-desc}, the \gloskey{name} and \gloskey{sort} -keys are set to the long form and the description is supplied in the -optional argument of \ics{newacronym}. - -\item \acrstyle{footnote}, \acrstyle{footnote-sc}, -\acrstyle{footnote-sm}: - -With these three styles, on first use the \glslike\ commands display: -\begin{definition} -\cs{firstacronymfont}\marg{short}\ics{footnote}\marg{long} -\end{definition} -However, \ics{acrfull} and \ics{glsentryfull} are set to -\cs{acronymfont}\marg{short} (\meta{long}). On subsequent use the display is: -\begin{definition} -\cs{acronymfont}\marg{short} -\end{definition} -The \gloskey{sort} and \gloskey{name} keys are set to -the short form, and the \gloskey{description} is set to the long -form. - -\begin{important} -In order to avoid nested hyperlinks on \firstuse\ the footnote -styles automatically implement \pkgopt[false]{hyperfirst} for the -acronym lists. -\end{important} - -\item \acrstyle{footnote-desc}, \acrstyle{footnote-sc-desc}, -\acrstyle{footnote-sm-desc}: +\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. -These three styles are similar to the previous three styles, but the -description has to be supplied in the optional argument of -\ics{newacronym}. The \gloskey{name} key is set to the long form -followed by the short form in parentheses and the \gloskey{sort} key -is set to the long form. This means that the acronyms will be sorted -according to the long form. In addition, since the \gloskey{name} -will typically be quite wide it's best to choose a glossary style -that can accommodate this, such as \glostyle{altlist}. +\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}. -\end{itemize} +\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{verbatim} -\setacronymstyle{footnote-sc-desc} -\end{verbatim} -and then redefine \ics{acronymsort} and \ics{acronymentry}: -\begin{verbatim} -\renewcommand*{\acronymsort}[2]{#1}% sort by short form -\renewcommand*{\acronymentry}[1]{% - \acronymfont{\glsentryshort{#1}}\space (\glsentrylong{#1})}% -\end{verbatim} -(I've used \cs{space} for extra clarity, but you can just use an +\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 -\gls{smallcaps}, so another font is required. For example: -\begin{verbatim} -\usepackage[T1]{fontenc} -\end{verbatim} -The alternative is to redefine \ics{acronymfont} so that it -always switches to medium weight to ensure the \gls{smallcaps} setting is +\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{verbatim} -\renewcommand*{\acronymfont}[1]{\textmd{\scshape #1}} -\end{verbatim} +\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 acronyms styles that come with the -\styfmt{glossaries} package don't suit your requirements. In this +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: -\begin{definition}[\DescribeMacro{\newacronymstyle}] -\cs{newacronymstyle}\marg{style name}\marg{display}\marg{definitions} -\end{definition} +\cmddef{newacronymstyle} where \meta{style name} is the name of the new style (avoid active -characters). The second argument, \meta{display}, is equivalent to -the mandatory argument of \ics{defglsentryfmt}. You can simply use -\ics{glsgenacfmt} or you can customize the display using commands -like \ics{ifglsused}, \ics{glsifplural} and \ics{glscapscase}. +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 glossary (that is entries in -that glossary are defined both with \ics{newacronym} and -\ics{newglossaryentry}) then you can test if the entry is an acronym -and use \ics{glsgenacfmt} if it is or \ics{glsgenentryfmt} if it -isn't. For example, the \acrstyle{long-short} style sets -\meta{display} as -\begin{verbatim} -\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -\end{verbatim} -(You can use \ics{ifglshasshort} instead of \ics{ifglshaslong} to -test if the entry is an acronym if you prefer.) -The third argument, \meta{definitions}, can be used to redefine the -commands that affect the display style, such as \ics{acronymfont} -or, if \meta{display} uses \cs{glsgenacfmt}, \ics{genacrfullformat} -and its variants. - -Note that \ics{setacronymstyle} redefines \ics{glsentryfull} and -\ics{acrfullfmt} to use \ics{genacrfullformat} (and similarly for -the plural and upper case variants). If this isn't appropriate for the +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}) \cs{newacronymstyle} should redefine these commands -within \meta{definitions}. - - -Within \cs{newacronymstyle}'s \meta{definitions} argument you -can also redefine -\begin{definition}[\DescribeMacro{\GenericAcronymFields}] -\cs{GenericAcronymFields} -\end{definition} -This is a list of additional fields to be set in \ics{newacronym}. -You can use the following token registers to access the entry label, -long form and short form: \DescribeMacro{\glslabeltok}\cs{glslabeltok}, -\DescribeMacro{\glslongtok}\cs{glslongtok} and -\DescribeMacro{\glsshorttok}\cs{glsshorttok}. As with all \TeX\ -registers, you can access their values by preceding the register -with \ics{the}. For example, the \acrstyle{long-short} style does: -\begin{verbatim} -\renewcommand*{\GenericAcronymFields}{% - description={\the\glslongtok}}% -\end{verbatim} +\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 -acronym whereas the \acrstyle{long-short-desc} style does: -\begin{verbatim} -\renewcommand*{\GenericAcronymFields}{}% -\end{verbatim} +\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 acronym style that's based -on an existing style. Within \meta{display} you can use -\begin{definition}[\DescribeMacro\GlsUseAcrEntryDispStyle] -\cs{GlsUseAcrEntryDispStyle}\marg{style name} -\end{definition} -to use the \meta{display} definition from the style given by -\meta{style name}. Within \meta{definitions} you can use -\begin{definition}[\DescribeMacro{\GlsUseAcrStyleDefs}] -\cs{GlsUseAcrStyleDefs}\marg{style name} -\end{definition} -to use the \meta{definitions} from the style given by \meta{style -name}. For example, the \acrstyle{long-sc-short} acronym style is +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 (remember to use \verb|##| instead of \verb|#| within -\meta{definitions}): -\begin{verbatim} -\newacronymstyle{long-sc-short}% -{% use the same display as "long-short" - \GlsUseAcrEntryDispStyle{long-short}% -}% -{% use the same definitions as "long-short" - \GlsUseAcrStyleDefs{long-short}% - % Minor modifications: - \renewcommand{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% +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{verbatim} -(\DescribeMacro{\glstextup}\cs{glstextup} is used to cancel the effect -of \ics{textsc}. This defaults to \ics{textulc}, if defined, -otherwise \ics{textup}. For example, the plural of \textsc{svm} -should be rendered as \textsc{svm}s rather than \textsc{svms}.) +\end{compactcodebox} \begin{example}{Defining a Custom Acronym Style}{ex:customacrstyle} -Suppose I want my acronym on \firstuse\ to have the +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 \ics{gls} on \gls{firstuse} +the description. That is, in the text I want \gls{gls} on \idx{firstuse} to display: -\begin{display} -\ics{textsc}\marg{abbrv}\cs{footnote}"{"\meta{long}: \meta{description}"}" -\end{display} -on subsequent use: -\begin{display} -\ics{textsc}\marg{abbrv} -\end{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{display} +\begin{compactcodebox} \meta{long} (\meta{short}) \meta{description} -\end{display} - -Let's suppose it's possible that I may have a mixed glossary. I can -check this in the second argument of \ics{newacronymstyle} using: -\begin{verbatim} -\ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -\end{verbatim} -This will use \ics{glsgenentryfmt} if the entry isn't an acronym, -otherwise it will use \ics{glsgenacfmt}. The third argument -(\meta{definitions}) of -\ics{newacronymstyle} needs to redefine \ics{genacrfullformat} etc -so that the \firstuse\ displays the short form in the text with the +\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 (remember to use \verb|##| instead of \verb|#|): -\begin{verbatim} - % No case change, singular first use: - \renewcommand*{\genacrfullformat}[2]{% - \firstacronymfont{\glsentryshort{##1}}##2% - \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% - }% - % First letter upper case, singular first use: - \renewcommand*{\Genacrfullformat}[2]{% - \firstacronymfont{\Glsentryshort{##1}}##2% - \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% - }% - % No case change, plural first use: - \renewcommand*{\genplacrfullformat}[2]{% - \firstacronymfont{\glsentryshortpl{##1}}##2% - \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% - }% - % First letter upper case, plural first use: - \renewcommand*{\Genplacrfullformat}[2]{% - \firstacronymfont{\Glsentryshortpl{##1}}##2% - \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% - }% -\end{verbatim} +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{verbatim} - % No case change, singular first use: - \renewcommand*{\genacrfullformat}[2]{% - \firstacronymfont{\glsentryshort{##1}}##2% - \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% - }% - % No case change, plural first use: - \renewcommand*{\genplacrfullformat}[2]{% - \firstacronymfont{\glsentryshortpl{##1}}##2% - \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% - }% - \let\Genacrfullformat\genacrfullformat - \let\Genplacrfullformat\genplacrfullformat -\end{verbatim} -Another variation is to use \ics{Glsentrylong} and -\ics{Glsentrylongpl} in the footnote instead of \ics{glsentrylong} and -\ics{glsentrylongpl}. - -Now let's suppose that commands such as \ics{glsentryfull} and -\ics{acrfull} shouldn't +\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 \cs{glsentryfull}, -\ics{acrfullfmt} and their plural and upper case variants. +This means that the style needs to redefine \gls{glsentryfull}, +\gls{acrfullfmt} and their plural and \casechanging\ variants. First, the non-linking commands: -\begin{verbatim} - \renewcommand*{\glsentryfull}[1]{% - \glsentrylong{##1}\space - (\acronymfont{\glsentryshort{##1}})% - }% - \renewcommand*{\Glsentryfull}[1]{% - \Glsentrylong{##1}\space - (\acronymfont{\glsentryshort{##1}})% - }% - \renewcommand*{\glsentryfullpl}[1]{% - \glsentrylongpl{##1}\space - (\acronymfont{\glsentryshortpl{##1}})% - }% - \renewcommand*{\Glsentryfullpl}[1]{% - \Glsentrylongpl{##1}\space - (\acronymfont{\glsentryshortpl{##1}})% - }% -\end{verbatim} +\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{verbatim} - \renewcommand*{\acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - \renewcommand*{\Acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \Glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - \renewcommand*{\ACRfullfmt}[3]{% - \glslink[##1]{##2}{% - \MakeTextUppercase{% - \glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - }% - \renewcommand*{\acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - \renewcommand*{\Acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \Glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - \renewcommand*{\ACRfullplfmt}[3]{% - \glslink[##1]{##2}{% - \MakeTextUppercase{% - \glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - }% -\end{verbatim} -(This may cause problems with long hyperlinks, in which case adjust +\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 \ics{glslink}.) +the argument of \gls{glslink}.) -The style also needs to redefine \ics{acronymsort} so that the -acronyms are sorted according to the long form: -\begin{verbatim} - \renewcommand*{\acronymsort}[2]{##2}% -\end{verbatim} +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{verbatim} - \renewcommand*{\acronymsort}[2]{##1}% -\end{verbatim} -The acronym font needs to be set to \ics{textsc} and the plural +\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 \gls{smallcaps}: -\begin{verbatim} - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% -\end{verbatim} +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 -acronyms. The simplest way is to redefine \ics{acronymentry} to the +\idxpl{acronym}. The simplest way is to redefine \gls{acronymentry} to the long form followed by the upper case short form in parentheses: -\begin{verbatim} - \renewcommand*{\acronymentry}[1]{% - \Glsentrylong{##1}\space - (\MakeTextUppercase{\glsentryshort{##1}})}% -\end{verbatim} -(I've used \ics{Glsentrylong} instead of \ics{glsentrylong} to -capitalise the name in the glossary.) - -An alternative approach is to set \ics{acronymentry} to just the -long form and redefine \ics{GenericAcronymFields} to set the -\gloskey{symbol} key to the short form and use a glossary style that +\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{verbatim} - \renewcommand*{\acronymentry}[1]{\Glsentrylong{##1}}% - \renewcommand*{\GenericAcronymFields}{% - symbol={\protect\MakeTextUppercase{\the\glsshorttok}}}% -\end{verbatim} +\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 -\ics{GenericAcronymFields} to do nothing: -\begin{verbatim} - \renewcommand*{\GenericAcronymFields}{}% -\end{verbatim} - -Finally, this style needs to switch off hyperlinks on first use to -avoid nested links: -\begin{verbatim} - \glshyperfirstfalse -\end{verbatim} +\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{verbatim} -\newacronymstyle{custom-fn}% new style name -{% - \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -}% -{% - \renewcommand*{\GenericAcronymFields}{}% - \glshyperfirstfalse - \renewcommand*{\genacrfullformat}[2]{% - \firstacronymfont{\glsentryshort{##1}}##2% - \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% - }% - \renewcommand*{\Genacrfullformat}[2]{% - \firstacronymfont{\Glsentryshort{##1}}##2% - \footnote{\glsentrylong{##1}: \glsentrydesc{##1}}% - }% - \renewcommand*{\genplacrfullformat}[2]{% - \firstacronymfont{\glsentryshortpl{##1}}##2% - \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% - }% - \renewcommand*{\Genplacrfullformat}[2]{% - \firstacronymfont{\Glsentryshortpl{##1}}##2% - \footnote{\glsentrylongpl{##1}: \glsentrydesc{##1}}% - }% - \renewcommand*{\glsentryfull}[1]{% - \glsentrylong{##1}\space - (\acronymfont{\glsentryshort{##1}})% - }% - \renewcommand*{\Glsentryfull}[1]{% - \Glsentrylong{##1}\space - (\acronymfont{\glsentryshort{##1}})% - }% - \renewcommand*{\glsentryfullpl}[1]{% - \glsentrylongpl{##1}\space - (\acronymfont{\glsentryshortpl{##1}})% - }% - \renewcommand*{\Glsentryfullpl}[1]{% - \Glsentrylongpl{##1}\space - (\acronymfont{\glsentryshortpl{##1}})% - }% - \renewcommand*{\acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - \renewcommand*{\Acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \Glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - \renewcommand*{\ACRfullfmt}[3]{% - \glslink[##1]{##2}{% - \MakeTextUppercase{% - \glsentrylong{##2}##3\space - (\acronymfont{\glsentryshort{##2}})% - }% - }% - }% - \renewcommand*{\acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - \renewcommand*{\Acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \Glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - \renewcommand*{\ACRfullplfmt}[3]{% - \glslink[##1]{##2}{% - \MakeTextUppercase{% - \glsentrylongpl{##2}##3\space - (\acronymfont{\glsentryshortpl{##2}})% - }% - }% - }% - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \Glsentrylong{##1}\space - (\MakeTextUppercase{\glsentryshort{##1}})}% +\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{verbatim} +\end{codebox} Now I need to specify that I want to use this new style: -\begin{verbatim} -\setacronymstyle{custom-fn} -\end{verbatim} -I also need to use a glossary style that suits this acronym 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{verbatim} -\setglossarystyle{altlist} -\end{verbatim} - -Once the acronym style has been set, I can define my acronyms: -\begin{verbatim} -\newacronym[description={set of tags for use in -developing hypertext documents}]{html}{html}{Hyper +\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} - -\newacronym[description={language used to describe the -layout of a document written in a markup language}]{css} -{css}{Cascading Style Sheet} -\end{verbatim} +\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 abbreviations in italic and some that +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 \cs{newacronym} can cause complications. - -This example uses \ics{glsaddstoragekey} to add an extra field that -can be used to store the formatting declaration (such as \cs{em}). -\begin{verbatim} -\glsaddstoragekey{font}{}{\entryfont} -\end{verbatim} -This defines a~new field/key called \texttt{font}, which defaults to +\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 \cs{entryfont} that's analogous to \cs{glsentrytext}. A~new -style is then created to format abbreviations that access this field. +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 \ics{glsgenacfmt} but instead provides a~modified -version that doesn't use \cs{acronymfont}\marg{short} +doesn't use \gls{glsgenacfmt} but instead provides a~modified +version that doesn't use \gls{acronymfont} but instead uses -\verb|{|\cs{entryfont}\verb|{\glslabel}|\meta{short}\verb|}|. -The full format given by commands such as \cs{genacrfullformat} +\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{verbatim} - \renewcommand*{\genacrfullformat}[2]{% - \glsentrylong{##1}##2\space - ({\entryfont{##1}\glsentryshort{##1}})% - }% -\end{verbatim} -This will deal with commands like \ics{gls} but not commands like -\ics{acrshort} which still use \ics{acronymfont}. Another approach -is to redefine \cs{acronymfont} to look up the required font -declaration. Since \cs{acronymfont} doesn't take the entry label as -an argument, the following will only work if \cs{acronymfont} is -used in a~context where the label is provided by \ics{glslabel}. -This is true in \cs{gls}, \cs{acrshort} and \cs{acrfull}. The +\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{verbatim} -\renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}#1}}% -\end{verbatim} +\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{verbatim} -\newacronymstyle{long-font-short} -{% - \GlsUseAcrEntryDispStyle{long-short}% -} -{% - \GlsUseAcrStyleDefs{long-short}% - \renewcommand*{\genacrfullformat}[2]{% - \glsentrylong{##1}##2\space - ({\entryfont{##1}\glsentryshort{##1}})% - }% - \renewcommand*{\Genacrfullformat}[2]{% - \Glsentrylong{##1}##2\space - ({\entryfont{##1}\glsentryshort{##1}})% - }% - \renewcommand*{\genplacrfullformat}[2]{% - \glsentrylongpl{##1}##2\space - ({\entryfont{##1}\glsentryshortpl{##1}})% - }% - \renewcommand*{\Genplacrfullformat}[2]{% - \Glsentrylongpl{##1}##2\space - ({\entryfont{##1}\glsentryshortpl{##1}})% - }% - \renewcommand*{\acronymfont}[1]{{\entryfont{\glslabel}##1}}% - \renewcommand*{\acronymentry}[1]{{\entryfont{##1}\glsentryshort{##1}}}% +\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{verbatim} +\end{codebox} Remember the style needs to be set before defining the entries: -\begin{verbatim} -\setacronymstyle{long-font-short} -\end{verbatim} +\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 full stops -(periods) from upper case initials but may still retain them for -lower case abbreviations, while others may still use them for both -upper and lower case. This can cause complications. Chapter~12 of -\emph{The \TeX{}book} discusses the spacing between words but, -briefly, the default behaviour of \TeX\ is to assume that an upper -case character followed by a~full stop and space is an abbreviation, -so the space is the default inter-word space whereas a~lower case -character followed by a~full stop and space is a word occurring at -the end of a~sentence. In the event that this isn't true, you need -to make a~manual adjustment using \verb*| | (back slash space) in -place of just a~space character for an inter-word mid-sentence space -and use \verb|\@| before the full stop to indicate the end of the -sentence. +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{verbatim} +\begin{codebox} I was awarded a B.Sc. and a Ph.D. (From the same place.) -\end{verbatim} +\end{codebox} is typeset as -\begin{display} +\begin{resultbox} I was awarded a B.Sc. and a Ph.D. (From the same place.) -\end{display} +\end{resultbox} The spacing is more noticeable with the typewriter font: -\begin{verbatim} -\ttfamily +\begin{codebox} +\cmd{ttfamily} I was awarded a B.Sc. and a Ph.D. (From the same place.) -\end{verbatim} +\end{codebox} is typeset as -\begin{display}\ttfamily +\begin{resultbox}\ttfamily I was awarded a B.Sc. and a Ph.D. (From the same place.) -\end{display} -The lower case letter at the end of ``B.Sc.''\ is confusing \TeX\ -into thinking that the full stop after it marks the end of the -sentence. Whereas the upper case letter at the end of ``Ph.D.'' has -confused \TeX\ into thinking that the following full stop is just +\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{verbatim} -I was awarded a B.Sc.\ and a Ph.D\@. (From the same place.) -\end{verbatim} - -This situation is a bit problematic for \styfmt{glossaries}. The -full stops can form part of the \meta{short} argument of -\cs{newacronym} and the \verb*|B.Sc.\ | part can be dealt with by -remembering to add \verb*|\ | (for example, \verb*|\gls{bsc}\ |) +\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 full stop (to avoid two dots) which can +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 space factor, which is usually done by inserting \cs{@} -before the full stop. +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. -(Note that the supplemental \gls{glossaries-extra} package provides a much + +\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}.) +\gallery{sample-initialisms.shtml}{Gallery: Initialisms}. +\end{xtr} \begin{example}{Abbreviations with Full Stops (Periods)}{ex:dotabbr} -As from version 4.16, there's now a hook (\ics{glspostlinkhook}) -that's called at the very end of the \glslike\ and \glstextlike\ +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 full stop. The \sty{amsgen} package (which is automatically -loaded by \styfmt{glossaries}) provides an internal command -called \cs{new@ifnextchar} that can be used to determine if the +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.) +\sty{amsgen} documentation. Alternatively, \LaTeX3 may provide a +better way of doing this.) -It's possible that I~may also want acronyms or contractions in my +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 -example~\ref{ex:addstoragekey} where a~new field is defined +\exampleref{ex:addstoragekey} where a~new field is defined to indicate the type of abbreviation: -\begin{verbatim} -\glsaddstoragekey{abbrtype}{word}{\abbrtype} - -\newcommand*{\newabbr}[1][]{\newacronym[abbrtype=initials,#1]} -\end{verbatim} -Now I just use \ics{newacronym} for the acronyms, for example, -\begin{verbatim} -\newacronym{laser}{laser}{light amplification by stimulated +\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{verbatim} -and my new command \cs{newabbr} for initials, for example, -\begin{verbatim} -\newabbr{eg}{e.g.}{exempli gratia} -\newabbr{ie}{i.e.}{id est} -\newabbr{bsc}{B.Sc.}{Bachelor of Science} -\newabbr{ba}{B.A.}{Bachelor of Arts} -\newabbr{agm}{A.G.M.}{annual general meeting} -\end{verbatim} -Within \cs{glspostlinkhook} the entry's label can be accessed using -\ics{glslabel} and \ics{ifglsfieldeq} can be used to determine if -the current entry has the new \texttt{abbrtype} field set to +\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~full -stop. If it is, this signals the end of a~sentence otherwise it's +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 -\ics{makeatletter} and \ics{makeatother}: -\begin{verbatim} -\makeatletter -\renewcommand{\glspostlinkhook}{% - \ifglsfieldeq{\glslabel}{abbrtype}{initials}% - {\new@ifnextchar.\doendsentence\doendword} - {}% +\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{} } -\makeatother -\end{verbatim} -In the event that a full stop is found \cs{doendsentence} is -performed but it will be followed by the full stop, which needs to -be discarded. Otherwise \cs{doendword} will be done but it won't be -followed by a full stop so there's nothing to discard. The +\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{verbatim} -\newcommand{\doendsentence}[1]{\spacefactor=10000{}} -\newcommand{\doendword}{\spacefactor=1000{}} -\end{verbatim} -Now, I can just do \verb|\gls{bsc}| mid-sentence and -\verb|\gls{phd}.| at the end of the sentence. The terminating full -stop will be discarded in the latter case, but it won't be discarded -in, say, \verb|\gls{laser}.| as that doesn't have the -\texttt{abbrtype} field set to \qt{initials}. - -This also works on first use when the style is set to one of the +\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 -full stop shouldn't be discarded. Since \ics{glspostlinkhook} is -used after the \firstuseflag\ has been unset for the entry, this -can't be fixed by simply checking with \ics{ifglsused}. One possible -solution to this is to redefine \ics{glslinkpostsetkeys} to check -for the \firstuseflag\ and define a macro that can then be used in -\ics{glspostlinkhook}. +\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 \cs{doendsentence} -(using \ics{glsifplural}) and put the full stop back if the plural +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 @@ -9935,263 +21954,317 @@ The complete document is contained in the sample file \section{Displaying the List of Acronyms} \label{sec:disploa} -The list of acronyms is just like any other type of glossary and can -be displayed on its own using: -\begin{description} -\itempar{\opt1:} -\begin{alltt} -\ics{printnoidxglossary}[type=\ics{acronymtype}] -\end{alltt} - -\itempar{\optsand23:} -\begin{alltt} -\ics{printglossary}[type=\ics{acronymtype}] -\end{alltt} - -(If you use the -\pkgopt{acronym} package option you can also use -\begin{alltt} -\ics{printacronyms}\oarg{options} -\end{alltt} -as a synonym for -\begin{alltt} -\ics{printglossary}[type=\ics{acronymtype},\meta{options}] -\end{alltt} +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}.) -\end{description} -Alternatively the list of acronyms can be displayed with all the other -glossaries using: -\begin{description} -\item[\opt1:] \ics{printnoidxglossaries} +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}). -\item[\optsand23:] \ics{printglossaries} -\end{description} +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. -However, care must be taken to choose a glossary style that's -appropriate to your acronym style. +\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 glossary Package} +\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 \styfmt{glossaries} package. In addition, the old +replacement \sty{glossaries} package. In addition, the old \sty{glossary} package created the command -\cs{}\meta{acr-name} when defining the acronym \meta{acr-name}. - -In order to facilitate migrating from the old package to the new -one, the \styfmt{glossaries} package\footnote{as from version 1.18} -provides the command: -\begin{definition}[\DescribeMacro{\oldacronym}] -\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list} -\end{definition} +\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{display} -\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long} -\end{display} -In addition, \ics{oldacronym} also defines the commands -\cs{}\meta{label}, which is equivalent to \ics{gls}\marg{label}, -and \cs{}\meta{label}\texttt{*}, which is equivalent to -\ics{Gls}\marg{label}. If \meta{label} is omitted, \meta{abbrv} -is used. Since commands names must consist only of alphabetical -characters, \meta{label} must also only consist of alphabetical -characters. Note that \cs{}\meta{label} doesn't allow you to use -the first optional argument of \ics{gls} or \ics{Gls} --- you will -need to explicitly use \ics{gls} or \ics{Gls} to change the -settings. +\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 -\cs{}\meta{label} unless you additionally load the -\sty{xspace} package, but be aware that there are some issues with -using \sty{xspace}.\footnotemark -\end{important} -\footnotetext{See David Carlisle's explanation in +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}} +of xspace}.) +\end{important} -The \styfmt{glossaries} package doesn't load the \sty{xspace} package +The \sty{glossaries} package doesn't load the \sty{xspace} package since there are both advantages and disadvantages to using -\ics{xspace} in \cs{}\meta{label}. If you don't use the -\sty{xspace} package you need to explicitly force a space using -\verb*|\ | (backslash space) however you can follow \cs{}\meta{label} -with additional text in square brackets (the final optional -argument to \ics{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 \ics{gls}). +\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{verbatim} -\oldacronym{abc}{example acronym}{} -\end{verbatim} -This will create the command \cs{abc} and its starred version -\cs{abc*}. \Tableref{tab:xspace} illustrates the effect of -\cs{abc} (on subsequent use) according to whether or not the +\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 xspace]{The effect of using -\styfmt{xspace} with \cs{oldacronym}} +\caption{The effect of using \stytext{xspace} with \glsfmttext{oldacronym}} \label{tab:xspace} -\vskip\baselineskip \centering \begin{tabular}{lll} -\bfseries Code & \bfseries With \styfmt{xspace} & -\bfseries Without \styfmt{xspace}\\ -\verb|\abc.| & abc. & abc.\\ -\verb|\abc xyz| & abc xyz & abcxyz\\ -\verb|\abc\ xyz| & abc xyz & abc xyz\\ -\verb|\abc* xyz| & Abc xyz & Abc xyz\\ -\verb|\abc['s] xyz| & abc ['s] xyz & abc's xyz +\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} -\par \end{table} \chapter{Unsetting and Resetting Entry Flags} \label{sec:glsunset} -When using the \glslike\ commands it is -possible that you may want to use the value given by the -\gloskey{first} key, even though you have already \glslink{firstuse}{used} the glossary -entry. Conversely, you may want to use the value given by the -\gloskey{text} key, even though you haven't used the glossary entry. +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: -\begin{definition}[\DescribeMacro{\glsreset}] -\cs{glsreset}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glslocalreset}] -\cs{glslocalreset}\marg{label} -\end{definition} -while the latter can be achieved by one of the following commands: -\begin{definition}[\DescribeMacro{\glsunset}] -\cs{glsunset}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro{\glslocalunset}] -\cs{glslocalunset}\marg{label} -\end{definition} -You can also reset or unset all entries for a given glossary or list of -glossaries using: -\begin{definition}[\DescribeMacro{\glsresetall}] -\cs{glsresetall}\oarg{glossary list} -\end{definition} -\begin{definition}[\DescribeMacro{\glslocalresetall}] -\cs{glslocalresetall}\oarg{glossary list} -\end{definition} -\begin{definition}[\DescribeMacro{\glsunsetall}] -\cs{glsunsetall}\oarg{glossary list} -\end{definition} -\begin{definition}[\DescribeMacro{\glslocalunsetall}] -\cs{glslocalunsetall}\oarg{glossary list} -\end{definition} -where \meta{glossary list} is a comma-separated list of -glossary labels. If omitted, all defined glossaries are assumed -(except for the ignored ones). -For example, to reset all entries in the main glossary and the -list of acronyms: -\begin{verbatim} -\glsresetall[main,acronym] -\end{verbatim} +\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} -You can determine whether an entry's \gls{firstuseflag} is set using: -\begin{definition}[\DescribeMacro{\ifglsused}] -\cs{ifglsused}\marg{label}\marg{true part}\marg{false part} -\end{definition} -where \meta{label} is the label of the required entry. If the -entry has been used, \meta{true part} will be done, otherwise -\meta{false part} will be done. +\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} -Note that \cs{ifglsused} is unreliable with \gls{bib2gls} as the -entry isn't defined on the first \LaTeX\ run, which means there's no -way of determining if it has been used, so -\gls{glossaries-extra} provides a similar command: -\begin{definition} -\ics*{GlsXtrIfUnusedOrUndefined}\marg{label}\marg{true part}\marg{false part} -\end{definition} +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 \glslike\ commands within an +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 first use displayed -text is different from subsequent use. +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 \firstuseflag\ -will be unset on the first overlay and subsequent overlays will use -the non-first use form. +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{verbatim} -\documentclass{beamer} - -\usepackage{glossaries} - -\newacronym{svm}{SVM}{support vector machine} - -\begin{document} - -\begin{frame} - \frametitle{Frame 1} - - \begin{itemize} - \item<+-> \gls{svm} - \item<+-> Stuff. - \end{itemize} -\end{frame} - -\end{document} -\end{verbatim} - -On the first overlay, \verb|\gls{svm}| produces \qt{support vector -machine (SVM)} and then unsets the \firstuseflag. When the second -overlay is processed, \verb|\gls{svm}| now produces \qt{SVM}, which +\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 two suggestions. +this and I can only offer the following suggestions. -Firstly, unset all acronyms at the start of the document and -explicitly use \ics{acrfull} when you want the full version to be +\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{verbatim} -\documentclass{beamer} - -\usepackage{glossaries} +\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} -\newacronym{svm}{SVM}{support vector machine} - -\glsunsetall - -\begin{document} -\begin{frame} - \frametitle{Frame 1} - - \begin{itemize} - \item<+-> \acrfull{svm} - \item<+-> Stuff. - \end{itemize} -\end{frame} -\end{document} -\end{verbatim} +\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} -Secondly, explicitly reset each acronym on first use: -\begin{verbatim} -\begin{frame} - \frametitle{Frame 1} - - \begin{itemize} - \item<+-> \glsreset{svm}\gls{svm} - \item<+-> Stuff. - \end{itemize} -\end{frame} -\end{verbatim} 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 @@ -10200,859 +22273,1194 @@ 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 \styfmt{glossaries} package now +their contents multiple times, but the \sty{glossaries} package now checks for this. For \sty{tabularx}, you need to explicitly patch it -by placing \cs{glspatchtabularx} in the preamble (or anywhere -before the problematic use of \envfmt{tabularx}). - -\begin{xtr} -If you need to use commands like \cs{gls} in any problematic context -that interferes with the \gls{firstuseflag}, then you can try using -the buffering system provided with \gls{glossaries-extra}. See the -\qt{First Use Flag} section of the \gls{glossaries-extra} manual. -\end{xtr} +by placing \gls{glspatchtabularx} in the \idx{documentpreamble} (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} -As from version 4.14, it's now possible to keep track of how many -times an entry is used. That is, how many times the \firstuseflag\ -is unset. Note that the supplemental \gls{glossaries-extra} package improves -this function and also provides per-unit counting, which isn't -available with the \styfmt{glossaries} package. +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 -\ics{newglossaryentry} (and therefore \ics{newacronym}) into -a~preamble-only command. +\gls{newglossaryentry} (and therefore \gls{newacronym}) into +a~\idx+{documentpreamble}-only command. \end{important} -To enable this function, use -\begin{definition}[\DescribeMacro\glsenableentrycount] -\cs{glsenableentrycount} -\end{definition} -before defining your entries. This adds two extra (internal) fields -to entries: \texttt{currcount} and \texttt{prevcount}. - -The \texttt{currcount} field keeps track of how many times -\cs{glsunset} is used within the document. A~local unset (using -\cs{glslocalunset}) performs a~local rather than global increment to -\texttt{currcount}. Remember that not all commands use -\cs{glsunset}. Only the \glslike\ commands do this. The reset -commands \cs{glsreset} and \cs{glslocalreset} reset this field back -to zero (where \cs{glslocalreset} performs a~local change). - -The \texttt{prevcount} field stores the final value of the -\texttt{currcount} field \emph{from the previous run}. This value is -read from the \filetype{aux} file at the beginning of the +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 -\begin{definition}[\DescribeMacro\glsentrycurrcount] -\cs{glsentrycurrcount}\marg{label} -\end{definition} -for the \texttt{currcount} field, and -\begin{definition}[\DescribeMacro\glsentryprevcount] -\cs{glsentryprevcount}\marg{label} -\end{definition} -for the \texttt{prevcount} field. +\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 \cs{glsenableentrycount}. +These commands are only defined if you have used \gls{glsenableentrycount}. \end{important} For example: -\begin{verbatim} -\documentclass{article} -\usepackage{glossaries} -\makeglossaries - -\glsenableentrycount - -\newglossaryentry{apple}{name=apple,description={a fruit}} - -\begin{document} -Total usage on previous run: \glsentryprevcount{apple}. - -\gls{apple}. \gls{apple}. \glsadd{apple}\glsentrytext{apple}. -\glslink{apple}{apple}. \glsdisp{apple}{apple}. \Gls{apple}. - -Number of times apple has been used: \glsentrycurrcount{apple}. -\end{document} -\end{verbatim} -On the first \LaTeX\ run, \verb|\glsentryprevcount{apple}| +\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, -\verb|\glsentrycurrcount{apple}| produces~4. This is because +\code{\gls{glsentryprevcount}\marg{apple}} produces~4. This is because the only commands that have incremented the entry count are those -that use \cs{glsunset}. That is: \cs{gls}, \cs{glsdisp} and -\cs{Gls}. The other commands used in the above example, \cs{glsadd}, -\cs{glsentrytext} and \cs{glslink}, don't use \cs{glsunset} so they +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, -\verb|\glsentryprevcount{apple}| now produces~4 as that was the -value of the \texttt{currcount} field for the \texttt{apple} entry +\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 \cs{glsenableentrycount}, you +When you enable the entry count using \gls{glsenableentrycount}, you also enable the following commands: -\begin{definition}[\DescribeMacro\cgls] -\cs{cgls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -(no case-change, singular) -\begin{definition}[\DescribeMacro\cglspl] -\cs{cglspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -(no case-change, plural) -\begin{definition}[\DescribeMacro\cGls] -\cs{cGls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -(first letter uppercase, singular), and -\begin{definition}[\DescribeMacro\cGlspl] -\cs{cGlspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -(first letter uppercase, plural). -These all have plus and starred variants like the analogous -\cs{gls}, \cs{glspl}, \cs{Gls} and \cs{Glspl} commands. - -If you don't use \cs{glsenableentrycount}, these commands behave -like \cs{gls}, \cs{glspl}, \cs{Gls} and \cs{Glspl}, -respectively, only there will be a warning that you haven't enabled -entry counting. If you have enabled entry counting with -\cs{glsenableentrycount} then these commands test if -\cs{glsentryprevcount}\marg{label} equals~1. If it doesn't then the -analogous \cs{gls} etc will be used. If it does, then the first optional +\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{alltt} -\meta{cs format}\marg{label}\marg{insert}\cs{glsunset}\marg{label} -\end{alltt} +\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 -\cs{cgls}, \cs{cglspl}, \cs{cGls} or \cs{cGlspl}. - -\begin{definition}[\DescribeMacro\cglsformat] -\cs{cglsformat}\marg{label}\marg{insert} -\end{definition} -This command is used by \cs{cgls} and defaults to -\begin{alltt} -\cs{glsentrylong}\marg{label}\meta{insert} -\end{alltt} -if the entry given by -\meta{label} has a~long form or -\begin{alltt} -\cs{glsentryfirst}\marg{label}\meta{insert} -\end{alltt} +\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. -\begin{definition}[\DescribeMacro\cglsplformat] -\cs{cglsplformat}\marg{label}\marg{insert} -\end{definition} -This command is used by \cs{cglspl} and defaults to -\begin{alltt} -\cs{glsentrylongpl}\marg{label}\meta{insert} -\end{alltt} -if the entry given by -\meta{label} has a~long form or -\begin{alltt} -\cs{glsentryfirstplural}\marg{label}\meta{insert} -\end{alltt} +\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. -\begin{definition}[\DescribeMacro\cGlsformat] -\cs{cGlsformat}\marg{label}\marg{insert} -\end{definition} -This command is used by \cs{cGls} and defaults to -\begin{alltt} -\cs{Glsentrylong}\marg{label}\meta{insert} -\end{alltt} -if the entry given by \meta{label} has a~long form or -\begin{alltt} -\cs{Glsentryfirst}\marg{label}\meta{insert} -\end{alltt} +\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. -\begin{definition}[\DescribeMacro\cGlsplformat] -\cs{cGlsplformat}\marg{label}\marg{insert} -\end{definition} -This command is used by \cs{cGlspl} and defaults to -\begin{alltt} -\cs{Glsentrylongpl}\marg{label}\meta{insert} -\end{alltt} -if the entry given by \meta{label} has a~long form or -\begin{alltt} -\cs{Glsentryfirstplural}\marg{label}\meta{insert} -\end{alltt} +\cmddef{cGlsplformat} +This command is used by \gls{cGlspl} and defaults to +\begin{compactcodebox} +\cmddef{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 hyperlinked with the \cs{cgls}-like commands and they -won't add a~line to the external glossary file. If you haven't used -any of the other commands that add information to the glossary file -(such as \cs{glsadd} or the \glstextlike\ commands) then the entry -won't appear in the glossary. - -Remember that since these commands use \cs{glsentryprevcount} you +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 order is now (at least): \texttt{(pdf)latex}, -\texttt{(pdf)latex}, \texttt{makeglossaries}, \texttt{(pdf)latex}. - -\begin{example}{Don't index entries that are only used once}{sec:entrycount} -In this example, the abbreviations that have only been used once (on the previous run) -only have their long form shown with \cs{cgls}. -\begin{verbatim} -\documentclass{article} - -\usepackage[colorlinks]{hyperref} -\usepackage[acronym]{glossaries} -\makeglossaries - -\glsenableentrycount - -\setacronymstyle{long-short} - -\newacronym{html}{HTML}{hypertext markup language} -\newacronym{css}{CSS}{cascading style sheets} -\newacronym{xml}{XML}{extensible markup language} -\newacronym{sql}{SQL}{structured query language} -\newacronym{rdbms}{RDBMS}{relational database management system} -\newacronym{rdsms}{RDSMS}{relational data stream management system} - -\begin{document} -These entries are only used once: \cgls{sql}, \cgls{rdbms}, -\cgls{xml}. These entries are used multiple times: -\cgls{html}, \cgls{html}, \cgls{css}, \cgls{css}, \cgls{css}, -\cgls{rdsms}, \cgls{rdsms}. - -\printglossaries -\end{document} -\end{verbatim} -After a complete document build (\texttt{latex}, \texttt{latex}, -\texttt{makeglossaries}, \texttt{latex}) the list of abbreviations only +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 the following document, 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~hyperlink. -\end{example} - -Remember that if you don't like typing \cs{cgls} you can create a -synonym. For example -\begin{verbatim} -\let\ac\cgls -\end{verbatim} +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}^^J% +\cmd{usepackage}[acronym]\marg{glossaries}^^J% +\gls{makeglossaries} +\codepar +\gls{glsenableentrycount} +\codepar +\gls{setacronymstyle}\marg{long-short} +\codepar +\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup +language}^^J% +\gls{newacronym}\marg{css}\marg{CSS}\marg{cascading style +sheets}^^J% +\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup +language}^^J% +\gls{newacronym}\marg{sql}\marg{SQL}\marg{structured query +language}^^J% +\gls{newacronym}\marg{rdbms}\marg{RDBMS}\marg{relational database +management system}^^J% +\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},^^J% +\gls{cgls}\marg{xml}. These entries are used multiple times:^^J% +\gls{cgls}\marg{html}, \gls{cgls}\marg{html}, \gls{cgls}\marg{css}, +\gls{cgls}\marg{css}, \gls{cgls}\marg{css},^^J% +\gls{cgls}\marg{rdsms}, \gls{cgls}\marg{rdsms}. +\codepar +\gls{printglossaries} +} +\end{resultbox} \begin{bib2gls} -With \gls{bib2gls} there's an analogous record counting set of -commands. See \gls{glossaries-extra} and \gls{bib2gls} manuals for further details. +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 glossaries may be displayed using: -\begin{description} -\item[\opt1:] -(Must be used with \ics{makenoidxglossaries} in the preamble.) -\begin{definition}[\DescribeMacro\printnoidxglossaries] -\cs{printnoidxglossaries} -\end{definition} -which internally uses \cs{printnoidxglossary} for each glossary. - -\item[\optsand23:] -(Must be used with \ics{makeglossaries} in the preamble.) -\begin{definition}[\DescribeMacro\printglossaries] -\cs{printglossaries} -\end{definition} -which internally uses \cs{printglossary} for each glossary. - -\item[\optsto46:] (\gls{glossaries-extra} only) -\begin{definition}[\DescribeMacro\printunsrtglossaries] -\cs{printunsrtglossaries} -\end{definition} -which internally uses \cs{printunsrtglossary} for each glossary. -\end{description} -These commands will display all the glossaries in the order in which -they were defined. - -Note that, in the case of \optsand23, no glossaries will appear -until you have either used the Perl script \gls{makeglossaries} or -Lua script \gls{makeglossaries-lite.lua} or have directly used -\gls{makeindex} or \gls{xindy} (as described in -\sectionref{sec:makeglossaries}). In the case of \opt4, no glossary -will appear until you have used \gls{bib2gls}. +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{documentpreamble}): +\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}. This command iterates over a list of +\idx{entry} labels, which it will have to first sort with +\opteqvalref{sort}{standard}. The list will only include those +\idxpl{entry} that have been \indexed\ and the appropriate +\idx{glossary} markup is added within the loop. This makes it +unsuitable for the tabular-like \idxpl{glossarystyle}, such as +\glostyle{long} and \glostyle{super}. + +The following is an iterative command: +\cmddef{printnoidxglossaries} +which internally uses \gls{printnoidxglossary} for each +non-\idx{ignoredglossary}. + +\options{mkidx,xdy} +(must be used with \gls{makeglossaries} in the \idxf{documentpreamble}): +\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}. See \sectionref{sec:makeglossaries} for information +on how to create the \idx{glossaryfile}. + +The following is an iterative command: +\cmddef{printglossaries} +which internally uses \gls{printglossary} for each +non-\idx{ignoredglossary}. \begin{important} -While the external files are missing, \cs{printglossary} will just do -\ics{null} for each missing glossary to assist dictionary style -documents that just use \cs{glsaddall} without inserting any text. -This use of \ics{null} ensures that all indexing information is +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 -files are present \cs{null} will no longer be used. This can cause a -spurious blank page on the first \LaTeX\ run before the glossary -files have been created. Once these files are present, \cs{null} +\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. +final document. With \sty{glossaries-extra}, placeholder text is +used instead. \end{important} -\begin{xtr} -If you use \gls{glossaries-extra}, it will insert a heading and boilerplate text when the -external files are missing. See the -\gls{glossaries-extra} manual for further details. -\end{xtr} - -If the glossary still does not appear after you re-\LaTeX\ your -document, check the \gls*{makeindex}, \gls*{xindy} or \gls*{bib2gls} -log files, as applicable, to see if there is a problem. With \opt1, -you just need two \LaTeX\ runs to make the glossaries appear, but -you may need further runs to make the \glspl{numberlist} up-to-date. +\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, 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}, the \idx{glossary} markup is +inserted during the loop but, unlike that command, +\gls{printunsrtglossary} performs the loop outside of the +\idx{glossarystyle}, which means that there are no issues with the +tabular-like styles. See the \sty{glossaries-extra} manual for +further details. -An individual glossary can be displayed using: -\begin{description} -\itempar{\opt1:} -\begin{definition}[\DescribeMacro{\printnoidxglossary}] -\cs{printnoidxglossary}\oarg{options} -\end{definition} -(Must be used with \ics{makenoidxglossaries} in the preamble.) - -\itempar{\optsand23:} -\begin{definition}[\DescribeMacro{\printglossary}] -\cs{printglossary}\oarg{options} -\end{definition} -(Must be used with \ics{makeglossaries} in the preamble.) - -\itempar{\optsto46:} -\begin{definition} -\ics*{printunsrtglossary}\oarg{options} -\end{definition} -(May be used with or without \gls{bib2gls}.) -\end{description} -where \meta{options} is a \meta{key}=\meta{value} list of options. -(Again, when the associated external file is missing, \cs{null} is -inserted into the document.) +The following is an iterative command: +\cmddef{printunsrtglossaries} +which internally uses \gls{printunsrtglossary} for each +non-\idx{ignoredglossary}. -\begin{xtr} -The \gls{glossaries-extra} package also provides -\begin{definition} -\ics*{printunsrtinnerglossary}\oarg{options}\marg{pre -code}\marg{post code} -\end{definition} +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: -\gallery{index.php?label=bib2gls-inner}{Inner or Nested Glossaries}. -See the \gls{glossaries-extra} package for further details. -\end{xtr} - -The following keys are available in \marg{options}: -\begin{description} -\item[{\gloskey[printglossary]{type}}] The value of this key -specifies which glossary to print. If omitted, the default -glossary is assumed. For example, to print the list of acronyms: -\begin{verbatim} -\printglossary[type=\acronymtype] -\end{verbatim} -Note that you can't display an ignored glossary, so don't try -setting \gloskey[printglossary]{type} to the name of a glossary that -was defined using \ics{newignoredglossary}, described in -\sectionref{sec:newglossary}. (You can display an ignored glossary -with \ics*{printunsrtglossary} provided by \gls{glossaries-extra}.) - -\item[{\gloskey[printglossary]{title}}] This is the glossary's -title (overriding the title specified when the glossary was -defined). - -\item[{\gloskey[printglossary]{toctitle}}] This is the title -to use for the table of contents (if the \pkgopt{toc} package -option has been used). It may also be used for the page header, -depending on the page style. If omitted, the value of -\gloskey[printglossary]{title} is used. - -\item[{\gloskey[printglossary]{style}}] This specifies which -glossary style to use for this glossary, overriding the effect -of the \pkgopt{style} package option or \ics{glossarystyle}. - -\item[{\gloskey[printglossary]{numberedsection}}] This specifies -whether to use a numbered section for this glossary, overriding -the effect of the \pkgopt{numberedsection} package option. This -key has the same syntax as the \pkgopt{numberedsection} package -option, described in \sectionref{sec:pkgopts-sec}. - -\item[{\gloskey[printglossary]{nonumberlist}}] This is a boolean -key. If true (\verb|nonumberlist=true|) the numberlist is suppressed -for this glossary. If false (\verb|nonumberlist=false|) the -numberlist is displayed for this glossary. - -\item[{\gloskey[printglossary]{nogroupskip}}] This is a boolean -key. If true the vertical gap between groups -is suppressed for this glossary. - -\item[{\gloskey[printglossary]{nopostdot}}] This is a boolean -key. If true the full stop after the description -is suppressed for this glossary. - -\item[{\gloskey[printglossary]{entrycounter}}] This is a boolean -key. Behaves similar to the package option of the same name. -The corresponding package option must be used to make \ics{glsrefentry} -work correctly. - -\item[{\gloskey[printglossary]{subentrycounter}}] This is a boolean -key. Behaves similar to the package option of the same name. If you -want to set both \gloskey{entrycounter} and -\gloskey{subentrycounter}, make sure you specify -\gloskey{entrycounter} first. The corresponding package option must -be used to make \ics{glsrefentry} work correctly. - -\item[{\gloskey[printnoidxglossary]{sort}}] This key is only -available for \opt1. Possible values are: \texttt{word} (word -order), \texttt{letter} (letter order), \texttt{standard} (word or -letter ordering taken from the \pkgopt{order} package option), -\texttt{use} (order of use), \texttt{def} (order of definition) -\texttt{nocase} (case-insensitive) or \texttt{case} (case-sensitive). -Note that the word and letter comparisons (that is, everything other -than \texttt{sort=use} and \texttt{sort=def}) just use a simple -character code comparison. For a locale-sensitive sort, you must use -either \gls{xindy} (\opt3) or \gls{bib2gls} (\opt4). Note that \gls{bib2gls} -provides many other sort options. +\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, 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 \texttt{use} or \texttt{def} values make sure -that you select a glossary style that doesn't have a visual +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 \pkgopt{nogroupskip} option. +Consider using the \opt{nogroupskip} option. \end{important} -{\raggedright -The word and letter order sort methods use -\sty{datatool}'s -\ics{dtlwordindexcompare} and \ics{dtlletterindexcompare} handlers. -The case-insensitive sort method uses \sty{datatool}'s -\ics{dtlicompare} handler. The case-sensitive sort method uses -\sty{datatool}'s \ics{dtlcompare} handler. See the \sty{datatool} +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 sort using simple character code comparisons +and are therefore unsuitable for non-\idx{ascii} documents. + +For a locale-sensitive sort, you must 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. + +\optionvaldef{printgloss.sort}{letter} +Letter order. + +\optionvaldef{printgloss.sort}{standard} +Word or letter order according to the \opt{order} +package option. + +The word and letter order sort methods use \sty{datatool}['s] +\gls{dtlwordindexcompare} and \gls{dtlletterindexcompare} handlers. +The case-insensitive sort method uses \sty{datatool}['s] +\gls{dtlicompare} handler. The case-sensitive sort method uses +\sty{datatool}['s] \gls{dtlcompare} handler. See the \sty{datatool} documentation for further details. -\par} - -If you don't get an error with \texttt{sort=use} and -\texttt{sort=def} but you do get an error with one of the other sort -options, then you probably need to use the -\pkgopt[true]{sanitizesort} package option or make sure none of the -entries have fragile commands in their \gloskey{sort} field. - -\item[{\xtrprintglosskey[\marg{label}]{label}}] -This key is only available with \gls{glossaries-extra} and labels -the glossary with \cs{label}\marg{label}. This is an alternative to -the package option \pkgopt[autolabel]{numberedsection} - -\item[{\xtrprintglosskey[\marg{boolean}]{target}}] This boolean key is only -available with \gls{glossaries-extra} and can be used to switch -off the automatic hypertarget for each entry. (This refers to the -target used by commands like \cs{gls} and \cs{glslink}.) - -This option is useful with \ics*{printunsrtglossary} as it allows -the same list (or sub-list) of entries to be displayed multiple + +\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. -\item[{\xtrprintglosskey[\marg{prefix}]{prefix}}] -This key is only available with \gls{glossaries-extra} and provides +\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 -\ics{glolinkprefix} but note this will also affect the target for any entry -referenced within the glossary with commands like \cs{gls}, -\cs{glslink} or \cs{glshypertarget}. - -\item[{\xtrprintglosskey[\marg{prefix}]{targetnameprefix}}] -This key is only available with \gls{glossaries-extra}. -This is similar to the \pkgoptfmt{prefix} option, but it alters the prefix of -the hypertarget anchors without changing \ics{glslinkprefix} (so it -won't change the hyperlinks for any entries referenced in the -glossary). - -\item[{\xtrprintglosskey[\marg{boolean}]{groups}}] -This boolean key is only available with \gls{glossaries-extra} and, -if true, will attempt to perform group formation. See the -\gls{glossaries-extra} manual for further details. - -\item[{\xtrprintglosskey[\marg{n}]{leveloffset}}] -This key is only available with \ics*{printunsrtglossary}. +\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 -hierarchical level used by the glossary style. See the -\gls{glossaries-extra} manual for further details. -\end{description} - -By default, the glossary is started either by \ics{chapter*} or by -\ics{section*}, depending on whether or not \ics{chapter} is defined. -This can be overridden by the \pkgopt{section} package option or the -\ics{setglossarysection} command. Numbered sectional units can be -obtained using the \pkgopt{numberedsection} package option. Each -glossary sets the page header via the command -\begin{definition}[\DescribeMacro\glsglossarymark] -\ics{glsglossarymark}\marg{title} -\end{definition} -If this mechanism is unsuitable for your chosen class file or page -style package, you will need to redefine \ics{glsglossarymark}. Further -information about these options and commands is given in +\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. -Information can be added to the start of the glossary (after the -title and before the main body of the glossary) by redefining -\begin{definition}[\DescribeMacro{\glossarypreamble}] -\cs{glossarypreamble} -\end{definition} -For example: -\begin{verbatim} -\renewcommand{\glossarypreamble}{Numbers in italic +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{glossarypreamble} 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{verbatim} -This needs to be done before the glossary is displayed. - -If you want a different preamble per glossary you can use -\begin{definition}[\DescribeMacro{\setglossarypreamble}] -\cs{setglossarypreamble}\oarg{type}\marg{preamble text} -\end{definition} -If \meta{type} is omitted, \cs{glsdefaulttype} is used. - +\end{codebox} +A \idx{glossary} may have its own specific \idx{glossarypreamble}. If it has one +defined, then the \gls{print...glossary} set of commands will +locally redefine \gls{glossarypreamble} to that \idx{glossarypreamble} instead. +Since this change is scoped, the previous definition will be +restored after the \gls{print...glossary} command. + +You can globally assign a \idx{glossarypreamble} to a specific \idx{glossary} with: +\cmddef{setglossarypreamble} +If \meta{type} is omitted, \gls{glsdefaulttype} is used. For example: -\begin{verbatim} -\setglossarypreamble{Numbers in italic +\begin{codebox} +\gls{setglossarypreamble}\marg{Numbers in italic indicate primary definitions.} -\end{verbatim} -This will print the given preamble text for the main glossary, -but not have any preamble text for any other glossaries. - -There is an analogous command to \cs{glossarypreamble} called -\begin{definition}[\DescribeMacro{\glossarypostamble}] -\cs{glossarypostamble} -\end{definition} -which is placed at the end of each glossary. +\end{codebox} +This will set the given \idx{glossarypreamble} 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{glossarypreamble} for the specific +\idx{glossary} and +\cmddef{pretoglossarypreamble} +which locally prepends \meta{text} to the \idx{glossarypreamble} 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{glossarypreamble} and so there's no analogous +command to \gls{setglossarypreamble}. + +\begin{information} +The \idx{glossarypreamble} 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\footnote{you can't use the \glostyle{longheaderborder} style -for this example as you can't use the \env{longtable} environment in -two column mode.}, and you want the glossary to be in two columns, -but after the glossary you want to switch back to one column mode, -you could do: -\begin{verbatim} -\renewcommand*{\glossarysection}[2][]{% - \twocolumn[{\chapter*{#2}}]% - \setlength\glsdescwidth{0.6\linewidth}% - \glsglossarymark{\glossarytoctitle}% +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{} } - -\renewcommand*{\glossarypostamble}{\onecolumn} -\end{verbatim} - +\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} -Within each glossary, each entry name is formatted according to -\begin{definition}[\DescribeMacro{\glsnamefont}] -\cs{glsnamefont}\marg{name} -\end{definition} -which takes one argument: the entry name. This command is always -used regardless of the glossary style. By default, \cs{glsnamefont} -simply displays its argument in whatever the surrounding font -happens to be. This means that in the list-like glossary styles -(defined in the \sty{glossary-list} style file) the name will appear -in bold, since the name is placed in the optional argument of -\cs{item}, whereas in the tabular styles (defined in the -\sty{glossary-long} and \sty{glossary-super} style files) the name -will appear in the normal font. The hierarchical glossary styles -(defined in the \sty{glossary-tree} style file) also set the name in -bold. - -If you want to change the font for the description, or if you -only want to change the name font for some types of entries -but not others, you might want to consider using the -\gls{glossaries-extra} package. - -\begin{example}{Changing the Font Used to Display Entry Names in the -Glossary}{ex:glsnamefont} -Suppose you want all the entry names to appear in -medium weight small caps in your glossaries, then you can do: -\begin{verbatim} -\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}} -\end{verbatim} -\end{example} - -\begin{xtr} -The \gls{glossaries-extra} package provides additional hooks that -can be used to make other minor adjustments. -\end{xtr} - -The letter group titles (which are displayed for styles like -\glostyle{indexgroup}) can be changed either by redefining the -corresponding \cs{\meta{group-label}groupname} commands, such as -\ics{glssymbolsgroupname}, (see \sectionref{sec:fixednames}) or by -using the \gls{glossaries-extra} commands \ics*{glsxtrsetgrouptitle} -and \ics*{glsxtrlocalsetgrouptitle}. The \meta{group-label} is -typically obtained by the \gls{indexingapp}. +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 glossary can be defined using: -\begin{definition}[\DescribeMacro{\newglossary}] -\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\linebreak\marg{title}\oarg{counter} -\end{definition} -where \meta{name} is the label to assign to this glossary. -The arguments \meta{in-ext} and \meta{out-ext} specify the extensions to -give to the input and output files for that glossary, \meta{title} -is the default title for this new glossary and the final optional -argument \meta{counter} specifies which counter to use for the -associated \glspl{numberlist} (see also -\sectionref{sec:numberlists}). The first optional argument specifies -the extension for the \gls{makeindex} (\opt2) or \gls{xindy} (\opt3) -transcript file (this information is only used by -\gls{makeglossaries} which picks up the information from the -auxiliary file). If you use \opt1, the \meta{log-ext}, -\meta{in-ext} and \meta{out-ext} arguments are ignored. +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} -The glossary label \meta{name} must not contain any active -characters. It's generally best to stick with just characters that -have category code~11 (typically the non-extended \glspl{latinchar} -for standard \LaTeX). +As with labels in general, \meta{glossary-label} must not contain any active +characters. \end{important} -There is also a starred version (new to v4.08): -\begin{definition}[\DescribeMacro{\newglossary*}] -\cs{newglossary*}\marg{name}\marg{title}\oarg{counter} -\end{definition} -which is equivalent to -\begin{alltt} -\cs{newglossary}[\meta{name}-glg]\marg{name}\{\meta{name}-gls\}\{\meta{name}-glo\}\ifpdf\linebreak\fi\marg{title}\oarg{counter} -\end{alltt} -or you can also use: -\begin{definition}[\DescribeMacro{\altnewglossary}] -\cs{altnewglossary}\marg{name}\marg{tag}\marg{title}\oarg{counter} -\end{definition} +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}. For the other +options, the \idx{indexing} information is written to the \ext{aux} +file for \options{noidx,b2g}. 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{alltt} -\cs{newglossary}[\meta{tag}-glg]\marg{name}\{\meta{tag}-gls\}\{\meta{tag}-glo\}\marg{title}\oarg{counter} -\end{alltt} +\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 glossary that doesn't create any associated files. -This is referred to as an \qt{ignored glossary} and it's ignored by -commands that iterate over all the glossaries, such as -\ics{printglossaries}. To define an ignored glossary, use -\begin{definition}[\DescribeMacro\newignoredglossary] -\cs{newignoredglossary}\marg{name} -\end{definition} -where \meta{name} is the name of the glossary (as above). This -glossary type will automatically be added to the -\pkgopt{nohypertypes} list, since there are no hypertargets for -the entries in an ignored glossary. +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 +\gls{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 \gls{glossaries-extra} package provides a starred version of -this command that allows hyperlinks (since ignored glossaries can be -useful with \gls{bib2gls}). There is also an analogous -\ics*{provideignoredglossary} command. +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 glossary is an ignored one using: -\begin{definition}[\DescribeMacro\ifignoredglossary] -\cs{ifignoredglossary}\marg{name}\marg{true}\marg{false} -\end{definition} -This does \meta{true} if \meta{name} was defined as an ignored -glossary, otherwise it does \meta{false}. - -Note that the main (default) glossary is automatically created as: -\begin{verbatim} -\newglossary{main}{gls}{glo}{\glossaryname} -\end{verbatim} -so it can be identified by the label \texttt{main} (unless the -\pkgopt{nomain} package option is used). Using the -\pkgopt{acronym} package option is equivalent to: -\begin{verbatim} -\newglossary[alg]{acronym}{acr}{acn}{\acronymname} -\end{verbatim} -so it can be identified by the label \texttt{acronym}. If you are -not sure whether the \pkgopt{acronym} option has been used, you -can identify the list of acronyms by the command -\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to -\texttt{acronym}, if the \pkgopt{acronym} option has been used, -otherwise it is set to \texttt{main}. Note that if you are using -the main glossary as your list of acronyms, you need to declare -it as a list of acronyms using the package option -\pkgopt{acronymlists}. - -The \pkgopt{symbols} package option creates a new glossary with the -label \texttt{symbols} using: -\begin{verbatim} -\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname} -\end{verbatim} -The \pkgopt{numbers} package option creates a new glossary with -the label \texttt{numbers} using: -\begin{verbatim} -\newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname} -\end{verbatim} -The \pkgopt{index} package option creates a new glossary with -the label \texttt{index} using: -\begin{verbatim} -\newglossary[ilg]{index}{ind}{idx}{\indexname} -\end{verbatim} +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} -\optsand23: all glossaries must be defined before \ics{makeglossaries} to -ensure that the relevant output files are opened. - -See \sectionref{sec:fixednames} if you want to redefine \cs{glossaryname}, -especially if you are using \sty{babel} or \sty{translator}. -(Similarly for \cs{glssymbolsgroupname} and -\cs{glsnumbersgroupname}.) If you want to redefine \ics{indexname}, +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 -\href{https://texfaq.org/FAQ-fixnam}{How to -change LaTeX’s \qt{fixed names}}. +\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 add a line to the glossary file without -generating any text at that point in the document using: -\begin{definition}[\DescribeMacro{\glsadd}] -\cs{glsadd}\oarg{options}\marg{label} -\end{definition} -This is similar to the \glstextlike\ commands, only it doesn't produce -any text (so therefore, there is no \gloskey[glslink]{hyper} key -available in \meta{options} but all the other options that can -be used with \glstextlike\ commands can be passed to \cs{glsadd}). - -This command essentially works like \cs{index} (provided by the -\LaTeX\ kernel) in that it doesn't produce text but it does add a -line with an associated location to the glossary file. In this case, -the \qt{encap} (the page encapsulator information) is specified with -the \gloskey{format} key. (See \sectionref{sec:encap}.) - -For example, to add a page range to the glossary number list for the -entry whose label is given by \texttt{set}: -\begin{verbatim} -\glsadd[format=(]{set} -Lots of text about sets spanning many pages. -\glsadd[format=)]{set} -\end{verbatim} +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}. To add all entries that have been defined, use: -\begin{definition}[\DescribeMacro{\glsaddall}] -\cs{glsaddall}\oarg{options} -\end{definition} -The optional argument is the same as for \cs{glsadd}, except -there is also a key \gloskey[glsaddall]{types} which can be -used to specify which glossaries to use. This should be a +\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 entries belonging to the list of acronyms (specified by -the glossary type \ics{acronymtype}) and a list of -notation (specified by the glossary type \texttt{notation}) then you can +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{verbatim} -\glsaddall[types={\acronymtype,notation}] -\end{verbatim} +\begin{codebox} +\gls{glsaddall}\oarg{\glsoptvalm{types}{\gls{acronymtype},notation}} +\end{codebox} \begin{bib2gls} -If you are using \gls{bib2gls} with \gls{glossaries-extra}, you -can't use \cs{glsaddall}. Instead use the \optfmt{selection=all} -resource option to select all entries in the given \filetype{bib} files. +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. \end{bib2gls} \begin{important} -Note that \cs{glsadd} and \cs{glsaddall} add the current location to -the \gls{numberlist}. In the case of \cs{glsaddall}, all entries in the -glossary will have the same location in the number list. If you want -to use \cs{glsaddall}, it's best to suppress the number list with -the \pkgopt{nonumberlist} package option. (See +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{documentpreamble}). 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} -There is now a variation of \cs{glsaddall} that skips any entries -that have been \glsdisp{firstuseflag}{marked as used}: -\begin{definition}[\DescribeMacro\glsaddallunused] -\cs{glsaddallunused}\oarg{list} -\end{definition} -This command uses \cs{glsadd}\texttt{[format=glsignore]} which will -ignore this location in the number list. (See \sectionref{sec:encap}.) -The optional argument \meta{list} is a comma-separated list of -glossary types. If omitted, it defaults to the list of all defined -glossaries. +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 +\glslink{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 \cs{glsaddallunused}, it's best to place the +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. Otherwise you could end up -with a spurious comma or dash in the location list. +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} -With \gls{glossaries-extra} and \gls{bib2gls}, \texttt{glsignore} -indicates an \qt{ignored location} which influences selection but -isn't added to the location list. In this case, if you use -\optfmt{selection=all} then only those entries that have been -explicitly indexed in the document will have location lists. The -other entries that were selected as a result of -\optfmt{selection=all} won't have location lists. +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. + +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{verbatim} -\documentclass{article} -\usepackage{glossaries} -\makeglossaries -\newglossaryentry{cat}{name={cat},description={feline}} -\newglossaryentry{dog}{name={dog},description={canine}} -\begin{document} -\gls{cat}. -\printglossaries -\glsaddallunused % <- make sure dog is also listed -\end{document} -\end{verbatim} -Corresponding \gls{glossaries-extra} and \gls{bib2gls} document code: -\begin{verbatim} -\documentclass{article} -\usepackage[record]{glossaries-extra} -\GlsXtrLoadResources[src={entries},selection=all] -\begin{document} -\gls{cat}. -\printunsrtglossaries -\end{document} -\end{verbatim} -With the file \texttt{entries.bib}: -\begin{verbatim} -@entry{cat,name={cat},description={feline}} -@entry{dog,name={dog},description={canine}} -\end{verbatim} +\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 \cs{glsadd} to -allow for an entry that should appear both in the main glossary and -in the list of acronyms. This example sets up the list of acronyms -using the \pkgopt{acronym} package option: -\begin{verbatim} -\usepackage[acronym]{glossaries} -\end{verbatim} -A new command is then defined to make it easier to define 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{verbatim} -\newcommand*{\newdualentry}[5][]{% - \newglossaryentry{main-#2}{name={#4},% - text={#3\glsadd{#2}},% - description={#5},% - #1 - }% - \newacronym{#2}{#3\glsadd{main-#2}}{#4}% +\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{verbatim} +\end{codebox} This has the following syntax: -\begin{alltt} -\ics{newdualentry}\oarg{options}\marg{label}\marg{abbrv}\marg{long}\marg{description} -\end{alltt} +\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{verbatim} -\newdualentry{svm}% label - {SVM}% abbreviation - {support vector machine}% long form - {Statistical pattern recognition technique}% description -\end{verbatim} -Now you can reference the acronym with \verb|\gls{svm}| or you can -reference the entry in the main glossary with \verb|\gls{main-svm}|. +\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. @@ -11062,11 +23470,11 @@ of the short forms start with a different letter to the associated long form, which may make it harder to lookup. \begin{bib2gls} -Note that with \gls{bib2gls}, there are special dual entry types +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 \cs{glsadd} with \gls{bib2gls}. -(Although it can still be useful, as shown in \opt6.) +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} @@ -11074,786 +23482,1777 @@ well. So there is less need for \cs{glsadd} with \gls{bib2gls}. \label{sec:crossref} \begin{important} -You must use \ics{makeglossaries} (\optsor23) or -\ics{makenoidxglossaries} (\opt1) \emph{before} defining any -terms that cross-reference entries. If any of the terms that you have -cross-referenced don't appear in the glossary, check that you have -put \cs{makeglossaries}\slash\cs{makenoidxglossaries} before all -entry definitions. The \gls{glossaries-extra} package provides -better cross-reference handling. +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 entries in the -glossary: +There are several ways of cross-referencing \idx{entry} in the +\idxpl{glossary}: \begin{enumerate} -\item You can use commands such as \ics{gls} in the +\item\label{itm.descsee} You can use commands such as \gls{gls} in the entries description. For example: -\begin{verbatim} -\newglossaryentry{apple}{name=apple, -description={firm, round fruit. See also \gls{pear}}} -\end{verbatim} +\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 -\gls{makeglossaries}: -\begin{prompt} +\app{makeglossaries}: +\begin{terminal} pdflatex filename makeglossaries filename pdflatex filename makeglossaries filename pdflatex filename -\end{prompt} -This is because the \cs{gls} in the description won't be detected -until the glossary has been created (unless the description is used -elsewhere in the document with \ics{glsentrydesc}). Take care not to -use \ics{glsdesc} (or \ics{Glsdesc}) in this case as it will cause a +\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 As described in \sectionref{sec:newglosentry}, you can use the +\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{verbatim} -\newglossaryentry{MaclaurinSeries}{name={Maclaurin -series}, -description={Series expansion}, -see={TaylorsTheorem}} -\end{verbatim} -Note that in this case, the entry with the \gloskey{see} key will -automatically be added to the glossary, but the cross-referenced -entry won't. You therefore need to ensure that you use the +\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{documentpreamble}. + +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 \ics{seename}, but can be +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{verbatim} -\newglossaryentry{MaclaurinSeries}{name={Maclaurin -series}, -description={Series expansion}, -see=[see also]{TaylorsTheorem}} -\end{verbatim} +\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 \ics{newacronym} or \ics{newterm} as the value will need to be +as \gls{newacronym} or \gls{newterm} as the value will need to be grouped. For example: -\begin{verbatim} -\newterm{seal} -\newterm[see={[see also]seal}]{sea lion} -\end{verbatim} +\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{verbatim} -\glossaryentry{lemon}{ - name={lemon}, - description={Yellow citrus fruit} +\begin{codebox} +\gls{glossaryentry}\marg{lemon} +\marg{ + \gloskeyval{name}{lemon}, + \gloskeyval{description}{Yellow citrus fruit} } -\glossaryentry{lime} -{ - name={lime}, - description={Green citrus fruit} +\gls{glossaryentry}\marg{lime} +\marg{ + \gloskeyval{name}{lime}, + \gloskeyval{description}{Green citrus fruit} } -\glossaryentry{citrus} -{ - name={citrus}, - description={Plant in the Rutaceae family}, - see={lemon,lime} +\gls{glossaryentry}\marg{citrus} +\marg{ + \gloskeyval{name}{citrus}, + \gloskeyval{description}{Plant in the Rutaceae family}, + \gloskeyval{see}{lemon,lime} } -\end{verbatim} - -\item After you have defined the entry, use -\begin{definition}[\DescribeMacro{\glssee}] -\cs{glssee}\oarg{tag}\marg{label}\marg{xr label list} -\end{definition} -where \meta{xr label list} is a comma-separated list of entry -labels to be cross-referenced, \meta{label} is the label of the -entry doing the cross-referencing and \meta{tag} is the \qt{see} tag. -(The default value of \meta{tag} is \ics{seename}.) -For example: -\begin{verbatim} -\glssee[see also]{series}{FourierSeries,TaylorsTheorem} -\end{verbatim} -Note that this automatically adds the entry given by \meta{label} to -the glossary but doesn't add the cross-referenced entries (specified -by \meta{xr label list}) to the glossary. +\end{codebox} \end{enumerate} -In both cases~2 and 3 above, the cross-referenced information -appears in the \gls{numberlist}, whereas in case~1, the -cross-referenced information appears in the description. (See the -\samplefile{-crossref} example file that comes with this package.) -This means that in cases~2 and~3, the cross-referencing information -won't appear if you have suppressed the \gls*{numberlist}. In this -case, you will need to activate the \gls*{numberlist} for the given -entries using \gloskey{nonumberlist=false}. Alternatively, if you -just use the \gloskey{see} key instead of \ics{glssee}, you can -automatically activate the \gls*{numberlist} using the -\pkgopt{seeautonumberlist} package option. +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} -\gls{bib2gls} provides much better support for cross-references. -See, for example, +\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} +\section{Customising Cross-Reference Text} \label{sec:customxr} -When you use either the \gloskey{see} key or the command -\cs{glssee}, the cross-referencing information will be typeset in the -glossary according to: -\begin{definition}[\DescribeMacro{\glsseeformat}] -\cs{glsseeformat}\oarg{tag}\marg{label-list}\marg{location} -\end{definition} -The default definition of \cs{glsseeformat} is: -\begin{display} -\cs{emph}\marg{tag} \cs{glsseelist}\marg{label-list} -\end{display} -Note that the location is always ignored.\footnote{\gls{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:\footnote{If you redefine \cs{glsseeformat}, -keep the default value of the optional argument as \ics{seename} as -both \gloskey{see} and \cs{glssee} explicitly write -\texttt[\cs{seename}\texttt] in the output file if no optional -argument is given.} -\begin{verbatim} -\renewcommand*{\glsseeformat}[3][\seename]{\textbf{#1} - \glsseelist{#2}} -\end{verbatim} +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. + +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. -The list of labels is dealt with by \cs{glsseelist}, which iterates -through the list and typesets each entry in the label. The entries -are separated by -\begin{definition}[\DescribeMacro{\glsseesep}] -\cs{glsseesep} -\end{definition} -or (for the last pair) -\begin{definition}[\DescribeMacro{\glsseelastsep}] -\cs{glsseelastsep} -\end{definition} -These default to ``",\space"'' and -\qt{\cs{space}\ics{andname}\cs{space}} respectively. The list entry text -is displayed using: -\begin{definition}[\DescribeMacro{\glsseeitemformat}] -\cs{glsseeitemformat}\marg{label} -\end{definition} -This defaults to \ics{glsentrytext}\marg{label}.\footnote{In -versions before 3.0, \cs{glsentryname} was used, but this could cause -problems when the \gloskey{name} key was \glsd{sanitize}.} For example, to -make the cross-referenced list use small caps: -\begin{verbatim} -\renewcommand{\glsseeitemformat}[1]{% - \textsc{\glsentrytext{#1}}} -\end{verbatim} \begin{xtr} -The \gls{glossaries-extra} package redefines \cs{glsseeitemformat} -and additionally provides \ics*{glsxtrhiername} which can be used -as an alternative to \cs{glsentrytext}. See the -\gls{glossaries-extra} manual for further details. +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} -\begin{important} -You can use \ics{glsseeformat} and \ics{glsseelist} in the main body -of the text, but they won't automatically add the cross-referenced -entries to the glossary. If you want them added with that location, -you can do: -\begin{verbatim} -Some information (see also -\glsseelist{FourierSeries,TaylorsTheorem}% -\glsadd{FourierSeries}\glsadd{TaylorsTheorem}). -\end{verbatim} -\end{important} - -\chapter{Number Lists} -\label{sec:numberlists} - -Each entry in the glossary has an associated \gls{numberlist}. -By default, these numbers refer to the pages on which that entry has -been indexed (using any of the commands described in -\sectionref{sec:glslink} and \sectionref{sec:glsadd}). The number -list can be suppressed using the \pkgopt{nonumberlist} package -option, or an alternative counter can be set as the default using -the \pkgopt{counter} package option. The number list is also -referred to as the location list\index{location list|see{number list}}. - -\Glspl{numberlist} are more common with indexes rather than -glossaries (although you can use the \styfmt{glossaries} package for -indexes as well). However, the \styfmt{glossaries} package makes use -of \gls{makeindex} or \gls{xindy} to hierarchically sort and collate the -entries since they are readily available with most modern \TeX\ -distributions. Since these are both designed as \glspl{indexingapp} -they both require that terms either have a valid location or a -cross-reference. Even if you use \pkgopt{nonumberlist}, the -locations must still be provided and acceptable to the -\gls{indexingapp} or they will cause an error during the indexing -stage, which will interrupt the document build. However, if you're -not interested in the locations, each entry only needs to be indexed -once, so consider using \pkgopt{indexonlyfirst}, which can improve the -document build time by only indexing the \gls{firstuse} of each term. - -The \ics{glsaddall} command (see \sectionref{sec:glsadd}), which is used to -automatically index all entries, iterates over all defined entries -and does \cs{glsadd}\marg{label} for each entry (where \meta{label} -is that entry's label). This means that \cs{glsaddall} automatically -adds the same location to every entry's \gls{numberlist}, which -looks weird if the \gls*{numberlist} hasn't been suppressed. - -With \opt4, the indexing is performed by \gls{bib2gls}, which was -specifically designed for the \gls{glossaries-extra} package. So it -will allow any location format, and its \texttt{selection=all} -option will select all entries without adding an unwanted location to the -\gls{numberlist}. If \gls{bib2gls} can deduce a numerical value for -a location, it will attempt to form a range over consecutive -locations, otherwise it won't try to form a range and the -location will just form an individual item in the list. -\opt1 also allows any location but it doesn't form ranges. +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. -\section{Encap Values (Location Formats)} -\label{sec:encap} +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} -Each location in the \gls{numberlist} is encapsulated with a -command formed from the \termdef{encap} value. By -default this is the \ics{glsnumberformat} command, which corresponds -to the encap \texttt{glsnumberformat}, but this may be -overridden using the \gloskey[glslink]{format} key in the optional -argument to commands like \cs{gls}. (See \sectionref{sec:glslink}.) -For example, you may want the location to appear in bold to indicate -the principle use of a term or symbol. If the encap starts with an -open parenthesis~\verb|(| this signifies the start of a range and if -the encap starts with close parenthesis~\verb|)| this signifies the -end of a range. These must always occur in matching pairs. - -The \styfmt{glossaries} package provides the command: -\begin{definition}[\glsignore] -\cs{glsignore}\marg{text} -\end{definition} -which ignores its argument. This is the format used by -\cs{glsaddallunused} to suppress the location, which works fine as -long as no other locations are added to the \gls{numberlist}. For -example, if you use \verb|\gls{sample}| on page~2 then reset the -\gls{firstuseflag} and then use \cs{glsaddallunused} on page~10, the -\gls{numberlist} for \texttt{sample} will be \verb|2, \glsignore{10}| -which will result in \qt{2,~} which has a spurious comma. - -This isn't a problem with \gls{bib2gls} because you would need to use -\texttt{selection=all} instead of \cs{glsaddallunused}, but even if -you explicitly had used \texttt{glsignore}, for example, -\cs{gls}\texttt{[format=glsignore]}\marg{label}, then \gls{bib2gls} -will recognise \texttt{glsignore} as -a special encap indicating an ignored location, so it will select -the entry but not add that location to the \gls{numberlist}. It's a -problem for all the other indexing options. - -Complications can arise if you use different encap values for the -same location. For example, suppose on page~10 you have both the -default \texttt{glsnumberformat} and \texttt{textbf} encaps. While it may -seem apparent that \texttt{textbf} should override \texttt{glsnumberformat} -in this situation, the \gls{indexingapp} may not know it. -This is therefore something you need to be careful about if you use the -\gloskey[glslink]{format} key or if you use a command that -implicitly sets it. - -In the case of \gls{xindy}, it only accepts one encap (according to -the order of precedence given in the \gls{xindy} module) and discards the -others for identical locations (for the same entry). This can cause -a problem if a discarded location forms the start or end of a range. - -In the case of \gls{makeindex}, it accepts different encaps for the -same location, but warns about it. This leads to a \gls{numberlist} -with the same location repeated in different formats. If you use -the \gls{makeglossaries} Perl script with \opt2 it will detect -\gls{makeindex}'s warning and attempt to fix the problem, ensuring -that the \texttt{glsnumberformat} encap always has the least precedence -unless it includes a range identifier. Other conflicting encaps will -have the last one override earlier ones for the same location with -range identifiers taking priority. - -No discard occurs with \opt1 so again you get the same location -repeated in different formats. With \opt4, \gls{bib2gls} will discard -according to order of precedence, giving priority to start and end -range encaps. (See the \gls{bib2gls} manual for further details.) +\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} -Neither \opt1 nor \opt4 care about the location syntax as long as -it's valid \LaTeX\ code (and doesn't contain fragile commands). In -both cases, the indexing is performed by writing a line to the -\filetype{aux} file. The write operation is deferred to avoid the -problems associated with \TeX's asynchronous output routine. -(See, for example, -\href{https://texfaq.org/FAQ-oddpage}{Finding -if you're on an odd or an even page} for more details on this issue.) -Unfortunately \optsand23 are far more problematic and need some -complex code to deal with awkward locations. - -If you know that your locations will always expand to a format -acceptable to your chosen \gls{indexingapp} then use the package -option \pkgopt[false]{esclocations} to bypass this operation. This setting -only affects \optsand23 as the problem doesn't arise with the other -indexing options. - -Both \gls{makeindex} and \gls{xindy} are fussy about the syntax of -the locations. In the case of \gls{makeindex}, only the numbering -system obtained with \cs{arabic}, \cs{roman}, \cs{Roman}, \cs{alph} -and \cs{Alph} or composites formed from them with the same separator -(set with \cs{glsSetCompositor}\marg{char}) are accepted. -(\gls{makeindex} won't accept an empty location.) In the case of -\gls{xindy}, you can define your own location classes, but if the -location contains a robust command then the leading backslash must -be escaped. The \sty{glossaries} package tries to do this, but it's -caught between two conflicting requirements: -\begin{enumerate} -\item The location must be fully expanded before \verb|\| can be -converted to \verb|\\| (there's no point converting \verb|\thepage| -to \verb|\\thepage|); -\item The page number can't be expanded until the deferred write -operation (so \verb|\c@page| mustn't expand in the previous step -but \verb|\the\c@page| mustn't be converted to \verb|\\the\\c@page| -and \verb|\number\c@page| mustn't be converted to -\verb|\\number\\c@page| etc). -\end{enumerate} -There's a certain amount of trickery needed to deal with this -conflict and the code requires the location to be in a form that -doesn't embed the counter's internal register in commands like -\cs{value}. For example, suppose you have a robust command called -\cs{tallynum} that takes a number as the argument and an expandable -command called \cs{tally} that converts a counter name into the -associated register or number to pass to \cs{tallynum}. Let's -suppose that this command is used to represent the page number: -\begin{verbatim} -\renewcommand{\thepage}{\tally{page}} -\end{verbatim} -Now let's suppose that a term is indexed at the beginning of page~2 -at the end of a paragraph that started on page~1. With \gls{xindy}, -the location \verb|\tally{page}| needs to be written to the file -as \verb|\\tallynum{2}|. If it's written as \verb|\tallynum{2}| then -\gls{xindy} will interpret \verb|\t| as the character \qt{t} -(which means the location would appear as \qt{tallynum2}). So -\sty{glossaries} tries to expand \cs{thepage} without expanding -\cs{c@page} and then escapes all the backslashes, except for the -page counter's internal command. The following definitions of -\cs{tally} will work: +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 In the following, \cs{arabic} works as its internal command \cs{c@arabic} is -temporarily redefined to check for \cs{c@page}: -\begin{verbatim} -\newcommand{\tally}[1]{\tallynum{\arabic{#1}}} -\end{verbatim} - -\item The form \verb|\expandafter\the\csname c@|\meta{counter}\verb|\endcsname| -also works (provided \cs{the} is allowed to be temporarily redefined, -see below): -\begin{verbatim} -\newcommand{\tally}[1]{% - \tallynum{\expandafter\the\csname c@#1\endcsname}} -\end{verbatim} - -\item \verb|\expandafter\the\value|\marg{counter} now also works -(with the same condition as above): -\begin{verbatim} -\newcommand{\tally}[1]{\tallynum{\expandafter\the\value{#1}}} -\end{verbatim} - -\item Another variation that will work: -\begin{verbatim} -\newcommand{\tally}[1]{% - \expandafter\tallynum\expandafter{\the\csname c@#1\endcsname}} -\end{verbatim} - -\item and also: -\begin{verbatim} -\newcommand{\tally}[1]{\tallynum{\the\csname c@#1\endcsname}} -\end{verbatim} +\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 \emph{don't work}: +The following are invalid: \begin{itemize} -\item This definition leads to the premature expansion of \cs{c@page} -to \qt{1} when, in this case, it should be \qt{2}: -\begin{verbatim} -\newcommand{\tally}[1]{\tallynum{\the\value{#1}}} -\end{verbatim} -\item This definition leads to \verb|\\c@page| in the glossary file: -\begin{verbatim} -\newcommand{\tally}[1]{\tallynum{\csname c@#1\endcsname}} -\end{verbatim} +\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} -If you have a numbering system where -\verb|\|\meta{cs name}\verb|{page}| expands to -\verb|\|\meta{internal cs name}\cs{c@page} (for example, if -\verb|\tally{page}| expands to \verb|\tallynum\c@page|) then you -need to use: -\begin{definition}[\DescribeMacro\glsaddprotectedpagefmt] -\cs{glsaddprotectedpagefmt}\marg{internal cs name} -\end{definition} -Note that the backslash must be omitted from \meta{internal cs name} -and the corresponding command must be able to process a count -register as the (sole) argument. - -For example, suppose you have a style \texttt{samplenum} that is -implemented as follows: -\begin{verbatim} - \newcommand*{\samplenum}[1]{% - \expandafter\@samplenum\csname c@#1\endcsname} - \newcommand*{\@samplenum}[1]{\two@digits{#1}} -\end{verbatim} -(That is, it displays the value of the counter as a two-digit -number.) Then to ensure the location is correct for entries in -page-spanning paragraphs, you need to do: -\begin{verbatim} -\glsaddprotectedpagefmt{@samplenum} -\end{verbatim} -(If you are using a different counter for the location, such as -\texttt{section} or \texttt{equation}, you don't need to worry about -this provided the inner command is expandable.) - -If the inner macro (as given by \verb|\|\meta{internal cs name}) contains -non-expandable commands then you may need to redefine -\cs{gls}\meta{internal cs name}\texttt{page} after using -\begin{alltt} -\cs{glsaddprotectedpagefmt}\marg{internal cs name} -\end{alltt} -This command doesn't take any arguments -as \emph{the location is assumed to be given by \cs{c@page}} because -that's the only occasion this command should be used. For example, -suppose now my page counter format uses small caps Roman numerals: -\begin{verbatim} - \newcommand*{\samplenum}[1]{% - \expandafter\@samplenum\csname c@#1\endcsname} - \newcommand*{\@samplenum}[1]{\textsc{\romannumeral#1}} -\end{verbatim} -Again, the inner macro needs to be identified using: -\begin{verbatim} -\glsaddprotectedpagefmt{@samplenum} -\end{verbatim} -However, since \cs{textsc} isn't fully expandable, the location -is written to the file as \verb|\textsc {i}| (for page~1), -\verb|\textsc {ii}| (for page~2), etc. This format may cause a problem for -the \gls{indexingapp} (particularly for \gls{makeindex}). -To compensate for this, the \cs{gls}\meta{internal cs -name}\texttt{page} command may be redefined so that it expands to a -format that's acceptable to the \gls*{indexingapp}. For example: -\begin{verbatim} -\renewcommand*{\gls@samplenumpage}{\romannumeral\c@page} -\end{verbatim} -While this modification means that the \gls{numberlist} in the glossary -won't exactly match the format of the page numbers (displaying -lower case Roman numbers instead of small cap Roman numerals) -this method will at least work correctly for both \gls{makeindex} -and \gls{xindy}. If you are using \gls{xindy}, the following -definition: -\begin{verbatim} - \renewcommand*{\gls@samplenumpage}{% - \glsbackslash\string\textsc{\romannumeral\c@page}} -\end{verbatim} -combined with -\begin{verbatim} -\GlsAddXdyLocation{romansc}{:sep "\string\textsc\glsopenbrace" - "roman-numbers-lowercase" :sep "\glsclosebrace"} -\end{verbatim} -will now have lowercase Roman numerals in the location list -(see \sectionref{sec:xindyloc} for further details on that command). -Take care of the backslashes. The location (which ends up in -the \xindyattr{:locref} attribute) needs \verb|\\| but the location class -(identified with \cs{GlsAddXdyLocation}) just has a single -backslash. Note that this example will cause problems if your -locations should be hyperlinks. - -Another possibility that may work with both \gls{makeindex} and -\gls{xindy} is to redefine \cs{gls}\meta{internal cs -name}\texttt{page} (\cs{gls@samplenumpage} in this example) -to just expand to the decimal page number (\verb|\number\c@page|) and redefine -\ics{glsnumberformat} to change the displayed format: -\begin{verbatim} -\renewcommand*{\gls@samplenumpage}{\number\c@page} -\renewcommand*{\glsnumberformat}[1]{\textsc{\romannumeral#1}} -\end{verbatim} +\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} -If you redefine \cs{gls}\meta{internal cs name}\texttt{page}, -you must make sure that \cs{c@page} is expanded when it's written to -the file. (So don't, for example, hide \cs{c@page} inside a robust -command.) +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} -The mechanism that allows this to work temporarily redefines -\ics{the} and \ics{number} while it processes the location. If this -causes a problem you can disallow it using -\begin{definition}[\DescribeMacro\glswrallowprimitivemodsfalse] -\cs{glswrallowprimitivemodsfalse} -\end{definition} -but you will need to find some other way to ensure the location expands -correctly. +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} -\section{Range Formations} -\label{sec:ranges} +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 \options{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. -Both \gls{makeindex} and \gls{xindy} (\optsand23) concatenate a -sequence of~3 or more consecutive pages into~a range. With -\gls*{xindy} (\opt3) you can vary the minimum sequence length using -\ics{GlsSetXdyMinRangeLength}\marg{n} where \meta{n} is either -an integer or the keyword \texttt{none} which indicates that there -should be no range formation (see \sectionref{sec:xindyloc} 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} -Note that \cs{GlsSetXdyMinRangeLength} must be used before -\ics{makeglossaries} and has no effect if \ics{noist} is used. +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} -With both \gls{makeindex} and \gls{xindy} (\optsand23), you can replace -the separator and the closing number in the range using: -\begin{definition}[\DescribeMacro{\glsSetSuffixF}] -\cs{glsSetSuffixF}\marg{suffix} -\end{definition} -\begin{definition}[\DescribeMacro{\glsSetSuffixFF}] -\cs{glsSetSuffixFF}\marg{suffix} -\end{definition} -where the former command specifies the suffix to use for a 2 page -list and the latter specifies the suffix to use for longer lists. -For example: -\begin{verbatim} -\glsSetSuffixF{f.} -\glsSetSuffixFF{ff.} -\end{verbatim} -Note that if you use \gls{xindy} (\opt3), you will also need to -set the minimum range length to 1 if you want to change these -suffixes: -\begin{verbatim} -\GlsSetXdyMinRangeLength{1} -\end{verbatim} -Note that if you use the \sty{hyperref} package, you will need -to use \ics{nohyperpage} in the suffix to ensure that the hyperlinks -work correctly. For example: -\begin{verbatim} -\glsSetSuffixF{\nohyperpage{f.}} -\glsSetSuffixFF{\nohyperpage{ff.}} -\end{verbatim} +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{important} -Note that \cs{glsSetSuffixF} and \cs{glsSetSuffixFF} must be used -before \ics{makeglossaries} and have no effect if \ics{noist} is -used. -\end{important} +\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} -It's also possible to concatenate a sequence of consecutive -locations into a range or have suffixes with \opt4, but with -\gls{bib2gls} these implicit ranges can't be merged with explicit -ranges (created with the \verb|(| and \verb|)| encaps). See -the \gls{bib2gls} manual for further details. - -\opt1 doesn't form ranges. However, with this option you -can iterate over an entry's \gls{numberlist} using: -\begin{definition}[\DescribeMacro\glsnumberlistloop] -\cs{glsnumberlistloop}\marg{label}\marg{handler cs}\marg{xr handler -cs} -\end{definition} -where \meta{label} is the entry's label and \meta{handler cs} is a -handler control sequence of the form: -\begin{definition} -\meta{handler cs}\marg{prefix}\marg{counter}\marg{format}\marg{location} -\end{definition} -where \meta{prefix} is the \sty{hyperref} prefix, \meta{counter} is -the name of the counter used for the location, \meta{format} is the -format used to display the location (e.g.\ \texttt{textbf}) -and \meta{location} is the location. The third argument is the -control sequence to use for any cross-references in the list. This -handler should have the syntax: -\begin{definition} -\meta{xr handler cs}\oarg{tag}\marg{xr list} -\end{definition} -where \meta{tag} is the cross-referenced text (e.g.\ \qt{see}) and -\meta{xr list} is a~comma-separated list of labels. (This actually -has a third argument but it's always empty when used with \opt1.) - -For example, if on page~12 -I~have used -\begin{verbatim} -\gls[format=textbf]{apple} -\end{verbatim} -and on page~18 I~have used -\begin{verbatim} -\gls[format=emph]{apple} -\end{verbatim} +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{verbatim} -\glsnumberlistloop{apple}{\myhandler} -\end{verbatim} +\begin{codebox} +\gls{glsnumberlistloop}\marg{apple}\marg{\cmd{myhandler}} +\end{codebox} will be equivalent to: -\begin{verbatim} -\myhandler{}{page}{textbf}{12}% -\myhandler{}{page}{emph}{18}% -\end{verbatim} +\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 -\gls{numberlist} in the glossary: -\begin{definition}[\DescribeMacro\glsnoidxdisplayloc] -\cs{glsnoidxdisplayloc}\marg{prefix}\marg{counter}\marg{format}\marg{location} -\end{definition} -The predefined handler used for the cross-references in the glossary is: -\begin{definition} -\cs{glsseeformat}\oarg{tag}\marg{xr list}\marg{location} -\end{definition} -which is described in \sectionref{sec:customxr}. - -\begin{important} -\cs{glsnumberlistloop} is not available for \optsand23. -\end{important} - -\section{Style Hook} -\label{sec:isthook} - -As from version 4.24, there's a hook that's used near the end of -\ics{writeist} before the file is closed. You can set the code -to be performed then using: -\begin{definition}[\DescribeMacro\GlsSetWriteIstHook] -\cs{GlsSetWriteIstHook}\marg{code} -\end{definition} -If you want the \meta{code} to write any information to the -file, you need to use -\begin{definition}[\DescribeMacro\glswrite] -\cs{write}\cs{glswrite}\marg{style information} -\end{definition} -Make sure you use the correct format within \meta{style -information}. For example, if you are using \app{makeindex}: -\begin{verbatim} -\GlsSetWriteIstHook{% - \write\glswrite{page_precedence "arnAR"}% - \write\glswrite{line_max 80}% -} -\end{verbatim} -This changes the page type precedence\index{page type precedence|main} and the maximum line length -used by \app{makeindex}. +\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}. -Remember that if you switch to \app{xindy}, this will no longer be -valid code. +\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} -Glossaries vary from lists that simply contain a symbol with a terse -description to lists of terms or phrases with lengthy descriptions. -Some glossaries may have terms with associated symbols. Some may -have hierarchical entries. There is therefore no single style that -fits every type of glossary. The \styfmt{glossaries} package comes -with a number of pre-defined glossary styles, described in -\sectionref{sec:predefinedstyles}. You can choose one of these that -best suits your type of glossary or, if none of them suit your -document, you can defined your own style (see -\sectionref{sec:newglossarystyle}). There are some examples -of glossary styles available at the \gallerytopic{glossaries}. - -The glossary style can be set using the \gloskey[printglossary]{style} key in the optional -argument to \ics{printnoidxglossary} (\opt1) or \ics{printglossary} -(\optsand23) or using the command: -\begin{definition}[\DescribeMacro{\setglossarystyle}] -\cs{setglossarystyle}\marg{style-name} -\end{definition} -(before the glossary is displayed). - -Some of the predefined glossary styles may also be set using the \pkgopt{style} -package option, it depends if the package in which they are defined -is automatically loaded by the \styfmt{glossaries} package. - -You can use the lorum ipsum dummy entries provided in the -accompanying -\texttt{example\dhyphen glossaries\dhyphen *.tex} files (described in -\sectionref{sec:lipsum}) to test the different 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} +\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}\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}, then you can do: +\begin{codebox} +\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-stylemods} package provided with -\gls{glossaries-extra} patches the predefined styles. There also -more styles available with \gls{glossaries-extra}. +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 level~0 (main) and level~1 entries. See the -package options \pkgopt{entrycounter}, \pkgopt{counterwithin} and -\pkgopt{subentrycounter} described in +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}. You can view samples of all the predefined styles at \galleryurl{glossaries-styles/}. -Note that \gls{glossaries-extra} provides additional 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 -\gls{glossaries-extra} manual for further details. +\sty{glossaries-extra} manual for further details. \begin{important} -Note that the group styles (such as \glostyle{listgroup}) will -have unexpected results if used with the \pkgopt[def]{sort} -or \pkgopt[use]{sort} options. If you don't sort your entries -alphabetically, it's best to set the \pkgopt{nogroupskip} +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 group title is obtained using \cs{glsgetgrouptitle}\marg{label}, +The \idx{group} title is obtained using \gls{glsgetgrouptitle}\marg{label}, which is described in \sectionref{sec:newglossarystyle}. \begin{table}[htbp] \caption[Glossary Styles]{Glossary Styles. An asterisk in the style name indicates anything that matches that doesn't match any -previously listed style (e.g.\ \texttt{long3col*} +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 --- there is no limit, but note that -\gls{makeindex} (\opt2) imposes a limit of 2 sub-levels. If the -homograph column is checked, then the name is not displayed for +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} -\vskip\baselineskip \centering \begin{tabular}{lccc} \bfseries Style & \bfseries Maximum Level & \bfseries Homograph & \bfseries Symbol\\ -\ttfamily listdotted & 0 & & \\ -\ttfamily sublistdotted & 1 & & \\ -\ttfamily list* & 1 & \tick & \\ -\ttfamily altlist* & 1 & \tick & \\ -\ttfamily long*3col* & 1 & \tick & \\ -\ttfamily long4col* & 1 & \tick & \tick \\ -\ttfamily altlong*4col* & 1 & \tick & \tick \\ -\ttfamily long* & 1 & \tick & \\ -\ttfamily super*3col* & 1 & \tick & \\ -\ttfamily super4col* & 1 & \tick & \tick \\ -\ttfamily altsuper*4col* & 1 & \tick & \tick \\ -\ttfamily super* & 1 & \tick & \\ -\ttfamily *index* & 2 & & \tick\\ -\ttfamily treenoname* & --- & \tick & \tick\\ -\ttfamily *alttree* & --- & & \tick\\ -\ttfamily *tree* & --- & & \tick\\ -\ttfamily inline & 1 & \tick & +\code{listdotted} & 0 & & \\ +\code{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\\ +\code{treenoname*} & \unlimited & \yes & \yes\\ +\code{*alttree*} & \unlimited & & \yes\\ +\code{*tree*} & \unlimited & & \yes\\ +\code{inline} & 1 & \yes & \end{tabular} \par \end{table} -The tabular-like styles that allow multi-line descriptions and page -lists use the length -\begin{definition}[\DescribeMacro{\glsdescwidth}] -\cs{glsdescwidth} -\end{definition} +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 -\begin{definition}[\DescribeMacro{\glspagelistwidth}] -\cs{glspagelistwidth} -\end{definition} -to set the width of the page list column.\footnote{These lengths will not be -available if you use both the \pkgopt{nolong} and \pkgopt{nosuper} -package options or if you use the \pkgopt{nostyles} package option -unless you explicitly load the relevant package.} -These will need to be changed using \cs{setlength} if the glossary -is too wide. Note that the \glostyle{long4col} and +\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 -entries. Instead you should use the analogous \glostyle{altlong4col} -and \glostyle{altsuper4col} styles. If you want to +\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 \ics{newline} instead of -\verb|\\|. +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 @@ -11863,67 +25262,72 @@ 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 \gloskey[printglossary]{style} key in the -optional argument to \ics{printnoidxglossary} (\opt1) or -\ics{printglossary} (\optsand23), it will override any -previous style settings for the given glossary, so if, for example, +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{verbatim} -\renewcommand*{\glsgroupskip}{} -\printglossary[style=long] -\end{verbatim} -then the new definition of \ics{glsgroupskip} will not have an affect -for this glossary, as \cs{glsgroupskip} is redefined by -\verb|style=long|. Likewise, \ics{setglossarystyle} will also +\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{verbatim} -\renewcommand*{\glsgroupskip}{} -\setglossarystyle{long} -\end{verbatim} -will reset \cs{glsgroupskip} back to its default definition for the -named glossary style (\glostyle{long} in this case). If you want to -modify the styles, either use \ics{newglossarystyle} (described +\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 -\ics{setglossarystyle}, e.g.: -\begin{verbatim} -\setglossarystyle{long} -\renewcommand*{\glsgroupskip}{} -\end{verbatim} -As from version 3.03, you can now use the package option -\pkgopt{nogroupskip} to suppress the gap between groups for the -default styles instead of redefining \cs{glsgroupskip}. +\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 command -\begin{definition}[\DescribeMacro{\glspostdescription}] -\cs{glspostdescription} -\end{definition} -after the description. This simply displays a full stop by default. -To eliminate this full stop (or replace it with something else, say, -a comma) you will need to redefine \cs{glspostdescription} before -the glossary is displayed. Alternatively, you can suppress it for a -given entry by placing \ics{nopostdesc} in the entry's description. -Note that \ics{longnewglossaryentry} puts \cs{nopostdesc} at the end -of the description. The \gls{glossaries-extra} package provides a +\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. -As from version 3.03 you can now use the package option -\pkgopt{nopostdot} to suppress this full stop. This is the better -option if you want to use the \gls{glossaries-extra} package. +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 some of to the predefined styles listed here, allowing -for greater flexibility. See the \gls{glossaries-extra} +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} -The styles described in this section are all defined in the package +\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 entry's symbol. Note that -these styles will automatically be available unless you use the -\pkgopt{nolist} or \pkgopt{nostyles} package options. +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 @@ -11932,73 +25336,78 @@ may also be incompatible with other classes or packages that modify the \env{description} environment. \end{important} -As from v4.48, there is an initialisation hook that provides a patch +There is an initialisation hook that provides a patch if the \sty{gettitlestring} package is loaded, since this is used by \sty{hyperref}. -\begin{definition}[\DescribeMacro\glslistinit] -\cs{glslistinit} -\end{definition} +\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 -\pkgopt{entercounter} should correctly expand the entry name to the -\filetype{aux} file. The name is expanded using: -\begin{definition}[\DescribeMacro\glslistexpandedname] -\cs{glslistexpandedname}\marg{label} -\end{definition} -This uses \ics{glsunexpandedfieldvalue}. If you need the name to +\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{verbatim} -\newcommand{\glslistexpandedname}[1]{\glsentryname{#1}} -\end{verbatim} +\begin{codebox} +\cmd{newcommand}\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. -\begin{description} -\item[list] The \glostyle{list} style uses the \env{description} -environment. The entry name is placed in the optional argument of -the \ics{item} command (so it will usually appear in bold by default). The -description follows, and then the associated \gls{numberlist} for +\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 \ics{indexspace}. +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. -\item[listgroup] The \glostyle{listgroup} style is like -\glostyle{list} but the glossary groups have headings -obtained using \cs{glsgetgrouptitle}\marg{label}, +\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}. -\item[listhypergroup] The \glostyle{listhypergroup} style is like +\glostyledef{listhypergroup} +The \glostyle{listhypergroup} style is like \glostyle{listgroup} but has a navigation line at the start of the -glossary with links to each group that is present in the glossary. -This requires an additional run through \LaTeX\ to ensure the group -information is up to date. In the navigation line, each group is -separated by -\begin{definition}[\DescribeMacro{\glshypernavsep}] -\cs{glshypernavsep} -\end{definition} -which defaults to a vertical bar with a space on either side. For -example, to simply have a space separating each group, do: -\begin{verbatim} -\renewcommand*{\glshypernavsep}{\space} -\end{verbatim} - -Note that the hyper-navigation line is now (as from version 1.14) -set inside the optional argument to \ics{item} instead of after it -to prevent a spurious space at the start. This can cause a problem -if the navigation line is too long. -As from v4.22, if you need to adjust this, you can redefine -\begin{definition}[\DescribeMacro\glslistnavigationitem] -\cs{glslistnavigationitem}\marg{navigation line} -\end{definition} -The default definition is \cs{item}\oarg{navigation line} but may -be redefined independently of setting the style. For example: -\begin{verbatim} -\renewcommand*{\glslistnavigationitem}[1]{\item \textbf{#1}} -\end{verbatim} - -You may prefer to use the tree-like styles, such as -\glostyle{treehypergroup} instead. - -\item[altlist] The \glostyle{altlist} style is like \glostyle{list} +\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, @@ -12006,153 +25415,214 @@ 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{verbatim} -\renewcommand{\glstreepredesc}{% - \glstreeitem\parindent\hangindent} -\end{verbatim} +\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. -\item[altlistgroup] The \glostyle{altlistgroup} style is like -\glostyle{altlist} but the glossary groups have headings. - -\item[altlisthypergroup] The \glostyle{altlisthypergroup} style is like +\glostyledef{altlisthypergroup} +The \glostyle{altlisthypergroup} style is like \glostyle{altlistgroup} but has a set of links to the glossary -groups. The navigation line is the same as that for +\idxpl{group}. The navigation line is the same as that for \glostyle{listhypergroup}, described above. -\item[listdotted] This style uses the \env{description} +\glostyledef{listdotted} +This style uses the \env{description} environment.\footnote{This style was supplied by Axel~Menzel.} Each -entry starts with \verb|\item[]|, followed by the name followed by a +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 \gls{numberlist} and the symbol. The length -\begin{definition}[\DescribeMacro{\glslistdottedwidth}] -\cs{glslistdottedwidth} -\end{definition} +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{verbatim} -\renewcommand{\glstreepredesc}{\dotfill} -\renewcommand{\glstreechildpredesc}{\dotfill} -\end{verbatim} -Note that this doesn't use \cs{glslistdottedwidth} and causes +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 \gls*{numberlist}, but that can be achieved with the -\pkgopt{nonumberlist} option.) +the \idx{numberlist}, but that can be achieved with the +\opt{nonumberlist} option.) -\item[sublistdotted] This is a variation on the \glostyle{listdotted} -style designed for hierarchical glossaries. The main entries +\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}. -\end{description} - \subsection{Longtable Styles} \label{sec:longstyles} -The styles described in this section are all defined in the package +\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 \pkgopt{nolong} or \pkgopt{nostyles} package -options. These styles fully justify the description and page list -columns. If you want ragged right formatting instead, use the +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}. -\begin{description} -\item[long] The \glostyle{long} style uses the \env{longtable} +\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 entry's name and the second -column contains the description followed by the \gls{numberlist}. -The entry's symbol is ignored. -Sub groups are separated with a blank row. The width of the +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 -\ics{glsdescwidth}. Child entries have a similar format to the +\gls{glsdescwidth}. Child entries have a similar format to the parent entries except that their name is suppressed. -\item[longborder] The \glostyle{longborder} style is like +\glostyledef{longborder} + +The \glostyle{longborder} style is like \glostyle{long} but has horizontal and vertical lines around it. -\item[longheader] The \glostyle{longheader} style is like -\glostyle{long} but has a header row. +\glostyledef{longheader} -\item[longheaderborder] The \glostyle{longheaderborder} style is -like \glostyle{longheader} but has horizontal and vertical lines -around it. +The \glostyle{longheader} style is like \glostyle{long} but has a header row. +You may prefer the \glostyle{long-booktabs} style instead. -\item[long3col] The \glostyle{long3col} style is like +\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 \gls{numberlist}. +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 -\ics{glsdescwidth}, and the width of the third column is governed by the -length \ics{glspagelistwidth}. +\gls{glsdescwidth}, and the width of the third column is governed by the +length \gls{glspagelistwidth}. + +\glostyledef{long3colborder} -\item[long3colborder] The \glostyle{long3colborder} style is like +The \glostyle{long3colborder} style is like the \glostyle{long3col} style but has horizontal and vertical lines around it. -\item[long3colheader] The \glostyle{long3colheader} style is like +\glostyledef{long3colheader} + +The \glostyle{long3colheader} style is like \glostyle{long3col} but has a header row. +You may prefer the \glostyle{long3col-booktabs} style instead. -\item[long3colheaderborder] The \glostyle{long3colheaderborder} style is -like \glostyle{long3colheader} but has horizontal and vertical lines -around it. +\glostyledef{long3colheaderborder} -\item[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. +The \glostyle{long3colheaderborder} style is like +\glostyle{long3colheader} but has horizontal and vertical lines +around it. The +\glostyle{long3col-booktabs} style is generally better. -\item[long4colborder] The \glostyle{long4colborder} style is like -the \glostyle{long4col} style but has horizontal and vertical -lines around it. +\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. -\item[long4colheader] The \glostyle{long4colheader} style is like +\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} -\item[long4colheaderborder] The \glostyle{long4colheaderborder} style is -like \glostyle{long4colheader} but has horizontal and vertical lines +The \glostyle{long4colheaderborder} style is like +\glostyle{long4colheader} but has horizontal and vertical lines around it. -\item[altlong4col] The \glostyle{altlong4col} style is like -\glostyle{long4col} but allows multi-line descriptions and page -lists. The width of the description column is governed by the -length \ics{glsdescwidth} and the width of the page list column is -governed by the length \ics{glspagelistwidth}. The widths of the -name and symbol columns are governed by the widest entry in the -given column. +\glostyledef{altlong4col} -\item[altlong4colborder] The \glostyle{altlong4colborder} style is like +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 -page lists. +\idxpl{numberlist}. + +\glostyledef{altlong4colheader} -\item[altlong4colheader] The \glostyle{altlong4colheader} style is like +The \glostyle{altlong4colheader} style is like \glostyle{long4colheader} but allows multi-line descriptions and -page lists. +\idxpl{numberlist}. +You may prefer the \glostyle{altlong4col-booktabs} style instead. -\item[altlong4colheaderborder] The \glostyle{altlong4colheaderborder} -style is like \glostyle{long4colheaderborder} but allows multi-line -descriptions and page lists. -\end{description} +\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} -The styles described in this section are all defined in the package +\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 @@ -12161,86 +25631,127 @@ 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{verbatim} -\usepackage{glossaries} -\usepackage{glossary-longragged} -\end{verbatim} -Note that you can't set these styles using the \pkgopt{style} +\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}. -\begin{description} -\item[longragged] The \glostyle{longragged} style has two -columns: the first column contains the entry's name and the second -column contains the (left-justified) description followed by the -\gls{numberlist}. The entry's symbol is ignored. -Sub groups are separated with a blank row. 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 -\ics{glsdescwidth}. Child entries have a similar format to the -parent entries except that their name is suppressed. +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. -\item[longraggedborder] The \glostyle{longraggedborder} style is like -\glostyle{longragged} but has horizontal and vertical lines around it. +\glostyledef{longraggedheaderborder} -\item[longraggedheader] The \glostyle{longraggedheader} style is like -\glostyle{longragged} but has a header row. +The \glostyle{longraggedheaderborder} style is like +\glostyle{longraggedheader} but has horizontal and vertical lines +around it. -\item[longraggedheaderborder] The \glostyle{longraggedheaderborder} -style is like \glostyle{longraggedheader} but has horizontal and -vertical lines around it. +\glostyledef{longragged3col} -\item[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) \gls{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 -\ics{glsdescwidth}, and the width of the third column is governed by -the length \ics{glspagelistwidth}. +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}. -\item[longragged3colborder] The \glostyle{longragged3colborder} -style is like the \glostyle{longragged3col} style but has horizontal -and vertical lines around it. +\glostyledef{longragged3colborder} -\item[longragged3colheader] The \glostyle{longragged3colheader} style is like +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} -\item[longragged3colheaderborder] The \glostyle{longragged3colheaderborder} style is +The \glostyle{longragged3colheaderborder} style is like \glostyle{longragged3colheader} but has horizontal and vertical lines around it. -\item[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 \ics{glsdescwidth} and the width of -the page list column is governed by the length -\ics{glspagelistwidth}. The widths of the name and symbol columns +\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. -\item[altlongragged4colborder] The -\glostyle{altlongragged4colborder} style is like the +\glostyledef{altlongragged4colborder} + +The \glostyle{altlongragged4colborder} style is like the \glostyle{altlongragged4col} but has horizontal and vertical lines around it. -\item[altlongragged4colheader] The -\glostyle{altlongragged4colheader} style is like +\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} -\item[altlongragged4colheaderborder] The -\glostyle{altlongragged4colheaderborder} style is like +The \glostyle{altlongragged4colheaderborder} style is like \glostyle{altlongragged4colheader} but has horizontal and vertical lines around it. -\end{description} - \subsection{Longtable Styles (\styfmt{booktabs})} \label{sec:longbooktabsstyles} -The styles described in this section are all defined in the package +\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 @@ -12251,165 +25762,254 @@ package automatically loads the \sty{glossary-long} and \sty{glossary-longragged} (\sectionref{sec:longraggedstyles}) packages. Note that these styles will only be available if you explicitly load \sty{glossary-longbooktabs}: -\begin{verbatim} -\usepackage{glossaries} -\usepackage{glossary-longbooktabs} -\end{verbatim} -Note that you can't set these styles using the \pkgopt{style} +\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 \styfmt{glossaries} package has been loaded. - -These styles are similar to the -\qt{header} styles in the \sty{glossary-long} and -\sty{glossary-ragged} packages, but they add the rules -provided by the \sty{booktabs} package, \ics{toprule}, \ics{midrule} and -\ics{bottomrule}. Additionally these styles patch the +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 -\gloskey[printglossary]{style} key in the optional argument of -\cs{printglossary}. (The \pkgopt{nogroupskip} package option -is checked by these styles.) +\printglossopt{style} key in the optional argument of +\gls{print...glossary}. Alternatively, you can restore the original \env{longtable} behaviour with: -\begin{definition}[\DescribeMacro\glsrestoreLToutput] -\cs{glsrestoreLToutput} -\end{definition} -For more information about the patch, see the documented code -(\texttt{glossaries-code.pdf}). +\cmddef{glsrestoreLToutput} -\begin{description} -\item[\glostyle{long-booktabs}] This style is similar to -the \glostyle{longheader} style but adds rules above and below the -header (\cs{toprule} and \cs{midrule}) and inserts a rule at the -bottom of the table (\cs{bottomrule}). +The penalty check is tested with: +\cmddef{glsLTpenaltycheck} +The default definition is: +\begin{compactcodebox} +\cmd{ifnum}\cmd{outputpenalty}=-50\cmd{vskip}-\cmd{normalbaselineskip}\cmd{relax}\cmd{fi} +\end{compactcodebox} -\item[\glostyle{long3col-booktabs}] This style is similar to -the \glostyle{long3colheader} style but adds rules as per -\glostyle{long-booktabs}. +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} -\item[\glostyle{long4col-booktabs}] This style is similar to -the \glostyle{long4colheader} style but adds rules as above. +\glostyledef{long-booktabs} -\item[\glostyle{altlong4col-booktabs}] This style is similar to -the \glostyle{altlong4colheader} style but adds rules as above. +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}). -\item[\glostyle{longragged-booktabs}] This style is similar to -the \glostyle{longraggedheader} style but adds rules as above. +\glostyledef{long3col-booktabs} -\item[\glostyle{longragged3col-booktabs}] This style is similar to -the \glostyle{longragged3colheader} style but adds rules as above. +This style is similar to the \glostyle{long3colheader} style but +adds rules as per \glostyle{long-booktabs}. -\item[\glostyle{altlongragged4col-booktabs}] This style is similar to -the \glostyle{altlongragged4colheader} style but adds rules as above. +\glostyledef{long4col-booktabs} -\end{description} +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} -The styles described in this section are all defined in the package +\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 \pkgopt{nosuper} or \pkgopt{nostyles} package +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}.\footnote{e.g.\ with the \sty{flowfram} -package.} These styles fully justify the description and page list +\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}. -\begin{description} -\item[super] The \glostyle{super} style uses the \env{supertabular} +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{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 entry's name and the second -column contains the description followed by the \gls{numberlist}. -The entry's symbol is ignored. -Sub groups are separated with a blank row. The width of the +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 -\ics{glsdescwidth}. Child entries have a similar format to the +\gls{glsdescwidth}. Child entries have a similar format to the parent entries except that their name is suppressed. -\item[superborder] The \glostyle{superborder} style is like -\glostyle{super} but has horizontal and vertical lines around it. +\glostyledef{superborder} + +The \glostyle{superborder} style is like \glostyle{super} but has +horizontal and vertical lines around it. + +\glostyledef{superheader} -\item[superheader] The \glostyle{superheader} style is like -\glostyle{super} but has a header row. +The \glostyle{superheader} style is like \glostyle{super} but has a +header row. -\item[superheaderborder] The \glostyle{superheaderborder} style is +\glostyledef{superheaderborder} + +The \glostyle{superheaderborder} style is like \glostyle{superheader} but has horizontal and vertical lines around it. -\item[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 \gls{numberlist}. The -entry's symbol is ignored. The width of the -first column is governed by the widest entry in that column. The +\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 -\ics{glsdescwidth}. The width of the third column is governed by the -length \ics{glspagelistwidth}. +\gls{glsdescwidth}. The width of the third column is governed by the +length \gls{glspagelistwidth}. -\item[super3colborder] The \glostyle{super3colborder} style is like +\glostyledef{super3colborder} + +The \glostyle{super3colborder} style is like the \glostyle{super3col} style but has horizontal and vertical lines around it. -\item[super3colheader] The \glostyle{super3colheader} style is like +\glostyledef{super3colheader} + +The \glostyle{super3colheader} style is like \glostyle{super3col} but has a header row. -\item[super3colheaderborder] The \glostyle{super3colheaderborder} style -is like the \glostyle{super3colheader} style but has horizontal and vertical +\glostyledef{super3colheaderborder} + +The \glostyle{super3colheaderborder} style is like the +\glostyle{super3colheader} style but has horizontal and vertical lines around it. -\item[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{super4col} -\item[super4colborder] The \glostyle{super4colborder} style is like -the \glostyle{super4col} style but has horizontal and vertical -lines around it. +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} -\item[super4colheader] The \glostyle{super4colheader} style is like -\glostyle{super4col} but has a header row. +The \glostyle{super4colheader} style is like \glostyle{super4col} +but has a header row. -\item[super4colheaderborder] The \glostyle{super4colheaderborder} style -is like the \glostyle{super4colheader} style but has horizontal and vertical +\glostyledef{super4colheaderborder} + +The \glostyle{super4colheaderborder} style is like the +\glostyle{super4colheader} style but has horizontal and vertical lines around it. -\item[altsuper4col] The \glostyle{altsuper4col} style is like -\glostyle{super4col} but allows multi-line descriptions and page -lists. -The width of the description column is governed by the length -\ics{glsdescwidth} and the width of the page list column is -governed by the length \ics{glspagelistwidth}. The width of the name -and symbol columns is governed by the widest entry in the -given column. +\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. -\item[altsuper4colborder] The \glostyle{altsuper4colborder} style is like -the \glostyle{super4colborder} style but allows multi-line descriptions -and page lists. +\glostyledef{altsuper4colborder} -\item[altsuper4colheader] The \glostyle{altsuper4colheader} style is like +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 -page lists. +\idxpl{numberlist}. -\item[altsuper4colheaderborder] The \glostyle{altsuper4colheaderborder} -style is like \glostyle{super4colheaderborder} but allows multi-line -descriptions and page lists. -\end{description} +\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} -The styles described in this section are all defined in the package +\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 @@ -12418,134 +26018,158 @@ 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{verbatim} -\usepackage{glossaries} -\usepackage{glossary-superragged} -\end{verbatim} -Note that you can't set these styles using the \pkgopt{style} +\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 \styfmt{glossaries} package has been loaded. +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. -\begin{description} -\item[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 entry's name and the second column contains the (left -justified) description followed by the \gls{numberlist}. The -entry's symbol is ignored. Sub groups are separated with a blank -row. 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 \ics{glsdescwidth}. Child entries have a similar format to -the parent entries except that their name is suppressed. - -\item[superraggedborder] The \glostyle{superraggedborder} style is -like \glostyle{superragged} but has horizontal and vertical lines -around it. +\glostyledef{superraggedborder} -\item[superraggedheader] The \glostyle{superraggedheader} style is -like \glostyle{superragged} but has a header row. +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} -\item[superraggedheaderborder] The -\glostyle{superraggedheaderborder} style is like +The \glostyle{superraggedheaderborder} style is like \glostyle{superraggedheader} but has horizontal and vertical lines around it. -\item[superragged3col] The \glostyle{superragged3col} style is like +\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) \gls{numberlist}. The entry's symbol is ignored. The +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 -\ics{glsdescwidth}. The width of the third column is governed by the -length \ics{glspagelistwidth}. +\gls{glsdescwidth}. The width of the third column is governed by the +length \gls{glspagelistwidth}. + +\glostyledef{superragged3colborder} -\item[superragged3colborder] The \glostyle{superragged3colborder} +The \glostyle{superragged3colborder} style is like the \glostyle{superragged3col} style but has horizontal and vertical lines around it. -\item[superragged3colheader] The \glostyle{superragged3colheader} +\glostyledef{superragged3colheader} + +The \glostyle{superragged3colheader} style is like \glostyle{superragged3col} but has a header row. -\item[superragged3colheaderborder] The -\glostyle{superragged3colheaderborder} style is like -the above but has horizontal and vertical -lines around it. +\glostyledef{superragged3colheaderborder} -\item[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. +The \glostyle{superragged3colheaderborder} style is like the above +but has horizontal and vertical lines around it. -\item[altsuperragged4colborder] The -\glostyle{altsuperragged4colborder} style is like the +\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. -\item[altsuperragged4colheader] The -\glostyle{altsuperragged4colheader} style is like +\glostyledef{altsuperragged4colheader} + +The \glostyle{altsuperragged4colheader} style is like \glostyle{altsuperragged4col} but has a header row. -\item[altsuperragged4colheaderborder] The -\glostyle{altsuperragged4colheaderborder} style is like -the above but has horizontal and vertical -lines around it. +\glostyledef{altsuperragged4colheaderborder} -\end{description} +The \glostyle{altsuperragged4colheaderborder} style is like the +above but has horizontal and vertical lines around it. \subsection{Tree-Like Styles} \label{sec:treestyles} -The styles described in this section are all defined in the package -\sty{glossary-tree}. These styles are designed for hierarchical +\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 entry's symbol if it -exists. Note that these styles will automatically be available -unless you use the \pkgopt{notree} or \pkgopt{nostyles} package +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. These styles all format the entry name using: -\begin{definition}[\DescribeMacro\glstreenamefmt] -\cs{glstreenamefmt}\marg{name} -\end{definition} -This defaults to \cs{textbf}\marg{name}, but note that \meta{name} -includes \ics{glsnamefont} so the bold setting in \cs{glstreenamefont} -may be counteracted by another font change in \cs{glsnamefont} (or -in \cs{acronymfont}). The tree-like styles that also display the +\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 -\begin{definition}[\DescribeMacro\glstreegroupheaderfmt] -\cs{glstreegroupheaderfmt}\marg{text} -\end{definition} +\cmddef{glstreegroupheaderfmt} to format the heading. This defaults to -\cs{glstreenamefmt}\marg{text}. The tree-like styles that display +\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 -\begin{definition}[\DescribeMacro\glstreenavigationfmt] -\cs{glstreenavigationfmt}\marg{text} -\end{definition} -which defaults to \cs{glstreenamefmt}\marg{text}. +\cmddef{glstreenavigationfmt} +which defaults to \code{\gls{glstreenamefmt}\margm{text}}. -Note that this is -different from \cs{glslistnavigationitem}, provided with the styles -such as \glostyle{listhypergroup}, as that also includes \cs{item}. +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 -\begin{definition}[\DescribeMacro\glstreepredesc] -\cs{glstreepredesc} -\end{definition} -This defaults to \cs{space}. +\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 -\begin{definition}[\DescribeMacro\glstreechildpredesc] -\cs{glstreechildpredesc} -\end{definition} -This defaults to \cs{space}. +\cmddef{glstreechildpredesc} +This defaults to \gls{space}. \begin{important} Most of these styles are not designed for multi-paragraph @@ -12554,219 +26178,252 @@ multi-paragraph top-level entry descriptions, or you can use the \glostyle{index} style with the adjustment shown below.) \end{important} -\begin{description} -\item[index] The \glostyle{index} style is similar to the way -indices are usually formatted in that it has a hierarchical -structure up to three levels (the main level plus two sub-levels). -The name is typeset in bold, and 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. Groups are separated -using \ics{indexspace}. +\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 -\begin{definition}[\DescribeMacro\glstreeitem] -\cs{glstreeitem} -\end{definition} -The level~1 entries are started with -\begin{definition}[\DescribeMacro\glstreesubitem] -\cs{glstreesubitem} -\end{definition} - -The level~2 entries are started with -\begin{definition}[\DescribeMacro\glstreesubsubitem] -\cs{glstreesubsubitem} -\end{definition} +\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{verbatim} -\let\item\glstreeitem -\let\subitem\glstreesubitem -\let\subsubitem\glstreesubsubitem -\end{verbatim} -at the start of the glossary for backward compatibility. +\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{verbatim} -\renewcommand{\glstreeitem}{% - \parindent0pt\par\hangindent40pt - \everypar{\parindent50pt\hangindent40pt}} -\end{verbatim} +\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} -\item[indexgroup] The \glostyle{indexgroup} style is similar to -the \glostyle{index} style except that each group has a heading -obtained using \cs{glsgetgrouptitle}\marg{label}, -which is described in \sectionref{sec:newglossarystyle}. +\glostyledef{indexgroup} -\item[indexhypergroup] The \glostyle{indexhypergroup} style is like -\glostyle{indexgroup} but has a set of links to the glossary -groups. The navigation line is the same as that for -\glostyle{listhypergroup}, described above, but is formatted using -\cs{glstreenavigationfmt}. - -\item[tree] The \glostyle{tree} style is similar to the -\glostyle{index} style except that it can have arbitrary levels. -(Note that \gls{makeindex} is limited to three levels, so -you will need to use \gls{xindy} if you want more than -three levels.) Each sub-level is indented by -\DescribeMacro{\glstreeindent}\cs{glstreeindent}. 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.) - -\item[treegroup] The \glostyle{treegroup} style is similar to -the \glostyle{tree} style except that each group has a heading. - -\item[treehypergroup] The \glostyle{treehypergroup} style is like +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 -groups. The navigation line is the same as that for +\idxpl{group}. The navigation line is the same as that for \glostyle{listhypergroup}, described above, but is formatted using -\cs{glstreenavigationfmt}. +\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} -\item[treenoname] The \glostyle{treenoname} style is like -the \glostyle{tree} style except that the name for each sub-entry -is ignored. +The \glostyle{treenonamegroup} style is similar to the +\glostyle{treenoname} style except that each group has a heading. -\item[treenonamegroup] The \glostyle{treenonamegroup} style is -similar to the \glostyle{treenoname} style except that each group -has a heading. +\glostyledef{treenonamehypergroup} -\item[treenonamehypergroup] The \glostyle{treenonamehypergroup} -style is like \glostyle{treenonamegroup} but has a set of links to -the glossary groups. The navigation line is the same as that for +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 -\cs{glstreenavigationfmt}. +\gls{glstreenavigationfmt}. -\item[alttree] The \glostyle{alttree} style is similar to the +\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 -\begin{definition}[\DescribeMacro{\glssetwidest}] -\cs{glssetwidest}\oarg{level}\marg{text} -\end{definition} -The optional argument \meta{level} indicates the level, where -0 indicates the top-most level, 1 indicates the first level -sub-entries, etc. If \cs{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. - -As from v4.22, the \sty{glossary-tree} package also provides -\begin{definition}[\DescribeMacro\glsfindwidesttoplevelname] -\cs{glsfindwidesttoplevelname}\oarg{glossary list} -\end{definition} -This iterates over all parentless entries in the given glossary -lists and determines the widest entry. If the optional argument is -omitted, all glossaries are assumed (as per \cs{forallglossaries}). +\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. + +\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{verbatim} -\glsfindwidesttoplevelname -\setglossarystyle{alttree} -\printglossaries -\end{verbatim} +\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{verbatim} -\renewcommand{\glossarypreamble}{% - \glsfindwidesttoplevelname[\currentglossary]} -\setglossarystyle{alttree} -\printglossaries -\end{verbatim} - -\begin{important} +\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. -If you forget to set the widest entry name, the description will -overwrite the name. -\end{important} +\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 \cs{makebox}. As from -v4.19, this can now be adjusted by redefining -\begin{definition}[\DescribeMacro\glstreenamebox] -\cs{glstreenamebox}\marg{width}\marg{text} -\end{definition} -where \meta{width} is the width of the box and \meta{text} is the -contents of the box. For example, to make the name right-aligned: -\begin{verbatim} -\renewcommand*{\glstreenamebox}[2]{% - \makebox[#1][r]{#2}% +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{} + \cmd{makebox}[\#1][r]\marg{\#2}\comment{} } -\end{verbatim} +\end{codebox} -\item[alttreegroup] The \glostyle{alttreegroup} is like the -\glostyle{alttree} style except that each group has a heading. +\glostyledef{alttreegroup} -\item[alttreehypergroup] The \glostyle{alttreehypergroup} style is -like \glostyle{alttreegroup} but has a set of links to the glossary -groups. The navigation line is the same as that for -\glostyle{listhypergroup}, described above. +The \glostyle{alttreegroup} is like the \glostyle{alttree} style +except that each \idx{group} has a heading. -\end{description} +\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} -The \sty{glossary-mcols} package provides tree-like styles 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 +\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 \pkgopt{notree} package option is -used when loading \styfmt{glossaries}). The formatting commands -\cs{glstreenamefmt}, \cs{glstreegroupheaderfmt} and -\cs{glstreenavigationfmt} are all used by the corresponding +\sty{glossary-mcols} (even if the \opt{notree} package option is +used when loading \sty{glossaries}). The formatting commands +\gls{glstreenamefmt}, \gls{glstreegroupheaderfmt} and +\gls{glstreenavigationfmt} are all used by the corresponding \sty{glossary-mcols} styles. -\begin{important} -Note that \sty{glossary-mcols} is not loaded by \styfmt{glossaries}. If -you want to use any of the multicol styles in that package you need -to load it explicitly with \cs{usepackage} and set the required glossary -style using \ics{setglossarystyle}. -\end{important} - -The default number of columns is 2, but can be changed by redefining -\begin{definition}[\DescribeMacro{\glsmcols}] -\cs{glsmcols} -\end{definition} -to the required number. For example, for a three column glossary: -\begin{verbatim} -\usepackage{glossary-mcols} -\renewcommand*{\glsmcols}{3} -\setglossarystyle{mcolindex} -\end{verbatim} +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} + +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{mcolindex} & \glostyle{index}\\ -\glostyle{mcolindexgroup} & \glostyle{indexgroup}\\ -\glostyle{mcolindexhypergroup} or \glostyle{mcolindexspannav} & \glostyle{indexhypergroup}\\ -\glostyle{mcoltree} & \glostyle{tree}\\ -\glostyle{mcoltreegroup} & \glostyle{treegroup}\\ -\glostyle{mcoltreehypergroup} or \glostyle{mcoltreespannav} & \glostyle{treehypergroup}\\ -\glostyle{mcoltreenoname} & \glostyle{treenoname}\\ -\glostyle{mcoltreenonamegroup} & \glostyle{treenonamegroup}\\ -\glostyle{mcoltreenonamehypergroup} or -\glostyle{mcoltreenonamespannav} & \glostyle{treenonamehypergroup}\\ -\glostyle{mcolalttree} & \glostyle{alttree}\\ -\glostyle{mcolalttreegroup} & \glostyle{alttreegroup}\\ -\glostyle{mcolalttreehypergroup} or \glostyle{mcolalttreespannav} & \glostyle{alttreehypergroup} +\bfseries \sty{glossary-mcols} Style & +\bfseries Analogous Tree Style\\ +\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} @@ -12778,386 +26435,608 @@ 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 style that is designed for +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 \gls{numberlist}. - -You will most likely need to redefine \ics{glossarysection} with +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 -glossaries and list of acronyms in a footnote, you can do: -\begin{verbatim} - \usepackage{glossary-inline} - - \renewcommand*{\glossarysection}[2][]{\textbf{#1}: } - \setglossarystyle{inline} -\end{verbatim} +\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} -Note that you need to include \sty{glossary-inline} with -\cs{usepackage} as it's not automatically included by the -\styfmt{glossaries} package and then set the style using -\ics{setglossarystyle}. +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} -Where you need to include your glossaries as a footnote you can do: -\begin{verbatim} -\footnote{\printglossaries} -\end{verbatim} +The \glostyle{inline} style is governed by the following commands. -The \glostyle{inline} style is governed by the following: -\begin{definition}[\DescribeMacro{\glsinlineseparator}] -\ics{glsinlineseparator} -\end{definition} -This defaults to \qt{\texttt{\glsinlineseparator}} and is used between -main (i.e.\ level~0) entries. -\begin{definition}[\DescribeMacro{\glsinlinesubseparator}] -\ics{glsinlinesubseparator} -\end{definition} -This defaults to \qt{\texttt{\glsinlinesubseparator}} and is used between -sub-entries. -\begin{definition}[\DescribeMacro{\glsinlineparentchildseparator}] -\ics{glsinlineparentchildseparator} -\end{definition} -This defaults to \qt{\texttt{\glsinlineparentchildseparator}} and is used between -a parent main entry and its first sub-entry. -\begin{definition}[\DescribeMacro{\glspostinline}] -\ics{glspostinline} -\end{definition} -This defaults to \qt{\texttt{\glsinlineseparator}} and is used at the end -of the glossary. -\begin{definition}[\DescribeMacro\glsinlinenameformat] -\cs{glsinlinenameformat}\marg{label}\marg{name} -\end{definition} -This is used to format the entry name and defaults to -\cs{glstarget}\marg{label}\marg{name}, where \meta{name} is provided -in the form \cs{glossentryname}\marg{label} and \meta{label} is the -entry's label. For example, if you want the name to appear in -\gls{smallcaps}: -\begin{verbatim} -\renewcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{\textsc{#2}}} -\end{verbatim} -Sub-entry names are formatted according to -\begin{definition}[\DescribeMacro\glsinlinesubnameformat] -\cs{glsinlinesubnameformat}\marg{label}\marg{name} -\end{definition} -This defaults to \cs{glstarget}\marg{label}\verb|{}| so the -sub-entry name is ignored. - -If the description has been suppressed (according to -\cs{ifglsdescsuppressed}) then -\begin{definition}[\DescribeMacro\glsinlineemptydescformat] -\cs{glsinlineemptydescformat}\marg{symbol}\marg{number list} -\end{definition} -(which defaults to nothing) is used, -otherwise the description is formatted according to -\begin{definition}[\DescribeMacro\glsinlinedescformat] -\cs{glsinlinedescformat}\marg{description}\marg{symbol}\marg{number -list} -\end{definition} -This defaults to just \cs{space}\meta{description} so the symbol and -location list are ignored. If the description is missing (according -to \cs{ifglshasdesc}), then \cs{glsinlineemptydescformat} is used -instead. +\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{verbatim} -\renewcommand*{\glsinlinedescformat}[3]{: #1} -\end{verbatim} +\begin{codebox} +\cmd{renewcommand}*\marg{\gls{glsinlinedescformat}}[3]\marg{: \#1} +\end{codebox} The sub-entry description is formatted according to: -\begin{definition}[\DescribeMacro\glsinlinesubdescformat] -\cs{glsinlinesubdescformat}\marg{description}\marg{symbol}\marg{number -list} -\end{definition} +\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 \cs{printglossary} are designed to produce content in -the PDF. If your intention is to design a style that doesn't print +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 indexing information (such as locations) then a much better -approach is to use \gls{bib2gls}, which automatically stores this +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 styles don't fit your requirements, you can +If the predefined \idxpl{glossarystyle} don't fit your requirements, you can define your own style using: -\begin{definition}[\DescribeMacro{\newglossarystyle}] -\cs{newglossarystyle}\marg{name}\marg{definitions} -\end{definition} -where \meta{name} is the name of the new glossary style (to be -used in \cs{setglossarystyle}). The second argument \meta{definitions} -needs to redefine all of the following: - -\begin{definition}[\DescribeEnv{theglossary}] -\env{theglossary} -\end{definition} -This environment defines how the main body of the glossary should -be typeset. - -Note that this does not include the section heading, -the glossary preamble (defined by \ics{glossarypreamble}) or the -glossary postamble (defined by \ics{glossarypostamble}). For example, -the \glostyle{list} style uses the \env{description} environment, -so the \env{theglossary} environment is simply redefined to begin -and end the \env{description} environment. - -\begin{definition}[\DescribeMacro{\glossaryheader}] -\cs{glossaryheader} -\end{definition} -This macro indicates what to do at the start of the main body -of the glossary. Note that this is not the same as -\ics{glossarypreamble}, which should not be affected by changes in -the glossary style. The \glostyle{list} glossary style redefines -\ics{glossaryheader} to do nothing, whereas the \glostyle{longheader} -glossary style redefines \cs{glossaryheader} to do a header row. - -\begin{definition}[\DescribeMacro{\glsgroupheading}] -\cs{glsgroupheading}\marg{label} -\end{definition} -This macro indicates -what to do at the start of each logical block within the main body -of the glossary. If you use \gls{makeindex} the glossary is -sub-divided into a maximum of twenty-eight logical blocks that are -determined by the first character of the \gloskey{sort} key (or -\gloskey{name} key if the \gloskey{sort} key is omitted). The -sub-divisions are in the following order: symbols, numbers, A, -\ldots, Z\@. If you use \gls{xindy}, the sub-divisions depend on -the language settings. - -Note that the argument to \cs{glsgroupheading} -is a label \emph{not} the group title. The group title can be obtained -via -\begin{definition}[\DescribeMacro{\glsgetgrouptitle}] -\cs{glsgetgrouptitle}\marg{label} -\end{definition} -This obtains the title as follows: if \meta{label} consists of a -single non-active character or \meta{label} is equal to -\texttt{glssymbols} or \texttt{glsnumbers} and -\cs{}\meta{label}\texttt{groupname} exists, this is taken to be the -title, otherwise the title is just \meta{label}. (The \qt{symbols} -group has the label \texttt{glssymbols}, so the command -\ics{glssymbolsgroupname} is used, and the \qt{numbers} group has the -label \texttt{glsnumbers}, so the command \ics{glsnumbersgrouptitle} -is used.) If you are using \gls{xindy}, \meta{label} may be an -active character (for example \o), in which case the title will be -set to just \meta{label}. You can redefine \cs{glsgetgrouptitle} if -this is unsuitable for your document. - -A navigation hypertarget can be created using -\begin{definition}[\DescribeMacro{\glsnavhypertarget}] -\cs{glsnavhypertarget}\marg{label}\marg{text} -\end{definition} -This typically requires \cs{glossaryheader} to be redefined to use -\begin{definition}[\DescribeMacro\glsnavigation] -\cs{glsnavigation} -\end{definition} -which displays the navigation line. - -For further details about \cs{glsnavhypertarget}, see -\ifpdf section~\ref*{sec:code:hypernav} in \fi the documented code -(\texttt{glossaries-code.pdf}). - -Most of the predefined glossary styles redefine \cs{glsgroupheading} -to simply ignore its argument. The \glostyle{listhypergroup} style -redefines \cs{glsgroupheading} as follows: -\begin{verbatim} -\renewcommand*{\glsgroupheading}[1]{% -\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]} -\end{verbatim} -See also \cs{glsgroupskip} below. - -Note that command definitions within -\ics{newglossarystyle} must use \verb|##1| instead of \verb|#1| etc. - -\begin{definition}[\DescribeMacro{\glsgroupskip}] -\cs{glsgroupskip} -\end{definition} -This macro determines what to do after one logical group but before -the header for the next logical group. The \glostyle{list} glossary -style simply redefines \cs{glsgroupskip} to be \ics{indexspace}, -whereas the tabular-like styles redefine \cs{glsgroupskip} to -produce a blank row. - -As from version 3.03, the package option \pkgopt{nogroupskip} can be -used to suppress this default gap for the predefined styles. - -\begin{definition}[\DescribeMacro{\glossentry}] -\cs{glossentry}\marg{label}\marg{number list} -\end{definition} -This macro indicates what to do for each top-level (level~0) glossary entry. -The entry label is given by \meta{label} and the associated -\gls{numberlist} is given by \meta{number list}. You can redefine -\ics{glossentry} to use commands like \ics{glossentryname}\marg{label}, -\ics{glossentrydesc}\marg{label} and \ics{glossentrysymbol}\marg{label} -to display the name, description and symbol fields, or to access -other fields, use commands like \ics{glsentryuseri}\marg{label}. -(See \sectionref{sec:glsnolink} for further details.) You can also -use the following commands: - -\begin{definition}[\DescribeMacro{\glsentryitem}] -\cs{glsentryitem}\marg{label} -\end{definition} -This macro will increment and display the associated counter for the -main (level~0) entries if the \pkgopt{entrycounter} or -\pkgopt{counterwithin} package options have been used. This macro -is typically called by \cs{glossentry} before \cs{glstarget}. -The format of the counter is controlled by the macro -\begin{definition}[\DescribeMacro{\glsentrycounterlabel}] -\cs{glsentrycounterlabel} -\end{definition} - -Each time you use a glossary entry it creates a hyperlink (if -hyperlinks are enabled) to the relevant line in the glossary. -Your new glossary style must therefore redefine -\cs{glossentry} to set the appropriate target. This -is done using -\begin{definition}[\DescribeMacro{\glstarget}] -\cs{glstarget}\marg{label}\marg{text} -\end{definition} -where \meta{label} is the entry's label. Note that you -don't need to worry about whether the \sty{hyperref} package has -been loaded, as \cs{glstarget} won't create a target if -\cs{hypertarget} hasn't been defined. - -For example, the \glostyle{list} style defines \cs{glossentry} as follows: -\begin{verbatim} - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glstarget{##1}{\glossentryname{##1}}] - \glossentrydesc{##1}\glspostdescription\space ##2} -\end{verbatim} +\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 \optval{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} -Note also that \meta{number list} will always be of the form -\begin{definition} -\ics{glossaryentrynumbers}\{\cs{relax}\\ -\ics{setentrycounter}\oarg{Hprefix}\marg{counter name}\meta{format cmd}\marg{number(s)}\} -\end{definition} -where \meta{number(s)} -may contain \ics{delimN} (to delimit individual numbers) and/or -\ics{delimR} (to indicate a range of numbers). There may be -multiple occurrences of -\ics{setentrycounter}\oarg{Hprefix}\marg{counter name}\meta{format cmd}\marg{number(s)}, but note -that the entire number list is enclosed within the argument -of \ics{glossaryentrynumbers}. The user can redefine this to change -the way the entire number list is formatted, regardless of -the glossary style. However the most common use of -\ics{glossaryentrynumbers} is to provide a means of suppressing the -number list altogether. (In fact, the \pkgopt{nonumberlist} option -redefines \ics{glossaryentrynumbers} to ignore its argument.) -Therefore, when you define a new glossary style, you don't need -to worry about whether the user has specified the -\pkgopt{nonumberlist} package option. - -\begin{definition}[\DescribeMacro{\subglossentry}] -\cs{subglossentry}\marg{level}\marg{label}\marg{number list} -\end{definition} -This is used to display sub-entries. -The first argument, \meta{level}, indicates the sub-entry level. -This must be an integer from 1 (first sub-level) onwards. The -remaining arguments are analogous to those for -\ics{glossentry} described above. - -\begin{definition}[\DescribeMacro{\glssubentryitem}] -\cs{glssubentryitem}\marg{label} -\end{definition} -This macro will increment and display the associated counter for the -level~1 entries if the \pkgopt{subentrycounter} package option has -been used. This macro is typically called by \cs{subglossentry} -before \ics{glstarget}. The format of the counter is controlled by -the macro -\begin{definition}[\DescribeMacro{\glssubentrycounterlabel}] -\cs{glssubentrycounterlabel} -\end{definition} - -Note that \ics{printglossary} (which \ics{printglossaries} calls) -sets -\begin{definition}[\DescribeMacro{\currentglossary}] -\cs{currentglossary} -\end{definition} +\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{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. + +\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}. +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. +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{glossarypreamble} 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} -For further details of these commands, see \ifpdf -section~\ref*{sec:code:printglos} \fi \qt{Displaying the glossary} -in the documented code (\texttt{glossaries-code.pdf}). +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. +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 glossary should be placed in the \env{itemize} +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 groups (so \ics{glsgroupheading} and \ics{glsgroupskip} +the glossary \idxpl{group} (so \gls{glsgroupheading} and \gls{glsgroupskip} should do nothing) and suppose you don't want anything to appear -immediately after \verb|\begin{theglossary}| (so \ics{glossaryheader} +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 \gls{numberlist} should appear within square brackets -at the end. Then you can create this new glossary style, called, say, -\texttt{mylist}, as follows: -\begin{verbatim} - \newglossarystyle{mylist}{% - % put the glossary in the itemize environment: - \renewenvironment{theglossary}% - {\begin{itemize}}{\end{itemize}}% - % have nothing after \begin{theglossary}: - \renewcommand*{\glossaryheader}{}% - % have nothing between glossary groups: - \renewcommand*{\glsgroupheading}[1]{}% - \renewcommand*{\glsgroupskip}{}% - % set how each entry should appear: - \renewcommand*{\glossentry}[2]{% - \item % bullet point - \glstarget{##1}{\glossentryname{##1}}% the entry name - \space (\glossentrysymbol{##1})% the symbol in brackets - \space \glossentrydesc{##1}% the description - \space [##2]% the number list in square brackets - }% - % set how sub-entries appear: - \renewcommand*{\subglossentry}[3]{% - \glossentry{##2}{##3}}% +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{verbatim} +\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 \ics{glsentryitem} or \ics{glssubentryitem} so -it won't be affected by the \pkgopt{entrycounter}, -\pkgopt{counterwithin} or \pkgopt{subentrycounter} package options. +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 be capitalised, in -which case use \ics{Glossentryname} instead of \ics{glossentryname}. +\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 -\ics{ifglshassymbol} (see \sectionref{sec:utilities}): -\begin{verbatim} - \renewcommand*{\glossentry}[2]{% - \item % bullet point - \glstarget{##1}{\glossentryname{##1}}% the entry name - \ifglshassymbol{##1}% check if symbol exists - {% - \space (\glossentrysymbol{##1})% the symbol in brackets - }% - {}% no symbol so do nothing - \space \glossentrydesc{##1}% the description - \space [##2]% the number list in square brackets - }% -\end{verbatim} +\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} @@ -13165,472 +27044,568 @@ the parentheses if the symbol is absent. In this case you can use 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 \ics{setglossarystyle} -within the second argument of \ics{newglossarystyle} followed by +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 \ics{indexspace} between groups, then you -can create a new glossary style called, say, \texttt{mylist} as +vertical space created by \gls{indexspace} between \idxpl{group}, then you +can create a new \idx{glossarystyle} called, say, \optfmt{mylist} as follows: -\begin{verbatim} -\newglossarystyle{mylist}{% -\setglossarystyle{list}% base this style on the list style -\renewcommand{\glsgroupskip}{}% make nothing happen - % between groups +\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{verbatim} +\end{codebox} (In this case, you can actually achieve the same effect using the \glostyle{list} style in combination with the package option -\pkgopt{nogroupskip}.) +\opt{nogroupskip}.) \end{example} \begin{example}{Example: creating a glossary style that uses the -\texorpdfstring{\gloskey{user1}}{user1}, \ldots, -\texorpdfstring{\gloskey{user6}}{user6} keys}{sec:exuserstyle} +\gloskeyfmttext{user1}, \ldots, \gloskeyfmttext{user6} keys}{sec:exuserstyle} -Suppose each entry not only has an associated symbol, +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 glossary style -that displays each entry in a \env{longtable} as follows: -\begin{verbatim} -\newglossarystyle{long6col}{% - % put the glossary in a longtable environment: - \renewenvironment{theglossary}% - {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}% - {\end{longtable}}% - % Set the table's header: - \renewcommand*{\glossaryheader}{% - \bfseries Term & \bfseries Description & \bfseries Symbol & - \bfseries Units & \bfseries Dimensions & \bfseries Page List - \\\endhead}% - % No heading between groups: - \renewcommand*{\glsgroupheading}[1]{}% - % Main (level 0) entries displayed in a row optionally numbered: - \renewcommand*{\glossentry}[2]{% - \glsentryitem{##1}% Entry number if required - \glstarget{##1}{\glossentryname{##1}}% Name - & \glossentrydesc{##1}% Description - & \glossentrysymbol{##1}% Symbol - & \glsentryuseri{##1}% Units - & \glsentryuserii{##1}% Dimensions - & ##2% Page list - \tabularnewline % end of row - }% - % Similarly for sub-entries (no sub-entry numbers): - \renewcommand*{\subglossentry}[3]{% - % ignoring first argument (sub-level) - \glstarget{##2}{\glossentryname{##2}}% Name - & \glossentrydesc{##2}% Description - & \glossentrysymbol{##2}% Symbol - & \glsentryuseri{##2}% Units - & \glsentryuserii{##2}% Dimensions - & ##3% Page list - \tabularnewline % end of row - }% - % Nothing between groups: - \renewcommand*{\glsgroupskip}{}% +(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{verbatim} +\end{codebox} \end{example} -\chapter[Xindy (Option 3)]{Xindy (\ifpdf\opt3\else Option 3\fi)} + +\chapter{Xindy (Option \glsfmttext{idx.opt.xdy})} \label{sec:xindy} -If you want to use \gls{xindy} to sort the glossary, you -must use the package option \pkgopt{xindy}: -\begin{verbatim} -\usepackage[xindy]{glossaries} -\end{verbatim} -This ensures that the glossary information is written in -\gls*{xindy} syntax. - -\sectionref{sec:makeglossaries} covers how to use the external -\gls{indexingapp}, and \sectionref{sec:locationsyntax} covers the -issues involved in the location syntax. This section covers the -commands provided by the \styfmt{glossaries} package that allow you -to adjust the \gls{xindy} style file (\filetype{xdy}) and +\glsaddeach[format=(]{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 \gls{xindy} style -file, the \styfmt{glossaries} package provides the following +To assist writing information to the \app{xindy} style +file, the \sty{glossaries} package provides the following commands: -\begin{definition}[\DescribeMacro{\glsopenbrace}] -\cs{glsopenbrace} -\end{definition} -\begin{definition}[\DescribeMacro{\glsclosebrace}] -\cs{glsclosebrace} -\end{definition} -which produce an open and closing brace. (This is needed because -\verb|\{| and \verb|\}| don't expand to a simple brace character -when written to a file.) Similarly, you can write a percent -character using: -\begin{definition}[\DescribeMacro{\glspercentchar}] -\cs{glspercentchar} -\end{definition} -and a tilde character using: -\begin{definition}[\DescribeMacro{\glstildechar}] -\cs{glstildechar} -\end{definition} -For example, a newline character is specified in a \gls{xindy} style -file using \verb|~n| so you can use \texttt{\cs{glstildechar} n} -to write this correctly (or you can do \verb|\string~n|). -A backslash can be written to a file using -\begin{definition}[\DescribeMacro{\glsbackslash}] -\cs{glsbackslash} -\end{definition} - -In addition, if you are using a package that makes the double -quote character active (e.g. \sty{ngerman}) you can use: -\begin{definition}[\DescribeMacro{\glsquote}] -\cs{glsquote}\marg{text} -\end{definition} -which will produce \verb|"|\meta{text}\verb|"|. Alternatively, -you can use \verb|\string"| to write the double-quote character. +\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 \verb|"| for clarity. +made active, so the examples just use \sym{dblquote} for clarity. -If you want greater control over the \gls{xindy} style file than is +If you want greater control over the \app{xindy} style file than is available through the \LaTeX\ commands provided by the -\styfmt{glossaries} package, you will need to edit the \gls*{xindy} -style file. In which case, you must use \ics{noist} to prevent the -style file from being overwritten by the \styfmt{glossaries} -package. For additional information about \gls*{xindy}, read the -\gls*{xindy} documentation. I'm sorry I can't provide any assistance -with writing \gls*{xindy} style files. If you need help, I recommend -you ask on the \gls*{xindy} mailing list -(\url{http://xindy.sourceforge.net/mailing-list.html}). +\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{documentpreamble} +(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} -When you use \gls{xindy}, you need to specify the language +\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 -\gls*{xindy} style file that defines the relevant alphabet -and sort rules). If you use \gls{makeglossaries}, +\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 -(\filetype{aux}) file. The \gls{makeglossaries} script attempts to -find the root language given your document settings, but in the -event that it gets it wrong or if \gls*{xindy} doesn't support +(\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: -\begin{definition}[\DescribeMacro{\GlsSetXdyLanguage}] -\cs{GlsSetXdyLanguage}\oarg{glossary type}\marg{language} -\end{definition} +\cmddef{GlsSetXdyLanguage} where \meta{language} is the name of the language. The -optional argument can be used if you have multiple glossaries -in different languages. If \meta{glossary type} is omitted, it -will be applied to all glossaries, otherwise the language -setting will only be applied to the glossary given by -\meta{glossary type}. - -If the \sty{inputenc} package is used, the encoding will be -obtained from the value of \ics{inputencodingname}. -Alternatively, you can specify the encoding using: -\begin{definition}[\DescribeMacro{\GlsSetXdyCodePage}] -\cs{GlsSetXdyCodePage}\marg{code} -\end{definition} -where \meta{code} is the name of the encoding. For example: -\begin{verbatim} -\GlsSetXdyCodePage{utf8} -\end{verbatim} - -Note that you can also specify the language and encoding using -the package option -\verb|xindy={language=|\meta{lang}\verb|,codepage=|\meta{code}\verb|}|. +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{verbatim} -\usepackage[xindy={language=english,codepage=utf8}]{glossaries} -\end{verbatim} +\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 \gls{xindy} style file that +If you write your own custom \app{xindy} style file that includes the language settings, you need to set the language to nothing: -\begin{verbatim} -\GlsSetXdyLanguage{} -\end{verbatim} -(and remember to use \ics{noist} to prevent the style file from +\begin{codebox} +\gls{GlsSetXdyLanguage}\marg{} +\end{codebox} +(and remember to use \gls{noist} to prevent the style file from being overwritten). -\begin{important} -The commands \cs{GlsSetXdyLanguage} and \cs{GlsSetXdyCodePage} -have no effect if you don't use \gls{makeglossaries}. If -you call \gls{xindy} without \gls*{makeglossaries} you -need to remember to set the language and encoding using the -\xdyopt{L} and \xdyopt{C} switches. -\end{important} - \section{Locations and Number lists} \label{sec:xindyloc} -If you use \pkgopt{xindy}, the \styfmt{glossaries} package needs to -know which counters you will be using in the \gls{numberlist} in order to correctly format the \gls{xindy} style -file. Counters specified using the \pkgopt{counter} package option -or the \meta{counter} option of \ics{newglossary} are +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 \gloskey[glslink]{counter} key for commands like -\ics{glslink}, then you need to identify these counters \emph{before} -\ics{makeglossaries} using: -\begin{definition}[\DescribeMacro{\GlsAddXdyCounters}] -\cs{GlsAddXdyCounters}\marg{counter list} -\end{definition} +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. -The most likely \ixindyattrs attributes used in the \gloskey[glslink]{format} -key (\locfmt{textrm}, \locfmt{hyperrm} etc) are automatically added -to the \gls{xindy} style file, but if you want to use another -attribute, you need to add it using: -\begin{definition}[\DescribeMacro{\GlsAddXdyAttribute}] -\cs{GlsAddXdyAttribute}\marg{name} -\end{definition} -where \meta{name} is the name of the attribute, as used in -the \gloskey[glslink]{format} key. - -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 \ixindyattrs attributes are listed. Consider +\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{verbatim} -\newcommand*{\primary}[1]{\textbf{#1}} -\GlsAddXdyAttribute{primary} -\end{verbatim} +\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{verbatim} -A \gls[format=primary]{duck} is an aquatic bird. -There are lots of different types of \gls{duck}. -\end{verbatim} -This will give the \verb|format=primary| instance preference over -the next use that doesn't use the \gloskey[glslink]{format} key. +\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{verbatim} -\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}} -\end{verbatim} -but with \gls{xindy}, I also need to add this as an allowed -\ixindyattrs attribute: -\begin{verbatim} -\GlsAddXdyAttribute{hyperbfit} -\end{verbatim} +\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 -\ics{gls}: -\begin{verbatim} -Here is a \gls[format=hyperbfit]{sample} entry. -\end{verbatim} -(where \texttt{sample} is the label of the required entry). +\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 \cs{GlsAddXdyAttribute} has no effect if \ics{noist} is -used or if \ics{makeglossaries} is omitted. -\cs{GlsAddXdyAttribute} must be used before \ics{makeglossaries}. -Additionally, \cs{GlsAddXdyCounters} must come before -\cs{GlsAddXdyAttribute}. +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 location numbers include formatting commands, then -you need to add a location style in the appropriate format using -\begin{definition}[\DescribeMacro{\GlsAddXdyLocation}] -\cs{GlsAddXdyLocation}\oarg{prefix-location}\marg{name}\marg{definition} -\end{definition} -where \meta{name} is the name of the format and \meta{definition} is -the \gls{xindy} definition. The optional argument \meta{prefix-location} -is needed if \cs{theH}\meta{counter} either isn't defined or is -different from \cs{the}\meta{counter}. + +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 \cs{GlsAddXdyLocation} has no effect if \ics{noist} is -used or if \ics{makeglossaries} is omitted. -\cs{GlsAddXdyLocation} must be used before \ics{makeglossaries}. +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 \cs{thesection} as follows: -\begin{verbatim} -\renewcommand*{\thesection}{[\thechapter]\arabic{section}} -\end{verbatim} -If I haven't done "counter=section" in the package -option, I need to specify that the counter will be used as a -location number: -\begin{verbatim} -\GlsAddXdyCounters{section} -\end{verbatim} -Next I need to add the location style (\cs{thechapter} is assumed to -be the standard \verb"\arabic{chapter}"): -\begin{verbatim} -\GlsAddXdyLocation{section}{:sep "[" "arabic-numbers" :sep "]" +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{verbatim} +\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 \cs{theHsection} as: -\begin{verbatim} -\renewcommand*{\theHsection}{\thepart.\thesection} -\renewcommand*{\thepart}{\Roman{part}} -\end{verbatim} -then I need to modify the \cs{GlsAddXdyLocation} code above to: -\begin{verbatim} -\GlsAddXdyLocation["roman-numbers-uppercase"]{section}{:sep "[" +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{verbatim} -Since \ics{Roman} will result in an empty string if the counter is +\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{verbatim} -\GlsAddXdyLocation{zero.section}{:sep "[" +\begin{codebox} +\gls{GlsAddXdyLocation}\marg{zero.section}\marg{:sep "[" "arabic-numbers" :sep "]" "arabic-numbers" } -\end{verbatim} +\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 \cs{dicei}, \ldots, \cs{dicevi} that represent the six +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 -\cs{dice}\meta{n} command is used otherwise it does \cs{dicevi} the +\csmetafmt{dice}{n}{} command is used otherwise it does \gls{dicevi} the required number of times with the leftover in a final -\cs{dice}\meta{n}. For example, the number 16 is represented by -\verb|\dicevi\dicevi\diceiv| ($6+6+4=16$). I've called this command -\cs{tallynum} to match the example given earlier in +\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{verbatim} -\newrobustcmd{\tallynum}[1]{% - \ifnum\number#1<7 - $\csname dice\romannumeral#1\endcsname$% - \else - $\dicevi$% - \expandafter\tallynum\expandafter{\numexpr#1-6}% - \fi +\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{verbatim} +\end{codebox} Here's the counter command: -\begin{verbatim} -newcommand{\tally}[1]{\tallynum{\arabic{#1}}} -\end{verbatim} -The \ctr{page} counter representation (\cs{thepage}) needs to be +\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{verbatim} -\renewcommand*{\thepage}{\tally{page}} -\end{verbatim} -The \cs{tally} command expands to \cs{tallynum} \marg{number} so -this needs a location class that matches this format: -\begin{verbatim} -\GlsAddXdyLocation{tally}{% - :sep "\string\tallynum\space\glsopenbrace" +\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 "\glsclosebrace" + :sep "\gls{glsclosebrace}" } -\end{verbatim} -The space between \cs{tallynum} and \marg{number} is -significant to \gls{xindy} so \cs{space} is required. - -Note that \cs{GlsAddXdyLocation}\marg{name}\marg{definition} will define -commands in the form: -\begin{definition} -\cs{glsX}\meta{counter}"X"\meta{name}\marg{Hprefix}\marg{location} -\end{definition} -for each counter that has been identified either by the -\pkgopt{counter} package option, the \meta{counter} option for -\ics{newglossary} or in the argument of \ics{GlsAddXdyCounters}. -The first argument \meta{Hprefix} is only relevant when used with -the \sty{hyperref} package and indicates that \cs{theH}\meta{counter} -is given by \cs{Hprefix}"."\cs{the}\meta{counter}. - -The sample file \samplefile{xdy}, which comes with the \styfmt{glossaries} -package, uses the default \ctr{page} counter for locations, and it -uses the default \ics{glsnumberformat} and a custom \cs{hyperbfit} -format. A new \gls{xindy} location called \texttt{tallynum}, as +\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 -\cs{glsX}\meta{counter}"X"\meta{format} commands: -\begin{verbatim} -\renewcommand{\glsXpageXglsnumberformat}[2]{% - \linkpagenumber#2% +\gls{glsXcounterXformat} commands: +\begin{codebox} +\cmd{renewcommand}\marg{\cmd{glsXpageXglsnumberformat}}[2]\marg{\comment{} + \cmd{linkpagenumber}\sym{hash}2\comment{} } - -\renewcommand{\glsXpageXhyperbfit}[2]{% - \textbf{\em\linkpagenumber#2}% +\codepar +\cmd{renewcommand}\marg{\cmd{glsXpageXhyperbfit}}[2]\marg{\comment{} + \gls{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\sym{hash}2}\comment{} } - -\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}} -\end{verbatim} -Note that the second argument of \cs{glsXpageXglsnumberformat} is -in the format \cs{tallynum}\marg{n} so the line -\begin{verbatim} - \linkpagenumber#2% -\end{verbatim} +\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{alltt} - \cs{linkpagenumber}\cs{tallynum}\marg{number} -\end{alltt} -so \cs{tallynum} is the first argument of \cs{linkpagenumber} +\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. +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 \ics{thepage} as follows: -\begin{verbatim} -\renewcommand*{\thepage}{\Numberstring{page}} -\end{verbatim} -This \emph{used} to get expanded to \verb|\protect \Numberstringnum |\marg{n} +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{verbatim} -\GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space - \string\Numberstringnum\space\glsopenbrace" - "arabic-numbers" :sep "\glsclosebrace"} -\end{verbatim} -and if I'd used the \cs{linkpagenumber} command from the previous +\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 -\cs{protect}): -\begin{verbatim} -\newcommand{\linkpagenumber}[3]{\hyperlink{page.#3}{#1#2{#3}}} -\end{verbatim} - -The internal definition of \cs{Numberstring} has since changed -so that it now expands to \verb|\Numberstringnum |\marg{n} -(no \cs{protect}). This means that the location class definition +\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{verbatim} -\GlsAddXdyLocation{Numberstring}{% no \protect now! - :sep "\string\Numberstringnum\space\glsopenbrace" - "arabic-numbers" :sep "\glsclosebrace"} -\end{verbatim} -and \cs{linkpagenumber} goes back to only two arguments: -\begin{verbatim} -\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}} -\end{verbatim} -The other change is that \cs{Numberstring} uses -\begin{alltt} -\cs{the}\cs{value}\marg{counter} -\end{alltt} +\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{alltt} -\cs{expandafter}\cs{the}\cs{csname} c@\meta{counter}\cs{endcsname} -\end{alltt} -so it hides \cs{c@page} from the location escaping mechanism +\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 indexing occurs during the output +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 \cs{expandafter} before \verb|\the\value| which -no longer hides \cs{c@page} from the location escaping mechanism, so +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. @@ -13640,54 +27615,60 @@ are outside of your control and liable to change, it's best to provide a wrapper command. \end{important} -Instead of directly using \cs{Numberstring} in the definition of -\cs{thepage}, I can provide a custom command in the same form -as the earlier \cs{tally} command: -\begin{verbatim} -\newcommand{\customfmt}[1]{\customfmtnum{\arabic{#1}}} -\newrobustcmd{\customfmtnum}[1]{\Numberstringnum{#1}} -\end{verbatim} +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{alltt} -:locref "\glsopenbrace\glsclosebrace\glsopenbrace\string\\customfmtnum \marg{n}\glsclosebrace" -\end{alltt} +\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{verbatim} -\GlsAddXdyLocation{customfmt}{ - :sep "\string\customfmtnum\space\glsopenbrace" +\begin{compactcodebox} +\gls{GlsAddXdyLocation}\marg{customfmt}\marg{ + :sep "\cmd{string}\cmd{customfmtnum}\gls{space}\gls{glsopenbrace}" "arabic-numbers" - :sep "\glsclosebrace"} -\end{verbatim} + :sep "\gls{glsclosebrace}"} +\end{compactcodebox} The sample file \samplefile{xdy3} illustrates this. \end{example} -In the \gls{numberlist}, the locations are sorted according to the list -of provided location classes. The default ordering is: -\texttt{roman-page-numbers} (i, ii, \ldots), \texttt{arabic-page-numbers} -(1, 2, \ldots), \texttt{arabic-section-numbers} (for example, 1.1 if the -compositor is a full stop or 1-1 if the compositor is a -hyphen\footnote{see \ics{glsSetCompositor} described in -\sectionref{sec:setup}}), \texttt{alpha-page-numbers} (a, b, \ldots), -\texttt{Roman-page-numbers} (I, II, \ldots), \texttt{Alpha-page-numbers} -(A, B, \ldots), \texttt{Appendix-page-numbers} (for example, A.1 if the Alpha -compositor is a full stop or A-1 if the Alpha compositor is a -hyphen\footnote{see \ics{glsSetAlphaCompositor} described in -\sectionref{sec:setup}}), user defined location names (as specified -by \ics{GlsAddXdyLocation} in the order in which they were defined), -and finally \texttt{see} (cross-referenced entries).\footnote{With -\gls{glossaries-extra} \texttt{seealso} is appended to the end of -the list.} This ordering can be changed using: - -\begin{definition}[\DescribeMacro\GlsSetXdyLocationClassOrder] -\cs{GlsSetXdyLocationClassOrder}\marg{location names} -\end{definition} +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{verbatim} -\GlsSetXdyLocationClassOrder{ +\begin{codebox} +\gls{GlsSetXdyLocationClassOrder}\marg{ "arabic-page-numbers" "arabic-section-numbers" "roman-page-numbers" @@ -13697,1186 +27678,1603 @@ separated by white space. For example: "Appendix-page-numbers" "see" } -\end{verbatim} -(Remember to add \verb|"seealso"| if you're using -\gls{glossaries-extra}.) +\end{codebox} +(Remember to add \code{"seealso"} if you're using \sty{glossaries-extra}.) \begin{important} -Note that \cs{GlsSetXdyLocationClassOrder} has no effect if -\ics{noist} is used or if \ics{makeglossaries} is omitted. -\cs{GlsSetXdyLocationClassOrder} must be used before -\ics{makeglossaries}. +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 \gls{numberlist} consists of a sequence of consecutive +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: - -\begin{definition}[\DescribeMacro\GlsSetXdyMinRangeLength] -\cs{GlsSetXdyMinRangeLength}\marg{n} -\end{definition} +\cmddef{GlsSetXdyMinRangeLength} +The \meta{value} may be the keyword \optfmt{none}, to indicate no +\idx{range} formation, or a number. For example: -\begin{verbatim} -\GlsSetXdyMinRangeLength{3} -\end{verbatim} -The argument may also be the keyword \texttt{none}, to indicate that -there should be no range formations. See the \gls{xindy} -manual for further details on range formations. +\begin{codebox} +\gls{GlsSetXdyMinRangeLength}\marg{3} +\end{codebox} +See the \app{xindy} manual for further details on \idx{range} formations. \begin{important} -Note that \cs{GlsSetXdyMinRangeLength} has no effect if \ics{noist} -is used or if \ics{makeglossaries} is omitted. -\cs{GlsSetXdyMinRangeLength} must be used before -\ics{makeglossaries}. +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 glossary is divided into groups according to the first -letter of the sort key. The \styfmt{glossaries} package also adds -a number group by default, unless you suppress it in the -\pkgopt{xindy} package option. For example: -\begin{verbatim} -\usepackage[xindy={glsnumbers=false}]{glossaries} -\end{verbatim} -Any entry that doesn't go in one of the letter groups or the -number group is placed in the default group. If you want \gls{xindy} +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 \gls{xindy}['s] \texttt{numeric-sort} module: -\begin{verbatim} -\GlsAddXdyStyle{numeric-sort} -\end{verbatim} +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} + +\glsaddeach[format=)]{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}. -If you don't use \texttt{glsnumbers=false}, the default behaviour is to locate -the number group before the \qt{A} letter group. If you are not using a -Roman alphabet, you need to change this using: +\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. -\begin{definition}[\DescribeMacro\GlsSetXdyFirstLetterAfterDigits] -\cs{GlsSetXdyFirstLetterAfterDigits}\marg{letter} -\end{definition} -where \meta{letter} is the first letter of your alphabet. Take care -if you're using \sty{inputenc} as non-ASCII characters are actually -active characters that expand. (This isn't a problem with the native -\gls{UTF-8} engines and \sty{fontspec}.) The starred form will sanitize -the argument to prevent expansion. -Alternatively you can use: +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}. +\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}. -\begin{definition}[\DescribeMacro\GlsSetXdyNumberGroupOrder] -\cs{GlsSetXdyNumberGroupOrder}\marg{relative location} -\end{definition} -to change the default -\begin{alltt} -:before \cs{string}"\meta{letter}\cs{string}" -\end{alltt} -to \meta{relative location}. For example: -\begin{verbatim} -\GlsSetXdyNumberGroupOrder{:after \string"Z\string"} -\end{verbatim} -will put the number group after the \qt{Z} letter group. -Again take care of active characters. There's a starred version -that sanitizes the argument (so don't use \cs{string} in it). -\begin{alltt} -\cs{GlsSetXdyNumberGroupOrder}*\{:after "\"O"\} -\end{alltt} + +\section{Case-Changing} +\label{sec:casechanging} + +These commands may be used to perform a \idx+{casechange}. \begin{important} -Note that these commands have no effect if -\ics{noist} is used or if \ics{makeglossaries} is omitted. -\cs{GlsSetXdyFirstLetterAfterDigits} must be used before -\ics{makeglossaries}.\par +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}. + +\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} -\chapter{Utilities} -\label{sec:utilities} +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}). -This section describes some utility commands. Additional commands -can be found in the documented code (glossaries-code.pdf). +\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}. -\begin{xtr} -The \gls{glossaries-extra} package provides extra utility commands. -See the \qt{Utilities} section of the \gls{glossaries-extra} manual. -\end{xtr} \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 \cs{@for} command, make sure your list +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 -\href{http://www.dickimaw-books.com/latex/admin/html/docsvlist.shtml#spacesinlists}{\S2.7.2 of \qt{\LaTeX\ for Administrative +\dickimawhref{latex/admin/html/docsvlist.shtml\#spacesinlists}{\S2.7.2 of \qt{\LaTeX\ for Administrative Work}}.) \end{important} -\begin{definition}[\DescribeMacro{\forallglossaries}] -\cs{forallglossaries}\oarg{glossary list}\marg{cs}\marg{body} -\end{definition} -This iterates through \meta{glossary list}, a comma-separated list -of glossary labels (as supplied when the glossary was defined). -At each iteration \meta{cs} (which must be a control sequence) is -set to the glossary label for the current iteration and \meta{body} -is performed. If \meta{glossary list} is omitted, the default is to -iterate over all glossaries (except the ignored ones). - -\begin{definition}[\DescribeMacro{\forallacronyms}] -\cs{forallacronyms}\marg{cs}\marg{body} -\end{definition} -This is like \cs{forallglossaries} but only iterates over the -lists of acronyms (that have previously been declared using -\ics{DeclareAcronymList} or the \pkgopt{acronymlists} package +\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 \cs{forallglossaries}. +argument of \gls{forallglossaries}. \begin{xtr} -The \gls{glossaries-extra} -package provides an analogous command -\ics*{forallabbreviationlists}. +The \sty{glossaries-extra} package provides an analogous command +\gls{forallabbreviationlists}. \end{xtr} -\begin{definition}[\DescribeMacro{\forglsentries}] -\cs{forglsentries}\oarg{glossary label}\marg{cs}\marg{body} -\end{definition} -This iterates through all entries in the glossary given by -\meta{glossary label}. At each iteration \meta{cs} (which must be a -control sequence) is set to the entry label for the current -iteration and \meta{body} is performed. If \meta{glossary label} is -omitted, \ics{glsdefaulttype} (usually the main glossary) is used. - -\begin{definition}[\DescribeMacro{\forallglsentries}] -\cs{forallglsentries}\oarg{glossary list}\marg{cs}\marg{body} -\end{definition} -This is like \cs{forglsentries} but for each glossary in -\meta{glossary list} (a comma-separated list of glossary labels). If -\meta{glossary list} is omitted, the default is the list of all -defined glossaries (except the ignored ones). At each iteration -\meta{cs} is set to the entry label and \meta{body} is performed. +\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 -\cs{glsentrytype}\marg{cs} within \meta{body}.) +\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{definition}[\DescribeMacro{\ifglossaryexists}] -\cs{ifglossaryexists}{\meta{label}}{\meta{true part}}{\meta{false -part}} -\end{definition} -This checks if the glossary given by \meta{label} exists. If it -does \meta{true part} is performed, otherwise \meta{false part}. -The unstarred form will do \meta{false part} for ignored glossaries. -As from v4.46, there is now a starred form of this command which -will also consider ignored glossaries as existing. For example, -given: -\begin{alltt} -\ics{newignoredglossary}\mgroup{common} -\end{alltt} +\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{verbatim} -\ifglossaryexists{common}{true}{false} -\ifglossaryexists*{common}{true}{false} -\end{verbatim} +\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}. -\begin{definition}[\DescribeMacro{\ifglsentryexists}] -\cs{ifglsentryexists}{\meta{label}}{\meta{true part}}{\meta{false -part}} -\end{definition} -This checks if the glossary entry given by \meta{label} exists. If it -does \meta{true part} is performed, otherwise \meta{false part}. -(Note that \cs{ifglsentryexists} will always be true after the -containing glossary has been displayed via \ics{printglossary} -or \ics{printglossaries} even if the entry is explicitly defined -later in the document. This is because the entry has to be defined -before it can be displayed in the glossary, see \sectionref{sec:techissues} for -further details.) +\cmddef{ifglsentryexists} -\begin{definition}[\DescribeMacro{\glsdoifexists}] -\cs{glsdoifexists}\marg{label}\marg{code} -\end{definition} -Does \meta{code} if the entry given by \meta{label} exists. If it -doesn't exist, an error is generated. (This command uses -\cs{ifglsentryexists}.) - -\begin{definition}[\DescribeMacro{\glsdoifnoexists}] -\cs{glsdoifnoexists}\marg{label}\marg{code} -\end{definition} -Does the reverse of \cs{glsdoifexists}. (This command uses -\cs{ifglsentryexists}.) - -\begin{definition}[\DescribeMacro{\glsdoifexistsorwarn}] -\cs{glsdoifexistsorwarn}\marg{label}\marg{code} -\end{definition} -As \cs{glsdoifexists} but issues a warning rather than an error if -the entry doesn't exist. +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. -\begin{definition}[\DescribeMacro{\glsdoifexistsordo}] -\cs{glsdoifexistsordo}\marg{label}\marg{code}\marg{else code} -\end{definition} -Does \meta{code} if the entry given by \meta{label} exists otherwise -generate an error and do \meta{else code}. - -\begin{definition}[\DescribeMacro{\glsdoifnoexistsordo}] -\cs{glsdoifnoexistsordo}\marg{label}\marg{code}\marg{else code} -\end{definition} -Does \meta{code} if the entry given by \meta{label} doesn't exist otherwise -generate an error and do \meta{else code}. - -\begin{definition}[\DescribeMacro{\ifglsused}] -\cs{ifglsused}{\meta{label}}{\meta{true part}}{\meta{false -part}} -\end{definition} -See \sectionref{sec:glsunset}. - -\begin{definition}[\DescribeMacro{\ifglshaschildren}] -\cs{ifglshaschildren}{\meta{label}}{\meta{true part}}{\meta{false -part}} -\end{definition} -This checks if the glossary entry given by \meta{label} has any -sub-entries. If it does, \meta{true part} is performed, otherwise -\meta{false part}. This uses an inefficient method since this -information isn't stored. +\cmddef{glsdoifexists} +Does \meta{code} if the entry given by \meta{entry-label} exists. If it +doesn't exist, an undefined error is generated. -\begin{bib2gls} -If you use \gls{bib2gls}, a more efficient method is to use the -\resourceopt{save-child-count} resource option and test the value of -the \field{childcount} field. -\end{bib2gls} +\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. -\begin{definition}[\DescribeMacro{\ifglshasparent}] -\cs{ifglshasparent}{\meta{label}}{\meta{true part}}{\meta{false -part}} -\end{definition} -This checks if the glossary entry given by \meta{label} has a parent -entry. If it does, \meta{true part} is performed, otherwise -\meta{false part}. - -\begin{definition}[\DescribeMacro{\ifglshassymbol}] -\cs{ifglshassymbol}\marg{label}\marg{true part}\marg{false part} -\end{definition} -This checks if the glossary entry given by \meta{label} has had the -\gloskey{symbol} field set. If it has, \meta{true part} is performed, -otherwise \meta{false part}. - -\begin{definition}[\DescribeMacro{\ifglshaslong}] -\cs{ifglshaslong}\marg{label}\marg{true part}\marg{false part} -\end{definition} -This checks if the glossary entry given by \meta{label} has had the -\gloskey{long} field set. If it has, \meta{true part} is performed, -otherwise \meta{false part}. This should be true for any entry that -has been defined via \ics{newacronym}. -There is no check for the existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\ifglshasshort}] -\cs{ifglshasshort}\marg{label}\marg{true part}\marg{false part} -\end{definition} -This checks if the glossary entry given by \meta{label} has had the -\gloskey{short} field set. If it has, \meta{true part} is performed, -otherwise \meta{false part}. This should be true for any entry that -has been defined via \ics{newacronym}. -There is no check for the existence of \meta{label}. - -\begin{definition}[\DescribeMacro{\ifglshasdesc}] -\cs{ifglshasdesc}\marg{label}\marg{true part}\marg{false part} -\end{definition} -This checks if the \gloskey{description} field is non-empty for -the entry given by \meta{label}. If it has, \meta{true part} is -performed, otherwise \meta{false part}. Compare with: -\begin{definition}[\DescribeMacro{\ifglsdescsuppressed}] -\cs{ifglsdescsuppressed}\marg{label}\marg{true part}\marg{false part} -\end{definition} -This checks if the \gloskey{description} field has been set to just -\ics{nopostdesc} for the entry given by \meta{label}. If it has, -\meta{true part} is performed, otherwise \meta{false part}. -There is no check for the existence of \meta{label}. - -For all other fields you can use: -\begin{definition}[\DescribeMacro\ifglshasfield] -\cs{ifglshasfield}\marg{field}\marg{label}\marg{true part}\marg{false -part} -\end{definition} -This tests the value of the field given by \meta{field} for the entry -identified by \meta{label}. If the value is empty \emph{or the default -value}, then \meta{false part} is performed, otherwise \meta{true -part} is performed. If the field supplied is unrecognised \meta{false part} -is performed and a warning is issued. Unlike the above commands, -such as \cs{ifglshasshort}, an error occurs if the entry is -undefined. - -As from version 4.23, within \meta{true part} you can use -\begin{definition}[\DescribeMacro\glscurrentfieldvalue] -\cs{glscurrentfieldvalue} -\end{definition} -to access the field value. This command is -initially defined to nothing but has -no relevance outside \meta{true part}. This saves re-accessing the -field if the test is true. For example: -\begin{verbatim} -\ifglshasfield{useri}{sample}{, \glscurrentfieldvalue}{} -\end{verbatim} -will insert a comma, space and the field value if the -\gloskey{user1} key has been set for -the entry whose label is \texttt{sample}. +\cmddef{glsdoifexistsorwarn} +As \gls{glsdoifexists} but issues a warning rather than an error if +the entry doesn't exist. -You can test if the value of the field is equal to a given string -using: -\begin{definition}[\DescribeMacro\ifglsfieldeq] -\cs{ifglsfieldeq}\marg{label}\marg{field}\marg{string}\marg{true}\marg{false} -\end{definition} -In this case the \meta{field} must be the field name not the key -(see \tableref{tab:fieldmap}). If the field isn't recognised, an -error will occur. This command internally uses -\sty{etoolbox}'s \cs{ifcsstring} to perform the comparison. \emph{The -string is not expanded during the test.} - -The result may vary depending on whether or not expansion is on for -the given field (when the entry was defined). For example: -\begin{verbatim} -\documentclass{article} +\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}. -\usepackage{glossaries} +\begin{xtr} +The undefined\slash already defined errors can be converted to warnings +with \optval{undefaction}{warn}. +\end{xtr} -\newcommand*{\foo}{FOO} +\cmddef{ifglsused} -\newglossaryentry{sample1}{name={sample1},description={an example}, -user1={FOO}} -\newglossaryentry{sample2}{name={sample2},description={an example}, -user1={\foo}} +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}). -\begin{document} -\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}. +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}. -\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}. -\end{document} -\end{verbatim} -This will produce \qt{TRUE} in both cases since expansion is on, so -\cs{foo} was expanded to \qt{FOO} when \texttt{sample2} was defined. -If the tests are changed to: -\begin{verbatim} -\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}. +\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} -\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}. -\end{verbatim} -then this will produce \qt{FALSE} in both cases. Now suppose -expansion is switched off for the \gloskey{user1} key: -\begin{verbatim} -\documentclass{article} +\cmddef{ifglshaschildren} -\usepackage{glossaries} +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}. -\newcommand*{\foo}{FOO} +\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} -\glssetnoexpandfield{useri} +\cmddef{ifglshasparent} -\newglossaryentry{sample1}{name={sample1},description={an example}, -user1={FOO}} -\newglossaryentry{sample2}{name={sample2},description={an example}, -user1={\foo}} +This does \meta{true} if the \gloskey+{parent} field is non-empty +for the entry identified by \meta{entry-label}. Uses \gls{glsdoifexists}. -\begin{document} -\ifglsfieldeq{sample1}{useri}{FOO}{TRUE}{FALSE}. +\cmddef{ifglshassymbol} -\ifglsfieldeq{sample2}{useri}{FOO}{TRUE}{FALSE}. -\end{document} -\end{verbatim} -This now produces \qt{TRUE} for the first case (comparing \qt{FOO} -with \qt{FOO}) and \qt{FALSE} for the second case (comparing -\qt{\cs{foo}} with \qt{FOO}). +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}. -The reverse happens in the following: -\begin{verbatim} -\documentclass{article} +\cmddef{ifglshaslong} -\usepackage{glossaries} +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}. -\newcommand*{\foo}{FOO} +\cmddef{ifglshasshort} -\glssetnoexpandfield{useri} +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}. -\newglossaryentry{sample1}{name={sample1},description={an example}, -user1={FOO}} -\newglossaryentry{sample2}{name={sample2},description={an example}, -user1={\foo}} +\cmddef{ifglshasdesc} -\begin{document} -\ifglsfieldeq{sample1}{useri}{\foo}{TRUE}{FALSE}. +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}. -\ifglsfieldeq{sample2}{useri}{\foo}{TRUE}{FALSE}. -\end{document} -\end{verbatim} -This now produces \qt{FALSE} for the first case (comparing \qt{FOO} -with \qt{\cs{foo}}) and \qt{TRUE} for the second case (comparing -\qt{\cs{foo}} with \qt{\cs{foo}}). +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. -You can test if the value of a field is equal to the replacement -text of a command using: -\begin{definition}[\DescribeMacro\ifglsfielddefeq] -\cs{ifglsfielddefeq}\marg{label}\marg{field}\marg{command}\marg{true}\marg{false} -\end{definition} -This internally uses \sty{etoolbox}'s \cs{ifdefstrequal} command to -perform the comparison. The argument \meta{command} must be a macro. +\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. -For example: -\begin{verbatim} -\documentclass{article} +\cmddef{ifglshasfield} -\usepackage{glossaries} +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}. -\newcommand*{\foo}{FOO} +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. -\glssetnoexpandfield{useri} +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}). -\newglossaryentry{sample1}{name={sample1},description={an example}, -user1={FOO}} -\newglossaryentry{sample2}{name={sample2},description={an example}, -user1={\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}}). -\begin{document} -\ifglsfielddefeq{sample1}{useri}{\foo}{TRUE}{FALSE}. +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. -\ifglsfielddefeq{sample2}{useri}{\foo}{TRUE}{FALSE}. -\end{document} -\end{verbatim} +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 -\texttt{useri} field (\qt{FOO}) is the same as the replacement text -(definition) of \cs{foo} (\qt{FOO}). We have the result -\qt{\texttt{FOO}} is equal to \qt{\texttt{FOO}}. +\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 -\texttt{useri} field (\qt{\cs{foo}}) is not the same as the replacement -text (definition) of \cs{foo} (\qt{FOO}). No expansion has been -performed on the value of the \texttt{useri} field. We have the -result \qt{\cs{foo}} is not equal to \qt{\texttt{FOO}}. +\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{verbatim} -\newcommand{\FOO}{\foo} -\ifglsfielddefeq{sample2}{useri}{\FOO}{TRUE}{FALSE}. -\end{verbatim} +\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 -\texttt{useri} field (\qt{\cs{foo}}) is the same as the replacement -text (definition) of \cs{FOO} (\qt{\cs{foo}}). We have the result \qt{\cs{foo}} -is equal to \qt{\cs{foo}}. +\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: -\begin{definition}[\DescribeMacro\ifglsfieldcseq] -\cs{ifglsfieldcseq}\marg{label}\marg{field}\marg{csname}\marg{true}\marg{false} -\end{definition} -This internally uses \sty{etoolbox}'s \cs{ifcsstrequal} command -instead of \cs{ifdefstrequal}. +\cmddef{ifglsfieldcseq} +This robust command is like {ifglsfielddefeq} +but internally uses \sty{etoolbox}'s \gls{ifcsstrequal} command +instead of \gls{ifdefstrequal}. \section{Fetching and Updating the Value of a Field} \label{sec:fetchset} In addition to the commands described in \sectionref{sec:glsnolink}, -the following may also be used to fetch field information. -\begin{definition}[\DescribeMacro\glsentrytype] -\cs{glsentrytype}\marg{label} -\end{definition} -Expands to the entry's glossary type. No existence check is -performed. +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} -\begin{definition}[\DescribeMacro\glsentryparent] -\cs{glsentryparent}\marg{label} -\end{definition} -Expands to the label of the entry's parent. No existence check is +\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. -\begin{definition}[\DescribeMacro\glsentrysort] -\cs{glsentrysort}\marg{label} -\end{definition} -Expands to the entry's sort value. No existence check is performed. - -You can fetch the value of a given field and store it in a control -sequence using: -\begin{definition}[\DescribeMacro\glsfieldfetch] -\cs{glsfieldfetch}\marg{label}\marg{field}\marg{cs} -\end{definition} -where \meta{label} is the label identifying the glossary entry, -\meta{field} is the field label (see \tableref{tab:fieldmap}) -and \meta{cs} is the control sequence in which to store the value. -Remember that \meta{field} is the internal label and is not -necessarily the same as the key used to set that field in the -argument of \cs{newglossaryentry} (or the optional argument of -\cs{newacronym}). This command uses \cs{glsdoifexists} so an error -will occur if the entry hasn't been defined. - -If you need to expand to the field value without expanding the -contents you can use: -\begin{definition}[\DescribeMacro\glsunexpandedfieldvalue] -\cs{glsunexpandedfieldvalue}\marg{label}\marg{field} -\end{definition} -where \meta{label} is the label identifying the glossary entry, -\meta{field} is the internal field label (see -\tableref{tab:fieldmap}). If the entry doesn't exist or if the field -isn't defined or hasn't been set this expands to nothing. +\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}\marg{label}\marg{field}\marg{cs} + +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. - -In all the four related commands below, \meta{label} and -\meta{field} are as above and \meta{definition} is the new value -of the field. - -\begin{definition}[\DescribeMacro\glsfielddef] -\cs{glsfielddef}\marg{label}\marg{field}\marg{definition} -\end{definition} -This uses \cs{def} to change the value of the field (so it will be +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). -\begin{definition}[\DescribeMacro\glsfieldedef] -\cs{glsfieldedef}\marg{label}\marg{field}\marg{definition} -\end{definition} -This uses \cs{edef} to change the value of the field (so it will be -localised by any grouping). Any fragile commands contained in the -\meta{definition} must be protected. +\cmddef{glsfieldedef} +This robust command uses \gls{protected@csedef} to change the value of the +field (so it will be localised by any grouping). -\begin{definition}[\DescribeMacro\glsfieldgdef] -\cs{glsfieldgdef}\marg{label}\marg{field}\marg{definition} -\end{definition} -This uses \cs{gdef} to change the value of the field. - -\begin{definition}[\DescribeMacro\glsfieldxdef] -\cs{glsfieldxdef}\marg{label}\marg{field}\marg{definition} -\end{definition} -This uses \cs{xdef} to change the value of the field. Any fragile -commands contained in the \meta{definition} must be protected. +\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 -\styfmt{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 \styfmt{glossaries-prefix} -package automatically loads the \styfmt{glossaries} package and has -the same package options. - -The extra keys for \ics{newglossaryentry} are as follows: -\begin{description} -\item[\gloskey{prefix}] The prefix associated with the -\gloskey{text} key. This defaults to nothing. +\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. -\item[\gloskey{prefixplural}] The prefix associated with the -\gloskey{plural} key. This defaults to nothing. +\begin{xtr} +The \sty{glossaries-prefix} package can automatically be loaded +with \sty{glossaries-extra} via the \opt{prefix} package option. +\end{xtr} -\item[\gloskey{prefixfirst}] The prefix associated with the -\gloskey{first} key. If omitted, this defaults to the value of the -\gloskey{prefix} key. +The extra keys for \gls{newglossaryentry} are as follows: -\item[\gloskey{prefixfirstplural}] The prefix associated with the -\gloskey{firstplural} key. If omitted, this defaults to the value of -the \gloskey{prefixplural} key. -\end{description} +\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{verbatim} -\documentclass{article} - -\usepackage[colorlinks]{hyperref} -\usepackage[toc,acronym]{glossaries-prefix} -\end{verbatim} -Note that I've simply replaced \styfmt{glossaries} from previous -sample documents with \styfmt{glossaries-prefix}. Now for a sample -definition\footnote{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 after \qt{a} in the \gloskey{prefix} field.}: -\begin{verbatim} -\newglossaryentry{sample}{name={sample},% - description={an example},% - prefix={a~},% - prefixplural={the\space}% +\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{verbatim} +\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{verbatim} -\newglossaryentry{oeil}{name={oeil}, - plural={yeux}, - description={eye}, - prefix={l'}, - prefixplural={les\space}} -\end{verbatim} +\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 \cs{space}, \verb*|\ | (backslash space) or -\verb|~| due to the automatic spacing trimming performed in -\meta{key}=\meta{value} options. +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 -\begin{definition}[\DescribeMacro\glsprefixsep] -\cs{glsprefixsep} -\end{definition} -to do a space. (This command does nothing by default.) For example: -\begin{verbatim} -\renewcommand{\glsprefixsep}{\space} -\end{verbatim} +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{verbatim} -\newacronym - [% - prefix={an\space},prefixfirst={a~}% - ]{svm}{SVM}{support vector machine} -\end{verbatim} +\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 \ics{gls}. Note that the -prefix is not considered part of the \gls{linktext}, so it's not +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 \glslike\ -command. (See \sectionref{sec:glslink} for further details.) - -\begin{definition}[\DescribeMacro\pgls] -\cs{pgls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This is inserts the value of the \gloskey{prefix} key (or -\gloskey{prefixfirst} key, on \gls{firstuse}) in front of -\cs{gls}\oarg{options}\marg{label}\oarg{insert}. - -\begin{definition}[\DescribeMacro\Pgls] -\cs{Pgls}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -If the \gloskey{prefix} key (or \gloskey{prefixfirst}, on -\gls*{firstuse}) has been set, this displays the value of that key -with the first letter converted to upper case followed by -\cs{gls}\oarg{options}\marg{label}\oarg{insert}. If that key hasn't -been set, this is equivalent to -\ics{Gls}\oarg{options}\marg{label}\oarg{insert}. - -\begin{definition}[\DescribeMacro\PGLS] -\cs{PGLS}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -As \cs{pgls} but converts the prefix to upper case and uses -\ics{GLS} instead of \cs{gls}. - -\begin{definition}[\DescribeMacro\pglspl] -\cs{pglspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -This is inserts the value of the \gloskey{prefixplural} key (or -\gloskey{prefixfirstplural} key, on \gls{firstuse}) in front of -\cs{glspl}\oarg{options}\marg{label}\oarg{insert}. - -\begin{definition}[\DescribeMacro\Pglspl] -\cs{Pglspl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -If the \gloskey{prefixplural} key (or \gloskey{prefixfirstplural}, on -\gls*{firstuse}) has been set, this displays the value of that key -with the first letter converted to upper case followed by -\cs{glspl}\oarg{options}\marg{label}\oarg{insert}. If that key hasn't -been set, this is equivalent to -\ics{Glspl}\oarg{options}\marg{label}\oarg{insert}. - -\begin{definition}[\DescribeMacro\PGLSpl] -\cs{PGLSpl}\oarg{options}\marg{label}\oarg{insert} -\end{definition} -As \cs{pglspl} but converts the prefix to upper case and uses -\ics{GLSpl} instead of \cs{glspl}. +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 Example~\ref{ex:determiners}, now that I've defined +Continuing from \exampleref{ex:determiners}, now that I've defined my entries, I~can use them in the text via the above commands: -\begin{verbatim} -First use: \pgls{svm}. Next use: \pgls{svm}. -Singular: \pgls{sample}, \pgls{oeil}. -Plural: \pglspl{sample}, \pglspl{oeil}. -\end{verbatim} +\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{quote} -First use: a~support vector machine (SVM). Next -use: an SVM. +\begin{resultbox} +First use: a~support vector machine (SVM). Next use: an SVM. Singular: a~sample, l'oeil. Plural: the samples, les yeux. -\end{quote} +\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. -\begin{definition}[\DescribeMacro\ifglshasprefix] -\cs{ifglshasprefix}\marg{label}\marg{true part}\marg{false part} -\end{definition} -Does \meta{true part} if the entry identified by \meta{label} has a -non-empty value for the \gloskey{prefix} key. - -This package also provides the following commands: -\begin{definition}[\DescribeMacro\ifglshasprefixplural] -\cs{ifglshasprefixplural}\marg{label}\marg{true part}\marg{false part} -\end{definition} -Does \meta{true part} if the entry identified by \meta{label} has a -non-empty value for the \gloskey{prefixplural} key. - -\begin{definition}[\DescribeMacro\ifglshasprefixfirst] -\cs{ifglshasprefixfirst}\marg{label}\marg{true part}\marg{false part} -\end{definition} -Does \meta{true part} if the entry identified by \meta{label} has a -non-empty value for the \gloskey{prefixfirst} key. - -\begin{definition}[\DescribeMacro\ifglshasprefixfirstplural] -\cs{ifglshasprefixfirstplural}\marg{label}\marg{true part}\marg{false part} -\end{definition} -Does \meta{true part} if the entry identified by \meta{label} has a -non-empty value for the \csoptfmt{prefix\-first\-plural} key. - -\begin{definition}[\DescribeMacro\glsentryprefix] -\cs{glsentryprefix}\marg{label} -\end{definition} -Displays the value of the \gloskey{prefix} key for the entry given -by \meta{label}. - -\begin{definition}[\DescribeMacro\glsentryprefixfirst] -\cs{glsentryprefixfirst}\marg{label} -\end{definition} -Displays the value of the \gloskey{prefixfirst} key for the entry given -by \meta{label}. - -\begin{definition}[\DescribeMacro\glsentryprefixplural] -\cs{glsentryprefixplural}\marg{label} -\end{definition} -Displays the value of the \gloskey{prefixplural} key for the entry given -by \meta{label}. (No check is performed to determine if the entry -exists.) - -\begin{definition}[\DescribeMacro\glsentryprefixfirstplural] -\cs{glsentryprefixfirstplural}\marg{label} -\end{definition} -Displays the value of the \gloskey{prefixfirstplural} key for the entry given -by \meta{label}. (No check is performed to determine if the entry -exists.) - -There are also variants that convert the first letter to upper -case\footnote{The earlier caveats about initial non-Latin characters -apply.}: -\begin{definition}[\DescribeMacro\Glsentryprefix] -\cs{Glsentryprefix}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro\Glsentryprefixfirst] -\cs{Glsentryprefixfirst}\marg{label} -\end{definition} -\begin{definition}[\DescribeMacro\Glsentryprefixplural] -\cs{Glsentryprefixplural}\marg{label} -\end{definition} - -\begin{definition}[\DescribeMacro\Glsentryprefixfirstplural] -\cs{Glsentryprefixfirstplural}\marg{label} -\end{definition} +\cmddef{ifglshasprefix} +Expands to \meta{true} if the \gloskey{prefix} field is non-empty, +otherwise expands to \meta{false}. -\begin{important} -As with analogous commands such as \ics{Glsentrytext}, these -commands aren't expandable so can't be used in PDF bookmarks. -\end{important} +\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 glossary style that +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{verbatim} -\newglossarystyle{plist}{% - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glsentryprefix{##1}% - \glstarget{##1}{\glossentryname{##1}}] - \glossentrydesc{##1}\glspostdescription\space ##2}% +\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{verbatim} -If you want to change the prefix separator (\cs{glsprefixsep}) then +\end{codebox} +If you want to change the prefix separator (\gls{glsprefixsep}) then the following is better: -\begin{verbatim} -\newglossarystyle{plist}{% - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \ifglshasprefix{##1}{\glsentryprefix{##1}\glsprefixsep}{}% - \glstarget{##1}{\glossentryname{##1}}] - \glossentrydesc{##1}\glspostdescription\space ##2}% +\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{verbatim} +\end{codebox} The conditional is also useful if you want the style to use an -uppercase letter at the start of the entry item: -\begin{verbatim} -\newglossarystyle{plist}{% - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glstarget{##1}% - {% - \ifglshasprefix{##1}% - {\Glsentryprefix{##1}\glsprefixsep\glossentryname{##1}}% - {\Glossentryname{##1}}% - }] - \glossentrydesc{##1}\glspostdescription\space ##2}% +\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{verbatim} +\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 and it requires the \sty{accsupp} package -which is also listed as experimental. This package automatically +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{verbatim} -\usepackage[acronym]{glossaries-accsupp} -\end{verbatim} -This will load \sty{glossaries} with the \pkgopt{acronym} package +\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}. -If you are using the \gls{glossaries-extra} extension package, you -need to load \gls{glossaries-extra} with the \pkgopt*{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 \gls{glossaries-extra} (with the -\pkgopt*{abbreviations} option), \sty{glossaries} and +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 glossary entries. -The keys are as follows: -\begin{description}\raggedright -\item[{\gloskey{access}}] The replacement text corresponding to +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. -\item[{\gloskey{textaccess}}] The replacement text corresponding -to the \gloskey{text} key. +\optiondef{gloskey.textaccess} -\item[{\gloskey{firstaccess}}] The replacement text corresponding -to the \gloskey{first} key. +The value of this key is the replacement text corresponding to +the \gloskey{text} key. -\item[{\gloskey{pluralaccess}}] The replacement text corresponding -to the \gloskey{plural} key. +\optiondef{gloskey.firstaccess} -\item[{\gloskey{firstpluralaccess}}] The replacement text corresponding -to the \gloskey{firstplural} key. +The value of this key is the replacement text corresponding to +the \gloskey{first} key. -\item[{\gloskey{symbolaccess}}] The replacement text corresponding -to the \gloskey{symbol} key. +\optiondef{gloskey.pluralaccess} -\item[{\gloskey{symbolpluralaccess}}] The replacement text corresponding -to the \gloskey{symbolplural} key. +The value of this key is the replacement text corresponding to +the \gloskey{plural} key. -\item[{\gloskey{descriptionaccess}}] The replacement text corresponding -to the \gloskey{description} key. +\optiondef{gloskey.firstpluralaccess} -\item[{\gloskey{descriptionpluralaccess}}] The replacement text corresponding -to the \gloskey{descriptionplural} key. +The value of this key is the replacement text corresponding to +the \gloskey{firstplural} key. -\item[{\gloskey{longaccess}}] The replacement text corresponding to -the \gloskey{long} key (used by \ics{newacronym}). +\optiondef{gloskey.symbolaccess} -\item[{\gloskey{shortaccess}}] The replacement text corresponding to -the \gloskey{short} key (used by \ics{newacronym}). +The value of this key is the replacement text corresponding to +the \gloskey{symbol} key. -\item[{\gloskey{longpluralaccess}}] The replacement text corresponding to -the \gloskey{longplural} key (used by \ics{newacronym}). +\optiondef{gloskey.symbolpluralaccess} -\item[{\gloskey{shortpluralaccess}}] The replacement text corresponding to -the \gloskey{shortplural} key (used by \ics{newacronym}). +The value of this key is the replacement text corresponding to +the \gloskey{symbolplural} key. -\item[{\gloskey{user1access}}] The replacement text corresponding to -the \gloskey{user1} key. +\optiondef{gloskey.descriptionaccess} -\item[{\gloskey{user2access}}] The replacement text corresponding to -the \gloskey{user2} key. +The value of this key is the replacement text corresponding to +the \gloskey{description} key. The corresponding +\idx{internalfieldlabel} is \glosfield{descaccess}. -\item[{\gloskey{user3access}}] The replacement text corresponding to -the \gloskey{user3} key. +\optiondef{gloskey.descriptionpluralaccess} -\item[{\gloskey{user4access}}] The replacement text corresponding to -the \gloskey{user4} key. +The value of this key is the replacement text corresponding to +the \gloskey{descriptionplural} key. The corresponding +\idx{internalfieldlabel} is \glosfield{descpluralaccess}. -\item[{\gloskey{user5access}}] The replacement text corresponding to -the \gloskey{user5} key. +\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}. -\item[{\gloskey{user6access}}] The replacement text corresponding to -the \gloskey{user6} key. -\end{description} For example: -\begin{verbatim} -\newglossaryentry{tex}{name={\TeX},description={Document -preparation language},access={TeX}} -\end{verbatim} -Now the \gls{linktext} produced by \verb|\gls{tex}| will be: -\begin{verbatim} -\BeginAccSupp{ActualText={TeX}}\TeX\EndAccSupp{} -\end{verbatim} +\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. -If you prefer to use \sty{accessibility} or \sty{tagpdf} instead of -\sty{accsupp} then you'll need to define \cs{gls@accsupp@engine} and -\cs{gls@accessibility} before loading \sty{glossaries-accsupp}. See -\ifpdf section~\ref*{sec:code:accsupp} \else the section -\qt{Accessibility Support}\fi in the documented code for further -details. +\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. -The PDF specification identifies three different types of +\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{description} -\item[Alt] Description of some content that's non-textual (for +\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. -\item[ActualText] 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. -\item[E] Expansion of an abbreviation to avoid ambiguity (for +\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{description} +\end{itemdesc} +\end{deflist} \begin{important} -Many PDF viewers don't actually support any type of replacement text. Some may +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} -If you define abbreviations with \ics{newacronym}, the -\gloskey{shortaccess} field will automatically be set to: -\begin{definition}[\DescribeMacro\glsdefaultshortaccess] -\cs{glsdefaultshortaccess}\marg{long}\marg{short} -\end{definition} -With the base \styfmt{glossaries} package this just expands to -\meta{long}. With \gls{glossaries-extra} this expands to \meta{long} -(\meta{short}). This command must be fully expandable. It expands -when the abbreviation is defined. - -As from \sty{glossaries-accsupp} v4.45, the helper command used to -identify the replacement text depends on the field name. Previous -versions just used: -\begin{definition}[\DescribeMacro\glsaccsupp] -\cs{glsaccsupp}\marg{replacement}\marg{content} -\end{definition} -for all fields. This is defined to use \texttt{ActualText}, which is -appropriate for symbols but not for abbreviations. - -As from v4.45, there's a new helper command: -\begin{definition}[\DescribeMacro\glsfieldaccsupp] -\cs{glsfieldaccsupp}\marg{replacement}\marg{content}\marg{field}\marg{label} -\end{definition} -This will use \csmeta{gls}{field}{accsupp} if it's defined otherwise -it will just use \cs{glsaccsupp}. There are just two of these field -commands for \gloskey{short} and \gloskey{shortplural}: -\begin{definition}[\DescribeMacro\glsshortaccsupp] -\cs{glsshortaccsupp}\marg{replacement}\marg{content} -\end{definition} -which is like \cs{glsaccsupp} but uses \texttt{E} instead of -\texttt{ActualText} and -\begin{definition}[\DescribeMacro\glsshortplaccsupp] -\cs{glsshortplaccsupp}\marg{replacement}\marg{content} -\end{definition} -which just does \cs{glsshortaccsupp}\marg{replacement}\marg{content}. -Note that \meta{field} indicates the \emph{internal} field name -(such as \texttt{shortpl}) not the key name (such as -\texttt{shortplural}). See \tableref{tab:fieldmap}. - -Rather than explicitly using \ics{BeginAccSupp}, these helper -commands can use: -\begin{definition}[\DescribeMacro\glsaccessibility] -\cs{glsaccessibility}\oarg{options}\marg{tag}\marg{value}\marg{content} -\end{definition} -where \meta{tag} is one of \texttt{E}, \texttt{Alt} or -\texttt{ActualText}. The replacement text for \meta{content} should be provided in -\meta{value}. -This does: -\begin{alltt} -\ics{BeginAccSupp}\mgroup{\meta{tag}=\marg{value},\meta{options}}\meta{content}\ics{EndAccSupp}\mgroup{} -\end{alltt} -but it also provides debugging information if \pkgopt[showaccsupp]{debug} is used. -If you explicitly use \cs{BeginAccSupp} instead of this command then -the debugging support won't be available. - You can define your own custom helper commands for specific fields that require them. For example: -\begin{verbatim} -\newcommand{\glssymbolaccsupp}[2]{% - \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% +\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{verbatim} +\end{codebox} This definition requires the replacement text to be specified with the hexadecimal character code. For example: -\begin{verbatim} -\newglossaryentry{int}{name={int},description={integral}, - symbol={\ensuremath{\int}},symbolaccess={222B} +\begin{codebox} +\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral}, + \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}},\gloskeyval{symbolaccess}{222B} } -\end{verbatim} +\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. -If you are using \gls{glossaries-extra}, then \cs{glsfieldaccsupp} -will first test for the existence of -\csmetameta*{glsxtr}{category}{}{field}{accsupp} -and \csmeta*{glsxtr}{category}{accsupp} and then for -\csmeta{gls}{field}{accsupp}. For example: -\begin{verbatim} -\usepackage{siunitx} -\usepackage[accsupp]{glossaries-extra} +\cmddef{glsentryuseriiiaccess} +Expands to the value of the \glosfield{useriiiaccess} field, which +corresponds to the \gloskey{user3access} key. -\glsnoexpandfields +\cmddef{glsentryuserivaccess} +Expands to the value of the \glosfield{userivaccess} field, which +corresponds to the \gloskey{user4access} key. -\newcommand{\glsxtrsymbolaccsupp}[2]{% - \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% -} +\cmddef{glsentryuservaccess} +Expands to the value of the \glosfield{uservaccess} field, which +corresponds to the \gloskey{user5access} key. -\newcommand{\glsxtrunitaccsupp}[2]{\glsaccessibility{E}{#1}{#2}} +\cmddef{glsentryuserviaccess} +Expands to the value of the \glosfield{userviaccess} field, which +corresponds to the \gloskey{user6access} key. -\newglossaryentry{cm}{name={\si{\centi\metre}}, - access={centimetre}, - description={centimetre}, - category=unit -} +\section{Developer's Note} +\label{sec:accsuppdevnote} -\newglossaryentry{int}{name={\ensuremath{\int}},access={222B}, - description={integral},category={symbol} -} -\end{verbatim} -The above uses the \csmeta*{glsxtr}{category}{accsupp} form that -doesn't include the field name. Remember that if you want to supply -a command specifically for the \gloskey{name} field then it won't be -picked up by the \gloskey{text}, \gloskey{plural}, \gloskey{firstplural} and -\gloskey{first} fields. You'd need to supply them all. For example: -\begin{verbatim} -\newcommand{\glsnameaccsupp}[2]{% - \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}% -} -\newcommand{\glstextaccsupp}{\glsnameaccsupp} -\newcommand{\glspluralaccsupp}{\glsnameaccsupp} -\newcommand{\glsfirstaccsupp}{\glsnameaccsupp} -\newcommand{\glsfirstplaccsupp}{\glsnameaccsupp} -\end{verbatim} +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. -See \ifpdf section~\ref*{sec:code:accsupp} in \fi the documented code -(\texttt{glossaries-code.pdf}) for further details. I~recommend -that you also read the \sty{accsupp} documentation. See also the -\sty{accessibility} and \sty{tagpdf} packages. +\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} -The \styfmt{glossaries} package is provided with some sample +The \sty{glossaries} package is provided with some sample documents that illustrate the various functions. These should -be located in the \texttt{samples} subdirectory (folder) of the -\styfmt{glossaries} documentation directory. This location varies +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 \texttt{texdoc} to locate the main glossaries documentation. -For example, in a -\href{http://www.dickimaw-books.com/latex/novices/html/terminal.html}{terminal or command prompt}, type: -\begin{prompt} -texdoc -l glossaries -\end{prompt} -This should display a list of all the files in the \styfmt{glossaries} -documentation directory with their full pathnames. (The GUI version -of \texttt{texdoc} may also provide you with the information.) +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 hyperlink to the file's location on +Each sample file listed below has a \idx{hyperlink} to the file's location on the CTAN mirror. -The \gls{glossaries-extra} package and \gls{bib2gls} +The \sty{glossaries-extra} package and \app{bib2gls} provide some additional sample files. There are also examples in the -\gallery{}{Dickimaw Books Gallery}. +\gallery{Dickimaw Books Gallery}. -If you prefer to use \gls{UTF-8} aware engines (\texttt{xelatex} or -\texttt{lualatex}) remember that you'll need to switch from -\styfmt{fontenc} \& \styfmt{inputenc} to \styfmt{fontspec} where +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. -\commandpromptnote -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 \qt{\texttt{Package:\ }}.) Where \sty{hyperref} is loaded you will -get warnings about non-existent references that look something like: -\begin{verbatim} -pdfTeX warning (dest): name{glo:aca} has been +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{verbatim} +\end{transcript} These warnings may be ignored on the first \LaTeX\ run. (The -destinations won't be defined until the glossary has been created.) +destinations won't be defined until the \idx{glossary} has been created.) \section{Basic} \label{sec:samplesbasic} -\exitem[minimal]{gls} This document is a -minimal working example. You can test your installation using this +\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 \texttt{minimalgls.tex} through \LaTeX\ either by + \item Run \file{minimalgls.tex} through \LaTeX\ either by typing -\begin{prompt} +\begin{terminal} pdflatex minimalgls -\end{prompt} +\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 glossary in the document. + associated files but you will not see the \idx{glossary} in the document. - \item If you have Perl installed, run \gls{makeglossaries} on the document (\sectionref{sec:makeglossaries}). This can + \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{prompt} +\begin{terminal} makeglossaries minimalgls -\end{prompt} - otherwise do: -\begin{prompt} +\end{terminal} + otherwise use \app{makeglossaries-lite}: +\begin{terminal} makeglossaries-lite minimalgls -\end{prompt} - If for some reason you want to call \gls{makeindex} explicitly, you can do this +\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{prompt} +\begin{terminal} makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo -\end{prompt} +\end{terminal} See \sectionref{sec:makeindexapp} for further details on using - \gls*{makeindex} explicitly. + \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 \texttt{minimalgls.tex} through \LaTeX\ again (as step~1) + \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 glossary is the location number. By default, this -is the page number where the entry was referenced. - -The \pkgopt{acronym} package option creates a second glossary with -the label \texttt{acronym} (which can be referenced with -\cs{acronymtype}). If you decide to enable this option then there -will be a second set of glossary files that need to be processed by -\gls{makeindex}. If you use \gls{makeglossaries} or -\gls{makeglossaries-lite.lua} you don't need to worry about it, as +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 \gls{makeindex} (or \gls{xindy}) the appropriate number +and will run \app{makeindex} (or \app{xindy}) the appropriate number of times. -If for some reason you don't want to use \gls{makeglossaries} or -\gls{makeglossaries-lite.lua} and you want the \pkgopt{acronym} +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{prompt} +\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{prompt} +\end{terminal} There are three other files that can be used as \href{http://www.dickimaw-books.com/latex/minexample/}{minimal working @@ -14884,204 +29282,206 @@ examples}: \mirrorsamplefile{mwe-gls.tex}, \mirrorsamplefile{mwe-acr.tex} and \mirrorsamplefile{mwe-acr-desc.tex}. \glsxtrnote -If you want to try out the \gls{glossaries-extra} extension package, +If you want to try out the \sty{glossaries-extra} extension package, you need to replace the package loading line: -\begin{alltt} -\cs{usepackage}[acronym]\mgroup{\strong{glossaries}} -\end{alltt} +\begin{codebox} +\cmd{usepackage}[\opt{acronym}]\marg{\strong{glossaries}} +\end{codebox} with: -\begin{alltt} -\cs{usepackage}[acronym\strong{,\xtrfont{postdot},\xtrfont{stylemods}}]\mgroup{\strong{glossaries-extra}} -\end{alltt} +\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 -\pkgopt{acronym} package option in both cases if you only want a -single glossary.) The \gls{glossaries-extra} package internally -loads the base \styfmt{glossaries} package so you don't need to +\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 -\gls{glossaries-extra} load \styfmt{glossaries}). +\sty{glossaries-extra} load \sty{glossaries}). Next, replace: -\begin{alltt} -\cs{setacronymstyle}\mgroup{long-short} -\end{alltt} +\begin{codebox} +\gls{setacronymstyle}\marg{\acrstyle{long-short}} +\end{codebox} with: -\begin{alltt} -\ics*{setabbreviationstyle}[\strong{acronym}]\mgroup{long-short} -\end{alltt} +\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 \cs{newacronym} command -provided by the base \styfmt{glossaries} package is redefined by -\gls{glossaries-extra} to use \ics*{newabbreviation} with the category +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 \cs{newacronym} with \ics*{newabbreviation} +If you prefer to replace \gls{newacronym} with \gls{newabbreviation} then the default category is \cat{abbreviation} so the style should instead be: -\begin{alltt} -\ics*{setabbreviationstyle}[\strong{abbreviation}]\mgroup{long-short} -\end{alltt} +\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{alltt} -\ics*{setabbreviationstyle}\mgroup{long-short} -\end{alltt} +\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 \cs{newacronym}. (The default style for the +you replace \gls{newacronym}. (The default style for the \cat{acronym} category is \abbrstyle{short-nolong}, which only shows -the short form on \gls{firstuse}.) - -As mentioned earlier, the \pkgopt{acronym} package option creates a -new glossary with the label \texttt{acronym}. This is independent of -the \cat{acronym} category. You can use the \pkgopt{acronym} -package option with either \cs{newacronym} or \ics*{newabbreviation}. - -You may instead prefer to use the \pkgopt*{abbreviations} package -option, which creates a new glossary with the label \texttt{abbreviations}: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{abbreviations}},\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -This can again be used with either \cs{newacronym} or -\ics*{newabbreviation}, but the file extensions are different. This -isn't a problem if you are using \gls{makeglossaries} or -\gls{makeglossaries-lite.lua}. If you are explicitly calling -\gls{makeindex} (or \gls{xindy}) then you need to modify the file +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 \gls{glossaries-extra} user manual for further details. +See the \sty{glossaries-extra} user manual for further details. -If you use both the \pkgopt{acronym} and \pkgopt*{abbreviations} -package options then \cs{newacronym} will default to the -\texttt{acronym} glossary and \ics*{newabbreviation} will default to -the \texttt{abbreviations} glossary. +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 \gls{bib2gls}, you first need to convert the -document to use \gls{glossaries-extra} as described above. Then add -the \pkgopt*{record} package option. For example: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -Next you need to convert the entry definitions into the -\filetype{bib} format required by \gls{bib2gls}. This can easily be -done with \gls{convertgls2bib}. For example: -\begin{prompt} -convertgls2bib -{}-preamble-only minimalgls.tex entries.bib -\end{prompt} -This will create a file called \strong{\nolinkurl{entries.bib}}. Next, replace: -\begin{alltt} -\cs{makeglossaries} -\end{alltt} +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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\strong{entries}] -\end{alltt} -Now remove all the entry definitions in the preamble -(\cs{longnewglossaryentry}, \cs{newglossaryentry} and \cs{newacronym} -or \cs{newabbreviation}). - -The abbreviation style command -must go before \ics*{GlsXtrLoadResources}. For example (if you are -using \cs{newacronym}): -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries] -\end{alltt} +\begin{codebox} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{\strong{entries}}} +\end{codebox} +Now remove all the entry definitions in the \idxf{documentpreamble} +(\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{verbatim} -\printglossaries -\end{verbatim} +\begin{codebox} +\gls{printglossaries} +\end{codebox} with: -\begin{alltt} -\ics*{printunsrtglossaries} -\end{alltt} +\begin{codebox} +\gls{printunsrtglossaries} +\end{codebox} The document build is now: -\begin{prompt} +\begin{terminal} pdflatex minimalgls bib2gls minimalgls pdflatex minimalgls -\end{prompt} - -\exitem{DB} This document illustrates how -to load external files containing the glossary definitions. It also -illustrates how to define a new glossary type. This document has the -\gls{numberlist} suppressed and uses \hyperref[sec:glsadd]{\ics{glsaddall}} to add all -the entries to the glossaries without referencing each one +\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 -\gls{glossaries-extra} and \gls{bib2gls} if you have a large number +\sty{glossaries-extra} and \app{bib2gls} if you have a large number of entries.) To create the document do: -\begin{prompt} +\begin{terminal} pdflatex sampleDB makeglossaries sampleDB pdflatex sampleDB -\end{prompt} +\end{terminal} or -\begin{prompt} +\begin{terminal} pdflatex sampleDB makeglossaries-lite sampleDB pdflatex sampleDB -\end{prompt} +\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 \gls{makeindex} explicitly you must +reason you want to call \app{makeindex} explicitly you must have a separate call for each glossary: \begin{enumerate} -\item Create the main glossary (all on one line): -\begin{prompt} +\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{prompt} +\end{terminal} \item Create the secondary glossary (all on one line): -\begin{prompt} +\begin{terminal} makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn -\end{prompt} -Note that both \gls{makeglossaries} and \gls{makeglossaries-lite.lua} do +\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 \gls{makeindex} the appropriate number of times. +extensions but they also call \app{makeindex} the appropriate number of times. \end{enumerate} \bibglsnote -If you want to switch to using \gls{bib2gls} with \gls{glossaries-extra}, you can convert -\mirrorsamplefile{database1.tex} and \mirrorsamplefile{database2.tex} to \filetype{bib} -files using \gls{convertgls2bib}: -\begin{prompt} +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{prompt} +\end{terminal} The document code then needs to be: -\begin{alltt} -\cs{documentclass}\mgroup{article} - -\cs{usepackage}[colorlinks,plainpages=false]\mgroup{hyperref} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot}]\mgroup{\strong{glossaries-extra}} - -\strong{\ics{newglossary*}}\mgroup{punc}\mgroup{Punctuation Characters} - -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{database1}, - \strong{\xtrfont{selection}=all},\resourceopt{sort}=en] -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{database2},\strong{\xtrfont{type}=punc,} - \strong{\xtrfont{selection}=all},\resourceopt{sort}=letter-case] - -\cs{begin}\mgroup{document} -\xtrfont{\cs{print\strong{unsrt}glossaries}} -\cs{end}\mgroup{document} -\end{alltt} -Note that the \pkgopt{nonumberlist} package option has been omitted. +\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 \cs{glsaddall}). The starred \ics{newglossary*} is used -since the \gls{makeindex}/\gls{xindy} extensions are now irrelevant. +created with \gls{glsaddall}). The starred \gls{newglossary*} is used +since the \app{makeindex}/\app{xindy} extensions are now irrelevant. -Instead of using \gls{makeglossaries} you need to use \gls{bib2gls} +Instead of using \app{makeglossaries} you need to use \app{bib2gls} when you build the document: -\begin{prompt} +\begin{terminal} pdflatex sampleDB bib2gls sampleDB pdflatex sampleDB -\end{prompt} -Note that one \gls{bib2gls} call processes all the indexing (rather -than one call per glossary). Unlike \gls{makeindex} and \gls{xindy}, -\gls{bib2gls} processes each resource set in turn, but the resource -sets aren't linked to a specific glossary. Multiple glossaries may +\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 @@ -15089,928 +29489,938 @@ 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 letter groups, you need to use the \bibglslongopt{group} +If you want \idxpl{lettergroup}, you need to use the \switch{group} switch: -\begin{prompt} -bib2gls -{}-group sampleDB -\end{prompt} +\begin{terminal} +bib2gls \switch{group} sampleDB +\end{terminal} and use an appropriate glossary style. -See also \bibglsgallery{sorting}, \bibglsbegin\ and the \gls{bib2gls} user manual. +See also \bibglsgallery{sorting}, \bibglsbegin\ and the \app{bib2gls} user manual. \section{Acronyms and First Use} \label{sec:sampleacronyms} -\exitem{Acr} This document has some -sample abbreviations. It also adds the glossary to the table of contents, +\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{prompt} +\begin{terminal} pdflatex sampleAcr makeglossaries sampleAcr pdflatex sampleAcr pdflatex sampleAcr -\end{prompt} -(or use \gls{makeglossaries-lite.lua}). +\end{terminal} +(or use \app{makeglossaries-lite}). -Note that if the glossary is at the start of the document +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 \gls{makeglossaries} and -\LaTeX\ call are required. In this particular example, the glossary +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 glossary at the start of the document if the page +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 -glossary is at the end of the front matter in a book-style document. +\idx{glossary} is at the end of the front matter in a book-style document. -This document uses \ics{ifglsused} to determine whether to use +This document uses \gls{ifglsused} to determine whether to use \qt{a} or \qt{an} in: -\begin{alltt} -\ldots\ is \ics{ifglsused}\mgroup{svm}\mgroup{an}\mgroup{a} \cs{gls}\mgroup{svm} \ldots -\end{alltt} +\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 \styfmt{glossaries} and passes all its options to the base +loads \sty{glossaries} and passes all its options to the base package it's possible to do a simple replacement of: -\begin{verbatim} -\usepackage[style=long,toc]{glossaries} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\optval{style}{\glostyle{long}},\opt{toc}]\marg{glossaries} +\end{codebox} with: -\begin{alltt} -\cs{usepackage}[style=long,toc]\mgroup{\strong{glossaries-prefix}} -\end{alltt} -The definition of \texttt{svm} now needs an adjustment: -\begin{alltt} -\ics{newacronym}[description=\mgroup{statistical pattern recognition -technique\string~\cs{protect}\cs{cite}\mgroup{svm}}, -\strong{prefixfirst=\mgroup{a\string~},prefix=\mgroup{an\ics{space}}} -]\mgroup{svm}\mgroup{svm}\mgroup{support vector machine} -\end{alltt} +\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{alltt} -\ldots\ is \ics{pgls}\mgroup{svm} \ldots -\end{alltt} +\begin{codebox} +\ldots\ is \gls{pgls}\marg{svm} \ldots +\end{codebox} \glsxtrnote -If you want to convert this sample document to use \gls{glossaries-extra}, +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 \pkgopt*{stylemods}: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{stylemods},}style=long]\mgroup{\strong{glossaries-extra}} -\end{alltt} +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 -\pkgopt{nostyles}, then you need to specify exactly which package +\opt{nostyles}, then you need to specify exactly which package (or packages) that you do want: -\begin{alltt} -\cs{usepackage}[\strong{nostyles,}\xtrfont{stylemods\strong{=long}},style=long]\mgroup{glossaries-extra} -\end{alltt} -(Now that \gls{glossaries-extra} is being used, there are more -available \qt{long} styles in the \sty*{glossary-longextra} package, +\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 either load it -after \gls{glossaries-extra} or (with at least -\gls{glossaries-extra} v1.42) you can simply use the -\pkgopt*{prefix} package option. +If you want to use \sty{glossaries-prefix}, you can simply add the +\opt{prefix} package option. -Note that the \pkgopt{toc} package option has been dropped. This is -the default with \gls{glossaries-extra}, so it doesn't need to be +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{prompt} +\begin{terminal} pdflatex sampleAcr makeglossaries sampleAcr pdflatex sampleAcr -\end{prompt} -The third \LaTeX\ call is no longer required to make the table of -contents up-to-date. This is because \gls{glossaries-extra} provides -boilerplate text on the first \LaTeX\ call when the glossary files -are missing. This means that the glossary header is added to the -\filetype{toc} file on the first \LaTeX\ call, whereas with just the -base \styfmt{glossaries} package, the header isn't present until the -second \LaTeX\ call. (As with just the base \styfmt{glossaries} -package, if the glossary occurs at the start of the document without +\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 \pkgopt[false]{nopostdot} as the -default. This means that a full stop (period) is automatically +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 \pkgopt[true]{nopostdot} as the default. If you want the -original behaviour then you can use \pkgopt[false]{nopostdot} or the -shorter synonym \pkgopt*{postdot}. - -The \gls{glossaries-extra} package has different -abbreviation handling that's far more flexible than that provided by -the base \styfmt{glossaries} package. The style now needs to be set with -\ics*{setabbreviationstyle} instead of \ics{setacronymstyle}: -\begin{alltt} -\strong{\ics*{setabbreviationstyle}[acronym]\mgroup{long-short-sc}} -\ics{newacronym}\mgroup{svm}\mgroup{svm}\mgroup{support vector machine} -\end{alltt} +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 \ics{newacronym} with \ics*{newabbreviation} then +prefer to replace \gls{newacronym} with \gls{newabbreviation} then omit the optional argument: -\begin{alltt} -\ics*{setabbreviationstyle}\mgroup{long-short-sc} -\ics*{newabbreviation}\mgroup{svm}\mgroup{svm}\mgroup{support vector machine} -\end{alltt} -(The optional argument of \ics*{setabbreviationstyle} is the +\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 \ics{acrshort}, \ics{acrlong} and -\ics{acrfull} and their variants with \ics*{glsxtrshort}, \ics*{glsxtrlong} and -\ics*{glsxtrfull} etc. +Finally, you need to replace \gls{acrshort}, \gls{acrlong} and +\gls{acrfull} and their variants with \gls{glsxtrshort}, \gls{glsxtrlong} and +\gls{glsxtrfull} etc. -\exitem{AcrDesc} This is similar to -the previous example, except that the abbreviations have an associated -description. As with the previous example, the glossary is added to -the table of contents, so an extra run through \LaTeX\ is required: -\begin{prompt} +\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{prompt} -This document uses the \pkgopt{acronym} package option, which -creates a new glossary used by \cs{newacronym}. This leaves the -default \texttt{main} glossary available for general terms. However, -in this case there are no general terms so the \texttt{main} -glossary is redundant. The \pkgopt{nomain} package option will +\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 \cs{newglossaryentry} you will need to remove the -\pkgopt{nomain} option as the \texttt{main} glossary will now be +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 \gls{glossaries-extra} you need to make a few modifications. -The most obvious one is to replace \texttt{glossaries} with -\texttt{glossaries-extra} in the \cs{usepackage} argument. Again you -can omit \pkgopt{toc} as this is the default for -\gls{glossaries-extra}. As in the previous example, you may want to +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 -\pkgopt*{stylemods}. -\begin{alltt} -\cs{usepackage}[acronym,nomain,style=altlist\strong{,\xtrfont{stylemods}}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -You may prefer to replace the \pkgopt{acronym} option with -\pkgopt*{abbreviations}, but this will change the file extensions. -If you use \gls{makeglossaries} or \gls{makeglossaries-lite.lua} you +\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{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short-sc-desc} -\end{alltt} +\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 \ics*{newabbreviation} instead of \ics{newacronym} +you prefer to use \gls{newabbreviation} instead of \gls{newacronym} then you need to omit the optional argument: -\begin{alltt} -\ics*{setabbreviationstyle}\mgroup{long-short-sc-desc} -\end{alltt} +\begin{codebox} +\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc-desc}} +\end{codebox} The original document uses: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics{glsseeitemformat}}[1]\mgroup{\% - \ics{acronymfont}\mgroup{\ics{glsentrytext}\mgroup{\#1}}} -\end{alltt} +\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 abbreviation styles don't -use \ics{acronymfont} so this isn't appropriate with -\gls{glossaries-extra}. If you're using at least version 1.42 of -\gls{glossaries-extra}, you don't need to do anything as it -automatically redefines \ics{glsseeitemformat} to take the style +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{alltt} -\cs{renewcommand}*\mgroup{\ics{glsseeitemformat}}[1]\mgroup{\% - \ics{ifglshasshort}\mgroup{\#1}\mgroup{\ics*{glsfmttext}\mgroup{\#1}}\mgroup{\ics*{glsfmtname}\mgroup{\#1}}\% +\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{alltt} +\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{alltt} -\cs{renewcommand}*\mgroup{\ics{glsseeitemformat}}[1]\mgroup{\ics*{glsfmtname}\mgroup{\#1}} -\end{alltt} +\begin{codebox} +\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\gls{glsfmtname}\marg{\#1}} +\end{codebox} -The \gls{glossaries-extra} package provides two additional -cross-referencing keys \xtrgloskey{seealso} and \xtrgloskey{alias}, -so \texttt{\gloskey{see}=\mgroup{[see also]\mgroup{svm}}} +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{alltt} -\ics{newacronym}[description=\mgroup{Statistical pattern recognition +\begin{codebox} +\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition technique using the ``kernel trick''}, -\strong{\xtrgloskey{seealso}=\mgroup{svm}}, -]\mgroup{ksvm}\mgroup{ksvm}\mgroup{kernel support vector machine} -\end{alltt} +\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 -\ics{acrshort}, \ics{acrlong} and \ics{acrfull} etc with -\ics*{glsxtrshort}, \ics*{glsxtrlong} and \ics*{glsxtrfull} etc. +\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 \gls{bib2gls}, -you first need to convert it to use \gls{glossaries-extra}, as above, -but remember that you now need the \pkgopt*{record} option: -\begin{alltt} -\cs{usepackage}[acronym,nomain,style=altlist,\strong{\xtrfont{record},\xtrfont{postdot},\xtrfont{stylemods}}] -\mgroup{\strong{glossaries-extra}} -\end{alltt} -Now you need to convert the abbreviation definitions to the \filetype{bib} -format required by \gls{bib2gls}. This can be done with: -\begin{prompt} -convertgls2bib -{}-preamble-only sampleAcrDesc.tex entries.bib -\end{prompt} -If you retained \ics{newacronym} from the original example file, -then the new \nolinkurl{entries.bib} file will contain entries +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{alltt} -\atentry{acronym}\mgroup{ksvm, - description = \mgroup{Statistical pattern recognition technique +\begin{codebox} +\atentry{acronym}\marg{ksvm, + \gloskeyval{description}{Statistical pattern recognition technique using the ``kernel trick''}, - \xtrfont{seealso} = \mgroup{svm}, - short = \mgroup{ksvm}, - long = \mgroup{kernel support vector machine} + \gloskeyval{seealso}{svm}, + \gloskeyval{short}{ksvm}, + \gloskeyval{long}{kernel support vector machine} } -\end{alltt} -If you switched to \ics*{newabbreviation} then the entries will +\end{codebox} +If you switched to \gls{newabbreviation} then the entries will instead be defined with \atentry{abbreviation}. -Next replace \cs{makeglossaries} with the resource command, but note -that the abbreviation style must be set first: -\begin{alltt} -\strong{\ics*{setabbreviationstyle}[acronym]\mgroup{long-short-sc-desc}} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\% terms defined in entries.bib - \strong{\xtrfont{abbreviation-sort-fallback}=long}] -\end{alltt} +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{alltt} -\strong{\ics*{setabbreviationstyle}\mgroup{long-short-sc-desc}} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\resourceopt{abbreviation-sort-fallback}=long\strong{, - entry-type-aliases=\mgroup{acronym=abbreviation}}] -\end{alltt} +\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 \ics*{setabbreviationstyle} needs adjusting. +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 -\gls{bib2gls}). For some styles, as in this example, it's more +\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 \gls{bib2gls} manual for +explicitly set the sort value.) See the \app{bib2gls} manual for further details and other examples. -Remember to delete any \cs{newacronym} or \cs{newabbreviation} in -the \filetype{tex} file. -Finally replace \cs{printglossary} with \ics*{printunsrtglossary}. +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{prompt} +\begin{terminal} pdflatex sampleAcrDesc bib2gls sampleAcrDesc pdflatex sampleAcrDesc -\end{prompt} +\end{terminal} Note that it's now much easier to revert back to the descriptionless style used in \samplefile{Acr}: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{\strong{long-short-sc}} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries\strong{,\resourceopt{ignore-fields}=description}] -\end{alltt} +\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 abbreviation definitions in -order to omit them, but with \gls{bib2gls} you can simply instruct -\gls{bib2gls} to ignore the description. This makes it much easier -to have a large database of abbreviations for use across multiple +\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. -\exitem{Desc} This is similar to the -previous example, except that it defines the abbreviations using -\ics{newglossaryentry} instead of \ics{newacronym}. As with the -previous example, the glossary is added to the table of contents, so -an extra run through \LaTeX\ is required: -\begin{prompt} +\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{prompt} +\end{terminal} This sample file demonstrates the use of the \gloskey{first} and \gloskey{text} keys but in general it's better to use -\ics{newacronym} instead as it's more flexible. For even greater -flexibility use \ics*{newabbreviation} provided by \gls{glossaries-extra}. -For other variations, such as showing the symbol on \gls{firstuse}, +\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. -\exitem{FnAcrDesc} This document has some sample abbreviations that -use the \acrstyle{footnote-sc-desc} acronym style. As with the previous example, -the glossary is added to the table of contents, so an extra run through +\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{prompt} +\begin{terminal} pdflatex sampleFnAcrDesc makeglossaries sampleFnAcrDesc pdflatex sampleFnAcrDesc pdflatex sampleFnAcrDesc -\end{prompt} +\end{terminal} \glsxtrnote If you want to convert this sample document to use -\gls{glossaries-extra}, then you just need to follow the same steps +\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} abbreviation style is needed: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{short-sc-footnote-desc} -\end{alltt} -The command redefinitions (performed with \cs{renewcommand}) should +\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 abbreviation style to -\abbrstyle{short-sc-footnote} and compare the location of the footnote marker +\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{prompt} +\begin{terminal} pdflatex sampleFnAcrDesc makeglossaries sampleFnAcrDesc pdflatex sampleFnAcrDesc -\end{prompt} -This is because the \gls{glossaries-extra} package produces -boilerplate text when the glossary file is missing (on the first -\LaTeX\ run) which adds the glossary title to the table of contents -(\filetype{toc}) file. - -\exitem{CustomAcr} This document has some sample abbreviations with a -custom acronym style. It also adds the glossary to the table of -contents, so an extra run through \LaTeX\ is required: -\begin{prompt} +\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{prompt} +\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 new acronym +long form). This requires defining a \idx{newacronym} style that inherits from the \acrstyle{footnote-sc-desc} style. \glsxtrnote -The conversion to \gls{glossaries-extra} starts in much the same way +The conversion to \sty{glossaries-extra} starts in much the same way as the previous examples: -\begin{alltt} -\cs{usepackage}[acronym,nomain,\strong{\xtrfont{postdot},\xtrfont{stylemods},}style=altlist] -\mgroup{\strong{glossaries-extra}} -\end{alltt} -The abbreviation styles have associated helper commands that may be +\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 abbreviations are defined. +done before the \idxpl{abbreviation} are defined. -The \abbrstyle{short-sc-footnote-desc} abbreviation style is the closest match -to the requirement, so replace the \cs{setacronymstyle} command +The \abbrstyle{short-sc-footnote-desc} \idx{abbrvstyle} is the closest match +to the requirement, so replace the \gls{setacronymstyle} command with: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{short-sc-footnote-desc} -\end{alltt} +\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{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrfootnotedescname}}\mgroup{\% - \cs{protect}\strong{\ics*{glslongfont}\mgroup{\cs{the}\ics{glslongtok}}}\% - \cs{protect}\ics*{glsxtrfullsep}\mgroup{\cs{the}\ics{glslabeltok}}\% - \cs{protect}\ics*{glsxtrparen}\mgroup{\cs{protect}\strong{\ics*{glsabbrvfont}\mgroup{\cs{the}\ics{glsshorttok}}}}\% +\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{alltt} -This command expands when the abbreviations are defined so take care -to \cs{protect} commands that shouldn't be expanded at that point, +\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{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrfootnotedescsort}}\mgroup{\strong{\cs{the}\ics{glslongtok}}} -\end{alltt} -The footnote for all the footnote abbreviation styles is produced +\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{alltt} -\ics*{glsxtrabbrvfootnote}\marg{label}\marg{text} -\end{alltt} +\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 abbreviation (\cs{gls}, -\cs{glspl} etc). This can simply be redefined as: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrabbrvfootnote}}[2]\mgroup{\ics{footnote}\mgroup{\% - \#2: \ics{glsentrydesc}\mgroup{\#1}}} -\end{alltt} +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 \verb|#2| with a reference to a +You may prefer to replace \code{\#2} with a reference to a specific field (or fields). For example: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrabbrvfootnote}}[2]\mgroup{\ics{footnote}\mgroup{\% - \ics*{Glsfmtlong}\mgroup{\#1} (\ics*{glsfmtshort}\mgroup{\#1}): \ics{glsentrydesc}\mgroup{\#1}.}} -\end{alltt} +\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 -\ics{glsseeitemformat} since \cs{acronymfont} is no longer appropriate. +\gls{glsseeitemformat} since \gls{acronymfont} is no longer appropriate. -In the original \texttt{sampleCustomAcr.tex} source code, I started +In the original \file{sampleCustomAcr.tex} source code, I started the description with a capital: -\begin{verbatim} -\newacronym[description={Statistical pattern recognition +\begin{codebox} +\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition technique using the ``kernel trick''}, -see={[see also]{svm}}, -]{ksvm}{ksvm}{kernel support vector machine} -\end{verbatim} +\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 glossary. The solution to this problem is -easy with \gls{glossaries-extra}. I start the description with a -lowercase letter and set the \attr{glossdesc} attribute to -\optfmt{firstuc}: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{acronym}\mgroup{glossdesc}\mgroup{firstuc} -\end{alltt} -The abbreviation definitions are modified slightly: -\begin{alltt} -\ics{newacronym}[description=\mgroup{\strong{s}tatistical pattern recognition +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{\xtrgloskey{seealso}=\mgroup{svm}}, -]\mgroup{ksvm}\mgroup{ksvm}\mgroup{kernel support vector machine} -\end{alltt} -Note the use of the \xtrgloskey{seealso} key, which is only -available with \gls{glossaries-extra}. - -If you prefer to use \ics*{newabbreviation} instead of -\ics{newacronym}, then the category needs to be +\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{alltt} -\ics*{glssetcategoryattribute}\mgroup{\strong{abbreviation}}\mgroup{glossdesc}\mgroup{firstuc} -\end{alltt} +\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{alltt} -\ics*{setabbreviationstyle}\mgroup{short-sc-postfootnote-desc} -\end{alltt} - -\exitem{-FnDesc} This example -defines a custom display format that puts the description in a -footnote on \gls{firstuse}. -\begin{prompt} +\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{prompt} -In order to prevent nested hyperlinks, this document uses the -\pkgopt[false]{hyperfirst} package option (otherwise the footnote -marker hyperlink would be inside the hyperlink around the -\gls{linktext} which would result in a nested hyperlink). +\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 \gls{glossaries-extra} package has category post-link hooks that -make it easier to adjust the formatting. The post-link hook is -placed after the hyperlink around the \gls{linktext}, so a hyperlink -created by \ics{footnote} in the post-link hook won't cause a nested -link. This means that the \pkgopt[false]{hyperfirst} option isn't -required: -\begin{alltt} -\cs{usepackage}[\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{\strong{glossaries-extra}} -\end{alltt} +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 \cs{gls} or \cs{glsdesc} in the post-link -hook as you can end up with infinite recursion. Use commands that -don't themselves have a post-link hook, such as \cs{glsentrydesc} or -\cs{glossentrydesc}, instead. +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 \texttt{sample-FnDesc.tex} file, the format was +In the original \file{sample-FnDesc.tex} file, the \idx{entryformat} was adjusted with: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics{glsentryfmt}}\mgroup{\% - \ics{glsgenentryfmt} - \ics{ifglsused}\mgroup{\ics{glslabel}}\mgroup{}\mgroup{\ics{footnote}\mgroup{\ics{glsentrydesc}\mgroup{\ics{glslabel}}}}% +\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{alltt} +\end{codebox} This can be changed to: -\begin{alltt} -\ics*{glsdefpostlink} -\mgroup{general}\% category label -\mgroup{\ics*{glsxtrifwasfirstuse}\mgroup{\ics{footnote}\mgroup{\ics{glsentrydesc}\mgroup{\ics{glslabel}}}}\mgroup{}} -\end{alltt} -This sets the post-link hook for the \cat{general} category -(which is the default category for entries defined with \ics{newglossaryentry}). If I -added some abbreviations (which have a different category) then this +\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{verbatim} -First use: \gls{sample}. -\end{verbatim} -So the PDF will have the word \qt{sample} (the \gls{linktext} -created by \verb|\gls{sample}|) as a hyperlink to the entry in the -glossary followed by the footnote marker, which is a hyperlink to +\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{alltt} -\ics*{glsdefpostlink} -\mgroup{general}\% category label -\mgroup{\ics*{glsxtrifwasfirstuse} - \mgroup{\ics*{glsxtrdopostpunc}\mgroup{\ics{footnote}\mgroup{\ics{glsentrydesc}\mgroup{\ics{glslabel}}}}}\% - \mgroup{}\% +\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{alltt} -You may prefer to use \ics{glossentrydesc} instead of -\ics{glsentrydesc}. This will obey the \attr{glossdesc} attribute. -If you append \ics{glspostdescription}, you can also pick up the -\pkgopt*{postdot} package option. For example: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{general}\mgroup{glossdesc}\mgroup{firstuc} - -\ics*{glsdefpostlink} -\mgroup{general}\% category label -\mgroup{\ics*{glsxtrifwasfirstuse} - \mgroup{\ics*{glsxtrdopostpunc}\mgroup{\ics{footnote}\mgroup{\% - \strong{\ics{glossentrydesc}}\mgroup{\ics{glslabel}}\strong{\ics{glspostdescription}}}}}\% - \mgroup{}\% +\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{alltt} -Alternatively, you could just use \ics{Glsentrydesc} and explicitly +\end{codebox} +Alternatively, you could just use \gls{Glsentrydesc} and explicitly append the full stop. -\exitem{-custom-acronym} -This document illustrates how to define your own acronym style if +\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{prompt} +\begin{terminal} pdflatex sample-custom-acronym makeglossaries sample-custom-acronym pdflatex sample-custom-acronym -\end{prompt} +\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 \gls{firstuse}. +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 \gls{smallcaps} in the main part of the -document but in uppercase in the list of acronyms. (So it's a slight +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 -all caps short form in parentheses. The final requirement is that +\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} abbreviation styles produce +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 -abbreviation style, but it can mostly inherit from the +\idx{abbrvstyle}, but it can mostly inherit from the \abbrstyle{short-sc-footnote-desc} or \abbrstyle{short-sc-postfootnote-desc} style: -\begin{alltt} -\ics*{newabbreviationstyle}\mgroup{custom-fn}\% -\mgroup{\% - \ics*{GlsXtrUseAbbrStyleSetup}\mgroup{short-sc-footnote-desc}\% -}\% -\mgroup{\% - \ics*{GlsXtrUseAbbrStyleFmts}\mgroup{short-sc-footnote-desc}\% - \cs{renewcommand}*\mgroup{\ics*{glsxtrinlinefullformat}}[2]\mgroup{\% - \strong{\ics*{glsfirstlongfootnotefont}}\mgroup{\strong{\ics*{glsaccesslong}\mgroup{\#\#1}}\% - \ics*{ifglsxtrinsertinside}\#\#2\cs{fi}}\% - \ics*{ifglsxtrinsertinside}\cs{else}\#\#2\cs{fi}\ics*{glsxtrfullsep}\mgroup{\#\#1}\% - \ics*{glsxtrparen}\mgroup{\strong{\ics*{glsfirstabbrvscfont}\mgroup{\ics*{glsaccessshort}\mgroup{\#\#1}}}}\% - }\% - \cs{renewcommand}*\mgroup{\ics*{glsxtrinlinefullplformat}}[2]\mgroup{\% - \strong{\ics*{glsfirstlongfootnotefont}}\mgroup{\strong{\ics*{glsaccesslongpl}\mgroup{\#\#1}}\% - \ics*{ifglsxtrinsertinside}\#\#2\cs{fi}}% - \ics*{ifglsxtrinsertinside}\cs{else}\#\#2\cs{fi}\ics*{glsxtrfullsep}\mgroup{\#\#1}\% - \ics*{glsxtrparen}\mgroup{\strong{\ics*{glsfirstabbrvscfont}\mgroup{\ics*{glsaccessshortpl}\mgroup{\#\#1}}}}\% +\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{} }% - \cs{renewcommand}*\mgroup{\ics*{Glsxtrinlinefullformat}}[2]\mgroup{\% - \strong{\ics*{glsfirstlongfootnotefont}}\mgroup{\strong{\ics*{Glsaccesslong}\mgroup{\#\#1}}\% - \ics*{ifglsxtrinsertinside}\#\#2\cs{fi}}\% - \ics*{ifglsxtrinsertinside}\cs{else}\#\#2\cs{fi}\ics*{glsxtrfullsep}\mgroup{\#\#1}\% - \ics*{glsxtrparen}\mgroup{\strong{\ics*{glsfirstabbrvscfont}\mgroup{\ics*{glsaccessshort}\mgroup{\#\#1}}}}\% - }\% - \cs{renewcommand}*\mgroup{\ics*{Glsxtrinlinefullplformat}}[2]\mgroup{\% - \strong{\ics*{glsfirstlongfootnotefont}}\mgroup{\strong{\ics*{Glsaccesslongpl}\mgroup{\#\#1}}\% - \ics*{ifglsxtrinsertinside}\#\#2\cs{fi}}\% - \ics*{ifglsxtrinsertinside}\cs{else}\#\#2\cs{fi}\ics*{glsxtrfullsep}\mgroup{\#\#1}\% - \ics*{glsxtrparen}\mgroup{\strong{\ics*{glsfirstabbrvscfont}\mgroup{\ics*{glsaccessshortpl}\mgroup{\#\#1}}}}\% - }\% + \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{alltt} -(See the \gls{glossaries-extra} user manual for further details.) +\end{codebox} +(See the \sty{glossaries-extra} user manual for further details.) This new custom style now needs to be set: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{custom-fn} -\end{alltt} -Remember that if you decide to use \ics*{newabbreviation} instead -of \ics{newacronym} then the category will be \cat{abbreviation} not \cat{acronym}: -\begin{alltt} -\ics*{setabbreviationstyle}\mgroup{custom-fn} -\end{alltt} +\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{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrabbrvfootnote}}[2]\mgroup{\ics{footnote}\mgroup{\#2: -\ics{glsentrydesc}\mgroup{\#1}.}} -\end{alltt} +\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{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrabbrvfootnote}}[2]\mgroup{\ics{footnote} - \mgroup{\ics*{Glsfmtlong}\mgroup{\#1}: \ics{glsentrydesc}\mgroup{\#1}.}} -\end{alltt} +\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 all capitals not \gls{smallcaps} and the +short form should now be in \idx{allcaps} not \idx{smallcaps} and the long form should start with a capital letter. -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrfootnotedescname}}\mgroup{\% - \cs{protect}\ics*{glsfirstlongfootnotefont} - \mgroup{\ics{makefirstuc}\mgroup{\cs{the}\ics{glslongtok}}} - (\cs{protect}\ics{MakeTextUppercase}\mgroup{\cs{the}\ics{glsshorttok}})\% +\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{alltt} -The inherited abbreviation style uses the short form as the +\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{alltt} -\cs{renewcommand}*\mgroup{\ics*{glsxtrfootnotedescsort}}\mgroup{\cs{the}\strong{\ics{glslongtok}}} -\end{alltt} +\begin{codebox} +\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescsort}}\marg{\cmd{the}\strong{\gls{glslongtok}}} +\end{codebox} \begin{bib2gls} -If you want to switch to using \gls{bib2gls}, remember to set the -abbreviation style before the resource command and change the +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} -\exitem{-dot-abbr} This document illustrates how to use the base -post link hook to adjust the space factor after abbreviations. -\begin{prompt} +\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{prompt} +\end{terminal} This example creates a custom storage key that provides a similar -function to \gls{glossaries-extra}['s] \xtrgloskey{category} key. +function to \sty{glossaries-extra}['s] \gloskey{category} key. \glsxtrnote -This example is much simpler with \gls{glossaries-extra}. The custom +This example is much simpler with \sty{glossaries-extra}. The custom storage key, which is defined using: -\begin{alltt} -\ics{glsaddstoragekey}\mgroup{abbrtype}\mgroup{word}\mgroup{\cs{abbrtype}} -\end{alltt} +\begin{codebox} +\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}} +\end{codebox} can now be removed. -The \xtrgloskey{category} key is set to \texttt{initials} for -the initialisms (which are defined with the custom \cs{newacr} -command). The abbreviation styles can be set with: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short} -\ics*{setabbreviationstyle}[initials]\mgroup{long-short} -\end{alltt} -The \attr{discardperiod} attribute will discard any full stop -(period) following commands like \cs{gls}: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{initials}\mgroup{discardperiod}\mgroup{true} -\end{alltt} -(If you want to use the \attr{noshortplural} attribute then you will -also need to set the \attr{pluraldiscardperiod} attribute.) - -The \gls{firstuse} is governed by the \attr{retainfirstuseperiod} -attribute. If set, the period won't be discarded if it follows the -\gls{firstuse} of commands like \cs{gls}. This is useful for styles -where the \gls{firstuse} doesn't end with the short form. In this -case, the \gls{firstuse} of the \abbrstyle{long-short} style ends +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{alltt} -\ics*{glssetcategoryattribute}\mgroup{initials}\mgroup{retainfirstuseperiod}\mgroup{true} -\end{alltt} +\begin{codebox} +\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{retainfirstuseperiod}}\marg{true} +\end{codebox} -The \attr{insertdots} attribute can automatically insert dots into +The \catattr{insertdots} \idx{categoryattribute} can automatically insert dots into the short form with a final space factor adjustment: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{initials}\mgroup{insertdots}\mgroup{true} -\end{alltt} +\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{alltt} -\cs{newcommand}*\mgroup{\cs{newabbr}}[1][]\mgroup{\% - \strong{\ics*{newabbreviation}}[\strong{\xtrfont{category}}=initials,\#1]} -\end{alltt} +\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 -\attr{insertdots} attribute: -\begin{alltt} -\cs{newabbr}\mgroup{eg}\mgroup{\strong{eg}}\mgroup{eg} -\cs{newabbr}\mgroup{ie}\mgroup{\strong{ie}}\mgroup{ie} -\cs{newabbr}\mgroup{bsc}\mgroup{\strong{B\mgroup{Sc}}}\mgroup{Bachelor of Science} -\cs{newabbr}\mgroup{ba}\mgroup{\strong{BA}}\mgroup{BA} -\cs{newabbr}\mgroup{agm}\mgroup{\strong{AGM}}\mgroup{AGM} -\end{alltt} +\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{verbatim} -\newacronym{laser}{laser}{light amplification by stimulated +\begin{codebox} +\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated emission of radiation} -\end{verbatim} -The remaining code in the preamble must now be removed. (It will -interfere with \gls{glossaries-extra}['s] category post-link hooks.) +\end{codebox} +The remaining code in the \idxf{documentpreamble} 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 \gls{glossaries-extra} user manual for further details about -category attributes and post-link hooks. +See the \sty{glossaries-extra} user manual for further details about +\idxpl{categoryattribute} and post-link hooks. -\exitem{-font-abbr} This document illustrates how to have different fonts -for abbreviations within the style. The document build is: -\begin{prompt} +\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{prompt} -The acronym mechanism provided by the base \styfmt{glossaries} +\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 \ics{glsaddstoragekey} that's used to hold the font -declaration (such as \cs{em}). -\begin{verbatim} -\glsaddstoragekey{font}{}{\entryfont} -\end{verbatim} -A new custom acronym style is defined that fetches the font +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 -abbreviation. Some helper commands are also provided to define the -different types of abbreviation: -\begin{verbatim} -\newcommand*{\newitabbr}[1][]{\newacronym[font=\em,#1]} -\newcommand*{\newupabbr}{\newacronym} - -\newitabbr{eg}{e.g.}{exempli gratia} -\newupabbr{bsc}{BSc}{Bachelor of Science} -\end{verbatim} -This makes the \gls{firstuse} of \verb|\gls{eg}| appear as \qt{exempli -gratia (\emph{e.g.})} whereas the \gls{firstuse} of \verb|\gls{bsc}| +\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 \gls{glossaries-extra}. -First the \cs{usepackage} command needs adjusting: -\begin{alltt} -\cs{usepackage}[\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{\strong{glossaries-extra}} -\end{alltt} +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 -acronym style. Now replace the \ics{setacronymstyle} line with: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short-em} -\end{alltt} +\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{alltt} -\cs{newcommand}*\mgroup{\cs{newitabbr}}\mgroup{\ics{newacronym}} -\cs{newcommand}*\mgroup{\cs{newupabbr}}\mgroup{\strong{\ics*{newabbreviation}}} -\end{alltt} -Note that the \verb|font=\em,| part has been removed from the +\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 -\ics*{newabbreviation} instead of \ics{newacronym}. This means that -\cs{newitabbr} will default to -\xtrgloskey{category}\csoptfmt{=acronym} and \cs{newupabbr} will -default to \xtrgloskey{category}\csoptfmt{=abbreviation}. The +\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 \ics*{setabbreviationstyle} +to have the style set (with the above \gls{setabbreviationstyle} command). -Finally, the \ics{acrshort}, \ics{acrlong} and \cs{acrfull} commands -need to be replaced with \ics*{glsxtrshort}, \ics*{glsxtrlong} and -\ics*{glsxtrfull}. +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 \attr{insertdots} -attribute). You can either remove the dots and use \attr{insertdots} -with \attr{discardperiod}: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{acronym}\mgroup{insertdots}\mgroup{true} -\ics*{glssetcategoryattribute}\mgroup{acronym}\mgroup{discardperiod}\mgroup{true} - -\cs{newitabbr}\mgroup{eg}\mgroup{\strong{eg}}\mgroup{exempli gratia} -\cs{newitabbr}\mgroup{ie}\mgroup{\strong{ie}}\mgroup{id est} -\end{alltt} -Or you can manually insert the space factor adjustment and only use -the \attr{discardperiod} attribute: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{acronym}\mgroup{discardperiod}\mgroup{true} - -\cs{newitabbr}\mgroup{eg}\mgroup{e.g.\strong{\ics{@}}}\mgroup{exempli gratia} -\cs{newitabbr}\mgroup{ie}\mgroup{i.e.\strong{\ics{@}}}\mgroup{id est} -\end{alltt} +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{alltt} -\ics*{setabbreviationstyle}[\strong{latinabbr}]\mgroup{long-short-em} -\cs{newcommand}*\mgroup{\cs{new\strong{latin}abbr}}[1][]\mgroup{\ics*{newabbreviation}[\xtrfont{category}=\strong{latinabbr},\#1]} -\ics*{glssetcategoryattribute}\mgroup{\strong{latinabbr}}\mgroup{insertdots}\mgroup{true} -\ics*{glssetcategoryattribute}\mgroup{\strong{latinabbr}}\mgroup{discardperiod}\mgroup{true} - -\cs{new\strong{latin}abbr}\mgroup{eg}\mgroup{e.g.\strong{\ics{@}}}\mgroup{exempli gratia} -\cs{new\strong{latin}abbr}\mgroup{ie}\mgroup{i.e.\strong{\ics{@}}}\mgroup{id est} -\end{alltt} +\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} -\exitem{Eq} This document illustrates how -to change the location to something other than the page number. In -this case, the \ctrfmt{equation} counter is used since all glossary -entries appear inside an \env{equation} environment. To create -the document do: -\begin{prompt} +\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{prompt} -The \styfmt{glossaries} package provides some location formats, such -as \ics{hyperrm} and \ics{hyperbf}, that allow the locations in the \gls{numberlist} -to hyperlink to the appropriate place in the document (if +\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 hyperlink name in the indexing information with \gls{makeindex} -and \gls{xindy}, the \styfmt{glossaries} package has to reform the -name from a prefix and the location value. +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 \ctrfmt{equation} -counter in certain classes, such as the \clsfmt{report} class (which +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 -\ics{theHequation} so that it has a format that fits the requirement: -\begin{verbatim} -\renewcommand*\theHequation{\theHchapter.\arabic{equation}} -\end{verbatim} -If you don't do this, the equation locations in the glossary won't -form valid hyperlinks. - -Each glossary entry represents a mathematical symbol. This means -that with \optsto13 it's necessary to use the \gloskey{sort} key. +\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{alltt} -\cs{newglossaryentry}\mgroup{Gamma}\mgroup{name=\cs{ensuremath}\mgroup{\cs{Gamma}(z)}, -description=Gamma function,\strong{sort=Gamma}} -\end{alltt} +\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 \gls{bib2gls}, the first change you +If you want to switch to using \app{bib2gls}, the first change you need to make is to switch from explicitly loading -\styfmt{glossaries} to loading \gls{glossaries-extra} with the -\pkgopt*{record} package option. If \pkgopt+{only}{record} (or -\pkgopt*{record} without a value) is used, then the above -redefinition of \cs{theHequation} is still required. If -\pkgopt+{nameref}{record} is used instead then the redefinition of -\cs{theHequation} isn't required. You may also want to use the -\pkgopt*{stylemods} and \pkgopt*{postdot} options: -\begin{alltt} -\cs{usepackage}[\strong{\strong{\xtrfont{record=nameref}},\xtrfont{stylemods},\xtrfont{postdot}}, - ucmark,style=long3colheader,counter=equation]\mgroup{\strong{glossaries-extra}} -\end{alltt} -The entries now need to be converted into the \filetype{bib} format required -by \gls{bib2gls}, which can be done with \gls{convertgls2bib}: -\begin{prompt} -convertgls2bib -{}-preamble-only sampleEq.tex entries.bib -\end{prompt} -This will create a file called \nolinkurl{entries.bib} that starts: -\begin{alltt} -\% Encoding: UTF-8 -\atentry{entry}\mgroup{Gamma, - name = \mgroup{\cs{ensuremath}\mgroup{\cs{Gamma}(z)}}, - description = \mgroup{Gamma function} +\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{alltt} +\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.) @@ -16025,406 +30435,407 @@ 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 \cs{makeglossaries} with: -\begin{alltt} -\strong{\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries]} -\end{alltt} -If you have used \pkgopt+{nameref}{record} then you can remove the -redefinition of \cs{theHequation}. Next remove all the lines +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 -\filetype{bib} file). +\ext{bib} file). -Finally, replace \ics{printglossary} with \ics*{printunsrtglossary}: -\begin{alltt} -\strong{\ics*{printunsrtglossary}}[title=\mgroup{Index of Special Functions and -Notations}] -\end{alltt} +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 -\ics*{glsxtrfmt} as described in the following example). +\gls{glsxtrfmt} as described in the following example). -\exitem{EqPg} This is similar to the previous example, but the \glspl{numberlist} are a +\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 -glossary to the table of contents, so an extra \LaTeX\ run is +\idx{glossary} to the \idx{tableofcontents}, so an extra \LaTeX\ run is required: -\begin{prompt} +\begin{terminal} pdflatex sampleEqPg makeglossaries sampleEqPg pdflatex sampleEqPg pdflatex sampleEqPg -\end{prompt} +\end{terminal} As with the previous example, entries are defined like this: -\begin{verbatim} -\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, -description=Gamma function,sort=Gamma} -\end{verbatim} -The \pkgopt[equation]{counter} package option is used to set the -default indexing counter to \ctrfmt{equation}. This means that it -has to be changed for indexing outside of any numbered equation. For +\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{verbatim} -\glslink[format=hyperbf,counter=page]{Gamma}{gamma function} -\end{verbatim} -I've set the \gloskey[glslink]{format} to \locfmt{hyperbf} to indicate that -this is a primary reference. (Note that I'm using \ics{hyperbf} not -\ics{textbf} in order to include a hyperlink in the location.) - -The \gls{linktext} here is almost identical to the +\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. If it started with a lowercase character instead, I could -simply use \ics{glsdesc} instead of \ics{glslink}. If I change the -entry descriptions so that they all start with a lowercase letter -then I would need to create a custom glossary style that used -\ics{Glossentrydesc} instead of \ics{glossentrydesc}. +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 \gls{glossaries-extra} I wouldn't need a new -glossary style. Instead I could just use the \attr{glossdesc} -attribute to perform the case change. Remember that the first change -to make is to replace \styfmt{glossaries} with -\gls{glossaries-extra}: -\begin{alltt} -\cs{usepackage}[style=long3colheader,\strong{\xtrfont{postdot},\xtrfont{stylemods}}, - counter=equation]\mgroup{\strong{glossaries-extra}} -\end{alltt} +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{alltt} -\ics{newglossaryentry}\mgroup{Gamma}\mgroup{name=\cs{ensuremath}\mgroup{\cs{Gamma}(z)}, -description=\strong{g}amma function,sort=Gamma} -\end{alltt} -The \attr{glossdesc} attribute needs setting: -\begin{alltt} -\ics*{glssetcategoryattribute}\mgroup{general}\mgroup{glossdesc}\mgroup{firstuc} -\end{alltt} -This means that I can now use \ics{glsdesc} instead of \ics{glslink}. - -It's a bit cumbersome typing \texttt{[format=hyperbf,counter=page]} -for each primary reference, but \gls{glossaries-extra} provides a -convenient way of having a third modifier for commands like \cs{gls} -and \cs{glstext}. This needs to be a single punctuation character -(but not \texttt{*} or \texttt{+} which are already in use). For +\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{alltt} -\ics*{GlsXtrSetAltModifier}\mgroup{\strong{!}}\mgroup{format=hyperbf,counter=page} -\end{alltt} -Now \texttt{\ics{glsdesc}\strong{!}\mgroup{Gamma}} is equivalent to: -\begin{alltt} -\ics{glsdesc}[format=hyperbf,counter=page]\mgroup{Gamma} -\end{alltt} +\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{alltt} -The \ics{glsdesc}!\mgroup{Gamma} is defined as -\end{alltt} +\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 \ics{glslink} where the \gls{linktext} is just +other instance of \gls{glslink} where the \idx{linktext} is just the description: -\begin{alltt} -The \ics{glsdesc}!\mgroup{erf} is defined as -\end{alltt} - -There are three other instances of \ics{glslink}, such as: -\begin{alltt} -\ics{glslink}\mgroup{Gamma}\mgroup{\cs{Gamma}(x+1)} -\end{alltt} -If I just use \verb|\gls{Gamma}| then I would get $\Gamma(z)$ as the -\gls{linktext}. For entries like this that represent functions with +\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 \styfmt{glossaries} package, one simple solution that +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{alltt} -\ics{newglossaryentry}\mgroup{Gamma}\mgroup{name=\cs{ensuremath}\mgroup{\cs{Gamma}(z)}, -\strong{symbol=\mgroup{\cs{ensuremath}\mgroup{\cs{Gamma}}},} -description=gamma function,sort=Gamma} -\end{alltt} +\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{alltt} -\strong{\ics{glssymbol}}\mgroup{Gamma}\strong[(\cs{Gamma}(x+1))\strong] -\end{alltt} -(which includes the function parameter inside the \gls{linktext}) or just: -\begin{alltt} -\ics{glssymbol}\mgroup{Gamma}(\cs{Gamma}(x+1)) -\end{alltt} -(which has the function parameter after the \gls{linktext}). +\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 \gls{glossaries-extra}. +follow the symbol, and it can also be used with \sty{glossaries-extra}. -The \gls{glossaries-extra} package provides another possibility. It +The \sty{glossaries-extra} package provides another possibility. It requires a command that takes a single argument, for example: -\begin{verbatim} -\newcommand{\Gammafunction}[1]{\Gamma(#1)} -\end{verbatim} +\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 \ics*{GlsXtrFmtField} +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 \field{useri} which corresponds to the \gloskey{user1} -key. This means that the \texttt{Gamma} entry would need to be -defined with \texttt{user1=Gammafunction}. With this approach, each +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 -\cs{glslabel} within the \gls{linktext}: -\begin{alltt} -\cs{newcommand}\mgroup{\cs{entryfunc}}[1]\mgroup{\ics{glsentrysymbol}\mgroup{\ics{glslabel}}(\#1)} -\end{alltt} -(Obviously, this command can't be used outside of the \gls{linktext} -or post-link hooks since it uses \ics{glslabel}.) +\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{alltt} -\ics{newglossaryentry}\mgroup{Gamma}\mgroup{name=\cs{ensuremath}\mgroup{\cs{Gamma}(z)}, -\strong{symbol=\mgroup{\cs{ensuremath}\mgroup{\cs{Gamma}}},user1=entryfunc,} -description=gamma function,sort=Gamma} -\end{alltt} -(This doesn't need to be done for the \texttt{C} and \texttt{G} +\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{verbatim} -\newcommand{\func}[2]{#1(#2)} -\newcommand{\entryfunc}[1]{\func{\glsentrysymbol{\glslabel}}{#1}} -\newcommand{\newfunc}[5][]{% - \newglossaryentry{#2}{name={\ensuremath{\func{#3}{#4}}}, - symbol={#3}, - user1={entryfunc}, - description={#5}, - sort={#2},#1 - }% +\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{verbatim} -The entries can now be defined using this custom \cs{newfunc} +\end{codebox} +The entries can now be defined using this custom \csfmt{newfunc} command. For example: -\begin{verbatim} -\newfunc{Gamma}{\Gamma}{z}{gamma function} -\newfunc[sort=gamma1]{gamma}{\gamma}{\alpha,x}{lower +\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} -\newfunc[sort=Gamma2]{iGamma}{\Gamma}{\alpha,x}{upper +\cmd{newfunc}[\gloskeyval{sort}{Gamma2}]\marg{iGamma}\marg{\cmd{Gamma}}\marg{\cmd{alpha},x}\marg{upper incomplete gamma function} -\end{verbatim} +\end{codebox} -Note that in \cs{newfunc} the \gloskey{symbol} key doesn't have its value -encapsulated with \ics{ensuremath} so \cs{glssymbol} will need to explicitly be -placed in math mode. If you switch to a glossary style that displays +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 -\cs{newfunc} to use \ics{ensuremath} in the \gloskey{symbol} field -or you can add the encapsulation with the \attr{glosssymbolfont} -attribute. +\csfmt{newfunc} to use \gls{ensuremath} in the \gloskey{symbol} field +or you can add the encapsulation with the \catattr{glosssymbolfont} +\idx{categoryattribute}. -Now \verb|\glslink{Znu}{Z_\nu}| can simply be replaced with -\texttt{\ics{glssymbol}\mgroup{Znu}} (no parameter is required in +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 \ics*{glsxtrfmt}. For example, -\texttt{\cs{glslink}\mgroup{Gamma}\mgroup{\cs{Gamma}(x+1)}} can now be replaced with: -\begin{alltt} -\ics*{glsxtrfmt}\mgroup{Gamma}\mgroup{x+1} -\end{alltt} -This effectively works like \cs{glslink} but omits the post-link hook. -(See the \gls{glossaries-extra} user manual for further details.) +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 \ics*{glsxtrfmt} within the argument of another \ics*{glsxtrfmt} command -(or inside any other \gls{linktext}). +Don't use \gls{glsxtrfmt} within the argument of another \gls{glsxtrfmt} command +(or inside any other \idx{linktext}). \end{important} -Similarly \verb|\glslink{Gamma}{\Gamma(\alpha)}| +Similarly \code{\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(\cmd{alpha})}} can now be replaced with: -\begin{alltt} -\ics*{glsxtrfmt}\mgroup{Gamma}\mgroup{\cs{alpha}} -\end{alltt} +\begin{codebox} +\gls{glsxtrfmt}\marg{Gamma}\marg{\cmd{alpha}} +\end{codebox} Note that it's still possible to use: -\begin{alltt} -\ics{glssymbol}\mgroup{Gamma}[(\cs{alpha})] -\end{alltt} +\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{verbatim} -\newcommand*{\Fn}[3][]{\glssymbol[#1]{#2}[(#3)]} -\end{verbatim} +\begin{codebox} +\cmd{newcommand}*\marg{\cmd{Fn}}[3][]\marg{\gls{glssymbol}\oarg{\#1}\marg{\#2}[(\#3)]} +\end{codebox} or: -\begin{alltt} -\cs{newcommand}*\mgroup{\cs{Fn}}[3][]\mgroup{\ics*{glsxtrfmt}[\#1]\mgroup{\#2}\mgroup{\#3}} -\end{alltt} +\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 \gls{bib2gls}, first -convert it to use \gls{glossaries-extra} (as described above), and +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 -\gls{convertgls2bib} application recognises \cs{newcommand} so it -will be able to parse the custom \cs{newfunc} commands. - -Note that \gls{bib2gls} allows you to separate the locations in the \gls{numberlist} -into different groups according to the counter used for the -location. This can be done with the \resourceopt{loc-counters} -resource option. It's also possible to identify primary formats -(such as \locfmt{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 -\gls{numberlist}. See the \gls{bib2gls} user manual for further +\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. -\exitem{Sec} This document also -illustrates how to change the location to something other than the -page number. In this case, the \texttt{section} counter is used. -This example adds the glossary to the table of contents, so an extra +\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{prompt} +\begin{terminal} pdflatex sampleSec makeglossaries sampleSec pdflatex sampleSec pdflatex sampleSec -\end{prompt} -Note that there are conflicting location formats, which trigger a -warning from \gls{makeindex}: -\begin{verbatim} -## Warning (input = sampleSec.glo, line = 6; output = -sampleSec.gls, line = 9): - -- Conflicting entries: multiple encaps for the same page -under same key. - -## Warning (input = sampleSec.glo, line = 2; output = -sampleSec.gls, line = 10): - -- Conflicting entries: multiple encaps for the same page -under same key. -\end{verbatim} -This is the result of indexing an entry multiple times for the same -location\footnote{\gls{makeindex} assumes that the location is a -page number} with different values of the \gloskey[glslink]{format} key. In this case, -it's caused by three references to the \texttt{ident} entry in section~2.1: -\begin{verbatim} -\gls[format=hyperit]{ident} -\glspl{ident} % default format=glsnumberformat -\gls*[format=hyperbf]{ident} -\end{verbatim} - -If you use the \gls{makeglossaries} Perl script it will detect the warnings in the -\gls{makeindex} transcript file and attempt to fix the conflict by -removing entries from the \filetype{glo} file: -\begin{verbatim} -Multiple encaps detected. Attempting to remedy. +\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{verbatim} -(Range formats have highest precedence. The default \locfmt{glsnumberformat} +\end{transcript} +(Range formats have highest precedence. The default \encap{glsnumberformat} has the lowest precedence.) -If you use \gls{makeglossaries-lite.lua} or call -\gls{makeindex} directly then the problem won't be fixed and the -glossary will end up with the rather odd \gls{numberlist} for the +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 (\locfmt{hyperbf}) -and then italic (\locfmt{hyperit}), which results in 2.1, -\textbf{2.1}, \textit{2.1}. If you use \gls{makeglossaries} then -only the bold entry (\textbf{2.1}) will be present. - -If you switch to \gls{xindy}: -\begin{alltt} -\cs{usepackage}[\strong{xindy},style=altlist,toc,counter=section]\mgroup{glossaries} -\end{alltt} -then the conflict will be resolved using the number format attribute -list order of priority. In this case, \locfmt{glsnumberformat} has +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{alltt} -\cs{newcommand}*\mgroup{\strong{\cs{primary}}}[1]\mgroup{\ics{hyperit}\mgroup{\#1}} -\ics{GlsAddXdyAttribute}\mgroup{\strong{primary}} -\end{alltt} -and change \verb|\gls[format=hyperit]| to \texttt{\cs{gls}[format=\strong{primary}]} etc. -This will give \csoptfmt{\gloskey[glslink]{format}=\locfmt{primary}} the highest priority. +\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 \gls{bib2gls}, you can supply rules to deal with location format -conflicts, as illustrated below. +With \app{bib2gls}, you can supply rules to deal with +\idx{locationformat} conflicts, as illustrated below. \bibglsnote -In order to switch to \gls{bib2gls}, first replace -\styfmt{glossaries} with \gls{glossaries-extra}, and add the \pkgopt*{record} -package option. Remember that \gls{glossaries-extra} has a different +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{alltt} -\cs{usepackage}[style=altlist,\strong{\xtrfont{postdot},\xtrfont{stylemods}},counter=section] -\mgroup{\strong{glossaries-extra}} -\end{alltt} - -The entry definitions now need to be converted into \gls{bib2gls} -format and saved in a \filetype{bib} file (say, \texttt{entries.bib}). You can use -\gls{convertgls2bib}: -\begin{prompt} -convertgls2bib -{}-preamble-only sampleSec.tex entries.bib -\end{prompt} - -Next replace \ics{makeglossaries} with: -\begin{alltt} -\ics*{GlsXtrLoadResources}[src=entries] -\end{alltt} -and remove all the \cs{newglossaryentry} commands. - -Finally, replace \ics{printglossaries} with \ics*{printunsrtglossaries}. +\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{prompt} +\begin{terminal} pdflatex sampleSec bib2gls sampleSec pdflatex sampleSec -\end{prompt} +\end{terminal} As with the original example, there's still a location format -conflict, which \gls{bib2gls} warns about: -\begin{verbatim} -Warning: Entry location conflict for formats: hyperbf and hyperit -Discarding: {ident}{}{section}{hyperbf}{2.1} -Conflicts with: {ident}{}{section}{hyperit}{2.1} -\end{verbatim} +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 \gls{makeglossaries}, range formats have the -highest priority and \locfmt{glsnumberformat} has the lowest.) +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{alltt} -\cs{newcommand}*\mgroup{\ics{hyperbfit}}[1]\mgroup{\cs{textbf}\mgroup{\cs{hyperit}\mgroup{\#1}}} -\end{alltt} -Now \gls{bib2gls} needs to be invoked with the appropriate mapping -with the \bibglslongopt{map-format} or \bibglsopt{m} switch: -\begin{prompt} -bib2gls -m \glsquote{hyperbf:hyperbfit,hyperit:hyperbfit} sampleSec -\end{prompt} +\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{alltt} -\% arara: bib2gls: \mgroup{ mapformats: [ [hyperbf, hyperbfit], -\% arara: -{}-> [hyperit, hyperbfit] ] } -\end{alltt} +\begin{codebox} +\araraline{bib2gls: \marg{ mapformats: [ [hyperbf, hyperbfit], +\araracont [hyperit, hyperbfit] ] }} +\end{codebox} If you try out this example, notice the difference between -\pkgopt+{only}{record} and \pkgopt+{nameref}{record}. If you use the -latter, the locations will now be the section titles rather than the -section numbers. If you use the \optfmt{nameref} setting you can customize the -location by defining the command: -\begin{alltt} -\csmeta*{glsxtr}{counter}{locfmt}\marg{location}\marg{title} -\end{alltt} - -In this case the counter is \ctrfmt{section}, so the command should be -\ics*{glsxtrsectionlocfmt}. It takes two arguments: the first is the +\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{alltt} -\cs{newcommand}*\mgroup{\ics*{glsxtrsectionlocfmt}}[2]\mgroup{\ics{S}\#1 \#2} -\end{alltt} +\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 \ctrfmt{equation} counter, \ics*{glsxtrequationlocfmt}.) Make sure -that you have at least version 1.42 of \gls{glossaries-extra}. +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} @@ -16432,1071 +30843,1096 @@ that you have at least version 1.42 of \gls{glossaries-extra}. See also \samplefile{Sort} in \sectionref{sec:samplessort}, which has three glossaries. -\exitem{Ntn} This document illustrates -how to create an additional glossary type. This example adds the -glossary to the table of contents, so an extra \LaTeX\ run is -required: -\begin{prompt} +\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{prompt} -Note that if you want to call \gls{makeindex} explicitly instead of -using the \gls{makeglossaries} or \gls{makeglossaries-lite.lua} -scripts then you need to call \gls{makeindex} twice: +\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 main glossary (all on one line): -\begin{prompt} +\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{prompt} +\end{terminal} \item Create the secondary glossary (all on one line): -\begin{prompt} +\begin{terminal} makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn -\end{prompt} +\end{terminal} \end{enumerate} This document creates a new glossary using: -\begin{alltt} -\ics{newglossary}[nlg]\mgroup{notation}\mgroup{not}\mgroup{ntn}\mgroup{Notation} -\end{alltt} -This defines a glossary that can be identified with the label -\texttt{notation} with the default title \qt{Notation}. The other -arguments are the file extensions required with \optsand23. For those -two options, the \styfmt{glossaries} package needs to know the input -and output files required by \gls{makeindex} or \gls{xindy}. - -(The optional argument is the file extension of the indexing transcript -file, which \styfmt{glossaries} doesn't need to know about, but it -writes the information to the \filetype{aux} file for the benefit of -\gls{makeglossaries} and \gls{makeglossaries-lite.lua}.) - -If you switch to a different indexing option then these file extensions +\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{alltt} -\ics{newglossary*}\mgroup{notation}\mgroup{Notation} -\end{alltt} - -This example uses a label prefixing system\footnote{If you use -\sty{babel} with a language that makes the colon character -\texttt{:} active you will need to change the prefix.}\ to differentiate -between the different types of entries. For example, the term +\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{verbatim} -\newglossaryentry{gls:set}{name=set, -description={A collection of distinct objects}} -\end{verbatim} +\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{verbatim} -\newglossaryentry{not:set}{type=notation, -name={\ensuremath{\mathcal{S}}}, -description={A \gls{gls:set}},sort={S}} -\end{verbatim} -Notice that the latter description contains \cs{gls}. This means -you shouldn't use \ics{glsdesc} with this entry otherwise you will +\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 \gls{glossaries-extra} package provides a command for use in -within field values to prevent nested \gls{linktext}: -\begin{alltt} -\ics*{glsxtrp}\marg{field}\marg{label} -\end{alltt} +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: -\texttt{\ics*{glsps}\marg{label}} (for the \gloskey{short} field) and -\texttt{\ics*{glspt}\marg{label}} (for the \gloskey{text} +\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{alltt} -\cs{newglossaryentry}\mgroup{not:set}\mgroup{type=notation, -name=\mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}}, -description=\mgroup{A \strong{\ics*{glspt}\mgroup{gls:set}}},sort={S}} -\end{alltt} -This will stop the inner reference from causing interference if you use \ics{glsdesc}. -It will also suppress indexing within the glossary but will have a -hyperlink (if \styfmt{hyperref} is used). - -The \gls{glossaries-extra} package provides a way of defining -commands like \cs{gls} that automatically insert a prefix. For +\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{alltt} -\ics*{glsxtrnewgls}\mgroup{not:}\mgroup{\cs{sym}} -\ics*{glsxtrnewglslike}\mgroup{gls:}\mgroup{\cs{term}}\mgroup{\cs{termpl}}\mgroup{\cs{Term}}\mgroup{\cs{Termpl}} -\end{alltt} -(there's no point providing commands for plural or case-changing with -symbols). Now \verb|\gls{not:set}| can be replaced with \verb|\sym{set}| and -\verb|\gls{gls:set}| can be replaced with \verb|\term{set}|. +\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 \gls{bib2gls} as -the information is written to the \filetype{aux} file. This allows -\gls{bib2gls} to recognise the custom commands if they have been -used in the \filetype{bib} files. When combined with +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 \gls{bib2gls}, remember -that you need the \pkgopt*{record} or \pkgopt+{nameref}{record} +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{alltt} -\cs{usepackage}[\strong{\xtrfont{record},}\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{glossaries-extra} -\end{alltt} -As with earlier examples, \gls{convertgls2bib} can be used to -convert the entry definitions into the required \filetype{bib} format. +\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.\footnote{Requires at least \gls{bib2gls} v2.0.} This is useful +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{prompt} -convertgls2bib -{}-split-on-type -{}-preamble-only sampleNtn.tex entries.bib -\end{prompt} -This will create a file called \nolinkurl{entries.bib} that contains +\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{alltt} -\atentry{entry}\mgroup{gls:set, - name = \mgroup{set}, - description = \mgroup{A collection of distinct objects} +\begin{codebox} +\atentry{entry}\marg{gls:set, + \gloskeyval{name}{set}, + \gloskeyval{description}{A collection of distinct objects} } -\end{alltt} -It will also create a file called \nolinkurl{notation.bib} that +\end{codebox} +It will also create a file called \filefmt{notation.bib} that contains the entries that had the \gloskey{type} set to -\texttt{notation} in the original file, such as: -\begin{alltt} -\atentry{entry}\mgroup{not:set, - name = \mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}}, - description = \mgroup{A \ics*{glspt}\mgroup{gls:set}} +\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{alltt} +\end{codebox} Note that the \gloskey{type} field has been removed. The above entry -in the \nolinkurl{notation.bib} file references a term in the -\nolinkurl{entries.bib} file. It's possible to strip all the -prefixes from the \filetype{bib} files and get \gls{bib2gls} to +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 -\xtrfont{\texttt{ext\meta{n}.}}\ prefixes: -\begin{alltt} -\atentry{entry}\mgroup{\strong{set}, - name = \mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}}, - description = \mgroup{A \ics*{glspt}\mgroup{\strong{\xtrfont{ext1.}}set}} +\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{alltt} -The corresponding term in the \nolinkurl{entries.bib} file is now: -\begin{alltt} -\atentry{entry}\mgroup{\strong{set}, - name = \mgroup{set}, - description = \mgroup{A collection of distinct objects} +\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{alltt} +\end{codebox} -Now you can replace \cs{makeglossaries} with: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{entries},\strong{\xtrfont{label-prefix}=\mgroup{gls:}}] -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{notation},\resourceopt{type}=notation, - \strong{\xtrfont{label-prefix}=\mgroup{not:},\xtrfont{ext-prefixes}=\mgroup{gls:}}] -\end{alltt} -Remove all the \cs{newglossaryentry} definitions and replace \cs{printglossaries} with -\ics*{printunsrtglossaries}. +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 -\gls{bib2gls} call is required: -\begin{prompt} +\app{bib2gls} call is required: +\begin{terminal} pdflatex sampleNtn bib2gls sampleNtn pdflatex sampleNtn -\end{prompt} +\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 \gls{convertgls2bib}, so the entries are +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 \nolinkurl{notations.bib} file so that, -for example, the \texttt{set} definition becomes: -\begin{alltt} -\strong{\atentry{symbol}}\mgroup{set, - name = \mgroup{\cs{ensuremath}\mgroup{\cs{mathcal}\mgroup{S}}}, - description = \mgroup{A \ics*{glspt}\mgroup{\xtrfont{ext1.}set}} +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{alltt} +\end{codebox} Now these \atentry{symbol} entries will be sorted according to their -label. (The original label in the \filetype{bib} file, not the +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 \gls{bib2gls} user manual for examples of varying the sorting +the \app{bib2gls} user manual for examples of varying the sorting and also \bibglsgallery{sorting}.) -\exitem{-dual} This document -illustrates how to define an entry that both appears in the list of -acronyms and in the main glossary. To create the document do: -\begin{prompt} +\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{prompt} -This defines a custom command \ics{newdualentry} that defines two entries at once (a -normal entry and an abbreviation). It uses \ics{glsadd} to ensure -that if one is used then the other is automatically indexed: -\begin{verbatim} -\newcommand*{\newdualentry}[5][]{% - % main entry: - \newglossaryentry{main-#2}{name={#4},% - text={#3\glsadd{#2}},% - description={#5},% - #1% additional options for main entry - }% - % abbreviation: - \newacronym{#2}{#3\glsadd{main-#2}}{#4}% +\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{verbatim} +\end{codebox} A sample dual entry is defined with this command: -\begin{verbatim} -\newdualentry{svm}% label - {SVM}% abbreviation - {support vector machine}% long form - {Statistical pattern recognition technique}% description -\end{verbatim} -This defines an acronym with the label \texttt{svm} that can be -referenced with \verb|\gls{svm}| but it also defines an entry with -the label \texttt{main-svm}. This isn't used in the document with -\cs{gls} but it's automatically added from the -\texttt{\cs{glsadd}\mgroup{main-svm}} in the short form of -\texttt{svm}. +\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 main +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 \gls{bib2gls}, first change to -\gls{glossaries-extra}: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot},\xtrfont{stylemods},acronym]\mgroup{\strong{glossaries-extra}} -\end{alltt} -Next, the definition needs to be converted to the \filetype{bib} -format required by \gls{bib2gls}. If you do: -\begin{prompt} -convertgls2bib -{}-preamble-only sample-dual.tex entries.bib -\end{prompt} -then \gls{convertgls2bib} will report the following: -\begin{verbatim} -Overriding default definition of \newdualentry with custom -definition. (Change \newcommand to \providecommand if you want -\newdualentry[options]{label}{short}{long}{description} -converted to @dualabbreviationentry.) -\end{verbatim} -This is because \gls{convertgls2bib} has its own internal definition -of \cs{newdualentry}, but if it encounters a new definition that +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 -\gls{convertgls2bib}['s] definition (recommended) then just replace -\cs{newcommand} with \cs{providecommand} in the document source and -rerun \gls{convertgls2bib}. - -With \cs{providecommand}, the new \nolinkurl{entries.bib} file -created by \gls{convertgls2bib} contains: -\begin{alltt} -\atentry{dualabbreviationentry}\mgroup{svm, - short = \mgroup{SVM}, - description = \mgroup{Statistical pattern recognition technique}, - long = \mgroup{support vector machine} +\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{alltt} -If \cs{newcommand} is retained, it will instead contain: -\begin{alltt} -\atentry{entry}\mgroup{main-svm, - name = \mgroup{support vector machine}, - description = \mgroup{Statistical pattern recognition technique}, - text = \mgroup{SVM\cs{glsadd}\mgroup{svm}} +\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}} } - -\atentry{acronym}\mgroup{svm, - short = \mgroup{SVM\cs{glsadd}\mgroup{main-svm}}, - long = \mgroup{support vector machine} +\codepar +\atentry{acronym}\marg{svm, + \gloskeyval{short}{SVM\gls{glsadd}\marg{main-svm}}, + \gloskeyval{long}{support vector machine} } -\end{alltt} -In the first case, \gls{bib2gls} creates two linked entries using -its primary-dual mechanism. In the second case, \gls{bib2gls} +\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 \nolinkurl{entries.bib} file just contains +Assuming that your \filefmt{entries.bib} file just contains \atentry{dualabbreviationentry}, -now replace \cs{makeglossaries} with: -\begin{alltt} -\cs{GlsXtrLoadResources}[\resourceopt{src}=entries,\% entries.bib - \resourceopt{type}=acronym,\resourceopt{dual-type}=main,\resourceopt{dual-prefix}=\mgroup{main-}] -\end{alltt} - -Then remove the definition of \cs{newdualentry} and the entry -definition. Finally, replace \cs{printglossaries} with -\ics*{printunsrtglossaries}. +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{prompt} +\begin{terminal} pdflatex sample-dual bib2gls sample-dual pdflatex sample-dual -\end{prompt} +\end{terminal} -If, instead, your \nolinkurl{entries.bib} file contains separate +If, instead, your \filefmt{entries.bib} file contains separate \atentry{entry} and \atentry{acronym}, then you need: -\begin{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries] -\end{alltt} -If you need \glspl{numberlist}, the document build is now -\begin{prompt} +\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{prompt} -and this time \gls{bib2gls} complains about the use of \ics{glsadd} +\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 \gls{bib2gls} and \LaTeX\ calls are -to ensure the \gls{numberlist} is up to date for the -\texttt{main-svm} entry, which can only be indexed with \cs{glsadd} -after \texttt{svm} has been defined.) - -Dual entries make much more sense when one entry is for a glossary -with the description displayed but no \gls{numberlist}, and the -other is for the index without the description but with a -\gls{numberlist}. This can be created with by replacing -\atentry{dualabbreviationentry} with \atentry{dualindexabbreviation}: -\begin{alltt} -\atentry{dualindexabbreviation}\mgroup{svm, - description = \mgroup{Statistical pattern recognition technique}, - short = \mgroup{SVM}, - long = \mgroup{support vector machine} +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{alltt} +\end{codebox} This can be mixed with \atentry{index} terms for example: -\begin{alltt} -\atentry{index}\mgroup{machlearn, - name=\mgroup{machine learning} +\begin{codebox} +\atentry{index}\marg{machlearn, + \gloskeyval{name}{machine learning} } -\end{alltt} +\end{codebox} The document needs modifying: -\begin{alltt} -\cs{documentclass}\mgroup{article} - -\ics{usepackage}[\xtrfont{record},\xtrfont{postdot}, - nostyles,\xtrfont{stylemods}=\mgroup{\xtrfont{bookindex},list},\% only want bookindex and list styles - acronym]\mgroup{glossaries-extra} - -\ics*{setabbreviationstyle}\mgroup{long-short-desc} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\% entries.bib - \resourceopt{dual-type}=acronym, - \xtrfont{label-prefix}=\mgroup{\strong{idx.}},\resourceopt{dual-prefix}=\mgroup{}, - \resourceopt{combine-dual-locations}=\mgroup{primary}] - -\ics*{glsxtrnewglslike}\mgroup{\strong{idx.}}\mgroup{\strong{\cs{idx}}}\mgroup{\cs{idxpl}}\mgroup{\cs{Idx}}\mgroup{\cs{Idxpl}} - -\cs{begin}\mgroup{document} -\cs{gls}\mgroup{svm} and \strong{\cs{idx}}\mgroup{machlearn}. - -\ics*{printunsrtglossary}[type=\acronymtype,style=altlist] -\ics*{printunsrtglossary}[style=bookindex,title=\mgroup{Index}] -\cs{end}\mgroup{document} -\end{alltt} -See the \gls{bib2gls} manual for further details. - -\exitem{-langdict} This document -illustrates how to use the glossaries package to create English +\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{prompt} +\begin{terminal} pdflatex sample-langdict makeglossaries sample-langdict pdflatex sample-langdict -\end{prompt} -This example uses the \pkgopt{nomain} package option to prevent the -creation of the \texttt{main} glossary. This means that the document -must provide its own glossaries: -\begin{verbatim} -\newglossary[glg]{english}{gls}{glo}{English to French} -\newglossary[flg]{french}{flx}{flo}{French to English} -\end{verbatim} -This means that if you want to call \gls{makeindex} explicitly +\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{prompt} +\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{prompt} +\end{terminal} As with the previous example, this document provides a custom command that defines two related entries: -\begin{verbatim} -\newcommand*{\newword}[4]{% - \newglossaryentry{en-#1}{type=english,name={#2},description={#3 #4}}% - \newglossaryentry{fr-#1}{type=french,name={#3 #4},text={#4},sort={#4}, - description={#2}}% +\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{verbatim} +\end{codebox} This has the syntax: -\begin{alltt} -\cs{newword}\marg{label}\marg{english}\marg{determiner}\marg{french} -\end{alltt} +\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 \texttt{en-\meta{label}} (for -the English term) and \texttt{fr-\meta{label}} (for the French term). +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{verbatim} -\newword{cat}{cat}{le}{chat} -\end{verbatim} +\begin{codebox} +\cmd{newword}\marg{cat}\marg{cat}\marg{le}\marg{chat} +\end{codebox} is equivalent to: -\begin{verbatim} -\newglossaryentry{en-cat}{type=english,name={cat},description={le chat}} -\newglossaryentry{fr-cat}{type=french,name={le chat},sort={chat}, - description={cat}} -\end{verbatim} +\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 -\verb|\gls{en-cat}|, then the \texttt{en-cat} entry will appear in the -\texttt{english} glossary but the \texttt{fr-cat} entry won't -appear in the \texttt{french} one. +\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 \gls{bib2gls} then you first need to -convert the document so that it uses \gls{glossaries-extra}, but -include the \pkgopt*{prefix} option to ensure that +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{alltt} -\cs{usepackage}[\strong{\xtrfont{record},\xtrfont{prefix}},\xtrfont{postdot},\xtrfont{stylemods},nomain]\mgroup{\strong{glossaries-extra}} -\end{alltt} +\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 form of \cs{newglossary}: -\begin{alltt} -\cs{newglossary}\strong{*}\mgroup{english}\mgroup{English to French} -\cs{newglossary}\strong{*}\mgroup{french}\mgroup{French to English} -\end{alltt} -Next the entries need to be converted to the \filetype{bib} format -required by \gls{bib2gls}: -\begin{prompt} -convertgls2bib -{}-only-preamble sample-langdict.tex entries.bib -\end{prompt} -This creates the file \nolinkurl{entries.bib} that contains entries +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{alltt} -\atentry{entry}\mgroup{en-cat, - name = \mgroup{cat}, - description = \mgroup{le chat}, - type = \mgroup{english} +\begin{codebox} +\atentry{entry}\marg{en-cat, + \gloskeyval{name}{cat}, + \gloskeyval{description}{le chat} } - -\atentry{entry}\mgroup{fr-cat, - name = \mgroup{le chat}, - description = \mgroup{cat}, - text = \mgroup{chat}, - type = \mgroup{french} +\codepar +\atentry{entry}\marg{fr-cat, + \gloskeyval{name}{le chat}, + \gloskeyval{description}{cat}, + \gloskeyval{text}{chat} } -\end{alltt} -(Note that the \gloskey{sort} field has been omitted.) +\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 \gls{bib2gls}['s] dual entry system combined with the +defined using \app{bib2gls}['s] dual entry system combined with the \sty{glossaries-prefix} package: -\begin{alltt} -\atentry{dualentry}\mgroup{cat, - name = \mgroup{chat}, - description = \mgroup{cat}, - \gloskey{prefix} = \mgroup{le}, - \gloskey{prefixplural} = \mgroup{les} +\begin{codebox} +\atentry{dualentry}\marg{cat, + \gloskeyval{name}{chat}, + \gloskeyval{description}{cat}, + \gloskeyval{prefix}{le}, + \gloskeyval{prefixplural}{les} } -\end{alltt} +\end{codebox} Similarly for the \qt{chair} entry: -\begin{alltt} -\atentry{dualentry}\mgroup{chair, - name = \mgroup{chaise}, - description = \mgroup{chair}, - \gloskey{prefix} = \mgroup{la}, - \gloskey{prefixplural} = \mgroup{les} +\begin{codebox} +\atentry{dualentry}\marg{chair, + \gloskeyval{name}{chaise}, + \gloskeyval{description}{chair}, + \gloskeyval{prefix}{la}, + \gloskeyval{prefixplural}{les} } -\end{alltt} +\end{codebox} With \atentry{dualentry}, the English and French terms are now -automatically linked from \gls{bib2gls}['s] point of view. If only one +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 glossary. However, it's possible to include it by +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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\% entries.bib - \xtrfont{append-prefix-field}=\mgroup{space}, - \resourceopt{category}=\mgroup{same as type},\resourceopt{dual-category}=\mgroup{same as type}, - \xtrfont{label-prefix}=\mgroup{en-},\resourceopt{dual-prefix}=\mgroup{fr-}, - \resourceopt{type}=english,\resourceopt{dual-type}=french, - \resourceopt{sort}=en,\resourceopt{dual-sort}=fr] - -\cs{newcommand}\mgroup{\cs{FrEncap}}[1]\mgroup{\% - \ics{foreignlanguage}\mgroup{french}\mgroup{\ics{glsentryprefix}\mgroup{\ics{glscurrententrylabel}}\#1}} -\cs{newcommand}\mgroup{\cs{EnEncap}}[1]\mgroup{\ics{foreignlanguage}\mgroup{english}\mgroup{\#1}} - -\ics*{glssetcategoryattribute}\mgroup{english}\mgroup{glossnamefont}\mgroup{EnEncap} -\ics*{glssetcategoryattribute}\mgroup{english}\mgroup{glossdescfont}\mgroup{FrEncap} -\ics*{glssetcategoryattribute}\mgroup{french}\mgroup{glossnamefont}\mgroup{FrEncap} -\ics*{glssetcategoryattribute}\mgroup{french}\mgroup{glossdescfont}\mgroup{EnEncap} -\end{alltt} - -Remember to remove \cs{makeglossaries}, the definition of \cs{newword} and -the entry definitions from the document preamble, and -replace \cs{printglossary} with: -\begin{alltt} -\ics*{printunsrtglossary} -\end{alltt} +\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{documentpreamble}, and +replace \gls{printglossary} with: +\begin{codebox} +\gls{printunsrtglossary} +\end{codebox} Other refinements that you might like to make include using -\ics*{glsxtrnewglslike} so you don't have to worry about the label -prefix (\qt{en-} and \qt{fr-}). - -\exitem{-index} This document uses -the \styfmt{glossaries} package to create both a glossary and an -index. This requires two \gls{makeglossaries} (or -\gls{makeglossaries-lite.lua}) calls to ensure the -document is up to date: -\begin{prompt} +\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{prompt} +\end{terminal} \section{Sorting} \label{sec:samplessort} -\exitem{People} This document illustrates how you can hook into the +\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 table of contents is +requires an additional run to ensure the \idx{tableofcontents} is up-to-date: -\begin{prompt} +\begin{terminal} pdflatex samplePeople makeglossaries samplePeople pdflatex samplePeople pdflatex samplePeople -\end{prompt} +\end{terminal} This provides two commands for typesetting a name: -\begin{verbatim} -\newcommand{\sortname}[2]{#2, #1} -\newcommand{\textname}[2]{#1 #2} -\end{verbatim} +\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{verbatim} -\let\name\textname -\end{verbatim} -This command defaults to the display name command (\cs{textname}) -but is temporarily redefined to the sort name command (\cs{sortname}) +\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{alltt} -\cs{renewcommand}\mgroup{\ics{glsprestandardsort}}[3]\mgroup{\% - \strong{\cs{let}\cs{name}\cs{sortname}} - \cs{edef}\#1\mgroup{\cs{expandafter}\cs{expandonce}\cs{expandafter}\mgroup{#1}}\% - \strong{\cs{let}\cs{name}\cs{textname}} - \ics{glsdosanitizesort} +\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{alltt} -The people are defined using the custom \cs{name} command: -\begin{alltt} -\cs{newglossaryentry}\mgroup{joebloggs}\mgroup{name=\mgroup{\strong{\cs{name}}\mgroup{Joe}\mgroup{Bloggs}}, - description=\mgroup{\cs{nopostdesc}}} -\end{alltt} -Since \cs{name} is temporarily changed while the \gloskey{sort} key +\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 \gls{bib2gls}, you first need to convert the -document to use \gls{glossaries-extra} but make sure you include the -\pkgopt*{record} option: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{stylemods},style=listgroup]\mgroup{\strong{glossaries-extra}} -\end{alltt} +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 -\filetype{bib} format required by \gls{bib2gls}. You can simply do: -\begin{prompt} -convertgls2bib -{}-preamble-only samplePeople people.bib -\end{prompt} -which will create a file called \nolinkurl{people.bib} that contains +\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{alltt} -\atentry{entry}\mgroup{joebloggs, - name = \mgroup{\cs{name}\mgroup{Joe}\mgroup{Bloggs}}, - description = \mgroup{\ics{nopostdesc}} +\begin{codebox} +\atentry{entry}\marg{joebloggs, + \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}}, + \gloskeyval{description}{\gls{nopostdesc}} } -\end{alltt} -However, you may prefer to use the \texttt{-{}-index-conversion} -(\texttt{-i}) switch: -\begin{prompt} -convertgls2bib -i -{}-preamble-only samplePeople people.bib -\end{prompt} +\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 \ics{nopostdesc} or -\ics*{glsxtrnopostpunc}. The \nolinkurl{people.bib} file now +\gloskey{description} is either empty or simply set to \gls{nopostdesc} or +\gls{glsxtrnopostpunc}. The \filefmt{people.bib} file now contains definitions like: -\begin{alltt} -\atentry{index}\mgroup{joebloggs, - name = \mgroup{\cs{name}\mgroup{Joe}\mgroup{Bloggs}} +\begin{codebox} +\atentry{index}\marg{joebloggs, + \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}} } -\end{alltt} -Regardless of which approach you used to create the \filetype{bib} +\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 -\cs{name} command for \gls{bib2gls}['s] use: -\begin{alltt} -\atentry{preamble}\mgroup{"\strong{\ics{providecommand}}\mgroup{\cs{name}}[2]\mgroup{\#2, \#1}"} -\end{alltt} -Note the use of \cs{providecommand} instead of \cs{newcommand}. - -In the document (\nolinkurl{samplePeople.tex}) you now need to -delete \cs{makeglossaries}, the definitions of \cs{sortname}, -\cs{textname}, \cs{name}, \cs{glsprestandardsort}, and all the entry -definitions. Then add the following to the document preamble: -\begin{alltt} -\cs{newcommand}\mgroup{\cs{name}}[2]\mgroup{\#1 \#2} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=people] -\end{alltt} +\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{documentpreamble}: +\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 -subsitute all instances of \cs{glsentrytext} in the chapter -headings with \ics*{glsfmttext}. For example: -\begin{alltt} -\ics{chapter}\mgroup{\strong{\ics*{glsfmttext}}\mgroup{joebloggs}} -\end{alltt} -Finally, replace \cs{printunsrtglossaries} with: -\begin{alltt} -\ics*{printunsrtglossaries} -\end{alltt} +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{prompt} +\begin{terminal} pdflatex samplePeople bib2gls samplePeople pdflatex samplePeople pdflatex samplePeople -\end{prompt} -The third \LaTeX\ call is required to ensure that the PDF bookmarks +\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 -\gls{bib2gls} run (which is why you have to use \ics*{glsfmttext} -instead of \cs{glsentrytext}). +\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 \gls{bib2gls} only sees the definition of \cs{name} +is because \app{bib2gls} only sees the definition of \csfmt{name} provided in \atentry{preamble}, but the document uses the definition -of \cs{name} provided before \cs{GlsXtrLoadResources}. The use of -\ics{providecommand} in \atentry{preamble} prevents \cs{name} from +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 \gls{bib2gls} user manual, -which provides another \qt{people} example. +See also the \qt{Examples} chapter of the \app{bib2gls} user manual, +which provides another \qt{people} example and +\gallerypage{aliases}{Aliases}. -\exitem{Sort} This is another document that illustrates how to hook +\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 table of contents is up-to-date: -\begin{prompt} +ensure the \idx{tableofcontents} is up-to-date: +\begin{terminal} pdflatex sampleSort makeglossaries sampleSort pdflatex sampleSort pdflatex sampleSort -\end{prompt} -This document has three glossaries (\texttt{main}, \texttt{acronym} -and a custom \texttt{notation}), so if you want to use -\gls{makeindex} explicitly you will need to have three -\gls{makeindex} calls with the appropriate file extensions: -\begin{prompt} +\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{prompt} -It's much simpler to just use \gls{makeglossaries} or \gls{makeglossaries-lite.lua}. +\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{verbatim} -\newcounter{sortcount} -\end{verbatim} +\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 -\texttt{notation} glossary. The other two glossaries have their sort +\glostypefmt{notation} glossary. The other two \idxpl{glossary} have their sort keys assigned as normal: -\begin{verbatim} -\renewcommand{\glsprestandardsort}[3]{% - \ifdefstring{#2}{notation}% - {% - \stepcounter{sortcount}% - \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% - }% - {% - \glsdosanitizesort - }% +\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{verbatim} -This means that \gls{makeindex} will sort the notation in numerical order. +\end{codebox*} +This means that \app{makeindex} will sort the notation in numerical order. \glsxtrnote -If you want to convert this document to use \gls{glossaries-extra}, +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{alltt} -\cs{usepackage}[\xtrfont{postdot},\xtrfont{stylemods},acronym]\mgroup{\strong{glossaries-extra}} -\end{alltt} -Either remove \cs{setacronymstyle} and replace all instances of -\cs{newacronym} with \ics*{newabbreviation} or replace: -\begin{verbatim} -\setacronymstyle{long-short} -\end{verbatim} +\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{alltt} -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short} -\end{alltt} +\begin{codebox} +\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}} +\end{codebox} -The custom counter and redefinition of \cs{glsprestandardsort} can now -be removed. The file extensions for the custom \texttt{notation} -glossary are no longer relevant so the glossary definition can be +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{alltt} -\cs{newglossary\strong{*}}\mgroup{notation}\mgroup{Notation} -\end{alltt} -The \ics{makeglossaries} command now needs to be adjusted to -indicate which glossaries need to be processed by \gls{makeindex}: -\begin{alltt} -\cs{makeglossaries}\strong{[main,acronym]} -\end{alltt} -Finally, \ics{printglossaries} needs to be replaced with: -\begin{alltt} -\cs{printglossary} -\cs{printacronyms} -\cs{print\strong{noidx}glossary}[type=notation\strong{,sort=def}] -\end{alltt} -Note that the \texttt{notation} glossary, which hasn't been listed in the optional -argument of \cs{makeglossaries}, must be displayed with \ics{printnoidxglossary}. - -This means that \gls{makeindex} only needs to process the -\texttt{main} and \texttt{acronym} glossaries. No actual sorting is -performed for the \texttt{notation} glossary because, when used with -\printnoidxglosskey[def]{sort}, \cs{printnoidxglossary} simply +\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 glossaries extend beyond a page break): -\begin{prompt} +none of the \idxpl{glossary} extend beyond a page break): +\begin{terminal} pdflatex sampleSort makeglossaries sampleSort pdflatex sampleSort -\end{prompt} -This time \gls{makeglossaries} will include the message: -\begin{verbatim} -only processing subset 'main,acronym' -\end{verbatim} -This means that although \gls{makeglossaries} has noticed the \texttt{notation} glossary, -it will be skipped. - -If you are explicitly calling \gls{makeindex} then you need to drop the call -for the \texttt{notation} glossary: -\begin{prompt} +\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{prompt} +\end{terminal} \bibglsnote -If you prefer to use \gls{bib2gls}, the package loading line needs +If you prefer to use \app{bib2gls}, the package loading line needs to be changed to: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot},\xtrfont{stylemods},acronym]\mgroup{\strong{glossaries-extra}} -\end{alltt} -Next the entry definitions need to be convert to the \filetype{bib} -format required by \gls{bib2gls}. +\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 -\texttt{-{}-split-on-type} or \texttt{-t} switch: -\begin{prompt} -convertgls2bib -t -{}-preamble-only sampleSort.tex entries.bib -\end{prompt} +\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{description} -\item[\nolinkurl{entries.bib}] which contains the entries that were -defined with \ics{newglossaryentry}. For example: -\begin{alltt} -\atentry{entry}\mgroup{gls:set, - name = {set}, - description = {A collection of distinct objects} +\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{alltt} - -\item[\nolinkurl{abbreviations.bib}] which contains the entries that -were defined with \ics{newacronym}. For example: -\begin{alltt} -\atentry{acronym}\mgroup{zfc, - short = \mgroup{ZFC}, - long = \mgroup{Zermelo-Fraenkel set theory} +\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{alltt} -If you changed \ics{newacronym} to \ics*{newabbreviation} then +\end{codebox} +If you changed \gls{newacronym} to \gls{newabbreviation} then \atentry{abbreviation} will be used instead: -\begin{alltt} -\atentry{abbreviation}\mgroup{zfc, - short = \mgroup{ZFC}, - long = \mgroup{Zermelo-Fraenkel set theory} +\begin{codebox} +\atentry{abbreviation}\marg{zfc, + \gloskeyval{short}{ZFC}, + \gloskeyval{long}{Zermelo-Fraenkel set theory} } -\end{alltt} - -\item[\nolinkurl{notation.bib}] which contains the entries that were -defined with \texttt{\gloskey{type}=notation}. For example: -\begin{alltt} -\atentry{entry}\mgroup{not:set, - name = \mgroup{\$\cs{mathcal}\mgroup{S}\$}, - description = \mgroup{A set}, - text = \mgroup{\cs{mathcal}\mgroup{S}} +\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{alltt} +\end{codebox} You may prefer to replace \atentry{entry} with \atentry{symbol} in this file. -\end{description} -\emph{After} the definition of the \texttt{notation} glossary -(\cs{newglossary}), add: -\begin{alltt} -\% abbreviation style must be set first: -\ics*{setabbreviationstyle}[acronym]\mgroup{long-short} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{entries,abbreviations}] -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{notation},\% notation.bib - \strong{\xtrfont{type}=notation},\resourceopt{sort}=\strong{unsrt}] -\end{alltt} -Delete the remainder of the preamble (\cs{makeglossaries} and entry +\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{documentpreamble} (\gls{makeglossaries} and entry definitions). -Finally, replace the lines that display the glossaries with: -\begin{alltt} -\ics*{printunsrtglossaries} -\end{alltt} +Finally, replace the lines that display the \idxpl{glossary} with: +\begin{codebox} +\gls{printunsrtglossaries} +\end{codebox} The build process is now: -\begin{prompt} +\begin{terminal} pdflatex sampleSort bib2gls sampleSort pdflatex sampleSort -\end{prompt} +\end{terminal} In this case, I have one resource command that processes two -glossaries (\texttt{main} and \texttt{acronym}) at the same time. +glossaries (\glostype{main} and \glostype{acronym}) at the same time. The entries in these glossaries are ordered alphabetically. -The second resource command processes the \texttt{notation} glossary but +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 \filetype{bib} file). +the order of definition within the \ext{bib} file). -See also \samplefile{Ntn}, \bibglsgallery{sorting} and the \gls{bib2gls} user manual +See also \samplefile{Ntn}, \bibglsgallery{sorting} and the \app{bib2gls} user manual for more examples. \section{Child Entries} \label{sec:samplesparent} -\exitem{} This document illustrates some of +\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 -table of contents and it also uses \ics{glsrefentry}, so an extra \LaTeX\ +\idx{tableofcontents} and it also uses \gls{glsrefentry}, so an extra \LaTeX\ run is required: -\begin{prompt} +\begin{terminal} pdflatex sample makeglossaries sample pdflatex sample pdflatex sample -\end{prompt} +\end{terminal} You can see the difference between word and letter ordering if you -add the package option \pkgopt[letter]{order}. (Note +add the package option \optval{order}{letter}. (Note that this will only have an effect if you use -\gls{makeglossaries} or \gls{makeglossaries-lite.lua}. -If you use \gls{makeindex} explicitly, you will need to use the +\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{alltt} -\cs{newcommand}\mgroup{\strong{\cs{scriptlang}}}[1]\mgroup{\cs{textsf}\mgroup{\#1}} - -\cs{newglossaryentry}\mgroup{Perl}\mgroup{name=\strong{\cs{scriptlang}}\mgroup{Perl},\strong{sort=Perl,} -description=\mgroup{A scripting language}} -\end{alltt} +\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 \gls{makeindex} will assign it to the \qt{symbol} letter -group, since it starts with a backslash (which \gls{makeindex} +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 -\pkgopt[false]{nopostdot} setting this will lead to a spurious dot. -This can be removed by adding \ics{nopostdesc} to the description, +\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{alltt} -\cs{newglossaryentry}\mgroup{glossary}\mgroup{name=glossary, - description=\mgroup{\strong{\ics{nopostdesc}}},plural=\mgroup{glossaries}} - -\ics{newglossaryentry}\mgroup{glossarycol}\mgroup{ - description=\mgroup{collection of glosses}, - \strong{sort=\mgroup{2},} - parent=\mgroup{glossary}\% parent \emph{label} +\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}} } - -\cs{newglossaryentry}\mgroup{glossarylist}\mgroup{ - description=\mgroup{list of technical words}, - \strong{sort=\mgroup{1},} - parent=\mgroup{glossary}\% 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{alltt} +\end{codebox} (Remember that the entries are sorted hierarchically.) This will -place \texttt{glossarylist} before \texttt{glossarycol}, but both -will come immediately after their parent \texttt{glossary} entry. +place \qt{glossarylist} before \qt{glossarycol}, but both +will come immediately after their parent \qt{glossary} entry. \glsxtrnote -If you switch to using \gls{glossaries-extra}, remember that the +If you switch to using \sty{glossaries-extra}, remember that the default package options are different: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{postdot},\xtrfont{stylemods}},style=treenonamegroup,order=word, - subentrycounter]\mgroup{\strong{glossaries-extra}} -\end{alltt} +\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 \ics{nopostdesc} in the -descriptions with \ics*{glsxtrnopostpunc} (using your +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{verbatim} -\newglossaryentry{cow}{name=cow, - plural=cows,% not required as this is the default - user1=kine, - description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult +\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{verbatim} +\end{codebox} which has the parenthetical material at the start of the description with emphasis, -\begin{verbatim} -\newglossaryentry{bravocry}{ - description={cry of approval (pl.\ bravos)}, - sort={1}, - parent={bravo} +\begin{codebox} +\gls{newglossaryentry}\marg{bravocry}\marg{ + \gloskeyval{description}{cry of approval (pl.\gls{cs.sp}bravos)}, + \gloskeyval{sort}{1}, + \gloskeyval{parent}{bravo} } -\end{verbatim} +\end{codebox} which has the parenthetical material at the end of the description without emphasis even though it's a regular plural, -\begin{verbatim} -\newglossaryentry{bravoruffian}{ - description={hired ruffian or killer (pl.\ bravoes)}, - sort={2}, - plural={bravoes}, - parent=bravo} -\end{verbatim} +\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{verbatim} -\newglossaryentry{glossary}{name=glossary, - description={\nopostdesc}, - plural={glossaries}} -\end{verbatim} +\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 \gls{glossaries-extra}, you can remove this parenthetical +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{verbatim} -\newglossaryentry{cow}{name=cow, - user1=kine, - description={an adult female of any bovine animal} +\begin{codebox} +\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow}, + \gloskeyval{user1}{kine}, + \gloskeyval{description}{an adult female of any bovine animal} } - -\newglossaryentry{bravocry}{ - description={cry of approval}, - sort={1}, - parent={bravo} +\codepar +\gls{newglossaryentry}\marg{bravocry}\marg{ + \gloskeyval{description}{cry of approval}, + \gloskeyval{sort}{1}, + \gloskeyval{parent}{bravo} } - -\newglossaryentry{bravoruffian}{ - description={hired ruffian or killer}, - sort={2}, - plural={bravoes}, - parent=bravo} -\end{verbatim} -\begin{alltt} -\cs{newglossaryentry}\mgroup{glossary}\mgroup{name=glossary, - description=\mgroup{\strong{\ics*{glsxtrnopostpunc}}}, - plural=\mgroup{glossaries}} -\end{alltt} +\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{alltt} -\ics*{glsdefpostdesc}\mgroup{general}\mgroup{\% -\codecomment{\% Has the user1 key been set?} - \ics*{glsxtrifhasfield}\mgroup{useri}\mgroup{\ics{glscurrententrylabel}}\% - \mgroup{\cs{space}(\cs{emph}\mgroup{pl.}\cs{ }\ics{glsentryplural}\mgroup{\ics{glscurrententrylabel}}, - \cs{emph}\mgroup{archaic} \ics{glscurrentfieldvalue})\% - }\% - \mgroup{\% -\codecomment{\% The user1 key hasn't been set. Is the plural the same as the -\% singular form with the plural suffix appended?} - \ics*{GlsXtrIfXpFieldEqXpStr}\mgroup{plural}\mgroup{\ics{glscurrententrylabel}}\% - \mgroup{\ics{glsentrytext}\mgroup{\ics{glscurrententrylabel}}\ics{glspluralsuffix}}\% - \mgroup{\% -\codecomment{\% Sibling check with \gls{bib2gls} (see below)} - }\% - \mgroup{\% -\codecomment{\% The plural isn't the default. Does this entry have a parent?} - \cs{ifglshasparent}\mgroup{\cs{glscurrententrylabel}}% - \mgroup{\% -\codecomment{\% This entry has a parent. -\% Are the plurals for the child and parent the same?} - \ics*{GlsXtrIfXpFieldEqXpStr}\mgroup{plural}\mgroup{\cs{glscurrententrylabel}}\% - \mgroup{\cs{glsentryplural}\mgroup{\cs{glsentryparent}\mgroup{\cs{glscurrententrylabel}}}}\% - \mgroup{}\% \codecomment{child and parent plurals the same} - \mgroup{\% - \cs{space}(\cs{emph}\mgroup{pl.}\cs{ }\cs{glsentryplural}\mgroup{\cs{glscurrententrylabel}})\% - }\% +\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{} }% - \mgroup{\cs{space}(\cs{emph}\mgroup{pl.}\cs{ }\ics{glsentryplural}\mgroup{\ics{glscurrententrylabel}})}\% - }\% - }\% + \marg{\gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})}\comment{} + }\comment{} + }\comment{} } -\end{alltt} +\end{codebox*} (If you try this example out, notice the difference for the -\texttt{glossary} entry if you use \cs{nopostdesc} and then -replace it with \ics*{glsxtrnopostpunc}.) -See the \gls{glossaries-extra} user manual for further details and +\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 \texttt{bravocry} term) and only show -the \qt{bravoes} plural (for the \texttt{bravoruffian} term). In this +\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 -\ics{glsentryparent}) it's much harder to access entry's children or -siblings. The \ics{ifglshaschildren} command has to iterate over all +\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 \gls{bib2gls}, it's possible to save this information with the +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 @@ -17504,36 +31940,36 @@ 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{alltt} -\codecomment{\% Sibling check with \gls{bib2gls} (see below)} -\end{alltt} +\begin{codebox} +\comment{Sibling check with \app{bib2gls} (see below)} +\end{codebox} indicates where to put the extra code. If you switch to -\gls{bib2gls} and make sure to use \resourceopt{save-sibling-count} +\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{alltt} -\ics*{GlsXtrIfFieldNonZero}\mgroup{siblingcount}\mgroup{\cs{glscurrententrylabel}}\% -\mgroup{\% \codecomment{\xtrfield{siblingcount} field value non-zero} - \ics*{glsxtrfieldforlistloop} \% \codecomment{iterate over internal list} - \mgroup{\cs{glscurrententrylabel}}\% \codecomment{entry label} - \mgroup{siblinglist}\% \codecomment{label of field containing list} - \mgroup{\cs{siblinghandler}}\% \codecomment{loop handler} -}\% -\mgroup{}\% \codecomment{\xtrfield{siblingcount} field value 0 or empty or missing} -\end{alltt} +\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{alltt} -\cs{newcommand}\mgroup{\cs{siblinghandler}}[1]\mgroup{\% - \ics*{GlsXtrIfXpFieldEqXpStr}*\mgroup{plural}\mgroup{\cs{glscurrententrylabel}}\% - \mgroup{\cs{glsentryplural}\mgroup{\#1}}\% - \mgroup{}\% \codecomment{current entry's plural same as sibling's plural} - \mgroup{\% - \cs{space}(\cs{emph}\mgroup{pl.}\cs{ }\cs{glsentryplural}\mgroup{\cs{glscurrententrylabel}})\% - \ics{listbreak} - }% +\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{alltt} -The \cs{listbreak} command is provided by \sty{etoolbox} and is used +\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, @@ -17542,194 +31978,195 @@ 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 \texttt{bravoruffian} child entry wouldn't show the plural (since +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 \gls{bib2gls} or if you use it without the +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 \gls{bib2gls}, it's first necessary to -switch to using \gls{glossaries-extra} (as above). Remember that the -\pkgopt*{record} option is required: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record},}\xtrfont{postdot},\xtrfont{stylemods},style=treenonamegroup, -subentrycounter]\mgroup{glossaries-extra} -\end{alltt} +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 -\filetype{bib} format required by \gls{bib2gls}. This can be done -with \gls{convertgls2bib}: -\begin{alltt} -convertgls2bib -{}-preamble-only sample.tex entries. -\end{alltt} -The semantic command may be moved to the \filetype{bib} file to +\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{bibpreamble} to ensure it's defined: -\begin{alltt} -\atentry{preamble}\mgroup{"\cs{providecommand}\mgroup{\cs{scriptlang}}[1]\mgroup{\cs{textsf}\mgroup{\#1}}"} -\end{alltt} +\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 -\gls{bib2gls}, so \gls{convertgls2bib} strips it. -If the \gloskey{sort} field is missing, \gls{bib2gls} will obtain it +\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{alltt} -\atentry{entry}\mgroup{Perl, - name = \mgroup{\cs{scriptlang}\mgroup{Perl}}, - description = \mgroup{A scripting language} +\begin{codebox} +\atentry{entry}\marg{Perl, + \gloskeyval{name}{\cmd{scriptlang}\marg{Perl}}, + \gloskeyval{description}{A scripting language} } -\end{alltt} -This isn't a problem for \gls{bib2gls}. In this case, the command -has been provided in the \atentry{preamble}, but \gls{bib2gls} -strips font information so the sort value becomes \texttt{Perl}. +\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 -\gls{bib2gls} will simply ignore the command (as \gls{xindy} does) -so the sort value will still end up as \texttt{Perl}. +\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{alltt} -\atentry{entry}\mgroup{glossarycol, - parent = \mgroup{glossary}, - description = \mgroup{collection of glosses} +\begin{codebox} +\atentry{entry}\marg{glossarycol, + \gloskeyval{parent}{glossary}, + \gloskeyval{description}{collection of glosses} } - -\atentry{entry}\mgroup{glossarylist, - parent = \mgroup{glossary}, - description = \mgroup{list of technical words} +\codepar +\atentry{entry}\marg{glossarylist, + \gloskeyval{parent}{glossary}, + \gloskeyval{description}{list of technical words} } -\end{alltt} +\end{codebox} This means that the sort value for both these child entries is -\qt{glossary}. When \gls{bib2gls} encounters identical sort values +\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 \texttt{glossarycol} before -\texttt{glossarylist}. In the original document, the \gloskey{sort} +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 \gls{firstuse}. This ordering can easily be obtained -by changing \gls{bib2gls}['s] identical sort action (requires at -least \gls{bib2gls} v2.0): -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{entries},\strong{\xtrfont{identical-sort-action}=use}] -\end{alltt} -This command should replace \cs{makeglossaries}. If you want the +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 \texttt{glossarycol} is used first, then +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 preamble (that is, the definition of -\cs{scriptlang} and all the entry definitions) should now be +The remainder of the \idxf{documentpreamble} (that is, the definition of +\csfmt{scriptlang} and all the entry definitions) should now be removed. -Finally, replace \cs{printglossaries} with \ics*{printunsrtglossaries}. +Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}. The document build is now: -\begin{prompt} +\begin{terminal} pdflatex sample -bib2gls -{}-group sample +bib2gls \switch{group} sample pdflatex sample pdflatex sample -\end{prompt} -Note use of the \bibglslongopt{group} (or \bibglsopt{g}) switch, which is needed +\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 \ics{glsrefentry}. +call is needed because the document contains \gls{glsrefentry}. -Note that you can't use the \pkgopt[letter]{order} package option -with \gls{bib2gls}. Instead use the \resourceopt[none]{break-at} +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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=\mgroup{entries},\xtrfont{identical-sort-action}=use, - \strong{\xtrfont{break-at}=none} -] -\end{alltt} +\begin{codebox} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\resourceoptval{identical-sort-action}{use}, + \strong{\resourceoptval{break-at}{none}} +} +\end{codebox} -\exitem{-inline} This document is -like \texttt{sample.tex}, above, but uses the \glostyle{inline} -glossary style to put the glossary in a footnote. The document build +\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{prompt} +\begin{terminal} pdflatex sample-inline makeglossaries sample-inline pdflatex sample-inline pdflatex sample-inline -\end{prompt} -If you want to convert this document to \gls{glossaries-extra}, -follow the same procedure as above. If you want to use \gls{bib2gls} -then you don't need the \bibglslongopt{group} switch since no letter +\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. -\exitem{tree} This document illustrates -a hierarchical glossary structure where child entries have different -names to their corresponding parent entry. To create the document -do: -\begin{prompt} +\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{prompt} +\end{terminal} The document uses the \glostyle{alttreehypergroup} glossary style, -which needs to know the widest name for each hierarchical level. -This has been assigned manually in the preamble with -\ics{glssetwidest}: -\begin{verbatim} -\glssetwidest{Roman letters} % level 0 widest name -\glssetwidest[1]{Sigma} % level 1 widest name -\end{verbatim} +which needs to know the widest name for each \idx{hierarchicallevel}. +This has been assigned manually in the \idxf{documentpreamble} 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 \styfmt{glossaries} to compute the -widest top-level entry with \ics{glsfindwidesttoplevelname} but this +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 glossary. If you have a large database of +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 \pkgopt{nolong} and -\pkgopt{nosuper}. The reduces the overall package loading. -\begin{alltt} -\cs{usepackage}[style=alttreehypergroup,\strong{nolong,nosuper}] -\mgroup{glossaries} -\end{alltt} +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.) +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 hierarchical level. A +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 \gls{glossaries-extra}, then you can -instead use a combination of \pkgopt{nostyles} and -\pkgopt*{stylemods}: -\begin{alltt} -\cs{usepackage}[style=alttreehypergroup,\xtrfont{postdot},\strong{nostyles, -\xtrfont{stylemods=tree}}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -The \pkgopt*{stylemods} package not only patches the original styles -provided by the base \styfmt{glossaries} package (such as +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 \ics{glssetwidest}, you could add the +the widest entry with \gls{glssetwidest}, you could add the following before the glossary: -\begin{alltt} -\ics*{glsFindWidestUsedTopLevelName} -\ics*{glsFindWidestUsedLevelTwo} -\end{alltt} +\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. @@ -17738,20 +32175,20 @@ a large number of entries. 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 \filetype{aux} file for the next run. +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 -\ics{nopostdesc} to prevent the post-description punctuation from +\gls{nopostdesc} to prevent the post-description punctuation from being automatically inserted. For example: -\begin{verbatim} -\newglossaryentry{greekletter}{name={Greek letters}, -text={Greek letter}, -description={\nopostdesc}} -\end{verbatim} -With \gls{glossaries-extra}, you can convert this to -\ics*{glsxtrnopostpunc} which will prevent the post-description +\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. @@ -17760,150 +32197,150 @@ 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 -\xtrgloskey{category} key must be a label. For example: -\begin{alltt} -\cs{newglossaryentry}\mgroup{C}\mgroup{name=\mgroup{C}, -description=\mgroup{Euler's constant}, -\strong{\xtrfont{category}=symbol,} -parent=romanletter} -\end{alltt} - -There is some redundancy caused by a parenthetical note after the \gls{firstuse} in some -of the symbol entries. For example: -\begin{verbatim} -\newglossaryentry{pi}{name={pi}, -text={\ensuremath{\pi}}, -first={\ensuremath{\pi} (lowercase pi)}, -description={Transcendental number}, -parent=greekletter} -\end{verbatim} -With \gls{glossaries-extra} this can be dealt with through the category post-link hook: -\begin{alltt} -\ics*{glsdefpostlink}\mgroup{symbol}\mgroup{\% - \ics*{glsxtrifwasfirstuse} - \mgroup{\% first use - \ics*{glsxtrifhasfield}\mgroup{useri}\mgroup{\ics{glslabel}}\% - \mgroup{ (\ics{glscurrentfieldvalue})}\mgroup{}\% - }\% - \mgroup{}\% not first use +\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{alltt} +\end{codebox} The parenthetical material is now stored in the \gloskey{user1} key. For example: -\begin{alltt} -\cs{newglossaryentry}\mgroup{sigma}\mgroup{name={Sigma}, -text=\mgroup{\cs{ensuremath}{\cs{Sigma}}}, -\strong{user1=\mgroup{uppercase sigma},} -description=\mgroup{Used to indicate summation}, -parent=greekletter} -\end{alltt} +\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{alltt} -\ics*{glsdefpostdesc}\mgroup{symbol}\mgroup{\cs{space} - (\$\ics{glsentrytext}\mgroup{\ics{glscurrententrylabel}}\$)} -\end{alltt} +\begin{codebox} +\gls{glsdefpostdesc}\marg{symbol}\marg{\gls{space} + (\$\gls{glsentrytext}\marg{\gls{glscurrententrylabel}}\$)} +\end{codebox} These modifications only affect entries with the -\xtrgloskey{category} set to \cat{symbol}. - -With \gls{glossaries-extra}, it's now possible to use the topic -styles provided with the \sty*{glossary-topic} package: -\begin{alltt} -\cs{usepackage}[style=\strong{\xtrfont{topic}},\xtrfont{postdot},\strong{nostyles,\xtrfont{stylemods=\mgroup{tree\strong{,topic}}}}] -\mgroup{\strong{glossaries-extra}} -\end{alltt} -The \xtrglostyle{topic} style is designed for this kind of hierarchy +\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 \ics{nopostdot} and \ics*{glsxtrnopostpunc} commands aren't +that the \gls{nopostdesc} and \gls{glsxtrnopostpunc} commands aren't required. The top-level entries can simply be defined as: -\begin{alltt} -\cs{newglossaryentry}\mgroup{greekletter}\mgroup{name=\mgroup{Greek letters}, -text=\mgroup{Greek letter}, description=\mgroup{}} - -\cs{newglossaryentry}\mgroup{romanletter}\mgroup{name=\mgroup{Roman letters}, -text=\mgroup{Roman letter}, description=\mgroup{}} -\end{alltt} +\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 \pkgopt*{stylemods}\optfmt{\dequals\mgroup{tree\dcomma topic}}). The +(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 \ics{glssetwidest} (provided by -\sty{glossary-tree}) then the \xtrglostyle{topic} style will behave +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 -\xtrglostyle{topic} style ignores the widest name setting for the +\glostyle{topic} style ignores the widest name setting for the top-level, so I can just have the level~1 setting: -\begin{verbatim} -\glssetwidest[1]{Sigma} -\end{verbatim} +\begin{codebox} +\gls{glssetwidest}\oarg{1}{Sigma} +\end{codebox} \bibglsnote -If you want to convert this document so that it uses \gls{bib2gls}, -you first need to convert it to using \gls{glossaries-extra}, as -described above, but remember that you now need the \pkgopt*{record} +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{alltt} -\cs{usepackage}[\strong{\xtrfont{record},}style=topic,\xtrfont{postdot},nostyles,\xtrfont{stylemods=\mgroup{tree,topic}}] -\mgroup{\strong{glossaries-extra}} -\end{alltt} -Next convert the entries to the \filetype{bib} format required by -\gls{bib2gls}: -\begin{prompt} -convertgls2bib -{}-preamble-only sampletree.tex entries.bib -\end{prompt} -Now replace \cs{makeglossaries} with: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\strong{\xtrfont{set-widest}}] -\end{alltt} +\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 -\gls{bib2gls} to compute the widest name. (Obviously, it can only do +\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 \ics{glssetwidest} commands can now be removed -completely. All the \cs{newglossaryentry} commands also need to be removed from -the preamble. Finally, \cs{printunsrtglossaries} needs to be -replaced with \ics*{printunsrtglossaries}. The document build is now: -\begin{prompt} +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{documentpreamble}. Finally, \gls{printglossaries} needs to be +replaced with \gls{printunsrtglossaries}. The document build is now: +\begin{terminal} pdflatex sampletree bib2gls sampletree pdflatex sampletree -\end{prompt} +\end{terminal} -This produces the same result as with just \gls{glossaries-extra} -and \gls{makeglossaries}. However, there are some modifications that -can be made to the \filetype{bib} file to make it neater. +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{alltt} -\atentry{entry}\mgroup{greekletter, - name = \mgroup{Greek letters}, - description = \mgroup{}, - text = \mgroup{Greek letter} +\begin{codebox} +\atentry{entry}\marg{greekletter, + \gloskeyval{name}{Greek letters}, + \gloskeyval{description}{}, + \gloskeyval{text}{Greek letter} } - -\atentry{entry}\mgroup{romanletter, - name = \mgroup{Roman letters}, - description = \mgroup{}, - text = \mgroup{Roman letter} +\codepar +\atentry{entry}\marg{romanletter, + \gloskeyval{name}{Roman letters}, + \gloskeyval{description}{}, + \gloskeyval{text}{Roman letter} } -\end{alltt} -This is a direct translation from the \cs{newglossaryentry} commands -(after switching to the \xtrglostyle{topic} style). There's a more +\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{alltt} -\atentry{indexplural}\mgroup{greekletter, - text = \mgroup{Greek letter} +\begin{codebox} +\atentry{indexplural}\marg{greekletter, + \gloskeyval{text}{Greek letter} } - -\atentry{indexplural}\mgroup{romanletter, - text = \mgroup{Roman letter} +\codepar +\atentry{indexplural}\marg{romanletter, + \gloskeyval{text}{Roman letter} } -\end{alltt} +\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 @@ -17913,1025 +32350,1046 @@ hasn't been set it's obtained by appending \qt{s} to the 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{alltt} -\atentry{entry}\mgroup{sigma, - user1 = \mgroup{uppercase sigma}, - parent = \mgroup{greekletter}, - description = \mgroup{Used to indicate summation}, - \strong{name = \mgroup{\cs{ensuremath}\mgroup{\cs{Sigma}}}}, - category = \mgroup{symbol} +\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}} } - -\atentry{entry}\mgroup{C, - parent = \mgroup{romanletter}, - name = \mgroup{\cs{ensuremath}\mgroup{C}}, - description = \mgroup{Euler's constant}, - category = \mgroup{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{alltt} +\end{codebox} The category post-description hook (provided with -\ics*{glsdefpostdesc}) should now be removed from the document. +\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 \texttt{sigma} entry is before the -\texttt{pi} entry. This is because \gls{bib2gls} is obtaining the +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$ (\gls{bib2gls} recognises the commands -\ics{Sigma} and \ics{pi} and converts them to the Unicode characters +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 (\texttt{pi} before -\texttt{Sigma}). This is because the sort fallback for +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 \filetype{bib} file by removing the -\xtrgloskey{category} fields. For example: -\begin{alltt} -\atentry{symbol}\mgroup{sigma, - user1 = \mgroup{uppercase sigma}, - parent = \mgroup{greekletter}, - description = \mgroup{Used to indicate summation}, - name = \mgroup{\cs{ensuremath}\mgroup{\cs{Sigma}}} +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{alltt} -You can then assign the \xtrgloskey{category} in the resource set: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries,\xtrfont{set-widest},\strong{\xtrfont{category}=\mgroup{same as entry}}] -\end{alltt} +\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 \xtrgloskey{category} set to \texttt{symbol} and all the +have the \gloskey{category} set to \cat{symbol} and all the entries defined with \atentry{indexplural} will have the -\xtrgloskey{category} set to \texttt{indexplural}. (Only the +\gloskey{category} set to \catfmt{indexplural}. (Only the \cat{symbol} category is significant in this example.) -You can make the \filetype{bib} files even more flexible by +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 \gls{bib2gls} manual +and \resourceopt{entry-type-aliases}. See the \app{bib2gls} manual for further details. \section{Cross-Referencing} \label{sec:samplescrossref} -\exitem{-crossref} +\filedef{sample-crossref.tex} This document illustrates how to cross-reference entries in the glossary. -\begin{prompt} +\begin{terminal} pdflatex sample-crossref makeglossaries sample-crossref pdflatex sample-crossref -\end{prompt} -The document provides a command \ics{alsoname} to produce some fixed text, which can be +\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{verbatim} -\providecommand{\alsoname}{see also} -\end{verbatim} -I've used \cs{providecommand} as some packages define this command. +\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{verbatim} -\newglossaryentry{apple}{name=apple,description={firm, round fruit}, -see=[\alsoname]{pear}} - -\newglossaryentry{marrow}{name={marrow}, - description={long vegetable with thin green skin and white flesh}, - see={[\alsoname]courgette}} -\end{verbatim} +\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 \ics{glssee} which indexes +\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 \gls{glossaries-extra} +that case, you may want to consider using \sty{glossaries-extra} (see below). \glsxtrnote -This example is quite simple to convert to \gls{glossaries-extra}. +This example is quite simple to convert to \sty{glossaries-extra}. If you want the dot after the description, you need the -\pkgopt[false]{nopostdot} or \pkgopt*{postdot} package option. You -may also want to consider using the \pkgopt*{stylemods} option. +\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 \pkgopt+{false}{autoseeindex} to prevent the automatic +can use \optval{autoseeindex}{false} to prevent the automatic indexing triggered by the \gloskey{see} key (or the -\xtrgloskey{seealso} key provided by \gls{glossaries-extra}). +\gloskey{seealso} key provided by \sty{glossaries-extra}). -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{autoseeindex}=false},\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{glossaries-extra} -\end{alltt} +\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 \ics{glssee} not via the \gloskey{see} key. - -The entries that contains \texttt{see=[\cs{alsoname}]} -can be converted to use the \xtrgloskey{seealso} key: -\begin{alltt} -\cs{newglossaryentry}\mgroup{apple}\mgroup{name=apple,description=\mgroup{firm, round fruit}, -\strong{\xtrfont{seealso}=\mgroup{pear}}} - -\cs{newglossaryentry}\mgroup{marrow}\mgroup{name=\mgroup{marrow}, - description=\mgroup{long vegetable with thin green skin and white flesh}, - \strong{\xtrfont{seealso}=\mgroup{courgette}}} -\end{alltt} -(The provided \cs{alsoname} definition may be removed.) +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 -\gls{smallcaps}: -\begin{alltt} -\cs{renewcommand}\mgroup{\ics{glsseeitemformat}}[1]\mgroup{\cs{textsc}\mgroup{\ics{glsentryname}\mgroup{\#1}}} -\end{alltt} -This will still produce the desired effect with \gls{glossaries-extra} for +\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 -\gls{glossaries-extra} v1.42. +\sty{glossaries-extra} v1.42. \bibglsnote -If you want to switch to \gls{bib2gls} then you first need to switch -to \gls{glossaries-extra}, as described above, but you now need the -\pkgopt*{record} option but no longer need the -\pkgopt+{false}{autoseeindex} option: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot},\xtrfont{stylemods}]\mgroup{glossaries-extra} -\end{alltt} +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 -\filetype{bib} format required by \gls{bib2gls}. -\begin{prompt} +\ext{bib} format required by \app{bib2gls}. +\begin{terminal} convertgls2bib sample-crossref.tex entries.bib -\end{prompt} -If you have at least v2.0 then \gls{convertgls2bib} will absorb the +\end{terminal} +If you have at least v2.0 then \app{convertgls2bib} will absorb the cross-referencing information supplied by: -\begin{verbatim} -\glssee{fruit}{pear,apple,banana} -\end{verbatim} -into the \texttt{fruit} definition: -\begin{alltt} -\atentry{entry}\mgroup{fruit, - see = \mgroup{pear,apple,banana}, - name = \mgroup{fruit}, - description = \mgroup{sweet, fleshy product of plant containing seed} +\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{alltt} -Now remove \cs{makeglossaries} and all the entry definition commands -(including \cs{glssee} from the preamble) and add: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries.bib] -\end{alltt} -Finally, replace \cs{printglossaries} with -\ics*{printunsrtglossaries}. The document build is now: -\begin{prompt} +\end{codebox} +Now remove \gls{makeglossaries} and all the entry definition commands +(including \gls{glssee} from the \idxf{documentpreamble}) 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{prompt} +\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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries.bib, - \strong{\xtrfont{selection}=\mgroup{recorded and deps and see}}] -\end{alltt} +\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 \gls{numberlist} for either -of these entries. Whereas marrow uses the \xtrgloskey{seealso} key, -which is typically intended as a supplement to a \gls{numberlist} -but in this case there are no locations as marrow hasn't been used +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{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries.bib, - \resourceopt{selection}=\mgroup{recorded and deps and see\strong{ not also}}] -\end{alltt} +\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} -\exitem{-newkeys} This document illustrates how add custom keys -(using \ics{glsaddkey}). There are two custom keys \texttt{ed}, where +\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 \texttt{ing}, where the default value is the \gloskey{text} +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 -\cs{glsaddkey*} is required to ensure that the default value is expanded on -definition if no alternative has been provided. +\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{verbatim} -\newglossaryentry{jump}{name={jump},description={}} - -\newglossaryentry{run}{name={run},% - ed={ran},% - ing={running}, - description={}} - -\newglossaryentry{waddle}{name={waddle},% - ed={waddled},% - ing={waddling},% - description={}} -\end{verbatim} +\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 -\cs{glsentrytext}, that allows the key value to be accessed, and -\cs{glstext} that allows the key value to be access with indexing +\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 \cs{glsdisp}. When editing the +you may find it simpler to just use \gls{glsdisp}. When editing the document source, it's usually simpler to read: -\begin{verbatim} -The dog \glsdisp{jump}{jumped} over the duck. -\end{verbatim} +\begin{codebox} +The dog \gls{glsdisp}\marg{jump}\marg{jumped} over the duck. +\end{codebox} than -\begin{verbatim} -The dog \glsed{jump} over the duck. -\end{verbatim} +\begin{codebox} +The dog \cmd{glsed}\marg{jump} over the duck. +\end{codebox} \bibglsnote -If you want to convert this document to use \gls{bib2gls}, you first -need to switch to \gls{glossaries-extra}, but remember that you need -the \pkgopt*{record} option: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}}]{\strong{glossaries-extra}} -\end{alltt} -Next convert the entry definitions to the \filetype{bib} format -required by \gls{bib2gls}: -\begin{prompt} -convertgls2bib -{}-index-conversion -{}-preamble-only sample-newkeys.tex entries.bib -\end{prompt} -The \texttt{-{}-index-conversion} switch requires at least v2.0 and +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 \ics{nopostdesc} or \ics*{glsxtrnopostpunc}) to +is simply \gls{nopostdesc} or \gls{glsxtrnopostpunc}) to \atentry{index} instead of \atentry{entry}. This means that the -new \nolinkurl{entries.bib} file will contain: -\begin{alltt} -\atentry{index}\mgroup{jump, - name = \mgroup{jump} +new \filefmt{entries.bib} file will contain: +\begin{codebox} +\atentry{index}\marg{jump, + \gloskeyval{name}{jump} } - -\atentry{index}\mgroup{run, - ing = \mgroup{running}, - name = \mgroup{run}, - ed = \mgroup{ran} +\codepar +\atentry{index}\marg{run, + ing = \marg{running}, + \gloskeyval{name}{run}, + ed = \marg{ran} } - -\atentry{index}\mgroup{waddle, - ing = \mgroup{waddling}, - name = \mgroup{waddle}, - ed = \mgroup{waddled} +\codepar +\atentry{index}\marg{waddle, + ing = \marg{waddling}, + \gloskeyval{name}{waddle}, + ed = \marg{waddled} } -\end{alltt} -Now replace \cs{makeglossaries} with -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries] -\end{alltt} -and delete the \cs{newglossaryentry} commands. Finally replace -\cs{printglossaries} with \ics*{printunsrtglossaries}. +\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{prompt} +\begin{terminal} pdflatex sample-newkeys bib2gls sample-newkeys pdflatex sample-newkeys -\end{prompt} -Note that there's no need for the \pkgopt{nonumberlist} package -option when you don't use \gls{bib2gls}['s] \texttt{-{}-group} +\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. -\exitem{-storage-abbr} This document illustrates how add custom -storage keys (using \cs{glsaddstoragekey}). The document build is: -\begin{prompt} +\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{prompt} - -The custom storage key is called \texttt{abbrtype} which defaults -to \texttt{word} if not explicitly set. Its value can be accessed -with the provided custom command \cs{abbrtype}. -\begin{alltt} -\ics{glsaddstoragekey}\mgroup{abbrtype}\mgroup{word}\mgroup{\cs{abbrtype}} -\end{alltt} -A custom abbreviation style is then defined that checks the value of +\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 \texttt{word}. +its value is the default \qt{word}. This essentially forms a very similar function to the -\gls{glossaries-extra} package's \xtrgloskey{category} key, which is +\sty{glossaries-extra} package's \gloskey{category} key, which is also defined as a storage key: -\begin{alltt} -\cs{glsaddstoragekey}\mgroup{category}\mgroup{general}\mgroup{\ics*{glscategory}} -\end{alltt} +\begin{codebox*} +\gls{glsaddstoragekey}\marg{\gloskey{category}}\marg{\cat{general}}\marg{\gls{glscategory}} +\end{codebox*} \glsxtrnote -This document is much simpler with the \gls{glossaries-extra} +This document is much simpler with the \sty{glossaries-extra} package: -\begin{alltt} -\cs{documentclass}\mgroup{article} -\cs{usepackage}[\xtrfont{postdot}]\mgroup{\strong{glossaries-extra}} -\cs{makeglossaries} -\ics*{setabbreviationstyle}[\strong{acronym}]\mgroup{short-long} -\ics{newacronym}\mgroup{radar}\mgroup{radar}\mgroup{radio detecting and ranging} -\ics{newacronym}\mgroup{laser}\mgroup{laser}\mgroup{light amplification by stimulated +\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} -\ics{newacronym}\mgroup{scuba}\mgroup{scuba}\mgroup{self-contained underwater breathing +\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing apparatus} - -\ics*{newabbreviation}\mgroup{dsp}\mgroup{DSP}\mgroup{digital signal processing} -\ics*{newabbreviation}\mgroup{atm}\mgroup{ATM}\mgroup{automated teller machine} - -\cs{begin}\mgroup{document} - -First use: \cs{gls}\mgroup{radar}, \cs{gls}\mgroup{laser}, \cs{gls}\mgroup{scuba}, \cs{gls}\mgroup{dsp}, -\cs{gls}\mgroup{atm}. - -Next use: \cs{gls}\mgroup{radar}, \cs{gls}\mgroup{laser}, \cs{gls}\mgroup{scuba}, \cs{gls}\mgroup{dsp}, -\cs{gls}\mgroup{atm}. - -\cs{printglossaries} -\cs{end}\mgroup{document} -\end{alltt} - -\exitem{-storage-abbr-desc} An extension of the previous example +\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. -\exitem{-chap-hyperfirst} This document illustrates how to add -a~custom key using \cs{glsaddstoragekey} and hook into the \glslike\ -and \glstextlike\ mechanism used to determine whether or not to -hyperlink an entry. +\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{prompt} +\begin{terminal} pdflatex sample-chap-hyperfirst makeglossaries sample-chap-hyperfirst pdflatex sample-chap-hyperfirst -\end{prompt} -This example creates a storage key called \texttt{chapter} used to store the chapter +\end{terminal} +This example creates a storage key called \qt{chapter} used to store the chapter number. -\begin{alltt} -\ics{glsaddstoragekey}\mgroup{\strong{chapter}}\mgroup{0}\mgroup{\strong{\cs{glschapnum}}} -\end{alltt} -It's initialised to 0 and the \ics{glslinkpostsetkeys} hook is used +\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 hyperlink is switched off, otherwise -the key value is updated unless the hyperlink has been switched off -(through the optional argument of commands like \cs{gls} and \cs{glstext}). -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics{glslinkpostsetkeys}}\mgroup{\% - \cs{edef}\cs{currentchap}\mgroup{\cs{arabic}\mgroup{chapter}}\% - \cs{ifnum}\cs{currentchap}=\strong{\cs{glschapnum}}\mgroup{\cs{glslabel}}\cs{relax} - \cs{setkeys}\mgroup{glslink}\mgroup{hyper=false}\% - \cs{else} - \ics{glsifhyperon}\mgroup{\ics{glsfieldxdef}\mgroup{\cs{glslabel}}\mgroup{\strong{chapter}}\mgroup{\cs{currentchap}}}\mgroup{}\% - \cs{fi} +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{alltt} -Since this key isn't intended for use when the entry is being +\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 -\ics{glsfieldxdef} requires the existence of the field. The -\gls{glossaries-extra} package provides utility commands designed to +\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 \gls{glossaries-extra} you need to change +If you want to switch to \sty{glossaries-extra} you need to change the package loading line: -\begin{alltt} -\cs{usepackage}[\xtrfont{postdot}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -The custom storage key (provided with \cs{glsaddstoragekey}) can be -removed, and the \ics{glslinkpostsetkeys} hook can be changed to: -\begin{alltt} -\cs{renewcommand}*\mgroup{\ics{glslinkpostsetkeys}}\mgroup{\% - \cs{edef}\cs{currentchap}\mgroup{\cs{arabic}\mgroup{chapter}}\% - \strong{\ics*{GlsXtrIfFieldEqNum}*}\mgroup{\strong{chapter}}\mgroup{\cs{glslabel}}\mgroup{\cs{currentchap}} - \mgroup{\% - \cs{setkeys}\mgroup{glslink}\mgroup{hyper=false}\% - }\% - \mgroup{% - \ics{glsifhyperon}\mgroup{\strong{\ics*{xGlsXtrSetField}}\mgroup{\cs{glslabel}}\mgroup{\strong{chapter}}\mgroup{\cs{currentchap}}}\mgroup{}\% - }% +\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{alltt} -The field name is still called \texttt{chapter} but there's no +\end{codebox} +The field name is still called \qt{chapter} but there's no longer an associated key or command. -\section{Xindy (Option 3)} +\section{Xindy (Option \glsfmttext{idx.opt.xdy})} \label{sec:samplesxindy} -Most of the earlier \gls{makeindex} sample files can be adapted to -use \gls{xindy} instead by adding the \pkgopt{xindy} package option. +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 \verb|name={\pi}|) or is identical -to another value (or is identical after \gls{xindy} has stripped all +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 \gls{makeindex}. +use features which are unavailable with \app{makeindex}. -\exitem{xdy} The document uses UTF8 encoding (with the +\filedef{samplexdy.tex} +The document uses \idx{utf8} \idx{encoding} (with the \sty{inputenc} package). This is information that needs to be passed -to \gls{xindy}, so the encoding is picked up by \gls{makeglossaries} -from the \filetype{aux} file. - -By default, this document will create a \gls{xindy} style file called -\nolinkurl{samplexdy.xdy}, but if you uncomment the lines -\begin{verbatim} -\setStyleFile{samplexdy-mc} -\noist -\GlsSetXdyLanguage{} -\end{verbatim} -it will set the style file to \texttt{samplexdy-mc.xdy} instead. -This provides an additional letter group for entries starting with -\qt{Mc} or \qt{Mac}. If you use \gls{makeglossaries} or -\gls{makeglossaries-lite.lua}, you don't +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 -\gls*{makeglossaries}, you will need to specify the required +\app{makeglossaries}, you will need to specify the required information. Note that if you set the style file to -\nolinkurl{samplexdy-mc.xdy} you must also specify \ics{noist}, -otherwise the \styfmt{glossaries} package will overwrite -\nolinkurl{samplexdy-mc.xdy} and you will lose the \qt{Mc} letter -group. +\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{prompt} +\begin{terminal} pdflatex samplexdy makeglossaries samplexdy pdflatex samplexdy -\end{prompt} +\end{terminal} If you don't have Perl installed then you can't use -\gls{makeglossaries}, but you also can't use \gls{xindy}! +\app{makeglossaries}, but you also can't use \app{xindy}! However, if for some reason you want to call -\gls{xindy} explicitly instead of using \gls{makeglossaries} (or -\gls{makeglossaries-lite.lua}): +\app{xindy} explicitly instead of using \app{makeglossaries} (or +\app{makeglossaries-lite}): \begin{itemize} -\item if you are using the default style file \nolinkurl{samplexdy.xdy}, then +\item if you are using the default style file \filefmt{samplexdy.xdy}, then do (no line breaks): -\begin{prompt} -xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo -\end{prompt} -\item if you are using \nolinkurl{samplexdy-mc.xdy}, then do +\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{prompt} -xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo -\end{prompt} +\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 -\gloskey[glslink]{format} key in the optional argument of commands -like \cs{gls} to format the location in the \gls{numberlist}. +\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 \csmeta{hyper}{xx}{} commands listed in +should use one of the \csmetafmt{hyper}{xx}{} commands listed in \tableref{tab:hyperxx}: -\begin{verbatim} -\newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}} -\end{verbatim} +\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 \texttt{hyperbfit} is used in the -\gloskey[glslink]{format} key. It does, however, need to be -identified as an attribute so that \gls{xindy} can recognise it: -\begin{verbatim} -\GlsAddXdyAttribute{hyperbfit} -\end{verbatim} -This will add information to the \filetype{xdy} file when it's -created by \cs{makeglossaries}. If you prevent the creation of this -file with \ics{noist} then you will need to add the attribute to -your custom \filetype{xdy} file (see the provided -\nolinkurl{samplexdy-mc.xdy} file). +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 \cs{tallynum}\marg{n} that represents its +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{verbatim} -\newrobustcmd*{\tallynum}[1]{% - \ifnum\number#1<7 - $\csname dice\romannumeral#1\endcsname$% - \else - $\dicevi$% - \expandafter\tallynum\expandafter{\numexpr#1-6}% - \fi +\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{verbatim} +\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 \ics{dicei}, -\ldots, \cs{dicevi} commands are provided by the \sty{stix} +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 \cs{tally}\marg{counter} is defined that +An associated command \csfmt{tally}\margm{counter} is defined that formats the value of the named \meta{counter} according to -\cs{tallynum}: -\begin{verbatim} -\newcommand*{\tally}[1]{\tallynum{\arabic{#1}}} -\end{verbatim} +\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 \ics{thepage}). +The page numbers are altered to use this format (by redefining \gls{thepage}). This custom location format also needs to be identified in the -\filetype{xdy} file so that \gls{xindy} can recognise it and +\ext{xdy} file so that \app{xindy} can recognise it and determine how to form ranges if required. -\begin{verbatim} -\GlsAddXdyLocation{tally}{% tally location format - :sep "\string\tallynum\space\glsopenbrace" +\begin{codebox*} +\gls{GlsAddXdyLocation}\marg{tally}\marg{\comment{tally location format} + :sep "\cmd{string}\cmd{tallynum}\gls{space}\gls{glsopenbrace}" "arabic-numbers" - :sep "\glsclosebrace" + :sep "\gls{glsclosebrace}" } -\end{verbatim} -Again this information is written to the \filetype{xdy} file by -\cs{makeglossaries} so if you use \cs{noist} then you need to -manually add it to your custom \filetype{xdy} file. - -When \gls{xindy} creates the associated glossary files, the -locations will be written using: -\begin{alltt} -\csmetameta{glsX}{counter}{X}{format}{}\marg{hyper-prefix}\marg{location} -\end{alltt} +\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{alltt} -\cs{glsXpageXglsnumberformat}\mgroup{}\mgroup{\cs{tallynum}\marg{number}} -\end{alltt} +\begin{codebox} +\glsXcounterXformat{page}{glsnumberformat}\marg{}\marg{\cmd{tallynum}\margm{number}} +\end{codebox} or -\begin{alltt} -\cs{glsXpageXhyperbfit}\mgroup{}\mgroup{\cs{tallynum}\marg{number}} -\end{alltt} -This means that although \cs{hyperbf} is designed to create -hyperlinked locations, the presence of \cs{tallynum} interferes with +\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 hyperlinks work correctly, the definitions of -\cs{glsXpageXhyperbfit} need to be redefined in order to grab the +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 \cs{tally} is changed so that it expands differently +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 \cs{tally}\marg{n}: -\begin{verbatim} -\renewcommand{\glsXpageXglsnumberformat}[2]{% - \linkpagenumber#2% +form \code{\csfmt{tally}\margm{n}}: +\begin{codebox} +\cmd{renewcommand}\marg{\glsXcounterXformat{page}{glsnumberformat}}[2]\marg{\comment{} + \cmd{linkpagenumber}\#2\comment{} } -\renewcommand{\glsXpageXhyperbfit}[2]{% - \textbf{\em\linkpagenumber#2}% +\cmd{renewcommand}\marg{\glsXcounterXformat{page}{hyperbfit}}[2]\marg{\comment{} + \cmd{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\#2}\comment{} } -\end{verbatim} +\end{codebox} These need a command that can grab the actual number and correctly encapsulate it: -\begin{verbatim} -\newcommand{\linkpagenumber}[2]{\hyperlink{page.#2}{#1{#2}}} -\end{verbatim} +\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 \nolinkurl{samplexdy-mc.xdy} file, the +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} letter group. Ideally it should be possible to do this -simply with \ics{GlsAddLetterGroup} (and not require a custom -\filetype{xdy} file) but unfortunately the \qt{M} letter -group 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{verbatim} -\setStyleFile{samplexdy-mc} -\noist -\GlsSetXdyLanguage{} -\end{verbatim} - -This \qt{Mc} group is suitable for names like +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{verbatim} -\newglossaryentry{mach}{name={Mach, Ernst}, -first={Ernst Mach},text={Mach}, -sort={mach, Ernst}, -description={Czech/Austrian physicist and philosopher}} -\end{verbatim} +\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 \gls{bib2gls}, -you first need to switch to \gls{glossaries-extra} and use the -\pkgopt*{record} package option: -\begin{alltt} -\cs{usepackage}[\strong{\xtrfont{record}},\xtrfont{postdot}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -The \gls{xindy}-only commands can now all be removed -(attribute \cs{GlsAddXdyAttribute}, location \cs{GlsAddXdyLocation}, -language \cs{GlsSetXdyLanguage}, location encapsulators -\csmetameta{glsX}{counter}{X}{format}{} -and the custom helper \cs{linkpagenumber}). -Also \cs{noist} and \cs{setStyleFile} aren't relevant with -\gls{bib2gls} and so should be removed. - -The definitions of \cs{hyperbfit} should be retained (as well as -\cs{tallynum}, \cs{tally} and the redefinition of \cs{thepage}). - -The entries all need to be converted to the \filetype{bib} format -required by \gls{bib2gls}. -\begin{prompt} -convertgls2bib -{}-preamble-only samplexdy.tex entries.bib -\end{prompt} -Next replace \cs{makeglossaries} with: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries] -\end{alltt} -and remove all the entry definitions from the preamble. Use the +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{documentpreamble}. Use the search and replace function on your text editor to replace all -instances of \ics{glsentryfirst} with \ics*{glsfmtfirst}, and all -instances of \ics{glsentryname} with \ics*{glsfmtname}. +instances of \gls{glsentryfirst} with \gls{glsfmtfirst}, and all +instances of \gls{glsentryname} with \gls{glsfmtname}. -Finally, replace \ics{printglossaries} with \ics*{printunsrtglossaries}. +Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}. The document build is now: -\begin{prompt} +\begin{terminal} pdflatex samplexdy -bib2gls -{}-group samplexdy +bib2gls \switch{group} samplexdy pdflatex samplexdy -\end{prompt} +\end{terminal} This results in a slightly different ordering from the original -document (without the \qt{Mc} letter group). In 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 \gls{bib2gls}['s] default -\resourceopt[word]{break-at} setting, which marks word boundaries -with the pipe (\texttt{|}) character, so the sort values for -\gls{bib2gls} are \texttt{Mach|Earnest|} and \texttt{Mach|number|}. -See the \gls{bib2gls} manual for further details of this option, and +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} letter group, it can be obtained by +If you want the \qt{Mc} \idx{lettergroup}, it can be obtained by providing a custom sort rule: -\begin{alltt} -\ics*{GlsXtrLoadResources}[\resourceopt{src}=entries, - \resourceopt{sort}=\strong{custom}, - \strong{\xtrfont{sort-rule}}=\mgroup{\ics*{glsxtrcontrolrules} - ;\ics*{glsxtrspacerules};\ics*{glsxtrnonprintablerules} - ;\ics*{glsxtrcombiningdiacriticrules},\ics*{glsxtrhyphenrules} - <\ics*{glsxtrgeneralpuncrules}<\ics*{glsxtrdigitrules} - > BDC @@ -19418,8 +33880,8 @@ content like: ET EMC \end{verbatim} -This shows that \qt{ActualText} was used for \verb|\gls{Doctor}|. -The integral symbol ($\int$) created with \verb|\glssymbol{int}| is: +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 @@ -19430,7 +33892,7 @@ The integral symbol ($\int$) created with \verb|\glssymbol{int}| is: EMC \end{verbatim} Again, \qt{ActualText} has been used, but the character code has -been supplied. The image created with \verb|\glsuseri{sampleimage}| is: +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 @@ -19445,7 +33907,7 @@ EMC \end{verbatim} This shows that \qt{Alt} has been used. -The first use of \verb|\gls{eg}| produces the long form (not +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 @@ -19466,236 +33928,238 @@ The subsequent use also has the \qt{E} element: ET EMC \end{verbatim} -Similarly for \verb|\acrshort{eg}|. You can also use the -\pkgopt[showaccsupp]{debug} package option. This will show the +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 \cs{BeginAccSupp}. +it's processed by \gls{BeginAccSupp}. -If the \ics{setacronymstyle} command is removed (or commented out) -then the result would be different. The \gls{firstuse} of \cs{gls} uses \qt{E} for +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 \ics{setacronymstyle} the original acronym +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 \ics{setacronymstyle}. +acronym mechanism that's triggered with \gls{setacronymstyle}. \begin{important} If you want to convert this example so that it uses -\gls{glossaries-extra}, make sure you have at least version 1.42 of +\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 -\gls{glossaries-extra}, you need to replace the explicit loading of +\sty{glossaries-extra}, you need to replace the explicit loading of \sty{glossaries-accsupp} with an implicit load through the -\pkgopt*{accsupp} package option: -\begin{alltt} -\cs{usepackage}[\xtrfont{abbreviations},\strong{\xtrfont{accsupp}}]\mgroup{\strong{glossaries-extra}} -\end{alltt} -I'm switching from \ics{newacronym} to \ics*{newabbreviation}, which +\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 \gls{makeglossaries} -or \gls{makeglossaries-lite.lua} you don't need to worry about it. +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 \texttt{\cs{setacronymstyle}\mgroup{long-short}} needs +The style command \code{\gls{setacronymstyle}\marg{\acrstyle{long-short}}} needs to be replaced with: -\begin{alltt} -\ics{setabbreviationstyle}\mgroup{long-short} -\end{alltt} +\begin{codebox} +\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}} +\end{codebox} This is actually the default so you can simply delete the -\cs{setacronymstyle} line. Substitute the two instances of -\ics{newacronym} with \ics*{newabbreviation}. For example: -\begin{alltt} -\strong{\ics*{newabbreviation}}\mgroup{eg}\mgroup{e.g.}\mgroup{for example} -\end{alltt} -Note that for the \texttt{tikz} entry you can now remove the explicit assignment of -\gloskey{shortaccess} with \gls{glossaries-extra} v1.42 as it will -strip formatting commands like \cs{emph}: -\begin{alltt} -\ics*{newabbreviation} - \mgroup{tikz}\mgroup{Ti\cs{emph}\mgroup{k}Z}\mgroup{Ti\cs{emph}\mgroup{k}Z ist \cs{emph}\mgroup{kein} Zeichenprogramm} -\end{alltt} -It's also necessary to replace \cs{acrshort}, \cs{acrlong} and \cs{acrfull} with -\ics*{glsxtrshort}, \ics*{glsxtrlong} and \ics*{glsxtrfull}. - -You may notice a slight difference from the original example. The -\gloskey{shortaccess} field now shows \meta{long} (\meta{short}) -instead of just \meta{long}. This is because \gls{glossaries-extra} -redefines \ics{glsdefaultshortaccess} to include the short form. +\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 -abbreviations but they shouldn't be expanded on first use. The +\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{alltt} -\ics{newacronym}\mgroup{Doctor}\mgroup{Dr}\mgroup{Doctor} -\end{alltt} -The \gls{firstuse} of \verb|\gls{Doctor}| is just \qt{Dr}. This -means that the \qt{E} element will be used instead of \qt{ActualText}. +\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} entry can be similarly defined but it has the awkward +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{verbatim} -\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive} -\end{verbatim} +\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 -\attr{discardperiod} attribute, but I need to assign a different -category so that it doesn't interfere with the \qt{Doctor} entry. +\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 -\gls{glossaries-extra}). - -In this case, I've decided to have a category called \texttt{shortdotted} -to indicate an abbreviation that ends with a -dot but only the short form is shown on \gls{firstuse}: -\begin{alltt} -\ics*{setabbreviationstyle}[shortdotted]\mgroup{short-nolong-noreg} -\ics*{glssetcategoryattribute}\mgroup{shortdotted}\mgroup{discardperiod}\mgroup{true} -\ics*{newabbreviation}[category=shortdotted]\mgroup{Drive}\mgroup{Dr.\cs{@}}\mgroup{Drive} -\end{alltt} +\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 -\attr{insertdots} attribute to automatically insert the dots and add -the space factor (which is adjusted if \attr{discardperiod} discards +\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 \ics{@} in case the abbreviation is used +added the space factor with \gls{cs.at} in case the \idx{abbreviation} is used mid-sentence. For example: -\begin{verbatim} -\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}. Next sentence. - -\gls{Doctor} Smith lives at 2, Blueberry \gls{Drive} end of sentence. -\end{verbatim} +\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 \cs{ttfamily}.) +font with \cmd{ttfamily}.) -The \qt{e.g.}\ abbreviation similarly ends with a dot. It's not +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 \texttt{shortdotted} category, but it has a +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{alltt} -\ics*{setabbreviationstyle}[longshortdotted]\mgroup{long-short} -\ics*{glssetcategoryattribute}\mgroup{longshortdotted}\mgroup{discardperiod}\mgroup{true} -\ics*{newabbreviation}[category=longshortdotted]\mgroup{e.g.}\mgroup{e.g.\cs{@}}\mgroup{for -example} -\end{alltt} - -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 -\cs{glssymbolaccsupp} and \cs{glsuseriaccsupp} commands won't be -used. I can't deal with both cases if I just provide -\cs{glsnameaccsupp}. - -I could provide category-field versions, such as -\xtrfont{\cs{glsxtrsymbolnameaccsupp}}, but remember that this only covers +\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 \csmeta*{glsxtr}{category}{accsupp} version: -\begin{alltt} -\cs{newcommand}\mgroup{\xtrfont{\cs{glsxtr\strong{symbol}accsupp}}}[2]\mgroup{\% - \ics{glsaccessibility}[method=hex,unicode]\mgroup{ActualText}\mgroup{\#1}\mgroup{#2}\% +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{} } -\cs{newcommand}\mgroup{\xtrfont{\cs{glsxtr\strong{image}accsupp}}}[2]\mgroup{\% - \ics{glsaccessibility}\mgroup{Alt}\mgroup{\#1}\mgroup{\#2}\% +\cmd{newcommand}\marg{\glsxtrcategoryaccsupp{\strong{image}}}[2]\marg{\comment{} + \gls{glsaccessibility}\marg{Alt}\marg{\#1}\marg{\#2}\comment{} } - -\cs{newglossaryentry}\mgroup{int}\mgroup{\strong{\xtrfont{category}=symbol}, - \strong{name}=\mgroup{\cs{ensuremath}\mgroup{\cs{int}}},\strong{access}=\mgroup{222B}, - description=\mgroup{integral} +\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} } - -\cs{newglossaryentry}\mgroup{sampleimage}\mgroup{\strong{\xtrfont{category}=image}, - description=\mgroup{an example image}, - \strong{name}=\mgroup{\cs{protect}\cs{includegraphics}[height=20pt]\mgroup{example-image}}, - \strong{access}=\mgroup{a boilerplate image used in examples} +\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{alltt} +\end{codebox} If it's necessary to provide support for additional fields, then the -category-field command \csmetameta*{glsxtr}{category}{}{field}{accsupp} could be used to -override the more general category command \csmeta*{glsxtr}{category}{accsupp}. +category+field command \gls{glsxtrcategoryfieldaccsupp} could be used to +override the more general category command \gls{glsxtrcategoryaccsupp}. -\exitem{-ignored} This document defines an ignored glossary for +\filedef{sample-ignored.tex} +This document defines an \idx{ignoredglossary} for common terms that don't need a definition. The document build is: -\begin{prompt} +\begin{terminal} pdflatex sample-ignored makeglossaries sample-ignored pdflatex sample-ignored -\end{prompt} -A new \qt{ignored} glossary is defined with: -\begin{alltt} -\ics{newignoredglossary}\mgroup{common} -\end{alltt} -There are no associated files with an ignored glossary. An entry is defined with -this as its glossary type: -\begin{verbatim} -\newglossaryentry{commonex}{type=common,name={common term}} -\end{verbatim} +\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 \cs{gls} (which is useful for consistent +may be referenced with \gls{gls} (which is useful for consistent formatting) but it won't be indexed. -\exitem{-entrycount} This document uses \ics{glsenableentrycount} -and \ics{cgls} (described in \sectionref{sec:enableentrycount}) +\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{prompt} +\begin{terminal} pdflatex sample-entrycount pdflatex sample-entrycount makeglossaries sample-entrycount pdflatex sample-entrycount -\end{prompt} -Note the need to call \LaTeX\ twice before \gls{makeglossaries}, and +\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 \gls{glossaries-extra} package has additions that extend this +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 \gls{bib2gls} you can use record counting instead. -See the \gls{bib2gls} manual for further details. +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 \styfmt{glossaries} package comes with some minimal example -files, \texttt{minimalgls.tex}, \texttt{mwe-gls.tex}, -\texttt{mwe-acr.tex} and \texttt{mwe-acr-desc.tex}, which can be -used for testing. These should be located in the \texttt{samples} -subdirectory (folder) of the \styfmt{glossaries} documentation +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 my Linux partition it can -be found in \texttt{/usr\slash local\slash texlive\slash -2014\slash texmf-dist\slash doc\slash latex\slash glossaries/}. -The \gls{makeglossariesgui} application can also be used to test for +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 -\urlfootref{http://www.dickimaw-books.com/faqs/glossariesfaq.html}{\styfmt{glossaries} FAQ}. If that +\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 @@ -19703,6 +34167,18 @@ doesn't help, try posting your query to somewhere like the Bug reports can be submitted via \urlfootref{https://www.dickimaw-books.com/bug-report.html}{my package bug report form}. -\PrintIndex + +\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} diff --git a/macros/latex/contrib/glossaries/glossaries.dtx b/macros/latex/contrib/glossaries/glossaries.dtx index 5c71fbc95a..1d44c808c2 100644 --- a/macros/latex/contrib/glossaries/glossaries.dtx +++ b/macros/latex/contrib/glossaries/glossaries.dtx @@ -1,29 +1,30 @@ %\iffalse % glossaries.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -comment ".*\.perl" +% -section "section" +% -author "Nicola Talbot" +% -setambles ".*\.tex=>\nopreamble\nopostamble" +% -setambles ".*\.l2h=>\nopreamble\nopostamble" % -comment ".*\.tex" -% -src "glossaries\.sty\Z=>glossaries.sty" -% -src "glossaries-prefix.sty\Z=>glossaries-prefix.sty" -% -src "(glossary-.+)\.(sty)\Z=>\1.\2" -% -src "(glossaries-compatible-207)\.(sty)\Z=>\1.\2" -% -src "(glossaries-compatible-307)\.(sty)\Z=>\1.\2" -% -src "(glossaries-accsupp)\.(sty)\Z=>\1.\2" -% -src "(glossaries-babel)\.(sty)\Z=>\1.\2" -% -src "(glossaries-polyglossia)\.(sty)\Z=>\1.\2" +% -comment ".*\.l2h" +% -doc "glossaries-manual.tex" +% -codetitle "Main Package Code (glossaries.sty)" +% -src "(glossaries\.sty)\Z=>\1" +% -src "(glossary-[a-z]+\.sty)\Z=>\1" +% -src "(glossaries-babel\.sty)\Z=>\1" +% -src "(glossaries-polyglossia\.sty)\Z=>\1" +% -src "(glossaries-prefix.sty)\Z=>\1" +% -src "(glossaries-accsupp\.sty)\Z=>\1" +% -src "(glossaries-compatible-207\.sty)\Z=>\1" +% -src "(glossaries-compatible-307\.sty)\Z=>\1" +% -src "(glossar.*-2020-03-19\.sty)\Z=>\1" +% -src "(glossar.*-2021-11-01\.sty)\Z=>\1" % -src "(example-glossaries-.*\.tex)\Z=>\1" -% -src "(glossaries-2020-03-19\.sty)\Z=>\1" -% -src "(.*\.perl)\Z=>\1" -% -codetitle "Main Package Code" -% -macrocode ".*\.perl" +% -src "(glossaries\.l2h)\Z=>\1" % -macrocode ".*\.tex" -% -author "Nicola Talbot" -% -doc "glossaries-manual.tex" -% -setambles ".*\.perl=>\nopreamble\nopostamble" -% -setambles ".*\.tex=>\nopreamble\nopostamble" -% -section "chapter" +% -macrocode ".*\.l2h" % glossaries -% Created on 2021/11/1 18:45 +% Created on 2022/10/17 16:00 %\fi %\iffalse %<*package> @@ -46,133 +47,87 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 2021 Nicola Talbot, all rights reserved. +% Copyright (C) 2022 Nicola Talbot, all rights reserved. % \fi % \iffalse %<*driver> -\documentclass[report]{nlctdoc} - -\DeleteShortVerb{|} - \iffalse glossaries-manual.tex is a stub file used by makedtx to create glossaries.dtx \fi -\usepackage{alltt} -\usepackage{pifont} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage[colorlinks, - bookmarks, - hyperindex=false, - pdfauthor={Nicola L.C. Talbot}, - pdftitle={glossaries.sty: LaTeX2e Package to Assist Generating Glossaries}, - pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref} -\usepackage{glossaries-extra} - -\RecordChanges -\setlength\IndexMin{100pt} - -\makeglossaries - -\renewcommand*{\main}[1]{\underline{\hyperpage{#1}}} -\renewcommand*{\usage}[1]{\textit{\hyperpage{#1}}} -\newcommand*{\htextbf}[1]{\textbf{\hyperpage{#1}}} -\newcommand*{\itermdef}[1]{\index{#1|htextbf}} - -\newglossaryentry{xindy}{ - name={\appfmt{xindy}\index{xindy|htextbf}}, - sort={xindy}, - text={\protect\app{xindy}}, - description={An flexible indexing application with multilingual - support written in Perl} -} - -\newglossaryentry{makeindex}{% - name={\appfmt{makeindex}\index{makeindex|htextbf}},% - sort={makeindex},% - text={\protect\app{makeindex}},% - description={An indexing application}, -} +\documentclass{article} -\let\glsd\glsuseri -\let\glsation\glsuserii - -\newglossaryentry{firstuse}{% - name={First use\ifirstuse}, - sort={first use},% - text={first use},% - user1={first used}, - description={The first time a glossary entry is used (from the start - of the document or after a reset) with one of the - following commands: \ics{gls}, \ics{Gls}, \ics{GLS}, \ics{glspl}, - \ics{Glspl}, \ics{GLSpl} or \ics{glsdisp}. - \glsseeformat{firstuseflag,firstusetext}{}\nopostdesc}% -} - -\newglossaryentry{firstuseflag}{% -name={First use flag\ifirstuseflag}, -sort={first use flag},% -text={first use flag},% -description={A conditional that determines whether or not the entry -has been used according to the rules of \gls{firstuse}}% -} - -\newglossaryentry{firstusetext}{% -name={First use text\ifirstusetext}, -sort={first use text},% -text={first use text},% -description={The text that is displayed on \gls{firstuse}, which is -governed by the \gloskey{first} and \gloskey{firstplural} keys of -\ics{newglossaryentry}. (May be overridden by -\ics{glsdisp}.)\nopostdesc}% -} - -\doxitem{Option}{option}{package options} -\doxitem{GlsKey}{key}{glossary keys} -\doxitem{Style}{style}{glossary styles} -\doxitem{Counter}{counter}{glossary counters} -\doxitem{AcrStyle}{acrstyle}{acronym styles} +\usepackage{doc} +\CheckSum{58550} +\RecordChanges +\PageIndex +\SetupDoc{reportchangedates} \setcounter{IndexColumns}{2} -\CheckSum{34319} - -\newcommand*{\ifirstuse}{\iterm{first use}} -\newcommand*{\firstuse}{\gls{firstuse}} -\newcommand*{\firstuseflag}{\gls{firstuseflag}} -\newcommand*{\firstusetext}{\gls{firstusetext}} - -\newcommand*{\ifirstuseflag}{\iterm{first use>flag}} -\newcommand*{\ifirstusetext}{\iterm{first use>text}} - -\newcommand*{\istkey}[1]{\appfmt{#1}\index{makeindex=\appfmt{makeindex}>#1=\texttt{#1}|hyperpage}} -\newcommand*{\locfmt}[1]{\texttt{#1}\SpecialMainIndex{#1}} -\newcommand*{\mkidxspch}{\index{makeindex=\appfmt{makeindex}>special characters|hyperpage}} - -\newcommand*{\igloskey}[2][newglossaryentry]{\icsopt{#1}{#2}} -\newcommand*{\gloskey}[2][newglossaryentry]{\csopt{#1}{#2}} - -\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles:>#1={\protect\ttfamily#1}|main}} - +\usepackage[T1]{fontenc} +\usepackage{tcolorbox} + +\definecolor{defbackground}{rgb}{1,1,0.75} + +\newtcolorbox{definition}{halign=flush left, + colframe=black,colback=defbackground, + fontupper=\ttfamily, + before upper={\frenchspacing\obeylines}, + after={\par\noindent\ignorespacesafterend} +} + +\NewDocElement{Option}{option} +\NewDocElement{AcrStyle}{acrstyle} +\NewDocElement{Style}{style} +\NewDocElement{Counter}{counter} +\NewDocElement{Key}{key} + +\newcommand{\sty}[1]{\textsf{#1}} +\newcommand{\cls}[1]{\textsf{#1}} +\newcommand{\app}[1]{\texttt{#1}} +\newcommand{\ctr}[1]{\textsf{#1}} +\newcommand{\env}[1]{\textsf{#1}} +\newcommand{\glostyle}[1]{\textsf{#1}} +\newcommand{\pkgoptfmt}[1]{\textsf{#1}} +\newcommand{\pkgopt}[2][]{\pkgoptfmt{#2\ifstrempty{#1}{}{=#1}}} +\newcommand{\gloskey}[2][]{\textsf{#2}} +\newcommand{\filetype}[1]{\texttt{#1}} +\newcommand{\istkey}[1]{\texttt{#1}} +\newcommand{\term}[1]{\emph{#1}} +\newcommand{\qt}[1]{``#1''} + +\providecommand\marg[1]{% + \texorpdfstring{\allowbreak{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} + {\{#1\}}} +\providecommand\oarg[1]{% + \texorpdfstring{\allowbreak{\ttfamily[}\meta{#1}{\ttfamily]}} + {[#1]}} + +\providecommand\parg[1]{\texorpdfstring{(\meta{#1})}{(#1)}} \begin{document} \DocInput{glossaries.dtx} \end{document} % %\fi +%\DeleteShortVerb{|} %\MakeShortVerb{"} % -% \title{Documented Code For glossaries v4.49} +% \title{Documented Code For glossaries v4.50} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2021-11-01} +% \date{2022-10-14} % \maketitle % -%This is the documented code for the \styfmt{glossaries} package. +%\tableofcontents +% +%\section{Introduction} +% +%This is the documented code for the \sty{glossaries} package. %This bundle comes with the following documentation: %\begin{description} %\item[\url{glossariesbegin.pdf}] @@ -185,7 +140,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %glossaries package}. % %\item[\url{glossaries-user.pdf}] -%For the main user guide, read \qt{glossaries.sty v4.49: +%For the main user guide, read \qt{glossaries.sty v4.50: %\LaTeX2e\ Package to Assist Generating Glossaries}. % %\item[\url{mfirstuc-manual.pdf}] @@ -194,7 +149,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % %\item[glossaries-code.pdf] %This document is for advanced users wishing to know more about the -%inner workings of the \styfmt{glossaries} package. +%inner workings of the \sty{glossaries} package. % %\item[INSTALL] Installation instructions. % @@ -205,7 +160,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %\end{description} % %The user level commands described in the user manual -%(glossaries-user.pdf) may be considered ``future-proof''. Even if +%(glossaries-user.pdf) may be considered \qt{future-proof}. Even if %they become deprecated, they should still work for %old documents (although they may not work in a document that also %contains new commands introduced since the old commands were @@ -216,39 +171,38 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %change. If you want a new user level command, you can post a feature %request at \url{http://www.dickimaw-books.com/feature-request.html}. %If you are a package writer wanting to integrate your package with -%\styfmt{glossaries}, it's better to request a new user level command +%\sty{glossaries}, it's better to request a new user level command %than to hack these internals. % -%\tableofcontents -% %\StopEventually{% -% \printglossaries +% \clearpage % \PrintChanges +% \clearpage % \PrintIndex %} % % % -%\chapter{Main Package Code} +%\section{Main Package Code (glossaries.sty)} %\iffalse % \begin{macrocode} %<*glossaries.sty> % \end{macrocode} %\fi %\label{sec:code} -% \section{Package Definition} -% This package requires \LaTeXe. +%\subsection{Package Definition} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} % \end{macrocode} % Rollback releases: % \begin{macrocode} \DeclareRelease{v4.46}{2020-03-19}{glossaries-2020-03-19.sty} -\DeclareCurrentRelease{v4.49}{2021-11-01} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} % Declare package: % \begin{macrocode} -\ProvidesPackage{glossaries}[2021/11/01 v4.49 (NLCT)] +\ProvidesPackage{glossaries}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} %\changes{4.18}{2015-09-09}{split mfirstuc into separate bundle} % Required packages: @@ -257,13 +211,123 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} % \end{macrocode} +%\begin{macro}{\glssentencecase} +%\changes{4.50}{2022-10-14}{new} +%Provided to allow user to switch to \cs{MFUsentencecase} if +%preferred. Don't redefine \cs{glsmakefirstuc} to \cs{makefirstuc} +%as it will result in infinite recursion. +% \begin{macrocode} +\newcommand{\glssentencecase}[1]{\makefirstuc{#1}} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\ExplSyntaxOn +% \end{macrocode} +%\begin{macro}{\glslowercase} +%\changes{4.50}{2022-10-14}{new} +%Provided to make it easier for user to use \LaTeX3 lowercase +%command without switching to exp3 syntax. For example, to redefine +%\cs{acronymfont} to automatically convert to lowercase. +% \begin{macrocode} +\newcommand{\glslowercase}[1]{\text_lowercase:n{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsuppercase} +%\changes{4.50}{2022-10-14}{new} +%Note that this isn't using \cs{mfirstucMakeUppercase}, which will be +%defined to use the robust \cs{MakeUppercase} if an old version of +%\sty{mfirstuc} is installed. +% \begin{macrocode} +\newcommand{\glsuppercase}[1]{\text_uppercase:n{#1}} +% \end{macrocode} +%\end{macro} +% +%Check if we have \sty{mfirstuc} v2.08+. In which case, don't +%redefine \cs{mfirstucMakeUppercase}. Since \cs{MFUsentencecase} was +%new in v2.08, the simplest check is to test for the existence of that +%command. +% \begin{macrocode} +\ifdef\MFUsentencecase +{% +% \end{macrocode} +% Automatically identify exclusions, blockers and mappings. +%\begin{macro}{\glsmfuexcl} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} + \newcommand{\glsmfuexcl}[1]{\MFUexcl{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsmfublocker} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} + \newcommand{\glsmfublocker}[1]{\MFUblocker{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsmfuaddmap} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} + \newcommand{\glsmfuaddmap}[2]{\MFUaddmap{#1}{#2}} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +} +{ +% \end{macrocode} %\changes{3.11a}{2013-10-15}{Now requires textcase} -% The \sty{textcase} package has much better case changing handling, -% so use \cs{MakeTextUppercase} instead of \cs{MakeUppercase} +%\changes{4.50}{2022-10-14}{No longer requires textcase with mfirstuc 2.08+} +% The \sty{textcase} package is now deprecated, so only load it with +% old versions of \sty{mfirstuc}. (From 2022, \sty{textcase} simply defines +% \cs{MakeTextUppercase} to \cs{MakeUppercase}.) % \begin{macrocode} -\RequirePackage{textcase} -\renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase}% + \RequirePackage{textcase} % \end{macrocode} +%Provide \cs{MFUsentencecase} for use where expandable contexts are +%required. +%\begin{macro}{\MFUsentencecase} +% \begin{macrocode} + \providecommand{\MFUsentencecase}[1]{\text_titlecase_first:n{#1}} +% \end{macrocode} +%\end{macro} +%Provide support for exclusions with \cs{MFUsentencecase}. +%\begin{macro}{\glsmfuexcl} +% \begin{macrocode} + \providecommand{\glsmfuexcl}[1]{ + \tl_if_in:NnF \l_text_case_exclude_arg_tl {#1} + { + \tl_put_right:Nn \l_text_case_exclude_arg_tl {#1} + } + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\mfirstucMakeUppercase} +%We have an old version of \sty{mfirstuc} that is still using this +%command in the definition of \cs{makefirstuc}, in which case, +%continue to use \cs{MakeTextUppercase} as in previous versions, in +%case there is also an old version of \sty{textcase} installed. +%However, note that the all-caps commands like \cs{GLS} now use +%\cs{glsuppercase} instead. +% \begin{macrocode} + \renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase} +% \end{macrocode} +%\end{macro} +%Just treat blockers and mappings as exclusions. +%\begin{macro}{\glsmfublocker} +% \begin{macrocode} + \newcommand{\glsmfublocker}[1]{\glsmfuexcl{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsmfuaddmap} +% \begin{macrocode} + \newcommand{\glsmfuaddmap}[2]{\glsmfuexcl{#1}\glsmfublocker{#2}} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +} +\ExplSyntaxOff +% \end{macrocode} +% % \begin{macrocode} \RequirePackage{xfor} % \end{macrocode} @@ -274,8 +338,8 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % \end{macrocode} %\changes{1.1}{2008-02-22}{amsgen now loaded (\cs{new@ifnextchar} needed)} % Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in -% commands that have a final optional argument (such as \ics{gls}) -% so require \isty{amsgen}. +% commands that have a final optional argument (such as \cs{gls}) +% so require \sty{amsgen}. % Thanks to Morten~H\o gholm for suggesting this. (This has % replaced using the \sty{xspace} package.) % \begin{macrocode} @@ -343,7 +407,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \fi % \end{macrocode} % -% \section{Package Options}\label{sec:pkgopt} +%\subsection{Package Options}\label{sec:pkgopt} %\begin{option}{debug} %\changes{4.24}{2016-05-27}{new} % Switch on debug mode. This will also cancel the \pkgopt{nowarn} @@ -406,15 +470,10 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % \begin{macrocode} \newcommand*{\glsshowtarget}[1]{% \ifmmode - \nfss@text{\glsshowtargetfont [#1]}% + \glsshowtargetinner{#1}% \else \ifinner -% \end{macrocode} -% Grouping no longer required as new \cs{@@glsshowtarget} adds -% scoping but retained here in case any existing documents are using -% \cs{glsshowtarget} elsewhere. -% \begin{macrocode} - {\glsshowtargetfont [#1]}% + \glsshowtargetinner{#1}% \else \glsshowtargetouter{#1}% \fi @@ -422,6 +481,25 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of } % \end{macrocode} %\end{macro} +%\begin{macro}{\glsshowtargetfonttext} +%\changes{4.50}{2022-10-14}{new} +%Text-block command that checks for math-mode. +% \begin{macrocode} +\newcommand*{\glsshowtargetfonttext}[1]{% + \ifmmode \nfss@text{\glsshowtargetfont #1}\else {\glsshowtargetfont #1}\fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsshowtargetinner} +%\changes{4.50}{2022-10-14}{new} +% Grouping no longer required as new \cs{@@glsshowtarget} adds +% scoping but retained here in case any existing documents are using +% \begin{macrocode} +\newcommand*{\glsshowtargetinner}[1]{\glsshowtargetfonttext{[#1]}} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsshowtargetouter} %\changes{4.45}{2020-02-13}{new} % \begin{macrocode} @@ -452,6 +530,14 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsdoshowtarget} +%\changes{4.50}{2022-10-14}{new} +%Make it easier to customise. +% \begin{macrocode} +\newcommand*{\glsdoshowtarget}[2]{\@glsshowtarget{#1}#2} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@@glsshowtarget} %\changes{4.45}{2020-02-13}{new} %Need to detokenize the label in the event that it contains awkward @@ -576,7 +662,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % The starred form of the named sectional unit will be used. % If you want some other way to start the glossary section (e.g.\ % a numbered section) you will have to redefined -% \ics{glossarysection}. +% \cs{glossarysection}. % \begin{macrocode} \define@choicekey{glossaries.sty}{section}{part,chapter,section,% subsection,subsubsection,paragraph,subparagraph}[section]{% @@ -634,7 +720,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The default glossary style is stored in % \cs{@glossary@default@style}. This is initialised to % \texttt{list}. (The \glostyle{list} style is -% defined in the accompanying \isty{glossary-list} package +% defined in the accompanying \sty{glossary-list} package % described in \autoref{sec:code:styles}.) Note that the % \glostyle{list} style is incompatible with \sty{classicthesis} % so change the default to \glostyle{index} if that package has been @@ -733,18 +819,20 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{option} % %\begin{option}{esclocations} -% When using \gls{makeindex} or \gls{xindy}, the locations may need +% When using \app{makeindex} or \app{xindy}, the locations may need % to be adjusted to ensure they're in a format that's allowed by the % indexing application. This involves a bit of hackery and isn't % needed if the locations are all guaranteed to be in the correct % form (or if the user is prepared to post-process the glossary file before -% calling the relevant indexing application) so \pkgopt[false]{esclocations} +% calling the relevant indexing application, which +% \app{makeglossaries} can do) so \pkgopt[false]{esclocations} % will switch off this mechanism allowing for a faster and more -% stable approach. +% stable approach. As from v4.50, the default is now false. %\changes{4.33}{2017-09-20}{new} +%\changes{4.50}{2022-10-14}{default now false} % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{esclocations}[true]{} -\glsesclocationstrue +\glsesclocationsfalse % \end{macrocode} %\end{option} % @@ -756,7 +844,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{option}{nolong} %\changes{1.18}{2009-01-14}{new} -% This option prevents \isty{glossary-long} from being loaded. +% This option prevents \sty{glossary-long} from being loaded. % This means that the glossary styles that use the % \env{longtable} environment will not be available. This option % is provided to reduce overhead caused by loading unrequired @@ -768,17 +856,24 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@loadsuper} %\changes{1.18}{2009-01-14}{new} -% The \isty{glossary-super} package isn't loaded if -% \isty{supertabular} isn't installed. +% The \sty{glossary-super} package isn't loaded if +% \sty{supertabular} isn't installed. % \begin{macrocode} \IfFileExists{supertabular.sty}{% \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}}}{% \newcommand*{\@gls@loadsuper}{}} % \end{macrocode} %\end{macro} +%Don't load super styles if \sty{xtab} has been loaded as it causes +%a conflict. +%\changes{4.50}{2022-10-14}{don't load \sty{glossary-super} if \sty{xtab} +%has been loaded} +% \begin{macrocode} +\@ifpackageloaded{xtab}{\renewcommand*{\@gls@loadsuper}{}}{} +% \end{macrocode} %\begin{option}{nosuper} %\changes{1.18}{2009-01-14}{new} -% This option prevents \isty{glossary-super} from being loaded. +% This option prevents \sty{glossary-super} from being loaded. % This means that the glossary styles that use the % \env{supertabular} environment will not be available. This option % is provided to reduce overhead caused by loading unrequired @@ -796,9 +891,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{option}{nolist} %\changes{1.18}{2009-01-14}{new} -% This option prevents \isty{glossary-list} from being loaded +% This option prevents \sty{glossary-list} from being loaded % (to reduce overheads if required). Naturally, the styles defined -% in \isty{glossary-list} will not be available if this option +% in \sty{glossary-list} will not be available if this option % is used. If the style is still set to \glostyle{list}, the default % must be set to \cs{relax}. %\changes{4.31}{2017-08-10}{added check for \qt{list} style} @@ -821,9 +916,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{option}{notree} %\changes{1.18}{2009-01-14}{new} -% This option prevents \isty{glossary-tree} from being loaded +% This option prevents \sty{glossary-tree} from being loaded % (to reduce overheads if required). Naturally, the styles defined -% in \isty{glossary-tree} will not be available if this option +% in \sty{glossary-tree} will not be available if this option % is used. % \begin{macrocode} \@gls@declareoption{notree}{\renewcommand*{\@gls@loadtree}{}} @@ -879,7 +974,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{option}{ucmark} % Boolean option to determine whether or not to use -% use upper case in definition of \ics{glsglossarymark} +% use upper case in definition of \cs{glsglossarymark} %\changes{3.02}{2012-05-21}{new} % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{ucmark}[true]{} @@ -1005,6 +1100,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{option} % +%\begin{macro}{\glsindexingsetting} +%\changes{4.50}{2022-10-14}{new} +%Provide a way of finding out what the current indexing setting is. +%This won't pick up the noidx option until \cs{makenoidxglossaries} +%is encountered. +% \begin{macrocode} +\newcommand{\glsindexingsetting}{\ifglsxindy xindy\else makeindex\fi} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glo@default@sorttype} % Initialise default sort for \cs{printnoidxglossary} % \begin{macrocode} @@ -1014,12 +1119,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{option}{sort} %\changes{3.0}{2011-04-02}{new} +%\changes{4.50}{2022-10-14}{added clear} % Define the sort method: \pkgopt[standard]{sort} (default), % \pkgopt[def]{sort} (order of definition) or % \pkgopt[use]{sort} (order of use). If no indexing required, use -% \pkgopt[none]{sort}. +% \pkgopt[none]{sort} or \pkgopt[clear]{sort}. % \begin{macrocode} -\define@choicekey{glossaries.sty}{sort}{standard,def,use,none}{% +\define@choicekey{glossaries.sty}{sort}{standard,def,use,none,clear}{% \renewcommand*{\@glo@default@sorttype}{#1}% \csname @gls@setupsort@#1\endcsname } @@ -1034,7 +1140,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Allow user to hook into sort mechanism. The first argument % \meta{sort cs} is the temporary control sequence containing the % sort value before it has been sanitized and had -% \gls{makeindex}\slash\gls{xindy} special characters escaped. +% \app{makeindex}\slash\app{xindy} special characters escaped. % \begin{macrocode} \newcommand*{\glsprestandardsort}[3]{% \glsdosanitizesort @@ -1229,6 +1335,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % required. % \begin{macrocode} \newcommand*{\@gls@setupsort@none}{% + \def\glsindexingsetting{none}% % \end{macrocode} % Don't store entry index information. % \begin{macrocode} @@ -1258,11 +1365,44 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@setupsort@clear} +%\changes{4.50}{2022-10-14}{new} +% Like sort=none but sets the sort value to empty. +% \begin{macrocode} +\newcommand*{\@gls@setupsort@clear}{% + \def\glsindexingsetting{none}% +% \end{macrocode} +% Don't store entry index information. +% \begin{macrocode} + \def\do@glo@storeentry##1{}% +% \end{macrocode} +% No count register required for standard sort. +% \begin{macrocode} + \def\@gls@defsortcount##1{}% +% \end{macrocode} +% Clear sort value. +% \begin{macrocode} + \def\@gls@defsort##1##2{\csgdef{glo@##2@sort}{}}% +% \end{macrocode} +% Don't need to do anything when the entry is used. +% \begin{macrocode} + \def\@gls@setsort##1{}% +% \end{macrocode} +% This sort option isn't allowed with \cs{makeglossaries} or +% \cs{makenoidxglossaries}. +% \begin{macrocode} + \renewcommand\@glo@check@sortallowed[1]{\PackageError{glossaries} + {Option sort=clear not allowed with \string##1}% + {(Use sort=def instead)}}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsdefmain} %\changes{2.01}{2009 May 30}{new} %\changes{3.04}{2012-11-18}{added check for doc package} % Define the main glossary. This will be the first glossary to -% be displayed when using \ics{printglossaries}. The default +% be displayed when using \cs{printglossaries}. The default % extensions conflict if used with \sty{doc}, so provide different % extensions if \sty{doc} loaded. (If these extensions are % inappropriate, use \pkgopt{nomain} and manually define the main @@ -1290,9 +1430,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % you want to make a secondary glossary the main glossary. This % affects any commands that can optionally take a glossary name % as an argument (or as the value of the -% \gloskey{type}\igloskey[printglossary]{type} key in +% \gloskey{type} key in %a key-value list). This was mainly done so that -% \ics{loadglsentries} can temporarily change +% \cs{loadglsentries} can temporarily change % \cs{glsdefaulttype} while it loads a file containing % new glossary entries (see \autoref{sec:load}). %\begin{macro}{\glsdefaulttype} @@ -1348,17 +1488,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{option} %\begin{macro}{\printacronyms} % Define \cs{printacronyms} at the start of the document if -% \pkgopt{acronym} is set and compatibility mode isn't on and +% \pkgopt{acronym} is set and % \cs{printacronyms} hasn't already been defined. % \begin{macrocode} \AtBeginDocument{% \ifglsacronym - \ifbool{glscompatible-3.07}% - {}% - {% - \providecommand*{\printacronyms}[1][]{% - \printglossary[type=\acronymtype,#1]}% - }% + \providecommand*{\printacronyms}[1][]{% + \printglossary[type=\acronymtype,#1]}% \fi } % \end{macrocode} @@ -1399,8 +1535,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\@glsacronymlists} %\changes{2.04}{2009-11-10}{new} % Comma-separated list of glossary labels indicating which -% glossaries contain acronyms. Note that \ics{SetAcronymStyle} -% must be used after adding labels to this macro. +% glossaries contain acronyms. % \begin{macrocode} \newcommand*{\@glsacronymlists}{} % \end{macrocode} @@ -1420,8 +1555,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{2.04}{2009-11-10}{new}% % Identifies the named glossary as a list of acronyms and adds % to the list. (Doesn't check if the glossary exists, but checks -% if label already in list. Use \ics{SetAcronymStyle} after -% identifying all the acronym lists.) +% if label already in list.) % \begin{macrocode} \newcommand*{\DeclareAcronymList}[1]{% \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}% @@ -1505,7 +1639,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % is stored in \cs{glscounter}. This is initialised to the % page counter. This is used as the default counter when a % new glossary is defined, unless a different counter is specified -% in the optional argument to \ics{newglossary} (see +% in the optional argument to \cs{newglossary} (see % \autoref{sec:newglos}). %\begin{macro}{\glscounter} % \begin{macrocode} @@ -1657,10 +1791,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \pkgopt{sanitizesort} option. % %\begin{macro}{\@gls@sanitizedesc} -% \begin{macrocode} -\newcommand*{\@gls@sanitizedesc}{% -} -% \end{macrocode} +%\changes{3.08a}{2013-09-28}{deprecated} +%\changes{4.50}{2022-10-14}{removed} +%\cs{@gls@sanitizedesc} was deprecated in v3.08a and removed in +%v4.50. %\end{macro} % %\begin{macro}{\glssetexpandfield} @@ -1888,6 +2022,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@removedoption} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\@gls@removedoption}[1]{% + \PackageError{glossaries}{obsolete package option `#1' has been +removed. Rollback required or use a newer alternative} +{Try \string\usepackage[#1]{glossaries}[=v4.46]}% +} +% \end{macrocode} +%\end{macro} +% % Before defining the \pkgopt{sanitize} package option, The % key-value list for the \pkgopt{sanitize} value needs to be defined. % These are all boolean keys. If they are not given a value, assume @@ -1954,7 +2099,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{option} % %\begin{macro}{\@gls@noidx@setsanitizesort} -% Default behaviour for \ics{makenoidxglossaries} is +% Default behaviour for \cs{makenoidxglossaries} is % sanitizesort=false. % \begin{macrocode} \newcommand*{\@gls@noidx@setsanitizesort}{% @@ -2129,6 +2274,27 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % +%\begin{macro}{\@gls@requested@languages} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\@gls@requested@languages}{} +% \end{macrocode} +%\end{macro} +% +%\begin{option}{languages} +%\changes{4.50}{2022-10-14}{new} +%Identify required languages independently of any language packages +%and switches off automatic loading of \sty{translator}. +% \begin{macrocode} +\define@key{glossaries.sty}{languages}{% + \renewcommand{\@gls@requested@languages}{#1}% + \glstranslatetrue + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo +} +% \end{macrocode} +%\end{option} +% %\begin{option}{indexonlyfirst} %\changes{3.02}{2012-05-21}{new} % Set whether to only index on first use. @@ -2158,57 +2324,58 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Set the long form of the acronym in footnote on first use. % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% - \ifbool{glsacrdescription}% - {}% - {% - \renewcommand*{\@gls@sanitizedesc}{}% - }% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% + \ifglsacrfootnote + \@gls@removedoption{footnote}% + \fi } % \end{macrocode} %\end{option} %\begin{option}{description} % Allow acronyms to have a description (needs to be set using % the \gloskey{description} key in the optional argument of -% \ics{newacronym}). +% \cs{newacronym}). % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{description}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% + \ifglsacrdescription + \@gls@removedoption{description}% + \fi } % \end{macrocode} %\end{option} %\begin{option}{smallcaps} -% Define \ics{newacronym} to set the short form in small capitals. +% Define \cs{newacronym} to set the short form in small capitals. % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% + \ifglsacrsmallcaps + \@gls@removedoption{smallcaps}% + \fi } % \end{macrocode} %\end{option} %\begin{option}{smaller} -% Define \ics{newacronym} to set the short form using \cs{smaller} +% Define \cs{newacronym} to set the short form using \cs{smaller} % which obviously needs to be defined by loading the appropriate % package. % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% + \ifglsacrsmaller + \@gls@removedoption{smaller}% + \fi } % \end{macrocode} %\end{option} %\begin{option}{dua} -% Define \ics{newacronym} to always use the long forms +% Define \cs{newacronym} to always use the long forms % (i.e.\ don't use acronyms) % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% + \ifglsacrdua + \@gls@removedoption{dua}% + \fi } % \end{macrocode} %\end{option} -%\begin{option}{shotcuts} +%\begin{option}{shortcuts} % Define acronym shortcuts. % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{} @@ -2243,8 +2410,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{1.17}{2008-12-26}{added xindy support} %\begin{macro}{\ifglsxindy} %\changes{1.17}{2008-12-26}{new} -% Provide boolean to determine whether \gls{xindy} or -% \gls{makeindex} will be used to sort the glossaries. +% Provide boolean to determine whether \app{xindy} or +% \app{makeindex} will be used to sort the glossaries. % \begin{macrocode} \newif\ifglsxindy % \end{macrocode} @@ -2280,21 +2447,41 @@ false,nolabel,autolabel,nameref}[nolabel]{% \def\@xdy@main@language{\languagename}% % \end{macrocode} %\end{macro} +% +%\begin{macro}{\gls@xdy@set@lang} +%\changes{4.50}{2022-10-14}{new} +%If the nomain option has been used, need to check +%\cs{glsdefaulttype} before falling back on main. +%This will set \cs{@gls@langmod} for the given glossary. +% \begin{macrocode} +\newcommand*{\gls@xdy@set@lang}[1]{% + \ifcsundef{@xdy@#1@language}% + {% + \ifcsundef{@xdy@\glsdefaulttype @language} + {\let\@gls@langmod\@xdy@main@language}% + {\letcs\@gls@langmod{@xdy@\glsdefaulttype @language}}% + }% + {\letcs\@gls@langmod{@xdy@#1@language}}% +} +% \end{macrocode} +%\end{macro} +% % Define key to set the language % \begin{macrocode} \define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}} % \end{macrocode} % %\begin{macro}{\gls@codepage} -% Define the code page. If \ics{inputencodingname} is defined -% use that, otherwise have initialise with no codepage. +% Define the code page. If \cs{inputencodingname} is defined +% use that, otherwise initialise to utf8. %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} +%\changes{4.50}{2022-10-14}{set default codepage to utf8 if +%\cs{inputencodingname} not defined and switched to \cs{ifdefvoid}} % \begin{macrocode} -\ifcsundef{inputencodingname}{% - \def\gls@codepage{}}{% - \def\gls@codepage{\inputencodingname} -} +\ifdefvoid\inputencodingname + {\def\gls@codepage{utf8}}% + {\def\gls@codepage{\inputencodingname}} % \end{macrocode} % Define a key to set the code page. % \begin{macrocode} @@ -2338,8 +2525,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@domakeglossaries} %\changes{4.45}{2020-02-13}{new} +%\changes{4.50}{2022-10-14}{added check for \cs{nofiles}} % \begin{macrocode} -\providecommand{\@domakeglossaries}[1]{#1} +\providecommand{\@domakeglossaries}[1]{\if@filesw #1\fi} % \end{macrocode} %\end{macro} % @@ -2490,31 +2678,92 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\gls@automake@makegloss} +%\changes{4.50}{2022-10-14}{new} +%Provide a way to allow makeglossaries or makeglossaries-lite run +%via automake instead of explicit calls to makeindex or xindy. +% \begin{macrocode} +\newcommand{\gls@automake@makegloss}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@automake@option} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\gls@automake@option}{automake=\gls@automake@val} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@do@automake@err} +%\changes{4.50}{2022-10-14}{new} +%NB \sty{glossaries-extra} v1.14 defines similar command +%\cs{@gls@doautomake@err}. +% \begin{macrocode} +\newcommand*{\@gls@do@automake@err}{% + \PackageError{glossaries}{You must use + \string\makeglossaries\space with \gls@automake@option} + {% + Either remove the \gls@automake@option\space setting or + add \string\makeglossaries\space to your document preamble.% + }% +}% +% \end{macrocode} +%\end{macro} +% %\begin{option}{automake} %\changes{4.08}{2014-07-30}{new} %\changes{4.42}{2019-01-06}{switch from boolean to choice} +%\changes{4.50}{2022-10-14}{added makegloss and lite options} % If this setting is on, automatically run -% \gls{makeindex}\slash\gls{xindy} at the end of the document. -% Must be used with \ics{makeglossaries}. +% \app{makeindex}\slash\app{xindy} at the end of the document. +% Must be used with \cs{makeglossaries}. % Default is false. As from v4.42, this is now a choice rather than % boolean key. % \begin{macrocode} \define@choicekey{glossaries.sty}{automake}% - [\gls@automake@val\gls@automake@nr]{true,false,immediate}[true]{% - \ifnum\gls@automake@nr=1\relax + [\gls@automake@val\gls@automake@nr]{true,false,immediate,makegloss,lite,delayed}[immediate]{% + \ifcase\gls@automake@nr\relax + \GlossariesWarning{automake=true deprecated. Use automake=delayed for a delayed write}% +% \end{macrocode} +% case 0: true +% \begin{macrocode} + \glsautomaketrue + \renewcommand{\gls@automake@makegloss}{}% + \or +% \end{macrocode} +% case 1: false +% \begin{macrocode} \glsautomakefalse - \else + \renewcommand{\gls@automake@makegloss}{}% + \or +% \end{macrocode} +% case 2: immediate +% \begin{macrocode} \glsautomaketrue + \renewcommand{\gls@automake@makegloss}{}% + \or +% \end{macrocode} +% case 3: makegloss +% \begin{macrocode} + \glsautomaketrue + \renewcommand{\gls@automake@makegloss}{makeglossaries}% + \or +% \end{macrocode} +% case 4: lite +% \begin{macrocode} + \glsautomaketrue + \renewcommand{\gls@automake@makegloss}{makeglossaries-lite}% + \or +% \end{macrocode} +% case 5: delayed +% \begin{macrocode} + \def\gls@automake@nr{0}% + \glsautomaketrue + \renewcommand{\gls@automake@makegloss}{}% \fi + \renewcommand{\gls@automake@option}{automake=\gls@automake@val}% \ifglsautomake - \renewcommand*{\@gls@doautomake}{% - \PackageError{glossaries}{You must use - \string\makeglossaries\space with automake=true} - {% - Either remove the automake=true setting or - add \string\makeglossaries\space to your document preamble.% - }% - }% + \let\@gls@doautomake\@gls@do@automake@err \else \renewcommand*{\@gls@doautomake}{}% \fi @@ -2530,6 +2779,38 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{option}{automakegloss} +%\changes{4.50}{2022-10-14}{new} +%Provide a synonym for \pkgopt[makegloss]{automake} that can be +%passed via the document class options. +% \begin{macrocode} +\@gls@declareoption{automakegloss}{% + \glsautomaketrue + \renewcommand{\gls@automake@option}{automakegloss}% + \def\gls@automake@val{makegloss}% + \def\gls@automake@nr{3}% + \renewcommand{\gls@automake@makegloss}{makeglossaries}% + \let\@gls@doautomake\@gls@do@automake@err +} +% \end{macrocode} +%\end{option} +% +%\begin{option}{automakeglosslite} +%\changes{4.50}{2022-10-14}{new} +%Provide a synonym for \pkgopt[lite]{automake} that can be +%passed via the document class options. +% \begin{macrocode} +\@gls@declareoption{automakeglosslite}{% + \glsautomaketrue + \renewcommand{\gls@automake@option}{automakeglosslite}% + \def\gls@automake@val{lite}% + \def\gls@automake@nr{4}% + \renewcommand{\gls@automake@makegloss}{makeglossaries-lite}% + \let\@gls@doautomake\@gls@do@automake@err +} +% \end{macrocode} +%\end{option} +% %\begin{option}{savewrites} %\changes{3.0}{2011-04-02}{new} % The \pkgopt{savewrites} package option is provided to save on @@ -2553,25 +2834,34 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % %\begin{option}{compatible-3.07} -%\changes{3.11a}{2013-10-15}{cnew} +%\changes{3.11a}{2013-10-15}{new} +%\changes{4.50}{2022-10-14}{deprecated} +%Rollback should now be used for backward-compatibility. % \begin{macrocode} -\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{} +\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{% + \ifbool{glscompatible-3.07}% + {% + \@gls@removedoption{compatible-3.07}% + }% + {}% +} \boolfalse{glscompatible-3.07} % \end{macrocode} %\end{option} % %\begin{option}{compatible-2.07} %\changes{3.0}{2011-04-02}{compatible-2.07 option added} +%\changes{4.50}{2022-10-14}{deprecated} +%Rollback should now be used for backward-compatibility. % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{% % \end{macrocode} -% Also set 3.07 compatibility if this option is set. %\changes{3.14a}{2013-11-12}{added check for 2.07 before setting 3.07 %compatibility} % \begin{macrocode} \ifbool{glscompatible-2.07}% {% - \booltrue{glscompatible-3.07}% + \@gls@removedoption{compatible-2.07}% }% {}% } @@ -2600,20 +2890,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % identical to \cs{makeglossaries}. (This is done partly to % reinforce the message that you must either use % \cs{@makeglossary} for all the glossaries or for none -% of them, but is also a legacy from the old \styfmt{glossary} package.) +% of them, but is also a legacy from the old \sty{glossary} package.) %\changes{4.41}{2018-07-23}{added warning} -% \begin{macrocode} -\def\makeglossary{% - \GlossariesWarning{Use of \string\makeglossary\space with - glossaries.sty is \MessageBreak deprecated. Use \string\makeglossaries\space - instead. If you \MessageBreak need the original definition of - \string\makeglossary\space use \MessageBreak the package options - kernelglossredefs=false (to \MessageBreak restore the former definition of - \string\makeglossary) and \MessageBreak nomain (if the file extensions cause a - conflict)}% - \makeglossaries -} -% \end{macrocode} +%As from v4.50 this command will only be redefined if +%\pkgopt{kernelglossredefs} is used. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % %\begin{macro}{\@gls@override@glossary} @@ -2636,21 +2917,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% % In v4.10, the redefinition of \cs{glossary} was removed since it % was never intended as a user level command (and wasn't documented % in the user manual), however it seems there are packages that have -% hacked the internal macros used by \styfmt{glossaries} and no longer +% hacked the internal macros used by \sty{glossaries} and no longer % work with this redefinition removed, so it's been restored in v4.11 -% but is not used at all by \styfmt{glossaries}. +% but is not used at all by \sty{glossaries}. % (This may be removed or moved to a compatibility mode in future.) % As from v4.41, the use of \cs{glossary} now triggers a warning. % The package option \pkgopt[nowarn]{kernelglossredefs} may be used to % remove the warning, but it's better not to use \cs{glossary}. %\begin{macro}{\glossary} %\changes{4.41}{2018-07-23}{added warning} -% \begin{macrocode} -\if@gls@docloaded -\else - \def\glossary{\@gls@override@glossary} -\fi -% \end{macrocode} +%As from v4.50 this command will only be redefined if +%\pkgopt{kernelglossredefs} is used. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % %\begin{option}{kernelglossredefs} @@ -2664,11 +2942,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% %and their use is not encouraged. The preferred commands are %\cs{makeglossaries} (to open all associated glossary files) and %\cs{gls}, \cs{glstext} etc or \cs{glsadd} for indexing. +%\changes{4.50}{2022-10-14}{corrected names of choice variables} +% +%As from v4.50, the default is kernelglossredefs=false. % \begin{macrocode} \define@choicekey{glossaries.sty}{kernelglossredefs}% - [\gls@debug@val\gls@debug@nr]{true,false,nowarn}[true]% + [\gls@kernelglossredefs@val\gls@kernelglossredefs@nr]{true,false,nowarn}[true]% {% - \ifcase\gls@debug@nr\relax + \ifcase\gls@kernelglossredefs@nr\relax \def\glossary{\@gls@override@glossary}% \def\makeglossary{% \GlossariesWarning{Use of \string\makeglossary\space with @@ -2795,6 +3076,26 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{option}{mfirstuc} +%\changes{4.50}{2022-10-14}{new} +%Similar to \sty{mfirstuc}'s expanded and unexpanded package options. +%Not providing the other option. +% \begin{macrocode} +\define@choicekey{glossaries.sty}{mfirstuc}% + [\gls@mfirstuc@val\gls@mfirstuc@nr]% + {expanded,unexpanded}% + {% + \ifcase\gls@mfirstuc@nr + % expanded + \renewcommand*{\glsmakefirstuc}[1]{\MFUsentencecase{#1}}% + \or + % unexpanded + \renewcommand*{\glsmakefirstuc}[1]{\MFUsentencecase{\unexpanded{#1}}}% + \fi + } +% \end{macrocode} +%\end{option} +% % Process package options. First process any options that have been % passed via the document class. % \begin{macrocode} @@ -2814,9 +3115,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \ProcessOptionsX % \end{macrocode} -% Load backward compatibility stuff: +%No longer load backward compatibility stuff as from v4.50. +%\changes{4.50}{2022-10-14}{removed automatic loading of +%\sty{glossaries-compatible-307}} +%If LuaLaTeX and automake set, need to load \sty{shellesc}. +%Note that if automake is passed to \cs{setupglossaries} instead, +%then \sty{shellesc} will need to be loaded explicitly. % \begin{macrocode} -\RequirePackage{glossaries-compatible-307} +\ifglsautomake + \ifdef\directlua{\RequirePackage{shellesc}}{} +\fi % \end{macrocode} % %\begin{macro}{\setupglossaries} @@ -2827,7 +3135,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \disable@keys{glossaries.sty}{compatible-2.07,% xindy,xindygloss,xindynoglsnumbers,makeindex,% - acronym,translate,notranslate,nolong,nosuper,notree,nostyles,% + acronym,translate,notranslate,languages,nolong,nosuper,notree,nostyles,% nomain,noglossaryindex} % \end{macrocode} %Now define \cs{setupglossaries}: @@ -2901,15 +3209,15 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@onlypremakeg} % Some commands only have an effect when used before -% \ics{makeglossaries}. So define a list of commands that -% should be disabled after \ics{makeglossaries} +% \cs{makeglossaries}. So define a list of commands that +% should be disabled after \cs{makeglossaries} % \begin{macrocode} \newcommand*{\@gls@onlypremakeg}{} % \end{macrocode} %\end{macro} %\begin{macro}{\@onlypremakeg} % Adds the specified control sequence to the list of commands that -% must be disabled after \ics{makeglossaries}. +% must be disabled after \cs{makeglossaries}. % \begin{macrocode} \newcommand*{\@onlypremakeg}[1]{% \ifx\@gls@onlypremakeg\@empty @@ -2941,10 +3249,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Predefined Text}\label{sec:predefinednames} +%\subsection{Predefined Text}\label{sec:predefinednames} % Set up default textual tags that are used by this % package. Some of the names may already be defined (e.g.\ by -% \isty{babel}) so \cs{providecommand} is used. +% \sty{babel}) so \cs{providecommand} is used. % % Main glossary title: %\begin{macro}{\glossaryname} @@ -3068,18 +3376,30 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \ifglstranslate % \end{macrocode} -% Load \sty{tracklang} +% Load \sty{tracklang}: % \begin{macrocode} \RequirePackage{tracklang} % \end{macrocode} +%Track any languages explicitly requested via the \pkgopt{languages} +%option. +% \begin{macrocode} + \ifdefvoid\@gls@requested@languages{}% + {% + \@for\@gls@thislang:=\@gls@requested@languages\do{% + \ifcsdef{@tracklang@add@\@gls@thislang}% + {\csuse{@tracklang@add@\@gls@thislang}}% + {\expandafter\TrackLanguageTag{\@gls@thislang}}% + }% + }% +% \end{macrocode} % Load \sty{translator} if required. % \begin{macrocode} \@gls@usetranslator % \end{macrocode} -% If using \isty{translator}, \ics{glossaryname} should be defined -% in terms of \ics{translate}, but if babel is also loaded, it will +% If using \sty{translator}, \cs{glossaryname} should be defined +% in terms of \cs{translate}, but if babel is also loaded, it will % redefine \cs{glossaryname} whenever the language is set, so -% override it. (Don't use \ics{addto} as \isty{polyglossia} doesn't +% override it. (Don't use \cs{addto} as \sty{polyglossia} doesn't % define it.) %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} @@ -3217,7 +3537,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % This command only has an effect prior to using -% \ics{makeglossaries}. +% \cs{makeglossaries}. % \begin{macrocode} \@onlypremakeg\setStyleFile % \end{macrocode} @@ -3225,11 +3545,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % % The name of the \app{makeindex} or \app{xindy} style file % is given by \cs{istfilename}. This file is -% created by \ics{writeist} (which is used by -% \ics{makeglossaries}) so +% created by \cs{writeist} (which is used by +% \cs{makeglossaries}) so % redefining this command will only have an effect if it is % done \emph{before} \cs{makeglossaries}. As from v1.17, use -% \ics{setStyleFile} instead of directly redefining \cs{istfilename}. +% \cs{setStyleFile} instead of directly redefining \cs{istfilename}. %\begin{macro}{\istfilename} %\changes{1.17}{2008-12-26}{added xindy support} % \begin{macrocode} @@ -3260,7 +3580,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % This command is the value of the \istkey{page\_compositor} % \app{makeindex} key. Again, any redefinition of this command % must take place \emph{before} \cs{writeist} otherwise it -% will have no effect. As from 1.17, use \ics{glsSetCompositor} +% will have no effect. As from 1.17, use \cs{glsSetCompositor} % instead of directly redefining \cs{glscompositor}. %\begin{macro}{\glscompositor} % \begin{macrocode} @@ -3273,7 +3593,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\glsSetCompositor}[1]{% \renewcommand*{\glscompositor}{#1}} % \end{macrocode} -% Only use before \ics{makeglossaries} +% Only use before \cs{makeglossaries} % \begin{macrocode} \@onlypremakeg\glsSetCompositor % \end{macrocode} @@ -3308,7 +3628,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsnoxindywarning\glsSetAlphaCompositor} \fi % \end{macrocode} -% Can only be used before \ics{makeglossaries} +% Can only be used before \cs{makeglossaries} % \begin{macrocode} \@onlypremakeg\glsSetAlphaCompositor % \end{macrocode} @@ -3330,7 +3650,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\glsSetSuffixF}[1]{% \renewcommand*{\gls@suffixF}{#1}} % \end{macrocode} -% Only has an effect when used before \ics{makeglossaries} +% Only has an effect when used before \cs{makeglossaries} % \begin{macrocode} \@onlypremakeg\glsSetSuffixF % \end{macrocode} @@ -3358,10 +3678,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glsnumberformat} % The command \cs{glsnumberformat} indicates the default % format for the page numbers in the glossary. (Note that this -% is not the same as \ics{glossaryentrynumbers}, but applies +% is not the same as \cs{glossaryentrynumbers}, but applies % to individual numbers or groups of numbers within an entry's % associated number list.) If hyperlinks are defined, it will use -% \ics{glshypernumber}, otherwise it will simply display its +% \cs{glshypernumber}, otherwise it will simply display its % argument ``as is''. %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} @@ -3376,6 +3696,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\glslocationcstoencap} +%\changes{4.50}{2022-10-14}{new} +%Used by \app{makeglossaries} to move commands out of the location +%numbers into the encap. The actual encap needs to be closest to the +%location in the event that hyperlinks are required. +% \begin{macrocode} +\newcommand{\glslocationcstoencap}[3]{\csuse{#2}{\csuse{#1}{#3}}} +% \end{macrocode} +%\end{macro} +% % Individual numbers in an entry's associated number list are % delimited using \cs{delimN} (which corresponds to the % \istkey{delim\_n} \app{makeindex} keyword). The default value @@ -3405,9 +3735,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % change \cs{glossarypreamble}.) The preamble is empty by % default. If you have multiple glossaries, and you want a % different preamble for each glossary, you will need to use -% \ics{printglossary} for each glossary type, instead of -% \ics{printglossaries}, and redefine \cs{glossarypreamble} -% before each \ics{printglossary}. +% \cs{printglossary} for each glossary type, instead of +% \cs{printglossaries}, and redefine \cs{glossarypreamble} +% before each \cs{printglossary}. %\begin{macro}{\glossarypreamble} %\changes{3.07}{2013-07-05}{modified to work with %\cs{setglossarypreamble}} @@ -3439,7 +3769,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % add something after the end of the \env{theglossary} % environment (again, this shouldn't be affected by the % glossary style). It is, of course, possible to simply add the -% text after \ics{printglossary}, but if you only want the +% text after \cs{printglossary}, but if you only want the % postamble to appear after the first glossary, but not after % subsequent glossaries, you can do something like: %\begin{verbatim} @@ -3456,7 +3786,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The sectioning command that starts a glossary is given by % \cs{glossarysection}. (This does not form part of the % glossary style, and so should not be changed by a glossary -% style.) If \ics{phantomsection} +% style.) If \cs{phantomsection} % is defined, it uses \cs{\@p@glossarysection}, otherwise it % uses \cs{@glossarysection}. %\changes{1.05}{2007-08-10}{added \cs{@mkboth} to @@ -3492,8 +3822,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\cs{mfirstucMakeUppercase}} %\changes{3.13a}{2013-11-05}{renamed \cs{glossarymark} to %\cs{glsglossarymark} to avoid conflict with memoir} +%\changes{4.50}{2022-10-14}{switched to \cs{glsuppercase}} % Sets the header mark for the glossary. Takes the glossary short -% (TOC) title as the argument. +% (TOC) title as the argument. If \cs{glossarymark} hasn't been +% defined, it will be defined shortly, so use that. Otherwise don't +% use it as it may not be compatible. % \begin{macrocode} \ifcsundef{glossarymark}% {% @@ -3513,7 +3846,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% \newcommand{\glsglossarymark}[1]{% \ifglsucmark - \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \@mkboth{\glsuppercase{#1}}{\glsuppercase{#1}}% \else \@mkboth{#1}{#1}% \fi @@ -3524,10 +3857,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\glossarymark} % Provided for backward compatibility: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \providecommand{\glossarymark}[1]{% \ifglsucmark - \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \@mkboth{\glsuppercase{#1}}{\glsuppercase{#1}}% \else \@mkboth{#1}{#1}% \fi @@ -3550,7 +3884,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %The command \cs{@glossarysection} indicates how to start -% the glossary section if \ics{phantomsection} is not defined. +% the glossary section if \cs{phantomsection} is not defined. %\begin{macro}{\@glossarysection} %\changes{1.1}{2008-02-22}{numbered sections and auto label added} %\changes{4.07}{2014-04-04}{added optional argument when using unstarred @@ -3574,7 +3908,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % % As \cs{@glossarysection}, but put in -% \ics{phantomsection}, and swap where \cs{@gls@toc} goes. +% \cs{phantomsection}, and swap where \cs{@gls@toc} goes. % If using chapters do a \cs{clearpage}. This ensures that % the hyper link from the table of contents leads to the line above % the heading, rather than the line below it. @@ -3664,7 +3998,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Xindy} +%\subsection{Xindy} % This section defines commands that only have an effect if % \app{xindy} is used to sort the glossaries. %\begin{macro}{\glsnoxindywarning} @@ -3755,7 +4089,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } } % \end{macrocode} -% Only has an effect before \ics{writeist}: +% Only has an effect before \cs{writeist}: % \begin{macrocode} \@onlypremakeg\GlsAddXdyCounters \else @@ -3788,8 +4122,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*\@glsaddxdyattribute[2]{% % \end{macrocode} % Add to xindy attribute list +%\changes{4.50}{2022-10-14}{remove duplicate counterless attribute definitions} % \begin{macrocode} - \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string" ^^J + \edef\@xdyattributes{\@xdyattributes ^^J \string"#2#1\string"}% % \end{macrocode} % Add to xindy markup location. @@ -3823,6 +4158,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \edef\@xdyattributelist{\@xdyattributelist,#1}% \fi % \end{macrocode} +% First add the attribute without the counter name: +%\changes{4.50}{2022-10-14}{remove duplicate counterless attribute definitions} +% \begin{macrocode} + \edef\@xdyattributes{\@xdyattributes ^^J + \string"#1\string"}% +% \end{macrocode} % Iterate through all specified counters and add counter-dependent % attributes: % \begin{macrocode} @@ -3839,7 +4180,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \let\GlsAddXdyCounters\@disabled@glsaddxdycounters } % \end{macrocode} -% Only has an effect before \ics{writeist}: +% Only has an effect before \cs{writeist}: % \begin{macrocode} \@onlypremakeg\GlsAddXdyAttribute \else @@ -3936,7 +4277,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@xdy@Lclass@roman-page-numbers} % Lower case Roman numerals (i, ii, \ldots). In the event that -% \ics{roman} has been redefined to produce a fancy form of +% \cs{roman} has been redefined to produce a fancy form of % roman numerals, attempt to work out how it will be written % to the output file. % \begin{macrocode} @@ -3998,7 +4339,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@xdy@Lclass@Appendix-page-numbers} % Appendix style locations (e.g.\ A-1, A-2, \ldots, B-1, B-2, -% \ldots). The separator is given by \ics{@glsAlphacompositor}. +% \ldots). The separator is given by \cs{@glsAlphacompositor}. % \begin{macrocode} \expandafter\def\csname @gls@xdy@Lclass@Appendix-page-numbers\endcsname{% \string"ALPHA\string" @@ -4010,7 +4351,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@xdy@Lclass@arabic-section-numbers} % Section number style locations (e.g.\ 1.1, 1.2, \ldots). The -% compositor is given by \ics{glscompositor}. +% compositor is given by \cs{glscompositor}. % \begin{macrocode} \expandafter\def\csname @gls@xdy@Lclass@arabic-section-numbers\endcsname{% \string"arabic-numbers\string" @@ -4084,7 +4425,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \string"#2\string"}% } % \end{macrocode} -% Only has an effect before \ics{writeist}: +% Only has an effect before \cs{writeist}: % \begin{macrocode} \@onlypremakeg\GlsAddXdyLocation \else @@ -4186,15 +4527,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\findrootlanguage} %\changes{3.06}{2013/06/17}{Obsoleted} -% This used to determine the root language, using a~bit of trickery -% since \sty{babel} doesn't supply the information, but now that -% \sty{babel} is once again actively maintained, we can't do this -% any more, so \cs{findrootlanguage} is no longer available. Now -% provide a command that does nothing (in case it's been patched), -% but this may be removed completely in the future. -% \begin{macrocode} -\newcommand*{\findrootlanguage}{} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% The command \cs{findrootlanguage} was used to determine the root +% language, using a~bit of trickery. This has been deferred to +% \sty{tracklang}. +%Removed in v4.50. %\end{macro} % %\begin{macro}{\@xdylanguage} @@ -4296,7 +4633,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Loops and conditionals} +%\subsection{Loops and conditionals} %\begin{macro}{\forallglossaries} % To iterate through all glossaries (or comma-separated list of % glossary names given in optional argument) use: @@ -4404,17 +4741,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % % Since the label is used to form the name of control sequences, by % default UTF8 etc characters can't be used in the label. A possible -% workaround is to use \ics{scantokens}, but commands such as -% \ics{glsentrytext} will no longer be usable in sectioning, caption +% workaround is to use \cs{scantokens}, but commands such as +% \cs{glsentrytext} will no longer be usable in sectioning, caption % etc commands. If the user really wants to be able to construct a % label with UTF8 characters, allow them the means to do so (but on -% their own head be it, if they then use entries in \ics{section} +% their own head be it, if they then use entries in \cs{section} % etc). This can be done via: %\begin{verbatim} %\renewcommand*{\glsdetoklabel}[1]{\scantokens{#1\noexpand}} %\end{verbatim} -% (Note, don't use \ics{detokenize} or it will cause commands like -% \ics{glsaddall} to fail.) +% (Note, don't use \cs{detokenize} or it will cause commands like +% \cs{glsaddall} to fail.) % Since redefining \cs{glsdetoklabel} can cause things to go % badly wrong, I'm not going to mention it in the main user guide. % Only advanced users who know what they're doing ought to attempt @@ -4696,6 +5033,19 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\ifglsfieldvoid} +%\changes{4.50}{2022-10-14}{new} +%\begin{definition} +%\cs{ifglsfieldvoid}\marg{field}\marg{label}\marg{true part}\marg{false +%part} +%\end{definition} +%Provide an expandable way of testing if a field is undefined or +%empty. +% \begin{macrocode} +\newcommand{\ifglsfieldvoid}[4]{\ifcsvoid{glo@\glsdetoklabel{#2}@#1}{#3}{#4}} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\ifglshasfield} %\changes{4.03}{2014-01-20}{new} %\begin{definition} @@ -4809,12 +5159,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Defining new glossaries}\label{sec:newglos} +%\subsection{Defining new glossaries}\label{sec:newglos} % A comma-separated list of glossary names is stored % in \cs{@glo@types}. When a new glossary type % is created, its identifying name is added to this list. % This is used by commands that iterate through all glossaries -% (such as \ics{makeglossaries} and \ics{printglossaries}). +% (such as \cs{makeglossaries} and \cs{printglossaries}). %\begin{macro}{\@glo@types} % \begin{macrocode} \newcommand*{\@glo@types}{,} @@ -4837,12 +5187,32 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@defaulttype} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@gls@defaulttype}{\glsdefaulttype} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\defglsentryfmt} %\changes{3.11a}{2013-10-15}{new} % Allow different glossaries to have different display styles. % \begin{macrocode} \newcommand*{\defglsentryfmt}[2][\glsdefaulttype]{% - \csgdef{gls@#1@entryfmt}{#2}% + \protected@edef\@glo@tmp{#1}% + \ifx\@glo@tmp\@gls@defaulttype +% \end{macrocode} +% Argument was \cs{glsdefaulttype} but it hasn't expanded, which +% probably means nomain was used and no alternative glossary has +% been defined. +% \begin{macrocode} + \GlossariesWarning{\string\defglsentryfmt\space attempting to set + a display style for \string\glsdefaulttype\space but there + doesn't seem to be a default glossary. If you have used + `nomain', you need to define an alternative glossary}% + \else + \csgdef{gls@\@glo@tmp @entryfmt}{#2}% + \fi } % \end{macrocode} %\end{macro} @@ -4895,12 +5265,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{definition} % where \meta{log-ext} is the extension of the \app{makeindex} % transcript file, \meta{in-ext} is the extension of the glossary -% input file (read in by \ics{printglossary} and created by +% input file (read in by \cs{printglossary} and created by % \app{makeindex}), \meta{out-ext} is the extension of the % glossary output file which is read in by \app{makeindex} -% (lines are written to this file by the \ics{glossary} command), +% (lines are written to this file by the \cs{glossary} command), % \meta{title} is the title of the glossary that is used in -% \ics{glossarysection} and +% \cs{glossarysection} and % \meta{counter} is the default counter to be used by entries % belonging to this glossary. The \app{makeglossaries} Perl % script reads in the relevant extensions from the auxiliary file, @@ -4971,7 +5341,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % How to display this entry in the document text (uses % \cs{glsentry} by % default). This can be redefined by the user later if required -% (see \ics{defglsentry}). This +% (see \cs{defglsentry}). This % may already have been defined if this has been specified as % a list of acronyms. %\changes{2.04}{2009-11-10}{added check to determine if @@ -4995,7 +5365,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Find out if the final optional argument has been specified, and % use it to set the counter associated with this glossary. (Uses -% \ics{glscounter} if no optional argument is present.) +% \cs{glscounter} if no optional argument is present.) % \begin{macrocode} \@ifnextchar[{\@gls@setcounter{#2}}% {\@gls@setcounter{#2}[\glscounter]}% @@ -5018,13 +5388,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \@onlypreamble{\newglossary} % \end{macrocode} -% Only define new glossaries before \ics{makeglossaries} +% Only define new glossaries before \cs{makeglossaries} % \begin{macrocode} \@onlypremakeg\newglossary % \end{macrocode} %\cs{@newglossary} is used to specify the file extensions % for the \app{makeindex} input, output and transcript files. -% It is written to the auxiliary file by \ics{newglossary}. +% It is written to the auxiliary file by \cs{newglossary}. % Since it is not used by \LaTeX, \cs{@newglossary} simply % ignores its arguments. %\begin{macro}{\@newglossary} @@ -5059,7 +5429,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % % Define the main glossary. This will be the first glossary to -% be displayed when using \ics{printglossaries}. +% be displayed when using \cs{printglossaries}. % \begin{macrocode} \glsdefmain % \end{macrocode} @@ -5077,8 +5447,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\newignoredglossary} % Creates a new glossary that doesn't have associated files. % This glossary is ignored by any commands that iterate over -% glossaries, such as \ics{printglossaries}, and won't work with -% commands like \ics{printglossary}. It's intended for entries that +% glossaries, such as \cs{printglossaries}, and won't work with +% commands like \cs{printglossary}. It's intended for entries that % are so commonly-known they don't require a glossary. %\changes{4.08}{2014-07-30}{new} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} @@ -5131,7 +5501,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Defining new entries}\label{sec:newentry} +%\subsection{Defining new entries}\label{sec:newentry} % New glossary entries are defined using \cs{newglossaryentry}. % This command requires a label and a key-value list that defines % the relevant information for that entry. The definition for these @@ -5158,10 +5528,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{key}{description} % The \gloskey{description} key is usually only used in % the glossary, but can be made to appear in the text by redefining -% \ics{glsentryfmt} or using \ics{defglsentryfmt}. The +% \cs{glsentryfmt} or using \cs{defglsentryfmt}. The % \gloskey{description} key is required when % defining a new glossary entry. If a long description is required, -% use \ics{longnewglossaryentry} instead of \ics{newglossaryentry}. +% use \cs{longnewglossaryentry} instead of \cs{newglossaryentry}. % \begin{macrocode} \define@key{glossentry}{description}{% \def\@glo@desc{#1}% @@ -5205,7 +5575,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{key}{plural} % The \gloskey{plural} key determines how the plural form of the term % should be displayed in the document. If omitted, the plural is -% constructed by appending \ics{glspluralsuffix} to the value of the +% constructed by appending \cs{glspluralsuffix} to the value of the % \gloskey{text} key. % \begin{macrocode} \define@key{glossentry}{plural}{% @@ -5229,7 +5599,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The \gloskey{firstplural} key is used to set the plural form for % first use, in the event that the plural is required the first % time the term is used. If omitted, it is constructed by -% appending \ics{glspluralsuffix} to the value of the \gloskey{first} key. +% appending \cs{glspluralsuffix} to the value of the \gloskey{first} key. % \begin{macrocode} \define@key{glossentry}{firstplural}{% \def\@glo@firstplural{#1}% @@ -5249,10 +5619,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % It is provided for glossary styles that require an associated % symbol, as well as a name and description. To make this value % appear in the glossary, you need to redefine -% \ics{glossentry}. +% \cs{glossentry}. % If you want this value to appear in the text when the term is used -% by commands like \ics{gls}, you will need to change -% \ics{glsentryfmt} (or use for \ics{defglsentryfmt} individual glossaries). +% by commands like \cs{gls}, you will need to change +% \cs{glsentryfmt} (or use for \cs{defglsentryfmt} individual glossaries). % \begin{macrocode} \define@key{glossentry}{symbol}{% \def\@glo@symbol{#1}% @@ -5389,6 +5759,24 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{key} % +%\begin{macro}{\gls@noidx@nonumberlist} +%\changes{4.50}{2022-10-14}{new} +%\cs{makenoidxglossaries} sets \cs{@gls@savenonumberlist} to this. +% \begin{macrocode} +\newcommand*{\gls@noidx@nonumberlist}[1]{% + \cslet{glo@\@glo@label @prenumberlist}\@glo@prefix +}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsnoidxprenumberlist} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\glsnoidxprenumberlist}[1]{% + \csuse{glo@\glsdetoklabel{#1}@prenumberlist}} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@savenonumberlist} %\changes{4.25}{2016-06-09}{new} %The \gloskey{nonumberlist} option isn't saved by default (as it @@ -5488,7 +5876,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{key}{short} %\changes{3.0}{2011-04-02}{new} -% This key is provided for use by \ics{newacronym}. It's not +% This key is provided for use by \cs{newacronym}. It's not % designed for general purpose use, so isn't described in the user % manual. % \begin{macrocode} @@ -5500,7 +5888,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{key}{shortplural} %\changes{3.0}{2011-04-02}{new} -% This key is provided for use by \ics{newacronym}. +% This key is provided for use by \cs{newacronym}. % \begin{macrocode} \define@key{glossentry}{shortplural}{% \def\@glo@shortpl{#1}% @@ -5510,7 +5898,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{key}{long} %\changes{3.0}{2011-04-02}{new} -% This key is provided for use by \ics{newacronym}. +% This key is provided for use by \cs{newacronym}. % \begin{macrocode} \define@key{glossentry}{long}{% \def\@glo@long{#1}% @@ -5520,7 +5908,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{key}{longplural} %\changes{3.0}{2011-04-02}{new} -% This key is provided for use by \ics{newacronym}. +% This key is provided for use by \cs{newacronym}. % \begin{macrocode} \define@key{glossentry}{longplural}{% \def\@glo@longpl{#1}% @@ -5558,10 +5946,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\@glsdefaultplural} % \changes{1.17}{2008-12-26}{new} %\changes{3.10a}{2013-10-13}{Obsolete} -% Now obsolete. Don't use. -% \begin{macrocode} -\newcommand*{\@glsdefaultplural}{} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{Removed} +% \cs{@glsdefaultplural} was obsoleted in v3.10a (2013-10-13) and +% removed in v4.50. %\end{macro} % %\begin{macro}{\@gls@missingnumberlist} @@ -6149,9 +6536,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% % \end{macrocode} % Define the no-link commands. +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% - \newcommand*{#4}[1]{\@Gls@entry@field{##1}{#1}}% + \newcommand*{#4}[1]{\@Glsentryfield{##1}{#1}}% % \end{macrocode} % Now for the commands with links. First the version with no case % change: @@ -6221,6 +6609,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} %\changes{4.08}{2014-07-30}{removed \cs{@sGLS@user@\meta{key}}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \expandafter\newcommand\expandafter*\expandafter {\csname @GLS@user@#1\endcsname}[2][]{% @@ -6228,11 +6617,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% {\csuse{@GLS@user@#1@}{##1}{##2}}% {\csuse{@GLS@user@#1@}{##1}{##2}[]}}% \csdef{@GLS@user@#1@}##1##2[##3]{% - \@gls@field@link{##1}{##2}{\mfirstucMakeUppercase{#3{##2}##3}}% + \@gls@field@link{##1}{##2}{\glsuppercase{#3{##2}##3}}% }% \newrobustcmd*{#7}{% \expandafter\@gls@hyp@opt\csname @GLS@user@#1\endcsname}% }% +% \end{macrocode} +%Add mappings. +% \begin{macrocode} + \glsmfuaddmap{#3}{#4}% + \glsmfuaddmap{#5}{#6}% + \glsmfublocker{#7}% }% {% \PackageError{glossaries}{Key `#1' already exists}{}% @@ -6248,8 +6643,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.16}{2015-07-08}{new} %\changes{4.42}{2019-01-06}{changed from \cs{edef} to \cs{protected@csxdef}} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand{\glsfieldxdef}[3]{% +\newrobustcmd{\glsfieldxdef}[3]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6258,7 +6654,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \protected@csxdef{glo@\@glo@label @#2}{#3}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6272,8 +6668,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.16}{2015-07-08}{new} %\changes{4.42}{2019-01-06}{changed from \cs{edef} to \cs{protected@csedef}} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand{\glsfieldedef}[3]{% +\newrobustcmd{\glsfieldedef}[3]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6282,7 +6679,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \protected@csedef{glo@\@glo@label @#2}{#3}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6295,8 +6692,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{definition} %\changes{4.16}{2015-07-08}{new} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand{\glsfieldgdef}[3]{% +\newrobustcmd{\glsfieldgdef}[3]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6305,7 +6703,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \expandafter\gdef\csname glo@\@glo@label @#2\endcsname{#3}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6318,8 +6716,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{definition} %\changes{4.16}{2015-07-08}{new} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand{\glsfielddef}[3]{% +\newrobustcmd{\glsfielddef}[3]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6328,7 +6727,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \expandafter\def\csname glo@\@glo@label @#2\endcsname{#3}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6343,8 +6742,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Fetches the value of the given field and stores in the given % control sequence. %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand{\glsfieldfetch}[3]{% +\newrobustcmd{\glsfieldfetch}[3]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6353,7 +6753,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \letcs#3{glo@\@glo@label @#2}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6382,10 +6782,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\cs{ifglsfieldeq}\marg{label}\marg{field}\marg{string}\marg{true}\marg{false} %\end{definition} %\changes{4.16}{2015-07-08}{new} +%\changes{4.50}{2022-10-14}{made robust} % Tests if the value of the given field is equal to the given % string. % \begin{macrocode} -\newcommand{\ifglsfieldeq}[5]{% +\newrobustcmd{\ifglsfieldeq}[5]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% @@ -6394,7 +6795,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \ifcsstring{glo@\@glo@label @#2}{#3}{#4}{#5}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6406,20 +6807,24 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\cs{ifglsfielddefeq}\marg{label}\marg{field}\marg{command}\marg{true}\marg{false} %\end{definition} %\changes{4.16}{2015-07-08}{new} +%\changes{4.50}{2022-10-14}{made robust} % Tests if the value of the given field is equal to the replacement % text of the given command. % \begin{macrocode} -\newcommand{\ifglsfielddefeq}[5]{% +\newrobustcmd{\ifglsfielddefeq}[5]{% \glsdoifexists{#1}% {% \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% - \expandafter\ifdefstrequal - \csname glo@\@glo@label @#2\endcsname{#3}{#4}{#5}% +% \end{macrocode} +%Use \cs{ifdefstrequal} not \cs{ifcsstrequal} as the \verb|#3| +%argument should be a command. +% \begin{macrocode} + \expandafter\ifdefstrequal\csname glo@\@glo@label @#2\endcsname{#3}{#4}{#5}% }% {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% + \PackageError{glossaries}{Field `#2' doesn't exist}{}% }% }% } @@ -6433,6 +6838,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.16}{2015-07-08}{new} %As above but uses \cs{ifcsstrequal} instead of \cs{ifdefstrequal} %\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} \newcommand{\ifglsfieldcseq}[5]{% \glsdoifexists{#1}% @@ -7109,11 +7515,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Resetting and unsetting entry flags} +%\subsection{Resetting and unsetting entry flags} % Each glossary entry is assigned a conditional of the form %\cs{ifglo@}\meta{label}\texttt{@flag} which determines % whether or not the entry has been used (see also -% \ics{ifglsused} defined below). These flags can +% \cs{ifglsused} defined below). These flags can % be set and unset using the following macros, but first we need to % know if we're in \sty{amsmath}'s \env{align} environment's % measuring pass. @@ -7352,7 +7758,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Keeping Track of How Many Times an Entry Has Been Unset} +%\subsection{Keeping Track of How Many Times an Entry Has Been Unset} %Version 4.14 introduced \cs{glsenableentrycount} that keeps track %of how many times an entry is marked as used. The counter is reset %back to zero when the first use flag is reset. Note that although @@ -7375,6 +7781,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\ifglsresetcurrcount} +%\changes{4.50}{2022-10-14}{new} +%A conditional to determine whether or not to reset the entry count +%to zero if the first use flag is reset. The default is now not to +%do this, which changes the implementation for v4.49 and below. +% \begin{macrocode} +\newif\ifglsresetcurrcount +\glsresetcurrcountfalse +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsenableentrycount} %\changes{4.14}{2015-02-28}{new} % Enables tracking of how many times an entry has been marked as @@ -7398,7 +7815,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% }% % \end{macrocode} -% Define commands \ics{glsentrycurrcount} and \ics{glsentryprevcount} to +% Define commands \cs{glsentrycurrcount} and \cs{glsentryprevcount} to % access these new fields. Default to zero if undefined. % \begin{macrocode} \newcommand*{\glsentrycurrcount}[1]{% @@ -7423,11 +7840,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% \renewcommand*{\@glsreset}[1]{% \@@glsreset{##1}% - \csgdef{glo@\glsdetoklabel{##1}@currcount}{0}% + \ifglsresetcurrcount\csgdef{glo@\glsdetoklabel{##1}@currcount}{0}\fi }% \renewcommand*{\@glslocalreset}[1]{% \@@glslocalreset{##1}% - \csdef{glo@\glsdetoklabel{##1}@currcount}{0}% + \ifglsresetcurrcount\csdef{glo@\glsdetoklabel{##1}@currcount}{0}\fi }% % \end{macrocode} % Alter behaviour of \cs{cgls}. (Only global unset is used if @@ -7600,6 +8017,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\cGls}{\@gls@hyp@opt\@cGls} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\cgls}{\cGls} +% \end{macrocode} %\begin{macro}{\@cGls} %\changes{4.14}{2015-02-28}{new} % Defined the un-starred form. Need to determine if there is @@ -7688,6 +8109,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\cGlspl}{\@gls@hyp@opt\@cGlspl} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\cglspl}{\cGlspl} +% \end{macrocode} %\begin{macro}{\@cglspl} %\changes{4.14}{2015-02-28}{new} % Defined the un-starred form. Need to determine if there is @@ -7723,11 +8148,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \section{Loading files containing glossary entries} +%\subsection{Loading files containing glossary entries} %\label{sec:load} % Glossary entries can be defined in an external file. -% These external files can contain \ics{newglossaryentry} -% and \ics{newacronym} commands.\footnote{and any other valid +% These external files can contain \cs{newglossaryentry} +% and \cs{newacronym} commands.\footnote{and any other valid %\LaTeX\ code that can be used in the preamble.} %\begin{definition} % \cs{loadglsentries}\oarg{type}\marg{filename} @@ -7737,8 +8162,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % entries should be assigned if they haven't used the \gloskey{type} % key. If the optional argument is not specified, the default % glossary is used. Only those entries used in the document (via -% \ics{glslink}, \ics{gls}, \ics{glspl} and uppercase -% variants or \ics{glsadd} and \ics{glsaddall} +% \cs{glslink}, \cs{gls}, \cs{glspl} and uppercase +% variants or \cs{glsadd} and \cs{glsaddall} % will appear in the glossary). The mandatory argument is % the filename (with or without .tex extension). %\begin{macro}{\loadglsentries} @@ -7755,18 +8180,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@onlypreamble{\loadglsentries} % \end{macrocode} % -%\section{Using glossary entries in the text} +%\subsection{Using glossary entries in the text} %\label{sec:code:glslink} % -% Any term that has been defined using \ics{newglossaryentry} -% (or \ics{newacronym}) can be displayed in the text +% Any term that has been defined using \cs{newglossaryentry} +% (or \cs{newacronym}) can be displayed in the text % (i.e.\ outside of the glossary) using % one of the commands defined in this section. Unless you use -% \ics{glslink}, the way the term appears in the text is -% determined by \ics{glsdisplayfirst} (if it is the first -% time the term has been used) or \ics{glsdisplay} (for +% \cs{glslink}, the way the term appears in the text is +% determined by \cs{glsdisplayfirst} (if it is the first +% time the term has been used) or \cs{glsdisplay} (for % subsequent use). Any formatting commands (such as \cs{textbf} -% is governed by \ics{glstextformat}. By default this just +% is governed by \cs{glstextformat}. By default this just % displays the \term{link text} ``as is''. %\changes{1.04}{2007-08-03}{Added \cs{glstextformat}}% %\begin{macro}{\glstextformat} @@ -7779,230 +8204,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% % As from version 3.11a, the way in which an entry is displayed is now % governed by \cs{glsentryfmt}. This doesn't take any arguments. The % required information is set by commands like \cs{gls}. -% To ensure backward compatibility, the default use the old -% \cs{glsdisplay} and \cs{glsdisplayfirst} style of commands -% \begin{macrocode} -\newcommand*{\glsentryfmt}{% - \@@gls@default@entryfmt\glsdisplayfirst\glsdisplay -} -% \end{macrocode} -% Format that provides backwards compatibility: +% This used to use the now deprecated +% \cs{glsdisplay} and \cs{glsdisplayfirst}. Replaced with +% \cs{glsgenentryfmt} in v4.50. +%\changes{4.50}{2022-10-14}{obsolete commands replaced with +%\cs{glsgenentryfmt}} % \begin{macrocode} -\newcommand*{\@@gls@default@entryfmt}[2]{% - \ifdefempty\glscustomtext - {% - \glsifplural - {% -% \end{macrocode} -% Plural form -% \begin{macrocode} - \glscapscase - {% -% \end{macrocode} -% Don't adjust case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - #2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - #1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - {% -% \end{macrocode} -% Make first letter upper case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use. (Expansion was used in version 3.07 and below -% in case the name wasn't the first thing to be displayed, but now -% the user can sort out the upper casing in \ics{defglsentryfmt}, -% which avoids the issues caused by fragile commands.) -% \begin{macrocode} - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #2{\Glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #1{\Glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - }% - {% -% \end{macrocode} -% Make all upper case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - \mfirstucMakeUppercase{#2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - \mfirstucMakeUppercase{#1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - }% - }% - }% - {% -% \end{macrocode} -% Singular form -% \begin{macrocode} - \glscapscase - {% -% \end{macrocode} -% Don't adjust case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - #2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - #1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - {% -% \end{macrocode} -% Make first letter upper case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #2{\Glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #1{\Glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - }% - {% -% \end{macrocode} -% Make all upper case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - \mfirstucMakeUppercase{#2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - \mfirstucMakeUppercase{#1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - }% - }% - }% - }% - {% -% \end{macrocode} -% Custom text provided in \cs{glsdisp} -% \begin{macrocode} - \ifglsused{\glslabel}% - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - #2{\glscustomtext}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - #1{\glscustomtext}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{}% - }% - }% -} +\newcommand*{\glsentryfmt}{\glsgenentryfmt} % \end{macrocode} %\end{macro} % @@ -8064,16 +8272,15 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% % \end{macrocode} % Subsequent use +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} - \mfirstucMakeUppercase - {\glsentryplural{\glslabel}\glsinsert}% + \glsuppercase{\glsentryplural{\glslabel}\glsinsert}% }% {% % \end{macrocode} % First use % \begin{macrocode} - \mfirstucMakeUppercase - {\glsentryfirstplural{\glslabel}\glsinsert}% + \glsuppercase{\glsentryfirstplural{\glslabel}\glsinsert}% }% }% }% @@ -8127,13 +8334,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Subsequent use % \begin{macrocode} - \mfirstucMakeUppercase{\glsentrytext{\glslabel}\glsinsert}% + \glsuppercase{\glsentrytext{\glslabel}\glsinsert}% }% {% % \end{macrocode} % First use % \begin{macrocode} - \mfirstucMakeUppercase{\glsentryfirst{\glslabel}\glsinsert}% + \glsuppercase{\glsentryfirst{\glslabel}\glsinsert}% }% }% }% @@ -8152,8 +8359,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glsgenacfmt} %\changes{4.02}{2013-12-05}{new} % Define a generic acronym format that uses the \gloskey{long} and -% \gloskey{short} keys (or their plurals) and \ics{acrfullformat}, -% \ics{firstacronymfont} and \ics{acronymfont}. +% \gloskey{short} keys (or their plurals) and \cs{acrfullformat}, +% \cs{firstacronymfont} and \cs{acronymfont}. % \begin{macrocode} \newcommand*{\glsgenacfmt}{% \ifdefempty\glscustomtext @@ -8184,8 +8391,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% % \end{macrocode} % Subsequent plural form, all caps: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\acronymfont{\glsentryshortpl{\glslabel}}\glsinsert}% }% }% @@ -8210,7 +8418,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Subsequent singular form, all caps: % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\acronymfont{\glsentryshort{\glslabel}}\glsinsert}% }% }% @@ -8241,7 +8449,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % First use plural form, all caps: % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\genplacrfullformat{\glslabel}{\glsinsert}}% }% }% @@ -8266,7 +8474,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % First use singular form, all caps: % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\genacrfullformat{\glslabel}{\glsinsert}}% }% }% @@ -8303,7 +8511,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \newcommand*{\Genacrfullformat}[2]{% \protected@edef\gls@text{\genacrfullformat{#1}{#2}}% - \xmakefirstuc\gls@text + \expandafter\glssentencecase\expandafter{\gls@text}% } % \end{macrocode} %\end{macro} @@ -8329,84 +8537,41 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \newcommand*{\Genplacrfullformat}[2]{% \protected@edef\gls@text{\genplacrfullformat{#1}{#2}}% - \xmakefirstuc\gls@text + \expandafter\glssentencecase\expandafter{\gls@text}% } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsdisplayfirst} -% Deprecated. Kept for backward compatibility. %\changes{3.11a}{2013-10-15}{obsoleted} -% \begin{macrocode} -\newcommand*{\glsdisplayfirst}[4]{#1#4} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%\cs{glsdisplayfirst} deprecated in v3.11a (2013-10-15) and removed in +%v4.50. +%Use rollback if required. %\end{macro} % %\begin{macro}{\glsdisplay} -% Deprecated. Kept for backward compatibility. %\changes{3.11a}{2013-10-15}{obsoleted} -% \begin{macrocode} -\newcommand*{\glsdisplay}[4]{#1#4} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%\cs{glsdisplay} deprecated in v3.11a (2013-10-15) and removed in +%v4.50. +%Use rollback if required. %\end{macro} % %\begin{macro}{\defglsdisplay} %\changes{3.11a}{2013-10-15}{obsoleted} -% Deprecated. Kept for backward compatibility. -% \begin{macrocode} -\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% - \GlossariesWarning{\string\defglsdisplay\space is now obsolete.^^J - Use \string\defglsentryfmt\space instead}% - \expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}% - \edef\@gls@doentrydef{% - \noexpand\defglsentryfmt[#1]{% - \noexpand\ifcsdef{gls@#1@displayfirst}% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\csuse{gls@#1@display}}% - }% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\glsdisplayfirst}% - {\noexpand\csuse{gls@#1@display}}% - }% - }% - }% - \@gls@doentrydef -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%\cs{defglsdisplay} deprecated in v3.11a (2013-10-15) and removed in +%v4.50. +%Use rollback if required. %\end{macro} % %\begin{macro}{\defglsdisplayfirst} -% Deprecated. Kept for backward compatibility. %\changes{3.11a}{2013-10-15}{obsoleted} -% \begin{macrocode} -\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% - \GlossariesWarning{\string\defglsdisplayfirst\space is now obsolete.^^J - Use \string\defglsentryfmt\space instead}% - \expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}% - \edef\@gls@doentrydef{% - \noexpand\defglsentryfmt[#1]{% - \noexpand\ifcsdef{gls@#1@display}% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\csuse{gls@#1@display}}% - }% - {% -% \end{macrocode} -%\changes{4.04}{2014-03-06}{fixed unwanted space} -% \begin{macrocode} - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\glsdisplay}% - }% - }% - }% - \@gls@doentrydef -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%\cs{defglsdisplayfirst} deprecated in v3.11a (2013-10-15) and removed in +%v4.50. +%Use rollback if required. %\end{macro} % %\subsubsection{Links to glossary entries} @@ -8417,7 +8582,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % the commands like \cs{gls} have a final optional % argument that can be used to insert additional text in the % link (this will usually be appended, but can be redefined using -% \ics{defglsentryfmt}). +% \cs{defglsentryfmt}). % It goes against the \LaTeX\ norm to have an optional % argument after the mandatory arguments, but it makes more % sense to write, say, \verb|\gls{label}['s]| rather than, say, @@ -8426,7 +8591,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % will be ignored after them. This is likely to lead to % confusion as most users would not expect, say, "\gls{"\meta{label}"}" % to ignore following spaces, so \cs{new@ifnextchar} from the -% \isty{amsgen} package is required. +% \sty{amsgen} package is required. % % The following keys can be used in the first optional % argument. The \gloskey[glslink]{counter} key checks that the @@ -8457,32 +8622,74 @@ false,nolabel,autolabel,nameref}[nolabel]{% \define@key{glslink}{format}{% \def\@glsnumberformat{#1}} % \end{macrocode} +% +%\begin{macro}{\@gls@glslink@hyper@update@hook} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@gls@glslink@hyper@update@hook}{} +% \end{macrocode} +%\end{macro} +% % The \gloskey[glslink]{hyper} key is a boolean key, it can either have the % value true or false, and indicates whether or not to make a % hyperlink to the relevant glossary entry. If hyper is false, an % entry will still be made in the glossary, but the given text % won't be a hyperlink. % \begin{macrocode} -\define@boolkey{glslink}{hyper}[true]{} +\define@boolkey{glslink}{hyper}[true]{\@gls@glslink@hyper@update@hook} % \end{macrocode} %\changes{4.08}{2014-07-30}{explicitly initialise hyper key} % Initialise hyper key. % \begin{macrocode} \ifdef{\hyperlink}{\KV@glslink@hypertrue}{\KV@glslink@hyperfalse} % \end{macrocode} +% +%Commands like \cs{gls} and \cs{glsdisp} unset the first use flag +%afterwards. Provide a way to localise this. +%\begin{macro}{\@gls@save@glslocal} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@gls@save@glslocal}{% + \let\if@org@KV@glslink@local\ifKV@glslink@local +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@restore@glslocal} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@gls@restore@glslocal}{% + \ifKV@glslink@local + \let\@gls@do@glsunset\glslocalunset + \else + \let\@gls@do@glsunset\glsunset + \fi + \let\ifKV@glslink@local\if@org@KV@glslink@local +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@do@glsunset} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@gls@do@glsunset}[1]{\glsunset{#1}} +% \end{macrocode} +%\end{macro} +% %\changes{3.04}{2012-11-18}{added local key} % The \gloskey[glslink]{local} key is a boolean key. If true this -% indicates that commands such as \ics{gls} should only do a local +% indicates that commands such as \cs{gls} should only do a local % reset rather than a global one. % \begin{macrocode} \define@boolkey{glslink}{local}[true]{} +\@gls@save@glslocal % \end{macrocode} % % The original \cs{glsifhyper} command isn't particularly useful % as it makes more sense to check the actual hyperlink setting % rather than testing whether the starred or unstarred version % has been used. Therefore, as from version 4.08, \cs{glsifhyper} -% is deprecated in favour of \ics{glsifhyperon}. In case there is +% is deprecated in favour of \cs{glsifhyperon}. In case there is % a particular need to know whether the starred or unstarred version % was used, provide a new command that determines whether the % *-version, +-version or unmodified version was used. @@ -8497,15 +8704,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} %\begin{macro}{\glsifhyper} -% Now deprecated. +% \cs{glsifhyper} deprecated in v4.08 (2014-07-30) and removed in +% v4.50. %\changes{4.08}{2014-07-30}{deprecated} -% \begin{macrocode} -\newcommand*{\glsifhyper}[2]{% - \glslinkvar{#1}{#2}{#1}% - \GlossariesWarning{\string\glsifhyper\space is deprecated. Did - you mean \string\glsifhyperon\space or \string\glslinkvar?}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % %\begin{macro}{\@gls@hyp@opt} @@ -8593,6 +8795,22 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\Glslink} +%\changes{4.50}{2022-10-14}{new} +%Provide a sentence-case version in order to set up a map. +% \begin{macrocode} +\newrobustcmd*{\Glslink}{% + \@gls@hyp@opt\@Gls@@link +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\newcommand*{\@Gls@@link}[3][]{% + \@gls@@link[#1]{#2}{\glssentencecase{#3}}% +} +\glsmfuaddmap{\glslink}{\Glslink} +% \end{macrocode} +% %\begin{macro}{\glspostlinkhook} %\changes{4.16}{2015-07-08}{new} % \begin{macrocode} @@ -8635,7 +8853,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %\begin{macro}{\glslinkcheckfirsthyperhook} -% Allow used to hook into the \cs{@gls@link@checkfirsthyper} macro +% Allow user to hook into the \cs{@gls@link@checkfirsthyper} macro %\changes{4.08}{2014-07-30}{new} % \begin{macrocode} \newcommand*{\glslinkcheckfirsthyperhook}{} @@ -8717,6 +8935,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \let\org@ifKV@glslink@hyper\ifKV@glslink@hyper % \end{macrocode} +%Save original setting of local key. +% \begin{macrocode} + \@gls@save@glslocal +% \end{macrocode} % Set defaults: %\changes{4.20}{2015-11-30}{added \cs{@gls@setdefault@glslink@opts}} % \begin{macrocode} @@ -8756,7 +8978,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % to prevent unwanted whatsit} % (De-tok'ing done by \cs{@@do@wrglossary}) % \begin{macrocode} - \@do@wrglossary{#2}% + \glsencapwrcontent{\@do@wrglossary{#2}}% \ifKV@glslink@hyper \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% \else @@ -8771,10 +8993,21 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Restore original setting % \begin{macrocode} \let\ifKV@glslink@hyper\org@ifKV@glslink@hyper + \@gls@restore@glslocal } % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsencapwrcontent} +%\changes{4.50}{2022-10-14}{new} +%This command is also provided by \sty{glossaries-extra} v1.49. +%It's purpose is to resolve +%\href{https://www.dickimaw-books.com/bugtracker.php?key=189}{issue \#189}. +% \begin{macrocode} +\newcommand*{\glsencapwrcontent}[1]{{#1}} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glolinkprefix} % \begin{macrocode} \newcommand*{\glolinkprefix}{glo:} @@ -8929,17 +9162,21 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Unsanitize \cs{gls@numberpage}, \cs{gls@alphpage}, % \cs{gls@Alphpage} and \cs{glsromanpage} (thanks to David~Carlise % for the suggestion.) +%\changes{4.50}{2022-10-14}{check esclocations setting} +%Skip if esclocations=false. % \begin{macrocode} - \@for\@gls@tmp:=\gls@protected@pagefmts\do - {% - \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% - \@onelevel@sanitize\@gls@sanitized@tmp - \edef\gls@dosubst{% - \noexpand\DTLsubstituteall\noexpand\gls@xdystring - {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% + \ifglsesclocations + \@for\@gls@tmp:=\gls@protected@pagefmts\do + {% + \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% + \@onelevel@sanitize\@gls@sanitized@tmp + \edef\gls@dosubst{% + \noexpand\DTLsubstituteall\noexpand\gls@xdystring + {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% + }% + \gls@dosubst }% - \gls@dosubst - }% + \fi % \end{macrocode} % Assign to required control sequence % \begin{macrocode} @@ -8947,7 +9184,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} %\end{macro} -% Catch special characters\mkidxspch\ (argument must be a +% Catch special characters (argument must be a % control sequence): %\begin{macro}{\@gls@checkmkidxchars} % \begin{macrocode} @@ -9008,7 +9245,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\@gls@checkquote} % Replace \verb|"| with \verb|""| since \verb|"| is a makeindex -% special character\mkidxspch. +% special character. % \begin{macrocode} \def\@gls@checkquote#1"#2"#3\null{% \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% @@ -9351,9 +9588,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \newlength\gls@tmplen \newcommand*{\glsdohypertarget}[2]{% - \@glsshowtarget{#1}% - \settoheight{\gls@tmplen}{#2}% - \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% + \glsdoshowtarget{#1}% + {% + \settoheight{\gls@tmplen}{#2}% + \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% + }% } % \end{macrocode} %\end{macro} @@ -9361,8 +9600,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{new} % \begin{macrocode} \newcommand*{\glsdohyperlink}[2]{% - \@glsshowtarget{#1}% - \hyperlink{#1}{#2}% + \glsdoshowtarget{#1}{\hyperlink{#1}{#2}}% } % \end{macrocode} %\end{macro} @@ -9375,9 +9613,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %\begin{macro}{\@glslink} -% If \ics{hyperlink} is not defined \cs{@glslink} +% If \cs{hyperlink} is not defined \cs{@glslink} % ignores its first argument and just does the second argument, -% otherwise it is equivalent to \ics{hyperlink}. +% otherwise it is equivalent to \cs{hyperlink}. %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} % \begin{macrocode} @@ -9394,9 +9632,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % to \cs{hyperlink} (memoir defines \cs{hyperlink} but not % \cs{hypertarget})} %\begin{macro}{\@glstarget} -% If \ics{hypertarget} is not defined, \cs{@glstarget} +% If \cs{hypertarget} is not defined, \cs{@glstarget} % ignores its first argument and just does the second argument, -% otherwise it is equivalent to \ics{hypertarget}. +% otherwise it is equivalent to \cs{hypertarget}. %\changes{1.16}{2008-08-27}{raised the hypertarget so the target text doesn't % scroll off the top of the page} % \begin{macrocode} @@ -9454,12 +9692,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% % keys used when the entry was defined. % % The first optional argument is a key-value list, the same as -% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, +% \cs{glslink}, % the mandatory argument is the entry label. % After the mandatory argument, there is another optional argument % to insert extra text in the link text (the location of the inserted -% text is governed by \ics{glsdisplay} and -% \ics{glsdisplayfirst}). As with \cs{glslink} +% text is governed by \cs{glsdisplay} and +% \cs{glsdisplayfirst}). As with \cs{glslink} % there is a starred version which is the same as the unstarred % version but with the \gloskey[glslink]{hyper} key set to \texttt{false}. % (Additional options can also be specified @@ -9528,11 +9766,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -9554,8 +9788,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Gls}{\@gls@hyp@opt\@Gls} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\gls}{\Gls} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGls}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Gls}[2][]{% @@ -9610,11 +9848,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -9624,13 +9858,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \cs{GLS} behaves like \ics{gls}, but the link +% \cs{GLS} behaves like \cs{gls}, but the link % text is converted to uppercase: %\changes{3.01}{2011-04-12}{made robust} %\begin{macro}{\GLS} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLS}{\@gls@hyp@opt\@GLS} +\glsmfublocker{\GLS} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLS}} @@ -9689,11 +9924,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -9703,7 +9934,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \cs{glspl} behaves in the same way as \ics{gls} except +% \cs{glspl} behaves in the same way as \cs{gls} except % it uses the plural form. %\begin{macro}{\glspl} %\changes{3.01}{2011-04-12}{made robust} @@ -9769,11 +10000,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -9783,9 +10010,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \cs{Glspl} behaves in the same way as \ics{glspl}, except +% \cs{Glspl} behaves in the same way as \cs{glspl}, except % that the first letter of the link text is converted to uppercase -% (as with \ics{Gls}, if the first letter has an accent, it +% (as with \cs{Gls}, if the first letter has an accent, it % will need to be grouped). %\begin{macro}{\Glspl} %\changes{3.01}{2011-04-12}{made robust} @@ -9794,8 +10021,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glspl}{\@gls@hyp@opt\@Glspl} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glspl}{\Glspl} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlspl}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Glspl}[2][]{% @@ -9854,11 +10085,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -9868,17 +10095,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \cs{GLSpl} behaves like \ics{glspl} except that all the +% \cs{GLSpl} behaves like \cs{glspl} except that all the % link text is converted to uppercase. %\begin{macro}{\GLSpl} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSpl}{\@gls@hyp@opt\@GLSpl} +\glsmfublocker{\GLSpl} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSpl}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@GLSpl}[2][]{% @@ -9936,11 +10164,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Indicate that this entry has now been used % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -10014,11 +10238,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Indicate that this entry has now been used %\changes{2.05}{2010-02-06}{Removed spurious brace. Patch provided by Sergiu Dotenco} % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \@gls@do@glsunset{#2}% }% % \end{macrocode} %\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} @@ -10028,6 +10248,23 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\Glsdisp} +%\changes{4.50}{2022-10-14}{new} +%Provide a sentence-case version to make it easier to map. +% \begin{macrocode} +\newrobustcmd*{\Glsdisp}{\@gls@hyp@opt\@Glsdisp} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@Glsdisp} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@Glsdisp}[3][]{% + \@glsdisp[#1]{#2}{\glssentencecase{#3}}% +} +\glsmfuaddmap{\glsdisp}{\Glsdisp} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@link@nocheckfirsthyper} %\changes{4.19}{2015-11-22}{new} % Instead of just setting \cs{do@gls@link@checkfirsthyper} to @@ -10040,6 +10277,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %\begin{macro}{\@gls@field@link} +%\begin{definition} +%\cs{@gls@field@link}\marg{options}\marg{label}\marg{link text} +%\end{definition} %\changes{4.03}{2014-01-20}{new} %\changes{4.08}{2014-07-30}{added assignment of \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} @@ -10057,7 +10297,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -% \cs{glstext} behaves like \ics{gls} except it always uses the value +% \cs{glstext} behaves like \cs{gls} except it always uses the value % given by the \gloskey{text} key and it doesn't mark the entry as % used. %\begin{macro}{\glstext} @@ -10089,6 +10329,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLStext}{\@gls@hyp@opt\@GLStext} +\glsmfublocker{\GLStext} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLStext}} @@ -10100,9 +10341,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLStext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrytext{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentrytext{#2}#3}}% } % \end{macrocode} % @@ -10115,8 +10357,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glstext}{\@gls@hyp@opt\@Glstext} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glstext}{\Glstext} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlstext}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Glstext}[2][]{% @@ -10131,7 +10377,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{glsfirst} behaves like \ics{gls} except it always uses the value +% \cs{glsfirst} behaves like \cs{gls} except it always uses the value % given by the \gloskey{first} key and it doesn't mark the entry as % used. %\begin{macro}{\glsfirst} @@ -10157,7 +10403,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the +% \cs{Glsfirst} behaves like \cs{glsfirst} except it displays the % first letter in uppercase. %\begin{macro}{\Glsfirst} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} @@ -10165,8 +10411,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsfirst}{\@gls@hyp@opt\@Glsfirst} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsfirst}{\Glsfirst} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsfirst}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Glsfirst}[2][]{% @@ -10181,12 +10431,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the +% \cs{GLSfirst} behaves like \cs{Glsfirst} except it displays the % text in uppercase. %\begin{macro}{\GLSfirst} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSfirst}{\@gls@hyp@opt\@GLSfirst} +\glsmfublocker{\GLSfirst} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSfirst}} @@ -10199,13 +10450,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Read in the final optional argument: % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryfirst}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirst{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryfirst{#2}#3}}% } % \end{macrocode} % -% \cs{glsplural} behaves like \ics{gls} except it always uses the value +% \cs{glsplural} behaves like \cs{gls} except it always uses the value % given by the \gloskey{plural} key and it doesn't mark the entry as % used. %\begin{macro}{\glsplural} @@ -10230,7 +10482,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsplural} behaves like \ics{glsplural} except that the first +% \cs{Glsplural} behaves like \cs{glsplural} except that the first % letter is converted to uppercase. %\begin{macro}{\Glsplural} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} @@ -10238,8 +10490,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsplural}{\@gls@hyp@opt\@Glsplural} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsplural}{\Glsplural} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsplural}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Glsplural}[2][]{% @@ -10254,17 +10510,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSplural} behaves like \ics{glsplural} except that the +% \cs{GLSplural} behaves like \cs{glsplural} except that the % text is converted to uppercase. %\begin{macro}{\GLSplural} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSplural}{\@gls@hyp@opt\@GLSplural} +\glsmfublocker{\GLSplural} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSplural}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@GLSplural}[2][]{% @@ -10273,13 +10530,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Read in the final optional argument: % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryplural}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryplural{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryplural{#2}#3}}% } % \end{macrocode} % -% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value +% \cs{glsfirstplural} behaves like \cs{gls} except it always uses the value % given by the \gloskey{firstplural} key and it doesn't mark the entry as % used. %\begin{macro}{\glsfirstplural} @@ -10306,7 +10564,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the +% \cs{Glsfirstplural} behaves like \cs{glsfirstplural} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsfirstplural} %\changes{3.01}{2011-04-12}{made robust} @@ -10315,6 +10573,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsfirstplural}{\@gls@hyp@opt\@Glsfirstplural} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsfirstplural}{\Glsfirstplural} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsfirstplural}} % Defined the un-starred form. Need to determine if there is % a final optional argument @@ -10332,13 +10594,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the +% \cs{GLSfirstplural} behaves like \cs{glsfirstplural} except that the % link text is converted to uppercase. %\begin{macro}{\GLSfirstplural} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSfirstplural}{\@gls@hyp@opt\@GLSfirstplural} +\glsmfublocker{\GLSfirstplural} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSfirstplural}} @@ -10352,13 +10615,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use %\cs{glsentryfirstplural}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirstplural{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryfirstplural{#2}#3}}% } % \end{macrocode} % -% \cs{glsname} behaves like \ics{gls} except it always uses the value +% \cs{glsname} behaves like \cs{gls} except it always uses the value % given by the \gloskey{name} key and it doesn't mark the entry as % used. %\begin{macro}{\glsname} @@ -10384,7 +10648,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsname} behaves like \ics{glsname} except that the +% \cs{Glsname} behaves like \cs{glsname} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsname} %\changes{3.01}{2011-04-12}{made robust} @@ -10393,8 +10657,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsname}{\@gls@hyp@opt\@Glsname} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsname}{\Glsname} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsname}} -% Defined the un-starred form. Need to determine if there is +% Define the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} \newcommand*{\@Glsname}[2][]{% @@ -10409,13 +10677,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSname} behaves like \ics{glsname} except that the +% \cs{GLSname} behaves like \cs{glsname} except that the % link text is converted to uppercase. %\begin{macro}{\GLSname} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSname}{\@gls@hyp@opt\@GLSname} +\glsmfublocker{\GLSname} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSname}} @@ -10428,13 +10697,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Read in the final optional argument: % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryname}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryname{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryname{#2}#3}}% } % \end{macrocode} % -% \cs{glsdesc} behaves like \ics{gls} except it always uses the value +% \cs{glsdesc} behaves like \cs{gls} except it always uses the value % given by the \gloskey{description} key and it doesn't mark the entry % as used. %\begin{macro}{\glsdesc} @@ -10460,7 +10730,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsdesc} behaves like \ics{glsdesc} except that the +% \cs{Glsdesc} behaves like \cs{glsdesc} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsdesc} %\changes{3.01}{2011-04-12}{made robust} @@ -10469,6 +10739,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsdesc}{\@gls@hyp@opt\@Glsdesc} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsdesc}{\Glsdesc} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsdesc}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10485,13 +10759,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSdesc} behaves like \ics{glsdesc} except that the +% \cs{GLSdesc} behaves like \cs{glsdesc} except that the % link text is converted to uppercase. %\begin{macro}{\GLSdesc} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSdesc}{\@gls@hyp@opt\@GLSdesc} +\glsmfublocker{\GLSdesc} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSdesc}} @@ -10504,13 +10779,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Read in the final optional argument: %\changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrydesc}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydesc{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentrydesc{#2}#3}}% } % \end{macrocode} % -% \cs{glsdescplural} behaves like \ics{gls} except it always uses the value +% \cs{glsdescplural} behaves like \cs{gls} except it always uses the value % given by the \gloskey{descriptionplural} key and it doesn't mark the entry % as used. %\begin{macro}{\glsdescplural} @@ -10537,7 +10813,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the +% \cs{Glsdescplural} behaves like \cs{glsdescplural} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsdescplural} %\changes{3.01}{2011-04-12}{made robust} @@ -10546,6 +10822,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsdescplural}{\@gls@hyp@opt\@Glsdescplural} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsdescplural}{\Glsdescplural} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsdescplural}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10563,13 +10843,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the +% \cs{GLSdescplural} behaves like \cs{glsdescplural} except that the % link text is converted to uppercase. %\begin{macro}{\GLSdescplural} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSdescplural}{\@gls@hyp@opt\@GLSdescplural} +\glsmfublocker{\GLSdescplural} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSdescplural}} @@ -10583,13 +10864,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use %\cs{glsentrydescplural}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydescplural{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentrydescplural{#2}#3}}% } % \end{macrocode} % -% \cs{glssymbol} behaves like \ics{gls} except it always uses the value +% \cs{glssymbol} behaves like \cs{gls} except it always uses the value % given by the \gloskey{symbol} key and it doesn't mark the entry as % used. %\begin{macro}{\glssymbol} @@ -10615,7 +10897,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glssymbol} behaves like \ics{glssymbol} except that the +% \cs{Glssymbol} behaves like \cs{glssymbol} except that the % first letter is converted to uppercase. %\begin{macro}{\Glssymbol} %\changes{3.01}{2011-04-12}{made robust} @@ -10624,6 +10906,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glssymbol}{\@gls@hyp@opt\@Glssymbol} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glssymbol}{\Glssymbol} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlssymbol}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10640,13 +10926,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the +% \cs{GLSsymbol} behaves like \cs{glssymbol} except that the % link text is converted to uppercase. %\begin{macro}{\GLSsymbol} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSsymbol}{\@gls@hyp@opt\@GLSsymbol} +\glsmfublocker{\GLSsymbol} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSsymbol}} @@ -10659,13 +10946,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Read in the final optional argument: %\changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrysymbol}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSsymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbol{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentrysymbol{#2}#3}}% } % \end{macrocode} % -% \cs{glssymbolplural} behaves like \ics{gls} except it always uses the value +% \cs{glssymbolplural} behaves like \cs{gls} except it always uses the value % given by the \gloskey{symbolplural} key and it doesn't mark the entry as % used. %\begin{macro}{\glssymbolplural} @@ -10692,7 +10980,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the +% \cs{Glssymbolplural} behaves like \cs{glssymbolplural} except that the % first letter is converted to uppercase. %\begin{macro}{\Glssymbolplural} %\changes{3.01}{2011-04-12}{made robust} @@ -10701,6 +10989,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glssymbolplural}{\@gls@hyp@opt\@Glssymbolplural} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glssymbolplural}{\Glssymbolplural} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlssymbolplural}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10718,13 +11010,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the +% \cs{GLSsymbolplural} behaves like \cs{glssymbolplural} except that the % link text is converted to uppercase. %\begin{macro}{\GLSsymbolplural} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSsymbolplural}{\@gls@hyp@opt\@GLSsymbolplural} +\glsmfublocker{\GLSsymbolplural} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSsymbolplural}} @@ -10738,13 +11031,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{1.13}{2008-05-10}{fixed bug that ignored 3rd parameter} %\changes{3.11a}{2013-10-15}{changed to just use %\cs{glsentrysymbolplural}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSsymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentrysymbolplural{#2}#3}}% } % \end{macrocode} % -% \cs{glsuseri} behaves like \ics{gls} except it always uses the value +% \cs{glsuseri} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user1} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuseri} @@ -10769,7 +11063,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuseri} behaves like \ics{glsuseri} except that the +% \cs{Glsuseri} behaves like \cs{glsuseri} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuseri} %\changes{3.01}{2011-04-12}{made robust} @@ -10778,6 +11072,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuseri}{\@gls@hyp@opt\@Glsuseri} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuseri}{\Glsuseri} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuseri}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10793,13 +11091,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuseri} behaves like \ics{glsuseri} except that the +% \cs{GLSuseri} behaves like \cs{glsuseri} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuseri} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuseri}{\@gls@hyp@opt\@GLSuseri} +\glsmfublocker{\GLSuseri} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuseri}} @@ -10811,13 +11110,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseri}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseri{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuseri{#2}#3}}% } % \end{macrocode} % -% \cs{glsuserii} behaves like \ics{gls} except it always uses the value +% \cs{glsuserii} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user2} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuserii} @@ -10842,7 +11142,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuserii} behaves like \ics{glsuserii} except that the +% \cs{Glsuserii} behaves like \cs{glsuserii} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuserii} %\changes{3.01}{2011-04-12}{made robust} @@ -10851,6 +11151,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuserii}{\@gls@hyp@opt\@Glsuserii} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuserii}{\Glsuserii} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuserii}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10866,13 +11170,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuserii} behaves like \ics{glsuserii} except that the +% \cs{GLSuserii} behaves like \cs{glsuserii} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuserii} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuserii}{\@gls@hyp@opt\@GLSuserii} +\glsmfublocker{\GLSuserii} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuserii}} @@ -10884,13 +11189,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserii}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserii{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuserii{#2}#3}}% } % \end{macrocode} % -% \cs{glsuseriii} behaves like \ics{gls} except it always uses the value +% \cs{glsuseriii} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user3} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuseriii} @@ -10915,7 +11221,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuseriii} behaves like \ics{glsuseriii} except that the +% \cs{Glsuseriii} behaves like \cs{glsuseriii} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuseriii} %\changes{3.01}{2011-04-12}{made robust} @@ -10924,6 +11230,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuseriii}{\@gls@hyp@opt\@Glsuseriii} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuseriii}{\Glsuseriii} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuseriii}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -10939,13 +11249,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuseriii} behaves like \ics{glsuseriii} except that the +% \cs{GLSuseriii} behaves like \cs{glsuseriii} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuseriii} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuseriii}{\@gls@hyp@opt\@GLSuseriii} +\glsmfublocker{\GLSuseriii} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuseriii}} @@ -10957,13 +11268,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriii}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriii{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuseriii{#2}#3}}% } % \end{macrocode} % -% \cs{glsuseriv} behaves like \ics{gls} except it always uses the value +% \cs{glsuseriv} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user4} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuseriv} @@ -10988,7 +11300,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuseriv} behaves like \ics{glsuseriv} except that the +% \cs{Glsuseriv} behaves like \cs{glsuseriv} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuseriv} %\changes{3.01}{2011-04-12}{made robust} @@ -10997,6 +11309,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuseriv}{\@gls@hyp@opt\@Glsuseriv} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuseriv}{\Glsuseriv} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuseriv}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11012,13 +11328,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuseriv} behaves like \ics{glsuseriv} except that the +% \cs{GLSuseriv} behaves like \cs{glsuseriv} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuseriv} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuseriv}{\@gls@hyp@opt\@GLSuseriv} +\glsmfublocker{\GLSuseriv} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuseriv}} @@ -11030,13 +11347,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriv}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriv{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuseriv{#2}#3}}% } % \end{macrocode} % -% \cs{glsuserv} behaves like \ics{gls} except it always uses the value +% \cs{glsuserv} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user5} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuserv} @@ -11061,7 +11379,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuserv} behaves like \ics{glsuserv} except that the +% \cs{Glsuserv} behaves like \cs{glsuserv} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuserv} %\changes{3.01}{2011-04-12}{made robust} @@ -11070,6 +11388,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuserv}{\@gls@hyp@opt\@Glsuserv} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuserv}{\Glsuserv} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuserv}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11085,13 +11407,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuserv} behaves like \ics{glsuserv} except that the +% \cs{GLSuserv} behaves like \cs{glsuserv} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuserv} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuserv}{\@gls@hyp@opt\@GLSuserv} +\glsmfublocker{\GLSuserv} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuserv}} @@ -11103,13 +11426,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserv}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserv{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuserv{#2}#3}}% } % \end{macrocode} % -% \cs{glsuservi} behaves like \ics{gls} except it always uses the value +% \cs{glsuservi} behaves like \cs{gls} except it always uses the value % given by the \gloskey{user6} key and it doesn't mark the entry % as used. %\begin{macro}{\glsuservi} @@ -11134,7 +11458,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{Glsuservi} behaves like \ics{glsuservi} except that the +% \cs{Glsuservi} behaves like \cs{glsuservi} except that the % first letter is converted to uppercase. %\begin{macro}{\Glsuservi} %\changes{3.01}{2011-04-12}{made robust} @@ -11143,6 +11467,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Glsuservi}{\@gls@hyp@opt\@Glsuservi} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsuservi}{\Glsuservi} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sGlsuservi}} % Defined the un-starred form. Need to determine if there is % a final optional argument @@ -11158,13 +11486,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \cs{GLSuservi} behaves like \ics{glsuservi} except that the +% \cs{GLSuservi} behaves like \cs{glsuservi} except that the % link text is converted to uppercase. %\begin{macro}{\GLSuservi} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\GLSuservi}{\@gls@hyp@opt\@GLSuservi} +\glsmfublocker{\GLSuservi} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sGLSuservi}} @@ -11176,9 +11505,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Read in the final optional argument: %\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuservi}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\@GLSuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuservi{#2}#3}}% + \@gls@field@link{#1}{#2}{\glsuppercase{\glsentryuservi{#2}#3}}% } % \end{macrocode} % @@ -11241,6 +11571,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Acrshort}{\@gls@hyp@opt\ns@Acrshort} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\Acrshort}{\Acrshort} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sAcrshort}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11289,6 +11623,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\ACRshort}{\@gls@hyp@opt\ns@ACRshort} +\glsmfublocker{\ACRshort} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sACRshort}} @@ -11311,13 +11646,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, % \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\glslabel{#2}% \let\glsifplural\@secondoftwo \let\glscapscase\@thirdofthree \let\glsinsert\@empty \def\glscustomtext{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshort{#2}}#3}% + \glsuppercase{\acronymfont{\glsentryshort{#2}}#3}% }% % \end{macrocode} %\changes{4.06}{2014-03-12}{added \cs{glsifhyper}} @@ -11392,6 +11728,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Acrshortpl}{\@gls@hyp@opt\ns@Acrshortpl} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\Acrshortpl}{\Acrshortpl} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sAcrshortpl}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11440,6 +11780,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\ACRshortpl}{\@gls@hyp@opt\ns@ACRshortpl} +\glsmfublocker{\ACRshortpl} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sACRshortpl}} @@ -11462,13 +11803,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, % \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\glslabel{#2}% \let\glsifplural\@firstoftwo \let\glscapscase\@thirdofthree \let\glsinsert\@empty \def\glscustomtext{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{#2}}#3}% + \glsuppercase{\acronymfont{\glsentryshortpl{#2}}#3}% }% % \end{macrocode} %\changes{4.06}{2014-03-12}{added \cs{glsifhyper}} @@ -11547,6 +11889,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Acrlong}{\@gls@hyp@opt\ns@Acrlong} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\Acrlong}{\Acrlong} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sAcrlong}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11600,6 +11946,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\ACRlong}{\@gls@hyp@opt\ns@ACRlong} +\glsmfublocker{\ACRlong} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sACRlong}} @@ -11632,9 +11979,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Bug fix v4.02 removed \cs{acronymfont} from \cs{glscustomtext} % (\cs{acronymfont} only designed for short form). % \changes{4.02}{2013-12-05}{Removed \cs{acronymfont}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\glscustomtext{% - \mfirstucMakeUppercase{\glsentrylong{#2}#3}% + \glsuppercase{\glsentrylong{#2}#3}% }% % \end{macrocode} %\changes{4.08}{2014-07-30}{moved \cs{glsifhyper}} @@ -11713,6 +12061,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newrobustcmd*{\Acrlongpl}{\@gls@hyp@opt\ns@Acrlongpl} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\Acrlongpl}{\Acrlongpl} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{@sAcrlongpl}} % Define the un-starred form. Need to determine if there is % a final optional argument @@ -11767,6 +12119,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} % \begin{macrocode} \newrobustcmd*{\ACRlongpl}{\@gls@hyp@opt\ns@ACRlongpl} +\glsmfublocker{\ACRlongpl} % \end{macrocode} %\end{macro} %\changes{4.08}{2014-07-30}{removed \cs{@sACRlongpl}} @@ -11799,9 +12152,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Bug fix v4.02 removed \cs{acronymfont} from \cs{glscustomtext} % (\cs{acronymfont} only designed for short form). % \changes{4.02}{2013-12-05}{Removed \cs{acronymfont}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \def\glscustomtext{% - \mfirstucMakeUppercase{\glsentrylongpl{#2}#3}% + \glsuppercase{\glsentrylongpl{#2}#3}% }% % \end{macrocode} %\changes{4.08}{2014-07-30}{moved \cs{glsifhyper}} @@ -11817,7 +12171,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} % -% \subsubsection{Displaying entry details without adding +%\subsubsection{Displaying entry details without adding % information to the glossary} %\label{sec:code:glsnolink} % @@ -11827,12 +12181,15 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\@gls@entry@field} % Generic version. %\changes{4.03}{2014-01-20}{new} +%\changes{4.50}{2022-10-14}{switched to \cs{csuse}} %\begin{definition} %\cs{@gls@entry@field}\marg{label}\marg{field} %\end{definition} +%Now using \cs{csuse} instead of \cs{csname} to expand to nothing +%rather than \cs{relax} if undefined. % \begin{macrocode} \newcommand*{\@gls@entry@field}[2]{% - \csname glo@\glsdetoklabel{#1}@#2\endcsname + \csuse{glo@\glsdetoklabel{#1}@#2}% } % \end{macrocode} %\end{macro} @@ -11855,14 +12212,15 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{definition} %\cs{@Gls@entry@field}\marg{label}\marg{field} %\end{definition} +%Check for PDF bookmarks performed by \cs{@Glsentryfield}. % \begin{macrocode} -\newcommand*{\@Gls@entry@field}[2]{% +\newrobustcmd*{\@Gls@entry@field}[2]{% \glsdoifexistsordo{#1}% {% \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% \ifdef\@glo@text {% - \xmakefirstuc{\@glo@text}% + \expandafter\glssentencecase\expandafter{\@glo@text}% }% {% ??\PackageError{glossaries}{The field `#2' doesn't exist for glossary @@ -11877,6 +12235,33 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%Aside from \cs{Glsentryname}, the \cs{Glsentry\ldots} sentence case commands can +%all follow the same format. +%\begin{macro}{\@Glsentryfield} +%\changes{4.50}{2022-10-14}{new} +%\begin{definition} +%\cs{@Glsentryfield}\marg{entry-label}\marg{field-label} +%\end{definition} +% \begin{macrocode} +\newcommand{\@Glsentryfield}[2]{% + \glstexorpdfstring{\@Gls@entry@field{#1}{#2}}% + {\MFUsentencecase{\@gls@entry@field{#1}{#2}}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glstexorpdfstring} +%\changes{4.50}{2022-10-14}{new} +%Provide a command that will use \cs{texorpdfstring} if it has been +%defined. (Remove all the cumbersome tests to determine whether or +%not that command has been defined.) +% \begin{macrocode} +\ifdef\texorpdfstring +{\newcommand{\glstexorpdfstring}{\texorpdfstring}} +{\newcommand{\glstexorpdfstring}[2]{#1}} +% \end{macrocode} +%\end{macro} +% % Get the entry name (as specified by the \gloskey{name} key % when the entry was defined). The argument % is the label associated with the entry. Note that unless you @@ -11888,19 +12273,33 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\glsentryname}[1]{\@gls@entry@field{#1}{name}} % \end{macrocode} %\end{macro} +%The sentence-case equivalents were made robust since they use the +%non-expandable \cs{makefirstuc}. These will now expand in the PDF +%bookmarks to sentence case using \cs{MFUsentencecase} (which is +%expandable). Obviously, if any of the fields contain non-expandable +%content (such as acronym font changing commands) then that will +%cause a problem (which can be dealt with by using \sty{hyperref}'s +%\cs{pdfstringdefDisableCommands}). %\begin{macro}{\Glsentryname} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryname}[1]{% - \@Gls@entryname{#1}% +\newcommand*{\Glsentryname}[1]{% + \glstexorpdfstring{\protect\@Gls@entryname{#1}}% + {\MFUsentencecase{\@gls@entry@field{#1}{name}}}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryname}{\Glsentryname} +% \end{macrocode} % %\begin{macro}{\@Gls@entryname} %\changes{4.10}{2014-08-27}{new} % This is a workaround in the event that the user defies the warning % in the manual about not using \cs{Glsname} or \cs{Glsentryname} with acronyms. +% The check for PDF bookmarks is in \cs{Glsentryname}. % First the default behaviour: % \begin{macrocode} \newcommand*{\@Gls@entryname}[1]{% @@ -11910,15 +12309,45 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\@Gls@acrentryname} %\changes{4.10}{2014-08-27}{new} -% Now the behaviour when \cs{setacronymstyle} is used: +%\changes{4.50}{2022-10-14}{removed \sty{mfirstuc} internal commands} +% Now the behaviour when \cs{setacronymstyle} is used. The original +% definition of this command used \sty{mfirstuc} internal commands that are now +% being deprecated. % \begin{macrocode} -\newcommand*{\@Gls@acrentryname}[1]{% +\newrobustcmd*{\@Gls@acrentryname}[1]{% + \ifglshaslong{#1}% + {% +% \end{macrocode} +%Just need to ensure that \cs{acrnameformat} is expanded, which may +%cause problems as non-robust semantic commands may expand to +%content that interferes with sentence-casing. +% \begin{macrocode} + \protected@edef\@glo@text{\@gls@entry@field{#1}{name}}% + \expandafter\glssentencecase\expandafter{\@glo@text}% + }% + {% +% \end{macrocode} +% Not an acronym +% \begin{macrocode} + \@Gls@entry@field{#1}{name}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@org@Gls@acrentryname} +%Original definition of \cs{@Gls@acrentryname}. This will be removed +%in a later version. +%\changes{4.50}{2022-10-14}{saved original definition of +%\cs{@Gls@acrentryname}} +% \begin{macrocode} +\newcommand*{\@org@Gls@acrentryname}[1]{% \ifglshaslong{#1}% {% \letcs\@glo@text{glo@\glsdetoklabel{#1}@name}% % \end{macrocode} %\cs{@gls@getbody} is defined by \sty{mfirstuc} (which used to be -%part of \styfmt{glossaries}). +%part of \sty{glossaries}). % \begin{macrocode} \expandafter\@gls@getbody\@glo@text{}\@nil \expandafter\ifx\@gls@body\glsentrylong\relax @@ -11949,7 +12378,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@glo@text }% \else - \xmakefirstuc{\@glo@text}% + \expandafter\glssentencecase\expandafter{\@glo@text}% \fi \fi \fi @@ -11976,14 +12405,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\glsentrydesc}[1]{\@gls@entry@field{#1}{desc}} % \end{macrocode} %\end{macro} +% %\begin{macro}{\Glsentrydesc} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrydesc}[1]{% - \@Gls@entry@field{#1}{desc}% -} +\newcommand*{\Glsentrydesc}[1]{\@Glsentryfield{#1}{desc}} % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrydesc}{\Glsentrydesc} +% \end{macrocode} % Plural form: %\begin{macro}{\glsentrydescplural} %\changes{1.12}{2008-03-08}{New} @@ -11996,12 +12429,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentrydescplural} %\changes{1.12}{2008-03-08}{New} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrydescplural}[1]{% - \@Gls@entry@field{#1}{descplural}% +\newcommand*{\Glsentrydescplural}[1]{% + \@Glsentryfield{#1}{descplural}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrydescplural}{\Glsentrydescplural} +% \end{macrocode} % % Get the entry text, as specified by the \gloskey{text} key when % the entry was defined. The argument @@ -12013,12 +12451,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\Glsentrytext} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrytext}[1]{% - \@Gls@entry@field{#1}{text}% +\newcommand*{\Glsentrytext}[1]{% + \@Glsentryfield{#1}{text}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrytext}{\Glsentrytext} +% \end{macrocode} % % Get the plural form: %\begin{macro}{\glsentryplural} @@ -12030,12 +12473,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\Glsentryplural} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryplural}[1]{% - \@Gls@entry@field{#1}{plural}% +\newcommand*{\Glsentryplural}[1]{% + \@Glsentryfield{#1}{plural}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryplural}{\Glsentryplural} +% \end{macrocode} % % Get the symbol associated with this entry. The argument % is the label associated with the entry. @@ -12048,12 +12496,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\Glsentrysymbol} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrysymbol}[1]{% - \@Gls@entry@field{#1}{symbol}% +\newcommand*{\Glsentrysymbol}[1]{% + \@Glsentryfield{#1}{symbol}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrysymbol}{\Glsentrysymbol} +% \end{macrocode} % Plural form: %\begin{macro}{\glsentrysymbolplural} %\changes{1.12}{2008-03-08}{New} @@ -12066,12 +12519,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentrysymbolplural} %\changes{1.12}{2008-03-08}{New} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrysymbolplural}[1]{% - \@Gls@entry@field{#1}{symbolplural}% +\newcommand*{\Glsentrysymbolplural}[1]{% + \@Glsentryfield{#1}{symbolplural}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrysymbolplural}{\Glsentrysymbolplural} +% \end{macrocode} % % Get the entry text to be used when the entry is first used in % the document (as specified by the \gloskey{first} key when @@ -12085,12 +12543,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\Glsentryfirst} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryfirst}[1]{% - \@Gls@entry@field{#1}{first}% +\newcommand*{\Glsentryfirst}[1]{% + \@Glsentryfield{#1}{first}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryfirst}{\Glsentryfirst} +% \end{macrocode} % % Get the plural form (as specified by the \gloskey{firstplural} % key when the entry was defined). @@ -12104,12 +12567,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\Glsentryfirstplural} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryfirstplural}[1]{% - \@Gls@entry@field{#1}{firstpl}% +\newcommand*{\Glsentryfirstplural}[1]{% + \@Glsentryfield{#1}{firstpl}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryfirstplural}{\Glsentryfirstplural} +% \end{macrocode} % %\begin{macro}{\glscapitalisewords} %\changes{4.48}{2021-10-19}{new} @@ -12125,6 +12593,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glsentrytitlecase} %\changes{4.22}{2016-04-19}{new} %\changes{4.45}{2020-02-13}{added existence check} +%\changes{4.50}{2022-10-14}{use sentence case for PDF bookmark} +%Now uses sentence case in PDF bookmark. +% \begin{macrocode} +\newcommand*{\glsentrytitlecase}[2]{% + \glstexorpdfstring + {\@glsentrytitlecase{#1}{#2}}% + {\MFUsentencecase{\@gls@entry@field{#1}{#2}}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glsentrytitlecase} % \begin{macrocode} \newrobustcmd*{\@glsentrytitlecase}[2]{% \glsdoifexists{#1}% @@ -12133,23 +12612,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% \expandafter\glscapitalisewords\expandafter{\@gls@value}% }% } -\ifdef\texorpdfstring -{ - \newcommand*{\glsentrytitlecase}[2]{% - \texorpdfstring - {\@glsentrytitlecase{#1}{#2}}% - {\@gls@entry@field{#1}{#2}}% - } -} -{ - \newcommand*{\glsentrytitlecase}[2]{\@glsentrytitlecase{#1}{#2}} -} % \end{macrocode} %\end{macro} % +% % Display the glossary type with which this entry is associated % (as specified by the \gloskey{type} key used when the entry was -% defined) +% defined). This expands to a label so isn't intended to produce +% text in the document. %\begin{macro}{\glsentrytype} % \begin{macrocode} \newcommand*{\glsentrytype}[1]{\@gls@entry@field{#1}{type}} @@ -12159,6 +12629,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Display the sort text used for this entry. Note that the % \gloskey{sort} key is sanitize, so unexpected results may % occur if the \gloskey{sort} key contained commands. +% This is likewise not intended to produce text in the document, +% other than for debugging purposes. %\begin{macro}{\glsentrysort} % \begin{macrocode} \newcommand*{\glsentrysort}[1]{% @@ -12168,7 +12640,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %\begin{macro}{\glsentryparent} -%Expands to the label of the entry's parent. +%Expands to the label of the entry's parent. +%This expands to a label so isn't intended to produce +%text in the document. %\changes{4.45}{2020-02-13}{new} % \begin{macrocode} \newcommand*{\glsentryparent}[1]{% @@ -12191,12 +12665,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuseri} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuseri}[1]{% - \@Gls@entry@field{#1}{useri}% +\newcommand*{\Glsentryuseri}[1]{% + \@Glsentryfield{#1}{useri}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuseri}{\Glsentryuseri} +% \end{macrocode} % %\begin{macro}{\glsentryuserii} % Get the second user key (as specified by the @@ -12212,12 +12691,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuserii} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuserii}[1]{% - \@Gls@entry@field{#1}{userii}% +\newcommand*{\Glsentryuserii}[1]{% + \@Glsentryfield{#1}{userii}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuserii}{\Glsentryuserii} +% \end{macrocode} % %\begin{macro}{\glsentryuseriii} % Get the third user key (as specified by the @@ -12233,12 +12717,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuseriii} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuseriii}[1]{% - \@Gls@entry@field{#1}{useriii}% +\newcommand*{\Glsentryuseriii}[1]{% + \@Glsentryfield{#1}{useriii}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuseriii}{\Glsentryuseriii} +% \end{macrocode} % %\begin{macro}{\glsentryuseriv} % Get the fourth user key (as specified by the @@ -12254,12 +12743,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuseriv} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuseriv}[1]{% - \@Gls@entry@field{#1}{useriv}% +\newcommand*{\Glsentryuseriv}[1]{% + \@Glsentryfield{#1}{useriv}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuseriv}{\Glsentryuseriv} +% \end{macrocode} % %\begin{macro}{\glsentryuserv} % Get the fifth user key (as specified by the @@ -12275,12 +12769,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuserv} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuserv}[1]{% - \@Gls@entry@field{#1}{userv}% +\newcommand*{\Glsentryuserv}[1]{% + \@Glsentryfield{#1}{userv}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuserv}{\Glsentryuserv} +% \end{macrocode} % %\begin{macro}{\glsentryuservi} % Get the sixth user key (as specified by the @@ -12296,12 +12795,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryuservi} %\changes{2.04}{2009-11-10}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryuservi}[1]{% - \@Gls@entry@field{#1}{uservi}% +\newcommand*{\Glsentryuservi}[1]{% + \@Glsentryfield{#1}{uservi}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryuservi}{\Glsentryuservi} +% \end{macrocode} % %\begin{macro}{\glsentryshort} % Get the short key (as specified by the @@ -12315,12 +12819,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryshort} %\changes{3.0}{2011-04-02}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryshort}[1]{% - \@Gls@entry@field{#1}{short}% +\newcommand*{\Glsentryshort}[1]{% + \@Glsentryfield{#1}{short}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryshort}{\Glsentryshort} +% \end{macrocode} % %\begin{macro}{\glsentryshortpl} % Get the short plural key (as specified by the @@ -12334,12 +12843,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentryshortpl} %\changes{3.0}{2011-04-02}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentryshortpl}[1]{% - \@Gls@entry@field{#1}{shortpl}% +\newcommand*{\Glsentryshortpl}[1]{% + \@Glsentryfield{#1}{shortpl}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryshortpl}{\Glsentryshortpl} +% \end{macrocode} % %\begin{macro}{\glsentrylong} % Get the long key (as specified by the @@ -12353,12 +12867,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentrylong} %\changes{3.0}{2011-04-02}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrylong}[1]{% - \@Gls@entry@field{#1}{long}% +\newcommand*{\Glsentrylong}[1]{% + \@Glsentryfield{#1}{long}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrylong}{\Glsentrylong} +% \end{macrocode} % %\begin{macro}{\glsentrylongpl} % Get the long plural key (as specified by the @@ -12372,20 +12891,27 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\Glsentrylongpl} %\changes{3.0}{2011-04-02}{new} %\changes{3.09a}{2013-10-09}{made robust} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\newrobustcmd*{\Glsentrylongpl}[1]{% - \@Gls@entry@field{#1}{longpl}% +\newcommand*{\Glsentrylongpl}[1]{% + \@Glsentryfield{#1}{longpl}% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentrylongpl}{\Glsentrylongpl} +% \end{macrocode} % % Short cut macros to access full form: %\begin{macro}{\glsentryfull} %\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} %\changes{4.02}{2013-12-05}{bug fix: added missing \cs{acronymfont}} +%This definition shouldn't actually be used. This command will be +%redefined by the acronym style. % \begin{macrocode} \newcommand*{\glsentryfull}[1]{% - \acrfullformat{\glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% + \glsentrylong{#1} (\glsentryshort{#1})% } % \end{macrocode} %\end{macro} @@ -12395,17 +12921,25 @@ false,nolabel,autolabel,nameref}[nolabel]{% %with \cs{glsentryshort})} %\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} %\changes{4.02}{2013-12-05}{bug fix: added missing \cs{acronymfont}} +%This definition shouldn't actually be used. This command will be +%redefined by the acronym style. % \begin{macrocode} -\newrobustcmd*{\Glsentryfull}[1]{% - \acrfullformat{\Glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% +\newcommand*{\Glsentryfull}[1]{% + \Glsentrylong{#1} (\glsentryshort{#1})% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryfull}{\Glsentryfull} +% \end{macrocode} %\begin{macro}{\glsentryfullpl} %\changes{3.02}{2012-05-21}{fixed bug (replaced \cs{glsentryshort} %with \cs{glsentryshortpl})} %\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} %\changes{4.02}{2013-12-05}{bug fix: added missing \cs{acronymfont}} +%This definition shouldn't actually be used. This command will be +%redefined by the acronym style. % \begin{macrocode} \newcommand*{\glsentryfullpl}[1]{% \acrfullformat{\glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% @@ -12416,12 +12950,18 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{3.09a}{2013-10-09}{made robust} %\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} %\changes{4.02}{2013-12-05}{bug fix: added missing \cs{acronymfont}} +%This definition shouldn't actually be used. This command will be +%redefined by the acronym style. % \begin{macrocode} -\newrobustcmd*{\Glsentryfullpl}[1]{% - \acrfullformat{\Glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% +\newcommand*{\Glsentryfullpl}[1]{% + \Glsentrylongpl{#1} (\glsentryshortpl{#1})% } % \end{macrocode} %\end{macro} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\glsentryfullpl}{\Glsentryfullpl} +% \end{macrocode} % %\begin{macro}{\glsentrynumberlist} %\changes{3.02}{2012-05-21}{new} @@ -12510,7 +13050,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glshyperlink} % Provide a hyperlink to a glossary entry without adding information % to the glossary file. The entry needs to be added using a -% command like \ics{glslink} or \ics{glsadd} to ensure that +% command like \cs{glslink} or \cs{glsadd} to ensure that % the target is defined. The first (optional) argument specifies % the link text. The entry name is used by default. The second % argument is the entry label. @@ -12525,7 +13065,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Adding an entry to the glossary without generating +%\subsection{Adding an entry to the glossary without generating % text} % The following keys are provided for \cs{glsadd} and % \cs{glsaddall}: @@ -12594,6 +13134,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} %\end{macro} +%Identify \cs{glsadd} as an exclusion, but this will only work if +%the optional argument is omitted. If the optional argument is +%required, the \cs{glsadd} command with arguments will need to be +%encapsulated with \cs{MFUskippunc}. See the \sty{mfirstuc} v2.08+ +%manual for further details. +% \begin{macrocode} +\glsmfuexcl{\glsadd} +% \end{macrocode} % %\begin{macro}{\@gls@adjustmode} %\changes{4.12}{2014-11-22}{new} @@ -12603,6 +13151,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%The following aren't added as exclusions, since there's no reason +%for them to occur at the start of content that may require a +%case-change (such as at the start of a description). %\begin{definition} %\cs{glsaddall}\oarg{option list} %\end{definition} @@ -12624,7 +13175,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\glsaddallunused} %\begin{definition} -%\cs{glsaddallunused}\oarg{glossary type} +%\cs{glsaddallunused}\oarg{glossary types} %\end{definition} % Add all used terms defined for the listed glossaries (without displaying % any text). If optional argument is omitted, apply to all @@ -12650,7 +13201,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Creating associated files} +%\subsection{Creating associated files} % The \cs{writeist} command creates the associated % customized \filetype{.ist} \app{makeindex} style file. % While defining this command, some characters have their @@ -12659,7 +13210,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % actual character (usually "@") is redefined to be a "?", to allow % internal commands to be written to the glossary file output file. % -% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar}, +% The special characters are stored in \cs{@gls@actualchar}, % \cs{@gls@encapchar}, \cs{@glsl@levelchar} and % \cs{@gls@quotechar} to make them easier to use later, % but don't change these values, because the characters are @@ -12670,12 +13221,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The symbols and numbers label for group headings are hardwired into % the \filetype{.ist} file as \texttt{glssymbols} and % \texttt{glsnumbers}, the group titles can be translated -% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols} -% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers}) -% using the command \ics{glsgetgrouptitle} which is -% defined in \isty{glossary-hypernav}. This is done to prevent -% any problem characters in \ics{glssymbolsgroupname} -% and \ics{glsnumbersgroupname} from breaking hyperlinks. +% (so that \cs{glssymbolsgroupname} replaces \texttt{glssymbols} +% and \cs{glsnumbersgroupname} replaces \texttt{glsnumbers}) +% using the command \cs{glsgetgrouptitle} which is +% defined in \sty{glossary-hypernav}. This is done to prevent +% any problem characters in \cs{glssymbolsgroupname} +% and \cs{glsnumbersgroupname} from breaking hyperlinks. % %\begin{macro}{\glsopenbrace} % Define \cs{glsopenbrace} to make it easier to write an opening @@ -12925,7 +13476,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Cross-reference class. (The unverified option is used as the % cross-references are supplied using the list of labels along with -% the optional argument for \ics{glsseeformat} which +% the optional argument for \cs{glsseeformat} which % \app{xindy} won't recognise.) % \begin{macrocode} \write\glswrite{^^J; define cross-reference class^^J}% @@ -13086,6 +13637,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Suppress any further calls. % \begin{macrocode} \let\writeist\relax + \let\noist\@gls@noist@toolate } \else % \end{macrocode} @@ -13171,6 +13723,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \closeout\glswrite \let\writeist\relax + \let\noist\@gls@noist@toolate } \fi % \end{macrocode} @@ -13378,17 +13931,27 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@noist@toolate} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\@gls@noist@toolate}{% + \GlossariesWarning{too late to use \string\noist. The style file +has already been written}% +} +% \end{macrocode} +%\end{macro} +% % \cs{@makeglossary} is an internal command that takes an % argument indicating the glossary type. This command will % create the glossary file required by \app{makeindex} for the % given glossary type, using the extension supplied by the -% \meta{out-ext} parameter used in \ics{newglossary} -% (and it will also activate the \ics{glossary} command, +% \meta{out-ext} parameter used in \cs{newglossary} +% (and it will also activate the \cs{glossary} command, % and create the customized \filetype{.ist} \app{makeindex} % style file). % % Note that you can't use \cs{@makeglossary} for only some of the -% defined glossaries (with just the base \styfmt{glossaries} package). You either need +% defined glossaries (with just the base \sty{glossaries} package). You either need % to have a \cs{makeglossaries} for all glossaries or none (otherwise % you will end up with a situation where \TeX\ is trying to write to a non-existant % file). The relevant glossary must be defined prior to using \cs{@makeglossary}. @@ -13456,15 +14019,19 @@ false,nolabel,autolabel,nameref}[nolabel]{% \ifdefstring{\glsorder}{letter}% {\def\@gls@order{-M ord/letorder }}% {\let\@gls@order\@empty}% - \ifcsundef{@xdy@#1@language}% - {\let\@gls@langmod\@xdy@main@language}% - {\letcs\@gls@langmod{@xdy@#1@language}}% + \gls@xdy@set@lang{#1}% +% \end{macrocode} +%\changes{4.50}{2022-10-14}{added check for void codepage} +% \begin{macrocode} + \ifdefvoid\gls@codepage + {\let\@@gls@codepage\@empty}% + {\def\@@gls@codepage{-C \gls@codepage\space}}% \edef\@gls@dothiswrite{\noexpand\write18{xindy -I xindy \@gls@order -L \@gls@langmod\space -M \gls@istfilebase\space - -C \gls@codepage\space + \@@gls@codepage -t \jobname.\csuse{@glotype@#1@log} -o \jobname.\csuse{@glotype@#1@in} \jobname.\csuse{@glotype@#1@out}}% @@ -13503,6 +14070,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.42}{2019-01-06}{new} %Unstarred form of \cs{ifglossaryexists} is used as %\cs{@gls@automake@immediate} can't be used with an ignored glossary. +%Note that \qt{out} means the output file from this package's point +%of view. It will be the input file from the indexing application's +%point of view. % \begin{macrocode} \ifglsxindy \newcommand*{\@gls@automake@immediate}[1]{% @@ -13513,15 +14083,22 @@ false,nolabel,autolabel,nameref}[nolabel]{% \ifdefstring{\glsorder}{letter}% {\def\@gls@order{-M ord/letorder }}% {\let\@gls@order\@empty}% - \ifcsundef{@xdy@#1@language}% - {\let\@gls@langmod\@xdy@main@language}% - {\letcs\@gls@langmod{@xdy@#1@language}}% +% \end{macrocode} +%Set \cs{@gls@langmod}: +% \begin{macrocode} + \gls@xdy@set@lang{#1}% +% \end{macrocode} +%\changes{4.50}{2022-10-14}{added check for void codepage} +% \begin{macrocode} + \ifdefvoid\gls@codepage + {\let\@@gls@codepage\@empty}% + {\def\@@gls@codepage{-C \gls@codepage\space}}% \edef\@gls@dothiswrite{\noexpand\immediate\noexpand\write18{xindy -I xindy \@gls@order -L \@gls@langmod\space -M \gls@istfilebase\space - -C \gls@codepage\space + \@@gls@codepage -t \jobname.\csuse{@glotype@#1@log} -o \jobname.\csuse{@glotype@#1@in} \jobname.\csuse{@glotype@#1@out}}% @@ -13575,17 +14152,34 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@automake@types} +%\changes{4.50}{2022-10-14}{new} +%The list of glossaries to build if automake is on. +%Provided for \sty{glossaries-extra}'s hybrid option. +% \begin{macrocode} +\newcommand{\@gls@automake@types}{\@glo@types} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@@automake@immediate} %\changes{4.42}{2019-01-06}{new} % \begin{macrocode} \newcommand{\@gls@@automake@immediate}{% \ifnum\gls@automake@nr=2\relax - \@for\@gls@type:=\@glo@types\do{% + \@for\@gls@type:=\@gls@automake@types\do{% \ifdefempty{\@gls@type}{}% {\@gls@automake@immediate{\@gls@type}}% }% \glsautomakefalse \renewcommand*{\@gls@doautomake}{}% + \else + \ifdefempty\gls@automake@makegloss{}% + {% + \IfFileExists{\jobname.aux}% + {\immediate\write18{\gls@automake@makegloss\space \jobname}}{}% + \glsautomakefalse + \renewcommand*{\@gls@doautomake}{}% + }% \fi } % \end{macrocode} @@ -13599,6 +14193,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\makeglossaries} % \begin{macrocode} \newcommand*{\makeglossaries}{% + \ifglsxindy + \def\glsindexingsetting{xindy}% + \else + \def\glsindexingsetting{makeindex}% + \fi \@domakeglossaries {% % \end{macrocode} @@ -13646,7 +14245,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% % \end{macrocode} % New glossaries must be created before \cs{makeglossaries} -% so disable \ics{newglossary}. +% so disable \cs{newglossary}. % \begin{macrocode} \renewcommand*\newglossary[4][]{% \PackageError{glossaries}{New glossaries @@ -13704,7 +14303,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \begin{macrocode} \ifglsautomake \renewcommand*{\@gls@doautomake}{% - \@for\@gls@type:=\@glo@types\do{% + \@for\@gls@type:=\@gls@automake@types\do{% \ifdefempty{\@gls@type}{}% {\@gls@automake{\@gls@type}}% }% @@ -13725,7 +14324,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} % %\begin{macro}{\@makeglossaries@warn@noprintglossary} -%\changes{4.47}{??}{new} +%\changes{4.47}{2021-09-20}{new} % \begin{macrocode} \newcommand\@makeglossaries@warn@noprintglossary{% \ifdefstring{\@glo@types}{,}% @@ -13748,9 +14347,9 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \cs{makeglossaries} so that it's only defined if needed. %\end{macro} % -% If \ics{makeglossaries} hasn't been used, issue a warning. -% Also issue a warning if neither \ics{printglossaries} nor -% \ics{printglossary} have been used. +% If \cs{makeglossaries} hasn't been used, issue a warning. +% Also issue a warning if neither \cs{printglossaries} nor +% \cs{printglossary} have been used. % \begin{macrocode} \AtEndDocument{% \warn@nomakeglossaries @@ -13764,6 +14363,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % needed for \cs{printnoidxglossary} % \begin{macrocode} \newcommand*{\makenoidxglossaries}{% + \def\glsindexingsetting{noidx}% \@domakeglossaries {% % \end{macrocode} @@ -13858,7 +14458,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \string\makeglossaries}% }% % \end{macrocode} -% Redefine \ics{glsentrynumberlist} +% Redefine \cs{glsentrynumberlist} % \begin{macrocode} \renewcommand*{\glsentrynumberlist}[1]{% \letcs{\@gls@loclist}{glo@\glsdetoklabel{##1}@loclist}% @@ -13875,7 +14475,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% }% % \end{macrocode} -% Redefine \ics{glsdisplaynumberlist} +% Redefine \cs{glsdisplaynumberlist} % \begin{macrocode} \renewcommand*{\glsdisplaynumberlist}[1]{% \letcs{\@gls@loclist}{glo@\glsdetoklabel{##1}@loclist}% @@ -13936,6 +14536,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Check sort option allowed. % \begin{macrocode} \@glo@check@sortallowed\makenoidxglossaries +% \end{macrocode} +% Implement nonumberlist +% \begin{macrocode} + \let\@gls@savenonumberlist\gls@noidx@nonumberlist }% } % \end{macrocode} @@ -13947,10 +14551,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\glsnumberlistloop} %\begin{definition} -%\cs{glsnumberlistloop}\marg{label}\marg{handler} +%\cs{glsnumberlistloop}\marg{label}\marg{handler}\marg{xr handler cs} %\end{definition} +%\changes{4.50}{2022-10-14}{corrected parameter number} % \begin{macrocode} -\newcommand*{\glsnumberlistloop}[2]{% +\newcommand*{\glsnumberlistloop}[3]{% \PackageError{glossaries}{\string\glsnumberlistloop\space only works with \string\makenoidxglossaries}{}% } @@ -13991,15 +14596,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % -%\section{Writing information to associated files} +%\subsection{Writing information to associated files} %\label{sec:wrgloss} % %\begin{macro}{\gls@noidxglossary} % Write the glossary information to the aux file (for the `noidx' -% method): +% method). +%\changes{4.50}{2022-10-14}{added \cs{glswrglossdisablelocationcmds}} % \begin{macrocode} \newcommand*{\gls@noidxglossary}{% - \protected@write\@auxout{}{% + \protected@write\@auxout{\glswrglossdisablelocationcmds}{% \string\@gls@reference {\csname glo@\@gls@label @type\endcsname}% {\@gls@label}% @@ -14017,10 +14623,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\istfile} %\changes{3.0}{2011-04-02}{deprecated} %\changes{4.40}{2018-06-01}{changed \cs{def} to \cs{providecommand}} -% Deprecated. -% \begin{macrocode} -\providecommand\istfile{\glswrite} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated in v3.0 (2011-04-02). Removed in v4.50. %\end{macro} % % At the end of the document, the files should be created if @@ -14078,10 +14682,10 @@ you %\end{macro} % % As from v4.10, the \cs{glossary} command isn't -% used by the \styfmt{glossaries} package. Since the -% user isn't expected to use this command (as \styfmt{glossaries} +% used by the \sty{glossaries} package. Since the +% user isn't expected to use this command (as \sty{glossaries} % takes care of the particular format required for -% \gls{makeindex}\slash\gls{xindy}) there's no need for a user level +% \app{makeindex}\slash\app{xindy}) there's no need for a user level % command. Using a custom internal command prevents any conflict % with other packages (and with the \cs{mark} mechanism). % @@ -14121,8 +14725,8 @@ you %The \cs{@index} trick allows for special characters within %\meta{indexing info} (so you can do, for example, \verb|\index{%@\%}|), %and the original design of \cs{@glossary} here -%was actually a legacy from the old \styfmt{glossary} package. With -%the \styfmt{glossaries} package, the indexing information supplied in +%was actually a legacy from the old \sty{glossary} package. With +%the \sty{glossaries} package, the indexing information supplied in %the second argument is more constrained and just consists of the sort %value (given by the \gloskey{sort} key), the actual value %(given by \cs{glossentry}\marg{label} or @@ -14229,15 +14833,29 @@ you %\end{macro} %\begin{macro}{\gls@disablepagerefexpansion} %\changes{3.04}{2012-11-18}{new} +%\changes{4.50}{2022-10-14}{added check for esclocations} +%As from v4.50, this will only do the page protection formats for +%esclocations=true. % \begin{macrocode} \newcommand*{\gls@disablepagerefexpansion}{% - \@for\@gls@this:=\gls@protected@pagefmts\do - {% - \expandafter\let\@gls@this\relax - }% + \glswrglossdisablelocationcmds + \ifglsesclocations + \@for\@gls@this:=\gls@protected@pagefmts\do + {% + \expandafter\let\@gls@this\relax + }% + \fi } % \end{macrocode} %\end{macro} +% +%\begin{macro}{\glswrglossdisablelocationcmds} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\glswrglossdisablelocationcmds}{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\gls@alphpage} %\changes{3.04}{2012-11-18}{new} % \begin{macrocode} @@ -14287,17 +14905,31 @@ you %\changes{1.46}{2021-09-20}{changed \cs{eappto} to \cs{protected@eappto}} % \begin{macrocode} \newcommand*{\glsaddprotectedpagefmt}[1]{% - \protected@eappto\gls@protected@pagefmts{,\expandonce{\csname gls#1page\endcsname}}% - \csedef{gls#1page}{\expandonce{\csname#1\endcsname}\noexpand\c@page}% - \protected@eappto\@wrglossarynumberhook{% - \noexpand\let\expandonce{\csname org@gls#1\endcsname}% - \expandonce{\csname#1\endcsname}% - \noexpand\def\expandonce{\csname#1\endcsname}{% - \noexpand\@wrglossary@pageformat - \expandonce{\csname gls#1page\endcsname}% - \expandonce{\csname org@gls#1\endcsname}% + \ifglsesclocations + \protected@eappto\gls@protected@pagefmts{,\expandonce{\csname gls#1page\endcsname}}% + \csedef{gls#1page}{\expandonce{\csname#1\endcsname}\noexpand\c@page}% + \protected@eappto\@wrglossarynumberhook{% + \noexpand\let\expandonce{\csname org@gls#1\endcsname}% + \expandonce{\csname#1\endcsname}% + \noexpand\def\expandonce{\csname#1\endcsname}{% + \noexpand\@wrglossary@pageformat + \expandonce{\csname gls#1page\endcsname}% + \expandonce{\csname org@gls#1\endcsname}% + }% }% - }% + \else + \GlsWarnAddProtectedPageFmt + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsWarnAddProtectedPageFmt} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\GlsWarnAddProtectedPageFmt}{% + \GlossariesWarning{\string\glsaddprotectedpagefmt\space has no + effect with esclocations=false}% } % \end{macrocode} %\end{macro} @@ -14331,6 +14963,34 @@ you % \end{macrocode} %\end{macro} % +%\begin{macro}{\glswrglossdisableanchorcmds} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\glswrglossdisableanchorcmds}{\let\glstexorpdfstring\@secondoftwo} +\ifdef\texorpdfstring + {\appto\glswrglossdisableanchorcmds{\let\texorpdfstring\@secondoftwo}}{} +\ifdef\pdfstringdefPreHook + {\appto\glswrglossdisableanchorcmds{\pdfstringdefPreHook}}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glswrglosslocationtarget} +%\changes{4.50}{2022-10-14}{new} +%Must expand. May be used to alter the location suffix in the +%\cs{glshypernumber} anchor. +% \begin{macrocode} +\newcommand{\glswrglosslocationtarget}[1]{#1} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glswrglosslocationtextfmt} +%\changes{4.50}{2022-10-14}{new} +%Used to encapsulate the hyperlink text in \cs{glshypernumber}. +% \begin{macrocode} +\newcommand{\glswrglosslocationtextfmt}[1]{#1} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@@do@noesc@wrglossary} %\changes{4.33}{2017-09-20}{new} % Write the glossary entry in the appropriate format. @@ -14357,10 +15017,7 @@ you % point, even if it hasn't been updated yet. The page number is not % expected to occur in the prefix.) % \begin{macrocode} - \protected@edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix - {\@glslocref}{\@glsHlocref}% - }% - \@do@gls@getcounterprefix + \@xp@gls@getcounterprefix{\@glslocref}{\@glsHlocref}% \fi % \end{macrocode} % De-tok label if required. @@ -14378,12 +15035,13 @@ you % %\begin{macro}{\ifglswrallowprimitivemods} %\changes{4.22}{2016-04-19}{new} +%\changes{4.50}{2022-10-14}{switch default to false} % Conditional to determine whether or not \cs{@@do@esc@wrglossary} % should be allowed to temporarily redefine \cs{the} and -% \cs{number}. +% \cs{number}. Version 4.50 switched the default to false. % \begin{macrocode} \newif\ifglswrallowprimitivemods -\glswrallowprimitivemodstrue +\glswrallowprimitivemodsfalse % \end{macrocode} %\end{macro} % @@ -14503,11 +15161,15 @@ you \def\gls@number##1{% \ifx##1\c@page \gls@numberpage\else\gls@orgnumber##1\fi}% \def\number{\expandafter\gls@number}% +% \end{macrocode} +%\changes{4.50}{2022-10-14}{moved \cs{romannumeral} inside allow primitive +%mods} +% \begin{macrocode} + \def\romannumeral##1{% + \ifx##1\c@page \gls@romanpage \else \gls@orgromannumeral##1\fi}% \fi \def\@arabic##1{% \ifx##1\c@page \gls@arabicpage\else\gls@orgarabic##1\fi}% - \def\romannumeral##1{% - \ifx##1\c@page \gls@romanpage\else\gls@orgromannumeral##1\fi}% \def\@Roman##1{% \ifx##1\c@page \gls@Romanpage\else\gls@orgRoman##1\fi}% \def\@alph##1{% @@ -14544,10 +15206,7 @@ you \else \protected@edef\@glsHlocref{\theHglsentrycounter}% \@gls@checkmkidxchars\@glsHlocref - \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix - {\@glslocref}{\@glsHlocref}% - }% - \@do@gls@getcounterprefix + \@xp@gls@getcounterprefix{\@glslocref}{\@glsHlocref}% \fi % \end{macrocode} % De-tok label if required @@ -14616,17 +15275,35 @@ you % \end{macrocode} %\end{macro} % +%\begin{macro}{\@xp@gls@getcounterprefix} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*\@xp@gls@getcounterprefix[2]{% + \bgroup + \glswrglossdisableanchorcmds + \protected@edef\@do@gls@getcounterprefix{% + \noexpand\egroup + \noexpand\@gls@getcounterprefix{#1}{#2}% + }% + \@do@gls@getcounterprefix +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@getcounterprefix} % Get the prefix that needs to be prepended to counter in order to % get the hyper counter. (For example, with the standard -% \cls{article} class and \sty{hyperref}, \ics{theequation} needs to +% \cls{article} class and \sty{hyperref}, \cs{theequation} needs to % be prefixed with \meta{section num}|.| to get the equivalent -% \ics{theHequation}.) NB this assumes that the prefix ends with a +% \cs{theHequation}.) NB this assumes that the prefix ends with a % dot, which is the standard. (Otherwise it makes the xindy location % classes more complicated.) +% +%\changes{4.50}{2022-10-14}{changed \cs{edef} to \cs{def}} +%The expansion has been moved to \cs{@xp@gls@getcounterprefix}. % \begin{macrocode} \newcommand*\@gls@getcounterprefix[2]{% - \edef\@gls@thisloc{#1}\edef\@gls@thisHloc{#2}% + \def\@gls@thisloc{#1}\def\@gls@thisHloc{#2}% \ifx\@gls@thisloc\@gls@thisHloc \def\@glo@counterprefix{}% \else @@ -14655,7 +15332,7 @@ you % \end{macrocode} %\end{macro} % -%\section{Glossary Entry Cross-References} +%\subsection{Glossary Entry Cross-References} %\begin{macro}{\@do@seeglossary} %\changes{1.17}{2008-12-26}{new} % Write the glossary entry with a cross reference. @@ -14802,15 +15479,23 @@ you %\end{macro} %\begin{macro}{\glsseeitemformat} %\changes{3.0}{2011-04-02}{new} -% As from v3.0, default is to use \ics{glsentrytext} instead of -% \ics{glsentryname}. (To avoid problems with the \gloskey{name} key being -% sanitized, although this is no longer a problem now.) +%\changes{4.50}{2022-10-14}{added test for short field} +%Introduced in v3.0 to replace use of \cs{glsentryname} (originally in +%\cs{glsseeitem}) with +%\cs{glsentrytext} to avoid problems with the \gloskey{name} key +%being sanitized. This ceased being a problem in v3.08a, but +%\cs{glsentrytext} was retained for backward-compatibility. +% As from v4.50, the default has reverted back to using +% \cs{glsentryname} unless the entry is an acronym (which could have +% a potentially long name). % \begin{macrocode} -\newcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} +\newcommand*{\glsseeitemformat}[1]{% + \ifglshasshort{#1}{\glsentrytext{#1}}{\glsentryname{#1}}% +} % \end{macrocode} %\end{macro} % -% \section{Displaying the glossary}\label{sec:code:printglos} +%\subsection{Displaying the glossary}\label{sec:code:printglos} % An individual glossary is displayed in the text using % \cs{printglossary}\oarg{key-val list}. If the % \gloskey[printglossary]{type} key is omitted, the default glossary is displayed. @@ -14839,10 +15524,10 @@ you %\end{macro} % %\begin{macro}{\warn@noprintglossary} -% Warn the user if they have forgotten \ics{printglossaries} -% or \ics{printglossary}. (Will be suppressed if there is at -% least one occurrence of \ics{printglossary}. There is no check -% to ensure that there is a \ics{printglossary} for each defined +% Warn the user if they have forgotten \cs{printglossaries} +% or \cs{printglossary}. (Will be suppressed if there is at +% least one occurrence of \cs{printglossary}. There is no check +% to ensure that there is a \cs{printglossary} for each defined % glossary.) %\changes{4.04}{2014-03-06}{Activate warning in \cs{makeglossaries}} % \begin{macrocode} @@ -14875,7 +15560,7 @@ you % Neither \cs{printglossary} nor \cs{printnoidxglossary} can work % with an ignored glossary (since ignored glossaries normally % suppress indexing and there's no associated file for -% \gls{makeindex}/\gls{xindy} to process). However \cs{printunsrtglossary} can be used +% \app{makeindex}/\app{xindy} to process). However \cs{printunsrtglossary} can be used % with an ignored glossary, so provide a command to warn if the % glossary doesn't exist or is an ignored glossary. %\begin{macro}{\@printgloss@checkexists@noignored} @@ -14986,7 +15671,7 @@ you % \cs{printnoidxglossary}. The first argument is the options list, % the second argument is the handler macro that % deals with the actual glossary. This is also used by -% \sty{glossaries-extra}'s \ics{printunsrtglossary} which may be +% \sty{glossaries-extra}'s \cs{printunsrtglossary} which may be % used with an ignored glossary. % \begin{macrocode} \newcommand{\@printglossary}[2]{% @@ -15007,7 +15692,7 @@ you \ifx\@glossary@default@style\relax \GlossariesWarning{No default glossary style provided \MessageBreak for the glossary `\@glo@type'. \MessageBreak - Using deprecated fallback. \MessageBreak + Using fallback. \MessageBreak To fix this set the style with \MessageBreak \string\setglossarystyle\space or use the \MessageBreak style key=value option}% @@ -15015,7 +15700,7 @@ you }% \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% % \end{macrocode} -% Store current value of \ics{glossaryentrynumbers}. (This may +% Store current value of \cs{glossaryentrynumbers}. (This may % be changed via the optional argument) % \begin{macrocode} \let\@org@glossaryentrynumbers\glossaryentrynumbers @@ -15108,11 +15793,11 @@ you % \begin{macrocode} \egroup % \end{macrocode} -% Reset \ics{glossaryentrynumbers} +% Reset \cs{glossaryentrynumbers} % \begin{macrocode} \global\let\glossaryentrynumbers\@org@glossaryentrynumbers % \end{macrocode} -% Suppress warning about no \ics{printglossary} +% Suppress warning about no \cs{printglossary} %\changes{2.02}{2007-07-13}{suppressed warning globally rather than locally} % \begin{macrocode} \global\let\warn@noprintglossary\relax @@ -15155,9 +15840,11 @@ you %prevent unwanted whatsit occurring here.} % \begin{macrocode} \ifglsxindy - \ifcsundef{@xdy@\@glo@type @language}% - {% - \edef\@do@auxoutstuff{% +% \end{macrocode} +%Set \cs{@gls@langmod}: +% \begin{macrocode} + \gls@xdy@set@lang{\@glo@type}% + \edef\@do@auxoutstuff{% \noexpand\AtEndDocument{% % \end{macrocode} %\changes{3.10a}{2013-10-13}{Added providecommand code to aux file} @@ -15168,19 +15855,7 @@ you \noexpand\immediate\noexpand\write\@auxout{% \string\providecommand\string\@xdylanguage[2]{}}% \noexpand\immediate\noexpand\write\@auxout{% - \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}% - }% - }% - }% - {% - \edef\@do@auxoutstuff{% - \noexpand\AtEndDocument{% - \noexpand\immediate\noexpand\write\@auxout{% - \string\providecommand\string\@xdylanguage[2]{}}% - \noexpand\immediate\noexpand\write\@auxout{% - \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type - @language\endcsname}}% - }% + \string\@xdylanguage{\@glo@type}{\@gls@langmod}}% }% }% \@do@auxoutstuff @@ -15590,7 +16265,7 @@ you \glossarypreamble % \end{macrocode} % \changes{4.29}{2017-01-19}{moved definition of -% \cs{@gls@currentlettergroup} outside of \envfmt{theglossary} environment} +% \cs{@gls@currentlettergroup} outside of \env{theglossary} environment} %The glossary style might use a tabular-like environment, which may %cause scoping problems when setting the current letter group. %The predefined tabular-like styles don't support letter group @@ -15697,6 +16372,7 @@ you {% \subglossentry{\gls@level}{#1}% {% + \glsnoidxprenumberlist{#1}% \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% }% }% @@ -15744,6 +16420,7 @@ you {% \glossentry{#1}% {% + \glsnoidxprenumberlist{#1}% \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% }% }% @@ -15791,7 +16468,7 @@ you %\begin{macro}{\glsnoidxdisplayloclisthandler} %\changes{4.04}{2014-03-06}{new} % Handler for location list iterator when used with -% \ics{glsdisplaynumberlist}. +% \cs{glsdisplaynumberlist}. % \begin{macrocode} \newcommand*{\glsnoidxdisplayloclisthandler}[1]{% \ifdefstring{\@gls@noidxloclist@prev}{#1}% @@ -15854,13 +16531,13 @@ you %\end{macro} % % The keys that can be used in the optional argument to -% \ics{printglossary} or \ics{printnoidxglossary} are as follows: +% \cs{printglossary} or \cs{printnoidxglossary} are as follows: % The \gloskey[printglossary]{type} key sets the glossary type. % \begin{macrocode} \define@key{printgloss}{type}{\def\@glo@type{#1}} % \end{macrocode} % The \gloskey[printglossary]{title} key sets the title used in the glossary section -% header. This overrides the title used in \ics{newglossary}. +% header. This overrides the title used in \cs{newglossary}. %\changes{3.03}{2012/09/21}{allow title to set toctitle} % \begin{macrocode} \define@key{printgloss}{title}{% @@ -15888,8 +16565,7 @@ you {Glossary style `#1' undefined}{}% }% {% - \def\@glossarystyle{\setglossentrycompatibility - \csname @glsstyle@#1\endcsname}% + \def\@glossarystyle{\setglossarystyle{#1}}% }% } % \end{macrocode} @@ -15970,7 +16646,7 @@ you %\texttt{printgloss} family} % The \gloskey[printglossary]{subentrycounter} key is the same as the % package option but localised to the current glossary. -% Note that this doesn't affect the master/slave counter attributes, +% Note that this doesn't affect the parent/child counter attributes, % which occurs if \pkgopt{subentrycounter} and \pkgopt{entrycounter} % package options are set to true. % \begin{macrocode} @@ -16029,7 +16705,7 @@ you % in the entry's description and 3 column tabular style glossary % is used.) \cs{org@glossaryentrynumbers} needs to be set at % the start of each glossary, in the event that -% \ics{glossaryentrynumber} is redefined. +% \cs{glossaryentrynumber} is redefined. % \begin{macrocode} \newcommand*{\@glsnonextpages}{% \gdef\glossaryentrynumbers##1{% @@ -16046,7 +16722,7 @@ you % in the entry's description and 3 column tabular style glossary % is used.) \cs{org@glossaryentrynumbers} needs to be set at % the start of each glossary, in the event that -% \ics{glossaryentrynumber} is redefined. +% \cs{glossaryentrynumber} is redefined. % \begin{macrocode} \newcommand*{\@glsnextpages}{% \gdef\glossaryentrynumbers##1{% @@ -16096,7 +16772,7 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsresetsubentrycounter} +%\begin{macro}{\glsresetentrycounter} %\changes{3.02}{2012-05-21}{new} %\changes{4.38}{2018-05-10}{bug fix: move conditional inside command} % Resets the \ctr{glossaryentry} counter. @@ -16148,7 +16824,7 @@ you %\begin{macro}{\glsrefentry} %\changes{3.0}{2011-04-02}{new} % Reference the entry or sub-entry counter if in use, otherwise just do -% \ics{gls}. +% \cs{gls}. %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} %\changes{4.38}{2018-05-10}{bug fix: move conditional inside command} % \begin{macrocode} @@ -16264,30 +16940,30 @@ you %\end{macro} % % As from version 3.08, glossary information is now written to the -% external files using \ics{glossentry} and \ics{subglossentry} +% external files using \cs{glossentry} and \cs{subglossentry} % instead of \cs{glossaryentryfield} and \cs{glossarysubentryfield}. % The default definition provides backward compatibility for % glossary styles that use the old forms. %\begin{macro}{\compatibleglossentry} %\changes{3.08a}{2013-09-28}{new} +%\changes{4.50}{2022-10-14}{removed} +%\begin{definition} +%\cs{compatibleglossentry}\marg{label}\marg{page-list} +%\end{definition} +%Removed in v4.50. +%\end{macro} +% +%\begin{macro}{\glossentry} %\begin{definition} % \cs{glossentry}\marg{label}\marg{page-list} %\end{definition} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\providecommand*{\compatibleglossentry}[2]{% - \toks@{#2}% - \protected@edef\@do@glossentry{\noexpand\glossaryentryfield{#1}% - {\noexpand\glsnamefont - {\expandafter\expandonce\csname glo@#1@name\endcsname}}% - {\expandafter\expandonce\csname glo@#1@desc\endcsname}% - {\expandafter\expandonce\csname glo@#1@symbol\endcsname}% - {\the\toks@}% - }% - \@do@glossentry -} +\newcommand{\glossentry}[2]{\glossentryname{#1} #2} % \end{macrocode} %\end{macro} % +% %\begin{macro}{\glossentryname} %\changes{3.08a}{2013-09-28}{new} %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} @@ -16311,6 +16987,7 @@ you \glsnamefont{\Glsentryname{#1}}% }% } +\glsmfuaddmap{\glossentryname}{\Glossentryname} % \end{macrocode} %\end{macro} % @@ -16335,6 +17012,7 @@ you \Glsentrydesc{#1}% }% } +\glsmfuaddmap{\glossentrydesc}{\Glossentrydesc} % \end{macrocode} %\end{macro} % @@ -16359,40 +17037,23 @@ you \Glsentrysymbol{#1}% }% } +\glsmfuaddmap{\glossentrysymbol}{\Glossentrysymbol} % \end{macrocode} %\end{macro} % % %\begin{macro}{\compatiblesubglossentry} %\changes{3.08a}{2013-09-28}{new} +%\changes{4.50}{2022-10-14}{removed} %\begin{definition} -% \cs{subglossentry}\marg{level}\marg{label}\marg{page-list} +% \cs{compatiblesubglossentry}\marg{level}\marg{label}\marg{page-list} %\end{definition} -% \begin{macrocode} -\providecommand*{\compatiblesubglossentry}[3]{% - \toks@{#3}% - \protected@edef\@do@subglossentry{\noexpand\glossarysubentryfield{\number#1}% - {#2}% - {\noexpand\glsnamefont - {\expandafter\expandonce\csname glo@#2@name\endcsname}}% - {\expandafter\expandonce\csname glo@#2@desc\endcsname}% - {\expandafter\expandonce\csname glo@#2@symbol\endcsname}% - {\the\toks@}% - }% - \@do@subglossentry -} -% \end{macrocode} +%Removed in v4.50 %\end{macro} % %\begin{macro}{\setglossentrycompatibility} %\changes{3.08a}{2013-09-28}{new} -% \begin{macrocode} -\newcommand*{\setglossentrycompatibility}{% - \let\glossentry\compatibleglossentry - \let\subglossentry\compatiblesubglossentry -} -\setglossentrycompatibility -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % % @@ -16403,33 +17064,30 @@ you % This command formerly governed how each entry row should be formatted % in the glossary. Now deprecated. %\changes{3.08a}{2013-09-28}{deprecated} -% \begin{macrocode} -\newcommand{\glossaryentryfield}[5]{% - \GlossariesWarning - {Deprecated use of \string\glossaryentryfield.^^J - I recommend you change to \string\glossentry.^^J - If you've just upgraded, try removing your gls auxiliary - files^^J and recompile}% - \noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%Removed in v4.50 %\end{macro} %\begin{macro}{\glossarysubentryfield} %\begin{definition} % \cs{glossarysubentryfield}\marg{level}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list} %\end{definition} +%\changes{4.50}{2022-10-14}{removed} % This command governs how each subentry should be formatted % in the glossary. Glossary styles need to redefine this command. % Most of the predefined styles ignore \meta{symbol}. The first % argument is a number indicating the level. (The level should % be greater than or equal to 1.) +% +%Removed in v4.50. +%\end{macro} +% +%\begin{macro}{\subglossentry} +%\begin{definition} +% \cs{subglossentry}\marg{level}\marg{label}\marg{page-list} +%\end{definition} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\glossarysubentryfield}[6]{% - \GlossariesWarning - {Deprecated use of \string\glossarysubentryfield.^^J - I recommend you change to \string\subglossentry.^^J - If you've just upgraded, try removing your gls auxiliary - files^^J and recompile}% - \glstarget{#2}{\strut}#4. #6\par} +\newcommand{\subglossentry}[3]{\glossentryname{#2} #3} % \end{macrocode} %\end{macro} % @@ -16483,8 +17141,8 @@ you % This command produces the title for the glossary group % whose label is given by \meta{label}. By default, the group % labelled \texttt{glssymbols} produces -% \ics{glssymbolsgroupname}, the group labelled -% \texttt{glsnumbers} produces \ics{glsnumbersgroupname} +% \cs{glssymbolsgroupname}, the group labelled +% \texttt{glsnumbers} produces \cs{glsnumbersgroupname} % and all the other groups simply produce their label. % As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers}, % \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine @@ -16497,8 +17155,9 @@ you %\cs{ifcsundef}} %\changes{3.11a}{2013-10-15}{Added check in case non-Latin alphabet %in use} +%\changes{4.50}{2022-10-14}{made robust} % \begin{macrocode} -\newcommand*{\glsgetgrouptitle}[1]{% +\newrobustcmd*{\glsgetgrouptitle}[1]{% \@gls@getgrouptitle{#1}{\@gls@grptitle}% \@gls@grptitle } @@ -16507,28 +17166,20 @@ you %\begin{macro}{\@gls@getgrouptitle} % Gets the group title specified by the label (first argument) and % stores in the second argument, which must be a control sequence. +%\changes{4.50}{2022-10-14}{switched to \LaTeX3 syntax} % \begin{macrocode} +\ExplSyntaxOn \newcommand*{\@gls@getgrouptitle}[2]{% % \end{macrocode} % Even if the argument appears to be a single letter, it won't be % considered a single letter by \cs{dtl@ifsingle} if it's an active % character. % \begin{macrocode} - \dtl@ifsingle{#1}% - {% - \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% - }% - {% - \ifboolexpr{test{\ifstrequal{#1}{glssymbols}} - or test{\ifstrequal{#1}{glsnumbers}}}% - {% - \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% - }% - {% - \def#2{#1}% - }% - }% + \def#2{#1}% + \regex_match:nnT { ^\A(.|glsnumbers|glssymbols)\Z } { #1 } + { \ifcsundef{#1groupname}{}{\letcs#2{#1groupname}} } } +\ExplSyntaxOff % \end{macrocode} %\end{macro} %\begin{macro}{\@gls@noidx@getgrouptitle} @@ -16554,21 +17205,35 @@ you % will also need to redefine \cs{glsgetgrouplabel}. %\begin{macro}{\glsgetgrouplabel} %\changes{3.05}{2013-04-21}{fixed bug (typo in \cs{equal})} +%\changes{4.50}{2022-10-14}{converted to use \LaTeX3} +%This only works for the symbol and number groups, so is best +%avoided and not documented. However, it has been converted to use +%\LaTeX3 commands. % \begin{macrocode} +\ExplSyntaxOn \newcommand*{\glsgetgrouplabel}[1]{% -\ifthenelse{\equal{#1}{\glssymbolsgroupname}}{glssymbols}{% -\ifthenelse{\equal{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} + \str_if_eq:eeTF {#1} { \glssymbolsgroupname } + { glssymbols } + { + \str_if_eq:eeTF {#1} { \glsnumbersgroupname } + { glsnumbers } + { #1 } + } +} +\ExplSyntaxOff % \end{macrocode} %\end{macro} % % The command \cs{setentrycounter} sets the entry's % associated counter (required by -% \cs{glshypernumber} etc.) \ics{glslink} and -% \ics{glsadd} encode the -% \ics{glossary} argument so that the relevant counter is +% \cs{glshypernumber} etc.) \cs{glslink} and +% \cs{glsadd} encode the +% \cs{glossary} argument so that the relevant counter is % set prior to the formatting command. %\begin{macro}{\setentrycounter} %\changes{3.0}{2011-04-02}{added optional argument} +%The prefix is an optional argument because this command originally +%only had one argument. The optional argument was added in v3.0. % \begin{macrocode} \newcommand*{\setentrycounter}[2][]{% \def\@glo@counterprefix{#1}% @@ -16608,37 +17273,9 @@ you %\begin{macro}{\glossarystyle} %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} -% \begin{macrocode} -\newcommand*{\glossarystyle}[1]{% - \ifcsundef{@glsstyle@#1}% - {% - \PackageError{glossaries}{Glossary style `#1' undefined}{}% - }% - {% - \GlossariesWarning - {Deprecated command \string\glossarystyle.^^J - I recommend you switch to \string\setglossarystyle\space unless - you want to maintain backward compatibility}% - \setglossentrycompatibility - \csname @glsstyle@#1\endcsname -% \end{macrocode} -%\changes{3.13a}{2013-11-05}{fixed bug caused by using \cs{ifdef} instead of -%\cs{ifcsdef}} -% \begin{macrocode} - \ifcsdef{@glscompstyle@#1}% - {\setglossentrycompatibility\csuse{@glscompstyle@#1}}% - {}% - }% -% \end{macrocode} -%\changes{4.21}{2016-01-24}{set default style if not already set} -% Set the default style if it isn't already set so that -% \cs{printglossary} can warn if the fallback style is in use. -% \begin{macrocode} - \ifx\@glossary@default@style\relax - \protected@edef\@glossary@default@style{#1}% - \fi -} -% \end{macrocode} +%\changes{3.08a}{2013-09-28}{deprecated} +%\changes{4.50}{2022-10-14}{removed} +%Deprecated in v3.08a. Removed in v4.50. %\end{macro} % %\begin{macro}{\newglossarystyle} @@ -16647,12 +17284,12 @@ you % \cs{newglossarystyle}\marg{name}\marg{definition} %\end{definition} % The \meta{definition} argument should redefine -% \env{theglossary}, \ics{glossaryheader}, -% \ics{glsgroupheading}, \ics{glossaryentryfield} and -% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the +% \env{theglossary}, \cs{glossaryheader}, +% \cs{glsgroupheading}, \cs{glossaryentryfield} and +% \cs{glsgroupskip} (see \autoref{sec:code:styles} for the % definitions of predefined styles). Glossary styles should not -% redefine \ics{glossarypreamble} and -% \ics{glossarypostamble}, as +% redefine \cs{glossarypreamble} and +% \cs{glossarypostamble}, as % the user should be able to switch between styles without affecting % the pre- and postambles. %\changes{1.17}{2008-12-26}{made \cs{newglossarystyle} long} @@ -16688,13 +17325,13 @@ you %\end{macro} % % Glossary entries are encoded so that the second argument -% to \ics{glossaryentryfield} is always specified as +% to \cs{glossaryentryfield} is always specified as % \cs{glsnamefont}\marg{name}. This allows the % user to change the font used to display the name term -% without having to redefine \ics{glossaryentryfield}. +% without having to redefine \cs{glossaryentryfield}. % The default uses the surrounding font, so in the list type % styles (which place the name in the optional argument to -% \ics{item}) the name will appear in bold. +% \cs{item}) the name will appear in bold. %\begin{macro}{\glsnamefont} % \begin{macrocode} \newcommand*{\glsnamefont}[1]{#1} @@ -16704,22 +17341,22 @@ you % Each glossary entry has an associated number list (usually page % numbers) that indicate where in the document the entry has been % used. The format for these number lists can be changed using the -% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}. +% \gloskey[glslink]{format} key in commands like \cs{glslink}. % The default format is given by \cs{glshypernumber}. This takes % a single argument which may be a single number, a number range % or a number list. The number ranges are delimited with -% \ics{delimR}, the number lists are delimited with -% \ics{delimN}. +% \cs{delimR}, the number lists are delimited with +% \cs{delimN}. % % If the document doesn't have hyperlinks, the numbers can be % displayed just as they are, but if the document supports % hyperlinks, the numbers should link to the relevant location. % This means extracting the individual numbers from the list or -% ranges. The \isty{hyperref} package does this with the -% \ics{hyperpage} command, but this is encoded for comma and +% ranges. The \sty{hyperref} package does this with the +% \cs{hyperpage} command, but this is encoded for comma and % dash delimiters and only for the page counter, but this code needs % to be more general. So I have adapted the code used in the -% \isty{hyperref} package. +% \sty{hyperref} package. %\begin{macro}{\glshypernumber} %\changes{1.17}{2008-12-26}{modified to allow material % to be attached to location} @@ -16731,7 +17368,16 @@ you \def\glshypernumber#1{#1}% }% {% - \def\glshypernumber#1{\@glshypernumber#1\nohyperpage{}\@nil} + \def\glshypernumber#1{\@xp@glshypernumber{#1}} +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@xp@glshypernumber} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newrobustcmd{\@xp@glshypernumber}[1]{% + \@glshypernumber#1\nohyperpage{}\@nil } % \end{macrocode} %\end{macro} @@ -16744,7 +17390,7 @@ you \def\@glshypernumber#1\nohyperpage#2#3\@nil{% \ifx\\#1\\% \else - \@delimR#1\delimR\delimR\\% + \gls@delimR#1\delimR\delimR\\% \fi \ifx\\#2\\% \else @@ -16757,31 +17403,34 @@ you } % \end{macrocode} %\end{macro} -% \cs{@delimR} displays a range of numbers for the counter +% \cs{gls@delimR} displays a range of numbers for the counter % whose name is given by % \cs{@gls@counter} (which must be set prior to using % \cs{glshypernumber}). -%\begin{macro}{\@delimR} +%\begin{macro}{\gls@delimR} +%\changes{4.50}{2022-10-14}{renamed \cs{@delimR} to \cs{gls@delimR}} % \begin{macrocode} -\def\@delimR#1\delimR #2\delimR #3\\{% -\ifx\\#2\\% - \@delimN{#1}% -\else - \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% -\fi} +\def\gls@delimR#1\delimR #2\delimR #3\\{% + \ifx\\#2\\% + \gls@delimN{#1}% + \else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% + \fi +} % \end{macrocode} %\end{macro} -% \cs{@delimN} displays a list of individual numbers, +% \cs{gls@delimN} displays a list of individual numbers, % instead of a range: -%\begin{macro}{\@delimN} +%\begin{macro}{\gls@delimN} +%\changes{4.50}{2022-10-14}{renamed \cs{@delimN} to \cs{gls@delimN}} % \begin{macrocode} -\def\@delimN#1{\@@delimN#1\delimN \delimN\\} -\def\@@delimN#1\delimN #2\delimN#3\\{% -\ifx\\#3\\% - \@gls@numberlink{#1}% -\else - \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% -\fi +\def\gls@delimN#1{\gls@@delimN#1\delimN \delimN\\} +\def\gls@@delimN#1\delimN #2\delimN#3\\{% + \ifx\\#3\\% + \@gls@numberlink{#1}% + \else + \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% + \fi } % \end{macrocode} %\end{macro} @@ -16791,10 +17440,11 @@ you % \cs{@gls@counter}. % \begin{macrocode} \def\@gls@numberlink#1{% -\begingroup - \toks@={}% - \@gls@removespaces#1 \@nil -\endgroup} + \begingroup + \toks@={}% + \@gls@removespaces#1 \@nil + \endgroup +} % \end{macrocode} % \begin{macrocode} \def\@gls@removespaces#1 #2\@nil{% @@ -16809,8 +17459,26 @@ you % \end{macrocode} %\changes{3.0}{2011-04-02}{added prefix to hyperlink} % \begin{macrocode} - \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}% - {\the\toks@}% + \bgroup +% \end{macrocode} +%\changes{4.50}{2022-10-14}{allow markup to be stripped from location} +%Allow any markup to be stripped from the location when forming the +%target name. +% \begin{macrocode} + \glswrglossdisableanchorcmds + \protected@edef\@gls@tmp{\glsentrycounter\@glo@counterprefix + \glswrglosslocationtarget{\@gls@x}}% +% \end{macrocode} +%If anything hasn't been fully expanded by this point then it will +%cause a problem, so sanitize to prevent an error, but it's likely +%the target won't be valid. +% \begin{macrocode} + \@onelevel@sanitize\@gls@tmp + \edef\@gls@x{\noexpand\egroup + \noexpand\hyperlink{\@gls@tmp}% + {\noexpand\glswrglosslocationtextfmt{\the\toks@}}% + }% + \@gls@x \fi \else \@gls@ReturnAfterFi{% @@ -16876,33 +17544,33 @@ you % \end{macrocode} %\end{macro} % -%\section{Acronyms}\label{sec:code:acronym} +%\subsection{Acronyms}\label{sec:code:acronym} %\begin{macro}{\oldacronym} %\begin{definition} %\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list} %\end{definition} -% This emulates the way the old \isty{glossary} package defined -% acronyms. It is equivalent to \ics{newacronym}\oarg{key-val +% This emulates the way the old \sty{glossary} package defined +% acronyms. It is equivalent to \cs{newacronym}\oarg{key-val % list}\marg{label}\marg{abbrv}\marg{long} and it additionally % defines the command \cs{}\meta{label} which is equivalent to % \cs{gls}\marg{label} (thus \meta{label} must only contain % alphabetical characters). If \meta{label} is omitted, \meta{abbrv} -% is used. This only emulates the syntax of the old \isty{glossary} +% is used. This only emulates the syntax of the old \sty{glossary} % package. The way the acronyms appear in the list of acronyms is -% determined by the definition of \ics{newacronym} and the +% determined by the definition of \cs{newacronym} and the % glossary style. % % Note that \cs{}\meta{label} can't have an optional -% argument if the \isty{xspace} package is loaded. If -% \isty{xspace} hasn't been loaded then you can do +% argument if the \sty{xspace} package is loaded. If +% \sty{xspace} hasn't been loaded then you can do % \cs{}\meta{label}\oarg{insert} but you can't do % \cs{}\meta{label}\oarg{key-val list}. For example if you define the % acronym svm, then you can do "\svm['s]" but you can't do -% "\svm[format=textbf]". If the \isty{xspace} package is loaded, +% "\svm[format=textbf]". If the \sty{xspace} package is loaded, % "\svm['s]" will appear as "svm ['s]" which is unlikely to be % the desired result. In this case, you will need to use % \cs{gls} explicitly, e.g.\ "\gls{svm}['s]". Note that it is -% up to the user to load \isty{xspace} if desired. +% up to the user to load \sty{xspace} if desired. %\changes{1.18}{2009-01-14}{new} %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} @@ -16930,27 +17598,54 @@ you % \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long} %\end{definition} % This is a quick way of defining acronyms, -% using \ics{newglossaryentry} with the appropriate +% using \cs{newglossaryentry} with the appropriate % values. It sets the -% glossary type to \ics{acronymtype} which will be +% glossary type to \cs{acronymtype} which will be % "acronym" if the package option \pkgopt{acronym} has % been used, otherwise it will be the default glossary. -% Since \cs{newacronym} merely calls \ics{newglossaryentry}, +% Since \cs{newacronym} merely calls \cs{newglossaryentry}, % the acronym is treated like any other glossary entry. % % If you prefer a different format, you % can redefine \cs{newacronym} as required. The optional % argument can be used to override any of the settings. % -% This is just a stub. It's redefined by commands like -% \cs{SetDefaultAcronymStyle}. +% This is just a stub. It's redefined by \cs{SetGenericNewAcronym} +% and by \sty{glossaries-extra}. It used to also be redefined by the +% obsolete acronym styles that have now been removed. +%If it is used then it means that the acronym style hasn't been +%initialised. +%\changes{4.50}{2022-10-14}{added initialisation} %\begin{macro}{\newacronym} % \begin{macrocode} - \newcommand{\newacronym}[4][]{} +\newcommand{\newacronym}[4][]{% + \gls@newacronym{#1}{#2}{#3}{#4}% +} % \end{macrocode} %\changes{1.13}{2008-05-10}{Removed restriction on only using % \cs{newacronym} in the preamble} %\end{macro} +% +%\begin{macro}{\gls@newacronym} +% \begin{macrocode} +\newcommand{\gls@newacronym}[4]{% +% \end{macrocode} +%Setting the acronym style will redefine \cs{newacronym} because it +%calls \cs{SetGenericNewAcronym} but if something weird has happened +%to alter this, redefine \cs{gls@newacronym} now to prevent an infinite +%loop. +% \begin{macrocode} + \renewcommand{\gls@newacronym}[4]{% + \PackageError{glossaries}{incompatible acronym style: + rollback may be required}% + {something has gone wrong with \string\newacronym. Try + \string\usepackage{glossaries}[=v4.49]}% + }% + \setacronymstyle{long-short}% + \newacronym[#1]{#2}{#3}{#4}% +} +% \end{macrocode} +%\end{macro} % Set up some convenient short cuts. These need to be changed if % \cs{newacronym} is changed (or if the \gloskey{description} key % is changed). @@ -17001,43 +17696,66 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\acrfull} -% Full form of the acronym. -%\changes{3.01}{2011-04-12}{made robust} -%\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd*{\acrfull}{\@gls@hyp@opt\ns@acrfull} -% \end{macrocode} -%\changes{4.08}{2014-07-30}{removed \cs{@sacrfull}} -%\changes{3.0}{2011-04-02}{added starred version} +% Using \cs{acrlinkfullformat} and \cs{acrfullformat} is now +% deprecated. However, these commands are still used in +% the initial definition of \cs{acrfull} and \cs{glsentryfull}. +% The acronym style now redefines \cs{glsentryfull}, and +% \cs{acrfull} now uses \cs{acrfullfmt}, which is redefined by the +% acronym style. Similar for the case and plural variants. This +% means that \cs{acrlinkfullformat} and \cs{acrfullformat} should +% now longer be used with v4.50, which will ensure that +% \cs{setacronymstyle} is used on the first instance of +% \cs{newacronym} if a style hasn't been set. +% +%Outlier cases may occur where someone has defined an entry +%explicitly with \cs{newglossaryentry} and set the long and short +%keys and is using \cs{glsentryfull} or \cs{acrfull} without a style +%set. So, for now, the deprecated \cs{acrlinkfullformat} and \cs{acrfullformat} are +%retained even though the remaining obsolete acronym code has been +%removed. However, they may be removed in a future version. +% +%\begin{macro}{\acrlinkfullformat} +% Format for full links like \cs{acrfull}. Syntax: +% \cs{acrlinkfullformat}\marg{long cs}\marg{short +% cs}\marg{options}\marg{label}\marg{insert} +%Deprecated. % \begin{macrocode} -\newcommand*\ns@acrfull[2][]{% - \new@ifnextchar[{\@acrfull{#1}{#2}}% - {\@acrfull{#1}{#2}[]}% +\newcommand{\acrlinkfullformat}[5]{% + \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\@acrfull} -%\changes{4.02}{2013-12-05}{now using \cs{acrfullfmt}} -% Low-level macro: +% +%\begin{macro}{\acrfullformat} +% Default full form is \meta{long} \parg{short}. +%\changes{3.01}{2011-04-12}{removed \cs{acronymfont} as it should +%already be set in the second argument.} +%Deprecated. % \begin{macrocode} -\def\@acrfull#1#2[#3]{% +\newcommand{\acrfullformat}[2]{#1\glsspace(#2)} % \end{macrocode} -% Make it easier for acronym styles to change this: +%\end{macro} +% +%\begin{macro}{\glsspace} +% Robust space to ensure it's written to the \texttt{.glsdefs} file. +%\changes{4.08}{2014-07-30}{new} % \begin{macrocode} - \acrfullfmt{#1}{#2}{#3}% -} +\newrobustcmd{\glsspace}{\space} % \end{macrocode} %\end{macro} % -% Using \cs{acrlinkfullformat} and \cs{acrfullformat} is now -% deprecated as it can cause complications with the first letter -% upper case variants, but the package needs to provide backward -% compatibility support. +% The following \cs{acrfullfmt} set of commands are used by the +% corresponding \cs{acrfull} command, and are redefined by the +% acronym style to match the style's full form. % %\begin{macro}{\acrfullfmt} %\changes{4.02}{2013-12-05}{new} -% No case change full format. +% No case change full format. This default will be overridden by the +% acronym style, so this definition shouldn't actually be used any +% more, but it still needs to be defined so the it doesn't cause a +% problem when acronym styles redefine it. This is initialised to +% use the deprecated \cs{acrlinkfullformat} but will be redefined by +% the acronym style when it's set. % \begin{macrocode} \newcommand*{\acrfullfmt}[3]{% \acrlinkfullformat{\@acrlong}{\@acrshort}{#1}{#2}{#3}% @@ -17045,31 +17763,83 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\acrlinkfullformat} -% Format for full links like \ics{acrfull}. Syntax: -% \cs{acrlinkfullformat}\marg{long cs}\marg{short -% cs}\marg{options}\marg{label}\marg{insert} +%\begin{macro}{\Acrfullfmt} +%\changes{4.02}{2013-12-05}{new} +% Sentence case full format. % \begin{macrocode} -\newcommand{\acrlinkfullformat}[5]{% - \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}% +\newcommand*{\Acrfullfmt}[3]{% + \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\acrfullformat} -% Default full form is \meta{long} \parg{short}. -%\changes{3.01}{2011-04-12}{removed \cs{acronymfont} as it should -%already be set in the second argument.} +%\begin{macro}{\ACRfullfmt} +%\changes{4.02}{2013-12-05}{new} +% All upper case full format. % \begin{macrocode} -\newcommand{\acrfullformat}[2]{#1\glsspace(#2)} +\newcommand*{\ACRfullfmt}[3]{% + \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsspace} -% Robust space to ensure it's written to the \texttt{.glsdefs} file. -%\changes{4.08}{2014-07-30}{new} +%\begin{macro}{\acrfullplfmt} +%\changes{4.02}{2013-12-05}{new} +% No case change plural full format. % \begin{macrocode} -\newrobustcmd{\glsspace}{\space} +\newcommand*{\acrfullplfmt}[3]{% + \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Acrfullplfmt} +%\changes{4.02}{2013-12-05}{new} +% Sentence case plural full format. +%\changes{4.07}{2014-04-04}{fixed no case change bug} +% \begin{macrocode} +\newcommand*{\Acrfullplfmt}[3]{% + \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ACRfullplfmt} +%\changes{4.02}{2013-12-05}{new} +% All upper case plural full format. +% \begin{macrocode} +\newcommand*{\ACRfullplfmt}[3]{% + \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\acrfull} +% Full form of the acronym. +%\changes{3.01}{2011-04-12}{made robust} +%\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} +% \begin{macrocode} +\newrobustcmd*{\acrfull}{\@gls@hyp@opt\ns@acrfull} +% \end{macrocode} +%\changes{4.08}{2014-07-30}{removed \cs{@sacrfull}} +%\changes{3.0}{2011-04-02}{added starred version} +% \begin{macrocode} +\newcommand*\ns@acrfull[2][]{% + \new@ifnextchar[{\@acrfull{#1}{#2}}% + {\@acrfull{#1}{#2}[]}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@acrfull} +%\changes{4.02}{2013-12-05}{now using \cs{acrfullfmt}} +% Low-level macro: +% \begin{macrocode} +\def\@acrfull#1#2[#3]{% +% \end{macrocode} +% Make it easier for acronym styles to change this: +% \begin{macrocode} + \acrfullfmt{#1}{#2}{#3}% +} % \end{macrocode} %\end{macro} % @@ -17080,6 +17850,10 @@ you % \begin{macrocode} \newrobustcmd*{\Acrfull}{\@gls@hyp@opt\ns@Acrfull} % \end{macrocode} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\acrfull}{\Acrfull} +% \end{macrocode} %\changes{3.0}{2011-04-02}{added starred version} %\changes{4.08}{2014-07-30}{removed \cs{@sAcrfull}} % \begin{macrocode} @@ -17099,16 +17873,6 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\Acrfullfmt} -%\changes{4.02}{2013-12-05}{new} -% First letter upper case full format. -% \begin{macrocode} -\newcommand*{\Acrfullfmt}[3]{% - \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -% %\begin{macro}{\ACRfull} %\changes{3.01}{2011-04-12}{made robust} %\changes{4.08}{2014-07-30}{switched to using \cs{@gls@hyp@opt}} @@ -17134,17 +17898,6 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\ACRfullfmt} -%\changes{4.02}{2013-12-05}{new} -% All upper case full format. -% \begin{macrocode} -\newcommand*{\ACRfullfmt}[3]{% - \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -% -% % Plural: %\begin{macro}{\acrfullpl} %\changes{1.13}{2008-05-10}{new} @@ -17172,16 +17925,6 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\acrfullplfmt} -%\changes{4.02}{2013-12-05}{new} -% No case change plural full format. -% \begin{macrocode} -\newcommand*{\acrfullplfmt}[3]{% - \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -% %\begin{macro}{\Acrfullpl} %\changes{1.13}{2008-05-10}{new} %\changes{3.01}{2011-04-12}{made robust} @@ -17189,6 +17932,10 @@ you % \begin{macrocode} \newrobustcmd*{\Acrfullpl}{\@gls@hyp@opt\ns@Acrfullpl} % \end{macrocode} +%Add sentence case mapping. +% \begin{macrocode} +\glsmfuaddmap{\acrfullpl}{\Acrfullpl} +% \end{macrocode} %\changes{4.08}{2014-07-30}{removed \cs{s@Acrfullpl}} %\changes{3.0}{2011-04-02}{added starred version} % \begin{macrocode} @@ -17208,18 +17955,6 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\Acrfullplfmt} -%\changes{4.02}{2013-12-05}{new} -% First letter upper case plural full format. -%\changes{4.07}{2014-04-04}{fixed no case change bug} -% \begin{macrocode} -\newcommand*{\Acrfullplfmt}[3]{% - \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -% -% %\begin{macro}{\ACRfullpl} %\changes{1.13}{2008-05-10}{new} %\changes{3.01}{2011-04-12}{made robust} @@ -17246,26 +17981,17 @@ you % \end{macrocode} %\end{macro} % -%\begin{macro}{\ACRfullplfmt} -%\changes{4.02}{2013-12-05}{new} -% All upper case plural full format. -% \begin{macrocode} -\newcommand*{\ACRfullplfmt}[3]{% - \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -% -%\section{Predefined acronym styles} +%\subsection{Predefined acronym styles} %\begin{macro}{\acronymfont} -%This is only used with the additional acronym styles: +%Used by the acronym styles to apply a font change to the short form. % \begin{macrocode} \newcommand{\acronymfont}[1]{#1} % \end{macrocode} %\end{macro} %\begin{macro}{\firstacronymfont} -%This is only used with the additional acronym styles: %\changes{1.14}{2008-06-17}{new} +%Used by the acronym styles to apply a font change to the short form +% on first use. % \begin{macrocode} \newcommand{\firstacronymfont}[1]{\acronymfont{#1}} % \end{macrocode} @@ -17343,7 +18069,10 @@ you short={\the\glsshorttok},% shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% +% \end{macrocode} +%\changes{4.50}{2022-10-14}{corrected long plural suffix} +% \begin{macrocode} + longplural={\the\glslongtok\noexpand\glspluralsuffix},% \GenericAcronymFields,% \the\glskeylisttok }% @@ -17351,7 +18080,8 @@ you \@do@newglossaryentry }% % \end{macrocode} -% Make sure that \ics{acrfull} etc reflects the new style: +% Make sure that \cs{acrfull} etc reflects the new style: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \renewcommand*{\acrfullfmt}[3]{% \glslink[##1]{##2}{\genacrfullformat{##2}{##3}}}% @@ -17359,16 +18089,16 @@ you \glslink[##1]{##2}{\Genacrfullformat{##2}{##3}}}% \renewcommand*{\ACRfullfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\genacrfullformat{##2}{##3}}}}% + \glsuppercase{\genacrfullformat{##2}{##3}}}}% \renewcommand*{\acrfullplfmt}[3]{% \glslink[##1]{##2}{\genplacrfullformat{##2}{##3}}}% \renewcommand*{\Acrfullplfmt}[3]{% \glslink[##1]{##2}{\Genplacrfullformat{##2}{##3}}}% \renewcommand*{\ACRfullplfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\genplacrfullformat{##2}{##3}}}}% + \glsuppercase{\genplacrfullformat{##2}{##3}}}}% % \end{macrocode} -% Make sure that \ics{glsentryfull} etc reflects the new style: +% Make sure that \cs{glsentryfull} etc reflects the new style: % \begin{macrocode} \renewcommand*{\glsentryfull}[1]{\genacrfullformat{##1}{}}% \renewcommand*{\Glsentryfull}[1]{\Genacrfullformat{##1}{}}% @@ -17700,7 +18430,7 @@ you %\end{acrstyle} % %\begin{acrstyle}{long-sp-short-desc} -%\changes{4.02}{2013-12-05}{new} +%\changes{4.16}{2015-07-08}{new} % \meta{long} (\marg{short}) acronym style that has an % accompanying description (which the user needs to supply). % The space between the long and short form is given by @@ -17849,8 +18579,9 @@ you {% % \end{macrocode} % Plural form, all caps: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\glsentrylongpl{\glslabel}\glsinsert}% }% }% @@ -17874,8 +18605,9 @@ you {% % \end{macrocode} % Subsequent singular form, all caps: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} - \mfirstucMakeUppercase + \glsuppercase {\glsentrylong{\glslabel}\glsinsert}% }% }% @@ -17893,6 +18625,7 @@ you \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% % \end{macrocode} %\changes{4.03}{2014-01-20}{fixed bug in \cs{acrfullfmt}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \renewcommand*{\acrfullfmt}[3]{% \glslink[##1]{##2}{\glsentrylong{##2}##3\space @@ -17902,7 +18635,7 @@ you (\acronymfont{\glsentryshort{##2}})}}% \renewcommand*{\ACRfullfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\glsentrylong{##2}##3\space + \glsuppercase{\glsentrylong{##2}##3\space (\acronymfont{\glsentryshort{##2}})}}}% % \end{macrocode} %\changes{4.03}{2014-01-20}{fixed bug in \cs{acrfullplfmt}} @@ -17912,13 +18645,14 @@ you (\acronymfont{\glsentryshortpl{##2}})}}% % \end{macrocode} %\changes{4.03}{2014-01-20}{fixed bug in \cs{Acrfullplfmt}} +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \renewcommand*{\Acrfullplfmt}[3]{% \glslink[##1]{##2}{\Glsentrylongpl{##2}##3\space (\acronymfont{\glsentryshortpl{##2}})}}% \renewcommand*{\ACRfullplfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\glsentrylongpl{##2}##3\space + \glsuppercase{\glsentrylongpl{##2}##3\space (\acronymfont{\glsentryshortpl{##2}})}}}% \renewcommand*{\glsentryfull}[1]{% \glsentrylong{##1}\space(\acronymfont{\glsentryshort{##1}})% @@ -17953,8 +18687,9 @@ you \renewcommand*{\GenericAcronymFields}{}% % \end{macrocode} %\changes{4.03}{2014-01-20}{commented spurious EOL} +%\changes{4.50}{2022-10-14}{removed \cs{acronymfont} from around long form} % \begin{macrocode} - \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentrylong{##1}}}% + \renewcommand*{\acronymentry}[1]{\glsentrylong{##1}}% \renewcommand*{\acronymsort}[2]{##2}% }% % \end{macrocode} @@ -17998,7 +18733,8 @@ you \renewcommand*{\acronymfont}[1]{##1}% \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% % \end{macrocode} -% Don't use footnotes for \ics{acrfull}: +% Don't use footnotes for \cs{acrfull}: +%\changes{4.50}{2022-10-14}{switched to using \cs{glsuppercase}} % \begin{macrocode} \renewcommand*{\acrfullfmt}[3]{% \glslink[##1]{##2}{\acronymfont{\glsentryshort{##2}}##3\space @@ -18008,7 +18744,7 @@ you (\glsentrylong{##2})}}% \renewcommand*{\ACRfullfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshort{##2}}##3\space + \glsuppercase{\acronymfont{\glsentryshort{##2}}##3\space (\glsentrylong{##2})}}}% \renewcommand*{\acrfullplfmt}[3]{% \glslink[##1]{##2}{\acronymfont{\glsentryshortpl{##2}}##3\space @@ -18018,10 +18754,10 @@ you (\glsentrylongpl{##2})}}% \renewcommand*{\ACRfullplfmt}[3]{% \glslink[##1]{##2}{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{##2}}##3\space + \glsuppercase{\acronymfont{\glsentryshortpl{##2}}##3\space (\glsentrylongpl{##2})}}}% % \end{macrocode} -% Similarly for \ics{glsentryfull} etc: +% Similarly for \cs{glsentryfull} etc: % \begin{macrocode} \renewcommand*{\glsentryfull}[1]{% \acronymfont{\glsentryshort{##1}}\space(\glsentrylong{##1})}% @@ -18240,155 +18976,70 @@ you \fi % \end{macrocode} % -% These commands for setting the style are now deprecated but are -% kept for backward compatibility. -% %\begin{macro}{\SetDefaultAcronymDisplayStyle} % Sets the default acronym display style for given glossary. %\changes{2.04}{2009-11-10}{new} %\changes{3.11a}{2013-10-15}{changed to use \cs{defglsentryfmt}} +% Used by \sty{glossaries-extra} when restoring \cs{newacronym}. % \begin{macrocode} \newcommand*{\SetDefaultAcronymDisplayStyle}[1]{% \defglsentryfmt[#1]{\glsgenentryfmt}% } % \end{macrocode} %\end{macro} +% +% The following commands for setting the acronym style are now deprecated. +% %\begin{macro}{\DefaultNewAcronymDef} % Sets up the acronym definition for the default style. % The information is provided by the tokens \cs{glslabeltok}, % \cs{glsshorttok}, \cs{glslongtok} and \cs{glskeylisttok}. -% \begin{macrocode} -\newcommand*{\DefaultNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glsshorttok},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% - plural={\noexpand\expandonce\noexpand\@glo@shortpl},% - firstplural={\acrfullformat{\noexpand\expandonce\noexpand\@glo@longpl}% - {\noexpand\expandonce\noexpand\@glo@shortpl}},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% -% \end{macrocode} -% Remaining options specified by the user: -% \begin{macrocode} - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@descplural\gls@assign@descplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural -% \end{macrocode} -% If expansion is switched off, the default plurals won't be properly set. -% \begin{macrocode} - \@@gls@noexpand@assign@default@plurals -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\@@gls@noexpand@assign@default@plurals} %\changes{4.47}{2021-09-20}{new} -% \begin{macrocode} -\newcommand*{\@@gls@noexpand@assign@default@plurals}{% - \expandafter\ifx\csname glo@\the\glslabeltok @plural\endcsname\@@gls@@default@acr@plural - \csxdef{glo@\the\glslabeltok @plural}{\expandonce\@glo@shortpl}% - \fi - \expandafter\ifx\csname glo@\the\glslabeltok @firstpl\endcsname\@@gls@@default@acr@firstplural - \csxdef{glo@\the\glslabeltok @firstpl}{% - \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)}% - \fi - \expandafter\ifx\csname glo@\the\glslabeltok @descplural\endcsname\@@gls@@default@acr@descplural - \csxdef{glo@\the\glslabeltok @descplural}{\expandonce\@glo@longpl}% - \fi -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +%\cs{@@gls@noexpand@assign@default@plurals} was used in \cs{DefaultNewAcronymDef}. +% Added in v4.47 to fix bug \#162 +% (\url{https://www.dickimaw-books.com/bugtracker.php?key=162}). +% Removed in v4.50 along with the deprecated styles. %\end{macro} %\begin{macro}{\@@gls@@default@acr@plural} %\changes{4.47}{2021-09-20}{new} -% \begin{macrocode} -\newcommand*{\@@gls@@default@acr@plural}{\expandonce\@glo@shortpl} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} %\end{macro} %\begin{macro}{\@@gls@@default@acr@firstplural} %\changes{4.47}{2021-09-20}{new} -% \begin{macrocode} -\newcommand*{\@@gls@@default@acr@firstplural}{% - \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} %\end{macro} %\begin{macro}{\@@gls@@default@acr@descplural} %\changes{4.47}{2021-09-20}{new} -% \begin{macrocode} -\newcommand*{\@@gls@@default@acr@descplural}{\expandonce\@glo@longpl} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} %\end{macro} %\begin{macro}{\SetDefaultAcronymStyle} %\changes{2.04}{2009-11-10}{new} -% Set up the default acronym style: -% \begin{macrocode} -\newcommand*{\SetDefaultAcronymStyle}{% -% \end{macrocode} -% Set the display style: -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDefaultAcronymDisplayStyle{\@gls@type}% - }% -% \end{macrocode} -% Set up the definition of \cs{newacronym}: -% \begin{macrocode} - \renewcommand{\newacronym}[4][]{% -% \end{macrocode} -% If user is just using the main glossary and hasn't identified it -% as a list of acronyms, then update. (This is done to ensure -% backwards compatibility with versions prior to 2.04). -% \begin{macrocode} - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDefaultAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DefaultNewAcronymDef - }% - \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\acrfootnote} %\changes{3.0}{2011-04-02}{new} -% Used by the footnote acronym styles. +% This was used by the old footnote acronym styles. +%Since it may have been used outside of those styles, it has been +%retained. % \begin{macrocode} \newcommand*{\acrfootnote}[3]{\acrlinkfootnote{#1}{#2}{#3}} % \end{macrocode} %\end{macro} %\begin{macro}{\acrlinkfootnote} %\changes{3.0}{2011-04-02}{new} +% This was used by the old footnote acronym styles. +%Since it may have been used outside of those styles, it has been +%retained. % \begin{macrocode} \newcommand*{\acrlinkfootnote}[3]{% \footnote{\glslink[#1]{#2}{#3}}% @@ -18397,6 +19048,9 @@ you %\end{macro} %\begin{macro}{\acrnolinkfootnote} %\changes{3.0}{2011-04-02}{new} +% This was used by the old footnote acronym styles. +%Since it may have been used outside of those styles, it has been +%retained. % \begin{macrocode} \newcommand*{\acrnolinkfootnote}[3]{% \footnote{#3}% @@ -18410,79 +19064,17 @@ you %\changes{2.04}{2009-11-10}{new} %\changes{3.0}{2011-04-02}{expanded options link options} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{% - \defglsentryfmt[#1]{% -% \end{macrocode} -%\changes{4.02}{2013-12-05}{Moved check for empty custom text to prevent -%unwanted parenthetical material} -% \begin{macrocode} - \ifdefempty\glscustomtext - {% - \ifglsused{\glslabel}% - {% - \acronymfont{\glsgenentryfmt}% - }% - {% - \firstacronymfont{\glsgenentryfmt}% - \ifglshassymbol{\glslabel}% - {% - \expandafter\protect\expandafter\acrfootnote\expandafter - {\@gls@link@opts}{\@gls@link@label}% - {% - \glsifplural - {\glsentrysymbolplural{\glslabel}}% - {\glsentrysymbol{\glslabel}}% - }% - }% - }% - }% - {\glscustomtext\glsinsert}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\DescriptionFootnoteNewAcronymDef} -% \begin{macrocode} -\newcommand*{\DescriptionFootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - first={\the\glsshorttok},% - firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - text={\the\glsshorttok},% - plural={\noexpand\expandonce\noexpand\@glo@shortpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\the\glslongtok},% - symbolplural={\noexpand\expandonce\noexpand\@glo@longpl},% - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetDescriptionFootnoteAcronymStyle} % If a description and footnote are both required, store the long form % in the \gloskey{symbol} key. Store the short form in \gloskey{text} @@ -18492,72 +19084,9 @@ you % This style was deprecated with the introduction of % \cs{newacronymstyle}. %\changes{4.47}{2021-09-20}{added deprecated warnings} -% \begin{macrocode} -\newcommand*{\SetDescriptionFootnoteAcronymStyle}{% - \ifglsacrsmallcaps - \@gls@deprecated@acr@warning{footnote,smallcaps,description}% - {footnote-sc-desc}{short-sc-footnote-desc}% - \else - \ifglsacrsmaller - \@gls@deprecated@acr@warning{footnote,smaller,description}% - {footnote-sm-desc}{short-sm-footnote-desc}% - \else - \@gls@deprecated@acr@warning{footnote,description}% - {footnote-desc}{short-footnote-desc}% - \fi - \fi - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionFootnoteNewAcronymDef - }% -% \end{macrocode} -% -% If \pkgopt{footnote} package option is specified, set the first -% use to append the long form (stored in \gloskey{symbol}) as a -% footnote. -%\changes{1.12}{2008-03-08}{Added \cs{protect} before \cs{footnote} -% and \cs{glslink}} -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}% - }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009-03-02}{changed \cs{acronymfont} to use -%\cs{textsmaller} instead -%of \cs{smaller}} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% -% \end{macrocode} -% \begin{macrocode} - \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% - \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -% \end{macrocode} -% Check for package option clash -% \begin{macrocode} - \ifglsacrdua - \PackageError{glossaries}{Option clash: `footnote' and `dua' - can't both be set}{}% - \fi -}% -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\SetDescriptionDUAAcronymDisplayStyle} @@ -18565,53 +19094,17 @@ you % description and dua combination. %\changes{2.04}{2009-11-10}{new} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{% - \defglsentryfmt[#1]{\glsgenentryfmt}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\DescriptionDUANewAcronymDef} -% \begin{macrocode} -\newcommand*{\DescriptionDUANewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glslongtok},% - sort={\the\glslongtok}, - text={\the\glslongtok},% - first={\the\glslongtok},% - plural={\noexpand\expandonce\noexpand\@glo@longpl},% - firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\the\glsshorttok},% - symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetDescriptionDUAAcronymStyle} % Description, don't use acronym and no footnote. % Note that the short form is stored in the \gloskey{symbol} key, @@ -18620,40 +19113,9 @@ you % This style was deprecated with the introduction of % \cs{newacronymstyle}. %\changes{4.47}{2021-09-20}{added deprecated warning} -% \begin{macrocode} -\newcommand*{\SetDescriptionDUAAcronymStyle}{% - \ifglsacrsmallcaps - \PackageError{glossaries}{Option clash: `smallcaps' and `dua' - can't both be set}{}% - \else - \ifglsacrsmaller - \PackageError{glossaries}{Option clash: `smaller' and `dua' - can't both be set}{}% - \fi - \fi - \@gls@deprecated@acr@warning{dua,description}{dua-desc}{long-noshort-desc}% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionDUANewAcronymDef - }% -% \end{macrocode} -% Set display. -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}% - }% -}% -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\SetDescriptionAcronymDisplayStyle} @@ -18662,150 +19124,28 @@ you %\changes{2.04}{2009-11-10}{new} %\changes{3.07}{2013-07-05}{now using \cs{glsdoparenifnotempty}} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{% - \defglsentryfmt[#1]{% -% \end{macrocode} -%\changes{4.02}{2013-12-05}{Moved check for empty custom text to prevent -%unwanted parenthetical material} -% \begin{macrocode} - \ifdefempty\glscustomtext - {% - \ifglsused{\glslabel}% - {% -% \end{macrocode} -% Move the inserted text outside of \cs{acronymfont} -% \begin{macrocode} - \let\gls@org@insert\glsinsert - \let\glsinsert\@empty - \acronymfont{\glsgenentryfmt}\gls@org@insert - }% - {% - \glsgenentryfmt - \ifglshassymbol{\glslabel}% - {% - \glsifplural - {% - \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% - }% - {% - \def\@glo@symbol{\glsentrysymbol{\glslabel}}% - }% - \space(\protect\firstacronymfont - {\glscapscase - {\@glo@symbol} - {\@glo@symbol} - {\mfirstucMakeUppercase{\@glo@symbol}}})% - }% - {}% - }% - }% - {\glscustomtext\glsinsert}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\DescriptionNewAcronymDef} -% \begin{macrocode} -\newcommand*{\DescriptionNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand - \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% - sort={\the\glsshorttok},% - first={\the\glslongtok},% - firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% - text={\the\glsshorttok},% - plural={\noexpand\expandonce\noexpand\@glo@shortpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\noexpand\@glo@text},% - symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - \the\glskeylisttok}% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetDescriptionAcronymStyle} % Option \pkgopt{description} is used, but not \pkgopt{dua} % or \pkgopt{footnote}. % Store long form in \gloskey{first} key % and short form in \gloskey{text} and \gloskey{symbol} key. -% The name is stored using \ics{acrnameformat} to allow the +% The name is stored using \cs{acrnameformat} to allow the % user to override the way the name is displayed in the % list of acronyms. -% \begin{macrocode} -\newcommand*{\SetDescriptionAcronymStyle}{% - \ifglsacrsmallcaps - \@gls@deprecated@acr@warning{smallcaps,description}% - {long-sc-short-desc}{long-short-sc-desc}% - \else - \ifglsacrsmaller - \@gls@deprecated@acr@warning{smaller,description}% - {long-sm-short-desc}{long-short-sm-desc}% - \else - \@gls@deprecated@acr@warning{description}% - {long-short-desc}{long-short-desc}% - \fi - \fi - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionNewAcronymDef - }% -% \end{macrocode} -% Set display. -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionAcronymDisplayStyle{\@gls@type}% - }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009-03-02}{changed \cs{acronymfont} to use -%\cs{textsmaller} instead -%of \cs{smaller}} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand{\acronymfont}[1]{\textsc{##1}} - \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% - \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -}% -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\SetFootnoteAcronymDisplayStyle} @@ -18813,162 +19153,38 @@ you % footnote setting (but not \pkgopt{description} or \pkgopt{dua}). %\changes{2.04}{2009-11-10}{new} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{% - \defglsentryfmt[#1]{% -% \end{macrocode} -%\changes{4.02}{2013-12-05}{Moved check for empty custom text to prevent -%unwanted parenthetical material} -% \begin{macrocode} - \ifdefempty\glscustomtext - {% -% \end{macrocode} -% Move the inserted text outside of \cs{acronymfont} -% \begin{macrocode} - \let\gls@org@insert\glsinsert - \let\glsinsert\@empty - \ifglsused{\glslabel}% - {% - \acronymfont{\glsgenentryfmt}\gls@org@insert - }% - {% - \firstacronymfont{\glsgenentryfmt}\gls@org@insert - \ifglshaslong{\glslabel}% - {% - \expandafter\protect\expandafter\acrfootnote\expandafter - {\@gls@link@opts}{\@gls@link@label}% - {% - \glsifplural - {\glsentrylongpl{\glslabel}}% - {\glsentrylong{\glslabel}}% - }% - }% -% \end{macrocode} -%\changes{3.13a}{2013-11-05}{fixed missing argument bug} -% \begin{macrocode} - {}% - }% - }% - {\glscustomtext\glsinsert}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\FootnoteNewAcronymDef} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. +%\end{macro} +% +%\begin{macro}{\SetFootnoteAcronymStyle} +% If \pkgopt{footnote} package option is specified, set the first +% use to append the long form (stored in \gloskey{description}) as a +% footnote. +% Use the \gloskey{description} key to store the long form. +% This style was deprecated with the introduction of +% \cs{newacronymstyle}. +%\changes{4.47}{2021-09-20}{added deprecated warnings} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. +%\end{macro} +% +%\begin{macro}{\glsdoparenifnotempty} +%\changes{4.50}{2022-10-14}{replaced \cs{DeclareRobustCommand} with +%\cs{newrobustcmd}} +% Do a space followed by the argument if the argument doesn't expand +% to empty or \cs{relax}. If argument isn't empty (or \cs{relax}), apply +% the macro to it given in the second argument. % \begin{macrocode} -\newcommand*{\FootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - plural={\noexpand\expandonce\noexpand\@glo@shortpl},% - first={\the\glsshorttok},% - firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@descplural\gls@assign@descplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@descplural\@org@gls@assign@descplural -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\SetFootnoteAcronymStyle} -% If \pkgopt{footnote} package option is specified, set the first -% use to append the long form (stored in \gloskey{description}) as a -% footnote. -% Use the \gloskey{description} key to store the long form. -% This style was deprecated with the introduction of -% \cs{newacronymstyle}. -%\changes{4.47}{2021-09-20}{added deprecated warnings} -% \begin{macrocode} -\newcommand*{\SetFootnoteAcronymStyle}{% - \ifglsacrsmallcaps - \@gls@deprecated@acr@warning{footnote,smallcaps}{footnote-sc}{short-sc-footnote}% - \else - \ifglsacrsmaller - \@gls@deprecated@acr@warning{footnote,smaller}{footnote-sm}{short-sm-footnote}% - \else - \@gls@deprecated@acr@warning{footnote}{footnote}{short-footnote}% - \fi - \fi - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetFootnoteAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \FootnoteNewAcronymDef - }% -% \end{macrocode} -% Set display -%\changes{1.12}{2008-03-08}{Added \cs{protect} before \cs{footnote} and -% \cs{glslink}} -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetFootnoteAcronymDisplayStyle{\@gls@type}% - }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009-03-02}{changed \cs{acronymfont} to use -%\cs{textsmaller} instead -%of \cs{smaller}} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% - \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -% \end{macrocode} -% Check for option clash -% \begin{macrocode} - \ifglsacrdua - \PackageError{glossaries}{Option clash: `footnote' and `dua' - can't both be set}{}% - \fi -}% -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsdoparenifnotempty} -% Do a space followed by the argument if the argument doesn't expand -% to empty or \cs{relax}. If argument isn't empty (or \cs{relax}), apply -% the macro to it given in the second argument. -% \begin{macrocode} -\DeclareRobustCommand*{\glsdoparenifnotempty}[2]{% +\newrobustcmd*{\glsdoparenifnotempty}[2]{% \protected@edef\gls@tmp{#1}% \ifdefempty\gls@tmp {}% @@ -18988,107 +19204,17 @@ you % specified. %\changes{2.04}{2009-11-10}{new} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetSmallAcronymDisplayStyle}[1]{% - \defglsentryfmt[#1]{% -% \end{macrocode} -%\changes{4.02}{2013-12-05}{Moved check for empty custom text to prevent -%unwanted parenthetical material} -% \begin{macrocode} - \ifdefempty\glscustomtext - {% -% \end{macrocode} -% Move the inserted text outside of \cs{acronymfont} -% \begin{macrocode} - \let\gls@org@insert\glsinsert - \let\glsinsert\@empty - \ifglsused{\glslabel}% - {% - \acronymfont{\glsgenentryfmt}\gls@org@insert - }% - {% - \glsgenentryfmt - \ifglshassymbol{\glslabel}% - {% - \glsifplural - {% - \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% - }% - {% - \def\@glo@symbol{\glsentrysymbol{\glslabel}}% - }% - \space - (\glscapscase - {\firstacronymfont{\@glo@symbol}}% - {\firstacronymfont{\@glo@symbol}}% - {\firstacronymfont{\mfirstucMakeUppercase{\@glo@symbol}}})% - }% - {}% - }% - }% - {\glscustomtext\glsinsert}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} %\begin{macro}{\SmallNewAcronymDef} %\changes{3.02}{2012-05-21}{fixed broken short and long plural} -% \begin{macrocode} -\newcommand*{\SmallNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% -% \end{macrocode} -% Default to the short plural. -% \begin{macrocode} - plural={\noexpand\expandonce\noexpand\@glo@shortpl},% - first={\the\glslongtok},% -% \end{macrocode} -% Default to the long plural. -% \begin{macrocode} - firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\noexpand\@glo@first},% - descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% - symbol={\the\glsshorttok},% -% \end{macrocode} -% Default to the short plural. -% \begin{macrocode} - symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@descplural\gls@assign@descplural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@descplural\@org@gls@assign@descplural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetSmallAcronymStyle} % Neither footnote nor description required, but smallcaps or % smaller specified. @@ -19097,61 +19223,9 @@ you % This style was deprecated with the introduction of % \cs{newacronymstyle}. %\changes{4.47}{2021-09-20}{added deprecated warnings} -% \begin{macrocode} -\newcommand*{\SetSmallAcronymStyle}{% - \ifglsacrsmallcaps - \@gls@deprecated@acr@warning{smallcaps}{long-sc-short}{long-short-sc}% - \else - \@gls@deprecated@acr@warning{smaller}{long-sm-short}{long-short-sm}% - \fi - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetSmallAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \SmallNewAcronymDef - }% -% \end{macrocode} -% Change the display since \gloskey{first} only contains long form. -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetSmallAcronymDisplayStyle{\@gls@type}% - }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009-03-02}{changed \cs{acronymfont} to use -%\cs{textsmaller} instead -%of \cs{smaller}} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}} - \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% - \else - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}} - \fi -% \end{macrocode} -% check for option clash -% \begin{macrocode} - \ifglsacrdua - \ifglsacrsmallcaps - \PackageError{glossaries}{Option clash: `smallcaps' and `dua' - can't both be set}{}% - \else - \PackageError{glossaries}{Option clash: `smaller' and `dua' - can't both be set}{}% - \fi - \fi -}% -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\SetDUADisplayStyle} @@ -19159,89 +19233,25 @@ you % setting. %\changes{2.04}{2009-11-10}{new} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetDUADisplayStyle}[1]{% - \defglsentryfmt[#1]{\glsgenentryfmt}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\DUANewAcronymDef} -% \begin{macrocode} -\newcommand*{\DUANewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glsshorttok},% - text={\the\glslongtok},% - first={\the\glslongtok},% - plural={\noexpand\expandonce\noexpand\@glo@longpl},% - firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% - symbol={\the\glsshorttok},% - symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% - \the\glskeylisttok - }% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \let\@org@gls@assign@descplural\gls@assign@descplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural - \let\gls@assign@descplural\@org@gls@assign@descplural -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetDUAStyle} % Always expand acronyms. % This style was deprecated with the introduction of % \cs{newacronymstyle}. %\changes{4.47}{2021-09-20}{added deprecated warnings} -% \begin{macrocode} -\newcommand*{\SetDUAStyle}{% - \@gls@deprecated@acr@warning{dua}{dua}{long-noshort}% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDUADisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DUANewAcronymDef - }% -% \end{macrocode} -% Set the display -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDUADisplayStyle{\@gls@type}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % %\begin{macro}{\@gls@deprecated@acr@warning} @@ -19257,41 +19267,9 @@ you %\end{macro} % %\begin{macro}{\SetAcronymStyle} -% \begin{macrocode} -\newcommand*{\SetAcronymStyle}{% - \SetDefaultAcronymStyle - \ifglsacrdescription - \ifglsacrfootnote - \SetDescriptionFootnoteAcronymStyle - \else - \ifglsacrdua - \SetDescriptionDUAAcronymStyle - \else - \SetDescriptionAcronymStyle - \fi - \fi - \else - \ifglsacrfootnote - \SetFootnoteAcronymStyle - \else - \ifthenelse{\boolean{glsacrsmallcaps}\OR - \boolean{glsacrsmaller}}% - {% - \SetSmallAcronymStyle - }% - {% - \ifglsacrdua - \SetDUAStyle - \fi - }% - \fi - \fi -} -% \end{macrocode} -% Set the acronym style according to the package options -% \begin{macrocode} -\SetAcronymStyle -% \end{macrocode} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % % Allow user to define their own custom acronyms. @@ -19304,84 +19282,34 @@ you % Sets the acronym display style. %\changes{2.06}{2010-06-14}{new} %\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} -% \begin{macrocode} -\newcommand*{\SetCustomDisplayStyle}[1]{% - \defglsentryfmt[#1]{\glsgenentryfmt}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\CustomAcronymFields} %\changes{2.06}{2010-06-14}{new} -% \begin{macrocode} -\newcommand*{\CustomAcronymFields}{% - name={\the\glsshorttok},% - description={\the\glslongtok},% - first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% - firstplural={\acrfullformat - {\noexpand\glsentrylongpl{\the\glslabeltok}}% - {\noexpand\glsentryshortpl{\the\glslabeltok}}},% -% \end{macrocode} -% \changes{4.01}{2013-11-16}{inserted missing comma} -% \begin{macrocode} - text={\the\glsshorttok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix}% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\CustomNewAcronymDef} %\changes{2.06}{2010-06-14}{new} -% \begin{macrocode} -\newcommand*{\CustomNewAcronymDef}{% - \protected@edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - user1={\the\glsshorttok},% - user2={\the\glsshorttok\noexpand\acrpluralsuffix},% - user3={\the\glslongtok},% - user4={\the\glslongtok\noexpand\acrpluralsuffix},% - \CustomAcronymFields,% - \the\glskeylisttok - }% - }% - \@do@newglossaryentry -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} +% %\begin{macro}{\SetCustomStyle} %\changes{2.06}{2010-06-14}{new} -% \begin{macrocode} -\newcommand*{\SetCustomStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetCustomDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \CustomNewAcronymDef - }% -% \end{macrocode} -% Set the display -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetCustomDisplayStyle{\@gls@type}% - }% -} -% \end{macrocode} +%\changes{4.50}{2022-10-14}{removed} +% Deprecated following the introduction of \cs{setacronymstyle}. +% Removed in v4.50. %\end{macro} % % -% \section{Predefined Glossary Styles}\label{sec:code:styles} +%\subsection{Predefined Glossary Styles}\label{sec:code:styles} % The \sty{glossaries} bundle comes with some predefined glossary % styles. These need to be loaded now for the \pkgopt{style} option % to use them. @@ -19402,7 +19330,7 @@ you % \end{macrocode} % The styles that use the \env{supertabular} environment. These are % not loaded if the \pkgopt{nosuper} package option is used or if -% the \isty{supertabular} package isn't installed. +% the \sty{supertabular} package isn't installed. % \begin{macrocode} \@gls@loadsuper % \end{macrocode} @@ -19412,7 +19340,7 @@ you \@gls@loadtree % \end{macrocode} % The default glossary style is set according to the \pkgopt{style} package -% option, but can be overridden by \ics{glossarystyle}. The +% option, but can be overridden by \cs{glossarystyle}. The % required style must be defined at this point. % \begin{macrocode} \ifx\@glossary@default@style\relax @@ -19421,7 +19349,7 @@ you \fi % \end{macrocode} % -%\section{Debugging Commands} +%\subsection{Debugging Commands} % %\begin{macro}{\showgloparent} %\changes{3.0}{2011-04-02}{new} @@ -19851,13 +19779,19 @@ you % \end{macrocode} %\end{macro} % -%\section{Compatibility with version 2.07 and below} +%\subsection{Compatibility with version 2.07 and below} +% +%The backward-compatibility options have been removed in version +%4.50. Use the rollback feature instead if backward-compatibility is +%required. Bear in mind that v2.07 was released 2010-07-10 and +%v3.07 was released 2013-07-05. Any old documents from that long +%ago will probably have problems with recent kernels. % % In order to fix some bugs in v3.0, it was necessary to change the % way information is written to the \filetype{glo} file, which also meant % a change in the format of the Xindy style file. The compatibility % option is meant for documents that use a customised Xindy style -% file with \ics{noist}. With the compatibility option, hopefully +% file with \cs{noist}. With the compatibility option, hopefully % \app{xindy} will still be able to process the old document, but % the bugs will remain. The issues in versions 2.07 and below: %\begin{itemize} @@ -19869,11 +19803,6 @@ you % \cs{thecounter}, the link in the location number would be % undefined. %\end{itemize} -% \begin{macrocode} -\csname ifglscompatible-2.07\endcsname - \RequirePackage{glossaries-compatible-207} -\fi -% \end{macrocode} %\iffalse % \begin{macrocode} % @@ -19881,547 +19810,106 @@ you %\fi %\iffalse % \begin{macrocode} -%<*glossaries-prefix.sty> +%<*glossary-hypernav.sty> % \end{macrocode} %\fi -%\chapter{Prefix Support (glossaries-prefix Code)} -%\label{sec:code:prefix} -%\changes{3.14a}{2013-11-12}{new} -% This package provides a means of adding prefixes to your glossary -% entries. For example, you may want to use \qt{a -% \cs{gls}\marg{label}} on first use but use \qt{an -% \cs{gls}\marg{label}} on subsequent use. +%\section{Glossary Styles} +% \subsection{Glossary hyper-navigation definitions +% (glossary-hypernav.sty)} +%\label{sec:code:hypernav} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-prefix}[2021/11/01 v4.49 (NLCT)] % \end{macrocode} -% Pass all options to \sty{glossaries}: +% Rollback releases: % \begin{macrocode} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\DeclareRelease{v4.46}{2020-03-19}{glossary-hypernav-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-hypernav-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} -% Process options: +% Package Definition: % \begin{macrocode} -\ProcessOptions +\ProvidesPackage{glossary-hypernav}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -% Load \sty{glossaries}: +% +% The commands defined in this package are provided to +% help navigate around the groups within a glossary +% (see \autoref{sec:code:printglos}.) +% \cs{printglossary} (and \cs{printglossaries}) +% set \cs{@glo@type} to the label of the current +% glossary. This is used to create a unique hypertarget in +% the event of multiple glossaries. +%\begin{definition} +% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text} +%\end{definition} +% This command makes \meta{text} a hyperlink to the glossary group +% whose label is given by \meta{label} for the glossary given +% by \meta{type}. +%\begin{macro}{\glsnavhyperlink} +%\changes{1.14}{2008-06-17}{changed \cs{edef} to \cs{protected@edef}} +%\changes{1.17}{2008-12-26}{replaced \cs{hyperlink} to +%\cs{@glslink}} +%\changes{4.50}{2022-10-14}{changed \cs{@glo@type} to \cs{currentglossary}} +%The optional argument is the glossary type and can be used to make the +%group label unique in case the same group occurs in multiple +%glossaries. +%The optional argument was \cs{@glo@type} but is now \cs{currentglossary} +%because that's less likely to change within the glossary. +%It's unlikely that the optional argument will be used to set it to +%anything other than \cs{currentglossary} but it makes it +%possible to hyperlink to the group from outside of the glossary. % \begin{macrocode} -\RequirePackage{glossaries} +\newcommand*{\glsnavhyperlink}[3][\currentglossary]{% % \end{macrocode} -% Add the new keys: +%\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} % \begin{macrocode} -\define@key{glossentry}{prefixfirst}{\def\@glo@entryprefixfirst{#1}}% -\define@key{glossentry}{prefixfirstplural}{\def\@glo@entryprefixfirstplural{#1}}% -\define@key{glossentry}{prefix}{\def\@glo@entryprefix{#1}}% -\define@key{glossentry}{prefixplural}{\def\@glo@entryprefixplural{#1}}% + \protected@edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% + \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}% +} % \end{macrocode} -% Add them to \ics{@gls@keymap}: +%\end{macro} +%\begin{macro}{\glsnavhyperlinkname} +%\changes{4.29}{2017-01-19}{new} +%Expands to the hypertarget name. The first argument is the glossary +%type. The second argument is the group label. % \begin{macrocode} -\appto\@gls@keymap{,% - {prefixfirst}{prefixfirst},% - {prefixfirstplural}{prefixfirstplural},% - {prefix}{prefix},% - {prefixplural}{prefixplural}% - } +\newcommand*{\glsnavhyperlinkname}[2]{glsn:#1@#2} % \end{macrocode} -% Set the default values: +%\end{macro} +% +%\begin{macro}{\glsnavhypertarget} +%\begin{definition} +% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text} +%\end{definition} +% This command makes \meta{text} a hypertarget for the glossary group +% whose label is given by \meta{label} in the glossary given +% by \meta{type}. If \meta{type} is omitted, \cs{@glo@type} is +% used which is set by \cs{printglossary} to the current +% glossary label. +%\changes{1.14}{2008-06-17}{added write to aux file} +%\changes{1.15}{2008-08-15}{added check if rerun required} +%\changes{1.17}{2008-12-26}{replaced \cs{hypertarget} to +%\cs{@glstarget}} +%\changes{4.50}{2022-10-14}{changed \cs{@glo@type} to \cs{currentglossary}} +%The optional argument complicates things for \sty{glossaries-extra}. % \begin{macrocode} -\appto\@newglossaryentryprehook{% - \def\@glo@entryprefix{}% - \def\@glo@entryprefixplural{}% - \let\@glo@entryprefixfirst\@gls@default@value - \let\@glo@entryprefixfirstplural\@gls@default@value +\newcommand*{\glsnavhypertarget}{\protect\@@gls@navhypertarget} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@@gls@navhypertarget} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand*{\@@gls@navhypertarget}[3][\currentglossary]{% + \@glsnavhypertarget{#1}{#2}{#3}% } % \end{macrocode} -% Set the assignment code: +%\end{macro} +%The actual code is now in an internal command that doesn't have an +%optional argument, which makes it easier to save and restore the +%original behaviour. +%\begin{macro}{\@glsnavhypertarget} +%\changes{4.32}{2017-08-24}{new} % \begin{macrocode} -\appto\@newglossaryentryposthook{% - \gls@assign@field{}{\@glo@label}{prefix}{\@glo@entryprefix}% - \gls@assign@field{}{\@glo@label}{prefixplural}{\@glo@entryprefixplural}% -% \end{macrocode} -% If \gloskey{prefixfirst} has not been supplied, make it the same -% as \gloskey{prefix}. -% \begin{macrocode} - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @prefix\endcsname}{\@glo@label}{prefixfirst}% - {\@glo@entryprefixfirst}% -% \end{macrocode} -% If \gloskey{prefixfirstplural} has not been supplied, make it the same -% as \gloskey{prefixplural}. -% \begin{macrocode} - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @prefixplural\endcsname}{\@glo@label}% - {prefixfirstplural}{\@glo@entryprefixfirstplural}% -} -% \end{macrocode} -% -% Define commands to access these fields: -%\begin{macro}{\glsentryprefixfirst} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\glsentryprefixfirst}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixfirst}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryprefixfirstplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\glsentryprefixfirstplural}[1]{% - \csuse{glo@\glsdetoklabel{#1}@prefixfirstplural}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryprefix} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\glsentryprefix}[1]{\csuse{glo@\glsdetoklabel{#1}@prefix}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryprefixplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\glsentryprefixplural}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixplural}} -% \end{macrocode} -%\end{macro} -% -% Now for the initial upper case variants: -%\begin{macro}{\Glsentryprefixfirst} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newrobustcmd*{\Glsentryprefixfirst}[1]{% - \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirst\endcsname}% - \xmakefirstuc\@glo@text -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryprefixfirstplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newrobustcmd*{\Glsentryprefixfirstplural}[1]{% - \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirstplural\endcsname}% - \xmakefirstuc\@glo@text -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryprefix} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newrobustcmd*{\Glsentryprefix}[1]{% - \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefix\endcsname}% - \xmakefirstuc\@glo@text -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryprefixplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newrobustcmd*{\Glsentryprefixplural}[1]{% - \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixplural\endcsname}% - \xmakefirstuc\@glo@text -} -% \end{macrocode} -%\end{macro} -% -% Define commands to determine if the prefix keys have been set: -%\begin{macro}{\ifglshasprefix} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\ifglshasprefix}[3]{% - \ifcsempty{glo@\glsdetoklabel{#1}@prefix}% - {#3}% - {#2}% -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ifglshasprefixplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\ifglshasprefixplural}[3]{% - \ifcsempty{glo@\glsdetoklabel{#1}@prefixplural}% - {#3}% - {#2}% -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ifglshasprefixfirst} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\ifglshasprefixfirst}[3]{% - \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirst}% - {#3}% - {#2}% -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ifglshasprefixfirstplural} -%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\ifglshasprefixfirstplural}[3]{% - \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirstplural}% - {#3}% - {#2}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsprefix@record@hook} -%\changes{4.44}{2019-12-06}{new} -%Need to take into account the possibility that -%\sty{glossaries-extra} might be loaded with the \pkgopt{record} -%option. -% \begin{macrocode} -\providecommand{\@glsprefix@record@hook}[2]{% - \ifdef\@glsxtr@record - {\@glsxtr@record{#1}{#2}{glslink}}% - {}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsprefixsep} -%\changes{4.45}{2020-02-13}{new} -%Separator between prefix and term. Does nothing by default. -% \begin{macrocode} -\newcommand{\glsprefixsep}{} -% \end{macrocode} -%\end{macro} -% -% Define commands that insert the prefix before commands like \ics{gls}: -%\begin{macro}{\pgls} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\pgls}{\@gls@hyp@opt\@pgls} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@spgls} -%\begin{macro}{\@pgls} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@pgls}[2][]{% - \new@ifnextchar[% - {\@pgls@{#1}{#2}}% - {\@pgls@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@pgls@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@pgls@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefix{#2}{\glsentryprefix{#2}\glsprefixsep}{}% - }% - {% - \ifglshasprefixfirst{#2}{\glsentryprefixfirst{#2}\glsprefixsep}{}% - }% - \@gls@{#1}{#2}[#3]% - }% -} -% \end{macrocode} -%\end{macro} -% -% Similarly for the plural version: -%\begin{macro}{\pglspl} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\pglspl}{\@gls@hyp@opt\@pglspl} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@spglspl} -%\begin{macro}{\@pglspl} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@pglspl}[2][]{% - \new@ifnextchar[% - {\@pglspl@{#1}{#2}}% - {\@pglspl@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@pglspl@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@pglspl@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefixplural{#2}{\glsentryprefixplural{#2}\glsprefixsep}{}% - }% - {% - \ifglshasprefixfirstplural{#2}% - {\glsentryprefixfirstplural{#2}\glsprefixsep}{}% - }% - \@glspl@{#1}{#2}[#3]% - }% -} -% \end{macrocode} -%\end{macro} -% -% Now for the first letter upper case versions: -%\begin{macro}{\Pgls} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\Pgls}{\@gls@hyp@opt\@Pgls} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@sPgls} -%\begin{macro}{\@Pgls} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@Pgls}[2][]{% - \new@ifnextchar[% - {\@Pgls@{#1}{#2}}% - {\@Pgls@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Pgls@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@Pgls@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefix{#2}% - {% - \Glsentryprefix{#2}% - \glsprefixsep - \@gls@{#1}{#2}[#3]% - }% - {\@Gls@{#1}{#2}[#3]}% - }% - {% - \ifglshasprefixfirst{#2}% - {% - \Glsentryprefixfirst{#2}% - \glsprefixsep - \@gls@{#1}{#2}[#3]% - }% - {\@Gls@{#1}{#2}[#3]}% - }% - }% -} -% \end{macrocode} -%\end{macro} -% -% Similarly for the plural version: -%\begin{macro}{\Pglspl} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\Pglspl}{\@gls@hyp@opt\@Pglspl} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@sPglspl} -%\begin{macro}{\@Pglspl} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@Pglspl}[2][]{% - \new@ifnextchar[% - {\@Pglspl@{#1}{#2}}% - {\@Pglspl@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Pglspl@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@Pglspl@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefixplural{#2}% - {% - \Glsentryprefixplural{#2}% - \glsprefixsep - \@glspl@{#1}{#2}[#3]% - }% - {\@Glspl@{#1}{#2}[#3]}% - }% - {% - \ifglshasprefixfirstplural{#2}% - {% - \Glsentryprefixfirstplural{#2}% - \glsprefixsep - \@glspl@{#1}{#2}[#3]% - }% - {\@Glspl@{#1}{#2}[#3]}% - }% - }% -} -% \end{macrocode} -%\end{macro} -% -% Finally the all upper case versions: -%\begin{macro}{\PGLS} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\PGLS}{\@gls@hyp@opt\@PGLS} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@sPGLS} -%\begin{macro}{\@PGLS} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@PGLS}[2][]{% - \new@ifnextchar[% - {\@PGLS@{#1}{#2}}% - {\@PGLS@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@PGLS@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@PGLS@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefix{#2}% - {\mfirstucMakeUppercase{\glsentryprefix{#2}\glsprefixsep}}{}% - }% - {% - \ifglshasprefixfirst{#2}% - {\mfirstucMakeUppercase{\glsentryprefixfirst{#2}\glsprefixsep}}{}% - }% - \@GLS@{#1}{#2}[#3]% - }% -} -% \end{macrocode} -%\end{macro} -% -% Plural version: -%\begin{macro}{\PGLSpl} -%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} -% \begin{macrocode} -\newrobustcmd{\PGLSpl}{\@gls@hyp@opt\@PGLSpl} -% \end{macrocode} -%\end{macro} -%\changes{4.08}{2014-07-30}{removed \@sPGLSpl} -%\begin{macro}{\@PGLSpl} -% Unstarred version. -% \begin{macrocode} -\newcommand*{\@PGLSpl}[2][]{% - \new@ifnextchar[% - {\@PGLSpl@{#1}{#2}}% - {\@PGLSpl@{#1}{#2}[]}% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@PGLSpl@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@PGLSpl@#1#2[#3]{% - \@glsprefix@record@hook{#1}{#2}% - \glsdoifexists{#2}% - {% - \ifglsused{#2}% - {% - \ifglshasprefixplural{#2}% - {\mfirstucMakeUppercase{\glsentryprefixplural{#2}\glsprefixsep}}{}% - }% - {% - \ifglshasprefixfirstplural{#2}% - {\mfirstucMakeUppercase{\glsentryprefixfirstplural{#2}\glsprefixsep}}{}% - }% - \@GLSpl@{#1}{#2}[#3]% - }% -} -% \end{macrocode} -%\end{macro} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossary-hypernav.sty> -% \end{macrocode} -%\fi -%\chapter{Glossary Styles} -% \section{Glossary hyper-navigation definitions (glossary-hypernav package)} -%\label{sec:code:hypernav} -% Package Definition: -% \begin{macrocode} -\ProvidesPackage{glossary-hypernav}[2021/11/01 v4.49 (NLCT)] -% \end{macrocode} -% -% The commands defined in this package are provided to -% help navigate around the groups within a glossary -% (see \autoref{sec:code:printglos}.) -% \ics{printglossary} (and \ics{printglossaries}) -% set \cs{@glo@type} to the label of the current -% glossary. This is used to create a unique hypertarget in -% the event of multiple glossaries. -%\begin{definition} -% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text} -%\end{definition} -% This command makes \meta{text} a hyperlink to the glossary group -% whose label is given by \meta{label} for the glossary given -% by \meta{type}. -%\begin{macro}{\glsnavhyperlink} -%\changes{1.14}{2008-06-17}{changed \cs{edef} to \cs{protected@edef}} -%\changes{1.17}{2008-12-26}{replaced \cs{hyperlink} to -%\cs{@glslink}} -% \begin{macrocode} -\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% -% \end{macrocode} -%\changes{4.47}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} -% \begin{macrocode} - \protected@edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% - \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsnavhyperlinkname} -%\changes{4.29}{2017-01-19}{new} -%Expands to the hypertarget name. The first argument is the glossary -%type. The second argument is the group label. -% \begin{macrocode} -\newcommand*{\glsnavhyperlinkname}[2]{glsn:#1@#2} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsnavhypertarget} -%\begin{definition} -% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text} -%\end{definition} -% This command makes \meta{text} a hypertarget for the glossary group -% whose label is given by \meta{label} in the glossary given -% by \meta{type}. If \meta{type} is omitted, \cs{@glo@type} is -% used which is set by \ics{printglossary} to the current -% glossary label. -%\changes{1.14}{2008-06-17}{added write to aux file} -%\changes{1.15}{2008-08-15}{added check if rerun required} -%\changes{1.17}{2008-12-26}{replaced \cs{hypertarget} to -%\cs{@glstarget}} -% \begin{macrocode} -\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% - \@glsnavhypertarget{#1}{#2}{#3}% -} -% \end{macrocode} -%\end{macro} -%The actual code is now in an internal command that doesn't have an -%optional argument, which makes it easier to save and restore the -%original behaviour. -%\begin{macro}{\@glsnavhypertarget} -%\changes{4.32}{2017-08-24}{new} -% \begin{macrocode} -\newcommand*{\@glsnavhypertarget}[3]{% +\newcommand*{\@glsnavhypertarget}[3]{% % \end{macrocode} % Add this group to the aux file for re-run check. % \begin{macrocode} @@ -20473,16 +19961,12 @@ you % However it requires at least 2 runs to ensure the information is % up-to-date. %\changes{1.14}{2008-06-17}{new} +%\changes{4.50}{2022-10-14}{updated to use \sty{etoolbox}} % \begin{macrocode} \newcommand*{\@gls@hypergroup}[2]{% -\@ifundefined{@gls@hypergrouplist@#1}{% - \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}% -}{% - \expandafter\let\expandafter\@gls@tmp - \csname @gls@hypergrouplist@#1\endcsname - \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{% - \@gls@tmp,#2}% -}% + \ifcsdef{@gls@hypergrouplist@#1}% + {\protected@csxappto{@gls@hypergrouplist@#1}{,#2}}% + {\protected@csxdef{@gls@hypergrouplist@#1}{#2}}% } % \end{macrocode} %\end{macro} @@ -20500,16 +19984,19 @@ you %\begin{macro}{\glsnavigation} % \changes{1.14}{2008-06-17}{changed to only use labels for % groups that are present} +%\changes{4.50}{2022-10-14}{changed \cs{@glo@type} to \cs{currentglossary}} % \begin{macrocode} \newcommand*{\glsnavigation}{% \def\@gls@between{}% - \ifcsundef{@gls@hypergrouplist@\@glo@type}% + \ifcsundef{@gls@hypergrouplist@\currentglossary}% {% \def\@gls@list{}% }% {% - \expandafter\let\expandafter\@gls@list - \csname @gls@hypergrouplist@\@glo@type\endcsname +% \end{macrocode} +%\changes{4.50}{2022-10-14}{switched to \cs{letcs}} +% \begin{macrocode} + \letcs\@gls@list{@gls@hypergrouplist@\currentglossary}% }% \@for\@gls@tmp:=\@gls@list\do{% \@gls@between @@ -20518,7 +20005,7 @@ you %\cs{@gls@getgrouptitle}} % \begin{macrocode} \@gls@getgrouptitle{\@gls@tmp}{\@gls@grptitle}% - \glsnavhyperlink{\@gls@tmp}{\@gls@grptitle}% + \expandafter\glsnavhyperlink\expandafter{\@gls@tmp}{\@gls@grptitle}% \let\@gls@between\glshypernavsep }% } @@ -20553,11 +20040,21 @@ you %<*glossary-inline.sty> % \end{macrocode} %\fi -% \section{In-line Style (glossary-inline.sty)} +% \subsection{In-line Style (glossary-inline.sty)} % This defines an in-line style where the entries are % comma-separated with just the name and description displayed. % \begin{macrocode} -\ProvidesPackage{glossary-inline}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-inline-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-inline-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-inline}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} % %\begin{style}{inline} @@ -20581,7 +20078,7 @@ you \renewcommand*{\glossaryheader}{}% % \end{macrocode} % No group headings (if heading is required, add -% \ics{glsinlinedopostchild} to start definition in case heading +% \cs{glsinlinedopostchild} to start definition in case heading % follows a child entry): % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% @@ -20612,7 +20109,7 @@ you {\glsinlinedescformat{\glossentrydesc{##1}}{\glossentrysymbol{##1}}{##2}}% {\glsinlineemptydescformat{\glossentrysymbol{##1}}{##2}}% }% - \ifglshaschildren{##1}% + \glsinlineifhaschildren{##1}% {% \glsresetsubentrycounter \glsinlineparentchildseparator @@ -20641,6 +20138,15 @@ you % \end{macrocode} %\end{style} % +%\begin{macro}{\glsinlineifhaschildren} +%\changes{4.50}{2022-10-14}{new} +% \begin{macrocode} +\newcommand{\glsinlineifhaschildren}[3]{% + \ifglshaschildren{#1}{#2}{#3}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsinlinedopostchild} % \begin{macrocode} \newcommand*{\glsinlinedopostchild}{% @@ -20738,103 +20244,14 @@ you %\fi %\iffalse % \begin{macrocode} -%<*glossary-list-2020-03-19.sty> +%<*glossary-list.sty> % \end{macrocode} %\fi -% \section{Rollback v4.46 (glossary-list-2020-03-19.sty)} -% Version 4.46 preserved for rollback. -% \begin{macrocode} -\ProvidesPackage{glossary-list}[2020/03/19 v4.46 (NLCT)] -\providecommand{\indexspace}{% - \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax -} -\newcommand*{\glslistgroupheaderfmt}[1]{#1} -\newcommand*{\glslistnavigationitem}[1]{\item[#1]} -\newglossarystyle{list}{% - \renewenvironment{theglossary}% - {\begin{description}}{\end{description}}% - \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glstarget{##1}{\glossentryname{##1}}] - \glossentrydesc{##1}\glspostdescription\space ##2}% - \renewcommand*{\subglossentry}[3]{% - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\space - \glossentrydesc{##2}\glspostdescription\space ##3.}% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% -} -\newglossarystyle{listgroup}{% - \setglossarystyle{list}% - \renewcommand*{\glsgroupheading}[1]{% - \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} -\newglossarystyle{listhypergroup}{% - \setglossarystyle{list}% - \renewcommand*{\glossaryheader}{% - \glslistnavigationitem{\glsnavigation}}% - \renewcommand*{\glsgroupheading}[1]{% - \item[\glslistgroupheaderfmt - {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} -\newglossarystyle{altlist}{% - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}% - \glstarget{##1}{\glossentryname{##1}}]% - \mbox{}\par\nobreak\@afterheading - \glossentrydesc{##1}\glspostdescription\space ##2}% - \renewcommand{\subglossentry}[3]{% - \par - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space ##3}% -} -\newglossarystyle{altlistgroup}{% - \setglossarystyle{altlist}% - \renewcommand*{\glsgroupheading}[1]{% - \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} -\newglossarystyle{altlisthypergroup}{% - \setglossarystyle{altlist}% - \renewcommand*{\glossaryheader}{% - \glslistnavigationitem{\glsnavigation}}% - \renewcommand*{\glsgroupheading}[1]{% - \item[\glslistgroupheaderfmt - {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} -\newglossarystyle{listdotted}{% - \setglossarystyle{list}% - \renewcommand*{\glossentry}[2]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glsentryitem{##1}% - \glstarget{##1}{\glossentryname{##1}}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##1}}% - \renewcommand*{\subglossentry}[3]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glssubentryitem{##2}% - \glstarget{##2}{\glossentryname{##2}}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##2}}% -} -\newlength\glslistdottedwidth -\setlength{\glslistdottedwidth}{.5\hsize} -\newglossarystyle{sublistdotted}{% - \setglossarystyle{listdotted}% - \renewcommand*{\glossentry}[2]{% - \item[\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}]}% -} -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossary-list.sty> -% \end{macrocode} -%\fi -% \section{List Style (glossary-list.sty)} -% The \isty{glossary-list} style file defines glossary styles +% \subsection{List Style (glossary-list.sty)} +% The \sty{glossary-list} style file defines glossary styles % that use the \env{description} environment. Note that since % the entry name is placed in the optional argument to the -% \ics{item} command, it will appear in a bold font by +% \cs{item} command, it will appear in a bold font by % default. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} @@ -20842,11 +20259,12 @@ you % Rollback releases: % \begin{macrocode} \DeclareRelease{v4.46}{2020-03-19}{glossary-list-2020-03-19.sty} -\DeclareCurrentRelease{v4.49}{2021-11-01} +\DeclareRelease{v4.49}{2021-11-01}{glossary-list-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} %Declare package: % \begin{macrocode} -\ProvidesPackage{glossary-list}[2021/11/01 v4.49 (NLCT)] +\ProvidesPackage{glossary-list}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} %\begin{macro}{\indexspace} %\changes{4.13}{2015-02-03}{new} @@ -20918,7 +20336,7 @@ you %\begin{style}{list} % The \glostyle{list} glossary style % uses the \env{description} environment. The group separator -% \ics{glsgroupskip} is redefined as \cs{indexspace} +% \cs{glsgroupskip} is redefined as \cs{indexspace} % which produces a gap between groups. The glossary heading % and the group headings do nothing. Sub-entries immediately % follow the main entry without the sub-entry name. This style @@ -21157,23 +20575,32 @@ you %<*glossary-long.sty> % \end{macrocode} %\fi -% \section{Glossary Styles using longtable (the glossary-long -% package)} -% The glossary styles defined in the \isty{glossary-long} package +% \subsection{Glossary Styles using longtable (glossary-long.sty)} +% The glossary styles defined in the \sty{glossary-long} package % used the \env{longtable} environment in the glossary. % \begin{macrocode} -\ProvidesPackage{glossary-long}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-long-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-long-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-long}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -% Requires the \isty{longtable} package: +% Requires the \sty{longtable} package: % \begin{macrocode} \RequirePackage{longtable} % \end{macrocode} %\begin{macro}{\glsdescwidth} % This is a length that governs the width of the description column. % (There's a chance that the user may specify \pkgopt{nolong} -% and then load \isty{glossary-long} later, in which case +% and then load \sty{glossary-long} later, in which case % \cs{glsdescwidth} may have already been defined by -% \isty{glossary-super}. The same goes for \cs{glspagelistwidth}.) +% \sty{glossary-super}. The same goes for \cs{glspagelistwidth}.) %\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} % \begin{macrocode} \@ifundefined{glsdescwidth}{% @@ -21653,13 +21080,23 @@ you %<*glossary-longbooktabs.sty> % \end{macrocode} %\fi -%\section{Glossary Styles using longtable and booktabs (the -%glossary-longbooktabs) package} +%\subsection{Glossary Styles using longtable and booktabs +%(glossary-longbooktabs.sty)} % The styles here are based on David Carlisle's patch at % \url{http://tex.stackexchange.com/a/56890} % % \begin{macrocode} -\ProvidesPackage{glossary-longbooktabs}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-longbooktabs-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-longbooktabs-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-longbooktabs}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} % Requires \sty{booktabs} package: % \begin{macrocode} @@ -21815,7 +21252,7 @@ you % \end{macrocode} %The patch \cs{glspatchLToutput} is already applied in %\glostyle{long4col-booktabs} and so doesn't need to be here. -%\changes{4.42}{??}{removed superfluous \cs{glspatchLToutput}} +%\changes{4.42}{2019-01-06}{removed superfluous \cs{glspatchLToutput}} % \begin{macrocode} \glspatchLToutput % \end{macrocode} @@ -21994,19 +21431,28 @@ you %<*glossary-longragged.sty> % \end{macrocode} %\fi -% \section{Glossary Styles using longtable (the glossary-longragged -% package)} -% The glossary styles defined in the \isty{glossary-longragged} package +% \subsection{Glossary Styles using longtable (glossary-longragged.sty)} +% The glossary styles defined in the \sty{glossary-longragged} package % used the \env{longtable} environment in the glossary and use % ragged right formatting for the multiline columns. % \begin{macrocode} -\ProvidesPackage{glossary-longragged}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-longragged-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-longragged-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-longragged}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -% Requires the \isty{array} package: +% Requires the \sty{array} package: % \begin{macrocode} \RequirePackage{array} % \end{macrocode} -% Requires the \isty{longtable} package: +% Requires the \sty{longtable} package: % \begin{macrocode} \RequirePackage{longtable} % \end{macrocode} @@ -22274,7 +21720,7 @@ you % %\begin{style}{altlongragged4col} % The \glostyle{altlongragged4col} style is like the \glostyle{altlong4col} -% style defined in the \isty{glossary-long} package, except that +% style defined in the \sty{glossary-long} package, except that % ragged right formatting is used for the description and page list % columns. % \begin{macrocode} @@ -22427,13 +21873,23 @@ you %<*glossary-mcols.sty> % \end{macrocode} %\fi -%\section{Glossary Styles using \styfmt{multicol} +%\subsection{Glossary Styles using \sty{multicol} %(glossary-mcols.sty)} -%The \isty{glossary-mcols} style file defines glossary styles that +%The \sty{glossary-mcols} style file defines glossary styles that %use the \sty{multicol} package. These use the tree-like glossary %styles in a multicol environment. % \begin{macrocode} -\ProvidesPackage{glossary-mcols}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-mcols-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-mcols-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-mcols}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -22455,6 +21911,7 @@ you %\begin{macro}{\glsmcols} % Define macro in which to store the number of columns. (Defaults to % 2.) +%\changes{3.05}{2013-04-21}{new} % \begin{macrocode} \newcommand*{\glsmcols}{2} % \end{macrocode} @@ -22866,19 +22323,30 @@ you %<*glossary-super.sty> % \end{macrocode} %\fi -% \section{Glossary Styles using supertabular environment (glossary-super package)} -% The glossary styles defined in the \isty{glossary-super} package +% \subsection{Glossary Styles using supertabular environment +% (glossary-super.sty)} +% The glossary styles defined in the \sty{glossary-super} package % use the \env{supertabular} environment. % \begin{macrocode} -\ProvidesPackage{glossary-super}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-super-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-super-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-super}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -% Requires the \isty{supertabular} package: +% Requires the \sty{supertabular} package: % \begin{macrocode} \RequirePackage{supertabular} % \end{macrocode} %\begin{macro}{\glsdescwidth} % This is a length that governs the width of the description column. -% This may already have been defined if \isty{glossary-long} +% This may already have been defined if \sty{glossary-long} % has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} % to \cs{hsize}} % \begin{macrocode} @@ -22891,7 +22359,7 @@ you % %\begin{macro}{\glspagelistwidth} % This is a length that governs the width of the page list column. -% This may already have been defined if \isty{glossary-long} +% This may already have been defined if \sty{glossary-long} % has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} % to \cs{hsize}} % \begin{macrocode} @@ -22905,7 +22373,7 @@ you %\begin{style}{super} % The \glostyle{super} glossary style uses the % \env{supertabular} environment -% (it uses lengths defined in the \isty{glossary-long} package.) +% (it uses lengths defined in the \sty{glossary-long} package.) % \begin{macrocode} \newglossarystyle{super}{% % \end{macrocode} @@ -23396,19 +22864,30 @@ you %<*glossary-superragged.sty> % \end{macrocode} %\fi -% \section{Glossary Styles using supertabular environment (glossary-superragged package)} -% The glossary styles defined in the \isty{glossary-superragged} +% \subsection{Glossary Styles using supertabular environment +% (glossary-superragged.sty)} +% The glossary styles defined in the \sty{glossary-superragged} % package use the \env{supertabular} environment. These styles -% are like those provided by the \isty{glossary-super} package, +% are like those provided by the \sty{glossary-super} package, % except that the multiline columns have ragged right justification. % \begin{macrocode} -\ProvidesPackage{glossary-superragged}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-superragged-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-superragged-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-superragged}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -% Requires the \isty{array} package: +% Requires the \sty{array} package: % \begin{macrocode} \RequirePackage{array} % \end{macrocode} -% Requires the \isty{supertabular} package: +% Requires the \sty{supertabular} package: % \begin{macrocode} \RequirePackage{supertabular} % \end{macrocode} @@ -23693,7 +23172,7 @@ you % %\begin{style}{altsuperragged4col} % The \glostyle{altsuperragged4col} glossary style is like -% \glostyle{altsuper4col} style in the \isty{glossary-super} +% \glostyle{altsuper4col} style in the \sty{glossary-super} % package but uses ragged right formatting in the description % and page list columns. % \begin{macrocode} @@ -23837,12 +23316,22 @@ you %<*glossary-tree.sty> % \end{macrocode} %\fi -%\section{Tree Styles (glossary-tree.sty)} -% The \isty{glossary-tree} style file defines glossary styles +%\subsection{Tree Styles (glossary-tree.sty)} +% The \sty{glossary-tree} style file defines glossary styles % that have a tree-like structure. These are designed for % hierarchical glossaries. % \begin{macrocode} -\ProvidesPackage{glossary-tree}[2021/11/01 v4.49 (NLCT)] +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossary-tree-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossary-tree-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossary-tree}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} % %\begin{macro}{\indexspace} @@ -23858,7 +23347,7 @@ you %\begin{macro}{\glstreenamefmt} %\changes{4.08}{2014-07-30}{new} % Format used to display the name in the tree styles. (This may be -% counteracted by \ics{glsnamefont}.) This command was previously also used to +% counteracted by \cs{glsnamefont}.) This command was previously also used to % format the group headings. % \begin{macrocode} \newcommand*{\glstreenamefmt}[1]{\textbf{#1}} @@ -23947,7 +23436,7 @@ you % \begin{macrocode} \newglossarystyle{index}{% % \end{macrocode} -% Set the paragraph indentation and skip and define \ics{item} +% Set the paragraph indentation and skip and define \cs{item} % to be the same as that used by \env{theindex}: % \begin{macrocode} \renewenvironment{theglossary}% @@ -23982,10 +23471,10 @@ you \glstreepredesc \glossentrydesc{##1}\glspostdescription\space ##2% }% % \end{macrocode} -% Sub entries: level 1 entries use \ics{subitem}, levels greater -% than~1 use \ics{subsubitem}. The level ("##1") shouldn't be 0, +% Sub entries: level 1 entries use \cs{subitem}, levels greater +% than~1 use \cs{subsubitem}. The level ("##1") shouldn't be 0, % as that's catered by \cs{glossentry}, but for completeness, -% if the level is 0, \ics{item} is used. The name is put in bold, +% if the level is 0, \cs{item} is used. The name is put in bold, % followed by the symbol in brackets (if it exists), the description % and the page list. % \begin{macrocode} @@ -24096,7 +23585,7 @@ you }% % \end{macrocode} % Sub entries: level \meta{n} is indented by \meta{n} times -% \ics{glstreeindent}. The name is in bold, followed by the +% \cs{glstreeindent}. The name is in bold, followed by the % symbol in brackets (if it exists), the description and the % page list. % \begin{macrocode} @@ -24211,7 +23700,7 @@ you }% % \end{macrocode} % Sub entries: level \meta{n} is indented by \meta{n} times -% \ics{glstreeindent}. The name and symbol are omitted. The +% \cs{glstreeindent}. The name and symbol are omitted. The % description followed by the page list are displayed. % \begin{macrocode} \renewcommand{\subglossentry}[3]{% @@ -24552,4547 +24041,4686 @@ you %\fi %\iffalse % \begin{macrocode} -%<*glossaries-compatible-207.sty> +%<*glossaries-babel.sty> % \end{macrocode} %\fi -%\chapter{Backwards Compatibility} -%\section{glossaries-compatible-207} -% Provides compatibility with version 2.07 and below. This uses -% original \sty{glossaries} xindy and makeindex formatting, so can -% be used with old documents that had customized style files, but -% hyperlinks may not work properly. +%\section{Multi-Lingual Support} +%\subsection{Babel Captions (glossaries-babel.sty)} +% Many thanks to everyone who contributed to the translations both +% via email and on comp.text.tex. +% Language support has now been split off into independent language +% modules. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-207}[2021/11/01 v4.49 (NLCT)] % \end{macrocode} -%\begin{macro}{\GlsAddXdyAttribute} -% Adds an attribute in old format. +% Rollback releases: % \begin{macrocode} -\ifglsxindy - \renewcommand*\GlsAddXdyAttribute[1]{% - \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}% - \expandafter\toks@\expandafter{\@xdylocref}% - \edef\@xdylocref{\the\toks@ ^^J% - (markup-locref - :open \string"\string~n\string\setentrycounter - {\noexpand\glscounter}% - \expandafter\string\csname#1\endcsname - \expandafter\@gobble\string\{\string" ^^J - :close \string"\expandafter\@gobble\string\}\string" ^^J - :attr \string"#1\string")}} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-babel-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-babel-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} -% Only has an effect before \ics{writeist}: +% Declare package % \begin{macrocode} -\fi +\ProvidesPackage{glossaries-babel}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -%\end{macro} -%\begin{macro}{\GlsAddXdyCounters} +% Load \sty{tracklang} to obtain language settings. % \begin{macrocode} -\renewcommand*\GlsAddXdyCounters[1]{% - \GlossariesWarning{\string\GlsAddXdyCounters\space not available - in compatibility mode.}% +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo +% \end{macrocode} +% Check for tracked languages: +% \begin{macrocode} + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-polyglossia.sty> +% \end{macrocode} +%\fi +%\subsection{Polyglossia Captions (glossaries-polyglossia.sty)} +% Language support has now been split off into independent language +% modules. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-polyglossia-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-polyglossia-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +% Declare package +% \begin{macrocode} +\ProvidesPackage{glossaries-polyglossia}[2022/10/14 v4.50 (NLCT)] +% \end{macrocode} +% Load \sty{tracklang} to obtain language settings. +% \begin{macrocode} +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo +% \end{macrocode} +% Check for tracked languages: +% \begin{macrocode} + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-prefix.sty> +% \end{macrocode} +%\fi +%\section{Prefix Support (glossaries-prefix Code)} +%\label{sec:code:prefix} +%\changes{3.14a}{2013-11-12}{new} +% This package provides a means of adding prefixes to your glossary +% entries. For example, you may want to use \qt{a +% \cs{gls}\marg{label}} on first use but use \qt{an +% \cs{gls}\marg{label}} on subsequent use. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% Rollback releases: +% \begin{macrocode} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-prefix-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-prefix-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} +% \end{macrocode} +%Declare package: +% \begin{macrocode} +\ProvidesPackage{glossaries-prefix}[2022/10/14 v4.50 (NLCT)] +% \end{macrocode} +% Pass all options to \sty{glossaries}: +% \begin{macrocode} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +% \end{macrocode} +% Process options: +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% Load \sty{glossaries}: +% \begin{macrocode} +\RequirePackage{glossaries} +% \end{macrocode} +% Add the new keys: +% \begin{macrocode} +\define@key{glossentry}{prefixfirst}{\def\@glo@entryprefixfirst{#1}}% +\define@key{glossentry}{prefixfirstplural}{\def\@glo@entryprefixfirstplural{#1}}% +\define@key{glossentry}{prefix}{\def\@glo@entryprefix{#1}}% +\define@key{glossentry}{prefixplural}{\def\@glo@entryprefixplural{#1}}% +% \end{macrocode} +% Add them to \cs{@gls@keymap}: +% \begin{macrocode} +\appto\@gls@keymap{,% + {prefixfirst}{prefixfirst},% + {prefixfirstplural}{prefixfirstplural},% + {prefix}{prefix},% + {prefixplural}{prefixplural}% + } +% \end{macrocode} +% Set the default values: +% \begin{macrocode} +\appto\@newglossaryentryprehook{% + \def\@glo@entryprefix{}% + \def\@glo@entryprefixplural{}% + \let\@glo@entryprefixfirst\@gls@default@value + \let\@glo@entryprefixfirstplural\@gls@default@value } % \end{macrocode} -%\end{macro} -% Add predefined attributes +% Set the assignment code: % \begin{macrocode} - \GlsAddXdyAttribute{glsnumberformat} - \GlsAddXdyAttribute{textrm} - \GlsAddXdyAttribute{textsf} - \GlsAddXdyAttribute{texttt} - \GlsAddXdyAttribute{textbf} - \GlsAddXdyAttribute{textmd} - \GlsAddXdyAttribute{textit} - \GlsAddXdyAttribute{textup} - \GlsAddXdyAttribute{textsl} - \GlsAddXdyAttribute{textsc} - \GlsAddXdyAttribute{emph} - \GlsAddXdyAttribute{glshypernumber} - \GlsAddXdyAttribute{hyperrm} - \GlsAddXdyAttribute{hypersf} - \GlsAddXdyAttribute{hypertt} - \GlsAddXdyAttribute{hyperbf} - \GlsAddXdyAttribute{hypermd} - \GlsAddXdyAttribute{hyperit} - \GlsAddXdyAttribute{hyperup} - \GlsAddXdyAttribute{hypersl} - \GlsAddXdyAttribute{hypersc} - \GlsAddXdyAttribute{hyperemph} +\appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{prefix}{\@glo@entryprefix}% + \gls@assign@field{}{\@glo@label}{prefixplural}{\@glo@entryprefixplural}% +% \end{macrocode} +% If \gloskey{prefixfirst} has not been supplied, make it the same +% as \gloskey{prefix}. +% \begin{macrocode} + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefix\endcsname}{\@glo@label}{prefixfirst}% + {\@glo@entryprefixfirst}% +% \end{macrocode} +% If \gloskey{prefixfirstplural} has not been supplied, make it the same +% as \gloskey{prefixplural}. +% \begin{macrocode} + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefixplural\endcsname}{\@glo@label}% + {prefixfirstplural}{\@glo@entryprefixfirstplural}% +} % \end{macrocode} % -%\begin{macro}{\GlsAddXdyLocation} -% Restore v2.07 definition: +% Define commands to access these fields: +%\begin{macro}{\glsentryprefixfirst} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} % \begin{macrocode} -\ifglsxindy - \renewcommand*{\GlsAddXdyLocation}[2]{% - \edef\@xdyuserlocationdefs{% - \@xdyuserlocationdefs ^^J% - (define-location-class \string"#1\string"^^J\space\space - \space(#2)) - }% - \edef\@xdyuserlocationnames{% - \@xdyuserlocationnames^^J\space\space\space - \string"#1\string"}% - } -\fi +\newcommand*{\glsentryprefixfirst}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixfirst}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsentryprefixfirstplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\glsentryprefixfirstplural}[1]{% + \csuse{glo@\glsdetoklabel{#1}@prefixfirstplural}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsentryprefix} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\glsentryprefix}[1]{\csuse{glo@\glsdetoklabel{#1}@prefix}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsentryprefixplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\glsentryprefixplural}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixplural}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@do@wrglossary} +% Now for the initial upper case variants: +%\begin{macro}{\Glsentryprefixfirst} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} -\renewcommand{\@do@wrglossary}[1]{% +\newcommand*{\Glsentryprefixfirst}[1]{% + \@Glsentryfield{#1}{prefixfirst}% +} % \end{macrocode} -% Determine whether to use \app{xindy} or \app{makeindex} -% syntax +%\end{macro} +%Add sentence case mapping. % \begin{macrocode} -\ifglsxindy +\glsmfuaddmap{\glsentryprefixfirst}{\Glsentryprefixfirst} % \end{macrocode} -% Need to determine if the formatting information starts with -% a ( or ) indicating a range. +%\begin{macro}{\Glsentryprefixfirstplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} - \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil - \def\@glo@range{}% - \expandafter\if\@glo@prefix(\relax - \def\@glo@range{:open-range}% - \else - \expandafter\if\@glo@prefix)\relax - \def\@glo@range{:close-range}% - \fi - \fi +\newcommand*{\Glsentryprefixfirstplural}[1]{% + \@Glsentryfield{#1}{prefixfirstplural}% +} % \end{macrocode} -% Get the location and escape any special characters +%\end{macro} +%Add sentence case mapping. % \begin{macrocode} - \protected@edef\@glslocref{\theglsentrycounter}% - \@gls@checkmkidxchars\@glslocref +\glsmfuaddmap{\glsentryprefixfirstplural}{\Glsentryprefixfirstplural} % \end{macrocode} -% Write to the glossary file using \app{xindy} syntax. +%\begin{macro}{\Glsentryprefix} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - (indexentry :tkey (\csname glo@#1@index\endcsname) - :locref \string"\@glslocref\string" % - :attr \string"\@glo@suffix\string" \@glo@range - ) - }% -\else +\newcommand*{\Glsentryprefix}[1]{% + \@Glsentryfield{#1}{prefix}% +} % \end{macrocode} -% Convert the format information into the format required for -% \app{makeindex} +%\end{macro} +%Add sentence case mapping. % \begin{macrocode} - \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat +\glsmfuaddmap{\glsentryprefix}{\Glsentryprefix} % \end{macrocode} -% Write to the glossary file using \app{makeindex} syntax. +%\begin{macro}{\Glsentryprefixplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +%\changes{4.50}{2022-10-14}{allow expansion in PDF bookmarks} % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - \string\glossaryentry{\csname glo@#1@index\endcsname - \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}% -\fi +\newcommand*{\Glsentryprefixplural}[1]{% + \@Glsentryfield{#1}{prefixplural}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\@set@glo@numformat} -% Only had 3 arguments in v2.07 +%Add sentence case mapping. % \begin{macrocode} -\def\@set@glo@numformat#1#2#3{% - \expandafter\@glo@check@mkidxrangechar#3\@nil - \protected@edef#1{% - \@glo@prefix setentrycounter[]{#2}% - \expandafter\string\csname\@glo@suffix\endcsname - }% - \@gls@checkmkidxchars#1% +\glsmfuaddmap{\glsentryprefixplural}{\Glsentryprefixplural} +% \end{macrocode} +% +% Define commands to determine if the prefix keys have been set: +%\begin{macro}{\ifglshasprefix} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\ifglshasprefix}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefix}% + {#3}% + {#2}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifglshasprefixplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\ifglshasprefixplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixplural}% + {#3}% + {#2}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifglshasprefixfirst} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\ifglshasprefixfirst}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirst}% + {#3}% + {#2}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifglshasprefixfirstplural} +%\changes{4.45}{2020-02-13}{added \cs{glsdetoklabel}} +% \begin{macrocode} +\newcommand*{\ifglshasprefixfirstplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirstplural}% + {#3}% + {#2}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\writeist} -% Redefine \cs{writeist} back to the way it was in v2.07, but change -% \cs{istfile} to \cs{glswrite}. +%\begin{macro}{\@glsprefix@record@hook} +%\changes{4.44}{2019-12-06}{new} +%Need to take into account the possibility that +%\sty{glossaries-extra} might be loaded with the \pkgopt{record} +%option. % \begin{macrocode} -\ifglsxindy - \def\writeist{% - \openout\glswrite=\istfilename - \write\glswrite{;; xindy style file created by the glossaries - package in compatible-2.07 mode}% - \write\glswrite{;; for document '\jobname' on - \the\year-\the\month-\the\day}% - \write\glswrite{^^J; required styles^^J} - \@for\@xdystyle:=\@xdyrequiredstyles\do{% - \ifx\@xdystyle\@empty - \else - \protected@write\glswrite{}{(require - \string"\@xdystyle.xdy\string")}% - \fi - }% - \write\glswrite{^^J% - ; list of allowed attributes (number formats)^^J}% - \write\glswrite{(define-attributes ((\@xdyattributes)))}% - \write\glswrite{^^J; user defined alphabets^^J}% - \write\glswrite{\@xdyuseralphabets}% - \write\glswrite{^^J; location class definitions^^J}% - \protected@edef\@gls@roman{\@roman{0\string" - \string"roman-numbers-lowercase\string" :sep \string"}}% - \@onelevel@sanitize\@gls@roman - \edef\@tmp{\string" \string"roman-numbers-lowercase\string" - :sep \string"}% - \@onelevel@sanitize\@tmp - \ifx\@tmp\@gls@roman - \write\glswrite{(define-location-class - \string"roman-page-numbers\string"^^J\space\space\space - (\string"roman-numbers-lowercase\string") - :min-range-length \@glsminrange)}% - \else - \write\glswrite{(define-location-class - \string"roman-page-numbers\string"^^J\space\space\space - (:sep "\@gls@roman") - :min-range-length \@glsminrange)}% - \fi - \write\glswrite{(define-location-class - \string"Roman-page-numbers\string"^^J\space\space\space - (\string"roman-numbers-uppercase\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"arabic-page-numbers\string"^^J\space\space\space - (\string"arabic-numbers\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"alpha-page-numbers\string"^^J\space\space\space - (\string"alpha\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"Alpha-page-numbers\string"^^J\space\space\space - (\string"ALPHA\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"Appendix-page-numbers\string"^^J\space\space\space - (\string"ALPHA\string" - :sep \string"\@glsAlphacompositor\string" - \string"arabic-numbers\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"arabic-section-numbers\string"^^J\space\space\space - (\string"arabic-numbers\string" - :sep \string"\glscompositor\string" - \string"arabic-numbers\string") - :min-range-length \@glsminrange)}% - \write\glswrite{^^J; user defined location classes}% - \write\glswrite{\@xdyuserlocationdefs}% - \write\glswrite{^^J; define cross-reference class^^J}% - \write\glswrite{(define-crossref-class \string"see\string" - :unverified )}% - \write\glswrite{(markup-crossref-list - :class \string"see\string"^^J\space\space\space - :open \string"\string\glsseeformat\string" - :close \string"{}\string")}% - \write\glswrite{^^J; define the order of the location classes}% - \write\glswrite{(define-location-class-order - (\@xdylocationclassorder))}% - \write\glswrite{^^J; define the glossary markup^^J}% - \write\glswrite{(markup-index^^J\space\space\space - :open \string"\string - \glossarysection[\string\glossarytoctitle]{\string - \glossarytitle}\string\glossarypreamble\string~n\string\begin - {theglossary}\string\glossaryheader\string~n\string" ^^J\space - \space\space:close \string"\expandafter\@gobble - \string\%\string~n\string - \end{theglossary}\string\glossarypostamble - \string~n\string" ^^J\space\space\space - :tree)}% - \write\glswrite{(markup-letter-group-list - :sep \string"\string\glsgroupskip\string~n\string")}% - \write\glswrite{(markup-indexentry - :open \string"\string\relax \string\glsresetentrylist - \string~n\string")}% - \write\glswrite{(markup-locclass-list :open - \string"\glsopenbrace\string\glossaryentrynumbers - \glsopenbrace\string\relax\space \string"^^J\space\space\space - :sep \string", \string" - :close \string"\glsclosebrace\glsclosebrace\string")}% - \write\glswrite{(markup-locref-list - :sep \string"\string\delimN\space\string")}% - \write\glswrite{(markup-range - :sep \string"\string\delimR\space\string")}% - \@onelevel@sanitize\gls@suffixF - \@onelevel@sanitize\gls@suffixFF - \ifx\gls@suffixF\@empty - \else - \write\glswrite{(markup-range - :close "\gls@suffixF" :length 1 :ignore-end)}% - \fi - \ifx\gls@suffixFF\@empty - \else - \write\glswrite{(markup-range - :close "\gls@suffixFF" :length 2 :ignore-end)}% - \fi - \write\glswrite{^^J; define format to use for locations^^J}% - \write\glswrite{\@xdylocref}% - \write\glswrite{^^J; define letter group list format^^J}% - \write\glswrite{(markup-letter-group-list - :sep \string"\string\glsgroupskip\string~n\string")}% - \write\glswrite{^^J; letter group headings^^J}% - \write\glswrite{(markup-letter-group - :open-head \string"\string\glsgroupheading - \glsopenbrace\string"^^J\space\space\space - :close-head \string"\glsclosebrace\string")}% - \write\glswrite{^^J; additional letter groups^^J}% - \write\glswrite{\@xdylettergroups}% - \write\glswrite{^^J; additional sort rules^^J} - \write\glswrite{\@xdysortrules}% - \noist} -\else - \edef\@gls@actualchar{\string?} - \edef\@gls@encapchar{\string|} - \edef\@gls@levelchar{\string!} - \edef\@gls@quotechar{\string"} - \def\writeist{\relax - \openout\glswrite=\istfilename - \write\glswrite{\expandafter\@gobble\string\% makeindex style file - created by the glossaries package} - \write\glswrite{\expandafter\@gobble\string\% for document - '\jobname' on \the\year-\the\month-\the\day} - \write\glswrite{actual '\@gls@actualchar'} - \write\glswrite{encap '\@gls@encapchar'} - \write\glswrite{level '\@gls@levelchar'} - \write\glswrite{quote '\@gls@quotechar'} - \write\glswrite{keyword \string"\string\\glossaryentry\string"} - \write\glswrite{preamble \string"\string\\glossarysection[\string - \\glossarytoctitle]{\string\\glossarytitle}\string - \\glossarypreamble\string\n\string\\begin{theglossary}\string - \\glossaryheader\string\n\string"} - \write\glswrite{postamble \string"\string\%\string\n\string - \\end{theglossary}\string\\glossarypostamble\string\n - \string"} - \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n - \string"} - \write\glswrite{item_0 \string"\string\%\string\n\string"} - \write\glswrite{item_1 \string"\string\%\string\n\string"} - \write\glswrite{item_2 \string"\string\%\string\n\string"} - \write\glswrite{item_01 \string"\string\%\string\n\string"} - \write\glswrite{item_x1 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} - \write\glswrite{item_12 \string"\string\%\string\n\string"} - \write\glswrite{item_x2 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} - \write\glswrite{delim_0 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_1 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_2 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_t \string"\string\}\string\}\string"} - \write\glswrite{delim_n \string"\string\\delimN \string"} - \write\glswrite{delim_r \string"\string\\delimR \string"} - \write\glswrite{headings_flag 1} - \write\glswrite{heading_prefix - \string"\string\\glsgroupheading\string\{\string"} - \write\glswrite{heading_suffix - \string"\string\}\string\\relax - \string\\glsresetentrylist \string"} - \write\glswrite{symhead_positive \string"glssymbols\string"} - \write\glswrite{numhead_positive \string"glsnumbers\string"} - \write\glswrite{page_compositor \string"\glscompositor\string"} - \@gls@escbsdq\gls@suffixF - \@gls@escbsdq\gls@suffixFF - \ifx\gls@suffixF\@empty - \else - \write\glswrite{suffix_2p \string"\gls@suffixF\string"} - \fi - \ifx\gls@suffixFF\@empty - \else - \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} - \fi - \noist - } -\fi +\providecommand{\@glsprefix@record@hook}[2]{% + \ifdef\@glsxtr@record + {\@glsxtr@record{#1}{#2}{glslink}}% + {}% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\noist} +% +%\begin{macro}{\glsprefixsep} +%\changes{4.45}{2020-02-13}{new} +%Separator between prefix and term. Does nothing by default. % \begin{macrocode} -\renewcommand*{\noist}{\let\writeist\relax} +\newcommand{\glsprefixsep}{} % \end{macrocode} %\end{macro} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossaries-compatible-307.sty> -% \end{macrocode} -%\fi -%\section{glossaries-compatible-307} +% +% Define commands that insert the prefix before commands like \cs{gls}: +%\begin{macro}{\pgls} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-307}[2021/11/01 v4.49 (NLCT)] +\newrobustcmd{\pgls}{\@gls@hyp@opt\@pgls} % \end{macrocode} -% -% Compatibility macros for predefined glossary styles: -%\begin{macro}{\compatglossarystyle} -% Defines a compatibility glossary style. +%\end{macro} +%\changes{4.08}{2014-07-30}{removed \@spgls} +%\begin{macro}{\@pgls} +% Unstarred version. % \begin{macrocode} -\newcommand{\compatglossarystyle}[2]{% - \ifcsundef{@glscompstyle@#1}% - {% - \csdef{@glscompstyle@#1}{#2}% - }% - {% - \PackageError{glossaries}{Glossary compatibility style `#1' is already defined}{}% - }% +\newcommand*{\@pgls}[2][]{% + \new@ifnextchar[% + {\@pgls@{#1}{#2}}% + {\@pgls@{#1}{#2}[]}% } % \end{macrocode} %\end{macro} -% Backward compatible \glostyle{inline} style. +% +%\begin{macro}{\@pgls@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{inline}{% - \renewcommand{\glossaryentryfield}[5]{% - \glsinlinedopostchild - \gls@inlinesep - \def\glo@desc{##3}% - \def\@no@post@desc{\nopostdesc}% - \glsentryitem{##1}\glsinlinenameformat{##1}{##2}% - \ifx\glo@desc\@no@post@desc - \glsinlineemptydescformat{##4}{##5}% - \else - \ifstrempty{##3}% - {\glsinlineemptydescformat{##4}{##5}}% - {\glsinlinedescformat{##3}{##4}{##5}}% - \fi - \ifglshaschildren{##1}% +\def\@pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% {% - \glsresetsubentrycounter - \glsinlineparentchildseparator - \def\gls@inlinesubsep{}% - \def\gls@inlinepostchild{\glsinlinepostchild}% + \ifglshasprefix{#2}{\glsentryprefix{#2}\glsprefixsep}{}% }% - {}% - \def\gls@inlinesep{\glsinlineseparator}% - }% -% \end{macrocode} -% Sub-entries display description: -% \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% - \gls@inlinesubsep% - \glsinlinesubnameformat{##2}{##3}% - \glssubentryitem{##2}\glsinlinesubdescformat{##4}{##5}{##6}% - \def\gls@inlinesubsep{\glsinlinesubseparator}% + {% + \ifglshasprefixfirst{#2}{\glsentryprefixfirst{#2}\glsprefixsep}{}% + }% + \@gls@{#1}{#2}[#3]% }% } % \end{macrocode} -% Backward compatible \glostyle{list} style. +%\end{macro} +% +% Similarly for the plural version: +%\begin{macro}{\pglspl} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\compatglossarystyle{list}{% - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}] - ##3\glspostdescription\space ##5}% +\newrobustcmd{\pglspl}{\@gls@hyp@opt\@pglspl} % \end{macrocode} -% Sub-entries continue on the same line: +%\end{macro} +%\changes{4.08}{2014-07-30}{removed \@spglspl} +%\begin{macro}{\@pglspl} +% Unstarred version. % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}% +\newcommand*{\@pglspl}[2][]{% + \new@ifnextchar[% + {\@pglspl@{#1}{#2}}% + {\@pglspl@{#1}{#2}[]}% } % \end{macrocode} -% Backward compatible \glostyle{listgroup} style. +%\end{macro} +% +%\begin{macro}{\@pglspl@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{listgroup}{% - \csuse{@glscompstyle@list}% -}% +\def\@pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}{\glsentryprefixplural{#2}\glsprefixsep}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\glsentryprefixfirstplural{#2}\glsprefixsep}{}% + }% + \@glspl@{#1}{#2}[#3]% + }% +} % \end{macrocode} -% Backward compatible \glostyle{listhypergroup} style. +%\end{macro} +% +% Now for the first letter upper case versions: +%\begin{macro}{\Pgls} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\compatglossarystyle{listhypergroup}{% - \csuse{@glscompstyle@list}% -}% +\newrobustcmd{\Pgls}{\@gls@hyp@opt\@Pgls} % \end{macrocode} -% Backward compatible \glostyle{altlist} style. +%\end{macro} +%Add sentence case mapping. % \begin{macrocode} -\compatglossarystyle{altlist}{% - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}]% - \mbox{}\par\nobreak\@afterheading - ##3\glspostdescription\space ##5}% - \renewcommand{\glossarysubentryfield}[6]{% - \par - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6}% -}% +\glsmfuaddmap{\pgls}{\Pgls} % \end{macrocode} -% Backward compatible \glostyle{altlistgroup} style. +%\changes{4.08}{2014-07-30}{removed \@sPgls} +%\begin{macro}{\@Pgls} +% Unstarred version. % \begin{macrocode} -\compatglossarystyle{altlistgroup}{% - \csuse{@glscompstyle@altlist}% -}% +\newcommand*{\@Pgls}[2][]{% + \new@ifnextchar[% + {\@Pgls@{#1}{#2}}% + {\@Pgls@{#1}{#2}[]}% +} % \end{macrocode} -% Backward compatible \glostyle{altlisthypergroup} style. +%\end{macro} +% +%\begin{macro}{\@Pgls@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{altlisthypergroup}{% - \csuse{@glscompstyle@altlist}% -}% +\def\@Pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {% + \Glsentryprefix{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirst{#2}% + {% + \Glsentryprefixfirst{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + }% +} % \end{macrocode} -% Backward compatible \glostyle{listdotted} style. +%\end{macro} +% +% Similarly for the plural version: +%\begin{macro}{\Pglspl} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\compatglossarystyle{listdotted}{% - \renewcommand*{\glossaryentryfield}[5]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glsentryitem{##1}\glstarget{##1}{##2}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}% - \renewcommand*{\glossarysubentryfield}[6]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glssubentryitem{##2}% - \glstarget{##2}{##3}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}% -}% +\newrobustcmd{\Pglspl}{\@gls@hyp@opt\@Pglspl} % \end{macrocode} -% Backward compatible \glostyle{sublistdotted} style. +%\end{macro} +%Add sentence case mapping. % \begin{macrocode} -\compatglossarystyle{sublistdotted}{% - \csuse{@glscompstyle@listdotted}% - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}]}% -}% +\glsmfuaddmap{\pglspl}{\Pglspl} % \end{macrocode} -% Backward compatible \glostyle{long} style. +%\changes{4.08}{2014-07-30}{removed \@sPglspl} +%\begin{macro}{\@Pglspl} +% Unstarred version. % \begin{macrocode} -\compatglossarystyle{long}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% -}% +\newcommand*{\@Pglspl}[2][]{% + \new@ifnextchar[% + {\@Pglspl@{#1}{#2}}% + {\@Pglspl@{#1}{#2}[]}% +} % \end{macrocode} -% Backward compatible \glostyle{longborder} style. +%\end{macro} +% +%\begin{macro}{\@Pglspl@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{longborder}{% - \csuse{@glscompstyle@long}% -}% +\def\@Pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {% + \Glsentryprefixplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {% + \Glsentryprefixfirstplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + }% +} % \end{macrocode} -% Backward compatible \glostyle{longheader} style. +%\end{macro} +% +% Finally the all upper case versions: +%\begin{macro}{\PGLS} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\compatglossarystyle{longheader}{% - \csuse{@glscompstyle@long}% -}% +\newrobustcmd{\PGLS}{\@gls@hyp@opt\@PGLS} % \end{macrocode} -% Backward compatible \glostyle{longheaderborder} style. +%\end{macro} +%\changes{4.08}{2014-07-30}{removed \@sPGLS} +%\begin{macro}{\@PGLS} +% Unstarred version. % \begin{macrocode} -\compatglossarystyle{longheaderborder}{% - \csuse{@glscompstyle@long}% -}% +\newcommand*{\@PGLS}[2][]{% + \new@ifnextchar[% + {\@PGLS@{#1}{#2}}% + {\@PGLS@{#1}{#2}[]}% +} % \end{macrocode} -% Backward compatible \glostyle{long3col} style. +%\end{macro} +% +%\begin{macro}{\@PGLS@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{long3col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\\}% -}% +\def\@PGLS@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {\glsuppercase{\glsentryprefix{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirst{#2}% + {\glsuppercase{\glsentryprefixfirst{#2}\glsprefixsep}}{}% + }% + \@GLS@{#1}{#2}[#3]% + }% +} % \end{macrocode} -% Backward compatible \glostyle{long3colborder} style. +%\end{macro} +% +% Plural version: +%\begin{macro}{\PGLSpl} +%\changes{4.08}{2014-07-30}{changed to use \cs{@gls@hyp@opt}} % \begin{macrocode} -\compatglossarystyle{long3colborder}{% - \csuse{@glscompstyle@long3col}% -}% +\newrobustcmd{\PGLSpl}{\@gls@hyp@opt\@PGLSpl} % \end{macrocode} -% Backward compatible \glostyle{long3colheader} style. +%\end{macro} +%\changes{4.08}{2014-07-30}{removed \@sPGLSpl} +%\begin{macro}{\@PGLSpl} +% Unstarred version. % \begin{macrocode} -\compatglossarystyle{long3colheader}{% - \csuse{@glscompstyle@long3col}% -}% +\newcommand*{\@PGLSpl}[2][]{% + \new@ifnextchar[% + {\@PGLSpl@{#1}{#2}}% + {\@PGLSpl@{#1}{#2}[]}% +} % \end{macrocode} -% Backward compatible \glostyle{long3colheaderborder} style. +%\end{macro} +% +%\begin{macro}{\@PGLSpl@} +% Read in the final optional argument: % \begin{macrocode} -\compatglossarystyle{long3colheaderborder}{% - \csuse{@glscompstyle@long3col}% -}% -% \end{macrocode} -% Backward compatible \glostyle{long4col} style. -% \begin{macrocode} -\compatglossarystyle{long4col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% -}% +\def\@PGLSpl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {\glsuppercase{\glsentryprefixplural{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\glsuppercase{\glsentryprefixfirstplural{#2}\glsprefixsep}}{}% + }% + \@GLSpl@{#1}{#2}[#3]% + }% +} % \end{macrocode} -% Backward compatible \glostyle{long4colheader} style. +%\end{macro} +%\iffalse % \begin{macrocode} -\compatglossarystyle{long4colheader}{% - \csuse{@glscompstyle@long4col}% -}% +% % \end{macrocode} -% Backward compatible \glostyle{long4colborder} style. +%\fi +%\iffalse % \begin{macrocode} -\compatglossarystyle{long4colborder}{% - \csuse{@glscompstyle@long4col}% -}% +%<*glossaries-accsupp.sty> % \end{macrocode} -% Backward compatible \glostyle{long4colheaderborder} style. +%\fi +%\section{Accessibility Support (glossaries-accsupp Code)} +%\label{sec:code:accsupp} +% The \sty{glossaries-accsupp} package is experimental. It is +% intended to provide a means of using the PDF accessibility support +% in glossary entries. See the \sty{accsupp} documentation for +% further details about accessibility support. % \begin{macrocode} -\compatglossarystyle{long4colheaderborder}{% - \csuse{@glscompstyle@long4col}% -}% +\NeedsTeXFormat{LaTeX2e} % \end{macrocode} -% Backward compatible \glostyle{altlong4col} style. +% Rollback releases: % \begin{macrocode} -\compatglossarystyle{altlong4col}{% - \csuse{@glscompstyle@long4col}% -}% +\DeclareRelease{v4.46}{2020-03-19}{glossaries-accsupp-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-accsupp-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} -% Backward compatible \glostyle{altlong4colheader} style. +% Package version number now in line with main glossaries package number. % \begin{macrocode} -\compatglossarystyle{altlong4colheader}{% - \csuse{@glscompstyle@long4col}% -}% +\ProvidesPackage{glossaries-accsupp}[2022/10/14 v4.50 (NLCT) + Experimental glossaries accessibility] % \end{macrocode} -% Backward compatible \glostyle{altlong4colborder} style. +% Pass all options to \sty{glossaries}: % \begin{macrocode} -\compatglossarystyle{altlong4colborder}{% - \csuse{@glscompstyle@long4col}% -}% +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} % \end{macrocode} -% Backward compatible \glostyle{altlong4colheaderborder} style. +% Process options: % \begin{macrocode} -\compatglossarystyle{altlong4colheaderborder}{% - \csuse{@glscompstyle@long4col}% -}% +\ProcessOptions % \end{macrocode} -% -% Backward compatible \glostyle{long} style. +% This package should be loaded before \sty{glossaries-extra}, so +% complain if that has already been loaded. % \begin{macrocode} -\compatglossarystyle{longragged}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% - \tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6% - \tabularnewline}% -}% +\@ifpackageloaded{glossaries-extra} +{% % \end{macrocode} -% Backward compatible \glostyle{longraggedborder} style. +%If the \pkgoptfmt{accsupp} option was used, \cs{@glsxtr@doaccsupp} +%will have been set, otherwise it will be empty. +%\changes{4.29}{2017-01-19}{added check for \cs{@glsxtr@doaccsupp}} % \begin{macrocode} -\compatglossarystyle{longraggedborder}{% - \csuse{@glscompstyle@longragged}% -}% + \ifx\@glsxtr@doaccsupp\empty + \GlossariesWarning{The `glossaries-accsupp' + package has been loaded\MessageBreak + after the `glossaries-extra' package. This\MessageBreak + can cause a failure to integrate both packages. \MessageBreak + Either use the `accsupp' option when you load\MessageBreak + `glossaries-extra' or load `glossaries-accsupp'\MessageBreak + before loading `glossaries-extra'}% + \fi +} +{} % \end{macrocode} -% Backward compatible \glostyle{longraggedheader} style. +% +%\begin{macro}{\compatibleglossentry} +% Override style compatibility macros: +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.04}{2014-03-06}{changed \cs{newcommand} to \cs{def} as is may or +%may not be defined} +%\changes{4.50}{2022-10-14}{removed} +%\end{macro} +% +%\begin{macro}{\compatiblesubglossentry} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.04}{2014-03-06}{changed \cs{newcommand} to \cs{def} as is may or +%may not be defined} +%\changes{4.50}{2022-10-14}{removed} +%\end{macro} +% Required packages: % \begin{macrocode} -\compatglossarystyle{longraggedheader}{% - \csuse{@glscompstyle@longragged}% -}% +\RequirePackage{glossaries} % \end{macrocode} -% Backward compatible \glostyle{longraggedheaderborder} style. +% +%\begin{macro}{\gls@accsupp@engine} +%\changes{4.45}{2020-02-13}{new} +%There's currently only support for \sty{accsupp}, but if you +%define \cs{gls@accsupp@engine} before loading +%\sty{glossaries-accsupp}, you can prevent \sty{accsupp} from being +%loaded. Redefining this command after \sty{glossaries-accsupp} has loaded +%obviously won't do anything (and so is an internal command to +%deter casual use). If it is defined to something other than +%"accsupp" then \cs{gls@accessibility} will need to be defined to +%something appropriate. % \begin{macrocode} -\compatglossarystyle{longraggedheaderborder}{% - \csuse{@glscompstyle@longragged}% -}% +\providecommand{\gls@accsupp@engine}{accsupp} % \end{macrocode} -% Backward compatible \glostyle{longragged3col} style. +%\end{macro} +% +%\begin{macro}{\gls@accessibility} +%\changes{4.45}{2020-02-13}{new} +%\begin{definition} +%\cs{gls@accessibility}\marg{options}\marg{PDF element}\marg{value}\marg{content} +%\end{definition} % \begin{macrocode} -\compatglossarystyle{longragged3col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% -}% +\providecommand{\gls@accessibility}[4]{#4} +\ifdefstring\gls@accsupp@engine{accsupp} +{ + \RequirePackage{accsupp} + \renewcommand{\gls@accessibility}[4]{% + \BeginAccSupp{#1,#2={#3}}#4\EndAccSupp{}% + } +} +{} % \end{macrocode} -% Backward compatible \glostyle{longragged3colborder} style. +%\end{macro} +% +%\begin{macro}{\glsaccessibility} +%\changes{4.45}{2020-02-13}{new} +%\begin{definition} +%\cs{glsaccessibility}\oarg{options}\marg{PDF element}\marg{value}\marg{content} +%\end{definition} +%User-level command that includes debug info if required. % \begin{macrocode} -\compatglossarystyle{longragged3colborder}{% - \csuse{@glscompstyle@longragged3col}% -}% +\newcommand{\glsaccessibility}[4][]{% + \@glsshowaccsupp{#1}{#2}{#3}% + \gls@accessibility{#1}{#2}{#3}{#4}% +} % \end{macrocode} -% Backward compatible \glostyle{longragged3colheader} style. +%\end{macro} +% +%\subsection{Defining Replacement Text} +% The version 0.1 stored the replacement text in the +% \gloskey{symbol} key. This has been changed to use the +% new keys defined here. Example of use: +%\begin{verbatim} +%\newglossaryentry{dr}{name=Dr,description={},access={Doctor}} +%\end{verbatim} +%\begin{key}{access} +% The replacement text corresponding to the \gloskey{name} key: % \begin{macrocode} -\compatglossarystyle{longragged3colheader}{% - \csuse{@glscompstyle@longragged3col}% -}% +\define@key{glossentry}{access}{% + \def\@glo@access{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{longragged3colheaderborder} style. +%\end{key} +%\begin{key}{textaccess} +% The replacement text corresponding to the \gloskey{text} key: % \begin{macrocode} -\compatglossarystyle{longragged3colheaderborder}{% - \csuse{@glscompstyle@longragged3col}% -}% +\define@key{glossentry}{textaccess}{% + \def\@glo@textaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{altlongragged4col} style. +%\end{key} +%\begin{key}{firstaccess} +% The replacement text corresponding to the \gloskey{first} key: % \begin{macrocode} -\compatglossarystyle{altlongragged4col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% -}% +\define@key{glossentry}{firstaccess}{% + \def\@glo@firstaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{altlongragged4colheader} style. +%\end{key} +%\begin{key}{pluralaccess} +% The replacement text corresponding to the \gloskey{plural} key: % \begin{macrocode} -\compatglossarystyle{altlongragged4colheader}{% - \csuse{@glscompstyle@altlong4col}% -}% +\define@key{glossentry}{pluralaccess}{% + \def\@glo@pluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{altlongragged4colborder} style. +%\end{key} +%\begin{key}{firstpluralaccess} +% The replacement text corresponding to the \gloskey{firstplural} key: % \begin{macrocode} -\compatglossarystyle{altlongragged4colborder}{% - \csuse{@glscompstyle@altlong4col}% -}% +\define@key{glossentry}{firstpluralaccess}{% + \def\@glo@firstpluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{altlongragged4colheaderborder} style. +%\end{key} +%\begin{key}{symbolaccess} +% The replacement text corresponding to the \gloskey{symbol} key: % \begin{macrocode} -\compatglossarystyle{altlongragged4colheaderborder}{% - \csuse{@glscompstyle@altlong4col}% -}% +\define@key{glossentry}{symbolaccess}{% + \def\@glo@symbolaccess{#1}% +} % \end{macrocode} -% -% Backward compatible \glostyle{index} style. +%\end{key} +%\begin{key}{symbolpluralaccess} +% The replacement text corresponding to the \gloskey{symbolplural} key: % \begin{macrocode} -\compatglossarystyle{index}{% - \renewcommand*{\glossaryentryfield}[5]{% - \item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5}% - \renewcommand*{\glossarysubentryfield}[6]{% - \ifcase##1\relax - % level 0 - \item - \or - % level 1 - \subitem - \glssubentryitem{##2}% - \else - % all other levels - \subsubitem - \fi - \textbf{\glstarget{##2}{##3}}% - \ifx\relax##5\relax - \else - \space(##5)% - \fi - \space##4\glspostdescription\space ##6}% -}% +\define@key{glossentry}{symbolpluralaccess}{% + \def\@glo@symbolpluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{indexgroup} style. +%\end{key} +%\begin{key}{descriptionaccess} +% The replacement text corresponding to the \gloskey{description} key: % \begin{macrocode} -\compatglossarystyle{indexgroup}{% - \csuse{@glscompstyle@index}% -}% +\define@key{glossentry}{descriptionaccess}{% + \def\@glo@descaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{indexhypergroup} style. +%\end{key} +%\begin{key}{descriptionpluralaccess} +% The replacement text corresponding to the \gloskey{descriptionplural} key: % \begin{macrocode} -\compatglossarystyle{indexhypergroup}{% - \csuse{@glscompstyle@index}% -}% +\define@key{glossentry}{descriptionpluralaccess}{% + \def\@glo@descpluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{tree} style. +%\end{key} +%\begin{key}{shortaccess} +% The replacement text corresponding to the \gloskey{short} key: % \begin{macrocode} -\compatglossarystyle{tree}{% - \renewcommand{\glossaryentryfield}[5]{% - \hangindent0pt\relax - \parindent0pt\relax - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5\par}% - \renewcommand{\glossarysubentryfield}[6]{% - \hangindent##1\glstreeindent\relax - \parindent##1\glstreeindent\relax - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \textbf{\glstarget{##2}{##3}}% - \ifx\relax##5\relax - \else - \space(##5)% - \fi - \space##4\glspostdescription\space ##6\par}% -}% +\define@key{glossentry}{shortaccess}{% + \def\@glo@shortaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{treegroup} style. +%\end{key} +%\begin{key}{shortpluralaccess} +% The replacement text corresponding to the \gloskey{shortplural} key: % \begin{macrocode} -\compatglossarystyle{treegroup}{% - \csuse{@glscompstyle@tree}% -}% +\define@key{glossentry}{shortpluralaccess}{% + \def\@glo@shortpluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{treehypergroup} style. +%\end{key} +%\begin{key}{longaccess} +% The replacement text corresponding to the \gloskey{long} key: % \begin{macrocode} -\compatglossarystyle{treehypergroup}{% - \csuse{@glscompstyle@tree}% -}% +\define@key{glossentry}{longaccess}{% + \def\@glo@longaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{treenoname} style. +%\end{key} +%\begin{key}{longpluralaccess} +% The replacement text corresponding to the \gloskey{longplural} key: % \begin{macrocode} -\compatglossarystyle{treenoname}{% - \renewcommand{\glossaryentryfield}[5]{% - \hangindent0pt\relax - \parindent0pt\relax - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5\par}% - \renewcommand{\glossarysubentryfield}[6]{% - \hangindent##1\glstreeindent\relax - \parindent##1\glstreeindent\relax - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \glstarget{##2}{\strut}% - ##4\glspostdescription\space ##6\par}% -}% +\define@key{glossentry}{longpluralaccess}{% + \def\@glo@longpluralaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{treenonamegroup} style. +%\end{key} +%There are now also keys that correspond to the user keys: +%\begin{key}{user1access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user1} key: % \begin{macrocode} -\compatglossarystyle{treenonamegroup}{% - \csuse{@glscompstyle@treenoname}% -}% +\define@key{glossentry}{user1access}{% + \def\@glo@useriaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{treenonamehypergroup} style. +%\end{key} +%\begin{key}{user2access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user2} key: % \begin{macrocode} -\compatglossarystyle{treenonamehypergroup}{% - \csuse{@glscompstyle@treenoname}% -}% +\define@key{glossentry}{user2access}{% + \def\@glo@useriiaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{alttree} style. +%\end{key} +% +%\begin{key}{user3access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user3} key: % \begin{macrocode} -\compatglossarystyle{alttree}{% - \renewcommand{\glossaryentryfield}[5]{% - \ifnum\@gls@prevlevel=0\relax - \else - \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% - \hangindent\glstreeindent - \parindent\glstreeindent - \fi - \makebox[0pt][r]{\makebox[\glstreeindent][l]{% - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}% - \ifx\relax##4\relax - \else - (##4)\space - \fi - ##3\glspostdescription \space ##5\par - \def\@gls@prevlevel{0}% - }% - \renewcommand{\glossarysubentryfield}[6]{% - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \ifnum\@gls@prevlevel=##1\relax - \else - \@ifundefined{@glswidestname\romannumeral##1}{% - \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% - \settowidth{\gls@tmplen}{\textbf{% - \csname @glswidestname\romannumeral##1\endcsname\space}}}% - \ifnum\@gls@prevlevel<##1\relax - \setlength\glstreeindent\gls@tmplen - \addtolength\glstreeindent\parindent - \parindent\glstreeindent - \else - \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% - \settowidth{\glstreeindent}{\textbf{% - \@glswidestname\space}}}{% - \settowidth{\glstreeindent}{\textbf{% - \csname @glswidestname\romannumeral\@gls@prevlevel - \endcsname\space}}}% - \addtolength\parindent{-\glstreeindent}% - \setlength\glstreeindent\parindent - \fi - \fi - \hangindent\glstreeindent - \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% - \textbf{\glstarget{##2}{##3}}}}% - \ifx##5\relax\relax - \else - (##5)\space - \fi - ##4\glspostdescription\space ##6\par - \def\@gls@prevlevel{##1}% - }% -}% +\define@key{glossentry}{user3access}{% + \def\@glo@useriiiaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{alttreegroup} style. +%\end{key} +% +%\begin{key}{user4access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user4} key: % \begin{macrocode} -\compatglossarystyle{alttreegroup}{% - \csuse{@glscompstyle@alttree}% -}% +\define@key{glossentry}{user4access}{% + \def\@glo@userivaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{alttreehypergroup} style. +%\end{key} +% +%\begin{key}{user5access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user5} key: % \begin{macrocode} -\compatglossarystyle{alttreehypergroup}{% - \csuse{@glscompstyle@alttree}% -}% +\define@key{glossentry}{user5access}{% + \def\@glo@uservaccess{#1}% +} % \end{macrocode} +%\end{key} % -% Backward compatible \glostyle{mcolindex} style. +%\begin{key}{user6access} +%\changes{4.45}{2020-02-13}{new} +% The replacement text corresponding to the \gloskey{user6} key: % \begin{macrocode} -\compatglossarystyle{mcolindex}{% - \csuse{@glscompstyle@index}% -}% +\define@key{glossentry}{user6access}{% + \def\@glo@userviaccess{#1}% +} % \end{macrocode} -% Backward compatible \glostyle{mcolindexgroup} style. +%\end{key} +% +% For any custom keys, the replacement text would have to be +% explicitly put in the value, e.g., +% "user1={\glsshortaccsupp{inches}{in}}". +% +% Append these new keys to \cs{@gls@keymap}: % \begin{macrocode} -\compatglossarystyle{mcolindexgroup}{% - \csuse{@glscompstyle@index}% -}% +\appto\@gls@keymap{,% + {access}{access},% + {textaccess}{textaccess},% + {firstaccess}{firstaccess},% + {pluralaccess}{pluralaccess},% + {firstpluralaccess}{firstpluralaccess},% + {symbolaccess}{symbolaccess},% + {symbolpluralaccess}{symbolpluralaccess},% % \end{macrocode} -% Backward compatible \glostyle{mcolindexhypergroup} style. +%\changes{4.50}{2022-10-14}{corrected description mapping} % \begin{macrocode} -\compatglossarystyle{mcolindexhypergroup}{% - \csuse{@glscompstyle@index}% -}% + {descriptionaccess}{descaccess},% + {descriptionpluralaccess}{descpluralaccess},% + {shortaccess}{shortaccess},% + {shortpluralaccess}{shortpluralaccess},% + {longaccess}{longaccess},% + {longpluralaccess}{longpluralaccess},% + {user1access}{useriaccess},% + {user2access}{useriiaccess},% + {user3access}{useriiiaccess},% + {user4access}{userivaccess},% + {user5access}{uservaccess},% + {user6access}{userviaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{mcoltree} style. +% +%\begin{macro}{\@gls@noaccess} +% Indicates that no replacement text has been provided. % \begin{macrocode} -\compatglossarystyle{mcoltree}{% - \csuse{@glscompstyle@tree}% -}% +\def\@gls@noaccess{\relax} % \end{macrocode} -% Backward compatible \glostyle{mcoltreegroup} style. +%\end{macro} +% +% Previously, the \gloskey{access} key was initialised to +% the value of the \gloskey{symbol} key at the start for backwards +% compatibility. This causes a problem for situations where the +% replacement text is provided for \gloskey{symbol} but not for +% \gloskey{name} so this behaviour has been removed. +%\changes{4.45}{2020-02-13}{removed backward compatibility use of +%symbol key} % \begin{macrocode} -\compatglossarystyle{mcolindextreegroup}{% - \csuse{@glscompstyle@tree}% -}% +\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook +\renewcommand*{\@newglossaryentryprehook}{% + \@gls@oldnewglossaryentryprehook + \def\@glo@access{\relax}% % \end{macrocode} -% Backward compatible \glostyle{mcoltreehypergroup} style. +% Initialise the other keys: % \begin{macrocode} -\compatglossarystyle{mcolindextreehypergroup}{% - \csuse{@glscompstyle@tree}% -}% + \def\@glo@textaccess{\@glo@access}% + \def\@glo@firstaccess{\@glo@access}% + \def\@glo@pluralaccess{\@glo@textaccess}% + \def\@glo@firstpluralaccess{\@glo@pluralaccess}% + \def\@glo@symbolaccess{\relax}% + \def\@glo@symbolpluralaccess{\@glo@symbolaccess}% + \def\@glo@descaccess{\relax}% + \def\@glo@descpluralaccess{\@glo@descaccess}% + \def\@glo@shortaccess{\relax}% + \def\@glo@shortpluralaccess{\@glo@shortaccess}% + \def\@glo@longaccess{\relax}% + \def\@glo@longpluralaccess{\@glo@longaccess}% + \def\@glo@useriaccess{\relax}% + \def\@glo@useriiaccess{\relax}% + \def\@glo@useriiiaccess{\relax}% + \def\@glo@userivaccess{\relax}% + \def\@glo@uservaccess{\relax}% + \def\@glo@userviaccess{\relax}% +} % \end{macrocode} -% Backward compatible \glostyle{mcoltreenoname} style. +% Add to the end hook: % \begin{macrocode} -\compatglossarystyle{mcoltreenoname}{% - \csuse{@glscompstyle@tree}% -}% +\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook +\renewcommand*{\@newglossaryentryposthook}{% + \@gls@oldnewglossaryentryposthook % \end{macrocode} -% Backward compatible \glostyle{mcoltreenonamegroup} style. +% Store the access information: % \begin{macrocode} -\compatglossarystyle{mcoltreenonamegroup}{% - \csuse{@glscompstyle@tree}% -}% + \expandafter + \protected@xdef\csname glo@\@glo@label @access\endcsname{% + \@glo@access}% + \expandafter + \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{% + \@glo@textaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{% + \@glo@firstaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{% + \@glo@pluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{% + \@glo@firstpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{% + \@glo@symbolaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{% + \@glo@symbolpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{% + \@glo@descaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{% + \@glo@descpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{% + \@glo@shortaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{% + \@glo@shortpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{% + \@glo@longaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{% + \@glo@longpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriaccess\endcsname{% + \@glo@useriaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiaccess\endcsname{% + \@glo@useriiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiiaccess\endcsname{% + \@glo@useriiiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userivaccess\endcsname{% + \@glo@userivaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @uservaccess\endcsname{% + \@glo@uservaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userviaccess\endcsname{% + \@glo@userviaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{mcoltreenonamehypergroup} style. +% +%\subsection{Accessing Replacement Text} +%\begin{macro}{\glsentryaccess} +% Get the value of the \gloskey{access} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{mcoltreenonamehypergroup}{% - \csuse{@glscompstyle@tree}% -}% +\newcommand*{\glsentryaccess}[1]{% + \@gls@entry@field{#1}{access}% +} % \end{macrocode} -% Backward compatible \glostyle{mcolalttree} style. +%\end{macro} +%\begin{macro}{\glsentrytextaccess} +% Get the value of the \gloskey{textaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{mcolalttree}{% - \csuse{@glscompstyle@alttree}% -}% +\newcommand*{\glsentrytextaccess}[1]{% + \@gls@entry@field{#1}{textaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{mcolalttreegroup} style. +%\end{macro} +%\begin{macro}{\glsentryfirstaccess} +% Get the value of the \gloskey{firstaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{mcolalttreegroup}{% - \csuse{@glscompstyle@alttree}% -}% +\newcommand*{\glsentryfirstaccess}[1]{% + \@gls@entry@field{#1}{firstaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{mcolalttreehypergroup} style. +%\end{macro} +%\begin{macro}{\glsentrypluralaccess} +% Get the value of the \gloskey{pluralaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{mcolalttreehypergroup}{% - \csuse{@glscompstyle@alttree}% -}% +\newcommand*{\glsentrypluralaccess}[1]{% + \@gls@entry@field{#1}{pluralaccess}% +} % \end{macrocode} - -% Backward compatible \glostyle{superragged} style. +%\end{macro} +%\begin{macro}{\glsentryfirstpluralaccess} +%\changes{4.45}{2020-02-13}{switched to using \cs{@gls@entry@field}} +% Get the value of the \gloskey{firstpluralaccess} key for the entry with +% the given label: % \begin{macrocode} -\compatglossarystyle{superragged}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% - \tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6% - \tabularnewline}% -}% +\newcommand*{\glsentryfirstpluralaccess}[1]{% + \@gls@entry@field{#1}{firstpluralaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superraggedborder} style. +%\end{macro} +%\begin{macro}{\glsentrysymbolaccess} +% Get the value of the \gloskey{symbolaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superraggedborder}{% - \csuse{@glscompstyle@superragged}% -}% +\newcommand*{\glsentrysymbolaccess}[1]{% + \@gls@entry@field{#1}{symbolaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superraggedheader} style. +%\end{macro} +%\begin{macro}{\glsentrysymbolpluralaccess} +% Get the value of the \gloskey{symbolpluralaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superraggedheader}{% - \csuse{@glscompstyle@superragged}% -}% +\newcommand*{\glsentrysymbolpluralaccess}[1]{% + \@gls@entry@field{#1}{symbolpluralaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superraggedheaderborder} style. +%\end{macro} +%\begin{macro}{\glsentrydescaccess} +% Get the value of the \gloskey{descriptionaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superraggedheaderborder}{% - \csuse{@glscompstyle@superragged}% -}% +\newcommand*{\glsentrydescaccess}[1]{% + \@gls@entry@field{#1}{descaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superragged3col} style. +%\end{macro} +%\begin{macro}{\glsentrydescpluralaccess} +% Get the value of the \gloskey{descriptionpluralaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +%\changes{4.45}{2020-02-13}{corrected field reference} % \begin{macrocode} -\compatglossarystyle{superragged3col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% -}% +\newcommand*{\glsentrydescpluralaccess}[1]{% + \@gls@entry@field{#1}{descpluralaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superragged3colborder} style. +%\end{macro} +% +%\begin{macro}{\glsentryshortaccess} +% Get the value of the \gloskey{shortaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superragged3colborder}{% - \csuse{@glscompstyle@superragged3col}% -}% +\newcommand*{\glsentryshortaccess}[1]{% + \@gls@entry@field{#1}{shortaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superragged3colheader} style. +%\end{macro} +%\begin{macro}{\glsentryshortpluralaccess} +% Get the value of the \gloskey{shortpluralaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superragged3colheader}{% - \csuse{@glscompstyle@superragged3col}% -}% +\newcommand*{\glsentryshortpluralaccess}[1]{% + \@gls@entry@field{#1}{shortpluralaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superragged3colheaderborder} style. +%\end{macro} +%\begin{macro}{\glsentrylongaccess} +% Get the value of the \gloskey{longaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{superragged3colheaderborder}{% - \csuse{@glscompstyle@superragged3col}% -}% +\newcommand*{\glsentrylongaccess}[1]{% + \@gls@entry@field{#1}{longaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuperragged4col} style. +%\end{macro} +%\begin{macro}{\glsentrylongpluralaccess} +% Get the value of the \gloskey{longpluralaccess} key for the entry with +% the given label: +%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} % \begin{macrocode} -\compatglossarystyle{altsuperragged4col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% -}% +\newcommand*{\glsentrylongpluralaccess}[1]{% + \@gls@entry@field{#1}{longpluralaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuperragged4colheader} style. +%\end{macro} +% +%\begin{macro}{\glsentryuseriaccess} +% Get the value of the \gloskey{user1access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{altsuperragged4colheader}{% - \csuse{@glscompstyle@altsuperragged4col}% -}% +\newcommand*{\glsentryuseriaccess}[1]{% + \@gls@entry@field{#1}{useriaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuperragged4colborder} style. +%\end{macro} +% +%\begin{macro}{\glsentryuseriiaccess} +% Get the value of the \gloskey{user2access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{altsuperragged4colborder}{% - \csuse{@glscompstyle@altsuperragged4col}% -}% +\newcommand*{\glsentryuseriiaccess}[1]{% + \@gls@entry@field{#1}{useriiaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuperragged4colheaderborder} style. +%\end{macro} +% +%\begin{macro}{\glsentryuseriiiaccess} +% Get the value of the \gloskey{user3access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{altsuperragged4colheaderborder}{% - \csuse{@glscompstyle@altsuperragged4col}% -}% +\newcommand*{\glsentryuseriiiaccess}[1]{% + \@gls@entry@field{#1}{useriiiaccess}% +} % \end{macrocode} +%\end{macro} % -% Backward compatible \glostyle{super} style. +%\begin{macro}{\glsentryuserivaccess} +% Get the value of the \gloskey{user4access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{super}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% -}% +\newcommand*{\glsentryuserivaccess}[1]{% + \@gls@entry@field{#1}{userivaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superborder} style. +%\end{macro} +% +%\begin{macro}{\glsentryuservaccess} +% Get the value of the \gloskey{user5access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{superborder}{% - \csuse{@glscompstyle@super}% -}% +\newcommand*{\glsentryuservaccess}[1]{% + \@gls@entry@field{#1}{uservaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superheader} style. +%\end{macro} +% +%\begin{macro}{\glsentryuserviaccess} +% Get the value of the \gloskey{user6access} key for the entry with +% the given label: +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{superheader}{% - \csuse{@glscompstyle@super}% -}% +\newcommand*{\glsentryuserviaccess}[1]{% + \@gls@entry@field{#1}{userviaccess}% +} % \end{macrocode} -% Backward compatible \glostyle{superheaderborder} style. +%\end{macro} +% +%There are three types of replacement text: +%\begin{description} +%\item[Alt] Description of some content that's non-textual (for +%example, an image). A word break is assumed after the content. +%\item[ActualText] 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. +%\item[E] Expansion of an abbreviation to avoid ambiguity (for +%example, ``St'' could be short for ``saint'' or ``street''). +%\end{description} +%Therefore, rather than having one command for all fields, it's +%better to have a command dependent on the field type. For example, +%the \gloskey{short} and \gloskey{shortpl} keys would require "E", +%the \gloskey{symbol} key would require "ActualText", and a field +%that contains an image would require "Alt". +% +%\begin{macro}{\glsfieldaccsupp} +%\begin{definition} +%\cs{glsfieldaccsupp}\marg{replacement}\marg{content}\marg{field}\marg{label} +%\end{definition} +%\changes{4.45}{2020-02-13}{new} +%Test if there's a command called \cs{gls\meta{field}accsupp}. If +%there is then use that otherwise use \cs{glsaccsupp}. The first +%argument should be the internal field label (not the key). The +%final argument is the entry label. If \sty{glossaries-extra} has +%been loaded, this first checks for +%\cs{glsxtr\meta{category}\meta{field}accsupp} and \cs{glsxtr\meta{category}accsupp}. % \begin{macrocode} -\compatglossarystyle{superheaderborder}{% - \csuse{@glscompstyle@super}% -}% +\newcommand{\glsfieldaccsupp}[4]{% + \ifdef\glscategory + {% + \ifcsdef{glsxtr\glscategory{#4}#3accsupp}% + {\csname glsxtr\glscategory{#4}#3accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{glsxtr\glscategory{#4}accsupp}% + {\csname glsxtr\glscategory{#4}accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% + }% + }% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% +} % \end{macrocode} -% Backward compatible \glostyle{super3col} style. +%\end{macro} +% +%\begin{macro}{\xglsfieldaccsupp} +%\begin{definition} +%\cs{xglsfieldaccsupp}\marg{replacement}\marg{content}\marg{field}\marg{label} +%\end{definition} +%\changes{4.45}{2020-02-13}{new} +%As \cs{glsfieldaccsupp} but fully expand replacement text. % \begin{macrocode} -\compatglossarystyle{super3col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\\}% -}% +\newcommand{\xglsfieldaccsupp}[1]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsfieldaccsupp\expandafter{\@gls@replacementtext}% +} % \end{macrocode} -% Backward compatible \glostyle{super3colborder} style. +%\end{macro} +% +%\begin{macro}{\glsshortaccsupp} +%\changes{4.45}{2020-02-13}{new} +%\begin{definition} +%\cs{glsshortaccsupp}\marg{replacement text}\marg{text} +%\end{definition} % \begin{macrocode} -\compatglossarystyle{super3colborder}{% - \csuse{@glscompstyle@super3col}% -}% +\newcommand*{\glsshortaccsupp}[2]{\glsaccessibility{E}{#1}{#2}} % \end{macrocode} -% Backward compatible \glostyle{super3colheader} style. +%\end{macro} +%\begin{macro}{\glsshortplaccsupp} +%\changes{4.45}{2020-02-13}{new} +%\begin{definition} +%\cs{glsshortplaccsupp}\marg{replacement text}\marg{text} +%\end{definition} % \begin{macrocode} -\compatglossarystyle{super3colheader}{% - \csuse{@glscompstyle@super3col}% -}% +\newcommand*{\glsshortplaccsupp}{\glsshortaccsupp} % \end{macrocode} -% Backward compatible \glostyle{super3colheaderborder} style. +%\end{macro} +%\begin{macro}{\glsaccsupp} +%\changes{4.38}{2018-05-10}{added braces around actual text argument} +%\begin{definition} +%\cs{glsaccsupp}\marg{replacement text}\marg{text} +%\end{definition} % \begin{macrocode} -\compatglossarystyle{super3colheaderborder}{% - \csuse{@glscompstyle@super3col}% -}% +\newcommand*{\glsaccsupp}[2]{\glsaccessibility{ActualText}{#1}{#2}} % \end{macrocode} -% Backward compatible \glostyle{super4col} style. +%\end{macro} +%\begin{macro}{\xglsaccsupp} +% Fully expands replacement text before calling \cs{glsaccsupp} % \begin{macrocode} -\compatglossarystyle{super4col}{% - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% -}% +\newcommand*{\xglsaccsupp}[2]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}% +} % \end{macrocode} -% Backward compatible \glostyle{super4colheader} style. +%\end{macro} +% +%\begin{macro}{\@gls@access@display} +%\changes{4.03}{2014-01-20}{new} +%\changes{4.45}{2020-02-13}{deprecated} +%Deprecated in v4.45. Use \cs{@gls@fieldaccess@display} instead. % \begin{macrocode} -\compatglossarystyle{super4colheader}{% - \csuse{@glscompstyle@super4col}% -}% +\newcommand*{\@gls@access@display}[2]{% + \protected@edef\@glo@access{#2}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} % \end{macrocode} -% Backward compatible \glostyle{super4colborder} style. +%\end{macro} +% +%\begin{macro}{\@gls@fieldaccess@display} +%\begin{definition} +%\cs{@gls@fieldaccess@display}\marg{label}\marg{field}\marg{content}\marg{replacement} +%\end{definition} +%\changes{4.45}{2020-02-13}{new} % \begin{macrocode} -\compatglossarystyle{super4colborder}{% - \csuse{@glscompstyle@super4col}% -}% +\newcommand*{\@gls@fieldaccess@display}[4]{% + \protected@edef\@glo@access{#4}% + \ifdefequal\@glo@access\@gls@noaccess + {#3}% + {\expandafter\glsfieldaccsupp\expandafter{\@glo@access}{#3}{#2}{#1}}% +} % \end{macrocode} -% Backward compatible \glostyle{super4colheaderborder} style. +%\end{macro} +% +%\begin{macro}{\glsnameaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% Displays the first argument with the accessibility text for +% the entry with the label given by the second argument (if set). % \begin{macrocode} -\compatglossarystyle{super4colheaderborder}{% - \csuse{@glscompstyle@super4col}% -}% +\newrobustcmd*{\glsnameaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@access}% + {#1}% + {\@gls@fieldaccess@display{#2}{name}{#1}{\glsentryaccess{#2}}}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuper4col} style. -% \begin{macrocode} -\compatglossarystyle{altsuper4col}{% - \csuse{@glscompstyle@super4col}% -}% -% \end{macrocode} -% Backward compatible \glostyle{altsuper4colheader} style. +%\end{macro} +%\begin{macro}{\glstextaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{textaccess} replacement text. % \begin{macrocode} -\compatglossarystyle{altsuper4colheader}{% - \csuse{@glscompstyle@super4col}% -}% +\newrobustcmd*{\glstextaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@textaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{text}{#1}{\glsentrytextaccess{#2}}}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuper4colborder} style. +%\end{macro} +%\begin{macro}{\glspluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{pluralaccess} replacement text. % \begin{macrocode} -\compatglossarystyle{altsuper4colborder}{% - \csuse{@glscompstyle@super4col}% -}% +\newrobustcmd*{\glspluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@pluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{plural}{#1}{\glsentrypluralaccess{#2}}}% +} % \end{macrocode} -% Backward compatible \glostyle{altsuper4colheaderborder} style. +%\end{macro} +%\begin{macro}{\glsfirstaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{firstaccess} replacement text. % \begin{macrocode} -\compatglossarystyle{altsuper4colheaderborder}{% - \csuse{@glscompstyle@super4col}% -}% +\newrobustcmd*{\glsfirstaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{first}{#1}{\glsentryfirstaccess{#2}}}% +} % \end{macrocode} -%\iffalse +%\end{macro} +%\begin{macro}{\glsfirstpluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{firstpluralaccess} replacement text. % \begin{macrocode} -% +\newrobustcmd*{\glsfirstpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{firstpl}{#1}{\glsentryfirstpluralaccess{#2}}}% +} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +%\begin{macro}{\glssymbolaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{symbolaccess} replacement text. % \begin{macrocode} -%<*glossaries-accsupp.sty> +\newrobustcmd*{\glssymbolaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbol}{#1}{\glsentrysymbolaccess{#2}}}% +} % \end{macrocode} -%\fi -%\chapter{Accessibility Support (glossaries-accsupp Code)} -%\label{sec:code:accsupp} -% The \isty{glossaries-accsupp} package is experimental. It is -% intended to provide a means of using the PDF accessibilty support -% in glossary entries. See the \isty{accsupp} documentation for -% further details about accessibility support. +%\end{macro} +%\begin{macro}{\glssymbolpluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{symbolpluralaccess} replacement text. % \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} +\newrobustcmd*{\glssymbolpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbolplural}{#1}{\glsentrysymbolpluralaccess{#2}}}% +} % \end{macrocode} -% Package version number now in line with main glossaries package number. +%\end{macro} +%\begin{macro}{\glsdescriptionaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{descriptionaccess} replacement text. % \begin{macrocode} -\ProvidesPackage{glossaries-accsupp}[2021/11/01 v4.49 (NLCT) - Experimental glossaries accessibility] +\newrobustcmd*{\glsdescriptionaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{desc}{#1}{\glsentrydescaccess{#2}}}% +} % \end{macrocode} -% Pass all options to \sty{glossaries}: +%\end{macro} +%\begin{macro}{\glsdescriptionpluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{descriptionpluralaccess} replacement text. % \begin{macrocode} -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\newrobustcmd*{\glsdescriptionpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{descplural}{#1}{\glsentrydescpluralaccess{#2}}}% +} % \end{macrocode} -% Process options: +%\end{macro} +%\begin{macro}{\glsshortaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{shortaccess} replacement text. % \begin{macrocode} -\ProcessOptions +\newrobustcmd*{\glsshortaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{short}{#1}{\glsentryshortaccess{#2}}}% +} % \end{macrocode} -% This package should be loaded before \sty{glossaries-extra}, so -% complain if that has already been loaded. +%\end{macro} +% +%\begin{macro}{\glsshortpluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{shortpluralaccess} replacement text. % \begin{macrocode} -\@ifpackageloaded{glossaries-extra} -{% +\newrobustcmd*{\glsshortpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{shortpl}{#1}{\glsentryshortpluralaccess{#2}}}% +} % \end{macrocode} -%If the \pkgoptfmt{accsupp} option was used, \cs{@glsxtr@doaccsupp} -%will have been set, otherwise it will be empty. -%\changes{4.29}{2017-01-19}{added check for \cs{@glsxtr@doaccsupp}} +%\end{macro} +%\begin{macro}{\glslongaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{longaccess} replacement text. % \begin{macrocode} - \ifx\@glsxtr@doaccsupp\empty - \GlossariesWarning{The `glossaries-accsupp' - package has been loaded\MessageBreak - after the `glossaries-extra' package. This\MessageBreak - can cause a failure to integrate both packages. \MessageBreak - Either use the `accsupp' option when you load\MessageBreak - `glossaries-extra' or load `glossaries-accsupp'\MessageBreak - before loading `glossaries-extra'}% - \fi +\newrobustcmd*{\glslongaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{long}{#1}{\glsentrylongaccess{#2}}}% } -{} % \end{macrocode} +%\end{macro} % -%\begin{macro}{\compatibleglossentry} -% Override style compatibility macros: -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -%\changes{4.04}{2014-03-06}{changed \cs{newcommand} to \cs{def} as is may or -%may not be defined} +%\begin{macro}{\glslongpluralaccessdisplay} +%\changes{4.45}{2020-02-13}{added check for existence} +% As above but for the \gloskey{longpluralaccess} replacement text. % \begin{macrocode} -\def\compatibleglossentry#1#2{% - \toks@{#2}% - \protected@edef\@do@glossentry{% - \noexpand\accsuppglossaryentryfield{#1}% - {\noexpand\glsnamefont - {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@name\endcsname}}% - {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@desc\endcsname}% - {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@symbol\endcsname}% - {\the\toks@}% - }% - \@do@glossentry +\newrobustcmd*{\glslongpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{longpl}{#1}{\glsentrylongpluralaccess{#2}}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\compatiblesubglossentry} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -%\changes{4.04}{2014-03-06}{changed \cs{newcommand} to \cs{def} as is may or -%may not be defined} +%\begin{macro}{\glsuseriaccessdisplay} +%\changes{4.45}{2020-02-13}{new} +% As above but for the \gloskey{user1access} replacement text. % \begin{macrocode} -\def\compatiblesubglossentry#1#2#3{% - \toks@{#3}% - \protected@edef\@do@subglossentry{% - \noexpand\accsuppglossarysubentryfield{\number#1}% - {#2}% - {\noexpand\glsnamefont - {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@name\endcsname}}% - {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@desc\endcsname}% - {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@symbol\endcsname}% - {\the\toks@}% - }% - \@do@subglossentry +\newrobustcmd*{\glsuseriaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useri}{#1}{\glsentryuseriaccess{#2}}}% } % \end{macrocode} %\end{macro} -% Required packages: +% +%\begin{macro}{\glsuseriiaccessdisplay} +%\changes{4.45}{2020-02-13}{new} +% As above but for the \gloskey{user2access} replacement text. % \begin{macrocode} -\RequirePackage{glossaries} +\newrobustcmd*{\glsuseriiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userii}{#1}{\glsentryuseriiaccess{#2}}}% +} % \end{macrocode} +%\end{macro} % -%\begin{macro}{\gls@accsupp@engine} +%\begin{macro}{\glsuseriiiaccessdisplay} %\changes{4.45}{2020-02-13}{new} -%There's currently only support for \sty{accsupp}, but if you -%define \cs{gls@accsupp@engine} before loading -%\sty{glossaries-accsupp}, you can prevent \sty{accsupp} from being -%loaded. Redefining this command after \sty{glossaries-accsupp} has loaded -%obviously won't do anything (and so is an internal command to -%deter casual use). If it is defined to something other than -%"accsupp" then \cs{gls@accessibility} will need to be defined to -%something appropriate. +% As above but for the \gloskey{user3access} replacement text. % \begin{macrocode} -\providecommand{\gls@accsupp@engine}{accsupp} +\newrobustcmd*{\glsuseriiiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriii}{#1}{\glsentryuseriiiaccess{#2}}}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\gls@accessibility} +%\begin{macro}{\glsuserivaccessdisplay} %\changes{4.45}{2020-02-13}{new} -%\begin{definition} -%\cs{gls@accessibility}\marg{options}\marg{PDF element}\marg{value}\marg{content} -%\end{definition} +% As above but for the \gloskey{user4access} replacement text. % \begin{macrocode} -\providecommand{\gls@accessibility}[4]{#4} -\ifdefstring\gls@accsupp@engine{accsupp} -{ - \RequirePackage{accsupp} - \renewcommand{\gls@accessibility}[4]{% - \BeginAccSupp{#1,#2={#3}}#4\EndAccSupp{}% - } +\newrobustcmd*{\glsuserivaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userivaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriv}{#1}{\glsentryuserivaccess{#2}}}% } -{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessibility} +%\begin{macro}{\glsuservaccessdisplay} %\changes{4.45}{2020-02-13}{new} -%\begin{definition} -%\cs{glsaccessibility}\oarg{options}\marg{PDF element}\marg{value}\marg{content} -%\end{definition} -%User-level command that includes debug info if required. +% As above but for the \gloskey{user5access} replacement text. % \begin{macrocode} -\newcommand{\glsaccessibility}[4][]{% - \@glsshowaccsupp{#1}{#2}{#3}% - \gls@accessibility{#1}{#2}{#3}{#4}% +\newrobustcmd*{\glsuservaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@uservaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userv}{#1}{\glsentryuservaccess{#2}}}% } % \end{macrocode} %\end{macro} -% -%\section{Defining Replacement Text} -% The version 0.1 stored the replacement text in the -% \gloskey{symbol} key. This has been changed to use the -% new keys defined here. Example of use: -%\begin{verbatim} -%\newglossaryentry{dr}{name=Dr,description={},access={Doctor}} -%\end{verbatim} -%\begin{key}{access} -% The replacement text corresponding to the \gloskey{name} key: +% +%\begin{macro}{\glsuserviaccessdisplay} +%\changes{4.45}{2020-02-13}{new} +% As above but for the \gloskey{user6access} replacement text. % \begin{macrocode} -\define@key{glossentry}{access}{% - \def\@glo@access{#1}% +\newrobustcmd*{\glsuserviaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userviaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{uservi}{#1}{\glsentryuserviaccess{#2}}}% } % \end{macrocode} -%\end{key} -%\begin{key}{textaccess} -% The replacement text corresponding to the \gloskey{text} key: +%\end{macro} +% +%\changes{4.25}{2016-06-09}{changed \cs{DeclareRobustCommand} to +%\cs{newrobustcmd} and changed \cs{@ifundefined} to \cs{ifcsundef}} +%\begin{macro}{\glsaccessdisplay} +% Gets the replacement text corresponding to the named key given +% by the first argument and calls the appropriate command +% defined above. % \begin{macrocode} -\define@key{glossentry}{textaccess}{% - \def\@glo@textaccess{#1}% +\newrobustcmd*{\glsaccessdisplay}[3]{% + \ifcsundef{gls#1accessdisplay}% + {% + \PackageError{glossaries-accsupp}{No accessibility support + for key `#1'}{}% + }% + {% + \csname gls#1accessdisplay\endcsname{#2}{#3}% + }% } % \end{macrocode} -%\end{key} -%\begin{key}{firstaccess} -% The replacement text corresponding to the \gloskey{first} key: +%\end{macro} +% +%\begin{macro}{\@@gls@default@entryfmt} +% Deprecated \cs{@@gls@default@entryfmt} was redefined to use accessibility information +% but has been removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} +%\end{macro} +% +%\begin{macro}{\glsgenentryfmt} +% Redefine to use accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\define@key{glossentry}{firstaccess}{% - \def\@glo@firstaccess{#1}% -} +\renewcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% % \end{macrocode} -%\end{key} -%\begin{key}{pluralaccess} -% The replacement text corresponding to the \gloskey{plural} key: +% Plural form % \begin{macrocode} -\define@key{glossentry}{pluralaccess}{% - \def\@glo@pluralaccess{#1}% -} + \glscapscase + {% % \end{macrocode} -%\end{key} -%\begin{key}{firstpluralaccess} -% The replacement text corresponding to the \gloskey{firstplural} key: +% Don't adjust case % \begin{macrocode} -\define@key{glossentry}{firstpluralaccess}{% - \def\@glo@firstpluralaccess{#1}% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{key} -%\begin{key}{symbolaccess} -% The replacement text corresponding to the \gloskey{symbol} key: +% Subsequent use % \begin{macrocode} -\define@key{glossentry}{symbolaccess}{% - \def\@glo@symbolaccess{#1}% -} + \glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% % \end{macrocode} -%\end{key} -%\begin{key}{symbolpluralaccess} -% The replacement text corresponding to the \gloskey{symbolplural} key: +% First use % \begin{macrocode} -\define@key{glossentry}{symbolpluralaccess}{% - \def\@glo@symbolpluralaccess{#1}% -} + \glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% % \end{macrocode} -%\end{key} -%\begin{key}{descriptionaccess} -% The replacement text corresponding to the \gloskey{description} key: +% Make first letter upper case % \begin{macrocode} -\define@key{glossentry}{descriptionaccess}{% - \def\@glo@descaccess{#1}% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{key} -%\begin{key}{descriptionpluralaccess} -% The replacement text corresponding to the \gloskey{descriptionplural} key: +% Subsequent use. % \begin{macrocode} -\define@key{glossentry}{descriptionpluralaccess}{% - \def\@glo@descpluralaccess{#1}% -} + \glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% % \end{macrocode} -%\end{key} -%\begin{key}{shortaccess} -% The replacement text corresponding to the \gloskey{short} key: +% First use % \begin{macrocode} -\define@key{glossentry}{shortaccess}{% - \def\@glo@shortaccess{#1}% -} + \glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% % \end{macrocode} -%\end{key} -%\begin{key}{shortpluralaccess} -% The replacement text corresponding to the \gloskey{shortplural} key: +% Make all upper case % \begin{macrocode} -\define@key{glossentry}{shortpluralaccess}{% - \def\@glo@shortpluralaccess{#1}% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{key} -%\begin{key}{longaccess} -% The replacement text corresponding to the \gloskey{long} key: +% Subsequent use % \begin{macrocode} -\define@key{glossentry}{longaccess}{% - \def\@glo@longaccess{#1}% -} + \glspluralaccessdisplay + {\glsuppercase{\glsentryplural{\glslabel}}}% + {\glslabel}% + \glsuppercase{\glsinsert}% + }% + {% % \end{macrocode} -%\end{key} -%\begin{key}{longpluralaccess} -% The replacement text corresponding to the \gloskey{longplural} key: +% First use % \begin{macrocode} -\define@key{glossentry}{longpluralaccess}{% - \def\@glo@longpluralaccess{#1}% -} + \glsfirstpluralacessdisplay + {\glsuppercase{\glsentryfirstplural{\glslabel}}}% + {\glslabel}% + \glsuppercase{\glsinsert}% + }% + }% + }% + {% % \end{macrocode} -%\end{key} -%There are now also keys that correspond to the user keys: -%\begin{key}{user1access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user1} key: +% Singular form % \begin{macrocode} -\define@key{glossentry}{user1access}{% - \def\@glo@useriaccess{#1}% -} + \glscapscase + {% % \end{macrocode} -%\end{key} -%\begin{key}{user2access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user2} key: +% Don't adjust case % \begin{macrocode} -\define@key{glossentry}{user2access}{% - \def\@glo@useriiaccess{#1}% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{key} -% -%\begin{key}{user3access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user3} key: +% Subsequent use % \begin{macrocode} -\define@key{glossentry}{user3access}{% - \def\@glo@useriiiaccess{#1}% -} + \glstextaccessdisplay{\glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% % \end{macrocode} -%\end{key} -% -%\begin{key}{user4access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user4} key: +% First use % \begin{macrocode} -\define@key{glossentry}{user4access}{% - \def\@glo@userivaccess{#1}% -} + \glsfirstaccessdisplay{\glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% % \end{macrocode} -%\end{key} -% -%\begin{key}{user5access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user5} key: +% Make first letter upper case % \begin{macrocode} -\define@key{glossentry}{user5access}{% - \def\@glo@uservaccess{#1}% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{key} -% -%\begin{key}{user6access} -%\changes{4.45}{2020-02-13}{new} -% The replacement text corresponding to the \gloskey{user6} key: +% Subsequent use % \begin{macrocode} -\define@key{glossentry}{user6access}{% - \def\@glo@userviaccess{#1}% -} + \glstextaccessdisplay{\Glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% % \end{macrocode} -%\end{key} -% -% For any custom keys, the replacement text would have to be -% explicitly put in the value, e.g., -% "user1={\glsshortaccsupp{inches}{in}}". -% -% Append these new keys to \cs{@gls@keymap}: +% First use % \begin{macrocode} -\appto\@gls@keymap{,% - {access}{access},% - {textaccess}{textaccess},% - {firstaccess}{firstaccess},% - {pluralaccess}{pluralaccess},% - {firstpluralaccess}{firstpluralaccess},% - {symbolaccess}{symbolaccess},% - {symbolpluralaccess}{symbolpluralaccess},% - {descaccess}{descaccess},% - {descpluralaccess}{descpluralaccess},% - {shortaccess}{shortaccess},% - {shortpluralaccess}{shortpluralaccess},% - {longaccess}{longaccess},% - {longpluralaccess}{longpluralaccess},% - {user1access}{useriaccess},% - {user2access}{useriiaccess},% - {user3access}{useriiiaccess},% - {user4access}{userivaccess},% - {user5access}{uservaccess},% - {user6access}{userviaccess}% -} + \glsfirstaccessdisplay{\Glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% % \end{macrocode} -% -%\begin{macro}{\@gls@noaccess} -% Indicates that no replacement text has been provided. +% Make all upper case % \begin{macrocode} -\def\@gls@noaccess{\relax} + \ifglsused\glslabel + {% +% \end{macrocode} +% Subsequent use +% \begin{macrocode} + \glstextaccessdisplay + {\glsuppercase{\glsentrytext{\glslabel}}}{\glslabel}% + \glsuppercase{\glsinsert}% + }% + {% +% \end{macrocode} +% First use +% \begin{macrocode} + \glsfirstaccessdisplay + {\glsuppercase{\glsentryfirst{\glslabel}}}{\glslabel}% + \glsuppercase{\glsinsert}% + }% + }% + }% + }% + {% +% \end{macrocode} +% Custom text provided in \cs{glsdisp}. (The insert should +% be empty at this point.) The accessibility information, if +% required, will have to be explicitly included in the custom text. +% \begin{macrocode} + \glscustomtext\glsinsert + }% +} % \end{macrocode} %\end{macro} % -% Previously, the \gloskey{access} key was initialised to -% the value of the \gloskey{symbol} key at the start for backwards -% compatibility. This causes a problem for situations where the -% replacement text is provided for \gloskey{symbol} but not for -% \gloskey{name} so this behaviour has been removed. -%\changes{4.45}{2020-02-13}{removed backward compatibility use of -%symbol key} +%\begin{macro}{\glsgenacfmt} +% Redefine to include accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook -\renewcommand*{\@newglossaryentryprehook}{% - \@gls@oldnewglossaryentryprehook - \def\@glo@access{\relax}% +\renewcommand*{\glsgenacfmt}{% + \ifdefempty\glscustomtext + {% + \ifglsused\glslabel + {% % \end{macrocode} -% Initialise the other keys: +% Subsequent use: % \begin{macrocode} - \def\@glo@textaccess{\@glo@access}% - \def\@glo@firstaccess{\@glo@access}% - \def\@glo@pluralaccess{\@glo@textaccess}% - \def\@glo@firstpluralaccess{\@glo@pluralaccess}% - \def\@glo@symbolaccess{\relax}% - \def\@glo@symbolpluralaccess{\@glo@symbolaccess}% - \def\@glo@descaccess{\relax}% - \def\@glo@descpluralaccess{\@glo@descaccess}% - \def\@glo@shortaccess{\relax}% - \def\@glo@shortpluralaccess{\@glo@shortaccess}% - \def\@glo@longaccess{\relax}% - \def\@glo@longpluralaccess{\@glo@longaccess}% - \def\@glo@useriaccess{\relax}% - \def\@glo@useriiaccess{\relax}% - \def\@glo@useriiiaccess{\relax}% - \def\@glo@userivaccess{\relax}% - \def\@glo@uservaccess{\relax}% - \def\@glo@userviaccess{\relax}% -} + \glsifplural + {% % \end{macrocode} -% Add to the end hook: +% Subsequent plural form: % \begin{macrocode} -\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook -\renewcommand*{\@newglossaryentryposthook}{% - \@gls@oldnewglossaryentryposthook + \glscapscase + {% % \end{macrocode} -% Store the access information: +% Subsequent plural form, don't adjust case: % \begin{macrocode} - \expandafter - \protected@xdef\csname glo@\@glo@label @access\endcsname{% - \@glo@access}% - \expandafter - \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{% - \@glo@textaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{% - \@glo@firstaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{% - \@glo@pluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{% - \@glo@firstpluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{% - \@glo@symbolaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{% - \@glo@symbolpluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{% - \@glo@descaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{% - \@glo@descpluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{% - \@glo@shortaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{% - \@glo@shortpluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{% - \@glo@longaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{% - \@glo@longpluralaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @useriaccess\endcsname{% - \@glo@useriaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @useriiaccess\endcsname{% - \@glo@useriiaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @useriiiaccess\endcsname{% - \@glo@useriiiaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @userivaccess\endcsname{% - \@glo@userivaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @uservaccess\endcsname{% - \@glo@uservaccess}% - \expandafter - \protected@xdef\csname glo@\@glo@label @userviaccess\endcsname{% - \@glo@userviaccess}% -} + \acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% % \end{macrocode} -% -%\section{Accessing Replacement Text} -%\begin{macro}{\glsentryaccess} -% Get the value of the \gloskey{access} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% Subsequent plural form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsentryaccess}[1]{% - \@gls@entry@field{#1}{access}% -} + \acronymfont + {\glsshortpluralaccessdisplay + {\Glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrytextaccess} -% Get the value of the \gloskey{textaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% Subsequent plural form, all caps: % \begin{macrocode} -\newcommand*{\glsentrytextaccess}[1]{% - \@gls@entry@field{#1}{textaccess}% -} + \glsuppercase + {\acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryfirstaccess} -% Get the value of the \gloskey{firstaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% Subsequent singular form % \begin{macrocode} -\newcommand*{\glsentryfirstaccess}[1]{% - \@gls@entry@field{#1}{firstaccess}% -} + \glscapscase + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrypluralaccess} -% Get the value of the \gloskey{pluralaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% Subsequent singular form, don't adjust case: % \begin{macrocode} -\newcommand*{\glsentrypluralaccess}[1]{% - \@gls@entry@field{#1}{pluralaccess}% -} + \acronymfont + {\glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryfirstpluralaccess} -%\changes{4.45}{2020-02-13}{switched to using \cs{@gls@entry@field}} -% Get the value of the \gloskey{firstpluralaccess} key for the entry with -% the given label: +% Subsequent singular form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsentryfirstpluralaccess}[1]{% - \@gls@entry@field{#1}{firstpluralaccess}% -} + \acronymfont + {\glsshortaccessdisplay{\Glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrysymbolaccess} -% Get the value of the \gloskey{symbolaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% Subsequent singular form, all caps: % \begin{macrocode} -\newcommand*{\glsentrysymbolaccess}[1]{% - \@gls@entry@field{#1}{symbolaccess}% -} + \glsuppercase + {\acronymfont{% + \glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrysymbolpluralaccess} -% Get the value of the \gloskey{symbolpluralaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use: % \begin{macrocode} -\newcommand*{\glsentrysymbolpluralaccess}[1]{% - \@gls@entry@field{#1}{symbolpluralaccess}% -} + \glsifplural + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrydescaccess} -% Get the value of the \gloskey{descriptionaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use plural form: % \begin{macrocode} -\newcommand*{\glsentrydescaccess}[1]{% - \@gls@entry@field{#1}{descaccess}% -} + \glscapscase + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrydescpluralaccess} -% Get the value of the \gloskey{descriptionpluralaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} -%\changes{4.45}{2020-02-13}{corrected field reference} +% First use plural form, don't adjust case: % \begin{macrocode} -\newcommand*{\glsentrydescpluralaccess}[1]{% - \@gls@entry@field{#1}{descpluralaccess}% -} + \genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryshortaccess} -% Get the value of the \gloskey{shortaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use plural form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsentryshortaccess}[1]{% - \@gls@entry@field{#1}{shortaccess}% -} + \Genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentryshortpluralaccess} -% Get the value of the \gloskey{shortpluralaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use plural form, all caps: % \begin{macrocode} -\newcommand*{\glsentryshortpluralaccess}[1]{% - \@gls@entry@field{#1}{shortpluralaccess}% -} + \glsuppercase + {\genplacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrylongaccess} -% Get the value of the \gloskey{longaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use singular form % \begin{macrocode} -\newcommand*{\glsentrylongaccess}[1]{% - \@gls@entry@field{#1}{longaccess}% -} + \glscapscase + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsentrylongpluralaccess} -% Get the value of the \gloskey{longpluralaccess} key for the entry with -% the given label: -%\changes{4.03}{2014-01-20}{switched to using \cs{@gls@entry@field}} +% First use singular form, don't adjust case: % \begin{macrocode} -\newcommand*{\glsentrylongpluralaccess}[1]{% - \@gls@entry@field{#1}{longpluralaccess}% -} + \genacrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuseriaccess} -% Get the value of the \gloskey{user1access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +% First use singular form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsentryuseriaccess}[1]{% - \@gls@entry@field{#1}{useriaccess}% -} + \Genacrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuseriiaccess} -% Get the value of the \gloskey{user2access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +% First use singular form, all caps: % \begin{macrocode} -\newcommand*{\glsentryuseriiaccess}[1]{% - \@gls@entry@field{#1}{useriiaccess}% + \glsuppercase + {\genacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% + }% + {% +% \end{macrocode} +% User supplied text. (The insert should be empty at this point.) +% The accessibility information, if +% required, will have to be explicitly included in the custom text. +% \begin{macrocode} + \glscustomtext + }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsentryuseriiiaccess} -% Get the value of the \gloskey{user3access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +%\begin{macro}{\genacrfullformat} +% Redefine to include accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\newcommand*{\glsentryuseriiiaccess}[1]{% - \@gls@entry@field{#1}{useriiiaccess}% +\renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\glsentryshort{#1}}}{#1})% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsentryuserivaccess} -% Get the value of the \gloskey{user4access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +%\begin{macro}{\Genacrfullformat} +% Redefine to include accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\newcommand*{\glsentryuserivaccess}[1]{% - \@gls@entry@field{#1}{userivaccess}% +\renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\Glsentryshort{#1}}}{#1})% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsentryuservaccess} -% Get the value of the \gloskey{user5access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +%\begin{macro}{\genplacrfullformat} +% Redefine to include accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\newcommand*{\glsentryuservaccess}[1]{% - \@gls@entry@field{#1}{uservaccess}% +\renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsentryuserviaccess} -% Get the value of the \gloskey{user6access} key for the entry with -% the given label: -%\changes{4.45}{2020-02-13}{new} +%\begin{macro}{\Genplacrfullformat} +% Redefine to include accessibility information. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} -\newcommand*{\glsentryuserviaccess}[1]{% - \@gls@entry@field{#1}{userviaccess}% +\renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% } % \end{macrocode} %\end{macro} % -%There are three types of replacement text: -%\begin{description} -%\item[Alt] Description of some content that's non-textual (for -%example, an image). A word break is assumed after the content. -%\item[ActualText] 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. -%\item[E] Expansion of an abbreviation to avoid ambiguity (for -%example, ``St'' could be short for ``saint'' or ``street''). -%\end{description} -%Therefore, rather than having one command for all fields, it's -%better to have a command dependent on the field type. For example, -%the \gloskey{short} and \gloskey{shortpl} keys would require "E", -%the \gloskey{symbol} key would require "ActualText", and a field -%that contains an image would require "Alt". -% -%\begin{macro}{\glsfieldaccsupp} -%\begin{definition} -%\cs{glsfieldaccsupp}\marg{replacement}\marg{content}\marg{field}\marg{label} -%\end{definition} -%\changes{4.45}{2020-02-13}{new} -%Test if there's a command called \cs{gls\meta{field}accsupp}. If -%there is then use that otherwise use \cs{glsaccsupp}. The first -%argument should be the internal field label (not the key). The -%final argument is the entry label. If \sty{glossaries-extra} has -%been loaded, this first checks for -%\cs{glsxtr\meta{category}\meta{field}accsupp} and \cs{glsxtr\meta{category}accsupp}. +%\begin{macro}{\@acrshort} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newcommand{\glsfieldaccsupp}[4]{% - \ifdef\glscategory +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% {% - \ifcsdef{glsxtr\glscategory{#4}#3accsupp}% - {\csname glsxtr\glscategory{#4}#3accsupp\endcsname{#1}{#2}}% - {% - \ifcsdef{glsxtr\glscategory{#4}accsupp}% - {\csname glsxtr\glscategory{#4}accsupp\endcsname{#1}{#2}}% - {% - \ifcsdef{gls#3accsupp}% - {\csname gls#3accsupp\endcsname{#1}{#2}}% - {\glsaccsupp{#1}{#2}}% - }% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} +% \begin{macrocode} + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\glsentryshort{#2}}{#2}}#3% }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - {% - \ifcsdef{gls#3accsupp}% - {\csname gls#3accsupp\endcsname{#1}{#2}}% - {\glsaccsupp{#1}{#2}}% - }% -} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\xglsfieldaccsupp} -%\begin{definition} -%\cs{xglsfieldaccsupp}\marg{replacement}\marg{content}\marg{field}\marg{label} -%\end{definition} -%\changes{4.45}{2020-02-13}{new} -%As \cs{glsfieldaccsupp} but fully expand replacement text. +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} % \begin{macrocode} -\newcommand{\xglsfieldaccsupp}[1]{% - \protected@edef\@gls@replacementtext{#1}% - \expandafter\glsfieldaccsupp\expandafter{\@gls@replacementtext}% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsshortaccsupp} -%\changes{4.45}{2020-02-13}{new} -%\begin{definition} -%\cs{glsshortaccsupp}\marg{replacement text}\marg{text} -%\end{definition} +%\begin{macro}{\@Acrshort} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newcommand*{\glsshortaccsupp}[2]{\glsaccessibility{E}{#1}{#2}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsshortplaccsupp} -%\changes{4.45}{2020-02-13}{new} -%\begin{definition} -%\cs{glsshortplaccsupp}\marg{replacement text}\marg{text} -%\end{definition} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} % \begin{macrocode} -\newcommand*{\glsshortplaccsupp}{\glsshortaccsupp} + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\Glsentryshort{#2}}{#2}}#3% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsaccsupp} -%\changes{4.38}{2018-05-10}{added braces around actual text argument} -%\begin{definition} -%\cs{glsaccsupp}\marg{replacement text}\marg{text} -%\end{definition} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\glsaccsupp}[2]{\glsaccessibility{ActualText}{#1}{#2}} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\xglsaccsupp} -% Fully expands replacement text before calling \cs{glsaccsupp} +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} % \begin{macrocode} -\newcommand*{\xglsaccsupp}[2]{% - \protected@edef\@gls@replacementtext{#1}% - \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@gls@access@display} -%\changes{4.03}{2014-01-20}{new} -%Deprecated. Use \cs{@gls@fieldaccess@display} instead. +%\begin{macro}{\@ACRshort} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newcommand*{\@gls@access@display}[2]{% - \protected@edef\@glo@access{#2}% - \ifx\@glo@access\@gls@noaccess - #1% - \else - \xglsaccsupp{\@glo@access}{#1}% - \fi +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} +% \begin{macrocode} + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay + {\glsuppercase{\glsentryshort{#2}}}{#2}}#3% + }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% +% \end{macrocode} +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +% \begin{macrocode} + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@gls@fieldaccess@display} -%\begin{definition} -%\cs{@gls@fieldaccess@display}\marg{label}\marg{field}\marg{content}\marg{replacement} -%\end{definition} -%\changes{4.45}{2020-02-13}{new} +%\begin{macro}{\@acrlong} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newcommand*{\@gls@fieldaccess@display}[4]{% - \protected@edef\@glo@access{#4}% - \ifdefequal\@glo@access\@gls@noaccess - {#3}% - {\expandafter\glsfieldaccsupp\expandafter{\@glo@access}{#3}{#2}{#1}}% +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} +% \begin{macrocode} + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\glsentrylong{#2}}{#2}}#3% + }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% +% \end{macrocode} +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +% \begin{macrocode} + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsnameaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% Displays the first argument with the accessibility text for -% the entry with the label given by the second argument (if set). +%\begin{macro}{\@Acrlong} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newrobustcmd*{\glsnameaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@access}% - {#1}% - {\@gls@fieldaccess@display{#2}{name}{#1}{\glsentryaccess{#2}}}% +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} +% \begin{macrocode} + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\Glsentrylong{#2}}{#2}}#3% + }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% +% \end{macrocode} +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +% \begin{macrocode} + \glspostlinkhook } % \end{macrocode} %\end{macro} -%\begin{macro}{\glstextaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{textaccess} replacement text. +% +%\begin{macro}{\@ACRlong} +%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} % \begin{macrocode} -\newrobustcmd*{\glstextaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@textaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{text}{#1}{\glsentrytextaccess{#2}}}% +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in +%\cs{@gls@link})} +% \begin{macrocode} + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{% + \glsuppercase{\glsentrylong{#2}}}{#2}#3}% + }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% +% \end{macrocode} +%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +% \begin{macrocode} + \glspostlinkhook } % \end{macrocode} %\end{macro} -%\begin{macro}{\glspluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{pluralaccess} replacement text. +% +%\begin{macro}{\@glstext@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glspluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@pluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{plural}{#1}{\glsentrypluralaccess{#2}}}% +\def\@glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\glsentrytext{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{firstaccess} replacement text. +% +%\begin{macro}{\@Glstext@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsfirstaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@firstaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{first}{#1}{\glsentryfirstaccess{#2}}}% +\def\@Glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\Glsentrytext{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstpluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{firstpluralaccess} replacement text. +% +%\begin{macro}{\@GLStext@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsfirstpluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@firstpluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{firstpl}{#1}{\glsentryfirstpluralaccess{#2}}}% +\def\@GLStext@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glstextaccessdisplay{\glsuppercase{\glsentrytext{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glssymbolaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{symbolaccess} replacement text. +% +%\begin{macro}{\@glsfirst@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glssymbolaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@symbolaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{symbol}{#1}{\glsentrysymbolaccess{#2}}}% +\def\@glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glssymbolpluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{symbolpluralaccess} replacement text. +% +%\begin{macro}{\@Glsfirst@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glssymbolpluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@symbolpluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{symbolplural}{#1}{\glsentrysymbolpluralaccess{#2}}}% +\def\@Glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glsdescriptionaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{descriptionaccess} replacement text. +% +%\begin{macro}{\@GLSfirst@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsdescriptionaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@descaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{desc}{#1}{\glsentrydescaccess{#2}}}% +\def\@GLSfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstaccessdisplay{\glsuppercase{\glsentryfirst{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glsdescriptionpluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{descriptionpluralaccess} replacement text. +% +%\begin{macro}{\@glsplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsdescriptionpluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@descpluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{descplural}{#1}{\glsentrydescpluralaccess{#2}}}% +\def\@glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\glsentryplural{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glsshortaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{shortaccess} replacement text. +% +%\begin{macro}{\@Glsplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsshortaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@shortaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{short}{#1}{\glsentryshortaccess{#2}}}% +\def\@Glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsshortpluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{shortpluralaccess} replacement text. +%\begin{macro}{\@GLSplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsshortpluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@shortpluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{shortpl}{#1}{\glsentryshortpluralaccess{#2}}}% +\def\@GLSplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glspluralaccessdisplay{\glsuppercase{\glsentryplural{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glslongaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{longaccess} replacement text. +% +%\begin{macro}{\@glsfirstplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glslongaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@longaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{long}{#1}{\glsentrylongaccess{#2}}}% +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glslongpluralaccessdisplay} -%\changes{4.45}{2020-02-13}{added check for existence} -% As above but for the \gloskey{longpluralaccess} replacement text. +%\begin{macro}{\@Glsfirstplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glslongpluralaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@longpluralaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{longpl}{#1}{\glsentrylongpluralaccess{#2}}}% +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuseriaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user1access} replacement text. +%\begin{macro}{\@GLSfirstplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuseriaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@useriaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{useri}{#1}{\glsentryuseriaccess{#2}}}% +\def\@GLSfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstpluralaccessdisplay{\glsuppercase{\glsentryfirstplural{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuseriiaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user2access} replacement text. +%\begin{macro}{\@glsname@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuseriiaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@useriiaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{userii}{#1}{\glsentryuseriiaccess{#2}}}% +\def\@glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\glsentryname{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuseriiiaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user3access} replacement text. +%\begin{macro}{\@Glsname@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuseriiiaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@useriiiaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{useriii}{#1}{\glsentryuseriiiaccess{#2}}}% +\def\@Glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\Glsentryname{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuserivaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user4access} replacement text. +%\begin{macro}{\@GLSname@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuserivaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@userivaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{useriv}{#1}{\glsentryuserivaccess{#2}}}% +\def\@GLSname@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsnameaccessdisplay{\glsuppercase{\glsentryname{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuservaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user5access} replacement text. +%\begin{macro}{\@glsdesc@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuservaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@uservaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{userv}{#1}{\glsentryuservaccess{#2}}}% +\def\@glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsuserviaccessdisplay} -%\changes{4.45}{2020-02-13}{new} -% As above but for the \gloskey{user6access} replacement text. +%\begin{macro}{\@Glsdesc@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsuserviaccessdisplay}[2]{% - \ifcsundef{glo@\glsdetoklabel{#2}@userviaccess}% - {#1}% - {\@gls@fieldaccess@display{#2}{uservi}{#1}{\glsentryuserviaccess{#2}}}% +\def\@Glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\Glsentrydesc{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\changes{4.25}{??}{changed \cs{DeclareRobustCommand} to -%\cs{newrobustcmd} and changed \cs{@ifundefined} to \cs{ifcsundef}} -%\begin{macro}{\glsaccessdisplay} -% Gets the replacement text corresponding to the named key given -% by the first argument and calls the appropriate command -% defined above. +%\begin{macro}{\@GLSdesc@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\newrobustcmd*{\glsaccessdisplay}[3]{% - \ifcsundef{gls#1accessdisplay}% - {% - \PackageError{glossaries-accsupp}{No accessibility support - for key `#1'}{}% - }% - {% - \csname gls#1accessdisplay\endcsname{#2}{#3}% - }% +\def\@GLSdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionaccessdisplay{\glsuppercase{\glsentrydesc{#2}}}{#2}% + \glsuppercase{#3}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@@gls@default@entryfmt} -% Redefine the default entry format to use accessibility information +%\begin{macro}{\@glsdescplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\renewcommand*{\@@gls@default@entryfmt}[2]{% - \ifdefempty\glscustomtext - {% - \glsifplural - {% +\def\@glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}#3}% +} % \end{macrocode} -% Plural form +%\end{macro} +% +%\begin{macro}{\@Glsdescplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glscapscase - {% +\def\@Glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\Glsentrydescplural{#2}}{#2}#3}% +} % \end{macrocode} -% Don't adjust case +%\end{macro} +% +%\begin{macro}{\@GLSdescplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@GLSdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionpluralaccessdisplay{\glsuppercase{\glsentrydescplural{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\begin{macro}{\@glssymbol@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #2{\glspluralaccessdisplay - {\glsentryplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}} - {\glsinsert}% - }% - {% +\def\@glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}#3}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@Glssymbol@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #1{\glsfirstpluralaccessdisplay - {\glsentryfirstplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - }% - {% +\def\@Glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\Glsentrysymbol{#2}}{#2}#3}% +} % \end{macrocode} -% Make first letter upper case +%\end{macro} +% +%\begin{macro}{\@GLSsymbol@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@GLSsymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolaccessdisplay{\glsuppercase{\glsentrysymbol{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Subsequent use. +%\end{macro} +% +%\begin{macro}{\@glssymbolplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #2{\glspluralaccessdisplay - {\Glsentryplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - {% +\def\@glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}#3}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@Glssymbolplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #1{\glsfirstpluralaccessdisplay - {\Glsentryfirstplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - }% - {% +\def\@Glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\Glsentrysymbolplural{#2}}{#2}#3}% +} % \end{macrocode} -% Make all upper case +%\end{macro} +% +%\begin{macro}{\@GLSsymbolplural@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - \MakeUppercase{% - #2{\glspluralaccessdisplay - {\glsentryplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}}% - {\glsinsert}}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - \MakeUppercase{% - #1{\glsfirstpluralaccessdisplay - {\glsentryfirstplural{\glslabel}}{\glslabel}}% - {\glsdescriptionpluralaccessdisplay - {\glsentrydescplural{\glslabel}}{\glslabel}}% - {\glssymbolpluralaccessdisplay - {\glsentrysymbolplural{\glslabel}}{\glslabel}}% - {\glsinsert}}% - }% - }% - }% - {% -% \end{macrocode} -% Singular form -% \begin{macrocode} - \glscapscase - {% -% \end{macrocode} -% Don't adjust case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - #2{\glstextaccessdisplay - {\glsentrytext{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - {% -% \end{macrocode} -% First use -% \begin{macrocode} - #1{\glsfirstaccessdisplay - {\glsentryfirst{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - }% - {% -% \end{macrocode} -% Make first letter upper case -% \begin{macrocode} - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use -% \begin{macrocode} - #2{\glstextaccessdisplay - {\Glsentrytext{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - {% +\def\@GLSsymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolpluralaccessdisplay{\glsuppercase{\glsentrysymbolplural{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@glsuseri@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #1{\glsfirstaccessdisplay - {\Glsentryfirst{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - }% - {% +\def\@glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\glsentryuseri{#2}}{#2}#3}% +} % \end{macrocode} -% Make all upper case +%\end{macro} +% +%\begin{macro}{\@Glsuseri@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\Glsentryuseri{#2}}{#2}#3}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\begin{macro}{\@GLSuseri@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \MakeUppercase{% - #2{\glstextaccessdisplay - {\glsentrytext{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}}% - }% - {% +\def\@GLSuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriaccessdisplay{\glsuppercase{\glsentryuseri{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@glsuserii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \MakeUppercase{% - #1{\glsfirstaccessdisplay - {\glsentryfirst{\glslabel}}{\glslabel}}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}}% - }% - }% - }% - }% - {% +\def\@glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\glsentryuserii{#2}}{#2}#3}% +} % \end{macrocode} -% Custom text provided in \cs{glsdisp} +%\end{macro} +% +%\begin{macro}{\@Glsuserii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused{\glslabel}% - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\Glsentryuserii{#2}}{#2}#3}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\begin{macro}{\@GLSuserii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #2{\glscustomtext}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - {% +\def\@GLSuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiaccessdisplay{\glsuppercase{\glsentryuserii{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@glsuseriii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - #1{\glscustomtext}% - {\glsdescriptionaccessdisplay - {\glsentrydesc{\glslabel}}{\glslabel}}% - {\glssymbolaccessdisplay - {\glsentrysymbol{\glslabel}}{\glslabel}}% - {\glsinsert}% - }% - }% +\def\@glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\glsentryuseriii{#2}}{#2}#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsgenentryfmt} -% Redefine to use accessibility information. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} +%\begin{macro}{\@Glsuseriii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} -\renewcommand*{\glsgenentryfmt}{% - \ifdefempty\glscustomtext - {% - \glsifplural - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\Glsentryuseriii{#2}}{#2}#3}% +} % \end{macrocode} -% Plural form +%\end{macro} +% +%\begin{macro}{\@GLSuseriii@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glscapscase - {% +\def\@GLSuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiiaccessdisplay{\glsuppercase{\glsentryuseriii{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Don't adjust case +%\end{macro} +% +%\begin{macro}{\@glsuseriv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\glsentryuseriv{#2}}{#2}#3}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\begin{macro}{\@Glsuseriv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glspluralaccessdisplay - {\glsentryplural{\glslabel}}{\glslabel}% - \glsinsert - }% - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\Glsentryuseriv{#2}}{#2}#3}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@GLSuseriv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glsfirstpluralaccessdisplay - {\glsentryfirstplural{\glslabel}}{\glslabel}% - \glsinsert - }% - }% - {% +\def\@GLSuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserivaccessdisplay{\glsuppercase{\glsentryuseriv{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Make first letter upper case +%\end{macro} +% +%\begin{macro}{\@glsuserv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\glsentryuserv{#2}}{#2}#3}% +} % \end{macrocode} -% Subsequent use. +%\end{macro} +% +%\begin{macro}{\@Glsuserv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glspluralaccessdisplay - {\Glsentryplural{\glslabel}}{\glslabel}% - \glsinsert - }% - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\Glsentryuserv{#2}}{#2}#3}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@GLSuserv@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glsfirstpluralaccessdisplay - {\Glsentryfirstplural{\glslabel}}{\glslabel}% - \glsinsert - }% - }% - {% +\def\@GLSuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuservaccessdisplay{\glsuppercase{\glsentryuserv{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Make all upper case +%\end{macro} +% +%\begin{macro}{\@glsuservi@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \ifglsused\glslabel - {% +\def\@glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\glsentryuservi{#2}}{#2}#3}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\begin{macro}{\@Glsuservi@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glspluralaccessdisplay - {\mfirstucMakeUppercase{\glsentryplural{\glslabel}}}% - {\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - {% +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\Glsentryuservi{#2}}{#2}#3}% +} % \end{macrocode} -% First use +%\end{macro} +% +%\begin{macro}{\@GLSuservi@} +%\changes{4.45}{2020-02-13}{added accessibility support} % \begin{macrocode} - \glsfirstpluralacessdisplay - {\mfirstucMakeUppercase{\glsentryfirstplural{\glslabel}}}% - {\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - }% - }% - {% +\def\@GLSuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserviaccessdisplay{\glsuppercase{\glsentryuservi{#2}}}{#2}% + \glsuppercase{#3}}% +} % \end{macrocode} -% Singular form +%\end{macro} +% +%\subsection{Displaying the Glossary} +%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossaryentryfield}} +%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossarysubentryfield}} +% +% We need to redefine the way the glossary entries are formatted to +% include the accessibility support. The predefined glossary styles +% use \cs{glossentryname}, \cs{glossentrydesc} and +% \cs{glossentrysymbol}, but we need to provide compatibility with +% earlier versions in case users have defined their own styles using +% \cs{accsuppglossaryentryfield} and +% \cs{accsuppglossarysubentryfield}. +% +% Now redefine \cs{glossentryname}, \cs{glossentrydesc} and +% \cs{glossentrysymbol} etc so they use the accessibility stuff. % \begin{macrocode} - \glscapscase - {% +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\glsentryname{#1}}{#1}}% + }% +} % \end{macrocode} -% Don't adjust case +% % \begin{macrocode} - \ifglsused\glslabel - {% +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\Glsentryname{#1}}{#1}}% + }% +} % \end{macrocode} -% Subsequent use +% % \begin{macrocode} - \glstextaccessdisplay{\glsentrytext{\glslabel}}{\glslabel}% - \glsinsert - }% - {% +\renewcommand*{\glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\glsentrydesc{#1}}{#1}% + }% +} % \end{macrocode} -% First use +% % \begin{macrocode} - \glsfirstaccessdisplay{\glsentryfirst{\glslabel}}{\glslabel}% - \glsinsert - }% - }% - {% +\renewcommand*{\Glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\Glsentrydesc{#1}}{#1}% + }% +} % \end{macrocode} -% Make first letter upper case +% % \begin{macrocode} - \ifglsused\glslabel - {% +\renewcommand*{\glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\glsentrysymbol{#1}}{#1}% + }% +} % \end{macrocode} -% Subsequent use +% % \begin{macrocode} - \glstextaccessdisplay{\Glsentrytext{\glslabel}}{\glslabel}% - \glsinsert - }% - {% +\renewcommand*{\Glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\Glsentrysymbol{#1}}{#1}% + }% +} % \end{macrocode} -% First use +% +%\begin{macro}{\accsuppglossaryentryfield} % \begin{macrocode} - \glsfirstaccessdisplay{\Glsentryfirst{\glslabel}}{\glslabel}% - \glsinsert - }% - }% - {% +\newcommand*{\accsuppglossaryentryfield}[5]{% + \glossaryentryfield{#1}% + {\glsnameaccessdisplay{#2}{#1}}% + {\glsdescriptionaccessdisplay{#3}{#1}}% + {\glssymbolaccessdisplay{#4}{#1}}{#5}% +} % \end{macrocode} -% Make all upper case +%\end{macro} +%\begin{macro}{\accsuppglossarysubentryfield} % \begin{macrocode} - \ifglsused\glslabel - {% +\newcommand*{\accsuppglossarysubentryfield}[6]{% + \glossarysubentryfield{#1}{#2}% + {\glsnameaccessdisplay{#3}{#2}}% + {\glsdescriptionaccessdisplay{#4}{#2}}% + {\glssymbolaccessdisplay{#5}{#2}}{#6}% +} % \end{macrocode} -% Subsequent use +%\end{macro} +% +%\subsection{Acronyms} +% Redefine acronym styles provided by \sty{glossaries}: +% +%\begin{acrstyle}{long-short} +% \meta{long} (\meta{short}) acronym style. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \glstextaccessdisplay - {\mfirstucMakeUppercase{\glsentrytext{\glslabel}}}{\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - {% +\renewacronymstyle{long-short}% +{% % \end{macrocode} -% First use +% Check for long form in case this is a mixed glossary. % \begin{macrocode} - \glsfirstaccessdisplay - {\mfirstucMakeUppercase{\glsentryfirst{\glslabel}}}{\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - }% - }% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% }% - {% -% \end{macrocode} -% Custom text provided in \cs{glsdisp}. (The insert should -% be empty at this point.) The accessibility information, if -% required, will have to be explicitly included in the custom text. -% \begin{macrocode} - \glscustomtext\glsinsert + \renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\glsgenacfmt} -% Redefine to include accessibility information. +%\begin{acrstyle}{short-long} +% \meta{short} (\meta{long}) acronym style. %\changes{4.03}{2014-01-20}{redefined to use accessibility %information} % \begin{macrocode} -\renewcommand*{\glsgenacfmt}{% - \ifdefempty\glscustomtext - {% - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use: -% \begin{macrocode} - \glsifplural - {% +\renewacronymstyle{short-long}% +{% % \end{macrocode} -% Subsequent plural form: +% Check for long form in case this is a mixed glossary. % \begin{macrocode} - \glscapscase - {% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\Glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay + {\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} % \end{macrocode} -% Subsequent plural form, don't adjust case: +%\end{acrstyle} +% +%\begin{acrstyle}{long-short-desc} +% \meta{long} (\marg{short}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \acronymfont - {\glsshortpluralaccessdisplay - {\glsentryshortpl{\glslabel}}{\glslabel}}% - \glsinsert - }% - {% +\renewacronymstyle{long-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent plural form, make first letter upper case: +%\end{acrstyle} +% +%\begin{acrstyle}{long-sc-short-desc} +% \meta{long} (\cs{textsc}\marg{short}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \acronymfont - {\glsshortpluralaccessdisplay - {\Glsentryshortpl{\glslabel}}{\glslabel}}% - \glsinsert - }% - {% +\renewacronymstyle{long-sc-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sc-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sc-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent plural form, all caps: +%\end{acrstyle} +% +%\begin{acrstyle}{long-sm-short-desc} +% \meta{long} (\cs{textsmaller}\marg{short}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \mfirstucMakeUppercase - {\acronymfont - {\glsshortpluralaccessdisplay - {\glsentryshortpl{\glslabel}}{\glslabel}}% - \glsinsert}% - }% - }% - {% +\renewacronymstyle{long-sm-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sm-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sm-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent singular form +%\end{acrstyle} +% +%\begin{acrstyle}{short-long-desc} +% \meta{short} (\marg{long}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \glscapscase - {% +\renewacronymstyle{short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent singular form, don't adjust case: +%\end{acrstyle} +% +%\begin{acrstyle}{sc-short-long-desc} +% \meta{long} (\cs{textsc}\marg{short}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \acronymfont - {\glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% - \glsinsert - }% - {% +\renewacronymstyle{sc-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sc-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sc-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent singular form, make first letter upper case: +%\end{acrstyle} +% +%\begin{acrstyle}{sm-short-long-desc} +% \meta{long} (\cs{textsmaller}\marg{short}) acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \acronymfont - {\glsshortaccessdisplay{\Glsentryshort{\glslabel}}{\glslabel}}% - \glsinsert - }% - {% +\renewacronymstyle{sm-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sm-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sm-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} % \end{macrocode} -% Subsequent singular form, all caps: +%\end{acrstyle} +% +%\begin{acrstyle}{dua} +% \meta{long} only acronym style. +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \mfirstucMakeUppercase - {\acronymfont{% - \glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% - \glsinsert}% - }% - }% - }% - {% +\renewacronymstyle{dua}% +{% % \end{macrocode} -% First use: +% Check for long form in case this is a mixed glossary. % \begin{macrocode} + \ifdefempty\glscustomtext + {% + \ifglshaslong{\glslabel}% + {% \glsifplural {% % \end{macrocode} -% First use plural form: +% Plural form: % \begin{macrocode} \glscapscase {% % \end{macrocode} -% First use plural form, don't adjust case: +% Plural form, don't adjust case: % \begin{macrocode} - \genplacrfullformat{\glslabel}{\glsinsert}% + \glslongpluralaccessdisplay{\glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert }% {% % \end{macrocode} -% First use plural form, make first letter upper case: +% Plural form, make first letter upper case: % \begin{macrocode} - \Genplacrfullformat{\glslabel}{\glsinsert}% + \glslongpluralaccessdisplay{\Glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert }% {% % \end{macrocode} -% First use plural form, all caps: +% Plural form, all caps: % \begin{macrocode} - \mfirstucMakeUppercase - {\genplacrfullformat{\glslabel}{\glsinsert}}% + \glslongpluralaccessdisplay + {\glsuppercase{\glsentrylongpl{\glslabel}}}{\glslabel}% + \glsuppercase{\glsinsert}% }% }% {% % \end{macrocode} -% First use singular form +% Singular form % \begin{macrocode} \glscapscase {% % \end{macrocode} -% First use singular form, don't adjust case: +% Singular form, don't adjust case: % \begin{macrocode} - \genacrfullformat{\glslabel}{\glsinsert}% + \glslongaccessdisplay{\glsentrylong{\glslabel}}{\glslabel}\glsinsert }% {% % \end{macrocode} -% First use singular form, make first letter upper case: +% Subsequent singular form, make first letter upper case: % \begin{macrocode} - \Genacrfullformat{\glslabel}{\glsinsert}% + \glslongaccessdisplay{\Glsentrylong{\glslabel}}{\glslabel}\glsinsert }% {% % \end{macrocode} -% First use singular form, all caps: +% Subsequent singular form, all caps: % \begin{macrocode} - \mfirstucMakeUppercase - {\genacrfullformat{\glslabel}{\glsinsert}}% + \glslongaccessdisplay + {\glsuppercase + {\glsentrylong{\glslabel}\glsinsert}}{\glslabel}% + \glsuppercase{\glsinsert}% }% }% }% - }% - {% + {% % \end{macrocode} -% User supplied text. (The insert should be empty at this point.) -% The accessibility information, if -% required, will have to be explicitly included in the custom text. +% Not an acronym: % \begin{macrocode} - \glscustomtext + \glsgenentryfmt + }% + }% + {\glscustomtext\glsinsert}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\Glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay + {\glsuppercase{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\Glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\glsuppercase{\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% }% + \renewcommand*{\Glsentryfull}[1]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\Glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\genacrfullformat} -% Redefine to include accessibility information. +%\begin{acrstyle}{dua-desc} +% \meta{long} only acronym style with user-supplied description. %\changes{4.03}{2014-01-20}{redefined to use accessibility %information} % \begin{macrocode} -\renewcommand*{\genacrfullformat}[2]{% - \glslongaccessdisplay{\glsentrylong{#1}}{#1}#2\space - (\glsshortaccessdisplay{\protect\firstacronymfont{\glsentryshort{#1}}}{#1})% -} +\renewacronymstyle{dua-desc}% +{% + \GlsUseAcrEntryDispStyle{dua}% +}% +{% + \GlsUseAcrStyleDefs{dua}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\acronymfont{\glsentrylong{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##2}% +}% % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\Genacrfullformat} -% Redefine to include accessibility information. +%\begin{acrstyle}{footnote} +% \meta{short}\cs{footnote}\marg{long} acronym style. %\changes{4.03}{2014-01-20}{redefined to use accessibility %information} % \begin{macrocode} -\renewcommand*{\Genacrfullformat}[2]{% - \glslongaccessdisplay{\Glsentrylong{#1}}{#1}#2\space - (\glsshortaccessdisplay{\protect\firstacronymfont{\Glsentryshort{#1}}}{#1})% +\renewacronymstyle{footnote}% +{% +% \end{macrocode} +% Check for long form in case this is a mixed glossary. +% \begin{macrocode} + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% +% \end{macrocode} +% Need to ensure hyperlinks are switched off on first use: +% \begin{macrocode} + \glshyperfirstfalse + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\firstacronymfont{\Glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +% \end{macrocode} +% Don't use footnotes for \cs{acrfull}: +% \begin{macrocode} + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay + {\glsuppercase + {\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\glsuppercase + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}}% +% \end{macrocode} +% Similarly for \cs{glsentryfull} etc: +% \begin{macrocode} + \renewcommand*{\glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\Glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% + \renewcommand*{\Glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\genplacrfullformat} -% Redefine to include accessibility information. +%\begin{acrstyle}{footnote-sc} +% \cs{textsc}\marg{short}\cs{footnote}\marg{long} acronym style. %\changes{4.03}{2014-01-20}{redefined to use accessibility %information} % \begin{macrocode} -\renewcommand*{\genplacrfullformat}[2]{% - \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}#2\space - (\glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% -} +\renewacronymstyle{footnote-sc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% +}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Genplacrfullformat} -% Redefine to include accessibility information. +%\end{acrstyle} +% +%\begin{acrstyle}{footnote-sm} +% \cs{textsmaller}\marg{short}\cs{footnote}\marg{long} acronym style. %\changes{4.03}{2014-01-20}{redefined to use accessibility %information} % \begin{macrocode} -\renewcommand*{\Genplacrfullformat}[2]{% - \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}#2\space - (\glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% -} +\renewacronymstyle{footnote-sm}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +}% % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\@acrshort} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@acrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glsshortaccessdisplay{\glsentryshort{#2}}{#2}}#3% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +%\begin{acrstyle}{footnote-desc} +% \meta{short}\cs{footnote}\marg{long} acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \glspostlinkhook +\renewacronymstyle{footnote-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\@Acrshort} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@Acrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glsshortaccessdisplay{\Glsentryshort{#2}}{#2}}#3% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +%\begin{acrstyle}{footnote-sc-desc} +% \cs{textsc}\marg{short}\cs{footnote}\marg{long} acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \glspostlinkhook +\renewacronymstyle{footnote-sc-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sc}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sc}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\@ACRshort} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@ACRshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glsshortaccessdisplay - {\MakeUppercase{\glsentryshort{#2}}}{#2}}#3% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +%\begin{acrstyle}{footnote-sm-desc} +% \cs{textsmaller}\marg{short}\cs{footnote}\marg{long} acronym style that has an +% accompanying description (which the user needs to supply). +%\changes{4.03}{2014-01-20}{redefined to use accessibility +%information} % \begin{macrocode} - \glspostlinkhook +\renewacronymstyle{footnote-sm-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sm}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sm}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% } % \end{macrocode} -%\end{macro} +%\end{acrstyle} % -%\begin{macro}{\@acrlong} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@acrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glslongaccessdisplay{\glsentrylong{#2}}{#2}}#3% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +%\begin{macro}{\glsdefaultshortaccess} +%\changes{4.45}{2020-02-13}{new} +%\begin{definition} +%\cs{glsdefaultshortaccess}\marg{long}\marg{short} +%\end{definition} +%Default \gloskey{shortaccess} value. % \begin{macrocode} - \glspostlinkhook -} +\newcommand*{\glsdefaultshortaccess}[2]{#1} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@Acrlong} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@Acrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glslongaccessdisplay{\Glsentrylong{#2}}{#2}}#3% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} +% Use \cs{newacronymhook} to modify the key list to set +% the access text to the long version by default. +%\changes{1.46}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} % \begin{macrocode} - \glspostlinkhook +\renewcommand*{\newacronymhook}{% + \protected@edef\@gls@keylist{% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + shortpluralaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + \the\glskeylisttok}% + \expandafter\glskeylisttok\expandafter{\@gls@keylist}% } % \end{macrocode} +%\begin{macro}{\DefaultNewAcronymDef} +%Deprecated with the introduction of \cs{setacronymstyle} in v4.02 +%(2013-12-05) and removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % -%\begin{macro}{\@ACRlong} -%\changes{4.08}{2014-07-30}{added \cs{do@gls@link@checkfirsthyper}} -% \begin{macrocode} -\def\@ACRlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\relax -% \end{macrocode} -%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, -% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} -%\changes{4.03}{2014-01-20}{removed \cs{glslabel} (defined in -%\cs{@gls@link})} -% \begin{macrocode} - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glslongaccessdisplay{% - \MakeUppercase{\glsentrylong{#2}}}{#2}#3}% - }% -% \end{macrocode} -% Call \cs{@gls@link} -% \begin{macrocode} - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% -% \end{macrocode} -%\changes{4.16}{2015-07-08}{added \cs{glspostlinkhook}} -% \begin{macrocode} - \glspostlinkhook -} -% \end{macrocode} +%\begin{macro}{\DescriptionFootnoteNewAcronymDef} +%Deprecated with the introduction of \cs{setacronymstyle} in v4.02 +%(2013-12-05) and removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % -%\begin{macro}{\@glstext@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@glstext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\glsentrytext{#2}}{#2}#3}% -} -% \end{macrocode} +%\begin{macro}{\DescriptionNewAcronymDef} +%Deprecated with the introduction of \cs{setacronymstyle} in v4.02 +%(2013-12-05) and removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} -% -%\begin{macro}{\@Glstext@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@Glstext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\Glsentrytext{#2}}{#2}#3}% -} -% \end{macrocode} +%\begin{macro}{\FootnoteNewAcronymDef} +%Deprecated with the introduction of \cs{setacronymstyle} in v4.02 +%(2013-12-05) and removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % -%\begin{macro}{\@GLStext@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@GLStext@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glstextaccessdisplay{\mfirstucMakeUppercase{\glsentrytext{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} -% \end{macrocode} +%\begin{macro}{\SmallNewAcronymDef} +%Deprecated with the introduction of \cs{setacronymstyle} in v4.02 +%(2013-12-05) and removed in v4.50. +%\changes{4.50}{2022-10-14}{removed} %\end{macro} % -%\begin{macro}{\@glsfirst@} -%\changes{4.45}{2020-02-13}{added accessibility support} +% The following are kept for compatibility with versions before +% 3.0: +%\begin{macro}{\glsshortaccesskey} % \begin{macrocode} -\def\@glsfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}#3}% -} + \newcommand*{\glsshortaccesskey}{\glsshortkey access}% % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@Glsfirst@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\glsshortpluralaccesskey} % \begin{macrocode} -\def\@Glsfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}#3}% -} + \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}% % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSfirst@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\glslongaccesskey} % \begin{macrocode} -\def\@GLSfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsfirstaccessdisplay{\mfirstucMakeUppercase{\glsentryfirst{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} + \newcommand*{\glslongaccesskey}{\glslongkey access}% % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\glslongpluralaccesskey} % \begin{macrocode} -\def\@glsplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\glsentryplural{#2}}{#2}#3}% -} + \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}% % \end{macrocode} %\end{macro} +%\subsection{Debugging Commands} % -%\begin{macro}{\@Glsplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglonameaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.38}{2018-05-10}{bug fix: corrected field (was showing text access field)} % \begin{macrocode} -\def\@Glsplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}#3}% +\newcommand*{\showglonameaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@access\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglotextaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@GLSplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glspluralaccessdisplay{\mfirstucMakeUppercase{\glsentryplural{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\showglotextaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@textaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsfirstplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglopluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@glsfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}#3}% +\newcommand*{\showglopluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@pluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@Glsfirstplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglofirstaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@glsfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}#3}% +\newcommand*{\showglofirstaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSfirstplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglofirstpluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@GLSfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsfirstpluralaccessdisplay{\mfirstucMakeUppercase{\glsentryfirstplural{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\showglofirstpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstpluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsname@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglosymbolaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@glsname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\glsentryname{#2}}{#2}#3}% +\newcommand*{\showglosymbolaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@Glsname@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglosymbolpluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@Glsname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\Glsentryname{#2}}{#2}#3}% +\newcommand*{\showglosymbolpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolpluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSname@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglodescaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@GLSname@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsnameaccessdisplay{\mfirstucMakeUppercase{\glsentryname{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\showglodescaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsdesc@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglodescpluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@glsdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}#3}% +\newcommand*{\showglodescpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descpluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@Glsdesc@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showgloshortaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@Glsdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\Glsentrydesc{#2}}{#2}#3}% +\newcommand*{\showgloshortaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSdesc@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showgloshortpluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@GLSdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsdescriptionaccessdisplay{\mfirstucMakeUppercase{\glsentrydesc{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\showgloshortpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortpluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsdescplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglolongaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@glsdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}#3}% +\newcommand*{\showglolongaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@Glsdescplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\begin{macro}{\showglolongpluralaccess} +%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} % \begin{macrocode} -\def\@Glsdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\Glsentrydescplural{#2}}{#2}#3}% +\newcommand*{\showglolongpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longpluralaccess\endcsname } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@GLSdescplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\iffalse % \begin{macrocode} -\def\@GLSdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsdescriptionpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrydescplural{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} +% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glssymbol@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\fi +%\iffalse % \begin{macrocode} -\def\@glssymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}#3}% -} +%<*glossaries-compatible-207.sty> % \end{macrocode} -%\end{macro} +%\fi +%\section{Backwards Compatibility} +%\subsection{glossaries-compatible-207} +% Provides compatibility with version 2.07 and below. This uses +% original \sty{glossaries} xindy and makeindex formatting, so can +% be used with old documents that had customized style files, but +% hyperlinks may not work properly. % -%\begin{macro}{\@Glssymbol@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Now only available with rollback. % \begin{macrocode} -\def\@Glssymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\Glsentrysymbol{#2}}{#2}#3}% -} +\NeedsTeXFormat{LaTeX2e} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSsymbol@} -%\changes{4.45}{2020-02-13}{added accessibility support} +% Rollback releases: % \begin{macrocode} -\def\@GLSsymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glssymbolaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbol{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-compatible-207-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-compatible-207-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glssymbolplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Identify package. % \begin{macrocode} -\def\@glssymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}#3}% -} +\ProvidesPackage{glossaries-compatible-207}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glssymbolplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Trigger error and that's it. % \begin{macrocode} -\def\@Glssymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\Glsentrysymbolplural{#2}}{#2}#3}% -} +\PackageError{glossaries} +{glossaries-compatible-207.sty no longer available. Use rollback if you need it}% +{Try \string\usepackage{glossaries}[=v4.46]} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSsymbolplural@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\iffalse % \begin{macrocode} -\def\@GLSsymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glssymbolpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} +% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuseri@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\fi +%\iffalse % \begin{macrocode} -\def\@glsuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\glsentryuseri{#2}}{#2}#3}% -} +%<*glossaries-compatible-307.sty> % \end{macrocode} -%\end{macro} +%\fi +%\subsection{glossaries-compatible-307} +% Provides compatibility with version 3.07 and below. % -%\begin{macro}{\@Glsuseri@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Now only available with rollback. % \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\Glsentryuseri{#2}}{#2}#3}% -} +\NeedsTeXFormat{LaTeX2e} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuseri@} -%\changes{4.45}{2020-02-13}{added accessibility support} +% Rollback releases: % \begin{macrocode} -\def\@GLSuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuseriaccessdisplay{\mfirstucMakeUppercase{\glsentryuseri{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-compatible-307-2020-03-19.sty} +\DeclareRelease{v4.49}{2021-11-01}{glossaries-compatible-307-2021-11-01.sty} +\DeclareCurrentRelease{v4.50}{2022-10-14} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuserii@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Identify package. % \begin{macrocode} -\def\@glsuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\glsentryuserii{#2}}{#2}#3}% -} +\ProvidesPackage{glossaries-compatible-307}[2022/10/14 v4.50 (NLCT)] % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glsuserii@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%Trigger error and that's it. % \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\Glsentryuserii{#2}}{#2}#3}% -} +\PackageError{glossaries} +{glossaries-compatible-307.sty no longer available. Use rollback if you need it}% +{Try \string\usepackage{glossaries}[=v4.46]} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuserii@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\iffalse % \begin{macrocode} -\def\@GLSuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuseriiaccessdisplay{\mfirstucMakeUppercase{\glsentryuserii{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% -} +% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuseriii@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\fi +%\iffalse % \begin{macrocode} -\def\@glsuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\glsentryuseriii{#2}}{#2}#3}% -} +%<*glossaries-2020-03-19.sty> % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glsuseriii@} -%\changes{4.45}{2020-02-13}{added accessibility support} +%\fi +%\section{Rollback} +% \subsection{Rollback v4.46 (glossaries-2020-03-19.sty)} +% Version 4.46 preserved for rollback. % \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\Glsentryuseriii{#2}}{#2}#3}% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{ifthen} +\RequirePackage{xkeyval}[2006/11/18] +\RequirePackage{mfirstuc} +\RequirePackage{textcase} +\renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase}% +\RequirePackage{xfor} +\RequirePackage{datatool-base} +\RequirePackage{amsgen} +\RequirePackage{etoolbox} +\newif\if@gls@docloaded +\@ifpackageloaded{doc}% +{% + \@gls@docloadedtrue +}% +{% + \@ifclassloaded{nlctdoc}{\@gls@docloadedtrue}{\@gls@docloadedfalse}% } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuseriii@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@GLSuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuseriiiaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriii{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\if@gls@docloaded + \let\glsorg@theglossary\theglossary + \let\glsorg@endtheglossary\endtheglossary + \let\glsorg@PrintChanges\PrintChanges + \renewcommand{\PrintChanges}{% + \begingroup + \let\theglossary\glsorg@theglossary + \let\endtheglossary\glsorg@endtheglossary + \glsorg@PrintChanges + \endgroup + } +\fi +\newif\if@gls@debug +\define@choicekey{glossaries.sty}{debug}[\gls@debug@val\gls@debug@nr]% + {true,false,showtargets,showaccsupp}[true]{% + \ifcase\gls@debug@nr\relax + % debug=true + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \let\@glsshowtarget\@gobble + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \or + % debug=false + \@gls@debugfalse + \let\@glsshowtarget\@gobble + \let\@glsshowaccsupp\@gobblethree + \PackageInfo{glossaries}{debug mode OFF}% + \or + % debug=showtargets + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \renewcommand{\@glsshowtarget}{\@@glsshowtarget}% + \or + % debug=showaccsupp + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \renewcommand{\@glsshowaccsupp}{\glsshowaccsupp}% + \fi } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuseriv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@glsuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\glsentryuseriv{#2}}{#2}#3}% +\newcommand*{\glsshowtarget}[1]{% + \ifmmode + \nfss@text{\glsshowtargetfont [#1]}% + \else + \ifinner + {\glsshowtargetfont [#1]}% + \else + \glsshowtargetouter{#1}% + \fi + \fi } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glsuseriv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\Glsentryuseriv{#2}}{#2}#3}% +\newcommand*{\glsshowtargetouter}[1]{% + \glsshowtargetsymbol\marginpar{\glsshowtargetsymbol\glsshowtargetfont #1}} +\newcommand*{\glsshowtargetsymbol}{{\tiny$\triangleright$}} +\newcommand*{\glsshowtargetfont}{\ttfamily\footnotesize} +\newcommand*{\@glsshowtarget}[1]{} +\newrobustcmd*{\@@glsshowtarget}[1]{% + \begingroup + \protected@edef\@gls@tmp{#1}% + \@onelevel@sanitize\@gls@tmp + \expandafter\glsshowtarget\expandafter{\@gls@tmp}% + \endgroup } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuseriv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@GLSuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuserivaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriv{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\@glsshowaccsupp}[3]{} +\newrobustcmd*{\glsshowaccsupp}[3]{% + \ifstrempty{#1}% + {\@@glsshowtarget{/#2 (#3)}}% + {\@@glsshowtarget{/#2 (#3) [#1]}}% } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuserv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@glsuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\glsentryuserv{#2}}{#2}#3}% +\newcommand*{\@gls@see@noindex}{% + \PackageError{glossaries}% + {`\gls@xr@key' key may only be used after \string\makeglossaries\space + or \string\makenoidxglossaries\space (or move + \string\newglossaryentry\space + definitions into the preamble)}% + {You must use \string\makeglossaries\space + or \string\makenoidxglossaries\space before defining + any entries that have a `\gls@xr@key' key. It may + be that the `see' key has been written to the .glsdefs + file from the previous run, in which case you need to + move your definitions + to the preamble if you don't want to use + \string\makeglossaries\space + or \string\makenoidxglossaries}% } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glsuserv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\Glsentryuserv{#2}}{#2}#3}% +\define@choicekey{glossaries.sty}{seenoindex}% + [\gls@seenoindex@val\gls@seenoindex@nr]{error,warn,ignore}{% + \ifcase\gls@seenoindex@nr + \renewcommand*{\@gls@see@noindex}{% + \PackageError{glossaries}% + {`\gls@xr@key' key may only be used after \string\makeglossaries\space + or \string\makenoidxglossaries}% + {You must use \string\makeglossaries\space + or \string\makenoidxglossaries\space before defining + any entries that have a `\gls@xr@key' key}% + }% + \or + \renewcommand*{\@gls@see@noindex}{% + \GlossariesWarning{`\gls@xr@key' key ignored}% + }% + \or + \renewcommand*{\@gls@see@noindex}{}% + \fi } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuserv@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@GLSuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuservaccessdisplay{\mfirstucMakeUppercase{\glsentryuserv{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\define@boolkey{glossaries.sty}[gls]{toc}[true]{} +\define@boolkey{glossaries.sty}[gls]{numberline}[true]{} +\ifcsundef{chapter}% + {\newcommand*{\@@glossarysec}{section}}% + {\newcommand*{\@@glossarysec}{chapter}} +\define@choicekey{glossaries.sty}{section}{part,chapter,section,% +subsection,subsubsection,paragraph,subparagraph}[section]{% + \renewcommand*{\@@glossarysec}{#1}} +\newcommand*{\@@glossarysecstar}{*} +\newcommand*{\@@glossaryseclabel}{} +\newcommand*{\glsautoprefix}{} +\define@choicekey{glossaries.sty}{numberedsection}% + [\gls@numberedsection@val\gls@numberedsection@nr]{% +false,nolabel,autolabel,nameref}[nolabel]{% + \ifcase\gls@numberedsection@nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{% + \label{\glsautoprefix\@glo@type}}% + \or + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{% + \protected@edef\@currentlabelname{\glossarytoctitle}% + \label{\glsautoprefix\@glo@type}}% + \fi } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsuservi@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@glsuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\glsentryuservi{#2}}{#2}#3}% +\@ifpackageloaded{classicthesis} +{\newcommand*{\@glossary@default@style}{index}} +{\newcommand*{\@glossary@default@style}{list}} +\define@key{glossaries.sty}{style}{% + \def\@glossary@default@style{#1}% } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glsuservi@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@Glsuser@i#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\Glsentryuservi{#2}}{#2}#3}% +\newcommand*{\@gls@declareoption}[2]{% + \DeclareOptionX{#1}{#2}% + \DeclareOption{#1}{#2}% } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSuservi@} -%\changes{4.45}{2020-02-13}{added accessibility support} -% \begin{macrocode} -\def\@GLSuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}% - {\glsuserviaccessdisplay{\mfirstucMakeUppercase{\glsentryuservi{#2}}}{#2}% - \mfirstucMakeUppercase{#3}}% +\newcommand*{\glossaryentrynumbers}[1]{#1\gls@save@numberlist{#1}} +\@gls@declareoption{nonumberlist}{% + \renewcommand*{\glossaryentrynumbers}[1]{\gls@save@numberlist{#1}}% } -% \end{macrocode} -%\end{macro} -% -%\section{Displaying the Glossary} -%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossaryentryfield}} -%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossarysubentryfield}} -% -% We need to redefine the way the glossary entries are formatted to -% include the accessibility support. The predefined glossary styles -% use \ics{glossentryname}, \ics{glossentrydesc} and -% \ics{glossentrysymbol}, but we need to provide compatibility with -% earlier versions in case users have defined their own styles using -% \cs{accsuppglossaryentryfield} and -% \cs{accsuppglossarysubentryfield}. -% -% Now redefine \cs{glossentryname}, \cs{glossentrydesc} and -% \cs{glossentrysymbol} etc so they use the accessibility stuff. -% \begin{macrocode} -\renewcommand*{\glossentryname}[1]{% - \glsdoifexists{#1}% - {% - \glsnamefont{\glsnameaccessdisplay{\glsentryname{#1}}{#1}}% - }% +\define@boolkey{glossaries.sty}[gls]{savenumberlist}[true]{} +\glssavenumberlistfalse +\newcommand*\@glo@seeautonumberlist{} +\@gls@declareoption{seeautonumberlist}{% + \renewcommand*{\@glo@seeautonumberlist}{% + \def\@glo@prefix{\glsnextpages}% + }% } -% \end{macrocode} -% -% \begin{macrocode} -\renewcommand*{\glossentryname}[1]{% - \glsdoifexists{#1}% - {% - \glsnamefont{\glsnameaccessdisplay{\Glsentryname{#1}}{#1}}% - }% +\define@boolkey{glossaries.sty}[gls]{esclocations}[true]{} +\glsesclocationstrue +\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}[=v4.46]} +\@gls@declareoption{nolong}{\renewcommand*{\@gls@loadlong}{}} +\IfFileExists{supertabular.sty}{% + \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}[=v4.46]}}{% + \newcommand*{\@gls@loadsuper}{}} +\@gls@declareoption{nosuper}{\renewcommand*{\@gls@loadsuper}{}} +\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}[=v4.46]} +\@gls@declareoption{nolist}{% + \renewcommand*{\@gls@loadlist}{% + \ifdefstring{\@glossary@default@style}{list}% + {\let\@glossary@default@style\relax}% + {}% + }% } -% \end{macrocode} -% -% \begin{macrocode} -\renewcommand*{\glossentrydesc}[1]{% - \glsdoifexists{#1}% - {% - \glsdescriptionaccessdisplay{\glsentrydesc{#1}}{#1}% - }% +\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}[=v4.46]} +\@gls@declareoption{notree}{\renewcommand*{\@gls@loadtree}{}} +\@gls@declareoption{nostyles}{% + \renewcommand*{\@gls@loadlong}{}% + \renewcommand*{\@gls@loadsuper}{}% + \renewcommand*{\@gls@loadlist}{}% + \renewcommand*{\@gls@loadtree}{}% + \let\@glossary@default@style\relax } -% \end{macrocode} -% -% \begin{macrocode} -\renewcommand*{\Glossentrydesc}[1]{% - \glsdoifexists{#1}% - {% - \glsdescriptionaccessdisplay{\Glsentrydesc{#1}}{#1}% - }% +\newcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi } -% \end{macrocode} -% -% \begin{macrocode} -\renewcommand*{\glossentrysymbol}[1]{% - \glsdoifexists{#1}% - {% - \glssymbolaccessdisplay{\glsentrysymbol{#1}}{#1}% - }% +\define@boolkey{glossaries.sty}[gls]{nopostdot}[true]{} +\glsnopostdotfalse +\define@boolkey{glossaries.sty}[gls]{nogroupskip}[true]{} +\glsnogroupskipfalse +\define@boolkey{glossaries.sty}[gls]{ucmark}[true]{} +\@ifclassloaded{memoir} +{% + \glsucmarktrue +}% +{% + \glsucmarkfalse } -% \end{macrocode} -% -% \begin{macrocode} -\renewcommand*{\Glossentrysymbol}[1]{% - \glsdoifexists{#1}% +\newcommand*{\@gls@define@glossaryentrycounter}{% + \ifglsentrycounter + \ifundef\c@glossaryentry + {% + \ifx\@gls@counterwithin\@empty + \newcounter{glossaryentry}% + \else + \newcounter{glossaryentry}[\@gls@counterwithin]% + \fi + \def\theHglossaryentry{\currentglossary.\theglossaryentry}% + }% + {}% + \fi +} +\define@boolkey{glossaries.sty}[gls]{entrycounter}[true]{} +\glsentrycounterfalse +\define@key{glossaries.sty}{counterwithin}{% + \renewcommand*{\@gls@counterwithin}{#1}% + \glsentrycountertrue + \@gls@define@glossaryentrycounter +} +\newcommand*{\@gls@counterwithin}{} +\newcommand{\@gls@define@glossarysubentrycounter}{% + \ifundef\c@glossarysubentry {% - \glssymbolaccessdisplay{\Glsentrysymbol{#1}}{#1}% + \ifglssubentrycounter + \ifglsentrycounter + \newcounter{glossarysubentry}[glossaryentry]% + \else + \newcounter{glossarysubentry}% + \fi + \def\theHglossarysubentry{\currentglossary.\currentglssubentry.\theglossarysubentry}% + \fi }% + {}% } -% \end{macrocode} -% -%\begin{macro}{\accsuppglossaryentryfield} -% \begin{macrocode} -\newcommand*{\accsuppglossaryentryfield}[5]{% - \glossaryentryfield{#1}% - {\glsnameaccessdisplay{#2}{#1}}% - {\glsdescriptionaccessdisplay{#3}{#1}}% - {\glssymbolaccessdisplay{#4}{#1}}{#5}% +\define@boolkey{glossaries.sty}[gls]{subentrycounter}[true]{} +\glssubentrycounterfalse +\newcommand*{\@glo@default@sorttype}{standard} +\define@choicekey{glossaries.sty}{sort}{standard,def,use,none}{% + \renewcommand*{\@glo@default@sorttype}{#1}% + \csname @gls@setupsort@#1\endcsname } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\accsuppglossarysubentryfield} -% \begin{macrocode} -\newcommand*{\accsuppglossarysubentryfield}[6]{% - \glossarysubentryfield{#1}{#2}% - {\glsnameaccessdisplay{#3}{#2}}% - {\glsdescriptionaccessdisplay{#4}{#2}}% - {\glssymbolaccessdisplay{#5}{#2}}{#6}% +\newcommand*{\glsprestandardsort}[3]{% + \glsdosanitizesort } -% \end{macrocode} -%\end{macro} -% -%\section{Acronyms} -% Redefine acronym styles provided by \styfmt{glossaries}: -% -%\begin{acrstyle}{long-short} -% \meta{long} (\meta{short}) acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{long-short}% -{% -% \end{macrocode} -% Check for long form in case this is a mixed glossary. -% \begin{macrocode} - \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -}% -{% - \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% - \renewcommand*{\genacrfullformat}[2]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}##2\space - (\glsshortaccessdisplay - {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% - }% - \renewcommand*{\Genacrfullformat}[2]{% - \glslongaccessdisplay{\Glsentrylong{##1}}{##1}##2\space - (\glsshortaccessdisplay - {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% +\newcommand*{\@glo@check@sortallowed}[1]{} +\newcommand*{\@gls@setupsort@standard}{% + \def\do@glo@storeentry{\@glo@storeentry}% + \def\@gls@defsortcount##1{}% + \def\@gls@defsort##1##2{% + \ifx\@glo@sort\@glsdefaultsort + \let\@glo@sort\@glo@name + \fi + \let\glsdosanitizesort\@gls@sanitizesort + \glsprestandardsort{\@glo@sort}{##1}{##2}% + \expandafter\protected@xdef\csname glo@##2@sort\endcsname{\@glo@sort}% }% - \renewcommand*{\genplacrfullformat}[2]{% - \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}##2\space - (\glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + \def\@gls@setsort##1{}% + \let\@glo@check@sortallowed\@gobble +} +\@gls@setupsort@standard +\newcommand*\glssortnumberfmt[1]{% + \ifnum#1<100000 0\fi + \ifnum#1<10000 0\fi + \ifnum#1<1000 0\fi + \ifnum#1<100 0\fi + \ifnum#1<10 0\fi + \number#1% +} +\newcommand*{\@gls@setupsort@def}{% + \def\do@glo@storeentry{\@glo@storeentry}% + \def\@gls@defsortcount##1{% + \expandafter\global + \expandafter\newcount\csname glossary@##1@sortcount\endcsname }% - \renewcommand*{\Genplacrfullformat}[2]{% - \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}##2\space - (\glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + \def\@gls@defsort##1##2{% + \ifcsundef{glossary@##1@sortcount}% + {\@gls@defsortcount{##1}}% + {}% + \expandafter\global\expandafter + \advance\csname glossary@##1@sortcount\endcsname by 1\relax + \expandafter\protected@xdef\csname glo@##2@sort\endcsname{% + \expandafter\glssortnumberfmt + {\csname glossary@##1@sortcount\endcsname}}% }% - \renewcommand*{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} - \renewcommand*{\acronymsort}[2]{##1}% - \renewcommand*{\acronymfont}[1]{##1}% - \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% + \def\@gls@setsort##1{}% + \let\@glo@check@sortallowed\@gobble } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{short-long} -% \meta{short} (\meta{long}) acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{short-long}% -{% -% \end{macrocode} -% Check for long form in case this is a mixed glossary. -% \begin{macrocode} - \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -}% -{% - \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% - \renewcommand*{\genacrfullformat}[2]{% - \glsshortaccessdisplay - {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2\space - (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% +\newcommand*{\@gls@setupsort@use}{% + \let\do@glo@storeentry\@gobble + \def\@gls@defsortcount##1{% + \expandafter\global + \expandafter\newcount\csname glossary@##1@sortcount\endcsname }% - \renewcommand*{\Genacrfullformat}[2]{% - \glsshortaccessdisplay - {\protect\firstacronymfont{\Glsentryshort{##1}}}{##1}##2\space - (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + \def\@gls@defsort##1##2{% + \expandafter\gdef\csname glo@##2@sort\endcsname{}% }% - \renewcommand*{\genplacrfullformat}[2]{% - \glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2\space - (\glslongpluralaccessdisplay - {\glsentrylongpl{##1}}{##1})% + \def\@gls@setsort##1{% + \edef\@glo@parent{\csname glo@##1@parent\endcsname}% + \ifx\@glo@parent\@empty + \else + \expandafter\@gls@setsort\expandafter{\@glo@parent}% + \fi + \edef\@glo@type{\csname glo@##1@type\endcsname}% + \edef\@gls@tmp{\csname glo@##1@sort\endcsname}% + \ifx\@gls@tmp\@empty + \expandafter\global\expandafter + \advance\csname glossary@\@glo@type @sortcount\endcsname by 1\relax + \expandafter\protected@xdef\csname glo@##1@sort\endcsname{% + \expandafter\glssortnumberfmt + {\csname glossary@\@glo@type @sortcount\endcsname}}% + \@glo@storeentry{##1}% + \fi }% - \renewcommand*{\Genplacrfullformat}[2]{% - \glsshortpluralaccessdisplay - {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})% + \let\@glo@check@sortallowed\@gobble +} +\newcommand*{\@gls@setupsort@none}{% + \def\do@glo@storeentry##1{}% + \def\@gls@defsortcount##1{}% + \def\@gls@defsort##1##2{% + \expandafter\global\expandafter\let\csname glo@##2@sort\endcsname\@glo@sort }% - \renewcommand*{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% - \renewcommand*{\acronymsort}[2]{##1}% - \renewcommand*{\acronymfont}[1]{##1}% - \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% + \def\@gls@setsort##1{}% + \renewcommand\@glo@check@sortallowed[1]{\PackageError{glossaries} + {Option sort=none not allowed with \string##1}% + {(Use sort=def instead)}}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{long-short-desc} -% \meta{long} (\marg{short}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{long-short-desc}% -{% - \GlsUseAcrEntryDispStyle{long-short}% -}% -{% - \GlsUseAcrStyleDefs{long-short}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\newcommand*{\glsdefmain}{% + \if@gls@docloaded + \newglossary[glg2]{main}{gls2}{glo2}{\glossaryname}% + \else + \newglossary{main}{gls}{glo}{\glossaryname}% + \fi + \newcommand*{\gls@tr@set@main@toctitle}{% + \translatelet{\glossarytoctitle}{Glossary}% + }% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{long-sc-short-desc} -% \meta{long} (\cs{textsc}\marg{short}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{long-sc-short-desc}% -{% - \GlsUseAcrEntryDispStyle{long-sc-short}% -}% -{% - \GlsUseAcrStyleDefs{long-sc-short}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\newcommand*{\glsdefaulttype}{main} +\newcommand*{\acronymtype}{\glsdefaulttype} +\@gls@declareoption{nomain}{% + \let\glsdefaulttype\relax + \renewcommand*{\glsdefmain}{}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{long-sm-short-desc} -% \meta{long} (\cs{textsmaller}\marg{short}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{long-sm-short-desc}% -{% - \GlsUseAcrEntryDispStyle{long-sm-short}% -}% -{% - \GlsUseAcrStyleDefs{long-sm-short}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\define@boolkey{glossaries.sty}[gls]{acronym}[true]{% + \ifglsacronym + \renewcommand{\@gls@do@acronymsdef}{% + \DeclareAcronymList{acronym}% + \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% + \renewcommand*{\acronymtype}{acronym}% + \newcommand*{\gls@tr@set@acronym@toctitle}{% + \translatelet{\glossarytoctitle}{Acronyms}% + }% + }% + \else + \let\@gls@do@acronymsdef\relax + \fi } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{short-long-desc} -% \meta{short} (\marg{long}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{short-long-desc}% -{% - \GlsUseAcrEntryDispStyle{short-long}% -}% -{% - \GlsUseAcrStyleDefs{short-long}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\AtBeginDocument{% + \ifglsacronym + \ifbool{glscompatible-3.07}% + {}% + {% + \providecommand*{\printacronyms}[1][]{% + \printglossary[type=\acronymtype,#1]}% + }% + \fi } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{sc-short-long-desc} -% \meta{long} (\cs{textsc}\marg{short}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{sc-short-long-desc}% -{% - \GlsUseAcrEntryDispStyle{sc-short-long}% -}% -{% - \GlsUseAcrStyleDefs{sc-short-long}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\newcommand*{\@gls@do@acronymsdef}{} +\@gls@declareoption{acronyms}{% + \glsacronymtrue + \def\@gls@do@acronymsdef{% + \DeclareAcronymList{acronym}% + \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% + \renewcommand*{\acronymtype}{acronym}% + \newcommand*{\gls@tr@set@acronym@toctitle}{% + \translatelet{\glossarytoctitle}{Acronyms}% + }% + }% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{sm-short-long-desc} -% \meta{long} (\cs{textsmaller}\marg{short}) acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{sm-short-long-desc}% -{% - \GlsUseAcrEntryDispStyle{sm-short-long}% -}% -{% - \GlsUseAcrStyleDefs{sm-short-long}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\newcommand*{\@glsacronymlists}{} +\newcommand*{\@addtoacronymlists}[1]{% + \ifx\@glsacronymlists\@empty + \protected@xdef\@glsacronymlists{#1}% + \else + \protected@xdef\@glsacronymlists{\@glsacronymlists,#1}% + \fi } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{dua} -% \meta{long} only acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{dua}% -{% -% \end{macrocode} -% Check for long form in case this is a mixed glossary. -% \begin{macrocode} - \ifdefempty\glscustomtext +\newcommand*{\DeclareAcronymList}[1]{% + \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}% +} +\newcommand{\glsIfListOfAcronyms}[1]{% + \edef\@do@gls@islistofacronyms{% + \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}% + \@do@gls@islistofacronyms +} +\newcommand{\@gls@islistofacronyms}[4]{% + \def\gls@islistofacronyms##1,#1,##2\end@gls@islistofacronyms{% + \def\@gls@before{##1}\def\@gls@after{##2}}% + \gls@islistofacronyms,#2,#1,\@nil\end@gls@islistofacronyms + \ifx\@gls@after\@nnil + #4% + \else + #3% + \fi +} +\newif\if@glsisacronymlist +\newcommand*{\gls@checkisacronymlist}[1]{% + \glsIfListOfAcronyms{#1}% + {\@glsisacronymlisttrue}{\@glsisacronymlistfalse}% +} +\newcommand*{\SetAcronymLists}[1]{% + \renewcommand*{\@glsacronymlists}{#1}% +} +\define@key{glossaries.sty}{acronymlists}{% + \DeclareAcronymList{#1}% +} +\newcommand{\glscounter}{page} +\define@key{glossaries.sty}{counter}{% + \renewcommand*{\glscounter}{#1}% +} +\newcommand*{\@gls@nohyperlist}{} +\newcommand*{\GlsDeclareNoHyperList}[1]{% + \ifdefempty\@gls@nohyperlist {% - \ifglshaslong{\glslabel}% - {% - \glsifplural - {% -% \end{macrocode} -% Plural form: -% \begin{macrocode} - \glscapscase - {% -% \end{macrocode} -% Plural form, don't adjust case: -% \begin{macrocode} - \glslongpluralaccessdisplay{\glsentrylongpl{\glslabel}}{\glslabel}% - \glsinsert - }% - {% -% \end{macrocode} -% Plural form, make first letter upper case: -% \begin{macrocode} - \glslongpluralaccessdisplay{\Glsentrylongpl{\glslabel}}{\glslabel}% - \glsinsert - }% - {% -% \end{macrocode} -% Plural form, all caps: -% \begin{macrocode} - \glslongpluralaccessdisplay - {\mfirstucMakeUppercase{\glsentrylongpl{\glslabel}}}{\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - }% - {% -% \end{macrocode} -% Singular form -% \begin{macrocode} - \glscapscase - {% -% \end{macrocode} -% Singular form, don't adjust case: -% \begin{macrocode} - \glslongaccessdisplay{\glsentrylong{\glslabel}}{\glslabel}\glsinsert - }% - {% -% \end{macrocode} -% Subsequent singular form, make first letter upper case: -% \begin{macrocode} - \glslongaccessdisplay{\Glsentrylong{\glslabel}}{\glslabel}\glsinsert - }% - {% -% \end{macrocode} -% Subsequent singular form, all caps: -% \begin{macrocode} - \glslongaccessdisplay - {\mfirstucMakeUppercase - {\glsentrylong{\glslabel}\glsinsert}}{\glslabel}% - \mfirstucMakeUppercase{\glsinsert}% - }% - }% - }% - {% -% \end{macrocode} -% Not an acronym: -% \begin{macrocode} - \glsgenentryfmt - }% + \renewcommand*{\@gls@nohyperlist}{#1}% }% - {\glscustomtext\glsinsert}% -}% -{% - \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% - \renewcommand*{\acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glslongaccessdisplay{\glsentrylong{##2}}{##2}##3\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% - \renewcommand*{\Acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glslongaccessdisplay{\Glsentrylong{##2}}{##2}##3\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% - \renewcommand*{\ACRfullfmt}[3]{% - \glslink[##1]{##2}{% - \glslongaccessdisplay - {\mfirstucMakeUppercase{\glsentrylong{##2}}{##2}##3\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}}% - \renewcommand*{\acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glslongpluralaccessdisplay - {\glsentrylongpl{##2}}{##2}##3\space - (\glsshortpluralaccessdisplay - {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% - \renewcommand*{\Acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glslongpluralaccessdisplay - {\Glsentrylongpl{##2}}{##2}##3\space - (\glsshortpluralaccessdisplay - {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% - \renewcommand*{\ACRfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glslongpluralaccessdisplay - {\mfirstucMakeUppercase{\glsentrylongpl{##2}}{##2}##3\space - (\glsshortpluralaccessdisplay - {\acronymfont{\glsentryshortpl{##2}}}{##2})}}}% - \renewcommand*{\glsentryfull}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + {% + \appto\@gls@nohyperlist{,#1}% }% - \renewcommand*{\Glsentryfull}[1]{% - \glslongaccessdisplay{\Glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% +} +\define@key{glossaries.sty}{nohypertypes}{% + \GlsDeclareNoHyperList{#1}% +} +\newcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{#1}% +} +\newcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{#1}% +} +\newcommand{\glosortentrieswarning}{% + \typeout{Using TeX to sort glossary entries---this may + take a while}% +} +\@gls@declareoption{nowarn}{% + \if@gls@debug + \GlossariesWarning{Warnings can't be suppressed in debug mode}% + \else + \renewcommand*{\GlossariesWarning}[1]{}% + \renewcommand*{\GlossariesWarningNoLine}[1]{}% + \renewcommand*{\glosortentrieswarning}{}% + \renewcommand*{\@gls@missinglang@warn}[2]{}% + \fi +} +\newcommand*{\@gls@missinglang@warn}[2]{% + \PackageWarningNoLine{glossaries}% + {No language module detected for `#1'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-#2' or similar}% +} +\@gls@declareoption{nolangwarn}{% + \renewcommand*{\@gls@missinglang@warn}[2]{}% +} +\newcommand*{\@gls@warnonglossdefined}{% + \GlossariesWarning{Overriding \string\printglossary}% +} +\newcommand*{\@gls@warnontheglossdefined}{% + \GlossariesWarning{Overriding `theglossary' environment}% +} +\@gls@declareoption{noredefwarn}{% + \renewcommand*{\@gls@warnonglossdefined}{}% + \renewcommand*{\@gls@warnontheglossdefined}{}% +} +\newcommand*{\@gls@sanitizedesc}{% +} +\newcommand*{\glssetexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@expand@field{##1}{#1}{##2}% }% - \renewcommand*{\glsentryfullpl}[1]{% - \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}\space - (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% +} +\newcommand*{\glssetnoexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@noexpand@field{##1}{#1}{##2}% }% - \renewcommand*{\Glsentryfullpl}[1]{% - \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}\space - (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% +} +\glssetexpandfield{type} +\glssetnoexpandfield{desc} +\glssetnoexpandfield{descplural} +\newcommand*{\@gls@sanitizename}{} +\glssetnoexpandfield{name} +\newcommand*{\@gls@sanitizesymbol}{} +\glssetnoexpandfield{symbol} +\glssetnoexpandfield{symbolplural} +\newcommand*{\@gls@sanitizesort}{% + \ifglssanitizesort + \@@gls@sanitizesort + \else + \@@gls@nosanitizesort + \fi +} +\newcommand*\@@gls@sanitizesort{% + \@onelevel@sanitize\@glo@sort +} +\newcommand*{\@@gls@nosanitizesort}{} +\newcommand*\@gls@noidx@sanitizesort{% + \ifdefvoid\@glo@sort + {}% + {% + \expandafter\@@gls@noidx@sanitizesort\@glo@sort\gls@end@sanitizesort }% - \renewcommand*{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% - \renewcommand*{\acronymsort}[2]{##1}% - \renewcommand*{\acronymfont}[1]{##1}% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{dua-desc} -% \meta{long} only acronym style with user-supplied description. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{dua-desc}% -{% - \GlsUseAcrEntryDispStyle{dua}% -}% -{% - \GlsUseAcrStyleDefs{dua}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\acronymfont{\glsentrylong{##1}}}{##1}}% - \renewcommand*{\acronymsort}[2]{##2}% -}% -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote} -% \meta{short}\cs{footnote}\marg{long} acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote}% -{% -% \end{macrocode} -% Check for long form in case this is a mixed glossary. -% \begin{macrocode} - \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% -}% -{% - \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% -% \end{macrocode} -% Need to ensure hyperlinks are switched off on first use: -% \begin{macrocode} - \glshyperfirstfalse - \renewcommand*{\genacrfullformat}[2]{% - \glsshortaccessdisplay - {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2% - \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% - }% - \renewcommand*{\Genacrfullformat}[2]{% - \glsshortaccessdisplay - {\firstacronymfont{\Glsentryshort{##1}}}{##1}##2% - \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% - }% - \renewcommand*{\genplacrfullformat}[2]{% - \glsshortpluralaccessdisplay - {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2% - \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% - }% - \renewcommand*{\Genplacrfullformat}[2]{% - \glsshortpluralaccessdisplay - {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2% - \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% +\def\@@gls@noidx@sanitizesort#1#2\gls@end@sanitizesort{% + \def\@glo@sort{#1#2}% + \@onelevel@sanitize\@glo@sort +} +\newcommand*{\@@gls@noidx@nosanitizesort}{% + \ifdefvoid\@glo@sort + {}% + {% + \expandafter\@@gls@noidx@no@sanitizesort\@glo@sort\gls@end@sanitizesort }% - \renewcommand*{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% - \renewcommand*{\acronymsort}[2]{##1}% - \renewcommand*{\acronymfont}[1]{##1}% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% -% \end{macrocode} -% Don't use footnotes for \ics{acrfull}: -% \begin{macrocode} - \renewcommand*{\acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2}##3\space - (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% - \renewcommand*{\Acrfullfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##2}}}{##2}##3\space - (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% - \renewcommand*{\ACRfullfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortaccessdisplay - {\mfirstucMakeUppercase - {\acronymfont{\glsentryshort{##2}}}{##2}##3\space - (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}}% - \renewcommand*{\acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortpluralaccessdisplay - {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}% - \renewcommand*{\Acrfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortpluralaccessdisplay - {\acronymfont{\Glsentryshortpl{##2}}}{##2}##3\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##2}})}}% - \renewcommand*{\ACRfullplfmt}[3]{% - \glslink[##1]{##2}{% - \glsshortpluralaccessdisplay - {\mfirstucMakeUppercase - {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}}% -% \end{macrocode} -% Similarly for \ics{glsentryfull} etc: -% \begin{macrocode} - \renewcommand*{\glsentryfull}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}\space - (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% - \renewcommand*{\Glsentryfull}[1]{% - \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##1}}}{##1}\space - (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% - \renewcommand*{\glsentryfullpl}[1]{% - \glsshortpluralaccessdisplay - {\acronymfont{\glsentryshortpl{##1}}}{##1}\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% - \renewcommand*{\Glsentryfullpl}[1]{% - \glsshortpluralaccessdisplay - {\acronymfont{\Glsentryshortpl{##1}}}{##1}\space - (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote-sc} -% \cs{textsc}\marg{short}\cs{footnote}\marg{long} acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote-sc}% -{% - \GlsUseAcrEntryDispStyle{footnote}% -}% -{% - \GlsUseAcrStyleDefs{footnote}% - \renewcommand{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} - \renewcommand{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% -}% -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote-sm} -% \cs{textsmaller}\marg{short}\cs{footnote}\marg{long} acronym style. -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote-sm}% -{% - \GlsUseAcrEntryDispStyle{footnote}% -}% -{% - \GlsUseAcrStyleDefs{footnote}% - \renewcommand{\acronymentry}[1]{% - \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} - \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% -}% -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote-desc} -% \meta{short}\cs{footnote}\marg{long} acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote-desc}% -{% - \GlsUseAcrEntryDispStyle{footnote}% -}% -{% - \GlsUseAcrStyleDefs{footnote}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\def\@@gls@noidx@no@sanitizesort#1#2\gls@end@sanitizesort{% + \bgroup + \glsnoidxstripaccents + \protected@xdef\@@glo@sort{#1#2}% + \egroup + \let\@glo@sort\@@glo@sort } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote-sc-desc} -% \cs{textsc}\marg{short}\cs{footnote}\marg{long} acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote-sc-desc}% -{% - \GlsUseAcrEntryDispStyle{footnote-sc}% -}% -{% - \GlsUseAcrStyleDefs{footnote-sc}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +\newcommand*\glsnoidxstripaccents{% + \let\IeC\@firstofone + \let\add@accent@\@secondoftwo + \let\@text@composite@x\@secondoftwo + \let\@tabacckludge\@secondoftwo + \expandafter\def\csname \encodingdefault-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname OT1-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname T1-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname PD1-cmd\endcsname##1##2##3{##3}% + \let\'\@firstofone + \let\`\@firstofone + \let\^\@firstofone + \let\"\@firstofone + \let\u\@firstofone + \let\t\@firstofone + \let\d\@firstofone + \let\r\@firstofone + \let\=\@firstofone + \let\.\@firstofone + \let\~\@firstofone + \let\v\@firstofone + \let\H\@firstofone + \let\c\@firstofone + \let\b\@firstofone + \let\a\@secondoftwo + \def\AE{AE}% + \def\ae{ae}% + \def\OE{OE}% + \def\oe{oe}% + \def\AA{AA}% + \def\aa{aa}% + \def\L{L}% + \def\l{l}% + \def\O{O}% + \def\o{o}% + \def\SS{SS}% + \def\ss{ss}% + \def\th{th}% + \def\TH{TH}% + \def\dh{dh}% + \def\DH{DH}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{acrstyle}{footnote-sm-desc} -% \cs{textsmaller}\marg{short}\cs{footnote}\marg{long} acronym style that has an -% accompanying description (which the user needs to supply). -%\changes{4.03}{2014-01-20}{redefined to use accessibility -%information} -% \begin{macrocode} -\renewacronymstyle{footnote-sm-desc}% -{% - \GlsUseAcrEntryDispStyle{footnote-sm}% -}% +\@ifl@t@r\fmtversion{2019/10/01} {% - \GlsUseAcrStyleDefs{footnote-sm}% - \renewcommand*{\GenericAcronymFields}{}% - \renewcommand*{\acronymsort}[2]{##2}% - \renewcommand*{\acronymentry}[1]{% - \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space - (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% + \appto\glsnoidxstripaccents{\let\UTFviii@two@octets\UTFviii@two@octets@combine}% } -% \end{macrocode} -%\end{acrstyle} -% -%\begin{macro}{\glsdefaultshortaccess} -%\changes{4.45}{2020-02-13}{new} -%\begin{definition} -%\cs{glsdefaultshortaccess}\marg{long}\marg{short} -%\end{definition} -%Default \gloskey{shortaccess} value. -% \begin{macrocode} -\newcommand*{\glsdefaultshortaccess}[2]{#1} -% \end{macrocode} -%\end{macro} -% -% Use \cs{newacronymhook} to modify the key list to set -% the access text to the long version by default. -%\changes{1.46}{2021-09-20}{changed \cs{edef} to \cs{protected@edef}} -% \begin{macrocode} -\renewcommand*{\newacronymhook}{% - \protected@edef\@gls@keylist{% - shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - shortpluralaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - \the\glskeylisttok}% - \expandafter\glskeylisttok\expandafter{\@gls@keylist}% +{} +\define@boolkey[gls]{sanitize}{description}[true]{% + \GlossariesWarning{sanitize={description} package option deprecated}% + \ifgls@sanitize@description + \glssetnoexpandfield{desc}% + \glssetnoexpandfield{descplural}% + \else + \glssetexpandfield{desc}% + \glssetexpandfield{descplural}% + \fi } -% \end{macrocode} -%\begin{macro}{\DefaultNewAcronymDef} -% Modify default style to use access text: -% \begin{macrocode} -\renewcommand*{\DefaultNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glsshorttok},% - description={\the\glslongtok},% - descriptionaccess=\relax, - text={\the\glsshorttok},% - access={\noexpand\@glo@textaccess},% - sort={\the\glsshorttok},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% - first={\noexpand\glslongaccessdisplay - {\the\glslongtok}{\the\glslabeltok}\space - (\noexpand\glsshortaccessdisplay - {\the\glsshorttok}{\the\glslabeltok})},% - plural={\the\glsshorttok\acrpluralsuffix},% - firstplural={\noexpand\glslongpluralaccessdisplay - {\noexpand\@glo@longpl}{\the\glslabeltok}\space - (\noexpand\glsshortpluralaccessdisplay - {\noexpand\@glo@shortpl}{\the\glslabeltok})},% - firstaccess=\relax, - firstpluralaccess=\relax, - textaccess={\noexpand\@glo@shortaccess},% - \the\glskeylisttok +\define@boolkey[gls]{sanitize}{name}[true]{% + \GlossariesWarning{sanitize={name} package option deprecated}% + \ifgls@sanitize@name + \glssetnoexpandfield{name}% + \else + \glssetexpandfield{name}% + \fi +} +\define@boolkey[gls]{sanitize}{symbol}[true]{% + \GlossariesWarning{sanitize={symbol} package option deprecated}% + \ifgls@sanitize@symbol + \glssetnoexpandfield{symbol}% + \glssetnoexpandfield{symbolplural}% + \else + \glssetexpandfield{symbol}% + \glssetexpandfield{symbolplural}% + \fi +} +\define@boolkey{glossaries.sty}[gls]{sanitizesort}[true]{% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \renewcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesorttrue + \glssetnoexpandfield{sortvalue}% + }% + \else + \glssetexpandfield{sortvalue}% + \renewcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesortfalse + \glssetexpandfield{sortvalue}% }% + \fi +} +\glssanitizesorttrue +\glssetnoexpandfield{sortvalue}% +\newcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesortfalse + \glssetexpandfield{sortvalue}% +} +\define@choicekey[gls]{sanitize}{sort}{true,false}[true]{% + \setbool{glssanitizesort}{#1}% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \else + \glssetexpandfield{sortvalue}% + \fi + \GlossariesWarning{sanitize={sort} package option + deprecated. Use sanitizesort instead}% +} +\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,name=true]{% + \ifthenelse{\equal{#1}{none}}% + {% + \GlossariesWarning{sanitize package option deprecated}% + \glssetexpandfield{name}% + \glssetexpandfield{symbol}% + \glssetexpandfield{symbolplural}% + \glssetexpandfield{desc}% + \glssetexpandfield{descplural}% }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@descplural\gls@assign@descplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% + {% + \setkeys[gls]{sanitize}{#1}% }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% +} +\newif\ifglstranslate +\newcommand*\@gls@usetranslator{% + \@ifpackageloaded{polyglossia}% + {% + \let\glsifusetranslator\@secondoftwo }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% + {% + \@ifpackageloaded{babel}% + {% + \IfFileExists{translator.sty}% + {% + \RequirePackage{translator}% + \let\glsifusetranslator\@firstoftwo + }% + {}% + }% + {}% }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural - \@@gls@noexpand@assign@default@plurals } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\DescriptionFootnoteNewAcronymDef} -% \begin{macrocode} -\renewcommand*{\DescriptionFootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% +\newcommand{\glsifusedtranslatordict}[3]{% + \glsifusetranslator + {\ifcsdef{ver@glossaries-dictionary-#1.dict}{#2}{#3}}% + {#3}% +} +\@gls@declareoption{notranslate}{% + \glstranslatefalse + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo +} +\define@choicekey{glossaries.sty}{translate}% + [\gls@translate@val\gls@translate@nr]% + {true,false,babel}[true]% + {% + \ifcase\gls@translate@nr\relax + \glstranslatetrue + \renewcommand*\@gls@usetranslator{% + \@ifpackageloaded{polyglossia}% + {% + \let\glsifusetranslator\@secondoftwo + }% + {% + \@ifpackageloaded{babel}% + {% + \IfFileExists{translator.sty}% + {% + \RequirePackage{translator}% + \let\glsifusetranslator\@firstoftwo + }% + {}% + }% + {}% + }% + }% + \or + \glstranslatefalse + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo + \or + \glstranslatetrue + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo + \fi + } +\glstranslatefalse +\let\glsifusetranslator\@secondoftwo +\@ifpackageloaded{translator}% +{% + \glstranslatetrue + \let\glsifusetranslator\@firstoftwo +}% +{% + \@for\gls@thissty:=tracklang,babel,ngerman,polyglossia\do + { + \@ifpackageloaded{\gls@thissty}% {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - access={\noexpand\@glo@textaccess},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - symbol={\the\glslongtok},% - symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},% - firstpluralaccess=\relax, - textaccess={\noexpand\@glo@shortaccess},% - \the\glskeylisttok + \glstranslatetrue + \@endfortrue }% + {}% + } +} +\define@boolkey{glossaries.sty}[gls]{indexonlyfirst}[true]{} +\glsindexonlyfirstfalse +\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{} +\glshyperfirsttrue +\newcommand*{\@gls@setacrstyle}{} +\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% + \ifbool{glsacrdescription}% + {}% + {% + \renewcommand*{\@gls@sanitizedesc}{}% }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\DescriptionNewAcronymDef} -% \begin{macrocode} -\renewcommand*{\DescriptionNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand - \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% - access={\noexpand\@glo@textaccess},% - sort={\the\glsshorttok},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - first={\the\glslongtok},% - firstaccess=\relax, - firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% - text={\the\glsshorttok},% - textaccess={\the\glslongtok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - symbol={\noexpand\@glo@text},% - symbolaccess={\noexpand\@glo@textaccess},% - symbolplural={\noexpand\@glo@plural},% - firstpluralaccess=\relax, - textaccess={\noexpand\@glo@shortaccess},% - \the\glskeylisttok}% - }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +\define@boolkey{glossaries.sty}[glsacr]{description}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\FootnoteNewAcronymDef} -% \begin{macrocode} -\renewcommand*{\FootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% +\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{} +\newcommand*{\glsorder}{word} +\newcommand*{\@glsorder}[1]{} +\define@choicekey{glossaries.sty}{order}{word,letter}{% + \def\glsorder{#1}} +\newif\ifglsxindy +\glsxindyfalse +\@gls@declareoption{makeindex}{\glsxindyfalse} +\define@boolkey[gls]{xindy}{glsnumbers}[true]{} +\gls@xindy@glsnumberstrue +\def\@xdy@main@language{\languagename}% +\define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}} +\ifcsundef{inputencodingname}{% + \def\gls@codepage{}}{% + \def\gls@codepage{\inputencodingname} +} +\define@key[gls]{xindy}{codepage}{\def\gls@codepage{#1}} +\define@key{glossaries.sty}{xindy}[]{% + \glsxindytrue + \setkeys[gls]{xindy}{#1}% +} +\@gls@declareoption{xindygloss}{% + \glsxindytrue +} +\@gls@declareoption{xindynoglsnumbers}{% + \glsxindytrue + \gls@xindy@glsnumbersfalse +} +\providecommand{\@domakeglossaries}[1]{#1} +\@gls@declareoption{disablemakegloss}{% + \ifdefequal\makeglossaries\@no@makeglossaries + {% + \GlossariesWarning{Option `disablemakegloss' has no effect + (\string\makenoidxglossaries\space has already been used)}% + }% + {% + \ifdefequal\@makeglossary\@gobble {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - textaccess={\the\glslongtok},% - access={\noexpand\@glo@textaccess},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% - \the\glskeylisttok + \GlossariesWarning{Option `disablemakegloss' has no effect + (\string\makeglossaries\space has already been used)}% }% - }% - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@descplural\gls@assign@descplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% - }% - \@do@newglossaryentry - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@descplural\@org@gls@assign@descplural -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\SmallNewAcronymDef} -% \begin{macrocode} -\renewcommand*{\SmallNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - access={\noexpand\@glo@symbolaccess},% - sort={\the\glsshorttok},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - text={\noexpand\@glo@short},% - textaccess={\noexpand\@glo@shortaccess},% - plural={\noexpand\@glo@shortpl},% - first={\the\glslongtok},% - firstaccess=\relax, - firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\noexpand\@glo@first},% - descriptionplural={\noexpand\@glo@firstplural},% - symbol={\the\glsshorttok},% - symbolaccess={\the\glslongtok},% - symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - \the\glskeylisttok + \renewcommand{\@domakeglossaries}[1]{% + \PackageInfo{glossaries}{\string\makeglossaries\space and + \string\makenoidxglossaries\space have been disabled}% + }% }% }% - \let\@org@gls@assign@firstpl\gls@assign@firstpl - \let\@org@gls@assign@plural\gls@assign@plural - \let\@org@gls@assign@descplural\gls@assign@descplural - \let\@org@gls@assign@symbolplural\gls@assign@symbolplural - \def\gls@assign@firstpl##1##2{% - \@@gls@expand@field{##1}{firstpl}{##2}% - }% - \def\gls@assign@plural##1##2{% - \@@gls@expand@field{##1}{plural}{##2}% - }% - \def\gls@assign@descplural##1##2{% - \@@gls@expand@field{##1}{descplural}{##2}% +} +\@gls@declareoption{restoremakegloss}{% + \ifdefequal\makeglossaries\@no@makeglossaries + {% + \GlossariesWarning{Option `restoremakegloss' has no effect + (\string\makenoidxglossaries\space has already been used)}% }% - \def\gls@assign@symbolplural##1##2{% - \@@gls@expand@field{##1}{symbolplural}{##2}% + {% + \ifdefequal\@makeglossary\@gobble + {% + \GlossariesWarning{Option `restoremakegloss' has no effect + (\string\makeglossaries\space has already been used)}% + }% + {% + \PackageInfo{glossaries}{\string\makeglossaries\space and + \string\makenoidxglossaries\space have been restored}% + \let\@domakeglossaries\@firstofone + }% }% - \@do@newglossaryentry - \let\gls@assign@firstpl\@org@gls@assign@firstpl - \let\gls@assign@plural\@org@gls@assign@plural - \let\gls@assign@descplural\@org@gls@assign@descplural - \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } -% \end{macrocode} -%\end{macro} -% -% The following are kept for compatibility with versions before -% 3.0: -%\begin{macro}{\glsshortaccesskey} -% \begin{macrocode} - \newcommand*{\glsshortaccesskey}{\glsshortkey access}% -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsshortpluralaccesskey} -% \begin{macrocode} - \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}% -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glslongaccesskey} -% \begin{macrocode} - \newcommand*{\glslongaccesskey}{\glslongkey access}% -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glslongpluralaccesskey} -% \begin{macrocode} - \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}% -% \end{macrocode} -%\end{macro} -%\section{Debugging Commands} -% -%\begin{macro}{\showglonameaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -%\changes{4.38}{2018-05-10}{bug fix: corrected field (was showing text access field)} -% \begin{macrocode} -\newcommand*{\showglonameaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@access\endcsname +\newcommand*{\@do@write@glslabels}{% + \AtEndDocument{\@@do@write@glslabels}% + \let\@do@write@glslabels\relax } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglotextaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglotextaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@textaccess\endcsname +\newcommand*{\@@do@write@glslabels}{% + \newwrite\@gls@labelsfile + \immediate\openout\@gls@labelsfile=\jobname.glslabels + \forallglsentries[\@glo@types,\@ignored@glossaries]{\@glsentry}% + {\ifdefempty{\@glsentry}{}{\immediate\write\@gls@labelsfile{\@glsentry}}}% + \immediate\closeout\@gls@labelsfile } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglopluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglopluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@pluralaccess\endcsname +\@gls@declareoption{writeglslabels}{\@do@write@glslabels} +\newif\ifglsautomake +\newcommand{\gls@automake@nr}{1} +\define@choicekey{glossaries.sty}{automake}% + [\gls@automake@val\gls@automake@nr]{true,false,immediate}[true]{% + \ifnum\gls@automake@nr=1\relax + \glsautomakefalse + \else + \glsautomaketrue + \fi + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \PackageError{glossaries}{You must use + \string\makeglossaries\space with automake=true} + {% + Either remove the automake=true setting or + add \string\makeglossaries\space to your document preamble.% + }% + }% + \else + \renewcommand*{\@gls@doautomake}{}% + \fi } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglofirstaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglofirstaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@firstaccess\endcsname +\glsautomakefalse +\newcommand*{\@gls@doautomake}{} +\AtEndDocument{\@gls@doautomake} +\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{% + \ifglssavewrites + \renewcommand*{\glswritefiles}{\@glswritefiles}% + \else + \let\glswritefiles\@empty + \fi } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglofirstpluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglofirstpluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@firstpluralaccess\endcsname +\glssavewritesfalse +\let\glswritefiles\@empty +\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{} +\boolfalse{glscompatible-3.07} +\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{% + \ifbool{glscompatible-2.07}% + {% + \booltrue{glscompatible-3.07}% + }% + {}% } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglosymbolaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglosymbolaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolaccess\endcsname +\boolfalse{glscompatible-2.07} +\let\gls@original@makeglossary\makeglossary +\let\gls@original@glossary\glossary +\def\makeglossary{% + \GlossariesWarning{Use of \string\makeglossary\space with + glossaries.sty is \MessageBreak deprecated. Use \string\makeglossaries\space + instead. If you \MessageBreak need the original definition of + \string\makeglossary\space use \MessageBreak the package options + kernelglossredefs=false (to \MessageBreak restore the former definition of + \string\makeglossary) and \MessageBreak nomain (if the file extensions cause a + conflict)}% + \makeglossaries } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglosymbolpluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglosymbolpluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolpluralaccess\endcsname +\newcommand*{\@gls@override@glossary}[1][main]{% + \GlossariesWarning{Use of \string\glossary\space with + glossaries.sty is deprecated. \MessageBreak Indexing should be performed + with the user level \MessageBreak commands, such as \string\gls\space or + \string\glsadd. If you need the \MessageBreak original definition of + \string\glossary\space use the package \MessageBreak options + kernelglossredefs=false (to restore the \MessageBreak former definition of + \string\glossary) and nomain (if the \MessageBreak file extensions cause a + conflict)}% + \gls@glossary{#1}% } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglodescaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglodescaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@descaccess\endcsname +\if@gls@docloaded +\else + \def\glossary{\@gls@override@glossary} +\fi +\define@choicekey{glossaries.sty}{kernelglossredefs}% + [\gls@debug@val\gls@debug@nr]{true,false,nowarn}[true]% +{% + \ifcase\gls@debug@nr\relax + \def\glossary{\@gls@override@glossary}% + \def\makeglossary{% + \GlossariesWarning{Use of \string\makeglossary\space with + glossaries.sty is deprecated. Use \string\makeglossaries\space + instead. If you need the original definition of + \string\makeglossary\space use the package options + kernelglossredefs=false (to prevent redefinition of + \string\makeglossary) and nomain (if the file extensions cause a + conflict)}% + \makeglossaries + }% + \or + \let\glossary\gls@original@glossary + \let\makeglossary\gls@original@makeglossary + \or + \def\makeglossary{\makeglossaries}% + \renewcommand*{\@gls@override@glossary}[1][main]{% + \gls@glossary{##1}% + }% + \fi } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglodescpluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglodescpluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@descpluralaccess\endcsname +\@gls@declareoption{symbols}{% + \let\@gls@do@symbolsdef\@gls@symbolsdef } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showgloshortaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showgloshortaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@shortaccess\endcsname +\newcommand*{\@gls@do@symbolsdef}{} +\newcommand*{\@gls@symbolsdef}{% + \newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}% + \newcommand*{\printsymbols}[1][]{\printglossary[type=symbols,##1]}% + \newcommand*{\gls@tr@set@symbols@toctitle}{% + \translatelet{\glossarytoctitle}{Symbols (glossaries)}% + }% +}% +\@gls@declareoption{numbers}{% + \let\@gls@do@numbersdef\@gls@numbersdef } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showgloshortpluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showgloshortpluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@shortpluralaccess\endcsname +\newcommand*{\@gls@do@numbersdef}{} +\newcommand*{\@gls@numbersdef}{% + \newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}% + \newcommand*{\printnumbers}[1][]{\printglossary[type=numbers,##1]}% + \newcommand*{\gls@tr@set@numbers@toctitle}{% + \translatelet{\glossarytoctitle}{Numbers (glossaries)}% + }% +}% +\@gls@declareoption{index}{% + \ifx\@gls@do@indexdef\@empty + \let\@gls@do@indexdef\@gls@indexdef + \fi } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglolongaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglolongaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@longaccess\endcsname +\@gls@declareoption{noglossaryindex}{% + \let\@gls@do@indexdef\relax } -% \end{macrocode} -%\end{macro} -%\begin{macro}{\showglolongpluralaccess} -%\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} -% \begin{macrocode} -\newcommand*{\showglolongpluralaccess}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@longpluralaccess\endcsname +\newcommand*{\@gls@do@indexdef}{} +\newcommand*{\@gls@indexdef}{% + \newglossary[ilg]{index}{ind}{idx}{\indexname}% + \newcommand*{\printindex}[1][]{\printglossary[type=index,##1]}% + \newcommand*{\newterm}[2][]{% + \newglossaryentry{##2}% + {type={index},name={##2},description={\nopostdesc},##1}} + \let\@gls@do@indexdef\relax +}% +\@for\CurrentOption :=\@declaredoptions\do{% + \ifx\CurrentOption\@empty + \else + \@expandtwoargs + \in@ {,\CurrentOption ,}{,\@classoptionslist,\@curroptions,}% + \ifin@ + \@use@ption + \expandafter \let\csname ds@\CurrentOption\endcsname\@empty + \fi + \fi } -% \end{macrocode} -%\end{macro} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossaries-babel.sty> -% \end{macrocode} -%\fi -%\chapter{Multi-Lingual Support} -% Many thanks to everyone who contributed to the translations both -% via email and on comp.text.tex. -% Language support has now been split off into independent language -% modules. -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-babel}[2021/11/01 v4.49 (NLCT)] -% \end{macrocode} -% Load \sty{tracklang} to obtain language settings. -% \begin{macrocode} -\RequirePackage{tracklang} -\let\glsifusetranslator\@secondoftwo -% \end{macrocode} -% Check for tracked languages: -% \begin{macrocode} - \AnyTrackedLanguages - {% - \ForEachTrackedDialect{\this@dialect}{% - \IfTrackedLanguageFileExists{\this@dialect}% - {glossaries-}% prefix - {.ldf}% - {% - \RequireGlossariesLang{\CurrentTrackedTag}% - }% - {% - \PackageWarningNoLine{glossaries}% - {No language module detected for `\this@dialect'.\MessageBreak - Language modules need to be installed separately.\MessageBreak - Please check on CTAN for a bundle called\MessageBreak - `glossaries-\CurrentTrackedLanguage' or similar}% - }% - }% +\ProcessOptionsX +\RequirePackage{glossaries-compatible-307}[=v4.46] +\disable@keys{glossaries.sty}{compatible-2.07,% + xindy,xindygloss,xindynoglsnumbers,makeindex,% + acronym,translate,notranslate,nolong,nosuper,notree,nostyles,% + nomain,noglossaryindex} +\newcommand*{\setupglossaries}[1]{% + \renewcommand*{\@gls@setacrstyle}{}% + \ifglsacrshortcuts + \def\@gls@setupshortcuts{\glsacrshortcutstrue}% + \else + \def\@gls@setupshortcuts{% + \ifglsacrshortcuts + \DefineAcronymSynonyms + \fi + }% + \fi + \glsacrshortcutsfalse + \let\@gls@do@numbersdef\relax + \let\@gls@do@symbolssdef\relax + \let\@gls@do@indexdef\relax + \let\@gls@do@acronymsdef\relax + \ifglsentrycounter + \let\@gls@doentrycounterdef\relax + \else + \let\@gls@doentrycounterdef\@gls@define@glossaryentrycounter + \fi + \ifglssubentrycounter + \let\@gls@dosubentrycounterdef\relax + \else + \let\@gls@dosubentrycounterdef\@gls@define@glossarysubentrycounter + \fi + \setkeys{glossaries.sty}{#1}% + \@gls@setacrstyle + \@gls@setupshortcuts + \@gls@do@acronymsdef + \@gls@do@numbersdef + \@gls@do@symbolssdef + \@gls@do@indexdef + \@gls@doentrycounterdef + \@gls@dosubentrycounterdef +} +\ifthenelse{\equal{\glscounter}{section}}% +{% + \ifcsundef{chapter}{}% + {% + \let\@gls@old@chapter\@chapter + \def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}% + \ifcsundef{hyperdef}{}{\hyperdef{section}{\thesection}{}}}% + }% +}% +{} +\newcommand*{\@gls@onlypremakeg}{} +\newcommand*{\@onlypremakeg}[1]{% + \ifx\@gls@onlypremakeg\@empty + \def\@gls@onlypremakeg{#1}% + \else + \expandafter\toks@\expandafter{\@gls@onlypremakeg}% + \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}% + \fi +} +\newcommand*{\@disable@onlypremakeg}{% +\@for\@thiscs:=\@gls@onlypremakeg\do{% + \expandafter\@disable@premakecs\@thiscs% +}} +\newcommand*{\@disable@premakecs}[1]{% + \def#1{\PackageError{glossaries}{\string#1\space may only be + used before \string\makeglossaries}{You can't use + \string#1\space after \string\makeglossaries}}% +} +\providecommand*{\glossaryname}{Glossary} +\providecommand*{\acronymname}{Acronyms} +\newcommand*{\glssettoctitle}[1]{% + \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}} +\providecommand*{\entryname}{Notation} +\providecommand*{\descriptionname}{Description} +\providecommand*{\symbolname}{Symbol} +\providecommand*{\pagelistname}{Page List} +\providecommand*{\glssymbolsgroupname}{Symbols} +\providecommand*{\glsnumbersgroupname}{Numbers} +\newcommand*{\glspluralsuffix}{s} +\newcommand*{\glsacrpluralsuffix}{\glspluralsuffix} +\newcommand*{\glsupacrpluralsuffix}{\glstextup{\glsacrpluralsuffix}} +\providecommand*{\seename}{see} +\providecommand*{\andname}{\&} +\newcommand*{\RequireGlossariesLang}[1]{% + \@ifundefined{ver@glossaries-#1.ldf}{\input{glossaries-#1.ldf}}{}% +} +\newcommand*{\ProvidesGlossariesLang}[1]{% + \ProvidesFile{glossaries-#1.ldf}% +} +\newcommand*{\addglossarytocaptions}[1]{} +\ifglstranslate + \RequirePackage{tracklang} + \@gls@usetranslator + \@ifpackageloaded{translator} + {% + \ifboolexpr + { + test {\ifdefstring{\trans@languages}{English}} + and not + test {\ifdefstring{bbl@loaded}{english}} + } + {% + \let\glsifusetranslator\@secondoftwo + }% + {% + \usedictionary{glossaries-dictionary}% + \renewcommand*{\addglossarytocaptions}[1]{% + \ifcsundef{captions#1}{}% + {% + \expandafter\let\expandafter\@gls@tmp\csname captions#1\endcsname + \expandafter\toks@\expandafter{\@gls@tmp + \renewcommand*{\glossaryname}{\translate{Glossary}}% + }% + \expandafter\edef\csname captions#1\endcsname{\the\toks@}% + }% + }% + }% }% {}% -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossaries-polyglossia.sty> -% \end{macrocode} -%\fi -%\section{Polyglossia Captions} -% Language support has now been split off into independent language -% modules. -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-polyglossia}[2021/11/01 v4.49 (NLCT)] -% \end{macrocode} -% Load \sty{tracklang} to obtain language settings. -% \begin{macrocode} -\RequirePackage{tracklang} -\let\glsifusetranslator\@secondoftwo -% \end{macrocode} -% Check for tracked languages: -% \begin{macrocode} \AnyTrackedLanguages {% \ForEachTrackedDialect{\this@dialect}{% @@ -29103,6662 +28731,3809 @@ you \RequireGlossariesLang{\CurrentTrackedTag}% }% {% - \PackageWarningNoLine{glossaries}% - {No language module detected for `\this@dialect'.\MessageBreak - Language modules need to be installed separately.\MessageBreak - Please check on CTAN for a bundle called\MessageBreak - `glossaries-\CurrentTrackedLanguage' or similar}% + \@gls@missinglang@warn\this@dialect\CurrentTrackedLanguage }% }% }% {}% -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-acronym-desc.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-acronym.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-acronyms-lang.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-brief.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-childmultipar.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-childnoname.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-cite.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-images.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-long.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-longchild.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-multipar.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-parent.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-symbolnames.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-symbols.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*example-glossaries-url.tex> -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%< -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossaries-2020-03-19.sty> -% \end{macrocode} -%\fi -% \section{Rollback v4.46 (glossaries-2020-03-19.sty)} -% Version 4.46 preserved for rollback. -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2020/03/19 v4.46 (NLCT)] -\RequirePackage{ifthen} -\RequirePackage{xkeyval}[2006/11/18] -\RequirePackage{mfirstuc} -\RequirePackage{textcase} -\renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase}% -\RequirePackage{xfor} -\RequirePackage{datatool-base} -\RequirePackage{amsgen} -\RequirePackage{etoolbox} -\newif\if@gls@docloaded -\@ifpackageloaded{doc}% -{% - \@gls@docloadedtrue -}% -{% - \@ifclassloaded{nlctdoc}{\@gls@docloadedtrue}{\@gls@docloadedfalse}% +\newcommand{\@ifglossaryexists}[3]{% + \ifcsundef{@glotype@#1@out}{#3}{#2}% } -\if@gls@docloaded - \let\glsorg@theglossary\theglossary - \let\glsorg@endtheglossary\endtheglossary - \let\glsorg@PrintChanges\PrintChanges - \renewcommand{\PrintChanges}{% - \begingroup - \let\theglossary\glsorg@theglossary - \let\endtheglossary\glsorg@endtheglossary - \glsorg@PrintChanges - \endgroup - } -\fi -\newif\if@gls@debug -\define@choicekey{glossaries.sty}{debug}[\gls@debug@val\gls@debug@nr]% - {true,false,showtargets,showaccsupp}[true]{% - \ifcase\gls@debug@nr\relax - % debug=true - \@gls@debugtrue - \renewcommand*{\GlossariesWarning}[1]{% - \PackageWarning{glossaries}{##1}% - }% - \renewcommand*{\GlossariesWarningNoLine}[1]{% - \PackageWarningNoLine{glossaries}{##1}% - }% - \let\@glsshowtarget\@gobble - \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% - \or - % debug=false - \@gls@debugfalse - \let\@glsshowtarget\@gobble - \let\@glsshowaccsupp\@gobblethree - \PackageInfo{glossaries}{debug mode OFF}% - \or - % debug=showtargets - \@gls@debugtrue - \renewcommand*{\GlossariesWarning}[1]{% - \PackageWarning{glossaries}{##1}% - }% - \renewcommand*{\GlossariesWarningNoLine}[1]{% - \PackageWarningNoLine{glossaries}{##1}% - }% - \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% - \renewcommand{\@glsshowtarget}{\@@glsshowtarget}% - \or - % debug=showaccsupp - \@gls@debugtrue - \renewcommand*{\GlossariesWarning}[1]{% - \PackageWarning{glossaries}{##1}% - }% - \renewcommand*{\GlossariesWarningNoLine}[1]{% - \PackageWarningNoLine{glossaries}{##1}% - }% - \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% - \renewcommand{\@glsshowaccsupp}{\glsshowaccsupp}% - \fi +\newcommand{\s@ifglossaryexists}[3]{% + \ifcsundef{glolist@#1}{#3}{#2}% } -\newcommand*{\glsshowtarget}[1]{% - \ifmmode - \nfss@text{\glsshowtargetfont [#1]}% - \else - \ifinner - {\glsshowtargetfont [#1]}% - \else - \glsshowtargetouter{#1}% - \fi - \fi +\newcommand*{\glsdetoklabel}[1]{#1} +\newcommand{\ifglsentryexists}[3]{% + \ifcsundef{glo@\glsdetoklabel{#1}@name}{#3}{#2}% } -\newcommand*{\glsshowtargetouter}[1]{% - \glsshowtargetsymbol\marginpar{\glsshowtargetsymbol\glsshowtargetfont #1}} -\newcommand*{\glsshowtargetsymbol}{{\tiny$\triangleright$}} -\newcommand*{\glsshowtargetfont}{\ttfamily\footnotesize} -\newcommand*{\@glsshowtarget}[1]{} -\newrobustcmd*{\@@glsshowtarget}[1]{% - \begingroup - \protected@edef\@gls@tmp{#1}% - \@onelevel@sanitize\@gls@tmp - \expandafter\glsshowtarget\expandafter{\@gls@tmp}% - \endgroup +\newcommand*{\ifglsused}[3]{% + \ifbool{glo@\glsdetoklabel{#1}@flag}{#2}{#3}% } -\newcommand*{\@glsshowaccsupp}[3]{} -\newrobustcmd*{\glsshowaccsupp}[3]{% - \ifstrempty{#1}% - {\@@glsshowtarget{/#2 (#3)}}% - {\@@glsshowtarget{/#2 (#3) [#1]}}% +\newcommand{\glsdoifexists}[2]{% + \ifglsentryexists{#1}{#2}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' + has not been defined}{You need to define a glossary entry before you + can use it.}}% } -\newcommand*{\@gls@see@noindex}{% - \PackageError{glossaries}% - {`\gls@xr@key' key may only be used after \string\makeglossaries\space - or \string\makenoidxglossaries\space (or move - \string\newglossaryentry\space - definitions into the preamble)}% - {You must use \string\makeglossaries\space - or \string\makenoidxglossaries\space before defining - any entries that have a `\gls@xr@key' key. It may - be that the `see' key has been written to the .glsdefs - file from the previous run, in which case you need to - move your definitions - to the preamble if you don't want to use - \string\makeglossaries\space - or \string\makenoidxglossaries}% +\newcommand{\glsdoifnoexists}[2]{% + \ifglsentryexists{#1}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' has already + been defined}{}}{#2}% } -\define@choicekey{glossaries.sty}{seenoindex}% - [\gls@seenoindex@val\gls@seenoindex@nr]{error,warn,ignore}{% - \ifcase\gls@seenoindex@nr - \renewcommand*{\@gls@see@noindex}{% - \PackageError{glossaries}% - {`\gls@xr@key' key may only be used after \string\makeglossaries\space - or \string\makenoidxglossaries}% - {You must use \string\makeglossaries\space - or \string\makenoidxglossaries\space before defining - any entries that have a `\gls@xr@key' key}% - }% - \or - \renewcommand*{\@gls@see@noindex}{% - \GlossariesWarning{`\gls@xr@key' key ignored}% - }% - \or - \renewcommand*{\@gls@see@noindex}{}% - \fi +\newcommand{\glsdoifexistsorwarn}[2]{% + \ifglsentryexists{#1}{#2}{% + \GlossariesWarning{Glossary entry `\glsdetoklabel{#1}' + has not been defined}% + }% } -\define@boolkey{glossaries.sty}[gls]{toc}[true]{} -\define@boolkey{glossaries.sty}[gls]{numberline}[true]{} -\ifcsundef{chapter}% - {\newcommand*{\@@glossarysec}{section}}% - {\newcommand*{\@@glossarysec}{chapter}} -\define@choicekey{glossaries.sty}{section}{part,chapter,section,% -subsection,subsubsection,paragraph,subparagraph}[section]{% - \renewcommand*{\@@glossarysec}{#1}} -\newcommand*{\@@glossarysecstar}{*} -\newcommand*{\@@glossaryseclabel}{} -\newcommand*{\glsautoprefix}{} -\define@choicekey{glossaries.sty}{numberedsection}% - [\gls@numberedsection@val\gls@numberedsection@nr]{% -false,nolabel,autolabel,nameref}[nolabel]{% - \ifcase\gls@numberedsection@nr\relax - \renewcommand*{\@@glossarysecstar}{*}% - \renewcommand*{\@@glossaryseclabel}{}% - \or - \renewcommand*{\@@glossarysecstar}{}% - \renewcommand*{\@@glossaryseclabel}{}% - \or - \renewcommand*{\@@glossarysecstar}{}% - \renewcommand*{\@@glossaryseclabel}{% - \label{\glsautoprefix\@glo@type}}% - \or - \renewcommand*{\@@glossarysecstar}{*}% - \renewcommand*{\@@glossaryseclabel}{% - \protected@edef\@currentlabelname{\glossarytoctitle}% - \label{\glsautoprefix\@glo@type}}% - \fi +\newcommand{\glsdoifexistsordo}[3]{% + \ifglsentryexists{#1}{#2}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' + has not been defined}{You need to define a glossary entry before you + can use it.}% + #3% + }% } -\@ifpackageloaded{classicthesis} -{\newcommand*{\@glossary@default@style}{index}} -{\newcommand*{\@glossary@default@style}{list}} -\define@key{glossaries.sty}{style}{% - \def\@glossary@default@style{#1}% +\newcommand{\doifglossarynoexistsordo}[3]{% + \ifglossaryexists*{#1}% + {% + \PackageError{glossaries}{Glossary type `#1' already exists}{}% + #3% + }% + {#2}% } -\newcommand*{\@gls@declareoption}[2]{% - \DeclareOptionX{#1}{#2}% - \DeclareOption{#1}{#2}% +\newrobustcmd{\ifglshaschildren}[3]{% + \glsdoifexists{#1}% + {% + \def\do@glshaschildren{#3}% + \edef\@gls@thislabel{\glsdetoklabel{#1}}% + \expandafter\forglsentries\expandafter + [\csname glo@\@gls@thislabel @type\endcsname] + {\glo@label}% + {% + \letcs\glo@parent{glo@\glo@label @parent}% + \ifdefequal\@gls@thislabel\glo@parent + {% + \def\do@glshaschildren{#2}% + \@endfortrue + }% + {}% + }% + \do@glshaschildren + }% } -\newcommand*{\glossaryentrynumbers}[1]{#1\gls@save@numberlist{#1}} -\@gls@declareoption{nonumberlist}{% - \renewcommand*{\glossaryentrynumbers}[1]{\gls@save@numberlist{#1}}% +\newcommand{\ifglshasparent}[3]{% + \glsdoifexists{#1}% + {% + \ifcsempty{glo@\glsdetoklabel{#1}@parent}{#3}{#2}% + }% } -\define@boolkey{glossaries.sty}[gls]{savenumberlist}[true]{} -\glssavenumberlistfalse -\newcommand*\@glo@seeautonumberlist{} -\@gls@declareoption{seeautonumberlist}{% - \renewcommand*{\@glo@seeautonumberlist}{% - \def\@glo@prefix{\glsnextpages}% - }% +\newcommand*{\ifglshasdesc}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@desc}% + {#3}% + {#2}% } -\define@boolkey{glossaries.sty}[gls]{esclocations}[true]{} -\glsesclocationstrue -\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}} -\@gls@declareoption{nolong}{\renewcommand*{\@gls@loadlong}{}} -\IfFileExists{supertabular.sty}{% - \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}}}{% - \newcommand*{\@gls@loadsuper}{}} -\@gls@declareoption{nosuper}{\renewcommand*{\@gls@loadsuper}{}} -\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}[=v4.46]} -\@gls@declareoption{nolist}{% - \renewcommand*{\@gls@loadlist}{% - \ifdefstring{\@glossary@default@style}{list}% - {\let\@glossary@default@style\relax}% - {}% - }% +\newcommand*{\ifglsdescsuppressed}[3]{% + \ifcsequal{glo@\glsdetoklabel{#1}@desc}{@no@post@desc}% + {#2}% + {#3}% } -\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}} -\@gls@declareoption{notree}{\renewcommand*{\@gls@loadtree}{}} -\@gls@declareoption{nostyles}{% - \renewcommand*{\@gls@loadlong}{}% - \renewcommand*{\@gls@loadsuper}{}% - \renewcommand*{\@gls@loadlist}{}% - \renewcommand*{\@gls@loadtree}{}% - \let\@glossary@default@style\relax +\newrobustcmd*{\ifglshassymbol}[3]{% + \letcs{\@glo@symbol}{glo@\glsdetoklabel{#1}@symbol}% + \ifdefempty\@glo@symbol + {#3}% + {% + \ifdefequal\@glo@symbol\@gls@default@value + {#3}% + {#2}% + }% } -\newcommand*{\glspostdescription}{% - \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi +\newrobustcmd*{\ifglshaslong}[3]{% + \letcs{\@glo@long}{glo@\glsdetoklabel{#1}@long}% + \ifdefempty\@glo@long + {#3}% + {% + \ifdefequal\@glo@long\@gls@default@value + {#3}% + {#2}% + }% } -\define@boolkey{glossaries.sty}[gls]{nopostdot}[true]{} -\glsnopostdotfalse -\define@boolkey{glossaries.sty}[gls]{nogroupskip}[true]{} -\glsnogroupskipfalse -\define@boolkey{glossaries.sty}[gls]{ucmark}[true]{} -\@ifclassloaded{memoir} -{% - \glsucmarktrue -}% -{% - \glsucmarkfalse +\newrobustcmd*{\ifglshasshort}[3]{% + \letcs{\@glo@short}{glo@\glsdetoklabel{#1}@short}% + \ifdefempty\@glo@short + {#3}% + {% + \ifdefequal\@glo@short\@gls@default@value + {#3}% + {#2}% + }% } -\newcommand*{\@gls@define@glossaryentrycounter}{% - \ifglsentrycounter - \ifundef\c@glossaryentry +\newrobustcmd*{\ifglshasfield}[4]{% + \glsdoifexists{#2}% + {% + \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@#1}% + \ifdef\@glo@thisvalue {% - \ifx\@gls@counterwithin\@empty - \newcounter{glossaryentry}% - \else - \newcounter{glossaryentry}[\@gls@counterwithin]% - \fi - \def\theHglossaryentry{\currentglossary.\theglossaryentry}% + \ifdefempty\@glo@thisvalue + {% + #4% + }% + {% + \ifdefequal\@glo@thisvalue\@gls@default@value + {% + #4% + }% + {% + \let\glscurrentfieldvalue\@glo@thisvalue + #3% + }% + }% }% - {}% - \fi + {% + \@gls@fetchfield{\@gls@thisfield}{#1}% + \ifdef\@gls@thisfield + {% + \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@\@gls@thisfield}% + \ifdefempty\@glo@thisvalue + {% + #4% + }% + {% + \ifdefequal\@glo@thisvalue\@gls@default@value + {% + #4% + }% + {% + \let\glscurrentfieldvalue\@glo@thisvalue + #3% + }% + }% + }% + {% + \GlossariesWarning{Unknown entry field `#1'}% + #4% + }% + }% + }% } -\define@boolkey{glossaries.sty}[gls]{entrycounter}[true]{} -\glsentrycounterfalse -\define@key{glossaries.sty}{counterwithin}{% - \renewcommand*{\@gls@counterwithin}{#1}% - \glsentrycountertrue - \@gls@define@glossaryentrycounter +\newcommand*{\glscurrentfieldvalue}{} +\newcommand*{\@glo@types}{,} +\newcommand*\@gls@provide@newglossary{% + \protected@write\@auxout{}{\string\providecommand\string\@newglossary[4]{}}% + \let\@gls@provide@newglossary\relax } -\newcommand*{\@gls@counterwithin}{} -\newcommand{\@gls@define@glossarysubentrycounter}{% - \ifundef\c@glossarysubentry - {% - \ifglssubentrycounter - \ifglsentrycounter - \newcounter{glossarysubentry}[glossaryentry]% - \else - \newcounter{glossarysubentry}% - \fi - \def\theHglossarysubentry{\currentglossary.\currentglssubentry.\theglossarysubentry}% - \fi - }% - {}% +\newcommand*{\defglsentryfmt}[2][\glsdefaulttype]{% + \csgdef{gls@#1@entryfmt}{#2}% } -\define@boolkey{glossaries.sty}[gls]{subentrycounter}[true]{} -\glssubentrycounterfalse -\newcommand*{\@glo@default@sorttype}{standard} -\define@choicekey{glossaries.sty}{sort}{standard,def,use,none}{% - \renewcommand*{\@glo@default@sorttype}{#1}% - \csname @gls@setupsort@#1\endcsname +\newcommand*{\gls@doentryfmt}[1]{\csuse{gls@#1@entryfmt}} +\newcommand*{\@gls@forbidtexext}[1]{% + \ifboolexpr{test {\ifdefstring{#1}{tex}} + or test {\ifdefstring{#1}{TEX}}} + {% + \def#1{nottex}% + \PackageError{glossaries}% + {Forbidden `.tex' extension replaced with `.nottex'}% + {I'm sorry, I can't allow you to do something so reckless.\MessageBreak + Don't use `.tex' as an extension for a temporary file.}% + }% + {% + }% } -\newcommand*{\glsprestandardsort}[3]{% - \glsdosanitizesort +\newcommand*{\gls@gobbleopt}{\new@ifnextchar[{\@gls@gobbleopt}{}} +\def\@gls@gobbleopt[#1]{} +\newcommand*{\newglossary}{\@ifstar\s@newglossary\ns@newglossary} +\newcommand*{\s@newglossary}[2]{% + \ns@newglossary[#1-glg]{#1}{#1-gls}{#1-glo}{#2}% } -\newcommand*{\@glo@check@sortallowed}[1]{} -\newcommand*{\@gls@setupsort@standard}{% - \def\do@glo@storeentry{\@glo@storeentry}% - \def\@gls@defsortcount##1{}% - \def\@gls@defsort##1##2{% - \ifx\@glo@sort\@glsdefaultsort - \let\@glo@sort\@glo@name - \fi - \let\glsdosanitizesort\@gls@sanitizesort - \glsprestandardsort{\@glo@sort}{##1}{##2}% - \expandafter\protected@xdef\csname glo@##2@sort\endcsname{\@glo@sort}% +\newcommand*{\ns@newglossary}[5][glg]{% + \doifglossarynoexistsordo{#2}% + {% + \ifundef\glsdefaulttype + {% + \gdef\glsdefaulttype{#2}% + }{}% + \toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}% + \expandafter\gdef\csname glolist@#2\endcsname{,}% + \expandafter\edef\csname @glotype@#2@log\endcsname{#1}% + \expandafter\edef\csname @glotype@#2@in\endcsname{#3}% + \expandafter\edef\csname @glotype@#2@out\endcsname{#4}% + \expandafter\@gls@forbidtexext\csname @glotype@#2@log\endcsname + \expandafter\@gls@forbidtexext\csname @glotype@#2@in\endcsname + \expandafter\@gls@forbidtexext\csname @glotype@#2@out\endcsname + \expandafter\def\csname @glotype@#2@title\endcsname{#5}% + \@gls@provide@newglossary + \protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}% + \ifcsundef{gls@#2@entryfmt}% + {% + \defglsentryfmt[#2]{\glsentryfmt}% }% - \def\@gls@setsort##1{}% - \let\@glo@check@sortallowed\@gobble + {}% + \@gls@defsortcount{#2}% + \@ifnextchar[{\@gls@setcounter{#2}}% + {\@gls@setcounter{#2}[\glscounter]}% + }% + {% + \gls@gobbleopt + }% } -\@gls@setupsort@standard -\newcommand*\glssortnumberfmt[1]{% - \ifnum#1<100000 0\fi - \ifnum#1<10000 0\fi - \ifnum#1<1000 0\fi - \ifnum#1<100 0\fi - \ifnum#1<10 0\fi - \number#1% +\newcommand*{\altnewglossary}[3]{% + \newglossary[#2-glg]{#1}{#2-gls}{#2-glo}{#3}% } -\newcommand*{\@gls@setupsort@def}{% - \def\do@glo@storeentry{\@glo@storeentry}% - \def\@gls@defsortcount##1{% - \expandafter\global - \expandafter\newcount\csname glossary@##1@sortcount\endcsname - }% - \def\@gls@defsort##1##2{% - \ifcsundef{glossary@##1@sortcount}% - {\@gls@defsortcount{##1}}% - {}% - \expandafter\global\expandafter - \advance\csname glossary@##1@sortcount\endcsname by 1\relax - \expandafter\protected@xdef\csname glo@##2@sort\endcsname{% - \expandafter\glssortnumberfmt - {\csname glossary@##1@sortcount\endcsname}}% - }% - \def\@gls@setsort##1{}% - \let\@glo@check@sortallowed\@gobble +\@onlypreamble{\newglossary} +\@onlypremakeg\newglossary +\newcommand*{\@newglossary}[4]{} +\def\@gls@setcounter#1[#2]{% + \expandafter\def\csname @glotype@#1@counter\endcsname{#2}% + \ifglsxindy + \GlsAddXdyCounters{#2}% + \fi } -\newcommand*{\@gls@setupsort@use}{% - \let\do@glo@storeentry\@gobble - \def\@gls@defsortcount##1{% - \expandafter\global - \expandafter\newcount\csname glossary@##1@sortcount\endcsname +\newcommand*{\@gls@getcounter}[1]{% + \csname @glotype@#1@counter\endcsname +} +\glsdefmain +\@gls@do@acronymsdef +\@gls@do@symbolsdef +\@gls@do@numbersdef +\@gls@do@indexdef +\newcommand*{\newignoredglossary}[1]{% + \ifdefempty\@ignored@glossaries + {% + \edef\@ignored@glossaries{#1}% }% - \def\@gls@defsort##1##2{% - \expandafter\gdef\csname glo@##2@sort\endcsname{}% + {% + \eappto\@ignored@glossaries{,#1}% }% - \def\@gls@setsort##1{% - \edef\@glo@parent{\csname glo@##1@parent\endcsname}% - \ifx\@glo@parent\@empty - \else - \expandafter\@gls@setsort\expandafter{\@glo@parent}% - \fi - \edef\@glo@type{\csname glo@##1@type\endcsname}% - \edef\@gls@tmp{\csname glo@##1@sort\endcsname}% - \ifx\@gls@tmp\@empty - \expandafter\global\expandafter - \advance\csname glossary@\@glo@type @sortcount\endcsname by 1\relax - \expandafter\protected@xdef\csname glo@##1@sort\endcsname{% - \expandafter\glssortnumberfmt - {\csname glossary@\@glo@type @sortcount\endcsname}}% - \@glo@storeentry{##1}% - \fi + \csgdef{glolist@#1}{,}% + \ifcsundef{gls@#1@entryfmt}% + {% + \defglsentryfmt[#1]{\glsentryfmt}% }% - \let\@glo@check@sortallowed\@gobble -} -\newcommand*{\@gls@setupsort@none}{% - \def\do@glo@storeentry##1{}% - \def\@gls@defsortcount##1{}% - \def\@gls@defsort##1##2{% - \expandafter\global\expandafter\let\csname glo@##2@sort\endcsname\@glo@sort + {}% + \ifdefempty\@gls@nohyperlist + {% + \renewcommand*{\@gls@nohyperlist}{#1}% }% - \def\@gls@setsort##1{}% - \renewcommand\@glo@check@sortallowed[1]{\PackageError{glossaries} - {Option sort=none not allowed with \string##1}% - {(Use sort=def instead)}}% -} -\newcommand*{\glsdefmain}{% - \if@gls@docloaded - \newglossary[glg2]{main}{gls2}{glo2}{\glossaryname}% - \else - \newglossary{main}{gls}{glo}{\glossaryname}% - \fi - \newcommand*{\gls@tr@set@main@toctitle}{% - \translatelet{\glossarytoctitle}{Glossary}% + {% + \eappto\@gls@nohyperlist{,#1}% }% } -\newcommand*{\glsdefaulttype}{main} -\newcommand*{\acronymtype}{\glsdefaulttype} -\@gls@declareoption{nomain}{% - \let\glsdefaulttype\relax - \renewcommand*{\glsdefmain}{}% -} -\define@boolkey{glossaries.sty}[gls]{acronym}[true]{% - \ifglsacronym - \renewcommand{\@gls@do@acronymsdef}{% - \DeclareAcronymList{acronym}% - \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% - \renewcommand*{\acronymtype}{acronym}% - \newcommand*{\gls@tr@set@acronym@toctitle}{% - \translatelet{\glossarytoctitle}{Acronyms}% - }% - }% - \else - \let\@gls@do@acronymsdef\relax - \fi -} -\AtBeginDocument{% - \ifglsacronym - \ifbool{glscompatible-3.07}% - {}% - {% - \providecommand*{\printacronyms}[1][]{% - \printglossary[type=\acronymtype,#1]}% - }% - \fi +\newcommand*{\@ignored@glossaries}{} +\newcommand*{\ifignoredglossary}[3]{% + \edef\@gls@igtype{#1}% + \expandafter\DTLifinlist\expandafter + {\@gls@igtype}{\@ignored@glossaries}{#2}{#3}% } -\newcommand*{\@gls@do@acronymsdef}{} -\@gls@declareoption{acronyms}{% - \glsacronymtrue - \def\@gls@do@acronymsdef{% - \DeclareAcronymList{acronym}% - \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% - \renewcommand*{\acronymtype}{acronym}% - \newcommand*{\gls@tr@set@acronym@toctitle}{% - \translatelet{\glossarytoctitle}{Acronyms}% - }% - }% +\define@key{glossentry}{name}{% +\def\@glo@name{#1}% } -\newcommand*{\@glsacronymlists}{} -\newcommand*{\@addtoacronymlists}[1]{% - \ifx\@glsacronymlists\@empty - \protected@xdef\@glsacronymlists{#1}% - \else - \protected@xdef\@glsacronymlists{\@glsacronymlists,#1}% - \fi +\define@key{glossentry}{description}{% +\def\@glo@desc{#1}% } -\newcommand*{\DeclareAcronymList}[1]{% - \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}% +\define@key{glossentry}{descriptionplural}{% +\def\@glo@descplural{#1}% } -\newcommand{\glsIfListOfAcronyms}[1]{% - \edef\@do@gls@islistofacronyms{% - \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}% - \@do@gls@islistofacronyms +\define@key{glossentry}{sort}{% +\def\@glo@sort{#1}} +\define@key{glossentry}{text}{% +\def\@glo@text{#1}% } -\newcommand{\@gls@islistofacronyms}[4]{% - \def\gls@islistofacronyms##1,#1,##2\end@gls@islistofacronyms{% - \def\@gls@before{##1}\def\@gls@after{##2}}% - \gls@islistofacronyms,#2,#1,\@nil\end@gls@islistofacronyms - \ifx\@gls@after\@nnil - #4% - \else - #3% - \fi +\define@key{glossentry}{plural}{% +\def\@glo@plural{#1}% } -\newif\if@glsisacronymlist -\newcommand*{\gls@checkisacronymlist}[1]{% - \glsIfListOfAcronyms{#1}% - {\@glsisacronymlisttrue}{\@glsisacronymlistfalse}% +\define@key{glossentry}{first}{% +\def\@glo@first{#1}% } -\newcommand*{\SetAcronymLists}[1]{% - \renewcommand*{\@glsacronymlists}{#1}% +\define@key{glossentry}{firstplural}{% +\def\@glo@firstplural{#1}% } -\define@key{glossaries.sty}{acronymlists}{% - \DeclareAcronymList{#1}% +\newcommand*{\@gls@default@value}{\relax} +\define@key{glossentry}{symbol}{% +\def\@glo@symbol{#1}% } -\newcommand{\glscounter}{page} -\define@key{glossaries.sty}{counter}{% - \renewcommand*{\glscounter}{#1}% +\define@key{glossentry}{symbolplural}{% +\def\@glo@symbolplural{#1}% } -\newcommand*{\@gls@nohyperlist}{} -\newcommand*{\GlsDeclareNoHyperList}[1]{% - \ifdefempty\@gls@nohyperlist +\define@key{glossentry}{type}{% +\def\@glo@type{#1}} +\define@key{glossentry}{counter}{% + \ifcsundef{c@#1}% {% - \renewcommand*{\@gls@nohyperlist}{#1}% + \PackageError{glossaries}% + {There is no counter called `#1'}% + {% + The counter key should have the name of a valid counter + as its value% + }% }% {% - \appto\@gls@nohyperlist{,#1}% + \def\@glo@counter{#1}% }% } -\define@key{glossaries.sty}{nohypertypes}{% - \GlsDeclareNoHyperList{#1}% +\define@key{glossentry}{see}{% + \gls@set@xr@key{see}{\@glo@see}{#1}% } -\newcommand*{\GlossariesWarning}[1]{% - \PackageWarning{glossaries}{#1}% +\newcommand*{\gls@set@xr@key}[3]{% + \renewcommand*{\gls@xr@key}{#1}% + \gls@checkseeallowed + \def#2{#3}% + \@glo@seeautonumberlist } -\newcommand*{\GlossariesWarningNoLine}[1]{% - \PackageWarningNoLine{glossaries}{#1}% +\newcommand*{\gls@xr@key}{see} +\newcommand*{\gls@checkseeallowed}{% + \@gls@see@noindex } -\newcommand{\glosortentrieswarning}{% - \typeout{Using TeX to sort glossary entries---this may - take a while}% +\newcommand*{\gls@checkseeallowed@preambleonly}{% + \GlossariesWarning{glossaries}% + {`\gls@xr@key' key doesn't have any effect when used in the document + environment. Move the definition to the preamble + after \string\makeglossaries\space + or \string\makenoidxglossaries}% } -\@gls@declareoption{nowarn}{% - \if@gls@debug - \GlossariesWarning{Warnings can't be suppressed in debug mode}% +\define@key{glossentry}{parent}{% +\def\@glo@parent{#1}} +\define@choicekey{glossentry}{nonumberlist}% + [\gls@nonumberlist@val\gls@nonumberlist@nr]{true,false}[true]% +{% + \ifcase\gls@nonumberlist@nr\relax + \def\@glo@prefix{\glsnonextpages}% + \@gls@savenonumberlist{true}% \else - \renewcommand*{\GlossariesWarning}[1]{}% - \renewcommand*{\GlossariesWarningNoLine}[1]{}% - \renewcommand*{\glosortentrieswarning}{}% - \renewcommand*{\@gls@missinglang@warn}[2]{}% + \def\@glo@prefix{\glsnextpages}% + \@gls@savenonumberlist{false}% \fi } -\newcommand*{\@gls@missinglang@warn}[2]{% - \PackageWarningNoLine{glossaries}% - {No language module detected for `#1'.\MessageBreak - Language modules need to be installed separately.\MessageBreak - Please check on CTAN for a bundle called\MessageBreak - `glossaries-#2' or similar}% +\newcommand*{\@gls@savenonumberlist}[1]{} +\newcommand*{\@gls@initnonumberlist}{}% +\newcommand*{\@gls@storenonumberlist}[1]{} +\newcommand*{\@gls@enablesavenonumberlist}{% + \renewcommand*{\@gls@initnonumberlist}{% + \undef\@glo@nonumberlist + }% + \renewcommand*{\@gls@savenonumberlist}[1]{% + \def\@glo@nonumberlist{##1}% + }% + \renewcommand*{\@gls@storenonumberlist}[1]{% + \ifdef\@glo@nonumberlist + {% + \cslet{glo@\glsdetoklabel{##1}@nonumberlist}{\@glo@nonumberlist}% + }% + {}% + }% + \appto\@gls@keymap{,{nonumberlist}{nonumberlist}}% } -\@gls@declareoption{nolangwarn}{% - \renewcommand*{\@gls@missinglang@warn}[2]{}% +\define@key{glossentry}{user1}{% + \def\@glo@useri{#1}% } -\newcommand*{\@gls@warnonglossdefined}{% - \GlossariesWarning{Overriding \string\printglossary}% +\define@key{glossentry}{user2}{% + \def\@glo@userii{#1}% } -\newcommand*{\@gls@warnontheglossdefined}{% - \GlossariesWarning{Overriding `theglossary' environment}% +\define@key{glossentry}{user3}{% + \def\@glo@useriii{#1}% } -\@gls@declareoption{noredefwarn}{% - \renewcommand*{\@gls@warnonglossdefined}{}% - \renewcommand*{\@gls@warnontheglossdefined}{}% +\define@key{glossentry}{user4}{% + \def\@glo@useriv{#1}% } -\newcommand*{\@gls@sanitizedesc}{% +\define@key{glossentry}{user5}{% + \def\@glo@userv{#1}% } -\newcommand*{\glssetexpandfield}[1]{% - \csdef{gls@assign@#1@field}##1##2{% - \@@gls@expand@field{##1}{#1}{##2}% - }% +\define@key{glossentry}{user6}{% + \def\@glo@uservi{#1}% } -\newcommand*{\glssetnoexpandfield}[1]{% - \csdef{gls@assign@#1@field}##1##2{% - \@@gls@noexpand@field{##1}{#1}{##2}% - }% +\define@key{glossentry}{short}{% + \def\@glo@short{#1}% } -\glssetexpandfield{type} -\glssetnoexpandfield{desc} -\glssetnoexpandfield{descplural} -\newcommand*{\@gls@sanitizename}{} -\glssetnoexpandfield{name} -\newcommand*{\@gls@sanitizesymbol}{} -\glssetnoexpandfield{symbol} -\glssetnoexpandfield{symbolplural} -\newcommand*{\@gls@sanitizesort}{% - \ifglssanitizesort - \@@gls@sanitizesort - \else - \@@gls@nosanitizesort - \fi +\define@key{glossentry}{shortplural}{% + \def\@glo@shortpl{#1}% } -\newcommand*\@@gls@sanitizesort{% - \@onelevel@sanitize\@glo@sort +\define@key{glossentry}{long}{% + \def\@glo@long{#1}% } -\newcommand*{\@@gls@nosanitizesort}{} -\newcommand*\@gls@noidx@sanitizesort{% - \ifdefvoid\@glo@sort - {}% +\define@key{glossentry}{longplural}{% + \def\@glo@longpl{#1}% +} +\newcommand*{\@glsnoname}{% + \PackageError{glossaries}{name key required in + \string\newglossaryentry\space for entry `\@glo@label'}{You + haven't specified the entry name}} +\newcommand*\@glsnodesc{% + \PackageError{glossaries} {% - \expandafter\@@gls@noidx@sanitizesort\@glo@sort\gls@end@sanitizesort + description key required in \string\newglossaryentry\space + for entry `\@glo@label'% }% -} -\def\@@gls@noidx@sanitizesort#1#2\gls@end@sanitizesort{% - \def\@glo@sort{#1#2}% - \@onelevel@sanitize\@glo@sort -} -\newcommand*{\@@gls@noidx@nosanitizesort}{% - \ifdefvoid\@glo@sort - {}% {% - \expandafter\@@gls@noidx@no@sanitizesort\@glo@sort\gls@end@sanitizesort + You haven't specified the entry description% }% -} -\def\@@gls@noidx@no@sanitizesort#1#2\gls@end@sanitizesort{% - \bgroup - \glsnoidxstripaccents - \protected@xdef\@@glo@sort{#1#2}% - \egroup - \let\@glo@sort\@@glo@sort -} -\newcommand*\glsnoidxstripaccents{% - \let\IeC\@firstofone - \let\add@accent@\@secondoftwo - \let\@text@composite@x\@secondoftwo - \let\@tabacckludge\@secondoftwo - \expandafter\def\csname \encodingdefault-cmd\endcsname##1##2##3{##3}% - \expandafter\def\csname OT1-cmd\endcsname##1##2##3{##3}% - \expandafter\def\csname T1-cmd\endcsname##1##2##3{##3}% - \expandafter\def\csname PD1-cmd\endcsname##1##2##3{##3}% - \let\'\@firstofone - \let\`\@firstofone - \let\^\@firstofone - \let\"\@firstofone - \let\u\@firstofone - \let\t\@firstofone - \let\d\@firstofone - \let\r\@firstofone - \let\=\@firstofone - \let\.\@firstofone - \let\~\@firstofone - \let\v\@firstofone - \let\H\@firstofone - \let\c\@firstofone - \let\b\@firstofone - \let\a\@secondoftwo - \def\AE{AE}% - \def\ae{ae}% - \def\OE{OE}% - \def\oe{oe}% - \def\AA{AA}% - \def\aa{aa}% - \def\L{L}% - \def\l{l}% - \def\O{O}% - \def\o{o}% - \def\SS{SS}% - \def\ss{ss}% - \def\th{th}% - \def\TH{TH}% - \def\dh{dh}% - \def\DH{DH}% -} -\@ifl@t@r\fmtversion{2019/10/01} -{% - \appto\glsnoidxstripaccents{\let\UTFviii@two@octets\UTFviii@two@octets@combine}% -} -{} -\define@boolkey[gls]{sanitize}{description}[true]{% - \GlossariesWarning{sanitize={description} package option deprecated}% - \ifgls@sanitize@description - \glssetnoexpandfield{desc}% - \glssetnoexpandfield{descplural}% - \else - \glssetexpandfield{desc}% - \glssetexpandfield{descplural}% - \fi -} -\define@boolkey[gls]{sanitize}{name}[true]{% - \GlossariesWarning{sanitize={name} package option deprecated}% - \ifgls@sanitize@name - \glssetnoexpandfield{name}% - \else - \glssetexpandfield{name}% - \fi -} -\define@boolkey[gls]{sanitize}{symbol}[true]{% - \GlossariesWarning{sanitize={symbol} package option deprecated}% - \ifgls@sanitize@symbol - \glssetnoexpandfield{symbol}% - \glssetnoexpandfield{symbolplural}% - \else - \glssetexpandfield{symbol}% - \glssetexpandfield{symbolplural}% - \fi -} -\define@boolkey{glossaries.sty}[gls]{sanitizesort}[true]{% - \ifglssanitizesort - \glssetnoexpandfield{sortvalue}% - \renewcommand*{\@gls@noidx@setsanitizesort}{% - \glssanitizesorttrue - \glssetnoexpandfield{sortvalue}% - }% +}% +\newcommand*{\@glsdefaultplural}{} +\newcommand*{\@gls@missingnumberlist}[1]{% + ??% + \ifglssavenumberlist + \GlossariesWarning{Missing number list for entry `#1'. + Maybe makeglossaries + rerun required}% \else - \glssetexpandfield{sortvalue}% - \renewcommand*{\@gls@noidx@setsanitizesort}{% - \glssanitizesortfalse - \glssetexpandfield{sortvalue}% + \PackageError{glossaries}% + {Package option `savenumberlist=true' required}% + {% + You must use the `savenumberlist' package option + to reference location lists.% }% \fi } -\glssanitizesorttrue -\glssetnoexpandfield{sortvalue}% -\newcommand*{\@gls@noidx@setsanitizesort}{% - \glssanitizesortfalse - \glssetexpandfield{sortvalue}% -} -\define@choicekey[gls]{sanitize}{sort}{true,false}[true]{% - \setbool{glssanitizesort}{#1}% - \ifglssanitizesort - \glssetnoexpandfield{sortvalue}% - \else - \glssetexpandfield{sortvalue}% - \fi - \GlossariesWarning{sanitize={sort} package option - deprecated. Use sanitizesort instead}% +\newcommand*{\@glsdefaultsort}{\@glo@name} +\newcount\gls@level +\newcommand{\@@gls@noexpand@field}[3]{% + \expandafter\global\expandafter + \let\csname glo@#1@#2\endcsname#3% } -\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,name=true]{% - \ifthenelse{\equal{#1}{none}}% +\newcommand{\@gls@noexpand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} {% - \GlossariesWarning{sanitize package option deprecated}% - \glssetexpandfield{name}% - \glssetexpandfield{symbol}% - \glssetexpandfield{symbolplural}% - \glssetexpandfield{desc}% - \glssetexpandfield{descplural}% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% }% {% - \setkeys[gls]{sanitize}{#1}% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \@@gls@noexpand@field{#2}{#3}{\@gls@value}% + }% + {% + \@@gls@noexpand@field{#2}{#3}{#4}% + }% }% } -\newif\ifglstranslate -\newcommand*\@gls@usetranslator{% - \@ifpackageloaded{polyglossia}% +\newcommand{\@@gls@expand@field}[3]{% + \expandafter + \protected@xdef\csname glo@#1@#2\endcsname{#3}% +} +\newcommand{\@gls@expand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} {% - \let\glsifusetranslator\@secondoftwo + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \expandafter\@gls@startswithexpandonce#4\relax\relax\gls@endcheck + {% + \@@gls@expand@field{#2}{#3}{#4}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% + }% }% {% - \@ifpackageloaded{babel}% + \ifdefequal{#4}{\@gls@default@value}% {% - \IfFileExists{translator.sty}% - {% - \RequirePackage{translator}% - \let\glsifusetranslator\@firstoftwo - }% - {}% + \@@gls@expand@field{#2}{#3}{#1}% }% - {}% - }% -} -\newcommand{\glsifusedtranslatordict}[3]{% - \glsifusetranslator - {\ifcsdef{ver@glossaries-dictionary-#1.dict}{#2}{#3}}% - {#3}% -} -\@gls@declareoption{notranslate}{% - \glstranslatefalse - \let\@gls@usetranslator\relax - \let\glsifusetranslator\@secondoftwo -} -\define@choicekey{glossaries.sty}{translate}% - [\gls@translate@val\gls@translate@nr]% - {true,false,babel}[true]% - {% - \ifcase\gls@translate@nr\relax - \glstranslatetrue - \renewcommand*\@gls@usetranslator{% - \@ifpackageloaded{polyglossia}% - {% - \let\glsifusetranslator\@secondoftwo - }% - {% - \@ifpackageloaded{babel}% - {% - \IfFileExists{translator.sty}% - {% - \RequirePackage{translator}% - \let\glsifusetranslator\@firstoftwo - }% - {}% - }% - {}% - }% - }% - \or - \glstranslatefalse - \let\@gls@usetranslator\relax - \let\glsifusetranslator\@secondoftwo - \or - \glstranslatetrue - \let\@gls@usetranslator\relax - \let\glsifusetranslator\@secondoftwo - \fi - } -\glstranslatefalse -\let\glsifusetranslator\@secondoftwo -\@ifpackageloaded{translator}% -{% - \glstranslatetrue - \let\glsifusetranslator\@firstoftwo -}% -{% - \@for\gls@thissty:=tracklang,babel,ngerman,polyglossia\do - { - \@ifpackageloaded{\gls@thissty}% {% - \glstranslatetrue - \@endfortrue + \@@gls@expand@field{#2}{#3}{#4}% }% - {}% - } -} -\define@boolkey{glossaries.sty}[gls]{indexonlyfirst}[true]{} -\glsindexonlyfirstfalse -\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{} -\glshyperfirsttrue -\newcommand*{\@gls@setacrstyle}{} -\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% - \ifbool{glsacrdescription}% - {}% - {% - \renewcommand*{\@gls@sanitizedesc}{}% }% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } -\define@boolkey{glossaries.sty}[glsacr]{description}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +\def\@gls@expandonce{\expandonce} +\def\@gls@startswithexpandonce#1#2\gls@endcheck#3#4{% + \def\@gls@tmp{#1}% + \ifdefequal{\@gls@expandonce}{\@gls@tmp}{#3}{#4}% } -\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +\let\gls@assign@field\@gls@expand@fields +\newcommand*{\glsexpandfields}{% + \let\gls@assign@field\@gls@expand@fields } -\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +\newcommand*{\glsnoexpandfields}{% + \let\gls@assign@field\@gls@noexpand@fields } -\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% - \renewcommand*{\@gls@sanitizesymbol}{}% - \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +\newrobustcmd{\newglossaryentry}[2]{% + \glsdoifnoexists{#1}% + {% + \gls@defglossaryentry{#1}{#2}% + }% } -\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{} -\newcommand*{\glsorder}{word} -\newcommand*{\@glsorder}[1]{} -\define@choicekey{glossaries.sty}{order}{word,letter}{% - \def\glsorder{#1}} -\newif\ifglsxindy -\glsxindyfalse -\@gls@declareoption{makeindex}{\glsxindyfalse} -\define@boolkey[gls]{xindy}{glsnumbers}[true]{} -\gls@xindy@glsnumberstrue -\def\@xdy@main@language{\languagename}% -\define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}} -\ifcsundef{inputencodingname}{% - \def\gls@codepage{}}{% - \def\gls@codepage{\inputencodingname} +\newcommand*{\gls@defdocnewglossaryentry}{% + \let\gls@checkseeallowed\gls@checkseeallowed@preambleonly + \let\newglossaryentry\new@glossaryentry } -\define@key[gls]{xindy}{codepage}{\def\gls@codepage{#1}} -\define@key{glossaries.sty}{xindy}[]{% - \glsxindytrue - \setkeys[gls]{xindy}{#1}% +\newrobustcmd{\provideglossaryentry}[2]{% + \ifglsentryexists{#1}% + {}% + {% + \gls@defglossaryentry{#1}{#2}% + }% } -\@gls@declareoption{xindygloss}{% - \glsxindytrue +\@onlypreamble{\provideglossaryentry} +\newrobustcmd{\new@glossaryentry}[2]{% + \ifundef\@gls@deffile + {% + \global\newwrite\@gls@deffile + \immediate\openout\@gls@deffile=\jobname.glsdefs + }% + {}% + \ifglsentryexists{#1}{}% + {% + \gls@defglossaryentry{#1}{#2}% + }% + \@gls@writedef{#1}% } -\@gls@declareoption{xindynoglsnumbers}{% - \glsxindytrue - \gls@xindy@glsnumbersfalse +\AtBeginDocument{\gls@begindocdefs} +\AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} +\newcommand*{\gls@begindocdefs}{% + \@gls@enablesavenonumberlist + \edef\@gls@restoreat{\noexpand\catcode`\noexpand\@=\number\catcode`\@\relax}% + \makeatletter + \InputIfFileExists{\jobname.glsdefs}{}{}% + \@gls@restoreat + \undef\@gls@restoreat + \gls@defdocnewglossaryentry } -\providecommand{\@domakeglossaries}[1]{#1} -\@gls@declareoption{disablemakegloss}{% - \ifdefequal\makeglossaries\@no@makeglossaries +\newcommand*{\@gls@writedef}[1]{% + \immediate\write\@gls@deffile {% - \GlossariesWarning{Option `disablemakegloss' has no effect - (\string\makenoidxglossaries\space has already been used)}% + \string\ifglsentryexists{#1}{}\glspercentchar^^J% + \expandafter\@gobble\string\{\glspercentchar^^J% + \string\gls@defglossaryentry{\glsdetoklabel{#1}}\glspercentchar^^J% + \expandafter\@gobble\string\{\glspercentchar% }% + \@for\@gls@map:=\@gls@keymap\do {% - \ifdefequal\@makeglossary\@gobble - {% - \GlossariesWarning{Option `disablemakegloss' has no effect - (\string\makeglossaries\space has already been used)}% - }% + \letcs\glo@value{glo@\glsdetoklabel{#1}@\expandafter\@secondoftwo\@gls@map}% + \ifdef\glo@value {% - \renewcommand{\@domakeglossaries}[1]{% - \PackageInfo{glossaries}{\string\makeglossaries\space and - \string\makenoidxglossaries\space have been disabled}% + \@onelevel@sanitize\glo@value + \immediate\write\@gls@deffile + {% + \expandafter\@firstoftwo\@gls@map + =\expandafter\@gobble\string\{\glo@value\expandafter\@gobble\string\},% + \glspercentchar }% }% + {}% + }% + \glswritedefhook + \immediate\write\@gls@deffile + {% + \glspercentchar^^J% + \expandafter\@gobble\string\}\glspercentchar^^J% + \expandafter\@gobble\string\}\glspercentchar% }% } -\@gls@declareoption{restoremakegloss}{% - \ifdefequal\makeglossaries\@no@makeglossaries +\newcommand*{\@gls@keymap}{% + {name}{name},% + {sort}{sortvalue},% unescaped sort value + {type}{type},% + {first}{first},% + {firstplural}{firstpl},% + {text}{text},% + {plural}{plural},% + {description}{desc},% + {descriptionplural}{descplural},% + {symbol}{symbol},% + {symbolplural}{symbolplural},% + {user1}{useri},% + {user2}{userii},% + {user3}{useriii},% + {user4}{useriv},% + {user5}{userv},% + {user6}{uservi},% + {long}{long},% + {longplural}{longpl},% + {short}{short},% + {shortplural}{shortpl},% + {counter}{counter},% + {parent}{parent}% +} +\newcommand*{\@gls@fetchfield}[2]{% + \edef\@gls@thisval{#2}% + \@for\@gls@map:=\@gls@keymap\do{% + \edef\@this@key{\expandafter\@firstoftwo\@gls@map}% + \ifdefequal{\@this@key}{\@gls@thisval}% + {% + \edef#1{\expandafter\@secondoftwo\@gls@map}% + \@endfortrue + }% + {}% + }% +} +\newcommand*{\glsaddstoragekey}{\@ifstar\@sglsaddstoragekey\@glsaddstoragekey} +\newcommand*{\@sglsaddstoragekey}[1]{% + \key@ifundefined{glossentry}{#1}% {% - \GlossariesWarning{Option `restoremakegloss' has no effect - (\string\makenoidxglossaries\space has already been used)}% + \expandafter\newcommand\expandafter*\expandafter + {\csname gls@assign@#1@field\endcsname}[2]{% + \@@gls@expand@field{##1}{#1}{##2}% + }% }% + {}% + \@glsaddstoragekey{#1}% +} +\newcommand*{\@glsaddstoragekey}[3]{% + \key@ifundefined{glossentry}{#1}% {% - \ifdefequal\@makeglossary\@gobble - {% - \GlossariesWarning{Option `restoremakegloss' has no effect - (\string\makeglossaries\space has already been used)}% - }% - {% - \PackageInfo{glossaries}{\string\makeglossaries\space and - \string\makenoidxglossaries\space have been restored}% - \let\@domakeglossaries\@firstofone + \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% + \appto\@gls@keymap{,{#1}{#1}}% + \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% + \appto\@newglossaryentryposthook{% + \letcs{\@glo@tmp}{@glo@#1}% + \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% }% + \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% + }% + {% + \PackageError{glossaries}{Key `#1' already exists}{}% }% } -\newcommand*{\@do@write@glslabels}{% - \AtEndDocument{\@@do@write@glslabels}% - \let\@do@write@glslabels\relax -} -\newcommand*{\@@do@write@glslabels}{% - \newwrite\@gls@labelsfile - \immediate\openout\@gls@labelsfile=\jobname.glslabels - \forallglsentries[\@glo@types,\@ignored@glossaries]{\@glsentry}% - {\ifdefempty{\@glsentry}{}{\immediate\write\@gls@labelsfile{\@glsentry}}}% - \immediate\closeout\@gls@labelsfile +\newcommand*{\glsaddkey}{\@ifstar\@sglsaddkey\@glsaddkey} +\newcommand*{\@sglsaddkey}[1]{% + \key@ifundefined{glossentry}{#1}% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname gls@assign@#1@field\endcsname}[2]{% + \@@gls@expand@field{##1}{#1}{##2}% + }% + }% + {}% + \@glsaddkey{#1}% } -\@gls@declareoption{writeglslabels}{\@do@write@glslabels} -\newif\ifglsautomake -\newcommand{\gls@automake@nr}{1} -\define@choicekey{glossaries.sty}{automake}% - [\gls@automake@val\gls@automake@nr]{true,false,immediate}[true]{% - \ifnum\gls@automake@nr=1\relax - \glsautomakefalse - \else - \glsautomaketrue - \fi - \ifglsautomake - \renewcommand*{\@gls@doautomake}{% - \PackageError{glossaries}{You must use - \string\makeglossaries\space with automake=true} - {% - Either remove the automake=true setting or - add \string\makeglossaries\space to your document preamble.% +\newcommand*{\@glsaddkey}[7]{% + \key@ifundefined{glossentry}{#1}% + {% + \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% + \appto\@gls@keymap{,{#1}{#1}}% + \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% + \appto\@newglossaryentryposthook{% + \letcs{\@glo@tmp}{@glo@#1}% + \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% + }% + \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% + \newcommand*{#4}[1]{\@Gls@entry@field{##1}{#1}}% + \ifcsdef{@gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#5' as helper command + `\expandafter\string\csname @gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@gls@user@#1@}{##1}{##2}}% + {\csuse{@gls@user@#1@}{##1}{##2}[]}}% + \csdef{@gls@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{#3{##2}##3}% }% + \newrobustcmd*{#5}{% + \expandafter\@gls@hyp@opt\csname @gls@user@#1\endcsname}% }% - \else - \renewcommand*{\@gls@doautomake}{}% - \fi -} -\glsautomakefalse -\newcommand*{\@gls@doautomake}{} -\AtEndDocument{\@gls@doautomake} -\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{% - \ifglssavewrites - \renewcommand*{\glswritefiles}{\@glswritefiles}% - \else - \let\glswritefiles\@empty - \fi -} -\glssavewritesfalse -\let\glswritefiles\@empty -\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{} -\boolfalse{glscompatible-3.07} -\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{% - \ifbool{glscompatible-2.07}% + \ifcsdef{@Gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#6' as helper command + `\expandafter\string\csname @Gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @Gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@Gls@user@#1@}{##1}{##2}}% + {\csuse{@Gls@user@#1@}{##1}{##2}[]}}% + \csdef{@Gls@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{#4{##2}##3}% + }% + \newrobustcmd*{#6}{% + \expandafter\@gls@hyp@opt\csname @Gls@user@#1\endcsname}% + }% + \ifcsdef{@GLS@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#7' as helper command + `\expandafter\string\csname @GLS@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @GLS@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@GLS@user@#1@}{##1}{##2}}% + {\csuse{@GLS@user@#1@}{##1}{##2}[]}}% + \csdef{@GLS@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{\mfirstucMakeUppercase{#3{##2}##3}}% + }% + \newrobustcmd*{#7}{% + \expandafter\@gls@hyp@opt\csname @GLS@user@#1\endcsname}% + }% + }% {% - \booltrue{glscompatible-3.07}% + \PackageError{glossaries}{Key `#1' already exists}{}% }% - {}% } -\boolfalse{glscompatible-2.07} -\let\gls@original@makeglossary\makeglossary -\let\gls@original@glossary\glossary -\def\makeglossary{% - \GlossariesWarning{Use of \string\makeglossary\space with - glossaries.sty is \MessageBreak deprecated. Use \string\makeglossaries\space - instead. If you \MessageBreak need the original definition of - \string\makeglossary\space use \MessageBreak the package options - kernelglossredefs=false (to \MessageBreak restore the former definition of - \string\makeglossary) and \MessageBreak nomain (if the file extensions cause a - conflict)}% - \makeglossaries +\newcommand{\glsfieldxdef}[3]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \protected@csxdef{glo@\@glo@label @#2}{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\newcommand*{\@gls@override@glossary}[1][main]{% - \GlossariesWarning{Use of \string\glossary\space with - glossaries.sty is deprecated. \MessageBreak Indexing should be performed - with the user level \MessageBreak commands, such as \string\gls\space or - \string\glsadd. If you need the \MessageBreak original definition of - \string\glossary\space use the package \MessageBreak options - kernelglossredefs=false (to restore the \MessageBreak former definition of - \string\glossary) and nomain (if the \MessageBreak file extensions cause a - conflict)}% - \gls@glossary{#1}% +\newcommand{\glsfieldedef}[3]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \protected@csedef{glo@\@glo@label @#2}{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\if@gls@docloaded -\else - \def\glossary{\@gls@override@glossary} -\fi -\define@choicekey{glossaries.sty}{kernelglossredefs}% - [\gls@debug@val\gls@debug@nr]{true,false,nowarn}[true]% -{% - \ifcase\gls@debug@nr\relax - \def\glossary{\@gls@override@glossary}% - \def\makeglossary{% - \GlossariesWarning{Use of \string\makeglossary\space with - glossaries.sty is deprecated. Use \string\makeglossaries\space - instead. If you need the original definition of - \string\makeglossary\space use the package options - kernelglossredefs=false (to prevent redefinition of - \string\makeglossary) and nomain (if the file extensions cause a - conflict)}% - \makeglossaries +\newcommand{\glsfieldgdef}[3]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\gdef\csname glo@\@glo@label @#2\endcsname{#3}% }% - \or - \let\glossary\gls@original@glossary - \let\makeglossary\gls@original@makeglossary - \or - \def\makeglossary{\makeglossaries}% - \renewcommand*{\@gls@override@glossary}[1][main]{% - \gls@glossary{##1}% - }% - \fi + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\@gls@declareoption{symbols}{% - \let\@gls@do@symbolsdef\@gls@symbolsdef +\newcommand{\glsfielddef}[3]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\def\csname glo@\@glo@label @#2\endcsname{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\newcommand*{\@gls@do@symbolsdef}{} -\newcommand*{\@gls@symbolsdef}{% - \newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}% - \newcommand*{\printsymbols}[1][]{\printglossary[type=symbols,##1]}% - \newcommand*{\gls@tr@set@symbols@toctitle}{% - \translatelet{\glossarytoctitle}{Symbols (glossaries)}% - }% -}% -\@gls@declareoption{numbers}{% - \let\@gls@do@numbersdef\@gls@numbersdef +\newcommand{\glsfieldfetch}[3]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \letcs#3{glo@\@glo@label @#2}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\newcommand*{\@gls@do@numbersdef}{} -\newcommand*{\@gls@numbersdef}{% - \newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}% - \newcommand*{\printnumbers}[1][]{\printglossary[type=numbers,##1]}% - \newcommand*{\gls@tr@set@numbers@toctitle}{% - \translatelet{\glossarytoctitle}{Numbers (glossaries)}% - }% -}% -\@gls@declareoption{index}{% - \ifx\@gls@do@indexdef\@empty - \let\@gls@do@indexdef\@gls@indexdef - \fi +\newcommand{\ifglsfieldeq}[5]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \ifcsstring{glo@\@glo@label @#2}{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\@gls@declareoption{noglossaryindex}{% - \let\@gls@do@indexdef\relax +\newcommand{\ifglsfielddefeq}[5]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\ifdefstrequal + \csname glo@\@glo@label @#2\endcsname{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\newcommand*{\@gls@do@indexdef}{} -\newcommand*{\@gls@indexdef}{% - \newglossary[ilg]{index}{ind}{idx}{\indexname}% - \newcommand*{\printindex}[1][]{\printglossary[type=index,##1]}% - \newcommand*{\newterm}[2][]{% - \newglossaryentry{##2}% - {type={index},name={##2},description={\nopostdesc},##1}} - \let\@gls@do@indexdef\relax -}% -\@for\CurrentOption :=\@declaredoptions\do{% - \ifx\CurrentOption\@empty - \else - \@expandtwoargs - \in@ {,\CurrentOption ,}{,\@classoptionslist,\@curroptions,}% - \ifin@ - \@use@ption - \expandafter \let\csname ds@\CurrentOption\endcsname\@empty - \fi - \fi +\newcommand{\ifglsfieldcseq}[5]{% + \glsdoifexists{#1}% + {% + \edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \ifcsstrequal{glo@\@glo@label @#2}{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% } -\ProcessOptionsX -\RequirePackage{glossaries-compatible-307} -\disable@keys{glossaries.sty}{compatible-2.07,% - xindy,xindygloss,xindynoglsnumbers,makeindex,% - acronym,translate,notranslate,nolong,nosuper,notree,nostyles,% - nomain,noglossaryindex} -\newcommand*{\setupglossaries}[1]{% - \renewcommand*{\@gls@setacrstyle}{}% - \ifglsacrshortcuts - \def\@gls@setupshortcuts{\glsacrshortcutstrue}% - \else - \def\@gls@setupshortcuts{% - \ifglsacrshortcuts - \DefineAcronymSynonyms - \fi - }% - \fi - \glsacrshortcutsfalse - \let\@gls@do@numbersdef\relax - \let\@gls@do@symbolssdef\relax - \let\@gls@do@indexdef\relax - \let\@gls@do@acronymsdef\relax - \ifglsentrycounter - \let\@gls@doentrycounterdef\relax - \else - \let\@gls@doentrycounterdef\@gls@define@glossaryentrycounter - \fi - \ifglssubentrycounter - \let\@gls@dosubentrycounterdef\relax - \else - \let\@gls@dosubentrycounterdef\@gls@define@glossarysubentrycounter - \fi - \setkeys{glossaries.sty}{#1}% - \@gls@setacrstyle - \@gls@setupshortcuts - \@gls@do@acronymsdef - \@gls@do@numbersdef - \@gls@do@symbolssdef - \@gls@do@indexdef - \@gls@doentrycounterdef - \@gls@dosubentrycounterdef +\newcommand*{\glswritedefhook}{} +\newcommand*{\gls@assign@desc}[1]{% + \gls@assign@field{}{#1}{desc}{\@glo@desc}% + \gls@assign@field{\@glo@desc}{#1}{descplural}{\@glo@descplural}% } -\ifthenelse{\equal{\glscounter}{section}}% -{% - \ifcsundef{chapter}{}% +\newcommand{\longnewglossaryentry}[3]{% + \glsdoifnoexists{#1}% {% - \let\@gls@old@chapter\@chapter - \def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}% - \ifcsundef{hyperdef}{}{\hyperdef{section}{\thesection}{}}}% - }% -}% -{} -\newcommand*{\@gls@onlypremakeg}{} -\newcommand*{\@onlypremakeg}[1]{% - \ifx\@gls@onlypremakeg\@empty - \def\@gls@onlypremakeg{#1}% - \else - \expandafter\toks@\expandafter{\@gls@onlypremakeg}% - \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}% - \fi -} -\newcommand*{\@disable@onlypremakeg}{% -\@for\@thiscs:=\@gls@onlypremakeg\do{% - \expandafter\@disable@premakecs\@thiscs% -}} -\newcommand*{\@disable@premakecs}[1]{% - \def#1{\PackageError{glossaries}{\string#1\space may only be - used before \string\makeglossaries}{You can't use - \string#1\space after \string\makeglossaries}}% -} -\providecommand*{\glossaryname}{Glossary} -\providecommand*{\acronymname}{Acronyms} -\newcommand*{\glssettoctitle}[1]{% - \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}} -\providecommand*{\entryname}{Notation} -\providecommand*{\descriptionname}{Description} -\providecommand*{\symbolname}{Symbol} -\providecommand*{\pagelistname}{Page List} -\providecommand*{\glssymbolsgroupname}{Symbols} -\providecommand*{\glsnumbersgroupname}{Numbers} -\newcommand*{\glspluralsuffix}{s} -\newcommand*{\glsacrpluralsuffix}{\glspluralsuffix} -\newcommand*{\glsupacrpluralsuffix}{\glstextup{\glsacrpluralsuffix}} -\providecommand*{\seename}{see} -\providecommand*{\andname}{\&} -\newcommand*{\RequireGlossariesLang}[1]{% - \@ifundefined{ver@glossaries-#1.ldf}{\input{glossaries-#1.ldf}}{}% + \bgroup + \let\@org@newglossaryentryprehook\@newglossaryentryprehook + \long\def\@newglossaryentryprehook{% + \long\def\@glo@desc{#3\leavevmode\unskip\nopostdesc}% + \@org@newglossaryentryprehook + }% + \renewcommand*{\gls@assign@desc}[1]{% + \global\cslet{glo@\glsdetoklabel{#1}@desc}{\@glo@desc}% + \global\cslet{glo@\glsdetoklabel{#1}@descplural}{\@glo@desc}% + } + \gls@defglossaryentry{#1}{#2}% + \egroup + } } -\newcommand*{\ProvidesGlossariesLang}[1]{% - \ProvidesFile{glossaries-#1.ldf}% +\@onlypreamble{\longnewglossaryentry} +\newcommand{\longprovideglossaryentry}[3]{% + \ifglsentryexists{#1}{}% + {\longnewglossaryentry{#1}{#2}{#3}}% } -\newcommand*{\addglossarytocaptions}[1]{} -\ifglstranslate - \RequirePackage{tracklang} - \@gls@usetranslator - \@ifpackageloaded{translator} +\@onlypreamble{\longprovideglossaryentry} +\newcommand{\gls@defglossaryentry}[2]{% + \let\GlsSetQuote\gls@nosetquote + \edef\@glo@label{\glsdetoklabel{#1}}% + \let\glslabel\@glo@label + \let\@glo@name\@glsnoname + \let\@glo@desc\@glsnodesc + \let\@glo@descplural\@gls@default@value + \let\@glo@type\@gls@default@value + \let\@glo@symbol\@gls@default@value + \let\@glo@symbolplural\@gls@default@value + \let\@glo@text\@gls@default@value + \let\@glo@plural\@gls@default@value + \let\@glo@first\@gls@default@value + \let\@glo@firstplural\@gls@default@value + \let\@glo@sort\@gls@default@value + \let\@glo@counter\@gls@default@value + \def\@glo@see{}% + \def\@glo@parent{}% + \def\@glo@prefix{}% + \@gls@initnonumberlist + \def\@glo@useri{}% + \def\@glo@userii{}% + \def\@glo@useriii{}% + \def\@glo@useriv{}% + \def\@glo@userv{}% + \def\@glo@uservi{}% + \def\@glo@short{}% + \def\@glo@shortpl{}% + \def\@glo@long{}% + \def\@glo@longpl{}% + \@newglossaryentryprehook + \setkeys{glossentry}{#2}% + \ifundef\glsdefaulttype {% - \ifboolexpr - { - test {\ifdefstring{\trans@languages}{English}} - and not - test {\ifdefstring{bbl@loaded}{english}} - } - {% - \let\glsifusetranslator\@secondoftwo - }% - {% - \usedictionary{glossaries-dictionary}% - \renewcommand*{\addglossarytocaptions}[1]{% - \ifcsundef{captions#1}{}% - {% - \expandafter\let\expandafter\@gls@tmp\csname captions#1\endcsname - \expandafter\toks@\expandafter{\@gls@tmp - \renewcommand*{\glossaryname}{\translate{Glossary}}% - }% - \expandafter\edef\csname captions#1\endcsname{\the\toks@}% - }% - }% - }% + \PackageError{glossaries}% + {No default glossary type (have you used `nomain' by mistake?)}% + {If you use package option `nomain' you must define + a new glossary before you can define entries}% }% {}% - \AnyTrackedLanguages + \gls@assign@field{\glsdefaulttype}{\@glo@label}{type}{\@glo@type}% + \edef\@glo@type{\glsentrytype{\@glo@label}}% + \ifcsundef{glolist@\@glo@type}% {% - \ForEachTrackedDialect{\this@dialect}{% - \IfTrackedLanguageFileExists{\this@dialect}% - {glossaries-}% prefix - {.ldf}% - {% - \RequireGlossariesLang{\CurrentTrackedTag}% - }% - {% - \@gls@missinglang@warn\this@dialect\CurrentTrackedLanguage - }% - }% + \PackageError{glossaries}% + {Glossary type `\@glo@type' has not been defined}% + {You need to define a new glossary type, before making entries + in it}% }% - {}% - \glsifusetranslator {% - \renewcommand*{\glssettoctitle}[1]{% - \ifcsdef{gls@tr@set@#1@toctitle}% + \ifignoredglossary\@glo@type {% - \csuse{gls@tr@set@#1@toctitle}% + \ifx\@glo@desc\@glsnodesc + \let\@glo@desc\@empty + \fi + }% + {% + }% + \protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}% + \expandafter\xdef\csname glolist@\@glo@type\endcsname{% + \@glolist@{\@glo@label},}% + }% + \gls@level=0\relax + \ifx\@glo@parent\@empty + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% + \else + \ifdefequal\@glo@label\@glo@parent% + {% + \PackageError{glossaries}{Entry `\@glo@label' can't be its own parent}{}% + \def\@glo@parent{}% + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% + }% + {% + \ifglsentryexists{\@glo@parent}% + {% + \expandafter\xdef\csname glo@\@glo@label @parent\endcsname{% + \@glo@parent}% + \gls@level=\csname glo@\@glo@parent @level\endcsname\relax + \advance\gls@level by 1\relax + \ifx\@glo@name\@glsnoname + \expandafter\let\expandafter\@glo@name + \csname glo@\@glo@parent @name\endcsname + \ifx\@glo@plural\@gls@default@value + \expandafter\let\expandafter\@glo@plural + \csname glo@\@glo@parent @plural\endcsname + \fi + \fi }% {% - \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}% + \PackageError{glossaries}% + {% + Invalid parent `\@glo@parent' + for entry `\@glo@label' - parent doesn't exist% + }% + {% + Parent entries must be defined before their children% + }% + \def\@glo@parent{}% + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% }% }% - \renewcommand*{\glossaryname}{\translate{Glossary}}% - \renewcommand*{\acronymname}{\translate{Acronyms}}% - \renewcommand*{\entryname}{\translate{Notation (glossaries)}}% - \renewcommand*{\descriptionname}{% - \translate{Description (glossaries)}}% - \renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}% - \renewcommand*{\pagelistname}{% - \translate{Page List (glossaries)}}% - \renewcommand*{\glssymbolsgroupname}{% - \translate{Symbols (glossaries)}}% - \renewcommand*{\glsnumbersgroupname}{% - \translate{Numbers (glossaries)}}% - }{}% -\fi -\DeclareRobustCommand*{\nopostdesc}{} -\newcommand*{\@nopostdesc}{% - \let\org@glspostdescription\glspostdescription - \def\glspostdescription{% - \let\glspostdescription\org@glspostdescription}% -} -\newcommand*{\@no@post@desc}{\nopostdesc} -\newcommand{\glspar}{\par} -\newcommand{\setStyleFile}[1]{% - \renewcommand*{\gls@istfilebase}{#1}% - \ifglsxindy - \def\istfilename{\gls@istfilebase.xdy} + \fi + \expandafter\xdef\csname glo@\@glo@label @level\endcsname{\number\gls@level}% + \gls@assign@field{\@glo@name}{\@glo@label}{sortvalue}{\@glo@sort}% + \letcs\@glo@sort{glo@\@glo@label @sortvalue}% + \gls@assign@field{\@glo@name}{\@glo@label}{text}{\@glo@text}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @text\endcsname\glspluralsuffix}% + {\@glo@label}{plural}{\@glo@plural}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @text\endcsname}% + {\@glo@label}{first}{\@glo@first}% + \ifx\@glo@first\@gls@default@value + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @plural\endcsname}% + {\@glo@label}{firstpl}{\@glo@firstplural}% \else - \def\istfilename{\gls@istfilebase.ist} + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @first\endcsname\glspluralsuffix}% + {\@glo@label}{firstpl}{\@glo@firstplural}% + \fi + \ifcsundef{@glotype@\@glo@type @counter}% + {% + \def\@glo@defaultcounter{\glscounter}% + }% + {% + \letcs\@glo@defaultcounter{@glotype@\@glo@type @counter}% + }% + \gls@assign@field{\@glo@defaultcounter}{\@glo@label}{counter}{\@glo@counter}% + \gls@assign@field{}{\@glo@label}{useri}{\@glo@useri}% + \gls@assign@field{}{\@glo@label}{userii}{\@glo@userii}% + \gls@assign@field{}{\@glo@label}{useriii}{\@glo@useriii}% + \gls@assign@field{}{\@glo@label}{useriv}{\@glo@useriv}% + \gls@assign@field{}{\@glo@label}{userv}{\@glo@userv}% + \gls@assign@field{}{\@glo@label}{uservi}{\@glo@uservi}% + \gls@assign@field{}{\@glo@label}{short}{\@glo@short}% + \gls@assign@field{}{\@glo@label}{shortpl}{\@glo@shortpl}% + \gls@assign@field{}{\@glo@label}{long}{\@glo@long}% + \gls@assign@field{}{\@glo@label}{longpl}{\@glo@longpl}% + \ifx\@glo@name\@glsnoname + \@glsnoname + \let\@gloname\@gls@default@value + \fi + \gls@assign@field{}{\@glo@label}{name}{\@glo@name}% + \ifcsundef{glo@\@glo@label @numberlist}% + {% + \csxdef{glo@\@glo@label @numberlist}{% + \noexpand\@gls@missingnumberlist{\@glo@label}}% + }% + {}% + \@gls@storenonumberlist{\@glo@label}% + \def\@glo@@desc{\@glo@first}% + \ifx\@glo@desc\@glo@@desc + \let\@glo@desc\@glo@first + \fi + \ifx\@glo@desc\@glsnodesc + \@glsnodesc + \let\@glodesc\@gls@default@value + \fi + \gls@assign@desc{\@glo@label}% + \@gls@defsort{\@glo@type}{\@glo@label}% + \def\@glo@@symbol{\@glo@text}% + \ifx\@glo@symbol\@glo@@symbol + \let\@glo@symbol\@glo@text \fi + \gls@assign@field{\relax}{\@glo@label}{symbol}{\@glo@symbol}% + \expandafter + \gls@assign@field\expandafter + {\csname glo@\@glo@label @symbol\endcsname} + {\@glo@label}{symbolplural}{\@glo@symbolplural}% + \expandafter\xdef\csname glo@\@glo@label @flagfalse\endcsname{% + \noexpand\global + \noexpand\let\expandafter\noexpand + \csname ifglo@\@glo@label @flag\endcsname\noexpand\iffalse + }% + \expandafter\xdef\csname glo@\@glo@label @flagtrue\endcsname{% + \noexpand\global + \noexpand\let\expandafter\noexpand + \csname ifglo@\@glo@label @flag\endcsname\noexpand\iftrue + }% + \csname glo@\@glo@label @flagfalse\endcsname + \@glo@autosee + \ifignoredglossary\@glo@type + {% + \csdef{glo@\@glo@label @index}{}% + } + {% + \do@glo@storeentry{\@glo@label}% + }% + \@newglossaryentry@defcounters + \@newglossaryentryposthook +} +\newcommand*{\@glo@autosee}{% + \ifdefvoid\@glo@see{}% + {% + \protected@edef\@do@glssee{% + \noexpand\@gls@fixbraces\noexpand\@glo@list\@glo@see\noexpand\@nil + \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{\@glo@label}}% + \@do@glssee + }% + \@glo@autoseehook +}% +\newcommand*{\@glo@autoseehook}{} +\newcommand*{\@newglossaryentryprehook}{} +\newcommand*{\@newglossaryentryposthook}{} +\newcommand*{\@newglossaryentry@defcounters}{} +\newcommand*{\glsmoveentry}[2]{% + \edef\@glo@thislabel{\glsdetoklabel{#1}}% + \edef\glo@type{\csname glo@\@glo@thislabel @type\endcsname}% + \def\glo@list{,}% + \forglsentries[\glo@type]{\glo@label}% + {% + \ifdefequal\@glo@thislabel\glo@label + {}{\eappto\glo@list{\glo@label,}}% + }% + \cslet{glolist@\glo@type}{\glo@list}% + \csdef{glo@\@glo@thislabel @type}{#2}% } -\@onlypremakeg\setStyleFile \ifglsxindy - \def\istfilename{\gls@istfilebase.xdy} + \newcommand*{\@glossaryentryfield}{\string\\glossentry} \else - \def\istfilename{\gls@istfilebase.ist} + \newcommand*{\@glossaryentryfield}{\string\glossentry} \fi -\newcommand*{\gls@istfilebase}{\jobname} -\newcommand*{\@istfilename}[1]{} -\newcommand*{\glscompositor}{.} -\newcommand*{\glsSetCompositor}[1]{% - \renewcommand*{\glscompositor}{#1}} -\@onlypremakeg\glsSetCompositor -\newcommand*{\@glsAlphacompositor}{\glscompositor} \ifglsxindy - \newcommand*\glsSetAlphaCompositor[1]{% - \renewcommand*\@glsAlphacompositor{#1}} + \newcommand*{\@glossarysubentryfield}{% + \string\\subglossentry} \else - \newcommand*\glsSetAlphaCompositor[1]{% - \glsnoxindywarning\glsSetAlphaCompositor} + \newcommand*{\@glossarysubentryfield}{% + \string\subglossentry} \fi -\@onlypremakeg\glsSetAlphaCompositor -\newcommand*{\gls@suffixF}{} -\newcommand*{\glsSetSuffixF}[1]{% - \renewcommand*{\gls@suffixF}{#1}} -\@onlypremakeg\glsSetSuffixF -\newcommand*{\gls@suffixFF}{} -\newcommand*{\glsSetSuffixFF}[1]{% - \renewcommand*{\gls@suffixFF}{#1}% +\newcommand{\@glo@storeentry}[1]{% + \edef\@glo@esclabel{#1}% + \@gls@checkmkidxchars\@glo@esclabel + \protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% + \@gls@checkmkidxchars\@glo@sort + \@gls@checkmkidxchars\@glo@prefix + \edef\@glo@parent{\csname glo@#1@parent\endcsname}% + \ifglsxindy + \ifx\@glo@parent\@empty + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossaryentryfield{\@glo@esclabel}\string") % + }% + \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@esclabel}\string") % + }% + \fi + \else + \ifx\@glo@parent\@empty + \@onelevel@sanitize\@glo@prefix + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossaryentryfield{\@glo@esclabel}% + }% + \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname\@gls@levelchar + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@esclabel}% + }% + \fi + \fi } -\ifcsundef{hyperlink}% -{% - \newcommand*{\glsnumberformat}[1]{#1}% -}% -{% - \newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}% +\AtBeginDocument{% + \@ifpackageloaded{amsmath}% + {\let\gls@ifnotmeasuring\@gls@ifnotmeasuring}% + {}% } -\newcommand{\delimN}{, } -\newcommand{\delimR}{--} -\newcommand*{\glossarypreamble}{% - \csuse{@glossarypreamble@\currentglossary}% +\newcommand*{\@gls@ifnotmeasuring}[1]{% + \ifmeasuring@ + \else + #1% + \fi } -\newcommand{\setglossarypreamble}[2][\glsdefaulttype]{% - \ifglossaryexists*{#1}% - {\csgdef{@glossarypreamble@#1}{#2}}% - {\GlossariesWarning{Glossary `#1' is not defined}}% +\newcommand*\gls@ifnotmeasuring[1]{#1} +\def\@gls@patchtabularx#1\hbox#2#3!!{% + \def\TX@trial##1{#1\hbox{\let\glsunset\@gobble#2}#3}% } -\newcommand*{\glossarypostamble}{} -\newcommand*{\glossarysection}[2][\@gls@title]{% - \def\@gls@title{#2}% - \ifcsundef{phantomsection}% +\newcommand*\glspatchtabularx{% + \ifdef\TX@trial + {% + \expandafter\@gls@patchtabularx\TX@trial{##1}!!% + \let\glspatchtabularx\relax + }% + {}% +} +\newcommand*{\glsreset}[1]{% + \gls@ifnotmeasuring {% - \@glossarysection{#1}{#2}% + \glsdoifexists{#1}% + {% + \@glsreset{#1}% + }% }% +} +\newcommand*{\glslocalreset}[1]{% + \gls@ifnotmeasuring {% - \@p@glossarysection{#1}{#2}% + \glsdoifexists{#1}% + {% + \@glslocalreset{#1}% + }% }% - \glsglossarymark{\glossarytoctitle}% } -\ifcsundef{glossarymark}% -{% - \newcommand{\glsglossarymark}[1]{\glossarymark{#1}} -}% -{% - \@ifclassloaded{memoir} +\newcommand*{\glsunset}[1]{% + \gls@ifnotmeasuring {% - \newcommand{\glsglossarymark}[1]{% - \ifglsucmark - \markboth{\memUChead{#1}}{\memUChead{#1}}% - \else - \markboth{#1}{#1}% - \fi - } + \glsdoifexists{#1}% + {% + \@glsunset{#1}% + }% }% +} +\newcommand*{\glslocalunset}[1]{% + \gls@ifnotmeasuring {% - \newcommand{\glsglossarymark}[1]{% - \ifglsucmark - \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% - \else - \@mkboth{#1}{#1}% - \fi - } - } + \glsdoifexists{#1}% + {% + \@glslocalunset{#1}% + }% + }% } -\providecommand{\glossarymark}[1]{% - \ifglsucmark - \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% - \else - \@mkboth{#1}{#1}% - \fi +\newcommand*{\@glslocalunset}{\@@glslocalunset} +\newcommand*{\@@glslocalunset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iftrue } -\newcommand*{\setglossarysection}[1]{% -\setkeys{glossaries.sty}{section=#1}} -\newcommand*{\@glossarysection}[2]{% - \ifdefempty\@@glossarysecstar +\newcommand*{\@glsunset}{\@@glsunset} +\newcommand*{\@@glsunset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagtrue\endcsname +} +\newcommand*{\@glslocalreset}{\@@glslocalreset} +\newcommand*{\@@glslocalreset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iffalse +} +\newcommand*{\@glsreset}{\@@glsreset} +\newcommand*{\@@glsreset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagfalse\endcsname +} +\newcommand*{\glsresetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% {% - \csname\@@glossarysec\endcsname[#1]{#2}% + \glsreset{\@glsentry}% }% +} +\newcommand*{\glslocalresetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% {% - \csname\@@glossarysec\endcsname*{#2}% - \@gls@toc{#1}{\@@glossarysec}% + \glslocalreset{\@glsentry}% }% - \@@glossaryseclabel } -\newcommand*{\@p@glossarysection}[2]{% - \glsclearpage - \phantomsection - \ifdefempty\@@glossarysecstar +\newcommand*{\glsunsetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% {% - \csname\@@glossarysec\endcsname{#2}% + \glsunset{\@glsentry}% }% +} +\newcommand*{\glslocalunsetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% {% - \@gls@toc{#1}{\@@glossarysec}% - \csname\@@glossarysec\endcsname*{#2}% + \glslocalunset{\@glsentry}% }% - \@@glossaryseclabel } -\newcommand*{\gls@doclearpage}{% - \ifthenelse{\equal{\@@glossarysec}{chapter}}% - {% - \ifcsundef{cleardoublepage}% - {% - \clearpage - }% - {% - \ifcsdef{if@openright}% - {% - \if@openright - \cleardoublepage - \else - \clearpage - \fi - }% - {% - \cleardoublepage - }% +\newcommand*{\@@newglossaryentry@defcounters}{% + \csdef{glo@\@glo@label @currcount}{0}% + \csdef{glo@\@glo@label @prevcount}{0}% +} +\newcommand*{\glsenableentrycount}{% + \let\@newglossaryentry@defcounters\@@newglossaryentry@defcounters + \renewcommand*{\gls@defdocnewglossaryentry}{% + \renewcommand*\newglossaryentry[2]{% + \PackageError{glossaries}{\string\newglossaryentry\space + may only be used in the preamble when entry counting has + been activated}{If you use \string\glsenableentrycount\space + you must place all entry definitions in the preamble not in + the document environment}% }% }% - {}% -} -\newcommand*{\glsclearpage}{\gls@doclearpage} -\newcommand*{\@gls@toc}[2]{% - \ifglstoc - \ifglsnumberline - \addcontentsline{toc}{#2}{\protect\numberline{}#1}% - \else - \addcontentsline{toc}{#2}{#1}% - \fi - \fi + \newcommand*{\glsentrycurrcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@currcount}% + {0}{\@gls@entry@field{##1}{currcount}}% + }% + \newcommand*{\glsentryprevcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@prevcount}% + {0}{\@gls@entry@field{##1}{prevcount}}% + }% + \renewcommand*{\@glsunset}[1]{% + \@@glsunset{##1}% + \@gls@increment@currcount{##1}% + }% + \renewcommand*{\@glslocalunset}[1]{% + \@@glslocalunset{##1}% + \@gls@local@increment@currcount{##1}% + }% + \renewcommand*{\@glsreset}[1]{% + \@@glsreset{##1}% + \csgdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% + \renewcommand*{\@glslocalreset}[1]{% + \@@glslocalreset{##1}% + \csdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% + \def\@cgls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsformat{##2}{##3}% + \glsunset{##2}% + \else + \@gls@{##1}{##2}[##3]% + \fi + }% + \def\@cglspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@glspl@{##1}{##2}[##3]% + \fi + }% + \def\@cGls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsformat{##2}{##3}% + \glsunset{##2}% + \else + \@Gls@{##1}{##2}[##3]% + \fi + }% + \def\@cGlspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@Glspl@{##1}{##2}[##3]% + \fi + }% + \AtEndDocument{\@gls@write@entrycounts}% + \renewcommand*{\@gls@entry@count}[2]{% + \csgdef{glo@\glsdetoklabel{##1}@prevcount}{##2}% + }% + \let\glsenableentrycount\relax } -\newcommand*{\glsnoxindywarning}[1]{% - \GlossariesWarning{Not in xindy mode --- ignoring \string#1}% +\@onlypreamble\glsenableentrycount +\newcommand*{\@gls@increment@currcount}[1]{% + \csxdef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% } -\newcommand*{\glsnomakeindexwarning}[1]{% - \GlossariesWarning{Not in makeindex mode --- ignoring \string#1}% +\newcommand*{\@gls@local@increment@currcount}[1]{% + \csedef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% } -\ifglsxindy - \edef\@xdyattributes{\string"default\string"}% -\fi -\ifglsxindy - \edef\@xdyattributelist{}% -\fi -\ifglsxindy - \def\@xdylocref{} -\fi -\newcommand*{\@gls@ifinlist}[4]{% - \def\@do@ifinlist##1,#1,##2\end@doifinlist{% - \def\@gls@listsuffix{##2}% - \ifx\@gls@listsuffix\@empty - #4% - \else - #3% - \fi - }% - \@do@ifinlist,#2,#1,\end@doifinlist -} -\ifglsxindy - \newcommand*{\@xdycounters}{\glscounter} - \newcommand*\GlsAddXdyCounters[1]{% - \@for\@gls@ctr:=#1\do{% - \edef\@do@addcounter{% - \noexpand\@gls@ifinlist{\@gls@ctr}{\@xdycounters}{}% - {% - \noexpand\edef\noexpand\@xdycounters{\@xdycounters,% - \noexpand\@gls@ctr}% - }% - }% - \@do@addcounter - } - } - \@onlypremakeg\GlsAddXdyCounters -\else - \newcommand*\GlsAddXdyCounters[1]{% - \glsnoxindywarning\GlsAddXdyAttribute - } -\fi -\newcommand*\@disabled@glsaddxdycounters{% - \PackageError{glossaries}{\string\GlsAddXdyCounters\space - can't be used after \string\GlsAddXdyAttribute}{Move all - occurrences of \string\GlsAddXdyCounters\space before the first - instance of \string\GlsAddXdyAttribute}% -} -\ifglsxindy - \newcommand*\@glsaddxdyattribute[2]{% - \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string" ^^J - \string"#2#1\string"}% - \expandafter\toks@\expandafter{\@xdylocref}% - \edef\@xdylocref{\the\toks@ ^^J% - (markup-locref - :open \string"\glstildechar n% - \expandafter\string\csname glsX#2X#1\endcsname - \string" ^^J - :close \string"\string" ^^J - :attr \string"#2#1\string")}% - \expandafter\gdef\csname glsX#2X#1\endcsname##1##2{% - \setentrycounter[##1]{#2}\csname #1\endcsname{##2}% - }% - } - \newcommand*\GlsAddXdyAttribute[1]{% - \ifx\@xdyattributelist\@empty - \edef\@xdyattributelist{#1}% - \else - \edef\@xdyattributelist{\@xdyattributelist,#1}% - \fi - \@for\@this@counter:=\@xdycounters\do{% - \protected@edef\gls@do@addxdyattribute{% - \noexpand\@glsaddxdyattribute{#1}{\@this@counter}% - } - \gls@do@addxdyattribute - }% - \let\GlsAddXdyCounters\@disabled@glsaddxdycounters - } - \@onlypremakeg\GlsAddXdyAttribute -\else - \newcommand*\GlsAddXdyAttribute[1]{% - \glsnoxindywarning\GlsAddXdyAttribute} -\fi -\ifglsxindy -\newcommand*{\@gls@addpredefinedattributes}{% - \GlsAddXdyAttribute{glsnumberformat} - \GlsAddXdyAttribute{textrm} - \GlsAddXdyAttribute{textsf} - \GlsAddXdyAttribute{texttt} - \GlsAddXdyAttribute{textbf} - \GlsAddXdyAttribute{textmd} - \GlsAddXdyAttribute{textit} - \GlsAddXdyAttribute{textup} - \GlsAddXdyAttribute{textsl} - \GlsAddXdyAttribute{textsc} - \GlsAddXdyAttribute{emph} - \GlsAddXdyAttribute{glshypernumber} - \GlsAddXdyAttribute{hyperrm} - \GlsAddXdyAttribute{hypersf} - \GlsAddXdyAttribute{hypertt} - \GlsAddXdyAttribute{hyperbf} - \GlsAddXdyAttribute{hypermd} - \GlsAddXdyAttribute{hyperit} - \GlsAddXdyAttribute{hyperup} - \GlsAddXdyAttribute{hypersl} - \GlsAddXdyAttribute{hypersc} - \GlsAddXdyAttribute{hyperemph} - \GlsAddXdyAttribute{glsignore} -} -\else - \let\@gls@addpredefinedattributes\relax -\fi -\def\@xdyuseralphabets{} -\ifglsxindy - \newcommand*{\GlsAddXdyAlphabet}[2]{% - \edef\@xdyuseralphabets{% - \@xdyuseralphabets ^^J - (define-alphabet "#1" (#2))}} -\else - \newcommand*{\GlsAddXdyAlphabet}[2]{% - \glsnoxindywarning\GlsAddXdyAlphabet} -\fi -\ifglsxindy - \newcommand*{\@gls@xdy@locationlist}{% - roman-page-numbers,% - Roman-page-numbers,% - arabic-page-numbers,% - alpha-page-numbers,% - Alpha-page-numbers,% - Appendix-page-numbers,% - arabic-section-numbers% - } - \protected@edef\@gls@roman{\@roman{0\string" - \string"roman-numbers-lowercase\string" :sep \string"}}% - \@onelevel@sanitize\@gls@roman - \edef\@tmp{\string" \string"roman-numbers-lowercase\string" - :sep \string"}% - \@onelevel@sanitize\@tmp - \ifx\@tmp\@gls@roman - \expandafter - \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{% - \string"roman-numbers-lowercase\string"% - }% - \else - \expandafter - \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{ - :sep \string"\@gls@roman\string"% - }% - \fi - \expandafter\def\csname @gls@xdy@Lclass@Roman-page-numbers\endcsname{% - \string"roman-numbers-uppercase\string"% - }% - \expandafter\def\csname @gls@xdy@Lclass@arabic-page-numbers\endcsname{% - \string"arabic-numbers\string"% - }% - \expandafter\def\csname @gls@xdy@Lclass@alpha-page-numbers\endcsname{% - \string"alpha\string"% - }% - \expandafter\def\csname @gls@xdy@Lclass@Alpha-page-numbers\endcsname{% - \string"ALPHA\string"% - }% - \expandafter\def\csname @gls@xdy@Lclass@Appendix-page-numbers\endcsname{% - \string"ALPHA\string" - :sep \string"\@glsAlphacompositor\string" - \string"arabic-numbers\string"% - } - \expandafter\def\csname @gls@xdy@Lclass@arabic-section-numbers\endcsname{% - \string"arabic-numbers\string" - :sep \string"\glscompositor\string" - \string"arabic-numbers\string"% - }% - \def\@xdyuserlocationdefs{} - \def\@xdyuserlocationnames{} -\fi -\ifglsxindy - \newcommand\@xdycrossrefhook{} -\fi -\ifglsxindy - \newcommand*{\GlsAddXdyLocation}[3][]{% - \def\@gls@tmp{#1}% - \ifx\@gls@tmp\@empty - \edef\@xdyuserlocationdefs{% - \@xdyuserlocationdefs ^^J% - (define-location-class \string"#2\string"^^J\space\space - \space(:sep \string"{}\glsopenbrace\string" #3 - :sep \string"\glsclosebrace\string")) - }% - \else - \edef\@xdyuserlocationdefs{% - \@xdyuserlocationdefs ^^J% - (define-location-class \string"#2\string"^^J\space\space - \space(:sep "\glsopenbrace" - #1 - :sep "\glsclosebrace\glsopenbrace" #3 - :sep "\glsclosebrace")) - }% - \fi - \edef\@xdyuserlocationnames{% - \@xdyuserlocationnames^^J\space\space\space - \string"#2\string"}% - } - \@onlypremakeg\GlsAddXdyLocation -\else - \newcommand*{\GlsAddXdyLocation}[2]{% - \glsnoxindywarning\GlsAddXdyLocation} -\fi -\ifglsxindy - \def\@xdylocationclassorder{^^J\space\space\space - \string"roman-page-numbers\string"^^J\space\space\space - \string"arabic-page-numbers\string"^^J\space\space\space - \string"arabic-section-numbers\string"^^J\space\space\space - \string"alpha-page-numbers\string"^^J\space\space\space - \string"Roman-page-numbers\string"^^J\space\space\space - \string"Alpha-page-numbers\string"^^J\space\space\space - \string"Appendix-page-numbers\string" - \@xdyuserlocationnames^^J\space\space\space - \string"see\string" - } -\fi -\ifglsxindy - \newcommand*\GlsSetXdyLocationClassOrder[1]{% - \def\@xdylocationclassorder{#1}} -\else - \newcommand*\GlsSetXdyLocationClassOrder[1]{% - \glsnoxindywarning\GlsSetXdyLocationClassOrder} -\fi -\ifglsxindy - \def\@xdysortrules{} -\fi -\ifglsxindy - \newcommand*\GlsAddSortRule[2]{% - \expandafter\toks@\expandafter{\@xdysortrules}% - \protected@edef\@xdysortrules{\the\toks@ ^^J - (sort-rule \string"#1\string" \string"#2\string")}% - } -\else - \newcommand*\GlsAddSortRule[2]{% - \glsnoxindywarning\GlsAddSortRule} -\fi -\ifglsxindy - \def\@xdyrequiredstyles{tex} -\fi -\ifglsxindy - \newcommand*\GlsAddXdyStyle[1]{% - \edef\@xdyrequiredstyles{\@xdyrequiredstyles,#1}}% -\else - \newcommand*\GlsAddXdyStyle[1]{% - \glsnoxindywarning\GlsAddXdyStyle} -\fi -\ifglsxindy - \newcommand*\GlsSetXdyStyles[1]{% - \edef\@xdyrequiredstyles{#1}} -\else - \newcommand*\GlsSetXdyStyles[1]{% - \glsnoxindywarning\GlsSetXdyStyles} -\fi -\newcommand*{\findrootlanguage}{} -\def\@xdylanguage#1#2{} -\ifglsxindy - \newcommand*\GlsSetXdyLanguage[2][\glsdefaulttype]{% - \ifglossaryexists{#1}{% - \expandafter\def\csname @xdy@#1@language\endcsname{#2}% - }{% - \PackageError{glossaries}{Can't set language type for - glossary type `#1' --- no such glossary}{% - You have specified a glossary type that doesn't exist}}} -\else - \newcommand*\GlsSetXdyLanguage[2][]{% - \glsnoxindywarning\GlsSetXdyLanguage} -\fi -\def\@gls@codepage#1#2{} -\ifglsxindy - \newcommand*{\GlsSetXdyCodePage}[1]{% - \renewcommand*{\gls@codepage}{#1}% - } - \AtBeginDocument{% - \ifx\gls@codepage\@empty - \@ifpackageloaded{fontspec}{\def\gls@codepage{utf8}}{}% - \fi - } -\else - \newcommand*{\GlsSetXdyCodePage}[1]{% - \glsnoxindywarning\GlsSetXdyCodePage} -\fi -\ifglsxindy - \ifgls@xindy@glsnumbers - \def\@xdylettergroups{(define-letter-group - \string"glsnumbers\string"^^J\space\space\space - :prefixes (\string"0\string" \string"1\string" - \string"2\string" \string"3\string" \string"4\string" - \string"5\string" \string"6\string" \string"7\string" - \string"8\string" \string"9\string")^^J\space\space\space - \@xdynumbergrouporder)} - \else - \def\@xdylettergroups{} - \fi -\fi - \newcommand*\GlsAddLetterGroup[2]{% - \expandafter\toks@\expandafter{\@xdylettergroups}% - \protected@edef\@xdylettergroups{\the\toks@^^J% - (define-letter-group \string"#1\string"^^J\space\space\space#2)}% - }% -\newcommand*{\forallglossaries}[3][\@glo@types]{% - \@for#2:=#1\do{\ifx#2\@empty\else#3\fi}% -} - -\newcommand*{\forallacronyms}[2]{% - \@for#1:=\@glsacronymlists\do{\ifx#1\@empty\else#2\fi}% -} -\newcommand*{\forglsentries}[3][\glsdefaulttype]{% - \edef\@@glo@list{\csname glolist@#1\endcsname}% - \@for#2:=\@@glo@list\do - {% - \ifdefempty{#2}{}{#3}% - }% -} -\newcommand*{\forallglsentries}[3][\@glo@types]{% - \expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}% - {% - \forglsentries[\@@this@glo@]{#2}{#3}% +\newcommand*{\@gls@write@entrycounts}{% + \immediate\write\@auxout + {\string\providecommand*{\string\@gls@entry@count}[2]{}}% + \forallglsentries{\@glsentry}{% + \ifglsused{\@glsentry}% + {\immediate\write\@auxout + {\string\@gls@entry@count{\@glsentry}{\glsentrycurrcount{\@glsentry}}}}% + {}% }% } -\newcommand{\ifglossaryexists}{% - \@ifstar\s@ifglossaryexists\@ifglossaryexists -} -\newcommand{\@ifglossaryexists}[3]{% - \ifcsundef{@glotype@#1@out}{#3}{#2}% -} -\newcommand{\s@ifglossaryexists}[3]{% - \ifcsundef{glolist@#1}{#3}{#2}% -} -\newcommand*{\glsdetoklabel}[1]{#1} -\newcommand{\ifglsentryexists}[3]{% - \ifcsundef{glo@\glsdetoklabel{#1}@name}{#3}{#2}% +\newcommand*{\@gls@entry@count}[2]{} +\newrobustcmd*{\cgls}{\@gls@hyp@opt\@cgls} +\newcommand*{\@cgls}[2][]{% + \new@ifnextchar[{\@cgls@{#1}{#2}}{\@cgls@{#1}{#2}[]}% } -\newcommand*{\ifglsused}[3]{% - \ifbool{glo@\glsdetoklabel{#1}@flag}{#2}{#3}% +\def\@cgls@#1#2[#3]{% + \GlossariesWarning{\string\cgls\space is defaulting to + \string\gls\space since you haven't enabled entry counting}% + \@gls@{#1}{#2}[#3]% } -\newcommand{\glsdoifexists}[2]{% - \ifglsentryexists{#1}{#2}{% - \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' - has not been defined}{You need to define a glossary entry before you - can use it.}}% +\newcommand*{\cglsformat}[2]{% + \ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}#2% } -\newcommand{\glsdoifnoexists}[2]{% - \ifglsentryexists{#1}{% - \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' has already - been defined}{}}{#2}% +\newrobustcmd*{\cGls}{\@gls@hyp@opt\@cGls} +\newcommand*{\@cGls}[2][]{% + \new@ifnextchar[{\@cGls@{#1}{#2}}{\@cGls@{#1}{#2}[]}% } -\newcommand{\glsdoifexistsorwarn}[2]{% - \ifglsentryexists{#1}{#2}{% - \GlossariesWarning{Glossary entry `\glsdetoklabel{#1}' - has not been defined}% - }% +\def\@cGls@#1#2[#3]{% + \GlossariesWarning{\string\cGls\space is defaulting to + \string\Gls\space since you haven't enabled entry counting}% + \@Gls@{#1}{#2}[#3]% } -\newcommand{\glsdoifexistsordo}[3]{% - \ifglsentryexists{#1}{#2}{% - \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' - has not been defined}{You need to define a glossary entry before you - can use it.}% - #3% - }% +\newcommand*{\cGlsformat}[2]{% + \ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}#2% } -\newcommand{\doifglossarynoexistsordo}[3]{% - \ifglossaryexists*{#1}% - {% - \PackageError{glossaries}{Glossary type `#1' already exists}{}% - #3% - }% - {#2}% +\newrobustcmd*{\cglspl}{\@gls@hyp@opt\@cglspl} +\newcommand*{\@cglspl}[2][]{% + \new@ifnextchar[{\@cglspl@{#1}{#2}}{\@cglspl@{#1}{#2}[]}% } -\newrobustcmd{\ifglshaschildren}[3]{% - \glsdoifexists{#1}% - {% - \def\do@glshaschildren{#3}% - \edef\@gls@thislabel{\glsdetoklabel{#1}}% - \expandafter\forglsentries\expandafter - [\csname glo@\@gls@thislabel @type\endcsname] - {\glo@label}% - {% - \letcs\glo@parent{glo@\glo@label @parent}% - \ifdefequal\@gls@thislabel\glo@parent - {% - \def\do@glshaschildren{#2}% - \@endfortrue - }% - {}% - }% - \do@glshaschildren - }% +\def\@cglspl@#1#2[#3]{% + \GlossariesWarning{\string\cglspl\space is defaulting to + \string\glspl\space since you haven't enabled entry counting}% + \@glspl@{#1}{#2}[#3]% } -\newcommand{\ifglshasparent}[3]{% - \glsdoifexists{#1}% - {% - \ifcsempty{glo@\glsdetoklabel{#1}@parent}{#3}{#2}% - }% +\newcommand*{\cglsplformat}[2]{% + \ifglshaslong{#1}{\glsentrylongpl{#1}}{\glsentryfirstplural{#1}}#2% } -\newcommand*{\ifglshasdesc}[3]{% - \ifcsempty{glo@\glsdetoklabel{#1}@desc}% - {#3}% - {#2}% +\newrobustcmd*{\cGlspl}{\@gls@hyp@opt\@cGlspl} +\newcommand*{\@cGlspl}[2][]{% + \new@ifnextchar[{\@cGlspl@{#1}{#2}}{\@cGlspl@{#1}{#2}[]}% } -\newcommand*{\ifglsdescsuppressed}[3]{% - \ifcsequal{glo@\glsdetoklabel{#1}@desc}{@no@post@desc}% - {#2}% - {#3}% +\def\@cGlspl@#1#2[#3]{% + \GlossariesWarning{\string\cGlspl\space is defaulting to + \string\Glspl\space since you haven't enabled entry counting}% + \@Glspl@{#1}{#2}[#3]% } -\newrobustcmd*{\ifglshassymbol}[3]{% - \letcs{\@glo@symbol}{glo@\glsdetoklabel{#1}@symbol}% - \ifdefempty\@glo@symbol - {#3}% - {% - \ifdefequal\@glo@symbol\@gls@default@value - {#3}% - {#2}% - }% +\newcommand*{\cGlsplformat}[2]{% + \ifglshaslong{#1}{\Glsentrylongpl{#1}}{\Glsentryfirstplural{#1}}#2% } -\newrobustcmd*{\ifglshaslong}[3]{% - \letcs{\@glo@long}{glo@\glsdetoklabel{#1}@long}% - \ifdefempty\@glo@long - {#3}% - {% - \ifdefequal\@glo@long\@gls@default@value - {#3}% - {#2}% - }% +\newcommand*{\loadglsentries}[2][\@gls@default]{% + \let\@gls@default\glsdefaulttype + \def\glsdefaulttype{#1}\input{#2}% + \let\glsdefaulttype\@gls@default } -\newrobustcmd*{\ifglshasshort}[3]{% - \letcs{\@glo@short}{glo@\glsdetoklabel{#1}@short}% - \ifdefempty\@glo@short - {#3}% - {% - \ifdefequal\@glo@short\@gls@default@value - {#3}% - {#2}% - }% +\@onlypreamble{\loadglsentries} +\newcommand*{\glstextformat}[1]{#1} +\newcommand*{\glsentryfmt}{% + \@@gls@default@entryfmt\glsdisplayfirst\glsdisplay } -\newrobustcmd*{\ifglshasfield}[4]{% - \glsdoifexists{#2}% +\newcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext {% - \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@#1}% - \ifdef\@glo@thisvalue + \glsifplural {% - \ifdefempty\@glo@thisvalue - {% - #4% - }% + \glscapscase {% - \ifdefequal\@glo@thisvalue\@gls@default@value + \ifglsused\glslabel {% - #4% + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% }% {% - \let\glscurrentfieldvalue\@glo@thisvalue - #3% + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{#2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + {% + \mfirstucMakeUppercase{#1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + {% + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{#2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + }% + {% + \mfirstucMakeUppercase{#1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% }% }% - }% - {% - \@gls@fetchfield{\@gls@thisfield}{#1}% - \ifdef\@gls@thisfield - {% - \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@\@gls@thisfield}% - \ifdefempty\@glo@thisvalue - {% - #4% - }% - {% - \ifdefequal\@glo@thisvalue\@gls@default@value - {% - #4% - }% - {% - \let\glscurrentfieldvalue\@glo@thisvalue - #3% - }% - }% - }% - {% - \GlossariesWarning{Unknown entry field `#1'}% - #4% - }% }% }% -} -\newcommand*{\glscurrentfieldvalue}{} -\newcommand*{\@glo@types}{,} -\newcommand*\@gls@provide@newglossary{% - \protected@write\@auxout{}{\string\providecommand\string\@newglossary[4]{}}% - \let\@gls@provide@newglossary\relax -} -\newcommand*{\defglsentryfmt}[2][\glsdefaulttype]{% - \csgdef{gls@#1@entryfmt}{#2}% -} -\newcommand*{\gls@doentryfmt}[1]{\csuse{gls@#1@entryfmt}} -\newcommand*{\@gls@forbidtexext}[1]{% - \ifboolexpr{test {\ifdefstring{#1}{tex}} - or test {\ifdefstring{#1}{TEX}}} - {% - \def#1{nottex}% - \PackageError{glossaries}% - {Forbidden `.tex' extension replaced with `.nottex'}% - {I'm sorry, I can't allow you to do something so reckless.\MessageBreak - Don't use `.tex' as an extension for a temporary file.}% - }% - {% - }% -} -\newcommand*{\gls@gobbleopt}{\new@ifnextchar[{\@gls@gobbleopt}{}} -\def\@gls@gobbleopt[#1]{} -\newcommand*{\newglossary}{\@ifstar\s@newglossary\ns@newglossary} -\newcommand*{\s@newglossary}[2]{% - \ns@newglossary[#1-glg]{#1}{#1-gls}{#1-glo}{#2}% -} -\newcommand*{\ns@newglossary}[5][glg]{% - \doifglossarynoexistsordo{#2}% - {% - \ifundef\glsdefaulttype - {% - \gdef\glsdefaulttype{#2}% - }{}% - \toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}% - \expandafter\gdef\csname glolist@#2\endcsname{,}% - \expandafter\edef\csname @glotype@#2@log\endcsname{#1}% - \expandafter\edef\csname @glotype@#2@in\endcsname{#3}% - \expandafter\edef\csname @glotype@#2@out\endcsname{#4}% - \expandafter\@gls@forbidtexext\csname @glotype@#2@log\endcsname - \expandafter\@gls@forbidtexext\csname @glotype@#2@in\endcsname - \expandafter\@gls@forbidtexext\csname @glotype@#2@out\endcsname - \expandafter\def\csname @glotype@#2@title\endcsname{#5}% - \@gls@provide@newglossary - \protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}% - \ifcsundef{gls@#2@entryfmt}% {% - \defglsentryfmt[#2]{\glsentryfmt}% + \ifglsused{\glslabel}% + {% + #2{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% + }% + {% + #1{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% + }% }% - {}% - \@gls@defsortcount{#2}% - \@ifnextchar[{\@gls@setcounter{#2}}% - {\@gls@setcounter{#2}[\glscounter]}% - }% - {% - \gls@gobbleopt - }% -} -\newcommand*{\altnewglossary}[3]{% - \newglossary[#2-glg]{#1}{#2-gls}{#2-glo}{#3}% -} -\@onlypreamble{\newglossary} -\@onlypremakeg\newglossary -\newcommand*{\@newglossary}[4]{} -\def\@gls@setcounter#1[#2]{% - \expandafter\def\csname @glotype@#1@counter\endcsname{#2}% - \ifglsxindy - \GlsAddXdyCounters{#2}% - \fi -} -\newcommand*{\@gls@getcounter}[1]{% - \csname @glotype@#1@counter\endcsname } -\glsdefmain -\@gls@do@acronymsdef -\@gls@do@symbolsdef -\@gls@do@numbersdef -\@gls@do@indexdef -\newcommand*{\newignoredglossary}[1]{% - \ifdefempty\@ignored@glossaries - {% - \edef\@ignored@glossaries{#1}% - }% +\newcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext {% - \eappto\@ignored@glossaries{,#1}% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glsentryplural{\glslabel}\glsinsert + }% + {% + \glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \Glsentryplural{\glslabel}\glsinsert + }% + {% + \Glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase + {\glsentryplural{\glslabel}\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\glsentryfirstplural{\glslabel}\glsinsert}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glsentrytext{\glslabel}\glsinsert + }% + {% + \glsentryfirst{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \Glsentrytext{\glslabel}\glsinsert + }% + {% + \Glsentryfirst{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{\glsentrytext{\glslabel}\glsinsert}% + }% + {% + \mfirstucMakeUppercase{\glsentryfirst{\glslabel}\glsinsert}% + }% + }% + }% }% - \csgdef{glolist@#1}{,}% - \ifcsundef{gls@#1@entryfmt}% {% - \defglsentryfmt[#1]{\glsentryfmt}% + \glscustomtext\glsinsert }% - {}% - \ifdefempty\@gls@nohyperlist +} +\newcommand*{\glsgenacfmt}{% + \ifdefempty\glscustomtext {% - \renewcommand*{\@gls@nohyperlist}{#1}% + \ifglsused\glslabel + {% + \glsifplural + {% + \glscapscase + {% + \acronymfont{\glsentryshortpl{\glslabel}}\glsinsert + }% + {% + \acronymfont{\Glsentryshortpl{\glslabel}}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{\glsentryshortpl{\glslabel}}\glsinsert}% + }% + }% + {% + \glscapscase + {% + \acronymfont{\glsentryshort{\glslabel}}\glsinsert + }% + {% + \acronymfont{\Glsentryshort{\glslabel}}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{\glsentryshort{\glslabel}}\glsinsert}% + }% + }% + }% + {% + \glsifplural + {% + \glscapscase + {% + \genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genplacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + {% + \glscapscase + {% + \genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% }% {% - \eappto\@gls@nohyperlist{,#1}% + \glscustomtext }% } -\newcommand*{\@ignored@glossaries}{} -\newcommand*{\ifignoredglossary}[3]{% - \edef\@gls@igtype{#1}% - \expandafter\DTLifinlist\expandafter - {\@gls@igtype}{\@ignored@glossaries}{#2}{#3}% -} -\define@key{glossentry}{name}{% -\def\@glo@name{#1}% -} -\define@key{glossentry}{description}{% -\def\@glo@desc{#1}% -} -\define@key{glossentry}{descriptionplural}{% -\def\@glo@descplural{#1}% -} -\define@key{glossentry}{sort}{% -\def\@glo@sort{#1}} -\define@key{glossentry}{text}{% -\def\@glo@text{#1}% +\newcommand*{\genacrfullformat}[2]{% + \glsentrylong{#1}#2\space + (\protect\firstacronymfont{\glsentryshort{#1}})% } -\define@key{glossentry}{plural}{% -\def\@glo@plural{#1}% +\newcommand*{\Genacrfullformat}[2]{% + \protected@edef\gls@text{\genacrfullformat{#1}{#2}}% + \xmakefirstuc\gls@text } -\define@key{glossentry}{first}{% -\def\@glo@first{#1}% +\newcommand*{\genplacrfullformat}[2]{% + \glsentrylongpl{#1}#2\space + (\protect\firstacronymfont{\glsentryshortpl{#1}})% } -\define@key{glossentry}{firstplural}{% -\def\@glo@firstplural{#1}% +\newcommand*{\Genplacrfullformat}[2]{% + \protected@edef\gls@text{\genplacrfullformat{#1}{#2}}% + \xmakefirstuc\gls@text } -\newcommand*{\@gls@default@value}{\relax} -\define@key{glossentry}{symbol}{% -\def\@glo@symbol{#1}% +\newcommand*{\glsdisplayfirst}[4]{#1#4} +\newcommand*{\glsdisplay}[4]{#1#4} +\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplay\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@displayfirst}% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\csuse{gls@#1@display}}% + }% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\glsdisplayfirst}% + {\noexpand\csuse{gls@#1@display}}% + }% + }% + }% + \@gls@doentrydef } -\define@key{glossentry}{symbolplural}{% -\def\@glo@symbolplural{#1}% +\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplayfirst\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@display}% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\csuse{gls@#1@display}}% + }% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\glsdisplay}% + }% + }% + }% + \@gls@doentrydef } -\define@key{glossentry}{type}{% -\def\@glo@type{#1}} -\define@key{glossentry}{counter}{% +\define@key{glslink}{counter}{% \ifcsundef{c@#1}% {% \PackageError{glossaries}% {There is no counter called `#1'}% {% - The counter key should have the name of a valid counter - as its value% + The counter key should have the name of a valid counter + as its value% }% }% {% - \def\@glo@counter{#1}% + \def\@gls@counter{#1}% }% } -\define@key{glossentry}{see}{% - \gls@set@xr@key{see}{\@glo@see}{#1}% -} -\newcommand*{\gls@set@xr@key}[3]{% - \renewcommand*{\gls@xr@key}{#1}% - \gls@checkseeallowed - \def#2{#3}% - \@glo@seeautonumberlist +\define@key{glslink}{format}{% + \def\@glsnumberformat{#1}} +\define@boolkey{glslink}{hyper}[true]{} +\ifdef{\hyperlink}{\KV@glslink@hypertrue}{\KV@glslink@hyperfalse} +\define@boolkey{glslink}{local}[true]{} +\newcommand*{\glslinkvar}[3]{#1} +\newcommand*{\glsifhyper}[2]{% + \glslinkvar{#1}{#2}{#1}% + \GlossariesWarning{\string\glsifhyper\space is deprecated. Did + you mean \string\glsifhyperon\space or \string\glslinkvar?}% } -\newcommand*{\gls@xr@key}{see} -\newcommand*{\gls@checkseeallowed}{% - \@gls@see@noindex +\newcommand*{\@gls@hyp@opt}[1]{% + \let\glslinkvar\@firstofthree + \let\@gls@hyp@opt@cs#1\relax + \@ifstar{\s@gls@hyp@opt}% + {\@ifnextchar+{\@firstoftwo{\p@gls@hyp@opt}}{#1}}% } -\newcommand*{\gls@checkseeallowed@preambleonly}{% - \GlossariesWarning{glossaries}% - {`\gls@xr@key' key doesn't have any effect when used in the document - environment. Move the definition to the preamble - after \string\makeglossaries\space - or \string\makenoidxglossaries}% +\newcommand*{\s@gls@hyp@opt}[1][]{% + \let\glslinkvar\@secondofthree + \@gls@hyp@opt@cs[hyper=false,#1]} +\newcommand*{\p@gls@hyp@opt}[1][]{% + \let\glslinkvar\@thirdofthree + \@gls@hyp@opt@cs[hyper=true,#1]} +\newrobustcmd*{\glslink}{% + \@gls@hyp@opt\@gls@@link } -\define@key{glossentry}{parent}{% -\def\@glo@parent{#1}} -\define@choicekey{glossentry}{nonumberlist}% - [\gls@nonumberlist@val\gls@nonumberlist@nr]{true,false}[true]% -{% - \ifcase\gls@nonumberlist@nr\relax - \def\@glo@prefix{\glsnonextpages}% - \@gls@savenonumberlist{true}% - \else - \def\@glo@prefix{\glsnextpages}% - \@gls@savenonumberlist{false}% - \fi +\newcommand*{\@gls@@link}[3][]{% + \glsdoifexistsordo{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \@gls@link[#1]{#2}{#3}% + }{% + \glstextformat{#3}% + }% + \glspostlinkhook } -\newcommand*{\@gls@savenonumberlist}[1]{} -\newcommand*{\@gls@initnonumberlist}{}% -\newcommand*{\@gls@storenonumberlist}[1]{} -\newcommand*{\@gls@enablesavenonumberlist}{% - \renewcommand*{\@gls@initnonumberlist}{% - \undef\@glo@nonumberlist +\newcommand*{\glspostlinkhook}{} +\newcommand*{\@gls@link@checkfirsthyper}{% + \ifglsused{\glslabel}% + {% }% - \renewcommand*{\@gls@savenonumberlist}[1]{% - \def\@glo@nonumberlist{##1}% - }% - \renewcommand*{\@gls@storenonumberlist}[1]{% - \ifdef\@glo@nonumberlist - {% - \cslet{glo@\glsdetoklabel{##1}@nonumberlist}{\@glo@nonumberlist}% - }% - {}% - }% - \appto\@gls@keymap{,{nonumberlist}{nonumberlist}}% -} -\define@key{glossentry}{user1}{% - \def\@glo@useri{#1}% -} -\define@key{glossentry}{user2}{% - \def\@glo@userii{#1}% -} -\define@key{glossentry}{user3}{% - \def\@glo@useriii{#1}% -} -\define@key{glossentry}{user4}{% - \def\@glo@useriv{#1}% -} -\define@key{glossentry}{user5}{% - \def\@glo@userv{#1}% -} -\define@key{glossentry}{user6}{% - \def\@glo@uservi{#1}% -} -\define@key{glossentry}{short}{% - \def\@glo@short{#1}% -} -\define@key{glossentry}{shortplural}{% - \def\@glo@shortpl{#1}% -} -\define@key{glossentry}{long}{% - \def\@glo@long{#1}% -} -\define@key{glossentry}{longplural}{% - \def\@glo@longpl{#1}% -} -\newcommand*{\@glsnoname}{% - \PackageError{glossaries}{name key required in - \string\newglossaryentry\space for entry `\@glo@label'}{You - haven't specified the entry name}} -\newcommand*\@glsnodesc{% - \PackageError{glossaries} {% - description key required in \string\newglossaryentry\space - for entry `\@glo@label'% - }% - {% - You haven't specified the entry description% + \gls@checkisacronymlist\glstype + \ifglshyperfirst + \if@glsisacronymlist + \ifglsacrfootnote + \KV@glslink@hyperfalse + \fi + \fi + \else + \KV@glslink@hyperfalse + \fi }% -}% -\newcommand*{\@glsdefaultplural}{} -\newcommand*{\@gls@missingnumberlist}[1]{% - ??% - \ifglssavenumberlist - \GlossariesWarning{Missing number list for entry `#1'. - Maybe makeglossaries + rerun required}% - \else - \PackageError{glossaries}% - {Package option `savenumberlist=true' required}% - {% - You must use the `savenumberlist' package option - to reference location lists.% - }% - \fi + \glslinkcheckfirsthyperhook } -\newcommand*{\@glsdefaultsort}{\@glo@name} -\newcount\gls@level -\newcommand{\@@gls@noexpand@field}[3]{% - \expandafter\global\expandafter - \let\csname glo@#1@#2\endcsname#3% +\newcommand*{\glslinkcheckfirsthyperhook}{} +\newcommand*{\glslinkpostsetkeys}{} +\newcommand{\glsifhyperon}[2]{\ifKV@glslink@hyper#1\else#2\fi} +\newcommand*{\do@glsdisablehyperinlist}{% + \expandafter\DTLifinlist\expandafter{\glstype}{\@gls@nohyperlist}% + {\KV@glslink@hyperfalse}{}% } -\newcommand{\@gls@noexpand@fields}[4]{% - \ifcsdef{gls@assign@#3@field} - {% - \ifdefequal{#4}{\@gls@default@value}% - {% - \edef\@gls@value{\expandonce{#1}}% - \csuse{gls@assign@#3@field}{#2}{\@gls@value}% - }% - {% - \csuse{gls@assign@#3@field}{#2}{#4}% - }% - }% - {% - \ifdefequal{#4}{\@gls@default@value}% +\newcommand*{\@gls@setdefault@glslink@opts}{} +\def\@gls@link[#1]#2#3{% + \leavevmode + \edef\glslabel{\glsdetoklabel{#2}}% + \def\@gls@link@opts{#1}% + \let\@gls@link@label\glslabel + \def\@glsnumberformat{glsnumberformat}% + \edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% + \edef\glstype{\csname glo@\glslabel @type\endcsname}% + \let\org@ifKV@glslink@hyper\ifKV@glslink@hyper + \@gls@setdefault@glslink@opts + \do@glsdisablehyperinlist + \do@gls@link@checkfirsthyper + \setkeys{glslink}{#1}% + \glslinkpostsetkeys + \@gls@saveentrycounter + \@gls@setsort{\glslabel}% + \@do@wrglossary{#2}% + \ifKV@glslink@hyper + \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \else + \glsdonohyperlink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \fi + \let\ifKV@glslink@hyper\org@ifKV@glslink@hyper +} +\newcommand*{\glolinkprefix}{glo:} +\def\glsentrycounter{\glscounter}% +\newcommand*{\@gls@saveentrycounter}{% + \def\@gls@Hcounter{}% + \ifthenelse{\equal{\@gls@counter}{equation}}% + { + \ifcsundef{xatlevel@}% {% - \edef\@gls@value{\expandonce{#1}}% - \@@gls@noexpand@field{#2}{#3}{\@gls@value}% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% }% {% - \@@gls@noexpand@field{#2}{#3}{#4}% + \ifx\xatlevel@\@empty + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + \else + \savecounters@ + \advance\c@equation by 1\relax + \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% + \ifcsundef{theH\@gls@counter}% + {% + \def\@gls@Hcounter{\theglsentrycounter}% + }% + {% + \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}% + }% + \protected@edef\theHglsentrycounter{\@gls@Hcounter}% + \restorecounters@ + \fi }% }% -} -\newcommand{\@@gls@expand@field}[3]{% - \expandafter - \protected@xdef\csname glo@#1@#2\endcsname{#3}% -} -\newcommand{\@gls@expand@fields}[4]{% - \ifcsdef{gls@assign@#3@field} {% - \ifdefequal{#4}{\@gls@default@value}% - {% - \edef\@gls@value{\expandonce{#1}}% - \csuse{gls@assign@#3@field}{#2}{\@gls@value}% - }% - {% - \expandafter\@gls@startswithexpandonce#4\relax\relax\gls@endcheck - {% - \@@gls@expand@field{#2}{#3}{#4}% - }% - {% - \csuse{gls@assign@#3@field}{#2}{#4}% - }% - }% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% }% - {% - \ifdefequal{#4}{\@gls@default@value}% + \ifx\@gls@Hcounter\@empty + \ifcsundef{theH\@gls@counter}% {% - \@@gls@expand@field{#2}{#3}{#1}% + \def\theHglsentrycounter{\theglsentrycounter}% }% {% - \@@gls@expand@field{#2}{#3}{#4}% + \protected@edef\theHglsentrycounter{\expandafter\noexpand + \csname theH\@gls@counter\endcsname}% }% - }% -} -\def\@gls@expandonce{\expandonce} -\def\@gls@startswithexpandonce#1#2\gls@endcheck#3#4{% - \def\@gls@tmp{#1}% - \ifdefequal{\@gls@expandonce}{\@gls@tmp}{#3}{#4}% -} -\let\gls@assign@field\@gls@expand@fields -\newcommand*{\glsexpandfields}{% - \let\gls@assign@field\@gls@expand@fields -} -\newcommand*{\glsnoexpandfields}{% - \let\gls@assign@field\@gls@noexpand@fields -} -\newrobustcmd{\newglossaryentry}[2]{% - \glsdoifnoexists{#1}% - {% - \gls@defglossaryentry{#1}{#2}% - }% -} -\newcommand*{\gls@defdocnewglossaryentry}{% - \let\gls@checkseeallowed\gls@checkseeallowed@preambleonly - \let\newglossaryentry\new@glossaryentry -} -\newrobustcmd{\provideglossaryentry}[2]{% - \ifglsentryexists{#1}% - {}% - {% - \gls@defglossaryentry{#1}{#2}% - }% + \fi } -\@onlypreamble{\provideglossaryentry} -\newrobustcmd{\new@glossaryentry}[2]{% - \ifundef\@gls@deffile - {% - \global\newwrite\@gls@deffile - \immediate\openout\@gls@deffile=\jobname.glsdefs - }% - {}% - \ifglsentryexists{#1}{}% - {% - \gls@defglossaryentry{#1}{#2}% +\def\@set@glo@numformat#1#2#3#4{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[#4]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname }% - \@gls@writedef{#1}% -} -\AtBeginDocument{\gls@begindocdefs} -\AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} -\newcommand*{\gls@begindocdefs}{% - \@gls@enablesavenonumberlist - \edef\@gls@restoreat{\noexpand\catcode`\noexpand\@=\number\catcode`\@\relax}% - \makeatletter - \InputIfFileExists{\jobname.glsdefs}{}{}% - \@gls@restoreat - \undef\@gls@restoreat - \gls@defdocnewglossaryentry + \@gls@checkmkidxchars#1% } -\newcommand*{\@gls@writedef}[1]{% - \immediate\write\@gls@deffile - {% - \string\ifglsentryexists{#1}{}\glspercentchar^^J% - \expandafter\@gobble\string\{\glspercentchar^^J% - \string\gls@defglossaryentry{\glsdetoklabel{#1}}\glspercentchar^^J% - \expandafter\@gobble\string\{\glspercentchar% - }% - \@for\@gls@map:=\@gls@keymap\do +\def\@glo@check@mkidxrangechar#1#2\@nil{% +\if#1(\relax + \def\@glo@prefix{(}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi +\else + \if#1)\relax + \def\@glo@prefix{)}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi + \else + \def\@glo@prefix{}\def\@glo@suffix{#1#2}% + \fi +\fi} +\newcommand*{\@gls@escbsdq}[1]{% + \def\@gls@checkedmkidx{}% + \let\gls@xdystring=#1\relax + \@onelevel@sanitize\gls@xdystring + \edef\do@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null}% + \do@gls@xdycheckbackslash + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \@for\@gls@tmp:=\gls@protected@pagefmts\do {% - \letcs\glo@value{glo@\glsdetoklabel{#1}@\expandafter\@secondoftwo\@gls@map}% - \ifdef\glo@value - {% - \@onelevel@sanitize\glo@value - \immediate\write\@gls@deffile - {% - \expandafter\@firstoftwo\@gls@map - =\expandafter\@gobble\string\{\glo@value\expandafter\@gobble\string\},% - \glspercentchar - }% + \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% + \@onelevel@sanitize\@gls@sanitized@tmp + \edef\gls@dosubst{% + \noexpand\DTLsubstituteall\noexpand\gls@xdystring + {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% }% - {}% - }% - \glswritedefhook - \immediate\write\@gls@deffile - {% - \glspercentchar^^J% - \expandafter\@gobble\string\}\glspercentchar^^J% - \expandafter\@gobble\string\}\glspercentchar% + \gls@dosubst }% + \let#1=\gls@xdystring } -\newcommand*{\@gls@keymap}{% - {name}{name},% - {sort}{sortvalue},% unescaped sort value - {type}{type},% - {first}{first},% - {firstplural}{firstpl},% - {text}{text},% - {plural}{plural},% - {description}{desc},% - {descriptionplural}{descplural},% - {symbol}{symbol},% - {symbolplural}{symbolplural},% - {user1}{useri},% - {user2}{userii},% - {user3}{useriii},% - {user4}{useriv},% - {user5}{userv},% - {user6}{uservi},% - {long}{long},% - {longplural}{longpl},% - {short}{short},% - {shortplural}{shortpl},% - {counter}{counter},% - {parent}{parent}% +\newcommand{\@gls@checkmkidxchars}[1]{% + \ifglsxindy + \@gls@escbsdq{#1}% + \else + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkquote#1\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescquote#1\@nil\"\"\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescactual#1\@nil\?\?\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkactual#1\@nil??\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkbar#1\@nil||\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescbar#1\@nil\|\|\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checklevel#1\@nil!!\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \fi } -\newcommand*{\@gls@fetchfield}[2]{% - \edef\@gls@thisval{#2}% - \@for\@gls@map:=\@gls@keymap\do{% - \edef\@this@key{\expandafter\@firstoftwo\@gls@map}% - \ifdefequal{\@this@key}{\@gls@thisval}% - {% - \edef#1{\expandafter\@secondoftwo\@gls@map}% - \@endfortrue - }% - {}% - }% +\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} +\newtoks\@gls@tmpb +\def\@gls@checkquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}% + \def\@@gls@checkquote{\@gls@checkquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkquote{\@gls@checkquote#2""\null}% + \else + \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}% + \fi + \fi + \@@gls@checkquote } -\newcommand*{\glsaddstoragekey}{\@ifstar\@sglsaddstoragekey\@glsaddstoragekey} -\newcommand*{\@sglsaddstoragekey}[1]{% - \key@ifundefined{glossentry}{#1}% - {% - \expandafter\newcommand\expandafter*\expandafter - {\csname gls@assign@#1@field\endcsname}[2]{% - \@@gls@expand@field{##1}{#1}{##2}% - }% - }% - {}% - \@glsaddstoragekey{#1}% +\def\@gls@checkescquote#1\"#2\"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar + \@gls@quotechar\string\"\@gls@quotechar}% + \def\@@gls@checkescquote{\@gls@checkescquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}% + \else + \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}% + \fi + \fi +\@@gls@checkescquote } -\newcommand*{\@glsaddstoragekey}[3]{% - \key@ifundefined{glossentry}{#1}% - {% - \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% - \appto\@gls@keymap{,{#1}{#1}}% - \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% - \appto\@newglossaryentryposthook{% - \letcs{\@glo@tmp}{@glo@#1}% - \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% - }% - \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% - }% - {% - \PackageError{glossaries}{Key `#1' already exists}{}% - }% +\def\@gls@checkescactual#1\?#2\?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar + \@gls@quotechar\string\"\@gls@actualchar}% + \def\@@gls@checkescactual{\@gls@checkescactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}% + \else + \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}% + \fi + \fi +\@@gls@checkescactual } -\newcommand*{\glsaddkey}{\@ifstar\@sglsaddkey\@glsaddkey} -\newcommand*{\@sglsaddkey}[1]{% - \key@ifundefined{glossentry}{#1}% - {% - \expandafter\newcommand\expandafter*\expandafter - {\csname gls@assign@#1@field\endcsname}[2]{% - \@@gls@expand@field{##1}{#1}{##2}% - }% - }% - {}% - \@glsaddkey{#1}% +\def\@gls@checkescbar#1\|#2\|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar + \@gls@quotechar\string\"\@gls@encapchar}% + \def\@@gls@checkescbar{\@gls@checkescbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}% + \else + \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}% + \fi + \fi +\@@gls@checkescbar } -\newcommand*{\@glsaddkey}[7]{% - \key@ifundefined{glossentry}{#1}% - {% - \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% - \appto\@gls@keymap{,{#1}{#1}}% - \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% - \appto\@newglossaryentryposthook{% - \letcs{\@glo@tmp}{@glo@#1}% - \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% - }% - \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% - \newcommand*{#4}[1]{\@Gls@entry@field{##1}{#1}}% - \ifcsdef{@gls@user@#1@}% - {% - \PackageError{glossaries}% - {Can't define `\string#5' as helper command - `\expandafter\string\csname @gls@user@#1@\endcsname' already exists}% - {}% - }% - {% - \expandafter\newcommand\expandafter*\expandafter - {\csname @gls@user@#1\endcsname}[2][]{% - \new@ifnextchar[% - {\csuse{@gls@user@#1@}{##1}{##2}}% - {\csuse{@gls@user@#1@}{##1}{##2}[]}}% - \csdef{@gls@user@#1@}##1##2[##3]{% - \@gls@field@link{##1}{##2}{#3{##2}##3}% - }% - \newrobustcmd*{#5}{% - \expandafter\@gls@hyp@opt\csname @gls@user@#1\endcsname}% - }% - \ifcsdef{@Gls@user@#1@}% - {% - \PackageError{glossaries}% - {Can't define `\string#6' as helper command - `\expandafter\string\csname @Gls@user@#1@\endcsname' already exists}% - {}% - }% - {% - \expandafter\newcommand\expandafter*\expandafter - {\csname @Gls@user@#1\endcsname}[2][]{% - \new@ifnextchar[% - {\csuse{@Gls@user@#1@}{##1}{##2}}% - {\csuse{@Gls@user@#1@}{##1}{##2}[]}}% - \csdef{@Gls@user@#1@}##1##2[##3]{% - \@gls@field@link{##1}{##2}{#4{##2}##3}% - }% - \newrobustcmd*{#6}{% - \expandafter\@gls@hyp@opt\csname @Gls@user@#1\endcsname}% - }% - \ifcsdef{@GLS@user@#1@}% - {% - \PackageError{glossaries}% - {Can't define `\string#7' as helper command - `\expandafter\string\csname @GLS@user@#1@\endcsname' already exists}% - {}% - }% - {% - \expandafter\newcommand\expandafter*\expandafter - {\csname @GLS@user@#1\endcsname}[2][]{% - \new@ifnextchar[% - {\csuse{@GLS@user@#1@}{##1}{##2}}% - {\csuse{@GLS@user@#1@}{##1}{##2}[]}}% - \csdef{@GLS@user@#1@}##1##2[##3]{% - \@gls@field@link{##1}{##2}{\mfirstucMakeUppercase{#3{##2}##3}}% - }% - \newrobustcmd*{#7}{% - \expandafter\@gls@hyp@opt\csname @GLS@user@#1\endcsname}% - }% - }% - {% - \PackageError{glossaries}{Key `#1' already exists}{}% - }% +\def\@gls@checkesclevel#1\!#2\!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkesclevel{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar + \@gls@quotechar\string\"\@gls@levelchar}% + \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}% + \else + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}% + \fi + \fi +\@@gls@checkesclevel } -\newcommand{\glsfieldxdef}[3]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \protected@csxdef{glo@\@glo@label @#2}{#3}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\def\@gls@checkbar#1|#2|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}% + \def\@@gls@checkbar{\@gls@checkbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkbar{\@gls@checkbar#2||\null}% + \else + \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}% + \fi + \fi + \@@gls@checkbar } -\newcommand{\glsfieldedef}[3]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \protected@csedef{glo@\@glo@label @#2}{#3}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\def\@gls@checklevel#1!#2!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checklevel{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}% + \def\@@gls@checklevel{\@gls@checklevel#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checklevel{\@gls@checklevel#2!!\null}% + \else + \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}% + \fi + \fi + \@@gls@checklevel } -\newcommand{\glsfieldgdef}[3]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \expandafter\gdef\csname glo@\@glo@label @#2\endcsname{#3}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\def\@gls@checkactual#1?#2?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}% + \def\@@gls@checkactual{\@gls@checkactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkactual{\@gls@checkactual#2??\null}% + \else + \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}% + \fi + \fi + \@@gls@checkactual } -\newcommand{\glsfielddef}[3]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \expandafter\def\csname glo@\@glo@label @#2\endcsname{#3}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\def\@gls@xdycheckquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@xdycheckquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"\string\"}% + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"}% + \ifx\null#3\null + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}% + \else + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}% + \fi + \fi + \@@gls@xdycheckquote } -\newcommand{\glsfieldfetch}[3]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \letcs#3{glo@\@glo@label @#2}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% +\edef\def@gls@xdycheckbackslash{% + \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar + ##2\@backslashchar##3\noexpand\null{% + \noexpand\@gls@tmpb=\noexpand\expandafter + {\noexpand\@gls@checkedmkidx}% + \noexpand\toks@={##1}% + \noexpand\ifx\noexpand\null##2\noexpand\null + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}% + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar\@backslashchar\@backslashchar}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##3\noexpand\null}% + \noexpand\fi + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar}% + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + \@backslashchar\noexpand\null}% + \noexpand\else + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + ##3\noexpand\null}% + \noexpand\fi + \noexpand\fi + \noexpand\@@gls@xdycheckbackslash }% } -\newcommand{\ifglsfieldeq}[5]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \ifcsstring{glo@\@glo@label @#2}{#3}{#4}{#5}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\def@gls@xdycheckbackslash + +\newlength\gls@tmplen +\newcommand*{\glsdohypertarget}[2]{% + \@glsshowtarget{#1}% + \settoheight{\gls@tmplen}{#2}% + \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% } -\newcommand{\ifglsfielddefeq}[5]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \expandafter\ifdefstrequal - \csname glo@\@glo@label @#2\endcsname{#3}{#4}{#5}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\newcommand*{\glsdohyperlink}[2]{% + \@glsshowtarget{#1}% + \hyperlink{#1}{#2}% } -\newcommand{\ifglsfieldcseq}[5]{% - \glsdoifexists{#1}% - {% - \edef\@glo@label{\glsdetoklabel{#1}}% - \ifcsdef{glo@\@glo@label @#2}% - {% - \ifcsstrequal{glo@\@glo@label @#2}{#3}{#4}{#5}% - }% - {% - \PackageError{glossaries}{Key `#2' doesn't exist}{}% - }% - }% +\newcommand*{\glsdonohyperlink}[2]{#2} +\ifcsundef{hyperlink}% +{% + \let\@glslink\glsdonohyperlink +}% +{% + \let\@glslink\glsdohyperlink } -\newcommand*{\glswritedefhook}{} -\newcommand*{\gls@assign@desc}[1]{% - \gls@assign@field{}{#1}{desc}{\@glo@desc}% - \gls@assign@field{\@glo@desc}{#1}{descplural}{\@glo@descplural}% +\ifcsundef{hypertarget}% +{% + \let\@glstarget\@secondoftwo +}% +{% + \let\@glstarget\glsdohypertarget } -\newcommand{\longnewglossaryentry}[3]{% - \glsdoifnoexists{#1}% +\newcommand{\glsdisablehyper}{% + \KV@glslink@hyperfalse + \let\@glslink\glsdonohyperlink + \let\@glstarget\@secondoftwo +} +\newcommand{\glsenablehyper}{% + \KV@glslink@hypertrue + \let\@glslink\glsdohyperlink + \let\@glstarget\glsdohypertarget +} +\providecommand{\@firstofthree}[3]{#1} +\providecommand{\@secondofthree}[3]{#2} +\newrobustcmd*{\gls}{\@gls@hyp@opt\@gls} +\newcommand*{\@gls}[2][]{% + \new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}% +} +\def\@gls@#1#2[#3]{% + \glsdoifexists{#2}% {% - \bgroup - \let\@org@newglossaryentryprehook\@newglossaryentryprehook - \long\def\@newglossaryentryprehook{% - \long\def\@glo@desc{#3\leavevmode\unskip\nopostdesc}% - \@org@newglossaryentryprehook - }% - \renewcommand*{\gls@assign@desc}[1]{% - \global\cslet{glo@\glsdetoklabel{#1}@desc}{\@glo@desc}% - \global\cslet{glo@\glsdetoklabel{#1}@descplural}{\@glo@desc}% - } - \gls@defglossaryentry{#1}{#2}% - \egroup - } + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook } -\@onlypreamble{\longnewglossaryentry} -\newcommand{\longprovideglossaryentry}[3]{% - \ifglsentryexists{#1}{}% - {\longnewglossaryentry{#1}{#2}{#3}}% +\newrobustcmd*{\Gls}{\@gls@hyp@opt\@Gls} +\newcommand*{\@Gls}[2][]{% + \new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}% } -\@onlypreamble{\longprovideglossaryentry} -\newcommand{\gls@defglossaryentry}[2]{% - \let\GlsSetQuote\gls@nosetquote - \edef\@glo@label{\glsdetoklabel{#1}}% - \let\glslabel\@glo@label - \let\@glo@name\@glsnoname - \let\@glo@desc\@glsnodesc - \let\@glo@descplural\@gls@default@value - \let\@glo@type\@gls@default@value - \let\@glo@symbol\@gls@default@value - \let\@glo@symbolplural\@gls@default@value - \let\@glo@text\@gls@default@value - \let\@glo@plural\@gls@default@value - \let\@glo@first\@gls@default@value - \let\@glo@firstplural\@gls@default@value - \let\@glo@sort\@gls@default@value - \let\@glo@counter\@gls@default@value - \def\@glo@see{}% - \def\@glo@parent{}% - \def\@glo@prefix{}% - \@gls@initnonumberlist - \def\@glo@useri{}% - \def\@glo@userii{}% - \def\@glo@useriii{}% - \def\@glo@useriv{}% - \def\@glo@userv{}% - \def\@glo@uservi{}% - \def\@glo@short{}% - \def\@glo@shortpl{}% - \def\@glo@long{}% - \def\@glo@longpl{}% - \@newglossaryentryprehook - \setkeys{glossentry}{#2}% - \ifundef\glsdefaulttype +\def\@Gls@#1#2[#3]{% + \glsdoifexists{#2}% {% - \PackageError{glossaries}% - {No default glossary type (have you used `nomain' by mistake?)}% - {If you use package option `nomain' you must define - a new glossary before you can define entries}% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi }% - {}% - \gls@assign@field{\glsdefaulttype}{\@glo@label}{type}{\@glo@type}% - \edef\@glo@type{\glsentrytype{\@glo@label}}% - \ifcsundef{glolist@\@glo@type}% + \glspostlinkhook +} +\newrobustcmd*{\GLS}{\@gls@hyp@opt\@GLS} +\newcommand*{\@GLS}[2][]{% + \new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}% +} +\def\@GLS@#1#2[#3]{% + \glsdoifexists{#2}% {% - \PackageError{glossaries}% - {Glossary type `\@glo@type' has not been defined}% - {You need to define a new glossary type, before making entries - in it}% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi }% + \glspostlinkhook +} +\newrobustcmd*{\glspl}{\@gls@hyp@opt\@glspl} +\newcommand*{\@glspl}[2][]{% + \new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}% +} +\def\@glspl@#1#2[#3]{% + \glsdoifexists{#2}% {% - \ifignoredglossary\@glo@type - {% - \ifx\@glo@desc\@glsnodesc - \let\@glo@desc\@empty - \fi - }% - {% - }% - \protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}% - \expandafter\xdef\csname glolist@\@glo@type\endcsname{% - \@glolist@{\@glo@label},}% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi }% - \gls@level=0\relax - \ifx\@glo@parent\@empty - \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% - \else - \ifdefequal\@glo@label\@glo@parent% - {% - \PackageError{glossaries}{Entry `\@glo@label' can't be its own parent}{}% - \def\@glo@parent{}% - \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% - }% - {% - \ifglsentryexists{\@glo@parent}% - {% - \expandafter\xdef\csname glo@\@glo@label @parent\endcsname{% - \@glo@parent}% - \gls@level=\csname glo@\@glo@parent @level\endcsname\relax - \advance\gls@level by 1\relax - \ifx\@glo@name\@glsnoname - \expandafter\let\expandafter\@glo@name - \csname glo@\@glo@parent @name\endcsname - \ifx\@glo@plural\@gls@default@value - \expandafter\let\expandafter\@glo@plural - \csname glo@\@glo@parent @plural\endcsname - \fi - \fi - }% - {% - \PackageError{glossaries}% - {% - Invalid parent `\@glo@parent' - for entry `\@glo@label' - parent doesn't exist% - }% - {% - Parent entries must be defined before their children% - }% - \def\@glo@parent{}% - \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% - }% - }% - \fi - \expandafter\xdef\csname glo@\@glo@label @level\endcsname{\number\gls@level}% - \gls@assign@field{\@glo@name}{\@glo@label}{sortvalue}{\@glo@sort}% - \letcs\@glo@sort{glo@\@glo@label @sortvalue}% - \gls@assign@field{\@glo@name}{\@glo@label}{text}{\@glo@text}% - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @text\endcsname\glspluralsuffix}% - {\@glo@label}{plural}{\@glo@plural}% - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @text\endcsname}% - {\@glo@label}{first}{\@glo@first}% - \ifx\@glo@first\@gls@default@value - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @plural\endcsname}% - {\@glo@label}{firstpl}{\@glo@firstplural}% - \else - \expandafter\gls@assign@field\expandafter - {\csname glo@\@glo@label @first\endcsname\glspluralsuffix}% - {\@glo@label}{firstpl}{\@glo@firstplural}% - \fi - \ifcsundef{@glotype@\@glo@type @counter}% - {% - \def\@glo@defaultcounter{\glscounter}% - }% - {% - \letcs\@glo@defaultcounter{@glotype@\@glo@type @counter}% - }% - \gls@assign@field{\@glo@defaultcounter}{\@glo@label}{counter}{\@glo@counter}% - \gls@assign@field{}{\@glo@label}{useri}{\@glo@useri}% - \gls@assign@field{}{\@glo@label}{userii}{\@glo@userii}% - \gls@assign@field{}{\@glo@label}{useriii}{\@glo@useriii}% - \gls@assign@field{}{\@glo@label}{useriv}{\@glo@useriv}% - \gls@assign@field{}{\@glo@label}{userv}{\@glo@userv}% - \gls@assign@field{}{\@glo@label}{uservi}{\@glo@uservi}% - \gls@assign@field{}{\@glo@label}{short}{\@glo@short}% - \gls@assign@field{}{\@glo@label}{shortpl}{\@glo@shortpl}% - \gls@assign@field{}{\@glo@label}{long}{\@glo@long}% - \gls@assign@field{}{\@glo@label}{longpl}{\@glo@longpl}% - \ifx\@glo@name\@glsnoname - \@glsnoname - \let\@gloname\@gls@default@value - \fi - \gls@assign@field{}{\@glo@label}{name}{\@glo@name}% - \ifcsundef{glo@\@glo@label @numberlist}% - {% - \csxdef{glo@\@glo@label @numberlist}{% - \noexpand\@gls@missingnumberlist{\@glo@label}}% - }% - {}% - \@gls@storenonumberlist{\@glo@label}% - \def\@glo@@desc{\@glo@first}% - \ifx\@glo@desc\@glo@@desc - \let\@glo@desc\@glo@first - \fi - \ifx\@glo@desc\@glsnodesc - \@glsnodesc - \let\@glodesc\@gls@default@value - \fi - \gls@assign@desc{\@glo@label}% - \@gls@defsort{\@glo@type}{\@glo@label}% - \def\@glo@@symbol{\@glo@text}% - \ifx\@glo@symbol\@glo@@symbol - \let\@glo@symbol\@glo@text - \fi - \gls@assign@field{\relax}{\@glo@label}{symbol}{\@glo@symbol}% - \expandafter - \gls@assign@field\expandafter - {\csname glo@\@glo@label @symbol\endcsname} - {\@glo@label}{symbolplural}{\@glo@symbolplural}% - \expandafter\xdef\csname glo@\@glo@label @flagfalse\endcsname{% - \noexpand\global - \noexpand\let\expandafter\noexpand - \csname ifglo@\@glo@label @flag\endcsname\noexpand\iffalse - }% - \expandafter\xdef\csname glo@\@glo@label @flagtrue\endcsname{% - \noexpand\global - \noexpand\let\expandafter\noexpand - \csname ifglo@\@glo@label @flag\endcsname\noexpand\iftrue - }% - \csname glo@\@glo@label @flagfalse\endcsname - \@glo@autosee - \ifignoredglossary\@glo@type - {% - \csdef{glo@\@glo@label @index}{}% - } - {% - \do@glo@storeentry{\@glo@label}% - }% - \@newglossaryentry@defcounters - \@newglossaryentryposthook + \glspostlinkhook } -\newcommand*{\@glo@autosee}{% - \ifdefvoid\@glo@see{}% - {% - \protected@edef\@do@glssee{% - \noexpand\@gls@fixbraces\noexpand\@glo@list\@glo@see\noexpand\@nil - \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{\@glo@label}}% - \@do@glssee - }% - \@glo@autoseehook -}% -\newcommand*{\@glo@autoseehook}{} -\newcommand*{\@newglossaryentryprehook}{} -\newcommand*{\@newglossaryentryposthook}{} -\newcommand*{\@newglossaryentry@defcounters}{} -\newcommand*{\glsmoveentry}[2]{% - \edef\@glo@thislabel{\glsdetoklabel{#1}}% - \edef\glo@type{\csname glo@\@glo@thislabel @type\endcsname}% - \def\glo@list{,}% - \forglsentries[\glo@type]{\glo@label}% - {% - \ifdefequal\@glo@thislabel\glo@label - {}{\eappto\glo@list{\glo@label,}}% - }% - \cslet{glolist@\glo@type}{\glo@list}% - \csdef{glo@\@glo@thislabel @type}{#2}% +\newrobustcmd*{\Glspl}{\@gls@hyp@opt\@Glspl} +\newcommand*{\@Glspl}[2][]{% + \new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}% } -\ifglsxindy - \newcommand*{\@glossaryentryfield}{\string\\glossentry} -\else - \newcommand*{\@glossaryentryfield}{\string\glossentry} -\fi -\ifglsxindy - \newcommand*{\@glossarysubentryfield}{% - \string\\subglossentry} -\else - \newcommand*{\@glossarysubentryfield}{% - \string\subglossentry} -\fi -\newcommand{\@glo@storeentry}[1]{% - \edef\@glo@esclabel{#1}% - \@gls@checkmkidxchars\@glo@esclabel - \protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% - \@gls@checkmkidxchars\@glo@sort - \@gls@checkmkidxchars\@glo@prefix - \edef\@glo@parent{\csname glo@#1@parent\endcsname}% - \ifglsxindy - \ifx\@glo@parent\@empty - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - (\string"\@glo@sort\string" % - \string"\@glo@prefix\@glossaryentryfield{\@glo@esclabel}\string") % - }% - \else - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \csname glo@\@glo@parent @index\endcsname - (\string"\@glo@sort\string" % - \string"\@glo@prefix\@glossarysubentryfield - {\csname glo@#1@level\endcsname}{\@glo@esclabel}\string") % - }% - \fi - \else - \ifx\@glo@parent\@empty - \@onelevel@sanitize\@glo@prefix - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \@glo@sort\@gls@actualchar\@glo@prefix - \@glossaryentryfield{\@glo@esclabel}% - }% +\def\@Glspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% \else - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \csname glo@\@glo@parent @index\endcsname\@gls@levelchar - \@glo@sort\@gls@actualchar\@glo@prefix - \@glossarysubentryfield - {\csname glo@#1@level\endcsname}{\@glo@esclabel}% - }% + \glsunset{#2}% \fi - \fi -} -\AtBeginDocument{% - \@ifpackageloaded{amsmath}% - {\let\gls@ifnotmeasuring\@gls@ifnotmeasuring}% - {}% -} -\newcommand*{\@gls@ifnotmeasuring}[1]{% - \ifmeasuring@ - \else - #1% - \fi -} -\newcommand*\gls@ifnotmeasuring[1]{#1} -\def\@gls@patchtabularx#1\hbox#2#3!!{% - \def\TX@trial##1{#1\hbox{\let\glsunset\@gobble#2}#3}% -} -\newcommand*\glspatchtabularx{% - \ifdef\TX@trial - {% - \expandafter\@gls@patchtabularx\TX@trial{##1}!!% - \let\glspatchtabularx\relax - }% - {}% -} -\newcommand*{\glsreset}[1]{% - \gls@ifnotmeasuring - {% - \glsdoifexists{#1}% - {% - \@glsreset{#1}% - }% }% + \glspostlinkhook } -\newcommand*{\glslocalreset}[1]{% - \gls@ifnotmeasuring +\newrobustcmd*{\GLSpl}{\@gls@hyp@opt\@GLSpl} +\newcommand*{\@GLSpl}[2][]{% + \new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}% +} +\def\@GLSpl@#1#2[#3]{% + \glsdoifexists{#2}% {% - \glsdoifexists{#1}% - {% - \@glslocalreset{#1}% - }% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi }% + \glspostlinkhook } -\newcommand*{\glsunset}[1]{% - \gls@ifnotmeasuring - {% - \glsdoifexists{#1}% - {% - \@glsunset{#1}% - }% +\newrobustcmd*{\glsdisp}{\@gls@hyp@opt\@glsdisp} +\newcommand*{\@glsdisp}[3][]{% + \glsdoifexists{#2}{% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \def\glscustomtext{#3}% + \def\glsinsert{}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi }% + \glspostlinkhook } -\newcommand*{\glslocalunset}[1]{% - \gls@ifnotmeasuring +\newcommand*{\@gls@link@nocheckfirsthyper}{} +\newcommand{\@gls@field@link}[3]{% + \glsdoifexists{#2}% {% - \glsdoifexists{#1}% - {% - \@glslocalunset{#1}% - }% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \@gls@link[#1]{#2}{#3}% }% + \glspostlinkhook } -\newcommand*{\@glslocalunset}{\@@glslocalunset} -\newcommand*{\@@glslocalunset}[1]{% - \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iftrue +\newrobustcmd*{\glstext}{\@gls@hyp@opt\@glstext} +\newcommand*{\@glstext}[2][]{% + \new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} +\def\@glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrytext{#2}#3}% } -\newcommand*{\@glsunset}{\@@glsunset} -\newcommand*{\@@glsunset}[1]{% - \expandafter\global\csname glo@\glsdetoklabel{#1}@flagtrue\endcsname +\newrobustcmd*{\GLStext}{\@gls@hyp@opt\@GLStext} +\newcommand*{\@GLStext}[2][]{% + \new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} +\def\@GLStext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrytext{#2}#3}}% } -\newcommand*{\@glslocalreset}{\@@glslocalreset} -\newcommand*{\@@glslocalreset}[1]{% - \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iffalse +\newrobustcmd*{\Glstext}{\@gls@hyp@opt\@Glstext} +\newcommand*{\@Glstext}[2][]{% + \new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} +\def\@Glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrytext{#2}#3}% } -\newcommand*{\@glsreset}{\@@glsreset} -\newcommand*{\@@glsreset}[1]{% - \expandafter\global\csname glo@\glsdetoklabel{#1}@flagfalse\endcsname +\newrobustcmd*{\glsfirst}{\@gls@hyp@opt\@glsfirst} +\newcommand*{\@glsfirst}[2][]{% + \new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} +\def\@glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryfirst{#2}#3}% } -\newcommand*{\glsresetall}[1][\@glo@types]{% - \forallglsentries[#1]{\@glsentry}% - {% - \glsreset{\@glsentry}% - }% +\newrobustcmd*{\Glsfirst}{\@gls@hyp@opt\@Glsfirst} +\newcommand*{\@Glsfirst}[2][]{% + \new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} +\def\@Glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryfirst{#2}#3}% } -\newcommand*{\glslocalresetall}[1][\@glo@types]{% - \forallglsentries[#1]{\@glsentry}% - {% - \glslocalreset{\@glsentry}% - }% +\newrobustcmd*{\GLSfirst}{\@gls@hyp@opt\@GLSfirst} +\newcommand*{\@GLSfirst}[2][]{% + \new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} +\def\@GLSfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirst{#2}#3}}% } -\newcommand*{\glsunsetall}[1][\@glo@types]{% - \forallglsentries[#1]{\@glsentry}% - {% - \glsunset{\@glsentry}% - }% +\newrobustcmd*{\glsplural}{\@gls@hyp@opt\@glsplural} +\newcommand*{\@glsplural}[2][]{% + \new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} +\def\@glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryplural{#2}#3}% } -\newcommand*{\glslocalunsetall}[1][\@glo@types]{% - \forallglsentries[#1]{\@glsentry}% - {% - \glslocalunset{\@glsentry}% - }% +\newrobustcmd*{\Glsplural}{\@gls@hyp@opt\@Glsplural} +\newcommand*{\@Glsplural}[2][]{% + \new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} +\def\@Glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryplural{#2}#3}% } -\newcommand*{\@@newglossaryentry@defcounters}{% - \csdef{glo@\@glo@label @currcount}{0}% - \csdef{glo@\@glo@label @prevcount}{0}% +\newrobustcmd*{\GLSplural}{\@gls@hyp@opt\@GLSplural} +\newcommand*{\@GLSplural}[2][]{% + \new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} +\def\@GLSplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryplural{#2}#3}}% } -\newcommand*{\glsenableentrycount}{% - \let\@newglossaryentry@defcounters\@@newglossaryentry@defcounters - \renewcommand*{\gls@defdocnewglossaryentry}{% - \renewcommand*\newglossaryentry[2]{% - \PackageError{glossaries}{\string\newglossaryentry\space - may only be used in the preamble when entry counting has - been activated}{If you use \string\glsenableentrycount\space - you must place all entry definitions in the preamble not in - the document environment}% - }% - }% - \newcommand*{\glsentrycurrcount}[1]{% - \ifcsundef{glo@\glsdetoklabel{##1}@currcount}% - {0}{\@gls@entry@field{##1}{currcount}}% - }% - \newcommand*{\glsentryprevcount}[1]{% - \ifcsundef{glo@\glsdetoklabel{##1}@prevcount}% - {0}{\@gls@entry@field{##1}{prevcount}}% - }% - \renewcommand*{\@glsunset}[1]{% - \@@glsunset{##1}% - \@gls@increment@currcount{##1}% - }% - \renewcommand*{\@glslocalunset}[1]{% - \@@glslocalunset{##1}% - \@gls@local@increment@currcount{##1}% - }% - \renewcommand*{\@glsreset}[1]{% - \@@glsreset{##1}% - \csgdef{glo@\glsdetoklabel{##1}@currcount}{0}% - }% - \renewcommand*{\@glslocalreset}[1]{% - \@@glslocalreset{##1}% - \csdef{glo@\glsdetoklabel{##1}@currcount}{0}% - }% - \def\@cgls@##1##2[##3]{% - \ifnum\glsentryprevcount{##2}=1\relax - \cglsformat{##2}{##3}% - \glsunset{##2}% - \else - \@gls@{##1}{##2}[##3]% - \fi - }% - \def\@cglspl@##1##2[##3]{% - \ifnum\glsentryprevcount{##2}=1\relax - \cglsplformat{##2}{##3}% - \glsunset{##2}% - \else - \@glspl@{##1}{##2}[##3]% - \fi - }% - \def\@cGls@##1##2[##3]{% - \ifnum\glsentryprevcount{##2}=1\relax - \cGlsformat{##2}{##3}% - \glsunset{##2}% - \else - \@Gls@{##1}{##2}[##3]% - \fi - }% - \def\@cGlspl@##1##2[##3]{% - \ifnum\glsentryprevcount{##2}=1\relax - \cGlsplformat{##2}{##3}% - \glsunset{##2}% - \else - \@Glspl@{##1}{##2}[##3]% - \fi - }% - \AtEndDocument{\@gls@write@entrycounts}% - \renewcommand*{\@gls@entry@count}[2]{% - \csgdef{glo@\glsdetoklabel{##1}@prevcount}{##2}% - }% - \let\glsenableentrycount\relax +\newrobustcmd*{\glsfirstplural}{\@gls@hyp@opt\@glsfirstplural} +\newcommand*{\@glsfirstplural}[2][]{% + \new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryfirstplural{#2}#3}% } -\@onlypreamble\glsenableentrycount -\newcommand*{\@gls@increment@currcount}[1]{% - \csxdef{glo@\glsdetoklabel{#1}@currcount}{% - \number\numexpr\glsentrycurrcount{#1}+1}% +\newrobustcmd*{\Glsfirstplural}{\@gls@hyp@opt\@Glsfirstplural} +\newcommand*{\@Glsfirstplural}[2][]{% + \new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} +\def\@Glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryfirstplural{#2}#3}% } -\newcommand*{\@gls@local@increment@currcount}[1]{% - \csedef{glo@\glsdetoklabel{#1}@currcount}{% - \number\numexpr\glsentrycurrcount{#1}+1}% +\newrobustcmd*{\GLSfirstplural}{\@gls@hyp@opt\@GLSfirstplural} +\newcommand*{\@GLSfirstplural}[2][]{% + \new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} +\def\@GLSfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirstplural{#2}#3}}% } -\newcommand*{\@gls@write@entrycounts}{% - \immediate\write\@auxout - {\string\providecommand*{\string\@gls@entry@count}[2]{}}% - \forallglsentries{\@glsentry}{% - \ifglsused{\@glsentry}% - {\immediate\write\@auxout - {\string\@gls@entry@count{\@glsentry}{\glsentrycurrcount{\@glsentry}}}}% - {}% - }% +\newrobustcmd*{\glsname}{\@gls@hyp@opt\@glsname} +\newcommand*{\@glsname}[2][]{% + \new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} +\def\@glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryname{#2}#3}% } -\newcommand*{\@gls@entry@count}[2]{} -\newrobustcmd*{\cgls}{\@gls@hyp@opt\@cgls} -\newcommand*{\@cgls}[2][]{% - \new@ifnextchar[{\@cgls@{#1}{#2}}{\@cgls@{#1}{#2}[]}% +\newrobustcmd*{\Glsname}{\@gls@hyp@opt\@Glsname} +\newcommand*{\@Glsname}[2][]{% + \new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} +\def\@Glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryname{#2}#3}% } -\def\@cgls@#1#2[#3]{% - \GlossariesWarning{\string\cgls\space is defaulting to - \string\gls\space since you haven't enabled entry counting}% - \@gls@{#1}{#2}[#3]% +\newrobustcmd*{\GLSname}{\@gls@hyp@opt\@GLSname} +\newcommand*{\@GLSname}[2][]{% + \new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} +\def\@GLSname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryname{#2}#3}}% } -\newcommand*{\cglsformat}[2]{% - \ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}#2% +\newrobustcmd*{\glsdesc}{\@gls@hyp@opt\@glsdesc} +\newcommand*{\@glsdesc}[2][]{% + \new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} +\def\@glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrydesc{#2}#3}% } -\newrobustcmd*{\cGls}{\@gls@hyp@opt\@cGls} -\newcommand*{\@cGls}[2][]{% - \new@ifnextchar[{\@cGls@{#1}{#2}}{\@cGls@{#1}{#2}[]}% +\newrobustcmd*{\Glsdesc}{\@gls@hyp@opt\@Glsdesc} +\newcommand*{\@Glsdesc}[2][]{% + \new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} +\def\@Glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrydesc{#2}#3}% } -\def\@cGls@#1#2[#3]{% - \GlossariesWarning{\string\cGls\space is defaulting to - \string\Gls\space since you haven't enabled entry counting}% - \@Gls@{#1}{#2}[#3]% +\newrobustcmd*{\GLSdesc}{\@gls@hyp@opt\@GLSdesc} +\newcommand*{\@GLSdesc}[2][]{% + \new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} +\def\@GLSdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydesc{#2}#3}}% } -\newcommand*{\cGlsformat}[2]{% - \ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}#2% +\newrobustcmd*{\glsdescplural}{\@gls@hyp@opt\@glsdescplural} +\newcommand*{\@glsdescplural}[2][]{% + \new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}} +\def\@glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrydescplural{#2}#3}% } -\newrobustcmd*{\cglspl}{\@gls@hyp@opt\@cglspl} -\newcommand*{\@cglspl}[2][]{% - \new@ifnextchar[{\@cglspl@{#1}{#2}}{\@cglspl@{#1}{#2}[]}% +\newrobustcmd*{\Glsdescplural}{\@gls@hyp@opt\@Glsdescplural} +\newcommand*{\@Glsdescplural}[2][]{% + \new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}} +\def\@Glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrydescplural{#2}#3}% } -\def\@cglspl@#1#2[#3]{% - \GlossariesWarning{\string\cglspl\space is defaulting to - \string\glspl\space since you haven't enabled entry counting}% - \@glspl@{#1}{#2}[#3]% +\newrobustcmd*{\GLSdescplural}{\@gls@hyp@opt\@GLSdescplural} +\newcommand*{\@GLSdescplural}[2][]{% + \new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}} +\def\@GLSdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydescplural{#2}#3}}% } -\newcommand*{\cglsplformat}[2]{% - \ifglshaslong{#1}{\glsentrylongpl{#1}}{\glsentryfirstplural{#1}}#2% +\newrobustcmd*{\glssymbol}{\@gls@hyp@opt\@glssymbol} +\newcommand*{\@glssymbol}[2][]{% + \new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} +\def\@glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrysymbol{#2}#3}% } -\newrobustcmd*{\cGlspl}{\@gls@hyp@opt\@cGlspl} -\newcommand*{\@cGlspl}[2][]{% - \new@ifnextchar[{\@cGlspl@{#1}{#2}}{\@cGlspl@{#1}{#2}[]}% +\newrobustcmd*{\Glssymbol}{\@gls@hyp@opt\@Glssymbol} +\newcommand*{\@Glssymbol}[2][]{% + \new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} +\def\@Glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrysymbol{#2}#3}% } -\def\@cGlspl@#1#2[#3]{% - \GlossariesWarning{\string\cGlspl\space is defaulting to - \string\Glspl\space since you haven't enabled entry counting}% - \@Glspl@{#1}{#2}[#3]% +\newrobustcmd*{\GLSsymbol}{\@gls@hyp@opt\@GLSsymbol} +\newcommand*{\@GLSsymbol}[2][]{% + \new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} +\def\@GLSsymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbol{#2}#3}}% } -\newcommand*{\cGlsplformat}[2]{% - \ifglshaslong{#1}{\Glsentrylongpl{#1}}{\Glsentryfirstplural{#1}}#2% +\newrobustcmd*{\glssymbolplural}{\@gls@hyp@opt\@glssymbolplural} +\newcommand*{\@glssymbolplural}[2][]{% + \new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}} +\def\@glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrysymbolplural{#2}#3}% } -\newcommand*{\loadglsentries}[2][\@gls@default]{% - \let\@gls@default\glsdefaulttype - \def\glsdefaulttype{#1}\input{#2}% - \let\glsdefaulttype\@gls@default +\newrobustcmd*{\Glssymbolplural}{\@gls@hyp@opt\@Glssymbolplural} +\newcommand*{\@Glssymbolplural}[2][]{% + \new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}} +\def\@Glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrysymbolplural{#2}#3}% } -\@onlypreamble{\loadglsentries} -\newcommand*{\glstextformat}[1]{#1} -\newcommand*{\glsentryfmt}{% - \@@gls@default@entryfmt\glsdisplayfirst\glsdisplay +\newrobustcmd*{\GLSsymbolplural}{\@gls@hyp@opt\@GLSsymbolplural} +\newcommand*{\@GLSsymbolplural}[2][]{% + \new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}} +\def\@GLSsymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}#3}}% } -\newcommand*{\@@gls@default@entryfmt}[2]{% - \ifdefempty\glscustomtext +\newrobustcmd*{\glsuseri}{\@gls@hyp@opt\@glsuseri} +\newcommand*{\@glsuseri}[2][]{% + \new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}} +\def\@glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseri{#2}#3}% +} +\newrobustcmd*{\Glsuseri}{\@gls@hyp@opt\@Glsuseri} +\newcommand*{\@Glsuseri}[2][]{% + \new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}} +\def\@Glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseri{#2}#3}% +} +\newrobustcmd*{\GLSuseri}{\@gls@hyp@opt\@GLSuseri} +\newcommand*{\@GLSuseri}[2][]{% + \new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}} +\def\@GLSuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseri{#2}#3}}% +} +\newrobustcmd*{\glsuserii}{\@gls@hyp@opt\@glsuserii} +\newcommand*{\@glsuserii}[2][]{% + \new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}} +\def\@glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuserii{#2}#3}% +} +\newrobustcmd*{\Glsuserii}{\@gls@hyp@opt\@Glsuserii} +\newcommand*{\@Glsuserii}[2][]{% + \new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}} +\def\@Glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuserii{#2}#3}% +} +\newrobustcmd*{\GLSuserii}{\@gls@hyp@opt\@GLSuserii} +\newcommand*{\@GLSuserii}[2][]{% + \new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}} +\def\@GLSuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserii{#2}#3}}% +} +\newrobustcmd*{\glsuseriii}{\@gls@hyp@opt\@glsuseriii} +\newcommand*{\@glsuseriii}[2][]{% + \new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}} +\def\@glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseriii{#2}#3}% +} +\newrobustcmd*{\Glsuseriii}{\@gls@hyp@opt\@Glsuseriii} +\newcommand*{\@Glsuseriii}[2][]{% + \new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}} +\def\@Glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseriii{#2}#3}% +} +\newrobustcmd*{\GLSuseriii}{\@gls@hyp@opt\@GLSuseriii} +\newcommand*{\@GLSuseriii}[2][]{% + \new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}} +\def\@GLSuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriii{#2}#3}}% +} +\newrobustcmd*{\glsuseriv}{\@gls@hyp@opt\@glsuseriv} +\newcommand*{\@glsuseriv}[2][]{% + \new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}} +\def\@glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseriv{#2}#3}% +} +\newrobustcmd*{\Glsuseriv}{\@gls@hyp@opt\@Glsuseriv} +\newcommand*{\@Glsuseriv}[2][]{% + \new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}} +\def\@Glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseriv{#2}#3}% +} +\newrobustcmd*{\GLSuseriv}{\@gls@hyp@opt\@GLSuseriv} +\newcommand*{\@GLSuseriv}[2][]{% + \new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}} +\def\@GLSuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriv{#2}#3}}% +} +\newrobustcmd*{\glsuserv}{\@gls@hyp@opt\@glsuserv} +\newcommand*{\@glsuserv}[2][]{% + \new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}} +\def\@glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuserv{#2}#3}% +} +\newrobustcmd*{\Glsuserv}{\@gls@hyp@opt\@Glsuserv} +\newcommand*{\@Glsuserv}[2][]{% +\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}} +\def\@Glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuserv{#2}#3}% +} +\newrobustcmd*{\GLSuserv}{\@gls@hyp@opt\@GLSuserv} +\newcommand*{\@GLSuserv}[2][]{% +\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}} +\def\@GLSuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserv{#2}#3}}% +} +\newrobustcmd*{\glsuservi}{\@gls@hyp@opt\@glsuservi} +\newcommand*{\@glsuservi}[2][]{% + \new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}} +\def\@glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuservi{#2}#3}% +} +\newrobustcmd*{\Glsuservi}{\@gls@hyp@opt\@Glsuservi} +\newcommand*{\@Glsuservi}[2][]{% + \new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}} +\def\@Glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuservi{#2}#3}% +} +\newrobustcmd*{\GLSuservi}{\@gls@hyp@opt\@GLSuservi} +\newcommand*{\@GLSuservi}[2][]{% + \new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}} +\def\@GLSuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuservi{#2}#3}}% +} +\newrobustcmd*{\acrshort}{\@gls@hyp@opt\ns@acrshort} +\newcommand*{\ns@acrshort}[2][]{% + \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}% +} +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% {% - \glsifplural - {% - \glscapscase - {% - \ifglsused\glslabel - {% - #2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - {% - #1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - {% - \ifglsused\glslabel - {% - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #2{\Glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - {% - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #1{\Glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}% - }% - }% - }% - {% - \ifglsused\glslabel - {% - \mfirstucMakeUppercase{#2{\glsentryplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - }% - {% - \mfirstucMakeUppercase{#1{\glsentryfirstplural{\glslabel}}% - {\glsentrydescplural{\glslabel}}% - {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% - }% - }% - }% - {% - \glscapscase - {% - \ifglsused\glslabel - {% - #2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - {% - #1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - {% - \ifglsused\glslabel - {% - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #2{\Glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - {% - \ifbool{glscompatible-3.07}% - {% - \protected@edef\@glo@etext{% - #1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - \xmakefirstuc\@glo@etext - }% - {% - #1{\Glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}% - }% - }% - }% - {% - \ifglsused\glslabel - {% - \mfirstucMakeUppercase{#2{\glsentrytext{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - }% - {% - \mfirstucMakeUppercase{#1{\glsentryfirst{\glslabel}}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{\glsinsert}}% - }% - }% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshort{#2}}#3% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% + \glspostlinkhook +} +\newrobustcmd*{\Acrshort}{\@gls@hyp@opt\ns@Acrshort} +\newcommand*{\ns@Acrshort}[2][]{% + \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}% +} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% {% - \ifglsused{\glslabel}% - {% - #2{\glscustomtext}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshort{#2}}#3% }% - {% - #1{\glscustomtext}% - {\glsentrydesc{\glslabel}}% - {\glsentrysymbol{\glslabel}}{}% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\ACRshort}{\@gls@hyp@opt\ns@ACRshort} +\newcommand*{\ns@ACRshort}[2][]{% + \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}% +} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshort{#2}}#3}% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% + \glspostlinkhook } -\newcommand*{\glsgenentryfmt}{% - \ifdefempty\glscustomtext +\newrobustcmd*{\acrshortpl}{\@gls@hyp@opt\ns@acrshortpl} +\newcommand*{\ns@acrshortpl}[2][]{% + \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}% +} +\def\@acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% {% - \glsifplural - {% - \glscapscase - {% - \ifglsused\glslabel - {% - \glsentryplural{\glslabel}\glsinsert - }% - {% - \glsentryfirstplural{\glslabel}\glsinsert - }% - }% - {% - \ifglsused\glslabel - {% - \Glsentryplural{\glslabel}\glsinsert - }% - {% - \Glsentryfirstplural{\glslabel}\glsinsert - }% - }% - {% - \ifglsused\glslabel - {% - \mfirstucMakeUppercase - {\glsentryplural{\glslabel}\glsinsert}% - }% - {% - \mfirstucMakeUppercase - {\glsentryfirstplural{\glslabel}\glsinsert}% - }% - }% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshortpl{#2}}#3% }% - {% - \glscapscase - {% - \ifglsused\glslabel - {% - \glsentrytext{\glslabel}\glsinsert - }% - {% - \glsentryfirst{\glslabel}\glsinsert - }% - }% - {% - \ifglsused\glslabel - {% - \Glsentrytext{\glslabel}\glsinsert - }% - {% - \Glsentryfirst{\glslabel}\glsinsert - }% - }% - {% - \ifglsused\glslabel - {% - \mfirstucMakeUppercase{\glsentrytext{\glslabel}\glsinsert}% - }% - {% - \mfirstucMakeUppercase{\glsentryfirst{\glslabel}\glsinsert}% - }% - }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\Acrshortpl}{\@gls@hyp@opt\ns@Acrshortpl} +\newcommand*{\ns@Acrshortpl}[2][]{% + \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}% +} +\def\@Acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshortpl{#2}}#3% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% + \glspostlinkhook +} +\newrobustcmd*{\ACRshortpl}{\@gls@hyp@opt\ns@ACRshortpl} +\newcommand*{\ns@ACRshortpl}[2][]{% + \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}% +} +\def\@ACRshortpl#1#2[#3]{% + \glsdoifexists{#2}% {% - \glscustomtext\glsinsert + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{#2}}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% + \glspostlinkhook } -\newcommand*{\glsgenacfmt}{% - \ifdefempty\glscustomtext +\newrobustcmd*{\acrlong}{\@gls@hyp@opt\ns@acrlong} +\newcommand*{\ns@acrlong}[2][]{% + \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}% +} +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% {% - \ifglsused\glslabel - {% - \glsifplural - {% - \glscapscase - {% - \acronymfont{\glsentryshortpl{\glslabel}}\glsinsert - }% - {% - \acronymfont{\Glsentryshortpl{\glslabel}}\glsinsert - }% - {% - \mfirstucMakeUppercase - {\acronymfont{\glsentryshortpl{\glslabel}}\glsinsert}% - }% - }% - {% - \glscapscase - {% - \acronymfont{\glsentryshort{\glslabel}}\glsinsert - }% - {% - \acronymfont{\Glsentryshort{\glslabel}}\glsinsert - }% - {% - \mfirstucMakeUppercase - {\acronymfont{\glsentryshort{\glslabel}}\glsinsert}% - }% - }% - }% - {% - \glsifplural - {% - \glscapscase - {% - \genplacrfullformat{\glslabel}{\glsinsert}% - }% - {% - \Genplacrfullformat{\glslabel}{\glsinsert}% - }% - {% - \mfirstucMakeUppercase - {\genplacrfullformat{\glslabel}{\glsinsert}}% - }% - }% - {% - \glscapscase - {% - \genacrfullformat{\glslabel}{\glsinsert}% - }% - {% - \Genacrfullformat{\glslabel}{\glsinsert}% - }% - {% - \mfirstucMakeUppercase - {\genacrfullformat{\glslabel}{\glsinsert}}% - }% - }% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsentrylong{#2}#3% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - {% - \glscustomtext - }% -} -\newcommand*{\genacrfullformat}[2]{% - \glsentrylong{#1}#2\space - (\protect\firstacronymfont{\glsentryshort{#1}})% -} -\newcommand*{\Genacrfullformat}[2]{% - \protected@edef\gls@text{\genacrfullformat{#1}{#2}}% - \xmakefirstuc\gls@text -} -\newcommand*{\genplacrfullformat}[2]{% - \glsentrylongpl{#1}#2\space - (\protect\firstacronymfont{\glsentryshortpl{#1}})% + \glspostlinkhook } -\newcommand*{\Genplacrfullformat}[2]{% - \protected@edef\gls@text{\genplacrfullformat{#1}{#2}}% - \xmakefirstuc\gls@text +\newrobustcmd*{\Acrlong}{\@gls@hyp@opt\ns@Acrlong} +\newcommand*{\ns@Acrlong}[2][]{% + \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}% } -\newcommand*{\glsdisplayfirst}[4]{#1#4} -\newcommand*{\glsdisplay}[4]{#1#4} -\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% - \GlossariesWarning{\string\defglsdisplay\space is now obsolete.^^J - Use \string\defglsentryfmt\space instead}% - \expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}% - \edef\@gls@doentrydef{% - \noexpand\defglsentryfmt[#1]{% - \noexpand\ifcsdef{gls@#1@displayfirst}% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\csuse{gls@#1@display}}% - }% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\glsdisplayfirst}% - {\noexpand\csuse{gls@#1@display}}% - }% +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \Glsentrylong{#2}#3% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - \@gls@doentrydef + \glspostlinkhook } -\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% - \GlossariesWarning{\string\defglsdisplayfirst\space is now obsolete.^^J - Use \string\defglsentryfmt\space instead}% - \expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}% - \edef\@gls@doentrydef{% - \noexpand\defglsentryfmt[#1]{% - \noexpand\ifcsdef{gls@#1@display}% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\csuse{gls@#1@display}}% - }% - {% - \noexpand\@@gls@default@entryfmt - {\noexpand\csuse{gls@#1@displayfirst}}% - {\noexpand\glsdisplay}% - }% - }% - }% - \@gls@doentrydef +\newrobustcmd*{\ACRlong}{\@gls@hyp@opt\ns@ACRlong} +\newcommand*{\ns@ACRlong}[2][]{% + \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}% } -\define@key{glslink}{counter}{% - \ifcsundef{c@#1}% +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% {% - \PackageError{glossaries}% - {There is no counter called `#1'}% - {% - The counter key should have the name of a valid counter - as its value% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\glsentrylong{#2}#3}% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - {% - \def\@gls@counter{#1}% - }% -} -\define@key{glslink}{format}{% - \def\@glsnumberformat{#1}} -\define@boolkey{glslink}{hyper}[true]{} -\ifdef{\hyperlink}{\KV@glslink@hypertrue}{\KV@glslink@hyperfalse} -\define@boolkey{glslink}{local}[true]{} -\newcommand*{\glslinkvar}[3]{#1} -\newcommand*{\glsifhyper}[2]{% - \glslinkvar{#1}{#2}{#1}% - \GlossariesWarning{\string\glsifhyper\space is deprecated. Did - you mean \string\glsifhyperon\space or \string\glslinkvar?}% -} -\newcommand*{\@gls@hyp@opt}[1]{% - \let\glslinkvar\@firstofthree - \let\@gls@hyp@opt@cs#1\relax - \@ifstar{\s@gls@hyp@opt}% - {\@ifnextchar+{\@firstoftwo{\p@gls@hyp@opt}}{#1}}% + \glspostlinkhook } -\newcommand*{\s@gls@hyp@opt}[1][]{% - \let\glslinkvar\@secondofthree - \@gls@hyp@opt@cs[hyper=false,#1]} -\newcommand*{\p@gls@hyp@opt}[1][]{% - \let\glslinkvar\@thirdofthree - \@gls@hyp@opt@cs[hyper=true,#1]} -\newrobustcmd*{\glslink}{% - \@gls@hyp@opt\@gls@@link +\newrobustcmd*{\acrlongpl}{\@gls@hyp@opt\ns@acrlongpl} +\newcommand*{\ns@acrlongpl}[2][]{% + \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}% } -\newcommand*{\@gls@@link}[3][]{% - \glsdoifexistsordo{#2}% +\def\@acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% {% - \let\do@gls@link@checkfirsthyper\relax - \@gls@link[#1]{#2}{#3}% - }{% - \glstextformat{#3}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsentrylongpl{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% \glspostlinkhook } -\newcommand*{\glspostlinkhook}{} -\newcommand*{\@gls@link@checkfirsthyper}{% - \ifglsused{\glslabel}% +\newrobustcmd*{\Acrlongpl}{\@gls@hyp@opt\ns@Acrlongpl} +\newcommand*{\ns@Acrlongpl}[2][]{% + \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}% +} +\def\@Acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \Glsentrylongpl{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% + \glspostlinkhook +} +\newrobustcmd*{\ACRlongpl}{\@gls@hyp@opt\ns@ACRlongpl} +\newcommand*{\ns@ACRlongpl}[2][]{% + \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}% +} +\def\@ACRlongpl#1#2[#3]{% + \glsdoifexists{#2}% {% - \gls@checkisacronymlist\glstype - \ifglshyperfirst - \if@glsisacronymlist - \ifglsacrfootnote - \KV@glslink@hyperfalse - \fi - \fi - \else - \KV@glslink@hyperfalse - \fi + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\glsentrylongpl{#2}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - \glslinkcheckfirsthyperhook + \glspostlinkhook } -\newcommand*{\glslinkcheckfirsthyperhook}{} -\newcommand*{\glslinkpostsetkeys}{} -\newcommand{\glsifhyperon}[2]{\ifKV@glslink@hyper#1\else#2\fi} -\newcommand*{\do@glsdisablehyperinlist}{% - \expandafter\DTLifinlist\expandafter{\glstype}{\@gls@nohyperlist}% - {\KV@glslink@hyperfalse}{}% +\newcommand*{\@gls@entry@field}[2]{% + \csname glo@\glsdetoklabel{#1}@#2\endcsname } -\newcommand*{\@gls@setdefault@glslink@opts}{} -\def\@gls@link[#1]#2#3{% - \leavevmode - \edef\glslabel{\glsdetoklabel{#2}}% - \def\@gls@link@opts{#1}% - \let\@gls@link@label\glslabel - \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% - \edef\glstype{\csname glo@\glslabel @type\endcsname}% - \let\org@ifKV@glslink@hyper\ifKV@glslink@hyper - \@gls@setdefault@glslink@opts - \do@glsdisablehyperinlist - \do@gls@link@checkfirsthyper - \setkeys{glslink}{#1}% - \glslinkpostsetkeys - \@gls@saveentrycounter - \@gls@setsort{\glslabel}% - \@do@wrglossary{#2}% - \ifKV@glslink@hyper - \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% - \else - \glsdonohyperlink{\glolinkprefix\glslabel}{\glstextformat{#3}}% - \fi - \let\ifKV@glslink@hyper\org@ifKV@glslink@hyper +\newcommand*{\glsletentryfield}[3]{% + \letcs{#1}{glo@\glsdetoklabel{#2}@#3}% } -\newcommand*{\glolinkprefix}{glo:} -\def\glsentrycounter{\glscounter}% -\newcommand*{\@gls@saveentrycounter}{% - \def\@gls@Hcounter{}% - \ifthenelse{\equal{\@gls@counter}{equation}}% - { - \ifcsundef{xatlevel@}% +\newcommand*{\@Gls@entry@field}[2]{% + \glsdoifexistsordo{#1}% + {% + \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% + \ifdef\@glo@text {% - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% + \xmakefirstuc{\@glo@text}% }% {% - \ifx\xatlevel@\@empty - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% - \else - \savecounters@ - \advance\c@equation by 1\relax - \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% - \ifcsundef{theH\@gls@counter}% - {% - \def\@gls@Hcounter{\theglsentrycounter}% - }% - {% - \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}% - }% - \protected@edef\theHglsentrycounter{\@gls@Hcounter}% - \restorecounters@ - \fi + ??\PackageError{glossaries}{The field `#2' doesn't exist for glossary + entry `\glsdetoklabel{#1}'}{Check you have correctly spelt the entry + label and the field name}% }% }% {% - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% + ??% }% - \ifx\@gls@Hcounter\@empty - \ifcsundef{theH\@gls@counter}% - {% - \def\theHglsentrycounter{\theglsentrycounter}% - }% - {% - \protected@edef\theHglsentrycounter{\expandafter\noexpand - \csname theH\@gls@counter\endcsname}% - }% - \fi } -\def\@set@glo@numformat#1#2#3#4{% - \expandafter\@glo@check@mkidxrangechar#3\@nil - \protected@edef#1{% - \@glo@prefix setentrycounter[#4]{#2}% - \expandafter\string\csname\@glo@suffix\endcsname - }% - \@gls@checkmkidxchars#1% +\newcommand*{\glsentryname}[1]{\@gls@entry@field{#1}{name}} +\newrobustcmd*{\Glsentryname}[1]{% + \@Gls@entryname{#1}% } -\def\@glo@check@mkidxrangechar#1#2\@nil{% -\if#1(\relax - \def\@glo@prefix{(}% - \if\relax#2\relax - \def\@glo@suffix{glsnumberformat}% - \else - \def\@glo@suffix{#2}% - \fi -\else - \if#1)\relax - \def\@glo@prefix{)}% - \if\relax#2\relax - \def\@glo@suffix{glsnumberformat}% +\newcommand*{\@Gls@entryname}[1]{% + \@Gls@entry@field{#1}{name}% +} +\newcommand*{\@Gls@acrentryname}[1]{% + \ifglshaslong{#1}% + {% + \letcs\@glo@text{glo@\glsdetoklabel{#1}@name}% + \expandafter\@gls@getbody\@glo@text{}\@nil + \expandafter\ifx\@gls@body\glsentrylong\relax + \expandafter\Glsentrylong\@gls@rest \else - \def\@glo@suffix{#2}% - \fi - \else - \def\@glo@prefix{}\def\@glo@suffix{#1#2}% - \fi -\fi} -\newcommand*{\@gls@escbsdq}[1]{% - \def\@gls@checkedmkidx{}% - \let\gls@xdystring=#1\relax - \@onelevel@sanitize\gls@xdystring - \edef\do@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil - \@backslashchar\@backslashchar\noexpand\null}% - \do@gls@xdycheckbackslash - \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% - \@for\@gls@tmp:=\gls@protected@pagefmts\do + \expandafter\ifx\@gls@body\glsentryshort\relax + \expandafter\Glsentryshort\@gls@rest + \else + \expandafter\ifx\@gls@body\acronymfont\relax + {% + \let\glsentryshort\Glsentryshort + \@glo@text + }% + \else + \expandafter\ifx\@gls@body\glsshortaccessdisplay\relax + {% + \let\glsentryshort\Glsentryshort + \@glo@text + }% + \else + \xmakefirstuc{\@glo@text}% + \fi + \fi + \fi + \fi + }% {% - \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% - \@onelevel@sanitize\@gls@sanitized@tmp - \edef\gls@dosubst{% - \noexpand\DTLsubstituteall\noexpand\gls@xdystring - {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% - }% - \gls@dosubst + \@Gls@entry@field{#1}{name}% }% - \let#1=\gls@xdystring } -\newcommand{\@gls@checkmkidxchars}[1]{% - \ifglsxindy - \@gls@escbsdq{#1}% - \else - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkquote#1\@nil""\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescquote#1\@nil\"\"\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescactual#1\@nil\?\?\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkactual#1\@nil??\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkbar#1\@nil||\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescbar#1\@nil\|\|\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checklevel#1\@nil!!\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \fi +\newcommand*{\glsentrydesc}[1]{\@gls@entry@field{#1}{desc}} +\newrobustcmd*{\Glsentrydesc}[1]{% + \@Gls@entry@field{#1}{desc}% } -\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} -\newtoks\@gls@tmpb -\def\@gls@checkquote#1"#2"#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}% - \def\@@gls@checkquote{\@gls@checkquote#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@quotechar}% - \ifx\null#3\null - \def\@@gls@checkquote{\@gls@checkquote#2""\null}% - \else - \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}% - \fi - \fi - \@@gls@checkquote +\newcommand*{\glsentrydescplural}[1]{% + \@gls@entry@field{#1}{descplural}% } -\def\@gls@checkescquote#1\"#2\"#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@quotechar - \@gls@quotechar\string\"\@gls@quotechar}% - \def\@@gls@checkescquote{\@gls@checkescquote#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@quotechar}% - \ifx\null#3\null - \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}% - \else - \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}% - \fi - \fi -\@@gls@checkescquote +\newrobustcmd*{\Glsentrydescplural}[1]{% + \@Gls@entry@field{#1}{descplural}% } -\def\@gls@checkescactual#1\?#2\?#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescactual{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@actualchar - \@gls@quotechar\string\"\@gls@actualchar}% - \def\@@gls@checkescactual{\@gls@checkescactual#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@actualchar}% - \ifx\null#3\null - \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}% - \else - \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}% - \fi - \fi -\@@gls@checkescactual -} -\def\@gls@checkescbar#1\|#2\|#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescbar{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@encapchar - \@gls@quotechar\string\"\@gls@encapchar}% - \def\@@gls@checkescbar{\@gls@checkescbar#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@encapchar}% - \ifx\null#3\null - \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}% - \else - \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}% - \fi - \fi -\@@gls@checkescbar -} -\def\@gls@checkesclevel#1\!#2\!#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkesclevel{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@levelchar - \@gls@quotechar\string\"\@gls@levelchar}% - \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@levelchar}% - \ifx\null#3\null - \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}% - \else - \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}% - \fi - \fi -\@@gls@checkesclevel -} -\def\@gls@checkbar#1|#2|#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkbar{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}% - \def\@@gls@checkbar{\@gls@checkbar#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@encapchar}% - \ifx\null#3\null - \def\@@gls@checkbar{\@gls@checkbar#2||\null}% - \else - \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}% - \fi - \fi - \@@gls@checkbar -} -\def\@gls@checklevel#1!#2!#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checklevel{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}% - \def\@@gls@checklevel{\@gls@checklevel#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@levelchar}% - \ifx\null#3\null - \def\@@gls@checklevel{\@gls@checklevel#2!!\null}% - \else - \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}% - \fi - \fi - \@@gls@checklevel +\newcommand*{\glsentrytext}[1]{\@gls@entry@field{#1}{text}} +\newrobustcmd*{\Glsentrytext}[1]{% + \@Gls@entry@field{#1}{text}% } -\def\@gls@checkactual#1?#2?#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkactual{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}% - \def\@@gls@checkactual{\@gls@checkactual#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@actualchar}% - \ifx\null#3\null - \def\@@gls@checkactual{\@gls@checkactual#2??\null}% - \else - \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}% - \fi - \fi - \@@gls@checkactual +\newcommand*{\glsentryplural}[1]{% + \@gls@entry@field{#1}{plural}% } -\def\@gls@xdycheckquote#1"#2"#3\null{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#1}% - \ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@xdycheckquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \string\"\string\"}% - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}% - \fi - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \string\"}% - \ifx\null#3\null - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}% - \else - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}% - \fi - \fi - \@@gls@xdycheckquote +\newrobustcmd*{\Glsentryplural}[1]{% + \@Gls@entry@field{#1}{plural}% } -\edef\def@gls@xdycheckbackslash{% - \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar - ##2\@backslashchar##3\noexpand\null{% - \noexpand\@gls@tmpb=\noexpand\expandafter - {\noexpand\@gls@checkedmkidx}% - \noexpand\toks@={##1}% - \noexpand\ifx\noexpand\null##2\noexpand\null - \noexpand\ifx\noexpand\null##3\noexpand\null - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% - \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}% - \noexpand\else - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ - \@backslashchar\@backslashchar\@backslashchar\@backslashchar}% - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##3\noexpand\null}% - \noexpand\fi - \noexpand\else - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ - \@backslashchar\@backslashchar}% - \noexpand\ifx\noexpand\null##3\noexpand\null - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##2\@backslashchar - \@backslashchar\noexpand\null}% - \noexpand\else - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##2\@backslashchar - ##3\noexpand\null}% - \noexpand\fi - \noexpand\fi - \noexpand\@@gls@xdycheckbackslash - }% +\newcommand*{\glsentrysymbol}[1]{% + \@gls@entry@field{#1}{symbol}% } -\def@gls@xdycheckbackslash - -\newlength\gls@tmplen -\newcommand*{\glsdohypertarget}[2]{% - \@glsshowtarget{#1}% - \settoheight{\gls@tmplen}{#2}% - \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% +\newrobustcmd*{\Glsentrysymbol}[1]{% + \@Gls@entry@field{#1}{symbol}% } -\newcommand*{\glsdohyperlink}[2]{% - \@glsshowtarget{#1}% - \hyperlink{#1}{#2}% +\newcommand*{\glsentrysymbolplural}[1]{% + \@gls@entry@field{#1}{symbolplural}% } -\newcommand*{\glsdonohyperlink}[2]{#2} -\ifcsundef{hyperlink}% -{% - \let\@glslink\glsdonohyperlink -}% -{% - \let\@glslink\glsdohyperlink +\newrobustcmd*{\Glsentrysymbolplural}[1]{% + \@Gls@entry@field{#1}{symbolplural}% } -\ifcsundef{hypertarget}% -{% - \let\@glstarget\@secondoftwo -}% -{% - \let\@glstarget\glsdohypertarget +\newcommand*{\glsentryfirst}[1]{% + \@gls@entry@field{#1}{first}% } -\newcommand{\glsdisablehyper}{% - \KV@glslink@hyperfalse - \let\@glslink\glsdonohyperlink - \let\@glstarget\@secondoftwo +\newrobustcmd*{\Glsentryfirst}[1]{% + \@Gls@entry@field{#1}{first}% } -\newcommand{\glsenablehyper}{% - \KV@glslink@hypertrue - \let\@glslink\glsdohyperlink - \let\@glstarget\glsdohypertarget +\newcommand*{\glsentryfirstplural}[1]{% + \@gls@entry@field{#1}{firstpl}% } -\providecommand{\@firstofthree}[3]{#1} -\providecommand{\@secondofthree}[3]{#2} -\newrobustcmd*{\gls}{\@gls@hyp@opt\@gls} -\newcommand*{\@gls}[2][]{% - \new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}% +\newrobustcmd*{\Glsentryfirstplural}[1]{% + \@Gls@entry@field{#1}{firstpl}% } -\def\@gls@#1#2[#3]{% - \glsdoifexists{#2}% +\newrobustcmd*{\@glsentrytitlecase}[2]{% + \glsdoifexists{#1}% {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi + \glsfieldfetch{#1}{#2}{\@gls@value}% + \xcapitalisewords{\@gls@value}% }% - \glspostlinkhook -} -\newrobustcmd*{\Gls}{\@gls@hyp@opt\@Gls} -\newcommand*{\@Gls}[2][]{% - \new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}% } -\def\@Gls@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\ifdef\texorpdfstring +{ + \newcommand*{\glsentrytitlecase}[2]{% + \texorpdfstring + {\@glsentrytitlecase{#1}{#2}}% + {\@gls@entry@field{#1}{#2}}% + } } -\newrobustcmd*{\GLS}{\@gls@hyp@opt\@GLS} -\newcommand*{\@GLS}[2][]{% - \new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}% +{ + \newcommand*{\glsentrytitlecase}[2]{\@glsentrytitlecase{#1}{#2}} } -\def\@GLS@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\newcommand*{\glsentrytype}[1]{\@gls@entry@field{#1}{type}} +\newcommand*{\glsentrysort}[1]{% + \@gls@entry@field{#1}{sort}% } -\newrobustcmd*{\glspl}{\@gls@hyp@opt\@glspl} -\newcommand*{\@glspl}[2][]{% - \new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}% +\newcommand*{\glsentryparent}[1]{% + \@gls@entry@field{#1}{parent}% } -\def\@glspl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\newcommand*{\glsentryuseri}[1]{% + \@gls@entry@field{#1}{useri}% } -\newrobustcmd*{\Glspl}{\@gls@hyp@opt\@Glspl} -\newcommand*{\@Glspl}[2][]{% - \new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}% +\newrobustcmd*{\Glsentryuseri}[1]{% + \@Gls@entry@field{#1}{useri}% } -\def\@Glspl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\newcommand*{\glsentryuserii}[1]{% + \@gls@entry@field{#1}{userii}% } -\newrobustcmd*{\GLSpl}{\@gls@hyp@opt\@GLSpl} -\newcommand*{\@GLSpl}[2][]{% - \new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}% +\newrobustcmd*{\Glsentryuserii}[1]{% + \@Gls@entry@field{#1}{userii}% } -\def\@GLSpl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glscustomtext\@empty - \def\glsinsert{#3}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\newcommand*{\glsentryuseriii}[1]{% + \@gls@entry@field{#1}{useriii}% } -\newrobustcmd*{\glsdisp}{\@gls@hyp@opt\@glsdisp} -\newcommand*{\@glsdisp}[3][]{% - \glsdoifexists{#2}{% - \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \def\glscustomtext{#3}% - \def\glsinsert{}% - \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% - \@gls@link[#1]{#2}{\@glo@text}% - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% - \glspostlinkhook +\newrobustcmd*{\Glsentryuseriii}[1]{% + \@Gls@entry@field{#1}{useriii}% } -\newcommand*{\@gls@link@nocheckfirsthyper}{} -\newcommand{\@gls@field@link}[3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \@gls@link[#1]{#2}{#3}% - }% - \glspostlinkhook +\newcommand*{\glsentryuseriv}[1]{% + \@gls@entry@field{#1}{useriv}% } -\newrobustcmd*{\glstext}{\@gls@hyp@opt\@glstext} -\newcommand*{\@glstext}[2][]{% - \new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} -\def\@glstext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentrytext{#2}#3}% +\newrobustcmd*{\Glsentryuseriv}[1]{% + \@Gls@entry@field{#1}{useriv}% } -\newrobustcmd*{\GLStext}{\@gls@hyp@opt\@GLStext} -\newcommand*{\@GLStext}[2][]{% - \new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} -\def\@GLStext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrytext{#2}#3}}% +\newcommand*{\glsentryuserv}[1]{% + \@gls@entry@field{#1}{userv}% } -\newrobustcmd*{\Glstext}{\@gls@hyp@opt\@Glstext} -\newcommand*{\@Glstext}[2][]{% - \new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} -\def\@Glstext@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentrytext{#2}#3}% +\newrobustcmd*{\Glsentryuserv}[1]{% + \@Gls@entry@field{#1}{userv}% } -\newrobustcmd*{\glsfirst}{\@gls@hyp@opt\@glsfirst} -\newcommand*{\@glsfirst}[2][]{% - \new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} -\def\@glsfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryfirst{#2}#3}% +\newcommand*{\glsentryuservi}[1]{% + \@gls@entry@field{#1}{uservi}% } -\newrobustcmd*{\Glsfirst}{\@gls@hyp@opt\@Glsfirst} -\newcommand*{\@Glsfirst}[2][]{% - \new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} -\def\@Glsfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryfirst{#2}#3}% +\newrobustcmd*{\Glsentryuservi}[1]{% + \@Gls@entry@field{#1}{uservi}% } -\newrobustcmd*{\GLSfirst}{\@gls@hyp@opt\@GLSfirst} -\newcommand*{\@GLSfirst}[2][]{% - \new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} -\def\@GLSfirst@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirst{#2}#3}}% +\newcommand*{\glsentryshort}[1]{\@gls@entry@field{#1}{short}} +\newrobustcmd*{\Glsentryshort}[1]{% + \@Gls@entry@field{#1}{short}% } -\newrobustcmd*{\glsplural}{\@gls@hyp@opt\@glsplural} -\newcommand*{\@glsplural}[2][]{% - \new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} -\def\@glsplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryplural{#2}#3}% +\newcommand*{\glsentryshortpl}[1]{\@gls@entry@field{#1}{shortpl}} +\newrobustcmd*{\Glsentryshortpl}[1]{% + \@Gls@entry@field{#1}{shortpl}% } -\newrobustcmd*{\Glsplural}{\@gls@hyp@opt\@Glsplural} -\newcommand*{\@Glsplural}[2][]{% - \new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} -\def\@Glsplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryplural{#2}#3}% +\newcommand*{\glsentrylong}[1]{\@gls@entry@field{#1}{long}} +\newrobustcmd*{\Glsentrylong}[1]{% + \@Gls@entry@field{#1}{long}% } -\newrobustcmd*{\GLSplural}{\@gls@hyp@opt\@GLSplural} -\newcommand*{\@GLSplural}[2][]{% - \new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} -\def\@GLSplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryplural{#2}#3}}% +\newcommand*{\glsentrylongpl}[1]{\@gls@entry@field{#1}{longpl}} +\newrobustcmd*{\Glsentrylongpl}[1]{% + \@Gls@entry@field{#1}{longpl}% } -\newrobustcmd*{\glsfirstplural}{\@gls@hyp@opt\@glsfirstplural} -\newcommand*{\@glsfirstplural}[2][]{% - \new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} -\def\@glsfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryfirstplural{#2}#3}% +\newcommand*{\glsentryfull}[1]{% + \acrfullformat{\glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% } -\newrobustcmd*{\Glsfirstplural}{\@gls@hyp@opt\@Glsfirstplural} -\newcommand*{\@Glsfirstplural}[2][]{% - \new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} -\def\@Glsfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryfirstplural{#2}#3}% +\newrobustcmd*{\Glsentryfull}[1]{% + \acrfullformat{\Glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% } -\newrobustcmd*{\GLSfirstplural}{\@gls@hyp@opt\@GLSfirstplural} -\newcommand*{\@GLSfirstplural}[2][]{% - \new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} -\def\@GLSfirstplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirstplural{#2}#3}}% +\newcommand*{\glsentryfullpl}[1]{% + \acrfullformat{\glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% } -\newrobustcmd*{\glsname}{\@gls@hyp@opt\@glsname} -\newcommand*{\@glsname}[2][]{% - \new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} -\def\@glsname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryname{#2}#3}% +\newrobustcmd*{\Glsentryfullpl}[1]{% + \acrfullformat{\Glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% } -\newrobustcmd*{\Glsname}{\@gls@hyp@opt\@Glsname} -\newcommand*{\@Glsname}[2][]{% - \new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} -\def\@Glsname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryname{#2}#3}% +\newcommand*{\glsentrynumberlist}[1]{% + \glsdoifexists{#1}% + {% + \@gls@entry@field{#1}{numberlist}% + }% } -\newrobustcmd*{\GLSname}{\@gls@hyp@opt\@GLSname} -\newcommand*{\@GLSname}[2][]{% - \new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} -\def\@GLSname@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryname{#2}#3}}% -} -\newrobustcmd*{\glsdesc}{\@gls@hyp@opt\@glsdesc} -\newcommand*{\@glsdesc}[2][]{% - \new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} -\def\@glsdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentrydesc{#2}#3}% -} -\newrobustcmd*{\Glsdesc}{\@gls@hyp@opt\@Glsdesc} -\newcommand*{\@Glsdesc}[2][]{% - \new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} -\def\@Glsdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentrydesc{#2}#3}% -} -\newrobustcmd*{\GLSdesc}{\@gls@hyp@opt\@GLSdesc} -\newcommand*{\@GLSdesc}[2][]{% - \new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} -\def\@GLSdesc@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydesc{#2}#3}}% -} -\newrobustcmd*{\glsdescplural}{\@gls@hyp@opt\@glsdescplural} -\newcommand*{\@glsdescplural}[2][]{% - \new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}} -\def\@glsdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentrydescplural{#2}#3}% -} -\newrobustcmd*{\Glsdescplural}{\@gls@hyp@opt\@Glsdescplural} -\newcommand*{\@Glsdescplural}[2][]{% - \new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}} -\def\@Glsdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentrydescplural{#2}#3}% -} -\newrobustcmd*{\GLSdescplural}{\@gls@hyp@opt\@GLSdescplural} -\newcommand*{\@GLSdescplural}[2][]{% - \new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}} -\def\@GLSdescplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydescplural{#2}#3}}% -} -\newrobustcmd*{\glssymbol}{\@gls@hyp@opt\@glssymbol} -\newcommand*{\@glssymbol}[2][]{% - \new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} -\def\@glssymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentrysymbol{#2}#3}% -} -\newrobustcmd*{\Glssymbol}{\@gls@hyp@opt\@Glssymbol} -\newcommand*{\@Glssymbol}[2][]{% - \new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} -\def\@Glssymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentrysymbol{#2}#3}% -} -\newrobustcmd*{\GLSsymbol}{\@gls@hyp@opt\@GLSsymbol} -\newcommand*{\@GLSsymbol}[2][]{% - \new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} -\def\@GLSsymbol@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbol{#2}#3}}% -} -\newrobustcmd*{\glssymbolplural}{\@gls@hyp@opt\@glssymbolplural} -\newcommand*{\@glssymbolplural}[2][]{% - \new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}} -\def\@glssymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentrysymbolplural{#2}#3}% -} -\newrobustcmd*{\Glssymbolplural}{\@gls@hyp@opt\@Glssymbolplural} -\newcommand*{\@Glssymbolplural}[2][]{% - \new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}} -\def\@Glssymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentrysymbolplural{#2}#3}% -} -\newrobustcmd*{\GLSsymbolplural}{\@gls@hyp@opt\@GLSsymbolplural} -\newcommand*{\@GLSsymbolplural}[2][]{% - \new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}} -\def\@GLSsymbolplural@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}#3}}% -} -\newrobustcmd*{\glsuseri}{\@gls@hyp@opt\@glsuseri} -\newcommand*{\@glsuseri}[2][]{% - \new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}} -\def\@glsuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuseri{#2}#3}% -} -\newrobustcmd*{\Glsuseri}{\@gls@hyp@opt\@Glsuseri} -\newcommand*{\@Glsuseri}[2][]{% - \new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}} -\def\@Glsuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuseri{#2}#3}% -} -\newrobustcmd*{\GLSuseri}{\@gls@hyp@opt\@GLSuseri} -\newcommand*{\@GLSuseri}[2][]{% - \new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}} -\def\@GLSuseri@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseri{#2}#3}}% -} -\newrobustcmd*{\glsuserii}{\@gls@hyp@opt\@glsuserii} -\newcommand*{\@glsuserii}[2][]{% - \new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}} -\def\@glsuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuserii{#2}#3}% -} -\newrobustcmd*{\Glsuserii}{\@gls@hyp@opt\@Glsuserii} -\newcommand*{\@Glsuserii}[2][]{% - \new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}} -\def\@Glsuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuserii{#2}#3}% -} -\newrobustcmd*{\GLSuserii}{\@gls@hyp@opt\@GLSuserii} -\newcommand*{\@GLSuserii}[2][]{% - \new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}} -\def\@GLSuserii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserii{#2}#3}}% -} -\newrobustcmd*{\glsuseriii}{\@gls@hyp@opt\@glsuseriii} -\newcommand*{\@glsuseriii}[2][]{% - \new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}} -\def\@glsuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuseriii{#2}#3}% -} -\newrobustcmd*{\Glsuseriii}{\@gls@hyp@opt\@Glsuseriii} -\newcommand*{\@Glsuseriii}[2][]{% - \new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}} -\def\@Glsuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuseriii{#2}#3}% -} -\newrobustcmd*{\GLSuseriii}{\@gls@hyp@opt\@GLSuseriii} -\newcommand*{\@GLSuseriii}[2][]{% - \new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}} -\def\@GLSuseriii@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriii{#2}#3}}% -} -\newrobustcmd*{\glsuseriv}{\@gls@hyp@opt\@glsuseriv} -\newcommand*{\@glsuseriv}[2][]{% - \new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}} -\def\@glsuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuseriv{#2}#3}% -} -\newrobustcmd*{\Glsuseriv}{\@gls@hyp@opt\@Glsuseriv} -\newcommand*{\@Glsuseriv}[2][]{% - \new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}} -\def\@Glsuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuseriv{#2}#3}% -} -\newrobustcmd*{\GLSuseriv}{\@gls@hyp@opt\@GLSuseriv} -\newcommand*{\@GLSuseriv}[2][]{% - \new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}} -\def\@GLSuseriv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriv{#2}#3}}% -} -\newrobustcmd*{\glsuserv}{\@gls@hyp@opt\@glsuserv} -\newcommand*{\@glsuserv}[2][]{% - \new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}} -\def\@glsuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuserv{#2}#3}% -} -\newrobustcmd*{\Glsuserv}{\@gls@hyp@opt\@Glsuserv} -\newcommand*{\@Glsuserv}[2][]{% -\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}} -\def\@Glsuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuserv{#2}#3}% -} -\newrobustcmd*{\GLSuserv}{\@gls@hyp@opt\@GLSuserv} -\newcommand*{\@GLSuserv}[2][]{% -\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}} -\def\@GLSuserv@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserv{#2}#3}}% -} -\newrobustcmd*{\glsuservi}{\@gls@hyp@opt\@glsuservi} -\newcommand*{\@glsuservi}[2][]{% - \new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}} -\def\@glsuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\glsentryuservi{#2}#3}% -} -\newrobustcmd*{\Glsuservi}{\@gls@hyp@opt\@Glsuservi} -\newcommand*{\@Glsuservi}[2][]{% - \new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}} -\def\@Glsuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\Glsentryuservi{#2}#3}% -} -\newrobustcmd*{\GLSuservi}{\@gls@hyp@opt\@GLSuservi} -\newcommand*{\@GLSuservi}[2][]{% - \new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}} -\def\@GLSuservi@#1#2[#3]{% - \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuservi{#2}#3}}% -} -\newrobustcmd*{\acrshort}{\@gls@hyp@opt\ns@acrshort} -\newcommand*{\ns@acrshort}[2][]{% - \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}% -} -\def\@acrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glsentryshort{#2}}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\Acrshort}{\@gls@hyp@opt\ns@Acrshort} -\newcommand*{\ns@Acrshort}[2][]{% - \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}% -} -\def\@Acrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\Glsentryshort{#2}}#3% +\@ifpackageloaded{hyperref} {% + \newcommand*{\glsdisplaynumberlist}[1]{% + \GlossariesWarning + {% + \string\glsdisplaynumberlist\space + doesn't work with hyperref.^^JUsing + \string\glsentrynumberlist\space instead% }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \glsentrynumberlist{#1}% }% - \glspostlinkhook -} -\newrobustcmd*{\ACRshort}{\@gls@hyp@opt\ns@ACRshort} -\newcommand*{\ns@ACRshort}[2][]{% - \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}% -} -\def\@ACRshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshort{#2}}#3}% +}% +{% + \newcommand*{\glsdisplaynumberlist}[1]{% + \glsdoifexists{#1}% + {% + \bgroup + \edef\@glo@label{\glsdetoklabel{#1}}% + \let\@org@glsnumberformat\glsnumberformat + \def\glsnumberformat##1{##1}% + \protected@edef\the@numberlist{% + \csname glo@\@glo@label @numberlist\endcsname}% + \def\@gls@numlist@sep{}% + \def\@gls@numlist@nextsep{}% + \def\@gls@numlist@lastsep{}% + \def\@gls@thislist{}% + \def\@gls@donext@def{}% + \renewcommand\do[1]{% + \protected@edef\@gls@thislist{% + \@gls@thislist + \noexpand\@gls@numlist@sep + ##1% + }% + \let\@gls@numlist@sep\@gls@numlist@nextsep + \def\@gls@numlist@nextsep{\glsnumlistsep}% + \@gls@donext@def + \def\@gls@donext@def{% + \def\@gls@numlist@lastsep{\glsnumlistlastsep}% + }% + }% + \expandafter \glsnumlistparser \expandafter{\the@numberlist}% + \let\@gls@numlist@sep\@gls@numlist@lastsep + \@gls@thislist + \egroup }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\acrshortpl}{\@gls@hyp@opt\ns@acrshortpl} -\newcommand*{\ns@acrshortpl}[2][]{% - \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}% + } } -\def\@acrshortpl#1#2[#3]{% +\newcommand*{\glsnumlistsep}{, } +\newcommand*{\glsnumlistlastsep}{ \& } +\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% + \def\@glo@label{#2}% + \@glslink{\glolinkprefix\glsdetoklabel{#2}}{#1}} +\define@key{glossadd}{counter}{\def\@gls@counter{#1}} +\define@key{glossadd}{format}{\def\@glsnumberformat{#1}} +\define@key{glossadd}{types}{\def\@glo@type{#1}} +\newrobustcmd*{\glsadd}[2][]{% + \@gls@adjustmode \glsdoifexists{#2}% {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\glsentryshortpl{#2}}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \def\@glsnumberformat{glsnumberformat}% + \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \setkeys{glossadd}{#1}% + \@gls@saveentrycounter + \@gls@setsort{#2}% + \@@do@wrglossary{#2}% }% - \glspostlinkhook -} -\newrobustcmd*{\Acrshortpl}{\@gls@hyp@opt\ns@Acrshortpl} -\newcommand*{\ns@Acrshortpl}[2][]{% - \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}% } -\def\@Acrshortpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \acronymfont{\Glsentryshortpl{#2}}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% +\newcommand*{\@gls@adjustmode}{} +\AtBeginDocument{\renewcommand*{\@gls@adjustmode}{\ifvmode\mbox{}\fi}} +\newrobustcmd*{\glsaddall}[1][]{% + \edef\@glo@type{\@glo@types}% + \setkeys{glossadd}{#1}% + \forallglsentries[\@glo@type]{\@glo@entry}{% + \glsadd[#1]{\@glo@entry}% }% - \glspostlinkhook -} -\newrobustcmd*{\ACRshortpl}{\@gls@hyp@opt\ns@ACRshortpl} -\newcommand*{\ns@ACRshortpl}[2][]{% - \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}% } -\def\@ACRshortpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{#2}}#3}% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook +\newrobustcmd*{\glsaddallunused}[1][\@glo@types]{% + \forallglsentries[#1]{\@glo@entry}% + {% + \ifglsused{\@glo@entry}{}{\glsadd[format=glsignore]{\@glo@entry}}% + }% } -\newrobustcmd*{\acrlong}{\@gls@hyp@opt\ns@acrlong} -\newcommand*{\ns@acrlong}[2][]{% - \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}% +\newcommand*{\glsignore}[1]{} +\edef\glsopenbrace{\expandafter\@gobble\string\{} +\edef\glsclosebrace{\expandafter\@gobble\string\}} +\edef\glsbackslash{\expandafter\@gobble\string\\} +\edef\glsquote#1{\string"#1\string"} +\edef\glspercentchar{\expandafter\@gobble\string\%} +\edef\glstildechar{\string~} +\ifglsxindy + \newcommand*{\@glsfirstletter}{A} +\fi +\newcommand*{\GlsSetXdyFirstLetterAfterDigits}{% + \@ifstar\s@GlsSetXdyFirstLetterAfterDigits\@GlsSetXdyFirstLetterAfterDigits} +\ifglsxindy + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}% + \@onelevel@sanitize\@glsfirstletter + } +\else + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% + \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}{% + \@GlsSetXdyFirstLetterAfterDigits + } +\fi +\ifglsxindy + \newcommand*{\@xdynumbergrouporder}{:before \string"\@glsfirstletter\string"} +\fi +\newcommand*{\GlsSetXdyNumberGroupOrder}[1]{% + \@ifstar\s@GlsSetXdyNumberGroupOrder\@GlsSetXdyNumberGroupOrder } -\def\@acrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsentrylong{#2}#3% +\ifglsxindy + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + } + \newcommand*{\s@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + \@onelevel@sanitize\@xdynumbergrouporder + } +\else + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \glsnoxindywarning\GlsSetXdyNumberGroupOrder} + \newcommand*{\s@GlsSetXdyNumberGroupOrder}{% + \@GlsSetXdyNumberGroupOrder} +\fi +\newcommand*{\@glsminrange}{2} +\ifglsxindy + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \renewcommand*{\@glsminrange}{#1}} +\else + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \glsnoxindywarning\GlsSetXdyMinRangeLength} +\fi + +\ifglsxindy + \def\writeist{% + \ifundef{\glswrite}{\newwrite\glswrite}{}% + \@gls@addpredefinedattributes + \openout\glswrite=\istfilename + \write\glswrite{;; xindy style file created by the glossaries + package}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\Acrlong}{\@gls@hyp@opt\ns@Acrlong} -\newcommand*{\ns@Acrlong}[2][]{% - \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}% -} -\def\@Acrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \Glsentrylong{#2}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\ACRlong}{\@gls@hyp@opt\ns@ACRlong} -\newcommand*{\ns@ACRlong}[2][]{% - \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}% -} -\def\@ACRlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase{\glsentrylong{#2}#3}% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\acrlongpl}{\@gls@hyp@opt\ns@acrlongpl} -\newcommand*{\ns@acrlongpl}[2][]{% - \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}% -} -\def\@acrlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsentrylongpl{#2}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\Acrlongpl}{\@gls@hyp@opt\ns@Acrlongpl} -\newcommand*{\ns@Acrlongpl}[2][]{% - \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}% -} -\def\@Acrlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \Glsentrylongpl{#2}#3% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newrobustcmd*{\ACRlongpl}{\@gls@hyp@opt\ns@ACRlongpl} -\newcommand*{\ns@ACRlongpl}[2][]{% - \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}% -} -\def\@ACRlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \def\glslabel{#2}% - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase{\glsentrylongpl{#2}#3}% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} -\newcommand*{\@gls@entry@field}[2]{% - \csname glo@\glsdetoklabel{#1}@#2\endcsname -} -\newcommand*{\glsletentryfield}[3]{% - \letcs{#1}{glo@\glsdetoklabel{#2}@#3}% -} -\newcommand*{\@Gls@entry@field}[2]{% - \glsdoifexistsordo{#1}% - {% - \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% - \ifdef\@glo@text - {% - \xmakefirstuc{\@glo@text}% - }% - {% - ??\PackageError{glossaries}{The field `#2' doesn't exist for glossary - entry `\glsdetoklabel{#1}'}{Check you have correctly spelt the entry - label and the field name}% - }% - }% - {% - ??% - }% -} -\newcommand*{\glsentryname}[1]{\@gls@entry@field{#1}{name}} -\newrobustcmd*{\Glsentryname}[1]{% - \@Gls@entryname{#1}% -} -\newcommand*{\@Gls@entryname}[1]{% - \@Gls@entry@field{#1}{name}% -} -\newcommand*{\@Gls@acrentryname}[1]{% - \ifglshaslong{#1}% - {% - \letcs\@glo@text{glo@\glsdetoklabel{#1}@name}% - \expandafter\@gls@getbody\@glo@text{}\@nil - \expandafter\ifx\@gls@body\glsentrylong\relax - \expandafter\Glsentrylong\@gls@rest - \else - \expandafter\ifx\@gls@body\glsentryshort\relax - \expandafter\Glsentryshort\@gls@rest - \else - \expandafter\ifx\@gls@body\acronymfont\relax - {% - \let\glsentryshort\Glsentryshort - \@glo@text - }% - \else - \expandafter\ifx\@gls@body\glsshortaccessdisplay\relax - {% - \let\glsentryshort\Glsentryshort - \@glo@text - }% - \else - \xmakefirstuc{\@glo@text}% - \fi - \fi - \fi - \fi - }% - {% - \@Gls@entry@field{#1}{name}% - }% -} -\newcommand*{\glsentrydesc}[1]{\@gls@entry@field{#1}{desc}} -\newrobustcmd*{\Glsentrydesc}[1]{% - \@Gls@entry@field{#1}{desc}% -} -\newcommand*{\glsentrydescplural}[1]{% - \@gls@entry@field{#1}{descplural}% -} -\newrobustcmd*{\Glsentrydescplural}[1]{% - \@Gls@entry@field{#1}{descplural}% -} -\newcommand*{\glsentrytext}[1]{\@gls@entry@field{#1}{text}} -\newrobustcmd*{\Glsentrytext}[1]{% - \@Gls@entry@field{#1}{text}% -} -\newcommand*{\glsentryplural}[1]{% - \@gls@entry@field{#1}{plural}% -} -\newrobustcmd*{\Glsentryplural}[1]{% - \@Gls@entry@field{#1}{plural}% -} -\newcommand*{\glsentrysymbol}[1]{% - \@gls@entry@field{#1}{symbol}% -} -\newrobustcmd*{\Glsentrysymbol}[1]{% - \@Gls@entry@field{#1}{symbol}% -} -\newcommand*{\glsentrysymbolplural}[1]{% - \@gls@entry@field{#1}{symbolplural}% -} -\newrobustcmd*{\Glsentrysymbolplural}[1]{% - \@Gls@entry@field{#1}{symbolplural}% -} -\newcommand*{\glsentryfirst}[1]{% - \@gls@entry@field{#1}{first}% -} -\newrobustcmd*{\Glsentryfirst}[1]{% - \@Gls@entry@field{#1}{first}% -} -\newcommand*{\glsentryfirstplural}[1]{% - \@gls@entry@field{#1}{firstpl}% -} -\newrobustcmd*{\Glsentryfirstplural}[1]{% - \@Gls@entry@field{#1}{firstpl}% -} -\newrobustcmd*{\@glsentrytitlecase}[2]{% - \glsdoifexists{#1}% - {% - \glsfieldfetch{#1}{#2}{\@gls@value}% - \xcapitalisewords{\@gls@value}% - }% -} -\ifdef\texorpdfstring -{ - \newcommand*{\glsentrytitlecase}[2]{% - \texorpdfstring - {\@glsentrytitlecase{#1}{#2}}% - {\@gls@entry@field{#1}{#2}}% - } -} -{ - \newcommand*{\glsentrytitlecase}[2]{\@glsentrytitlecase{#1}{#2}} -} -\newcommand*{\glsentrytype}[1]{\@gls@entry@field{#1}{type}} -\newcommand*{\glsentrysort}[1]{% - \@gls@entry@field{#1}{sort}% -} -\newcommand*{\glsentryparent}[1]{% - \@gls@entry@field{#1}{parent}% -} -\newcommand*{\glsentryuseri}[1]{% - \@gls@entry@field{#1}{useri}% -} -\newrobustcmd*{\Glsentryuseri}[1]{% - \@Gls@entry@field{#1}{useri}% -} -\newcommand*{\glsentryuserii}[1]{% - \@gls@entry@field{#1}{userii}% -} -\newrobustcmd*{\Glsentryuserii}[1]{% - \@Gls@entry@field{#1}{userii}% -} -\newcommand*{\glsentryuseriii}[1]{% - \@gls@entry@field{#1}{useriii}% -} -\newrobustcmd*{\Glsentryuseriii}[1]{% - \@Gls@entry@field{#1}{useriii}% -} -\newcommand*{\glsentryuseriv}[1]{% - \@gls@entry@field{#1}{useriv}% -} -\newrobustcmd*{\Glsentryuseriv}[1]{% - \@Gls@entry@field{#1}{useriv}% -} -\newcommand*{\glsentryuserv}[1]{% - \@gls@entry@field{#1}{userv}% -} -\newrobustcmd*{\Glsentryuserv}[1]{% - \@Gls@entry@field{#1}{userv}% -} -\newcommand*{\glsentryuservi}[1]{% - \@gls@entry@field{#1}{uservi}% -} -\newrobustcmd*{\Glsentryuservi}[1]{% - \@Gls@entry@field{#1}{uservi}% -} -\newcommand*{\glsentryshort}[1]{\@gls@entry@field{#1}{short}} -\newrobustcmd*{\Glsentryshort}[1]{% - \@Gls@entry@field{#1}{short}% -} -\newcommand*{\glsentryshortpl}[1]{\@gls@entry@field{#1}{shortpl}} -\newrobustcmd*{\Glsentryshortpl}[1]{% - \@Gls@entry@field{#1}{shortpl}% -} -\newcommand*{\glsentrylong}[1]{\@gls@entry@field{#1}{long}} -\newrobustcmd*{\Glsentrylong}[1]{% - \@Gls@entry@field{#1}{long}% -} -\newcommand*{\glsentrylongpl}[1]{\@gls@entry@field{#1}{longpl}} -\newrobustcmd*{\Glsentrylongpl}[1]{% - \@Gls@entry@field{#1}{longpl}% -} -\newcommand*{\glsentryfull}[1]{% - \acrfullformat{\glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% -} -\newrobustcmd*{\Glsentryfull}[1]{% - \acrfullformat{\Glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% -} -\newcommand*{\glsentryfullpl}[1]{% - \acrfullformat{\glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% -} -\newrobustcmd*{\Glsentryfullpl}[1]{% - \acrfullformat{\Glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% -} -\newcommand*{\glsentrynumberlist}[1]{% - \glsdoifexists{#1}% - {% - \@gls@entry@field{#1}{numberlist}% - }% -} -\@ifpackageloaded{hyperref} {% - \newcommand*{\glsdisplaynumberlist}[1]{% - \GlossariesWarning - {% - \string\glsdisplaynumberlist\space - doesn't work with hyperref.^^JUsing - \string\glsentrynumberlist\space instead% - }% - \glsentrynumberlist{#1}% - }% -}% -{% - \newcommand*{\glsdisplaynumberlist}[1]{% - \glsdoifexists{#1}% - {% - \bgroup - \edef\@glo@label{\glsdetoklabel{#1}}% - \let\@org@glsnumberformat\glsnumberformat - \def\glsnumberformat##1{##1}% - \protected@edef\the@numberlist{% - \csname glo@\@glo@label @numberlist\endcsname}% - \def\@gls@numlist@sep{}% - \def\@gls@numlist@nextsep{}% - \def\@gls@numlist@lastsep{}% - \def\@gls@thislist{}% - \def\@gls@donext@def{}% - \renewcommand\do[1]{% - \protected@edef\@gls@thislist{% - \@gls@thislist - \noexpand\@gls@numlist@sep - ##1% - }% - \let\@gls@numlist@sep\@gls@numlist@nextsep - \def\@gls@numlist@nextsep{\glsnumlistsep}% - \@gls@donext@def - \def\@gls@donext@def{% - \def\@gls@numlist@lastsep{\glsnumlistlastsep}% - }% - }% - \expandafter \glsnumlistparser \expandafter{\the@numberlist}% - \let\@gls@numlist@sep\@gls@numlist@lastsep - \@gls@thislist - \egroup - }% - } -} -\newcommand*{\glsnumlistsep}{, } -\newcommand*{\glsnumlistlastsep}{ \& } -\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% - \def\@glo@label{#2}% - \@glslink{\glolinkprefix\glsdetoklabel{#2}}{#1}} -\define@key{glossadd}{counter}{\def\@gls@counter{#1}} -\define@key{glossadd}{format}{\def\@glsnumberformat{#1}} -\define@key{glossadd}{types}{\def\@glo@type{#1}} -\newrobustcmd*{\glsadd}[2][]{% - \@gls@adjustmode - \glsdoifexists{#2}% - {% - \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% - \setkeys{glossadd}{#1}% - \@gls@saveentrycounter - \@gls@setsort{#2}% - \@@do@wrglossary{#2}% - }% -} -\newcommand*{\@gls@adjustmode}{} -\AtBeginDocument{\renewcommand*{\@gls@adjustmode}{\ifvmode\mbox{}\fi}} -\newrobustcmd*{\glsaddall}[1][]{% - \edef\@glo@type{\@glo@types}% - \setkeys{glossadd}{#1}% - \forallglsentries[\@glo@type]{\@glo@entry}{% - \glsadd[#1]{\@glo@entry}% - }% -} -\newrobustcmd*{\glsaddallunused}[1][\@glo@types]{% - \forallglsentries[#1]{\@glo@entry}% - {% - \ifglsused{\@glo@entry}{}{\glsadd[format=glsignore]{\@glo@entry}}% - }% -} -\newcommand*{\glsignore}[1]{} -\edef\glsopenbrace{\expandafter\@gobble\string\{} -\edef\glsclosebrace{\expandafter\@gobble\string\}} -\edef\glsbackslash{\expandafter\@gobble\string\\} -\edef\glsquote#1{\string"#1\string"} -\edef\glspercentchar{\expandafter\@gobble\string\%} -\edef\glstildechar{\string~} -\ifglsxindy - \newcommand*{\@glsfirstletter}{A} -\fi -\newcommand*{\GlsSetXdyFirstLetterAfterDigits}{% - \@ifstar\s@GlsSetXdyFirstLetterAfterDigits\@GlsSetXdyFirstLetterAfterDigits} -\ifglsxindy - \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% - \renewcommand*{\@glsfirstletter}{#1}} - \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}[1]{% - \renewcommand*{\@glsfirstletter}{#1}% - \@onelevel@sanitize\@glsfirstletter - } -\else - \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% - \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} - \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}{% - \@GlsSetXdyFirstLetterAfterDigits - } -\fi -\ifglsxindy - \newcommand*{\@xdynumbergrouporder}{:before \string"\@glsfirstletter\string"} -\fi -\newcommand*{\GlsSetXdyNumberGroupOrder}[1]{% - \@ifstar\s@GlsSetXdyNumberGroupOrder\@GlsSetXdyNumberGroupOrder -} -\ifglsxindy - \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% - \renewcommand*{\@xdynumbergrouporder}{#1}% - } - \newcommand*{\s@GlsSetXdyNumberGroupOrder}[1]{% - \renewcommand*{\@xdynumbergrouporder}{#1}% - \@onelevel@sanitize\@xdynumbergrouporder - } -\else - \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% - \glsnoxindywarning\GlsSetXdyNumberGroupOrder} - \newcommand*{\s@GlsSetXdyNumberGroupOrder}{% - \@GlsSetXdyNumberGroupOrder} -\fi -\newcommand*{\@glsminrange}{2} -\ifglsxindy - \newcommand*{\GlsSetXdyMinRangeLength}[1]{% - \renewcommand*{\@glsminrange}{#1}} -\else - \newcommand*{\GlsSetXdyMinRangeLength}[1]{% - \glsnoxindywarning\GlsSetXdyMinRangeLength} -\fi - -\ifglsxindy - \def\writeist{% - \ifundef{\glswrite}{\newwrite\glswrite}{}% - \@gls@addpredefinedattributes - \openout\glswrite=\istfilename - \write\glswrite{;; xindy style file created by the glossaries - package}% - \write\glswrite{;; for document '\jobname' on - \the\year-\the\month-\the\day}% - \write\glswrite{^^J; required styles^^J} - \@for\@xdystyle:=\@xdyrequiredstyles\do{% - \ifx\@xdystyle\@empty - \else - \protected@write\glswrite{}{(require - \string"\@xdystyle.xdy\string")}% - \fi - }% - \write\glswrite{^^J% - ; list of allowed attributes (number formats)^^J}% - \write\glswrite{(define-attributes ((\@xdyattributes)))}% - \write\glswrite{^^J; user defined alphabets^^J}% - \write\glswrite{\@xdyuseralphabets}% - \write\glswrite{^^J; location class definitions^^J}% - \@for\@gls@classI:=\@gls@xdy@locationlist\do{% - \protected@write\glswrite{}{(define-location-class - \string"\@gls@classI\string"^^J\space\space\space - ( - :sep "{}{" - \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space - :sep "}" - ) - ^^J\space\space\space - :min-range-length \@glsminrange^^J% - ) - }% - {% - \@for\@gls@classII:=\@gls@xdy@locationlist\do{% - \protected@write\glswrite{}{(define-location-class - \string"\@gls@classII-\@gls@classI\string" - ^^J\space\space\space - ( - :sep "{" - \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space - :sep "}{" - \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space - :sep "}" - ) - ^^J\space\space\space - :min-range-length \@glsminrange^^J% - ) - }% - }% - }% + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% + \write\glswrite{^^J; location class definitions^^J}% + \@for\@gls@classI:=\@gls@xdy@locationlist\do{% + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classI\string"^^J\space\space\space + ( + :sep "{}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% + {% + \@for\@gls@classII:=\@gls@xdy@locationlist\do{% + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classII-\@gls@classI\string" + ^^J\space\space\space + ( + :sep "{" + \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space + :sep "}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% + }% + }% }% \write\glswrite{^^J; user defined location classes}% \write\glswrite{\@xdyuserlocationdefs}% @@ -38857,7 +35632,7 @@ you \SetCustomDisplayStyle{\@gls@type}% }% } -\RequirePackage{glossary-hypernav} +\RequirePackage{glossary-hypernav}[=v4.46] \@gls@loadlist \@gls@loadlong \@gls@loadsuper @@ -38908,93 +35683,19068 @@ you \newcommand*{\showglouservi}[1]{% \expandafter\show\csname glo@\glsdetoklabel{#1}@uservi\endcsname } -\newcommand*{\showgloname}[1]{% - \expandafter\show\csname glo@\glsdetoklabel{#1}@name\endcsname +\newcommand*{\showgloname}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@name\endcsname +} +\newcommand*{\showglodesc}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@desc\endcsname +} +\newcommand*{\showglodescplural}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descplural\endcsname +} +\newcommand*{\showglosort}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@sort\endcsname +} +\newcommand*{\showglosymbol}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbol\endcsname +} +\newcommand*{\showglosymbolplural}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolplural\endcsname +} +\newcommand*{\showgloshort}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@short\endcsname +} +\newcommand*{\showglolong}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@long\endcsname +} +\newcommand*{\showgloindex}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@index\endcsname +} +\newcommand*{\showgloflag}[1]{% + \expandafter\show\csname ifglo@\glsdetoklabel{#1}@flag\endcsname +} +\newcommand*{\showgloloclist}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@loclist\endcsname +} +\newcommand*{\showglofield}[2]{% + \csshow{glo@\glsdetoklabel{#1}@#2}% +} +\newcommand*{\showacronymlists}{% + \show\@glsacronymlists +} +\newcommand*{\showglossaries}{% + \show\@glo@types +} +\newcommand*{\showglossaryin}[1]{% + \expandafter\show\csname @glotype@#1@in\endcsname +} +\newcommand*{\showglossaryout}[1]{% + \expandafter\show\csname @glotype@#1@out\endcsname +} +\newcommand*{\showglossarytitle}[1]{% + \expandafter\show\csname @glotype@#1@title\endcsname +} +\newcommand*{\showglossarycounter}[1]{% + \expandafter\show\csname @glotype@#1@counter\endcsname +} +\newcommand*{\showglossaryentries}[1]{% + \expandafter\show\csname glolist@#1\endcsname +} +\csname ifglscompatible-2.07\endcsname + \RequirePackage{glossaries-compatible-207}[=v4.46] +\fi +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-accsupp-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-accsupp-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-accsupp}[2020/03/19 v4.46 (NLCT) + Experimental glossaries accessibility] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\ProcessOptions +\@ifpackageloaded{glossaries-extra} +{% + \ifx\@glsxtr@doaccsupp\empty + \GlossariesWarning{The `glossaries-accsupp' + package has been loaded\MessageBreak + after the `glossaries-extra' package. This\MessageBreak + can cause a failure to integrate both packages. \MessageBreak + Either use the `accsupp' option when you load\MessageBreak + `glossaries-extra' or load `glossaries-accsupp'\MessageBreak + before loading `glossaries-extra'}% + \fi +} +{} +\def\compatibleglossentry#1#2{% + \toks@{#2}% + \protected@edef\@do@glossentry{% + \noexpand\accsuppglossaryentryfield{#1}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@name\endcsname}}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@desc\endcsname}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@symbol\endcsname}% + {\the\toks@}% + }% + \@do@glossentry +} +\def\compatiblesubglossentry#1#2#3{% + \toks@{#3}% + \protected@edef\@do@subglossentry{% + \noexpand\accsuppglossarysubentryfield{\number#1}% + {#2}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@name\endcsname}}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@desc\endcsname}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@symbol\endcsname}% + {\the\toks@}% + }% + \@do@subglossentry +} +\RequirePackage{glossaries}[=v4.46] +\providecommand{\gls@accsupp@engine}{accsupp} +\providecommand{\gls@accessibility}[4]{#4} +\ifdefstring\gls@accsupp@engine{accsupp} +{ + \RequirePackage{accsupp} + \renewcommand{\gls@accessibility}[4]{% + \BeginAccSupp{#1,#2={#3}}#4\EndAccSupp{}% + } +} +{} +\newcommand{\glsaccessibility}[4][]{% + \@glsshowaccsupp{#1}{#2}{#3}% + \gls@accessibility{#1}{#2}{#3}{#4}% +} +\define@key{glossentry}{access}{% + \def\@glo@access{#1}% +} +\define@key{glossentry}{textaccess}{% + \def\@glo@textaccess{#1}% +} +\define@key{glossentry}{firstaccess}{% + \def\@glo@firstaccess{#1}% +} +\define@key{glossentry}{pluralaccess}{% + \def\@glo@pluralaccess{#1}% +} +\define@key{glossentry}{firstpluralaccess}{% + \def\@glo@firstpluralaccess{#1}% +} +\define@key{glossentry}{symbolaccess}{% + \def\@glo@symbolaccess{#1}% +} +\define@key{glossentry}{symbolpluralaccess}{% + \def\@glo@symbolpluralaccess{#1}% +} +\define@key{glossentry}{descriptionaccess}{% + \def\@glo@descaccess{#1}% +} +\define@key{glossentry}{descriptionpluralaccess}{% + \def\@glo@descpluralaccess{#1}% +} +\define@key{glossentry}{shortaccess}{% + \def\@glo@shortaccess{#1}% +} +\define@key{glossentry}{shortpluralaccess}{% + \def\@glo@shortpluralaccess{#1}% +} +\define@key{glossentry}{longaccess}{% + \def\@glo@longaccess{#1}% +} +\define@key{glossentry}{longpluralaccess}{% + \def\@glo@longpluralaccess{#1}% +} +\define@key{glossentry}{user1access}{% + \def\@glo@useriaccess{#1}% +} +\define@key{glossentry}{user2access}{% + \def\@glo@useriiaccess{#1}% +} +\define@key{glossentry}{user3access}{% + \def\@glo@useriiiaccess{#1}% +} +\define@key{glossentry}{user4access}{% + \def\@glo@userivaccess{#1}% +} +\define@key{glossentry}{user5access}{% + \def\@glo@uservaccess{#1}% +} +\define@key{glossentry}{user6access}{% + \def\@glo@userviaccess{#1}% +} +\appto\@gls@keymap{,% + {access}{access},% + {textaccess}{textaccess},% + {firstaccess}{firstaccess},% + {pluralaccess}{pluralaccess},% + {firstpluralaccess}{firstpluralaccess},% + {symbolaccess}{symbolaccess},% + {symbolpluralaccess}{symbolpluralaccess},% + {descaccess}{descaccess},% + {descpluralaccess}{descpluralaccess},% + {shortaccess}{shortaccess},% + {shortpluralaccess}{shortpluralaccess},% + {longaccess}{longaccess},% + {longpluralaccess}{longpluralaccess},% + {user1access}{useriaccess},% + {user2access}{useriiaccess},% + {user3access}{useriiiaccess},% + {user4access}{userivaccess},% + {user5access}{uservaccess},% + {user6access}{userviaccess}% +} +\def\@gls@noaccess{\relax} +\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook +\renewcommand*{\@newglossaryentryprehook}{% + \@gls@oldnewglossaryentryprehook + \def\@glo@access{\relax}% + \def\@glo@textaccess{\@glo@access}% + \def\@glo@firstaccess{\@glo@access}% + \def\@glo@pluralaccess{\@glo@textaccess}% + \def\@glo@firstpluralaccess{\@glo@pluralaccess}% + \def\@glo@symbolaccess{\relax}% + \def\@glo@symbolpluralaccess{\@glo@symbolaccess}% + \def\@glo@descaccess{\relax}% + \def\@glo@descpluralaccess{\@glo@descaccess}% + \def\@glo@shortaccess{\relax}% + \def\@glo@shortpluralaccess{\@glo@shortaccess}% + \def\@glo@longaccess{\relax}% + \def\@glo@longpluralaccess{\@glo@longaccess}% + \def\@glo@useriaccess{\relax}% + \def\@glo@useriiaccess{\relax}% + \def\@glo@useriiiaccess{\relax}% + \def\@glo@userivaccess{\relax}% + \def\@glo@uservaccess{\relax}% + \def\@glo@userviaccess{\relax}% +} +\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook +\renewcommand*{\@newglossaryentryposthook}{% + \@gls@oldnewglossaryentryposthook + \expandafter + \protected@xdef\csname glo@\@glo@label @access\endcsname{% + \@glo@access}% + \expandafter + \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{% + \@glo@textaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{% + \@glo@firstaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{% + \@glo@pluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{% + \@glo@firstpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{% + \@glo@symbolaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{% + \@glo@symbolpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{% + \@glo@descaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{% + \@glo@descpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{% + \@glo@shortaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{% + \@glo@shortpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{% + \@glo@longaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{% + \@glo@longpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriaccess\endcsname{% + \@glo@useriaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiaccess\endcsname{% + \@glo@useriiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiiaccess\endcsname{% + \@glo@useriiiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userivaccess\endcsname{% + \@glo@userivaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @uservaccess\endcsname{% + \@glo@uservaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userviaccess\endcsname{% + \@glo@userviaccess}% +} +\newcommand*{\glsentryaccess}[1]{% + \@gls@entry@field{#1}{access}% +} +\newcommand*{\glsentrytextaccess}[1]{% + \@gls@entry@field{#1}{textaccess}% +} +\newcommand*{\glsentryfirstaccess}[1]{% + \@gls@entry@field{#1}{firstaccess}% +} +\newcommand*{\glsentrypluralaccess}[1]{% + \@gls@entry@field{#1}{pluralaccess}% +} +\newcommand*{\glsentryfirstpluralaccess}[1]{% + \@gls@entry@field{#1}{firstpluralaccess}% +} +\newcommand*{\glsentrysymbolaccess}[1]{% + \@gls@entry@field{#1}{symbolaccess}% +} +\newcommand*{\glsentrysymbolpluralaccess}[1]{% + \@gls@entry@field{#1}{symbolpluralaccess}% +} +\newcommand*{\glsentrydescaccess}[1]{% + \@gls@entry@field{#1}{descaccess}% +} +\newcommand*{\glsentrydescpluralaccess}[1]{% + \@gls@entry@field{#1}{descpluralaccess}% +} +\newcommand*{\glsentryshortaccess}[1]{% + \@gls@entry@field{#1}{shortaccess}% +} +\newcommand*{\glsentryshortpluralaccess}[1]{% + \@gls@entry@field{#1}{shortpluralaccess}% +} +\newcommand*{\glsentrylongaccess}[1]{% + \@gls@entry@field{#1}{longaccess}% +} +\newcommand*{\glsentrylongpluralaccess}[1]{% + \@gls@entry@field{#1}{longpluralaccess}% +} +\newcommand*{\glsentryuseriaccess}[1]{% + \@gls@entry@field{#1}{useriaccess}% +} +\newcommand*{\glsentryuseriiaccess}[1]{% + \@gls@entry@field{#1}{useriiaccess}% +} +\newcommand*{\glsentryuseriiiaccess}[1]{% + \@gls@entry@field{#1}{useriiiaccess}% +} +\newcommand*{\glsentryuserivaccess}[1]{% + \@gls@entry@field{#1}{userivaccess}% +} +\newcommand*{\glsentryuservaccess}[1]{% + \@gls@entry@field{#1}{uservaccess}% +} +\newcommand*{\glsentryuserviaccess}[1]{% + \@gls@entry@field{#1}{userviaccess}% +} +\newcommand{\glsfieldaccsupp}[4]{% + \ifdef\glscategory + {% + \ifcsdef{glsxtr\glscategory{#4}#3accsupp}% + {\csname glsxtr\glscategory{#4}#3accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{glsxtr\glscategory{#4}accsupp}% + {\csname glsxtr\glscategory{#4}accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% + }% + }% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% +} +\newcommand{\xglsfieldaccsupp}[1]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsfieldaccsupp\expandafter{\@gls@replacementtext}% +} +\newcommand*{\glsshortaccsupp}[2]{\glsaccessibility{E}{#1}{#2}} +\newcommand*{\glsshortplaccsupp}{\glsshortaccsupp} +\newcommand*{\glsaccsupp}[2]{\glsaccessibility{ActualText}{#1}{#2}} +\newcommand*{\xglsaccsupp}[2]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}% +} +\newcommand*{\@gls@access@display}[2]{% + \protected@edef\@glo@access{#2}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} +\newcommand*{\@gls@fieldaccess@display}[4]{% + \protected@edef\@glo@access{#4}% + \ifdefequal\@glo@access\@gls@noaccess + {#3}% + {\expandafter\glsfieldaccsupp\expandafter{\@glo@access}{#3}{#2}{#1}}% +} +\newrobustcmd*{\glsnameaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@access}% + {#1}% + {\@gls@fieldaccess@display{#2}{name}{#1}{\glsentryaccess{#2}}}% +} +\newrobustcmd*{\glstextaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@textaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{text}{#1}{\glsentrytextaccess{#2}}}% +} +\newrobustcmd*{\glspluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@pluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{plural}{#1}{\glsentrypluralaccess{#2}}}% +} +\newrobustcmd*{\glsfirstaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{first}{#1}{\glsentryfirstaccess{#2}}}% +} +\newrobustcmd*{\glsfirstpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{firstpl}{#1}{\glsentryfirstpluralaccess{#2}}}% +} +\newrobustcmd*{\glssymbolaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbol}{#1}{\glsentrysymbolaccess{#2}}}% +} +\newrobustcmd*{\glssymbolpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbolplural}{#1}{\glsentrysymbolpluralaccess{#2}}}% +} +\newrobustcmd*{\glsdescriptionaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{desc}{#1}{\glsentrydescaccess{#2}}}% +} +\newrobustcmd*{\glsdescriptionpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{descplural}{#1}{\glsentrydescpluralaccess{#2}}}% +} +\newrobustcmd*{\glsshortaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{short}{#1}{\glsentryshortaccess{#2}}}% +} +\newrobustcmd*{\glsshortpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{shortpl}{#1}{\glsentryshortpluralaccess{#2}}}% +} +\newrobustcmd*{\glslongaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{long}{#1}{\glsentrylongaccess{#2}}}% +} +\newrobustcmd*{\glslongpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{longpl}{#1}{\glsentrylongpluralaccess{#2}}}% +} +\newrobustcmd*{\glsuseriaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useri}{#1}{\glsentryuseriaccess{#2}}}% +} +\newrobustcmd*{\glsuseriiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userii}{#1}{\glsentryuseriiaccess{#2}}}% +} +\newrobustcmd*{\glsuseriiiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriii}{#1}{\glsentryuseriiiaccess{#2}}}% +} +\newrobustcmd*{\glsuserivaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userivaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriv}{#1}{\glsentryuserivaccess{#2}}}% +} +\newrobustcmd*{\glsuservaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@uservaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userv}{#1}{\glsentryuservaccess{#2}}}% +} +\newrobustcmd*{\glsuserviaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userviaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{uservi}{#1}{\glsentryuserviaccess{#2}}}% +} +\newrobustcmd*{\glsaccessdisplay}[3]{% + \ifcsundef{gls#1accessdisplay}% + {% + \PackageError{glossaries-accsupp}{No accessibility support + for key `#1'}{}% + }% + {% + \csname gls#1accessdisplay\endcsname{#2}{#3}% + }% +} +\renewcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}} + {\glsinsert}% + }% + {% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + #2{\glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \MakeUppercase{% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% + \MakeUppercase{% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + #2{\glstextaccessdisplay + {\Glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstaccessdisplay + {\Glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \MakeUppercase{% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% + \MakeUppercase{% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% + }% + }% + {% + \ifglsused{\glslabel}% + {% + #2{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% +} +\renewcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\mfirstucMakeUppercase{\glsentryplural{\glslabel}}}% + {\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + {% + \glsfirstpluralacessdisplay + {\mfirstucMakeUppercase{\glsentryfirstplural{\glslabel}}}% + {\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay{\glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstaccessdisplay{\glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay{\Glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstaccessdisplay{\Glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay + {\mfirstucMakeUppercase{\glsentrytext{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + {% + \glsfirstaccessdisplay + {\mfirstucMakeUppercase{\glsentryfirst{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + }% + {% + \glscustomtext\glsinsert + }% +} +\renewcommand*{\glsgenacfmt}{% + \ifdefempty\glscustomtext + {% + \ifglsused\glslabel + {% + \glsifplural + {% + \glscapscase + {% + \acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \acronymfont + {\glsshortpluralaccessdisplay + {\Glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + {% + \glscapscase + {% + \acronymfont + {\glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \acronymfont + {\glsshortaccessdisplay{\Glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{% + \glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + }% + {% + \glsifplural + {% + \glscapscase + {% + \genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genplacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + {% + \glscapscase + {% + \genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% + }% + {% + \glscustomtext + }% +} +\renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\glsentryshort{#1}}}{#1})% +} +\renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\Glsentryshort{#1}}}{#1})% +} +\renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% +} +\renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% +} +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\glsentryshort{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\Glsentryshort{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay + {\MakeUppercase{\glsentryshort{#2}}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\glsentrylong{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\Glsentrylong{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{% + \MakeUppercase{\glsentrylong{#2}}}{#2}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\glsentrytext{#2}}{#2}#3}% +} +\def\@Glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\Glsentrytext{#2}}{#2}#3}% +} +\def\@GLStext@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glstextaccessdisplay{\mfirstucMakeUppercase{\glsentrytext{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}#3}% +} +\def\@Glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}#3}% +} +\def\@GLSfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstaccessdisplay{\mfirstucMakeUppercase{\glsentryfirst{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\glsentryplural{#2}}{#2}#3}% +} +\def\@Glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}#3}% +} +\def\@GLSplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glspluralaccessdisplay{\mfirstucMakeUppercase{\glsentryplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}#3}% +} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}#3}% +} +\def\@GLSfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstpluralaccessdisplay{\mfirstucMakeUppercase{\glsentryfirstplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\glsentryname{#2}}{#2}#3}% +} +\def\@Glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\Glsentryname{#2}}{#2}#3}% +} +\def\@GLSname@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsnameaccessdisplay{\mfirstucMakeUppercase{\glsentryname{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}#3}% +} +\def\@Glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\Glsentrydesc{#2}}{#2}#3}% +} +\def\@GLSdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionaccessdisplay{\mfirstucMakeUppercase{\glsentrydesc{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}#3}% +} +\def\@Glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\Glsentrydescplural{#2}}{#2}#3}% +} +\def\@GLSdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrydescplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}#3}% +} +\def\@Glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\Glsentrysymbol{#2}}{#2}#3}% +} +\def\@GLSsymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbol{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}#3}% +} +\def\@Glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\Glsentrysymbolplural{#2}}{#2}#3}% +} +\def\@GLSsymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\glsentryuseri{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\Glsentryuseri{#2}}{#2}#3}% +} +\def\@GLSuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriaccessdisplay{\mfirstucMakeUppercase{\glsentryuseri{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\glsentryuserii{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\Glsentryuserii{#2}}{#2}#3}% +} +\def\@GLSuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiaccessdisplay{\mfirstucMakeUppercase{\glsentryuserii{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\glsentryuseriii{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\Glsentryuseriii{#2}}{#2}#3}% +} +\def\@GLSuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiiaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriii{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\glsentryuseriv{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\Glsentryuseriv{#2}}{#2}#3}% +} +\def\@GLSuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserivaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriv{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\glsentryuserv{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\Glsentryuserv{#2}}{#2}#3}% +} +\def\@GLSuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuservaccessdisplay{\mfirstucMakeUppercase{\glsentryuserv{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\glsentryuservi{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\Glsentryuservi{#2}}{#2}#3}% +} +\def\@GLSuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserviaccessdisplay{\mfirstucMakeUppercase{\glsentryuservi{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\glsentryname{#1}}{#1}}% + }% +} +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\Glsentryname{#1}}{#1}}% + }% +} +\renewcommand*{\glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\glsentrydesc{#1}}{#1}% + }% +} +\renewcommand*{\Glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\Glsentrydesc{#1}}{#1}% + }% +} +\renewcommand*{\glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\glsentrysymbol{#1}}{#1}% + }% +} +\renewcommand*{\Glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\Glsentrysymbol{#1}}{#1}% + }% +} +\newcommand*{\accsuppglossaryentryfield}[5]{% + \glossaryentryfield{#1}% + {\glsnameaccessdisplay{#2}{#1}}% + {\glsdescriptionaccessdisplay{#3}{#1}}% + {\glssymbolaccessdisplay{#4}{#1}}{#5}% +} +\newcommand*{\accsuppglossarysubentryfield}[6]{% + \glossarysubentryfield{#1}{#2}% + {\glsnameaccessdisplay{#3}{#2}}% + {\glsdescriptionaccessdisplay{#4}{#2}}% + {\glssymbolaccessdisplay{#5}{#2}}{#6}% +} +\renewacronymstyle{long-short}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{short-long}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\Glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay + {\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{long-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{long-sc-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sc-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sc-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{long-sm-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sm-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sm-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{sc-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sc-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sc-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{sm-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sm-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sm-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{dua}% +{% + \ifdefempty\glscustomtext + {% + \ifglshaslong{\glslabel}% + {% + \glsifplural + {% + \glscapscase + {% + \glslongpluralaccessdisplay{\glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glslongpluralaccessdisplay{\Glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glslongpluralaccessdisplay + {\mfirstucMakeUppercase{\glsentrylongpl{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + {% + \glscapscase + {% + \glslongaccessdisplay{\glsentrylong{\glslabel}}{\glslabel}\glsinsert + }% + {% + \glslongaccessdisplay{\Glsentrylong{\glslabel}}{\glslabel}\glsinsert + }% + {% + \glslongaccessdisplay + {\mfirstucMakeUppercase + {\glsentrylong{\glslabel}\glsinsert}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + {% + \glsgenentryfmt + }% + }% + {\glscustomtext\glsinsert}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\Glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay + {\mfirstucMakeUppercase{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\Glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\mfirstucMakeUppercase{\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\Glsentryfull}[1]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\Glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{dua-desc}% +{% + \GlsUseAcrEntryDispStyle{dua}% +}% +{% + \GlsUseAcrStyleDefs{dua}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\acronymfont{\glsentrylong{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##2}% +}% +\renewacronymstyle{footnote}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \glshyperfirstfalse + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\firstacronymfont{\Glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay + {\mfirstucMakeUppercase + {\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\mfirstucMakeUppercase + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\Glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% + \renewcommand*{\Glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% +} +\renewacronymstyle{footnote-sc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% +}% +\renewacronymstyle{footnote-sm}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +}% +\renewacronymstyle{footnote-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{footnote-sc-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sc}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sc}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{footnote-sm-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sm}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sm}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\newcommand*{\glsdefaultshortaccess}[2]{#1} +\renewcommand*{\newacronymhook}{% + \edef\@gls@keylist{% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + shortpluralaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + \the\glskeylisttok}% + \expandafter\glskeylisttok\expandafter{\@gls@keylist}% +} +\renewcommand*{\DefaultNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + description={\the\glslongtok},% + descriptionaccess=\relax, + text={\the\glsshorttok},% + access={\noexpand\@glo@textaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% + first={\noexpand\glslongaccessdisplay + {\the\glslongtok}{\the\glslabeltok}\space + (\noexpand\glsshortaccessdisplay + {\the\glsshorttok}{\the\glslabeltok})},% + plural={\the\glsshorttok\acrpluralsuffix},% + firstplural={\noexpand\glslongpluralaccessdisplay + {\noexpand\@glo@longpl}{\the\glslabeltok}\space + (\noexpand\glsshortpluralaccessdisplay + {\noexpand\@glo@shortpl}{\the\glslabeltok})},% + firstaccess=\relax, + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\renewcommand*{\DescriptionFootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + access={\noexpand\@glo@textaccess},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + symbol={\the\glslongtok},% + symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\renewcommand*{\DescriptionNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand + \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% + access={\noexpand\@glo@textaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + first={\the\glslongtok},% + firstaccess=\relax, + firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% + text={\the\glsshorttok},% + textaccess={\the\glslongtok},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + symbol={\noexpand\@glo@text},% + symbolaccess={\noexpand\@glo@textaccess},% + symbolplural={\noexpand\@glo@plural},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok}% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\renewcommand*{\FootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + textaccess={\the\glslongtok},% + access={\noexpand\@glo@textaccess},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@descplural\@org@gls@assign@descplural +} +\renewcommand*{\SmallNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + access={\noexpand\@glo@symbolaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + text={\noexpand\@glo@short},% + textaccess={\noexpand\@glo@shortaccess},% + plural={\noexpand\@glo@shortpl},% + first={\the\glslongtok},% + firstaccess=\relax, + firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\noexpand\@glo@first},% + descriptionplural={\noexpand\@glo@firstplural},% + symbol={\the\glsshorttok},% + symbolaccess={\the\glslongtok},% + symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@descplural\@org@gls@assign@descplural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} + \newcommand*{\glsshortaccesskey}{\glsshortkey access}% + \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}% + \newcommand*{\glslongaccesskey}{\glslongkey access}% + \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}% +\newcommand*{\showglonameaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@access\endcsname +} +\newcommand*{\showglotextaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@textaccess\endcsname +} +\newcommand*{\showglopluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@pluralaccess\endcsname +} +\newcommand*{\showglofirstaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstaccess\endcsname +} +\newcommand*{\showglofirstpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstpluralaccess\endcsname +} +\newcommand*{\showglosymbolaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolaccess\endcsname +} +\newcommand*{\showglosymbolpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolpluralaccess\endcsname +} +\newcommand*{\showglodescaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descaccess\endcsname +} +\newcommand*{\showglodescpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descpluralaccess\endcsname +} +\newcommand*{\showgloshortaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortaccess\endcsname +} +\newcommand*{\showgloshortpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortpluralaccess\endcsname +} +\newcommand*{\showglolongaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longaccess\endcsname +} +\newcommand*{\showglolongpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longpluralaccess\endcsname +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-babel-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-babel-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-babel}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-207-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-compatible-207-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-207}[2020/03/19 v4.46 (NLCT)] +\ifglsxindy + \renewcommand*\GlsAddXdyAttribute[1]{% + \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}% + \expandafter\toks@\expandafter{\@xdylocref}% + \edef\@xdylocref{\the\toks@ ^^J% + (markup-locref + :open \string"\string~n\string\setentrycounter + {\noexpand\glscounter}% + \expandafter\string\csname#1\endcsname + \expandafter\@gobble\string\{\string" ^^J + :close \string"\expandafter\@gobble\string\}\string" ^^J + :attr \string"#1\string")}} +\fi +\renewcommand*\GlsAddXdyCounters[1]{% + \GlossariesWarning{\string\GlsAddXdyCounters\space not available + in compatibility mode.}% +} + \GlsAddXdyAttribute{glsnumberformat} + \GlsAddXdyAttribute{textrm} + \GlsAddXdyAttribute{textsf} + \GlsAddXdyAttribute{texttt} + \GlsAddXdyAttribute{textbf} + \GlsAddXdyAttribute{textmd} + \GlsAddXdyAttribute{textit} + \GlsAddXdyAttribute{textup} + \GlsAddXdyAttribute{textsl} + \GlsAddXdyAttribute{textsc} + \GlsAddXdyAttribute{emph} + \GlsAddXdyAttribute{glshypernumber} + \GlsAddXdyAttribute{hyperrm} + \GlsAddXdyAttribute{hypersf} + \GlsAddXdyAttribute{hypertt} + \GlsAddXdyAttribute{hyperbf} + \GlsAddXdyAttribute{hypermd} + \GlsAddXdyAttribute{hyperit} + \GlsAddXdyAttribute{hyperup} + \GlsAddXdyAttribute{hypersl} + \GlsAddXdyAttribute{hypersc} + \GlsAddXdyAttribute{hyperemph} +\ifglsxindy + \renewcommand*{\GlsAddXdyLocation}[2]{% + \edef\@xdyuserlocationdefs{% + \@xdyuserlocationdefs ^^J% + (define-location-class \string"#1\string"^^J\space\space + \space(#2)) + }% + \edef\@xdyuserlocationnames{% + \@xdyuserlocationnames^^J\space\space\space + \string"#1\string"}% + } +\fi +\renewcommand{\@do@wrglossary}[1]{% +\ifglsxindy + \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil + \def\@glo@range{}% + \expandafter\if\@glo@prefix(\relax + \def\@glo@range{:open-range}% + \else + \expandafter\if\@glo@prefix)\relax + \def\@glo@range{:close-range}% + \fi + \fi + \protected@edef\@glslocref{\theglsentrycounter}% + \@gls@checkmkidxchars\@glslocref + \glossary[\csname glo@#1@type\endcsname]{% + (indexentry :tkey (\csname glo@#1@index\endcsname) + :locref \string"\@glslocref\string" % + :attr \string"\@glo@suffix\string" \@glo@range + ) + }% +\else + \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat + \glossary[\csname glo@#1@type\endcsname]{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}% +\fi +} +\def\@set@glo@numformat#1#2#3{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname + }% + \@gls@checkmkidxchars#1% +} +\ifglsxindy + \def\writeist{% + \openout\glswrite=\istfilename + \write\glswrite{;; xindy style file created by the glossaries + package in compatible-2.07 mode}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi + }% + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% + \write\glswrite{^^J; location class definitions^^J}% + \protected@edef\@gls@roman{\@roman{0\string" + \string"roman-numbers-lowercase\string" :sep \string"}}% + \@onelevel@sanitize\@gls@roman + \edef\@tmp{\string" \string"roman-numbers-lowercase\string" + :sep \string"}% + \@onelevel@sanitize\@tmp + \ifx\@tmp\@gls@roman + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-lowercase\string") + :min-range-length \@glsminrange)}% + \else + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (:sep "\@gls@roman") + :min-range-length \@glsminrange)}% + \fi + \write\glswrite{(define-location-class + \string"Roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-uppercase\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"arabic-page-numbers\string"^^J\space\space\space + (\string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"alpha-page-numbers\string"^^J\space\space\space + (\string"alpha\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"Alpha-page-numbers\string"^^J\space\space\space + (\string"ALPHA\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"Appendix-page-numbers\string"^^J\space\space\space + (\string"ALPHA\string" + :sep \string"\@glsAlphacompositor\string" + \string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"arabic-section-numbers\string"^^J\space\space\space + (\string"arabic-numbers\string" + :sep \string"\glscompositor\string" + \string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{^^J; user defined location classes}% + \write\glswrite{\@xdyuserlocationdefs}% + \write\glswrite{^^J; define cross-reference class^^J}% + \write\glswrite{(define-crossref-class \string"see\string" + :unverified )}% + \write\glswrite{(markup-crossref-list + :class \string"see\string"^^J\space\space\space + :open \string"\string\glsseeformat\string" + :close \string"{}\string")}% + \write\glswrite{^^J; define the order of the location classes}% + \write\glswrite{(define-location-class-order + (\@xdylocationclassorder))}% + \write\glswrite{^^J; define the glossary markup^^J}% + \write\glswrite{(markup-index^^J\space\space\space + :open \string"\string + \glossarysection[\string\glossarytoctitle]{\string + \glossarytitle}\string\glossarypreamble\string~n\string\begin + {theglossary}\string\glossaryheader\string~n\string" ^^J\space + \space\space:close \string"\expandafter\@gobble + \string\%\string~n\string + \end{theglossary}\string\glossarypostamble + \string~n\string" ^^J\space\space\space + :tree)}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% + \write\glswrite{(markup-indexentry + :open \string"\string\relax \string\glsresetentrylist + \string~n\string")}% + \write\glswrite{(markup-locclass-list :open + \string"\glsopenbrace\string\glossaryentrynumbers + \glsopenbrace\string\relax\space \string"^^J\space\space\space + :sep \string", \string" + :close \string"\glsclosebrace\glsclosebrace\string")}% + \write\glswrite{(markup-locref-list + :sep \string"\string\delimN\space\string")}% + \write\glswrite{(markup-range + :sep \string"\string\delimR\space\string")}% + \@onelevel@sanitize\gls@suffixF + \@onelevel@sanitize\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixF" :length 1 :ignore-end)}% + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixFF" :length 2 :ignore-end)}% + \fi + \write\glswrite{^^J; define format to use for locations^^J}% + \write\glswrite{\@xdylocref}% + \write\glswrite{^^J; define letter group list format^^J}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% + \write\glswrite{^^J; letter group headings^^J}% + \write\glswrite{(markup-letter-group + :open-head \string"\string\glsgroupheading + \glsopenbrace\string"^^J\space\space\space + :close-head \string"\glsclosebrace\string")}% + \write\glswrite{^^J; additional letter groups^^J}% + \write\glswrite{\@xdylettergroups}% + \write\glswrite{^^J; additional sort rules^^J} + \write\glswrite{\@xdysortrules}% + \noist} +\else + \edef\@gls@actualchar{\string?} + \edef\@gls@encapchar{\string|} + \edef\@gls@levelchar{\string!} + \edef\@gls@quotechar{\string"} + \def\writeist{\relax + \openout\glswrite=\istfilename + \write\glswrite{\expandafter\@gobble\string\% makeindex style file + created by the glossaries package} + \write\glswrite{\expandafter\@gobble\string\% for document + '\jobname' on \the\year-\the\month-\the\day} + \write\glswrite{actual '\@gls@actualchar'} + \write\glswrite{encap '\@gls@encapchar'} + \write\glswrite{level '\@gls@levelchar'} + \write\glswrite{quote '\@gls@quotechar'} + \write\glswrite{keyword \string"\string\\glossaryentry\string"} + \write\glswrite{preamble \string"\string\\glossarysection[\string + \\glossarytoctitle]{\string\\glossarytitle}\string + \\glossarypreamble\string\n\string\\begin{theglossary}\string + \\glossaryheader\string\n\string"} + \write\glswrite{postamble \string"\string\%\string\n\string + \\end{theglossary}\string\\glossarypostamble\string\n + \string"} + \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n + \string"} + \write\glswrite{item_0 \string"\string\%\string\n\string"} + \write\glswrite{item_1 \string"\string\%\string\n\string"} + \write\glswrite{item_2 \string"\string\%\string\n\string"} + \write\glswrite{item_01 \string"\string\%\string\n\string"} + \write\glswrite{item_x1 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{item_12 \string"\string\%\string\n\string"} + \write\glswrite{item_x2 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{delim_0 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_1 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_2 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_t \string"\string\}\string\}\string"} + \write\glswrite{delim_n \string"\string\\delimN \string"} + \write\glswrite{delim_r \string"\string\\delimR \string"} + \write\glswrite{headings_flag 1} + \write\glswrite{heading_prefix + \string"\string\\glsgroupheading\string\{\string"} + \write\glswrite{heading_suffix + \string"\string\}\string\\relax + \string\\glsresetentrylist \string"} + \write\glswrite{symhead_positive \string"glssymbols\string"} + \write\glswrite{numhead_positive \string"glsnumbers\string"} + \write\glswrite{page_compositor \string"\glscompositor\string"} + \@gls@escbsdq\gls@suffixF + \@gls@escbsdq\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + \fi + \noist + } +\fi +\renewcommand*{\noist}{\let\writeist\relax} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-307-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-compatible-307-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-307}[2020/03/19 v4.46 (NLCT)] +\newcommand{\compatglossarystyle}[2]{% + \ifcsundef{@glscompstyle@#1}% + {% + \csdef{@glscompstyle@#1}{#2}% + }% + {% + \PackageError{glossaries}{Glossary compatibility style `#1' is already defined}{}% + }% +} +\compatglossarystyle{inline}{% + \renewcommand{\glossaryentryfield}[5]{% + \glsinlinedopostchild + \gls@inlinesep + \def\glo@desc{##3}% + \def\@no@post@desc{\nopostdesc}% + \glsentryitem{##1}\glsinlinenameformat{##1}{##2}% + \ifx\glo@desc\@no@post@desc + \glsinlineemptydescformat{##4}{##5}% + \else + \ifstrempty{##3}% + {\glsinlineemptydescformat{##4}{##5}}% + {\glsinlinedescformat{##3}{##4}{##5}}% + \fi + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand{\glossarysubentryfield}[6]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{##3}% + \glssubentryitem{##2}\glsinlinesubdescformat{##4}{##5}{##6}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% +} +\compatglossarystyle{list}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}] + ##3\glspostdescription\space ##5}% + \renewcommand*{\glossarysubentryfield}[6]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}% +} +\compatglossarystyle{listgroup}{% + \csuse{@glscompstyle@list}% +}% +\compatglossarystyle{listhypergroup}{% + \csuse{@glscompstyle@list}% +}% +\compatglossarystyle{altlist}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]% + \mbox{}\par\nobreak\@afterheading + ##3\glspostdescription\space ##5}% + \renewcommand{\glossarysubentryfield}[6]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6}% +}% +\compatglossarystyle{altlistgroup}{% + \csuse{@glscompstyle@altlist}% +}% +\compatglossarystyle{altlisthypergroup}{% + \csuse{@glscompstyle@altlist}% +}% +\compatglossarystyle{listdotted}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}\glstarget{##1}{##2}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}% + \renewcommand*{\glossarysubentryfield}[6]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{##3}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}% +}% +\compatglossarystyle{sublistdotted}{% + \csuse{@glscompstyle@listdotted}% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]}% +}% +\compatglossarystyle{long}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +\compatglossarystyle{longborder}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{longheader}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{longheaderborder}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{long3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +\compatglossarystyle{long3colborder}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long3colheader}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long3colheaderborder}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +\compatglossarystyle{long4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{long4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{long4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4col}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{longragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +\compatglossarystyle{longraggedborder}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longraggedheader}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longraggedheaderborder}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +\compatglossarystyle{longragged3colborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{longragged3colheader}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{longragged3colheaderborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{altlongragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +\compatglossarystyle{altlongragged4colheader}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{altlongragged4colborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{altlongragged4colheaderborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{index}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5}% + \renewcommand*{\glossarysubentryfield}[6]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem + \fi + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax + \else + \space(##5)% + \fi + \space##4\glspostdescription\space ##6}% +}% +\compatglossarystyle{indexgroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{indexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{tree}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax + \else + \space(##5)% + \fi + \space##4\glspostdescription\space ##6\par}% +}% +\compatglossarystyle{treegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{treehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{treenoname}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + ##4\glspostdescription\space ##6\par}% +}% +\compatglossarystyle{treenonamegroup}{% + \csuse{@glscompstyle@treenoname}% +}% +\compatglossarystyle{treenonamehypergroup}{% + \csuse{@glscompstyle@treenoname}% +}% +\compatglossarystyle{alttree}{% + \renewcommand{\glossaryentryfield}[5]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% + \hangindent\glstreeindent + \parindent\glstreeindent + \fi + \makebox[0pt][r]{\makebox[\glstreeindent][l]{% + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}% + \ifx\relax##4\relax + \else + (##4)\space + \fi + ##3\glspostdescription \space ##5\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\glossarysubentryfield}[6]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\textbf{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\textbf{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\textbf{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \hangindent\glstreeindent + \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% + \textbf{\glstarget{##2}{##3}}}}% + \ifx##5\relax\relax + \else + (##5)\space + \fi + ##4\glspostdescription\space ##6\par + \def\@gls@prevlevel{##1}% + }% +}% +\compatglossarystyle{alttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{alttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolindex}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcolindexgroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcolindexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcoltree}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolindextreegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolindextreehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenoname}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenonamegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenonamehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolalttree}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolalttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolalttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% + +\compatglossarystyle{superragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +\compatglossarystyle{superraggedborder}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superraggedheader}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superraggedheaderborder}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +\compatglossarystyle{superragged3colborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{superragged3colheader}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{superragged3colheaderborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{altsuperragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +\compatglossarystyle{altsuperragged4colheader}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{altsuperragged4colborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{altsuperragged4colheaderborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{super}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +\compatglossarystyle{superborder}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{superheader}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{superheaderborder}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{super3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +\compatglossarystyle{super3colborder}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super3colheader}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super3colheaderborder}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +\compatglossarystyle{super4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{super4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{super4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4col}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-polyglossia-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-polyglossia-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-polyglossia}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-prefix-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossaries-prefix-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-prefix}[2020/03/19 v4.46 (NLCT)] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\ProcessOptions +\RequirePackage{glossaries}[=v4.46] +\define@key{glossentry}{prefixfirst}{\def\@glo@entryprefixfirst{#1}}% +\define@key{glossentry}{prefixfirstplural}{\def\@glo@entryprefixfirstplural{#1}}% +\define@key{glossentry}{prefix}{\def\@glo@entryprefix{#1}}% +\define@key{glossentry}{prefixplural}{\def\@glo@entryprefixplural{#1}}% +\appto\@gls@keymap{,% + {prefixfirst}{prefixfirst},% + {prefixfirstplural}{prefixfirstplural},% + {prefix}{prefix},% + {prefixplural}{prefixplural}% + } +\appto\@newglossaryentryprehook{% + \def\@glo@entryprefix{}% + \def\@glo@entryprefixplural{}% + \let\@glo@entryprefixfirst\@gls@default@value + \let\@glo@entryprefixfirstplural\@gls@default@value +} +\appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{prefix}{\@glo@entryprefix}% + \gls@assign@field{}{\@glo@label}{prefixplural}{\@glo@entryprefixplural}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefix\endcsname}{\@glo@label}{prefixfirst}% + {\@glo@entryprefixfirst}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefixplural\endcsname}{\@glo@label}% + {prefixfirstplural}{\@glo@entryprefixfirstplural}% +} +\newcommand*{\glsentryprefixfirst}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixfirst}} +\newcommand*{\glsentryprefixfirstplural}[1]{% + \csuse{glo@\glsdetoklabel{#1}@prefixfirstplural}} +\newcommand*{\glsentryprefix}[1]{\csuse{glo@\glsdetoklabel{#1}@prefix}} +\newcommand*{\glsentryprefixplural}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixplural}} +\newrobustcmd*{\Glsentryprefixfirst}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirst\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefixfirstplural}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirstplural\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefix}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefix\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefixplural}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixplural\endcsname}% + \xmakefirstuc\@glo@text +} +\newcommand*{\ifglshasprefix}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefix}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixplural}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixfirst}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirst}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixfirstplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirstplural}% + {#3}% + {#2}% +} +\providecommand{\@glsprefix@record@hook}[2]{% + \ifdef\@glsxtr@record + {\@glsxtr@record{#1}{#2}{glslink}}% + {}% +} +\newcommand{\glsprefixsep}{} +\newrobustcmd{\pgls}{\@gls@hyp@opt\@pgls} +\newcommand*{\@pgls}[2][]{% + \new@ifnextchar[% + {\@pgls@{#1}{#2}}% + {\@pgls@{#1}{#2}[]}% +} +\def\@pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}{\glsentryprefix{#2}\glsprefixsep}{}% + }% + {% + \ifglshasprefixfirst{#2}{\glsentryprefixfirst{#2}\glsprefixsep}{}% + }% + \@gls@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\pglspl}{\@gls@hyp@opt\@pglspl} +\newcommand*{\@pglspl}[2][]{% + \new@ifnextchar[% + {\@pglspl@{#1}{#2}}% + {\@pglspl@{#1}{#2}[]}% +} +\def\@pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}{\glsentryprefixplural{#2}\glsprefixsep}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\glsentryprefixfirstplural{#2}\glsprefixsep}{}% + }% + \@glspl@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\Pgls}{\@gls@hyp@opt\@Pgls} +\newcommand*{\@Pgls}[2][]{% + \new@ifnextchar[% + {\@Pgls@{#1}{#2}}% + {\@Pgls@{#1}{#2}[]}% +} +\def\@Pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {% + \Glsentryprefix{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirst{#2}% + {% + \Glsentryprefixfirst{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + }% +} +\newrobustcmd{\Pglspl}{\@gls@hyp@opt\@Pglspl} +\newcommand*{\@Pglspl}[2][]{% + \new@ifnextchar[% + {\@Pglspl@{#1}{#2}}% + {\@Pglspl@{#1}{#2}[]}% +} +\def\@Pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {% + \Glsentryprefixplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {% + \Glsentryprefixfirstplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + }% +} +\newrobustcmd{\PGLS}{\@gls@hyp@opt\@PGLS} +\newcommand*{\@PGLS}[2][]{% + \new@ifnextchar[% + {\@PGLS@{#1}{#2}}% + {\@PGLS@{#1}{#2}[]}% +} +\def\@PGLS@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {\mfirstucMakeUppercase{\glsentryprefix{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirst{#2}% + {\mfirstucMakeUppercase{\glsentryprefixfirst{#2}\glsprefixsep}}{}% + }% + \@GLS@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\PGLSpl}{\@gls@hyp@opt\@PGLSpl} +\newcommand*{\@PGLSpl}[2][]{% + \new@ifnextchar[% + {\@PGLSpl@{#1}{#2}}% + {\@PGLSpl@{#1}{#2}[]}% +} +\def\@PGLSpl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {\mfirstucMakeUppercase{\glsentryprefixplural{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\mfirstucMakeUppercase{\glsentryprefixfirstplural{#2}\glsprefixsep}}{}% + }% + \@GLSpl@{#1}{#2}[#3]% + }% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-hypernav-2020-03-19.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.46 (glossary-hypernav-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-hypernav}[2020/03/19 v4.46 (NLCT)] +\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% + \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% + \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}} +\newcommand*{\glsnavhyperlinkname}[2]{glsn:#1@#2} +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% + \@glsnavhypertarget{#1}{#2}{#3}% +} +\newcommand*{\@glsnavhypertarget}[3]{% + \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% + \@glstarget{\glsnavhyperlinkname{#1}{#2}}{#3}% + \expandafter\let + \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname + \@for\@gls@elem:=\@gls@list\do{% + \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% + \if@endfor + \else + \GlossariesWarningNoLine{Navigation panel + for glossary type `#1'^^Jmissing group `#2'}% + \gdef\gls@hypergrouprerun{% + \GlossariesWarningNoLine{Navigation panel + has changed. Rerun LaTeX}}% + \fi +} +\let\gls@hypergrouprerun\relax +\AtEndDocument{\gls@hypergrouprerun} +\newcommand*{\@gls@hypergroup}[2]{% +\@ifundefined{@gls@hypergrouplist@#1}{% + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}% +}{% + \expandafter\let\expandafter\@gls@tmp + \csname @gls@hypergrouplist@#1\endcsname + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{% + \@gls@tmp,#2}% +}% +} +\newcommand*{\glsnavigation}{% + \def\@gls@between{}% + \ifcsundef{@gls@hypergrouplist@\@glo@type}% + {% + \def\@gls@list{}% + }% + {% + \expandafter\let\expandafter\@gls@list + \csname @gls@hypergrouplist@\@glo@type\endcsname + }% + \@for\@gls@tmp:=\@gls@list\do{% + \@gls@between + \@gls@getgrouptitle{\@gls@tmp}{\@gls@grptitle}% + \glsnavhyperlink{\@gls@tmp}{\@gls@grptitle}% + \let\@gls@between\glshypernavsep + }% +} +\newcommand*{\glshypernavsep}{\space\textbar\space} +\newcommand*{\glssymbolnav}{% + \glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}% + \glshypernavsep + \glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}% + \glshypernavsep +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-inline-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-inline-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-inline}[2020/03/19 v4.46 (NLCT)] +\newglossarystyle{inline}{% + \renewenvironment{theglossary}% + {% + \def\gls@inlinesep{}% + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{}% + }% + {\glspostinline}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsinlinedopostchild + \gls@inlinesep + \glsentryitem{##1}% + \glsinlinenameformat{##1}{% + \glossentryname{##1}% + }% + \ifglsdescsuppressed{##1}% + {% + \glsinlineemptydescformat + {% + \glossentrysymbol{##1}% + }% + {% + ##2% + }% + }% + {% + \ifglshasdesc{##1}% + {\glsinlinedescformat{\glossentrydesc{##1}}{\glossentrysymbol{##1}}{##2}}% + {\glsinlineemptydescformat{\glossentrysymbol{##1}}{##2}}% + }% + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand{\subglossentry}[3]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{% + \glossentryname{##2}}% + \glssubentryitem{##2}% + \glsinlinesubdescformat{\glossentrydesc{##2}}{\glossentrysymbol{##2}}{##3}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% + \renewcommand*{\glsgroupskip}{}% +} +\newcommand*{\glsinlinedopostchild}{% + \gls@inlinepostchild + \def\gls@inlinepostchild{}% +} +\newcommand*{\glsinlineseparator}{;\space} +\newcommand*{\glsinlinesubseparator}{,\space} +\newcommand*{\glsinlineparentchildseparator}{:\space} +\newcommand*{\glsinlinepostchild}{} +\newcommand*{\glspostinline}{\glspostdescription\space} +\newcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{#2}} +\newcommand*{\glsinlinedescformat}[3]{\space#1} +\newcommand*{\glsinlineemptydescformat}[2]{} +\newcommand*{\glsinlinesubnameformat}[2]{\glstarget{#1}{}} +\newcommand*{\glsinlinesubdescformat}[3]{#1} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-list-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-list-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-list}[2020/03/19 v4.46 (NLCT)] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glslistgroupheaderfmt}[1]{#1} +\newcommand*{\glslistnavigationitem}[1]{\item[#1]} +\newglossarystyle{list}{% + \renewenvironment{theglossary}% + {\begin{description}}{\end{description}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}] + \glossentrydesc{##1}\glspostdescription\space ##2}% + \renewcommand*{\subglossentry}[3]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\space + \glossentrydesc{##2}\glspostdescription\space ##3.}% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{listgroup}{% + \setglossarystyle{list}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} +\newglossarystyle{listhypergroup}{% + \setglossarystyle{list}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} +\newglossarystyle{altlist}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}]% + \mbox{}\par\nobreak\@afterheading + \glossentrydesc{##1}\glspostdescription\space ##2}% + \renewcommand{\subglossentry}[3]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space ##3}% +} +\newglossarystyle{altlistgroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} +\newglossarystyle{altlisthypergroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} +\newglossarystyle{listdotted}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##1}}% + \renewcommand*{\subglossentry}[3]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{\glossentryname{##2}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##2}}% +} +\newlength\glslistdottedwidth +\setlength{\glslistdottedwidth}{.5\hsize} +\newglossarystyle{sublistdotted}{% + \setglossarystyle{listdotted}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}]}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-long-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-list-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-long}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{longtable} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{long}{% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi +} +\newglossarystyle{longborder}{% + \setglossarystyle{long}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longheader}{% + \setglossarystyle{long}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname\tabularnewline\endhead}% +} +\newglossarystyle{longheaderborder}{% + \setglossarystyle{longborder}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries + \descriptionname\tabularnewline\hline + \endhead + \hline\endfoot}% +} +\newglossarystyle{long3col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & \tabularnewline}% + \fi +} +\newglossarystyle{long3colborder}{% + \setglossarystyle{long3col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{long3colheader}{% + \setglossarystyle{long3col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{long3colheaderborder}{% + \setglossarystyle{long3colborder}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{long4col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{llll}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & & \tabularnewline}% + \fi +} +\newglossarystyle{long4colheader}{% + \setglossarystyle{long4col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{long4colborder}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{long4colheaderborder}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{altlong4col}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colheader}{% + \setglossarystyle{long4colheader}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colborder}{% + \setglossarystyle{long4colborder}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colheaderborder}{% + \setglossarystyle{long4colheaderborder}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-longbooktabs-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-longbooktabs-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-longbooktabs}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{booktabs} +\RequirePackage{glossary-long}[=v4.46] +\RequirePackage{glossary-longragged}[=v4.46] +\newglossarystyle{long-booktabs}{% + \glspatchLToutput + \setglossarystyle{long}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & \bfseries + \descriptionname\tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{long3col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long3col}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & + \bfseries \descriptionname & + \bfseries \pagelistname + \tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{long4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long4col}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & + \bfseries \descriptionname & + \bfseries \symbolname & + \bfseries \pagelistname + \tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{altlong4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long4col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{longragged-booktabs}{% + \glspatchLToutput + \setglossarystyle{long-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{longragged3col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long3col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlongragged4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{altlong4col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newcommand*{\glsLTpenaltycheck}{% + \ifnum\outputpenalty=-50\vskip-\normalbaselineskip\relax\fi +} +\newcommand{\glspenaltygroupskip}{% + \noalign{\penalty-50\vskip\normalbaselineskip}} +\let\@gls@org@LT@output\LT@output +\newcommand*{\glsrestoreLToutput}{\let\LT@output\@gls@org@LT@output} +\newcommand*{\glspatchLToutput}{% + \renewcommand*{\LT@output}{% + \ifnum\outputpenalty <-\@Mi + \ifnum\outputpenalty > -\LT@end@pen + \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \else + \setbox\z@\vbox{\unvbox\@cclv}% + \ifdim \ht\LT@lastfoot>\ht\LT@foot + \dimen@\pagegoal + \advance\dimen@-\ht\LT@lastfoot + \ifdim\dimen@<\ht\z@ + \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% + \@makecol + \@outputpage + \setbox\z@\vbox{\box\LT@head\glsLTpenaltycheck}% + \fi + \fi + \global\@colroom\@colht + \global\vsize\@colht + {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% + \fi + \else + \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% + \@makecol + \@outputpage + \global\vsize\@colroom + \copy\LT@head + \glsLTpenaltycheck + \nobreak + \fi + }% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-longragged-2020-03-19.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.46 (glossary-longragged-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-longragged}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{array} +\RequirePackage{longtable} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{longragged}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}% + \glspostdescription\space ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi +} +\newglossarystyle{longraggedborder}{% + \setglossarystyle{longragged}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longraggedheader}{% + \setglossarystyle{longragged}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname + \tabularnewline\endhead}% +} +\newglossarystyle{longraggedheaderborder}{% + \setglossarystyle{longraggedborder}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries \descriptionname + \tabularnewline\hline + \endhead + \hline\endfoot}% +} +\newglossarystyle{longragged3col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & \tabularnewline}% + \fi +} +\newglossarystyle{longragged3colborder}{% + \setglossarystyle{longragged3col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longragged3colheader}{% + \setglossarystyle{longragged3col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{longragged3colheaderborder}{% + \setglossarystyle{longragged3colborder}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{altlongragged4col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & & \tabularnewline}% + \fi +} +\newglossarystyle{altlongragged4colheader}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{altlongragged4colborder}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{altlongragged4colheaderborder}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-mcols-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-mcols-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-mcols}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{multicol} +\RequirePackage{glossary-tree}[=v4.46] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glsmcols}{2} +\newglossarystyle{mcolindex}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem + \let\subitem\glstreesubitem + \let\subsubitem\glstreesubsubitem + }% + {\end{multicols}}% +} +\newglossarystyle{mcolindexgroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\indexspace}% +} +\newglossarystyle{mcolindexhypergroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{mcolindexspannav}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem}% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{mcoltree}{% + \setglossarystyle{tree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% +} +\newglossarystyle{mcoltreegroup}{% + \setglossarystyle{mcoltree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcoltreehypergroup}{% + \setglossarystyle{mcoltree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreespannav}{% + \setglossarystyle{tree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreenoname}{% + \setglossarystyle{treenoname}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% +} +\newglossarystyle{mcoltreenonamegroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcoltreenonamehypergroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreenonamespannav}{% + \setglossarystyle{treenoname}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcolalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \def\@gls@prevlevel{-1}% + \mbox{}\par + }% + {\par\end{multicols}}% +} +\newglossarystyle{mcolalttreegroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcolalttreehypergroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand*{\glossaryheader}{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcolalttreespannav}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \def\@gls@prevlevel{-1}% + \mbox{}\par + }% + {\par\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-super-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-super-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-super}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{supertabular} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{super}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi +} +\newglossarystyle{superborder}{% + \setglossarystyle{super}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superheader}{% + \setglossarystyle{super}% +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & + \bfseries\descriptionname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superheaderborder}{% + \setglossarystyle{super}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super3col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & \tabularnewline}% + \fi +} +\newglossarystyle{super3colborder}{% + \setglossarystyle{super3col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super3colheader}{% + \setglossarystyle{super3col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{super3colheaderborder}{% + \setglossarystyle{super3colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super4col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{llll}}{% + \end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & & \tabularnewline}% + \fi +} +\newglossarystyle{super4colheader}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{llll}}% + {\end{supertabular}}% +} +\newglossarystyle{super4colborder}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +\newglossarystyle{super4colheaderborder}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4col}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colheader}{% + \setglossarystyle{super4colheader}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colborder}{% + \setglossarystyle{super4colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colheaderborder}{% + \setglossarystyle{super4colheaderborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-superragged-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-superragged-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-superragged}[2020/03/19 v4.46 (NLCT)] +\RequirePackage{array} +\RequirePackage{supertabular} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{superragged}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi +} +\newglossarystyle{superraggedborder}{% + \setglossarystyle{superragged}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superraggedheader}{% + \setglossarystyle{superragged}% +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & \bfseries \descriptionname + \tabularnewline}% + \tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superraggedheaderborder}{% + \setglossarystyle{superragged}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & \tabularnewline}% + \fi +} +\newglossarystyle{superragged3colborder}{% + \setglossarystyle{superragged3col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3colheader}{% + \setglossarystyle{superragged3col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3colheaderborder}{% + \setglossarystyle{superragged3colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & & \tabularnewline}% + \fi +} +\newglossarystyle{altsuperragged4colheader}{% + \setglossarystyle{altsuperragged4col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4colborder}{% + \setglossarystyle{altsuper4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4colheaderborder}{% + \setglossarystyle{altsuperragged4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-tree-2020-03-19.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.46 (glossary-tree-2020-03-19.sty)} +% Version 4.46 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-tree}[2020/03/19 v4.46 (NLCT)] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glstreenamefmt}[1]{\textbf{#1}} +\newcommand*{\glstreegroupheaderfmt}[1]{\glstreenamefmt{#1}} +\newcommand*{\glstreenavigationfmt}[1]{\glstreenamefmt{#1}} +\ifdef\@idxitem +{\newcommand{\glstreeitem}{\@idxitem}} +{\newcommand{\glstreeitem}{\par\hangindent40\p@}} +\ifdef\subitem +{\let\glstreesubitem\subitem} +{\newcommand\glstreesubitem{\glstreeitem\hspace*{20\p@}}} +\ifdef\subsubitem +{\let\glstreesubsubitem\subsubitem} +{\newcommand\glstreesubsubitem{\glstreeitem\hspace*{30\p@}}} +\newcommand{\glstreepredesc}{\space} +\newcommand{\glstreechildpredesc}{\space} +\newglossarystyle{index}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem + \let\subitem\glstreesubitem + \let\subsubitem\glstreesubsubitem + }% + {\par}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glossentry}[2]{% + \item\glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc \glossentrydesc{##1}\glspostdescription\space ##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription\space ##3% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +\newglossarystyle{indexgroup}{% + \setglossarystyle{index}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \indexspace + }% +} +\newglossarystyle{indexhypergroup}{% + \setglossarystyle{index}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{tree}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc\glossentrydesc{##1}\glspostdescription\space##2\par + }% + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription\space ##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +\newglossarystyle{treegroup}{% + \setglossarystyle{tree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par + \indexspace}% +} +\newglossarystyle{treehypergroup}{% + \setglossarystyle{tree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newlength\glstreeindent +\setlength{\glstreeindent}{10pt} +\newglossarystyle{treenoname}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc\glossentrydesc{##1}\glspostdescription\space##2\par + }% + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + \glossentrydesc{##2}\glspostdescription\space##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{treenonamegroup}{% + \setglossarystyle{treenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt + {\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{treenonamehypergroup}{% + \setglossarystyle{treenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newrobustcmd*{\glsfindwidesttoplevelname}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \letcs{\@glswidestname}{glo@\glsdetoklabel{\@glo@label}@name}% + \fi + }% + }% + }% +} +\newcommand*{\glssetwidest}[2][0]{% + \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{% + #2}% +} +\newcommand*{\@glswidestname}{} +\newcommand*{\glstreenamebox}[2]{% + \makebox[#1][l]{#2}% +} +\newglossarystyle{alttree}{% + \renewenvironment{theglossary}% + {\def\@gls@prevlevel{-1}% + \mbox{}\par}% + {\par}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{\glstreenamefmt{\@glswidestname\space}}% + \fi + \hangindent\glstreeindent + \parindent\glstreeindent + \makebox[0pt][r]{\glstreenamebox{\glstreeindent}{% + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}}}% + \ifglshassymbol{##1}{(\glossentrysymbol{##1})\space}{}% + \glossentrydesc{##1}\glspostdescription \space ##2\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\subglossentry}[3]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\glstreenamefmt{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\glstreenamefmt{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \hangindent\glstreeindent + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% + \ifglshassymbol{##2}{(\glossentrysymbol{##2})\space}{}% + \glossentrydesc{##2}\glspostdescription\space ##3\par + \def\@gls@prevlevel{##1}% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{alttreegroup}{% + \setglossarystyle{alttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \par\indexspace}% +} +\newglossarystyle{alttreehypergroup}{% + \setglossarystyle{alttree}% + \renewcommand*{\glossaryheader}{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossaries-2021-11-01.sty)} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\DeclareRelease{v4.46}{2020-03-19}{glossaries-2020-03-19.sty} +\DeclareCurrentRelease{v4.49}{2021-11-01} +\ProvidesPackage{glossaries}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{ifthen} +\RequirePackage{xkeyval}[2006/11/18] +\RequirePackage{mfirstuc} +\RequirePackage{textcase} +\renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase}% +\RequirePackage{xfor} +\RequirePackage{datatool-base} +\RequirePackage{amsgen} +\RequirePackage{etoolbox} +\newif\if@gls@docloaded +\@ifpackageloaded{doc}% +{% + \@gls@docloadedtrue +}% +{% + \@ifclassloaded{nlctdoc}{\@gls@docloadedtrue}{\@gls@docloadedfalse}% +} +\if@gls@docloaded + \let\glsorg@theglossary\theglossary + \let\glsorg@endtheglossary\endtheglossary + \let\glsorg@PrintChanges\PrintChanges + \renewcommand{\PrintChanges}{% + \begingroup + \let\theglossary\glsorg@theglossary + \let\endtheglossary\glsorg@endtheglossary + \glsorg@PrintChanges + \endgroup + } +\fi +\newif\if@gls@debug +\define@choicekey{glossaries.sty}{debug}[\gls@debug@val\gls@debug@nr]% + {true,false,showtargets,showaccsupp}[true]{% + \ifcase\gls@debug@nr\relax + % debug=true + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \let\@glsshowtarget\@gobble + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \or + % debug=false + \@gls@debugfalse + \let\@glsshowtarget\@gobble + \let\@glsshowaccsupp\@gobblethree + \PackageInfo{glossaries}{debug mode OFF}% + \or + % debug=showtargets + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \renewcommand{\@glsshowtarget}{\@@glsshowtarget}% + \or + % debug=showaccsupp + \@gls@debugtrue + \renewcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{##1}% + }% + \renewcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{##1}% + }% + \PackageInfo{glossaries}{debug mode ON (nowarn option disabled)}% + \renewcommand{\@glsshowaccsupp}{\glsshowaccsupp}% + \fi +} +\newcommand*{\glsshowtarget}[1]{% + \ifmmode + \nfss@text{\glsshowtargetfont [#1]}% + \else + \ifinner + {\glsshowtargetfont [#1]}% + \else + \glsshowtargetouter{#1}% + \fi + \fi +} +\newcommand*{\glsshowtargetouter}[1]{% + \glsshowtargetsymbol\marginpar{\glsshowtargetsymbol\glsshowtargetfont #1}} +\newcommand*{\glsshowtargetsymbol}{{\tiny$\triangleright$}} +\newcommand*{\glsshowtargetfont}{\ttfamily\footnotesize} +\newcommand*{\@glsshowtarget}[1]{} +\newrobustcmd*{\@@glsshowtarget}[1]{% + \begingroup + \protected@edef\@gls@tmp{#1}% + \@onelevel@sanitize\@gls@tmp + \expandafter\glsshowtarget\expandafter{\@gls@tmp}% + \endgroup +} +\newcommand*{\@glsshowaccsupp}[3]{} +\newrobustcmd*{\glsshowaccsupp}[3]{% + \ifstrempty{#1}% + {\@@glsshowtarget{/#2 (#3)}}% + {\@@glsshowtarget{/#2 (#3) [#1]}}% +} +\newcommand*{\@gls@see@noindex}{% + \PackageError{glossaries}% + {`\gls@xr@key' key may only be used after \string\makeglossaries\space + or \string\makenoidxglossaries\space (or move + \string\newglossaryentry\space + definitions into the preamble)}% + {You must use \string\makeglossaries\space + or \string\makenoidxglossaries\space before defining + any entries that have a `\gls@xr@key' key. It may + be that the `see' key has been written to the .glsdefs + file from the previous run, in which case you need to + move your definitions + to the preamble if you don't want to use + \string\makeglossaries\space + or \string\makenoidxglossaries}% +} +\define@choicekey{glossaries.sty}{seenoindex}% + [\gls@seenoindex@val\gls@seenoindex@nr]{error,warn,ignore}{% + \ifcase\gls@seenoindex@nr + \renewcommand*{\@gls@see@noindex}{% + \PackageError{glossaries}% + {`\gls@xr@key' key may only be used after \string\makeglossaries\space + or \string\makenoidxglossaries}% + {You must use \string\makeglossaries\space + or \string\makenoidxglossaries\space before defining + any entries that have a `\gls@xr@key' key}% + }% + \or + \renewcommand*{\@gls@see@noindex}{% + \GlossariesWarning{`\gls@xr@key' key ignored}% + }% + \or + \renewcommand*{\@gls@see@noindex}{}% + \fi +} +\define@boolkey{glossaries.sty}[gls]{toc}[true]{} +\define@boolkey{glossaries.sty}[gls]{numberline}[true]{} +\ifcsundef{chapter}% + {\newcommand*{\@@glossarysec}{section}}% + {\newcommand*{\@@glossarysec}{chapter}} +\define@choicekey{glossaries.sty}{section}{part,chapter,section,% +subsection,subsubsection,paragraph,subparagraph}[section]{% + \renewcommand*{\@@glossarysec}{#1}} +\newcommand*{\@@glossarysecstar}{*} +\newcommand*{\@@glossaryseclabel}{} +\newcommand*{\glsautoprefix}{} +\define@choicekey{glossaries.sty}{numberedsection}% + [\gls@numberedsection@val\gls@numberedsection@nr]{% +false,nolabel,autolabel,nameref}[nolabel]{% + \ifcase\gls@numberedsection@nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{% + \label{\glsautoprefix\@glo@type}}% + \or + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{% + \protected@edef\@currentlabelname{\glossarytoctitle}% + \label{\glsautoprefix\@glo@type}}% + \fi +} +\@ifpackageloaded{classicthesis} +{\newcommand*{\@glossary@default@style}{index}} +{\newcommand*{\@glossary@default@style}{list}} +\define@key{glossaries.sty}{style}{% + \def\@glossary@default@style{#1}% +} +\newcommand*{\@gls@declareoption}[2]{% + \DeclareOptionX{#1}{#2}% + \DeclareOption{#1}{#2}% +} +\newcommand*{\glossaryentrynumbers}[1]{#1\gls@save@numberlist{#1}} +\@gls@declareoption{nonumberlist}{% + \renewcommand*{\glossaryentrynumbers}[1]{\gls@save@numberlist{#1}}% +} +\define@boolkey{glossaries.sty}[gls]{savenumberlist}[true]{} +\glssavenumberlistfalse +\newcommand*\@glo@seeautonumberlist{} +\@gls@declareoption{seeautonumberlist}{% + \renewcommand*{\@glo@seeautonumberlist}{% + \def\@glo@prefix{\glsnextpages}% + }% +} +\define@boolkey{glossaries.sty}[gls]{esclocations}[true]{} +\glsesclocationstrue +\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}[=v4.49]} +\@gls@declareoption{nolong}{\renewcommand*{\@gls@loadlong}{}} +\IfFileExists{supertabular.sty}{% + \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}[=v4.49]}}{% + \newcommand*{\@gls@loadsuper}{}} +\@gls@declareoption{nosuper}{\renewcommand*{\@gls@loadsuper}{}} +\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}[=v4.49]} +\@gls@declareoption{nolist}{% + \renewcommand*{\@gls@loadlist}{% + \ifdefstring{\@glossary@default@style}{list}% + {\let\@glossary@default@style\relax}% + {}% + }% +} +\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}[=v4.49]} +\@gls@declareoption{notree}{\renewcommand*{\@gls@loadtree}{}} +\@gls@declareoption{nostyles}{% + \renewcommand*{\@gls@loadlong}{}% + \renewcommand*{\@gls@loadsuper}{}% + \renewcommand*{\@gls@loadlist}{}% + \renewcommand*{\@gls@loadtree}{}% + \let\@glossary@default@style\relax +} +\newcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi +} +\define@boolkey{glossaries.sty}[gls]{nopostdot}[true]{} +\glsnopostdotfalse +\define@boolkey{glossaries.sty}[gls]{nogroupskip}[true]{} +\glsnogroupskipfalse +\define@boolkey{glossaries.sty}[gls]{ucmark}[true]{} +\@ifclassloaded{memoir} +{% + \glsucmarktrue +}% +{% + \glsucmarkfalse +} +\newcommand*{\@gls@define@glossaryentrycounter}{% + \ifglsentrycounter + \ifundef\c@glossaryentry + {% + \ifx\@gls@counterwithin\@empty + \newcounter{glossaryentry}% + \else + \newcounter{glossaryentry}[\@gls@counterwithin]% + \fi + \def\theHglossaryentry{\currentglossary.\theglossaryentry}% + }% + {}% + \fi +} +\define@boolkey{glossaries.sty}[gls]{entrycounter}[true]{} +\glsentrycounterfalse +\define@key{glossaries.sty}{counterwithin}{% + \renewcommand*{\@gls@counterwithin}{#1}% + \glsentrycountertrue + \@gls@define@glossaryentrycounter +} +\newcommand*{\@gls@counterwithin}{} +\newcommand{\@gls@define@glossarysubentrycounter}{% + \ifundef\c@glossarysubentry + {% + \ifglssubentrycounter + \ifglsentrycounter + \newcounter{glossarysubentry}[glossaryentry]% + \else + \newcounter{glossarysubentry}% + \fi + \def\theHglossarysubentry{\currentglossary.\currentglssubentry.\theglossarysubentry}% + \fi + }% + {}% +} +\define@boolkey{glossaries.sty}[gls]{subentrycounter}[true]{} +\glssubentrycounterfalse +\newcommand*{\@glo@default@sorttype}{standard} +\define@choicekey{glossaries.sty}{sort}{standard,def,use,none}{% + \renewcommand*{\@glo@default@sorttype}{#1}% + \csname @gls@setupsort@#1\endcsname +} +\newcommand*{\glsprestandardsort}[3]{% + \glsdosanitizesort +} +\newcommand*{\@glo@check@sortallowed}[1]{} +\newcommand*{\@gls@setupsort@standard}{% + \def\do@glo@storeentry{\@glo@storeentry}% + \def\@gls@defsortcount##1{}% + \def\@gls@defsort##1##2{% + \ifx\@glo@sort\@glsdefaultsort + \let\@glo@sort\@glo@name + \fi + \let\glsdosanitizesort\@gls@sanitizesort + \glsprestandardsort{\@glo@sort}{##1}{##2}% + \expandafter\protected@xdef\csname glo@##2@sort\endcsname{\@glo@sort}% + }% + \def\@gls@setsort##1{}% + \let\@glo@check@sortallowed\@gobble +} +\@gls@setupsort@standard +\newcommand*\glssortnumberfmt[1]{% + \ifnum#1<100000 0\fi + \ifnum#1<10000 0\fi + \ifnum#1<1000 0\fi + \ifnum#1<100 0\fi + \ifnum#1<10 0\fi + \number#1% +} +\newcommand*{\@gls@setupsort@def}{% + \def\do@glo@storeentry{\@glo@storeentry}% + \def\@gls@defsortcount##1{% + \expandafter\global + \expandafter\newcount\csname glossary@##1@sortcount\endcsname + }% + \def\@gls@defsort##1##2{% + \ifcsundef{glossary@##1@sortcount}% + {\@gls@defsortcount{##1}}% + {}% + \expandafter\global\expandafter + \advance\csname glossary@##1@sortcount\endcsname by 1\relax + \expandafter\protected@xdef\csname glo@##2@sort\endcsname{% + \expandafter\glssortnumberfmt + {\csname glossary@##1@sortcount\endcsname}}% + }% + \def\@gls@setsort##1{}% + \let\@glo@check@sortallowed\@gobble +} +\newcommand*{\@gls@setupsort@use}{% + \let\do@glo@storeentry\@gobble + \def\@gls@defsortcount##1{% + \expandafter\global + \expandafter\newcount\csname glossary@##1@sortcount\endcsname + }% + \def\@gls@defsort##1##2{% + \expandafter\gdef\csname glo@##2@sort\endcsname{}% + }% + \def\@gls@setsort##1{% + \protected@edef\@glo@parent{\csname glo@##1@parent\endcsname}% + \ifx\@glo@parent\@empty + \else + \expandafter\@gls@setsort\expandafter{\@glo@parent}% + \fi + \protected@edef\@glo@type{\csname glo@##1@type\endcsname}% + \protected@edef\@gls@tmp{\csname glo@##1@sort\endcsname}% + \ifx\@gls@tmp\@empty + \expandafter\global\expandafter + \advance\csname glossary@\@glo@type @sortcount\endcsname by 1\relax + \expandafter\protected@xdef\csname glo@##1@sort\endcsname{% + \expandafter\glssortnumberfmt + {\csname glossary@\@glo@type @sortcount\endcsname}}% + \@glo@storeentry{##1}% + \fi + }% + \let\@glo@check@sortallowed\@gobble +} +\newcommand*{\@gls@setupsort@none}{% + \def\do@glo@storeentry##1{}% + \def\@gls@defsortcount##1{}% + \def\@gls@defsort##1##2{% + \expandafter\global\expandafter\let\csname glo@##2@sort\endcsname\@glo@sort + }% + \def\@gls@setsort##1{}% + \renewcommand\@glo@check@sortallowed[1]{\PackageError{glossaries} + {Option sort=none not allowed with \string##1}% + {(Use sort=def instead)}}% +} +\newcommand*{\glsdefmain}{% + \if@gls@docloaded + \newglossary[glg2]{main}{gls2}{glo2}{\glossaryname}% + \else + \newglossary{main}{gls}{glo}{\glossaryname}% + \fi + \newcommand*{\gls@tr@set@main@toctitle}{% + \translatelet{\glossarytoctitle}{Glossary}% + }% +} +\newcommand*{\glsdefaulttype}{main} +\newcommand*{\acronymtype}{\glsdefaulttype} +\@gls@declareoption{nomain}{% + \let\glsdefaulttype\relax + \renewcommand*{\glsdefmain}{}% +} +\define@boolkey{glossaries.sty}[gls]{acronym}[true]{% + \ifglsacronym + \renewcommand{\@gls@do@acronymsdef}{% + \DeclareAcronymList{acronym}% + \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% + \renewcommand*{\acronymtype}{acronym}% + \newcommand*{\gls@tr@set@acronym@toctitle}{% + \translatelet{\glossarytoctitle}{Acronyms}% + }% + }% + \else + \let\@gls@do@acronymsdef\relax + \fi +} +\AtBeginDocument{% + \ifglsacronym + \ifbool{glscompatible-3.07}% + {}% + {% + \providecommand*{\printacronyms}[1][]{% + \printglossary[type=\acronymtype,#1]}% + }% + \fi +} +\newcommand*{\@gls@do@acronymsdef}{} +\@gls@declareoption{acronyms}{% + \glsacronymtrue + \def\@gls@do@acronymsdef{% + \DeclareAcronymList{acronym}% + \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% + \renewcommand*{\acronymtype}{acronym}% + \newcommand*{\gls@tr@set@acronym@toctitle}{% + \translatelet{\glossarytoctitle}{Acronyms}% + }% + }% +} +\newcommand*{\@glsacronymlists}{} +\newcommand*{\@addtoacronymlists}[1]{% + \ifx\@glsacronymlists\@empty + \protected@xdef\@glsacronymlists{#1}% + \else + \protected@xdef\@glsacronymlists{\@glsacronymlists,#1}% + \fi +} +\newcommand*{\DeclareAcronymList}[1]{% + \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}% +} +\newcommand{\glsIfListOfAcronyms}[1]{% + \protected@edef\@do@gls@islistofacronyms{% + \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}% + \@do@gls@islistofacronyms +} +\newcommand{\@gls@islistofacronyms}[4]{% + \def\gls@islistofacronyms##1,#1,##2\end@gls@islistofacronyms{% + \def\@gls@before{##1}\def\@gls@after{##2}}% + \gls@islistofacronyms,#2,#1,\@nil\end@gls@islistofacronyms + \ifx\@gls@after\@nnil + #4% + \else + #3% + \fi +} +\newif\if@glsisacronymlist +\newcommand*{\gls@checkisacronymlist}[1]{% + \glsIfListOfAcronyms{#1}% + {\@glsisacronymlisttrue}{\@glsisacronymlistfalse}% +} +\newcommand*{\SetAcronymLists}[1]{% + \renewcommand*{\@glsacronymlists}{#1}% +} +\define@key{glossaries.sty}{acronymlists}{% + \DeclareAcronymList{#1}% +} +\newcommand{\glscounter}{page} +\define@key{glossaries.sty}{counter}{% + \renewcommand*{\glscounter}{#1}% +} +\newcommand*{\@gls@nohyperlist}{} +\newcommand*{\GlsDeclareNoHyperList}[1]{% + \ifdefempty\@gls@nohyperlist + {% + \renewcommand*{\@gls@nohyperlist}{#1}% + }% + {% + \appto\@gls@nohyperlist{,#1}% + }% +} +\define@key{glossaries.sty}{nohypertypes}{% + \GlsDeclareNoHyperList{#1}% +} +\newcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{#1}% +} +\newcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{#1}% +} +\newcommand{\glosortentrieswarning}{% + \typeout{Using TeX to sort glossary entries---this may + take a while}% +} +\@gls@declareoption{nowarn}{% + \if@gls@debug + \GlossariesWarning{Warnings can't be suppressed in debug mode}% + \else + \renewcommand*{\GlossariesWarning}[1]{}% + \renewcommand*{\GlossariesWarningNoLine}[1]{}% + \renewcommand*{\glosortentrieswarning}{}% + \renewcommand*{\@gls@missinglang@warn}[2]{}% + \fi +} +\newcommand*{\@gls@missinglang@warn}[2]{% + \PackageWarningNoLine{glossaries}% + {No language module detected for `#1'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-#2' or similar}% +} +\@gls@declareoption{nolangwarn}{% + \renewcommand*{\@gls@missinglang@warn}[2]{}% +} +\newcommand*{\@gls@warnonglossdefined}{% + \GlossariesWarning{Overriding \string\printglossary}% +} +\newcommand*{\@gls@warnontheglossdefined}{% + \GlossariesWarning{Overriding `theglossary' environment}% +} +\@gls@declareoption{noredefwarn}{% + \renewcommand*{\@gls@warnonglossdefined}{}% + \renewcommand*{\@gls@warnontheglossdefined}{}% +} +\newcommand*{\@gls@sanitizedesc}{% +} +\newcommand*{\glssetexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@expand@field{##1}{#1}{##2}% + }% +} +\newcommand*{\glssetnoexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@noexpand@field{##1}{#1}{##2}% + }% +} +\glssetexpandfield{type} +\glssetnoexpandfield{desc} +\glssetnoexpandfield{descplural} +\newcommand*{\@gls@sanitizename}{} +\glssetnoexpandfield{name} +\newcommand*{\@gls@sanitizesymbol}{} +\glssetnoexpandfield{symbol} +\glssetnoexpandfield{symbolplural} +\newcommand*{\@gls@sanitizesort}{% + \ifglssanitizesort + \@@gls@sanitizesort + \else + \@@gls@nosanitizesort + \fi +} +\newcommand*\@@gls@sanitizesort{% + \@onelevel@sanitize\@glo@sort +} +\newcommand*{\@@gls@nosanitizesort}{} +\newcommand*\@gls@noidx@sanitizesort{% + \ifdefvoid\@glo@sort + {}% + {% + \expandafter\@@gls@noidx@sanitizesort\@glo@sort\gls@end@sanitizesort + }% +} +\def\@@gls@noidx@sanitizesort#1#2\gls@end@sanitizesort{% + \def\@glo@sort{#1#2}% + \@onelevel@sanitize\@glo@sort +} +\newcommand*{\@@gls@noidx@nosanitizesort}{% + \ifdefvoid\@glo@sort + {}% + {% + \expandafter\@@gls@noidx@no@sanitizesort\@glo@sort\gls@end@sanitizesort + }% +} +\def\@@gls@noidx@no@sanitizesort#1#2\gls@end@sanitizesort{% + \bgroup + \glsnoidxstripaccents + \protected@xdef\@@glo@sort{#1#2}% + \egroup + \let\@glo@sort\@@glo@sort +} +\newcommand*\glsnoidxstripaccents{% + \let\IeC\@firstofone + \let\add@accent@\@secondoftwo + \let\@text@composite@x\@secondoftwo + \let\@tabacckludge\@secondoftwo + \expandafter\def\csname \encodingdefault-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname OT1-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname T1-cmd\endcsname##1##2##3{##3}% + \expandafter\def\csname PD1-cmd\endcsname##1##2##3{##3}% + \let\'\@firstofone + \let\`\@firstofone + \let\^\@firstofone + \let\"\@firstofone + \let\u\@firstofone + \let\t\@firstofone + \let\d\@firstofone + \let\r\@firstofone + \let\=\@firstofone + \let\.\@firstofone + \let\~\@firstofone + \let\v\@firstofone + \let\H\@firstofone + \let\c\@firstofone + \let\b\@firstofone + \let\a\@secondoftwo + \def\AE{AE}% + \def\ae{ae}% + \def\OE{OE}% + \def\oe{oe}% + \def\AA{AA}% + \def\aa{aa}% + \def\L{L}% + \def\l{l}% + \def\O{O}% + \def\o{o}% + \def\SS{SS}% + \def\ss{ss}% + \def\th{th}% + \def\TH{TH}% + \def\dh{dh}% + \def\DH{DH}% +} +\@ifl@t@r\fmtversion{2019/10/01} +{% + \appto\glsnoidxstripaccents{\let\UTFviii@two@octets\UTFviii@two@octets@combine}% +} +{} +\define@boolkey[gls]{sanitize}{description}[true]{% + \GlossariesWarning{sanitize={description} package option deprecated}% + \ifgls@sanitize@description + \glssetnoexpandfield{desc}% + \glssetnoexpandfield{descplural}% + \else + \glssetexpandfield{desc}% + \glssetexpandfield{descplural}% + \fi +} +\define@boolkey[gls]{sanitize}{name}[true]{% + \GlossariesWarning{sanitize={name} package option deprecated}% + \ifgls@sanitize@name + \glssetnoexpandfield{name}% + \else + \glssetexpandfield{name}% + \fi +} +\define@boolkey[gls]{sanitize}{symbol}[true]{% + \GlossariesWarning{sanitize={symbol} package option deprecated}% + \ifgls@sanitize@symbol + \glssetnoexpandfield{symbol}% + \glssetnoexpandfield{symbolplural}% + \else + \glssetexpandfield{symbol}% + \glssetexpandfield{symbolplural}% + \fi +} +\define@boolkey{glossaries.sty}[gls]{sanitizesort}[true]{% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \renewcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesorttrue + \glssetnoexpandfield{sortvalue}% + }% + \else + \glssetexpandfield{sortvalue}% + \renewcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesortfalse + \glssetexpandfield{sortvalue}% + }% + \fi +} +\glssanitizesorttrue +\glssetnoexpandfield{sortvalue}% +\newcommand*{\@gls@noidx@setsanitizesort}{% + \glssanitizesortfalse + \glssetexpandfield{sortvalue}% +} +\define@choicekey[gls]{sanitize}{sort}{true,false}[true]{% + \setbool{glssanitizesort}{#1}% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \else + \glssetexpandfield{sortvalue}% + \fi + \GlossariesWarning{sanitize={sort} package option + deprecated. Use sanitizesort instead}% +} +\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,name=true]{% + \ifthenelse{\equal{#1}{none}}% + {% + \GlossariesWarning{sanitize package option deprecated}% + \glssetexpandfield{name}% + \glssetexpandfield{symbol}% + \glssetexpandfield{symbolplural}% + \glssetexpandfield{desc}% + \glssetexpandfield{descplural}% + }% + {% + \setkeys[gls]{sanitize}{#1}% + }% +} +\newif\ifglstranslate +\newcommand*\@gls@usetranslator{% + \@ifpackageloaded{polyglossia}% + {% + \let\glsifusetranslator\@secondoftwo + }% + {% + \@ifpackageloaded{babel}% + {% + \IfFileExists{translator.sty}% + {% + \RequirePackage{translator}% + \let\glsifusetranslator\@firstoftwo + }% + {}% + }% + {}% + }% +} +\newcommand{\glsifusedtranslatordict}[3]{% + \glsifusetranslator + {\ifcsdef{ver@glossaries-dictionary-#1.dict}{#2}{#3}}% + {#3}% +} +\@gls@declareoption{notranslate}{% + \glstranslatefalse + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo +} +\define@choicekey{glossaries.sty}{translate}% + [\gls@translate@val\gls@translate@nr]% + {true,false,babel}[true]% + {% + \ifcase\gls@translate@nr\relax + \glstranslatetrue + \renewcommand*\@gls@usetranslator{% + \@ifpackageloaded{polyglossia}% + {% + \let\glsifusetranslator\@secondoftwo + }% + {% + \@ifpackageloaded{babel}% + {% + \IfFileExists{translator.sty}% + {% + \RequirePackage{translator}% + \let\glsifusetranslator\@firstoftwo + }% + {}% + }% + {}% + }% + }% + \or + \glstranslatefalse + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo + \or + \glstranslatetrue + \let\@gls@usetranslator\relax + \let\glsifusetranslator\@secondoftwo + \fi + } +\glstranslatefalse +\let\glsifusetranslator\@secondoftwo +\@ifpackageloaded{translator}% +{% + \glstranslatetrue + \let\glsifusetranslator\@firstoftwo +}% +{% + \@for\gls@thissty:=tracklang,babel,ngerman,polyglossia\do + { + \@ifpackageloaded{\gls@thissty}% + {% + \glstranslatetrue + \@endfortrue + }% + {}% + } +} +\define@boolkey{glossaries.sty}[gls]{indexonlyfirst}[true]{} +\glsindexonlyfirstfalse +\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{} +\glshyperfirsttrue +\newcommand*{\@gls@setacrstyle}{} +\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% + \ifbool{glsacrdescription}% + {}% + {% + \renewcommand*{\@gls@sanitizedesc}{}% + }% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{description}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% +} +\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{} +\newcommand*{\glsorder}{word} +\newcommand*{\@glsorder}[1]{} +\define@choicekey{glossaries.sty}{order}{word,letter}{% + \def\glsorder{#1}} +\newif\ifglsxindy +\glsxindyfalse +\@gls@declareoption{makeindex}{\glsxindyfalse} +\define@boolkey[gls]{xindy}{glsnumbers}[true]{} +\gls@xindy@glsnumberstrue +\def\@xdy@main@language{\languagename}% +\define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}} +\ifcsundef{inputencodingname}{% + \def\gls@codepage{}}{% + \def\gls@codepage{\inputencodingname} +} +\define@key[gls]{xindy}{codepage}{\def\gls@codepage{#1}} +\define@key{glossaries.sty}{xindy}[]{% + \glsxindytrue + \setkeys[gls]{xindy}{#1}% +} +\@gls@declareoption{xindygloss}{% + \glsxindytrue +} +\@gls@declareoption{xindynoglsnumbers}{% + \glsxindytrue + \gls@xindy@glsnumbersfalse +} +\providecommand{\@domakeglossaries}[1]{#1} +\@gls@declareoption{disablemakegloss}{% + \ifdefequal\makeglossaries\@no@makeglossaries + {% + \GlossariesWarning{Option `disablemakegloss' has no effect + (\string\makenoidxglossaries\space has already been used)}% + }% + {% + \ifdefequal\@makeglossary\@gobble + {% + \GlossariesWarning{Option `disablemakegloss' has no effect + (\string\makeglossaries\space has already been used)}% + }% + {% + \renewcommand{\@domakeglossaries}[1]{% + \PackageInfo{glossaries}{\string\makeglossaries\space and + \string\makenoidxglossaries\space have been disabled}% + }% + }% + }% +} +\@gls@declareoption{restoremakegloss}{% + \ifdefequal\makeglossaries\@no@makeglossaries + {% + \GlossariesWarning{Option `restoremakegloss' has no effect + (\string\makenoidxglossaries\space has already been used)}% + }% + {% + \ifdefequal\@makeglossary\@gobble + {% + \GlossariesWarning{Option `restoremakegloss' has no effect + (\string\makeglossaries\space has already been used)}% + }% + {% + \PackageInfo{glossaries}{\string\makeglossaries\space and + \string\makenoidxglossaries\space have been restored}% + \let\@domakeglossaries\@firstofone + }% + }% +} +\newcommand*{\@do@write@glslabels}{% + \AtEndDocument{\@@do@write@glslabels}% + \let\@do@write@glslabels\relax +} +\newcommand*{\@@do@write@glslabels}{% + \newwrite\@gls@labelsfile + \immediate\openout\@gls@labelsfile=\jobname.glslabels + \protected@edef\@gls@fulllist{\@glo@types}% + \ifdefempty{\@ignored@glossaries}{}% + {\protected@eappto\@gls@fulllist{,\@ignored@glossaries}}% + \forallglsentries[\@gls@fulllist]{\@glsentry}% + {% + \ifdefempty{\@glsentry}{}% + {% + \ifx\do@write@glslabelsname\@gobble + \def\@gls@thisentryname{}% + \else + \letcs{\@gls@thisentryname}{glo@\glsdetoklabel{\@glsentry}@name}% + \@onelevel@sanitize\@gls@thisentryname + \fi + \immediate\write\@gls@labelsfile + {\@glsentry\do@write@glslabelsname{\@gls@thisentryname}}% + }% + }% + \immediate\closeout\@gls@labelsfile +} +\newcommand*{\do@write@glslabelsname}[1]{} +\begingroup +\catcode`\^^I12 +\gdef\@write@glslabelsname#1{^^I#1} +\endgroup +\@gls@declareoption{writeglslabels}{\@do@write@glslabels + \let\do@write@glslabelsname\@gobble} +\@gls@declareoption{writeglslabelnames}{\@do@write@glslabels + \let\do@write@glslabelsname\@write@glslabelsname} +\newif\ifglsautomake +\newcommand{\gls@automake@nr}{1} +\define@choicekey{glossaries.sty}{automake}% + [\gls@automake@val\gls@automake@nr]{true,false,immediate}[true]{% + \ifnum\gls@automake@nr=1\relax + \glsautomakefalse + \else + \glsautomaketrue + \fi + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \PackageError{glossaries}{You must use + \string\makeglossaries\space with automake=true} + {% + Either remove the automake=true setting or + add \string\makeglossaries\space to your document preamble.% + }% + }% + \else + \renewcommand*{\@gls@doautomake}{}% + \fi +} +\glsautomakefalse +\newcommand*{\@gls@doautomake}{} +\AtEndDocument{\@gls@doautomake} +\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{% + \ifglssavewrites + \renewcommand*{\glswritefiles}{\@glswritefiles}% + \else + \let\glswritefiles\@empty + \fi +} +\glssavewritesfalse +\let\glswritefiles\@empty +\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{} +\boolfalse{glscompatible-3.07} +\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{% + \ifbool{glscompatible-2.07}% + {% + \booltrue{glscompatible-3.07}% + }% + {}% +} +\boolfalse{glscompatible-2.07} +\let\gls@original@makeglossary\makeglossary +\let\gls@original@glossary\glossary +\def\makeglossary{% + \GlossariesWarning{Use of \string\makeglossary\space with + glossaries.sty is \MessageBreak deprecated. Use \string\makeglossaries\space + instead. If you \MessageBreak need the original definition of + \string\makeglossary\space use \MessageBreak the package options + kernelglossredefs=false (to \MessageBreak restore the former definition of + \string\makeglossary) and \MessageBreak nomain (if the file extensions cause a + conflict)}% + \makeglossaries +} +\newcommand*{\@gls@override@glossary}[1][main]{% + \GlossariesWarning{Use of \string\glossary\space with + glossaries.sty is deprecated. \MessageBreak Indexing should be performed + with the user level \MessageBreak commands, such as \string\gls\space or + \string\glsadd. If you need the \MessageBreak original definition of + \string\glossary\space use the package \MessageBreak options + kernelglossredefs=false (to restore the \MessageBreak former definition of + \string\glossary) and nomain (if the \MessageBreak file extensions cause a + conflict)}% + \gls@glossary{#1}% +} +\if@gls@docloaded +\else + \def\glossary{\@gls@override@glossary} +\fi +\define@choicekey{glossaries.sty}{kernelglossredefs}% + [\gls@debug@val\gls@debug@nr]{true,false,nowarn}[true]% +{% + \ifcase\gls@debug@nr\relax + \def\glossary{\@gls@override@glossary}% + \def\makeglossary{% + \GlossariesWarning{Use of \string\makeglossary\space with + glossaries.sty is deprecated. Use \string\makeglossaries\space + instead. If you need the original definition of + \string\makeglossary\space use the package options + kernelglossredefs=false (to prevent redefinition of + \string\makeglossary) and nomain (if the file extensions cause a + conflict)}% + \makeglossaries + }% + \or + \let\glossary\gls@original@glossary + \let\makeglossary\gls@original@makeglossary + \or + \def\makeglossary{\makeglossaries}% + \renewcommand*{\@gls@override@glossary}[1][main]{% + \gls@glossary{##1}% + }% + \fi +} +\@gls@declareoption{symbols}{% + \let\@gls@do@symbolsdef\@gls@symbolsdef +} +\newcommand*{\@gls@do@symbolsdef}{} +\newcommand*{\@gls@symbolsdef}{% + \newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}% + \newcommand*{\printsymbols}[1][]{\printglossary[type=symbols,##1]}% + \newcommand*{\gls@tr@set@symbols@toctitle}{% + \translatelet{\glossarytoctitle}{Symbols (glossaries)}% + }% +}% +\@gls@declareoption{numbers}{% + \let\@gls@do@numbersdef\@gls@numbersdef +} +\newcommand*{\@gls@do@numbersdef}{} +\newcommand*{\@gls@numbersdef}{% + \newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}% + \newcommand*{\printnumbers}[1][]{\printglossary[type=numbers,##1]}% + \newcommand*{\gls@tr@set@numbers@toctitle}{% + \translatelet{\glossarytoctitle}{Numbers (glossaries)}% + }% +}% +\@gls@declareoption{index}{% + \ifx\@gls@do@indexdef\@empty + \let\@gls@do@indexdef\@gls@indexdef + \fi +} +\@gls@declareoption{noglossaryindex}{% + \let\@gls@do@indexdef\relax +} +\newcommand*{\@gls@do@indexdef}{} +\newcommand*{\@gls@indexdef}{% + \newglossary[ilg]{index}{ind}{idx}{\indexname}% + \newcommand*{\printindex}[1][]{\printglossary[type=index,##1]}% + \newcommand*{\newterm}[2][]{% + \newglossaryentry{##2}% + {type={index},name={##2},description={\nopostdesc},##1}} + \let\@gls@do@indexdef\relax +}% +\@for\CurrentOption :=\@declaredoptions\do{% + \ifx\CurrentOption\@empty + \else + \@expandtwoargs + \in@ {,\CurrentOption ,}{,\@classoptionslist,\@curroptions,}% + \ifin@ + \@use@ption + \expandafter \let\csname ds@\CurrentOption\endcsname\@empty + \fi + \fi +} +\ProcessOptionsX +\RequirePackage{glossaries-compatible-307}[=v4.49] +\disable@keys{glossaries.sty}{compatible-2.07,% + xindy,xindygloss,xindynoglsnumbers,makeindex,% + acronym,translate,notranslate,nolong,nosuper,notree,nostyles,% + nomain,noglossaryindex} +\newcommand*{\setupglossaries}[1]{% + \renewcommand*{\@gls@setacrstyle}{}% + \ifglsacrshortcuts + \def\@gls@setupshortcuts{\glsacrshortcutstrue}% + \else + \def\@gls@setupshortcuts{% + \ifglsacrshortcuts + \DefineAcronymSynonyms + \fi + }% + \fi + \glsacrshortcutsfalse + \let\@gls@do@numbersdef\relax + \let\@gls@do@symbolssdef\relax + \let\@gls@do@indexdef\relax + \let\@gls@do@acronymsdef\relax + \ifglsentrycounter + \let\@gls@doentrycounterdef\relax + \else + \let\@gls@doentrycounterdef\@gls@define@glossaryentrycounter + \fi + \ifglssubentrycounter + \let\@gls@dosubentrycounterdef\relax + \else + \let\@gls@dosubentrycounterdef\@gls@define@glossarysubentrycounter + \fi + \setkeys{glossaries.sty}{#1}% + \@gls@setacrstyle + \@gls@setupshortcuts + \@gls@do@acronymsdef + \@gls@do@numbersdef + \@gls@do@symbolssdef + \@gls@do@indexdef + \@gls@doentrycounterdef + \@gls@dosubentrycounterdef +} +\ifthenelse{\equal{\glscounter}{section}}% +{% + \ifcsundef{chapter}{}% + {% + \let\@gls@old@chapter\@chapter + \def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}% + \ifcsundef{hyperdef}{}{\hyperdef{section}{\thesection}{}}}% + }% +}% +{} +\newcommand*{\@gls@onlypremakeg}{} +\newcommand*{\@onlypremakeg}[1]{% + \ifx\@gls@onlypremakeg\@empty + \def\@gls@onlypremakeg{#1}% + \else + \expandafter\toks@\expandafter{\@gls@onlypremakeg}% + \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}% + \fi +} +\newcommand*{\@disable@onlypremakeg}{% +\@for\@thiscs:=\@gls@onlypremakeg\do{% + \expandafter\@disable@premakecs\@thiscs% +}} +\newcommand*{\@disable@premakecs}[1]{% + \def#1{\PackageError{glossaries}{\string#1\space may only be + used before \string\makeglossaries}{You can't use + \string#1\space after \string\makeglossaries}}% +} +\providecommand*{\glossaryname}{Glossary} +\providecommand*{\acronymname}{Acronyms} +\newcommand*{\glssettoctitle}[1]{% + \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}} +\providecommand*{\entryname}{Notation} +\providecommand*{\descriptionname}{Description} +\providecommand*{\symbolname}{Symbol} +\providecommand*{\pagelistname}{Page List} +\providecommand*{\glssymbolsgroupname}{Symbols} +\providecommand*{\glsnumbersgroupname}{Numbers} +\newcommand*{\glspluralsuffix}{s} +\newcommand*{\glsacrpluralsuffix}{\glspluralsuffix} +\newcommand*{\glsupacrpluralsuffix}{\glstextup{\glsacrpluralsuffix}} +\providecommand*{\seename}{see} +\providecommand*{\andname}{\&} +\newcommand*{\RequireGlossariesLang}[1]{% + \@ifundefined{ver@glossaries-#1.ldf}{\input{glossaries-#1.ldf}}{}% +} +\newcommand*{\ProvidesGlossariesLang}[1]{% + \ProvidesFile{glossaries-#1.ldf}% +} +\newcommand*{\addglossarytocaptions}[1]{} +\ifglstranslate + \RequirePackage{tracklang} + \@gls@usetranslator + \@ifpackageloaded{translator} + {% + \ifboolexpr + { + test {\ifdefstring{\trans@languages}{English}} + and not + test {\ifdefstring{bbl@loaded}{english}} + } + {% + \let\glsifusetranslator\@secondoftwo + }% + {% + \usedictionary{glossaries-dictionary}% + \renewcommand*{\addglossarytocaptions}[1]{% + \ifcsundef{captions#1}{}% + {% + \expandafter\let\expandafter\@gls@tmp\csname captions#1\endcsname + \expandafter\toks@\expandafter{\@gls@tmp + \renewcommand*{\glossaryname}{\translate{Glossary}}% + }% + \expandafter\edef\csname captions#1\endcsname{\the\toks@}% + }% + }% + }% + }% + {}% + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \@gls@missinglang@warn\this@dialect\CurrentTrackedLanguage + }% + }% + }% + {}% + \glsifusetranslator + {% + \renewcommand*{\glssettoctitle}[1]{% + \ifcsdef{gls@tr@set@#1@toctitle}% + {% + \csuse{gls@tr@set@#1@toctitle}% + }% + {% + \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}% + }% + }% + \renewcommand*{\glossaryname}{\translate{Glossary}}% + \renewcommand*{\acronymname}{\translate{Acronyms}}% + \renewcommand*{\entryname}{\translate{Notation (glossaries)}}% + \renewcommand*{\descriptionname}{% + \translate{Description (glossaries)}}% + \renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}% + \renewcommand*{\pagelistname}{% + \translate{Page List (glossaries)}}% + \renewcommand*{\glssymbolsgroupname}{% + \translate{Symbols (glossaries)}}% + \renewcommand*{\glsnumbersgroupname}{% + \translate{Numbers (glossaries)}}% + }{}% +\fi +\DeclareRobustCommand*{\nopostdesc}{} +\newcommand*{\@nopostdesc}{% + \let\org@glspostdescription\glspostdescription + \def\glspostdescription{% + \let\glspostdescription\org@glspostdescription}% +} +\newcommand*{\@no@post@desc}{\nopostdesc} +\newcommand{\glspar}{\par} +\newcommand{\setStyleFile}[1]{% + \renewcommand*{\gls@istfilebase}{#1}% + \ifglsxindy + \def\istfilename{\gls@istfilebase.xdy} + \else + \def\istfilename{\gls@istfilebase.ist} + \fi +} +\@onlypremakeg\setStyleFile +\ifglsxindy + \def\istfilename{\gls@istfilebase.xdy} +\else + \def\istfilename{\gls@istfilebase.ist} +\fi +\newcommand*{\gls@istfilebase}{\jobname} +\newcommand*{\@istfilename}[1]{} +\newcommand*{\glscompositor}{.} +\newcommand*{\glsSetCompositor}[1]{% + \renewcommand*{\glscompositor}{#1}} +\@onlypremakeg\glsSetCompositor +\newcommand*{\@glsAlphacompositor}{\glscompositor} +\ifglsxindy + \newcommand*\glsSetAlphaCompositor[1]{% + \renewcommand*\@glsAlphacompositor{#1}} +\else + \newcommand*\glsSetAlphaCompositor[1]{% + \glsnoxindywarning\glsSetAlphaCompositor} +\fi +\@onlypremakeg\glsSetAlphaCompositor +\newcommand*{\gls@suffixF}{} +\newcommand*{\glsSetSuffixF}[1]{% + \renewcommand*{\gls@suffixF}{#1}} +\@onlypremakeg\glsSetSuffixF +\newcommand*{\gls@suffixFF}{} +\newcommand*{\glsSetSuffixFF}[1]{% + \renewcommand*{\gls@suffixFF}{#1}% +} +\ifcsundef{hyperlink}% +{% + \newcommand*{\glsnumberformat}[1]{#1}% +}% +{% + \newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}% +} +\newcommand{\delimN}{, } +\newcommand{\delimR}{--} +\newcommand*{\glossarypreamble}{% + \csuse{@glossarypreamble@\currentglossary}% +} +\newcommand{\setglossarypreamble}[2][\glsdefaulttype]{% + \ifglossaryexists*{#1}% + {\csgdef{@glossarypreamble@#1}{#2}}% + {\GlossariesWarning{Glossary `#1' is not defined}}% +} +\newcommand*{\glossarypostamble}{} +\newcommand*{\glossarysection}[2][\@gls@title]{% + \def\@gls@title{#2}% + \ifcsundef{phantomsection}% + {% + \@glossarysection{#1}{#2}% + }% + {% + \@p@glossarysection{#1}{#2}% + }% + \glsglossarymark{\glossarytoctitle}% +} +\ifcsundef{glossarymark}% +{% + \newcommand{\glsglossarymark}[1]{\glossarymark{#1}} +}% +{% + \@ifclassloaded{memoir} + {% + \newcommand{\glsglossarymark}[1]{% + \ifglsucmark + \markboth{\memUChead{#1}}{\memUChead{#1}}% + \else + \markboth{#1}{#1}% + \fi + } + }% + {% + \newcommand{\glsglossarymark}[1]{% + \ifglsucmark + \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \else + \@mkboth{#1}{#1}% + \fi + } + } +} +\providecommand{\glossarymark}[1]{% + \ifglsucmark + \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \else + \@mkboth{#1}{#1}% + \fi +} +\newcommand*{\setglossarysection}[1]{% +\setkeys{glossaries.sty}{section=#1}} +\newcommand*{\@glossarysection}[2]{% + \ifdefempty\@@glossarysecstar + {% + \csname\@@glossarysec\endcsname[#1]{#2}% + }% + {% + \csname\@@glossarysec\endcsname*{#2}% + \@gls@toc{#1}{\@@glossarysec}% + }% + \@@glossaryseclabel +} +\newcommand*{\@p@glossarysection}[2]{% + \glsclearpage + \phantomsection + \ifdefempty\@@glossarysecstar + {% + \csname\@@glossarysec\endcsname{#2}% + }% + {% + \@gls@toc{#1}{\@@glossarysec}% + \csname\@@glossarysec\endcsname*{#2}% + }% + \@@glossaryseclabel +} +\newcommand*{\gls@doclearpage}{% + \ifthenelse{\equal{\@@glossarysec}{chapter}}% + {% + \ifcsundef{cleardoublepage}% + {% + \clearpage + }% + {% + \ifcsdef{if@openright}% + {% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + }% + {% + \cleardoublepage + }% + }% + }% + {}% +} +\newcommand*{\glsclearpage}{\gls@doclearpage} +\newcommand*{\@gls@toc}[2]{% + \ifglstoc + \ifglsnumberline + \addcontentsline{toc}{#2}{\protect\numberline{}#1}% + \else + \addcontentsline{toc}{#2}{#1}% + \fi + \fi +} +\newcommand*{\glsnoxindywarning}[1]{% + \GlossariesWarning{Not in xindy mode --- ignoring \string#1}% +} +\newcommand*{\glsnomakeindexwarning}[1]{% + \GlossariesWarning{Not in makeindex mode --- ignoring \string#1}% +} +\ifglsxindy + \edef\@xdyattributes{\string"default\string"}% +\fi +\ifglsxindy + \edef\@xdyattributelist{}% +\fi +\ifglsxindy + \def\@xdylocref{} +\fi +\newcommand*{\@gls@ifinlist}[4]{% + \def\@do@ifinlist##1,#1,##2\end@doifinlist{% + \def\@gls@listsuffix{##2}% + \ifx\@gls@listsuffix\@empty + #4% + \else + #3% + \fi + }% + \@do@ifinlist,#2,#1,\end@doifinlist +} +\ifglsxindy + \newcommand*{\@xdycounters}{\glscounter} + \newcommand*\GlsAddXdyCounters[1]{% + \@for\@gls@ctr:=#1\do{% + \edef\@do@addcounter{% + \noexpand\@gls@ifinlist{\@gls@ctr}{\@xdycounters}{}% + {% + \noexpand\edef\noexpand\@xdycounters{\@xdycounters,% + \noexpand\@gls@ctr}% + }% + }% + \@do@addcounter + } + } + \@onlypremakeg\GlsAddXdyCounters +\else + \newcommand*\GlsAddXdyCounters[1]{% + \glsnoxindywarning\GlsAddXdyAttribute + } +\fi +\newcommand*\@disabled@glsaddxdycounters{% + \PackageError{glossaries}{\string\GlsAddXdyCounters\space + can't be used after \string\GlsAddXdyAttribute}{Move all + occurrences of \string\GlsAddXdyCounters\space before the first + instance of \string\GlsAddXdyAttribute}% +} +\ifglsxindy + \newcommand*\@glsaddxdyattribute[2]{% + \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string" ^^J + \string"#2#1\string"}% + \expandafter\toks@\expandafter{\@xdylocref}% + \edef\@xdylocref{\the\toks@ ^^J% + (markup-locref + :open \string"\glstildechar n% + \expandafter\string\csname glsX#2X#1\endcsname + \string" ^^J + :close \string"\string" ^^J + :attr \string"#2#1\string")}% + \expandafter\gdef\csname glsX#2X#1\endcsname##1##2{% + \setentrycounter[##1]{#2}\csname #1\endcsname{##2}% + }% + } + \newcommand*\GlsAddXdyAttribute[1]{% + \ifx\@xdyattributelist\@empty + \edef\@xdyattributelist{#1}% + \else + \edef\@xdyattributelist{\@xdyattributelist,#1}% + \fi + \@for\@this@counter:=\@xdycounters\do{% + \protected@edef\gls@do@addxdyattribute{% + \noexpand\@glsaddxdyattribute{#1}{\@this@counter}% + } + \gls@do@addxdyattribute + }% + \let\GlsAddXdyCounters\@disabled@glsaddxdycounters + } + \@onlypremakeg\GlsAddXdyAttribute +\else + \newcommand*\GlsAddXdyAttribute[1]{% + \glsnoxindywarning\GlsAddXdyAttribute} +\fi +\ifglsxindy +\newcommand*{\@gls@addpredefinedattributes}{% + \GlsAddXdyAttribute{glsnumberformat} + \GlsAddXdyAttribute{textrm} + \GlsAddXdyAttribute{textsf} + \GlsAddXdyAttribute{texttt} + \GlsAddXdyAttribute{textbf} + \GlsAddXdyAttribute{textmd} + \GlsAddXdyAttribute{textit} + \GlsAddXdyAttribute{textup} + \GlsAddXdyAttribute{textsl} + \GlsAddXdyAttribute{textsc} + \GlsAddXdyAttribute{emph} + \GlsAddXdyAttribute{glshypernumber} + \GlsAddXdyAttribute{hyperrm} + \GlsAddXdyAttribute{hypersf} + \GlsAddXdyAttribute{hypertt} + \GlsAddXdyAttribute{hyperbf} + \GlsAddXdyAttribute{hypermd} + \GlsAddXdyAttribute{hyperit} + \GlsAddXdyAttribute{hyperup} + \GlsAddXdyAttribute{hypersl} + \GlsAddXdyAttribute{hypersc} + \GlsAddXdyAttribute{hyperemph} + \GlsAddXdyAttribute{glsignore} +} +\else + \let\@gls@addpredefinedattributes\relax +\fi +\def\@xdyuseralphabets{} +\ifglsxindy + \newcommand*{\GlsAddXdyAlphabet}[2]{% + \edef\@xdyuseralphabets{% + \@xdyuseralphabets ^^J + (define-alphabet "#1" (#2))}} +\else + \newcommand*{\GlsAddXdyAlphabet}[2]{% + \glsnoxindywarning\GlsAddXdyAlphabet} +\fi +\ifglsxindy + \newcommand*{\@gls@xdy@locationlist}{% + roman-page-numbers,% + Roman-page-numbers,% + arabic-page-numbers,% + alpha-page-numbers,% + Alpha-page-numbers,% + Appendix-page-numbers,% + arabic-section-numbers% + } + \protected@edef\@gls@roman{\@roman{0\string" + \string"roman-numbers-lowercase\string" :sep \string"}}% + \@onelevel@sanitize\@gls@roman + \edef\@gls@tmp{\string" \string"roman-numbers-lowercase\string" + :sep \string"}% + \@onelevel@sanitize\@gls@tmp + \ifx\@gls@tmp\@gls@roman + \expandafter + \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{% + \string"roman-numbers-lowercase\string"% + }% + \else + \expandafter + \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{ + :sep \string"\@gls@roman\string"% + }% + \fi + \expandafter\def\csname @gls@xdy@Lclass@Roman-page-numbers\endcsname{% + \string"roman-numbers-uppercase\string"% + }% + \expandafter\def\csname @gls@xdy@Lclass@arabic-page-numbers\endcsname{% + \string"arabic-numbers\string"% + }% + \expandafter\def\csname @gls@xdy@Lclass@alpha-page-numbers\endcsname{% + \string"alpha\string"% + }% + \expandafter\def\csname @gls@xdy@Lclass@Alpha-page-numbers\endcsname{% + \string"ALPHA\string"% + }% + \expandafter\def\csname @gls@xdy@Lclass@Appendix-page-numbers\endcsname{% + \string"ALPHA\string" + :sep \string"\@glsAlphacompositor\string" + \string"arabic-numbers\string"% + } + \expandafter\def\csname @gls@xdy@Lclass@arabic-section-numbers\endcsname{% + \string"arabic-numbers\string" + :sep \string"\glscompositor\string" + \string"arabic-numbers\string"% + }% + \def\@xdyuserlocationdefs{} + \def\@xdyuserlocationnames{} +\fi +\ifglsxindy + \newcommand\@xdycrossrefhook{} +\fi +\ifglsxindy + \newcommand*{\GlsAddXdyLocation}[3][]{% + \def\@gls@tmp{#1}% + \ifx\@gls@tmp\@empty + \edef\@xdyuserlocationdefs{% + \@xdyuserlocationdefs ^^J% + (define-location-class \string"#2\string"^^J\space\space + \space(:sep \string"{}\glsopenbrace\string" #3 + :sep \string"\glsclosebrace\string")) + }% + \else + \edef\@xdyuserlocationdefs{% + \@xdyuserlocationdefs ^^J% + (define-location-class \string"#2\string"^^J\space\space + \space(:sep "\glsopenbrace" + #1 + :sep "\glsclosebrace\glsopenbrace" #3 + :sep "\glsclosebrace")) + }% + \fi + \edef\@xdyuserlocationnames{% + \@xdyuserlocationnames^^J\space\space\space + \string"#2\string"}% + } + \@onlypremakeg\GlsAddXdyLocation +\else + \newcommand*{\GlsAddXdyLocation}[2]{% + \glsnoxindywarning\GlsAddXdyLocation} +\fi +\ifglsxindy + \def\@xdylocationclassorder{^^J\space\space\space + \string"roman-page-numbers\string"^^J\space\space\space + \string"arabic-page-numbers\string"^^J\space\space\space + \string"arabic-section-numbers\string"^^J\space\space\space + \string"alpha-page-numbers\string"^^J\space\space\space + \string"Roman-page-numbers\string"^^J\space\space\space + \string"Alpha-page-numbers\string"^^J\space\space\space + \string"Appendix-page-numbers\string" + \@xdyuserlocationnames^^J\space\space\space + \string"see\string" + } +\fi +\ifglsxindy + \newcommand*\GlsSetXdyLocationClassOrder[1]{% + \def\@xdylocationclassorder{#1}} +\else + \newcommand*\GlsSetXdyLocationClassOrder[1]{% + \glsnoxindywarning\GlsSetXdyLocationClassOrder} +\fi +\ifglsxindy + \def\@xdysortrules{} +\fi +\ifglsxindy + \newcommand*\GlsAddSortRule[2]{% + \expandafter\toks@\expandafter{\@xdysortrules}% + \protected@edef\@xdysortrules{\the\toks@ ^^J + (sort-rule \string"#1\string" \string"#2\string")}% + } +\else + \newcommand*\GlsAddSortRule[2]{% + \glsnoxindywarning\GlsAddSortRule} +\fi +\ifglsxindy + \def\@xdyrequiredstyles{tex} +\fi +\ifglsxindy + \newcommand*\GlsAddXdyStyle[1]{% + \edef\@xdyrequiredstyles{\@xdyrequiredstyles,#1}}% +\else + \newcommand*\GlsAddXdyStyle[1]{% + \glsnoxindywarning\GlsAddXdyStyle} +\fi +\ifglsxindy + \newcommand*\GlsSetXdyStyles[1]{% + \edef\@xdyrequiredstyles{#1}} +\else + \newcommand*\GlsSetXdyStyles[1]{% + \glsnoxindywarning\GlsSetXdyStyles} +\fi +\newcommand*{\findrootlanguage}{} +\def\@xdylanguage#1#2{} +\ifglsxindy + \newcommand*\GlsSetXdyLanguage[2][\glsdefaulttype]{% + \ifglossaryexists{#1}{% + \expandafter\def\csname @xdy@#1@language\endcsname{#2}% + }{% + \PackageError{glossaries}{Can't set language type for + glossary type `#1' --- no such glossary}{% + You have specified a glossary type that doesn't exist}}} +\else + \newcommand*\GlsSetXdyLanguage[2][]{% + \glsnoxindywarning\GlsSetXdyLanguage} +\fi +\def\@gls@codepage#1#2{} +\ifglsxindy + \newcommand*{\GlsSetXdyCodePage}[1]{% + \renewcommand*{\gls@codepage}{#1}% + } + \AtBeginDocument{% + \ifx\gls@codepage\@empty + \@ifpackageloaded{fontspec}{\def\gls@codepage{utf8}}{}% + \fi + } +\else + \newcommand*{\GlsSetXdyCodePage}[1]{% + \glsnoxindywarning\GlsSetXdyCodePage} +\fi +\ifglsxindy + \ifgls@xindy@glsnumbers + \def\@xdylettergroups{(define-letter-group + \string"glsnumbers\string"^^J\space\space\space + :prefixes (\string"0\string" \string"1\string" + \string"2\string" \string"3\string" \string"4\string" + \string"5\string" \string"6\string" \string"7\string" + \string"8\string" \string"9\string")^^J\space\space\space + \@xdynumbergrouporder)} + \else + \def\@xdylettergroups{} + \fi +\fi + \newcommand*\GlsAddLetterGroup[2]{% + \expandafter\toks@\expandafter{\@xdylettergroups}% + \protected@edef\@xdylettergroups{\the\toks@^^J% + (define-letter-group \string"#1\string"^^J\space\space\space#2)}% + }% +\newcommand*{\forallglossaries}[3][\@glo@types]{% + \@for#2:=#1\do{\ifx#2\@empty\else#3\fi}% +} + +\newcommand*{\forallacronyms}[2]{% + \@for#1:=\@glsacronymlists\do{\ifx#1\@empty\else#2\fi}% +} +\newcommand*{\forglsentries}[3][\glsdefaulttype]{% + \protected@edef\@@glo@list{\csname glolist@#1\endcsname}% + \@for#2:=\@@glo@list\do + {% + \ifdefempty{#2}{}{#3}% + }% +} +\newcommand*{\forallglsentries}[3][\@glo@types]{% + \expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}% + {% + \forglsentries[\@@this@glo@]{#2}{#3}% + }% +} +\newcommand{\ifglossaryexists}{% + \@ifstar\s@ifglossaryexists\@ifglossaryexists +} +\newcommand{\@ifglossaryexists}[3]{% + \ifcsundef{@glotype@#1@out}{#3}{#2}% +} +\newcommand{\s@ifglossaryexists}[3]{% + \ifcsundef{glolist@#1}{#3}{#2}% +} +\newcommand*{\glsdetoklabel}[1]{#1} +\newcommand{\ifglsentryexists}[3]{% + \ifcsundef{glo@\glsdetoklabel{#1}@name}{#3}{#2}% +} +\newcommand*{\ifglsused}[3]{% + \ifbool{glo@\glsdetoklabel{#1}@flag}{#2}{#3}% +} +\newcommand{\glsdoifexists}[2]{% + \ifglsentryexists{#1}{#2}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' + has not been defined}{You need to define a glossary entry before you + can use it.}}% +} +\newcommand{\glsdoifnoexists}[2]{% + \ifglsentryexists{#1}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' has already + been defined}{}}{#2}% +} +\newcommand{\glsdoifexistsorwarn}[2]{% + \ifglsentryexists{#1}{#2}{% + \GlossariesWarning{Glossary entry `\glsdetoklabel{#1}' + has not been defined}% + }% +} +\newcommand{\glsdoifexistsordo}[3]{% + \ifglsentryexists{#1}{#2}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' + has not been defined}{You need to define a glossary entry before you + can use it.}% + #3% + }% +} +\newcommand{\doifglossarynoexistsordo}[3]{% + \ifglossaryexists*{#1}% + {% + \PackageError{glossaries}{Glossary type `#1' already exists}{}% + #3% + }% + {#2}% +} +\newrobustcmd{\ifglshaschildren}[3]{% + \glsdoifexists{#1}% + {% + \def\do@glshaschildren{#3}% + \protected@edef\@gls@thislabel{\glsdetoklabel{#1}}% + \expandafter\forglsentries\expandafter + [\csname glo@\@gls@thislabel @type\endcsname] + {\glo@label}% + {% + \letcs\glo@parent{glo@\glo@label @parent}% + \ifdefequal\@gls@thislabel\glo@parent + {% + \def\do@glshaschildren{#2}% + \@endfortrue + }% + {}% + }% + \do@glshaschildren + }% +} +\newcommand{\ifglshasparent}[3]{% + \glsdoifexists{#1}% + {% + \ifcsempty{glo@\glsdetoklabel{#1}@parent}{#3}{#2}% + }% +} +\newcommand*{\ifglshasdesc}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@desc}% + {#3}% + {#2}% +} +\newcommand*{\ifglsdescsuppressed}[3]{% + \ifcsequal{glo@\glsdetoklabel{#1}@desc}{@no@post@desc}% + {#2}% + {#3}% +} +\newrobustcmd*{\ifglshassymbol}[3]{% + \letcs{\@glo@symbol}{glo@\glsdetoklabel{#1}@symbol}% + \ifdefempty\@glo@symbol + {#3}% + {% + \ifdefequal\@glo@symbol\@gls@default@value + {#3}% + {#2}% + }% +} +\newrobustcmd*{\ifglshaslong}[3]{% + \letcs{\@glo@long}{glo@\glsdetoklabel{#1}@long}% + \ifdefempty\@glo@long + {#3}% + {% + \ifdefequal\@glo@long\@gls@default@value + {#3}% + {#2}% + }% +} +\newrobustcmd*{\ifglshasshort}[3]{% + \letcs{\@glo@short}{glo@\glsdetoklabel{#1}@short}% + \ifdefempty\@glo@short + {#3}% + {% + \ifdefequal\@glo@short\@gls@default@value + {#3}% + {#2}% + }% +} +\newrobustcmd*{\ifglshasfield}[4]{% + \glsdoifexists{#2}% + {% + \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@#1}% + \ifdef\@glo@thisvalue + {% + \ifdefempty\@glo@thisvalue + {% + #4% + }% + {% + \ifdefequal\@glo@thisvalue\@gls@default@value + {% + #4% + }% + {% + \let\glscurrentfieldvalue\@glo@thisvalue + #3% + }% + }% + }% + {% + \@gls@fetchfield{\@gls@thisfield}{#1}% + \ifdef\@gls@thisfield + {% + \letcs{\@glo@thisvalue}{glo@\glsdetoklabel{#2}@\@gls@thisfield}% + \ifdefempty\@glo@thisvalue + {% + #4% + }% + {% + \ifdefequal\@glo@thisvalue\@gls@default@value + {% + #4% + }% + {% + \let\glscurrentfieldvalue\@glo@thisvalue + #3% + }% + }% + }% + {% + \GlossariesWarning{Unknown entry field `#1'}% + #4% + }% + }% + }% +} +\newcommand*{\glscurrentfieldvalue}{} +\newcommand*{\@glo@types}{,} +\newcommand*\@gls@provide@newglossary{% + \protected@write\@auxout{}{\string\providecommand\string\@newglossary[4]{}}% + \let\@gls@provide@newglossary\relax +} +\newcommand*{\defglsentryfmt}[2][\glsdefaulttype]{% + \csgdef{gls@#1@entryfmt}{#2}% +} +\newcommand*{\gls@doentryfmt}[1]{\csuse{gls@#1@entryfmt}} +\newcommand*{\@gls@forbidtexext}[1]{% + \ifboolexpr{test {\ifdefstring{#1}{tex}} + or test {\ifdefstring{#1}{TEX}}} + {% + \def#1{nottex}% + \PackageError{glossaries}% + {Forbidden `.tex' extension replaced with `.nottex'}% + {I'm sorry, I can't allow you to do something so reckless.\MessageBreak + Don't use `.tex' as an extension for a temporary file.}% + }% + {% + }% +} +\newcommand*{\gls@gobbleopt}{\new@ifnextchar[{\@gls@gobbleopt}{}} +\def\@gls@gobbleopt[#1]{} +\newcommand*{\newglossary}{\@ifstar\s@newglossary\ns@newglossary} +\newcommand*{\s@newglossary}[2]{% + \ns@newglossary[#1-glg]{#1}{#1-gls}{#1-glo}{#2}% +} +\newcommand*{\ns@newglossary}[5][glg]{% + \doifglossarynoexistsordo{#2}% + {% + \ifundef\glsdefaulttype + {% + \gdef\glsdefaulttype{#2}% + }{}% + \toks@{#2}\protected@edef\@glo@types{\@glo@types\the\toks@,}% + \expandafter\gdef\csname glolist@#2\endcsname{,}% + \expandafter\edef\csname @glotype@#2@log\endcsname{#1}% + \expandafter\edef\csname @glotype@#2@in\endcsname{#3}% + \expandafter\edef\csname @glotype@#2@out\endcsname{#4}% + \expandafter\@gls@forbidtexext\csname @glotype@#2@log\endcsname + \expandafter\@gls@forbidtexext\csname @glotype@#2@in\endcsname + \expandafter\@gls@forbidtexext\csname @glotype@#2@out\endcsname + \expandafter\def\csname @glotype@#2@title\endcsname{#5}% + \@gls@provide@newglossary + \protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}% + \ifcsundef{gls@#2@entryfmt}% + {% + \defglsentryfmt[#2]{\glsentryfmt}% + }% + {}% + \@gls@defsortcount{#2}% + \@ifnextchar[{\@gls@setcounter{#2}}% + {\@gls@setcounter{#2}[\glscounter]}% + }% + {% + \gls@gobbleopt + }% +} +\newcommand*{\altnewglossary}[3]{% + \newglossary[#2-glg]{#1}{#2-gls}{#2-glo}{#3}% +} +\@onlypreamble{\newglossary} +\@onlypremakeg\newglossary +\newcommand*{\@newglossary}[4]{} +\def\@gls@setcounter#1[#2]{% + \expandafter\def\csname @glotype@#1@counter\endcsname{#2}% + \ifglsxindy + \GlsAddXdyCounters{#2}% + \fi +} +\newcommand*{\@gls@getcounter}[1]{% + \csname @glotype@#1@counter\endcsname +} +\glsdefmain +\@gls@do@acronymsdef +\@gls@do@symbolsdef +\@gls@do@numbersdef +\@gls@do@indexdef +\newcommand*{\newignoredglossary}[1]{% + \ifdefempty\@ignored@glossaries + {% + \protected@edef\@ignored@glossaries{#1}% + }% + {% + \protected@eappto\@ignored@glossaries{,#1}% + }% + \csgdef{glolist@#1}{,}% + \ifcsundef{gls@#1@entryfmt}% + {% + \defglsentryfmt[#1]{\glsentryfmt}% + }% + {}% + \ifdefempty\@gls@nohyperlist + {% + \renewcommand*{\@gls@nohyperlist}{#1}% + }% + {% + \protected@eappto\@gls@nohyperlist{,#1}% + }% +} +\newcommand*{\@ignored@glossaries}{} +\newcommand*{\ifignoredglossary}[3]{% + \protected@edef\@gls@igtype{#1}% + \expandafter\DTLifinlist\expandafter + {\@gls@igtype}{\@ignored@glossaries}{#2}{#3}% +} +\define@key{glossentry}{name}{% +\def\@glo@name{#1}% +} +\define@key{glossentry}{description}{% +\def\@glo@desc{#1}% +} +\define@key{glossentry}{descriptionplural}{% +\def\@glo@descplural{#1}% +} +\define@key{glossentry}{sort}{% +\def\@glo@sort{#1}} +\define@key{glossentry}{text}{% +\def\@glo@text{#1}% +} +\define@key{glossentry}{plural}{% +\def\@glo@plural{#1}% +} +\define@key{glossentry}{first}{% +\def\@glo@first{#1}% +} +\define@key{glossentry}{firstplural}{% +\def\@glo@firstplural{#1}% +} +\newcommand*{\@gls@default@value}{\relax} +\define@key{glossentry}{symbol}{% +\def\@glo@symbol{#1}% +} +\define@key{glossentry}{symbolplural}{% +\def\@glo@symbolplural{#1}% +} +\define@key{glossentry}{type}{% +\def\@glo@type{#1}} +\define@key{glossentry}{counter}{% + \ifcsundef{c@#1}% + {% + \PackageError{glossaries}% + {There is no counter called `#1'}% + {% + The counter key should have the name of a valid counter + as its value% + }% + }% + {% + \def\@glo@counter{#1}% + }% +} +\define@key{glossentry}{see}{% + \gls@set@xr@key{see}{\@glo@see}{#1}% +} +\newcommand*{\gls@set@xr@key}[3]{% + \renewcommand*{\gls@xr@key}{#1}% + \gls@checkseeallowed + \def#2{#3}% + \@glo@seeautonumberlist +} +\newcommand*{\gls@xr@key}{see} +\newcommand*{\gls@checkseeallowed}{% + \@gls@see@noindex +} +\newcommand*{\gls@checkseeallowed@preambleonly}{% + \GlossariesWarning + {`\gls@xr@key' key doesn't have any effect when used in the document + environment. Move the definition to the preamble + after \string\makeglossaries\space + or \string\makenoidxglossaries}% +} +\define@key{glossentry}{parent}{% +\def\@glo@parent{#1}} +\define@choicekey{glossentry}{nonumberlist}% + [\gls@nonumberlist@val\gls@nonumberlist@nr]{true,false}[true]% +{% + \ifcase\gls@nonumberlist@nr\relax + \def\@glo@prefix{\glsnonextpages}% + \@gls@savenonumberlist{true}% + \else + \def\@glo@prefix{\glsnextpages}% + \@gls@savenonumberlist{false}% + \fi +} +\newcommand*{\@gls@savenonumberlist}[1]{} +\newcommand*{\@gls@initnonumberlist}{}% +\newcommand*{\@gls@storenonumberlist}[1]{} +\newcommand*{\@gls@enablesavenonumberlist}{% + \renewcommand*{\@gls@initnonumberlist}{% + \undef\@glo@nonumberlist + }% + \renewcommand*{\@gls@savenonumberlist}[1]{% + \def\@glo@nonumberlist{##1}% + }% + \renewcommand*{\@gls@storenonumberlist}[1]{% + \ifdef\@glo@nonumberlist + {% + \cslet{glo@\glsdetoklabel{##1}@nonumberlist}{\@glo@nonumberlist}% + }% + {}% + }% + \appto\@gls@keymap{,{nonumberlist}{nonumberlist}}% +} +\define@key{glossentry}{user1}{% + \def\@glo@useri{#1}% +} +\define@key{glossentry}{user2}{% + \def\@glo@userii{#1}% +} +\define@key{glossentry}{user3}{% + \def\@glo@useriii{#1}% +} +\define@key{glossentry}{user4}{% + \def\@glo@useriv{#1}% +} +\define@key{glossentry}{user5}{% + \def\@glo@userv{#1}% +} +\define@key{glossentry}{user6}{% + \def\@glo@uservi{#1}% +} +\define@key{glossentry}{short}{% + \def\@glo@short{#1}% +} +\define@key{glossentry}{shortplural}{% + \def\@glo@shortpl{#1}% +} +\define@key{glossentry}{long}{% + \def\@glo@long{#1}% +} +\define@key{glossentry}{longplural}{% + \def\@glo@longpl{#1}% +} +\newcommand*{\@glsnoname}{% + \PackageError{glossaries}{name key required in + \string\newglossaryentry\space for entry `\@glo@label'}{You + haven't specified the entry name}} +\newcommand*\@glsnodesc{% + \PackageError{glossaries} + {% + description key required in \string\newglossaryentry\space + for entry `\@glo@label'% + }% + {% + You haven't specified the entry description% + }% +}% +\newcommand*{\@glsdefaultplural}{} +\newcommand*{\@gls@missingnumberlist}[1]{% + ??% + \ifglssavenumberlist + \GlossariesWarning{Missing number list for entry `#1'. + Maybe makeglossaries + rerun required}% + \else + \PackageError{glossaries}% + {Package option `savenumberlist=true' required}% + {% + You must use the `savenumberlist' package option + to reference location lists.% + }% + \fi +} +\newcommand*{\@glsdefaultsort}{\@glo@name} +\newcount\gls@level +\newcommand{\@@gls@noexpand@field}[3]{% + \expandafter\global\expandafter + \let\csname glo@#1@#2\endcsname#3% +} +\newcommand{\@gls@noexpand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% + }% + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \@@gls@noexpand@field{#2}{#3}{\@gls@value}% + }% + {% + \@@gls@noexpand@field{#2}{#3}{#4}% + }% + }% +} +\newcommand{\@@gls@expand@field}[3]{% + \expandafter + \protected@xdef\csname glo@#1@#2\endcsname{#3}% +} +\newcommand{\@gls@expand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \expandafter\@gls@startswithexpandonce#4\relax\relax\gls@endcheck + {% + \@@gls@expand@field{#2}{#3}{#4}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% + }% + }% + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \@@gls@expand@field{#2}{#3}{#1}% + }% + {% + \@@gls@expand@field{#2}{#3}{#4}% + }% + }% +} +\def\@gls@expandonce{\expandonce} +\def\@gls@startswithexpandonce#1#2\gls@endcheck#3#4{% + \def\@gls@tmp{#1}% + \ifdefequal{\@gls@expandonce}{\@gls@tmp}{#3}{#4}% +} +\let\gls@assign@field\@gls@expand@fields +\newcommand*{\glsexpandfields}{% + \let\gls@assign@field\@gls@expand@fields +} +\newcommand*{\glsnoexpandfields}{% + \let\gls@assign@field\@gls@noexpand@fields +} +\newrobustcmd{\newglossaryentry}[2]{% + \glsdoifnoexists{#1}% + {% + \gls@defglossaryentry{#1}{#2}% + }% +} +\newcommand*{\gls@defdocnewglossaryentry}{% + \let\newglossaryentry\new@glossaryentry +} +\newrobustcmd{\provideglossaryentry}[2]{% + \ifglsentryexists{#1}% + {}% + {% + \gls@defglossaryentry{#1}{#2}% + }% +} +\@onlypreamble{\provideglossaryentry} +\newcommand*{\gls@glsdefs@labellist}{} +\newcommand*{\gls@glsdefs@addlabel}[1]{\listxadd{\gls@glsdefs@labellist}{#1}} +\newcommand*{\gls@docdef@labellist}{} +\newcommand*{\gls@docdef@addlabel}[1]{\listxadd{\gls@docdef@labellist}{#1}} +\newrobustcmd{\new@glossaryentry}[2]{% + \ifundef\@gls@deffile + {% + \global\newwrite\@gls@deffile + \immediate\openout\@gls@deffile=\jobname.glsdefs + }% + {}% + \ifglsentryexists{#1}% + {% + \xifinlist{#1}{\gls@docdef@labellist}% + {% + \GlossariesWarning{Entry `#1' has already been defined in the + document environment (ignoring new definition)}% + }% + {% + \xifinlist{#1}{\gls@glsdefs@labellist}% + {% + \gls@defglossaryentry{#1}{#2}% + \gls@docdef@addlabel{#1}% + \@gls@writedef{#1}% + }% + {% + \GlossariesWarning{Entry `#1' has already been defined in + the preamble (in which case remove the duplicate definition) + or you have just updated to glossaries.sty + v4.47 (in which case delete `\jobname.glsdefs')}% + }% + }% + }% + {% + \gls@defglossaryentry{#1}{#2}% + \gls@docdef@addlabel{#1}% + \@gls@writedef{#1}% + }% +} +\AtBeginDocument{\gls@begindocdefs} +\AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} +\newcommand*{\gls@begindocdefs}{% + \@gls@enablesavenonumberlist + \edef\@gls@restoreat{\noexpand\catcode`\noexpand\@=\number\catcode`\@\relax}% + \makeatletter + \InputIfFileExists{\jobname.glsdefs}{}{}% + \@gls@restoreat + \undef\@gls@restoreat + \gls@defdocnewglossaryentry +} +\newcommand*{\glsdefs@newdocentry}[2]{% + \ifglsentryexists{#1}% + {\GlossariesWarning{entry `#1' has already been defined in the preamble + (if you have moved the definition there from the document + environment, delete \jobname.glsdefs)}}% + {% + \gls@glsdefs@addlabel{#1}% + \gls@defglossaryentry{#1}{#2}% + }% +} +\newcommand*{\@gls@writedef}[1]{% + \immediate\write\@gls@deffile + {% + \string\glsdefs@newdocentry{\glsdetoklabel{#1}}\glspercentchar^^J% + \expandafter\@gobble\string\{\glspercentchar% + }% + \@for\@gls@map:=\@gls@keymap\do + {% + \letcs\glo@value{glo@\glsdetoklabel{#1}@\expandafter\@secondoftwo\@gls@map}% + \ifdef\glo@value + {% + \@onelevel@sanitize\glo@value + \immediate\write\@gls@deffile + {% + \expandafter\@firstoftwo\@gls@map + =\expandafter\@gobble\string\{\glo@value\expandafter\@gobble\string\},% + \glspercentchar + }% + }% + {}% + }% + \glswritedefhook + \immediate\write\@gls@deffile + {% + \glspercentchar^^J% + \expandafter\@gobble\string\}\glspercentchar^^J% + }% +} +\newcommand*{\@gls@keymap}{% + {name}{name},% + {sort}{sortvalue},% unescaped sort value + {type}{type},% + {first}{first},% + {firstplural}{firstpl},% + {text}{text},% + {plural}{plural},% + {description}{desc},% + {descriptionplural}{descplural},% + {symbol}{symbol},% + {symbolplural}{symbolplural},% + {user1}{useri},% + {user2}{userii},% + {user3}{useriii},% + {user4}{useriv},% + {user5}{userv},% + {user6}{uservi},% + {long}{long},% + {longplural}{longpl},% + {short}{short},% + {shortplural}{shortpl},% + {counter}{counter},% + {parent}{parent}% +} +\newcommand*{\@gls@fetchfield}[2]{% + \edef\@gls@thisval{#2}% + \@for\@gls@map:=\@gls@keymap\do{% + \edef\@this@key{\expandafter\@firstoftwo\@gls@map}% + \ifdefequal{\@this@key}{\@gls@thisval}% + {% + \edef#1{\expandafter\@secondoftwo\@gls@map}% + \@endfortrue + }% + {}% + }% +} +\newcommand*{\glsaddstoragekey}{\@ifstar\@sglsaddstoragekey\@glsaddstoragekey} +\newcommand*{\@sglsaddstoragekey}[1]{% + \key@ifundefined{glossentry}{#1}% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname gls@assign@#1@field\endcsname}[2]{% + \@@gls@expand@field{##1}{#1}{##2}% + }% + }% + {}% + \@glsaddstoragekey{#1}% +} +\newcommand*{\@glsaddstoragekey}[3]{% + \key@ifundefined{glossentry}{#1}% + {% + \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% + \appto\@gls@keymap{,{#1}{#1}}% + \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% + \appto\@newglossaryentryposthook{% + \letcs{\@glo@tmp}{@glo@#1}% + \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% + }% + \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% + }% + {% + \PackageError{glossaries}{Key `#1' already exists}{}% + }% +} +\newcommand*{\glsaddkey}{\@ifstar\@sglsaddkey\@glsaddkey} +\newcommand*{\@sglsaddkey}[1]{% + \key@ifundefined{glossentry}{#1}% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname gls@assign@#1@field\endcsname}[2]{% + \@@gls@expand@field{##1}{#1}{##2}% + }% + }% + {}% + \@glsaddkey{#1}% +} +\newcommand*{\@glsaddkey}[7]{% + \key@ifundefined{glossentry}{#1}% + {% + \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% + \appto\@gls@keymap{,{#1}{#1}}% + \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% + \appto\@newglossaryentryposthook{% + \letcs{\@glo@tmp}{@glo@#1}% + \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% + }% + \newcommand*{#3}[1]{\@gls@entry@field{##1}{#1}}% + \newcommand*{#4}[1]{\@Gls@entry@field{##1}{#1}}% + \ifcsdef{@gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#5' as helper command + `\expandafter\string\csname @gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@gls@user@#1@}{##1}{##2}}% + {\csuse{@gls@user@#1@}{##1}{##2}[]}}% + \csdef{@gls@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{#3{##2}##3}% + }% + \newrobustcmd*{#5}{% + \expandafter\@gls@hyp@opt\csname @gls@user@#1\endcsname}% + }% + \ifcsdef{@Gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#6' as helper command + `\expandafter\string\csname @Gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @Gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@Gls@user@#1@}{##1}{##2}}% + {\csuse{@Gls@user@#1@}{##1}{##2}[]}}% + \csdef{@Gls@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{#4{##2}##3}% + }% + \newrobustcmd*{#6}{% + \expandafter\@gls@hyp@opt\csname @Gls@user@#1\endcsname}% + }% + \ifcsdef{@GLS@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#7' as helper command + `\expandafter\string\csname @GLS@user@#1@\endcsname' already exists}% + {}% + }% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname @GLS@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@GLS@user@#1@}{##1}{##2}}% + {\csuse{@GLS@user@#1@}{##1}{##2}[]}}% + \csdef{@GLS@user@#1@}##1##2[##3]{% + \@gls@field@link{##1}{##2}{\mfirstucMakeUppercase{#3{##2}##3}}% + }% + \newrobustcmd*{#7}{% + \expandafter\@gls@hyp@opt\csname @GLS@user@#1\endcsname}% + }% + }% + {% + \PackageError{glossaries}{Key `#1' already exists}{}% + }% +} +\newcommand{\glsfieldxdef}[3]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \protected@csxdef{glo@\@glo@label @#2}{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\glsfieldedef}[3]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \protected@csedef{glo@\@glo@label @#2}{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\glsfieldgdef}[3]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\gdef\csname glo@\@glo@label @#2\endcsname{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\glsfielddef}[3]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\def\csname glo@\@glo@label @#2\endcsname{#3}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\glsfieldfetch}[3]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \letcs#3{glo@\@glo@label @#2}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand*{\glsunexpandedfieldvalue}[2]{% + \ifcsname glo@\glsdetoklabel{#1}@#2\endcsname + \expandafter\expandonce\csname glo@\glsdetoklabel{#1}@#2\expandafter\endcsname + \fi +} +\newcommand{\ifglsfieldeq}[5]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \ifcsstring{glo@\@glo@label @#2}{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\ifglsfielddefeq}[5]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \expandafter\ifdefstrequal + \csname glo@\@glo@label @#2\endcsname{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand{\ifglsfieldcseq}[5]{% + \glsdoifexists{#1}% + {% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \ifcsdef{glo@\@glo@label @#2}% + {% + \ifcsstrequal{glo@\@glo@label @#2}{#3}{#4}{#5}% + }% + {% + \PackageError{glossaries}{Key `#2' doesn't exist}{}% + }% + }% +} +\newcommand*{\glswritedefhook}{} +\newcommand*{\gls@assign@desc}[1]{% + \gls@assign@field{}{#1}{desc}{\@glo@desc}% + \gls@assign@field{\@glo@desc}{#1}{descplural}{\@glo@descplural}% +} +\newcommand{\longnewglossaryentry}[3]{% + \glsdoifnoexists{#1}% + {% + \bgroup + \let\@org@newglossaryentryprehook\@newglossaryentryprehook + \long\def\@newglossaryentryprehook{% + \long\def\@glo@desc{#3\leavevmode\unskip\nopostdesc}% + \@org@newglossaryentryprehook + }% + \renewcommand*{\gls@assign@desc}[1]{% + \global\cslet{glo@\glsdetoklabel{#1}@desc}{\@glo@desc}% + \global\cslet{glo@\glsdetoklabel{#1}@descplural}{\@glo@desc}% + } + \gls@defglossaryentry{#1}{#2}% + \egroup + } +} +\@onlypreamble{\longnewglossaryentry} +\newcommand{\longprovideglossaryentry}[3]{% + \ifglsentryexists{#1}{}% + {\longnewglossaryentry{#1}{#2}{#3}}% +} +\@onlypreamble{\longprovideglossaryentry} +\newcommand{\gls@defglossaryentry}[2]{% + \let\GlsSetQuote\gls@nosetquote + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \let\glslabel\@glo@label + \let\@glo@name\@glsnoname + \let\@glo@desc\@glsnodesc + \let\@glo@descplural\@gls@default@value + \let\@glo@type\@gls@default@value + \let\@glo@symbol\@gls@default@value + \let\@glo@symbolplural\@gls@default@value + \let\@glo@text\@gls@default@value + \let\@glo@plural\@gls@default@value + \let\@glo@first\@gls@default@value + \let\@glo@firstplural\@gls@default@value + \let\@glo@sort\@gls@default@value + \let\@glo@counter\@gls@default@value + \def\@glo@see{}% + \def\@glo@parent{}% + \def\@glo@prefix{}% + \@gls@initnonumberlist + \def\@glo@useri{}% + \def\@glo@userii{}% + \def\@glo@useriii{}% + \def\@glo@useriv{}% + \def\@glo@userv{}% + \def\@glo@uservi{}% + \def\@glo@short{}% + \def\@glo@shortpl{}% + \def\@glo@long{}% + \def\@glo@longpl{}% + \@newglossaryentryprehook + \setkeys{glossentry}{#2}% + \ifundef\glsdefaulttype + {% + \PackageError{glossaries}% + {No default glossary type (have you used `nomain' by mistake?)}% + {If you use package option `nomain' you must define + a new glossary before you can define entries}% + }% + {}% + \gls@assign@field{\glsdefaulttype}{\@glo@label}{type}{\@glo@type}% + \protected@edef\@glo@type{\glsentrytype{\@glo@label}}% + \ifcsundef{glolist@\@glo@type}% + {% + \PackageError{glossaries}% + {Glossary type `\@glo@type' has not been defined}% + {You need to define a new glossary type, before making entries + in it}% + }% + {% + \ifignoredglossary\@glo@type + {% + \ifx\@glo@desc\@glsnodesc + \let\@glo@desc\@empty + \fi + }% + {% + }% + \protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}% + \expandafter\protected@xdef\csname glolist@\@glo@type\endcsname{% + \@glolist@{\@glo@label},}% + }% + \gls@level=0\relax + \ifx\@glo@parent\@empty + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% + \else + \ifdefequal\@glo@label\@glo@parent% + {% + \PackageError{glossaries}{Entry `\@glo@label' can't be its own parent}{}% + \def\@glo@parent{}% + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% + }% + {% + \ifglsentryexists{\@glo@parent}% + {% + \expandafter\protected@xdef\csname glo@\@glo@label @parent\endcsname{% + \@glo@parent}% + \gls@level=\csname glo@\@glo@parent @level\endcsname\relax + \advance\gls@level by 1\relax + \ifx\@glo@name\@glsnoname + \expandafter\let\expandafter\@glo@name + \csname glo@\@glo@parent @name\endcsname + \ifx\@glo@plural\@gls@default@value + \expandafter\let\expandafter\@glo@plural + \csname glo@\@glo@parent @plural\endcsname + \fi + \fi + }% + {% + \PackageError{glossaries}% + {% + Invalid parent `\@glo@parent' + for entry `\@glo@label' - parent doesn't exist% + }% + {% + Parent entries must be defined before their children% + }% + \def\@glo@parent{}% + \expandafter\gdef\csname glo@\@glo@label @parent\endcsname{}% + }% + }% + \fi + \expandafter\xdef\csname glo@\@glo@label @level\endcsname{\number\gls@level}% + \gls@assign@field{\@glo@name}{\@glo@label}{sortvalue}{\@glo@sort}% + \letcs\@glo@sort{glo@\@glo@label @sortvalue}% + \gls@assign@field{\@glo@name}{\@glo@label}{text}{\@glo@text}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @text\endcsname\glspluralsuffix}% + {\@glo@label}{plural}{\@glo@plural}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @text\endcsname}% + {\@glo@label}{first}{\@glo@first}% + \ifx\@glo@first\@gls@default@value + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @plural\endcsname}% + {\@glo@label}{firstpl}{\@glo@firstplural}% + \else + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @first\endcsname\glspluralsuffix}% + {\@glo@label}{firstpl}{\@glo@firstplural}% + \fi + \ifcsundef{@glotype@\@glo@type @counter}% + {% + \def\@glo@defaultcounter{\glscounter}% + }% + {% + \letcs\@glo@defaultcounter{@glotype@\@glo@type @counter}% + }% + \gls@assign@field{\@glo@defaultcounter}{\@glo@label}{counter}{\@glo@counter}% + \gls@assign@field{}{\@glo@label}{useri}{\@glo@useri}% + \gls@assign@field{}{\@glo@label}{userii}{\@glo@userii}% + \gls@assign@field{}{\@glo@label}{useriii}{\@glo@useriii}% + \gls@assign@field{}{\@glo@label}{useriv}{\@glo@useriv}% + \gls@assign@field{}{\@glo@label}{userv}{\@glo@userv}% + \gls@assign@field{}{\@glo@label}{uservi}{\@glo@uservi}% + \gls@assign@field{}{\@glo@label}{short}{\@glo@short}% + \gls@assign@field{}{\@glo@label}{shortpl}{\@glo@shortpl}% + \gls@assign@field{}{\@glo@label}{long}{\@glo@long}% + \gls@assign@field{}{\@glo@label}{longpl}{\@glo@longpl}% + \ifx\@glo@name\@glsnoname + \@glsnoname + \let\@gloname\@gls@default@value + \fi + \gls@assign@field{}{\@glo@label}{name}{\@glo@name}% + \ifcsundef{glo@\@glo@label @numberlist}% + {% + \csxdef{glo@\@glo@label @numberlist}{% + \noexpand\@gls@missingnumberlist{\@glo@label}}% + }% + {}% + \@gls@storenonumberlist{\@glo@label}% + \def\@glo@@desc{\@glo@first}% + \ifx\@glo@desc\@glo@@desc + \let\@glo@desc\@glo@first + \fi + \ifx\@glo@desc\@glsnodesc + \@glsnodesc + \let\@glodesc\@gls@default@value + \fi + \gls@assign@desc{\@glo@label}% + \@gls@defsort{\@glo@type}{\@glo@label}% + \def\@glo@@symbol{\@glo@text}% + \ifx\@glo@symbol\@glo@@symbol + \let\@glo@symbol\@glo@text + \fi + \gls@assign@field{\relax}{\@glo@label}{symbol}{\@glo@symbol}% + \expandafter + \gls@assign@field\expandafter + {\csname glo@\@glo@label @symbol\endcsname} + {\@glo@label}{symbolplural}{\@glo@symbolplural}% + \expandafter\protected@xdef\csname glo@\@glo@label @flagfalse\endcsname{% + \noexpand\global + \noexpand\let\expandafter\noexpand + \csname ifglo@\@glo@label @flag\endcsname\noexpand\iffalse + }% + \expandafter\protected@xdef\csname glo@\@glo@label @flagtrue\endcsname{% + \noexpand\global + \noexpand\let\expandafter\noexpand + \csname ifglo@\@glo@label @flag\endcsname\noexpand\iftrue + }% + \csname glo@\@glo@label @flagfalse\endcsname + \@glo@autosee + \ifignoredglossary\@glo@type + {% + \csdef{glo@\@glo@label @index}{}% + } + {% + \do@glo@storeentry{\@glo@label}% + }% + \@newglossaryentry@defcounters + \@newglossaryentryposthook +} +\newcommand*{\@glo@autosee}{% + \ifdefvoid\@glo@see{}% + {% + \protected@edef\@do@glssee{% + \noexpand\@gls@fixbraces\noexpand\@glo@list\@glo@see\noexpand\@nil + \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{\@glo@label}}% + \@do@glssee + }% + \@glo@autoseehook +}% +\newcommand*{\@glo@autoseehook}{} +\newcommand*{\@newglossaryentryprehook}{} +\newcommand*{\@newglossaryentryposthook}{} +\newcommand*{\@newglossaryentry@defcounters}{} +\newcommand*{\glsmoveentry}[2]{% + \protected@edef\@glo@thislabel{\glsdetoklabel{#1}}% + \protected@edef\glo@type{\csname glo@\@glo@thislabel @type\endcsname}% + \def\glo@list{,}% + \forglsentries[\glo@type]{\glo@label}% + {% + \ifdefequal\@glo@thislabel\glo@label + {}{\protected@eappto\glo@list{\glo@label,}}% + }% + \cslet{glolist@\glo@type}{\glo@list}% + \csdef{glo@\@glo@thislabel @type}{#2}% +} +\ifglsxindy + \newcommand*{\@glossaryentryfield}{\string\\glossentry} +\else + \newcommand*{\@glossaryentryfield}{\string\glossentry} +\fi +\ifglsxindy + \newcommand*{\@glossarysubentryfield}{% + \string\\subglossentry} +\else + \newcommand*{\@glossarysubentryfield}{% + \string\subglossentry} +\fi +\newcommand{\@glo@storeentry}[1]{% + \protected@edef\@glo@esclabel{#1}% + \@gls@checkmkidxchars\@glo@esclabel + \protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% + \@gls@checkmkidxchars\@glo@sort + \@gls@checkmkidxchars\@glo@prefix + \protected@edef\@glo@parent{\csname glo@#1@parent\endcsname}% + \ifglsxindy + \ifx\@glo@parent\@empty + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossaryentryfield{\@glo@esclabel}\string") % + }% + \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@esclabel}\string") % + }% + \fi + \else + \ifx\@glo@parent\@empty + \@onelevel@sanitize\@glo@prefix + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossaryentryfield{\@glo@esclabel}% + }% + \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname\@gls@levelchar + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@esclabel}% + }% + \fi + \fi +} +\AtBeginDocument{% + \@ifpackageloaded{amsmath}% + {\let\gls@ifnotmeasuring\@gls@ifnotmeasuring}% + {}% +} +\newcommand*{\@gls@ifnotmeasuring}[1]{% + \ifmeasuring@ + \else + #1% + \fi +} +\newcommand*\gls@ifnotmeasuring[1]{#1} +\def\@gls@patchtabularx#1\hbox#2#3!!{% + \def\TX@trial##1{#1\hbox{\let\glsunset\@gobble#2}#3}% +} +\newcommand*\glspatchtabularx{% + \ifdef\TX@trial + {% + \expandafter\@gls@patchtabularx\TX@trial{##1}!!% + \let\glspatchtabularx\relax + }% + {}% +} +\newcommand*{\glsreset}[1]{% + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \@glsreset{#1}% + }% + }% +} +\newcommand*{\glslocalreset}[1]{% + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \@glslocalreset{#1}% + }% + }% +} +\newcommand*{\glsunset}[1]{% + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \@glsunset{#1}% + }% + }% +} +\newcommand*{\glslocalunset}[1]{% + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \@glslocalunset{#1}% + }% + }% +} +\newcommand*{\@glslocalunset}{\@@glslocalunset} +\newcommand*{\@@glslocalunset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iftrue +} +\newcommand*{\@glsunset}{\@@glsunset} +\newcommand*{\@@glsunset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagtrue\endcsname +} +\newcommand*{\@glslocalreset}{\@@glslocalreset} +\newcommand*{\@@glslocalreset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iffalse +} +\newcommand*{\@glsreset}{\@@glsreset} +\newcommand*{\@@glsreset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagfalse\endcsname +} +\newcommand*{\glsresetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% + {% + \glsreset{\@glsentry}% + }% +} +\newcommand*{\glslocalresetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% + {% + \glslocalreset{\@glsentry}% + }% +} +\newcommand*{\glsunsetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% + {% + \glsunset{\@glsentry}% + }% +} +\newcommand*{\glslocalunsetall}[1][\@glo@types]{% + \forallglsentries[#1]{\@glsentry}% + {% + \glslocalunset{\@glsentry}% + }% +} +\newcommand*{\@@newglossaryentry@defcounters}{% + \csdef{glo@\@glo@label @currcount}{0}% + \csdef{glo@\@glo@label @prevcount}{0}% +} +\newcommand*{\glsenableentrycount}{% + \let\@newglossaryentry@defcounters\@@newglossaryentry@defcounters + \renewcommand*{\gls@defdocnewglossaryentry}{% + \renewcommand*\newglossaryentry[2]{% + \PackageError{glossaries}{\string\newglossaryentry\space + may only be used in the preamble when entry counting has + been activated}{If you use \string\glsenableentrycount\space + you must place all entry definitions in the preamble not in + the document environment}% + }% + }% + \newcommand*{\glsentrycurrcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@currcount}% + {0}{\@gls@entry@field{##1}{currcount}}% + }% + \newcommand*{\glsentryprevcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@prevcount}% + {0}{\@gls@entry@field{##1}{prevcount}}% + }% + \renewcommand*{\@glsunset}[1]{% + \@@glsunset{##1}% + \@gls@increment@currcount{##1}% + }% + \renewcommand*{\@glslocalunset}[1]{% + \@@glslocalunset{##1}% + \@gls@local@increment@currcount{##1}% + }% + \renewcommand*{\@glsreset}[1]{% + \@@glsreset{##1}% + \csgdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% + \renewcommand*{\@glslocalreset}[1]{% + \@@glslocalreset{##1}% + \csdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% + \def\@cgls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsformat{##2}{##3}% + \glsunset{##2}% + \else + \@gls@{##1}{##2}[##3]% + \fi + }% + \def\@cglspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@glspl@{##1}{##2}[##3]% + \fi + }% + \def\@cGls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsformat{##2}{##3}% + \glsunset{##2}% + \else + \@Gls@{##1}{##2}[##3]% + \fi + }% + \def\@cGlspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@Glspl@{##1}{##2}[##3]% + \fi + }% + \AtEndDocument{\@gls@write@entrycounts}% + \renewcommand*{\@gls@entry@count}[2]{% + \csgdef{glo@\glsdetoklabel{##1}@prevcount}{##2}% + }% + \let\glsenableentrycount\relax +} +\@onlypreamble\glsenableentrycount +\newcommand*{\@gls@increment@currcount}[1]{% + \csxdef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% +} +\newcommand*{\@gls@local@increment@currcount}[1]{% + \csedef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% +} +\newcommand*{\@gls@write@entrycounts}{% + \immediate\write\@auxout + {\string\providecommand*{\string\@gls@entry@count}[2]{}}% + \forallglsentries{\@glsentry}{% + \ifglsused{\@glsentry}% + {\immediate\write\@auxout + {\string\@gls@entry@count{\@glsentry}{\glsentrycurrcount{\@glsentry}}}}% + {}% + }% +} +\newcommand*{\@gls@entry@count}[2]{} +\newrobustcmd*{\cgls}{\@gls@hyp@opt\@cgls} +\newcommand*{\@cgls}[2][]{% + \new@ifnextchar[{\@cgls@{#1}{#2}}{\@cgls@{#1}{#2}[]}% +} +\def\@cgls@#1#2[#3]{% + \GlossariesWarning{\string\cgls\space is defaulting to + \string\gls\space since you haven't enabled entry counting}% + \@gls@{#1}{#2}[#3]% +} +\newcommand*{\cglsformat}[2]{% + \ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}#2% +} +\newrobustcmd*{\cGls}{\@gls@hyp@opt\@cGls} +\newcommand*{\@cGls}[2][]{% + \new@ifnextchar[{\@cGls@{#1}{#2}}{\@cGls@{#1}{#2}[]}% +} +\def\@cGls@#1#2[#3]{% + \GlossariesWarning{\string\cGls\space is defaulting to + \string\Gls\space since you haven't enabled entry counting}% + \@Gls@{#1}{#2}[#3]% +} +\newcommand*{\cGlsformat}[2]{% + \ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}#2% +} +\newrobustcmd*{\cglspl}{\@gls@hyp@opt\@cglspl} +\newcommand*{\@cglspl}[2][]{% + \new@ifnextchar[{\@cglspl@{#1}{#2}}{\@cglspl@{#1}{#2}[]}% +} +\def\@cglspl@#1#2[#3]{% + \GlossariesWarning{\string\cglspl\space is defaulting to + \string\glspl\space since you haven't enabled entry counting}% + \@glspl@{#1}{#2}[#3]% +} +\newcommand*{\cglsplformat}[2]{% + \ifglshaslong{#1}{\glsentrylongpl{#1}}{\glsentryfirstplural{#1}}#2% +} +\newrobustcmd*{\cGlspl}{\@gls@hyp@opt\@cGlspl} +\newcommand*{\@cGlspl}[2][]{% + \new@ifnextchar[{\@cGlspl@{#1}{#2}}{\@cGlspl@{#1}{#2}[]}% +} +\def\@cGlspl@#1#2[#3]{% + \GlossariesWarning{\string\cGlspl\space is defaulting to + \string\Glspl\space since you haven't enabled entry counting}% + \@Glspl@{#1}{#2}[#3]% +} +\newcommand*{\cGlsplformat}[2]{% + \ifglshaslong{#1}{\Glsentrylongpl{#1}}{\Glsentryfirstplural{#1}}#2% +} +\newcommand*{\loadglsentries}[2][\@gls@default]{% + \let\@gls@default\glsdefaulttype + \def\glsdefaulttype{#1}\input{#2}% + \let\glsdefaulttype\@gls@default +} +\@onlypreamble{\loadglsentries} +\newcommand*{\glstextformat}[1]{#1} +\newcommand*{\glsentryfmt}{% + \@@gls@default@entryfmt\glsdisplayfirst\glsdisplay +} +\newcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + {% + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{#2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + {% + \mfirstucMakeUppercase{#1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + {% + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{#2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + }% + {% + \mfirstucMakeUppercase{#1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + }% + }% + }% + }% + {% + \ifglsused{\glslabel}% + {% + #2{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% + }% + {% + #1{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% + }% + }% +} +\newcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glsentryplural{\glslabel}\glsinsert + }% + {% + \glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \Glsentryplural{\glslabel}\glsinsert + }% + {% + \Glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase + {\glsentryplural{\glslabel}\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\glsentryfirstplural{\glslabel}\glsinsert}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glsentrytext{\glslabel}\glsinsert + }% + {% + \glsentryfirst{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \Glsentrytext{\glslabel}\glsinsert + }% + {% + \Glsentryfirst{\glslabel}\glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \mfirstucMakeUppercase{\glsentrytext{\glslabel}\glsinsert}% + }% + {% + \mfirstucMakeUppercase{\glsentryfirst{\glslabel}\glsinsert}% + }% + }% + }% + }% + {% + \glscustomtext\glsinsert + }% +} +\newcommand*{\glsgenacfmt}{% + \ifdefempty\glscustomtext + {% + \ifglsused\glslabel + {% + \glsifplural + {% + \glscapscase + {% + \acronymfont{\glsentryshortpl{\glslabel}}\glsinsert + }% + {% + \acronymfont{\Glsentryshortpl{\glslabel}}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{\glsentryshortpl{\glslabel}}\glsinsert}% + }% + }% + {% + \glscapscase + {% + \acronymfont{\glsentryshort{\glslabel}}\glsinsert + }% + {% + \acronymfont{\Glsentryshort{\glslabel}}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{\glsentryshort{\glslabel}}\glsinsert}% + }% + }% + }% + {% + \glsifplural + {% + \glscapscase + {% + \genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genplacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + {% + \glscapscase + {% + \genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% + }% + {% + \glscustomtext + }% +} +\newcommand*{\genacrfullformat}[2]{% + \glsentrylong{#1}#2\space + (\protect\firstacronymfont{\glsentryshort{#1}})% +} +\newcommand*{\Genacrfullformat}[2]{% + \protected@edef\gls@text{\genacrfullformat{#1}{#2}}% + \xmakefirstuc\gls@text +} +\newcommand*{\genplacrfullformat}[2]{% + \glsentrylongpl{#1}#2\space + (\protect\firstacronymfont{\glsentryshortpl{#1}})% +} +\newcommand*{\Genplacrfullformat}[2]{% + \protected@edef\gls@text{\genplacrfullformat{#1}{#2}}% + \xmakefirstuc\gls@text +} +\newcommand*{\glsdisplayfirst}[4]{#1#4} +\newcommand*{\glsdisplay}[4]{#1#4} +\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplay\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@displayfirst}% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\csuse{gls@#1@display}}% + }% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\glsdisplayfirst}% + {\noexpand\csuse{gls@#1@display}}% + }% + }% + }% + \@gls@doentrydef +} +\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplayfirst\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@display}% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\csuse{gls@#1@display}}% + }% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\glsdisplay}% + }% + }% + }% + \@gls@doentrydef +} +\define@key{glslink}{counter}{% + \ifcsundef{c@#1}% + {% + \PackageError{glossaries}% + {There is no counter called `#1'}% + {% + The counter key should have the name of a valid counter + as its value% + }% + }% + {% + \def\@gls@counter{#1}% + }% +} +\define@key{glslink}{format}{% + \def\@glsnumberformat{#1}} +\define@boolkey{glslink}{hyper}[true]{} +\ifdef{\hyperlink}{\KV@glslink@hypertrue}{\KV@glslink@hyperfalse} +\define@boolkey{glslink}{local}[true]{} +\newcommand*{\glslinkvar}[3]{#1} +\newcommand*{\glsifhyper}[2]{% + \glslinkvar{#1}{#2}{#1}% + \GlossariesWarning{\string\glsifhyper\space is deprecated. Did + you mean \string\glsifhyperon\space or \string\glslinkvar?}% +} +\newcommand*{\@gls@hyp@opt}[1]{% + \let\glslinkvar\@firstofthree + \let\@gls@hyp@opt@cs#1\relax + \@ifstar{\s@gls@hyp@opt}% + {\@ifnextchar+{\@firstoftwo{\p@gls@hyp@opt}}{#1}}% +} +\newcommand*{\s@gls@hyp@opt}[1][]{% + \let\glslinkvar\@secondofthree + \@gls@hyp@opt@cs[hyper=false,#1]} +\newcommand*{\p@gls@hyp@opt}[1][]{% + \let\glslinkvar\@thirdofthree + \@gls@hyp@opt@cs[hyper=true,#1]} +\newrobustcmd*{\glslink}{% + \@gls@hyp@opt\@gls@@link +} +\newcommand*{\@gls@@link}[3][]{% + \glsdoifexistsordo{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \@gls@link[#1]{#2}{#3}% + }{% + \glstextformat{#3}% + }% + \glspostlinkhook +} +\newcommand*{\glspostlinkhook}{} +\newcommand*{\@gls@link@checkfirsthyper}{% + \ifglsused{\glslabel}% + {% + }% + {% + \gls@checkisacronymlist\glstype + \ifglshyperfirst + \if@glsisacronymlist + \ifglsacrfootnote + \KV@glslink@hyperfalse + \fi + \fi + \else + \KV@glslink@hyperfalse + \fi + }% + \glslinkcheckfirsthyperhook +} +\newcommand*{\glslinkcheckfirsthyperhook}{} +\newcommand*{\glslinkpostsetkeys}{} +\newcommand{\glsifhyperon}[2]{\ifKV@glslink@hyper#1\else#2\fi} +\newcommand*{\do@glsdisablehyperinlist}{% + \expandafter\DTLifinlist\expandafter{\glstype}{\@gls@nohyperlist}% + {\KV@glslink@hyperfalse}{}% +} +\newcommand*{\@gls@setdefault@glslink@opts}{} +\def\@gls@link[#1]#2#3{% + \leavevmode + \protected@edef\glslabel{\glsdetoklabel{#2}}% + \def\@gls@link@opts{#1}% + \let\@gls@link@label\glslabel + \def\@glsnumberformat{glsnumberformat}% + \protected@edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% + \protected@edef\glstype{\csname glo@\glslabel @type\endcsname}% + \let\org@ifKV@glslink@hyper\ifKV@glslink@hyper + \@gls@setdefault@glslink@opts + \do@glsdisablehyperinlist + \do@gls@link@checkfirsthyper + \setkeys{glslink}{#1}% + \glslinkpostsetkeys + \@gls@saveentrycounter + \@gls@setsort{\glslabel}% + \@do@wrglossary{#2}% + \ifKV@glslink@hyper + \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \else + \glsdonohyperlink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \fi + \let\ifKV@glslink@hyper\org@ifKV@glslink@hyper +} +\newcommand*{\glolinkprefix}{glo:} +\def\glsentrycounter{\glscounter}% +\newcommand*{\@gls@saveentrycounter}{% + \def\@gls@Hcounter{}% + \ifthenelse{\equal{\@gls@counter}{equation}}% + { + \ifcsundef{xatlevel@}% + {% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + }% + {% + \ifx\xatlevel@\@empty + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + \else + \savecounters@ + \advance\c@equation by 1\relax + \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% + \ifcsundef{theH\@gls@counter}% + {% + \def\@gls@Hcounter{\theglsentrycounter}% + }% + {% + \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}% + }% + \protected@edef\theHglsentrycounter{\@gls@Hcounter}% + \restorecounters@ + \fi + }% + }% + {% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + }% + \ifx\@gls@Hcounter\@empty + \ifcsundef{theH\@gls@counter}% + {% + \def\theHglsentrycounter{\theglsentrycounter}% + }% + {% + \protected@edef\theHglsentrycounter{\expandafter\noexpand + \csname theH\@gls@counter\endcsname}% + }% + \fi +} +\def\@set@glo@numformat#1#2#3#4{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[#4]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname + }% + \@gls@checkmkidxchars#1% +} +\def\@glo@check@mkidxrangechar#1#2\@nil{% +\if#1(\relax + \def\@glo@prefix{(}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi +\else + \if#1)\relax + \def\@glo@prefix{)}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi + \else + \def\@glo@prefix{}\def\@glo@suffix{#1#2}% + \fi +\fi} +\newcommand*{\@gls@escbsdq}[1]{% + \def\@gls@checkedmkidx{}% + \let\gls@xdystring=#1\relax + \@onelevel@sanitize\gls@xdystring + \edef\do@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null}% + \do@gls@xdycheckbackslash + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \@for\@gls@tmp:=\gls@protected@pagefmts\do + {% + \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% + \@onelevel@sanitize\@gls@sanitized@tmp + \edef\gls@dosubst{% + \noexpand\DTLsubstituteall\noexpand\gls@xdystring + {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% + }% + \gls@dosubst + }% + \let#1=\gls@xdystring +} +\newcommand{\@gls@checkmkidxchars}[1]{% + \ifglsxindy + \@gls@escbsdq{#1}% + \else + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkquote#1\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescquote#1\@nil\"\"\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescactual#1\@nil\?\?\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkactual#1\@nil??\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkbar#1\@nil||\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescbar#1\@nil\|\|\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checklevel#1\@nil!!\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkesclevel#1\@nil\!\!\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \edef\@do@gls@checkesc{% + \noexpand\@gls@checkesc\expandonce{#1}\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null + }% + \@do@gls@checkesc + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \fi +} +\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} +\newtoks\@gls@tmpb +\def\@gls@checkquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}% + \def\@@gls@checkquote{\@gls@checkquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkquote{\@gls@checkquote#2""\null}% + \else + \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}% + \fi + \fi + \@@gls@checkquote +} +\def\@gls@checkescquote#1\"#2\"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar + \@gls@quotechar\string\"\@gls@quotechar}% + \def\@@gls@checkescquote{\@gls@checkescquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}% + \else + \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}% + \fi + \fi +\@@gls@checkescquote +} +\def\@gls@checkescactual#1\?#2\?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar + \@gls@quotechar\string\"\@gls@actualchar}% + \def\@@gls@checkescactual{\@gls@checkescactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}% + \else + \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}% + \fi + \fi +\@@gls@checkescactual +} +\def\@gls@checkescbar#1\|#2\|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar + \@gls@quotechar\string\"\@gls@encapchar}% + \def\@@gls@checkescbar{\@gls@checkescbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}% + \else + \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}% + \fi + \fi +\@@gls@checkescbar +} +\def\@gls@checkesclevel#1\!#2\!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkesclevel{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar + \@gls@quotechar\string\"\@gls@levelchar}% + \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}% + \else + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}% + \fi + \fi +\@@gls@checkesclevel +} +\def\@gls@checkbar#1|#2|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}% + \def\@@gls@checkbar{\@gls@checkbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkbar{\@gls@checkbar#2||\null}% + \else + \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}% + \fi + \fi + \@@gls@checkbar +} +\def\@gls@checklevel#1!#2!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checklevel{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}% + \def\@@gls@checklevel{\@gls@checklevel#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checklevel{\@gls@checklevel#2!!\null}% + \else + \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}% + \fi + \fi + \@@gls@checklevel +} +\def\@gls@checkactual#1?#2?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}% + \def\@@gls@checkactual{\@gls@checkactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkactual{\@gls@checkactual#2??\null}% + \else + \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}% + \fi + \fi + \@@gls@checkactual +} +\bgroup +\catcode`\|0\relax +\catcode`\\12\relax +|gdef|@gls@checkesc#1\#2\#3|null{% + |@gls@tmpb=|expandafter{|@gls@checkedmkidx}% + |toks@={#1}% + |ifx|null#2|null + |ifx|null#3|null + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@}% + |def|@@gls@checkesc{|relax}% + |else + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@ + |@gls@quotechar|@backslashchar|@gls@quotechar|@backslashchar}% + |def|@@gls@checkesc{|@gls@checkesc#3|null}% + |fi + |else + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@ + |@gls@quotechar|@backslashchar}% + |ifx|null#3|null + |def|@@gls@checkesc{|@gls@checkesc#2\\|null}% + |else + |def|@@gls@checkesc{|@gls@checkesc#2\#3|null}% + |fi + |fi + |@@gls@checkesc +} +|egroup +\def\@gls@xdycheckquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@xdycheckquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"\string\"}% + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"}% + \ifx\null#3\null + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}% + \else + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}% + \fi + \fi + \@@gls@xdycheckquote +} +\edef\def@gls@xdycheckbackslash{% + \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar + ##2\@backslashchar##3\noexpand\null{% + \noexpand\@gls@tmpb=\noexpand\expandafter + {\noexpand\@gls@checkedmkidx}% + \noexpand\toks@={##1}% + \noexpand\ifx\noexpand\null##2\noexpand\null + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}% + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar\@backslashchar\@backslashchar}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##3\noexpand\null}% + \noexpand\fi + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar}% + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + \@backslashchar\noexpand\null}% + \noexpand\else + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + ##3\noexpand\null}% + \noexpand\fi + \noexpand\fi + \noexpand\@@gls@xdycheckbackslash + }% +} +\def@gls@xdycheckbackslash + +\newlength\gls@tmplen +\newcommand*{\glsdohypertarget}[2]{% + \@glsshowtarget{#1}% + \settoheight{\gls@tmplen}{#2}% + \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% +} +\newcommand*{\glsdohyperlink}[2]{% + \@glsshowtarget{#1}% + \hyperlink{#1}{#2}% +} +\newcommand*{\glsdonohyperlink}[2]{#2} +\ifcsundef{hyperlink}% +{% + \let\@glslink\glsdonohyperlink +}% +{% + \let\@glslink\glsdohyperlink +} +\ifcsundef{hypertarget}% +{% + \let\@glstarget\@secondoftwo +}% +{% + \let\@glstarget\glsdohypertarget +} +\newcommand{\glsdisablehyper}{% + \KV@glslink@hyperfalse + \let\@glslink\glsdonohyperlink + \let\@glstarget\@secondoftwo +} +\newcommand{\glsenablehyper}{% + \KV@glslink@hypertrue + \let\@glslink\glsdohyperlink + \let\@glstarget\glsdohypertarget +} +\providecommand{\@firstofthree}[3]{#1} +\providecommand{\@secondofthree}[3]{#2} +\newrobustcmd*{\gls}{\@gls@hyp@opt\@gls} +\newcommand*{\@gls}[2][]{% + \new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}% +} +\def\@gls@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\Gls}{\@gls@hyp@opt\@Gls} +\newcommand*{\@Gls}[2][]{% + \new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}% +} +\def\@Gls@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\GLS}{\@gls@hyp@opt\@GLS} +\newcommand*{\@GLS}[2][]{% + \new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}% +} +\def\@GLS@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\glspl}{\@gls@hyp@opt\@glspl} +\newcommand*{\@glspl}[2][]{% + \new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}% +} +\def\@glspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\Glspl}{\@gls@hyp@opt\@Glspl} +\newcommand*{\@Glspl}[2][]{% + \new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}% +} +\def\@Glspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\GLSpl}{\@gls@hyp@opt\@GLSpl} +\newcommand*{\@GLSpl}[2][]{% + \new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}% +} +\def\@GLSpl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newrobustcmd*{\glsdisp}{\@gls@hyp@opt\@glsdisp} +\newcommand*{\@glsdisp}[3][]{% + \glsdoifexists{#2}{% + \let\do@gls@link@checkfirsthyper\@gls@link@checkfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \def\glscustomtext{#3}% + \def\glsinsert{}% + \def\@glo@text{\csname gls@\glstype @entryfmt\endcsname}% + \@gls@link[#1]{#2}{\@glo@text}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% + \glspostlinkhook +} +\newcommand*{\@gls@link@nocheckfirsthyper}{} +\newcommand{\@gls@field@link}[3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \@gls@link[#1]{#2}{#3}% + }% + \glspostlinkhook +} +\newrobustcmd*{\glstext}{\@gls@hyp@opt\@glstext} +\newcommand*{\@glstext}[2][]{% + \new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} +\def\@glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrytext{#2}#3}% +} +\newrobustcmd*{\GLStext}{\@gls@hyp@opt\@GLStext} +\newcommand*{\@GLStext}[2][]{% + \new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} +\def\@GLStext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrytext{#2}#3}}% +} +\newrobustcmd*{\Glstext}{\@gls@hyp@opt\@Glstext} +\newcommand*{\@Glstext}[2][]{% + \new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} +\def\@Glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrytext{#2}#3}% +} +\newrobustcmd*{\glsfirst}{\@gls@hyp@opt\@glsfirst} +\newcommand*{\@glsfirst}[2][]{% + \new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} +\def\@glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryfirst{#2}#3}% +} +\newrobustcmd*{\Glsfirst}{\@gls@hyp@opt\@Glsfirst} +\newcommand*{\@Glsfirst}[2][]{% + \new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} +\def\@Glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryfirst{#2}#3}% +} +\newrobustcmd*{\GLSfirst}{\@gls@hyp@opt\@GLSfirst} +\newcommand*{\@GLSfirst}[2][]{% + \new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} +\def\@GLSfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirst{#2}#3}}% +} +\newrobustcmd*{\glsplural}{\@gls@hyp@opt\@glsplural} +\newcommand*{\@glsplural}[2][]{% + \new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} +\def\@glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryplural{#2}#3}% +} +\newrobustcmd*{\Glsplural}{\@gls@hyp@opt\@Glsplural} +\newcommand*{\@Glsplural}[2][]{% + \new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} +\def\@Glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryplural{#2}#3}% +} +\newrobustcmd*{\GLSplural}{\@gls@hyp@opt\@GLSplural} +\newcommand*{\@GLSplural}[2][]{% + \new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} +\def\@GLSplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryplural{#2}#3}}% +} +\newrobustcmd*{\glsfirstplural}{\@gls@hyp@opt\@glsfirstplural} +\newcommand*{\@glsfirstplural}[2][]{% + \new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryfirstplural{#2}#3}% +} +\newrobustcmd*{\Glsfirstplural}{\@gls@hyp@opt\@Glsfirstplural} +\newcommand*{\@Glsfirstplural}[2][]{% + \new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} +\def\@Glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryfirstplural{#2}#3}% +} +\newrobustcmd*{\GLSfirstplural}{\@gls@hyp@opt\@GLSfirstplural} +\newcommand*{\@GLSfirstplural}[2][]{% + \new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} +\def\@GLSfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryfirstplural{#2}#3}}% +} +\newrobustcmd*{\glsname}{\@gls@hyp@opt\@glsname} +\newcommand*{\@glsname}[2][]{% + \new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} +\def\@glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryname{#2}#3}% +} +\newrobustcmd*{\Glsname}{\@gls@hyp@opt\@Glsname} +\newcommand*{\@Glsname}[2][]{% + \new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} +\def\@Glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryname{#2}#3}% +} +\newrobustcmd*{\GLSname}{\@gls@hyp@opt\@GLSname} +\newcommand*{\@GLSname}[2][]{% + \new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} +\def\@GLSname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryname{#2}#3}}% +} +\newrobustcmd*{\glsdesc}{\@gls@hyp@opt\@glsdesc} +\newcommand*{\@glsdesc}[2][]{% + \new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} +\def\@glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrydesc{#2}#3}% +} +\newrobustcmd*{\Glsdesc}{\@gls@hyp@opt\@Glsdesc} +\newcommand*{\@Glsdesc}[2][]{% + \new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} +\def\@Glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrydesc{#2}#3}% +} +\newrobustcmd*{\GLSdesc}{\@gls@hyp@opt\@GLSdesc} +\newcommand*{\@GLSdesc}[2][]{% + \new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} +\def\@GLSdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydesc{#2}#3}}% +} +\newrobustcmd*{\glsdescplural}{\@gls@hyp@opt\@glsdescplural} +\newcommand*{\@glsdescplural}[2][]{% + \new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}} +\def\@glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrydescplural{#2}#3}% +} +\newrobustcmd*{\Glsdescplural}{\@gls@hyp@opt\@Glsdescplural} +\newcommand*{\@Glsdescplural}[2][]{% + \new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}} +\def\@Glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrydescplural{#2}#3}% +} +\newrobustcmd*{\GLSdescplural}{\@gls@hyp@opt\@GLSdescplural} +\newcommand*{\@GLSdescplural}[2][]{% + \new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}} +\def\@GLSdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrydescplural{#2}#3}}% +} +\newrobustcmd*{\glssymbol}{\@gls@hyp@opt\@glssymbol} +\newcommand*{\@glssymbol}[2][]{% + \new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} +\def\@glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrysymbol{#2}#3}% +} +\newrobustcmd*{\Glssymbol}{\@gls@hyp@opt\@Glssymbol} +\newcommand*{\@Glssymbol}[2][]{% + \new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} +\def\@Glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrysymbol{#2}#3}% +} +\newrobustcmd*{\GLSsymbol}{\@gls@hyp@opt\@GLSsymbol} +\newcommand*{\@GLSsymbol}[2][]{% + \new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} +\def\@GLSsymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbol{#2}#3}}% +} +\newrobustcmd*{\glssymbolplural}{\@gls@hyp@opt\@glssymbolplural} +\newcommand*{\@glssymbolplural}[2][]{% + \new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}} +\def\@glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentrysymbolplural{#2}#3}% +} +\newrobustcmd*{\Glssymbolplural}{\@gls@hyp@opt\@Glssymbolplural} +\newcommand*{\@Glssymbolplural}[2][]{% + \new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}} +\def\@Glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentrysymbolplural{#2}#3}% +} +\newrobustcmd*{\GLSsymbolplural}{\@gls@hyp@opt\@GLSsymbolplural} +\newcommand*{\@GLSsymbolplural}[2][]{% + \new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}} +\def\@GLSsymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}#3}}% +} +\newrobustcmd*{\glsuseri}{\@gls@hyp@opt\@glsuseri} +\newcommand*{\@glsuseri}[2][]{% + \new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}} +\def\@glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseri{#2}#3}% +} +\newrobustcmd*{\Glsuseri}{\@gls@hyp@opt\@Glsuseri} +\newcommand*{\@Glsuseri}[2][]{% + \new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}} +\def\@Glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseri{#2}#3}% +} +\newrobustcmd*{\GLSuseri}{\@gls@hyp@opt\@GLSuseri} +\newcommand*{\@GLSuseri}[2][]{% + \new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}} +\def\@GLSuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseri{#2}#3}}% +} +\newrobustcmd*{\glsuserii}{\@gls@hyp@opt\@glsuserii} +\newcommand*{\@glsuserii}[2][]{% + \new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}} +\def\@glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuserii{#2}#3}% +} +\newrobustcmd*{\Glsuserii}{\@gls@hyp@opt\@Glsuserii} +\newcommand*{\@Glsuserii}[2][]{% + \new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}} +\def\@Glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuserii{#2}#3}% +} +\newrobustcmd*{\GLSuserii}{\@gls@hyp@opt\@GLSuserii} +\newcommand*{\@GLSuserii}[2][]{% + \new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}} +\def\@GLSuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserii{#2}#3}}% +} +\newrobustcmd*{\glsuseriii}{\@gls@hyp@opt\@glsuseriii} +\newcommand*{\@glsuseriii}[2][]{% + \new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}} +\def\@glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseriii{#2}#3}% +} +\newrobustcmd*{\Glsuseriii}{\@gls@hyp@opt\@Glsuseriii} +\newcommand*{\@Glsuseriii}[2][]{% + \new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}} +\def\@Glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseriii{#2}#3}% +} +\newrobustcmd*{\GLSuseriii}{\@gls@hyp@opt\@GLSuseriii} +\newcommand*{\@GLSuseriii}[2][]{% + \new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}} +\def\@GLSuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriii{#2}#3}}% +} +\newrobustcmd*{\glsuseriv}{\@gls@hyp@opt\@glsuseriv} +\newcommand*{\@glsuseriv}[2][]{% + \new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}} +\def\@glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuseriv{#2}#3}% +} +\newrobustcmd*{\Glsuseriv}{\@gls@hyp@opt\@Glsuseriv} +\newcommand*{\@Glsuseriv}[2][]{% + \new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}} +\def\@Glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuseriv{#2}#3}% +} +\newrobustcmd*{\GLSuseriv}{\@gls@hyp@opt\@GLSuseriv} +\newcommand*{\@GLSuseriv}[2][]{% + \new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}} +\def\@GLSuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuseriv{#2}#3}}% +} +\newrobustcmd*{\glsuserv}{\@gls@hyp@opt\@glsuserv} +\newcommand*{\@glsuserv}[2][]{% + \new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}} +\def\@glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuserv{#2}#3}% +} +\newrobustcmd*{\Glsuserv}{\@gls@hyp@opt\@Glsuserv} +\newcommand*{\@Glsuserv}[2][]{% +\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}} +\def\@Glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuserv{#2}#3}% +} +\newrobustcmd*{\GLSuserv}{\@gls@hyp@opt\@GLSuserv} +\newcommand*{\@GLSuserv}[2][]{% +\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}} +\def\@GLSuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuserv{#2}#3}}% +} +\newrobustcmd*{\glsuservi}{\@gls@hyp@opt\@glsuservi} +\newcommand*{\@glsuservi}[2][]{% + \new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}} +\def\@glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsentryuservi{#2}#3}% +} +\newrobustcmd*{\Glsuservi}{\@gls@hyp@opt\@Glsuservi} +\newcommand*{\@Glsuservi}[2][]{% + \new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}} +\def\@Glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\Glsentryuservi{#2}#3}% +} +\newrobustcmd*{\GLSuservi}{\@gls@hyp@opt\@GLSuservi} +\newcommand*{\@GLSuservi}[2][]{% + \new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}} +\def\@GLSuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\mfirstucMakeUppercase{\glsentryuservi{#2}#3}}% +} +\newrobustcmd*{\acrshort}{\@gls@hyp@opt\ns@acrshort} +\newcommand*{\ns@acrshort}[2][]{% + \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}% +} +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshort{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\Acrshort}{\@gls@hyp@opt\ns@Acrshort} +\newcommand*{\ns@Acrshort}[2][]{% + \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}% +} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshort{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\ACRshort}{\@gls@hyp@opt\ns@ACRshort} +\newcommand*{\ns@ACRshort}[2][]{% + \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}% +} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshort{#2}}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\acrshortpl}{\@gls@hyp@opt\ns@acrshortpl} +\newcommand*{\ns@acrshortpl}[2][]{% + \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}% +} +\def\@acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshortpl{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\Acrshortpl}{\@gls@hyp@opt\ns@Acrshortpl} +\newcommand*{\ns@Acrshortpl}[2][]{% + \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}% +} +\def\@Acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshortpl{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\ACRshortpl}{\@gls@hyp@opt\ns@ACRshortpl} +\newcommand*{\ns@ACRshortpl}[2][]{% + \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}% +} +\def\@ACRshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{#2}}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\acrlong}{\@gls@hyp@opt\ns@acrlong} +\newcommand*{\ns@acrlong}[2][]{% + \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}% +} +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsentrylong{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\Acrlong}{\@gls@hyp@opt\ns@Acrlong} +\newcommand*{\ns@Acrlong}[2][]{% + \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}% +} +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \Glsentrylong{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\ACRlong}{\@gls@hyp@opt\ns@ACRlong} +\newcommand*{\ns@ACRlong}[2][]{% + \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}% +} +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\glsentrylong{#2}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\acrlongpl}{\@gls@hyp@opt\ns@acrlongpl} +\newcommand*{\ns@acrlongpl}[2][]{% + \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}% +} +\def\@acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsentrylongpl{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\Acrlongpl}{\@gls@hyp@opt\ns@Acrlongpl} +\newcommand*{\ns@Acrlongpl}[2][]{% + \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}% +} +\def\@Acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \Glsentrylongpl{#2}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newrobustcmd*{\ACRlongpl}{\@gls@hyp@opt\ns@ACRlongpl} +\newcommand*{\ns@ACRlongpl}[2][]{% + \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}% +} +\def\@ACRlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\glsentrylongpl{#2}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\newcommand*{\@gls@entry@field}[2]{% + \csname glo@\glsdetoklabel{#1}@#2\endcsname +} +\newcommand*{\glsletentryfield}[3]{% + \letcs{#1}{glo@\glsdetoklabel{#2}@#3}% +} +\newcommand*{\@Gls@entry@field}[2]{% + \glsdoifexistsordo{#1}% + {% + \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% + \ifdef\@glo@text + {% + \xmakefirstuc{\@glo@text}% + }% + {% + ??\PackageError{glossaries}{The field `#2' doesn't exist for glossary + entry `\glsdetoklabel{#1}'}{Check you have correctly spelt the entry + label and the field name}% + }% + }% + {% + ??% + }% +} +\newcommand*{\glsentryname}[1]{\@gls@entry@field{#1}{name}} +\newrobustcmd*{\Glsentryname}[1]{% + \@Gls@entryname{#1}% +} +\newcommand*{\@Gls@entryname}[1]{% + \@Gls@entry@field{#1}{name}% +} +\newcommand*{\@Gls@acrentryname}[1]{% + \ifglshaslong{#1}% + {% + \letcs\@glo@text{glo@\glsdetoklabel{#1}@name}% + \expandafter\@gls@getbody\@glo@text{}\@nil + \expandafter\ifx\@gls@body\glsentrylong\relax + \expandafter\Glsentrylong\@gls@rest + \else + \expandafter\ifx\@gls@body\glsentryshort\relax + \expandafter\Glsentryshort\@gls@rest + \else + \expandafter\ifx\@gls@body\acronymfont\relax + {% + \let\glsentryshort\Glsentryshort + \@glo@text + }% + \else + \expandafter\ifx\@gls@body\glsshortaccessdisplay\relax + {% + \let\glsentryshort\Glsentryshort + \@glo@text + }% + \else + \xmakefirstuc{\@glo@text}% + \fi + \fi + \fi + \fi + }% + {% + \@Gls@entry@field{#1}{name}% + }% +} +\newcommand*{\glsentrydesc}[1]{\@gls@entry@field{#1}{desc}} +\newrobustcmd*{\Glsentrydesc}[1]{% + \@Gls@entry@field{#1}{desc}% +} +\newcommand*{\glsentrydescplural}[1]{% + \@gls@entry@field{#1}{descplural}% +} +\newrobustcmd*{\Glsentrydescplural}[1]{% + \@Gls@entry@field{#1}{descplural}% +} +\newcommand*{\glsentrytext}[1]{\@gls@entry@field{#1}{text}} +\newrobustcmd*{\Glsentrytext}[1]{% + \@Gls@entry@field{#1}{text}% +} +\newcommand*{\glsentryplural}[1]{% + \@gls@entry@field{#1}{plural}% +} +\newrobustcmd*{\Glsentryplural}[1]{% + \@Gls@entry@field{#1}{plural}% +} +\newcommand*{\glsentrysymbol}[1]{% + \@gls@entry@field{#1}{symbol}% +} +\newrobustcmd*{\Glsentrysymbol}[1]{% + \@Gls@entry@field{#1}{symbol}% +} +\newcommand*{\glsentrysymbolplural}[1]{% + \@gls@entry@field{#1}{symbolplural}% +} +\newrobustcmd*{\Glsentrysymbolplural}[1]{% + \@Gls@entry@field{#1}{symbolplural}% +} +\newcommand*{\glsentryfirst}[1]{% + \@gls@entry@field{#1}{first}% +} +\newrobustcmd*{\Glsentryfirst}[1]{% + \@Gls@entry@field{#1}{first}% +} +\newcommand*{\glsentryfirstplural}[1]{% + \@gls@entry@field{#1}{firstpl}% +} +\newrobustcmd*{\Glsentryfirstplural}[1]{% + \@Gls@entry@field{#1}{firstpl}% +} +\newcommand{\glscapitalisewords}[1]{% + \capitalisewords{#1}% +} +\newrobustcmd*{\@glsentrytitlecase}[2]{% + \glsdoifexists{#1}% + {% + \glsfieldfetch{#1}{#2}{\@gls@value}% + \expandafter\glscapitalisewords\expandafter{\@gls@value}% + }% +} +\ifdef\texorpdfstring +{ + \newcommand*{\glsentrytitlecase}[2]{% + \texorpdfstring + {\@glsentrytitlecase{#1}{#2}}% + {\@gls@entry@field{#1}{#2}}% + } +} +{ + \newcommand*{\glsentrytitlecase}[2]{\@glsentrytitlecase{#1}{#2}} +} +\newcommand*{\glsentrytype}[1]{\@gls@entry@field{#1}{type}} +\newcommand*{\glsentrysort}[1]{% + \@gls@entry@field{#1}{sort}% +} +\newcommand*{\glsentryparent}[1]{% + \@gls@entry@field{#1}{parent}% +} +\newcommand*{\glsentryuseri}[1]{% + \@gls@entry@field{#1}{useri}% +} +\newrobustcmd*{\Glsentryuseri}[1]{% + \@Gls@entry@field{#1}{useri}% +} +\newcommand*{\glsentryuserii}[1]{% + \@gls@entry@field{#1}{userii}% +} +\newrobustcmd*{\Glsentryuserii}[1]{% + \@Gls@entry@field{#1}{userii}% +} +\newcommand*{\glsentryuseriii}[1]{% + \@gls@entry@field{#1}{useriii}% +} +\newrobustcmd*{\Glsentryuseriii}[1]{% + \@Gls@entry@field{#1}{useriii}% +} +\newcommand*{\glsentryuseriv}[1]{% + \@gls@entry@field{#1}{useriv}% +} +\newrobustcmd*{\Glsentryuseriv}[1]{% + \@Gls@entry@field{#1}{useriv}% +} +\newcommand*{\glsentryuserv}[1]{% + \@gls@entry@field{#1}{userv}% +} +\newrobustcmd*{\Glsentryuserv}[1]{% + \@Gls@entry@field{#1}{userv}% +} +\newcommand*{\glsentryuservi}[1]{% + \@gls@entry@field{#1}{uservi}% +} +\newrobustcmd*{\Glsentryuservi}[1]{% + \@Gls@entry@field{#1}{uservi}% +} +\newcommand*{\glsentryshort}[1]{\@gls@entry@field{#1}{short}} +\newrobustcmd*{\Glsentryshort}[1]{% + \@Gls@entry@field{#1}{short}% +} +\newcommand*{\glsentryshortpl}[1]{\@gls@entry@field{#1}{shortpl}} +\newrobustcmd*{\Glsentryshortpl}[1]{% + \@Gls@entry@field{#1}{shortpl}% +} +\newcommand*{\glsentrylong}[1]{\@gls@entry@field{#1}{long}} +\newrobustcmd*{\Glsentrylong}[1]{% + \@Gls@entry@field{#1}{long}% +} +\newcommand*{\glsentrylongpl}[1]{\@gls@entry@field{#1}{longpl}} +\newrobustcmd*{\Glsentrylongpl}[1]{% + \@Gls@entry@field{#1}{longpl}% +} +\newcommand*{\glsentryfull}[1]{% + \acrfullformat{\glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% +} +\newrobustcmd*{\Glsentryfull}[1]{% + \acrfullformat{\Glsentrylong{#1}}{\acronymfont{\glsentryshort{#1}}}% +} +\newcommand*{\glsentryfullpl}[1]{% + \acrfullformat{\glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% +} +\newrobustcmd*{\Glsentryfullpl}[1]{% + \acrfullformat{\Glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% +} +\newcommand*{\glsentrynumberlist}[1]{% + \glsdoifexists{#1}% + {% + \@gls@entry@field{#1}{numberlist}% + }% +} +\@ifpackageloaded{hyperref} {% + \newcommand*{\glsdisplaynumberlist}[1]{% + \GlossariesWarning + {% + \string\glsdisplaynumberlist\space + doesn't work with hyperref.^^JUsing + \string\glsentrynumberlist\space instead% + }% + \glsentrynumberlist{#1}% + }% +}% +{% + \newcommand*{\glsdisplaynumberlist}[1]{% + \glsdoifexists{#1}% + {% + \bgroup + \protected@edef\@glo@label{\glsdetoklabel{#1}}% + \let\@org@glsnumberformat\glsnumberformat + \def\glsnumberformat##1{##1}% + \protected@edef\the@numberlist{% + \csname glo@\@glo@label @numberlist\endcsname}% + \def\@gls@numlist@sep{}% + \def\@gls@numlist@nextsep{}% + \def\@gls@numlist@lastsep{}% + \def\@gls@thislist{}% + \def\@gls@donext@def{}% + \renewcommand\do[1]{% + \protected@edef\@gls@thislist{% + \@gls@thislist + \noexpand\@gls@numlist@sep + ##1% + }% + \let\@gls@numlist@sep\@gls@numlist@nextsep + \def\@gls@numlist@nextsep{\glsnumlistsep}% + \@gls@donext@def + \def\@gls@donext@def{% + \def\@gls@numlist@lastsep{\glsnumlistlastsep}% + }% + }% + \expandafter \glsnumlistparser \expandafter{\the@numberlist}% + \let\@gls@numlist@sep\@gls@numlist@lastsep + \@gls@thislist + \egroup + }% + } +} +\newcommand*{\glsnumlistsep}{, } +\newcommand*{\glsnumlistlastsep}{ \& } +\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% + \def\@glo@label{#2}% + \@glslink{\glolinkprefix\glsdetoklabel{#2}}{#1}} +\define@key{glossadd}{counter}{\def\@gls@counter{#1}} +\define@key{glossadd}{format}{\def\@glsnumberformat{#1}} +\define@key{glossadd}{types}{\def\@glo@type{#1}} +\newrobustcmd*{\glsadd}[2][]{% + \@gls@adjustmode + \glsdoifexists{#2}% + {% + \def\@glsnumberformat{glsnumberformat}% + \protected@edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \setkeys{glossadd}{#1}% + \@gls@saveentrycounter + \@gls@setsort{#2}% + \@@do@wrglossary{#2}% + }% +} +\newcommand*{\@gls@adjustmode}{} +\AtBeginDocument{\renewcommand*{\@gls@adjustmode}{\ifvmode\mbox{}\fi}} +\newrobustcmd*{\glsaddall}[1][]{% + \protected@edef\@glo@type{\@glo@types}% + \setkeys{glossadd}{#1}% + \forallglsentries[\@glo@type]{\@glo@entry}{% + \glsadd[#1]{\@glo@entry}% + }% +} +\newrobustcmd*{\glsaddallunused}[1][\@glo@types]{% + \forallglsentries[#1]{\@glo@entry}% + {% + \ifglsused{\@glo@entry}{}{\glsadd[format=glsignore]{\@glo@entry}}% + }% +} +\newcommand*{\glsignore}[1]{} +\edef\glsopenbrace{\expandafter\@gobble\string\{} +\edef\glsclosebrace{\expandafter\@gobble\string\}} +\edef\glsbackslash{\expandafter\@gobble\string\\} +\edef\glsquote#1{\string"#1\string"} +\edef\glspercentchar{\expandafter\@gobble\string\%} +\edef\glstildechar{\string~} +\ifglsxindy + \newcommand*{\@glsfirstletter}{A} +\fi +\newcommand*{\GlsSetXdyFirstLetterAfterDigits}{% + \@ifstar\s@GlsSetXdyFirstLetterAfterDigits\@GlsSetXdyFirstLetterAfterDigits} +\ifglsxindy + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}% + \@onelevel@sanitize\@glsfirstletter + } +\else + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% + \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}{% + \@GlsSetXdyFirstLetterAfterDigits + } +\fi +\ifglsxindy + \newcommand*{\@xdynumbergrouporder}{:before \string"\@glsfirstletter\string"} +\fi +\newcommand*{\GlsSetXdyNumberGroupOrder}[1]{% + \@ifstar\s@GlsSetXdyNumberGroupOrder\@GlsSetXdyNumberGroupOrder +} +\ifglsxindy + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + } + \newcommand*{\s@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + \@onelevel@sanitize\@xdynumbergrouporder + } +\else + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \glsnoxindywarning\GlsSetXdyNumberGroupOrder} + \newcommand*{\s@GlsSetXdyNumberGroupOrder}{% + \@GlsSetXdyNumberGroupOrder} +\fi +\newcommand*{\@glsminrange}{2} +\ifglsxindy + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \renewcommand*{\@glsminrange}{#1}} +\else + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \glsnoxindywarning\GlsSetXdyMinRangeLength} +\fi + +\ifglsxindy + \def\writeist{% + \ifundef{\glswrite}{\newwrite\glswrite}{}% + \@gls@addpredefinedattributes + \openout\glswrite=\istfilename + \write\glswrite{;; xindy style file created by the glossaries + package}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi + }% + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% + \write\glswrite{^^J; location class definitions^^J}% + \@for\@gls@classI:=\@gls@xdy@locationlist\do{% + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classI\string"^^J\space\space\space + ( + :sep "{}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% + {% + \@for\@gls@classII:=\@gls@xdy@locationlist\do{% + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classII-\@gls@classI\string" + ^^J\space\space\space + ( + :sep "{" + \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space + :sep "}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% + }% + }% + }% + \write\glswrite{^^J; user defined location classes}% + \write\glswrite{\@xdyuserlocationdefs}% + \write\glswrite{^^J; define cross-reference class^^J}% + \write\glswrite{(define-crossref-class \string"see\string" + :unverified )}% + \write\glswrite{(markup-crossref-list + :class \string"see\string"^^J\space\space\space + :open \string"\string\glsseeformat\string" + :close \string"{}\string")}% + \@xdycrossrefhook + \write\glswrite{^^J; define the order of the location classes}% + \write\glswrite{(define-location-class-order + (\@xdylocationclassorder))}% + \write\glswrite{^^J; define the glossary markup^^J}% + \write\glswrite{(markup-index^^J\space\space\space + :open \string"\string + \glossarysection[\string\glossarytoctitle]{\string + \glossarytitle}\string\glossarypreamble}% + \@for\@this@ctr:=\@xdycounters\do{% + {% + \@for\@this@attr:=\@xdyattributelist\do{% + \protected@write\glswrite{}{\string\providecommand*% + \expandafter\string + \csname glsX\@this@ctr X\@this@attr\endcsname[2]% + {% + \string\setentrycounter + [\expandafter\@gobble\string\#1]{\@this@ctr}% + \expandafter\string + \csname\@this@attr\endcsname + {\expandafter\@gobble\string\#2}% + }% + }% + }% + }% + }% + \write\glswrite{% + \string\begin + {theglossary}\string\glossaryheader\glstildechar n\string" ^^J\space + \space\space:close \string"\glspercentchar\glstildechar n\string + \end{theglossary}\string\glossarypostamble + \glstildechar n\string" ^^J\space\space\space + :tree)}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\glstildechar n\string")}% + \write\glswrite{(markup-indexentry + :open \string"\string\relax \string\glsresetentrylist + \glstildechar n\string")}% + \write\glswrite{(markup-locclass-list :open + \string"\glsopenbrace\string\glossaryentrynumbers + \glsopenbrace\string\relax\space \string"^^J\space\space\space + :sep \string", \string" + :close \string"\glsclosebrace\glsclosebrace\string")}% + \write\glswrite{(markup-locref-list + :sep \string"\string\delimN\space\string")}% + \write\glswrite{(markup-range + :sep \string"\string\delimR\space\string")}% + \@onelevel@sanitize\gls@suffixF + \@onelevel@sanitize\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixF" :length 1 :ignore-end)}% + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixFF" :length 2 :ignore-end)}% + \fi + \write\glswrite{^^J; define format to use for locations^^J}% + \write\glswrite{\@xdylocref}% + \write\glswrite{^^J; define letter group list format^^J}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\glstildechar n\string")}% + \write\glswrite{^^J; letter group headings^^J}% + \write\glswrite{(markup-letter-group + :open-head \string"\string\glsgroupheading + \glsopenbrace\string"^^J\space\space\space + :close-head \string"\glsclosebrace\string")}% + \write\glswrite{^^J; additional letter groups^^J}% + \write\glswrite{\@xdylettergroups}% + \write\glswrite{^^J; additional sort rules^^J} + \write\glswrite{\@xdysortrules}% + \@gls@writeisthook + \closeout\glswrite + \let\writeist\relax + } +\else + \edef\@gls@actualchar{\string?} + \edef\@gls@encapchar{\string|} + \edef\@gls@levelchar{\string!} + \edef\@gls@quotechar{\string"}% + \let\GlsSetQuote\gls@nosetquote + \def\writeist{\relax + \ifundef{\glswrite}{\newwrite\glswrite}{}\relax + \openout\glswrite=\istfilename + \write\glswrite{\glspercentchar\space makeindex style file + created by the glossaries package} + \write\glswrite{\glspercentchar\space for document + '\jobname' on \the\year-\the\month-\the\day} + \write\glswrite{actual '\@gls@actualchar'} + \write\glswrite{encap '\@gls@encapchar'} + \write\glswrite{level '\@gls@levelchar'} + \write\glswrite{quote '\@gls@quotechar'} + \write\glswrite{keyword \string"\string\\glossaryentry\string"} + \write\glswrite{preamble \string"\string\\glossarysection[\string + \\glossarytoctitle]{\string\\glossarytitle}\string + \\glossarypreamble\string\n\string\\begin{theglossary}\string + \\glossaryheader\string\n\string"} + \write\glswrite{postamble \string"\string\%\string\n\string + \\end{theglossary}\string\\glossarypostamble\string\n + \string"} + \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n + \string"} + \write\glswrite{item_0 \string"\string\%\string\n\string"} + \write\glswrite{item_1 \string"\string\%\string\n\string"} + \write\glswrite{item_2 \string"\string\%\string\n\string"} + \write\glswrite{item_01 \string"\string\%\string\n\string"} + \write\glswrite{item_x1 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{item_12 \string"\string\%\string\n\string"} + \write\glswrite{item_x2 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{delim_0 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_1 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_2 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_t \string"\string\}\string\}\string"} + \write\glswrite{delim_n \string"\string\\delimN \string"} + \write\glswrite{delim_r \string"\string\\delimR \string"} + \write\glswrite{headings_flag 1} + \write\glswrite{heading_prefix + \string"\string\\glsgroupheading\string\{\string"} + \write\glswrite{heading_suffix + \string"\string\}\string\\relax + \string\\glsresetentrylist \string"} + \write\glswrite{symhead_positive \string"glssymbols\string"} + \write\glswrite{numhead_positive \string"glsnumbers\string"} + \write\glswrite{page_compositor \string"\glscompositor\string"} + \@gls@escbsdq\gls@suffixF + \@gls@escbsdq\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + \fi + \@gls@writeisthook + \closeout\glswrite + \let\writeist\relax + } +\fi +\newcommand*{\GlsSetWriteIstHook}[1]{\renewcommand*{\@gls@writeisthook}{#1}} +\@onlypremakeg\GlsSetWriteIstHook +\newcommand*{\@gls@writeisthook}{} +\ifglsxindy + \newcommand*{\GlsSetQuote}[1]{\glsnomakeindexwarning\GlsSetQuote} + \newcommand*{\gls@nosetquote}[1]{\glsnomakeindexwarning\GlsSetQuote} +\else + \newcommand*{\GlsSetQuote}[1]{\edef\@gls@quotechar{\string#1}% + \@ifpackageloaded{tracklang}% + {% + \IfTrackedLanguage{german}% + {% + \def\@@gls@extramakeindexopts{-g}% + }% + {}% + }% + {}% + \edef\@gls@docheckquotedef{% + \noexpand\def\noexpand\@gls@checkquote####1#1####2#1####3\noexpand\null{% + \noexpand\@gls@tmpb=\noexpand\expandafter{\noexpand\@gls@checkedmkidx}% + \noexpand\toks@={####1}% + \noexpand\ifx\noexpand\null####2\noexpand\null + \noexpand\ifx\noexpand\null####3\noexpand\null + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% + \noexpand\def\noexpand\@@gls@checkquote{\noexpand\relax}% + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \noexpand\@gls@quotechar\noexpand\@gls@quotechar + \noexpand\@gls@quotechar\noexpand\@gls@quotechar}% + \noexpand\def\noexpand\@@gls@checkquote{% + \noexpand\@gls@checkquote####3\noexpand\null}% + \noexpand\fi + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \noexpand\@gls@quotechar\noexpand\@gls@quotechar}% + \noexpand\ifx\noexpand\null####3\noexpand\null + \noexpand\def\noexpand\@@gls@checkquote{% + \noexpand\@gls@checkquote####2#1#1\noexpand\null}% + \noexpand\else + \noexpand\def\noexpand\@@gls@checkquote{% + \noexpand\@gls@checkquote####2#1####3\noexpand\null}% + \noexpand\fi + \noexpand\fi + \noexpand\@@gls@checkquote + }% + }% + \@gls@docheckquotedef + \edef\@gls@docheckquotedef{% + \noexpand\renewcommand{\noexpand\@gls@checkmkidxchars}[1]{% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkquote####1\noexpand\@nil + #1#1\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkescquote####1\noexpand\@nil + \expandonce{\csname#1\endcsname}\expandonce{\csname#1\endcsname}% + \noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkescactual####1\noexpand\@nil + \noexpand\?\noexpand\?\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkactual####1\noexpand\@nil + \noexpand?\noexpand?\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkbar####1\noexpand\@nil + \noexpand|\noexpand|\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkescbar####1\noexpand\@nil + \noexpand\|\noexpand\|\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checklevel####1\noexpand\@nil + \noexpand!\noexpand!\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkesclevel####1\noexpand\@nil + \noexpand\!\noexpand\!\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkesc####1\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + }% + }% + \@gls@docheckquotedef + \edef\@gls@docheckquotedef{% + \noexpand\def\noexpand\@gls@checkescquote####1% + \expandonce{\csname#1\endcsname}####2\expandonce{\csname#1\endcsname}% + ####3\noexpand\null{% + \noexpand\@gls@tmpb=\noexpand\expandafter{\noexpand\@gls@checkedmkidx}% + \noexpand\toks@={####1}% + \noexpand\ifx\noexpand\null####2\noexpand\null + \noexpand\ifx\noexpand\null####3\noexpand\null + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% + \noexpand\def\noexpand\@@gls@checkescquote{\noexpand\relax}% + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \noexpand\@gls@quotechar\noexpand\string\expandonce{% + \csname#1\endcsname}\noexpand\@gls@quotechar + \noexpand\@gls@quotechar\noexpand\string\expandonce{% + \csname#1\endcsname}\noexpand\@gls@quotechar}% + \noexpand\def\noexpand\@@gls@checkescquote{% + \noexpand\@gls@checkescquote####3\noexpand\null}% + \noexpand\fi + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \noexpand\@gls@quotechar\noexpand\string + \expandonce{\csname#1\endcsname}\noexpand\@gls@quotechar}% + \noexpand\ifx\noexpand\null####3\noexpand\null + \noexpand\def\noexpand\@@gls@checkescquote{% + \noexpand\@gls@checkescquote####2\expandonce{\csname#1\endcsname}% + \expandonce{\csname#1\endcsname}\noexpand\null}% + \noexpand\else + \noexpand\def\noexpand\@@gls@checkescquote{% + \noexpand\@gls@checkescquote####2\expandonce{\csname#1\endcsname}% + ####3\noexpand\null}% + \noexpand\fi + \noexpand\fi + \noexpand\@@gls@checkescquote + }% + }% + \@gls@docheckquotedef + } + \newcommand*{\gls@nosetquote}[1]{\PackageError{glossaries}% + {\string\GlsSetQuote\space not permitted here}% + {Move \string\GlsSetQuote\space earlier in the preamble, as + soon as possible after glossaries.sty has been loaded}} +\fi +\newcommand*{\@gls@extramakeindexopts}[1]{} +\newcommand{\noist}{% + \@gls@addpredefinedattributes + \let\writeist\relax +} +\newcommand*{\@makeglossary}[1]{% + \ifglossaryexists{#1}% + {% + \ifglssavewrites + \expandafter\newtoks\csname glo@#1@filetok\endcsname + \else + \expandafter\newwrite\csname glo@#1@file\endcsname + \expandafter\@glsopenfile\csname glo@#1@file\endcsname{#1}% + \fi + \@gls@renewglossary + \writeist + }% + {% + \PackageError{glossaries}% + {Glossary type `#1' not defined}% + {New glossaries must be defined before using \string\makeglossaries}% + }% +} +\newcommand*{\@glsopenfile}[2]{% + \immediate\openout#1=\jobname.\csname @glotype@#2@out\endcsname + \PackageInfo{glossaries}{Writing glossary file + \jobname.\csname @glotype@#2@out\endcsname}% +} +\newcommand*{\@closegls}[1]{% + \closeout\csname glo@#1@file\endcsname +} +\ifglsxindy + \newcommand*{\@gls@automake}[1]{% + \ifglossaryexists{#1} + {% + \@closegls{#1}% + \ifdefstring{\glsorder}{letter}% + {\def\@gls@order{-M ord/letorder }}% + {\let\@gls@order\@empty}% + \ifcsundef{@xdy@#1@language}% + {\let\@gls@langmod\@xdy@main@language}% + {\letcs\@gls@langmod{@xdy@#1@language}}% + \edef\@gls@dothiswrite{\noexpand\write18{xindy + -I xindy + \@gls@order + -L \@gls@langmod\space + -M \gls@istfilebase\space + -C \gls@codepage\space + -t \jobname.\csuse{@glotype@#1@log} + -o \jobname.\csuse{@glotype@#1@in} + \jobname.\csuse{@glotype@#1@out}}% + }% + \@gls@dothiswrite + }% + {% + \GlossariesWarning{Can't make glossary `#1', it doesn't exist}% + }% + } +\else + \newcommand*{\@gls@automake}[1]{% + \ifglossaryexists{#1} + {% + \@closegls{#1}% + \ifdefstring{\glsorder}{letter}% + {\def\@gls@order{-l }}% + {\let\@gls@order\@empty}% + \edef\@gls@dothiswrite{\noexpand\write18{makeindex \@gls@order + -s \istfilename\space + -t \jobname.\csuse{@glotype@#1@log} + -o \jobname.\csuse{@glotype@#1@in} + \jobname.\csuse{@glotype@#1@out}}% + }% + \@gls@dothiswrite + }% + {% + \GlossariesWarning{Can't make glossary `#1', it doesn't exist}% + }% + } +\fi +\ifglsxindy + \newcommand*{\@gls@automake@immediate}[1]{% + \ifglossaryexists{#1} + {% + \IfFileExists{\jobname.\csuse{@glotype@#1@out}}% + {% + \ifdefstring{\glsorder}{letter}% + {\def\@gls@order{-M ord/letorder }}% + {\let\@gls@order\@empty}% + \ifcsundef{@xdy@#1@language}% + {\let\@gls@langmod\@xdy@main@language}% + {\letcs\@gls@langmod{@xdy@#1@language}}% + \edef\@gls@dothiswrite{\noexpand\immediate\noexpand\write18{xindy + -I xindy + \@gls@order + -L \@gls@langmod\space + -M \gls@istfilebase\space + -C \gls@codepage\space + -t \jobname.\csuse{@glotype@#1@log} + -o \jobname.\csuse{@glotype@#1@in} + \jobname.\csuse{@glotype@#1@out}}% + }% + \@gls@dothiswrite + }% + {\GlossariesWarning{can't automake `#1': \jobname.\csuse{@glotype@#1@out} + doesn't exist. Rerun may be required}}% + }% + {% + \GlossariesWarning{Can't make glossary `#1', it doesn't exist}% + }% + } +\else + \newcommand*{\@gls@automake@immediate}[1]{% + \ifglossaryexists{#1} + {% + \IfFileExists{\jobname.\csuse{@glotype@#1@out}}% + {% + \ifdefstring{\glsorder}{letter}% + {\def\@gls@order{-l }}% + {\let\@gls@order\@empty}% + \edef\@gls@dothiswrite{\noexpand\immediate\noexpand\write18{makeindex \@gls@order + -s \istfilename\space + -t \jobname.\csuse{@glotype@#1@log} + -o \jobname.\csuse{@glotype@#1@in} + \jobname.\csuse{@glotype@#1@out}}% + }% + \@gls@dothiswrite + }% + {\GlossariesWarning{can't automake `#1': \jobname.\csuse{@glotype@#1@out} + doesn't exist. Rerun may be required}}% + }% + {% + \GlossariesWarning{Can't make glossary `#1', it doesn't exist}% + }% + } +\fi +\newcommand*{\@warn@nomakeglossaries}{} +\newcommand*{\warn@nomakeglossaries}{\@warn@nomakeglossaries} +\newcommand{\@gls@@automake@immediate}{% + \ifnum\gls@automake@nr=2\relax + \@for\@gls@type:=\@glo@types\do{% + \ifdefempty{\@gls@type}{}% + {\@gls@automake@immediate{\@gls@type}}% + }% + \glsautomakefalse + \renewcommand*{\@gls@doautomake}{}% + \fi +} +\newcommand*{\makeglossaries}{% + \@domakeglossaries + {% + \@gls@@automake@immediate + \ifundef{\glswrite}{\newwrite\glswrite}{}% + \protected@write\@auxout{}{\string\providecommand\string\@glsorder[1]{}} + \protected@write\@auxout{}{\string\providecommand\string\@istfilename[1]{}} + \ifundef\@@gls@extramakeindexopts + {}% + {% + \protected@write\@auxout{}{\string\providecommand + \string\@gls@extramakeindexopts[1]{}} + \protected@write\@auxout{}{\string\@gls@extramakeindexopts + {\@@gls@extramakeindexopts}}% + }% + \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% + \protected@write\@auxout{}{\string\@glsorder{\glsorder}} + \@for\@glo@type:=\@glo@types\do{% + \ifthenelse{\equal{\@glo@type}{}}{}{% + \@makeglossary{\@glo@type}}% + }% + \renewcommand*\newglossary[4][]{% + \PackageError{glossaries}{New glossaries + must be created before \string\makeglossaries}{You need + to move \string\makeglossaries\space after all your + \string\newglossary\space commands}}% + \let\@makeglossary\@gobble + \let\makeglossaries\relax + \@disable@onlypremakeg + \let\gls@checkseeallowed\relax + \let\warn@nomakeglossaries\relax + \let\warn@noprintglossary\@makeglossaries@warn@noprintglossary + \ifglssavenumberlist + \edef\@gls@dodeflistparser{\noexpand\DeclareListParser + {\noexpand\glsnumlistparser}{\delimN}}% + \@gls@dodeflistparser + \fi + \let\makenoidxglossaries\@no@makeglossaries + \renewcommand*{\@printgloss@setsort}{% + \let\@glo@assign@sortkey\@glo@no@assign@sortkey + }% + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \@for\@gls@type:=\@glo@types\do{% + \ifdefempty{\@gls@type}{}% + {\@gls@automake{\@gls@type}}% + }% + }% + \fi + \@glo@check@sortallowed\makeglossaries + }% +} +\@onlypreamble{\makeglossaries} +\newcommand\@makeglossaries@warn@noprintglossary{% + \ifdefstring{\@glo@types}{,}% + {% + \GlossariesWarningNoLine{No glossaries have been defined}% + }% + {% + \GlossariesWarningNoLine{No \string\printglossary\space + or \string\printglossaries\space + found. ^^J(Remove \string\makeglossaries\space if you + don't want any glossaries.) ^^JThis document will not + have a glossary}% + }% +}% +\AtEndDocument{% + \warn@nomakeglossaries + \warn@noprintglossary +} +\newcommand*{\makenoidxglossaries}{% + \@domakeglossaries + {% + \renewcommand{\@gls@noref@warn}[1]{% + \GlossariesWarning{Empty glossary for + \string\printnoidxglossary[type={##1}]. + Rerun may be required (or you may have forgotten to use + commands like \string\gls)}% + }% + \let\@gls@checkmkidxchars\@gobble + \glsesclocationsfalse + \let\@@do@@wrglossary\gls@noidxglossary + \let\@gls@getgrouptitle\@gls@noidx@getgrouptitle + \let\gls@checkseeallowed\relax + \renewcommand{\@do@seeglossary}[2]{% + \protected@edef\@gls@label{\glsdetoklabel{##1}}% + \protected@write\@auxout{}{% + \string\@gls@reference + {\csname glo@\@gls@label @type\endcsname}% + {\@gls@label}% + {% + \string\glsseeformat##2{}% + }% + }% + }% + \AtBeginDocument + {% + \write\@auxout{\string\providecommand\string\@gls@reference[3]{}}% + }% + \def\warn@noprintglossary{% + \GlossariesWarningNoLine{No \string\printnoidxglossary\space + or \string\printnoidxglossaries ^^J + found. (Remove \string\makenoidxglossaries\space if you + don't want any glossaries.)^^JThis document will not have a glossary}% + }% + \let\warn@nomakeglossaries\relax + \let\makeglossaries\@no@makeglossaries + \renewcommand*{\@printgloss@setsort}{% + \let\@glo@assign@sortkey\@@glo@assign@sortkey + \def\@glo@sorttype{\@glo@default@sorttype}% + }% + \renewcommand*\new@glossaryentry[2]{% + \PackageError{glossaries}{Glossary entries must be + defined in the preamble^^Jwhen you use + \string\makenoidxglossaries}% + {Either move your definitions to the preamble or use + \string\makeglossaries}% + }% + \renewcommand*{\glsentrynumberlist}[1]{% + \letcs{\@gls@loclist}{glo@\glsdetoklabel{##1}@loclist}% + \ifdef\@gls@loclist + {% + \glsnoidxloclist{\@gls@loclist}% + }% + {% + ??\glsdoifexists{##1}% + {% + \GlossariesWarning{Missing location list for `##1'. Either + a rerun is required or you haven't referenced the entry}% + }% + }% + }% + \renewcommand*{\glsdisplaynumberlist}[1]{% + \letcs{\@gls@loclist}{glo@\glsdetoklabel{##1}@loclist}% + \ifdef\@gls@loclist + {% + \def\@gls@noidxloclist@sep{% + \def\@gls@noidxloclist@sep{% + \def\@gls@noidxloclist@sep{% + \glsnumlistsep + }% + \def\@gls@noidxloclist@finalsep{\glsnumlistlastsep}% + }% + }% + \def\@gls@noidxloclist@finalsep{}% + \def\@gls@noidxloclist@prev{}% + \forlistloop{\glsnoidxdisplayloclisthandler}{\@gls@loclist}% + \@gls@noidxloclist@finalsep + \@gls@noidxloclist@prev + }% + {% + ??\glsdoifexists{##1}% + {% + \GlossariesWarning{Missing location list for `##1'. Either + a rerun is required or you haven't referenced the entry}% + }% + }% + }% + \renewcommand*{\glsnumberlistloop}[3]{% + \letcs{\@gls@loclist}{glo@\glsdetoklabel{##1}@loclist}% + \let\@gls@org@glsnoidxdisplayloc\glsnoidxdisplayloc + \let\@gls@org@glsseeformat\glsseeformat + \let\glsnoidxdisplayloc##2\relax + \let\glsseeformat##3\relax + \ifdef\@gls@loclist + {% + \forlistloop{\glsnoidxnumberlistloophandler}{\@gls@loclist}% + }% + {% + ??\glsdoifexists{##1}% + {% + \GlossariesWarning{Missing location list for `##1'. Either + a rerun is required or you haven't referenced the entry}% + }% + }% + \let\glsnoidxdisplayloc\@gls@org@glsnoidxdisplayloc + \let\glsseeformat\@gls@org@glsseeformat + }% + \let\@@gls@sanitizesort\@gls@noidx@sanitizesort + \let\@@gls@nosanitizesort\@@gls@noidx@nosanitizesort + \@gls@noidx@setsanitizesort + \@glo@check@sortallowed\makenoidxglossaries + }% +} +\@onlypreamble{\makenoidxglossaries} +\newcommand*{\glsnumberlistloop}[2]{% + \PackageError{glossaries}{\string\glsnumberlistloop\space + only works with \string\makenoidxglossaries}{}% +} +\newcommand*{\glsnoidxnumberlistloophandler}[1]{% + #1% +} +\newcommand*{\@no@makeglossaries}{% + \PackageError{glossaries}{You can't use both + \string\makeglossaries\space and \string\makenoidxglossaries}% + {Either use one or other (or none) of those commands but not both + together.}% +} +\newcommand{\@gls@noref@warn}[1]{% + \GlossariesWarning{\string\makenoidxglossaries\space + is required to make \string\printnoidxglossary[type={#1}] work}% +} +\newcommand*{\gls@noidxglossary}{% + \protected@write\@auxout{}{% + \string\@gls@reference + {\csname glo@\@gls@label @type\endcsname}% + {\@gls@label}% + {\string\glsnoidxdisplayloc + {\@glo@counterprefix}% + {\@gls@counter}% + {\@glsnumberformat}% + {\@glslocref}% + }% + }% +} +\providecommand\istfile{\glswrite} +\AtEndDocument{% + \glswritefiles +} +\newcommand*{\@glswritefiles}{% + \forallglossaries{\@glo@type}{% + \ifcsundef{glo@\@glo@type @filetok}% + {% + \def\gls@tmp{}% + }% + {% + \edef\gls@tmp{\expandafter\the + \csname glo@\@glo@type @filetok\endcsname}% + }% + \ifx\gls@tmp\@empty + \ifx\@glo@type\glsdefaulttype + \GlossariesWarningNoLine{Glossary `\@glo@type' has no + entries.^^JRemember to use package option `nomain' if +you + don't want to^^Juse the main glossary}% + \else + \GlossariesWarningNoLine{Glossary `\@glo@type' has no + entries}% + \fi + \else + \@glsopenfile{\glswrite}{\@glo@type}% + \immediate\write\glswrite{% + \expandafter\the + \csname glo@\@glo@type @filetok\endcsname}% + \immediate\closeout\glswrite + \fi + }% +} +\newcommand*{\gls@glossary}[1]{% + \@gls@glossary{#1}% +} +\newcommand*{\@gls@glossary}[2]{% + \if@gls@debug + \PackageInfo{glossaries}{wrglossary(#1)(#2)}% + \fi +} +\newcommand{\@gls@renewglossary}{% + \gdef\@gls@glossary##1{\@bsphack\begingroup\gls@wrglossary{##1}}% + \let\@gls@renewglossary\@empty +} +\newcommand*{\gls@wrglossary}[2]{% + \ifglssavewrites + \protected@edef\@gls@tmp{\the\csname glo@#1@filetok\endcsname#2}% + \expandafter\global\expandafter\csname glo@#1@filetok\endcsname + \expandafter{\@gls@tmp^^J}% + \else + \ifcsdef{glo@#1@file}% + {% + \expandafter\protected@write\csname glo@#1@file\endcsname{% + \gls@disablepagerefexpansion}{#2}% + }% + {% + \ifignoredglossary{#1}{}% + {% + \GlossariesWarning{No file defined for glossary `#1'}% + }% + }% + \fi + \endgroup\@esphack +} +\newcommand*{\@do@wrglossary}[1]{% + \glswriteentry{#1}{\@@do@wrglossary{#1}}% +} +\newcommand*{\glswriteentry}[2]{% + \ifglsindexonlyfirst + \ifglsused{#1}{}{#2}% + \else + #2% + \fi +} +\newcommand{\gls@protected@pagefmts}{\gls@numberpage,\gls@alphpage,% + \gls@Alphpage,\gls@romanpage,\gls@Romanpage,\gls@arabicpage} +\newcommand*{\gls@disablepagerefexpansion}{% + \@for\@gls@this:=\gls@protected@pagefmts\do + {% + \expandafter\let\@gls@this\relax + }% +} +\newcommand*{\gls@alphpage}{\@alph\c@page} +\newcommand*{\gls@Alphpage}{\@Alph\c@page} +\newcommand*{\gls@numberpage}{\number\c@page} +\newcommand*{\gls@arabicpage}{\@arabic\c@page} +\newcommand*{\gls@romanpage}{\romannumeral\c@page} +\newcommand*{\gls@Romanpage}{\@Roman\c@page} +\newcommand*{\glsaddprotectedpagefmt}[1]{% + \protected@eappto\gls@protected@pagefmts{,\expandonce{\csname gls#1page\endcsname}}% + \csedef{gls#1page}{\expandonce{\csname#1\endcsname}\noexpand\c@page}% + \protected@eappto\@wrglossarynumberhook{% + \noexpand\let\expandonce{\csname org@gls#1\endcsname}% + \expandonce{\csname#1\endcsname}% + \noexpand\def\expandonce{\csname#1\endcsname}{% + \noexpand\@wrglossary@pageformat + \expandonce{\csname gls#1page\endcsname}% + \expandonce{\csname org@gls#1\endcsname}% + }% + }% +} +\newcommand*\@wrglossarynumberhook{} +\newcommand{\@wrglossary@pageformat}[3]{% + \ifx#3\c@page #1\else #2#3\fi +} +\newcommand*{\@@do@wrglossary}[1]{% + \ifglsesclocations + \@@do@esc@wrglossary{#1}% + \else + \@@do@noesc@wrglossary{#1}% + \fi +} +\newcommand*{\@@do@noesc@wrglossary}[1]{% + \expandafter\def\expandafter\@glslocref\expandafter{\theglsentrycounter}% + \expandafter\def\expandafter\@glsHlocref\expandafter{\theHglsentrycounter}% + \ifx\@glsHlocref\@glslocref + \def\@glo@counterprefix{}% + \else + \protected@edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\@glslocref}{\@glsHlocref}% + }% + \@do@gls@getcounterprefix + \fi + \protected@edef\@gls@label{\glsdetoklabel{#1}}% + \@@do@@wrglossary +} +\newif\ifglswrallowprimitivemods +\glswrallowprimitivemodstrue +\newcommand*{\@@do@esc@wrglossary}[1]{% please read documented code! + \begingroup + \let\gls@orgthe\the + \let\gls@orgnumber\number + \let\gls@orgarabic\@arabic + \let\gls@orgromannumeral\romannumeral + \let\gls@orgalph\@alph + \let\gls@orgAlph\@Alph + \let\gls@orgRoman\@Roman + \ifglswrallowprimitivemods + \def\gls@the##1{% + \ifx##1\c@page \gls@numberpage\else\gls@orgthe##1\fi}% + \def\the{\expandafter\gls@the}% + \def\gls@number##1{% + \ifx##1\c@page \gls@numberpage\else\gls@orgnumber##1\fi}% + \def\number{\expandafter\gls@number}% + \fi + \def\@arabic##1{% + \ifx##1\c@page \gls@arabicpage\else\gls@orgarabic##1\fi}% + \def\romannumeral##1{% + \ifx##1\c@page \gls@romanpage\else\gls@orgromannumeral##1\fi}% + \def\@Roman##1{% + \ifx##1\c@page \gls@Romanpage\else\gls@orgRoman##1\fi}% + \def\@alph##1{% + \ifx##1\c@page \gls@alphpage\else\gls@orgalph##1\fi}% + \def\@Alph##1{% + \ifx##1\c@page \gls@Alphpage\else\gls@orgAlph##1\fi}% + \@wrglossarynumberhook + \gls@disablepagerefexpansion + \protected@xdef\@glslocref{\theglsentrycounter}% + \endgroup + \@gls@checkmkidxchars\@glslocref + \expandafter\ifx\theHglsentrycounter\theglsentrycounter\relax + \def\@glo@counterprefix{}% + \else + \protected@edef\@glsHlocref{\theHglsentrycounter}% + \@gls@checkmkidxchars\@glsHlocref + \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\@glslocref}{\@glsHlocref}% + }% + \@do@gls@getcounterprefix + \fi + \protected@edef\@gls@label{\glsdetoklabel{#1}}% + \@@do@@wrglossary +} +\newcommand*{\@@do@@wrglossary}{% + \ifglsxindy + \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil + \def\@glo@range{}% + \expandafter\if\@glo@prefix(\relax + \def\@glo@range{:open-range}% + \else + \expandafter\if\@glo@prefix)\relax + \def\@glo@range{:close-range}% + \fi + \fi + \gls@glossary{\csname glo@\@gls@label @type\endcsname}{% + (indexentry :tkey (\csname glo@\@gls@label @index\endcsname) + :locref \string"{\@glo@counterprefix}{\@glslocref}\string" % + :attr \string"\@gls@counter\@glo@suffix\string" + \@glo@range + ) + }% + \else + \@set@glo@numformat{\@glo@numfmt}{\@gls@counter}{\@glsnumberformat}% + {\@glo@counterprefix}% + \gls@glossary{\csname glo@\@gls@label @type\endcsname}{% + \string\glossaryentry{\csname glo@\@gls@label @index\endcsname + \@gls@encapchar\@glo@numfmt}{\@glslocref}}% + \fi +} +\newcommand*\@gls@getcounterprefix[2]{% + \edef\@gls@thisloc{#1}\edef\@gls@thisHloc{#2}% + \ifx\@gls@thisloc\@gls@thisHloc + \def\@glo@counterprefix{}% + \else + \def\@gls@get@counterprefix##1.#1##2\end@getprefix{% + \def\@glo@tmp{##2}% + \ifx\@glo@tmp\@empty + \def\@glo@counterprefix{}% + \else + \def\@glo@counterprefix{##1}% + \fi + }% + \@gls@get@counterprefix#2.#1\end@getprefix + \ifx\@glo@counterprefix\@empty + \GlossariesWarning{Hyper target `#2' can't be formed by + prefixing^^Jlocation `#1'. You need to modify the + definition of \string\theH\@gls@counter^^Jotherwise you + will get the warning: "`name{\@gls@counter.#1}' has been^^J + referenced but does not exist"}% + \fi + \fi +} +\newcommand{\@do@seeglossary}[2]{% +\def\@gls@xref{#2}% +\@onelevel@sanitize\@gls@xref +\@gls@checkmkidxchars\@gls@xref +\ifglsxindy + \gls@glossary{\csname glo@#1@type\endcsname}{% + (indexentry + :tkey (\csname glo@#1@index\endcsname) + :xref (\string"\@gls@xref\string") + :attr \string"see\string" + ) + }% +\else + \gls@glossary{\csname glo@#1@type\endcsname}{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar glsseeformat\@gls@xref}{Z}}% +\fi +} +\def\@gls@fixbraces#1#2#3\@nil{% + \ifx#2[\relax + \@@gls@fixbraces#1#2#3\@end@fixbraces + \else + \def#1{{#2#3}}% + \fi +} +\def\@@gls@fixbraces#1[#2]#3\@end@fixbraces{% + \def#1{[#2]{#3}}% +} +\newrobustcmd*{\glssee}[3][\seename]{% + \@do@seeglossary{#2}{[#1]{#3}}} +\newcommand*{\@glssee}[3][\seename]{% + \glssee[#1]{#3}{#2}} +\newrobustcmd*{\glsseeformat}[3][\seename]{% + \emph{#1} \glsseelist{#2}} +\newrobustcmd*{\glsseelist}[1]{% + \let\@gls@dolast\relax + \let\@gls@donext\relax + \@for\@gls@thislabel:=#1\do{% + \ifx\@xfor@nextelement\@nnil + \@gls@dolast + \else + \@gls@donext + \fi + \expandafter\glsseeitem\expandafter{\@gls@thislabel}% + \let\@gls@dolast\glsseelastsep + \let\@gls@donext\glsseesep + }% +} +\newcommand*{\glsseelastsep}{\space\andname\space} +\newcommand*{\glsseesep}{, } +\newrobustcmd*{\glsseeitem}[1]{\glshyperlink[\glsseeitemformat{#1}]{#1}} +\newcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} +\newcommand*{\gls@save@numberlist}[1]{% + \ifglssavenumberlist + \toks@{#1}% + \protected@edef\@do@writeaux@info{% + \noexpand\csgdef{glo@\glscurrententrylabel @numberlist}{\the\toks@}% + }% + \@onelevel@sanitize\@do@writeaux@info + \protected@write\@auxout{}{\@do@writeaux@info}% + \fi +} +\newcommand*{\warn@noprintglossary}{}% +\ifcsundef{printglossary}{}% +{% + \@gls@warnonglossdefined + \undef\printglossary +} +\newcommand*{\@printgloss@checkexists@noignored}[2]{% + \@ifglossaryexists{#1}% + {#2}% + {% + \ifignoredglossary{#1}% + {\GlossariesWarning{Glossary `#1' is an ignored glossary}}% + {\GlossariesWarning{Glossary `#1' doesn't exist}}% + }% +} +\newcommand*{\@printgloss@checkexists@allowignored}[2]{% + \s@ifglossaryexists{#1}% + {#2}% + {\GlossariesWarning{Glossary `#1' doesn't exist}}% +} +\let\@printgloss@checkexists\@printgloss@checkexists@noignored +\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% + \let\@printgloss@checkexists\@printgloss@checkexists@noignored + \@printglossary{#1}{\@print@glossary}% +} +\newcommand*{\printglossaries}{% + \forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}% +} +\newcommand*{\printnoidxglossary}[1][type=\glsdefaulttype]{% + \let\@printgloss@checkexists\@printgloss@checkexists@noignored + \@printglossary{#1}{\@print@noidx@glossary}% +} +\newcommand*{\printnoidxglossaries}{% + \forallglossaries{\@@glo@type}{\printnoidxglossary[type=\@@glo@type]}% +} +\newcommand*{\@printgloss@setsort}{} +\newcommand*{\@gls@preglossaryhook}{} +\newcommand{\@printglossary}[2]{% + \def\@glo@type{\glsdefaulttype}% + \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% + \def\glossarytoctitle{\glossarytitle}% + \let\org@glossarytitle\glossarytitle + \def\@glossarystyle{% + \ifx\@glossary@default@style\relax + \GlossariesWarning{No default glossary style provided \MessageBreak + for the glossary `\@glo@type'. \MessageBreak + Using deprecated fallback. \MessageBreak + To fix this set the style with \MessageBreak + \string\setglossarystyle\space or use the \MessageBreak + style key=value option}% + \fi + }% + \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% + \let\@org@glossaryentrynumbers\glossaryentrynumbers + \bgroup + \@printgloss@setsort + \setkeys{printgloss}{#1}% + \@printgloss@checkexists{\@glo@type}% + {% + \ifx\glossarytitle\org@glossarytitle + \else + \expandafter\let\csname @glotype@\@glo@type @title\endcsname + \glossarytitle + \fi + \let\currentglossary\@glo@type + \let\org@glossaryentrynumbers\glossaryentrynumbers + \let\glsnonextpages\@glsnonextpages + \let\glsnextpages\@glsnextpages + \let\nopostdesc\@nopostdesc + \gls@dotoctitle + \@glossarystyle + \let\gls@org@glossaryentryfield\glossentry + \let\gls@org@glossarysubentryfield\subglossentry + \renewcommand{\glossentry}[1]{% + \protected@xdef\glscurrententrylabel{\glsdetoklabel{##1}}% + \gls@org@glossaryentryfield{##1}% + }% + \renewcommand{\subglossentry}[2]{% + \protected@xdef\glscurrententrylabel{\glsdetoklabel{##2}}% + \gls@org@glossarysubentryfield{##1}{##2}% + }% + \@gls@preglossaryhook + #2% + }% + \egroup + \global\let\glossaryentrynumbers\@org@glossaryentrynumbers + \global\let\warn@noprintglossary\relax +} +\newcommand{\@print@glossary}{% + \makeatletter + \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% + \IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}% + {}% + {\null}% + \ifglsxindy + \ifcsundef{@xdy@\@glo@type @language}% + {% + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@xdylanguage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}% + }% + }% + }% + {% + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@xdylanguage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type + @language\endcsname}}% + }% + }% + }% + \@do@auxoutstuff + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@gls@codepage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@gls@codepage{\@glo@type}{\gls@codepage}}% + }% + }% + \@do@auxoutstuff + \fi + \renewcommand*{\@warn@nomakeglossaries}{% + \GlossariesWarningNoLine{\string\makeglossaries\space + hasn't been used,^^Jthe glossaries will not be updated}% + }% +} +\newcommand*{\@glo@sortentries}[2]{% + \glosortentrieswarning + \def\@glo@sortinglist{}% + \def\@glo@sortinghandler{#1}% + \protected@edef\@glo@type{#2}% + \forlistcsloop{\@glo@do@sortentries}{@glsref@#2}% + \csdef{@glsref@#2}{}% + \@for\@this@label:=\@glo@sortinglist\do{% + \xifinlistcs{\@this@label}{@glsref@#2}% + {}% + {% + \listcsxadd{@glsref@#2}{\@this@label}% + }% + \ifcsdef{@glo@sortingchildren@\@this@label}% + {% + \@glo@addchildren{#2}{\@this@label}% + }% + {}% + }% +} +\newcommand*{\@glo@addchildren}[2]{% + \bgroup + \letcs{\@glo@childlist}{@glo@sortingchildren@#2}% + \@for\@this@childlabel:=\@glo@childlist\do + {% + \xifinlistcs{\@this@childlabel}{@glsref@#1}% + {}% + {% + \listcsxadd{@glsref@#1}{\@this@childlabel}% + }% + \ifcsdef{@glo@sortingchildren@\@this@childlabel}% + {% + \@glo@addchildren{#1}{\@this@childlabel}% + }% + {% + }% + }% + \egroup +} +\newcommand*{\@glo@do@sortentries}[1]{% + \ifglshasparent{#1}% + {% + \protected@edef\@glo@parent{\csuse{glo@\glsdetoklabel{#1}@parent}}% + \ifcsundef{@glo@sortingchildren@\@glo@parent}% + {% + \csdef{@glo@sortingchildren@\@glo@parent}{}% + }% + {}% + \expandafter\@glo@sortedinsert + \csname @glo@sortingchildren@\@glo@parent\endcsname{#1}% + \xifinlistcs{\@glo@parent}{@glsref@\@glo@type}% + {% + }% + {% + \expandafter\@glo@do@sortentries\expandafter{\@glo@parent}% + }% + }% + {% + \@glo@sortedinsert{\@glo@sortinglist}{#1}% + }% +} +\newcommand*{\@glo@sortedinsert}[2]{% + \dtl@insertinto{#2}{#1}{\@glo@sortinghandler}% +}% +\newcommand*{\@glo@sorthandler@word}[2]{% + \letcs\@gls@sort@A{glo@\glsdetoklabel{#1}@sort}% + \letcs\@gls@sort@B{glo@\glsdetoklabel{#2}@sort}% + \edef\glo@do@compare{% + \noexpand\dtlwordindexcompare{\noexpand\dtl@sortresult}% + {\expandonce\@gls@sort@B}% + {\expandonce\@gls@sort@A}% + }% + \glo@do@compare +} +\newcommand*{\@glo@sorthandler@letter}[2]{% + \letcs\@gls@sort@A{glo@\glsdetoklabel{#1}@sort}% + \letcs\@gls@sort@B{glo@\glsdetoklabel{#2}@sort}% + \edef\glo@do@compare{% + \noexpand\dtlletterindexcompare{\noexpand\dtl@sortresult}% + {\expandonce\@gls@sort@B}% + {\expandonce\@gls@sort@A}% + }% + \glo@do@compare +} +\newcommand*{\@glo@sorthandler@case}[2]{% + \letcs\@gls@sort@A{glo@\glsdetoklabel{#1}@sort}% + \letcs\@gls@sort@B{glo@\glsdetoklabel{#2}@sort}% + \edef\glo@do@compare{% + \noexpand\dtlcompare{\noexpand\dtl@sortresult}% + {\expandonce\@gls@sort@B}% + {\expandonce\@gls@sort@A}% + }% + \glo@do@compare +} +\newcommand*{\@glo@sorthandler@nocase}[2]{% + \letcs\@gls@sort@A{glo@\glsdetoklabel{#1}@sort}% + \letcs\@gls@sort@B{glo@\glsdetoklabel{#2}@sort}% + \edef\glo@do@compare{% + \noexpand\dtlicompare{\noexpand\dtl@sortresult}% + {\expandonce\@gls@sort@B}% + {\expandonce\@gls@sort@A}% + }% + \glo@do@compare +} +\newcommand*{\@glo@sortmacro@word}[1]{% + \ifdefstring{\@glo@default@sorttype}{standard}% + {% + \@glo@sortentries{\@glo@sorthandler@word}{#1}% + }% + {% + \PackageError{glossaries}{Conflicting sort options:^^J + \string\usepackage[sort=\@glo@default@sorttype]{glossaries}^^J + \string\printnoidxglossary[sort=word]}{}% + }% +} +\newcommand*{\@glo@sortmacro@letter}[1]{% + \ifdefstring{\@glo@default@sorttype}{standard}% + {% + \@glo@sortentries{\@glo@sorthandler@letter}{#1}% + }% + {% + \PackageError{glossaries}{Conflicting sort options:^^J + \string\usepackage[sort=\@glo@default@sorttype]{glossaries}^^J + \string\printnoidxglossary[sort=letter]}{}% + }% +} +\newcommand*{\@glo@sortmacro@standard}[1]{% + \ifdefstring{\@glo@default@sorttype}{standard}% + {% + \ifcsdef{@glo@sorthandler@\glsorder}% + {% + \@glo@sortentries{\csuse{@glo@sorthandler@\glsorder}}{#1}% + }% + {% + \PackageError{glossaries}{Unknown sort handler `\glsorder'}{}% + }% + }% + {% + \PackageError{glossaries}{Conflicting sort options:^^J + \string\usepackage[sort=\@glo@default@sorttype]{glossaries}^^J + \string\printnoidxglossary[sort=standard]}{}% + }% +} +\newcommand*{\@glo@sortmacro@case}[1]{% + \ifdefstring{\@glo@default@sorttype}{standard}% + {% + \@glo@sortentries{\@glo@sorthandler@case}{#1}% + }% + {% + \PackageError{glossaries}{Conflicting sort options:^^J + \string\usepackage[sort=\@glo@default@sorttype]{glossaries}^^J + \string\printnoidxglossary[sort=case]}{}% + }% +} +\newcommand*{\@glo@sortmacro@nocase}[1]{% + \ifdefstring{\@glo@default@sorttype}{standard}% + {% + \@glo@sortentries{\@glo@sorthandler@nocase}{#1}% + }% + {% + \PackageError{glossaries}{Conflicting sort options:^^J + \string\usepackage[sort=\@glo@default@sorttype]{glossaries}^^J + \string\printnoidxglossary[sort=nocase]}{}% + }% +} +\newcommand*{\@glo@sortmacro@def}[1]{% + \def\@glo@sortinglist{}% + \forglsentries[#1]{\@gls@thislabel}% + {% + \xifinlistcs{\@gls@thislabel}{@glsref@#1}% + {% + \listeadd{\@glo@sortinglist}{\@gls@thislabel}% + }% + {% + }% + }% + \cslet{@glsref@#1}{\@glo@sortinglist}% +} +\newcommand*{\@glo@sortmacro@def@do}[1]{% + \ifinlistcs{#1}{@glsref@\@glo@type}% + {}% + {% + \listcsadd{@glsref@\@glo@type}{#1}% + }% + \ifcsdef{@glo@sortingchildren@#1}% + {% + \@glo@addchildren{\@glo@type}{#1}% + }% + {}% +} +\newcommand*{\@glo@sortmacro@use}[1]{} +\newcommand*{\@print@noidx@glossary}{% + \ifcsdef{@glsref@\@glo@type}% + {% + \ifcsdef{@glo@sortmacro@\@glo@sorttype}% + {% + \csuse{@glo@sortmacro@\@glo@sorttype}{\@glo@type}% + }% + {% + \PackageError{glossaries}{Unknown sort handler `\@glo@sorttype'}{}% + }% + \glossarysection[\glossarytoctitle]{\glossarytitle}% + \glossarypreamble + \def\@gls@currentlettergroup{}% + \begin{theglossary}% + \glossaryheader + \glsresetentrylist + \forlistcsloop{\@gls@noidx@do}{@glsref@\@glo@type}% + \end{theglossary}% + \glossarypostamble + }% + {% + \@gls@noref@warn{\@glo@type}% + }% +} +\def\glo@grabfirst#1#2\@nil{% + \def\@gls@firsttok{#1}% + \ifdefempty\@gls@firsttok + {% + \def\@glo@thislettergrp{0}% + }% + {% + \@onelevel@sanitize\@gls@firsttok + \expandafter\@glo@grabfirst\@gls@firsttok{}{}\@nil + }% +} +\def\@glo@grabfirst#1#2\@nil{% + \ifdefempty\@glo@thislettergrp + {% + \def\@glo@thislettergrp{glssymbols}% + }% + {% + \count@=\uccode`#1\relax + \ifnum\count@=0\relax + \def\@glo@thislettergrp{glssymbols}% + \else + \ifdefstring\@glo@sorttype{case}% + {% + \count@=`#1\relax + }% + {% + }% + \edef\@glo@thislettergrp{\the\count@}% + \fi + }% +} +\newcommand{\@gls@noidx@do}[1]{% + \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% + \ifglshasparent{#1}% + {% + \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax + \ifdefvoid{\@gls@loclist} + {% + \subglossentry{\gls@level}{#1}{}% + }% + {% + \subglossentry{\gls@level}{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% + {% + \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% + \expandafter\glo@grabfirst\@gls@sort{}{}\@nil + \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% + {}% + {% + \ifdefempty{\@gls@currentlettergroup}{}% + {% + \global\let\@glo@thislettergrp\@glo@thislettergrp + \glsgroupskip + }% + \glsgroupheading{\@glo@thislettergrp}% + }% + \global\let\@gls@currentlettergroup\@glo@thislettergrp + \ifdefvoid{\@gls@loclist} + {% + \glossentry{#1}{}% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% +} +\newcommand*{\glsnoidxloclist}[1]{% + \def\@gls@noidxloclist@sep{}% + \def\@gls@noidxloclist@prev{}% + \forlistloop{\glsnoidxloclisthandler}{#1}% +} +\newcommand*{\glsnoidxloclisthandler}[1]{% + \ifdefstring{\@gls@noidxloclist@prev}{#1}% + {% + }% + {% + \@gls@noidxloclist@sep + #1% + \def\@gls@noidxloclist@sep{\delimN}% + \def\@gls@noidxloclist@prev{#1}% + }% +} +\newcommand*{\glsnoidxdisplayloclisthandler}[1]{% + \ifdefstring{\@gls@noidxloclist@prev}{#1}% + {% + }% + {% + \@gls@noidxloclist@sep + \@gls@noidxloclist@prev + \def\@gls@noidxloclist@prev{#1}% + }% +} +\newcommand*\glsnoidxdisplayloc[4]{% + \setentrycounter[#1]{#2}% + \csuse{#3}{#4}% +} +\newcommand*{\@gls@reference}[3]{% + \glsdoifexistsorwarn{#2}% + {% + \ifcsundef{@glsref@#1}{\csgdef{@glsref@#1}{}}{}% + \ifinlistcs{#2}{@glsref@#1}% + {}% + {\listcsgadd{@glsref@#1}{#2}}% + \ifcsundef{glo@\glsdetoklabel{#2}@loclist}% + {\csgdef{glo@\glsdetoklabel{#2}@loclist}{}}% + {}% + \listcsgadd{glo@\glsdetoklabel{#2}@loclist}{#3}% + }% +} +\define@key{printgloss}{type}{\def\@glo@type{#1}} +\define@key{printgloss}{title}{% + \def\glossarytitle{#1}% + \let\gls@dotoctitle\relax +} +\define@key{printgloss}{toctitle}{% + \def\glossarytoctitle{#1}% + \let\gls@dotoctitle\relax +} +\define@key{printgloss}{style}{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}% + {Glossary style `#1' undefined}{}% + }% + {% + \def\@glossarystyle{\setglossentrycompatibility + \csname @glsstyle@#1\endcsname}% + }% +} +\define@choicekey{printgloss}{numberedsection}% + [\gls@numberedsection@val\gls@numberedsection@nr]% + {false,nolabel,autolabel,nameref}[nolabel]% +{% + \ifcase\gls@numberedsection@nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% + \or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}% + \or + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{% + \protected@edef\@currentlabelname{\glossarytoctitle}% + \label{\glsautoprefix\@glo@type}}% + \fi +} +\define@choicekey{printgloss}{nogroupskip}{true,false}[true]{% + \csuse{glsnogroupskip#1}% +} +\define@choicekey{printgloss}{nopostdot}{true,false}[true]{% + \csuse{glsnopostdot#1}% +} +\newcommand*{\GlsEntryCounterLabelPrefix}{glsentry-} +\define@choicekey{printgloss}{entrycounter}{true,false}[true]{% + \csuse{glsentrycounter#1}% + \@gls@define@glossaryentrycounter +} +\define@choicekey{printgloss}{subentrycounter}{true,false}[true]{% + \csuse{glssubentrycounter#1}% + \@gls@define@glossarysubentrycounter +} +\define@boolkey{printgloss}[gls]{nonumberlist}[true]{% +\ifglsnonumberlist + \def\glossaryentrynumbers##1{}% +\else + \def\glossaryentrynumbers##1{##1}% +\fi} +\define@key{printgloss}{sort}{\@glo@assign@sortkey{#1}} +\newcommand*{\@glo@no@assign@sortkey}[1]{% + \PackageError{glossaries}{`sort' key not permitted with + \string\printglossary}% + {The `sort' key may only be used with \string\printnoidxglossary}% +} +\newcommand*{\@@glo@assign@sortkey}[1]{% + \def\@glo@sorttype{#1}% +} +\newcommand*{\@glsnonextpages}{% + \gdef\glossaryentrynumbers##1{% + \glsresetentrylist + }% +} +\newcommand*{\@glsnextpages}{% + \gdef\glossaryentrynumbers##1{% + ##1\glsresetentrylist}} +\newcommand*{\glsresetentrylist}{% + \global\let\glossaryentrynumbers\org@glossaryentrynumbers} +\newcommand*{\glsnonextpages}{} +\newcommand*{\glsnextpages}{} +\@gls@define@glossaryentrycounter +\@gls@define@glossarysubentrycounter +\newcommand*{\glsresetsubentrycounter}{% + \ifglssubentrycounter + \setcounter{glossarysubentry}{0}% + \fi +} +\newcommand*{\glsresetentrycounter}{% + \ifglsentrycounter + \setcounter{glossaryentry}{0}% + \fi +} +\newcommand*{\glsstepentry}[1]{% + \ifglsentrycounter + \refstepcounter{glossaryentry}% + \label{\GlsEntryCounterLabelPrefix\glsdetoklabel{#1}}% + \fi +} +\newcommand*{\glsstepsubentry}[1]{% + \ifglssubentrycounter + \protected@edef\currentglssubentry{\glsdetoklabel{#1}}% + \refstepcounter{glossarysubentry}% + \label{\GlsEntryCounterLabelPrefix\currentglssubentry}% + \fi +} +\newcommand*{\glsrefentry}[1]{% + \ifglsentrycounter + \ref{\GlsEntryCounterLabelPrefix\glsdetoklabel{#1}}% + \else + \ifglssubentrycounter + \ref{\GlsEntryCounterLabelPrefix\glsdetoklabel{#1}}% + \else + \gls{#1}% + \fi + \fi +} +\newcommand*{\glsentrycounterlabel}{% + \ifglsentrycounter + \theglossaryentry.\space + \fi +} +\newcommand*{\glssubentrycounterlabel}{% + \ifglssubentrycounter + \theglossarysubentry)\space + \fi +} +\newcommand*{\glsentryitem}[1]{% + \ifglsentrycounter + \glsstepentry{#1}\glsentrycounterlabel + \else + \glsresetsubentrycounter + \fi +} +\newcommand*{\glssubentryitem}[1]{% + \ifglssubentrycounter + \glsstepsubentry{#1}\glssubentrycounterlabel + \fi +} +\ifcsundef{theglossary}% +{% + \newenvironment{theglossary}{}{}% +}% +{% + \@gls@warnontheglossdefined + \renewenvironment{theglossary}{}{}% +} +\newcommand*{\glossaryheader}{} +\newcommand*{\glstarget}[2]{\@glstarget{\glolinkprefix#1}{#2}} +\providecommand*{\compatibleglossentry}[2]{% + \toks@{#2}% + \protected@edef\@do@glossentry{\noexpand\glossaryentryfield{#1}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#1@name\endcsname}}% + {\expandafter\expandonce\csname glo@#1@desc\endcsname}% + {\expandafter\expandonce\csname glo@#1@symbol\endcsname}% + {\the\toks@}% + }% + \@do@glossentry +} +\newcommand*{\glossentryname}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% + \expandafter\glsnamefont\expandafter{\glo@name}% + }% +} +\newcommand*{\Glossentryname}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glsnamefont{\Glsentryname{#1}}% + }% +} +\newcommand*{\glossentrydesc}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glsentrydesc{#1}% + }% +} +\newcommand*{\Glossentrydesc}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \Glsentrydesc{#1}% + }% +} +\newcommand*{\glossentrysymbol}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glsentrysymbol{#1}% + }% +} +\newcommand*{\Glossentrysymbol}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \Glsentrysymbol{#1}% + }% +} +\providecommand*{\compatiblesubglossentry}[3]{% + \toks@{#3}% + \protected@edef\@do@subglossentry{\noexpand\glossarysubentryfield{\number#1}% + {#2}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#2@name\endcsname}}% + {\expandafter\expandonce\csname glo@#2@desc\endcsname}% + {\expandafter\expandonce\csname glo@#2@symbol\endcsname}% + {\the\toks@}% + }% + \@do@subglossentry +} +\newcommand*{\setglossentrycompatibility}{% + \let\glossentry\compatibleglossentry + \let\subglossentry\compatiblesubglossentry +} +\setglossentrycompatibility +\newcommand{\glossaryentryfield}[5]{% + \GlossariesWarning + {Deprecated use of \string\glossaryentryfield.^^J + I recommend you change to \string\glossentry.^^J + If you've just upgraded, try removing your gls auxiliary + files^^J and recompile}% + \noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par} +\newcommand*{\glossarysubentryfield}[6]{% + \GlossariesWarning + {Deprecated use of \string\glossarysubentryfield.^^J + I recommend you change to \string\subglossentry.^^J + If you've just upgraded, try removing your gls auxiliary + files^^J and recompile}% + \glstarget{#2}{\strut}#4. #6\par} +\newcommand*{\glsgroupskip}{} +\newcommand*{\glsgroupheading}[1]{} +\newcommand*{\glsgetgrouptitle}[1]{% + \@gls@getgrouptitle{#1}{\@gls@grptitle}% + \@gls@grptitle +} +\newcommand*{\@gls@getgrouptitle}[2]{% + \dtl@ifsingle{#1}% + {% + \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% + }% + {% + \ifboolexpr{test{\ifstrequal{#1}{glssymbols}} + or test{\ifstrequal{#1}{glsnumbers}}}% + {% + \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% + }% + {% + \def#2{#1}% + }% + }% +} +\newcommand*{\@gls@noidx@getgrouptitle}[2]{% + \DTLifint{#1}% + {\edef#2{\char#1\relax}}% + {% + \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% + }% +} +\newcommand*{\glsgetgrouplabel}[1]{% +\ifthenelse{\equal{#1}{\glssymbolsgroupname}}{glssymbols}{% +\ifthenelse{\equal{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} +\newcommand*{\setentrycounter}[2][]{% + \def\@glo@counterprefix{#1}% + \ifx\@glo@counterprefix\@empty + \def\@glo@counterprefix{.}% + \else + \def\@glo@counterprefix{.#1.}% + \fi + \def\glsentrycounter{#2}% +} +\newcommand*{\setglossarystyle}[1]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' undefined}{}% + }% + {% + \csname @glsstyle@#1\endcsname + }% + \ifx\@glossary@default@style\relax + \protected@edef\@glossary@default@style{#1}% + \fi +} +\newcommand*{\glossarystyle}[1]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' undefined}{}% + }% + {% + \GlossariesWarning + {Deprecated command \string\glossarystyle.^^J + I recommend you switch to \string\setglossarystyle\space unless + you want to maintain backward compatibility}% + \setglossentrycompatibility + \csname @glsstyle@#1\endcsname + \ifcsdef{@glscompstyle@#1}% + {\setglossentrycompatibility\csuse{@glscompstyle@#1}}% + {}% + }% + \ifx\@glossary@default@style\relax + \protected@edef\@glossary@default@style{#1}% + \fi +} +\newcommand{\newglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \expandafter\def\csname @glsstyle@#1\endcsname{#2}% + }% + {% + \PackageError{glossaries}{Glossary style `#1' is already defined}{}% + }% +} +\newcommand{\renewglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' isn't already defined}{}% + }% + {% + \csdef{@glsstyle@#1}{#2}% + }% +} +\newcommand*{\glsnamefont}[1]{#1} +\ifcsundef{hyperlink}% +{% + \def\glshypernumber#1{#1}% +}% +{% + \def\glshypernumber#1{\@glshypernumber#1\nohyperpage{}\@nil} +} +\def\@glshypernumber#1\nohyperpage#2#3\@nil{% + \ifx\\#1\\% + \else + \@delimR#1\delimR\delimR\\% + \fi + \ifx\\#2\\% + \else + #2% + \fi + \ifx\\#3\\% + \else + \@glshypernumber#3\@nil + \fi +} +\def\@delimR#1\delimR #2\delimR #3\\{% +\ifx\\#2\\% + \@delimN{#1}% +\else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% +\fi} +\def\@delimN#1{\@@delimN#1\delimN \delimN\\} +\def\@@delimN#1\delimN #2\delimN#3\\{% +\ifx\\#3\\% + \@gls@numberlink{#1}% +\else + \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% +\fi +} +\def\@gls@numberlink#1{% +\begingroup + \toks@={}% + \@gls@removespaces#1 \@nil +\endgroup} +\def\@gls@removespaces#1 #2\@nil{% + \toks@=\expandafter{\the\toks@#1}% + \ifx\\#2\\% + \edef\@gls@x{\the\toks@}% + \ifx\@gls@x\empty + \else + \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}% + {\the\toks@}% + \fi + \else + \@gls@ReturnAfterFi{% + \@gls@removespaces#2\@nil + }% + \fi +} +\long\def\@gls@ReturnAfterFi#1\fi{\fi#1} +\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} +\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} +\newcommand{\oldacronym}[4][\gls@label]{% + \def\gls@label{#2}% + \newacronym[#4]{#1}{#2}{#3}% + \ifcsundef{xspace}% + {% + \expandafter\edef\csname#1\endcsname{% + \noexpand\@ifstar{\noexpand\Gls{#1}}{\noexpand\gls{#1}}% + }% + }% + {% + \expandafter\edef\csname#1\endcsname{% + \noexpand\@ifstar{\noexpand\Gls{#1}\noexpand\xspace}{% + \noexpand\gls{#1}\noexpand\xspace}% + }% + }% +} + \newcommand{\newacronym}[4][]{} +\newcommand*{\acrpluralsuffix}{\glsacrpluralsuffix} +\newrobustcmd*{\glstextup}[1]{\ifdef\textulc{\textulc{#1}}{\textup{#1}}} +\newcommand*{\glsshortkey}{short} +\newcommand*{\glsshortpluralkey}{shortplural} +\newcommand*{\glslongkey}{long} +\newcommand*{\glslongpluralkey}{longplural} +\newrobustcmd*{\acrfull}{\@gls@hyp@opt\ns@acrfull} +\newcommand*\ns@acrfull[2][]{% + \new@ifnextchar[{\@acrfull{#1}{#2}}% + {\@acrfull{#1}{#2}[]}% +} +\def\@acrfull#1#2[#3]{% + \acrfullfmt{#1}{#2}{#3}% +} +\newcommand*{\acrfullfmt}[3]{% + \acrlinkfullformat{\@acrlong}{\@acrshort}{#1}{#2}{#3}% +} +\newcommand{\acrlinkfullformat}[5]{% + \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}% +} +\newcommand{\acrfullformat}[2]{#1\glsspace(#2)} +\newrobustcmd{\glsspace}{\space} +\newrobustcmd*{\Acrfull}{\@gls@hyp@opt\ns@Acrfull} +\newcommand*\ns@Acrfull[2][]{% + \new@ifnextchar[{\@Acrfull{#1}{#2}}% + {\@Acrfull{#1}{#2}[]}% +} +\def\@Acrfull#1#2[#3]{% + \Acrfullfmt{#1}{#2}{#3}% +} +\newcommand*{\Acrfullfmt}[3]{% + \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}% +} +\newrobustcmd*{\ACRfull}{\@gls@hyp@opt\ns@ACRfull} +\newcommand*\ns@ACRfull[2][]{% + \new@ifnextchar[{\@ACRfull{#1}{#2}}% + {\@ACRfull{#1}{#2}[]}% +} +\def\@ACRfull#1#2[#3]{% + \ACRfullfmt{#1}{#2}{#3}% +} +\newcommand*{\ACRfullfmt}[3]{% + \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}% +} +\newrobustcmd*{\acrfullpl}{\@gls@hyp@opt\ns@acrfullpl} +\newcommand*\ns@acrfullpl[2][]{% + \new@ifnextchar[{\@acrfullpl{#1}{#2}}% + {\@acrfullpl{#1}{#2}[]}% +} +\def\@acrfullpl#1#2[#3]{% + \acrfullplfmt{#1}{#2}{#3}% +} +\newcommand*{\acrfullplfmt}[3]{% + \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% +} +\newrobustcmd*{\Acrfullpl}{\@gls@hyp@opt\ns@Acrfullpl} +\newcommand*\ns@Acrfullpl[2][]{% + \new@ifnextchar[{\@Acrfullpl{#1}{#2}}% + {\@Acrfullpl{#1}{#2}[]}% +} +\def\@Acrfullpl#1#2[#3]{% + \Acrfullplfmt{#1}{#2}{#3}% +} +\newcommand*{\Acrfullplfmt}[3]{% + \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% +} +\newrobustcmd*{\ACRfullpl}{\@gls@hyp@opt\ns@ACRfullpl} +\newcommand*\ns@ACRfullpl[2][]{% + \new@ifnextchar[{\@ACRfullpl{#1}{#2}}% + {\@ACRfullpl{#1}{#2}[]}% +} +\def\@ACRfullpl#1#2[#3]{% + \ACRfullplfmt{#1}{#2}{#3}% +} +\newcommand*{\ACRfullplfmt}[3]{% + \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}% +} +\newcommand{\acronymfont}[1]{#1} +\newcommand{\firstacronymfont}[1]{\acronymfont{#1}} +\newcommand*{\acrnameformat}[2]{\acronymfont{#1}} +\newtoks\glskeylisttok +\newtoks\glslabeltok +\newtoks\glsshorttok +\newtoks\glslongtok +\newcommand*{\newacronymhook}{} +\newcommand*{\SetGenericNewAcronym}{% + \let\@Gls@entryname\@Gls@acrentryname + \renewcommand{\newacronym}[4][]{% + \ifdefempty{\@glsacronymlists}% + {% + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + }% + {}% + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \protected@edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\expandonce{\acronymentry{##2}}},% + sort={\acronymsort{\the\glsshorttok}{\the\glslongtok}},% + text={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + \GenericAcronymFields,% + \the\glskeylisttok + }% + }% + \@do@newglossaryentry + }% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{\genacrfullformat{##2}{##3}}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{\Genacrfullformat{##2}{##3}}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\genacrfullformat{##2}{##3}}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{\genplacrfullformat{##2}{##3}}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{\Genplacrfullformat{##2}{##3}}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\genplacrfullformat{##2}{##3}}}}% + \renewcommand*{\glsentryfull}[1]{\genacrfullformat{##1}{}}% + \renewcommand*{\Glsentryfull}[1]{\Genacrfullformat{##1}{}}% + \renewcommand*{\glsentryfullpl}[1]{\genplacrfullformat{##1}{}}% + \renewcommand*{\Glsentryfullpl}[1]{\Genplacrfullformat{##1}{}}% +} +\newcommand*{\GenericAcronymFields}{description={\the\glslongtok}} +\newcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{#1}}} +\newcommand*{\acronymsort}[2]{#1} +\newcommand*{\setacronymstyle}[1]{% + \ifcsundef{@glsacr@dispstyle@#1} + {% + \PackageError{glossaries}{Undefined acronym style `#1'}{}% + }% + {% + \ifdefempty{\@glsacronymlists}% + {% + \DeclareAcronymList{\acronymtype}% + }% + {}% + \SetGenericNewAcronym + \GlsUseAcrStyleDefs{#1}% + \@for\@gls@type:=\@glsacronymlists\do{% + \defglsentryfmt[\@gls@type]{\GlsUseAcrEntryDispStyle{#1}}% + }% + }% +} +\newcommand*{\newacronymstyle}[3]{% + \ifcsdef{@glsacr@dispstyle@#1}% + {% + \PackageError{glossaries}{Acronym style `#1' already exists}{}% + }% + {% + \csdef{@glsacr@dispstyle@#1}{#2}% + \csdef{@glsacr@styledefs@#1}{#3}% + }% +} +\newcommand*{\renewacronymstyle}[3]{% + \ifcsdef{@glsacr@dispstyle@#1}% + {% + \csdef{@glsacr@dispstyle@#1}{#2}% + \csdef{@glsacr@styledefs@#1}{#3}% + }% + {% + \PackageError{glossaries}{Acronym style `#1' doesn't exist}{}% + }% +} +\newcommand*{\GlsUseAcrEntryDispStyle}[1]{\csuse{@glsacr@dispstyle@#1}} +\newcommand*{\GlsUseAcrStyleDefs}[1]{\csuse{@glsacr@styledefs@#1}} +\newacronymstyle{long-short}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glsentrylong{##1}##2\space + (\protect\firstacronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \Glsentrylong{##1}##2\space + (\protect\firstacronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsentrylongpl{##1}##2\space + (\protect\firstacronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \Glsentrylongpl{##1}##2\space + (\protect\firstacronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\newacronymstyle{long-sp-short}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glsentrylong{##1}##2\glsacspace{##1}% + (\protect\firstacronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \Glsentrylong{##1}##2\glsacspace{##1}% + (\protect\firstacronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsentrylongpl{##1}##2\glsacspace{##1}% + (\protect\firstacronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \Glsentrylongpl{##1}##2\glsacspace{##1}% + (\protect\firstacronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\newcommand*{\glsacspace}[1]{% + \settowidth{\dimen@}{(\firstacronymfont{\glsentryshort{#1}})}% + \ifdim\dimen@<3em~\else\space\fi +} +\newacronymstyle{short-long}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \protect\firstacronymfont{\glsentryshort{##1}}##2\space + (\glsentrylong{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \protect\firstacronymfont{\Glsentryshort{##1}}##2\space + (\glsentrylong{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \protect\firstacronymfont{\glsentryshortpl{##1}}##2\space + (\glsentrylongpl{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \protect\firstacronymfont{\Glsentryshortpl{##1}}##2\space + (\glsentrylongpl{##1})% + }% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\newacronymstyle{long-sc-short}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% +} +\newacronymstyle{long-sm-short}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% +} +\newacronymstyle{sc-short-long}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% +} +\newacronymstyle{sm-short-long}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% +} +\newacronymstyle{long-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{long-sp-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sp-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sp-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\glsacspace{##1}(\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{long-sc-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sc-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sc-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{long-sm-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sm-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sm-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{sc-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sc-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sc-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{sm-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sm-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sm-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{dua}% +{% + \ifdefempty\glscustomtext + {% + \ifglshaslong{\glslabel}% + {% + \glsifplural + {% + \glscapscase + {% + \glsentrylongpl{\glslabel}\glsinsert + }% + {% + \Glsentrylongpl{\glslabel}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\glsentrylongpl{\glslabel}\glsinsert}% + }% + }% + {% + \glscapscase + {% + \glsentrylong{\glslabel}\glsinsert + }% + {% + \Glsentrylong{\glslabel}\glsinsert + }% + {% + \mfirstucMakeUppercase + {\glsentrylong{\glslabel}\glsinsert}% + }% + }% + }% + {% + \glsgenentryfmt + }% + }% + {\glscustomtext\glsinsert}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{\glsentrylong{##2}##3\space + (\acronymfont{\glsentryshort{##2}})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{\Glsentrylong{##2}##3\space + (\acronymfont{\glsentryshort{##2}})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\glsentrylong{##2}##3\space + (\acronymfont{\glsentryshort{##2}})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{\glsentrylongpl{##2}##3\space + (\acronymfont{\glsentryshortpl{##2}})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{\Glsentrylongpl{##2}##3\space + (\acronymfont{\glsentryshortpl{##2}})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\glsentrylongpl{##2}##3\space + (\acronymfont{\glsentryshortpl{##2}})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glsentrylong{##1}\space(\acronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\Glsentryfull}[1]{% + \Glsentrylong{##1}\space(\acronymfont{\glsentryshort{##1}})% + }% + \renewcommand*{\glsentryfullpl}[1]{% + \glsentrylongpl{##1}\space(\acronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\Glsentryfullpl}[1]{% + \Glsentrylongpl{##1}\space(\acronymfont{\glsentryshortpl{##1}})% + }% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% +} +\newacronymstyle{dua-desc}% +{% + \GlsUseAcrEntryDispStyle{dua}% +}% +{% + \GlsUseAcrStyleDefs{dua}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentrylong{##1}}}% + \renewcommand*{\acronymsort}[2]{##2}% +}% +\newacronymstyle{footnote}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \glshyperfirstfalse + \renewcommand*{\genacrfullformat}[2]{% + \protect\firstacronymfont{\glsentryshort{##1}}##2% + \protect\footnote{\glsentrylong{##1}}% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \firstacronymfont{\Glsentryshort{##1}}##2% + \protect\footnote{\glsentrylong{##1}}% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \protect\firstacronymfont{\glsentryshortpl{##1}}##2% + \protect\footnote{\glsentrylongpl{##1}}% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \protect\firstacronymfont{\Glsentryshortpl{##1}}##2% + \protect\footnote{\glsentrylongpl{##1}}% + }% + \renewcommand*{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{\acronymfont{\glsentryshort{##2}}##3\space + (\glsentrylong{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{\acronymfont{\Glsentryshort{##2}}##3\space + (\glsentrylong{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshort{##2}}##3\space + (\glsentrylong{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{\acronymfont{\glsentryshortpl{##2}}##3\space + (\glsentrylongpl{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{\acronymfont{\Glsentryshortpl{##2}}##3\space + (\glsentrylongpl{##2})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{##2}}##3\space + (\glsentrylongpl{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \acronymfont{\glsentryshort{##1}}\space(\glsentrylong{##1})}% + \renewcommand*{\Glsentryfull}[1]{% + \acronymfont{\Glsentryshort{##1}}\space(\glsentrylong{##1})}% + \renewcommand*{\glsentryfullpl}[1]{% + \acronymfont{\glsentryshortpl{##1}}\space(\glsentrylongpl{##1})}% + \renewcommand*{\Glsentryfullpl}[1]{% + \acronymfont{\Glsentryshortpl{##1}}\space(\glsentrylongpl{##1})}% +} +\newacronymstyle{footnote-sc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}} + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% +}% +\newacronymstyle{footnote-sm}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{\acronymfont{\glsentryshort{##1}}} + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% +}% +\newacronymstyle{footnote-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{footnote-sc-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sc}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sc}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newacronymstyle{footnote-sm-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sm}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sm}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glsentrylong{##1}\space (\acronymfont{\glsentryshort{##1}})}% +} +\newcommand*{\DefineAcronymSynonyms}{% + \let\acs\acrshort + \let\Acs\Acrshort + \let\acsp\acrshortpl + \let\Acsp\Acrshortpl + \let\acl\acrlong + \let\aclp\acrlongpl + \let\Acl\Acrlong + \let\Aclp\Acrlongpl + \let\acf\acrfull + \let\acfp\acrfullpl + \let\Acf\Acrfull + \let\Acfp\Acrfullpl + \let\ac\gls + \let\Ac\Gls + \let\acp\glspl + \let\Acp\Glspl +} +\ifglsacrshortcuts + \DefineAcronymSynonyms +\fi +\newcommand*{\SetDefaultAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} +\newcommand*{\DefaultNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + firstplural={\acrfullformat{\noexpand\expandonce\noexpand\@glo@longpl}% + {\noexpand\expandonce\noexpand\@glo@shortpl}},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \@@gls@noexpand@assign@default@plurals +} +\newcommand*{\@@gls@noexpand@assign@default@plurals}{% + \expandafter\ifx\csname glo@\the\glslabeltok @plural\endcsname\@@gls@@default@acr@plural + \csxdef{glo@\the\glslabeltok @plural}{\expandonce\@glo@shortpl}% + \fi + \expandafter\ifx\csname glo@\the\glslabeltok @firstpl\endcsname\@@gls@@default@acr@firstplural + \csxdef{glo@\the\glslabeltok @firstpl}{% + \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)}% + \fi + \expandafter\ifx\csname glo@\the\glslabeltok @descplural\endcsname\@@gls@@default@acr@descplural + \csxdef{glo@\the\glslabeltok @descplural}{\expandonce\@glo@longpl}% + \fi +} +\newcommand*{\@@gls@@default@acr@plural}{\expandonce\@glo@shortpl} +\newcommand*{\@@gls@@default@acr@firstplural}{% + \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)% +} +\newcommand*{\@@gls@@default@acr@descplural}{\expandonce\@glo@longpl} +\newcommand*{\SetDefaultAcronymStyle}{% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDefaultAcronymDisplayStyle{\@gls@type}% + }% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDefaultAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DefaultNewAcronymDef + }% + \renewcommand*{\acrpluralsuffix}{\glsacrpluralsuffix}% +} +\newcommand*{\acrfootnote}[3]{\acrlinkfootnote{#1}{#2}{#3}} +\newcommand*{\acrlinkfootnote}[3]{% + \footnote{\glslink[#1]{#2}{#3}}% +} +\newcommand*{\acrnolinkfootnote}[3]{% + \footnote{#3}% +} +\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifdefempty\glscustomtext + {% + \ifglsused{\glslabel}% + {% + \acronymfont{\glsgenentryfmt}% + }% + {% + \firstacronymfont{\glsgenentryfmt}% + \ifglshassymbol{\glslabel}% + {% + \expandafter\protect\expandafter\acrfootnote\expandafter + {\@gls@link@opts}{\@gls@link@label}% + {% + \glsifplural + {\glsentrysymbolplural{\glslabel}}% + {\glsentrysymbol{\glslabel}}% + }% + }% + }% + }% + {\glscustomtext\glsinsert}% + }% +} +\newcommand*{\DescriptionFootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + first={\the\glsshorttok},% + firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\the\glslongtok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@longpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\newcommand*{\SetDescriptionFootnoteAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{footnote,smallcaps,description}% + {footnote-sc-desc}{short-sc-footnote-desc}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{footnote,smaller,description}% + {footnote-sm-desc}{short-sm-footnote-desc}% + \else + \@gls@deprecated@acr@warning{footnote,description}% + {footnote-desc}{short-footnote-desc}% + \fi + \fi + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionFootnoteNewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}% + }% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi +}% +\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} +\newcommand*{\DescriptionDUANewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glslongtok},% + sort={\the\glslongtok}, + text={\the\glslongtok},% + first={\the\glslongtok},% + plural={\noexpand\expandonce\noexpand\@glo@longpl},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\the\glsshorttok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\newcommand*{\SetDescriptionDUAAcronymStyle}{% + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \else + \ifglsacrsmaller + \PackageError{glossaries}{Option clash: `smaller' and `dua' + can't both be set}{}% + \fi + \fi + \@gls@deprecated@acr@warning{dua,description}{dua-desc}{long-noshort-desc}% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionDUANewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}% + }% +}% +\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifdefempty\glscustomtext + {% + \ifglsused{\glslabel}% + {% + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \glsgenentryfmt + \ifglshassymbol{\glslabel}% + {% + \glsifplural + {% + \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% + }% + {% + \def\@glo@symbol{\glsentrysymbol{\glslabel}}% + }% + \space(\protect\firstacronymfont + {\glscapscase + {\@glo@symbol} + {\@glo@symbol} + {\mfirstucMakeUppercase{\@glo@symbol}}})% + }% + {}% + }% + }% + {\glscustomtext\glsinsert}% + }% +} +\newcommand*{\DescriptionNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand + \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% + sort={\the\glsshorttok},% + first={\the\glslongtok},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\noexpand\@glo@text},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok}% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\newcommand*{\SetDescriptionAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{smallcaps,description}% + {long-sc-short-desc}{long-short-sc-desc}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{smaller,description}% + {long-sm-short-desc}{long-short-sm-desc}% + \else + \@gls@deprecated@acr@warning{description}% + {long-short-desc}{long-short-desc}% + \fi + \fi + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionNewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionAcronymDisplayStyle{\@gls@type}% + }% + \ifglsacrsmallcaps + \renewcommand{\acronymfont}[1]{\textsc{##1}} + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi +}% +\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifdefempty\glscustomtext + {% + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \ifglsused{\glslabel}% + {% + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \firstacronymfont{\glsgenentryfmt}\gls@org@insert + \ifglshaslong{\glslabel}% + {% + \expandafter\protect\expandafter\acrfootnote\expandafter + {\@gls@link@opts}{\@gls@link@label}% + {% + \glsifplural + {\glsentrylongpl{\glslabel}}% + {\glsentrylong{\glslabel}}% + }% + }% + {}% + }% + }% + {\glscustomtext\glsinsert}% + }% +} +\newcommand*{\FootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + first={\the\glsshorttok},% + firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@descplural\@org@gls@assign@descplural +} +\newcommand*{\SetFootnoteAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{footnote,smallcaps}{footnote-sc}{short-sc-footnote}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{footnote,smaller}{footnote-sm}{short-sm-footnote}% + \else + \@gls@deprecated@acr@warning{footnote}{footnote}{short-footnote}% + \fi + \fi + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetFootnoteAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \FootnoteNewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetFootnoteAcronymDisplayStyle{\@gls@type}% + }% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi +}% +\DeclareRobustCommand*{\glsdoparenifnotempty}[2]{% + \protected@edef\gls@tmp{#1}% + \ifdefempty\gls@tmp + {}% + {% + \ifx\gls@tmp\@gls@default@value + \else + \space (#2{#1})% + \fi + }% +} +\newcommand*{\SetSmallAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifdefempty\glscustomtext + {% + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \ifglsused{\glslabel}% + {% + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \glsgenentryfmt + \ifglshassymbol{\glslabel}% + {% + \glsifplural + {% + \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% + }% + {% + \def\@glo@symbol{\glsentrysymbol{\glslabel}}% + }% + \space + (\glscapscase + {\firstacronymfont{\@glo@symbol}}% + {\firstacronymfont{\@glo@symbol}}% + {\firstacronymfont{\mfirstucMakeUppercase{\@glo@symbol}}})% + }% + {}% + }% + }% + {\glscustomtext\glsinsert}% + }% +} +\newcommand*{\SmallNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + first={\the\glslongtok},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\noexpand\@glo@first},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + symbol={\the\glsshorttok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@descplural\@org@gls@assign@descplural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\newcommand*{\SetSmallAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{smallcaps}{long-sc-short}{long-short-sc}% + \else + \@gls@deprecated@acr@warning{smaller}{long-sm-short}{long-short-sm}% + \fi + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetSmallAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \SmallNewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetSmallAcronymDisplayStyle{\@gls@type}% + }% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}} + \renewcommand*{\acrpluralsuffix}{\glsupacrpluralsuffix}% + \else + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}} + \fi + \ifglsacrdua + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \else + \PackageError{glossaries}{Option clash: `smaller' and `dua' + can't both be set}{}% + \fi + \fi +}% +\newcommand*{\SetDUADisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} +\newcommand*{\DUANewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + text={\the\glslongtok},% + first={\the\glslongtok},% + plural={\noexpand\expandonce\noexpand\@glo@longpl},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + symbol={\the\glsshorttok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \let\gls@assign@descplural\@org@gls@assign@descplural +} +\newcommand*{\SetDUAStyle}{% + \@gls@deprecated@acr@warning{dua}{dua}{long-noshort}% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDUADisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DUANewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDUADisplayStyle{\@gls@type}% + }% +} +\newcommand*{\@gls@deprecated@acr@warning}[3]{% + \GlossariesWarning{Acronym style option #1 deprecated. + Use \string\setacronymstyle{#2} with just glossaries.sty or + use \string\setabbreviationstyle[acronym]{#3} with + glossaries-extra.sty}% +} +\newcommand*{\SetAcronymStyle}{% + \SetDefaultAcronymStyle + \ifglsacrdescription + \ifglsacrfootnote + \SetDescriptionFootnoteAcronymStyle + \else + \ifglsacrdua + \SetDescriptionDUAAcronymStyle + \else + \SetDescriptionAcronymStyle + \fi + \fi + \else + \ifglsacrfootnote + \SetFootnoteAcronymStyle + \else + \ifthenelse{\boolean{glsacrsmallcaps}\OR + \boolean{glsacrsmaller}}% + {% + \SetSmallAcronymStyle + }% + {% + \ifglsacrdua + \SetDUAStyle + \fi + }% + \fi + \fi +} +\SetAcronymStyle +\newcommand*{\SetCustomDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} +\newcommand*{\CustomAcronymFields}{% + name={\the\glsshorttok},% + description={\the\glslongtok},% + first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% + firstplural={\acrfullformat + {\noexpand\glsentrylongpl{\the\glslabeltok}}% + {\noexpand\glsentryshortpl{\the\glslabeltok}}},% + text={\the\glsshorttok},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix}% +} +\newcommand*{\CustomNewAcronymDef}{% + \protected@edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + user1={\the\glsshorttok},% + user2={\the\glsshorttok\noexpand\acrpluralsuffix},% + user3={\the\glslongtok},% + user4={\the\glslongtok\noexpand\acrpluralsuffix},% + \CustomAcronymFields,% + \the\glskeylisttok + }% + }% + \@do@newglossaryentry +} +\newcommand*{\SetCustomStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetCustomDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \CustomNewAcronymDef + }% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetCustomDisplayStyle{\@gls@type}% + }% +} +\RequirePackage{glossary-hypernav}[=v4.49] +\@gls@loadlist +\@gls@loadlong +\@gls@loadsuper +\@gls@loadtree +\ifx\@glossary@default@style\relax +\else + \setglossarystyle{\@glossary@default@style} +\fi +\newcommand*{\showgloparent}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@parent\endcsname +} +\newcommand*{\showglolevel}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@level\endcsname +} +\newcommand*{\showglotext}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@text\endcsname +} +\newcommand*{\showgloplural}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@plural\endcsname +} +\newcommand*{\showglofirst}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@first\endcsname +} +\newcommand*{\showglofirstpl}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstpl\endcsname +} +\newcommand*{\showglotype}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@type\endcsname +} +\newcommand*{\showglocounter}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@counter\endcsname +} +\newcommand*{\showglouseri}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@useri\endcsname +} +\newcommand*{\showglouserii}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@userii\endcsname +} +\newcommand*{\showglouseriii}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@useriii\endcsname +} +\newcommand*{\showglouseriv}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@useriv\endcsname +} +\newcommand*{\showglouserv}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@userv\endcsname +} +\newcommand*{\showglouservi}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@uservi\endcsname +} +\newcommand*{\showgloname}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@name\endcsname +} +\newcommand*{\showglodesc}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@desc\endcsname +} +\newcommand*{\showglodescplural}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descplural\endcsname +} +\newcommand*{\showglosort}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@sort\endcsname +} +\newcommand*{\showglosymbol}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbol\endcsname +} +\newcommand*{\showglosymbolplural}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolplural\endcsname +} +\newcommand*{\showgloshort}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@short\endcsname +} +\newcommand*{\showglolong}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@long\endcsname +} +\newcommand*{\showgloindex}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@index\endcsname +} +\newcommand*{\showgloflag}[1]{% + \expandafter\show\csname ifglo@\glsdetoklabel{#1}@flag\endcsname +} +\newcommand*{\showgloloclist}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@loclist\endcsname +} +\newcommand*{\showglofield}[2]{% + \csshow{glo@\glsdetoklabel{#1}@#2}% +} +\newcommand*{\showacronymlists}{% + \show\@glsacronymlists +} +\newcommand*{\showglossaries}{% + \show\@glo@types +} +\newcommand*{\showglossaryin}[1]{% + \expandafter\show\csname @glotype@#1@in\endcsname +} +\newcommand*{\showglossaryout}[1]{% + \expandafter\show\csname @glotype@#1@out\endcsname +} +\newcommand*{\showglossarytitle}[1]{% + \expandafter\show\csname @glotype@#1@title\endcsname +} +\newcommand*{\showglossarycounter}[1]{% + \expandafter\show\csname @glotype@#1@counter\endcsname +} +\newcommand*{\showglossaryentries}[1]{% + \expandafter\show\csname glolist@#1\endcsname +} +\csname ifglscompatible-2.07\endcsname + \RequirePackage{glossaries-compatible-207}[=v4.49] +\fi +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-accsupp-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossaries-accsupp-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-accsupp}[2021/11/01 v4.49 (NLCT) + Experimental glossaries accessibility] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\ProcessOptions +\@ifpackageloaded{glossaries-extra} +{% + \ifx\@glsxtr@doaccsupp\empty + \GlossariesWarning{The `glossaries-accsupp' + package has been loaded\MessageBreak + after the `glossaries-extra' package. This\MessageBreak + can cause a failure to integrate both packages. \MessageBreak + Either use the `accsupp' option when you load\MessageBreak + `glossaries-extra' or load `glossaries-accsupp'\MessageBreak + before loading `glossaries-extra'}% + \fi +} +{} +\def\compatibleglossentry#1#2{% + \toks@{#2}% + \protected@edef\@do@glossentry{% + \noexpand\accsuppglossaryentryfield{#1}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@name\endcsname}}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@desc\endcsname}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#1}@symbol\endcsname}% + {\the\toks@}% + }% + \@do@glossentry +} +\def\compatiblesubglossentry#1#2#3{% + \toks@{#3}% + \protected@edef\@do@subglossentry{% + \noexpand\accsuppglossarysubentryfield{\number#1}% + {#2}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@name\endcsname}}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@desc\endcsname}% + {\expandafter\expandonce\csname glo@\glsdetoklabel{#2}@symbol\endcsname}% + {\the\toks@}% + }% + \@do@subglossentry +} +\RequirePackage{glossaries}[=v4.49] +\providecommand{\gls@accsupp@engine}{accsupp} +\providecommand{\gls@accessibility}[4]{#4} +\ifdefstring\gls@accsupp@engine{accsupp} +{ + \RequirePackage{accsupp} + \renewcommand{\gls@accessibility}[4]{% + \BeginAccSupp{#1,#2={#3}}#4\EndAccSupp{}% + } +} +{} +\newcommand{\glsaccessibility}[4][]{% + \@glsshowaccsupp{#1}{#2}{#3}% + \gls@accessibility{#1}{#2}{#3}{#4}% +} +\define@key{glossentry}{access}{% + \def\@glo@access{#1}% +} +\define@key{glossentry}{textaccess}{% + \def\@glo@textaccess{#1}% +} +\define@key{glossentry}{firstaccess}{% + \def\@glo@firstaccess{#1}% +} +\define@key{glossentry}{pluralaccess}{% + \def\@glo@pluralaccess{#1}% +} +\define@key{glossentry}{firstpluralaccess}{% + \def\@glo@firstpluralaccess{#1}% +} +\define@key{glossentry}{symbolaccess}{% + \def\@glo@symbolaccess{#1}% +} +\define@key{glossentry}{symbolpluralaccess}{% + \def\@glo@symbolpluralaccess{#1}% +} +\define@key{glossentry}{descriptionaccess}{% + \def\@glo@descaccess{#1}% +} +\define@key{glossentry}{descriptionpluralaccess}{% + \def\@glo@descpluralaccess{#1}% +} +\define@key{glossentry}{shortaccess}{% + \def\@glo@shortaccess{#1}% +} +\define@key{glossentry}{shortpluralaccess}{% + \def\@glo@shortpluralaccess{#1}% +} +\define@key{glossentry}{longaccess}{% + \def\@glo@longaccess{#1}% +} +\define@key{glossentry}{longpluralaccess}{% + \def\@glo@longpluralaccess{#1}% +} +\define@key{glossentry}{user1access}{% + \def\@glo@useriaccess{#1}% +} +\define@key{glossentry}{user2access}{% + \def\@glo@useriiaccess{#1}% +} +\define@key{glossentry}{user3access}{% + \def\@glo@useriiiaccess{#1}% +} +\define@key{glossentry}{user4access}{% + \def\@glo@userivaccess{#1}% +} +\define@key{glossentry}{user5access}{% + \def\@glo@uservaccess{#1}% +} +\define@key{glossentry}{user6access}{% + \def\@glo@userviaccess{#1}% +} +\appto\@gls@keymap{,% + {access}{access},% + {textaccess}{textaccess},% + {firstaccess}{firstaccess},% + {pluralaccess}{pluralaccess},% + {firstpluralaccess}{firstpluralaccess},% + {symbolaccess}{symbolaccess},% + {symbolpluralaccess}{symbolpluralaccess},% + {descaccess}{descaccess},% + {descpluralaccess}{descpluralaccess},% + {shortaccess}{shortaccess},% + {shortpluralaccess}{shortpluralaccess},% + {longaccess}{longaccess},% + {longpluralaccess}{longpluralaccess},% + {user1access}{useriaccess},% + {user2access}{useriiaccess},% + {user3access}{useriiiaccess},% + {user4access}{userivaccess},% + {user5access}{uservaccess},% + {user6access}{userviaccess}% +} +\def\@gls@noaccess{\relax} +\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook +\renewcommand*{\@newglossaryentryprehook}{% + \@gls@oldnewglossaryentryprehook + \def\@glo@access{\relax}% + \def\@glo@textaccess{\@glo@access}% + \def\@glo@firstaccess{\@glo@access}% + \def\@glo@pluralaccess{\@glo@textaccess}% + \def\@glo@firstpluralaccess{\@glo@pluralaccess}% + \def\@glo@symbolaccess{\relax}% + \def\@glo@symbolpluralaccess{\@glo@symbolaccess}% + \def\@glo@descaccess{\relax}% + \def\@glo@descpluralaccess{\@glo@descaccess}% + \def\@glo@shortaccess{\relax}% + \def\@glo@shortpluralaccess{\@glo@shortaccess}% + \def\@glo@longaccess{\relax}% + \def\@glo@longpluralaccess{\@glo@longaccess}% + \def\@glo@useriaccess{\relax}% + \def\@glo@useriiaccess{\relax}% + \def\@glo@useriiiaccess{\relax}% + \def\@glo@userivaccess{\relax}% + \def\@glo@uservaccess{\relax}% + \def\@glo@userviaccess{\relax}% +} +\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook +\renewcommand*{\@newglossaryentryposthook}{% + \@gls@oldnewglossaryentryposthook + \expandafter + \protected@xdef\csname glo@\@glo@label @access\endcsname{% + \@glo@access}% + \expandafter + \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{% + \@glo@textaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{% + \@glo@firstaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{% + \@glo@pluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{% + \@glo@firstpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{% + \@glo@symbolaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{% + \@glo@symbolpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{% + \@glo@descaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{% + \@glo@descpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{% + \@glo@shortaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{% + \@glo@shortpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{% + \@glo@longaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{% + \@glo@longpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriaccess\endcsname{% + \@glo@useriaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiaccess\endcsname{% + \@glo@useriiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @useriiiaccess\endcsname{% + \@glo@useriiiaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userivaccess\endcsname{% + \@glo@userivaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @uservaccess\endcsname{% + \@glo@uservaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @userviaccess\endcsname{% + \@glo@userviaccess}% +} +\newcommand*{\glsentryaccess}[1]{% + \@gls@entry@field{#1}{access}% +} +\newcommand*{\glsentrytextaccess}[1]{% + \@gls@entry@field{#1}{textaccess}% +} +\newcommand*{\glsentryfirstaccess}[1]{% + \@gls@entry@field{#1}{firstaccess}% +} +\newcommand*{\glsentrypluralaccess}[1]{% + \@gls@entry@field{#1}{pluralaccess}% +} +\newcommand*{\glsentryfirstpluralaccess}[1]{% + \@gls@entry@field{#1}{firstpluralaccess}% +} +\newcommand*{\glsentrysymbolaccess}[1]{% + \@gls@entry@field{#1}{symbolaccess}% +} +\newcommand*{\glsentrysymbolpluralaccess}[1]{% + \@gls@entry@field{#1}{symbolpluralaccess}% +} +\newcommand*{\glsentrydescaccess}[1]{% + \@gls@entry@field{#1}{descaccess}% +} +\newcommand*{\glsentrydescpluralaccess}[1]{% + \@gls@entry@field{#1}{descpluralaccess}% +} +\newcommand*{\glsentryshortaccess}[1]{% + \@gls@entry@field{#1}{shortaccess}% +} +\newcommand*{\glsentryshortpluralaccess}[1]{% + \@gls@entry@field{#1}{shortpluralaccess}% +} +\newcommand*{\glsentrylongaccess}[1]{% + \@gls@entry@field{#1}{longaccess}% +} +\newcommand*{\glsentrylongpluralaccess}[1]{% + \@gls@entry@field{#1}{longpluralaccess}% +} +\newcommand*{\glsentryuseriaccess}[1]{% + \@gls@entry@field{#1}{useriaccess}% +} +\newcommand*{\glsentryuseriiaccess}[1]{% + \@gls@entry@field{#1}{useriiaccess}% +} +\newcommand*{\glsentryuseriiiaccess}[1]{% + \@gls@entry@field{#1}{useriiiaccess}% +} +\newcommand*{\glsentryuserivaccess}[1]{% + \@gls@entry@field{#1}{userivaccess}% +} +\newcommand*{\glsentryuservaccess}[1]{% + \@gls@entry@field{#1}{uservaccess}% +} +\newcommand*{\glsentryuserviaccess}[1]{% + \@gls@entry@field{#1}{userviaccess}% +} +\newcommand{\glsfieldaccsupp}[4]{% + \ifdef\glscategory + {% + \ifcsdef{glsxtr\glscategory{#4}#3accsupp}% + {\csname glsxtr\glscategory{#4}#3accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{glsxtr\glscategory{#4}accsupp}% + {\csname glsxtr\glscategory{#4}accsupp\endcsname{#1}{#2}}% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% + }% + }% + {% + \ifcsdef{gls#3accsupp}% + {\csname gls#3accsupp\endcsname{#1}{#2}}% + {\glsaccsupp{#1}{#2}}% + }% +} +\newcommand{\xglsfieldaccsupp}[1]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsfieldaccsupp\expandafter{\@gls@replacementtext}% +} +\newcommand*{\glsshortaccsupp}[2]{\glsaccessibility{E}{#1}{#2}} +\newcommand*{\glsshortplaccsupp}{\glsshortaccsupp} +\newcommand*{\glsaccsupp}[2]{\glsaccessibility{ActualText}{#1}{#2}} +\newcommand*{\xglsaccsupp}[2]{% + \protected@edef\@gls@replacementtext{#1}% + \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}% +} +\newcommand*{\@gls@access@display}[2]{% + \protected@edef\@glo@access{#2}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} +\newcommand*{\@gls@fieldaccess@display}[4]{% + \protected@edef\@glo@access{#4}% + \ifdefequal\@glo@access\@gls@noaccess + {#3}% + {\expandafter\glsfieldaccsupp\expandafter{\@glo@access}{#3}{#2}{#1}}% +} +\newrobustcmd*{\glsnameaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@access}% + {#1}% + {\@gls@fieldaccess@display{#2}{name}{#1}{\glsentryaccess{#2}}}% +} +\newrobustcmd*{\glstextaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@textaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{text}{#1}{\glsentrytextaccess{#2}}}% +} +\newrobustcmd*{\glspluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@pluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{plural}{#1}{\glsentrypluralaccess{#2}}}% +} +\newrobustcmd*{\glsfirstaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{first}{#1}{\glsentryfirstaccess{#2}}}% +} +\newrobustcmd*{\glsfirstpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@firstpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{firstpl}{#1}{\glsentryfirstpluralaccess{#2}}}% +} +\newrobustcmd*{\glssymbolaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbol}{#1}{\glsentrysymbolaccess{#2}}}% +} +\newrobustcmd*{\glssymbolpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@symbolpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{symbolplural}{#1}{\glsentrysymbolpluralaccess{#2}}}% +} +\newrobustcmd*{\glsdescriptionaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{desc}{#1}{\glsentrydescaccess{#2}}}% +} +\newrobustcmd*{\glsdescriptionpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@descpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{descplural}{#1}{\glsentrydescpluralaccess{#2}}}% +} +\newrobustcmd*{\glsshortaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{short}{#1}{\glsentryshortaccess{#2}}}% +} +\newrobustcmd*{\glsshortpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@shortpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{shortpl}{#1}{\glsentryshortpluralaccess{#2}}}% +} +\newrobustcmd*{\glslongaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{long}{#1}{\glsentrylongaccess{#2}}}% +} +\newrobustcmd*{\glslongpluralaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@longpluralaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{longpl}{#1}{\glsentrylongpluralaccess{#2}}}% +} +\newrobustcmd*{\glsuseriaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useri}{#1}{\glsentryuseriaccess{#2}}}% +} +\newrobustcmd*{\glsuseriiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userii}{#1}{\glsentryuseriiaccess{#2}}}% +} +\newrobustcmd*{\glsuseriiiaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@useriiiaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriii}{#1}{\glsentryuseriiiaccess{#2}}}% +} +\newrobustcmd*{\glsuserivaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userivaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{useriv}{#1}{\glsentryuserivaccess{#2}}}% +} +\newrobustcmd*{\glsuservaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@uservaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{userv}{#1}{\glsentryuservaccess{#2}}}% +} +\newrobustcmd*{\glsuserviaccessdisplay}[2]{% + \ifcsundef{glo@\glsdetoklabel{#2}@userviaccess}% + {#1}% + {\@gls@fieldaccess@display{#2}{uservi}{#1}{\glsentryuserviaccess{#2}}}% +} +\newrobustcmd*{\glsaccessdisplay}[3]{% + \ifcsundef{gls#1accessdisplay}% + {% + \PackageError{glossaries-accsupp}{No accessibility support + for key `#1'}{}% + }% + {% + \csname gls#1accessdisplay\endcsname{#2}{#3}% + }% +} +\renewcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}} + {\glsinsert}% + }% + {% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + #2{\glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \MakeUppercase{% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% + \MakeUppercase{% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + #2{\glstextaccessdisplay + {\Glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glsfirstaccessdisplay + {\Glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% + \ifglsused\glslabel + {% + \MakeUppercase{% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% + \MakeUppercase{% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% + }% + }% + {% + \ifglsused{\glslabel}% + {% + #2{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% + #1{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% +} +\renewcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glspluralaccessdisplay + {\mfirstucMakeUppercase{\glsentryplural{\glslabel}}}% + {\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + {% + \glsfirstpluralacessdisplay + {\mfirstucMakeUppercase{\glsentryfirstplural{\glslabel}}}% + {\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + {% + \glscapscase + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay{\glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstaccessdisplay{\glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay{\Glsentrytext{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glsfirstaccessdisplay{\Glsentryfirst{\glslabel}}{\glslabel}% + \glsinsert + }% + }% + {% + \ifglsused\glslabel + {% + \glstextaccessdisplay + {\mfirstucMakeUppercase{\glsentrytext{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + {% + \glsfirstaccessdisplay + {\mfirstucMakeUppercase{\glsentryfirst{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + }% + {% + \glscustomtext\glsinsert + }% +} +\renewcommand*{\glsgenacfmt}{% + \ifdefempty\glscustomtext + {% + \ifglsused\glslabel + {% + \glsifplural + {% + \glscapscase + {% + \acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \acronymfont + {\glsshortpluralaccessdisplay + {\Glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont + {\glsshortpluralaccessdisplay + {\glsentryshortpl{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + {% + \glscapscase + {% + \acronymfont + {\glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \acronymfont + {\glsshortaccessdisplay{\Glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert + }% + {% + \mfirstucMakeUppercase + {\acronymfont{% + \glsshortaccessdisplay{\glsentryshort{\glslabel}}{\glslabel}}% + \glsinsert}% + }% + }% + }% + {% + \glsifplural + {% + \glscapscase + {% + \genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genplacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genplacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + {% + \glscapscase + {% + \genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \Genacrfullformat{\glslabel}{\glsinsert}% + }% + {% + \mfirstucMakeUppercase + {\genacrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% + }% + {% + \glscustomtext + }% +} +\renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\glsentryshort{#1}}}{#1})% +} +\renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{#1}}{#1}#2\space + (\glsshortaccessdisplay{\protect\firstacronymfont{\Glsentryshort{#1}}}{#1})% +} +\renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% +} +\renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}#2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{#1}}}{#1})% +} +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\glsentryshort{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\Glsentryshort{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay + {\MakeUppercase{\glsentryshort{#2}}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\glsentrylong{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\Glsentrylong{#2}}{#2}}#3% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\relax + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{% + \MakeUppercase{\glsentrylong{#2}}}{#2}#3}% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} +\def\@glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\glsentrytext{#2}}{#2}#3}% +} +\def\@Glstext@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glstextaccessdisplay{\Glsentrytext{#2}}{#2}#3}% +} +\def\@GLStext@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glstextaccessdisplay{\mfirstucMakeUppercase{\glsentrytext{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}#3}% +} +\def\@Glsfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}#3}% +} +\def\@GLSfirst@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstaccessdisplay{\mfirstucMakeUppercase{\glsentryfirst{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\glsentryplural{#2}}{#2}#3}% +} +\def\@Glsplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}#3}% +} +\def\@GLSplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glspluralaccessdisplay{\mfirstucMakeUppercase{\glsentryplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}#3}% +} +\def\@glsfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}#3}% +} +\def\@GLSfirstplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsfirstpluralaccessdisplay{\mfirstucMakeUppercase{\glsentryfirstplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\glsentryname{#2}}{#2}#3}% +} +\def\@Glsname@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsnameaccessdisplay{\Glsentryname{#2}}{#2}#3}% +} +\def\@GLSname@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsnameaccessdisplay{\mfirstucMakeUppercase{\glsentryname{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}#3}% +} +\def\@Glsdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionaccessdisplay{\Glsentrydesc{#2}}{#2}#3}% +} +\def\@GLSdesc@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionaccessdisplay{\mfirstucMakeUppercase{\glsentrydesc{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}#3}% +} +\def\@Glsdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsdescriptionpluralaccessdisplay{\Glsentrydescplural{#2}}{#2}#3}% +} +\def\@GLSdescplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsdescriptionpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrydescplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}#3}% +} +\def\@Glssymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolaccessdisplay{\Glsentrysymbol{#2}}{#2}#3}% +} +\def\@GLSsymbol@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbol{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}#3}% +} +\def\@Glssymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glssymbolpluralaccessdisplay{\Glsentrysymbolplural{#2}}{#2}#3}% +} +\def\@GLSsymbolplural@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glssymbolpluralaccessdisplay{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\glsentryuseri{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriaccessdisplay{\Glsentryuseri{#2}}{#2}#3}% +} +\def\@GLSuseri@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriaccessdisplay{\mfirstucMakeUppercase{\glsentryuseri{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\glsentryuserii{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiaccessdisplay{\Glsentryuserii{#2}}{#2}#3}% +} +\def\@GLSuserii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiaccessdisplay{\mfirstucMakeUppercase{\glsentryuserii{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\glsentryuseriii{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuseriiiaccessdisplay{\Glsentryuseriii{#2}}{#2}#3}% +} +\def\@GLSuseriii@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuseriiiaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriii{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\glsentryuseriv{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserivaccessdisplay{\Glsentryuseriv{#2}}{#2}#3}% +} +\def\@GLSuseriv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserivaccessdisplay{\mfirstucMakeUppercase{\glsentryuseriv{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\glsentryuserv{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuservaccessdisplay{\Glsentryuserv{#2}}{#2}#3}% +} +\def\@GLSuserv@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuservaccessdisplay{\mfirstucMakeUppercase{\glsentryuserv{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\def\@glsuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\glsentryuservi{#2}}{#2}#3}% +} +\def\@Glsuser@i#1#2[#3]{% + \@gls@field@link{#1}{#2}{\glsuserviaccessdisplay{\Glsentryuservi{#2}}{#2}#3}% +} +\def\@GLSuservi@#1#2[#3]{% + \@gls@field@link{#1}{#2}% + {\glsuserviaccessdisplay{\mfirstucMakeUppercase{\glsentryuservi{#2}}}{#2}% + \mfirstucMakeUppercase{#3}}% +} +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\glsentryname{#1}}{#1}}% + }% +} +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\Glsentryname{#1}}{#1}}% + }% +} +\renewcommand*{\glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\glsentrydesc{#1}}{#1}% + }% +} +\renewcommand*{\Glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\Glsentrydesc{#1}}{#1}% + }% +} +\renewcommand*{\glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\glsentrysymbol{#1}}{#1}% + }% +} +\renewcommand*{\Glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\Glsentrysymbol{#1}}{#1}% + }% +} +\newcommand*{\accsuppglossaryentryfield}[5]{% + \glossaryentryfield{#1}% + {\glsnameaccessdisplay{#2}{#1}}% + {\glsdescriptionaccessdisplay{#3}{#1}}% + {\glssymbolaccessdisplay{#4}{#1}}{#5}% +} +\newcommand*{\accsuppglossarysubentryfield}[6]{% + \glossarysubentryfield{#1}{#2}% + {\glsnameaccessdisplay{#3}{#2}}% + {\glsdescriptionaccessdisplay{#4}{#2}}% + {\glssymbolaccessdisplay{#5}{#2}}{#6}% +} +\renewacronymstyle{long-short}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}##2\space + (\glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}##2\space + (\glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{short-long}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\Glsentryshort{##1}}}{##1}##2\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay + {\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\firstacronymfont}[1]{\acronymfont{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{long-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-short}% +}% +{% + \GlsUseAcrStyleDefs{long-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{long-sc-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sc-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sc-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{long-sm-short-desc}% +{% + \GlsUseAcrEntryDispStyle{long-sm-short}% +}% +{% + \GlsUseAcrStyleDefs{long-sm-short}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{short-long}% +}% +{% + \GlsUseAcrStyleDefs{short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{sc-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sc-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sc-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{sm-short-long-desc}% +{% + \GlsUseAcrEntryDispStyle{sm-short-long}% +}% +{% + \GlsUseAcrStyleDefs{sm-short-long}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{dua}% +{% + \ifdefempty\glscustomtext + {% + \ifglshaslong{\glslabel}% + {% + \glsifplural + {% + \glscapscase + {% + \glslongpluralaccessdisplay{\glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glslongpluralaccessdisplay{\Glsentrylongpl{\glslabel}}{\glslabel}% + \glsinsert + }% + {% + \glslongpluralaccessdisplay + {\mfirstucMakeUppercase{\glsentrylongpl{\glslabel}}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + {% + \glscapscase + {% + \glslongaccessdisplay{\glsentrylong{\glslabel}}{\glslabel}\glsinsert + }% + {% + \glslongaccessdisplay{\Glsentrylong{\glslabel}}{\glslabel}\glsinsert + }% + {% + \glslongaccessdisplay + {\mfirstucMakeUppercase + {\glsentrylong{\glslabel}\glsinsert}}{\glslabel}% + \mfirstucMakeUppercase{\glsinsert}% + }% + }% + }% + {% + \glsgenentryfmt + }% + }% + {\glscustomtext\glsinsert}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay{\Glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glslongaccessdisplay + {\mfirstucMakeUppercase{\glsentrylong{##2}}{##2}##3\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\Glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glslongpluralaccessdisplay + {\mfirstucMakeUppercase{\glsentrylongpl{##2}}{##2}##3\space + (\glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\Glsentryfull}[1]{% + \glslongaccessdisplay{\Glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})% + }% + \renewcommand*{\glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\Glsentryfullpl}[1]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{##1}}{##1}\space + (\glsshortpluralaccessdisplay{\acronymfont{\glsentryshortpl{##1}}}{##1})% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +} +\renewacronymstyle{dua-desc}% +{% + \GlsUseAcrEntryDispStyle{dua}% +}% +{% + \GlsUseAcrStyleDefs{dua}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\acronymfont{\glsentrylong{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##2}% +}% +\renewacronymstyle{footnote}% +{% + \ifglshaslong{\glslabel}{\glsgenacfmt}{\glsgenentryfmt}% +}% +{% + \renewcommand*{\GenericAcronymFields}{description={\the\glslongtok}}% + \glshyperfirstfalse + \renewcommand*{\genacrfullformat}[2]{% + \glsshortaccessdisplay + {\protect\firstacronymfont{\glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\Genacrfullformat}[2]{% + \glsshortaccessdisplay + {\firstacronymfont{\Glsentryshort{##1}}}{##1}##2% + \protect\footnote{\glslongaccessdisplay{\glsentrylong{##1}}{##1}}% + }% + \renewcommand*{\genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\Genplacrfullformat}[2]{% + \glsshortpluralaccessdisplay + {\protect\firstacronymfont{\Glsentryshortpl{##1}}}{##1}##2% + \protect\footnote{\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1}}% + }% + \renewcommand*{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}}% + \renewcommand*{\acronymsort}[2]{##1}% + \renewcommand*{\acronymfont}[1]{##1}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% + \renewcommand*{\acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\Acrfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}% + \renewcommand*{\ACRfullfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortaccessdisplay + {\mfirstucMakeUppercase + {\acronymfont{\glsentryshort{##2}}}{##2}##3\space + (\glslongaccessdisplay{\glsentrylong{##2}}{##2})}}}% + \renewcommand*{\acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}% + \renewcommand*{\Acrfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}})}}% + \renewcommand*{\ACRfullplfmt}[3]{% + \glslink[##1]{##2}{% + \glsshortpluralaccessdisplay + {\mfirstucMakeUppercase + {\acronymfont{\glsentryshortpl{##2}}}{##2}##3\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##2}}{##2})}}}% + \renewcommand*{\glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\Glsentryfull}[1]{% + \glsshortaccessdisplay{\acronymfont{\Glsentryshort{##1}}}{##1}\space + (\glslongaccessdisplay{\glsentrylong{##1}}{##1})}% + \renewcommand*{\glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% + \renewcommand*{\Glsentryfullpl}[1]{% + \glsshortpluralaccessdisplay + {\acronymfont{\Glsentryshortpl{##1}}}{##1}\space + (\glslongpluralaccessdisplay{\glsentrylongpl{##1}}{##1})}% +} +\renewacronymstyle{footnote-sc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{\glstextup{\glspluralsuffix}}% +}% +\renewacronymstyle{footnote-sm}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand{\acronymentry}[1]{% + \glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1}} + \renewcommand{\acronymfont}[1]{\textsmaller{##1}}% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% +}% +\renewacronymstyle{footnote-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote}% +}% +{% + \GlsUseAcrStyleDefs{footnote}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{footnote-sc-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sc}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sc}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\renewacronymstyle{footnote-sm-desc}% +{% + \GlsUseAcrEntryDispStyle{footnote-sm}% +}% +{% + \GlsUseAcrStyleDefs{footnote-sm}% + \renewcommand*{\GenericAcronymFields}{}% + \renewcommand*{\acronymsort}[2]{##2}% + \renewcommand*{\acronymentry}[1]{% + \glslongaccessdisplay{\glsentrylong{##1}}{##1}\space + (\glsshortaccessdisplay{\acronymfont{\glsentryshort{##1}}}{##1})}% +} +\newcommand*{\glsdefaultshortaccess}[2]{#1} +\renewcommand*{\newacronymhook}{% + \protected@edef\@gls@keylist{% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + shortpluralaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + \the\glskeylisttok}% + \expandafter\glskeylisttok\expandafter{\@gls@keylist}% +} +\renewcommand*{\DefaultNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + description={\the\glslongtok},% + descriptionaccess=\relax, + text={\the\glsshorttok},% + access={\noexpand\@glo@textaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% + first={\noexpand\glslongaccessdisplay + {\the\glslongtok}{\the\glslabeltok}\space + (\noexpand\glsshortaccessdisplay + {\the\glsshorttok}{\the\glslabeltok})},% + plural={\the\glsshorttok\acrpluralsuffix},% + firstplural={\noexpand\glslongpluralaccessdisplay + {\noexpand\@glo@longpl}{\the\glslabeltok}\space + (\noexpand\glsshortpluralaccessdisplay + {\noexpand\@glo@shortpl}{\the\glslabeltok})},% + firstaccess=\relax, + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \@@gls@noexpand@assign@default@plurals +} +\renewcommand*{\DescriptionFootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + access={\noexpand\@glo@textaccess},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + symbol={\the\glslongtok},% + symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\renewcommand*{\DescriptionNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand + \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% + access={\noexpand\@glo@textaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + first={\the\glslongtok},% + firstaccess=\relax, + firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% + text={\the\glsshorttok},% + textaccess={\the\glslongtok},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + symbol={\noexpand\@glo@text},% + symbolaccess={\noexpand\@glo@textaccess},% + symbolplural={\noexpand\@glo@plural},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% + \the\glskeylisttok}% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} +\renewcommand*{\FootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + textaccess={\the\glslongtok},% + access={\noexpand\@glo@textaccess},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@descplural\@org@gls@assign@descplural +} +\renewcommand*{\SmallNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + access={\noexpand\@glo@symbolaccess},% + sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\glsdefaultshortaccess{\the\glslongtok}{\the\glsshorttok}},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + text={\noexpand\@glo@short},% + textaccess={\noexpand\@glo@shortaccess},% + plural={\noexpand\@glo@shortpl},% + first={\the\glslongtok},% + firstaccess=\relax, + firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\noexpand\@glo@first},% + descriptionplural={\noexpand\@glo@firstplural},% + symbol={\the\glsshorttok},% + symbolaccess={\the\glslongtok},% + symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@descplural\@org@gls@assign@descplural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} + \newcommand*{\glsshortaccesskey}{\glsshortkey access}% + \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}% + \newcommand*{\glslongaccesskey}{\glslongkey access}% + \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}% +\newcommand*{\showglonameaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@access\endcsname +} +\newcommand*{\showglotextaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@textaccess\endcsname +} +\newcommand*{\showglopluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@pluralaccess\endcsname +} +\newcommand*{\showglofirstaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstaccess\endcsname +} +\newcommand*{\showglofirstpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@firstpluralaccess\endcsname +} +\newcommand*{\showglosymbolaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolaccess\endcsname +} +\newcommand*{\showglosymbolpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@symbolpluralaccess\endcsname +} +\newcommand*{\showglodescaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descaccess\endcsname +} +\newcommand*{\showglodescpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@descpluralaccess\endcsname +} +\newcommand*{\showgloshortaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortaccess\endcsname +} +\newcommand*{\showgloshortpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@shortpluralaccess\endcsname +} +\newcommand*{\showglolongaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longaccess\endcsname +} +\newcommand*{\showglolongpluralaccess}[1]{% + \expandafter\show\csname glo@\glsdetoklabel{#1}@longpluralaccess\endcsname +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-babel-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossaries-babel-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-babel}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-207-2021-11-01.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.49 (glossaries-compatible-207-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-207}[2021/11/01 v4.49 (NLCT)] +\ifglsxindy + \renewcommand*\GlsAddXdyAttribute[1]{% + \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}% + \expandafter\toks@\expandafter{\@xdylocref}% + \edef\@xdylocref{\the\toks@ ^^J% + (markup-locref + :open \string"\string~n\string\setentrycounter + {\noexpand\glscounter}% + \expandafter\string\csname#1\endcsname + \expandafter\@gobble\string\{\string" ^^J + :close \string"\expandafter\@gobble\string\}\string" ^^J + :attr \string"#1\string")}} +\fi +\renewcommand*\GlsAddXdyCounters[1]{% + \GlossariesWarning{\string\GlsAddXdyCounters\space not available + in compatibility mode.}% +} + \GlsAddXdyAttribute{glsnumberformat} + \GlsAddXdyAttribute{textrm} + \GlsAddXdyAttribute{textsf} + \GlsAddXdyAttribute{texttt} + \GlsAddXdyAttribute{textbf} + \GlsAddXdyAttribute{textmd} + \GlsAddXdyAttribute{textit} + \GlsAddXdyAttribute{textup} + \GlsAddXdyAttribute{textsl} + \GlsAddXdyAttribute{textsc} + \GlsAddXdyAttribute{emph} + \GlsAddXdyAttribute{glshypernumber} + \GlsAddXdyAttribute{hyperrm} + \GlsAddXdyAttribute{hypersf} + \GlsAddXdyAttribute{hypertt} + \GlsAddXdyAttribute{hyperbf} + \GlsAddXdyAttribute{hypermd} + \GlsAddXdyAttribute{hyperit} + \GlsAddXdyAttribute{hyperup} + \GlsAddXdyAttribute{hypersl} + \GlsAddXdyAttribute{hypersc} + \GlsAddXdyAttribute{hyperemph} +\ifglsxindy + \renewcommand*{\GlsAddXdyLocation}[2]{% + \edef\@xdyuserlocationdefs{% + \@xdyuserlocationdefs ^^J% + (define-location-class \string"#1\string"^^J\space\space + \space(#2)) + }% + \edef\@xdyuserlocationnames{% + \@xdyuserlocationnames^^J\space\space\space + \string"#1\string"}% + } +\fi +\renewcommand{\@do@wrglossary}[1]{% +\ifglsxindy + \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil + \def\@glo@range{}% + \expandafter\if\@glo@prefix(\relax + \def\@glo@range{:open-range}% + \else + \expandafter\if\@glo@prefix)\relax + \def\@glo@range{:close-range}% + \fi + \fi + \protected@edef\@glslocref{\theglsentrycounter}% + \@gls@checkmkidxchars\@glslocref + \glossary[\csname glo@#1@type\endcsname]{% + (indexentry :tkey (\csname glo@#1@index\endcsname) + :locref \string"\@glslocref\string" % + :attr \string"\@glo@suffix\string" \@glo@range + ) + }% +\else + \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat + \glossary[\csname glo@#1@type\endcsname]{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}% +\fi +} +\def\@set@glo@numformat#1#2#3{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname + }% + \@gls@checkmkidxchars#1% +} +\ifglsxindy + \def\writeist{% + \openout\glswrite=\istfilename + \write\glswrite{;; xindy style file created by the glossaries + package in compatible-2.07 mode}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi + }% + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% + \write\glswrite{^^J; location class definitions^^J}% + \protected@edef\@gls@roman{\@roman{0\string" + \string"roman-numbers-lowercase\string" :sep \string"}}% + \@onelevel@sanitize\@gls@roman + \edef\@tmp{\string" \string"roman-numbers-lowercase\string" + :sep \string"}% + \@onelevel@sanitize\@tmp + \ifx\@tmp\@gls@roman + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-lowercase\string") + :min-range-length \@glsminrange)}% + \else + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (:sep "\@gls@roman") + :min-range-length \@glsminrange)}% + \fi + \write\glswrite{(define-location-class + \string"Roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-uppercase\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"arabic-page-numbers\string"^^J\space\space\space + (\string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"alpha-page-numbers\string"^^J\space\space\space + (\string"alpha\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"Alpha-page-numbers\string"^^J\space\space\space + (\string"ALPHA\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"Appendix-page-numbers\string"^^J\space\space\space + (\string"ALPHA\string" + :sep \string"\@glsAlphacompositor\string" + \string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"arabic-section-numbers\string"^^J\space\space\space + (\string"arabic-numbers\string" + :sep \string"\glscompositor\string" + \string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{^^J; user defined location classes}% + \write\glswrite{\@xdyuserlocationdefs}% + \write\glswrite{^^J; define cross-reference class^^J}% + \write\glswrite{(define-crossref-class \string"see\string" + :unverified )}% + \write\glswrite{(markup-crossref-list + :class \string"see\string"^^J\space\space\space + :open \string"\string\glsseeformat\string" + :close \string"{}\string")}% + \write\glswrite{^^J; define the order of the location classes}% + \write\glswrite{(define-location-class-order + (\@xdylocationclassorder))}% + \write\glswrite{^^J; define the glossary markup^^J}% + \write\glswrite{(markup-index^^J\space\space\space + :open \string"\string + \glossarysection[\string\glossarytoctitle]{\string + \glossarytitle}\string\glossarypreamble\string~n\string\begin + {theglossary}\string\glossaryheader\string~n\string" ^^J\space + \space\space:close \string"\expandafter\@gobble + \string\%\string~n\string + \end{theglossary}\string\glossarypostamble + \string~n\string" ^^J\space\space\space + :tree)}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% + \write\glswrite{(markup-indexentry + :open \string"\string\relax \string\glsresetentrylist + \string~n\string")}% + \write\glswrite{(markup-locclass-list :open + \string"\glsopenbrace\string\glossaryentrynumbers + \glsopenbrace\string\relax\space \string"^^J\space\space\space + :sep \string", \string" + :close \string"\glsclosebrace\glsclosebrace\string")}% + \write\glswrite{(markup-locref-list + :sep \string"\string\delimN\space\string")}% + \write\glswrite{(markup-range + :sep \string"\string\delimR\space\string")}% + \@onelevel@sanitize\gls@suffixF + \@onelevel@sanitize\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixF" :length 1 :ignore-end)}% + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixFF" :length 2 :ignore-end)}% + \fi + \write\glswrite{^^J; define format to use for locations^^J}% + \write\glswrite{\@xdylocref}% + \write\glswrite{^^J; define letter group list format^^J}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% + \write\glswrite{^^J; letter group headings^^J}% + \write\glswrite{(markup-letter-group + :open-head \string"\string\glsgroupheading + \glsopenbrace\string"^^J\space\space\space + :close-head \string"\glsclosebrace\string")}% + \write\glswrite{^^J; additional letter groups^^J}% + \write\glswrite{\@xdylettergroups}% + \write\glswrite{^^J; additional sort rules^^J} + \write\glswrite{\@xdysortrules}% + \noist} +\else + \edef\@gls@actualchar{\string?} + \edef\@gls@encapchar{\string|} + \edef\@gls@levelchar{\string!} + \edef\@gls@quotechar{\string"} + \def\writeist{\relax + \openout\glswrite=\istfilename + \write\glswrite{\expandafter\@gobble\string\% makeindex style file + created by the glossaries package} + \write\glswrite{\expandafter\@gobble\string\% for document + '\jobname' on \the\year-\the\month-\the\day} + \write\glswrite{actual '\@gls@actualchar'} + \write\glswrite{encap '\@gls@encapchar'} + \write\glswrite{level '\@gls@levelchar'} + \write\glswrite{quote '\@gls@quotechar'} + \write\glswrite{keyword \string"\string\\glossaryentry\string"} + \write\glswrite{preamble \string"\string\\glossarysection[\string + \\glossarytoctitle]{\string\\glossarytitle}\string + \\glossarypreamble\string\n\string\\begin{theglossary}\string + \\glossaryheader\string\n\string"} + \write\glswrite{postamble \string"\string\%\string\n\string + \\end{theglossary}\string\\glossarypostamble\string\n + \string"} + \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n + \string"} + \write\glswrite{item_0 \string"\string\%\string\n\string"} + \write\glswrite{item_1 \string"\string\%\string\n\string"} + \write\glswrite{item_2 \string"\string\%\string\n\string"} + \write\glswrite{item_01 \string"\string\%\string\n\string"} + \write\glswrite{item_x1 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{item_12 \string"\string\%\string\n\string"} + \write\glswrite{item_x2 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{delim_0 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_1 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_2 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_t \string"\string\}\string\}\string"} + \write\glswrite{delim_n \string"\string\\delimN \string"} + \write\glswrite{delim_r \string"\string\\delimR \string"} + \write\glswrite{headings_flag 1} + \write\glswrite{heading_prefix + \string"\string\\glsgroupheading\string\{\string"} + \write\glswrite{heading_suffix + \string"\string\}\string\\relax + \string\\glsresetentrylist \string"} + \write\glswrite{symhead_positive \string"glssymbols\string"} + \write\glswrite{numhead_positive \string"glsnumbers\string"} + \write\glswrite{page_compositor \string"\glscompositor\string"} + \@gls@escbsdq\gls@suffixF + \@gls@escbsdq\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + \fi + \noist + } +\fi +\renewcommand*{\noist}{\let\writeist\relax} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-307-2021-11-01.sty> +% \end{macrocode} +%\fi +% \subsection{Rollback v4.49 (glossaries-compatible-307-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-307}[2021/11/01 v4.49 (NLCT)] +\newcommand{\compatglossarystyle}[2]{% + \ifcsundef{@glscompstyle@#1}% + {% + \csdef{@glscompstyle@#1}{#2}% + }% + {% + \PackageError{glossaries}{Glossary compatibility style `#1' is already defined}{}% + }% +} +\compatglossarystyle{inline}{% + \renewcommand{\glossaryentryfield}[5]{% + \glsinlinedopostchild + \gls@inlinesep + \def\glo@desc{##3}% + \def\@no@post@desc{\nopostdesc}% + \glsentryitem{##1}\glsinlinenameformat{##1}{##2}% + \ifx\glo@desc\@no@post@desc + \glsinlineemptydescformat{##4}{##5}% + \else + \ifstrempty{##3}% + {\glsinlineemptydescformat{##4}{##5}}% + {\glsinlinedescformat{##3}{##4}{##5}}% + \fi + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand{\glossarysubentryfield}[6]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{##3}% + \glssubentryitem{##2}\glsinlinesubdescformat{##4}{##5}{##6}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% +} +\compatglossarystyle{list}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}] + ##3\glspostdescription\space ##5}% + \renewcommand*{\glossarysubentryfield}[6]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}% +} +\compatglossarystyle{listgroup}{% + \csuse{@glscompstyle@list}% +}% +\compatglossarystyle{listhypergroup}{% + \csuse{@glscompstyle@list}% +}% +\compatglossarystyle{altlist}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]% + \mbox{}\par\nobreak\@afterheading + ##3\glspostdescription\space ##5}% + \renewcommand{\glossarysubentryfield}[6]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6}% +}% +\compatglossarystyle{altlistgroup}{% + \csuse{@glscompstyle@altlist}% +}% +\compatglossarystyle{altlisthypergroup}{% + \csuse{@glscompstyle@altlist}% +}% +\compatglossarystyle{listdotted}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}\glstarget{##1}{##2}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}% + \renewcommand*{\glossarysubentryfield}[6]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{##3}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}% +}% +\compatglossarystyle{sublistdotted}{% + \csuse{@glscompstyle@listdotted}% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]}% +}% +\compatglossarystyle{long}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +\compatglossarystyle{longborder}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{longheader}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{longheaderborder}{% + \csuse{@glscompstyle@long}% +}% +\compatglossarystyle{long3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +\compatglossarystyle{long3colborder}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long3colheader}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long3colheaderborder}{% + \csuse{@glscompstyle@long3col}% +}% +\compatglossarystyle{long4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +\compatglossarystyle{long4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{long4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{long4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4col}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{altlong4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +\compatglossarystyle{longragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +\compatglossarystyle{longraggedborder}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longraggedheader}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longraggedheaderborder}{% + \csuse{@glscompstyle@longragged}% +}% +\compatglossarystyle{longragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +\compatglossarystyle{longragged3colborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{longragged3colheader}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{longragged3colheaderborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +\compatglossarystyle{altlongragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +\compatglossarystyle{altlongragged4colheader}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{altlongragged4colborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{altlongragged4colheaderborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +\compatglossarystyle{index}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5}% + \renewcommand*{\glossarysubentryfield}[6]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem + \fi + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax + \else + \space(##5)% + \fi + \space##4\glspostdescription\space ##6}% +}% +\compatglossarystyle{indexgroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{indexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{tree}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax + \else + \space(##5)% + \fi + \space##4\glspostdescription\space ##6\par}% +}% +\compatglossarystyle{treegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{treehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{treenoname}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + ##4\glspostdescription\space ##6\par}% +}% +\compatglossarystyle{treenonamegroup}{% + \csuse{@glscompstyle@treenoname}% +}% +\compatglossarystyle{treenonamehypergroup}{% + \csuse{@glscompstyle@treenoname}% +}% +\compatglossarystyle{alttree}{% + \renewcommand{\glossaryentryfield}[5]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% + \hangindent\glstreeindent + \parindent\glstreeindent + \fi + \makebox[0pt][r]{\makebox[\glstreeindent][l]{% + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}% + \ifx\relax##4\relax + \else + (##4)\space + \fi + ##3\glspostdescription \space ##5\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\glossarysubentryfield}[6]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\textbf{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\textbf{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\textbf{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \hangindent\glstreeindent + \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% + \textbf{\glstarget{##2}{##3}}}}% + \ifx##5\relax\relax + \else + (##5)\space + \fi + ##4\glspostdescription\space ##6\par + \def\@gls@prevlevel{##1}% + }% +}% +\compatglossarystyle{alttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{alttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolindex}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcolindexgroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcolindexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +\compatglossarystyle{mcoltree}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolindextreegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolindextreehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenoname}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenonamegroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcoltreenonamehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +\compatglossarystyle{mcolalttree}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolalttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +\compatglossarystyle{mcolalttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% + +\compatglossarystyle{superragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +\compatglossarystyle{superraggedborder}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superraggedheader}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superraggedheaderborder}{% + \csuse{@glscompstyle@superragged}% +}% +\compatglossarystyle{superragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +\compatglossarystyle{superragged3colborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{superragged3colheader}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{superragged3colheaderborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +\compatglossarystyle{altsuperragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +\compatglossarystyle{altsuperragged4colheader}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{altsuperragged4colborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{altsuperragged4colheaderborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +\compatglossarystyle{super}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +\compatglossarystyle{superborder}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{superheader}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{superheaderborder}{% + \csuse{@glscompstyle@super}% +}% +\compatglossarystyle{super3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +\compatglossarystyle{super3colborder}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super3colheader}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super3colheaderborder}{% + \csuse{@glscompstyle@super3col}% +}% +\compatglossarystyle{super4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +\compatglossarystyle{super4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{super4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{super4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4col}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +\compatglossarystyle{altsuper4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-polyglossia-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossaries-polyglossia-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-polyglossia}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{tracklang} +\let\glsifusetranslator\@secondoftwo + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossaries-}% prefix + {.ldf}% + {% + \RequireGlossariesLang{\CurrentTrackedTag}% + }% + {% + \PackageWarningNoLine{glossaries}% + {No language module detected for `\this@dialect'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-\CurrentTrackedLanguage' or similar}% + }% + }% + }% + {}% +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-prefix-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossaries-prefix-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-prefix}[2021/11/01 v4.49 (NLCT)] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} +\ProcessOptions +\RequirePackage{glossaries}[=v4.49] +\define@key{glossentry}{prefixfirst}{\def\@glo@entryprefixfirst{#1}}% +\define@key{glossentry}{prefixfirstplural}{\def\@glo@entryprefixfirstplural{#1}}% +\define@key{glossentry}{prefix}{\def\@glo@entryprefix{#1}}% +\define@key{glossentry}{prefixplural}{\def\@glo@entryprefixplural{#1}}% +\appto\@gls@keymap{,% + {prefixfirst}{prefixfirst},% + {prefixfirstplural}{prefixfirstplural},% + {prefix}{prefix},% + {prefixplural}{prefixplural}% + } +\appto\@newglossaryentryprehook{% + \def\@glo@entryprefix{}% + \def\@glo@entryprefixplural{}% + \let\@glo@entryprefixfirst\@gls@default@value + \let\@glo@entryprefixfirstplural\@gls@default@value +} +\appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{prefix}{\@glo@entryprefix}% + \gls@assign@field{}{\@glo@label}{prefixplural}{\@glo@entryprefixplural}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefix\endcsname}{\@glo@label}{prefixfirst}% + {\@glo@entryprefixfirst}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefixplural\endcsname}{\@glo@label}% + {prefixfirstplural}{\@glo@entryprefixfirstplural}% +} +\newcommand*{\glsentryprefixfirst}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixfirst}} +\newcommand*{\glsentryprefixfirstplural}[1]{% + \csuse{glo@\glsdetoklabel{#1}@prefixfirstplural}} +\newcommand*{\glsentryprefix}[1]{\csuse{glo@\glsdetoklabel{#1}@prefix}} +\newcommand*{\glsentryprefixplural}[1]{\csuse{glo@\glsdetoklabel{#1}@prefixplural}} +\newrobustcmd*{\Glsentryprefixfirst}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirst\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefixfirstplural}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixfirstplural\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefix}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefix\endcsname}% + \xmakefirstuc\@glo@text +} +\newrobustcmd*{\Glsentryprefixplural}[1]{% + \protected@edef\@glo@text{\csname glo@\glsdetoklabel{#1}@prefixplural\endcsname}% + \xmakefirstuc\@glo@text +} +\newcommand*{\ifglshasprefix}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefix}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixplural}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixfirst}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirst}% + {#3}% + {#2}% +} +\newcommand*{\ifglshasprefixfirstplural}[3]{% + \ifcsempty{glo@\glsdetoklabel{#1}@prefixfirstplural}% + {#3}% + {#2}% +} +\providecommand{\@glsprefix@record@hook}[2]{% + \ifdef\@glsxtr@record + {\@glsxtr@record{#1}{#2}{glslink}}% + {}% +} +\newcommand{\glsprefixsep}{} +\newrobustcmd{\pgls}{\@gls@hyp@opt\@pgls} +\newcommand*{\@pgls}[2][]{% + \new@ifnextchar[% + {\@pgls@{#1}{#2}}% + {\@pgls@{#1}{#2}[]}% +} +\def\@pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}{\glsentryprefix{#2}\glsprefixsep}{}% + }% + {% + \ifglshasprefixfirst{#2}{\glsentryprefixfirst{#2}\glsprefixsep}{}% + }% + \@gls@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\pglspl}{\@gls@hyp@opt\@pglspl} +\newcommand*{\@pglspl}[2][]{% + \new@ifnextchar[% + {\@pglspl@{#1}{#2}}% + {\@pglspl@{#1}{#2}[]}% +} +\def\@pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}{\glsentryprefixplural{#2}\glsprefixsep}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\glsentryprefixfirstplural{#2}\glsprefixsep}{}% + }% + \@glspl@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\Pgls}{\@gls@hyp@opt\@Pgls} +\newcommand*{\@Pgls}[2][]{% + \new@ifnextchar[% + {\@Pgls@{#1}{#2}}% + {\@Pgls@{#1}{#2}[]}% +} +\def\@Pgls@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {% + \Glsentryprefix{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirst{#2}% + {% + \Glsentryprefixfirst{#2}% + \glsprefixsep + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + }% +} +\newrobustcmd{\Pglspl}{\@gls@hyp@opt\@Pglspl} +\newcommand*{\@Pglspl}[2][]{% + \new@ifnextchar[% + {\@Pglspl@{#1}{#2}}% + {\@Pglspl@{#1}{#2}[]}% +} +\def\@Pglspl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {% + \Glsentryprefixplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {% + \Glsentryprefixfirstplural{#2}% + \glsprefixsep + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + }% +} +\newrobustcmd{\PGLS}{\@gls@hyp@opt\@PGLS} +\newcommand*{\@PGLS}[2][]{% + \new@ifnextchar[% + {\@PGLS@{#1}{#2}}% + {\@PGLS@{#1}{#2}[]}% +} +\def\@PGLS@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {\mfirstucMakeUppercase{\glsentryprefix{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirst{#2}% + {\mfirstucMakeUppercase{\glsentryprefixfirst{#2}\glsprefixsep}}{}% + }% + \@GLS@{#1}{#2}[#3]% + }% +} +\newrobustcmd{\PGLSpl}{\@gls@hyp@opt\@PGLSpl} +\newcommand*{\@PGLSpl}[2][]{% + \new@ifnextchar[% + {\@PGLSpl@{#1}{#2}}% + {\@PGLSpl@{#1}{#2}[]}% +} +\def\@PGLSpl@#1#2[#3]{% + \@glsprefix@record@hook{#1}{#2}% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {\mfirstucMakeUppercase{\glsentryprefixplural{#2}\glsprefixsep}}{}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {\mfirstucMakeUppercase{\glsentryprefixfirstplural{#2}\glsprefixsep}}{}% + }% + \@GLSpl@{#1}{#2}[#3]% + }% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-hypernav-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-hypernav-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-hypernav}[2021/11/01 v4.49 (NLCT)] +\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% + \protected@edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% + \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}} +\newcommand*{\glsnavhyperlinkname}[2]{glsn:#1@#2} +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% + \@glsnavhypertarget{#1}{#2}{#3}% +} +\newcommand*{\@glsnavhypertarget}[3]{% + \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% + \@glstarget{\glsnavhyperlinkname{#1}{#2}}{#3}% + \expandafter\let + \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname + \@for\@gls@elem:=\@gls@list\do{% + \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% + \if@endfor + \else + \GlossariesWarningNoLine{Navigation panel + for glossary type `#1'^^Jmissing group `#2'}% + \gdef\gls@hypergrouprerun{% + \GlossariesWarningNoLine{Navigation panel + has changed. Rerun LaTeX}}% + \fi +} +\let\gls@hypergrouprerun\relax +\AtEndDocument{\gls@hypergrouprerun} +\newcommand*{\@gls@hypergroup}[2]{% +\@ifundefined{@gls@hypergrouplist@#1}{% + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}% +}{% + \expandafter\let\expandafter\@gls@tmp + \csname @gls@hypergrouplist@#1\endcsname + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{% + \@gls@tmp,#2}% +}% +} +\newcommand*{\glsnavigation}{% + \def\@gls@between{}% + \ifcsundef{@gls@hypergrouplist@\@glo@type}% + {% + \def\@gls@list{}% + }% + {% + \expandafter\let\expandafter\@gls@list + \csname @gls@hypergrouplist@\@glo@type\endcsname + }% + \@for\@gls@tmp:=\@gls@list\do{% + \@gls@between + \@gls@getgrouptitle{\@gls@tmp}{\@gls@grptitle}% + \glsnavhyperlink{\@gls@tmp}{\@gls@grptitle}% + \let\@gls@between\glshypernavsep + }% +} +\newcommand*{\glshypernavsep}{\space\textbar\space} +\newcommand*{\glssymbolnav}{% + \glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}% + \glshypernavsep + \glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}% + \glshypernavsep +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-inline-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-inline-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-inline}[2021/11/01 v4.49 (NLCT)] +\newglossarystyle{inline}{% + \renewenvironment{theglossary}% + {% + \def\gls@inlinesep{}% + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{}% + }% + {\glspostinline}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsinlinedopostchild + \gls@inlinesep + \glsentryitem{##1}% + \glsinlinenameformat{##1}{% + \glossentryname{##1}% + }% + \ifglsdescsuppressed{##1}% + {% + \glsinlineemptydescformat + {% + \glossentrysymbol{##1}% + }% + {% + ##2% + }% + }% + {% + \ifglshasdesc{##1}% + {\glsinlinedescformat{\glossentrydesc{##1}}{\glossentrysymbol{##1}}{##2}}% + {\glsinlineemptydescformat{\glossentrysymbol{##1}}{##2}}% + }% + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% + \renewcommand{\subglossentry}[3]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{% + \glossentryname{##2}}% + \glssubentryitem{##2}% + \glsinlinesubdescformat{\glossentrydesc{##2}}{\glossentrysymbol{##2}}{##3}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% + \renewcommand*{\glsgroupskip}{}% +} +\newcommand*{\glsinlinedopostchild}{% + \gls@inlinepostchild + \def\gls@inlinepostchild{}% +} +\newcommand*{\glsinlineseparator}{;\space} +\newcommand*{\glsinlinesubseparator}{,\space} +\newcommand*{\glsinlineparentchildseparator}{:\space} +\newcommand*{\glsinlinepostchild}{} +\newcommand*{\glspostinline}{\glspostdescription\space} +\newcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{#2}} +\newcommand*{\glsinlinedescformat}[3]{\space#1} +\newcommand*{\glsinlineemptydescformat}[2]{} +\newcommand*{\glsinlinesubnameformat}[2]{\glstarget{#1}{}} +\newcommand*{\glsinlinesubdescformat}[3]{#1} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-list-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-list-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossary-list}[2021/11/01 v4.49 (NLCT)] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glslistgroupheaderfmt}[1]{#1} +\newcommand*{\glslistnavigationitem}[1]{\item[#1]} +\newcommand{\glslistinit}{% + \ifdef\GetTitleStringDisableCommands + {% + \GetTitleStringSetup{expand}% + \GetTitleStringDisableCommands{% + \let\glsentryitem\@gobble + \let\glstarget\@secondoftwo + \let\glossentryname\glslistexpandedname + \let\glslistgroupheaderfmt\@firstofone + \let\glsgetgrouptitle\@firstofone + \let\glsnavhypertarget\@secondoftwo + \let\glsnavigation\relax + }% + }% + {}% +} +\newcommand{\glslistexpandedname}[1]{% + \glsunexpandedfieldvalue{#1}{name}% +} +\newglossarystyle{list}{% + \renewenvironment{theglossary}% + {\glslistinit\begin{description}}{\end{description}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}] + \glossentrydesc{##1}\glspostdescription\space ##2}% + \renewcommand*{\subglossentry}[3]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\space + \glossentrydesc{##2}\glspostdescription\space ##3.}% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{listgroup}{% + \setglossarystyle{list}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} +\newglossarystyle{listhypergroup}{% + \setglossarystyle{list}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} +\newglossarystyle{altlist}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}]% + \mbox{}\par\nobreak\@afterheading + \glossentrydesc{##1}\glspostdescription\space ##2}% + \renewcommand{\subglossentry}[3]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space ##3}% +} +\newglossarystyle{altlistgroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]}} +\newglossarystyle{altlisthypergroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]}} +\newglossarystyle{listdotted}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##1}}% + \renewcommand*{\subglossentry}[3]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{\glossentryname{##2}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##2}}% +} +\newlength\glslistdottedwidth +\setlength{\glslistdottedwidth}{.5\hsize} +\newglossarystyle{sublistdotted}{% + \setglossarystyle{listdotted}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}]}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-long-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-long-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-long}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{longtable} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{long}{% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi +} +\newglossarystyle{longborder}{% + \setglossarystyle{long}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longheader}{% + \setglossarystyle{long}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname\tabularnewline\endhead}% +} +\newglossarystyle{longheaderborder}{% + \setglossarystyle{longborder}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries + \descriptionname\tabularnewline\hline + \endhead + \hline\endfoot}% +} +\newglossarystyle{long3col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & \tabularnewline}% + \fi +} +\newglossarystyle{long3colborder}{% + \setglossarystyle{long3col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{long3colheader}{% + \setglossarystyle{long3col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{long3colheaderborder}{% + \setglossarystyle{long3colborder}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{long4col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{llll}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & & \tabularnewline}% + \fi +} +\newglossarystyle{long4colheader}{% + \setglossarystyle{long4col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{long4colborder}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{long4colheaderborder}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{altlong4col}{% + \setglossarystyle{long4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colheader}{% + \setglossarystyle{long4colheader}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colborder}{% + \setglossarystyle{long4colborder}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% +} +\newglossarystyle{altlong4colheaderborder}{% + \setglossarystyle{long4colheaderborder}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-longbooktabs-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-longbooktabs-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-longbooktabs}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{booktabs} +\RequirePackage{glossary-long}[=v4.46] +\RequirePackage{glossary-longragged}[=v4.46] +\newglossarystyle{long-booktabs}{% + \glspatchLToutput + \setglossarystyle{long}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & \bfseries + \descriptionname\tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{long3col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long3col}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & + \bfseries \descriptionname & + \bfseries \pagelistname + \tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{long4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long4col}% + \renewcommand*{\glossaryheader}{% + \toprule \bfseries \entryname & + \bfseries \descriptionname & + \bfseries \symbolname & + \bfseries \pagelistname + \tabularnewline\midrule\endhead + \bottomrule\endfoot}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newglossarystyle{altlong4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long4col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{longragged-booktabs}{% + \glspatchLToutput + \setglossarystyle{long-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{longragged3col-booktabs}{% + \glspatchLToutput + \setglossarystyle{long3col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newglossarystyle{altlongragged4col-booktabs}{% + \glspatchLToutput + \setglossarystyle{altlong4col-booktabs}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% +} +\newcommand*{\glsLTpenaltycheck}{% + \ifnum\outputpenalty=-50\vskip-\normalbaselineskip\relax\fi +} +\newcommand{\glspenaltygroupskip}{% + \noalign{\penalty-50\vskip\normalbaselineskip}} +\let\@gls@org@LT@output\LT@output +\newcommand*{\glsrestoreLToutput}{\let\LT@output\@gls@org@LT@output} +\newcommand*{\glspatchLToutput}{% + \renewcommand*{\LT@output}{% + \ifnum\outputpenalty <-\@Mi + \ifnum\outputpenalty > -\LT@end@pen + \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \else + \setbox\z@\vbox{\unvbox\@cclv}% + \ifdim \ht\LT@lastfoot>\ht\LT@foot + \dimen@\pagegoal + \advance\dimen@-\ht\LT@lastfoot + \ifdim\dimen@<\ht\z@ + \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% + \@makecol + \@outputpage + \setbox\z@\vbox{\box\LT@head\glsLTpenaltycheck}% + \fi + \fi + \global\@colroom\@colht + \global\vsize\@colht + {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% + \fi + \else + \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% + \@makecol + \@outputpage + \global\vsize\@colroom + \copy\LT@head + \glsLTpenaltycheck + \nobreak + \fi + }% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-longragged-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-longragged-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-longragged}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{array} +\RequirePackage{longtable} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{longragged}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}% + \glspostdescription\space ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi +} +\newglossarystyle{longraggedborder}{% + \setglossarystyle{longragged}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longraggedheader}{% + \setglossarystyle{longragged}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname + \tabularnewline\endhead}% +} +\newglossarystyle{longraggedheaderborder}{% + \setglossarystyle{longraggedborder}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries \descriptionname + \tabularnewline\hline + \endhead + \hline\endfoot}% +} +\newglossarystyle{longragged3col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & \tabularnewline}% + \fi +} +\newglossarystyle{longragged3colborder}{% + \setglossarystyle{longragged3col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longragged3colheader}{% + \setglossarystyle{longragged3col}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{longragged3colheaderborder}{% + \setglossarystyle{longragged3colborder}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +\newglossarystyle{altlongragged4col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & & & \tabularnewline}% + \fi +} +\newglossarystyle{altlongragged4colheader}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% +} +\newglossarystyle{altlongragged4colborder}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{altlongragged4colheaderborder}{% + \setglossarystyle{altlongragged4col}% + \renewenvironment{theglossary}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-mcols-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-mcols-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-mcols}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{multicol} +\RequirePackage{glossary-tree}[=v4.49] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glsmcols}{2} +\newglossarystyle{mcolindex}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem + \let\subitem\glstreesubitem + \let\subsubitem\glstreesubsubitem + }% + {\end{multicols}}% +} +\newglossarystyle{mcolindexgroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\indexspace}% +} +\newglossarystyle{mcolindexhypergroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{mcolindexspannav}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem}% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{mcoltree}{% + \setglossarystyle{tree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% +} +\newglossarystyle{mcoltreegroup}{% + \setglossarystyle{mcoltree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcoltreehypergroup}{% + \setglossarystyle{mcoltree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreespannav}{% + \setglossarystyle{tree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreenoname}{% + \setglossarystyle{treenoname}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% +} +\newglossarystyle{mcoltreenonamegroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcoltreenonamehypergroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcoltreenonamespannav}{% + \setglossarystyle{treenoname}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcolalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols} + \def\@gls@prevlevel{-1}% + \mbox{}\par + }% + {\par\end{multicols}}% +} +\newglossarystyle{mcolalttreegroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{mcolalttreehypergroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand*{\glossaryheader}{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newglossarystyle{mcolalttreespannav}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \begin{multicols}{\glsmcols}[\noindent\glstreenavigationfmt{\glsnavigation}] + \def\@gls@prevlevel{-1}% + \mbox{}\par + }% + {\par\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-super-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-super-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-super}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{supertabular} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{super}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi +} +\newglossarystyle{superborder}{% + \setglossarystyle{super}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superheader}{% + \setglossarystyle{super}% +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & + \bfseries\descriptionname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superheaderborder}{% + \setglossarystyle{super}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super3col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & \tabularnewline}% + \fi +} +\newglossarystyle{super3colborder}{% + \setglossarystyle{super3col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super3colheader}{% + \setglossarystyle{super3col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{super3colheaderborder}{% + \setglossarystyle{super3colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{super4col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{llll}}{% + \end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & & \tabularnewline}% + \fi +} +\newglossarystyle{super4colheader}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{llll}}% + {\end{supertabular}}% +} +\newglossarystyle{super4colborder}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +\newglossarystyle{super4colheaderborder}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4col}{% + \setglossarystyle{super4col}% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colheader}{% + \setglossarystyle{super4colheader}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colborder}{% + \setglossarystyle{super4colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuper4colheaderborder}{% + \setglossarystyle{super4colheaderborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-superragged-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-superragged-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-superragged}[2021/11/01 v4.49 (NLCT)] +\RequirePackage{array} +\RequirePackage{supertabular} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +\newglossarystyle{superragged}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi +} +\newglossarystyle{superraggedborder}{% + \setglossarystyle{superragged}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superraggedheader}{% + \setglossarystyle{superragged}% +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & \bfseries \descriptionname + \tabularnewline}% + \tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superraggedheaderborder}{% + \setglossarystyle{superragged}% + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & \tabularnewline}% + \fi +} +\newglossarystyle{superragged3colborder}{% + \setglossarystyle{superragged3col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3colheader}{% + \setglossarystyle{superragged3col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{superragged3colheaderborder}{% + \setglossarystyle{superragged3colborder}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & & \tabularnewline}% + \fi +} +\newglossarystyle{altsuperragged4colheader}{% + \setglossarystyle{altsuperragged4col}% + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4colborder}{% + \setglossarystyle{altsuper4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +\newglossarystyle{altsuperragged4colheaderborder}{% + \setglossarystyle{altsuperragged4col}% + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-tree-2021-11-01.sty> +% \end{macrocode} +%\fi +%\subsection{Rollback v4.49 (glossary-tree-2021-11-01.sty)} +% Version 4.49 preserved for rollback. +% \begin{macrocode} +\ProvidesPackage{glossary-tree}[2021/11/01 v4.49 (NLCT)] +\providecommand{\indexspace}{% + \par \vskip 10\p@ \@plus 5\p@ \@minus 3\p@ \relax +} +\newcommand*{\glstreenamefmt}[1]{\textbf{#1}} +\newcommand*{\glstreegroupheaderfmt}[1]{\glstreenamefmt{#1}} +\newcommand*{\glstreenavigationfmt}[1]{\glstreenamefmt{#1}} +\ifdef\@idxitem +{\newcommand{\glstreeitem}{\@idxitem}} +{\newcommand{\glstreeitem}{\par\hangindent40\p@}} +\ifdef\subitem +{\let\glstreesubitem\subitem} +{\newcommand\glstreesubitem{\glstreeitem\hspace*{20\p@}}} +\ifdef\subsubitem +{\let\glstreesubsubitem\subsubitem} +{\newcommand\glstreesubsubitem{\glstreeitem\hspace*{30\p@}}} +\newcommand{\glstreepredesc}{\space} +\newcommand{\glstreechildpredesc}{\space} +\newglossarystyle{index}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\glstreeitem + \let\subitem\glstreesubitem + \let\subsubitem\glstreesubsubitem + }% + {\par}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glossentry}[2]{% + \item\glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc \glossentrydesc{##1}\glspostdescription\space ##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription\space ##3% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +\newglossarystyle{indexgroup}{% + \setglossarystyle{index}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \indexspace + }% +} +\newglossarystyle{indexhypergroup}{% + \setglossarystyle{index}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +\newglossarystyle{tree}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc\glossentrydesc{##1}\glspostdescription\space##2\par + }% + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription\space ##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +\newglossarystyle{treegroup}{% + \setglossarystyle{tree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par + \indexspace}% +} +\newglossarystyle{treehypergroup}{% + \setglossarystyle{tree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newlength\glstreeindent +\setlength{\glstreeindent}{10pt} +\newglossarystyle{treenoname}{% + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \glstreepredesc\glossentrydesc{##1}\glspostdescription\space##2\par + }% + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + \glossentrydesc{##2}\glspostdescription\space##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{treenonamegroup}{% + \setglossarystyle{treenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt + {\glsgetgrouptitle{##1}}\par\indexspace}% +} +\newglossarystyle{treenonamehypergroup}{% + \setglossarystyle{treenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +\newrobustcmd*{\glsfindwidesttoplevelname}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \letcs{\@glswidestname}{glo@\glsdetoklabel{\@glo@label}@name}% + \fi + }% + }% + }% +} +\newcommand*{\glssetwidest}[2][0]{% + \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{% + #2}% +} +\newcommand*{\@glswidestname}{} +\newcommand*{\glstreenamebox}[2]{% + \makebox[#1][l]{#2}% +} +\newglossarystyle{alttree}{% + \renewenvironment{theglossary}% + {\def\@gls@prevlevel{-1}% + \mbox{}\par}% + {\par}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{\glstreenamefmt{\@glswidestname\space}}% + \fi + \hangindent\glstreeindent + \parindent\glstreeindent + \makebox[0pt][r]{\glstreenamebox{\glstreeindent}{% + \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}}}% + \ifglshassymbol{##1}{(\glossentrysymbol{##1})\space}{}% + \glossentrydesc{##1}\glspostdescription \space ##2\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\subglossentry}[3]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\glstreenamefmt{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\glstreenamefmt{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\glstreenamefmt{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \hangindent\glstreeindent + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% + \ifglshassymbol{##2}{(\glossentrysymbol{##2})\space}{}% + \glossentrydesc{##2}\glspostdescription\space ##3\par + \def\@gls@prevlevel{##1}% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +\newglossarystyle{alttreegroup}{% + \setglossarystyle{alttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \par\indexspace}% +} +\newglossarystyle{alttreehypergroup}{% + \setglossarystyle{alttree}% + \renewcommand*{\glossaryheader}{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-acronym-desc.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-acronym.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-acronyms-lang.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-brief.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-childmultipar.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-childnoname.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-cite.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-images.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-long.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-longchild.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-multipar.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-parent.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-symbolnames.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-symbols.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-url.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%< +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*glossaries.perl> +%<*glossaries.l2h> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -# File : glossaries.perl +# File : glossaries.l2h # Author : Nicola L.C. Talbot -# Date : 14th June 2007 -# Last Modified : 2014-09-24 -# Version : 1.06 -# Description : LaTeX2HTML (limited!) implementation of glossaries +# Version : 4.50 (2022-10-14) +# Description : LaTeX2HTML (limited!) implementation of glossaries # package. Note that not all the glossaries.sty # macros have been implemented. -# Note that this may not work with new versions of -# LaTeX2HTML. - +# +# Note that this may not work with new versions of +# LaTeX2HTML. There are no plans to continue to +# development as the glossaries package is now too large to +# reimplement in Perl. +# +# This file has been renamed from glossaries.perl to glossaries.l2h +# but it may need to be changed back. This file should be copied +# to somewhere that LaTeX2HTML can find it. +# # This is a LaTeX2HTML style implementing the glossaries package, and # is distributed as part of that package. -# Copyright 2007 Nicola L.C. Talbot +# +# Copyright 2007-2022 Nicola L.C. Talbot # This work may be distributed and/or modified under the # conditions of the LaTeX Project Public License, either version 1.3 # of this license of (at your option) any later version. @@ -39007,17 +54757,16 @@ you # # The Current Maintainer of this work is Nicola Talbot. -# This work consists of the files glossaries.dtx and glossaries.ins +# This work consists of the files glossaries.dtx and glossaries.ins # and the derived files glossaries.sty, glossaries-prefix.sty, -# glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, +# glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, # glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, -# glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, -# glossary-tree.sty, glossaries-compatible-207.sty, -# glossaries-compatible-307.sty, glossaries-accsupp.sty, +# glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, +# glossary-tree.sty, glossaries-compatible-207.sty, +# glossaries-compatible-307.sty, glossaries-accsupp.sty, # glossaries-babel.sty, glossaries-polyglossia.sty, glossaries.perl. # Also makeglossaries and makeglossaries-lite.lua. - package main; &do_require_package("mfirstuc"); @@ -39362,7 +55111,7 @@ sub gls_compare{ { # already checked for '0' < x < '9' and '0' < y < '9' # already checked for 'a' < x < 'z' and '0' < y < '9' - + # digits greater than symbols return 1; } @@ -39370,7 +55119,7 @@ sub gls_compare{ { # already checked for x is digit and y a is letter # already checked for x is letter and y a is letter - + # symbols and digits are less than letters return -1; @@ -39510,12 +55259,12 @@ sub add_real_gls{ { my $id2 = ++$global{'max_id'}; - $thisglsentry .= + $thisglsentry .= "\\glossarysubentryfield $OP$id2$CP$level$OP$id2$CP$glossaryentryfield$OP$id$CP$linktext$OP$id$CP"; } else { - $thisglsentry .= + $thisglsentry .= "\\glossaryentryfield $glossaryentryfield$OP$id$CP$linktext$OP$id$CP"; } @@ -39551,7 +55300,7 @@ sub add_real_gls{ $previousentry = $entry; # Back ref - + if ($gls_nonumberlist{$type}) { $linktext = ''; @@ -39596,13 +55345,13 @@ sub add_real_gls{ { my $id2 = ++$global{'max_id'}; - $thisglsentry .= + $thisglsentry .= "\\glossarysubentryfield $OP$id2$CP$level$OP$id2$CP$glossaryentryfield$OP$id$CP$linktext$OP$id$CP"; } else { $id = ++$global{'max_id'}; - $thisglsentry .= + $thisglsentry .= "\\glossaryentryfield $glossaryentryfield$OP$id$CP$linktext$OP$id$CP"; } } @@ -39636,10 +55385,10 @@ sub do_cmd_newglossarystyle{ local($id,$style,$defs); - $style = &missing_braces unless + $style = &missing_braces unless s/$next_pair_rx/$id=$1;$style=$2;''/eo; - $defs = &missing_braces unless + $defs = &missing_braces unless s/$next_pair_rx/$id=$1;$defs=$2;''/eo; $glossary_style{$style} = $defs; @@ -39652,7 +55401,7 @@ sub do_cmd_glossarystyle{ local($id,$style); - $style = &missing_braces unless + $style = &missing_braces unless s/$next_pair_pr_rx/$id=$1;$style=$2;''/eo; &set_glossarystyle($style); @@ -39694,7 +55443,7 @@ sub set_glossarystyle{ sub do_cmd_glspar{ "

".$_[0]; } -sub do_cmd_glossaryheader{ +sub do_cmd_glossaryheader{ local($_) = @_; $_ } @@ -39721,7 +55470,7 @@ sub do_cmd_glssubentryitem{ $_ } -sub do_cmd_glsgroupheading{ +sub do_cmd_glsgroupheading{ local($_) = @_; local($id, $heading); @@ -39792,13 +55541,13 @@ sub do_env_theglossary{ } sub set_glossarystyle_altlist{ - eval(<<'END_STYLE'); - sub do_cmd_glossaryheader{ + eval(<<'END_STYLE'); + sub do_cmd_glossaryheader{ local($_) = @_; $_ } - sub do_cmd_glsgroupheading{ + sub do_cmd_glsgroupheading{ local($_) = @_; local($id, $heading); @@ -39836,7 +55585,7 @@ sub set_glossarystyle_altlist{ sub do_cmd_glossarysubentryfield{ local($_) = @_; - local($id, $id2, $id3, $id4, $id5, $id6, $level, + local($id, $id2, $id3, $id4, $id5, $id6, $level, $label, $name, $desc, $symbol, $backlink); $level = &missing_braces unless @@ -39856,7 +55605,7 @@ sub set_glossarystyle_altlist{ $backlink = &missing_braces unless s/$next_pair_pr_rx/$id6=$1;$backlink=$2;''/eo; - + "

\\glssubentryitem $OP$id$CP$label$OP$id$CP" ."\\glstarget $OP$id2$CP$label$OP$id2$CP$OP$id3$CP$name$OP$id3$CP" ."$desc\\glspostdescription\\space $backlink\n$_"; @@ -39871,13 +55620,13 @@ END_STYLE } sub set_glossarystyle_inline{ - eval(<<'END_STYLE'); - sub do_cmd_glossaryheader{ + eval(<<'END_STYLE'); + sub do_cmd_glossaryheader{ local($_) = @_; $_ } - sub do_cmd_glsgroupheading{ + sub do_cmd_glsgroupheading{ local($_) = @_; local($id, $heading); @@ -39917,14 +55666,14 @@ sub set_glossarystyle_inline{ if ($desc) { - $field .= + $field .= "\\glsinlinedescformat $OP$id3$CP$desc$OP$id3$CP" ."$OP$id4$CP$symbol$OP$id4$CP" ."$OP$id5$CP$backlink$OP$id5$CP"; } else { - $field .= + $field .= "\\glsinlineemptydescformat " ."$OP$id4$CP$symbol$OP$id4$CP" ."$OP$id5$CP$backlink$OP$id5$CP"; @@ -39950,7 +55699,7 @@ sub set_glossarystyle_inline{ sub do_cmd_glossarysubentryfield{ local($_) = @_; - local($id, $id2, $id3, $id4,$id5,$id6,$level, + local($id, $id2, $id3, $id4,$id5,$id6,$level, $label, $name, $desc, $symbol, $backlink); $level = &missing_braces unless @@ -40318,7 +56067,7 @@ sub do_real_glossary { local($type,$pat) = &get_next_optional_argument; - $entry = &missing_braces unless + $entry = &missing_braces unless (s/$next_pair_pr_rx//o&&($entry=$2)); $anchor = &make_glossary_entry($entry,$anchor_invisible_mark,$type); @@ -40401,13 +56150,13 @@ sub do_cmd_newglossary{ ($opt,$pat) = &get_next_optional_argument; - $type = &missing_braces unless + $type = &missing_braces unless (s/$next_pair_pr_rx//o&&($type=$2)); - $in = &missing_braces unless + $in = &missing_braces unless (s/$next_pair_pr_rx//o&&($in=$2)); - $out = &missing_braces unless + $out = &missing_braces unless (s/$next_pair_pr_rx//o&&($out=$2)); - $title = &missing_braces unless + $title = &missing_braces unless (s/$next_pair_pr_rx//o&&($title=$2)); ($opt,$pat) = &get_next_optional_argument; @@ -40569,7 +56318,7 @@ sub do_cmd_newacronym{ sub gls_entry_init{ local($label, $type, $name, $desc) = @_; - %{$glsentry{$label}} = + %{$glsentry{$label}} = ( type => $type, name => $name, 'sort' => $name, @@ -40585,7 +56334,7 @@ sub gls_entry_init{ parent => '' ); - $#{@{$glsentry{$label}{children}}} = -1; + $#{@{$glsentry{$label}{children}}} = -1; $glsentry{$label}; } @@ -43460,7 +59209,7 @@ _IGNORED_CMDS_ %\fi %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\Finale diff --git a/macros/latex/contrib/glossaries/glossaries.ins b/macros/latex/contrib/glossaries/glossaries.ins index 4f90432115..30f427235c 100644 --- a/macros/latex/contrib/glossaries/glossaries.ins +++ b/macros/latex/contrib/glossaries/glossaries.ins @@ -1,10 +1,10 @@ -% glossaries.ins generated using makedtx version 1.2 2021/11/1 18:45 +% glossaries.ins generated using makedtx version 1.2 2022/10/17 16:00 \input docstrip \preamble glossaries.dtx - Copyright 2021 Nicola Talbot + Copyright 2022 Nicola Talbot This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -18,7 +18,7 @@ The Current Maintainer of this work is Nicola Talbot. - This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list-2020-03-19.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childmultipar.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-longchild.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbolnames.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, glossaries-2020-03-19.sty, glossaries.perl. + This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-prefix.sty, glossaries-accsupp.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-2020-03-19.sty, glossaries-accsupp-2020-03-19.sty, glossaries-babel-2020-03-19.sty, glossaries-compatible-207-2020-03-19.sty, glossaries-compatible-307-2020-03-19.sty, glossaries-polyglossia-2020-03-19.sty, glossaries-prefix-2020-03-19.sty, glossary-hypernav-2020-03-19.sty, glossary-inline-2020-03-19.sty, glossary-list-2020-03-19.sty, glossary-long-2020-03-19.sty, glossary-longbooktabs-2020-03-19.sty, glossary-longragged-2020-03-19.sty, glossary-mcols-2020-03-19.sty, glossary-super-2020-03-19.sty, glossary-superragged-2020-03-19.sty, glossary-tree-2020-03-19.sty, glossaries-2021-11-01.sty, glossaries-accsupp-2021-11-01.sty, glossaries-babel-2021-11-01.sty, glossaries-compatible-207-2021-11-01.sty, glossaries-compatible-307-2021-11-01.sty, glossaries-polyglossia-2021-11-01.sty, glossaries-prefix-2021-11-01.sty, glossary-hypernav-2021-11-01.sty, glossary-inline-2021-11-01.sty, glossary-list-2021-11-01.sty, glossary-long-2021-11-01.sty, glossary-longbooktabs-2021-11-01.sty, glossary-longragged-2021-11-01.sty, glossary-mcols-2021-11-01.sty, glossary-super-2021-11-01.sty, glossary-superragged-2021-11-01.sty, glossary-tree-2021-11-01.sty, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childmultipar.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-longchild.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbolnames.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, glossaries.l2h. \endpreamble @@ -26,14 +26,10 @@ \generate{\file{glossaries.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries.sty,package}} -\file{glossaries-prefix.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-prefix.sty,package}} \file{glossary-hypernav.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-hypernav.sty,package}} \file{glossary-inline.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-inline.sty,package}} -\file{glossary-list-2020-03-19.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-list-2020-03-19.sty,package}} \file{glossary-list.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-list.sty,package}} \file{glossary-long.sty}{\usepreamble\defaultpreamble @@ -50,16 +46,86 @@ \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-superragged.sty,package}} \file{glossary-tree.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-tree.sty,package}} -\file{glossaries-compatible-207.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-207.sty,package}} -\file{glossaries-compatible-307.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-307.sty,package}} -\file{glossaries-accsupp.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-accsupp.sty,package}} \file{glossaries-babel.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-babel.sty,package}} \file{glossaries-polyglossia.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-polyglossia.sty,package}} +\file{glossaries-prefix.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-prefix.sty,package}} +\file{glossaries-accsupp.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-accsupp.sty,package}} +\file{glossaries-compatible-207.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-207.sty,package}} +\file{glossaries-compatible-307.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-307.sty,package}} +\file{glossaries-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-2020-03-19.sty,package}} +\file{glossaries-accsupp-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-accsupp-2020-03-19.sty,package}} +\file{glossaries-babel-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-babel-2020-03-19.sty,package}} +\file{glossaries-compatible-207-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-207-2020-03-19.sty,package}} +\file{glossaries-compatible-307-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-307-2020-03-19.sty,package}} +\file{glossaries-polyglossia-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-polyglossia-2020-03-19.sty,package}} +\file{glossaries-prefix-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-prefix-2020-03-19.sty,package}} +\file{glossary-hypernav-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-hypernav-2020-03-19.sty,package}} +\file{glossary-inline-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-inline-2020-03-19.sty,package}} +\file{glossary-list-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-list-2020-03-19.sty,package}} +\file{glossary-long-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-long-2020-03-19.sty,package}} +\file{glossary-longbooktabs-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-longbooktabs-2020-03-19.sty,package}} +\file{glossary-longragged-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-longragged-2020-03-19.sty,package}} +\file{glossary-mcols-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-mcols-2020-03-19.sty,package}} +\file{glossary-super-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-super-2020-03-19.sty,package}} +\file{glossary-superragged-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-superragged-2020-03-19.sty,package}} +\file{glossary-tree-2020-03-19.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-tree-2020-03-19.sty,package}} +\file{glossaries-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-2021-11-01.sty,package}} +\file{glossaries-accsupp-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-accsupp-2021-11-01.sty,package}} +\file{glossaries-babel-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-babel-2021-11-01.sty,package}} +\file{glossaries-compatible-207-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-207-2021-11-01.sty,package}} +\file{glossaries-compatible-307-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-307-2021-11-01.sty,package}} +\file{glossaries-polyglossia-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-polyglossia-2021-11-01.sty,package}} +\file{glossaries-prefix-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-prefix-2021-11-01.sty,package}} +\file{glossary-hypernav-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-hypernav-2021-11-01.sty,package}} +\file{glossary-inline-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-inline-2021-11-01.sty,package}} +\file{glossary-list-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-list-2021-11-01.sty,package}} +\file{glossary-long-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-long-2021-11-01.sty,package}} +\file{glossary-longbooktabs-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-longbooktabs-2021-11-01.sty,package}} +\file{glossary-longragged-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-longragged-2021-11-01.sty,package}} +\file{glossary-mcols-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-mcols-2021-11-01.sty,package}} +\file{glossary-super-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-super-2021-11-01.sty,package}} +\file{glossary-superragged-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-superragged-2021-11-01.sty,package}} +\file{glossary-tree-2021-11-01.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-tree-2021-11-01.sty,package}} \file{example-glossaries-acronym-desc.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-acronym-desc.tex}} \file{example-glossaries-acronym.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-acronym.tex}} \file{example-glossaries-acronyms-lang.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-acronyms-lang.tex}} @@ -75,9 +141,7 @@ \file{example-glossaries-symbolnames.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-symbolnames.tex}} \file{example-glossaries-symbols.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-symbols.tex}} \file{example-glossaries-url.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{example-glossaries-url.tex}} -\file{glossaries-2020-03-19.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-2020-03-19.sty,package}} -\file{glossaries.perl}{\nopreamble\nopostamble\from{glossaries.dtx}{glossaries.perl}} +\file{glossaries.l2h}{\nopreamble\nopostamble\from{glossaries.dtx}{glossaries.l2h}} } \endbatchfile diff --git a/macros/latex/contrib/glossaries/glossariesbegin.html b/macros/latex/contrib/glossaries/glossariesbegin.html index 36b22ec2f1..f93be2f57d 100644 --- a/macros/latex/contrib/glossaries/glossariesbegin.html +++ b/macros/latex/contrib/glossaries/glossariesbegin.html @@ -1,4097 +1,1866 @@ - - - - - - - - - - + + + + + + + + + The glossaries package v4.50: +a guide for beginners - -

-

- - - -

- - - -

-
-

-

The glossaries package v4.49: a guide for -beginners -

-
-
Nicola L.C. Talbot
dickimaw-books.com
-
-

2021-11-01

-
-

-Abstract -

-

The glossaries package is very flexible, but this means that it has a lot of - options, and since a user guide is supposed to provide a complete list of all - the high-level user commands, the main user manual is quite big. This can - be rather daunting for beginners, so this document is a brief introduction - just to help get you started. If you find yourself saying, “Yeah, but how - can I do…?” then it’s time to move on to the main user manual. -

I’ve made some statements in this document that don’t actually tell - you the full truth, but it would clutter the document and cause confusion - if I keep writing “except when …” or “but you can also do this, that or - the other” or “you can do it this way but you can also do it that way, but - that way may cause complications under certain circumstances”. -

-
-

Contents

- -

-

-

Top

1 Getting Started

-

As with all packages, you need to load glossaries with \usepackage, but -there are certain packages that must be loaded before glossaries, if they are -required: hyperref, babel, polyglossia, inputenc and fontenc. (You don’t have -to load these packages, but if you want them, you must load them before -glossaries.) -

If you require multilingual support you must also install the relevant -language module. Each language module is called glossaries-language⟩, where -⟨language⟩ is the root language name. For example, glossaries-french or -glossaries-german. If a language module is required, the glossaries package will -automatically try to load it and will give a warning if the module isn’t found. -
-

-

Once you have loaded glossaries, you need to define your terms in the -preamble and then you can use them throughout the document. Here’s a simple -example: - - - -

-
- \documentclass{article}
- \usepackage{glossaries}
- \newglossaryentry{ex}{name={sample},description={an example}}
- \begin{document}
- Here's my \gls{ex} term.
- \end{document}
-
-

This produces: -

-

Here’s my sample term.

-

Here’s another example: - - - -

-
- \documentclass{article}
- \usepackage{glossaries}
- \setacronymstyle{long-short}
- \newacronym{svm}{SVM}{support vector machine}
- \begin{document}
- First use: \gls{svm}. Second use: \gls{svm}.
- \end{document}
-
-

This produces: -

-

First use: support vector machine (SVM). Second use: SVM.

-

In this case, the text produced by \gls{svm} changed after the first use. The first use -produced the long form followed by the short form in parentheses because I set the -acronym style to long-short. I suggest you try the above two examples to -make sure you have the package correctly installed. If you get an undefined -control sequence error, check that the version number at the top of this -document matches the version you have installed. (Open the .log file and search -for the line that starts with Package: glossaries followed by a date and -version.) -

Be careful of fragile commands. If a command causes a problem when used in one -of the \newglossaryentry fields, consider adding \glsnoexpandfields before you -start defining your entries.
-

-

Abbreviations are slightly different if you use the extension package glossaries-extra -(which needs to be installed separately): - - - -

-
- \documentclass{article}
- \usepackage{glossaries-extra}
- \setabbreviationstyle{long-short}% glossaries-extra.sty
- \newabbreviation{svm}{SVM}{support vector machine}% glossaries-extra.sty
- \begin{document}
- First use: \gls{svm}. Second use: \gls{svm}.
- \end{document}
-
-

Since long-short happens to be the default for \newabbreviation (if you haven’t -set the category key) you may omit the \setabbreviationstyle line in this -example. -

If you still want to use \newacronym (rather than \newabbreviation) then you -need the optional argument of \setabbreviationstyle: - - - -

-
- \documentclass{article}
- \usepackage{glossaries-extra}
- \setabbreviationstyle[acronym]{long-short}% glossaries-extra.sty only
- \newacronym{svm}{SVM}{support vector machine}
- \begin{document}
- First use: \gls{svm}. Second use: \gls{svm}.
- \end{document}
-
-

In this example, if you omit the \setabbreviationstyle line you will notice a -difference because the short-nolong style (not the long-short style) is the default -with \newacronym. With the short-nolong style the first use simply shows just the -short form. -

You can’t use \setacronymstyle with glossaries-extra.
-

-

If you like, you can put all your definitions in another file (for example, -defns.tex) and load that file in the preamble using \loadglsentries with the -filename as the argument. For example: - - - -

-
-\loadglsentries{defns}
-
-

If you find you have a really large number of definitions that are hard to manage in a -.tex file, you might want to have a look at bib2gls (installed separately) which -requires a .bib format instead that can be managed by an application such as -JabRef. -

Don’t try inserting formatting commands into the definitions as they can interfere -with the underlying mechanism. Instead, the formatting should be done by the -style. For example, suppose I want to replace SVM with \textsc{svm}, then -I need to select a style that uses \textsc, like this (for the base glossaries -style): - - - -

-
- \documentclass{article}
- \usepackage{glossaries}
- \setacronymstyle{long-sc-short}
- \newacronym{svm}{svm}{support vector machine}
- \begin{document}
- First use: \gls{svm}. Second use: \gls{svm}.
- \end{document}
-
-

The abbreviation styles have a different naming scheme with glossaries-extra: - - - -

-
- \documentclass{article}
- \usepackage{glossaries-extra}
- \setabbreviationstyle{long-short-sc}% glossaries-extra.sty
- \newabbreviation{svm}{svm}{support vector machine}% glossaries-extra.sty
- \begin{document}
- First use: \gls{svm}. Second use: \gls{svm}.
- \end{document}
-
-

With glossaries-extra you can have multiple abbreviation styles for different -categories. Many of these styles have their own associated formatting commands that -can be redefined for minor adjustments. For example: - - - -

-
- \documentclass{article}
- \usepackage{glossaries-extra}
- \setabbreviationstyle[statistical]{long-short-sc}
- \setabbreviationstyle[bacteria]{long-only-short-only}
- % Formatting commands used by 'long-only-short-only' style:
- \renewcommand*{\glsabbrvonlyfont}[1]{\emph{#1}}
- \renewcommand*{\glslongonlyfont}[1]{\emph{#1}}
- % Formatting command used by 'long-short-sc' style:
- % (make sure abbreviation is converted to lower case)
- \renewcommand*{\glsabbrvscfont}[1]{\textsc{\MakeLowercase{#1}}}
- \newabbreviation
-  [
-    category={statistical}% glossaries-extra.sty key
-  ]
-  {svm}{SVM}{support vector machine}
- \newabbreviation
-  [
-    category={bacteria}% glossaries-extra.sty key
-  ]
-  {cbot}{C.~botulinum}{Clostridium botulinum}
- \begin{document}
- First use: \gls{svm}, \gls{cbot}.
- Next use: \gls{svm}, \gls{cbot}.
- \end{document}
-
-

This produces: -

-

First use: support vector machine (svm), Clostridium botulinum. -

Next use: svm, C. botulinum.

-

As you can hopefully see from the above examples, there are two main ways of -defining a term: as a general entry (\newglossaryentry) or as an abbreviation -(\newacronym or, with glossaries-extra, \newabbreviation). -

Regardless of the method of defining a term, the term is always given a - - - -label. In the first example, the label was ex and in the other examples the -label was svm (and cbot in the last example). The label is used to uniquely -identify the term (like the standard \label/\ref or \cite mechanism). -It’s best to just use the following alphanumerics in the labels: a, …, z, A, …, -Z, 0, …, 9. Sometimes you can also use punctuation characters but not if -another package (such as babel) makes them active. Don’t try using any -characters outside of the basic Latin set with inputenc (for example, é or ß) -or things will go horribly wrong. This warning only applies to the label. -It doesn’t apply to the text that appears in the document. If you really -need UTF-8 characters in your labels then you’ll need to use XeLaTeX or -LuaLaTeX. -

Don’t use \gls in chapter or section headings as it can have some unpleasant -side-effects. Instead use \glsentrytext for regular entries and one of \glsentryshort, -\glsentrylong or \glsentryfull for acronyms. Alternatively use glossaries-extra -which provides special commands for use in section headings and captions, such as -\glsfmtshort{label}.
-

-

The above examples are reasonably straightforward. The difficulty comes if you -want to display a sorted list of all the entries you have used in the document. The -glossaries-extra package provides a really easy way of listing all the defined -entries: - - - -

-
- \documentclass{article}
- \usepackage[sort=none]{glossaries-extra}
- \newglossaryentry{potato}{name={potato},plural={potatoes},
-  description={starchy tuber}}
- \newglossaryentry{cabbage}{name={cabbage},
-  description={vegetable with thick green or purple leaves}}
- \newglossaryentry{turnip}{name={turnip},
-  description={round pale root vegetable}}
- \newglossaryentry{carrot}{name={carrot},
-  description={orange root}}
- \begin{document}
- Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
- \printunsrtglossaries % list all entries
- \end{document}
-
-

However this method doesn’t sort the entries (they’re listed in order of definition) -and it will display all the defined entries, regardless of whether or not you’ve used -them all in the document, so “turnip” appears in the glossary even though there’s no -\gls{turnip} (or similar) in the document. -

The sort=none option isn’t essential in this case (there’s no other sort option -available for this document), but it prevents the automatic construction of the sort -value and so slightly improves the document build time. -

Note that this example document uses the same command (\printunsrtglossaries) -that’s used with bib2gls (Option 4) but with bib2gls you instead need to use the -record package option and one or more instances of \GlsXtrLoadResources in the -preamble (see below). -

Most users prefer to have an automatically sorted list that only contains entries -that have been used in the document. The glossaries package provides three -options: use TeX to perform the sorting (Option 1); use makeindex to perform -the sorting (Option 2); use xindy to perform the sorting (Option 3). The -extension package glossaries-extra provides a fourth method: use bib2gls -(Option 4). -

The first option (using TeX) is the simplest method, as it doesn’t require an -external tool, but it’s very inefficient and the sorting is done according to lower case -character code (which matches basic Latin alphabets, such as English, but -not extended Latin alphabets, such as Icelandic). To use this method, add - - - -\makenoidxglossaries to the preamble and put \printnoidxglossaries at the -place where you want your glossary. For example: - - - -

-
- \documentclass{article}
- \usepackage{glossaries}
- \makenoidxglossaries % use TeX to sort
- \newglossaryentry{potato}{name={potato},plural={potatoes},
-  description={starchy tuber}}
- \newglossaryentry{cabbage}{name={cabbage},
-  description={vegetable with thick green or purple leaves}}
- \newglossaryentry{turnip}{name={turnip},
-  description={round pale root vegetable}}
- \newglossaryentry{carrot}{name={carrot},
-  description={orange root}}
- \begin{document}
- Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
- \printnoidxglossaries
- \end{document}
-
-

-

The \makenoidxglossaries method is very slow, uses an ASCII comparator and -often breaks if there are commands in the name key. See Glossaries Performance for a -comparison.
-

-

Try this out and run LaTeX (or pdfLaTeX) twice. The first run won’t show the -glossary. It will only appear on the second run. This doesn’t include “turnip” in the -glossary because that term hasn’t been used (with commands like \gls{turnip}) in -the document. -

The glossary has a vertical gap between the “carrot” term and the “potato” term. -This is because the entries in the glossaries are grouped according to their -first letter. If you don’t want this gap, just add nogroupskip to the package -options: - - - -

-
-\usepackage[nogroupskip]{glossaries}
-
-

or you may want to try out a style that shows the group headings: - - - -

-
-\usepackage[style=indexgroup]{glossaries}
-
-

If you try out this example you may also notice that the description is followed by a -full stop (period) and a number. The number is the location in the document where -the entry was used (page 1 in this case), so you can lookup the term in the glossary -and be directed to the relevant pages. It may be that you don’t want this -back-reference, in which case you can suppress it using the nonumberlist package -option: - - - -

-
-\usepackage[nonumberlist]{glossaries}
-
-

If you don’t like the terminating full stop, you can suppress that with the nopostdot -package option: - - - -

-
-\usepackage[nopostdot]{glossaries}
-
-

-

If you try out the earlier example with glossaries-extra and \printunsrtglossaries -you may notice that the terminating full stop is missing and there are no number -lists. You can add the full stop back with - - - -

-
-\usepackage[nopostdot=false]{glossaries-extra}
-
-

or - - - -

-
-\usepackage[postdot]{glossaries-extra}
-
-

If you want the number lists then you need to use an indexing option. -

You may have noticed that I’ve used another command in the above examples: -\glspl. This displays the plural form. By default, this is just the singular form with -the letter “s” appended, but in the case of “potato” I had to specify the correct -plural using the plural key. -

As I mentioned earlier, using TeX to sort the entries is the simplest but least -efficient method. If you have a large glossary or if your terms contain non-Latin or -extended Latin characters, then you will have a much faster build time if you use -makeindex (Option 2) or xindy (Option 3) or bib2gls (Option 4). If you are -using extended Latin or non-Latin characters, then xindy or bib2gls are -the recommended methods. These methods are described in more detail in -§4 Displaying a List of Entries. -

The rest of this document briefly describes the main commands provided by the -glossaries package. (Most of these are also available with glossaries-extra but may -behave slightly differently.) -

-

-

Top

2 Defining Terms

-

When you use the glossaries package, you need to define glossary entries in the -document preamble. These entries could be a word, phrase, abbreviation or symbol. -They’re usually accompanied by a description, which could be a short sentence or an -in-depth explanation that spans multiple paragraphs. The simplest method of -defining an entry is to use: -


-
-\newglossaryentry{label} -
{ -
  name={name}, -
  description={description}, -
  other options⟩ -
} -
-

- - - -

-where ⟨label⟩ is a unique label that identifies this entry. (Don’t include the angle -brackets ⟨ ⟩. They just indicate the parts of the code you need to change when you use -this command in your document.) The ⟨name⟩ is the word, phrase or symbol -you are defining, and ⟨description⟩ is the description to be displayed in the -glossary. -

This command is a “short” command, which means that ⟨description⟩ can’t -contain a paragraph break. If you have a long description, you can instead -use: -


-
-\longnewglossaryentry{label} -
{ -
  name={name}, -
  other options⟩ -
} -
{description} -
-

-

-

Examples: -

    -
  1. -

    Define the term “set” with the label set: - - - -

    -
    -     \newglossaryentry{set}
    -     {
    -       name={set},
    -       description={a collection of objects}
    -     }
    -
    -

    -

  2. -
  3. -

    Define the symbol with the label emptyset: - - - -

    -
    -     \newglossaryentry{emptyset}
    -     {
    -       name={\ensuremath{\emptyset}},
    -       description={the empty set}
    -     }
    -
    -

    (This will also need a sort key if you use Options 1 or 3, see below.) -

  4. -
  5. -

    Define the phrase “Fish Age” with the label fishage: - - - -

    -
    -     \longnewglossaryentry{fishage}
    -     {name={Fish Age}}
    -     {%
    -       A common name for the Devonian geologic period
    -       spanning from the end of the Silurian Period to
    -       the beginning of the Carboniferous Period.
    -       This age was known for its remarkable variety of
    -       fish species.
    -     }
    -
    -

    (The percent character discards the end of line character that would otherwise - cause an unwanted space to appear at the start of the description.) -

  6. -
  7. -

    Take care if the first letter is an extended Latin or non-Latin character (either - specified via a command such as \’e or explicitly via the inputenc package such - as é). This first letter must be placed in a group: - - - -

    -
    -     \newglossaryentry{elite}
    -     {
    -       name={{\'e}lite},
    -       description={select group or class}
    -     }
    -
    -

    or

    -
    - \newglossaryentry{elite} -
    { -
      name={{é}lite}, -
      description={select group or class} -
    } -
    -
-

(This isn’t necessary for UTF-8 characters with XeLaTeX or LuaLaTeX. For further -details, see the section “UTF-8” of the mfirstuc user manual.) -

If you use bib2gls with glossaries-extra then the terms must be defined in a .bib -file. For example:

-
-% Encoding: UTF-8 -
-
@entry{set, -
  name={set}, -
  description={a collection of objects} -
} -
-
@entry{emptyset, -
  name={\ensuremath{\emptyset}}, -
  description={the empty set} -
} -
-
@entry{fishage, -
  name={Fish Age}, - - - -
  description={A common name for the Devonian geologic period -
  spanning from the end of the Silurian Period to -
  the beginning of the Carboniferous Period. -
-
  This age was known for its remarkable variety of -
  fish species.} -
} -
-
@entry{elite, -
  name={{é}lite}, -
  description={select group or class} -
} -
-
(The .bib format doesn’t allow spaces in labels so you can’t have fish age as the -label, but you can have fish-age.) This method requires the glossaries-extra’s record -package option: - - - -
-\usepackage[record]{glossaries-extra}
-
-

and the .bib file is specified in the resource command. For example, if the -.bib file is called entries.bib then put the following line in the document -preamble: - - - -

-
-\GlsXtrLoadResources[src={entries}]
-
-

You can have a comma-separated list. For example, if you also have entries defined -in the file entries2.bib: - - - -

-
-\GlsXtrLoadResources[src={entries,entries2}]
-
-

-

There are other keys you can use when you define an entry. For example, the name -key indicates how the term should appear in the list of entries (glossary), but if the -term should appear differently when you reference it with \gls{label} in the -document, you need to use the text key as well. -

For example: - - - -

-
-\newglossaryentry{latinalph}
+#main {margin-left: 5%; margin-right: 15%}
+div.tomain {position: absolute; left: 0pt; width: 5%; text-align: right; font-size: x-small;}
+div.tomain a {text-decoration: none;}
+div.labellink {display: inline; font-size: x-small; margin-left: 1em; margin-right: 1em;}
+div.marginleft {position: absolute; left: 0pt; width: 5%;}
+div.marginright {position: absolute; right: 0pt; width: 15%;}
+div.displaymath { display: block; text-align: center; }
+span.eqno { float: right; }
+div.table { display: block; text-align: center; }
+table.tabular-cm
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: center;
+  vertical-align: middle;
+}
+table.tabular-cb
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: center;
+  vertical-align: bottom;
+}
+table.tabular-ct
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: center;
+  vertical-align: top;
+}
+table.tabular-lm
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: left;
+  vertical-align: middle;
+}
+table.tabular-lb
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: left;
+  vertical-align: bottom;
+}
+table.tabular-lt
 {
-  name={Latin Alphabet},
-  text={Latin alphabet},
-  description={alphabet consisting of the letters
-  a, \ldots, z, A, \ldots, Z}
+  display: inline-table;
+  border-collapse: collapse;
+  align: left;
+  vertical-align: top;
 }
-
-

This will appear in the text as “Latin alphabet” but will be listed in the glossary -as “Latin Alphabet”. With bib2gls this entry is defined in the .bib file -as: - - - -

-
-@entry{latinalph,
-  name={Latin Alphabet},
-  text={Latin alphabet},
-  description={alphabet consisting of the letters
-  a, \ldots, z, A, \ldots, Z}
+table.tabular-rm
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: right;
+  vertical-align: middle;
 }
-
-

-

Another commonly used key is plural for specifying the plural of the term. This -defaults to the value of the text key with an “s” appended, but if this is incorrect, -just use the plural key to override it: - - - -

-
-\newglossaryentry{oesophagus}
+table.tabular-rb
 {
-  name={{\oe}sophagus},
-  plural={{\oe}sophagi},
-  description={canal from mouth to stomach}
+  display: inline-table;
+  border-collapse: collapse;
+  align: right;
+  vertical-align: bottom;
 }
-
-

(Remember from earlier that the initial ligature \oe needs to be grouped.) -

Abbreviations can be defined using: -


\newacronym[options]{label}{short}{long}

-

-where ⟨label⟩ is the label (as per \newglossaryentry), ⟨short⟩ is the short form and -⟨long⟩ is the long form. For example, the following defines an abbreviation: - - - -

-
-\newacronym{svm}{SVM}{support vector machine}
-
-

This internally uses \newglossaryentry to define an entry with the label svm. By -default, the name key is set to ⟨short⟩ (“SVM” in the above example) and the -description key is set to ⟨long⟩ (“support vector machine” in the above example). If, -instead, you want to be able to specify your own description you can do this using -the optional argument: - - - -

-
-\newacronym
- [description={statistical pattern recognition technique}]
- {svm}{SVM}{support vector machine}
-
-

-

Before you define your acronyms (or other types of abbreviations), you need to -specify which style to use with: -


\setacronymstyle{style name}

-

-where ⟨style name⟩ is the name of the style. There are a number of predefined styles, -such as: long-short (on first use display the long form with the short form in -parentheses); short-long (on first use display the short form with the long form in -parentheses); long-short-desc (like long-short but you need to specify the -description); or short-long-desc (like short-long but you need to specify the -description). There are some other styles as well that use \textsc to typeset the -acronym or that use a footnote on first use. See the main user guide for further -details. -

The glossaries-extra package provides improved abbreviation handling with a lot -more predefined styles. With this extension package, abbreviations are defined -using: -


\newabbreviation[options]{label}{short}{long}

-

-You can still use \newacronym but it’s redefined to use the new abbreviation -interface. The style must now be set using: -


\setabbreviationstyle[category]{style name}

-

-The default ⟨category⟩ is abbreviation. If you use \newacronym the category is -acronym, which is why you need to use the optional argument if you define -abbreviations with \newacronym when glossaries-extra has been loaded:

-
-\setabbreviationstyle[acronym]{style name} -
-
If you use bib2gls then abbreviations are defined in the .bib file in the format: -
-
-@abbreviation{label, -
  long={long form}, - - - -
  short={short form} -
} -
-
-

The plural forms for abbreviations can be specified using the longplural and -shortplural keys. For example: - - - -

-
-\newacronym
- [longplural={diagonal matrices}]
- {dm}{DM}{diagonal matrix}
-
-

or (with glossaries-extra): - - - -

-
-\newabbreviation % glossaries-extra.sty
- [longplural={diagonal matrices}]
- {dm}{DM}{diagonal matrix}
-
-

If omitted, the defaults are again obtained by appending an “s” to the singular -versions. With bib2gls, the definition in the .bib file is: - - - -

-
-@abbreviation{dm,
-  short={DM},
-  long={diagonal matrix},
-  longplural={diagonal matrices}
+table.tabular-rt
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: right;
+  vertical-align: top;
 }
-
-

-

It’s also possible to have both a name and a corresponding symbol. -Just use the name key for the name and the symbol key for the symbol. For -example: - - - -

-
-\newglossaryentry{emptyset}
+table.tabular-m
 {
-  name={empty set},
-  symbol={\ensuremath{\emptyset}},
-  description={the set containing no elements}
+  display: inline-table;
+  border-collapse: collapse;
+  vertical-align: middle;
 }
-
-

or with bib2gls the definition in the .bib file is: - - - -

-
-@entry{emptyset,
-  name={empty set},
-  symbol={\ensuremath{\emptyset}},
-  description={the set containing no elements}
+table.tabular-b
+{
+  display: inline-table;
+  border-collapse: collapse;
+  vertical-align: bottom;
+}
+table.tabular-t
+{
+  display: inline-table;
+  border-collapse: collapse;
+  vertical-align: top;
 }
-
-

-

If you want the symbol in the name field then you must supply a sort value with -Options 1 and 3 otherwise you’ll end up with errors from TeX or xindy. With -Option 2 (makeindex) it’s not quite so important but you may find the resulting -order is a little odd. For example: - - - -

-
-\newglossaryentry{emptyset}
+table.tabular-l
 {
-  name={\ensuremath{\emptyset}},
-  sort={empty set},
-  description={the set containing no elements}
+  display: inline-table;
+  border-collapse: collapse;
+  align: left;
 }
-
-

This displays the symbol as but sorts according to “empty set”. You -may want to consider using glossaries-extra’s symbols package option which -provides -


\glsxtrnewsymbol[options]{label}{symbol}

-

-This internally uses \newglossaryentry but automatically sets the sort key to the -⟨label⟩. For example: - - - -

-
-\documentclass{article}
-\usepackage[symbols]{glossaries-extra}
-\makeglossaries
-\glsxtrnewsymbol % requires glossaries-extra.sty 'symbols' option
- [description={the set containing no elements}]
- {emptyset}% label (and sort value)
- {\ensuremath{\emptyset}}% symbol
-\begin{document}
-\gls{emptyset}
-\printglossaries
-\end{document}
-
-

Now the sort value is “emptyset” rather than the previous “empty set”. -

With bib2gls you can define this in the .bib file as - - - -

-
-@entry{emptyset,
-  name={\ensuremath{\emptyset}},
-  description={the set containing no elements}
+table.tabular-c
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: center;
 }
-
-

in which case bib2gls will try to interpret the name field to determine the sort -value. Alternatively you can use: - - - -

-
-@symbol{emptyset,
-  name={\ensuremath{\emptyset}},
-  description={the set containing no elements}
+table.tabular-r
+{
+  display: inline-table;
+  border-collapse: collapse;
+  align: right;
 }
-
-

which will use the label (emptyset) as the sort value. (You don’t need the symbols -package option in this case, unless you want a separate symbols list.) The -corresponding document (where the definition is in the file entries.bib) is -now: - - - -

-
-\documentclass{article}
-\usepackage[record]{glossaries-extra}
-\GlsXtrLoadResources[src=entries]
-\begin{document}
-\gls{emptyset}
-\printunsrtglossaries
-\end{document}
-
-

-

Note that while the sort key is advised for symbols when using \makeglossaries or -\makenoidxglossaries it shouldn’t be used with bib2gls. Instead, bib2gls has its -own algorithm for determining the sort value based on the entry type (@entry, -@symbol etc). See bib2gls gallery: sorting for further details. -

-

-

Top

3 Using Entries

-

Once you have defined your entries, as described above, you can reference them in -your document. There are a number of commands to do this, but the most common -one is: -


\gls{label}

-

-where ⟨label⟩ is the label you assigned to the entry when you defined it. For example, -\gls{fishage} will display “Fish Age” in the text (given the definition from the -previous section). If you are using bib2gls then this will display ?? (like -\ref and \cite) until bib2gls has created the relevant files and LaTeX is -rerun. -

If you are using the hyperref package (remember to load it before glossaries) \gls -will create a hyperlink to the corresponding entry in the glossary. If you want to -suppress the hyperlink for a particular instance, use the starred form \gls* for -example, \gls*{fishage}. The other commands described in this section all have a -similar starred form. -

If the entry was defined as an acronym (using \newacronym with glossaries -described above) or an abbreviation (using \newabbreviation with glossaries-extra), -then \gls will display the full form the first time it’s used and just the -short form on subsequent use. For example, if the style is set to long-short, -then \gls{svm} will display “support vector machine (SVM)” the first time - - - -it’s used, but the next occurrence of \gls{svm} will just display “SVM”. -(If you use \newacronym with glossaries-extra the default doesn’t show the -long form on first use. You’ll need to change the style first, as described -earlier.) -

If you want the plural form, you can use: -


\glspl{label}

-

-instead of \gls{label}. For example, \glspl{set} displays “sets”. -

If the term appears at the start of a sentence, you can convert the first letter to -upper case using: -


\Gls{label}

-

-for the singular form or -


\Glspl{label}

-

-for the plural form. For example: - - - -

-
-\Glspl{set} are collections.
-
-

produces “Sets are collections”. -

If you’ve specified a symbol using the symbol key, you can display it -using: -


\glssymbol{label}

-

-

-

-

Top

4 Displaying a List of Entries

-

In §1 Getting Started, I mentioned that there are three options you can -choose from to create an automatically sorted glossary with the base glossaries -package. These are also available with the extension package glossaries-extra along -with a fourth option. These four options are listed below in a little more detail. -Table +c summarises the main advantages and disadvantages. -(There’s a more detailed summary in the main glossaries user manual.) See also -Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document -build. -

-
- - - -


- - - -
Table 1: Comparison of Glossary Options
-
+ + +
+
The glossaries package v4.50: a guide for beginners
Nicola L.C. Talbot
+ +dickimaw-books.com
2022-10-14

+ +

Abstract
+ The glossaries package is very flexible, but this means that it has a lot of options, and since a user guide is supposed to provide a complete list of all the high-level user commands, the main user manual is quite big. This can be rather daunting for beginners, so this document is a brief introduction just to help get you started. If you find yourself saying, “Yeah, but how can I do…?” then it’s time to move on to the main user manual.

+I’ve made some statements in this document that don’t actually tell you the full truth, but it would clutter the document and cause confusion if I keep writing “except when …” or “but you can also do this, that or the other” or “you can do it this way but you can also do it that way, but that way may cause complications under certain circumstances”.

+

+

+ + + +

+

1. Getting Started

+

+As with all packages, you need to load glossaries with \usepackage, but there are certain packages that must be loaded before glossaries, if they are required: hyperref, babel, polyglossia, inputenc and fontenc. (You don’t have to load these packages, but if you want them, you must load them before glossaries.)

+

+If you require multilingual support you must also install the relevant language module. Each language module is called glossaries-language, where language is the root language name. For example, glossaries-french or glossaries-german. If a language module is required, the glossaries package will automatically try to load it and will give a warning if the module isn’t found.
+

+Once you have loaded glossaries, you need to define your terms in the preamble and then you can use them throughout the document. Here’s a simple example:

\documentclass{article}
+\usepackage{glossaries}
+% define a term:
+\newglossaryentry{ex}{name={sample},description={an example}}
+\begin{document}
+Here's my \gls{ex} term.
+\end{document}
+
This produces:
+Here’s my sample term.
+ Another example:
\documentclass{article}
+\usepackage{glossaries}
+\setacronymstyle{long-short}
+\newacronym{svm}{SVM}{support vector machine}
+\begin{document}
+First use: \gls{svm}. Second use: \gls{svm}.
+\end{document}
+
This produces:
+First use: support vector machine (SVM). Second use: SVM.
+ In this case, the text (the link text) produced by \gls{svm} changed after the first use. The first use produced the long form followed by the short form in parentheses because I set the acronym style to long-short. The subsequent use just showed the short form.

+I suggest you try the above two examples to make sure you have the package correctly installed. If you get an “undefined control sequence” error, check that the version number at the top of this document matches the version you have installed. (Open the log file and search for the line that starts with “Package: glossaries” followed by a date and version.)

+

+Be careful of fragile commands. If a command causes a problem when used in one of the \newglossaryentry fields, consider adding \glsnoexpandfields before you start defining your entries. Where possible use robust semantic commands.
+

+Abbreviations are slightly different if you use the extension package glossaries-extra (which needs to be installed separately):

\documentclass{article}
+% glossaries.sty is automatically loaded by glossaries-extra.sty
+\usepackage{glossaries-extra}
+% commands provided by glossaries-extra:
+\setabbreviationstyle{long-short}
+\newabbreviation{svm}{SVM}{support vector machine}
+\begin{document}
+First use: \gls{svm}. Second use: \gls{svm}.
+\end{document}
+
Since long-short happens to be the default for \newabbreviation you may omit the \setabbreviationstyle line in this example.

+If you still want to use \newacronym (rather than \newabbreviation) then you need the optional argument of \setabbreviationstyle:

\documentclass{article}
+\usepackage{glossaries-extra}
+\setabbreviationstyle[acronym]{long-short}
+\newacronym{svm}{SVM}{support vector machine}
+\begin{document}
+First use: \gls{svm}. Second use: \gls{svm}.
+\end{document}
+
In this example, if you omit the \setabbreviationstyle line you will notice a difference because the short-nolong style (not the long-short style) is the default with \newacronym. With the short-nolong style the first use simply shows just the short form.

+

+You can’t use \setacronymstyle with glossaries-extra.
+

+If you like, you can put all your definitions in another file (for example, defns.tex) and load that file in the preamble using \loadglsentries with the filename as the argument. For example:

\loadglsentries{defns}
+
If you find you have a really large number of definitions that are hard to manage in a tex file, you might want to have a look at bib2gls (installed separately) which requires a bib format instead that can be managed by an application such as JabRef.

+Don’t try inserting formatting commands into the definitions as they can interfere with the underlying mechanism. Instead, the formatting should be done by the style. For example, suppose I want to replace SVM with \textsc{svm}, then I need to select a style that uses \textsc, like this (for the base glossaries style):

\documentclass{article}
+\usepackage{glossaries}
+\setacronymstyle{long-sc-short}
+\newacronym{svm}{svm}{support vector machine}
+\begin{document}
+First use: \gls{svm}. Second use: \gls{svm}.
+\end{document}
+
The abbreviation styles have a different naming scheme with glossaries-extra:
\documentclass{article}
+\usepackage{glossaries-extra}
+\setabbreviationstyle{long-short-sc}% glossaries-extra.sty\newabbreviation{svm}{svm}{support vector machine}
+\begin{document}
+First use: \gls{svm}. Second use: \gls{svm}.
+\end{document}
+
With glossaries-extra you can have multiple abbreviation styles for different categories. Many of these styles have their own associated formatting commands that can be redefined for minor adjustments. For example:
\documentclass{article}
+\usepackage{glossaries-extra}
+\setabbreviationstyle[statistical]{long-short-sc}
+\setabbreviationstyle[bacteria]{long-only-short-only}
+% Formatting commands used by 'long-only-short-only' style:
+\renewcommand*{\glsabbrvonlyfont}[1]{\emph{#1}}
+\renewcommand*{\glslongonlyfont}[1]{\emph{#1}}
+
+% Formatting command used by 'long-short-sc' style:
+% (the following converts the abbreviation to lowercase)
+\renewcommand*{\glsabbrvscfont}[1]{\textsc{\glslowercase{#1}}}
+
+\newabbreviation
+ [
+   category={statistical}% glossaries-extra.sty key ]
+ {svm}{SVM}{support vector machine}
+
+\newabbreviation
+ [
+   category={bacteria}% glossaries-extra.sty key ]
+ {cbot}{C.~botulinum}{Clostridium botulinum}
+
+\begin{document}
+First use: \gls{svm}, \gls{cbot}.
+
+Next use: \gls{svm}, \gls{cbot}.
+\end{document}
+
This produces:
+First use: support vector machine (svm), Clostridium botulinum.

+Next use: svm, C. botulinum.

+

+As you can hopefully see from the above examples, there are two main ways of defining a term: as a general entry (\newglossaryentry) or as an abbreviation (\newacronym or, with glossaries-extra, \newabbreviation).

+Regardless of the method of defining a term, the term is always given a label. In the first example, the label was ex and in the other examples the label was svm (and cbot in the last example). The label is used to uniquely identify the term (like the standard \label/\ref or \cite mechanism). The label may be the same as the text produced with \gls (provided it doesn’t contain any formatting commands) or may be completely different.

+The labels are identified in bold in the following:

\newglossaryentry{elite}{name={élite},
+ description={select group}}
+\newglossaryentry{set}{name={set},
+ description={collection of distinct elements}}
+\newglossaryentry{sym.set}{
+ name={\ensuremath{\mathcal{S}}},
+ description={a set}}
+\newacronym{tool.cnc}{CNC}{computer numerical control}
+\newacronym{police.cnc}{CNC}{civil nuclear constabulary}
+\newacronym{miltary.cnc}{CNC}{commander in chief}
+

+With modern TeX installations you may now be able to use UTF-8 characters in the label, but beware of active characters. For example, babel makes some punctuation characters, such as : (colon), active. This means that the character behaves like a command, which allows extra spacing to be inserted before or after the punctuation mark or provides a shortcut to apply an accent to a following character.

+For example, the following works:

\documentclass{article}
+\usepackage{glossaries}
+\newglossaryentry{sym:set}{name={\ensuremath{\mathcal{S}}},
+ description={a set}}
+\begin{document}
+\gls{sym:set}
+\end{document}
+
However, if babel is loaded with french then the : (colon) character becomes active.
\documentclass{article}
+\usepackage[T1]{fontenc}
+\usepackage[french]{babel}
+\usepackage{glossaries}
+
+% the colon : is a normal character here
+\newglossaryentry{sym:set}{name={\ensuremath{\mathcal{S}}},
+ description={a set}}
+
+\begin{document}
+% the colon : is now an active character
+\gls{sym:set}
+\end{document}
+
You may find that the above example seems to work, but a problem will occur if hyperref and a glossary are added to the document as the active character will interfere with the hyperlink target name.

+

+Don’t use \gls in chapter or section headings as it can have some unpleasant side-effects. Instead use \glsentrytext for regular entries and either \glsentryshort or \glsentrylong for acronyms. Alternatively use glossaries-extra which provides special commands for use in section headings and captions, such as \glsfmttext and \glsfmtshort.
+

+The above examples are reasonably straightforward. The difficulty comes if you want to display a sorted list of all the entries you have used in the document. The glossaries-extra package provides an easy way of listing all the defined entries:

\documentclass{article}
+
+\usepackage[sort=none]{glossaries-extra}
+
+\newglossaryentry{potato}{name={potato},plural={potatoes},
+ description={starchy tuber}}
+
+\newglossaryentry{cabbage}{name={cabbage},
+ description={vegetable with thick green or purple leaves}}
+
  
->
- - - - - - - - - - -

Option 1 Option 2 Option 3 Option 4

Requires - glossaries-extra?

Requires - an - external - application?

Requires - Perl?

Requires - Java?

Can - sort - extended - Latin - or - non-Latin - alphabets?

Efficient - sort - algorithm?

Can - use - different - sort - methods - for - each - glossary?

Any - problematic - sort - values?

Can - form - ranges - in - the - location - lists?

Can - have - non-standard - locations?

-

Requires some setting up. - - - -

-

-
-
-

-

-

Option 1: -

This is the simplest option but it’s slow and if you want a sorted list, - it doesn’t work for extended or non-Latin alphabets. The name mustn’t - contain commands (or, if it does, the sort value must be supplied) unless - you have the package option sanitizesort or sort=def or sort=use. -

    -
  1. -

    Add \makenoidxglossaries to your preamble (before you start - defining your entries, as described in §2 Defining Terms). -

  2. -
  3. -

    Put -


    \printnoidxglossary[sort=order,other options]

    -

    - where you want your list of entries to appear. The sort ⟨order⟩ may be one - of: word (word ordering), letter (letter ordering), case (case-sensitive - letter ordering), def (in order of definition) or use (in order of use). - Alternatively, use -


    \printnoidxglossaries

    -

    - to display all your glossaries (if you have more than one). This command - doesn’t have any arguments. -

    This option allows you to have different sort methods. For example: - - - -

    -
    -         \printnoidxglossary[sort=word]% main glossary
    -         \printnoidxglossary[type=symbols,sort=use]% symbols glossary
    -
    -

    -

  4. -
  5. -

    Run LaTeX twice on your document. (As you would do to make a table - of contents appear.) For example, click twice on the “typeset” or “build” - or “PDFLaTeX” button in your editor.

-

Here’s a complete document (myDoc.tex): - - - -

-
-     \documentclass{article}
-     \usepackage{glossaries}
-     \makenoidxglossaries % use TeX to sort
-     \newglossaryentry{sample}{name={sample},
-       description={an example}}
-     \begin{document}
-     A \gls{sample}.
-     \printnoidxglossaries % iterate over all indexed entries
-     \end{document}
-
-

Document build: - - - -

-
-     pdflatex myDoc
-     pdflatex myDoc
-
-

-

-

-

-

Option 2: -

This option uses an application called makeindex to sort the entries. This - application comes with all modern TeX distributions, but it’s hard-coded for - the non-extended Latin alphabet. This process involves making LaTeX write - the glossary information to a temporary file which makeindex reads. - Then makeindex writes a new file containing the code to typeset the - glossary. LaTeX then reads this file on the next run. The makeindex - application is automatically invoked by the helper makeglossaries - script, which works out all the appropriate settings from the .aux - file. -

    -
  1. -

    If you are using ngerman1 - or some other package that makes the double-quote character " a - shorthand, then use \GlsSetQuote to change this to some other character. - For example: - - - -

    -
    -         \GlsSetQuote{+}
    -
    -

    Use this as soon as possible after you’ve loaded the glossaries - package. -

  2. -
  3. -

    Add \makeglossaries to your preamble (before you start defining your - entries). -

  4. -
  5. -

    Put -


    \printglossary[options]

    -

    - where you want your list of entries (glossary) to appear. (The sort key - isn’t available in ⟨options⟩.) Alternatively, use -


    \printglossaries

    -

    - which will display all glossaries (if you have more than one). This - command doesn’t have any arguments. -

    All glossaries are sorted using the same method which may be identified - with one of the package options: sort=standard (default), sort=use or - sort=def.
    -

    -

  6. -
  7. -

    Run LaTeX on your document. This creates files with the extensions .glo - and .ist (for example, if your LaTeX document is called myDoc.tex, then - you’ll have two extra files called myDoc.glo and myDoc.ist). If you look - at your document at this point, you won’t see the glossary as it hasn’t - been created yet. -

  8. -
  9. -

    Run makeglossaries with the base name of your document (without the - .tex) extension. If you have access to a terminal or a command prompt - - - - (for example, the MSDOS command prompt for Windows users or - the bash console for Unix-like users) then you need to run the - command: - - - -

    -
    -         makeglossaries myDoc
    -
    -

    (Replace myDoc with the base name of your LaTeX document file without - the .tex extension. Avoid spaces in the file name.) If you don’t have Perl - installed use makeglossaries-lite instead: - - - -

    -
    -         makeglossaries-lite myDoc
    -
    -

    -

    Some beginners get confused by makeglossaries the application (run as - a system command) and \makeglossaries the LaTeX command - which should be typed in the document preamble. These are two - different concepts that happen to have similar looking names. -
    -

    -

    If you don’t know how to use the command prompt, then you can - probably configure your text editor to add makeglossaries (or - makeglossaries-lite) as a build tool, but each editor has a different - method of doing this, so I can’t give a general description. You will have - to check your editor’s manual. (There are some guidelines in Incorporating - makeglossaries or makeglossaries-lite or bib2gls into the document - build.) If you still have problems, try adding the automake package - option: - - - -

    -
    -         \usepackage[automake]{glossaries}
    -
    -

    -

    The default sort is word order (“sea lion” comes before “seal”). If you - want letter ordering you need to add the order=letter package - option - - - -

    -
    -         \usepackage[order=letter]{glossaries}
    -
    -

    -

  10. -
  11. -

    Once you have successfully completed the previous step, you can now run - LaTeX on your document again.

-

Here’s a complete document (myDoc.tex): - - - -

-
-     \documentclass{article}
-     \usepackage{glossaries}
-     \makeglossaries % create makeindex files
-     \newglossaryentry{sample}{name={sample},
-       description={an example}}
-     \begin{document}
-     A \gls{sample}.
-     \printglossaries % input files created by makeindex
-     \end{document}
-
-

Document build: - - - -

-
-     pdflatex myDoc
-     makeglossaries myDoc
-     pdflatex myDoc
-
-

or - - - -

-
-     pdflatex myDoc
-     makeglossaries-lite myDoc
-     pdflatex myDoc
-
-

-

-

-

-

Option 3: -

This option uses an application called xindy to sort the entries. This - application is more flexible than makeindex and is able to sort extended Latin - or non-Latin alphabets. It comes with both TeX Live and MiKTeX. - Since xindy is a Perl script, you will also need to ensure that Perl is - installed. In a similar way to Option 2, this option involves making - LaTeX write the glossary information to a temporary file which xindy - reads. Then xindy writes a new file containing the code to typeset - the glossary. LaTeX then reads this file on the next run. The xindy - application is automatically invoked by the helper makeglossaries - script, which works out all the appropriate settings from the .aux - file. -

    -
  1. -

    Add the xindy option to the glossaries package option list: - - - -

    -
    -         \usepackage[xindy]{glossaries}
    -
    -

    -

  2. -
  3. -

    Add \makeglossaries to your preamble (before you start defining your - entries). -

  4. -
  5. -

    Put -


    \printglossary[options]

    -

    - where you want your list of entries (glossary) to appear. (The sort key - isn’t available in ⟨options⟩.) Alternatively, use -


    \printglossaries

    -

    -

    All glossaries are sorted using the same method which may be identified - with one of the package options: sort=standard (default), sort=use or - sort=def.
    -

    -

  6. -
  7. -

    Run LaTeX on your document. This creates files with the extensions .glo - and .xdy (for example, if your LaTeX document is called myDoc.tex, then - you’ll have two extra files called myDoc.glo and myDoc.xdy). If you look - at your document at this point, you won’t see the glossary as it hasn’t - been created yet. -

  8. -
  9. -

    Run makeglossaries with the base name of the document (omitting the - .tex extension). If you have access to a terminal or a command prompt - (for example, the MSDOS command prompt for Windows users or - the bash console for Unix-like users) then you need to run the - command: - - - -

    -
    -         makeglossaries myDoc
    -
    -

    (Replace myDoc with the base name of your LaTeX document file without - the .tex extension. Avoid spaces in the file name. If you don’t know how - to use the command prompt, then as mentioned above, you may be able to - configure your text editor to add makeglossaries as a build - tool. -

    The default sort is word order (“sea lion” comes before “seal”). If you - want letter ordering you need to add the order=letter package - option: - - - -

    -
    -         \usepackage[xindy,order=letter]{glossaries}
    -
    -

    -

  10. -
  11. -

    Once you have successfully completed the previous step, you can now run - LaTeX on your document again. -

    -
-

Here’s a complete document (myDoc.tex): - - - -

-
-     \documentclass{article}
-     \usepackage[xindy]{glossaries}
-     \makeglossaries % create xindy files
-     \newglossaryentry{sample}{name={sample},
-       description={an example}}
-     \begin{document}
-     A \gls{sample}.
-     \printglossaries % input files created by xindy
-     \end{document}
-
-

Document build: - - - -

-
-     pdflatex myDoc
-     makeglossaries myDoc
-     pdflatex myDoc
-
-

-

-

-

-

Option 4: -

This requires the extension package glossaries-extra and an application called - bib2gls. This application is able to sort extended Latin or non-Latin - alphabets. It comes with both TeX Live and MiKTeX but requires at least - Java 8. This method works differently to Options 2 and 3. Instead of - creating a file containing the code to typeset the glossary it creates a - .glstex file containing the entry definitions fetched from the .bib file (or - files), but only those entries that are required in the document are - defined and they are defined in the order obtained from the chosen sort - method. This means that you can just use \printunsrtglossary to - display each glossary (or \printunsrtglossaries to display them - all). -

    -
  1. -

    Add the record option to the glossaries-extra package option list: - - - -

    -
    -         \usepackage[record]{glossaries-extra}
    -
    -

    -

  2. -
  3. -

    Add one or more -


    \GlsXtrLoadResources[src={bib list},options]

    -

    - to your preamble where ⟨bib list⟩ is the list of .bib files containing the - entries. You may use different sort methods for each resource set. For - example: - - - -

    -
    -         \usepackage[record,% using bib2gls
    -          abbreviations,
    -          symbols,
    -          numbers
    -         ]{glossaries-extra}
    -         \GlsXtrLoadResources[
    -           src={terms},% entries in terms.bib
    -           type=main,% put these entries in the 'main' (default) list
    -           sort={de-CH-1996}% sort according to this locale
    -         ]
    -         \GlsXtrLoadResources[
    -           src={abbrvs},% entries in abbrvs.bib
    -           type=abbreviations,% put these entries in the 'abbreviations' list
    -           sort={letter-case}% case-sensitive letter (non-locale) sort
    -         ]
    -         \GlsXtrLoadResources[
    -           src={syms},% entries in syms.bib
    -           type=symbols,% put these entries in the 'symbols' list
    -           sort={use}% sort according to first use in the document
    -         ]
    -         \GlsXtrLoadResources[
    -           src={constants},% entries in constants.bib
    -           type=numbers,% put these entries in the 'numbers' list
    -           sort-field={user1},% sort according to this field
    -           sort={double}% double-precision sort
    -         ]
    -
    -

    The last resource set assumes that the entries defined in the file - constants.bib have a number stored in the user1 field. For - example: - - - -

    -
    -         @number{pi,
    -           name={\ensuremath{\pi}},
    -           description={pi},
    -           user1={3.141592654}
    -         }
    -
    -

    -

  4. -
  5. -

    Put -


    \printunsrtglossary[type={type},options]

    -

    - where you want your list of entries (glossary) to appear. (The sort key - isn’t available in ⟨options⟩. It needs to be used in \GlsXtrLoadResources - instead.) Alternatively, use -


    \printunsrtglossaries

    -

    -

  6. -
  7. -

    Run LaTeX on your document. The record option adds information to the - .aux file that provides bib2gls with all required details for each resource - set. For example, if the file is called myDoc.tex: - - - -

    -
    -         pdflatex myDoc
    -
    -

    -

  8. -
  9. -

    Run bib2gls - - - -

    -
    -         bib2gls myDoc
    -
    -

    or (if you need letter groups) - - - -

    -
    -         bib2gls --group myDoc
    -
    -

    -

  10. -
  11. -

    Run LaTeX again.

-

Here’s a complete document (myDoc.tex): - - - -

-
-     \documentclass{article}
-     \usepackage[record]{glossaries-extra}
-     \GlsXtrLoadResources % input file created by bib2gls
-      [% instructions to bib2gls:
-        src={entries}, % terms defined in entries.bib
-        sort={en-GB}% sort according to this locale
-      ]
-     \newglossaryentry{sample}{name={sample},
-       description={an example}}
-     \begin{document}
-     A \gls{sample}.
-     \printunsrtglossaries % iterate over all defined entries
-     \end{document}
-
-

The accompanying entries.bib file: - - - -

-
-     @entry{sample,
-       name = {sample},
-       description = {an example}
-     }
-
-

Document build: - - - -

-
-     pdflatex myDoc
-     bib2gls myDoc
-     pdflatex myDoc
-
-

-

-
-

If you are having difficulty integrating makeglossaries into your document build -process, you may want to consider using arara, which is a Java application that -searches the document for special comment lines that tell arara which applications -to run. For example, the file myDoc.tex might start with: - - - -

-
- % arara: pdflatex
- % arara: makeglossaries
- % arara: pdflatex
- \documentclass{article}
- \usepackage{glossaries}
- \makeglossaries
-
-

then to build the document you just need the single system call: - - - -

-
- arara myDoc
-
-

(As from version 4.0, arara also has directives for makeglossaries-lite and -bib2gls. See the arara manual for further details.) -

When sorting the entries, the string comparisons are made according to each -entry’s sort key. If this is omitted, the name key is used. For example, recall the -earlier definition: - - - -

-
- \newglossaryentry{elite}
- {
-   name={{\'e}lite},
-   description={select group or class}
- }
-
-

No sort key was used, so it’s set to the same as the name key: {\’e}lite. How this -is interpreted depends on which option you have used: -

-

-Option 1:

-

By default, the accent command will be stripped so the sort value will be - elite. This will put the entry in the “E” letter group. However if you use - the sanitizesort=true package option, the sort value will be interpreted as - the sequence of characters: { \ ’ e } l i t and e. This will place this entry - in the “symbols” group since it starts with a symbol. -

-

-Option 2:

-

The sort key will be interpreted the sequence of characters: { \ e } l i - t and e. The first character is an opening curly brace { so makeindex will - put this entry in the “symbols” group. -

-

-Option 3:

-

xindy disregards LaTeX commands so it sorts on elite, which puts this entry - in the “E” group. If stripping all commands leads to an empty string - (such as \ensuremath{\emptyset}) then xindy will fail, so in these - situations you need to provide an appropriate sort value that xindy will - accept. -

xindy merges entries with duplicate sort values. xindy forbids empty sort - values. A sort value may degrade into an empty or duplicate value once xindy - has stripped all commands and braces.
-

-

- - - -

-Option 4:

-

bib2gls has a primitive LaTeX parser that recognises a limited set of - commands, which includes the standard accent commands and some maths - commands, so it can convert {\’e}lite to élite. It disregards unknown - commands. This may lead to an empty sort value, but bib2gls doesn’t mind - that. -

Note that even if the name is given as {\’e}lite, the letter group heading - (if the --group switch is used) may end up with the character É - depending on the locale used by the sort comparator. In this case you - will need to ensure the document can support this character either - with inputenc or by switching to a LaTeX engine with native UTF-8 - support. -

There’s more information on how bib2gls obtains the sort value in bib2gls - gallery: sorting. -

-
-

If the inputenc package is used: - - - -

-
- \usepackage[utf8]{inputenc}
-
-

and the entry is defined as:

-
- \newglossaryentry{elite} -
 { -
   name={{é}lite}, -
   description={select group or class} -
 } -
-
then: -
-

-Option 1:

-

By default the sort value will be interpreted as elite so the entry will be - put in the “E” letter group. If you use the sanitizesort=true package option, - the sort value will be interpreted as élite where é has been sanitized - (so it’s no longer an active character and is in fact seen as two octets 0xC3 - 0xA9) which will put this entry before the “A” letter group. (The group - is determined by the first octet 0xC3.) -

-

-Option 2:

-

makeindex sees é as two octets (0xC3 0xA9) rather than a single - character so it tries to put élite in the 0xC3 (“Ô) letter group (which, - in this case, comes after “Z”). -

-

-Option 3:

-

xindy will correctly recognise the sort value élite and will place it in - whatever letter group is appropriate for the given language setting. (In - English, this would just be the “E” letter group, but another language - might put it in the “É” letter group.) - - - -

-

-Option 4:

-

The inputenc package doesn’t affect the encoding used with .bib entry - definitions, since these are dependent on the encoding used to save the .bib file - (although the labels must still be ASCII unless you use XeLaTeX/LuaLaTeX). - You can help bib2gls (and JabRef) by putting an encoding comment at the - start of the .bib file:

-
- % Encoding: UTF-8 -
-
-

With the correct encoding set up, bib2gls will determine that the sort value is - élite and will place it in whatever letter group is appropriate for the given - sort rule. For example, sort=en-GB (or just sort=en) will put élite in the - “E” letter group, but another language might put it in the “É” letter - group. -

-
-

Therefore if you have extended Latin or non-Latin characters, your best option is -to use either xindy (Option 3) or bib2gls (Option 4) with the inputenc or fontspec -package. If you use makeindex (Option 2) you need to specify the sort key like -this: - - - -

-
-\newglossaryentry{elite}
+\newglossaryentry{turnip}{name={turnip},
+  description={round pale root vegetable}}
+
+\newglossaryentry{carrot}{name={carrot},
+  description={orange root}}
+
+\begin{document}
+Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
+
+\printunsrtglossaries % list all entries
+\end{document}
+
However this method doesn’t sort the entries (they’re listed in order of definition) and it will display all the defined entries, regardless of whether or not you’ve used them all in the document, so “turnip” appears in the glossary even though there’s no \gls{turnip} (or similar) in the document.

+The sort=none option isn’t essential in this case (there’s no other sort option available for this document), but it prevents the automatic construction of the sort value and so slightly improves the document build time.

+Note that this example document uses the same command (\printunsrtglossaries) that’s used with bib2gls (Option 4) but with bib2gls you instead need to use the record package option and one or more instances of \GlsXtrLoadResources in the preamble (see below).

+Most users prefer to have an automatically sorted list that only contains entries that have been used in the document, optionally with a page list (indexing). The glossaries package provides three options: use TeX to perform the sorting (Option 1); use makeindex to perform the sorting (Option 2); use xindy to perform the sorting (Option 3). The extension package glossaries-extra provides a fourth method: use bib2gls (Option 4).

+The first option (using TeX) is the simplest method, as it doesn’t require an external tool, but it’s very inefficient and the sorting is done according to lower case character code (which matches basic Latin alphabets, such as English, but not extended Latin alphabets, such as Icelandic) or non-Latin alphabets. To use this method, add \makenoidxglossaries to the preamble and put \printnoidxglossaries at the place where you want your glossary. For example:

\documentclass{article}
+
+\usepackage{glossaries}
+
+\makenoidxglossaries % use TeX to sort
+
+\newglossaryentry{potato}{name={potato},plural={potatoes},
+ description={starchy tuber}}
+
+\newglossaryentry{cabbage}{name={cabbage},
+ description={vegetable with thick green or purple leaves}}
+
+\newglossaryentry{turnip}{name={turnip},
+ description={round pale root vegetable}}
+
+\newglossaryentry{carrot}{name={carrot},
+ description={orange root}}
+
+\begin{document}
+Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}.
+
+\printnoidxglossaries
+\end{document}
+

+

+The \makenoidxglossaries method is very slow, uses an ASCII comparator and often breaks if there are commands in the name key. See Glossaries Performance for a comparison.
+

+Try this out and run LaTeX (or pdfLaTeX) twice. The first run won’t show the glossary. It will only appear on the second run. This doesn’t include “turnip” in the glossary because that term hasn’t been used (with commands like \gls{turnip}) in the document.

+The glossary has a vertical gap between the “carrot” term and the “potato” term. This is because the entries in the glossaries are grouped according to their first letter. If you don’t want this gap, just add nogroupskip to the package options:

\usepackage[nogroupskip]{glossaries}
+
or you may want to try out a style that shows the group headings:
\usepackage[style=indexgroup]{glossaries}
+
If you try out this example you may also notice that the description is followed by a full stop (period) and a number. The number is the location in the document where the entry was used (page 1 in this case), so you can lookup the term in the glossary and be directed to the relevant pages. It may be that you don’t want this back-reference, in which case you can suppress it using the nonumberlist package option:
\usepackage[nonumberlist]{glossaries}
+
If you don’t like the terminating full stop, you can suppress that with the nopostdot package option:
\usepackage[nopostdot]{glossaries}
+

+If you try out the earlier example with glossaries-extra and \printunsrtglossaries you may notice that the terminating full stop is missing and there are no number lists. You can add the full stop back with

\usepackage[nopostdot=false]{glossaries-extra}
+
or
\usepackage[postdot]{glossaries-extra}
+
If you want the number lists then you need to use an indexing option.

+You may have noticed that I’ve used another command in the above examples: \glspl. This displays the plural form. By default, this is just the singular form with the letter “s” appended, but in the case of “potato” I had to specify the correct plural using the plural key.

+As I mentioned earlier, using TeX to sort the entries is the simplest but least efficient method. If you have a large glossary or if your terms contain non-Latin or extended Latin characters, then you will have a much faster build time if you use makeindex (Option 2) or xindy (Option 3) or bib2gls (Option 4). If you are using extended Latin or non-Latin characters, then xindy or bib2gls are the recommended methods. These methods are described in more detail in §4.

+The rest of this document briefly describes the main commands provided by the glossaries package. (Most of these are also available with glossaries-extra but may behave slightly differently.)

+ + + +

+

2. Defining Terms

+

+When you use the glossaries package, you need to define glossary entries before you can reference them. This is best done in the document preamble, as shown in the earlier examples, or in a separate file that’s input in the preamble.

+These entries could be a word, phrase, abbreviation or symbol. They’re usually accompanied by a description, which could be a short sentence or an in-depth explanation that spans multiple paragraphs. The simplest method of defining an entry is to use:

+\newglossaryentry{label}{key=value list}
+ The two most important keys are name and description:
\newglossaryentry{label}
+{
+  name={name},
+  description={description},
+  other options
+}
+
where label is a unique label that identifies this entry. (Don’t include the angle brackets . They just indicate the parts of the code that you need to change when you use this command in your document.) The name is the word, phrase or symbol you are defining, and description is the description to be displayed in the glossary.

+This command is a “short” command, which means that description can’t contain a paragraph break. If you have a long description, you can instead use:

+\longnewglossaryentry{label}{key=value list}{description}
+ In this case the name key is in the second argument but the description is supplied in the third argument instead of via a key.
\longnewglossaryentry{label}
+{
+  name={name},
+  other options
+}
+{description}
+

+Examples: +

    +
  1. 1.Define the term “set” with the label set:
    \newglossaryentry{set}
    +{
    +  name={set},
    +  description={a collection of objects}
    +}
    +

    +

  2. 2.Define the symbol \(\emptyset \) with the label emptyset:
    \newglossaryentry{emptyset}
     {
    -  name={{\'e}lite},
    -  sort={elite},
    -  description={select group or class}
    +  name={\ensuremath{\emptyset}},
    +  description={the empty set}
     }
    -
    -

    or

    -
    -\newglossaryentry{elite} -
    { -
      name={{é}lite}, -
      sort={elite}, -
      description={select group or class} -
    } -
    -
    If you use Option 1, you may or may not need to use the sort key, but you will -need to be careful about fragile commands in the name key if you don’t set the sort -key. -

    If you use Option 3 and the name only contains a command or commands (such -as \P or \ensuremath{\pi}) you must add the sort key. This is also advisable -for the other options (except Option 4), but is essential for Option 3. For -example: - - - -

    -
    - \newglossaryentry{P}{name={\P},sort={P},
    -  description={paragraph symbol}}
    -
    -

    -

    -

    Top

    5 Customising the Glossary

    -

    The default glossary style uses the description environment to display the entry list. -Each entry name is set in the optional argument of \item which means that it will -typically be displayed in bold. You can switch to medium weight by redefining -\glsnamefont: - - - -

    -
    -\renewcommand*{\glsnamefont}[1]{\textmd{#1}}
    -
    -

    Some classes and packages redefine the description environment in such as way that’s -incompatible with the glossaries package. In which case you’ll need to select a -different glossary style (see below). -

    By default, a full stop is appended to the description (unless you use -glossaries-extra). To prevent this from happening use the nopostdot package -option: - - - -

    -
    -\usepackage[nopostdot]{glossaries}
    -
    -

    or to add it with glossaries-extra: - - - -

    -
    -\usepackage[postdot]{glossaries-extra}
    -
    -

    -

    By default, a location list is displayed for each entry (unless you use -\printunsrtglossary without bib2gls). This refers to the document locations (for -example, the page number) where the entry has been referenced. If you use -Options 2 or 3 described in §4 Displaying a List of Entries or -Option 4 (with bib2gls and glossaries-extra) then location ranges will be -compressed. For example, if an entry was used on pages 1, 2 and 3, with Options 2 -or 3 or Option 4 the location list will appear as 1–3, but with Option 1 it will -appear as 1, 2, 3. If you don’t want the locations displayed you can hide them using -the nonumberlist package option: - - - -

    -
    -\usepackage[nonumberlist]{glossaries}
    -
    -

    or with bib2gls use save-locations=false in the optional argument of the -appropriate \GlsXtrLoadResources (it’s possible to have some resource sets with -locations and some without). -

    Entries are grouped according to the first letter of each entry’s sort -key. By default a vertical gap is placed between letter groups for most of -the predefined styles. You can suppress this with the nogroupskip package -option: - - - -

    -
    -\usepackage[nogroupskip]{glossaries}
    -
    -

    -

    If the default style doesn’t suit your document, you can change the style -using: -


    \setglossarystyle{style name}

    -

    -There are a number of predefined styles. Glossaries can vary from a list of symbols -with a terse description to a list of words or phrases with descriptions that span -multiple paragraphs, so there’s no “one style fits all” solution. You need to choose -a style that suits your document. For example: - - - -

    -
    -\setglossarystyle{index}
    -
    -

    You can also use the style package option for the preloaded styles. For example: - - - -

    -
    -\usepackage[style=index]{glossaries}
    -
    -

    -

    Examples: -

      -
    1. -

      You have entries where the name is a symbol and the description is a brief - phrase or short sentence. Try one of the “mcol” styles defined in the - glossary-mcols package. For example: - - - -

      -
      -     \usepackage[nopostdot]{glossaries}
      -     \usepackage{glossary-mcols}
      -     \setglossarystyle{mcolindex}
      -
      -

      or - - - -

      -
      -     \usepackage[stylemods={mcols},style=mcolindex]{glossaries-extra}
      -
      -

      -

    2. -
    3. -

      You have entries where the name is a word or phrase and the description spans - multiple paragraphs. Try one of the “altlist” styles. For example: - - - -

      -
      -     \usepackage[nopostdot]{glossaries}
      -     \setglossarystyle{altlist}
      -
      -

      or - - - -

      -
      -     \usepackage[stylemods,style=altlist]{glossaries-extra}
      -
      -

      -

    4. -
    5. -

      You have entries where the name is a single word, the description is - brief, and an associated symbol has been set. Use one of the styles that - display the symbol (not all of them do). For example, one of the tabular - styles: - - - -

      -
      -     \usepackage[nopostdot,nonumberlist,style=long4col]{glossaries}
      -
      -

      or one of the “tree” styles: - - - -

      -
      -     \usepackage[nopostdot,nonumberlist,style=tree]{glossaries}
      -
      -

    -

    If your glossary consists of a list of abbreviations and you also want to specify -a description as well as the long form, then you need to use an abbreviation style -that will suit the glossary style. For example, use the long-short-desc acronym -style: - - - -

    -
    -\setacronymstyle{long-short-desc}
    -
    -

    Define the acronyms with a description: - - - -

    -
    -\newacronym
    - [description={statistical pattern recognition technique}]
    - {svm}{SVM}{support vector machine}
    -
    -

    Alternatively with glossaries-extra: - - - -

    -
    -\setabbreviationstyle{long-short-desc}
    -\newabbreviation
    - [description={statistical pattern recognition technique}]
    - {svm}{SVM}{support vector machine}
    -
    -

    -

    Choose a glossary style that suits wide entry names. For example: - - - -

    -
    -\setglossarystyle{altlist}
    -
    -

    -

    -

    -

    Top

    6 Multiple Glossaries

    -

    The glossaries package predefines a default main glossary. When you define an entry -(using one of the commands described in §2 Defining Terms), that entry -is automatically assigned to the default glossary, unless you indicate otherwise using -the type key. However you first need to make sure the desired glossary has been -defined. This is done using: -


    \newglossary[glg]{label}{gls}{glo}{title}

    -

    -The ⟨label⟩ is a label that uniquely identifies this new glossary. As with other types of -identifying labels, be careful not to use active characters in ⟨label⟩. The final -argument ⟨title⟩ is the section or chapter heading used by \printglossary or -\printnoidxglossary. The other arguments indicate the file extensions -used by makeindex/xindy (described in §4 Displaying -a List of Entries). If you use Option 1 described above (or bib2gls and -\printunsrtglossaries), then the ⟨glg⟩, ⟨gls⟩ and ⟨glo⟩ arguments aren’t relevant, in -which case you may prefer to use the starred version where you don’t specify the -extensions: -


    \newglossary*{label}{title}

    -

    -

    In the case of Options 2 or 3, all glossary definitions must come before -\makeglossaries. (Entry definitions should come after \makeglossaries.) In the case -of Option 4, all glossary definitions must come before any \GlsXtrLoadResources -that requires them. -

    Since it’s quite common for documents to have both a list of terms and a list of -abbreviations, the glossaries package provides the package option acronym (or -acronyms), which is a convenient shortcut for - - - -

    -
    -\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
    -
    -

    The option also changes the behaviour of \newacronym so that acronyms are -automatically put in the list of acronyms instead of the main glossary. The -glossaries-extra package also provides this option for abbreviations defined using -\newacronym but additionally has the package option abbreviations to create a list of -abbreviations for \newabbreviation. -

    There are some other package options for creating commonly used lists: symbols -(lists of symbols), numbers (lists of numbers), index (index of terms without -descriptions defined with \newterm[options]{label}). -

    For example, suppose you want a main glossary for terms, a list of acronyms and -a list of notation: - - - -

    -
    - \usepackage[acronyms]{glossaries}
    - \newglossary[nlg]{notation}{not}{ntn}{Notation}
    -
    -

    After \makeglossaries (or \makenoidxglossaries) you can define the entries in -the preamble. For example: - - - -

    -
    - \newglossaryentry{gls:set}
    - {% This entry goes in the `main' glossary
    -   name=set,
    -   description={A collection of distinct objects}
    - }
    - % This entry goes in the `acronym' glossary:
    - \newacronym{svm}{svm}{support vector machine}
    - \newglossaryentry{not:set}
    - {% This entry goes in the `notation' glossary:
    -   type=notation,
    -   name={\ensuremath{\mathcal{S}}},
    -   description={A set},
    -   sort={S}}
    -
    -

    or if you don’t like using \ensuremath: - - - -

    -
    - \newglossaryentry{not:set}
    - {% This entry goes in the `notation' glossary:
    -   type=notation,
    -   name={$\mathcal{S}$},
    -   text={\mathcal{S}},
    -   description={A set},
    -   sort={S}}
    -
    -

    -

    Each glossary is displayed using: -


    \printnoidxglossary[type=type]

    -

    -(Option 1) or -


    \printglossary[type=type]

    -

    -(Options 2 and 3). Where ⟨type⟩ is the glossary label. If the type is omitted the -default main glossary is assumed. -

    If you’re using bib2gls then each glossary is displayed using: -


    \printunsrtglossary[type=type]

    -

    -With this method you don’t use \makeglossaries or \makenoidxglossaries. -Instead you can assign the entry type with the resource command. For example: - - - -

    -
    - \usepackage[record,abbreviations,symbols]{glossaries-extra}
    - \GlsXtrLoadResources[
    -  src={terms}, % entries defined in terms.bib
    -  type={main}% put in main glossary
    - ]
    - \GlsXtrLoadResources[
    -  src={abbrvs}, % entries defined in abbrvs.bib
    -  type={abbreviations}% put in abbreviations glossary
    - ]
    - \GlsXtrLoadResources[
    -  src={syms}, % entries defined in syms.bib
    -  type={symbols}% put in symbols glossary
    - ]
    -
    -

    Later in the document: - - - -

    -
    - \printunsrtglossary % main
    - \printunsrtglossary[type=abbreviations]
    - \printunsrtglossary[type=symbols]
    -
    -

    -

    There’s a convenient shortcut that will display all the defined glossaries -depending on the indexing method: -


    \printnoidxglossaries

    -

    -(Option 1) or -


    \printglossaries

    -

    -(Options 2 and 3) or (glossaries-extra only) -


    \printunsrtglossaries

    -

    -

    If you use Option 1, you don’t need to do anything else. If you use Options 2 -or 3 with the makeglossaries Perl script or the makeglossaries-lite Lua -script, you similarly don’t need to do anything else. If you use Options 2 -or 3 without the makeglossaries Perl script or makeglossaries-lite -Lua script then you need to make sure you run makeindex/xindy for each -defined glossary. The ⟨gls⟩ and ⟨glo⟩ arguments of \newglossary specify the file -extensions to use instead of .gls and .glo. The optional argument ⟨glg⟩ is the file -extension for the transcript file. This should be different for each glossary in -case you need to check for makeindex/xindy errors or warnings if things go -wrong. -

    For example, suppose you have three glossaries in your document (main, acronym -and notation), specified using: - - - -

    -
    -\usepackage[acronyms]{glossaries}
    -\newglossary[nlg]{notation}{not}{ntn}{Notation}
    -
    -

    Then (assuming your LaTeX document is in a file called myDoc.tex): -

    -

    -

    -

    -

    Option 2 Either use one makeglossaries or makeglossaries-lite - call: - - - -

    -
    -     makeglossaries myDoc
    -
    -

    or - - - -

    -
    -     makeglossaries-lite myDoc
    -
    -

    Or you need to run makeindex three times: - - - -

    -
    -     makeindex -t myDoc.glg -s myDoc.ist -o myDoc.gls myDoc.glo
    -     makeindex -t myDoc.alg -s myDoc.ist -o myDoc.acr myDoc.acn
    -     makeindex -t myDoc.nlg -s myDoc.ist -o myDoc.not myDoc.ntn
    -
    -

    -

    -

    -

    -

    Option 3 Either use one makeglossaries call: - - - -

    -
    -     makeglossaries myDoc
    -
    -

    Or you need to run xindy three times (be careful not to insert line breaks - where the line has wrapped.) - - - -

    -
    -     xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.glg
    -     -o myDoc.gls myDoc.glo
    -     xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.alg
    -     -o myDoc.acr myDoc.acn
    -     xindy  -L english -C utf8 -I xindy -M myDoc -t myDoc.nlg
    -     -o myDoc.not myDoc.ntn
    -
    -

    -

    -

    -

    -

    Option 4 With bib2gls only one call is required: - - - -

    -
    -     pdflatex myDoc
    -     bib2gls --group myDoc
    -     pdflatex myDoc
    -
    -

    (Omit --group if you don’t need letter groups.)

    -

    -

    -

    Top

    7 glossaries and hyperref

    -

    Take care if you use the glossaries package with hyperref. Contrary to the usual advice -that hyperref should be loaded last, glossaries (and glossaries-extra) must be loaded -after hyperref: - - - -

    -
    -\usepackage[colorlinks]{hyperref}
    -\usepackage{glossaries}
    -
    -

    If you use hyperref make sure you use PDFLaTeX rather than the LaTeX to DVI -engine. The DVI format can’t break hyperlinks across a line so long glossary entries -(such as the full form of acronyms) won’t line wrap with the DVI engine. -Also, hyperlinks in sub- or superscripts aren’t correctly sized with the DVI -format. -

    By default, if the hyperref package has been loaded, commands like \gls will form -a hyperlink to the relevant entry in the glossary. If you want to disable this for all -your glossaries, then use: -


    \glsdisablehyper

    -

    -If you want hyperlinks suppressed for entries in specific glossaries, then use the -nohypertypes package option. For example, if you don’t want hyperlinks for entries in -the acronym and notation glossaries but you do want them for entries in the main -glossary, then do: - - - -

    -
    -\usepackage[colorlinks]{hyperref}
    -\usepackage[acronym,nohypertypes={acronym,notation}]{glossaries}
    -\newglossary[nlg]{notation}{not}{ntn}{Notation}
    -
    -

    -

    If you want the hyperlinks suppressed the first time an entry is used, but you -want hyperlinks for subsequence references then use the hyperfirst=false package -option: - - - -

    -
    -\usepackage[colorlinks]{hyperref}
    -\usepackage[hyperfirst=false]{glossaries}
    -
    -

    The glossaries-extra extension package provides another method using category -attributes. See the glossaries-extra user manual for further details. -

    Take care not to use non-expandable commands in PDF bookmarks. This isn’t -specific to the glossaries package but is a limitation of PDF bookmarks. -Non-expandable commands include commands like \gls, \glspl, \Gls and \Glspl. -The hyperref package provides a way of specifying alternative text for the PDF -bookmarks via \texorpdfstring. For example: - - - -

    -
    -\section{The \texorpdfstring{\gls{fishage}}{Fish Age}}
    -
    -

    However, it’s not a good idea to use commands like \gls in a section heading as -you’ll end up with the table of contents page in your location list. Instead you can -use -


    \glsentrytext{label}

    -

    -This is expandable provided that the text key doesn’t contain non-expandable code. -For example, the following works: - - - -

    -
    -\section{The \glsentrytext{fishage}}
    -
    -

    and it doesn’t put the table of contents in the location list. -

    If you use glossaries-extra then use the commands that are provided specifically for -use in section headers. For example: - - - -

    -
    -\section{The \glsfmttext{fishage}}
    -
    -

    -

    -

    -

    Top

    8 Cross-References

    -

    You can add a reference to another entry in a location list using the see={label list} -key when you define an entry. The referenced entry (or entries) must also be -defined. -

    For example: - - - -

    -
    -\longnewglossaryentry{devonian}{name={Devonian}}%
    +
    (This will also need a sort key if you use Options 1 or 3, see below.)

    +

  3. 3.Define the phrase “Fish Age” with the label fishage:
    \longnewglossaryentry{fishage}
    +{name={Fish Age}}
     {%
    -  The geologic period spanning from the end of the
    -  Silurian Period to the beginning of the Carboniferous Period.
    -  This age was known for its remarkable variety of
    -  fish species.
    +  A common name for the Devonian geologic period 
    +  spanning from the end of the Silurian Period to
    +  the beginning of the Carboniferous Period.
    +
    +  This age was known for its remarkable variety of 
    +  fish species.
    +}
    +
    (The percent character discards the end of line character that would otherwise cause an unwanted space to appear at the start of the description.)

    +

  4. 4.If you are using UTF-8 characters with the inputenc package, make sure you have mfirstuc v2.08+ installed:
    % mfirstuc v2.08+
    +\newglossaryentry{elite}
    +{
    +  name={élite},
    +  description={select group or class}
    +}
    +
    If you have an older version of mfirstuc then any initial character that is an extended Latin or non-Latin character must be grouped in order to work with sentence-casing commands, such as \Gls:
    % mfirstuc v2.07 or older
    +\newglossaryentry{elite}
    +{
    +  name={{é}lite},
    +  description={select group or class}
    +}
    +
    Or
    % mfirstuc v2.07 or older
    +\newglossaryentry{elite}
    +{
    +  name={{\'e}lite},
    +  description={select group or class}
    +}
    +
    +
+

+If you use bib2gls with glossaries-extra then the terms must be defined in a bib file. For example:

% Encoding: UTF-8
+
+@entry{set,
+  name={set},
+  description={a collection of objects}
+}
+
+@entry{emptyset,
+  name={\ensuremath{\emptyset}},
+  description={the empty set}
 }
-\newglossaryentry{fishage}
+
+@entry{fishage,
+  name={Fish Age},
+  description={A common name for the Devonian geologic period    spanning from the end of the Silurian Period to   the beginning of the Carboniferous Period. 
+  This age was known for its remarkable variety of    fish species.}
+}
+
+@entry{elite,
+  name={élite},
+  description={select group or class}
+}
+
(The bib format doesn’t allow spaces in labels so you can’t have fish age as the label, but you can have fish-age.) This method requires glossaries-extra’s record package option:
\usepackage[record]{glossaries-extra}
+
and the bib file is specified in the resource command. For example, if the bib file is called entries.bib then put the following line in the document preamble:
\GlsXtrLoadResources[src={entries}]
+
You can have a comma-separated list. For example, if you also have entries defined in the file entries2.bib:
\GlsXtrLoadResources[src={entries,entries2}]
+

+There are other keys you can use when you define an entry. For example, the name key indicates how the term should appear in the list of entries (glossary), but if the term should appear differently when you reference it with \gls{label} in the document, you need to use the text key as well.

+For example:

\newglossaryentry{latinalph}
+{
+  name={Latin Alphabet},
+  text={Latin alphabet},
+  description={alphabet consisting of the letters    a, \ldots, z, A, \ldots, Z}
+}
+
This will appear in the text as “Latin alphabet” but will be listed in the glossary as “Latin Alphabet”. With bib2gls this entry is defined in the bib file as:
@entry{latinalph,
+  name={Latin Alphabet},
+  text={Latin alphabet},
+  description={alphabet consisting of the letters    a, \ldots, z, A, \ldots, Z}
+}
+

+Another commonly used key is plural for specifying the plural of the term. This defaults to the value of the text key with an “s” appended, but if this is incorrect, just use the plural key to override it:

\newglossaryentry{oesophagus}
+{
+  name={œsophagus},
+  plural={œsophagi},
+  description={canal from mouth to stomach}
+}
+

+Abbreviations can be defined using:

+\newacronym[options]{label}{short}{long}
+ where label is the label (as per \newglossaryentry), short is the short form and long is the long form. For example, the following defines an abbreviation:
\newacronym{svm}{SVM}{support vector machine}
+
This internally uses \newglossaryentry to define an entry with the label svm. By default, the name key is set to short (“SVM” in the above example) and the description key is set to long (“support vector machine” in the above example). If, instead, you want to be able to specify your own description you can do this using the optional argument:
\newacronym
+ [description={statistical pattern recognition technique}]
+ {svm}{SVM}{support vector machine}
+

+Before you define your acronyms, you need to specify which style to use with:

+\setacronymstyle[glossary-type]{style-name}
+ where style-name is the name of the style. There are a number of predefined styles, such as: long-short (on first use display the long form with the short form in parentheses); short-long (on first use display the short form with the long form in parentheses); long-short-desc (like long-short but you need to specify the description); or short-long-desc (like short-long but you need to specify the description). There are some other styles as well that use \textsc to typeset the acronym in small-caps or that use a footnote on first use. See the main user guide for further details.

+The glossaries-extra package provides improved abbreviation handling with a lot more predefined styles. With this extension package, abbreviations are defined using:

+\newabbreviation[options]{label}{short}{long}
+ You can still use \newacronym but it’s redefined to use the new abbreviation interface. The style must now be set using:
+\setabbreviationstyle[category]{style-name}
+ The default category is abbreviation. If you use \newacronym the category is acronym, which is why you need to use the optional argument if you define abbreviations with \newacronym when glossaries-extra has been loaded:
\setabbreviationstyle[acronym]{style name}
+
If you use bib2gls then abbreviations are defined in the bib file in the format:
@abbreviation{label,
+  long={long form},
+  short={short form}
+}
+

+The plural forms for abbreviations can be specified using the longplural and shortplural keys. For example:

\newacronym
+ [longplural={diagonal matrices}]
+ {dm}{DM}{diagonal matrix}
+
or (with glossaries-extra):
\newabbreviation % glossaries-extra.sty [longplural={diagonal matrices}]
+ {dm}{DM}{diagonal matrix}
+
If omitted, the defaults are again obtained by appending an “s” to the singular versions. (The glossaries-extra package provides a way of not appending “s” for abbreviation plurals via category attributes.) With bib2gls, the definition in the bib file is:
@abbreviation{dm,
+  short={DM},
+  long={diagonal matrix},
+  longplural={diagonal matrices}
+}
+

+It’s also possible to have both a name and a corresponding symbol. Just use the name key for the name and the symbol key for the symbol. For example:

\newglossaryentry{emptyset}
 {
-  name={Fish Age},
-  description={Common name for the Devonian period},
-  see={devonian}
+  name={empty set},
+  symbol={\ensuremath{\emptyset}},
+  description={the set containing no elements}
+}
+
or with bib2gls the definition in the bib file is:
@entry{emptyset,
+  name={empty set},
+  symbol={\ensuremath{\emptyset}},
+  description={the set containing no elements}
 }
-
-

The cross-reference will appear as “see Devonian”. You can change the “see” tag -using the format see=[tag]label⟩. For example: - - - -

-
-\newglossaryentry{latinalph}
+
If you want the symbol in the name field then you must supply a sort value with Options 1 and 3 otherwise you’ll end up with errors from TeX or xindy. With Option 2 (makeindex) it’s not quite so important but you may find the resulting order is a little odd. For example:
\newglossaryentry{emptyset}
 {
-  name={Latin alphabet},
-  description={alphabet consisting of the letters
-  a, \ldots, z, A, \ldots, Z},
-  see=[see also]{exlatinalph}
+  name={\ensuremath{\emptyset}},
+  sort={empty set},
+  description={the set containing no elements}
+}
+
This displays the symbol as \(\emptyset \) but sorts according to “empty set”. You may want to consider using glossaries-extra’s symbols package option which provides
+\glsxtrnewsymbol[key=value list]{label}{sym}

+

requires \usepackage[symbols]{glossaries-extra}
+
+ This internally uses \newglossaryentry but automatically sets the sort key to the label. For example:
\documentclass{article}
+\usepackage[symbols]{glossaries-extra}
+\makeglossaries
+\glsxtrnewsymbol % requires glossaries-extra.sty 'symbols' option
+ [description={the set containing no elements}]
+ {emptyset}% label (and sort value)
+ {\ensuremath{\emptyset}}% symbol
+\begin{document}
+\gls{emptyset}
+\printglossaries
+\end{document}
+
Now the sort value is set to the label “emptyset”.

+With bib2gls you can define this entry in the bib file as

@entry{emptyset,
+  name={\ensuremath{\emptyset}},
+  description={the set containing no elements}
 }
-\newglossaryentry{exlatinalph}
+
in which case bib2gls will try to interpret the name field to determine the sort value. Alternatively you can use:
@symbol{emptyset,
+  name={\ensuremath{\emptyset}},
+  description={the set containing no elements}
+}
+
which will use the label (emptyset) as the sort value. (You don’t need the symbols package option in this case, unless you want a separate symbols list.) The corresponding document (where the definition is in the file entries.bib) is now:
\documentclass{article}
+\usepackage[record]{glossaries-extra}
+\GlsXtrLoadResources[src={entries}]
+\begin{document}
+\gls{emptyset}
+\printunsrtglossaries
+\end{document}
+

+Note that while the sort key is advised for symbols when using \makeglossaries or \makenoidxglossaries it shouldn’t be used with bib2gls. Instead, bib2gls has its own algorithm for determining the sort value based on the entry type (@entry, @symbol etc). See bib2gls gallery: sorting for further details.

+ +

+ +
+

3. Using Entries

+

+Once you have defined your entries, as described above, you can reference them in your document. There are a number of commands to do this, but the most common one is:

+\gls[options]{label}[insert]modifiers: * +
+ where label is the label you assigned to the entry when you defined it. For example, \gls{fishage} will display “Fish Age” in the text (given the definition from the previous section). If you are using bib2gls then this will display ?? (like \ref and \cite) until bib2gls has created the relevant files and LaTeX is rerun.

+If you are using the hyperref package (remember to load it before glossaries) \gls will create a hyperlink to the corresponding entry in the glossary. If you want to suppress the hyperlink for a particular instance, use the starred form \gls* for example, \gls*{fishage}. The other commands described in this section all have a similar starred form.

+If the entry was defined as an acronym (using \newacronym with glossaries described above) or an abbreviation (using \newabbreviation with glossaries-extra), then \gls will display the full form the first time it’s used (first use) and just the short form on subsequent use. For example, if the style is set to long-short, then \gls{svm} will display “support vector machine (SVM)” the first time it’s used, but the next occurrence of \gls{svm} will just display “SVM”. (If you use \newacronym with glossaries-extra the default doesn’t show the long form on first use. You’ll need to change the style first, as described earlier.)

+If you want the plural form, you can use:

+\glspl[options]{label}[insert]modifiers: * +
+ instead of \gls{label}. For example, \glspl{set} displays “sets”.

+If the term appears at the start of a sentence, you can convert the first letter to uppercase (sentence case) using:

+\Gls[options]{label}[insert]modifiers: * +
+ for the singular form or
+\Glspl[options]{label}[insert]modifiers: * +
+ for the plural form. For example:
\Glspl{set} are collections.
+
produces “Sets are collections”.

+If you’ve specified a symbol using the symbol key, you can display it using:

+\glssymbol[options]{label}[insert]modifiers: * +
+ For example
\documentclass{article}
+\usepackage{glossaries}
+\newglossaryentry{emptyset}
 {
-   name={extended Latin alphabet},
-   description={The Latin alphabet extended to include
-   other letters such as ligatures or diacritics.}
+  name={empty set},
+  symbol={\ensuremath{\emptyset}},
+  description={the set containing no elements}
 }
-
-

If you use the see key in the optional argument of \newacronym, make sure you -enclose the value in braces. For example: - - - -

-
-\newacronym{ksvm}{ksvm}{kernel support vector machine}
-\newacronym
- [see={[see also]{ksvm}}]
- {svm}{svm}{support vector machine}
-
-

The glossaries-extra package provides a seealso key. This doesn’t allow a tag but -behaves much like see={[\seealsoname]{label}}. For example: - - - -

-
-\newabbreviation{ksvm}{ksvm}{kernel support vector machine}
-\newabbreviation
- [seealso={ksvm}]
- {svm}{svm}{support vector machine}
-
-

-

Since the cross-reference appears in the location list, if you suppress the -location list using the nonumberlist package option, then the cross-reference -will also be suppressed. With bib2gls, don’t use the nonumberlist package -option. Instead use the save-locations=false in the resource options. For -example: - - - -

-
-\usepackage[record,abbreviations,symbols]{glossaries-extra}
-\GlsXtrLoadResources[
- src={terms}, % entries defined in terms.bib
- type={main}% put in main glossary
+\begin{document}
+The \gls{emptyset} is denoted \glssymbol{emptyset}.
+\end{document}
+
+The empty set is denoted \(\emptyset \).
+

+ +

+ +
+

4. Displaying a List of Entries

+

+In §1, I mentioned that there are three options you can choose from to create an automatically sorted glossary with the base glossaries package. These are also available with the extension package glossaries-extra along with a fourth option. These four options are listed below in a little more detail. Table 1 summarises the main advantages and disadvantages. (There’s a more detailed summary in the main glossaries user manual.) See also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

+

Table 1: Comparison of Glossary Options
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Option 1 Option 2 Option 3 Option 4
Requires glossaries-extra?
Requires an external application?
Requires Perl?
Requires Java?
Can sort extended Latin or non-Latin alphabets?
Efficient sort algorithm?
Can use different sort methods for each glossary?
Any problematic sort values?
Can form ranges in the location lists?
Can have non-standard locations?
+

+

Requires some setting up.
+

+ +

+
Option 1 (“noidx”)
+

+ +

This is the simplest option but it’s slow and if you want a sorted list, it doesn’t work for extended or non-Latin alphabets. The name mustn’t contain commands (or, if it does, the sort value must be supplied) unless you have the package option sanitizesort or sort=def or sort=use.

+ +

    + 1.Add \makenoidxglossaries to your preamble (before you start defining your entries, as described in §2).

    +2.Put

    \printnoidxglossary[sort=order,other options]
    +
    where you want your list of entries to appear. The sort order may be one of: word (word ordering), letter (letter ordering), case (case-sensitive letter ordering), def (in order of definition) or use (in order of use). Alternatively, use
    \printnoidxglossaries
    +
    to display all your glossaries (if you have more than one). This command doesn’t have any arguments.

    +This option allows you to have different sort methods. For example:

    \printnoidxglossary[sort=word]% main glossary
    +\printnoidxglossary[type=symbols,% symbols glossary
    + sort=use]
    +

    +3.Run LaTeX twice on your document. (As you would do to make a table of contents appear.) For example, click twice on the “typeset” or “build” or “PDFLaTeX” button in your editor. +

+ Here’s a complete document (myDoc.tex):
\documentclass{article}
+
+\usepackage{glossaries}
+
+\makenoidxglossaries 
+\newglossaryentry{sample}{name={sample},
+  description={an example}}
+
+\begin{document}
+A \gls{sample}.
+
+\printnoidxglossaries % iterate over all indexed entries
+\end{document}
+
Document build:
pdflatex myDoc
+pdflatex myDoc
+
+

+

Option 2 (makeindex)
+

+ +

This option uses an application called makeindex to sort the entries. This application comes with all modern TeX distributions, but it’s hard-coded for the non-extended Latin alphabet. This process involves making LaTeX write the glossary information to a temporary file which makeindex reads. Then makeindex writes a new file containing the code to typeset the glossary. LaTeX then reads this file on the next run. The makeindex application is automatically invoked by the helper makeglossaries script, which works out all the appropriate settings from the aux file.

+ +

    + 1.If you are using a package that makes the double-quote character " a shorthand (an active character), then use \GlsSetQuote to change this to some other character. For example:
    \GlsSetQuote{+}
    +
    Use this as soon as possible after you’ve loaded the glossaries package. (This may not be necessary if you define all your entries in the preamble.)

    +2.Add \makeglossaries to your preamble (before you start defining your entries).

    +3.Put

    \printglossary[options]
    +
    where you want your list of entries (glossary) to appear. (The sort key isn’t available in options.) Alternatively, use
    \printglossaries
    +
    which will display all glossaries (if you have more than one). This command doesn’t have any arguments.

    +

    +All glossaries are sorted using the same method which may be identified with one of the package options: sort=standard (default), sort=use or sort=def.
    +

    +4.Run LaTeX on your document. This creates files with the extensions glo and ist (for example, if your LaTeX document is called myDoc.tex, then you’ll have two extra files called myDoc.glo and myDoc.ist). If you look at your document at this point, you won’t see the glossary as it hasn’t been created yet.

    +5.Run makeglossaries with the base name of your document (without the tex extension). If you have access to a terminal or a command prompt then you need to run the command:

    makeglossaries myDoc
    +
    (Replace myDoc with the base name of your LaTeX document file without the extension. Avoid spaces in the file name.) If you don’t have Perl installed use makeglossaries-lite instead:
    makeglossaries-lite myDoc
    +

    +

    +Some beginners get confused by makeglossaries the application (run as a system command) and \makeglossaries the LaTeX command which should be typed in the document preamble. These are two different concepts that happen to have similar looking names.
    +

    +If you don’t know how to use the command prompt, then you can probably configure your text editor to add makeglossaries (or makeglossaries-lite) as a build tool, but each editor has a different method of doing this, so I can’t give a general description. However, there are some guidelines in Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build. If you still have problems, try adding the automake package option:

    \usepackage[automake]{glossaries}
    +

    +The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to add the order=letter package option

    \usepackage[order=letter]{glossaries}
    +

    +6.Once you have successfully completed the previous step, you can now run LaTeX on your document again. +

+ Here’s a complete document (myDoc.tex):
\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries % create makeindex files
+
+\newglossaryentry{sample}{name={sample},
+  description={an example}}
+
+\begin{document}
+A \gls{sample}.
+
+\printglossaries % input files created by makeindex
+\end{document}
+
Document build:
pdflatex myDoc
+makeglossaries myDoc
+pdflatex myDoc
+
or
pdflatex myDoc
+makeglossaries-lite myDoc
+pdflatex myDoc
+
+

+

Option 3 (xindy)
+

+ +

This option uses an application called xindy to sort the entries. This application is more flexible than makeindex and is able to sort extended Latin or non-Latin alphabets. It comes with both TeX Live and MiKTeX. Since xindy is a Perl script, you will also need to ensure that Perl is installed. In a similar way to Option 2, this option involves making LaTeX write the glossary information to a temporary file which xindy reads. Then xindy writes a new file containing the code to typeset the glossary. LaTeX then reads this file on the next run. The xindy application is automatically invoked by the helper makeglossaries script, which works out all the appropriate settings from the aux file.

+ +

    + 1.Add the xindy option to the glossaries package option list:
    \usepackage[xindy]{glossaries}
    +
    If you aren’t using a Latin script, you may need to suppress the default number group:
    \usepackage[xindy={glsnumbers=false}]{glossaries}
    +

    +2.Add \makeglossaries to your preamble (before you start defining your entries).

    +3.Put

    \printglossary[options]
    +
    where you want your list of entries (glossary) to appear. (The sort key isn’t available in options.) Alternatively, use
    \printglossaries
    +

    +

    +All glossaries are sorted using the same method which may be identified with one of the package options: sort=standard (default), sort=use or sort=def.
    +

    +4.Run LaTeX on your document. This creates files with the extensions glo and xdy (for example, if your LaTeX document is called myDoc.tex, then you’ll have two extra files called myDoc.glo and myDoc.xdy). If you look at your document at this point, you won’t see the glossary as it hasn’t been created yet.

    +5.Run makeglossaries with the base name of the document (omitting the tex extension). If you have access to a terminal or a command prompt then you need to run the command:

    makeglossaries myDoc
    +
    (Replace myDoc with the base name of your LaTeX document file without the tex extension.) Avoid spaces in the file name. If you don’t know how to use the command prompt, then as mentioned above, you may be able to configure your text editor to add makeglossaries as a build tool. Note that the automake option won’t work in TeX’s restricted mode, as xindy isn’t on the list of trusted applications.

    +The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to add the order=letter package option:

    \usepackage[xindy,order=letter]{glossaries}
    +

    +6.Once you have successfully completed the previous step, you can now run LaTeX on your document again.

    + +

+ Here’s a complete document (myDoc.tex):
\documentclass{article}
+
+\usepackage[xindy]{glossaries}
+
+\makeglossaries % create xindy files
+
+\newglossaryentry{sample}{name={sample},
+  description={an example}}
+
+\begin{document}
+A \gls{sample}.
+
+\printglossaries % input files created by xindy
+\end{document}
+
Document build:
pdflatex myDoc
+makeglossaries myDoc
+pdflatex myDoc
+
+

+

Option 4 (bib2gls)
+

+ +

This requires the extension package glossaries-extra and an application called bib2gls. This application is able to sort extended Latin or non-Latin alphabets. It comes with both TeX Live and MiKTeX but requires at least Java 8. This method works differently to Options 2 and 3. Instead of creating a file containing the code to typeset the glossary it creates a glstex file containing the entry definitions fetched from the bib file (or files), but only those entries that are required in the document are defined and they are defined in the order obtained from the chosen sort method. This means that you can just use \printunsrtglossary to display each glossary (or \printunsrtglossaries to display them all).

+ +

    + 1.Add the record option to the glossaries-extra package option list:
    \usepackage[record]{glossaries-extra}
    +

    +2.Add one or more

    \GlsXtrLoadResources[src={bib list},options]
    +
    to your preamble where bib list is the list of bib files containing the entries. You may use different sort methods for each resource set. For example:
    \usepackage[record,% using bib2gls
    + abbreviations,% create abbreviations list
    + symbols,% create symbols list
    + numbers% create numbers list
    +]{glossaries-extra}
    +
    +\GlsXtrLoadResources[
    +  src={terms},% entries in terms.bib
    +  % put these entries in the 'main' (default) list:
    +  type=main,
    +  sort=de-CH-1996% sort according to this locale
     ]
    -\GlsXtrLoadResources[
    - src={abbrvs}, % entries defined in abbrvs.bib
    - type={abbreviations},% put in abbreviations glossary
    - save-locations=false% no number list for these entries
    +\GlsXtrLoadResources[
    +  src={abbrvs},% entries in abbrvs.bib
    +  % put these entries in the 'abbreviations' list:
    +  type={abbreviations},
    +  % case-sensitive letter (non-locale) sort:
    +  sort=letter-case
     ]
    -\GlsXtrLoadResources[
    - src={syms}, % entries defined in syms.bib
    - type={symbols}% put in symbols glossary
    +\GlsXtrLoadResources[
    +  src={syms},% entries in syms.bib
    +  type=symbols,% put these entries in the 'symbols' list
    +  sort=use% sort according to first use in the document
     ]
    -
    -

    -

    -

    -

    Top

    9 Further Information

    - -

    The Dickimaw Books Gallery provides additional example documents. -

    -

    1deprecated, use babel instead

    - - - - +\GlsXtrLoadResources[ + src={constants},% entries in constants.bib + type=numbers,% put these entries in the 'numbers' list + sort-field=user1,% sort according to this field + sort=double% double-precision sort +] + The last resource set assumes that the entries defined in the file constants.bib have a number stored in the user1 field. For example:
    @number{pi,
    +  name={\ensuremath{\pi}},
    +  description={pi},
    +  user1={3.141592654}
    +}
    +

    +3.Put

    \printunsrtglossary[type=type,options]
    +
    where you want your list of entries (glossary) to appear. (The sort key isn’t available in options. The sort setting needs to be used in \GlsXtrLoadResources instead.) Alternatively, use
    \printunsrtglossaries
    +

    +4.Run LaTeX on your document. The record option adds information to the aux file that provides bib2gls with all required details for each resource set. For example, if the file is called myDoc.tex:

    pdflatex myDoc
    +

    +5.Run bib2gls

    bib2gls myDoc
    +
    or (if you need letter groups)
    bib2gls --group myDoc
    +

    +6.Run LaTeX again. +

+ Here’s a complete document (myDoc.tex):
\documentclass{article}
+
+\usepackage[record]{glossaries-extra}
+% input the glstex file created by bib2gls:
+\GlsXtrLoadResources
+ [% instructions to bib2gls:
+   src={entries}, % terms are defined in entries.bib
+   sort=en-GB% sort according to this locale
+ ]
+
+\begin{document}
+A \gls{sample}.
+
+\printunsrtglossaries % iterate over all defined entries
+\end{document}
+
The accompanying entries.bib file:
@entry{sample,
+  name={sample},
+  description={an example}
+}
+
Document build:
pdflatex myDoc
+bib2gls myDoc
+pdflatex myDoc
+
+

+ +

+

+If you are having difficulty integrating makeglossaries (or makeglossaries-lite) or bib2gls into your document build process, you may want to consider using arara, which is a Java application that searches the document for special comment lines that tell arara which applications to run. For example, the file myDoc.tex might start with:

% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+\documentclass{article}
+\usepackage{glossaries}
+\makeglossaries
+
then to build the document you just need the single system call:
arara myDoc
+
Alternatively, if you want to use makeglossaries-lite, change the second line to:
% arara: makeglossarieslite
+
There’s also a rule for bib2gls. For example, the following indicates that letter groups are required:
% arara: pdflatex
+% arara: bib2gls: { group: on }
+% arara: pdflatex
+\documentclass{article}
+\usepackage[record]{glossaries-extra}
+\GlsXtrLoadResources
+

+When sorting the entries, the string comparisons are made according to each entry’s sort key. If this is omitted, the name key is used. For example, consider the definition:

\newglossaryentry{elite}
+{
+  name={\'elite},
+  description={select group or class}
+}
+
The sort key isn’t present, so it’s set to the same as the name key: \'elite. How this is interpreted depends on which option you have used: +
+ Option 1 By default, the accent command will be stripped so the sort value will be elite. This will put the entry in the “E” letter group. However if you use the sanitizesort=true package option, the sort value will be interpreted as the sequence of characters: \ ' e l i t and e. This will place this entry in the “symbols” group since it starts with a symbol.

+Option 2 The sort value will be interpreted as the sequence of characters: \ ’ e l i t and e. The first character is a backslash so makeindex will put this entry in the “symbols” group.

+Option 3 xindy disregards LaTeX commands so it sorts on elite, which puts this entry in the “E” group. If stripping all commands leads to an empty string (such as would happen with \ensuremath{\emptyset}) then xindy will fail, so in those situations you need to provide an appropriate sort value that xindy will accept.

+xindy merges entries with duplicate sort values. xindy forbids empty sort values. A sort value may degrade into an empty or duplicate value once xindy has stripped all commands and braces.
+

+Option 4 bib2gls has a primitive LaTeX parser that recognises a limited set of commands, which includes the standard accent commands and some maths commands, so it can convert \'elite to élite. It disregards unknown commands. This may lead to an empty sort value, but bib2gls doesn’t mind that. (It has fallbacks, depending on the sort method and various settings, that can be used to determine the order if the sort value is empty or a duplicate.)

+Note that even if the name is given as \'elite, the letter group heading (if the --group switch is used) may end up with the character É depending on the locale used by the sort comparator. In this case you will need to ensure the document can support this character either with inputenc or by switching to a LaTeX engine with native UTF-8 support. (Modern LaTeX kernels default to UTF-8.)

+There’s more information on how bib2gls obtains the sort value in bib2gls gallery: sorting.

+ +

+

+If the inputenc package is used:

\usepackage[utf8]{inputenc}
+
and the entry is defined as:
\newglossaryentry{elite}
+{
+  name={élite},
+  description={select group or class}
+}
+
then: +
+ Option 1: With old LaTeX kernels, this entry was placed in the “E” letter group. With new LaTeX kernels you will have to set the sort key to Basic Latin (for example, sort={elite}) but, where possible, it’s better to use xindy or bib2gls.

+Option 2 makeindex sees é as two octets (0xC3 0xA9) rather than a single character so it tries to put élite in the 0xC3 (“Ô) letter group (which, in this case, comes after “Z”). You will either have to set the sort key to Basic Latin (for example, sort={elite}) or switch to xindy or bib2gls.

+Option 3 xindy will correctly recognise the sort value élite and will place it in whatever letter group is appropriate for the given language setting. (In English, this would just be the “E” letter group, but another language might put it in the “É” letter group.)

+Option 4 The inputenc package doesn’t affect the encoding used with bib entry definitions, since these are dependent on the encoding used to save the bib file. The glstex file created by bib2gls will be written in the encoding required by your document. (In general, it’s best to use the same encoding across all files.)

+You can help bib2gls by putting an encoding comment at the start of the bib file:

% Encoding: UTF-8
+

+With the correct encoding set up, bib2gls will determine that the sort value is élite and will place it in whatever letter group is appropriate for the given sort rule. For example, sort=en-GB (or just sort=en) will put élite in the “E” letter group, but another language might put it in the “É” letter group.

+ +

+

+Therefore if you have extended Latin or non-Latin characters, your best option is to use either xindy (Option 3) or bib2gls (Option 4). If you use makeindex (Option 2) you need to specify the sort key like this:

\newglossaryentry{elite}
+{
+  name={élite},
+  sort={elite},
+  description={select group or class}
+}
+
If you use Option 1, you may or may not need to use the sort key, but you will need to be careful about fragile commands in the name key if you don’t set the sort key.

+If you use Option 3 and the name only contains a command or commands (such as \P or \ensuremath{\pi}) you must add the sort key. This is also advisable for the other options (except Option 4), but is essential for Option 3. For example:

\newglossaryentry{P}{name={\P},sort={P},
+  description={paragraph symbol}}
+

+ +

+ +
+

5. Customising the Glossary

+

+The default glossary style uses the description environment to display the entry list. Each entry name is set in the optional argument of \item which means that it will typically be displayed in bold. You can switch to medium weight by redefining \glsnamefont:

\renewcommand*{\glsnamefont}[1]{\textmd{#1}}
+
Some classes and packages redefine the description environment in such as way that’s incompatible with the glossaries package. In which case you’ll need to select a different glossary style (see below).

+By default, a full stop is appended to the description (unless you use glossaries-extra). To prevent this from happening use the nopostdot package option:

\usepackage[nopostdot]{glossaries}
+
or to add it with glossaries-extra:
\usepackage[postdot]{glossaries-extra}
+

+By default, a location list is displayed for each entry (unless you use \printunsrtglossary without bib2gls). This refers to the document locations (for example, the page number) where the entry has been referenced. If you use Options 2 or 3 described in §4 or Option 4 (with bib2gls and glossaries-extra) then location ranges will be compressed. For example, if an entry was used on pages 1, 2 and 3, with Options 2, 3 or 4 the location list will appear as 1–3, but with Option 1 it will appear as 1, 2, 3. If you don’t want the locations displayed you can hide them using the nonumberlist package option:

\usepackage[nonumberlist]{glossaries}
+
or with bib2gls use save-locations=false in the optional argument of the appropriate \GlsXtrLoadResources (it’s possible to have some resource sets with locations and some without).

+Entries are grouped according to the first letter of each entry’s sort key. By default a vertical gap is placed between letter groups for most of the predefined styles. You can suppress this with the nogroupskip package option:

\usepackage[nogroupskip]{glossaries}
+

+If the default style doesn’t suit your document, you can change the style using:

+\setglossarystyle{style name}
+ There are a number of predefined styles. Glossaries can vary from a list of symbols with a terse description to a list of words or phrases with descriptions that span multiple paragraphs, so there’s no “one style fits all” solution. You need to choose a style that suits your document. For example:
\setglossarystyle{index}
+
You can also use the style package option for the preloaded styles. For example:
\usepackage[style=index]{glossaries}
+

+Examples: +

    +
  1. 1.You have entries where the name is a symbol and the description is a brief phrase or short sentence. Try one of the “mcol” styles defined in the glossary-mcols package. For example:
    \usepackage[nopostdot]{glossaries}
    +\usepackage{glossary-mcols}
    +\setglossarystyle{mcolindex}
    +
    or
    \usepackage[stylemods=mcols,style=mcolindex]{glossaries-extra}
    +

    +

  2. 2.You have entries where the name is a word or phrase and the description spans multiple paragraphs. Try one of the “altlist” styles. For example:
    \usepackage[nopostdot]{glossaries}
    +\setglossarystyle{altlist}
    +
    or
    \usepackage[stylemods,style=altlist]{glossaries-extra}
    +

    +

  3. 3.You have entries where the name is a single word, the description is brief, and an associated symbol has been set. Use one of the styles that display the symbol (not all of them do). For example, one of the tabular styles:
    \usepackage[nopostdot,nonumberlist,style=long4col]glossaries
    +
    or one of the “tree” styles:
    \usepackage[nopostdot,nonumberlist,style=tree]{glossaries}
    +
    +
+

+If your glossary consists of a list of abbreviations and you also want to specify a description as well as the long form, then you need to use an abbreviation style that will suit the glossary style. For example, use the long-short-desc acronym style:

\setacronymstyle{long-short-desc}
+
Define the acronyms with a description:
\newacronym
+ [description={statistical pattern recognition technique}]
+ {svm}{SVM}{support vector machine}
+
Alternatively with glossaries-extra:
\setabbreviationstyle{long-short-desc}
+
+\newabbreviation
+ [description={statistical pattern recognition technique}]
+ {svm}{SVM}{support vector machine}
+

+Choose a glossary style that suits wide entry names. For example:

\setglossarystyle{altlist}
+

+ +

+ +
+

6. Multiple Glossaries

+

+The glossaries package predefines a default main glossary. When you define an entry (using one of the commands described in §2), that entry is automatically assigned to the default glossary, unless you indicate otherwise using the type key. However you first need to make sure the desired glossary has been defined. This is done using:

+\newglossary[log-ext]{glossary-label}{out-ext}{in-ext}{title}
+ The glossary-label is a label that uniquely identifies this new glossary. As with other types of identifying labels, be careful not to use active characters in label. The final argument title is the section or chapter title used by \printglossary, \printnoidxglossary or \printunsrtglossary. The other arguments indicate the file extensions used by makeindex or xindy (described in §4). If you’re not using either makeindex or xindy, then the log-ext, in-ext and out-ext arguments aren’t relevant, in which case you may prefer to use the starred version where those arguments are omitted:
+\newglossary*{glossary-label}{title}[counter]
+

+In the case of Options 2 or 3, all new glossaries must be defined before \makeglossaries. (Entry definitions should come after \makeglossaries.) In the case of Option 4, all new glossaries must be defined before any \GlsXtrLoadResources that requires them.

+Since it’s quite common for documents to have both a list of terms and a list of abbreviations, the glossaries package provides the package option acronyms (or acronym), which is a convenient shortcut for

\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
+
The option also changes the behaviour of \newacronym so that acronyms are automatically put in the list of acronyms instead of the main glossary. The glossaries-extra package also supports the acronyms option for abbreviations defined using \newacronym but additionally has the package option abbreviations to create a list of abbreviations for \newabbreviation.

+There are some other package options for creating commonly used lists: symbols (lists of symbols), numbers (lists of numbers), index (an index). Since indexes don’t typically have descriptions, the index option also defines:

+\newterm[key=value list]{entry-label}

+

requires index package option
+
+ This is just a shortcut that uses \newglossaryentry with the name set to entry-label and the description is suppressed.

+For example, suppose you want a main glossary for terms, a list of acronyms and a list of notation:

\usepackage[acronyms]{glossaries}
+\newglossary[nlg]{notation}{not}{ntn}{Notation}
+
After \makeglossaries (or \makenoidxglossaries) you can define the entries in the preamble. For example:
\newglossaryentry{gls:set}
+{% This entry goes in the `main' glossary
+  name={set},
+  description={A collection of distinct objects}
+}
 
+% This entry goes in the `acronym' glossary:
+\newacronym{svm}{svm}{support vector machine}
+
+\newglossaryentry{not:set}
+{% This entry goes in the `notation' glossary:
+  type={notation},
+  name={\ensuremath{\mathcal{S}}},
+  description={A set},
+  sort={S}}
+
or if you don’t like using \ensuremath:
\newglossaryentry{not:set}
+{% This entry goes in the `notation' glossary:
+  type={notation},
+  name={$\mathcal{S}$},
+  text={\mathcal{S}},
+  description={A set},
+  sort={S}
+}
+

+Each glossary is displayed using:

\printnoidxglossary[type=type]
+
(Option 1) or
\printglossary[type=type]
+
(Options 2 and 3). Where type is the glossary label. If the type is omitted the default main glossary is assumed.

+If you’re using bib2gls then each glossary is displayed using:

\printunsrtglossary[type=type]
+
With this method you don’t use \makeglossaries or \makenoidxglossaries. Instead you can assign the entry type with the resource command. For example:
\usepackage[record,abbreviations,symbols]{glossaries-extra}
+
+\GlsXtrLoadResources[
+ src={terms}, % entries defined in terms.bib
+ type=main% put in main glossary
+]
+\GlsXtrLoadResources[
+ src={abbrvs}, % entries defined in abbrvs.bib
+ type=abbreviations% put in abbreviations glossary
+]
+\GlsXtrLoadResources[
+ src={syms}, % entries defined in syms.bib
+ type=symbols% put in symbols glossary
+]
+
Later in the document:
\printunsrtglossary % main
+\printunsrtglossary[type=abbreviations]
+\printunsrtglossary[type=symbols]
+

+There’s a convenient shortcut that will display all the defined glossaries depending on the indexing method:

+\printnoidxglossaries
+ (Option 1) or
+\printglossaries
+ (Options 2 and 3) or (glossaries-extra only)
+\printunsrtglossaries
+

+If you use Options 1 or 4, you don’t need to do anything different for a document with multiple glossaries. If you use Options 2 or 3 with the makeglossaries Perl script or the makeglossaries-lite Lua script, you similarly don’t need to do anything different to the document build (compared to building a document with only one glossary).

+If you use Options 2 or 3 without the makeglossaries Perl script or makeglossaries-lite Lua script then you need to make sure you run makeindex/xindy for each defined glossary. The gls and glo arguments of \newglossary specify the file extensions to use instead of gls and glo. The optional argument glg is the file extension for the transcript file. This should be different for each glossary in case you need to check for makeindex/xindy errors or warnings if things go wrong.

+For example, suppose you have three glossaries in your document (main, acronym and notation), specified using:

\usepackage[acronyms]{glossaries}
+\newglossary[nlg]{notation}{not}{ntn}{Notation}
+
Then (assuming your LaTeX document is in a file called myDoc.tex):

+ +

+ Option 2: Either use one makeglossaries or makeglossaries-lite call:
makeglossaries myDoc
+
or
makeglossaries-lite myDoc
+
Or you need to run makeindex three times:
makeindex -t myDoc.glg -s myDoc.ist -o myDoc.gls myDoc.glo
+makeindex -t myDoc.alg -s myDoc.ist -o myDoc.acr myDoc.acn
+makeindex -t myDoc.nlg -s myDoc.ist -o myDoc.not myDoc.ntn
+

+Option 3: Either use one makeglossaries call:

makeglossaries myDoc
+
Or you need to run xindy three times (be careful not to insert line breaks where the line has wrapped.)
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
+xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
+xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.nlg -o myDoc.not myDoc.ntn
+

+Option 4: With bib2gls only one call is required:

pdflatex myDoc
+bib2gls --group myDoc
+pdflatex myDoc
+
(Omit --group if you don’t need letter groups.) +
+

+ +

+ +
+

7. Hyperlinks (glossaries and hyperref)

+

+Take care if you use the glossaries package with hyperref. Contrary to the usual advice that hyperref should be loaded last, glossaries (and glossaries-extra) must be loaded after hyperref:

\usepackage[colorlinks]{hyperref}
+\usepackage{glossaries}
+
If you use hyperref make sure you use pdfLaTeX rather than the LaTeX to DVI engine. The DVI format can’t break hyperlinks across a line so long glossary entries (such as the full form of acronyms) won’t line wrap with the DVI engine. Also, hyperlinks in sub- or superscripts aren’t correctly sized with the DVI format.

+By default, if the hyperref package has been loaded, commands like \gls will form a hyperlink to the relevant entry in the glossary. If you want to disable this for all your glossaries, then use:

+\glsdisablehyper
+ If you want hyperlinks suppressed for entries in specific glossaries, then use the nohypertypes package option. For example, if you don’t want hyperlinks for entries in the acronym and notation glossaries but you do want them for entries in the main glossary, then do:
\usepackage[colorlinks]{hyperref}
+\usepackage[acronym,nohypertypes={acronym,notation}]{glossaries}
+\newglossary[nlg]{notation}{not}{ntn}{Notation}
+

+If you want the hyperlinks suppressed the first time an entry is used, but you want hyperlinks for subsequence references then use the hyperfirst=false package option:

\usepackage[colorlinks]{hyperref}
+\usepackage[hyperfirst=false]{glossaries}
+
The glossaries-extra extension package provides another method using category attributes. See the glossaries-extra user manual for further details.

+Take care not to use non-expandable commands in PDF bookmarks. This isn’t specific to the glossaries package but is a limitation of PDF bookmarks. Non-expandable commands include commands like \gls, \glspl, \Gls and \Glspl. The hyperref package provides a way of specifying alternative text for the PDF bookmarks via \texorpdfstring. For example:

\section{The \texorpdfstring{\gls{fishage}}{Fish Age}}
+
However, it’s not a good idea to use commands like \gls in a section heading as you’ll end up with the table of contents page in your location list and it will unset the first use flag too soon. Instead you can use
+\glsentrytext{entry-label}
+ This is expandable provided that the text key doesn’t contain non-expandable code. For example, the following works:
\section{The \glsentrytext{fishage}}
+
and it doesn’t put the table of contents in the location list.

+If you use glossaries-extra then use the commands that are provided specifically for use in section headers. For example:

\section{The \glsfmttext{fishage}}
+

+ +

+ +
+

8. Cross-References

+

+You can add a reference to another entry in a location list using the see={label-list} key when you define an entry. The referenced entry (or entries) must also be defined.

+For example:

\longnewglossaryentry{devonian}{name={Devonian}}% 
+{% 
+  The geologic period spanning from the end of the 
+  Silurian Period to the beginning of the Carboniferous Period.
+
+  This age was known for its remarkable variety of 
+  fish species.
+}
 
+\newglossaryentry{fishage}
+{
+  name={Fish Age},
+  description={Common name for the Devonian period},
+  see={devonian}
+}
+
The cross-reference will appear as see Devonian”. You can change the “see” tag for an individual entry using the format see={[tag]label-list}. For example:
\newglossaryentry{latinalph}
+{
+  name={Latin alphabet},
+  description={alphabet consisting of the letters    a, \ldots, z, A, \ldots, Z},
+  see=[see also]{exlatinalph}
+}
+\newglossaryentry{exlatinalph}
+{
+   name={extended Latin alphabet},
+   description={The Latin alphabet extended to include     other letters such as ligatures or diacritics.}
+}
+
In the above, I haven’t enclosed the entire value of the see key in braces. If you use the see key in an optional argument, such as the optional argument of \newacronym, make sure you enclose the value (including the optional tag) in braces. For example:
\newacronym{ksvm}{ksvm}{kernel support vector machine}
+\newacronym
+ [see={[see also]{ksvm}}]
+ {svm}{svm}{support vector machine}
+
The glossaries-extra package provides a seealso key. This doesn’t allow a tag but behaves much like see={[\seealsoname]{label-list}}. For example:
\newabbreviation{ksvm}{ksvm}{kernel support vector machine}
+\newabbreviation
+ [seealso={ksvm}]
+ {svm}{svm}{support vector machine}
+

+Since the cross-reference appears in the location list, if you suppress the location list using the nonumberlist package option, then the cross-reference will also be suppressed. With bib2gls, don’t use the nonumberlist package option. Instead use save-locations=false in the resource options. For example:

\usepackage[record,abbreviations,symbols]{glossaries-extra}
+
+\GlsXtrLoadResources[
+ src={terms}, % entries defined in terms.bib
+ type=main% put in main glossary
+]
+\GlsXtrLoadResources[
+ src={abbrvs}, % entries defined in abbrvs.bib
+ type=abbreviations,% put in abbreviations glossary
+ save-locations=false% no number list for these entries
+]
+\GlsXtrLoadResources[
+ src={syms}, % entries defined in syms.bib
+ type=symbols% put in symbols glossary
+]
+

+ +

+ +
+

9. Further Information

+

+ +

+ The Dickimaw Books Gallery provides additional example documents.

+ +

+ +
+

Symbols

+ +
+
📌
+
The syntax and usage of a command, environment or option etc.
+
+
An important message.
+
🖹
+
LaTeX code to insert into your document.
+
🖹🛇
+
Problematic code which should be avoided.
+
🖺
+
How the example code should appear in the PDF.
+
🔎
+
A command-line application invocation that needs to be entered into a terminal or command prompt.
+ +
+ +
+ +
+

Glossary

+ +
+
First use
+
The first time an entry is used by a command that unsets the first use flag (or the first time since the flag was reset).
+
First use flag
+
A conditional that keeps track of whether or not an entry has been referenced by any of the \gls-like 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).
+
Glossary
+
Technically a glossary is an alphabetical list of words relating to a particular topic. For the purposes of describing the glossaries and glossaries-extra packages, a glossary is either the list produced by commands like \printglossary or \printunsrtglossary (which may or may not be ordered alphabetically) or a glossary is a set of entry labels where the set is identified by the glossary label or type.
+
\Gls-like
+
Commands like \gls that change the first use flag. These commands index the entry (if indexing is enabled), create a hyperlink to the entry’s glossary listing (if enabled) and unset the first use flag.
+
Indexing (or recording)
+
The process of saving the location (for example, the page number) and any associated information that is required in the glossary. The data may be sorted and collated by an indexing application as part of the document build.
+
Link text
+
The text produced by commands like \gls that have the potential to be a hyperlink.
+
Semantic command
+
Essentially, a semantic command is one that’s associated with a particular document element, idea or topic that hides the font and other stylistic formatting inside its definition. For example, Latin taxonomy is usually displayed in italic. Explicitly using font commands, for example \textit{Clostridium}, is syntactic markup. Whereas defining a command called, say, \bacteria that displays its argument in italics is a semantic command. The actual styling is hidden and the command relates specifically to a particular concept.
Syntactic: \textit{Clostridium}
+\newrobustcmd*{\bacteria}[1]{\emph{#1}}%
Semantic: \bacteria{Clostridium}
The end result is the same:
+Syntactic: Clostridium

+Semantic: Clostridium

+ The advantage with semantic commands is that it’s much easier to change the style, simply by adjusting the command definition. Note that I’ve used \newrobustcmd to make the semantic command robust as the style commands can cause a problem if they expand too soon.
+
Subsequent use
+
Using an entry that unsets the first use flag when it has already been unset.
+ +
+ +
+ +
+

Command Summary

+ +
+ +
+

A

+
\acronymnameinitial: Acronyms; glossaries

+

(language-sensitive)
+
+

+Expands to the title of the acronym glossary.

+ +

+ +
+

G

+
\Gls[options]{label}[insert]modifiers: * + glossaries
+

+As \gls but converts the first character of the link text to uppercase (for the start of a sentence) using \makefirstuc. §3; 20

+

\gls[options]{label}[insert]modifiers: * + glossaries
+

+References the entry identified by label. The text produced may vary depending on whether or not this is the first use. §3; 20

+

\glsabbrvonlyfont{text}glossaries-extra v1.17+
+

+Short form font used by the “only” abbreviation styles.

+

\glsabbrvscfont{text}glossaries-extra v1.17+
+

+Short form font used by the small-caps “sc” abbreviation styles.

+

\glsdefaulttypeinitial: main; glossaries
+

+Expands to the label of the default glossary.

+

+

+Suppresses all glossary related hyperlinks. §7; 42

+

\glsentrylong{entry-label}glossaries
+

+Simply expands to the value of the long field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the long field doesn’t contain any fragile commands.

+

\glsentryshort{entry-label}glossaries
+

+Simply expands to the value of the short field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the short field doesn’t contain any fragile commands.

+

\glsentrytext{entry-label}glossaries
+

+Simply expands to the value of the text field. Does nothing if the entry hasn’t been defined. May be used in expandable contexts provided that the text field doesn’t contain any fragile commands. §7; 43

+

\glsfmtshort{entry-label}
+

+For use within captions or section titles to display the formatted short form.

+

\glsfmttext{entry-label}
+

+For use within captions or section titles to display the formatted text.

+

\glslongonlyfont{text}glossaries-extra v1.17+
+

+Long form font used by the “only” abbreviation styles.

+

\glslowercase{text}glossaries v4.50+
+

+Converts text to lowercase using the modern LaTeX3 case-changing command, which is expandable.

+

\glsnamefont{text}glossaries
+

+Used within the predefined glossary styles to apply a font change to the name.

+

\glsnoexpandfieldsglossaries
+

+Don’t expand field values when defining entries, except for those that explicitly have expansion enabled.

+

\Glspl[options]{label}[insert]modifiers: * + glossaries
+

+As \Gls but uses the plural form. §3; 20

+

\glspl[options]{label}[insert]modifiers: * + glossaries
+

+As \gls but uses the plural form. §3; 20

+

\GlsSetQuote{character}glossaries v4.24+
+

+Set makeindex’s quote character to character.

+

\glssymbol[options]{label}[insert]modifiers: * +
+

+References the entry identified by label. The text produced is obtained from the symbol value. The insert argument will be inserted at the end of the link text. This command does not alter or depend on the first use flag. §3; 21

+

\GlsXtrLoadResources[options]glossaries-extra v1.11+
+

+For use with bib2gls, this both sets up the resource options (which bib2gls can detect from the aux file) and inputs the glstex file created by bib2gls.

+

\glsxtrnewsymbol[key=value list]{label}{sym}glossaries-extra

+

(requires \usepackage[symbols]{glossaries-extra})
+
+

+Defines a new glossary entry with the given label, type set to symbols, the category set to symbol, the name set to sym and the sort set to label. The optional argument is a comma-separated list of glossary entry keys, which can be used to override the defaults. §2; 18

+ +

+ +
+

L

+
\loadglsentries[type]{filename}glossaries
+

+Locally assigns \glsdefaulttype to type and inputs filename. If the optional argument is omitted, the default glossary is assumed. Note that if any entries within filename have the type key set (including implicitly in commands like \newacronym), then this will override the type given in the optional argument.

+

\longnewglossaryentry{label}{key=value list}{description}glossaries
+

+Defines a new glossary entry with the given label. The second argument is a comma-separated list of glossary entry keys. The third argument is the description, which may include paragraph breaks. §2; 11

+ +

+ +
+

M

+
\makefirstuc{text}mfirstuc
+

+Robust command that converts the first character of text to uppercase (sentence case). See the mfirstuc documentation for further details, either:

texdoc mfirstuc
or visit ctan.org/pkg/mfirstuc.

+

\makeglossariesglossaries
+

+Opens the associated glossary files that need to be processed by makeindex or xindy.

+

\makenoidxglossariesglossaries v4.04+
+

+Sets up all glossaries so that they can be displayed with \printnoidxglossary.

+ +

+ +
+

N

+
\newabbreviation[options]{label}{short}{long}glossaries-extra
+

+Defines a new entry that represents an abbreviation. This internally uses \newglossaryentry and any provided options (glossary entry keys) will be appended. The category is set to abbreviation by default, but may be overridden in options. The appropriate style should be set before the abbreviation is defined with \setabbreviationstyle. §2; 16

+

\newacronym[options]{label}{short}{long}glossaries
+

+This command is provided by the base glossaries package but is redefined by glossaries-extra to use \newabbreviation with the category key set to acronym. With just the base glossaries package, use \setacronymstyle to set the style. With glossaries-extra, use \setabbreviationstyle[acronym]{style} to set the style that governs \newacronym. §2; 15

+

\newglossary[log-ext]{glossary-label}{out-ext}{in-ext}{title}glossaries
+

+Defines a glossary identified by glossary-label (which can be referenced by the type key when defining an entry). §6; 37

+

\newglossary*{glossary-label}{title}[counter]glossaries v4.08+
+

+A shortcut that supplies file extensions based on the glossary label:

\newglossary[glossary-label-glg]{glossary-label}{glossary-label-gls}{glossary-label-glo}{title}[counter]
§6; 38

+

\newglossaryentry{label}{key=value list}glossaries
+

+Defines a new glossary entry with the given label. The second argument is a comma-separated list of glossary entry keys. §2; 11

+

\newterm[key=value list]{entry-label}

+

(requires index package option)
+
+

+Defines a new glossary entry with the given label, type set to index, the name set to entry-label and the description set to \nopostdesc. The optional argument is a comma-separated list of glossary entry keys, which can be used to override the defaults. §6; 38

+

\nopostdescglossaries v1.17+
+

+When placed at the end of the description, this switches off the post-description punctuation (if it has been enabled). Does nothing outside of the glossary.

+ +

+ +
+

P

+ +

+Iterates over all glossaries and does \printglossary[type=type] for each glossary. §6; 40

+

\printglossary[options]glossaries
+

+Displays the glossary by inputting a file created by makeindex or xindy. Must be used with \makeglossaries and either makeindex or xindy.

+

+

+Iterates over all glossaries and does \printnoidxglossary[type=type] for each glossary. §6; 40

+

\printnoidxglossary[options]glossaries v4.04+
+

+Displays the glossary by obtaining the indexing information from the aux file and using TeX to sort and collate. Must be used with \makenoidxglossaries. This method can be very slow and has limitations.

+

+

+Iterates over all glossaries and does \printunsrtglossary[type=type] for each glossary. §6; 40

+

\printunsrtglossary[options]glossaries-extra v1.08+
+

+Displays the glossary by iterating over all entries associated with the given glossary (in the order in which they were added to the glossary). The location lists and group headers will only be present if the associated fields have been set (typically by bib2gls).

+ +

+ +
+

S

+
\seealsonameinitial: see also; glossaries-extra

+

(language-sensitive)
+
+

+Used as a cross-reference tag.

+

\setabbreviationstyle[category]{style-name}glossaries-extra
+

+Sets the current abbreviation style to style-name for the category identified by category. If the optional argument is omitted, abbreviation is assumed. §2; 16

+

\setacronymstyle[glossary-type]{style-name}glossaries
+

+Sets the acronym style. Don’t use with glossaries-extra. §2; 16

+

\setglossarystyle{style name}glossaries
+

+Set the current glossary style to style name. §5; 35

+ +

+ +
+

Index

+
Symbols A B C D F G H I L M N O P R S T U X
+ +
+ +
+

Symbols

+
: (colon)67
+
?? (unknown entry marker)20
+
~ (non-breaking space) +
+ +
+ +
+

A

+
abbreviation styles54, +
+
long-only-short-only5
+
long-short-sc5
+
long-short34
+
short-nolong4
+
abbreviations28, 3840
+
acronym38
+
acronym styles +
+
long-sc-short4
+
long-short-desc1637
+
long-short3, 1620
+
short-long-desc16
+
short-long16
+ +
acronyms38
+
arara31
+
automake2527
+ +
+ +
+

B

+
babel package2, 67
+
bib2gls4, 8, 10, 13, 15, 1720, 28, 3035, 39, 42, 45, 5154
+
-g +
+
--group30, 3242
+ +
+ +
+

C

+
category
+
abbreviation16, 5254
+
acronym4, 16, 1752
+ +
+ +
+

D

+
description environment34
+ +
+ +
+

F

+
file formats
+
acn38
+
acr38
+
alg38
+
aux23, 26, 3054
+
bib4, 13, 1428
+
glo24, 2741
+
gls41
+
glstex28
+
ist24
+
log3
+
tex4
+
xdy27
+
first use46
+
first use flag46
+
fontenc package2
+ +
+ +
+

G

+
glossaries-extra package328
+
glossaries-french2
+
glossaries-german2
+
glossaries-language2
+
glossaries package2
+
glossary-mcols package36
+
glossary46
+
glossary entry keys
+
category5, 5152
+
description2, 11, 16, 37, 3853
+
long1749
+
longplural17
+
name2, 11, 14, 1619, 21, 32, 34, 38, 50, 5153
+
plural1015
+
see4445
+
seealso45
+
short1749
+
shortplural17
+
sort12, 18, 19, 21, 323551
+
symbol17, 2150
+
text15, 4349
+
type37, 5153
+
user129
+
glossary styles55
+
altlist3637
+
index35
+
indexgroup10
+
long4col36
+
mcolindex36
+ +
\gls§3; 29, 15, 20, 42, 43, 47, 4850
+
\gls-like1047
+ + + + + + + + + + + + + + + + + + +
save-locations3545
+
sort-field29
+
sort2934
+
src28, 2940
+
type2940
+ + +
+ +
+

H

+
hyperfirst43
+
hyperref package2, 7, 20, 4243
+ +
+ +
+

I

+
index3853
+
indexing (or recording)8, 4754
+
inputenc package2, 1333
+
\item34
+ +
+ +
+

L

+
link text3, 47, 4850
+ + +
lowercase550
+ +
+ +
+

M

+ + +
makeglossaries-lite24, 25, 3141
+
makeglossaries2327, 31, 4041
+
makeindex8, 10, 18, 23, 26, 3234, 38, 41, 50, 5253
+ +
mfirstuc package1351
+ +
+ +
+

N

+ +
\newacronym§2; 36, 15, 16, 20, 37, 38, 44, 5152
+ + + + +
nogroupskip935
+
nohypertypes42
+
non-breaking space (~)6
+
nonumberlist10, 3545
+ +
nopostdot1034
+
numbers2838
+ +
+ +
+

O

+ + + + +
order2527
+ +
+ +
+

P

+
polyglossia package2
+
postdot10
+
print [unsrt|noidx] glossary options
+
sort22, 24, 2629
+
type29, 39, 40, 5354
+ + + + + + + +
+ +
+

R

+
record8, 14, 28, 3040
+ +
+ +
+

S

+
sanitizesort2132
+ +
semantic command347
+
sentence case20, 4851
+ + + +
sort8, 21, 2427
+
style1036
+
stylemods36
+
subsequent use47
+
symbols18, 19, 28, 38, 4051
+ +
+ +
+

T

+
\texorpdfstring43
+
\textsc4, 516
+ +
+ +
+

U

+
uppercase20, 4851,
see also sentence case
+
+ +
+ +
+

X

+
xindy8, 10, 18, 26, 27, 3234, 38, 41, 5253
+
xindy26
+

+ +

+ + + diff --git a/macros/latex/contrib/glossaries/glossariesbegin.pdf b/macros/latex/contrib/glossaries/glossariesbegin.pdf index df97b42bca..79451e76cc 100644 Binary files a/macros/latex/contrib/glossaries/glossariesbegin.pdf and b/macros/latex/contrib/glossaries/glossariesbegin.pdf differ diff --git a/macros/latex/contrib/glossaries/glossariesbegin.tex b/macros/latex/contrib/glossaries/glossariesbegin.tex index 00b3a872c0..983766842e 100644 --- a/macros/latex/contrib/glossaries/glossariesbegin.tex +++ b/macros/latex/contrib/glossaries/glossariesbegin.tex @@ -1,65 +1,1051 @@ -\documentclass{nlctdoc} - -\usepackage[utf8]{inputenc} -\ifpdf - \usepackage[T1]{fontenc} - \usepackage{mathpazo} - \usepackage[scaled=.88]{helvet} - \usepackage{courier} - \usepackage{metalogo} - \usepackage{xr-hyper} -\else - \providecommand{\XeLaTeX}{XeLaTeX} - \providecommand{\LuaLaTeX}{LuaLaTeX} -\fi - -\usepackage{alltt} +% arara: lualatex +% arara: bib2gls: { group: on } +% arara: lualatex +% arara: bib2gls: { group: on } if found ("log", "Glossary entry `sym.") +% arara: lualatex +% arara: lualatex if found ("log", "Rerun to") +\documentclass[titlepage=false,oneside, + fontsize=12pt,captions=tableheading]{scrarticle} + \usepackage{pifont} -\usepackage{array} -\usepackage{color} +\usepackage[noatsymgroup]{nlctuserguide} -\usepackage[colorlinks,linkcolor=blue,pdfauthor={Nicola L.C. Talbot}, - pdftitle={The glossaries package: a guide for beginners}]{hyperref} -\usepackage[nomain]{glossaries} +\renewcommand*{\thispackagename}{glossaries} -\newcommand*{\yes}{\ding{52}} -\newcommand*{\no}{\ding{56}} +\glsxtrnewgls{opt.glostyle.}{\glostyle} +\glsxtrnewgls{opt.acrstyle.}{\acrstyle} +\glsxtrnewgls{opt.abbrstyle.}{\abbrstyle} -\newcommand*{\proyes}{\textcolor{green}{\yes}} -\newcommand*{\prono}{\textcolor{red}{\no}} +\defsemanticcmd{\glostylefmt}{\textsf}{} +\defsemanticcmd{\acrstylefmt}{\textsf}{} +\defsemanticcmd{\abbrstylefmt}{\textsf}{} -\newcommand*{\conyes}{\textcolor{red}{\yes}} -\newcommand*{\conno}{\textcolor{green}{\no}} +\newcommand{\atentry}[1]{\texorpdfstring{\code{@#1}}{@#1}} -\newcommand*{\code}[1]{% - \texorpdfstring{{\frenchspacing\obeyspaces\ttfamily#1}}{#1}} -\newcommand*{\file}[1]{\texorpdfstring{\texttt{#1}}{#1}} +\glsxtrnewgls{opt.printgloss.}{\printglossopt} +\newcommand{\printglossoptval}[2]{\optval{printgloss.#1}{#2}} +\newcommand{\printglossoptvalm}[2]{\optval{printgloss.#1}{\marg{#2}}} -\title{The glossaries package v4.49: -a guide for beginners} -\author{Nicola L.C. Talbot\\\href{https://www.dickimaw-books.com/}{\nolinkurl{dickimaw-books.com}}} -\date{2021-11-01} +\glsxtrnewgls{opt.gloskey.}{\gloskey} +\newcommand{\gloskeyval}[2]{\optval{gloskey.#1}{\marg{#2}}} -\ifpdf - \externaldocument{glossaries-user} -\fi +\newcommand*{\catfmt}{\csoptfmt} -\makeatletter -\newcommand*{\optionlabel}[1]{% - \@glstarget{option#1}{}\textbf{Option~#1}} -\makeatother +\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}}} + +\renewcommand{\optionlistprefix}{idx.opt.} +\renewcommand{\glsxtrtaggedlistsep}{~} +\newcommand{\idxoptiondef}[1]{\hypertarget{option\glsentrytext{idx.opt.#1}}{}\inlineidxdef{opt.#1}} + +\renewcommand{\nlctuserguidecustomentryaliases}{% + glossarystyle=index, + acronymstyle=index, + abbreviationstyle=index, +} + +\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}} + +\nlctuserguidegls +{ + \def\gprintglossopt#1#2{% + \glsbibwriteentry{commandoption}{opt.printgloss.#1}{% + \field{name}{\csoptfmt{#1}}\parent{idx.printglossopt}#2}}% + \def\gglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}% + {\field{name}{\glostylefmt{#1}}\parent{idx.glossarystyle}#2}}% + \def\gacrsty#1#2{\glsbibwriteentry{acronymstyle}{opt.acrstyle.#1}% + {\field{name}{\acrstylefmt{#1}}\parent{idx.acrstyle}#2}}% + \def\gabbrsty#1#2{\glsbibwriteentry{abbreviationstyle}{opt.abbrstyle.#1}% + {\field{name}{\abbrstylefmt{#1}}\parent{idx.abbrstyle}#2}}% + \def\ggloskey#1#2{% + \glsbibwriteentry{commandoption}{opt.gloskey.#1}{% + \field{name}{\csoptfmt{#1}}\parent{idx.gloskey}#2}}% + \def\gglsopt#1#2{% + \glsbibwriteentry{commandoption}{opt.glsopt.#1}{% + \field{name}{\csoptfmt{#1}}\parent{gls}#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\gresourceopt#1#2{% + \glsbibwriteentry{commandoption}{opt.resource.#1}{% + \field{name}{\csoptfmt{#1}}\parent{GlsXtrLoadResources}#2}}% + \gidx{category}{\field{plural}{categories}} + \gidx{glossarystyle}{\name{glossary styles}\field{text}{glossary style}} + \gidx{acrstyle}{\name{acronym styles}\field{text}{acronym style} + \field{see}{setacronymstyle}} + \gidx{abbrstyle}{\name{abbreviation styles}\field{text}{abbreviation style} + \field{see}{setabbreviationstyle}} + \gidx{printglossopt}{\name{print [unsrt|noidx] glossary options}% + \field{text}{print glossary option}% + } + % \newglossary + \gcmd{new\-glossary} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{log-ext}\margm{glossary-label}\margm{out-ext}\margm{in-ext}\margm{title}} + \desc{defines a \idx{glossary} identified by \meta{glossary-label} (which can + be referenced by the \gloskey{type} key when defining an entry)} + } + % \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}\marg{\meta{glossary-label}-glo}\margm{title}\oargm{counter}% +\end{compactcodebox}\glsxtrnopostpunc +} + } + % \GlsSetQuote + \gcmd{Gls\-Set\-Quote} + { + \providedby{\sty{glossaries} v4.24+} + \syntax{\margm{character}} + \desc{set \app{makeindex}['s] quote character to \meta{character}} + } + % \glsdisablehyper + \gcmd{gls\-disable\-hyper} + { + \providedby{\sty{glossaries}}% + \desc{suppresses all \idx{glossary} related hyperlinks} + } + % \glsenablehyper + \gcmd{gls\-enable\-hyper} + { + \providedby{\sty{glossaries}}% + \desc{enables \idx{glossary} related hyperlinks. This is the + default if \sty{hyperref} is loaded. Has no effect if + \sty{hyperref} wasn't loaded} + } + % \setglossarystyle + \gcmd{set\-glossary\-style} + { + \providedby{\sty{glossaries}}% + \syntax{\margm{style name}} + \desc{set the current \idx{glossarystyle} to \meta{style name}} + } + % \printglossary + \gcmd{print\-glossary} + { + \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}} + } + % \printglossaries + \gcmd{print\-glossaries} + { + \providedby{\sty{glossaries}}% + \desc{iterates over all glossaries and does + \code{\gls{printglossary}\oarg{\printglossoptval{type}{\meta{type}}}} + for each \idx{glossary}} + } + % \printnoidxglossary + \gcmd{print\-noidx\-glossary}% + {% + \providedby{\sty{glossaries} v4.04+} + \syntax{\oargm{options}} + \desc{displays the \idx{glossary} by obtaining the \gls{indexing} information from + the \ext+{aux} file and using \TeX\ to sort and collate. Must be used with + \gls{makenoidxglossaries}. This method can be very slow and has limitations} + }% + % \printnoidxglossaries + \gcmd{print\-noidx\-glossaries}% + {% + \providedby{\sty{glossaries} v4.04+} + \desc{iterates over all glossaries and does + \code{\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\meta{type}}}} + for each \idx{glossary}} + } + % \printunsrtglossary + \gcmd{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}). The location lists and group headers + will only be present if the associated fields have been set + (typically by \app{bib2gls})} + }% + % \printunsrtglossaries + \gcmd{print\-unsrt\-glossaries}% + {% + \providedby{\sty{glossaries-extra} v1.08+} + \desc{iterates over all glossaries and does + \code{\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\meta{type}}}} + for each \idx{glossary}} + } + % \glsdefaulttype + \gcmd{gls\-default\-type}% + {% + \providedby{\sty{glossaries}} + \initval{main}% + \desc{expands to the label of the default \idx{glossary}} + }% + % \acronymname + \gcmd{acronym\-name}% + {% + \providedby{\sty{glossaries}} + \initval{Acronyms}% + \note{language-sensitive} + \desc{expands to the title of the \code{acronym} \idx{glossary}} + }% + % \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 within + \meta{filename} have the \gloskey{type} key set (including + implicitly in commands like \gls{newacronym}), then this will + override the type given in the optional argument} + } + % \makeglossaries + \gcmd{make\-glossaries} + { + \providedby{\sty{glossaries}} + \desc{opens the associated \idx{glossary} files that need to be + processed by \app+{makeindex} or \app+{xindy}} + } + % \makenoidxglossaries + \gcmd{make\-noidx\-glossaries}% + {% + \providedby{\sty{glossaries} v4.04+} + \desc{sets up all glossaries so that they can be displayed + with \gls{printnoidxglossary}} + } + % \GlsXtrLoadResources + \gcmd{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{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}} + \syntax{\margm{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} + } + % \newterm + \gcmd{new\-term}% + {% + \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} + } + % \glsnamefont + \gcmd{gls\-name\-font} + { + \providedby{\sty{glossaries}} + \syntax{\margm{text}} + \desc{used within the predefined glossary styles to apply a font change to the + \gloskey{name}} + } + % \gls + \gcmdsp{gls} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{references the entry identified by \meta{label}. The text + produced may vary depending on whether or not this is the \idx{firstuse}} + } + % \glspl + \gcmdsp{glspl} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{as \gls{gls} but uses the plural form} + } + % \Gls + \gcmdsp{Gls} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{as \gls{gls} but converts the first character of the + \gls{linktext} to \idx{uppercase}\glsadd{idx.sentencecase} (for + the start of a sentence) using \gls{makefirstuc}} + } + % \Glspl + \gcmdsp{Glspl} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{as \gls{Gls} but uses the plural form} + } + % \glssymbol + \gcmdsp{gls\-symbol}{% + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{references the entry identified by \meta{label}. The text + produced is obtained from the \gloskey{symbol} value. + The \meta{insert} argument will be inserted at the end of the + \gls{linktext}. This command does not alter or depend on the + \idx{firstuseflag}} + } + % \glslink + \gcmdsp{glslink} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\margm{text}} + \desc{references the entry identified by \meta{label} with the + given \meta{text} as the \gls{linktext}. This command doesn't + change the \idx{firstuseflag}} + } + % \glsadd + \gcmd{glsadd} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}} + \desc{indexes the entry identified by \meta{label} without + producing any text. This ensures the entry appears in the + \idx{glossary}} + } + % \glsfmttext + \gcmd{gls\-fmt\-text} + { + \syntax{\margm{entry-label}} + \desc{for use within captions or section titles to display the + formatted \gloskey{text}} + } + % \glsfmtshort + \gcmd{gls\-fmt\-short} + { + \syntax{\margm{entry-label}} + \desc{for use within captions or section titles to display the + formatted short form} + } + % \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} + } + % \glsentryshort + \gcmd{gls\-entry\-short} + {% + \providedby{\sty{glossaries}} + \syntax{\margm{entry-label}} + \desc{simply expands to the value of the \gloskey{short} field. + Does nothing if the entry hasn't been defined. May be used in + expandable contexts provided that the \gloskey{short} field doesn't + contain any fragile commands} + } + % \glsentrylong + \gcmd{gls\-entry\-long} + {% + \providedby{\sty{glossaries}} + \syntax{\margm{entry-label}} + \desc{simply expands to the value of the \gloskey{long} field. + Does nothing if the entry hasn't been defined. May be used in + expandable contexts provided that the \gloskey{long} field doesn't + contain any fragile commands} + } + % \glsabbrvscfont + \gcmd{gls\-abbrv\-sc\-font} + { + \providedby{\sty{glossaries-extra} v1.17+} + \syntax{\margm{text}} + \desc{short form font used by the small-caps \qt{sc} abbreviation styles} + } + % \glslongonlyfont + \gcmd{gls\-long\-only\-font} + { + \providedby{\sty{glossaries-extra} v1.17+} + \syntax{\margm{text}} + \desc{long form font used by the \qt{only} abbreviation styles} + } + % \glsabbrvonlyfont + \gcmd{gls\-abbrv\-only\-font} + { + \providedby{\sty{glossaries-extra} v1.17+} + \syntax{\margm{text}} + \desc{short form font used by the \qt{only} abbreviation styles} + } + % \glsxtrnewsymbol + \gcmd{gls\-xtr\-new\-symbol}% + {% + \syntax{\oargm{key=value list}\margm{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 \code{symbols}, the \gloskey{category} set + to \code{symbol}, the \gloskey{name} set to \meta{sym} and the \gloskey{sort} + set to \meta{label}. The optional argument is a comma-separated list of \idxpl{gloskey}, + which can be used to override the defaults} + } + % \newacronym + \gcmd{new\-acronym} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\margm{short}\margm{long}} + \desc{this command is provided by the base \sty{glossaries} + package but is 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}} + } + % \setacronymstyle + \gcmd{set\-acronym\-style} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{glossary-type}\margm{style-name}} + \desc{sets the acronym style. Don't use with \sty{glossaries-extra}} + } + % \newabbreviation + \gcmd{new\-abbreviation} + { + \providedby{\sty{glossaries-extra}} + \syntax{\oargm{options}\margm{label}\margm{short}\margm{long}} + \desc{defines a new entry that represents an abbreviation. + This internally uses \gls{newglossaryentry} and any provided + \meta{options} (\idxpl{gloskey}) 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 + \gcmd{set\-abbreviation\-style} + { + \providedby{\sty{glossaries-extra}} + \syntax{\oargm{category}\margm{style-name}} + \desc{sets the current \idx{abbrstyle} to \meta{style-name} + for the category identified by \meta{category}. If the + optional argument is omitted, \cat{abbreviation} is assumed} + } + % \acrlong + \gcmdsp{acr\-long} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{displays the long form of an acronym. Only for use with + the base \sty{glossaries} package's acronym mechanism. With + \sty{glossaries-extra}, use \gls{glsxtrlong} instead} + } + % \acrshort + \gcmdsp{acr\-short} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{displays the short form of an acronym. Only for use with + the base \sty{glossaries} package's acronym mechanism. With + \sty{glossaries-extra}, use \gls{glsxtrshort} instead} + } + % \glsxtrlong + \gcmdsp{gls\-xtr\-long} + { + \providedby{\sty{glossaries-extra}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{displays the long form of an abbreviation} + } + % \glsxtrshort + \gcmdsp{gls\-xtr\-short} + { + \providedby{\sty{glossaries-extra}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + \desc{displays the short form of an abbreviation} + } + % \ifglsused + \gcmd{if\-gls\-used} + { + \providedby{\sty{glossaries}} + \syntax{\margm{label}\margm{true text}\margm{false text}} + \desc{does \meta{true} if the entry has been marked as + \idxc{firstuseflag}{used} and does \meta{false} if the entry is + marked as \idxc{firstuseflag}{unused}} + } + % \glsnoexpandfields + \gcmd{gls\-no\-expand\-fields} + { + \providedby{\sty{glossaries}} + \desc{don't expand field values when defining entries, except + for those that explicitly have expansion enabled} + } + % \glsreset + \gcmd{gls\-reset} + { + \providedby{\sty{glossaries}} + \syntax{\margm{label}} + \desc{globally resets the entry's \idx{firstuseflag}. That is, this marks the entry + as \qt{not used}} + } + % \glsunset + \gcmd{gls\-unset} + { + \providedby{\sty{glossaries}} + \syntax{\margm{label}} + \desc{globally unsets the entry's \idx{firstuseflag}. That is, this marks the entry + as \qt{used}} + } + % \glsresetall + \gcmd{gls\-reset\-all} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{types}} + \desc{globally resets all entries associated with the listed + glossaries or all glossaries if \meta{types} is omitted} + } + % \glsunsetall + \gcmd{gls\-unset\-all} + { + \providedby{\sty{glossaries}} + \syntax{\oargm{types}} + \desc{globally unsets all entries associated with the listed + glossaries or all glossaries if \meta{types} is omitted} + } + % \glslowercase + \gcmd{gls\-lower\-case} + { + \providedby{\sty{glossaries} v4.50+} + \syntax{\margm{text}} + \desc{converts \meta{text} to \idx{lowercase} using the modern \LaTeX3 + case-changing command, which is expandable} + } + % \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}). See the \sty{mfirstuc} + documentation for further details, either: + \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}} + } + % \nopostdesc + \gcmd{no\-post\-desc} + {% + \providedby{\sty{glossaries} v1.17+} + \desc{when placed at the end of the \gloskey{description}, this + switches off the post-description punctuation (if it has been + enabled). Does nothing outside of the \idx{glossary}} + } + % \seename + \gcmd{see\-name} + { + \providedby{\sty{glossaries}} + \initval{see} + \note{language-sensitive} + \desc{used as a cross-reference tag} + } + % \seealsoname + \gcmd{see\-also\-name} + { + \providedby{\sty{glossaries-extra}} + \initval{see also} + \note{language-sensitive} + \desc{used as a cross-reference tag} + } + % \newglossaryentry (glossentry) keys + \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{newabbreviation}} + } + % glossentry name + \ggloskey{name}% + {% + \syntax{\margm{text}} + \desc{the entry's name, as displayed in the \idx{glossary}} + } + % glossentry description + \ggloskey{description}% + {% + \syntax{\margm{text}} + \desc{the entry's description, as displayed in the \idx{glossary}} + } + % glossentry type + \ggloskey{type}% + {% + \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}% + {% + \syntax{\meta{parent-label}} + \desc{the label of the entry's parent (from which the entry's + hierarchical level is obtained)} + } + % glossentry category + \ggloskey{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}% + {% + \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 see + \ggloskey{see}% + {% + \syntax{\oargm{tag}\margm{label-list}} + \desc{indexes each item in \meta{label-list} with the + cross-reference in place of a normal location} + } + % glossentry seealso + \ggloskey{see\-also}% + {% + \providedby{\sty{glossaries-extra}} + \syntax{\margm{label-list}} + \desc{like \gloskey{see} but always uses \gls{seealsoname} as the tag} + } + % glossentry text + \ggloskey{text}% + {% + \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}% + {% + \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}% + {% + \initval{\gls{relax}} + \syntax{\margm{symbol}} + \desc{the entry's associated symbol (optional), which can be + displayed with \gls{glssymbol} (if \gls{indexing} and hyperlinks are + required) or with \gls{glsentrysymbol}} + } + % glossentry first + \ggloskey{first}% + {% + \syntax{\margm{first}} + \desc{the entry's text, as displayed on \idx{firstuse} of + \gls{glslike} commands. If omitted, + this value is assumed to be the same as the \gloskey{text} key} + } + % glossentry firstplural + \ggloskey{first\-plural}% + {% + \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}% + {% + \syntax{\margm{short form}} + \desc{a key that is set implicitly by \gls{newabbreviation} + and \gls{newacronym} to the entry's short (abbreviated) form. It + typically shouldn't be used explicitly with + \gls{newglossaryentry}. However, if you are using \app{bib2gls} + then this field should be used in the \ext{bib} file when + defining abbreviations} + } + % glossentry long + \ggloskey{long}% + {% + \syntax{\margm{long form}} + \desc{a key that is set implicitly by \gls{newabbreviation} + and \gls{newacronym} to the entry's long (unabbreviated) form. It + typically shouldn't be used explicitly with + \gls{newglossaryentry}. However, if you are using \app{bib2gls} + then this field should be used in the \ext{bib} file when + defining abbreviations} + } + % glossentry shortplural + \ggloskey{short\-plural}% + {% + \syntax{\margm{plural short form}} + \desc{the plural corresponding to the \gloskey{short} key if the + default value is inappropriate} + } + % glossentry longplural + \ggloskey{long\-plural}% + {% + \syntax{\margm{plural long form}} + \desc{the plural corresponding to the \gloskey{long} key if the + default value is inappropriate} + } + % glossentry user1 + \ggloskey{user1}% + {% + \syntax{\margm{text}} + \desc{a generic field, which can be + displayed with \gls{glsuseri} (if \gls{indexing} and hyperlinks are + required) or with \gls{glsentryuseri}} + } + % package option style + \gstyopt{style}% + {% + \syntax{\meta{style-name}} + } + % package option nogroupskip + \gstyopt{no\-group\-skip} + { + \initval{false} + \defval{true} + \syntax{\meta{boolean}} + } + % package option nopostdot + \gstyopt{no\-post\-dot} + { + \initval{false} + \defval{true} + \syntax{\meta{boolean}} + } + % package option postdot + \gstyopt{post\-dot}{\providedby{\sty{glossaries-extra}}} + % package option nonumberlist + \gstyopt{no\-number\-list}{} + % package option symbols + \gstyopt{symbols}{} + % package option numbers + \gstyopt{numbers}{} + % package option index + \gstyopt{index}{} + % package option abbreviations + \gstyopt{abbreviations}{} + % package option counter + \gstyopt{counter}% + {% + \syntax{\meta{counter-name}} + } + % package option toc + \gstyopt{toc}% + {% + \syntax{\meta{boolean}} + } + % package option section + \gstyopt{section} + { + \syntax{\meta{value}} + } + % package option acronym + \gstyopt{acronym}% + {% + \initval{false} + \defval{true} + \syntax{\meta{boolean}} + } + % package option acronyms + \gstyopt{acronyms}{} + % package option stylemods + \gstyopt{style\-mods}{} + % package option sort + \gstyopt{sort}% + {% + \syntax{\meta{setting}} + } + % package option sanitizesort + \gstyopt{sanitize\-sort}{} + % package option record + \gstyopt{record}% + {% + \initval{off} + \defval{only} + \syntax{\meta{setting}} + } + % package option automake + \gstyopt{auto\-make}{} + % package option xindy + \gstyopt{xindy}{} + % package option order + \gstyopt{order}{} + % package option nohypertypes + \gstyopt{no\-hyper\-types}{\syntax{\margm{label list}}} + % package option hyperfirst + \gstyopt{hyper\-first} + { + \initval{true} + \defval{true} + \syntax{\meta{boolean}} + } + % category: abbreviation + \gcat{abbreviation}{} + % category: acronym + \gcat{acronym}{} + % glossary style: index + \gglosty{index}{} + % glossary style: indexgroup + \gglosty{index\-group}{} + % glossary style: mcolindex + \gglosty{mcol\-index}{} + % glossary style: altlist + \gglosty{alt\-list}{} + % glossary style: long4col + \gglosty{long4col}{} + % acronym style: long-short + \gacrsty{long\dhyphen short}{} + % acronym style: long-sc-short + \gacrsty{long\dhyphen sc\dhyphen short}{} + % acronym style: long-short-desc + \gacrsty{long\dhyphen short\dhyphen desc}{} + % acronym style: short-long + \gacrsty{short\dhyphen long}{} + % acronym style: short-long-desc + \gacrsty{short\dhyphen long\dhyphen desc}{} + % abbreviation style: long-short + \gabbrsty{long\dhyphen short}{} + % abbreviation style: long-short-sc + \gabbrsty{long\dhyphen short\dhyphen sc}{} + % abbreviation style: short-nolong + \gabbrsty{short\dhyphen nolong}{} + % abbreviation style: long-only-short-only + \gabbrsty{long\dhyphen only\dhyphen short\dhyphen only}{} + % resource option src + \gresourceopt{src}{\syntax{bib list}} + % resource option type + \gresourceopt{type}{\syntax{glossary-label}} + % resource option sort + \gresourceopt{sort}{\syntax{method}} + % resource option sort-field + \gresourceopt{sort\dhyphen field}{\syntax{field name}} + % resource option save-locations + \gresourceopt{save\dhyphen locations}{\syntax{\meta{boolean}}} + % printgloss style + \gprintglossopt{style}{% + \syntax{\meta{style-name}} + } + % printgloss type + \gprintglossopt{type}{% + \syntax{\meta{glossary-label}} + } + % printgloss nonumberlist + \gprintglossopt{no\-number\-list}{} + % printgloss toctitle + \gprintglossopt{toc\-title}{} + % printgloss sort + \gprintglossopt{sort}{} + % general commands and environments + \gcmd{textsc}{}% \textsc + \gcmd{item}{}% \item + \gcmd{tex\-or\-pdf\-string}{}% \texorpdfstring + \genv{description}{} + % applications: + \gapp{makeindex}{} + \gapp{xindy}{} + \gapp{makeglossaries}{} + \gapp{makeglossaries\dhyphen lite}{}% makeglossaries-lite + \gapp{bib2gls}{} + \gapp{arara}{} + % --group + \glongswitch{group}{\inapp{bib2gls}} + % -g + \gshortswitch{g}{\inapp{bib2gls}\field{alias}{switch.group}} + % packages + \gpkg{glossaries}{\common}% glossaries.sty + \gpkg{glossaries\dhyphen extra}{\common}% glossaries-extra.sty + \gpkg{glossary\dhyphen mcols}{}% glossary-mcols.sty + \gpkg{mfirst\-uc}{}% mfirstuc.sty + \gpkg{hyper\-ref}{}% hyperref.sty + \gpkg{babel}{}% babel.sty + \gpkg{poly\-glossia}{}% polyglossia.sty + \gpkg{input\-enc}{}% inputenc.sty + \gpkg{font\-enc}{}% fontenc.sty + % files + \gfilemeta{glossaries\dhyphen}{language}{}{}% glossaries- + \gfile{glossaries\dhyphen french}{}% glossaries-french + \gfile{glossaries\dhyphen german}{}% glossaries-german + \gext{log}{} + \gext{tex}{} + \gext{bib}{} + \gext{glo}{} + \gext{gls}{} + \gext{glg}{} + \gext{ist}{} + \gext{xdy}{} + \gext{aux}{} + \gext{glstex}{} + \gext{alg}{} + \gext{acr}{} + \gext{acn}{} + % terms + \gterm{field}% + {% + \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{indexing}{% + \name{indexing (or recording)} + \field{text}{indexing} + \desc{the process of saving the location (for example, the page number) and any + associated information that is required in the \idx{glossary}. + The data may be sorted and collated by an indexing application + as part of the document build} + } + \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 + entry labels where the set is identified by the glossary label + or type} + } + \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 \gls{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} + \desc{commands like \gls{gls} that change the + \idx{firstuseflag}. These commands index the entry (if indexing + is enabled), create a hyperlink to the entry's \idx{glossary} listing (if enabled) + and unset the \idx{firstuseflag}} + } + \gterm{linktext}{\name{link text}% + \desc{the text produced by commands like \gls{gls} that have the + potential to be a hyperlink} + } + \gterm{semanticcommand}{\name{semantic command} + \desc{essentially, a semantic command is one that's associated with a + particular document element, idea or topic that hides the font + and other stylistic formatting inside its definition. For + example, Latin taxonomy is usually displayed in italic. + Explicitly using font commands, for example + \code{\cmd{textit}\marg{Clostridium}}, is syntactic markup. + Whereas defining a command called, say, \csfmt{bacteria} that + displays its argument in italics is a semantic command. The + actual styling is hidden and the command relates specifically to + a particular concept. +\begin{codebox} +Syntactic: \cmd{textit}\marg{Clostridium}\codepar +\cmd{newrobustcmd}*\marg{\cmd{bacteria}}[1]\marg{\cmd{emph}\marg{\#1}}\%\newline +Semantic: \cmd{bacteria}\marg{Clostridium} +\end{codebox} + The end result is the same: +\begin{resultbox} +Syntactic: \textit{Clostridium}\glspar +Semantic: \emph{Clostridium} +\end{resultbox} + The advantage with semantic commands is that it's much easier to + change the style, simply by adjusting the command definition. + Note that I've used \csfmt{newrobustcmd} to make the semantic + command robust as the style commands can cause a problem if they + expand too soon} + } + % index only + \gidx{uppercase}{\field{seealso}{idx.sentencecase}} + \gidx{lowercase}{} + \gidx{sentencecase}{\name{sentence case}} + \gidx{allcaps}{\name{all caps}} + % punctuation + \gpunc{sym.nbsp}{\name{\code{\textasciitilde} (non-breaking space)} + \field{see}{idx.nbsp} + } + \gidx{nbsp}{\name{non-breaking space (\code{\textasciitilde})} + \field{symbol}{\code{\textasciitilde}} + } + \gpunc{sym.colon}{\name{\code{:} (colon)}} + \gpunc{unknowntag}{\name{\code{??} (unknown entry marker)} + \field{text}{\code{??}}} + % 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}} +} -\newcommand*{\opt}[1]{\hyperlink{option#1}{Option~#1}} -\newcommand*{\optsor}[2]{Options~\hyperlink{option#1}{#1} -or~\hyperlink{option#2}{#2}} -\newcommand*{\optsand}[2]{Options~\hyperlink{option#1}{#1} -and~\hyperlink{option#2}{#2}} +\title{The glossaries package v4.50: +a guide for beginners} +\author{Nicola L.C. Talbot\\\href{https://www.dickimaw-books.com/}{\nolinkurl{dickimaw-books.com}}} +\date{2022-10-14} \begin{document} \maketitle \begin{abstract} -The \styfmt{glossaries} package is very flexible, but this means +The \sty{glossaries} package is very flexible, but this means that it has a~lot of options, and since a user guide is supposed to provide a complete list of all the high-level user commands, the main user manual is quite big. This can be rather @@ -81,400 +1067,428 @@ under certain circumstances}. \section{Getting Started} \label{sec:start} -As with all packages, you need to load \styfmt{glossaries} with -\cs{usepackage}, but there are certain packages that must be loaded +As with all packages, you need to load \sty+{glossaries} with +\csfmt{usepackage}, but there are certain packages that must be loaded before \styfmt{glossaries}, \emph{if} they are required: \sty{hyperref}, \sty{babel}, \sty{polyglossia}, \sty{inputenc} and \sty{fontenc}. (You don't have to load these packages, but if you want them, you -must load them before \styfmt{glossaries}.) +must load them before \sty{glossaries}.) \begin{important} If you require multilingual support you must also install the relevant language module. Each language module is called -\file{glossaries-}\meta{language}, where \meta{language} is the +\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 \styfmt{glossaries} package will automatically try to load it +the \sty{glossaries} package will automatically try to load it and will give a warning if the module isn't found. \end{important} -Once you have loaded \styfmt{glossaries}, you need to define +Once you have loaded \sty{glossaries}, you need to define your terms in the preamble and then you can use them throughout the document. Here's a simple example: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries} - - \newglossaryentry{ex}{name={sample},description={an example}} - - \begin{document} - Here's my \gls{ex} term. - \end{document} -\end{verbatim} +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\comment{define a term:} +\gls{newglossaryentry}\marg{ex}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{an example}} +\cbeg{document} +Here's my \gls{gls}\marg{ex} term. +\cend{document} +\end{codebox*} This produces: -\begin{quote} +\begin{resultbox} Here's my sample term. -\end{quote} -Here's another example: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries} - - \setacronymstyle{long-short} - - \newacronym{svm}{SVM}{support vector machine} - - \begin{document} - First use: \gls{svm}. Second use: \gls{svm}. - \end{document} -\end{verbatim} +\end{resultbox} +Another example: +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\gls{setacronymstyle}\marg{\acrstyle{long-short}} +\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine} +\cbeg{document} +First use: \gls{gls}\marg{svm}. Second use: \gls{gls}\marg{svm}. +\cend{document} +\end{codebox*} This produces: -\begin{quote} +\begin{resultbox} First use: support vector machine (SVM). Second use: SVM. -\end{quote} -In this case, the text produced by \verb|\gls{svm}| changed after the first -use. The first use produced the long form followed by the short form -in parentheses because I set the acronym style to -\code{long-short}. I suggest you try the above two examples to -make sure you have the package correctly installed. -If you get an \code{undefined control sequence} error, check that -the version number at the top of this document matches the version -you have installed. (Open the \file{.log} file and search for the -line that starts with \code{Package: glossaries} followed by a -date and version.) +\end{resultbox} +In this case, the text (the \qt{\gls{linktext}}) produced by +\code{\gls{gls}\marg{svm}} +changed after the \idx{firstuse}. The \idx{firstuse} produced the +long form followed by the short form in parentheses because I set +the acronym style to \acrstyle{long-short}. The \idx{subsequentuse} +just showed the short form. + +I suggest you try the above two examples to make sure you have the +package correctly installed. If you get an \qt{undefined control +sequence} error, check that the version number at the top of this +document matches the version you have installed. (Open the +\ext+{log} file and search for the line that starts with +\qt{Package: glossaries} followed by a date and version.) \begin{important} Be careful of fragile commands. If a command causes a problem when -used in one of the \cs{newglossaryentry} fields, consider adding -\cs{glsnoexpandfields} before you start defining your entries. +used in one of the \gls{newglossaryentry} fields, consider adding +\gls{glsnoexpandfields} before you start defining your entries. +Where possible use robust \idxpl{semanticcommand}. \end{important} Abbreviations are slightly different if you use the extension package -\sty{glossaries-extra} (which needs to be installed separately): -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries-extra} - - \setabbreviationstyle{long-short}% glossaries-extra.sty - - \newabbreviation{svm}{SVM}{support vector machine}% glossaries-extra.sty - - \begin{document} - First use: \gls{svm}. Second use: \gls{svm}. - \end{document} -\end{verbatim} -Since \code{long-short} happens to be the default for -\cs{newabbreviation} (if you haven't set the \code{category} key) -you may omit the \cs{setabbreviationstyle} line in this example. - -If you still want to use \cs{newacronym} (rather than -\cs{newabbreviation}) then you need the optional -argument of \cs{setabbreviationstyle}: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries-extra} - - \setabbreviationstyle[acronym]{long-short}% glossaries-extra.sty only - - \newacronym{svm}{SVM}{support vector machine} - - \begin{document} - First use: \gls{svm}. Second use: \gls{svm}. - \end{document} -\end{verbatim} -In this example, if you omit the \cs{setabbreviationstyle} line you -will notice a difference because the \code{short-nolong} style (not -the \code{long-short} style) is the default with \cs{newacronym}. -With the \code{short-nolong} style the first use simply shows just +\sty+{glossaries-extra} (which needs to be installed separately): +\begin{codebox*} +\cmd{documentclass}\marg{article} +\comment{glossaries.sty is automatically loaded by glossaries-extra.sty} +\cmd{usepackage}\marg{glossaries-extra} +\comment{commands provided by \sty{glossaries-extra}:} +\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}} +\gls{newabbreviation}\marg{svm}\marg{SVM}\marg{support vector machine} +\cbeg{document} +First use: \gls{gls}\marg{svm}. Second use: \gls{gls}\marg{svm}. +\cend{document} +\end{codebox*} +Since \abbrstyle{long-short} happens to be the default for +\gls{newabbreviation} you may omit the \gls{setabbreviationstyle} +line in this example. + +If you still want to use \gls{newacronym} (rather than +\gls{newabbreviation}) then you need the optional +argument of \gls{setabbreviationstyle}: +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries-extra} +\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}} +\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine} +\cbeg{document} +First use: \gls{gls}\marg{svm}. Second use: \gls{gls}\marg{svm}. +\cend{document} +\end{codebox*} +In this example, if you omit the \gls{setabbreviationstyle} line you +will notice a difference because the \abbrstyle{short-nolong} style (not +the \abbrstyle{long-short} style) is the default with \gls{newacronym}. +With the \abbrstyle{short-nolong} style the first use simply shows just the short form. \begin{important} -You can't use \cs{setacronymstyle} with \sty{glossaries-extra}. +You can't use \gls{setacronymstyle} with \sty{glossaries-extra}. \end{important} If you like, you can put all your definitions in another file (for -example, \file{defns.tex}) and load that file in the preamble using -\cs{loadglsentries} with the filename as the argument. For example: -\begin{verbatim} -\loadglsentries{defns} -\end{verbatim} +example, \filefmt{defns.tex}) and load that file in the preamble using +\gls{loadglsentries} with the filename as the argument. For example: +\begin{codebox} +\gls{loadglsentries}\marg{defns} +\end{codebox} If you find you have a really large number of definitions that are -hard to manage in a \file{.tex} file, you might want to have a +hard to manage in a \ext+{tex} file, you might want to have a look at \app{bib2gls} (installed separately) which requires -a \file{.bib} format instead that can be managed by an application +a \ext+{bib} format instead that can be managed by an application such as JabRef. Don't try inserting formatting commands into the definitions as they can interfere with the underlying mechanism. Instead, the formatting should be done by the style. For example, suppose I~want -to replace \code{SVM} with \verb|\textsc{svm}|, then -I~need to select a style that uses \cs{textsc}, like this (for the -base \styfmt{glossaries} style): -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries} - - \setacronymstyle{long-sc-short} - - \newacronym{svm}{svm}{support vector machine} - - \begin{document} - First use: \gls{svm}. Second use: \gls{svm}. - \end{document} -\end{verbatim} +to replace \code{SVM} with \code{\gls{textsc}\marg{svm}}, then +I~need to select a style that uses \gls{textsc}, like this (for the +base \sty{glossaries} style): +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}} +\gls{newacronym}\marg{svm}\marg{svm}\marg{support vector machine} +\cbeg{document} +First use: \gls{gls}\marg{svm}. Second use: \gls{gls}\marg{svm}. +\cend{document} +\end{codebox*} The abbreviation styles have a different naming scheme with \sty{glossaries-extra}: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries-extra} - - \setabbreviationstyle{long-short-sc}% glossaries-extra.sty - - \newabbreviation{svm}{svm}{support vector machine}% glossaries-extra.sty - - \begin{document} - First use: \gls{svm}. Second use: \gls{svm}. - \end{document} -\end{verbatim} +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries-extra} +\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc}}\comxr +\gls{newabbreviation}\marg{svm}\marg{svm}\marg{support vector machine} +\cbeg{document} +First use: \gls{gls}\marg{svm}. Second use: \gls{gls}\marg{svm}. +\cend{document} +\end{codebox*} With \sty{glossaries-extra} you can have multiple abbreviation styles for different categories. Many of these styles have their own associated formatting commands that can be redefined for minor adjustments. For example: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries-extra} - - \setabbreviationstyle[statistical]{long-short-sc} - \setabbreviationstyle[bacteria]{long-only-short-only} - - % Formatting commands used by 'long-only-short-only' style: - \renewcommand*{\glsabbrvonlyfont}[1]{\emph{#1}} - \renewcommand*{\glslongonlyfont}[1]{\emph{#1}} - - % Formatting command used by 'long-short-sc' style: - % (make sure abbreviation is converted to lower case) - \renewcommand*{\glsabbrvscfont}[1]{\textsc{\MakeLowercase{#1}}} - - \newabbreviation - [ - category={statistical}% glossaries-extra.sty key - ] - {svm}{SVM}{support vector machine} - - \newabbreviation - [ - category={bacteria}% glossaries-extra.sty key - ] - {cbot}{C.~botulinum}{Clostridium botulinum} - - \begin{document} - First use: \gls{svm}, \gls{cbot}. - - Next use: \gls{svm}, \gls{cbot}. - \end{document} -\end{verbatim} +\begin{codebox*} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries-extra} +\gls{setabbreviationstyle}\oarg{statistical}\marg{\abbrstyle{long-short-sc}} +\gls{setabbreviationstyle}\oarg{bacteria}\marg{\abbrstyle{long-only-short-only}} +\comment{Formatting commands used by '\abbrstyle{long-only-short-only}' style:} +\cmd{renewcommand}*\marg{\gls{glsabbrvonlyfont}}[1]\marg{\cmd{emph}\marg{\#1}} +\cmd{renewcommand}*\marg{\gls{glslongonlyfont}}[1]\marg{\cmd{emph}\marg{\#1}} +\codepar +\comment{Formatting command used by '\abbrstyle{long-short-sc}' style:} +\comment{(the following converts the abbreviation to \idx{lowercase})} +\cmd{renewcommand}*\marg{\gls{glsabbrvscfont}}[1]\marg{\gls{textsc}\marg{\gls{glslowercase}\marg{\#1}}} +\codepar +\gls{newabbreviation} + \oarg{ + \gloskeyval{category}{statistical}\comxrkey + } + \marg{svm}\marg{SVM}\marg{support vector machine} +\codepar +\gls{newabbreviation} + \oarg{ + \gloskeyval{category}{bacteria}\comxrkey + } + \marg{cbot}\marg{C.\glssymbol{idx.nbsp}botulinum}\marg{Clostridium botulinum} +\codepar +\cbeg{document} +First use: \gls{gls}\marg{svm}, \gls{gls}\marg{cbot}. +\codepar +Next use: \gls{gls}\marg{svm}, \gls{gls}\marg{cbot}. +\cend{document} +\end{codebox*} This produces: -\begin{quote} +\begin{resultbox} First use: support vector machine (\textsc{svm}), \emph{Clostridium botulinum}. Next use: \textsc{svm}, \emph{C.~botulinum}. -\end{quote} +\end{resultbox} As you can hopefully see from the above examples, there are two main ways of -defining a term: as a general entry (\cs{newglossaryentry}) or as an -abbreviation (\cs{newacronym} or, with \sty{glossaries-extra}, -\cs{newabbreviation}). +defining a term: as a general entry (\gls{newglossaryentry}) or as an +abbreviation (\gls{newacronym} or, with \sty{glossaries-extra}, +\gls{newabbreviation}). Regardless of the method of defining a term, the term is always given a label. In the first example, the label was \code{ex} and in the other examples the label was \code{svm} (and \code{cbot} in the last example). The label is used to uniquely identify the term (like the standard -\cs{label}\slash\cs{ref} or \cs{cite} mechanism). It's best to just use the -following alphanumerics in the labels: \code{a}, \ldots, -\code{z}, \code{A}, \ldots, \code{Z}, \code{0}, \ldots, -\code{9}. Sometimes you can also use punctuation characters but -not if another package (such as \sty{babel}) makes them active. -Don't try using any characters outside of the basic Latin set with -\sty{inputenc} (for example, \'e or \ss) or things will go horribly -wrong. This warning only applies to the label. It doesn't apply to -the text that appears in the document. If you really need UTF-8 -characters in your labels then you'll need to use \XeLaTeX\ or -\LuaLaTeX. +\csfmt{label}\slash\csfmt{ref} or \csfmt{cite} mechanism). The label may be +the same as the text produced with \gls{gls} (provided it doesn't +contain any formatting commands) or may be completely different. + +The labels are identified in bold in the following: +\begin{codebox} +\gls{newglossaryentry}\marg{\strong{elite}}\marg{\gloskeyval{name}{\'elite}, + \gloskeyval{description}{select group}} +\gls{newglossaryentry}\marg{\strong{set}}\marg{\gloskeyval{name}{set}, + \gloskeyval{description}{collection of distinct elements}} +\gls{newglossaryentry}\marg{\strong{sym.set}}\marg{ + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{mathcal}\marg{S}}}, + \gloskeyval{description}{a set}} +\gls{newacronym}\marg{\strong{tool.cnc}}\marg{CNC}\marg{computer numerical control} +\gls{newacronym}\marg{\strong{police.cnc}}\marg{CNC}\marg{civil nuclear constabulary} +\gls{newacronym}\marg{\strong{miltary.cnc}}\marg{CNC}\marg{commander in chief} +\end{codebox} + +With modern \TeX\ installations you may now be able to use UTF-8 +characters in the label, but beware of active characters. For +example, \sty{babel} makes some punctuation characters, such as +\idx{sym.colon}, active. This means that the character behaves like a +command, which allows extra spacing to be inserted before or after +the punctuation mark or provides a shortcut to apply an accent to a +following character. + +For example, the following works: +\begin{codebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\gls{newglossaryentry}\marg{sym:set}\marg{\gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{mathcal}\marg{S}}}, + \gloskeyval{description}{a set}} +\cbeg{document} +\gls{gls}\marg{sym:set} +\cend{document} +\end{codebox} +However, if \sty{babel} is loaded with \optfmt{french} then the +\idx{sym.colon} character becomes active. +\begin{badcodebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}[T1]\marg{fontenc} +\cmd{usepackage}[french]\marg{babel} +\cmd{usepackage}\marg{glossaries} +\codepar +\comment{the colon : is a normal character here} +\gls{newglossaryentry}\marg{sym:set}\marg{\gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{mathcal}\marg{S}}}, + \gloskeyval{description}{a set}} +\codepar +\cbeg{document} +\comment{the colon : is now an active character} +\gls{gls}\marg{sym:set} +\cend{document} +\end{badcodebox} +You may find that the above example seems to work, but a problem +will occur if \sty{hyperref} and a \idx{glossary} are added to the +document as the active character will interfere with the hyperlink +target name. \begin{important} -Don't use \cs{gls} in chapter or section headings as it can have -some unpleasant side-effects. Instead use \cs{glsentrytext} for -regular entries and one of \cs{glsentryshort}, \cs{glsentrylong} -or \cs{glsentryfull} for acronyms. Alternatively use +Don't use \gls{gls} in chapter or section headings as it can have +some unpleasant side-effects. Instead use \gls{glsentrytext} for +regular entries and either \gls{glsentryshort} or \gls{glsentrylong} +for acronyms. Alternatively use \sty{glossaries-extra} which provides special commands for use in -section headings and captions, such as \cs{glsfmtshort}\marg{label}. +section headings and captions, such as \gls{glsfmttext} and \gls{glsfmtshort}. \end{important} The above examples are reasonably straightforward. The difficulty comes if you want to display a \emph{sorted} list of all the entries you have used in the document. The \sty{glossaries-extra} package -provides a really easy way of listing all the defined entries: -\begin{verbatim} - \documentclass{article} - - \usepackage[sort=none]{glossaries-extra} - - \newglossaryentry{potato}{name={potato},plural={potatoes}, - description={starchy tuber}} - - \newglossaryentry{cabbage}{name={cabbage}, - description={vegetable with thick green or purple leaves}} - - \newglossaryentry{turnip}{name={turnip}, - description={round pale root vegetable}} - - \newglossaryentry{carrot}{name={carrot}, - description={orange root}} - - \begin{document} - Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}. - - \printunsrtglossaries % list all entries - \end{document} -\end{verbatim} +provides an easy way of listing all the defined entries: +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}[\optval{sort}{none}]\marg{glossaries-extra} +\codepar +\gls{newglossaryentry}\marg{potato}\marg{\gloskeyval{name}{potato},\gloskeyval{plural}{potatoes}, + \gloskeyval{description}{starchy tuber}} +\codepar +\gls{newglossaryentry}\marg{cabbage}\marg{\gloskeyval{name}{cabbage}, + \gloskeyval{description}{vegetable with thick green or purple leaves}} +\codepar +\gls{newglossaryentry}\marg{turnip}\marg{\gloskeyval{name}{turnip}, + \gloskeyval{description}{round pale root vegetable}} +\codepar +\gls{newglossaryentry}\marg{carrot}\marg{\gloskeyval{name}{carrot}, + \gloskeyval{description}{orange root}} +\codepar +\cbeg{document} +Chop the \gls{gls}\marg{cabbage}, \gls{glspl}\marg{potato} and \gls{glspl}\marg{carrot}. +\codepar +\gls+{printunsrtglossaries} \comment{list all entries} +\cend{document} +\end{codebox} However this method doesn't sort the entries (they're listed in order of definition) and it will display all the defined entries, regardless of whether or not you've used them all in the document, so \qt{turnip} appears in the glossary even though there's -no \verb|\gls{turnip}| (or similar) in the document. +no \code{\gls{gls}\marg{turnip}} (or similar) in the document. -The \pkgopt[none]{sort} option isn't essential in this case (there's +The \optval{sort}{none} option isn't essential in this case (there's no other sort option available for this document), but it prevents the automatic construction of the sort value and so slightly improves the document build time. Note that this example document uses the same command -(\cs{printunsrtglossaries}) that's used with \app{bib2gls} (\opt4) +(\gls{printunsrtglossaries}) that's used with \app{bib2gls} (\option{b2g}) but with \app{bib2gls} you instead need to use the -\pkgopt{record} package option and one or more instances of -\cs{GlsXtrLoadResources} in the preamble (see below). +\opt{record} package option and one or more instances of +\gls{GlsXtrLoadResources} in the preamble (see below). Most users prefer to have an automatically sorted list that only -contains entries that have been used in the document. -The \styfmt{glossaries} package provides -three options: use \TeX\ to perform the sorting (\opt1); use -\app{makeindex} to perform the sorting (\opt2); use \app{xindy} to -perform the sorting (\opt3). The extension package \sty{glossaries-extra} -provides a fourth method: use \app{bib2gls} (\opt4). +contains entries that have been used in the document, optionally +with a page list (\gls{indexing}). +The \sty{glossaries} package provides +three options: use \TeX\ to perform the sorting (\option{noidx}); use +\app{makeindex} to perform the sorting (\option{mkidx}); use \app{xindy} to +perform the sorting (\option{xdy}). The extension package \sty{glossaries-extra} +provides a fourth method: use \app{bib2gls} (\option{b2g}). The first option (using \TeX) is the simplest method, as it doesn't require an external tool, but it's very inefficient and the sorting is done according to lower case character code (which matches basic Latin alphabets, such as English, but not extended Latin alphabets, such -as Icelandic). To use this method, add -\cs{makenoidxglossaries} to the preamble and put -\cs{printnoidxglossaries} at the place where you want your glossary. +as Icelandic) or non-Latin alphabets. To use this method, add +\gls{makenoidxglossaries} to the preamble and put +\gls{printnoidxglossaries} at the place where you want your glossary. For example: -\begin{verbatim} - \documentclass{article} - - \usepackage{glossaries} - - \makenoidxglossaries % use TeX to sort - - \newglossaryentry{potato}{name={potato},plural={potatoes}, - description={starchy tuber}} - - \newglossaryentry{cabbage}{name={cabbage}, - description={vegetable with thick green or purple leaves}} - - \newglossaryentry{turnip}{name={turnip}, - description={round pale root vegetable}} - - \newglossaryentry{carrot}{name={carrot}, - description={orange root}} - - \begin{document} - Chop the \gls{cabbage}, \glspl{potato} and \glspl{carrot}. - - \printnoidxglossaries - \end{document} -\end{verbatim} +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}\marg{glossaries} +\codepar +\gls{makenoidxglossaries} \comment{use TeX to sort} +\codepar +\gls{newglossaryentry}\marg{potato}\marg{\gloskeyval{name}{potato},\gloskeyval{plural}{potatoes}, + \gloskeyval{description}{starchy tuber}} +\codepar +\gls{newglossaryentry}\marg{cabbage}\marg{\gloskeyval{name}{cabbage}, + \gloskeyval{description}{vegetable with thick green or purple leaves}} +\codepar +\gls{newglossaryentry}\marg{turnip}\marg{\gloskeyval{name}{turnip}, + \gloskeyval{description}{round pale root vegetable}} +\codepar +\gls{newglossaryentry}\marg{carrot}\marg{\gloskeyval{name}{carrot}, + \gloskeyval{description}{orange root}} +\codepar +\cbeg{document} +Chop the \gls{gls}\marg{cabbage}, \gls{glspl}\marg{potato} and \gls{glspl}\marg{carrot}. +\codepar +\gls{printnoidxglossaries} +\cend{document} +\end{codebox} \begin{important} -The \cs{makenoidxglossaries} method is very slow, uses an ASCII +The \gls{makenoidxglossaries} method is very slow, uses an ASCII comparator and often breaks if there are commands in the \code{name} key. See -\href{https://www.dickimaw-books.com/gallery/glossaries-performance.shtml}{Glossaries +\dickimawhrefnofn{gallery/glossaries-performance.shtml}{Glossaries Performance} for a comparison. \end{important} Try this out and run \LaTeX\ (or pdf\LaTeX) \emph{twice}. The first -run won't show the glossary. It will only appear on the second run. -This doesn't include \qt{turnip} in the glossary because that term -hasn't been used (with commands like \verb|\gls{turnip}|) in the document. +run won't show the \idx{glossary}. It will only appear on the second run. +This doesn't include \qt{turnip} in the \idx{glossary} because that term +hasn't been used (with commands like \code{\gls{gls}\marg{turnip}}) in the document. The glossary has a vertical gap between the \qt{carrot} term and the \qt{potato} term. This is because the entries in the glossaries are grouped according to their first letter. If you don't want this gap, -just add \pkgopt{nogroupskip} to the package options: -\begin{verbatim} -\usepackage[nogroupskip]{glossaries} -\end{verbatim} +just add \opt{nogroupskip} to the package options: +\begin{codebox} +\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries} +\end{codebox} or you may want to try out a style that shows the group headings: -\begin{verbatim} -\usepackage[style=indexgroup]{glossaries} -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries} +\end{codebox*} If you try out this example you may also notice that the description is followed by a full stop (period) and a number. The number is the location in the document where the entry was used (page~1 in this -case), so you can lookup the term in the glossary and be directed to +case), so you can lookup the term in the \idx{glossary} and be directed to the relevant pages. It may be that you don't want this back-reference, in which case you can suppress it using the -\pkgopt{nonumberlist} package option: -\begin{verbatim} -\usepackage[nonumberlist]{glossaries} -\end{verbatim} +\opt{nonumberlist} package option: +\begin{codebox} +\cmd{usepackage}[\opt{nonumberlist}]\marg{glossaries} +\end{codebox} If you don't like the terminating full stop, you can suppress that -with the \pkgopt{nopostdot} package option: -\begin{verbatim} -\usepackage[nopostdot]{glossaries} -\end{verbatim} +with the \opt{nopostdot} package option: +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot}]\marg{glossaries} +\end{codebox} If you try out the earlier example with \sty{glossaries-extra} -and \cs{printunsrtglossaries} you may notice that the terminating full stop is missing +and \gls{printunsrtglossaries} you may notice that the terminating full stop is missing and there are no number lists. You can add the full stop back with -\begin{verbatim} -\usepackage[nopostdot=false]{glossaries-extra} -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}[\optval{nopostdot}{false}]\marg{glossaries-extra} +\end{codebox*} or -\begin{verbatim} -\usepackage[postdot]{glossaries-extra} -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}[\opt{postdot}]\marg{glossaries-extra} +\end{codebox*} If you want the number lists then you need to use an indexing option. You may have noticed that I've used another command in the above examples: -\cs{glspl}. This displays the plural form. By default, this is just +\glsadd{glslike}\gls{glspl}. This displays the plural form. By default, this is just the singular form with the letter \qt{s} appended, but in the case of \qt{potato} I had to specify the correct plural using the -\code{plural} key. +\gloskey{plural} key. As I mentioned earlier, using \TeX\ to sort the entries is the -simplest but least efficient method. If you have a large glossary or +simplest but least efficient method. If you have a large \idx{glossary} or if your terms contain non-Latin or extended Latin characters, then you will have a much faster build time if you use \app{makeindex} -(\opt2) or \app{xindy} (\opt3) or \app{bib2gls} (\opt4). If +(\option{mkidx}) or \app{xindy} (\option{xdy}) or \app{bib2gls} (\option{b2g}). If you are using extended Latin or non-Latin characters, then \app{xindy} or \app{bib2gls} are the recommended methods. These methods are described in more detail in \sectionref{sec:printglossaries}. The rest of this document briefly describes the main commands -provided by the \styfmt{glossaries} package. (Most of these are also +provided by the \sty{glossaries} package. (Most of these are also available with \sty{glossaries-extra} but may behave slightly differently.) @@ -482,24 +1496,28 @@ differently.) \label{sec:defterm} When you use the \sty{glossaries} package, you need to define -glossary entries in the document preamble. These entries could be -a~word, phrase, abbreviation or symbol. They're usually accompanied by -a~description, which could be a short sentence or an in-depth -explanation that spans multiple paragraphs. The simplest method of -defining an entry is to use: -\begin{definition} -\begin{alltt} -\cs{newglossaryentry}\marg{label} -\verb|{| - name=\marg{name}, - description=\marg{description}, +glossary entries before you can reference them. This is best +done in the document preamble, as shown in the earlier examples, or +in a separate file that's input in the preamble. + +These entries could be a~word, phrase, abbreviation or symbol. +They're usually accompanied by a~description, which could be a short +sentence or an in-depth explanation that spans multiple paragraphs. +The simplest method of defining an entry is to use: +\cmddef{newglossaryentry} +The two most important keys are \gloskey{name} and +\gloskey{description}: +\begin{compactcodebox} +\gls{newglossaryentry}\margm{label} +\marg{ + \gloskeyval{name}{\meta{name}}, + \gloskeyval{description}{\meta{description}}, \meta{other options} -\verb|}| -\end{alltt} -\end{definition} +} +\end{compactcodebox} where \meta{label} is a unique label that identifies this entry. (Don't include the angle brackets \meta{ }. They just indicate the parts of -the code you need to change when you use this command in your document.) +the code that you need to change when you use this command in your document.) The \meta{name} is the word, phrase or symbol you are defining, and \meta{description} is the description to be displayed in the glossary. @@ -507,372 +1525,359 @@ glossary. This command is a \qt{short} command, which means that \meta{description} can't contain a~paragraph break. If you have a~long description, you can instead use: -\begin{definition} -\begin{alltt} -\cs{longnewglossaryentry}\marg{label} -\verb|{| - name=\marg{name}, +\cmddef{longnewglossaryentry} +In this case the \gloskey{name} key is in the second argument but the +description is supplied in the third argument instead of via a key. +\begin{compactcodebox} +\gls{longnewglossaryentry}\margm{label} +\marg{ + \gloskeyval{name}{\meta{name}}, \meta{other options} -\verb|}| -\marg{description} -\end{alltt} -\end{definition} +} +\margm{description} +\end{compactcodebox} Examples: \begin{enumerate} \item Define the term \qt{set} with the label \code{set}: -\begin{verbatim} -\newglossaryentry{set} -{ - name={set}, - description={a collection of objects} +\begin{codebox} +\gls{newglossaryentry}\marg{set} +\marg{ + \gloskeyval{name}{set}, + \gloskeyval{description}{a collection of objects} } -\end{verbatim} +\end{codebox} \item Define the symbol $\emptyset$ with the label \code{emptyset}: -\begin{verbatim} -\newglossaryentry{emptyset} -{ - name={\ensuremath{\emptyset}}, - description={the empty set} +\begin{codebox} +\gls{newglossaryentry}\marg{emptyset} +\marg{ + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the empty set} } -\end{verbatim} -(This will also need a \code{sort} key if you use \optsor13, see +\end{codebox} +(This will also need a \gloskey{sort} key if you use \optionsor{noidx,xdy}, see below.) \item Define the phrase \qt{Fish Age} with the label \code{fishage}: -\begin{verbatim} -\longnewglossaryentry{fishage} -{name={Fish Age}} -{% +\begin{codebox} +\gls{longnewglossaryentry}\marg{fishage} +\marg{\gloskeyval{name}{Fish Age}} +\marg{\% A common name for the Devonian geologic period spanning from the end of the Silurian Period to the beginning of the Carboniferous Period. - +\codepar This age was known for its remarkable variety of fish species. } -\end{verbatim} +\end{codebox} (The percent character discards the end of line character that would otherwise cause an unwanted space to appear at the start of the description.) -\item Take care if the first letter is an extended Latin or -non-Latin character (either specified via a~command such as -\verb|\'e| or explicitly via the \sty{inputenc} package such -as \code{\'e}). This first letter must be placed in a~group: - -\begin{verbatim} -\newglossaryentry{elite} -{ - name={{\'e}lite}, - description={select group or class} +\item If you are using UTF-8 characters with the \sty{inputenc} +package, make sure you have \sty{mfirstuc} v2.08+ installed: +\begin{codebox} +\comment{\sty{mfirstuc} v2.08+} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\'elite}, + \gloskeyval{description}{select group or class} } -\end{verbatim} -or -\begin{alltt} -\verb|\newglossaryentry{elite}| -\verb|{| - name=\verb|{{|\'e\verb|}lite}|, - description=\verb|{select group or class}| -\verb|}| -\end{alltt} +\end{codebox} +If you have an older version of \sty{mfirstuc} then any initial +character that is an extended Latin or non-Latin character must be +grouped in order to work with sentence-casing commands, such as +\gls{Gls}: +\begin{codebox} +\comment{\sty{mfirstuc} v2.07 or older} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\marg{\'e}lite}, + \gloskeyval{description}{select group or class} +} +\end{codebox} +Or +\begin{codebox} +\comment{\sty{mfirstuc} v2.07 or older} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\marg{\cmd{'}e}lite}, + \gloskeyval{description}{select group or class} +} +\end{codebox} \end{enumerate} -(This isn't necessary for UTF-8 characters with \XeLaTeX\ or -\LuaLaTeX. For further details, see the section \qt{UTF-8} of the -\href{https://ctan.org/pkg/mfirstuc}{\styfmt{mfirstuc}} user manual.) If you use \app{bib2gls} with \sty{glossaries-extra} then the -terms must be defined in a \file{.bib} file. For example: -\begin{alltt} -\% Encoding: UTF-8 - -@entry\{set, - name=\{set\}, - description=\{a collection of objects\} -\} - -@entry\{emptyset, - name=\verb|{\ensuremath{\emptyset}}|, - description=\{the empty set\} -\} - -@entry\{fishage, - name=\{Fish Age\}, - description=\{A common name for the Devonian geologic period +terms must be defined in a \ext+{bib} file. For example: +\begin{codebox} +\comment{Encoding: UTF-8} +\codepar +\atentry{entry}\marg{set, + \gloskeyval{name}{set}, + \gloskeyval{description}{a collection of objects} +} +\codepar +\atentry{entry}\marg{emptyset, + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the empty set} +} +\codepar +\atentry{entry}\marg{fishage, + \gloskeyval{name}{Fish Age}, + \gloskeyval{description}{A common name for the Devonian geologic period spanning from the end of the Silurian Period to the beginning of the Carboniferous Period. - +\codepar This age was known for its remarkable variety of - fish species.\} -\} - -@entry\{elite, - name=\verb|{{|\'e\verb|}lite}|, - description=\verb|{select group or class}| -\} -\end{alltt} -(The \file{.bib} format doesn't allow spaces in labels so you can't + fish species.} +} +\codepar +\atentry{entry}\marg{elite, + \gloskeyval{name}{\'elite}, + \gloskeyval{description}{select group or class} +} +\end{codebox} +(The \ext+{bib} format doesn't allow spaces in labels so you can't have \code{fish age} as the label, but you can have \code{fish-age}.) -This method requires the \sty{glossaries-extra}'s \pkgopt{record} +This method requires \sty{glossaries-extra}['s] \opt{record} package option: -\begin{verbatim} -\usepackage[record]{glossaries-extra} -\end{verbatim} -and the \file{.bib} file is specified in the resource command. For -example, if the \file{.bib} file is called \file{entries.bib} +\begin{codebox} +\cmd{usepackage}[\opt{record}]\marg{glossaries-extra} +\end{codebox} +and the \ext{bib} file is specified in the resource command. For +example, if the \ext{bib} file is called \filefmt{entries.bib} then put the following line in the document preamble: -\begin{verbatim} -\GlsXtrLoadResources[src={entries}] -\end{verbatim} +\begin{codebox} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}} +\end{codebox} You can have a comma-separated list. For example, if you also -have entries defined in the file \file{entries2.bib}: -\begin{verbatim} -\GlsXtrLoadResources[src={entries,entries2}] -\end{verbatim} +have entries defined in the file \filefmt{entries2.bib}: +\begin{codebox} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries,entries2}} +\end{codebox} There are other keys you can use when you define an entry. For -example, the \code{name} key indicates how the term -should appear in the list of entries (glossary), but if the term should -appear differently when you reference it with \cs{gls}\marg{label} in -the document, you need to use the \code{text} key as well. +example, the \gloskey{name} key indicates how the term +should appear in the list of entries (\idx{glossary}), but if the term should +appear differently when you reference it with \code{\gls{gls}\margm{label}} in +the document, you need to use the \gloskey{text} key as well. For example: -\begin{verbatim} -\newglossaryentry{latinalph} -{ - name={Latin Alphabet}, - text={Latin alphabet}, - description={alphabet consisting of the letters - a, \ldots, z, A, \ldots, Z} +\begin{codebox} +\gls{newglossaryentry}\marg{latinalph} +\marg{ + \gloskeyval{name}{Latin Alphabet}, + \gloskeyval{text}{Latin alphabet}, + \gloskeyval{description}{alphabet consisting of the letters + a, \cmd{ldots}, z, A, \cmd{ldots}, Z} } -\end{verbatim} +\end{codebox} This will appear in the text as \qt{Latin alphabet} but will be listed in the glossary as \qt{Latin Alphabet}. -With \app{bib2gls} this entry is defined in the \file{.bib} +With \app{bib2gls} this entry is defined in the \ext{bib} file as: -\begin{verbatim} -@entry{latinalph, - name={Latin Alphabet}, - text={Latin alphabet}, - description={alphabet consisting of the letters - a, \ldots, z, A, \ldots, Z} +\begin{codebox} +\atentry{entry}\marg{latinalph, + \gloskeyval{name}{Latin Alphabet}, + \gloskeyval{text}{Latin alphabet}, + \gloskeyval{description}{alphabet consisting of the letters + a, \cmd{ldots}, z, A, \cmd{ldots}, Z} } -\end{verbatim} +\end{codebox} -Another commonly used key is \code{plural} for specifying the -plural of the term. This defaults to the value of the \code{text} +Another commonly used key is \gloskey{plural} for specifying the +plural of the term. This defaults to the value of the \gloskey{text} key with an \qt{s} appended, but if this is incorrect, just use the -\code{plural} key to override it: -\begin{verbatim} -\newglossaryentry{oesophagus} -{ - name={{\oe}sophagus}, - plural={{\oe}sophagi}, - description={canal from mouth to stomach} +\gloskey{plural} key to override it: +\begin{codebox} +\gls{newglossaryentry}\marg{oesophagus} +\marg{ + \gloskeyval{name}{\oe{}sophagus}, + \gloskeyval{plural}{\oe{}sophagi}, + \gloskeyval{description}{canal from mouth to stomach} } -\end{verbatim} -(Remember from earlier that the initial ligature \cs{oe} needs to -be grouped.) +\end{codebox} Abbreviations can be defined using: -\begin{definition} -\cs{newacronym}\oarg{options}\marg{label}\marg{short}\marg{long} -\end{definition} -where \meta{label} is the label (as per \cs{newglossaryentry}), +\cmddef{newacronym} +where \meta{label} is the label (as per \gls{newglossaryentry}), \meta{short} is the short form and \meta{long} is the long form. For example, the following defines an abbreviation: -\begin{verbatim} -\newacronym{svm}{SVM}{support vector machine} -\end{verbatim} -This internally uses \cs{newglossaryentry} to define an entry with -the label \code{svm}. By default, the \code{name} key is set to +\begin{codebox} +\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine} +\end{codebox} +This internally uses \gls{newglossaryentry} to define an entry with +the label \code{svm}. By default, the \gloskey{name} key is set to \meta{short} (\qt{SVM} in the above example) and the -\code{description} key is set to \meta{long} (\qt{support vector +\gloskey{description} key is set to \meta{long} (\qt{support vector machine} in the above example). If, instead, you want to be able to specify your own description you can do this using the optional argument: -\begin{verbatim} -\newacronym - [description={statistical pattern recognition technique}] - {svm}{SVM}{support vector machine} -\end{verbatim} - -Before you define your acronyms (or other types of abbreviations), you -need to specify which style to use with: -\begin{definition} -\cs{setacronymstyle}\marg{style name} -\end{definition} -where \meta{style name} is the name of the style. There are a number -of predefined styles, such as: \code{long-short} (on first use +\begin{codebox} +\gls{newacronym} + \oarg{\gloskeyval{description}{statistical pattern recognition technique}} + \marg{svm}\marg{SVM}\marg{support vector machine} +\end{codebox} + +Before you define your acronyms, you need to specify which style to use with: +\cmddef{setacronymstyle} +where \meta{style-name} is the name of the style. There are a number +of predefined styles, such as: \acrstyle{long-short} (on \idx{firstuse} display the long form with the short form in parentheses); -\code{short-long} (on first use display the short form with the -long form in parentheses); \code{long-short-desc} (like -\code{long-short} but you need to specify the description); or -\code{short-long-desc} (like \code{short-long} but you need to +\acrstyle{short-long} (on \idx{firstuse} display the short form with the +long form in parentheses); \acrstyle{long-short-desc} (like +\acrstyle{long-short} but you need to specify the description); or +\acrstyle{short-long-desc} (like \acrstyle{short-long} but you need to specify the description). There are some other styles as well that -use \cs{textsc} to typeset the acronym or that use a footnote on +use \gls{textsc} to typeset the acronym in small-caps or that use a footnote on first use. See the main user guide for further details. The \sty{glossaries-extra} package provides improved abbreviation -handling with \href{http://www.dickimaw-books.com/gallery/sample-abbr-styles.shtml}{a lot more predefined styles}. +handling with \dickimawhref{gallery/sample-abbr-styles.shtml}{a lot more predefined styles}. With this extension package, abbreviations are defined using: -\begin{definition} -\cs{newabbreviation}\oarg{options}\marg{label}\marg{short}\marg{long} -\end{definition} -You can still use \cs{newacronym} but it's redefined to +\cmddef{newabbreviation} +You can still use \gls{newacronym} but it's redefined to use the new abbreviation interface. The style must now be set using: -\begin{definition} -\cs{setabbreviationstyle}\oarg{category}\marg{style name} -\end{definition} -The default \meta{category} is \code{abbreviation}. If you use -\cs{newacronym} the category is \code{acronym}, which is why you +\cmddef{setabbreviationstyle} +The default \meta{category} is \cat{abbreviation}. If you use +\gls{newacronym} the category is \cat{acronym}, which is why you need to use the optional argument if you define abbreviations with -\cs{newacronym} when \sty{glossaries-extra} has been loaded: -\begin{alltt} -\cs{setabbreviationstyle}[acronym]\marg{style name} -\end{alltt} +\gls{newacronym} when \sty{glossaries-extra} has been loaded: +\begin{compactcodebox*} +\gls{setabbreviationstyle}\oarg{\cat{acronym}}\margm{style name} +\end{compactcodebox*} If you use \app{bib2gls} then abbreviations are defined in the -\file{.bib} file in the format: -\begin{alltt} -@abbreviation\{\meta{label}, - long=\marg{long form}, - short=\marg{short form} -\} -\end{alltt} +\ext{bib} file in the format: +\begin{compactcodebox*} +\atentry{abbreviation}\marg{\meta{label}, + \gloskeyval{long}{long form}, + \gloskeyval{short}{short form} +} +\end{compactcodebox*} The plural forms for abbreviations can be specified using the -\code{longplural} and \code{shortplural} keys. For example: -\begin{verbatim} -\newacronym - [longplural={diagonal matrices}] - {dm}{DM}{diagonal matrix} -\end{verbatim} +\gloskey{longplural} and \gloskey{shortplural} keys. For example: +\begin{codebox} +\gls{newacronym} + \oarg{\gloskeyval{longplural}{diagonal matrices}} + \marg{dm}\marg{DM}\marg{diagonal matrix} +\end{codebox} or (with \sty{glossaries-extra}): -\begin{verbatim} -\newabbreviation % glossaries-extra.sty - [longplural={diagonal matrices}] - {dm}{DM}{diagonal matrix} -\end{verbatim} +\begin{codebox} +\gls{newabbreviation} \comxr + \oarg{\gloskeyval{longplural}{diagonal matrices}} + \marg{dm}\marg{DM}\marg{diagonal matrix} +\end{codebox} If omitted, the defaults are again obtained by appending an \qt{s} to -the singular versions. With \app{bib2gls}, the definition in the -\file{.bib} file is: -\begin{verbatim} -@abbreviation{dm, - short={DM}, - long={diagonal matrix}, - longplural={diagonal matrices} +the singular versions. (The \sty{glossaries-extra} package provides +a way of not appending \qt{s} for abbreviation plurals via category +attributes.) With \app{bib2gls}, the definition in the +\ext{bib} file is: +\begin{codebox} +\atentry{abbreviation}\marg{dm, + \gloskeyval{short}{DM}, + \gloskeyval{long}{diagonal matrix}, + \gloskeyval{longplural}{diagonal matrices} } -\end{verbatim} +\end{codebox} It's also possible to have both a~name and a~corresponding symbol. -Just use the \code{name} key for the name and the \code{symbol} key +Just use the \gloskey{name} key for the name and the \gloskey{symbol} key for the symbol. For example: -\begin{verbatim} -\newglossaryentry{emptyset} -{ - name={empty set}, - symbol={\ensuremath{\emptyset}}, - description={the set containing no elements} +\begin{codebox} +\gls{newglossaryentry}\marg{emptyset} +\marg{ + \gloskeyval{name}{empty set}, + \gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the set containing no elements} } -\end{verbatim} -or with \app{bib2gls} the definition in the \file{.bib} file is: -\begin{verbatim} -@entry{emptyset, - name={empty set}, - symbol={\ensuremath{\emptyset}}, - description={the set containing no elements} +\end{codebox} +or with \app{bib2gls} the definition in the \ext{bib} file is: +\begin{codebox} +\atentry{entry}\marg{emptyset, + \gloskeyval{name}{empty set}, + \gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the set containing no elements} } -\end{verbatim} - -If you want the symbol in the \code{name} field then you must -supply a \code{sort} value with \optsand13 otherwise you'll end up -with errors from \TeX\ or \app{xindy}. With \opt2 +\end{codebox} +If you want the symbol in the \gloskey{name} field then you must +supply a \gloskey{sort} value with \options{noidx,xdy} otherwise you'll end up +with errors from \TeX\ or \app{xindy}. With \option{mkidx} (\app{makeindex}) it's not quite so important but you may find the resulting order is a little odd. For example: -\begin{verbatim} -\newglossaryentry{emptyset} -{ - name={\ensuremath{\emptyset}}, - sort={empty set}, - description={the set containing no elements} +\begin{codebox} +\gls{newglossaryentry}\marg{emptyset} +\marg{ + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{sort}{empty set}, + \gloskeyval{description}{the set containing no elements} } -\end{verbatim} +\end{codebox} This displays the symbol as $\emptyset$ but sorts according to \qt{empty set}. You may want to consider using -\sty{glossaries-extra}'s \pkgopt{symbols} package option which +\sty{glossaries-extra}['s] \opt{symbols} package option which provides -\begin{definition} -\cs{glsxtrnewsymbol}\oarg{options}\marg{label}\marg{symbol} -\end{definition} -This internally uses \cs{newglossaryentry} but automatically sets -the \code{sort} key to the \meta{label}. For example: -\begin{verbatim} -\documentclass{article} - -\usepackage[symbols]{glossaries-extra} - -\makeglossaries - -\glsxtrnewsymbol % requires glossaries-extra.sty 'symbols' option - [description={the set containing no elements}] - {emptyset}% label (and sort value) - {\ensuremath{\emptyset}}% symbol - -\begin{document} -\gls{emptyset} - -\printglossaries -\end{document} -\end{verbatim} -Now the sort value is \qt{emptyset} rather than the previous -\qt{empty set}. - -With \app{bib2gls} you can define this in the \file{.bib} file +\cmddef{glsxtrnewsymbol} +This internally uses \gls{newglossaryentry} but automatically sets +the \gloskey{sort} key to the \meta{label}. For example: +\begin{codebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}[\opt{symbols}]\marg{glossaries-extra} +\gls{makeglossaries} +\gls{glsxtrnewsymbol} \comxropt{symbols} + \oarg{\gloskeyval{description}{the set containing no elements}} + \marg{emptyset}\comment{label (and sort value)} + \marg{\cmd{ensuremath}\marg{\cmd{emptyset}}}\comment{symbol} +\cbeg{document} +\gls{gls}\marg{emptyset} +\gls{printglossaries} +\cend{document} +\end{codebox} +Now the sort value is set to the label \qt{emptyset}. + +With \app{bib2gls} you can define this entry in the \ext{bib} file as -\begin{verbatim} -@entry{emptyset, - name={\ensuremath{\emptyset}}, - description={the set containing no elements} +\begin{codebox} +\atentry{entry}\marg{emptyset, + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the set containing no elements} } -\end{verbatim} -in which case \app{bib2gls} will try to interpret the \code{name} +\end{codebox} +in which case \app{bib2gls} will try to interpret the \gloskey{name} field to determine the sort value. Alternatively you can use: -\begin{verbatim} -@symbol{emptyset, - name={\ensuremath{\emptyset}}, - description={the set containing no elements} +\begin{codebox} +\atentry{symbol}\marg{emptyset, + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the set containing no elements} } -\end{verbatim} +\end{codebox} which will use the label (\code{emptyset}) as the sort value. -(You don't need the \pkgopt{symbols} package option in this case, +(You don't need the \opt{symbols} package option in this case, unless you want a separate symbols list.) The corresponding document -(where the definition is in the file \file{entries.bib}) is now: -\begin{verbatim} -\documentclass{article} - -\usepackage[record]{glossaries-extra} - -\GlsXtrLoadResources[src=entries] - -\begin{document} -\gls{emptyset} - -\printunsrtglossaries -\end{document} -\end{verbatim} - -Note that while the \code{sort} key is advised for symbols when -using \cs{makeglossaries} or \cs{makenoidxglossaries} it shouldn't +(where the definition is in the file \filefmt{entries.bib}) is now: +\begin{codebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}[\opt{record}]\marg{glossaries-extra} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}} +\cbeg{document} +\gls{gls}\marg{emptyset} +\gls{printunsrtglossaries} +\cend{document} +\end{codebox} + +Note that while the \gloskey{sort} key is advised for symbols when +using \gls{makeglossaries} or \gls{makenoidxglossaries} it shouldn't be used with \app{bib2gls}. Instead, \app{bib2gls} has its own algorithm for determining the sort value based on the entry type -(\code{@entry}, \code{@symbol} etc). See -\href{https://www.dickimaw-books.com/gallery/index.php?label=bib2gls-sorting}{bib2gls -gallery: sorting} for further details. +(\atentry{entry}, \atentry{symbol} etc). See +\gallerypage{bib2gls-sorting}{bib2gls gallery: sorting} for further +details. \section{Using Entries} \label{sec:useterm} @@ -880,75 +1885,82 @@ gallery: sorting} for further details. Once you have defined your entries, as described above, you can reference them in your document. There are a~number of commands to do this, but the most common one is: -\begin{definition} -\cs{gls}\marg{label} -\end{definition} +\cmddef{gls} where \meta{label} is the label you assigned to the entry when you -defined it. For example, \verb|\gls{fishage}| will display \qt{Fish +defined it. For example, \code{\gls{gls}\marg{fishage}} will display \qt{Fish Age} in the text (given the definition from the previous section). -If you are using \app{bib2gls} then this will display ?? (like -\cs{ref} and \cs{cite}) until \app{bib2gls} has created the +If you are using \app{bib2gls} then this will display \idx{unknowntag} (like +\csfmt{ref} and \csfmt{cite}) until \app{bib2gls} has created the relevant files and \LaTeX\ is rerun. If you are using the \sty{hyperref} package (remember to load it -before \styfmt{glossaries}) \cs{gls} will create a hyperlink to the +before \sty{glossaries}) \gls{gls} will create a hyperlink to the corresponding entry in the glossary. If you want to suppress the -hyperlink for a particular instance, use the starred form \cs{gls*} -for example, \verb|\gls*{fishage}|. The other commands described in +hyperlink for a particular instance, use the starred form \code{\gls{gls}*} +for example, \code{\gls{gls}*\marg{fishage}}. The other commands described in this section all have a similar starred form. -If the entry was defined as an acronym (using \cs{newacronym} with -\styfmt{glossaries} described above) or an abbreviation (using -\cs{newabbreviation} with \sty{glossaries-extra}), then \cs{gls} -will display the full form the first time it's used and just the -short form on subsequent use. For example, if the style is -set to \code{long-short}, then \verb|\gls{svm}| will display +If the entry was defined as an acronym (using \gls{newacronym} with +\sty{glossaries} described above) or an abbreviation (using +\gls{newabbreviation} with \sty{glossaries-extra}), then \gls{gls} +will display the full form the first time it's used (\idx{firstuse}) and just the +short form on \idx{subsequentuse}. For example, if the style is +set to \acrstyle{long-short}, then \code{\gls{gls}\marg{svm}} will display \qt{support vector machine (SVM)} the first time it's used, but the -next occurrence of \verb|\gls{svm}| will just display \qt{SVM}. -(If you use \cs{newacronym} with \sty{glossaries-extra} the default -doesn't show the long form on first use. You'll need to change the +next occurrence of \code{\gls{gls}\marg{svm}} will just display \qt{SVM}. +(If you use \gls{newacronym} with \sty{glossaries-extra} the default +doesn't show the long form on \idx{firstuse}. You'll need to change the style first, as described earlier.) If you want the plural form, you can use: -\begin{definition} -\cs{glspl}\marg{label} -\end{definition} -instead of \cs{gls}\marg{label}. For example, \verb|\glspl{set}| -displays \qt{sets}. +\cmddef{glspl} +instead of \code{\gls{gls}\margm{label}}. For example, +\code{\gls{glspl}\marg{set}} displays \qt{sets}. If the term appears at the start of a~sentence, you can convert the -first letter to upper case using: -\begin{definition} -\cs{Gls}\marg{label} -\end{definition} +first letter to \idx{uppercase} (\idx{sentencecase}) using: +\cmddef{Gls} for the singular form or -\begin{definition} -\cs{Glspl}\marg{label} -\end{definition} +\cmddef{Glspl} for the plural form. For example: -\begin{verbatim} -\Glspl{set} are collections. -\end{verbatim} +\begin{codebox} +\gls{Glspl}\marg{set} are collections. +\end{codebox} produces \qt{Sets are collections}. -If you've specified a symbol using the \code{symbol} key, you can +If you've specified a symbol using the \gloskey{symbol} key, you can display it using: -\begin{definition} -\cs{glssymbol}\marg{label} -\end{definition} +\cmddef{glssymbol} +For example +\begin{codebox} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\gls{newglossaryentry}\marg{emptyset} +\marg{ + \gloskeyval{name}{empty set}, + \gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{emptyset}}}, + \gloskeyval{description}{the set containing no elements} +} +\cbeg{document} +The \gls{gls}\marg{emptyset} is denoted \gls{glssymbol}\marg{emptyset}. +\cend{document} +\end{codebox} +\begin{resultbox} +The empty set is denoted $\emptyset$. +\end{resultbox} \section{Displaying a List of Entries} \label{sec:printglossaries} In \sectionref{sec:start}, I mentioned that there are three options you can choose from to create an automatically sorted glossary with the base -\styfmt{glossaries} package. These are also available with the -extension package \styfmt{glossaries-extra} along with a fourth +\sty{glossaries} package. These are also available with the +extension package \sty{glossaries-extra} along with a fourth option. These four options are listed below in a little more detail. \Tableref{tab:optionsp+c} summarises the main advantages and disadvantages. (There's a more detailed summary in the main -\styfmt{glossaries} user manual.) See also -\href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build}. +\sty{glossaries} user manual.) See also +\dickimawhref{latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build}. \begin{table}[htbp] \caption{Comparison of Glossary Options} @@ -956,8 +1968,10 @@ disadvantages. (There's a more detailed summary in the main {% \centering \begin{tabular}{>{\raggedright}p{0.3\textwidth}cccc} - & \bfseries \opt1 & \bfseries \opt2 & \bfseries \opt3 & \bfseries -\opt4\\ + & \bfseries \option{noidx} + & \bfseries \option{mkidx} + & \bfseries \option{xdy} + & \bfseries \option{b2g}\\ Requires \sty{glossaries-extra}? & \conno & \conno & \conno & \conyes\\ Requires an external application? & @@ -978,78 +1992,81 @@ disadvantages. (There's a more detailed summary in the main Can form ranges in the location lists? & \prono & \proyes & \proyes & \proyes\\ Can have non-standard locations? & - \proyes & \prono & \proyes\textsuperscript{\textdagger} & \proyes + \proyes & \prono & \proyes\tablefnmark{\textdagger} & \proyes \end{tabular} - \par}\medskip\footnotesize\textsuperscript{\textdagger} Requires some setting up. + \par}\medskip\tablefntext{\textdagger}{Requires some setting up.} \end{table} +\begin{deflist} +\itemtitle{\idxoptiondef{noidx}} -\begin{description} -\item[]\optionlabel1: - +\begin{itemdesc} This is the simplest option but it's slow and if you want a sorted list, it doesn't work for extended or non-Latin alphabets. - The \code{name} mustn't contain commands (or, if it does, the - \code{sort} value must be supplied) unless you - have the package option \pkgopt{sanitizesort} or \pkgopt[def]{sort} - or \pkgopt[use]{sort}. + The \gloskey{name} mustn't contain commands (or, if it does, the + \gloskey{sort} value must be supplied) unless you + have the package option \opt{sanitizesort} or \optval{sort}{def} + or \optval{sort}{use}. \begin{enumerate} - \item Add \cs{makenoidxglossaries} to your preamble (before you + \item Add \gls{makenoidxglossaries} to your preamble (before you start defining your entries, as described in \sectionref{sec:defterm}). \item Put -\begin{definition} -\cs{printnoidxglossary}[sort=\meta{order},\meta{other options}] -\end{definition} +\begin{compactcodebox*} +\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{\meta{order}},\meta{other options}} +\end{compactcodebox*} where you want your list of entries to appear. The sort \meta{order} may be one of: \code{word} (word ordering), \code{letter} (letter ordering), \code{case} (case-sensitive letter ordering), \code{def} (in order of definition) or \code{use} (in order of use). Alternatively, use -\begin{definition} -\cs{printnoidxglossaries} -\end{definition} +\begin{compactcodebox*} +\gls{printnoidxglossaries} +\end{compactcodebox*} to display all your glossaries (if you have more than one). This command doesn't have any arguments. This option allows you to have different sort methods. For example: -\begin{verbatim} -\printnoidxglossary[sort=word]% main glossary -\printnoidxglossary[type=symbols,sort=use]% symbols glossary -\end{verbatim} +\begin{codebox} +\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{word}}\comment{main glossary} +\gls{printnoidxglossary}\oarg{\printglossoptval{type}{symbols},\comment{symbols glossary} + \printglossoptval{sort}{use}} +\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{PDF\LaTeX} button in your editor. \end{enumerate} -Here's a complete document (\file{myDoc.tex}): -\begin{verbatim} -\documentclass{article} - -\usepackage{glossaries} - -\makenoidxglossaries % use TeX to sort - -\newglossaryentry{sample}{name={sample}, - description={an example}} - -\begin{document} -A \gls{sample}. - -\printnoidxglossaries % iterate over all indexed entries -\end{document} -\end{verbatim} +Here's a complete document (\filefmt{myDoc.tex}): +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}\marg{glossaries} +\codepar +\gls{makenoidxglossaries} % use TeX to sort +\codepar +\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample}, + \gloskeyval{description}{an example}} +\codepar +\cbeg{document} +A \gls{gls}\marg{sample}. +\codepar +\gls{printnoidxglossaries} \comment{iterate over all indexed entries} +\cend{document} +\end{codebox} Document build: -\begin{verbatim} +\begin{terminal} pdflatex myDoc pdflatex myDoc -\end{verbatim} +\end{terminal} +\end{itemdesc} -\item[]\optionlabel2: +\itemtitle{\idxoptiondef{mkidx}} +\begin{itemdesc} This option uses an 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 Latin alphabet. This process @@ -1059,69 +2076,69 @@ pdflatex myDoc reads this file on the next run. The \app{makeindex} application is automatically invoked by the helper \app{makeglossaries} script, which works out all the - appropriate settings from the \file{.aux} file. + appropriate settings from the \ext+{aux} file. \begin{enumerate} - \item If you are using \sty{ngerman}\footnote{deprecated, use -\sty{babel} instead} or some other package that -makes the double-quote character \verb|"| a shorthand, then use -\cs{GlsSetQuote} to change this to some other character. For + \item If you are using a package that +makes the double-quote character \verb|"| a shorthand (an active +character), then use +\gls{GlsSetQuote} to change this to some other character. For example: -\begin{verbatim} -\GlsSetQuote{+} -\end{verbatim} +\begin{codebox} +\gls{GlsSetQuote}\marg{+} +\end{codebox} Use this as soon as possible after you've loaded the -\styfmt{glossaries} package. +\sty{glossaries} package. (This may not be necessary if you define +all your entries in the preamble.) - \item Add \cs{makeglossaries} to your preamble (before you start + \item Add \gls{makeglossaries} to your preamble (before you start defining your entries). \item Put -\begin{definition} -\cs{printglossary}\oarg{options} -\end{definition} - where you want your list of entries (glossary) to appear. (The - \code{sort} key isn't available in \meta{options}.) +\begin{compactcodebox*} +\gls{printglossary}\oargm{options} +\end{compactcodebox*} + where you want your list of entries (\idx{glossary}) to appear. (The + \printglossopt{sort} key isn't available in \meta{options}.) Alternatively, use -\begin{definition} -\cs{printglossaries} -\end{definition} +\begin{compactcodebox*} +\gls{printglossaries} +\end{compactcodebox*} which will display all glossaries (if you have more than one). This command doesn't have any arguments. \begin{important} All glossaries are sorted using the same method which may be identified with one of the package options: -\pkgopt[standard]{sort} (default), \pkgopt[use]{sort} -or \pkgopt[def]{sort}. +\optval{sort}{standard} (default), \optval{sort}{use} +or \optval{sort}{def}. \end{important} \item Run \LaTeX\ on your document. This creates files with the - extensions \file{.glo} and \file{.ist} (for example, if your - \LaTeX\ document is called \file{myDoc.tex}, then you'll have - two extra files called \file{myDoc.glo} and \file{myDoc.ist}). + 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. + \idx{glossary} as it hasn't been created yet. \item Run \app{makeglossaries} with the base name of your - document (without the \file{.tex}) extension. If - you have access to a terminal or a command prompt (for example, the - MSDOS command prompt for Windows users or the bash console for - Unix-like users) then you need to run the command: -\begin{verbatim} + document (without the \ext{tex} extension). If + you have access to a terminal or a command prompt then you need + to run the command: +\begin{terminal} makeglossaries myDoc -\end{verbatim} - (Replace \file{myDoc} with the base name of your \LaTeX\ - document file without the \file{.tex} extension. +\end{terminal} + (Replace \filefmt{myDoc} with the base name of your \LaTeX\ + document file without the extension. Avoid spaces in the file name.) If you don't have Perl installed use \app{makeglossaries-lite} instead: -\begin{verbatim} +\begin{terminal} makeglossaries-lite myDoc -\end{verbatim} +\end{terminal} \begin{important} Some beginners get confused by \app{makeglossaries} the -application (run as a system command) and \cs{makeglossaries} +application (run as a system command) and \gls{makeglossaries} the \LaTeX\ command which should be typed in the document preamble. These are two different concepts that happen to have similar looking names. @@ -1132,355 +2149,377 @@ similar looking names. \app{makeglossaries} (or \app{makeglossaries-lite}) as a build tool, but each editor has a different method of doing this, so I~can't give a~general - description. You will have to check your editor's manual. - (There are some guidelines in -\href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating + description. However, there are some guidelines in +\dickimawhref{latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document -build}.) - If you still have problems, try adding the \pkgopt{automake} +build}. + If you still have problems, try adding the \opt{automake} package option: -\begin{verbatim} -\usepackage[automake]{glossaries} -\end{verbatim} +\begin{compactcodebox} +\cmd{usepackage}[\opt{automake}]\marg{glossaries} +\end{compactcodebox} The default sort is word order (\qt{sea lion} comes before \qt{seal}). If you want letter ordering you need to add the - \pkgopt[letter]{order} package option -\begin{verbatim} -\usepackage[order=letter]{glossaries} -\end{verbatim} + \optval{order}{letter} package option +\begin{compactcodebox} +\cmd{usepackage}[\optval{order}{letter}]\marg{glossaries} +\end{compactcodebox} \item Once you have successfully completed the previous step, you can now run \LaTeX\ on your document again. \end{enumerate} -Here's a complete document (\file{myDoc.tex}): -\begin{verbatim} -\documentclass{article} - -\usepackage{glossaries} - -\makeglossaries % create makeindex files - -\newglossaryentry{sample}{name={sample}, - description={an example}} - -\begin{document} -A \gls{sample}. - -\printglossaries % input files created by makeindex -\end{document} -\end{verbatim} +Here's a complete document (\filefmt{myDoc.tex}): +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}\marg{glossaries} +\codepar +\gls{makeglossaries} \comment{create \app{makeindex} files} +\codepar +\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample}, + \gloskeyval{description}{an example}} +\codepar +\cbeg{document} +A \gls{gls}\marg{sample}. +\codepar +\gls{printglossaries} \comment{input files created by makeindex} +\cend{document} +\end{codebox} Document build: -\begin{verbatim} +\begin{terminal} pdflatex myDoc makeglossaries myDoc pdflatex myDoc -\end{verbatim} +\end{terminal} or -\begin{verbatim} +\begin{terminal} pdflatex myDoc makeglossaries-lite myDoc pdflatex myDoc -\end{verbatim} +\end{terminal} +\end{itemdesc} +\itemtitle{\idxoptiondef{xdy}} -\item[]\optionlabel3: - +\begin{itemdesc} This option uses an application called \app{xindy} to sort the entries. This application is more flexible than \app{makeindex} and is able to sort extended Latin or non-Latin alphabets. It comes with both \TeX~Live and MiK\TeX. Since \app{xindy} is a Perl script, you will also - need to ensure that Perl is installed. In a~similar way to \opt2, this + need to ensure that Perl is installed. In a~similar way to \option{mkidx}, this option involves making \LaTeX\ write the glossary information to a~temporary file which \app{xindy} reads. Then \app{xindy} writes a~new file containing the code to typeset the glossary. \LaTeX\ then reads this file on the next run. The \app{xindy} application is automatically invoked by the helper \app{makeglossaries} script, which works out all the - appropriate settings from the \file{.aux} file. + appropriate settings from the \ext+{aux} file. \begin{enumerate} - \item Add the \pkgopt{xindy} option to the \sty{glossaries} + \item Add the \opt{xindy} option to the \sty{glossaries} package option list: -\begin{verbatim} -\usepackage[xindy]{glossaries} -\end{verbatim} - - \item Add \cs{makeglossaries} to your preamble (before you start +\begin{compactcodebox} +\cmd{usepackage}[\opt{xindy}]\marg{glossaries} +\end{compactcodebox} +If you aren't using a Latin script, you may need to suppress the +default number group: +\begin{compactcodebox} +\cmd{usepackage}[\optvalm{xindy}{glsnumbers=false}]\marg{glossaries} +\end{compactcodebox} + + \item Add \gls{makeglossaries} to your preamble (before you start defining your entries). \item Put -\begin{definition} -\cs{printglossary}\oarg{options} -\end{definition} +\begin{compactcodebox*} +\gls{printglossary}\oargm{options} +\end{compactcodebox*} where you want your list of entries (glossary) to appear. (The - \code{sort} key isn't available in \meta{options}.) + \printglossopt{sort} key isn't available in \meta{options}.) Alternatively, use -\begin{definition} -\cs{printglossaries} -\end{definition} +\begin{compactcodebox*} +\gls{printglossaries} +\end{compactcodebox*} \begin{important} -All glossaries are sorted using the same method +All \idxpl{glossary} are sorted using the same method which may be identified with one of the package options: -\pkgopt[standard]{sort} (default), \pkgopt[use]{sort} -or \pkgopt[def]{sort}. +\optval{sort}{standard} (default), \optval{sort}{use} +or \optval{sort}{def}. \end{important} \item Run \LaTeX\ on your document. This creates files with the - extensions \file{.glo} and \file{.xdy} (for example, if your - \LaTeX\ document is called \file{myDoc.tex}, then you'll have - two extra files called \file{myDoc.glo} and \file{myDoc.xdy}). + 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. + \idx{glossary} as it hasn't been created yet. \item Run \app{makeglossaries} with the base name of the - document (omitting the \file{.tex} extension). - If you have access to a terminal or a command prompt (for example, the - MSDOS command prompt for Windows users or the bash console for - Unix-like users) then you need to run the command: -\begin{verbatim} + document (omitting the \ext{tex} extension). + If you have access to a terminal or a command prompt then + you need to run the command: +\begin{terminal} makeglossaries myDoc -\end{verbatim} - (Replace \file{myDoc} with the base name of your \LaTeX\ - document file without the \file{.tex} extension. +\end{terminal} + (Replace \filefmt{myDoc} with the base name of your \LaTeX\ + document file without the \ext{tex} extension.) Avoid spaces in the file name. If you don't know how to use the command prompt, then as mentioned above, you may be able to configure your text editor to add - \app{makeglossaries} as a build tool. + \app{makeglossaries} as a build tool. Note that the \opt{automake} option + won't work in \TeX's restricted mode, as \app{xindy} isn't on the + list of trusted applications. - The default sort is word order (\qt{sea lion} comes before -\qt{seal}). + The default sort is word order (\qt{sea lion} comes before \qt{seal}). If you want letter ordering you need to add the - \code{order=letter} package option: -\begin{verbatim} -\usepackage[xindy,order=letter]{glossaries} -\end{verbatim} + \optval{order}{letter} package option: +\begin{compactcodebox} +\cmd{usepackage}[\opt{xindy},\optval{order}{letter}]\marg{glossaries} +\end{compactcodebox} \item Once you have successfully completed the previous step, you can now run \LaTeX\ on your document again. \end{enumerate} -Here's a complete document (\file{myDoc.tex}): -\begin{verbatim} -\documentclass{article} - -\usepackage[xindy]{glossaries} - -\makeglossaries % create xindy files - -\newglossaryentry{sample}{name={sample}, - description={an example}} - -\begin{document} -A \gls{sample}. - -\printglossaries % input files created by xindy -\end{document} -\end{verbatim} +Here's a complete document (\filefmt{myDoc.tex}): +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}[\opt{xindy}]\marg{glossaries} +\codepar +\gls{makeglossaries} \comment{create \app{xindy} files} +\codepar +\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample}, + \gloskeyval{description}{an example}} +\codepar +\cbeg{document} +A \gls{gls}\marg{sample}. +\codepar +\gls{printglossaries} \comment{input files created by \app{xindy}} +\cend{document} +\end{codebox} Document build: -\begin{verbatim} +\begin{terminal} pdflatex myDoc makeglossaries myDoc pdflatex myDoc -\end{verbatim} +\end{terminal} +\end{itemdesc} -\item[]\optionlabel4: +\itemtitle{\idxoptiondef{b2g}} - This requires the extension package \sty{glossaries-extra} and +\begin{itemdesc} + This requires the extension package \sty+{glossaries-extra} and an application called \app{bib2gls}. This application is able to sort extended Latin or non-Latin alphabets. It comes with both \TeX~Live and MiK\TeX\ but requires at least Java~8. This method - works differently to \optsand23. Instead of creating a file + works differently to \options{mkidx,xdy}. Instead of creating a file containing the code to typeset the glossary it creates a - \file{.glstex} file containing the entry definitions fetched - from the \file{.bib} file (or files), but only those entries + \ext+{glstex} file containing the entry definitions fetched + from the \ext+{bib} file (or files), but only those entries that are required in the document are defined and they are defined in the order obtained from the chosen sort method. This means that you can just use - \cs{printunsrtglossary} to display each glossary (or - \cs{printunsrtglossaries} to display them all). + \gls{printunsrtglossary} to display each glossary (or + \gls{printunsrtglossaries} to display them all). \begin{enumerate} - \item Add the \pkgopt{record} option to the \sty{glossaries-extra} + \item Add the \opt{record} option to the \sty{glossaries-extra} package option list: -\begin{verbatim} -\usepackage[record]{glossaries-extra} -\end{verbatim} +\begin{compactcodebox} +\cmd{usepackage}\oarg{\opt{record}}\marg{glossaries-extra} +\end{compactcodebox} \item Add one or more -\begin{definition} -\cs{GlsXtrLoadResources}[src=\marg{bib list},\meta{options}] -\end{definition} +\begin{compactcodebox*} +\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{\meta{bib list}},\meta{options}} +\end{compactcodebox*} to your preamble where \meta{bib list} is the - list of \file{.bib} files containing the entries. You may + list of \ext{bib} files containing the entries. You may use different sort methods for each resource set. For example: -\begin{verbatim} -\usepackage[record,% using bib2gls - abbreviations, - symbols, - numbers -]{glossaries-extra} - -\GlsXtrLoadResources[ - src={terms},% entries in terms.bib - type=main,% put these entries in the 'main' (default) list - sort={de-CH-1996}% sort according to this locale -] -\GlsXtrLoadResources[ - src={abbrvs},% entries in abbrvs.bib - type=abbreviations,% put these entries in the 'abbreviations' list - sort={letter-case}% case-sensitive letter (non-locale) sort -] -\GlsXtrLoadResources[ - src={syms},% entries in syms.bib - type=symbols,% put these entries in the 'symbols' list - sort={use}% sort according to first use in the document -] -\GlsXtrLoadResources[ - src={constants},% entries in constants.bib - type=numbers,% put these entries in the 'numbers' list - sort-field={user1},% sort according to this field - sort={double}% double-precision sort -] -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}\oarg{record,\comment{using \app{bib2gls}} + \opt{abbreviations},\comment{create abbreviations list} + \opt{symbols},\comment{create symbols list} + \opt{numbers}\comment{create numbers list} +}\marg{glossaries-extra} +\codepar +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{terms},\comment{entries in terms.bib} + \comment{put these entries in the 'main' (default) list:} + \resourceoptval{type}{main}, + \resourceoptval{sort}{de-CH-1996}\comment{sort according to this locale} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{abbrvs},\comment{entries in abbrvs.bib} + \comment{put these entries in the 'abbreviations' list:} + \resourceoptvalm{type}{abbreviations}, + \comment{case-sensitive letter (non-locale) sort:} + \resourceoptval{sort}{letter-case} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{syms},\comment{entries in syms.bib} + \resourceoptval{type}{symbols},\comment{put these entries in the 'symbols' list} + \resourceoptval{sort}{use}\comment{sort according to first use in the document} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{constants},\comment{entries in constants.bib} + \resourceoptval{type}{numbers},\comment{put these entries in the 'numbers' list} + \resourceoptval{sort-field}{user1},\comment{sort according to this field} + \resourceoptval{sort}{double}\comment{double-precision sort} +} +\end{codebox*} The last resource set assumes that the entries defined in the -file \file{constants.bib} have a number stored in the \code{user1} +file \filefmt{constants.bib} have a number stored in the \gloskey{user1} field. For example: -\begin{verbatim} -@number{pi, - name={\ensuremath{\pi}}, - description={pi}, - user1={3.141592654} +\begin{compactcodebox} +\atentry{number}\marg{pi, + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{pi}}}, + \gloskeyval{description}{pi}, + \gloskeyval{user1}{3.141592654} } -\end{verbatim} +\end{compactcodebox} \item Put -\begin{definition} -\cs{printunsrtglossary}[type=\marg{type},\meta{options}] -\end{definition} - where you want your list of entries (glossary) to appear. (The - \code{sort} key isn't available in \meta{options}. It needs to be - used in \cs{GlsXtrLoadResources} instead.) +\begin{compactcodebox*} +\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\meta{type}},\meta{options}} +\end{compactcodebox*} + where you want your list of entries (\idx{glossary}) to appear. (The + \printglossopt{sort} key isn't available in \meta{options}. The + \resourceopt{sort} setting needs to be + used in \gls{GlsXtrLoadResources} instead.) Alternatively, use -\begin{definition} -\cs{printunsrtglossaries} -\end{definition} +\begin{compactcodebox*} +\gls{printunsrtglossaries} +\end{compactcodebox*} - \item Run \LaTeX\ on your document. The \pkgopt{record} option - adds information to the \file{.aux} file that provides + \item Run \LaTeX\ on your document. The \opt{record} option + adds information to the \ext+{aux} file that provides \app{bib2gls} with all required details for each resource set. - For example, if the file is called \file{myDoc.tex}: -\begin{verbatim} + For example, if the file is called \filefmt{myDoc.tex}: +\begin{terminal} pdflatex myDoc -\end{verbatim} +\end{terminal} \item Run \app{bib2gls} -\begin{verbatim} +\begin{terminal} bib2gls myDoc -\end{verbatim} +\end{terminal} or (if you need letter groups) -\begin{verbatim} -bib2gls --group myDoc -\end{verbatim} +\begin{terminal} +bib2gls \switch{group} myDoc +\end{terminal} \item Run \LaTeX\ again. \end{enumerate} -Here's a complete document (\file{myDoc.tex}): -\begin{verbatim} -\documentclass{article} - -\usepackage[record]{glossaries-extra} - -\GlsXtrLoadResources % input file created by bib2gls - [% instructions to bib2gls: - src={entries}, % terms defined in entries.bib - sort={en-GB}% sort according to this locale - ] - -\newglossaryentry{sample}{name={sample}, - description={an example}} - -\begin{document} -A \gls{sample}. - -\printunsrtglossaries % iterate over all defined entries -\end{document} -\end{verbatim} -The accompanying \file{entries.bib} file: -\begin{verbatim} -@entry{sample, - name = {sample}, - description = {an example} +Here's a complete document (\filefmt{myDoc.tex}): +\begin{codebox} +\cmd{documentclass}\marg{article} +\codepar +\cmd{usepackage}[\opt{record}]\marg{glossaries-extra} +\comment{input the \ext{glstex} file created by \app{bib2gls}:} +\gls{GlsXtrLoadResources} + \oarg{\comment{instructions to \app{bib2gls}:} + \resourceoptvalm{src}{entries}, \comment{terms are defined in entries.bib} + \resourceoptval{sort}{en-GB}\comment{sort according to this locale} + } +\codepar +\cbeg{document} +A \gls{gls}\marg{sample}. +\codepar +\gls{printunsrtglossaries} \comment{iterate over all defined entries} +\cend{document} +\end{codebox} +The accompanying \filefmt{entries.bib} file: +\begin{compactcodebox} +\atentry{entry}\marg{sample, + \gloskeyval{name}{sample}, + \gloskeyval{description}{an example} } -\end{verbatim} +\end{compactcodebox} Document build: -\begin{verbatim} +\begin{terminal} pdflatex myDoc bib2gls myDoc pdflatex myDoc -\end{verbatim} +\end{terminal} +\end{itemdesc} -\end{description} +\end{deflist} -If you are having difficulty integrating \app{makeglossaries} +If you are having difficulty integrating \app{makeglossaries} (or +\app{makeglossaries-lite}) or \app{bib2gls} into your document build process, you may want to consider using \app{arara}, which is a Java application that searches the document for special comment lines that tell \app{arara} which -applications to run. For example, the file \file{myDoc.tex} might +applications to run. For example, the file \filefmt{myDoc.tex} might start with: -\begin{verbatim} - % arara: pdflatex - % arara: makeglossaries - % arara: pdflatex - \documentclass{article} - \usepackage{glossaries} - \makeglossaries -\end{verbatim} +\begin{codebox} +\araraline{pdflatex} +\araraline{makeglossaries} +\araraline{pdflatex} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\marg{glossaries} +\gls{makeglossaries} +\end{codebox} then to build the document you just need the single system call: -\begin{verbatim} - arara myDoc -\end{verbatim} -(As from version 4.0, \app{arara} also has -directives for \app{makeglossaries-lite} and \app{bib2gls}. See the -\app{arara} manual for further details.) +\begin{terminal} +arara myDoc +\end{terminal} +Alternatively, if you want to use \app{makeglossaries-lite}, change +the second line to: +\begin{compactcodebox} +\araraline{makeglossarieslite} +\end{compactcodebox} +There's also a rule for \app{bib2gls}. For example, the following +indicates that letter groups are required: +\begin{codebox} +\araraline{pdflatex} +\araraline{bib2gls: \marg{ group: on }} +\araraline{pdflatex} +\cmd{documentclass}\marg{article} +\cmd{usepackage}\oarg{\opt{record}}\marg{glossaries-extra} +\gls{GlsXtrLoadResources} +\end{codebox} When sorting the entries, the string comparisons are made according -to each entry's \code{sort} key. If this is omitted, the -\code{name} key is used. For example, recall the earlier +to each entry's \gloskey{sort} key. If this is omitted, the +\gloskey{name} key is used. For example, consider the definition: -\begin{verbatim} - \newglossaryentry{elite} - { - name={{\'e}lite}, - description={select group or class} - } -\end{verbatim} -No \code{sort} key was used, so it's set to the same as the -\code{name} key: \verb|{\'e}lite|. How this is interpreted depends +\begin{codebox} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\cmd{'}elite}, + \gloskeyval{description}{select group or class} +} +\end{codebox} +The \gloskey{sort} key isn't present, so it's set to the same as the +\gloskey{name} key: \code{\cmd{'}elite}. How this is interpreted depends on which option you have used: \begin{description} -\item[\opt1:] By default, the accent command will be stripped so the +\item[\option{noidx}] By default, the accent command will be stripped so the sort value will be \code{elite}. This will put the entry in the \qt{E} letter group. However if you use the -\pkgopt[true]{sanitizesort} package option, the sort value will be -interpreted as the sequence of characters: \verb|{| \verb|\| \code{'} \code{e} -\verb|}| \code{l} \code{i} \code{t} and \code{e}. This will place +\optval{sanitizesort}{true} package option, the sort value will be +interpreted as the sequence of characters: \verb|\| \code{'} \code{e} +\code{l} \code{i} \code{t} and \code{e}. This will place this entry in the \qt{symbols} group since it starts with a symbol. -\item[\opt2:] The sort key will be interpreted the sequence of characters: -\verb|{| \verb|\| \verb|'| \code{e} \verb|}| \code{l} \code{i} \code{t} -and \code{e}. The first character is an opening curly brace -\verb|{| so \app{makeindex} will put this entry in the +\item[\option{mkidx}] The sort value will be interpreted as the sequence of characters: +\verb|\| \verb|'| \code{e} \code{l} \code{i} \code{t} +and \code{e}. The first character is a backslash +so \app{makeindex} will put this entry in the \qt{symbols} group. -\item[\opt3:] +\item[\option{xdy}] \app{xindy} disregards \LaTeX\ commands so it sorts on \code{elite}, which puts this entry in the \qt{E} group. If stripping all commands leads to an empty string (such as -\verb|\ensuremath{\emptyset}|) then \app{xindy} will fail, so in -these situations you need to provide an appropriate \code{sort} +would happen with \code{\cmd{ensuremath}\marg{\cmd{emptyset}}}) then \app{xindy} will fail, so in +those situations you need to provide an appropriate \gloskey{sort} value that \app{xindy} will accept. \begin{important} \app{xindy} merges entries with duplicate sort values. @@ -1489,509 +2528,501 @@ A sort value may degrade into an empty or duplicate value once \app{xindy} has stripped all commands and braces. \end{important} -\item[\opt4:] +\item[\option{b2g}] \app{bib2gls} has a primitive \LaTeX\ parser that recognises a limited set of commands, which includes the standard accent commands -and some maths commands, so it can convert \verb|{\'e}lite| to +and some maths commands, so it can convert \code{\cmd{'}elite} to \code{\'elite}. It disregards unknown commands. This may lead to -an empty sort value, but \app{bib2gls} doesn't mind that. +an empty sort value, but \app{bib2gls} doesn't mind that. (It has +fallbacks, depending on the sort method and various settings, that +can be used to determine the order if the sort value is empty or a +duplicate.) -Note that even if the name is given as \verb|{\'e}lite|, the letter -group heading (if the \verb|--group| switch is used) may end up with +Note that even if the name is given as \code{\cmd{'}elite}, the letter +group heading (if the \switch{group} switch is used) may end up with the character \'E depending on the locale used by the sort comparator. In this case you will need to ensure the document can support this character either with \sty{inputenc} or by switching to -a \LaTeX\ engine with native UTF-8 support. +a \LaTeX\ engine with native UTF-8 support. (Modern \LaTeX\ kernels +default to UTF-8.) There's more information on how \app{bib2gls} obtains the sort value in -\href{https://www.dickimaw-books.com/gallery/index.php?label=bib2gls-sorting}{bib2gls -gallery: sorting}. +\gallerypage{label=bib2gls-sorting}{bib2gls gallery: sorting}. \end{description} If the \sty{inputenc} package is used: -\begin{verbatim} - \usepackage[utf8]{inputenc} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[utf8]\marg{inputenc} +\end{codebox} and the entry is defined as: -\begin{alltt} - \verb|\newglossaryentry{elite}| - \verb|{| - name=\verb|{{|\'e\verb|}lite},| - description=\verb|{select group or class}| - \verb|}| -\end{alltt} +\begin{compactcodebox} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\'elite}, + \gloskeyval{description}{select group or class} +} +\end{compactcodebox} then: \begin{description} -\item[\opt1:] By default the sort value will be interpreted as -\code{elite} so the entry will be put in the \qt{E} letter group. -If you use the \pkgopt[true]{sanitizesort} package option, the -sort value will be interpreted as \code{\'elite} where \'e has -been sanitized (so it's no longer an active character and is in fact -seen as two octets 0xC3 0xA9) which will -put this entry before the \qt{A} letter group. (The group is -determined by the first octet 0xC3.) - -\item[\opt2:] \app{makeindex} sees \code{\'e} as two octets -(0xC3 0xA9) rather than a single character so it tries to put +\item[\option{noidx}:] With old \LaTeX\ kernels, this entry was placed in the +\qt{E} letter group. With new \LaTeX\ kernels you will have to set +the \gloskey{sort} key to Basic Latin (for example, +\code{\gloskeyval{sort}{elite}}) but, where possible, it's better to +use \app{xindy} or \app{bib2gls}. + +\item[\option{mkidx}] \app{makeindex} sees \code{\'e} as two octets (0xC3 +0xA9) rather than a single character so it tries to put \code{\'elite} in the 0xC3 (\qt{\~A}) letter group (which, in this -case, comes after \qt{Z}). +case, comes after \qt{Z}). You will either have to set the +\gloskey{sort} key to Basic Latin (for example, +\gloskeyval{sort}{elite}) or switch to \app{xindy} or +\app{bib2gls}. -\item[\opt3:] \app{xindy} will correctly recognise the sort value +\item[\option{xdy}] \app{xindy} will correctly recognise the sort value \code{\'elite} and will place it in whatever letter group is appropriate for the given language setting. (In English, this would just be the \qt{E} letter group, but another language might put it in the \qt{\'E} letter group.) -\item[\opt4:] The \sty{inputenc} package doesn't affect the -encoding used with \file{.bib} entry definitions, since these are dependent -on the encoding used to save the \file{.bib} file (although the -labels must still be ASCII unless you use \XeLaTeX/\LuaLaTeX). You can help \app{bib2gls} (and -JabRef) by putting an encoding comment at the start of the \file{.bib} file: -\begin{alltt} +\item[\option{b2g}] The \sty{inputenc} package doesn't affect the +encoding used with \ext{bib} entry definitions, since these are dependent +on the encoding used to save the \ext{bib} file. The \ext{glstex} +file created by \app{bib2gls} will be written in the encoding +required by your document. (In general, it's best to use the same +encoding across all files.) + +You can help \app{bib2gls} by putting an encoding comment at the +start of the \ext{bib} file: +\begin{codebox} \% Encoding: UTF-8 -\end{alltt} +\end{codebox} -With the correct encoding set up, \app{bib2gls} will determine -that the sort value is \code{\'elite} and will place it in -whatever letter group is appropriate for the given sort rule. -For example, \verb|sort=en-GB| (or just \verb|sort=en|) will put -\code{\'elite} in the \qt{E} letter group, but another language -might put it in the \qt{\'E} letter group. +With the correct encoding set up, \app{bib2gls} will determine that +the sort value is \code{\'elite} and will place it in whatever +letter group is appropriate for the given sort rule. For example, +\resourceoptval{sort}{en-GB} (or just \resourceoptval{sort}{en}) +will put \code{\'elite} in the \qt{E} letter group, but another +language might put it in the \qt{\'E} letter group. \end{description} Therefore if you have extended Latin or non-Latin characters, your -best option is to use either \app{xindy} (\opt3) or -\app{bib2gls} (\opt4) with the \sty{inputenc} or \sty{fontspec} package. -If you use \app{makeindex} (\opt2) you need to specify the +best option is to use either \app{xindy} (\option{xdy}) or \app{bib2gls} +(\option{b2g}). +If you use \app{makeindex} (\option{mkidx}) you need to specify the \code{sort} key like this: -\begin{verbatim} -\newglossaryentry{elite} -{ - name={{\'e}lite}, - sort={elite}, - description={select group or class} +\begin{codebox} +\gls{newglossaryentry}\marg{elite} +\marg{ + \gloskeyval{name}{\'elite}, + \gloskeyval{sort}{elite}, + \gloskeyval{description}{select group or class} } -\end{verbatim} -or -\begin{alltt} -\cs{newglossaryentry}\{elite\} -\{ - name=\{\{\'e\}lite\}, - sort=\{elite\}, - description=\{select group or class\} -\} -\end{alltt} -If you use \opt1, you may or may not need to use the \code{sort} +\end{codebox} +If you use \option{noidx}, you may or may not need to use the \gloskey{sort} key, but you will need to be careful about fragile commands in the -\code{name} key if you don't set the \code{sort} key. - -If you use \opt3 and the \code{name} only contains a command or -commands (such as \cs{P} or \verb|\ensuremath{\pi}|) you must add the -\code{sort} key. This is also advisable for the other options -(except \opt4), but is essential for \opt3. For example: -\begin{verbatim} - \newglossaryentry{P}{name={\P},sort={P}, - description={paragraph symbol}} -\end{verbatim} +\gloskey{name} key if you don't set the \gloskey{sort} key. + +If you use \option{xdy} and the \gloskey{name} only contains a command or +commands (such as \csfmt{P} or +\code{\cmd{ensuremath}\marg{\cmd{pi}}}) you must add the +\gloskey{sort} key. This is also advisable for the other options +(except \option{b2g}), but is essential for \option{xdy}. For example: +\begin{codebox} +\gls{newglossaryentry}\marg{P}\marg{\gloskeyval{name}{\cmd{P}},\gloskeyval{sort}{P}, + \gloskeyval{description}{paragraph symbol}} +\end{codebox} \section{Customising the Glossary} \label{sec:glosstyle} The default glossary style uses the \env{description} environment to display the entry list. Each entry name is set in the optional -argument of \cs{item} which means that it will typically be +argument of \gls{item} which means that it will typically be displayed in bold. You can switch to medium weight by redefining -\cs{glsnamefont}: -\begin{verbatim} -\renewcommand*{\glsnamefont}[1]{\textmd{#1}} -\end{verbatim} +\gls{glsnamefont}: +\begin{codebox} +\cmd{renewcommand}*\marg{\gls{glsnamefont}}[1]\marg{\cmd{textmd}\marg{\#1}} +\end{codebox} Some classes and packages redefine the \env{description} environment -in such as way that's incompatible with the \styfmt{glossaries} +in such as way that's incompatible with the \sty{glossaries} package. In which case you'll need to select a different glossary style (see below). By default, a~full stop is appended to the description (unless you use \sty{glossaries-extra}). To prevent -this from happening use the \pkgopt{nopostdot} package option: -\begin{verbatim} -\usepackage[nopostdot]{glossaries} -\end{verbatim} -or to add it with \styfmt{glossaries-extra}: -\begin{verbatim} -\usepackage[postdot]{glossaries-extra} -\end{verbatim} +this from happening use the \opt{nopostdot} package option: +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot}]\marg{glossaries} +\end{codebox} +or to add it with \sty{glossaries-extra}: +\begin{codebox} +\cmd{usepackage}[\opt{postdot}]\marg{glossaries-extra} +\end{codebox} By default, a~location list is displayed for each entry (unless you -use \cs{printunsrtglossary} without \app{bib2gls}). This refers +use \gls{printunsrtglossary} without \app{bib2gls}). This refers to the document locations (for example, the page number) where the -entry has been referenced. If you use \optsor23 described in -\sectionref{sec:printglossaries} or \opt4 (with \app{bib2gls} and +entry has been referenced. If you use \optionsor{mkidx,xdy} described in +\sectionref{sec:printglossaries} or \option{b2g} (with \app{bib2gls} and \sty{glossaries-extra}) then location ranges will be compressed. For example, if an entry was used on pages~1, 2 and~3, with -\optsor23 or \opt4 the location list will appear as 1--3, but with \opt1 it +\optionsor{mkidx,xdy,b2g} the location list will appear as 1--3, but +with \option{noidx} it will appear as 1, 2, 3. If you don't want the locations displayed -you can hide them using the \pkgopt{nonumberlist} package option: -\begin{verbatim} -\usepackage[nonumberlist]{glossaries} -\end{verbatim} -or with \app{bib2gls} use \code{save-locations=false} in the -optional argument of the appropriate \cs{GlsXtrLoadResources} +you can hide them using the \opt{nonumberlist} package option: +\begin{codebox} +\cmd{usepackage}[\opt{nonumberlist}]\marg{glossaries} +\end{codebox} +or with \app{bib2gls} use \resourceoptval{save-locations}{false} in the +optional argument of the appropriate \gls{GlsXtrLoadResources} (it's possible to have some resource sets with locations and some without). Entries are grouped according to the first letter of -each entry's \code{sort} key. By default a~vertical gap is placed +each entry's \gloskey{sort} key. By default a~vertical gap is placed between letter groups for most of the predefined styles. You can suppress this with the -\pkgopt{nogroupskip} package option: -\begin{verbatim} -\usepackage[nogroupskip]{glossaries} -\end{verbatim} +\opt{nogroupskip} package option: +\begin{codebox} +\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries} +\end{codebox} If the default style doesn't suit your document, you can change the style using: -\begin{definition} -\cs{setglossarystyle}\marg{style name} -\end{definition} -\href{http://www.dickimaw-books.com/gallery/glossaries-styles/}{There are a~number of predefined styles.} Glossaries can vary from +\cmddef{setglossarystyle} +\dickimawhref{gallery/glossaries-styles/}{There are a~number of predefined styles.} Glossaries can vary from a~list of symbols with a~terse description to a~list of words or phrases with descriptions that span multiple paragraphs, so there's no \qt{one style fits all} solution. You need to choose a~style that suits your document. For example: -\begin{verbatim} -\setglossarystyle{index} -\end{verbatim} -You can also use the \pkgopt{style} package option for the preloaded +\begin{codebox*} +\gls{setglossarystyle}\marg{\glostyle{index}} +\end{codebox*} +You can also use the \opt{style} package option for the preloaded styles. For example: -\begin{verbatim} -\usepackage[style=index]{glossaries} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\optval{style}{index}]\marg{glossaries} +\end{codebox} Examples: \begin{enumerate} \item You have entries where the name is a~symbol and the description is a~brief phrase or short sentence. Try one of the \qt{mcol} styles defined in the \sty{glossary-mcols} package. For example: -\begin{verbatim} -\usepackage[nopostdot]{glossaries} -\usepackage{glossary-mcols} -\setglossarystyle{mcolindex} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot}]\marg{glossaries} +\cmd{usepackage}\marg{glossary-mcols} +\gls{setglossarystyle}\marg{\glostyle+{mcolindex}} +\end{codebox} or -\begin{verbatim} -\usepackage[stylemods={mcols},style=mcolindex]{glossaries-extra} -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}[\optval{stylemods}{mcols},\optval{style}{mcolindex}]\marg{glossaries-extra} +\end{codebox*} \item You have entries where the name is a~word or phrase and the description spans multiple paragraphs. Try one of the \qt{altlist} styles. For example: -\begin{verbatim} -\usepackage[nopostdot]{glossaries} -\setglossarystyle{altlist} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot}]\marg{glossaries} +\gls{setglossarystyle}\marg{\glostyle+{altlist}} +\end{codebox} or -\begin{verbatim} -\usepackage[stylemods,style=altlist]{glossaries-extra} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{stylemods},\optval{style}{altlist}]\marg{glossaries-extra} +\end{codebox} \item You have entries where the name is a~single word, the description is brief, and an associated symbol has been set. Use one of the styles that display the symbol (not all of them do). For example, one of the tabular styles: -\begin{verbatim} -\usepackage[nopostdot,nonumberlist,style=long4col]{glossaries} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot},\opt{nonumberlist},\optval{style}{\glostyle+{long4col}}]{glossaries} +\end{codebox} or one of the \qt{tree} styles: -\begin{verbatim} -\usepackage[nopostdot,nonumberlist,style=tree]{glossaries} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{nopostdot},\opt{nonumberlist},\optval{style}{tree}]\marg{glossaries} +\end{codebox} \end{enumerate} If your glossary consists of a~list of abbreviations and you also want to specify a~description as well as the long form, then you need to use an abbreviation style that will suit the glossary style. For example, -use the \code{long-short-desc} acronym style: -\begin{verbatim} -\setacronymstyle{long-short-desc} -\end{verbatim} +use the \acrstyle{long-short-desc} acronym style: +\begin{codebox*} +\gls{setacronymstyle}\marg{\acrstyle{long-short-desc}} +\end{codebox*} Define the acronyms with a~description: -\begin{verbatim} -\newacronym - [description={statistical pattern recognition technique}] - {svm}{SVM}{support vector machine} -\end{verbatim} +\begin{codebox*} +\gls{newacronym} + \oarg{\gloskeyval{description}{statistical pattern recognition technique}} + \marg{svm}\marg{SVM}\marg{support vector machine} +\end{codebox*} Alternatively with \sty{glossaries-extra}: -\begin{verbatim} -\setabbreviationstyle{long-short-desc} - -\newabbreviation - [description={statistical pattern recognition technique}] - {svm}{SVM}{support vector machine} -\end{verbatim} +\begin{codebox*} +\gls{setabbreviationstyle}\marg{\acrstyle{long-short-desc}} +\codepar +\gls{newabbreviation} + \oarg{\gloskeyval{description}{statistical pattern recognition technique}} + \marg{svm}\marg{SVM}\marg{support vector machine} +\end{codebox*} Choose a~glossary style that suits wide entry names. For example: -\begin{verbatim} -\setglossarystyle{altlist} -\end{verbatim} +\begin{codebox*} +\gls{setglossarystyle}\marg{\glostyle{altlist}} +\end{codebox*} \section{Multiple Glossaries} \label{sec:multigloss} The \sty{glossaries} package predefines a~default \code{main} -glossary. When you define an entry (using one of the commands +\idx{glossary}. When you define an entry (using one of the commands described in \sectionref{sec:defterm}), that entry is automatically -assigned to the default glossary, unless you indicate otherwise -using the \code{type} key. However you first need to -make sure the desired glossary has been defined. This is done using: -\begin{definition} -\cs{newglossary}\oarg{glg}\marg{label}\marg{gls}\marg{glo}\marg{title} -\end{definition} -The \meta{label} is a~label that uniquely identifies this new -glossary. As with other types of identifying labels, be careful not +assigned to the default \idx{glossary}, unless you indicate otherwise +using the \gloskey{type} key. However you first need to +make sure the desired \idx{glossary} has been defined. This is done using: +\cmddef{newglossary} +The \meta{glossary-label} is a~label that uniquely identifies this new +\idx{glossary}. As with other types of identifying labels, be careful not to use active characters in \meta{label}. The final argument -\meta{title} is the section or chapter heading used by -\cs{printglossary} or \cs{printnoidxglossary}. The other arguments +\meta{title} is the section or chapter title used by +\gls{printglossary}, \gls{printnoidxglossary} or +\gls{printunsrtglossary}. The other arguments indicate the file extensions used by -\app{makeindex}\slash\app{xindy} (described in -\sectionref{sec:printglossaries}). If you use \opt1 described -above (or \app{bib2gls} and \cs{printunsrtglossaries}), -then the \meta{glg}, \meta{gls} and \meta{glo} arguments aren't +\app{makeindex} or \app{xindy} (described in +\sectionref{sec:printglossaries}). If you're not using either +\app{makeindex} or \app{xindy}, +then the \meta{log-ext}, \meta{in-ext} and \meta{out-ext} arguments aren't relevant, in which case you may prefer to use the starred version -where you don't specify the extensions: -\begin{definition} -\cs{newglossary*}\marg{label}\marg{title} -\end{definition} +where those arguments are omitted: +\cmddef{newglossary*} -In the case of \optsor23, all glossary definitions must come before -\cs{makeglossaries}. (\emph{Entry} definitions should come after -\cs{makeglossaries}.) In the case of \opt4, all glossary definitions -must come before any \cs{GlsXtrLoadResources} that requires them. +In the case of \optionsor{mkidx,xdy}, all new \idxpl{glossary} must +be defined before \gls{makeglossaries}. (\emph{Entry} definitions +should come after \gls{makeglossaries}.) In the case of +\option{b2g}, all new \idxpl{glossary} must be defined before any +\gls{GlsXtrLoadResources} that requires them. Since it's quite common for documents to have both a~list of terms and a~list of abbreviations, the \sty{glossaries} package provides the -package option \pkgopt{acronym} (or \pkgopt{acronyms}), which +package option \opt{acronyms} (or \opt{acronym}), which is a~convenient shortcut for -\begin{verbatim} -\newglossary[alg]{acronym}{acr}{acn}{\acronymname} -\end{verbatim} -The option also changes the behaviour of \cs{newacronym} so that acronyms +\begin{compactcodebox} +\gls{newglossary}\oarg{\ext+{alg}}\marg{acronym}\marg{\ext+{acr}}\marg{\ext+{acn}}\marg{\gls+{acronymname}} +\end{compactcodebox} +The option also changes the behaviour of \gls{newacronym} so that acronyms are automatically put in the list of acronyms instead of the main -glossary. The \sty{glossaries-extra} package also provides this -option for abbreviations defined using \cs{newacronym} but -additionally has the package option \pkgopt{abbreviations} to create -a list of abbreviations for \cs{newabbreviation}. +glossary. The \sty{glossaries-extra} package also supports the +\opt{acronyms} option for abbreviations defined using \gls{newacronym} but +additionally has the package option \opt{abbreviations} to create +a list of abbreviations for \gls{newabbreviation}. There are some other package options for creating commonly used -lists: \pkgopt{symbols} (lists of symbols), \pkgopt{numbers} (lists -of numbers), \pkgopt{index} (index of terms without descriptions defined with -\cs{newterm}\oarg{options}\marg{label}). +lists: \opt{symbols} (lists of symbols), \opt{numbers} (lists +of numbers), \opt{index} (an index). Since indexes don't +typically have descriptions, the \opt{index} option also defines: +\cmddef{newterm} +This is just a shortcut that uses \gls{newglossaryentry} with the +\gloskey{name} set to \meta{entry-label} and the \gloskey{description} is +suppressed. For example, suppose you want a~main glossary for terms, a~list of acronyms and a~list of notation: -\begin{verbatim} - \usepackage[acronyms]{glossaries} - \newglossary[nlg]{notation}{not}{ntn}{Notation} -\end{verbatim} -After \cs{makeglossaries} (or \cs{makenoidxglossaries}) you can +\begin{codebox} +\cmd{usepackage}[\opt{acronyms}]\marg{glossaries} +\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation} +\end{codebox} +After \gls{makeglossaries} (or \gls{makenoidxglossaries}) you can define the entries in the preamble. For example: -\begin{verbatim} - \newglossaryentry{gls:set} - {% This entry goes in the `main' glossary - name=set, - description={A collection of distinct objects} - } - - % This entry goes in the `acronym' glossary: - \newacronym{svm}{svm}{support vector machine} - - \newglossaryentry{not:set} - {% This entry goes in the `notation' glossary: - type=notation, - name={\ensuremath{\mathcal{S}}}, - description={A set}, - sort={S}} -\end{verbatim} -or if you don't like using \cs{ensuremath}: -\begin{verbatim} - \newglossaryentry{not:set} - {% This entry goes in the `notation' glossary: - type=notation, - name={$\mathcal{S}$}, - text={\mathcal{S}}, - description={A set}, - sort={S}} -\end{verbatim} +\begin{codebox} +\gls{newglossaryentry}\marg{gls:set} +\marg{\comment{This entry goes in the `main' glossary} + \gloskeyval{name}{set}, + \gloskeyval{description}{A collection of distinct objects} +} +\codepar +\comment{This entry goes in the `acronym' glossary:} +\gls{newacronym}\marg{svm}\marg{svm}\marg{support vector machine} +\codepar +\gls{newglossaryentry}\marg{not:set} +\marg{\comment{This entry goes in the `notation' glossary:} + \gloskeyval{type}{notation}, + \gloskeyval{name}{\cmd{ensuremath}\marg{\cmd{mathcal}\marg{S}}}, + \gloskeyval{description}{A set}, + \gloskeyval{sort}{S}} +\end{codebox} +or if you don't like using \csfmt{ensuremath}: +\begin{codebox} +\gls{newglossaryentry}\marg{not:set} +\marg{\comment{This entry goes in the `notation' glossary:} + \gloskeyval{type}{notation}, + \gloskeyval{name}{\$\cmd{mathcal}\marg{S}\$}, + \gloskeyval{text}{\cmd{mathcal}\marg{S}}, + \gloskeyval{description}{A set}, + \gloskeyval{sort}{S} +} +\end{codebox} Each glossary is displayed using: -\begin{definition} -\cs{printnoidxglossary}[type=\meta{type}] -\end{definition} -(\opt1) or -\begin{definition} -\cs{printglossary}[type=\meta{type}] -\end{definition} -(\optsand23). Where \meta{type} is the glossary label. If the +\begin{compactcodebox*} +\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\meta{type}}} +\end{compactcodebox*} +(\option{noidx}) or +\begin{compactcodebox*} +\gls{printglossary}\oarg{\printglossoptval{type}{\meta{type}}} +\end{compactcodebox*} +(\options{mkidx,xdy}). Where \meta{type} is the glossary label. If the type is omitted the default \code{main} glossary is assumed. If you're using \app{bib2gls} then each glossary is displayed using: -\begin{definition} -\cs{printunsrtglossary}[type=\meta{type}] -\end{definition} -With this method you don't use \cs{makeglossaries} or -\cs{makenoidxglossaries}. Instead you can assign the entry type +\begin{compactcodebox*} +\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\meta{type}}} +\end{compactcodebox*} +With this method you don't use \gls{makeglossaries} or +\gls{makenoidxglossaries}. Instead you can assign the entry type with the resource command. For example: -\begin{verbatim} - \usepackage[record,abbreviations,symbols]{glossaries-extra} - - \GlsXtrLoadResources[ - src={terms}, % entries defined in terms.bib - type={main}% put in main glossary - ] - \GlsXtrLoadResources[ - src={abbrvs}, % entries defined in abbrvs.bib - type={abbreviations}% put in abbreviations glossary - ] - \GlsXtrLoadResources[ - src={syms}, % entries defined in syms.bib - type={symbols}% put in symbols glossary - ] -\end{verbatim} +\begin{codebox*} +\cmd{usepackage}[\opt{record},\opt{abbreviations},\opt{symbols}]\marg{glossaries-extra} +\codepar +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{terms}, \comment{entries defined in terms.bib} + \resourceoptval{type}{main}\comment{put in main glossary} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{abbrvs}, \comment{entries defined in abbrvs.bib} + \resourceoptval{type}{abbreviations}\comment{put in abbreviations glossary} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{syms}, \comment{entries defined in syms.bib} + \resourceoptval{type}{symbols}\comment{put in symbols glossary} +} +\end{codebox*} Later in the document: -\begin{verbatim} - \printunsrtglossary % main - \printunsrtglossary[type=abbreviations] - \printunsrtglossary[type=symbols] -\end{verbatim} +\begin{codebox*} +\gls{printunsrtglossary} \comment{main} +\gls{printunsrtglossary}\oarg{\printglossoptval{type}{abbreviations}} +\gls{printunsrtglossary}\oarg{\printglossoptval{type}{symbols}} +\end{codebox*} There's a~convenient shortcut that will display all the defined glossaries depending on the indexing method: -\begin{definition} -\cs{printnoidxglossaries} -\end{definition} -(\opt1) or -\begin{definition} -\cs{printglossaries} -\end{definition} -(\optsand23) or (\sty{glossaries-extra} only) -\begin{definition} -\cs{printunsrtglossaries} -\end{definition} - -If you use \opt1, you don't need to do anything else. If you use -\optsor23 with the \app{makeglossaries} Perl script or the +\cmddef{printnoidxglossaries} +(\option{noidx}) or +\cmddef{printglossaries} +(\options{mkidx,xdy}) or (\sty{glossaries-extra} only) +\cmddef{printunsrtglossaries} + +If you use \optionsor{noidx,b2g}, you don't need to do anything different +for a document with multiple \idxpl{glossary}. If you use +\optionsor{mkidx,xdy} with the \app{makeglossaries} Perl script or the \app{makeglossaries-lite} Lua script, you -similarly don't need to do anything else. If you use \optsor23 -without the \app{makeglossaries} Perl script or -\app{makeglossaries-lite} Lua script then you need to -make sure you run \app{makeindex}\slash\app{xindy} \emph{for -each defined glossary}. The \meta{gls} and \meta{glo} arguments of -\cs{newglossary} specify the file extensions to use instead of -\file{.gls} and \file{.glo}. The optional argument \meta{glg} is -the file extension for the transcript file. This should be different -for each glossary in case you need to check for -\app{makeindex}\slash\app{xindy} errors or warnings if things -go wrong. +similarly don't need to do anything different to the document build +(compared to building a document with only one \idx{glossary}). + +If you use \optionsor{mkidx,xdy} without the \app{makeglossaries} +Perl script or \app{makeglossaries-lite} Lua script then you need to +make sure you run \app{makeindex}\slash\app{xindy} \emph{for each +defined glossary}. The \meta{gls} and \meta{glo} arguments of +\gls{newglossary} specify the file extensions to use instead of +\ext+{gls} and \ext+{glo}. The optional argument \meta{glg} is the +file extension for the transcript file. This should be different for +each glossary in case you need to check for +\app{makeindex}\slash\app{xindy} errors or warnings if things go +wrong. For example, suppose you have three glossaries in your document (\code{main}, \code{acronym} and \code{notation}), specified using: -\begin{verbatim} -\usepackage[acronyms]{glossaries} -\newglossary[nlg]{notation}{not}{ntn}{Notation} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{acronyms}]\marg{glossaries} +\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation} +\end{codebox} Then (assuming your \LaTeX\ document is in a~file called -\file{myDoc.tex}): +\filefmt{myDoc.tex}): \begin{description} -\item\opt2 +\item\option{mkidx}: Either use one \app{makeglossaries} or \app{makeglossaries-lite} call: -\begin{verbatim} +\begin{terminal} makeglossaries myDoc -\end{verbatim} +\end{terminal} or -\begin{verbatim} +\begin{terminal} makeglossaries-lite myDoc -\end{verbatim} +\end{terminal} Or you need to run \app{makeindex} three times: -\begin{verbatim} +\begin{terminal} makeindex -t myDoc.glg -s myDoc.ist -o myDoc.gls myDoc.glo makeindex -t myDoc.alg -s myDoc.ist -o myDoc.acr myDoc.acn makeindex -t myDoc.nlg -s myDoc.ist -o myDoc.not myDoc.ntn -\end{verbatim} +\end{terminal} -\item\opt3 +\item\option{xdy}: Either use one \app{makeglossaries} call: -\begin{verbatim} +\begin{terminal} makeglossaries myDoc -\end{verbatim} +\end{terminal} Or you need to run \app{xindy} three times (be careful not to insert line breaks where the line has wrapped.) -\begin{verbatim} -xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg --o myDoc.gls myDoc.glo -xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg --o myDoc.acr myDoc.acn -xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.nlg --o myDoc.not myDoc.ntn -\end{verbatim} - -\item\opt4 +\begin{terminal} +xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo +xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn +xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.nlg -o myDoc.not myDoc.ntn +\end{terminal} + +\item\option{b2g}: With \app{bib2gls} only one call is required: -\begin{verbatim} +\begin{terminal} pdflatex myDoc -bib2gls --group myDoc +bib2gls \switch{group} myDoc pdflatex myDoc -\end{verbatim} -(Omit \verb|--group| if you don't need letter groups.) +\end{terminal} +(Omit \switch{group} if you don't need letter groups.) \end{description} - -\section[glossaries and hyperref]{\styfmt{glossaries} and \styfmt{hyperref}} +\section{Hyperlinks (\stytext{glossaries} and \stytext{hyperref})} \label{sec:hyperref} Take care if you use the \sty{glossaries} package with \sty{hyperref}. Contrary to the usual advice that \sty{hyperref} should be loaded last, \sty{glossaries} (and \sty{glossaries-extra}) must be loaded \emph{after} \sty{hyperref}: -\begin{verbatim} -\usepackage[colorlinks]{hyperref} -\usepackage{glossaries} -\end{verbatim} -If you use \sty{hyperref} make sure you use PDF\LaTeX\ rather than +\begin{codebox} +\cmd{usepackage}[colorlinks]\marg{hyperref} +\cmd{usepackage}\marg{glossaries} +\end{codebox} +If you use \sty{hyperref} make sure you use \pdfLaTeX\ rather than the \LaTeX\ to DVI engine. The DVI format can't break hyperlinks across a~line so long glossary entries (such as the full form of acronyms) won't line wrap with the DVI engine. Also, hyperlinks in sub- or superscripts aren't correctly sized with the DVI format. By default, if the \sty{hyperref} package has been loaded, commands -like \cs{gls} will form a~hyperlink to the relevant entry in the -glossary. If you want to disable this for \emph{all} your +like \gls{gls} will form a~hyperlink to the relevant entry in the +\idx{glossary}. If you want to disable this for \emph{all} your glossaries, then use: -\begin{definition} -\cs{glsdisablehyper} -\end{definition} +\cmddef{glsdisablehyper} If you want hyperlinks suppressed for entries in specific -glossaries, then use the \pkgopt{nohypertypes} package option. For +glossaries, then use the \opt{nohypertypes} package option. For example, if you don't want hyperlinks for entries in the \code{acronym} and \code{notation} glossaries but you do want them for entries in the \code{main} glossary, then do: -\begin{verbatim} -\usepackage[colorlinks]{hyperref} -\usepackage[acronym,nohypertypes={acronym,notation}]{glossaries} -\newglossary[nlg]{notation}{not}{ntn}{Notation} -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[colorlinks]\marg{hyperref} +\cmd{usepackage}[\opt{acronym},\optvalm{nohypertypes}{acronym,notation}]\marg{glossaries} +\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation} +\end{codebox} If you want the hyperlinks suppressed the first time an entry is used, but you want hyperlinks for subsequence references then use -the \pkgopt[false]{hyperfirst} package option: -\begin{verbatim} -\usepackage[colorlinks]{hyperref} -\usepackage[hyperfirst=false]{glossaries} -\end{verbatim} +the \optval{hyperfirst}{false} package option: +\begin{codebox} +\cmd{usepackage}[colorlinks]\marg{hyperref} +\cmd{usepackage}[\optval{hyperfirst}{false}]\marg{glossaries} +\end{codebox} The \sty{glossaries-extra} extension package provides another method using category attributes. See the \sty{glossaries-extra} user manual for further details. @@ -1999,132 +3030,137 @@ manual for further details. Take care not to use non-expandable commands in PDF bookmarks. This isn't specific to the \sty{glossaries} package but is a~limitation of PDF bookmarks. Non-expandable commands include commands like -\cs{gls}, \cs{glspl}, \cs{Gls} and \cs{Glspl}. The \sty{hyperref} +\gls{gls}, \gls{glspl}, \gls{Gls} and \gls{Glspl}. The \sty{hyperref} package provides a~way of specifying alternative text for the PDF -bookmarks via \cs{texorpdfstring}. For example: -\begin{verbatim} -\section{The \texorpdfstring{\gls{fishage}}{Fish Age}} -\end{verbatim} -However, it's not a~good idea to use commands like \cs{gls} in +bookmarks via \gls{texorpdfstring}. For example: +\begin{codebox} +\cmd{section}\marg{The \gls{texorpdfstring}\marg{\gls{gls}\marg{fishage}}\marg{Fish Age}} +\end{codebox} +However, it's not a~good idea to use commands like \gls{gls} in a~section heading as you'll end up with the table of contents page in -your location list. Instead you can use -\begin{definition} -\cs{glsentrytext}\marg{label} -\end{definition} -This is expandable provided that the \code{text} key doesn't +your location list and it will unset the \idx{firstuseflag} too soon. +Instead you can use +\cmddef{glsentrytext} +This is expandable provided that the \gloskey{text} key doesn't contain non-expandable code. For example, the following works: -\begin{verbatim} -\section{The \glsentrytext{fishage}} -\end{verbatim} +\begin{codebox} +\cmd{section}\marg{The \gls{glsentrytext}\marg{fishage}} +\end{codebox} and it doesn't put the table of contents in the location list. If you use \sty{glossaries-extra} then use the commands that are provided specifically for use in section headers. For example: -\begin{verbatim} -\section{The \glsfmttext{fishage}} -\end{verbatim} +\begin{codebox*} +\cmd{section}\marg{The \gls{glsfmttext}\marg{fishage}} +\end{codebox*} \section{Cross-References} \label{sec:xr} You can add a~reference to another entry in a~location list using -the \code{see=}\marg{label list} key when you define an entry. +the \gloskeyval{see}{\meta{label-list}} key when you define an entry. The referenced entry (or entries) must also be defined. For example: -\begin{verbatim} -\longnewglossaryentry{devonian}{name={Devonian}}% -{% +\begin{codebox} +\gls{longnewglossaryentry}\marg{devonian}\marg{\gloskeyval{name}{Devonian}}\comment{} +\marg{\comment{} The geologic period spanning from the end of the Silurian Period to the beginning of the Carboniferous Period. - +\codepar This age was known for its remarkable variety of fish species. } - -\newglossaryentry{fishage} -{ - name={Fish Age}, - description={Common name for the Devonian period}, - see={devonian} +\codepar +\gls{newglossaryentry}\marg{fishage} +\marg{ + \gloskeyval{name}{Fish Age}, + \gloskeyval{description}{Common name for the Devonian period}, + \gloskeyval{see}{devonian} } -\end{verbatim} +\end{codebox} The cross-reference will appear as \qt{\emph{see} Devonian}. You can -change the \qt{see} tag using the format -\code{see=}\oarg{tag}\meta{label}. For example: -\begin{verbatim} -\newglossaryentry{latinalph} -{ - name={Latin alphabet}, - description={alphabet consisting of the letters - a, \ldots, z, A, \ldots, Z}, - see=[see also]{exlatinalph} +change the \qt{see} tag for an individual entry using the format +\gloskeyval{see}{\oargm{tag}\meta{label-list}}. For example: +\begin{codebox} +\gls{newglossaryentry}\marg{latinalph} +\marg{ + \gloskeyval{name}{Latin alphabet}, + \gloskeyval{description}{alphabet consisting of the letters + a, \cmd{ldots}, z, A, \cmd{ldots}, Z}, + \gloskey{see}=[see also]\marg{exlatinalph} } -\newglossaryentry{exlatinalph} -{ - name={extended Latin alphabet}, - description={The Latin alphabet extended to include +\gls{newglossaryentry}\marg{exlatinalph} +\marg{ + \gloskeyval{name}{extended Latin alphabet}, + \gloskeyval{description}{The Latin alphabet extended to include other letters such as ligatures or diacritics.} } -\end{verbatim} -If you use the \code{see} key in the optional argument of -\cs{newacronym}, make sure you enclose the value in braces. For -example: -\begin{verbatim} -\newacronym{ksvm}{ksvm}{kernel support vector machine} -\newacronym - [see={[see also]{ksvm}}] - {svm}{svm}{support vector machine} -\end{verbatim} -The \sty{glossaries-extra} package provides a \code{seealso} +\end{codebox} +In the above, I haven't enclosed the entire value of the +\gloskey{see} key in braces. +If you use the \gloskey{see} key in an optional argument, such as +the optional argument of \gls{newacronym}, make sure you enclose the +value (including the optional tag) in braces. For example: +\begin{codebox} +\gls{newacronym}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine} +\gls{newacronym} + \oarg{\gloskeyval{see}{[see also]\marg{ksvm}}} + \marg{svm}\marg{svm}\marg{support vector machine} +\end{codebox} +The \sty{glossaries-extra} package provides a \gloskey{seealso} key. This doesn't allow a tag but behaves much like -\code{see=\{[\cs{seealsoname}]\marg{label}\}}. For example: -\begin{verbatim} -\newabbreviation{ksvm}{ksvm}{kernel support vector machine} -\newabbreviation - [seealso={ksvm}] - {svm}{svm}{support vector machine} -\end{verbatim} +\gloskeyval{see}{[\gls{seealsoname}]\margm{label-list}}. For example: +\begin{codebox} +\gls{newabbreviation}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine} +\gls{newabbreviation} + \oarg{\gloskeyval{seealso}{ksvm}} + \marg{svm}\marg{svm}\marg{support vector machine} +\end{codebox} Since the cross-reference appears in the location list, if you -suppress the location list using the \pkgopt{nonumberlist} package +suppress the location list using the \opt{nonumberlist} package option, then the cross-reference will also be suppressed. With -\app{bib2gls}, don't use the \pkgopt{nonumberlist} package -option. Instead use the \code{save-locations=false} in the resource +\app{bib2gls}, don't use the \opt{nonumberlist} package +option. Instead use \resourceoptval{save-locations}{false} in the resource options. For example: -\begin{verbatim} -\usepackage[record,abbreviations,symbols]{glossaries-extra} - -\GlsXtrLoadResources[ - src={terms}, % entries defined in terms.bib - type={main}% put in main glossary -] -\GlsXtrLoadResources[ - src={abbrvs}, % entries defined in abbrvs.bib - type={abbreviations},% put in abbreviations glossary - save-locations=false% no number list for these entries -] -\GlsXtrLoadResources[ - src={syms}, % entries defined in syms.bib - type={symbols}% put in symbols glossary -] -\end{verbatim} +\begin{codebox} +\cmd{usepackage}[\opt{record},\opt{abbreviations},\opt{symbols}]\marg{glossaries-extra} +\codepar +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{terms}, \comment{entries defined in terms.bib} + \resourceoptval{type}{main}\comment{put in main glossary} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{abbrvs}, \comment{entries defined in abbrvs.bib} + \resourceoptval{type}{abbreviations},\comment{put in abbreviations glossary} + \resourceoptval{save-locations}{false}\comment{no number list for these entries} +} +\gls{GlsXtrLoadResources}\oarg{ + \resourceoptvalm{src}{syms}, \comment{entries defined in syms.bib} + \resourceoptval{type}{symbols}\comment{put in symbols glossary} +} +\end{codebox} \section{Further Information} \label{sec:moreinfo} \begin{itemize} -\item \href{http://mirrors.ctan.org/support/bib2gls/bib2gls-begin.pdf}{\styfmt{glossaries-extra} +\item \ctanmirrordocnofn{support/bib2gls/bib2gls-begin}{\styfmt{glossaries-extra} and \appfmt{bib2gls}: an introductory guide}. \item The main \sty{glossaries} \docref{user manual}{glossaries-user}. -\item The \href{http://www.dickimaw-books.com/faqs/glossariesfaq.html}{glossaries FAQ}. -\item \href{https://www.dickimaw-books.com/latex/buildglossaries/}{Incorporating +\item The \dickimawhrefnofn{faqs/glossariesfaq.html}{glossaries FAQ}. +\item \dickimawhrefnofn{latex/buildglossaries/}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build}. \item The \href{https://ctan.org/pkg/glossaries-extra}{\styfmt{glossaries-extra}} package. \item The \href{https://ctan.org/pkg/bib2gls}{\appfmt{bib2gls}} application. \end{itemize} -The \href{https://www.dickimaw-books.com/gallery}{Dickimaw Books -Gallery} provides additional example documents. +The \gallery{Dickimaw Books Gallery} provides additional example documents. + +\printterms +\printsummary +\printuserguideindex + \end{document} diff --git a/macros/latex/contrib/glossaries/glossary2glossaries.html b/macros/latex/contrib/glossaries/glossary2glossaries.html index 747c533b00..6024b43dfb 100644 --- a/macros/latex/contrib/glossaries/glossary2glossaries.html +++ b/macros/latex/contrib/glossaries/glossary2glossaries.html @@ -1,1897 +1,904 @@ - - - - - - - - - - - - - -

-

- - - -

- - - -

-
-

-

Upgrading from the glossary package to the -glossaries package -

-
Nicola L.C. Talbot
-
-

2021-11-01

-
-

-Abstract -

-

The purpose of this document is to provide advice if you want to convert - a LaTeX document from using the obsolete glossary package to the - replacement glossaries package. -

-
-

Contents

- -

-

-

Top

1 Why the Need for a New Package?

-

The glossary package started out as an example in a tutorial, but I decided that I -may as well package it up and upload it to CTAN. Unfortunately it was fairly rigid -and unable to adapt well to the wide variation in glossary styles. Users began making -requests for enhancements, but with each enhancement the code became more -complicated and bugs crept in. Each fix in one place seemed to cause another -problem elsewhere. In the end, it was taking up too much of my time to maintain, so -I decided to replace it with a much better designed package. With the new glossaries -package: -

-
    -
  • -

    you can define irregular plurals; -

  • -
  • -

    glossary terms can have an associated symbol in addition to the name and - description; -

  • -
  • -

    new glossary styles are much easier to design; -

  • -
  • -

    you can add dictionaries to supply translations for the fixed names used - in headings and by some of the glossary styles; - - - -

  • -
  • -

    you can choose1 - between using makeindex or xindy to sort the glossary. Using xindy means - that: -

    -
      -
    • -

      there is much better support for terms containing accented or - non-Latin characters; -

    • -
    • -

      there is support for non-standard location numbers;

    -
  • -
  • -

    you don’t need to remember to escape makeindex’s special characters as this is - done internally; -

  • -
  • -

    hierarchical entries and homographs are - supported;2 -

  • -
  • -

    there is better support for cross-referencing glossary entries; -

  • -
  • -

    acronyms are just another glossary term which helps to maintain consistency; -

  • -
  • -

    different acronym styles are supported. -

    -
- - - -

-

-

Top

2 Package Options

-

When converting a document that currently uses the obsolete glossary package to the -replacement glossaries package, it should be fairly obvious that the first thing you -need to do is replace \usepackage{glossary} with \usepackage{glossaries}, -however some of the package options are different, so you may need to change those -as well. Table 1 shows the mappings from the glossary to the glossaries package -options. -

-
- - - -


- - - -
Table 1: Mappings from glossary to glossaries package options
-
-

-

-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
glossary option glossaries option
style=list style=list
style=altlist style=altlist
style=long,header=none,border=none,cols=2 style=long
style=long,header=plain,border=none,cols=2 style=longheader
style=long,header=none,border=plain,cols=2 style=longborder
style=long,header=plain,border=plain,cols=2 style=longheaderborder
style=long,header=none,border=none,cols=3 style=long3col
style=long,header=plain,border=none,cols=3 style=long3colheader
style=long,header=none,border=plain,cols=3 style=long3colborder
style=long,header=plain,border=plain,cols=3 style=long3colheaderborder
style=super,header=none,border=none,cols=2 style=super
style=super,header=plain,border=none,cols=2style=superheader
style=super,header=none,border=plain,cols=2style=superborder
style=super,header=plain,border=plain,cols=2style=superheaderborder
style=super,header=none,border=none,cols=3 style=super3col
style=super,header=plain,border=none,cols=3style=super3colheader
style=super,header=none,border=plain,cols=3style=super3colborder
style=super,header=plain,border=plain,cols=3style=super3colheaderborder
number=none nonumberlist
number=⟨counter namecounter=⟨counter name
toc toc
hypertoc toc
hyper no corresponding option
section=true section
section=false no corresponding option
acronym acronym
global no corresponding option
-
- - - -

-
-

Top

3 Defining new glossary types

-

If you have created new glossary types, you will need to replace all instances -of -


glossary - \newglossarytype[log-ext]{type}{out-ext}{in-ext}[old style -list]
-
\newcommand{\typename}{title} -

-
-with -


glossaries - \newglossary[log-ext]{type}{out-ext}{in-ext}{title} -

-
-in the preamble, and, if the new glossary requires a different style to the main -(default) glossary, you will also need to put -


glossaries - \setglossarystyle{new style} -

-
-immediately before the glossary is displayed, or you can specify the style when you -display the glossary using \printglossary (see below). -

The ⟨old style list⟩ optional argument can be converted to ⟨new style⟩ using the same -mapping given in Table 1. -

For example, if your document contains the following: - - - -

-
-\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header]
-\newcommand{\notationname}{Index of Notation}
-
-

You will need to replace the above two lines with: - - - -

-
-\newglossary[nlg]{notation}{not}{ntn}{Index of Notation}
-
-

in the preamble and - - - -

-
-\setglossarystyle{longheader}
-
-

immediately prior to displaying this glossary. Alternatively, you can specify the -style using the style key in the optional argument of \printglossary. For -example: - - - -

-
-\printglossary[type=notation,style=longheader]
-
-

-

Note that the glossary title is no longer specified using \glossary-typename (except -for \glossaryname and \acronymname) but is instead specified in the ⟨title⟩ argument -of \newglossary. The short title which is specified in the glossary package by the -command \shortglossary-namename is now specified using the toctitle key in the -optional argument to \printglossary. -

-

-

Top

4 \makeglossary name

-

All instances of \makeglossary name⟩ (e.g. \makeglossary and \makeacronym) -should be replaced by the single command \makeglossaries. For example, if your -document contained the following: - - - -

-
-\makeglossary
-\makeacronym
-
-

then you should replace both lines with the single line: - - - -

-
-\makeglossaries
-
-

-

-

-

Top

5 Storing glossary information

-

With the old glossary package you could optionally store glossary information for later -use, or you could simply use \glossary whenever you wanted to add information to -the glossary. With the new glossaries package, the latter option is no longer -available.3 -If you have stored all the glossary information using \storeglosentry, then you will -need to convert these commands into the equivalent \newglossaryentry. If you have -only used \glossary, then see §6.4 \glossary. -

Substitute all instances of -


glossary - \storeglosentry{label}{gls-entry} -

-
-with -


glossaries - \newglossaryentry{label}{gls-entry} -

-
-This should be fairly easy to do using the search and replace facility in your editor -(but see notes below). -

If you have used the optional argument of \storeglosentry (i.e. you have -multiple glossaries) then you will need to substitute -


glossary - \storeglosentry[gls-type]{label}{gls-entry} -

-
-with -


glossaries - \newglossaryentry{label}{gls-entry,type=gls-type} -

- - - -
-

The glossary entry information ⟨gls-entry⟩ may also need changing. If ⟨gls-entry⟩ -contains any of makeindex’s special characters (i.e. @ ! " or |) then they should no -longer be escaped with " since the glossaries package deals with these characters -internally. For example, if your document contains the following: - - - -

-
-\storeglosentry{card}{name={$"|\mathcal{S}"|$},
-description={The cardinality of the set $\mathcal{S}$}}
-
-

then you will need to replace it with: - - - -

-
-\newglossaryentry{card}{name={$|\mathcal{S}|$},
-description={The cardinality of the set $\mathcal{S}$}}
-
-

-

The format and number keys available in \storeglosentry are not available with -\newglossaryentry. -

-

-

Top

6 Adding an entry to the glossary

-

The glossary package provided two basic means to add information to the glossary: -firstly, the term was defined using \storeglosentry and the entries for that term -were added using \useglosentry, \useGlosentry and \gls. Secondly, the term was -added to the glossary using \glossary. This second approach is unavailable with the -glossaries package. -

-

-

Top

6.1 \useglosentry

-

The glossary package allows you to add information to the glossary for a predefined -term without producing any text in the document using -


glossary - \useglosentry[old options]{label} -

-
-Any occurrences of this command will need to be replaced with -


glossaries - \glsadd[new options]{label} -

-
-The format key in ⟨old options⟩ remains the same in ⟨new options⟩. However the -number=counter name⟩ key in ⟨old options⟩ should be replaced with counter=counter -name⟩ in ⟨new options⟩. - - - -

-

-

Top

6.2 \useGlosentry

-

The glossary package allows you to add information to the glossary for a predefined -term with the given text using -


glossary - \useGlosentry[old options]{label}{text} -

-
-Any occurrences of this command will need to be replaced with -


glossaries - \glslink[new options]{label}{text} -

-
-The mapping from ⟨old options⟩ to ⟨new options⟩ is the same as that given -§6.1 \useglosentry. -

-

-

Top

6.3 \gls

-

Both the glossary and the glossaries packages define the command \gls. In this -case, the only thing you need to change is the number key in the optional -argument to counter. Note that the new form of \gls also takes a final optional -argument which can be used to insert text into the automatically generated -text. -

-

-

Top

6.4 \glossary

-

When using the glossaries package, you should not use \glossary -directly.4 -If, with the old package, you have opted to explicitly use \glossary instead of storing -the glossary information with \storeglosentry, then converting from glossary to -glossaries will be more time-consuming, although in the end, I hope you will see the -benefits.5 -If you have used \glossary with the old glossary package, you will instead need to -define the relevant glossary terms using \newglossaryentry and reference the terms -using \glsadd, \glslink, \gls etc. -

If you don’t like the idea of continually scrolling back to the preamble to type all -your \newglossaryentry commands, you may prefer to create a new file, in which to -store all these commands, and then input that file in your document’s preamble. - - - -Most text editors and front-ends allow you to have multiple files open, and you can -tab back and forth between them. -

-

-

Top

7 Acronyms

-

In the glossary package, acronyms were treated differently to glossary entries. This -resulted in inconsistencies and sprawling unmaintainable code. The new glossaries -package treats acronyms in exactly the same way as normal glossary terms. In fact, in -the glossaries package, the default definition of: -


glossaries - \newacronym[options]{label}{abbrv}{long} -

-
-is a shortcut for: -


glossaries - \newglossaryentry{label}{type=\acronymtype, -
name={abbrv}, -
description={long}, -
text={abbrv}, -
first={long(abbrv)}, -
plural={abbrvs}, -
firstplural={longs (abbrvs)}, -
options} -

-
-

This is different to the glossary package which set the name key to ⟨long⟩ -(⟨abbrv⟩) and allowed you to set a description using the description key. If -you still want to do this, you can use one of the description styles, such as -long-short-desc, and use the description key in the optional argument of -\newacronym. -

For example, if your document originally had the following: - - - -

-
-\newacronym{SVM}{Support Vector Machine}{description=Statistical
-pattern recognition technique}
-
-

Then you would need to first set the style: - - - -

-
-\setacronymstyle{long-short-desc}
-
-

and change the acronym definition to: - - - -

-
-\newacronym[description=Statistical pattern recognition
-technique]{svm}{SVM}{Support Vector Machine}
-
-

You can then reference the acronym using any of the new referencing commands, -such as \gls or \glsadd. -

With the old glossary package, when you defined an acronym, it also defined a -command \acr-name⟩ which could be used to display the acronym in the text. -So the above SVM example would create the command \SVM with the old -package. In the new glossaries package, the acronyms are just another type of -glossary entry, so they are displayed using \gls{label}. Therefore, in the -above example, you will also need to replace all occurrences of \SVM with -\gls{svm}. -

If you have used \useacronym instead of \acr-name⟩, then you will need to -replace all occurrences of -


glossary - \useacronym[insert]{acr-name} -

-
-with -


glossaries - \gls{label}[insert] -

-
-Note that the starred versions of \useacronym and \acr-name⟩ (which make the first -letter uppercase) should be replaced with \Gls{label}. -

Alternatively (as from v1.18 of the glossaries package), you can use \oldacronym -which uses the same syntax as the old glossary package’s \newacronym and -also defines \acr-name⟩. For example, if your document originally had the -following: -


glossary - - - -
-

\newacronym{SVM}{Support Vector Machine}{description=Statistical -

pattern recognition technique} - -

-

-


-

-then you can change this to: -


glossaries - - - -
-

\oldacronym{SVM}{Support Vector Machine}{description=Statistical -

pattern recognition technique} - -

-

-


-

-You can then continue to use \SVM. However, remember that LaTeX generally -ignores spaces after command names that consist of alphabetical characters. You will -therefore need to force a space after \acr-name⟩, unless you also load the xspace -package. (See Acronyms of the glossaries documentation for further details.) Note -that \oldacronym uses its first argument to define the acronym’s label (as used by -commands like \gls), so in the above example, with the new glossaries package, -\SVM becomes a shortcut for \gls{SVM} and \SVM* becomes a shortcut for -\Gls{SVM}. -

-

-

Top

7.1 \acrln and \acrsh

-

In the glossary package, it is possible to produce the long and short forms of an -acronym without adding an entry to the glossary using \acrln and \acrsh. With the -glossaries package (provided you defined the acronym using \newacronym or -\oldacronym and provided you haven’t redefined \newacronym) you can -replace -


glossary - \acrsh{acr-name} -

-
-with -


glossaries - \acrshort{label} -

-
-and you can replace -


glossary - \acrln{acr-name} -

- - - -
-with -


glossaries - \acrlong{label} -

-
-The glossaries package also provides the related commands \acrshortpl (plural short -form) and \acrlongpl (plural long form) as well as upper case variations. If you use -the glossaries “shortcuts” package option, you can use \acs in place of \acrshort -and \acl in place of \acrlong. -

See Acronyms of the glossaries manual for further details of how to use these -commands. -

-

-

Top

7.2 \ifacronymfirstuse

-

The glossary package command -


glossary - \ifacronymfirstuse{acr-name}{text1}{text2} -

-
-can be replaced by the glossaries command: -


glossaries - \ifglsused{label}{text2}{text1} -

-
-Note that \ifglsused evaluates the opposite condition to that of \ifacronymfirstuse -which is why the last two arguments have been reversed. -

-

-

Top

7.3 \resetacronym and \unsetacronym

-

The glossary package allows you to reset and unset the acronym flag which is used to -determine whether the acronym has been used in the document. The glossaries -package also provides a means to do this on either a local or a global level. To reset -an acronym, you will need to replace: -


glossary - \resetacronym{acr-name} -

- - - -
-with either -


glossaries - \glsreset{label} -

-
-or -


glossaries - \glslocalreset{label} -

-
-

To unset an acronym, you will need to replace: -


glossary - \unsetacronym{acr-name} -

-
-with either -


glossaries - \glsunset{label} -

-
-or -


glossaries - \glslocalunset{label} -

-
-

To reset all acronyms, you will need to replace: -


glossary - \resetallacronyms -

-
-with -


glossaries - \glsresetall[\acronymtype] -

-
- - - -or -


glossaries - \glslocalresetall[\acronymtype] -

-
-To unset all acronyms, you will need to replace: -


glossary - \unsetallacronyms -

-
-with -


glossaries - \glsunsetall[\acronymtype] -

-
-or -


glossaries - \glslocalunsetall[\acronymtype] -

-
-

-

-

Top

8 Displaying the glossary

-

The glossary package provides the command \printglossary (or \printtype⟩ for -other glossary types) which can be used to print individual glossaries. The glossaries -package provides the command \printglossaries which will print all the glossaries -which have been defined, or \printglossary[options] to print individual glossaries. -So if you just have \printglossary, then you can leave it as it is, but if you have, -say: - - - -

-
-\printglossary
-\printglossary[acronym]
-
-

or - - - -

-
-\printglossary
-\printacronym
-
-

then you will need to replace this with either - - - -

-
-\printglossaries
-
-

or - - - -

-
-\printglossary
-\printglossary[type=\acronymtype]
-
-

-

The glossary package allows you to specify a short title (for the table of contents -and page header) by defining a command of the form \shortglossary-typename. The -glossaries package doesn’t do this, but instead provides the toctitle key which can be -used in the optional argument to \printglossary. For example, if you have created -a new glossary type called notation, and you had defined - - - -

-
-\newcommand{\shortnotationname}{Notation}
-
-

then you would need to use the toctitle key: - - - -

-
-\printglossary[type=notation,toctitle=Notation]
-
-

The glossaries package will ignore \shortnotationname, so unless you have used it -elsewhere in the document, you may as well remove the definition. -

-

-

Top

9 Processing Your Document

-

If you convert your document from using the glossary package to the glossaries -package, you will need to delete any of the additional files, such as the .glo file, that -were created by the glossary package, as the glossaries package uses a different format. -Remember also, that if you used the makeglos Perl script, you will need to use the -makeglossaries Perl script instead. As from v1.17, the glossaries package can -be used with either makeindex or xindy. Since xindy was designed to be -multilingual, the new glossaries package is a much better option for non-English -documents. If you use the extension package, glossaries-extra, then you also -have the option of using bib2gls instead (which also provides multilingual -support). -

For further information on using makeglossaries, makeindex or xindy to create -your glossaries, see Generating the Associated Glossary Files of the glossaries -documentation. -

-

-

Top

10 Troubleshooting

-

Please check the FAQ for the glossaries package if you have any problems. -

-

-

Index

-

B -

-
bib2gls  1
-

F - - - -file types
-    .glo  2
-

G -glossaries-extra package  3
-\gls options
-    counter  4
-    number  5
-\glsadd options
-    counter  6
-

M -makeglos  7
-makeglossaries  8, 9
-makeindex  10, 11, 12, 13, 14, 15, 16, 17, 18
-

N -\newglossaryentry options
-    description  19, 20
-    name  21
-

P -\printglossary options
-    style  22
-    toctitle  23, 24, 25
-

S -\storeglosentry options
-    format  26
-    number  27
-

U -\useglosentry options
-    format  28
-    number  29
-

X -xindy  30, 31, 32, 33, 34, 35, 36
- - - -

-

1as from v1.17. Previous versions were designed to be used with makeindex only

-

2as from v1.17

3mainly because having a key value list in \glossary caused problems, but it also helps -consistency.

-

4This is because \glossary requires the argument to be in a specific format and doesn’t use -the key=valueformat that the old glossary package used. The new package’s internal commands set -this format, as well as escaping any of makeindex’s or xindy’s special characters. What’s more, the -format has changed as from v1.17 to allow the new package to be used with either makeindex or -xindy.

-

5From the user’s point of view, using \glossary throughout the document is time consuming, -and if you use it more than once for the same term, there’s a chance extra spaces may creep in which -will cause makeindex to treat the two entries as different terms, even though they look the same in -the document.

- - - - - - + + + + + + + + + Upgrading from the glossary package to the glossaries +package + + + +
+
Upgrading from the glossary package to the glossaries package
Nicola L.C. Talbot
2022-10-14

+

+ +

Abstract
+ The purpose of this document is to provide advice if you want to convert a LaTeX document from using the obsolete glossary package to the replacement glossaries package. The final version of the glossary package is 2.4 (2006-07-20). It was made obsolete after the release of glossaries v1.0 (2007-05-16).
+

+For the main glossaries user guide, see glossaries-user.pdf.

texdoc glossaries-user
For a shorter guide for beginners, see glossariesbegin.pdf.
texdoc glossariesbegin

+

+ + + +

+

1. Why the Need for a New Package?

+

+The glossary package started out as an example in a tutorial, but I decided that I may as well package it up and upload it to CTAN. Unfortunately it was fairly rigid and unable to adapt well to the wide variation in glossary styles. Users began making requests for enhancements, but with each enhancement the code became more complicated and bugs crept in. Each fix in one place seemed to cause another problem elsewhere. In the end, it was taking up too much of my time to maintain, so I decided to replace it with a much better designed package. With the new glossaries package:

+ +

    +
  • you can define irregular plurals;

    +

  • glossary terms can have an associated symbol in addition to the name and description;

    +

  • new glossary styles are much easier to design;

    +

  • you can add dictionaries to supply translations for the fixed names used in headings and by some of the glossary styles;

    +

  • you can choose between using makeindex or xindy to sort the glossary. Using xindy means that:

    + +

      +
    • there is much better support for terms containing accented or non-Latin characters;

      +

    • there is support for non-standard location numbers; +
    +

    +(Additional indexing options have since been added. See the “Indexing Options” section of the glossaries user manual.)

    +

  • you don’t need to remember to escape makeindex’s special characters as this is done internally;

    +

  • hierarchical entries and homographs are supported (as from v1.17);

    +

  • there is better support for cross-referencing glossary entries;

    +

  • acronyms are just another glossary term which helps to maintain consistency;

    +

  • different acronym styles are supported.

    + +

+

+ +

+ +
+

2. Package Options

+

+When converting a document that currently uses the obsolete glossary package to the replacement glossaries package, it should be fairly obvious that the first thing you need to do is replace \usepackage{glossary} with \usepackage{glossaries}, however some of the package options are different, so you may need to change those as well. Table 1 shows the mappings from the glossary to the glossaries package options.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1: Mappings from glossary to glossaries package options
glossary option glossaries option
style=list style=list
style=altlist style=altlist
style=long,header=none,border=none,cols=2 style=long
style=long,header=plain,border=none,cols=2 style=longheader
style=long,header=none,border=plain,cols=2 style=longborder
style=long,header=plain,border=plain,cols=2 style=longheaderborder
style=long,header=none,border=none,cols=3 style=long3col
style=long,header=plain,border=none,cols=3 style=long3colheader
style=long,header=none,border=plain,cols=3 style=long3colborder
style=long,header=plain,border=plain,cols=3 style=long3colheaderborder
style=super,header=none,border=none,cols=2 style=super
style=super,header=plain,border=none,cols=2 style=superheader
style=super,header=none,border=plain,cols=2 style=superborder
style=super,header=plain,border=plain,cols=2 style=superheaderborder
style=super,header=none,border=none,cols=3 style=super3col
style=super,header=plain,border=none,cols=3 style=super3colheader
style=super,header=none,border=plain,cols=3 style=super3colborder
style=super,header=plain,border=plain,cols=3 style=super3colheaderborder
number=none nonumberlist
number=counter name counter=counter name
toc toc
hypertoc toc
hyper no corresponding option
section=true section
section=false no corresponding option
acronym acronym
global no corresponding option
+

+ +

+ +
+

3. Defining new glossary types

+

+If you have created new glossary types, you will need to replace all instances of

glossary.sty
+\newglossarytype[log-ext]{type}{out-ext}{in-ext}[old style list]
\newcommand{typename}{title} +
with
glossaries.sty
+\newglossary[log-ext]{type}{out-ext}{in-ext}{title} +
in the preamble, and, if the new glossary requires a different style to the main (default) glossary, you will also need to put
glossaries.sty
+\setglossarystyle{new-style} +
immediately before the glossary is displayed, or you can specify the style when you display the glossary using \printglossary (see below).

+The old style list optional argument can be converted to new-style using the same mapping given in Table 1.

+For example, if your document contains the following:

glossary.sty
+\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header] +\newcommand{\notationname}{Index of Notation} +
You will need to replace the above two lines with:
glossaries.sty
+\newglossary[nlg]{notation}{not}{ntn}{Index of Notation} +
in the preamble and set the style to longheader with
glossaries.sty
+\setglossarystyle{longheader} +
prior to displaying this glossary. Alternatively, you can specify the style using style package option (which makes it the default style) or the style key in the optional argument of \printglossary. For example:
glossaries.sty
+\printglossary[type=notation,style=longheader] +

+Note that the glossary title is no longer specified using \glossary-typename (except for \glossaryname and \acronymname) but is instead specified in the title argument of \newglossary. The short title which is specified in the glossary package by the command \shortglossary-typename is now specified using the toctitle key in the optional argument to \printglossary.

+ +

+ +
+

4. \makeglossary-type

+

+All instances of \makeglossary-type (e.g. \makeglossary and \makeacronym) should be replaced by the single command \makeglossaries. For example, if your document contained the following:

glossary.sty
+\makeglossary +\makeacronym +
then you should replace both lines with the single line:
glossaries.sty
+\makeglossaries +

+ +

+ +
+

5. Storing glossary information

+

+With the old glossary package you could optionally store glossary information for later use, or you could simply use \glossary whenever you wanted to add information to the glossary. With the new glossaries package, the latter option is no longer available. (This is mainly because having a key value list in \glossary caused problems, but it also helps consistency.) If you have stored all the glossary information using \storeglosentry, then you will need to convert these commands into the equivalent \newglossaryentry. If you have only used \glossary, then see §6.4.

+Substitute all instances of

glossary.sty
+\storeglosentry{label}{key=value list} +
with
glossaries.sty
+\newglossaryentry{label}{key=value list} +
This should be fairly easy to do using the search and replace facility in your editor (but see notes below).

+If you have used the optional argument of \storeglosentry (i.e. you have multiple glossaries) then you will need to substitute

glossary.sty
+\storeglosentry[gls-type]{label}{key=value list} +
with
glossaries.sty
+\newglossaryentry{label}{key=value list,type={gls-type}} +

+The glossary entry information key=value list may also need changing. If key=value list contains any of makeindex’s special characters (i.e. @ ! " or |) then they should no longer be escaped with " since the glossaries package deals with these characters internally. For example, if your document contains the following:

glossary.sty
+\storeglosentry{card}{name={$"|\mathcal{S}"|$}, +description={The cardinality of the set $\mathcal{S}$}} +
then you will need to replace it with:
glossaries.sty
+\newglossaryentry{card}{name={$|\mathcal{S}|$}, +description={The cardinality of the set $\mathcal{S}$}} +

+The number key available in \storeglosentry should be replaced with the counter key in \newglossaryentry. The sort key in \storeglosentry is also called sort in \newglossaryentry.

+The \storeglosentry format key doesn’t have a counterpart in \newglossaryentry. You can, however, specify the format in the optional argument of commands like \gls or \glsadd or you can change the default format by redefining \glsnumberformat.

+ +

+ +
+

6. Adding an entry to the glossary

+

+The glossary package provided two basic means to add information to the glossary: firstly, the term was defined using \storeglosentry and the entries for that term were added using \useglosentry, \useGlosentry and \gls. Secondly, the term was added to the glossary using \glossary. This second approach is unavailable with the glossaries package, since all entries must be defined before they can be indexed.

+ +

+ +
+

6.1. \useglosentry

+

+The glossary package allows you to add information to the glossary for a predefined term without producing any text in the document using

glossary.sty
+\useglosentry[old options]{label} +
Any occurrences of this command will need to be replaced with
glossaries.sty
+\glsadd[new options]{label} +
The format key in old options is also called format in new options. However the optdefnumber={counter-name} key in old options should be replaced with optdefcounter=counter-name in new options.

+ +

+ +
+

6.2. \useGlosentry

+

+The glossary package allows you to add information to the glossary for a predefined term with the given text using

glossary.sty
+\useGlosentry[old options]{label}{text} +
Any occurrences of this command will need to be replaced with
glossaries.sty
+\glslink[new options]{label}{text} +
The mapping from old options to new options is the same as that given §6.1.

+ +

+ +
+

6.3. \gls

+

+The glossary defines:

glossary.sty
+\gls (glossary.sty)[options]{label} +
The glossaries package defines a command with the same name, but be aware that it has a final optional argument:
glossaries.sty
+\gls (glossaries.sty)[options]{label}[insert] +
In this case, the only thing you need to change is the number key in the optional argument to counter. The insert optional argument in the new form of \gls can be used to insert text into the automatically generated text, which will put it inside the hyperlink (if hyperlinks are supported).

+ +

+ +
+

6.4. \glossary

+

+When using the glossaries package, you should not use \glossary. This is because the appropriate indexing syntax (including escaping any of makeindex’s or xindy’s special characters) is generated when the entry is defined. This reduces overall complexity as it no longer needs to be performed every time an entry is indexed. By placing the glossary definitions within the preamble, it also reduces the chance that the indexing special character may have their category code changed, which can cause interference.

+If, with the old package, you have opted to explicitly use \glossary instead of storing the glossary information with \storeglosentry, then converting from glossary to glossaries will be more time-consuming, although in the end, I hope you will see the benefits. From the user’s point of view, using \glossary throughout the document is time consuming, and if you use it more than once for the same term, there’s a chance extra spaces may creep in which will cause makeindex to treat the two entries as different terms, even though they look the same in the document. If you have used \glossary with the old glossary package, you will instead need to define the relevant glossary terms using \newglossaryentry and reference the terms using \glsadd, \glslink, \gls etc.

+If you don’t like the idea of continually scrolling back to the preamble to type all your \newglossaryentry commands, you may prefer to create a new file, in which to store all these commands, and then input that file in your document’s preamble. Most text editors and front-ends allow you to have multiple files open, and you can tab back and forth between them.

+ +

+ +
+

7. Acronyms

+

+In the glossary package, acronyms were treated differently to glossary entries. This resulted in inconsistencies and sprawling unmaintainable code. The new glossaries package treats acronyms in exactly the same way as normal glossary terms.

+Both packages provide \newacronym, but the syntax is different. With the glossary package, the syntax is:

glossary.sty
+\newacronym (glossary.sty)[cmd-name]{acronym}{long}{old-options} +
With the glossaries package, the default definition of:
glossaries.sty
+\newacronym (glossaries.sty)[options]{label}{abbrv}{long} +
is a shortcut for:
glossaries.sty
+\newglossaryentry{label}{type=\acronymtype, +name={abbrv}, +description={long}, +text={abbrv}, +first={long (abbrv)}, +plural={abbrvs}, +firstplural={longs (abbrvs)}, +options} +
(Note that this shortcut default is an older method of defining acronyms. If you use \setacronymstyle introduced to glossaries v4.02, then a more flexible method is adopted.)

+This is different to the glossary package which set the name key to long (abbrv) and allowed you to set a description using the description key. If you still want to do this, you can use one of the description styles, such as long-short-desc, and use the description key in the optional argument of \newacronym.

+For example, if your document originally had the following:

glossary.sty
+\newacronym{SVM}{Support Vector Machine}{description={Statistical pattern recognition technique}} +
Then you would need to first set the style:
glossaries.sty
+\setacronymstyle{long-short-desc} +
and change the acronym definition to:
glossaries.sty
+\newacronym[description={Statistical pattern recognition technique}]{svm}{SVM}{Support Vector Machine} +
You can then reference the acronym using any of the new referencing commands, such as \gls or \glsadd.

+With the old glossary package, when you defined an acronym, it also defined a command \acr-name which could be used to display the acronym in the text. So the above SVM example would create the command \SVM with the old package. In the new glossaries package, the acronyms are just another type of glossary entry, so they are displayed using \gls{label}. Therefore, in the above example, you will also need to replace all occurrences of \SVM with \gls{svm}.

+If you have used \useacronym instead of \acr-name, then you will need to replace all occurrences of

glossary.sty
+\useacronym[insert]{acr-name} +
with
glossaries.sty
+\gls{label}[insert] +
Note that the starred versions of \useacronym and \acr-name (which make the first letter uppercase) should be replaced with \Gls{label}.

+Alternatively (as from v1.18 of the glossaries package), you can use \oldacronym which uses the same syntax as the old glossary package’s \newacronym and also defines \acr-name. For example, if your document originally had the following:

glossary.sty
+\newacronym{SVM}{Support Vector Machine}{description={Statistical pattern recognition technique}} +
then you can change this to:
glossaries.sty
+\oldacronym{SVM}{Support Vector Machine}{description={Statistical pattern recognition technique}} +
You can then continue to use \SVM. However, remember that LaTeX generally ignores spaces after command names that consist of alphabetical characters. You will therefore need to force a space after \acr-name, unless you also load the xspace package. (See the “Acronyms” of the glossaries documentation for further details.) Note that \oldacronym uses its first argument to define the acronym’s label (as used by commands like \gls), so in the above example, with the new glossaries package, \SVM becomes a shortcut for \gls{SVM} and \SVM* becomes a shortcut for \Gls{SVM}.

+ +

+ +
+

7.1. \acrln and \acrsh

+

+In the glossary package, it is possible to produce the long and short forms of an acronym without adding an entry to the glossary using \acrln and \acrsh. With the glossaries package (provided you defined the acronym using \newacronym or \oldacronym and provided you haven’t redefined \newacronym) you can replace

glossary.sty
+\acrsh{acr-name} +
with
glossaries.sty
+\acrshort{label} +
and you can replace
glossary.sty
+\acrln{acr-name} +
with
glossaries.sty
+\acrlong{label} +
The glossaries package also provides the related commands \acrshortpl (plural short form) and \acrlongpl (plural long form) as well as upper case variations. If you use the glossaries “shortcuts” package option, you can use \acs in place of \acrshort and \acl in place of \acrlong.

+See the “Acronyms” of the glossaries manual for further details of how to use these commands.

+ +

+ +
+

7.2. \ifacronymfirstuse

+

+The glossary package command

glossary.sty
+\ifacronymfirstuse{acr-name}{not used text}{has been used text} +
can be replaced by the glossaries command:
glossaries.sty
+\ifglsused{label}{has been used text}{not used text} +
Note that \ifglsused evaluates the opposite condition to that of \ifacronymfirstuse which is why the last two arguments have been reversed.

+ +

+ +
+

7.3. \resetacronym and \unsetacronym

+

+The glossary package allows you to reset and unset the acronym flag which is used to determine whether the acronym has been used in the document. The glossaries package also provides a means to do this on either a local or a global level. To reset an acronym, you will need to replace:

glossary.sty
+\resetacronym{acr-name} +
with either
glossaries.sty
+\glsreset{label} +
or
glossaries.sty
+\glslocalreset{label} +

+To unset an acronym, you will need to replace:

glossary.sty
+\unsetacronym{acr-name} +
with either
glossaries.sty
+\glsunset{label} +
or
glossaries.sty
+\glslocalunset{label} +

+To reset all acronyms, you will need to replace:

glossary.sty
+\resetallacronyms +
with
glossaries.sty
+\glsresetall[\acronymtype] +
or
glossaries.sty
+\glslocalresetall[\acronymtype] +
To unset all acronyms, you will need to replace:
glossary.sty
+\unsetallacronyms +
with
glossaries.sty
+\glsunsetall[\acronymtype] +
or
glossaries.sty
+\glslocalunsetall[\acronymtype] +

+ +

+ +
+

8. Displaying the glossary

+

+The glossary package provides the command \printglossary (or \printtype for other glossary types) which can be used to print individual glossaries. The glossaries package provides the command \printglossaries which will print all the glossaries which have been defined, or \printglossary (glossaries.sty)[options] to print individual glossaries. So if you just have \printglossary, then you can leave it as it is, but if you have, say:

glossary.sty
+\printglossary +\printglossary[acronym] +
or
glossary.sty
+\printglossary +\printacronym* +
then you will need to replace this with either
glossaries.sty
+\printglossaries +
or
glossaries.sty
+\printglossary +\printglossary[type=\acronymtype] +

+The glossary package allows you to specify a short title (for the table of contents and page header) by defining a command of the form \shortglossary-typename. The glossaries package doesn’t do this, but instead provides the toctitle key which can be used in the optional argument to \printglossary. For example, if you have created a new glossary type called notation, and you had defined

glossary.sty
+\newcommand{\shortnotationname}{Notation} +
then you would need to use the toctitle key:
glossaries.sty
+\printglossary[type=notation,toctitle=Notation] +
The glossaries package will ignore \shortnotationname, so unless you have used it elsewhere in the document, you may as well remove the definition.

+ +

+ +
+

9. Processing Your Document

+

+If you convert your document from using the glossary package to the glossaries package, you will need to delete any of the additional files, such as the glo file, that were created by the glossary package, as the glossaries package uses a different format. Remember also, that if you used the makeglos Perl script, you will need to use the makeglossaries Perl script instead. As from v1.17, the glossaries package can be used with either makeindex or xindy. Since xindy was designed to be multilingual, the new glossaries package is a much better option for non-English documents. If you use the extension package, glossaries-extra, then you also have the option of using bib2gls instead (which also provides multilingual support).

+For further information on using makeglossaries, makeindex or xindy to create your glossaries, see the “Generating the Associated Glossary Files” section of the glossaries documentation.

+ +

+ +
+

10. Troubleshooting

+

+Please check the FAQ for the glossaries package if you have any problems.

+ +

+ +
+

Symbols

+ +
+
🔎
+
A command-line application invocation that needs to be entered into a terminal or command prompt.
+ +
+ +
+ +
+

Index

+
Symbols A B C F G I M N O P R S T U X
+ +
+ +
+

Symbols

+
!6
+

+

"67
+
|67
+
@6
+ +
+ +
+

A

+
\acl12
+
\acr-name1011
+ + +
\acrlongpl12
+
acronymTable 1
+
\acronymname5
+
\acronymtype9, 1314
+ + +
\acrshortpl12
+
\acs12
+ +
+ +
+

B

+
bib2gls15
+ +
+ +
+

C

+
counterTable 1
+ +
+ +
+

F

+
file formats
+
glo15
+ +
+ +
+

G

+
glossaries-extra package15
+
\glossary69
+
\glossary-typename5
+
glossary styles
+ +
long3colTable 1
+
long3colborderTable 1
+
long3colheaderTable 1
+
long3colheaderborderTable 1
+
longborderTable 1
+
longheaderTable 1; 5
+
longheaderborderTable 1
+
superTable 1
+
super3colTable 1
+
super3colborderTable 1
+
super3colheaderTable 1
+
super3colheaderborderTable 1
+
superborderTable 1
+
superheaderTable 1
+
superheaderborderTable 1
+
\glossaryname5
+
\Gls1011
+ + +
format7
+ + + + +
\glslocalresetall13
+ +
\glslocalunsetall13
+
\glsnumberformat7
+ +
\glsresetall13
+ +
\glsunsetall13
+ +
+ +
+

I

+ + + +
+ +
+

M

+
\makeacronym5
+
makeglos15
+
\makeglossaries56
+
makeglossaries15
+
\makeglossary5
+
\makeglossary-type5
+
makeindex2, 3, 6, 8, 915
+ +
+ +
+

N

+ + + + +
counter7
+
description7, 911
+
first9
+
firstplural9
+
name79
+
plural9
+
sort7
+
text9
+
type6
+ +
nonumberlistTable 1
+ +
+ +
+

O

+
\oldacronym1011
+ +
+ +
+

P

+
\printacronym14
+
\printglossaries14
+ +
style5
+
toctitle514
+
type514
+
\printglossary (glossary.sty)14
+
\printtype14
+ +
+ +
+

R

+ + + +
+ +
+

S

+
sectionTable 1
+
\setacronymstyle910
+
long-short-desc10
+ +
\shortglossary-typename514
+ +
description7, 911
+
format7
+
name79
+
number7
+
sort7
+
styleTable 1; 5
+ +
+ +
+

T

+ + +
+ +
+

U

+ + + + + +
format7
+ + +
+ +
+

X

+
xindy2, 815
+
xspace package11
+ +
+
+ + diff --git a/macros/latex/contrib/glossaries/glossary2glossaries.pdf b/macros/latex/contrib/glossaries/glossary2glossaries.pdf index f9a189ad1b..a8b9b0c324 100644 Binary files a/macros/latex/contrib/glossaries/glossary2glossaries.pdf and b/macros/latex/contrib/glossaries/glossary2glossaries.pdf differ diff --git a/macros/latex/contrib/glossaries/glossary2glossaries.tex b/macros/latex/contrib/glossaries/glossary2glossaries.tex index 268d3c997a..2c334ff099 100644 --- a/macros/latex/contrib/glossaries/glossary2glossaries.tex +++ b/macros/latex/contrib/glossaries/glossary2glossaries.tex @@ -1,62 +1,403 @@ -\documentclass{nlctdoc} - -\usepackage[utf8]{inputenc} -\ifpdf -\usepackage[T1]{fontenc} -\usepackage{lmodern} -\usepackage{fourier} -\usepackage{mathpazo} -\usepackage[scaled=.88]{helvet} -\usepackage{courier} -\fi -\usepackage{cmap} - -\usepackage[colorlinks, - bookmarks, - hyperindex=false, - pdfauthor={Nicola L.C. Talbot}, - pdftitle={Upgrading from the glossary package to - the glossaries package}]{hyperref} -\usepackage{xr-hyper} - -\newcommand*{\igloskey}[2][newglossaryentry]{\icsopt{#1}{#2}} -\newcommand*{\gloskey}[2][newglossaryentry]{\csopt{#1}{#2}} -\newcommand*{\acrstyle}[1]{\texttt{#1}} - -\ifpdf -\newcommand{\glsentrytext}[1]{\texttt{#1}} -\externaldocument{glossaries-user} -\fi - -\IndexPrologue{\section*{Index}} -\setcounter{IndexColumns}{2} +% arara: lualatex +% arara: bib2gls: { group: on } +% arara: lualatex +% arara: bib2gls: { group: on } if found ("log", "Glossary entry `sym.") +% arara: lualatex +% arara: lualatex if found ("log", "Rerun to") + +\documentclass[titlepage=false,oneside, + fontsize=12pt,captions=tableheading]{scrarticle} + +\usepackage[noatsymgroup]{nlctuserguide} + +\renewcommand*{\thispackagename}{glossaries} + +\glsxtrnewgls{opt.glostyle.}{\glostyle} +\glsxtrnewgls{opt.acrstyle.}{\acrstyle} + +\defsemanticcmd{\glostylefmt}{\textsf}{} +\defsemanticcmd{\acrstylefmt}{\textsf}{} + +\glsxtrnewgls{opt.printgloss.}{\printglossopt} +\newcommand{\printglossoptval}[2]{\optval{printgloss.#1}{#2}} +\newcommand{\printglossoptvalm}[2]{\optval{printgloss.#1}{\marg{#2}}} + +\glsxtrnewgls{opt.gloskey.}{\gloskey} +\newcommand{\gloskeyval}[2]{\optval{gloskey.#1}{\marg{#2}}} + +\glsxtrnewgls{opt.storegloskey.}{\storegloskey} +\newcommand{\storegloskeyval}[2]{\optval{storegloskey.#1}{\marg{#2}}} + +\glsxtrnewgls{opt.glsopt.}{\glsopt} +\newcommand{\glsoptval}[2]{\optval{glsopt.#1}{#2}} + +\glsxtrnewgls{opt.useglsopt.}{\useglsopt} +\newcommand{\useglsoptval}[2]{\optval{useglsopt.#1}{#2}} + +\renewcommand{\nlctuserguidecustomentryaliases}{% + glossarystyle=index, + acronymstyle=index, +} + +\nlctuserguidegls +{ + \def\gprintglossopt#1#2{% + \glsbibwriteentry{commandoption}{opt.printgloss.#1}{% + \field{name}{\csoptfmt{#1}}\parent{printglossary}#2}}% + \def\gglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}% + {\field{name}{\glostylefmt{#1}}\parent{idx.glossarystyle}#2}}% + \def\gacrsty#1#2{\glsbibwriteentry{acronymstyle}{opt.acrstyle.#1}% + {\field{name}{\acrstylefmt{#1}}\parent{setacronymstyle}#2}}% + \def\ggloskey#1#2{% + \glsbibwriteentry{commandoption}{opt.gloskey.#1}{% + \field{name}{\csoptfmt{#1}}\parent{newglossaryentry}#2}}% + \def\gstoregloskey#1#2{% + \glsbibwriteentry{commandoption}{opt.storegloskey.#1}{% + \field{name}{\csoptfmt{#1}}\parent{storeglosentry}#2}}% + \def\gglsopt#1#2{% + \glsbibwriteentry{commandoption}{opt.glsopt.#1}{% + \field{name}{\csoptfmt{#1}}\parent{gls}#2}}% + \def\guseglsopt#1#2{% + \glsbibwriteentry{commandoption}{opt.useglsopt.#1}{% + \field{name}{\csoptfmt{#1}}\parent{useglosentry}#2}}% + \gidx{glossarystyle}{\name{glossary styles}\field{text}{glossary style}} + % \newglossarytype + \gcmd{new\-glossary\-type} + {% + \syntax{\oargm{log-ext}\margm{type}\margm{out-ext}\margm{in-ext}\oargm{old style list}} + } + % \newglossary + \gcmd{new\-glossary} + { + \syntax{\oargm{log-ext}\margm{type}\margm{out-ext}\margm{in-ext}\margm{title}} + } + % \setglossarystyle + \gcmd{set\-glossary\-style} + { + \syntax{\margm{new-style}} + } + % \printglossary (glossary.sty) + \gcmd{oldprintglossary} + { + \name{\csfmt{print\-glossary} (\styfmt{glossary.sty})} + \field{text}{\csfmt{print\-glossary}} + \syntax{\oargm{type}} + } + % \printglossary (glossaries.sty) + \gcmd{print\-glossary} + { + \name{\csfmt{print\-glossary} (\styfmt{glossaries.sty})} + \field{text}{\csfmt{print\-glossary}} + \syntax{\oargm{options}} + } + % \printglossaries + \gcmd{print\-glossaries}{} + % \printacronym + \gcmds{print\-acronym}{} + % \acronymtype + \gcmd{acronym\-type}{} + % \print + \gcmdmeta{print}{type}{}{} + % \glossaryname + \gcmd{glossary\-name}{} + % \acronymname + \gcmd{acronym\-name}{} + % \name + \gcmdmeta{}{glossary\dhyphen type}{name}{} + % \shortname + \gcmdmeta{short}{glossary\dhyphen type}{name}{} + % \make + \gcmdmeta{make}{glossary\dhyphen type}{}{} + % \makeglossary + \gcmd{make\-glossary}{} + % \makeacronym + \gcmd{make\-acronym}{} + % \makeglossaries + \gcmd{make\-glossaries}{} + % \glossary + \gcmd{glossary}{} + % \storeglosentry + \gcmd{store\-glos\-entry} + { + \syntax{\margm{label}\marg{\keyvallist}} + } + % \newglossaryentry + \gcmd{new\-glossary\-entry} + { + \syntax{\margm{label}\marg{\keyvallist}} + } + % \glsnumberformat + \gcmd{gls\-number\-format}{\syntax{text}} + % \gls (glossary.sty) + \gcmd{oldgls}{ + \name{\csfmt{gls} (\styfmt{glossary.sty})} + \field{text}{\csfmt{gls}} + \syntax{\oargm{options}\margm{label}} + } + % \gls + \gcmd{gls} + { + \name{\csfmt{gls} (\styfmt{glossaries.sty})} + \field{text}{\csfmt{gls}} + \syntax{\oargm{options}\margm{label}\oargm{insert}} + } + % \Gls + \gcmd{Gls} + { + \syntax{\oargm{options}\margm{label}\oargm{insert}} + } + % \glsadd + \gcmd{glsadd}{\syntax{\oargm{new options}\margm{label}}} + % \glslink + \gcmd{glslink}{\syntax{\oargm{new options}\margm{label}\margm{text}}} + % \useglosentry + \gcmd{use\-glos\-entry}{\syntax{\oargm{old options}\margm{label}}} + % \useGlosentry + \gcmd{use\-Glos\-entry}{\syntax{\oargm{old options}\margm{label}\margm{text}}} + % \newacronym (glossary.sty) + \gcmd{oldnewacronym} + { + \name{\csfmt{new\-acronym} (\styfmt{glossary.sty})} + \field{text}{\csfmt{new\-acronym}} + \syntax{\oargm{cmd-name}\margm{acronym}\margm{long}\margm{old-options}} + } + % \newacronym (glossaries.sty) + \gcmd{new\-acronym} + { + \name{\csfmt{new\-acronym} (\styfmt{glossaries.sty})} + \field{text}{\csfmt{new\-acronym}} + \syntax{\oargm{options}\margm{label}\margm{abbrv}\margm{long}} + } + % \oldacronym + \gcmd{oldacronym} + { + \syntax{\oargm{cmd-name}\margm{acronym}\margm{long}\margm{old-options}} + } + % \setacronymstyle + \gcmd{set\-acronym\-style} + { + \syntax{\oargm{glossary-type}\margm{style-name}} + } + % \useacronym + \gcmds{use\-acronym} + { + \syntax{\oargm{insert}\margm{acr-name}} + } + % \acrlong + \gcmd{acr\-long}{\syntax{\margm{label}}} + % \acrshort + \gcmd{acr\-short}{\syntax{\margm{label}}} + % \acrlongpl + \gcmd{acr\-long\-pl}{\syntax{\margm{label}}} + % \acrshort + \gcmd{acr\-short\-pl}{\syntax{\margm{label}}} + % \acs + \gcmd{acs}{\syntax{\margm{label}}} + % \acl + \gcmd{acl}{\syntax{\margm{label}}} + % \acrln + \gcmd{acrln}{\syntax{\margm{acr-name}}} + % \acrsh + \gcmd{acrsh}{\syntax{\margm{acr-name}}} + % \ifacronymfirstuse + \gcmd{if\-acronym\-first\-use} + { + \syntax{\margm{acr-name}\margm{not used text}\margm{has been used text}} + } + % \ifglsused + \gcmd{if\-gls\-used} + { + \syntax{\margm{label}\margm{has been used text}\margm{not used text}} + } + % \resetacronym + \gcmd{reset\-acronym}{\syntax{\margm{acr-name}}} + % \unsetacronym + \gcmd{unset\-acronym}{\syntax{\margm{acr-name}}} + % \resetallacronyms + \gcmd{reset\-all\-acronyms}{} + % \unsetallacronyms + \gcmd{unset\-all\-acronyms}{} + % \glsreset + \gcmd{gls\-reset}{\syntax{\margm{label}}} + % \glslocalreset + \gcmd{gls\-local\-reset}{\syntax{\margm{label}}} + % \glsunset + \gcmd{gls\-unset}{\syntax{\margm{label}}} + % \glslocalunset + \gcmd{gls\-local\-unset}{\syntax{\margm{label}}} + % \glsresetall + \gcmd{gls\-reset\-all}{\syntax{\oargm{glossary-types}}} + % \glsunsetall + \gcmd{gls\-unset\-all}{\syntax{\oargm{glossary-types}}} + % \glslocalresetall + \gcmd{gls\-local\-reset\-all}{\syntax{\oargm{glossary-types}}} + % \glslocalunsetall + \gcmd{gls\-local\-unset\-all}{\syntax{\oargm{glossary-types}}} + % \ + \gcmdmeta{}{acr\dhyphen name}{}{\field{modifiers}{*}} + % new key: type + \ggloskey{type}{\syntax{\meta{glossary-type}}} + % new key: name + \ggloskey{name}{\syntax{\margm{text}}} + % new key: description + \ggloskey{description}{\syntax{\margm{text}}} + % new key: counter + \ggloskey{counter}{\syntax{\margm{counter-name}}} + % new key: sort + \ggloskey{sort}{\syntax{\margm{text}}} + % new key: first + \ggloskey{first}{\syntax{\margm{text}}} + % new key: firstplural + \ggloskey{first\-plural}{\syntax{\margm{text}}} + % new key: text + \ggloskey{text}{\syntax{\margm{text}}} + % new key: plural + \ggloskey{plural}{\syntax{\margm{text}}} + % old key: name + \gstoregloskey{name}{\syntax{\margm{text}}} + % old key: description + \gstoregloskey{description}{\syntax{\margm{text}}} + % old key: format + \gstoregloskey{format}{\syntax{\meta{csname}}} + % old key: number + \gstoregloskey{number}{\syntax{\meta{counter-name}}} + % old key: sort + \gstoregloskey{sort}{\syntax{\margm{text}}} + % gls key: format + \gglsopt{format}{\syntax{\meta{csname}}} + % gls key: counter + \gglsopt{counter}{\syntax{\meta{counter-name}}} + % useglosentry key: format + \guseglsopt{format}{\syntax{\meta{csname}}} + % useglosentry key: number + \guseglsopt{number}{\syntax{\margm{counter-name}}} + % package option style + \gstyopt{style}% + {% + \syntax{\meta{style-name}} + } + % package option nonumberlist + \gstyopt{nonumberlist}{} + % package option counter + \gstyopt{counter}% + {% + \syntax{\meta{counter-name}} + } + % package option toc + \gstyopt{toc}% + {% + \syntax{\meta{boolean}} + } + % package option section + \gstyopt{section} + { + \syntax{\meta{value}} + } + % package option acronym + \gstyopt{acronym}% + {% + \syntax{\meta{boolean}} + } + % printgloss style + \gprintglossopt{style}{% + \syntax{\meta{style-name}} + } + % printgloss type + \gprintglossopt{type}{% + \syntax{\meta{glossary-label}} + } + % printgloss nonumberlist + \gprintglossopt{no\-number\-list}{} + % printgloss toctitle + \gprintglossopt{toc\-title}{} + % acronym style: long-short-desc + \gacrsty{long\dhyphen short\dhyphen desc}{} + % glossary style: long + \gglosty{long}{} + % glossary style: longheader + \gglosty{long\-header}{} + % glossary style: longborder + \gglosty{long\-border}{} + % glossary style: longheaderborder + \gglosty{long\-header\-border}{} + % glossary style: long3col + \gglosty{long3col}{} + % glossary style: long3colheader + \gglosty{long3col\-header}{} + % glossary style: long3colborder + \gglosty{long3col\-border}{} + % glossary style: long3colheaderborder + \gglosty{long3col\-header\-border}{} + % glossary style: super + \gglosty{super}{} + % glossary style: superheader + \gglosty{super\-header}{} + % glossary style: superborder + \gglosty{super\-border}{} + % glossary style: superheaderborder + \gglosty{super\-header\-border}{} + % glossary style: super3col + \gglosty{super3col}{} + % glossary style: super3colheader + \gglosty{super3col\-header}{} + % glossary style: super3colborder + \gglosty{super3col\-border}{} + % glossary style: super3colheaderborder + \gglosty{super3col\-header\-border}{} + % applications: + \gapp{makeindex}{} + \gapp{xindy}{} + \gapp{makeglos}{} + \gapp{makeglossaries}{} + \gapp{bib2gls}{} + % punctuation + \gpunc{at}{\name{\code{@}}} + \gpunc{excl}{\name{\code{!}}} + \gpunc{dblquote}{\name{\code{"}}} + \gpunc{vbar}{\name{\code{|}}} + % packages + \gpkg{xspace}{} + \gpkg{glossaries\dhyphen extra}{} + % file types + \gext{glo}{} + \gext{glg}{} + \gext{gls}{} +} \title{Upgrading from the glossary package to the glossaries package} \author{Nicola L.C. Talbot} -\date{2021-11-01} +\date{2022-10-14} -\newenvironment{oldway}{% - \begin{labelledbox}{\styfmt{glossary}}\ttfamily\obeylines -}{% - \end{labelledbox}% -} +\newenvironment{oldway} +{\begin{codebox*}[title={\styfmt{glossary.sty}}]} +{\end{codebox*}} -\newenvironment{newway}{% - \begin{labelledbox}{\styfmt{glossaries}}\ttfamily\obeylines -}{% - \end{labelledbox}% -} +\newenvironment{newway} +{\begin{codebox*}[title={\styfmt{glossaries.sty}}]} +{\end{codebox*}} \begin{document} \maketitle +\htmlavailable + \begin{abstract} The purpose of this document is to provide advice if you want to convert a \LaTeX\ document from using the obsolete \styfmt{glossary} package to the replacement \styfmt{glossaries} package. +The final version of the \styfmt{glossary} package is 2.4 (2006-07-20). +It was made obsolete after the release of \styfmt{glossaries} +v1.0 (2007-05-16). \end{abstract} +For the main \styfmt{glossaries} user guide, see +\filefmt{glossaries-user.pdf}. +\texdocref{glossaries-user} +For a shorter guide for beginners, see +\filefmt{glossariesbegin.pdf}. +\texdocref{glossariesbegin} + \tableofcontents \section{Why the Need for a New Package?} @@ -83,10 +424,8 @@ to the name and description; \item you can add dictionaries to supply translations for the fixed names used in headings and by some of the glossary styles; -\item you can choose\footnote{as from v1.17. Previous versions -were designed to be used with \app{makeindex} only} between using -\app{makeindex} or \app{xindy} to sort the glossary. Using -\app{xindy} means that: +\item you can choose between using \app{makeindex} or \app{xindy} to +sort the glossary. Using \app{xindy} means that: \begin{itemize} \item there is much better support for terms containing accented @@ -95,11 +434,15 @@ were designed to be used with \app{makeindex} only} between using \item there is support for non-standard location numbers; \end{itemize} -\item you don't need to remember to escape \app{makeindex}'s +(Additional indexing options have since been added. See +the \qt{Indexing Options} section +of the \styfmt{glossaries} user manual.) + +\item you don't need to remember to escape \app{makeindex}['s] special characters as this is done internally; -\item hierarchical entries and homographs are supported;\footnote{as -from v1.17} +\item hierarchical entries and homographs are supported (as +from v1.17); \item there is better support for cross-referencing glossary entries; @@ -115,8 +458,8 @@ maintain consistency; When converting a document that currently uses the obsolete \styfmt{glossary} package to the replacement \styfmt{glossaries} package, it should be fairly obvious that the first thing you need to do is -replace \verb|\usepackage{glossary}| with -\verb|\usepackage{glossaries}|, however some of the package options +replace \code{\cmd{usepackage}\marg{glossary}} with +\code{\cmd{usepackage}\marg{glossaries}}, however some of the package options are different, so you may need to change those as well. Table~\ref{tab:pkgopt} shows the mappings from the \styfmt{glossary} to the \styfmt{glossaries} package options. @@ -125,38 +468,37 @@ to the \styfmt{glossaries} package options. \caption[Mappings]{Mappings from \styfmt{glossary} to \styfmt{glossaries} package options} \label{tab:pkgopt} -\begin{center} +\centering \begin{tabular}{ll} \bfseries \styfmt{glossary} option & \bfseries \styfmt{glossaries} option\\ style=list & style=list\\ style=altlist & style=altlist\\ -style=long,header=none,border=none,cols=2 & style=long\\ -style=long,header=plain,border=none,cols=2 & style=longheader\\ -style=long,header=none,border=plain,cols=2 & style=longborder\\ -style=long,header=plain,border=plain,cols=2 & style=longheaderborder\\ -style=long,header=none,border=none,cols=3 & style=long3col\\ -style=long,header=plain,border=none,cols=3 & style=long3colheader\\ -style=long,header=none,border=plain,cols=3 & style=long3colborder\\ -style=long,header=plain,border=plain,cols=3 & style=long3colheaderborder\\ -style=super,header=none,border=none,cols=2 & style=super\\ -style=super,header=plain,border=none,cols=2 & style=superheader\\ -style=super,header=none,border=plain,cols=2 & style=superborder\\ -style=super,header=plain,border=plain,cols=2 & style=superheaderborder\\ -style=super,header=none,border=none,cols=3 & style=super3col\\ -style=super,header=plain,border=none,cols=3 & style=super3colheader\\ -style=super,header=none,border=plain,cols=3 & style=super3colborder\\ -style=super,header=plain,border=plain,cols=3 & style=super3colheaderborder\\ -number=none & nonumberlist\\ -number=\meta{counter name} & counter=\meta{counter name}\\ -toc & toc\\ -hypertoc & toc\\ +style=long,header=none,border=none,cols=2 & \opt{style}=\glostyle{long}\\ +style=long,header=plain,border=none,cols=2 & \opt{style}=\glostyle{longheader}\\ +style=long,header=none,border=plain,cols=2 & \opt{style}=\glostyle{longborder}\\ +style=long,header=plain,border=plain,cols=2 & \opt{style}=\glostyle{longheaderborder}\\ +style=long,header=none,border=none,cols=3 & \opt{style}=\glostyle{long3col}\\ +style=long,header=plain,border=none,cols=3 & \opt{style}=\glostyle{long3colheader}\\ +style=long,header=none,border=plain,cols=3 & \opt{style}=\glostyle{long3colborder}\\ +style=long,header=plain,border=plain,cols=3 & \opt{style}=\glostyle{long3colheaderborder}\\ +style=super,header=none,border=none,cols=2 & \opt{style}=\glostyle{super}\\ +style=super,header=plain,border=none,cols=2 & \opt{style}=\glostyle{superheader}\\ +style=super,header=none,border=plain,cols=2 & \opt{style}=\glostyle{superborder}\\ +style=super,header=plain,border=plain,cols=2 & \opt{style}=\glostyle{superheaderborder}\\ +style=super,header=none,border=none,cols=3 & \opt{style}=\glostyle{super3col}\\ +style=super,header=plain,border=none,cols=3 & \opt{style}=\glostyle{super3colheader}\\ +style=super,header=none,border=plain,cols=3 & \opt{style}=\glostyle{super3colborder}\\ +style=super,header=plain,border=plain,cols=3 & \opt{style}=\glostyle{super3colheaderborder}\\ +number=none & \opt{nonumberlist}\\ +number=\meta{counter name} & \opt{counter}=\meta{counter name}\\ +toc & \opt{toc}\\ +hypertoc & \opt{toc}\\ hyper & \emph{no corresponding option}\\ -section=true & section\\ +section=true & \opt{section}\\ section=false & \emph{no corresponding option}\\ -acronym & acronym\\ +acronym & \opt{acronym}\\ global & \emph{no corresponding option} \end{tabular} -\end{center} \end{table} \section{Defining new glossary types} @@ -164,209 +506,225 @@ global & \emph{no corresponding option} If you have created new glossary types, you will need to replace all instances of \begin{oldway} -\ics{newglossarytype}\oarg{log-ext}\marg{type}\marg{out-ext}\marg{in-ext}\oarg{old style list}\newline -\cs{newcommand}\verb|{\|\meta{type}name\verb|}|\marg{title} +\cmddefsyntax{}{newglossarytype}\newline +\csfmt{newcommand}\marg{\meta{type}name}\margm{title} \end{oldway}% with \begin{newway} -\ics{newglossary}\oarg{log-ext}\marg{type}\marg{out-ext}\marg{in-ext}\marg{title} +\cmddefsyntax{}{newglossary} \end{newway}% in the preamble, and, if the new glossary requires a different style to the main (default) glossary, you will also need to put \begin{newway} -\ics{setglossarystyle}\marg{new style} +\cmddefsyntax{}{setglossarystyle} \end{newway}% immediately before the glossary is displayed, or you can specify -the style when you display the glossary using \ics{printglossary} +the style when you display the glossary using \gls{printglossary} (see below). The \meta{old style list} optional argument can be converted to -\meta{new style} using the same mapping given in +\meta{new-style} using the same mapping given in Table~\ref{tab:pkgopt}. For example, if your document contains the following: -\begin{verbatim} -\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header] -\newcommand{\notationname}{Index of Notation} -\end{verbatim} +\begin{oldway} +\gls{newglossarytype}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\oarg{style=long,header} +\cmd{newcommand}\marg{\cmd{notationname}}\marg{Index of Notation} +\end{oldway} You will need to replace the above two lines with: -\begin{verbatim} -\newglossary[nlg]{notation}{not}{ntn}{Index of Notation} -\end{verbatim} -in the preamble and -\begin{verbatim} -\setglossarystyle{longheader} -\end{verbatim} -immediately prior to displaying this glossary. Alternatively, you -can specify the style using the \csopt{printglossary}{style} key in -the optional argument of \ics{printglossary}. For example: -\begin{verbatim} -\printglossary[type=notation,style=longheader] -\end{verbatim} +\begin{newway} +\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Index of Notation} +\end{newway} +in the preamble and set the style to \glostyle{longheader} with +\begin{newway} +\gls{setglossarystyle}\marg{\glostyle{longheader}} +\end{newway} +prior to displaying this glossary. Alternatively, you +can specify the style using \opt{style} package option (which makes +it the default style) or the \printglossopt{style} key in +the optional argument of \gls{printglossary}. For example: +\begin{newway} +\gls{printglossary}\oarg{\printglossoptval{type}{notation},\printglossoptval{style}{\glostyle{longheader}}} +\end{newway} Note that the glossary title is no longer specified using -\cs{}\meta{glossary-type}\texttt{name} (except for \ics{glossaryname} -and \ics{acronymname}) but is instead specified in the \meta{title} -argument of \ics{newglossary}. The short title which is specified in +\gls{glossary-typename} (except for \gls{glossaryname} +and \gls{acronymname}) but is instead specified in the \meta{title} +argument of \gls{newglossary}. The short title which is specified in the \styfmt{glossary} package by the command -\cs{short}\meta{glossary-name}\texttt{name} is now specified using -the \csopt{printglossary}{toctitle} key in the optional argument to -\ics{printglossary}. +\gls{shortglossary-typename} is now specified using +the \printglossopt{toctitle} key in the optional argument to +\gls{printglossary}. -\section{\texorpdfstring{\cs{make}\meta{glossary -name}}{\textbackslash make...}} +\section{\glsfmttext{makeglossary-type}} -All instances of \cs{make}\meta{glossary name} (e.g.\ -\ics{makeglossary} and \ics{makeacronym}) should be replaced -by the single command \ics{makeglossaries}. For example, if +All instances of \gls{makeglossary-type} (e.g.\ +\gls{makeglossary} and \gls{makeacronym}) should be replaced +by the single command \gls{makeglossaries}. For example, if your document contained the following: -\begin{verbatim} -\makeglossary -\makeacronym -\end{verbatim} +\begin{oldway} +\gls{makeglossary} +\gls{makeacronym} +\end{oldway} then you should replace both lines with the single line: -\begin{verbatim} -\makeglossaries -\end{verbatim} +\begin{newway} +\gls{makeglossaries} +\end{newway} \section{Storing glossary information} With the old \styfmt{glossary} package you could optionally store glossary information for later use, or you could simply use -\ics{glossary} whenever you wanted to add information to the glossary. +\gls{glossary} whenever you wanted to add information to the glossary. With the new \styfmt{glossaries} package, the latter option is no longer -available.\footnote{mainly because having a key value list in -\ics{glossary} caused problems, but it also helps consistency.} If +available. (This is mainly because having a key value list in +\gls{glossary} caused problems, but it also helps consistency.) If you have stored all the glossary information using -\ics{storeglosentry}, then you will need to convert these commands -into the equivalent \ics{newglossaryentry}. If you have only -used \ics{glossary}, then see \sectionref{sec:csglossary}. +\gls{storeglosentry}, then you will need to convert these commands +into the equivalent \gls{newglossaryentry}. If you have only +used \gls{glossary}, then see \sectionref{sec:csglossary}. Substitute all instances of \begin{oldway} -\ics{storeglosentry}\marg{label}\marg{gls-entry} +\cmddefsyntax{}{storeglosentry} \end{oldway}% with \begin{newway} -\ics{newglossaryentry}\marg{label}\marg{gls-entry} +\cmddefsyntax{}{newglossaryentry} \end{newway}% This should be fairly easy to do using the search and replace facility in your editor (but see notes below). -If you have used the optional argument of \ics{storeglosentry} +If you have used the optional argument of \gls{storeglosentry} (i.e.\ you have multiple glossaries) then you will need to substitute \begin{oldway} -\ics{storeglosentry}\oarg{gls-type}\marg{label}\marg{gls-entry} +\gls{storeglosentry}\oargm{gls-type}\margm{label}\marg{\keyvallist} \end{oldway}% with \begin{newway} -\ics{newglossaryentry}\marg{label}\verb|{|\meta{gls-entry},type=\meta{gls-type}\verb|}| +\gls{newglossaryentry}\margm{label}\marg{\keyvallist,\gloskeyval{type}{\meta{gls-type}}} \end{newway} -The glossary entry information \meta{gls-entry} may also need -changing. If \meta{gls-entry} contains any of \app{makeindex}'s -special characters (i.e.\ \texttt{@} \texttt{!} \verb|"| or -\verb"|") then they should no longer be escaped with \verb'"' +The glossary entry information \keyvallist\ may also need +changing. If \keyvallist\ contains any of \app{makeindex}['s] +special characters (i.e.\ \idx{at} \idx{excl} \idx{dblquote} or +\idx{vbar}) then they should no longer be escaped with \idx{dblquote} since the \styfmt{glossaries} package deals with these characters internally. For example, if your document contains the following: -\begin{verbatim} -\storeglosentry{card}{name={$"|\mathcal{S}"|$}, -description={The cardinality of the set $\mathcal{S}$}} -\end{verbatim} +\begin{oldway} +\gls{storeglosentry}\marg{card}\marg{\storegloskeyval{name}{\$\idx{dblquote}\idx{vbar}\cmd{mathcal}\marg{S}\idx{dblquote}\idx{vbar}\$}, +\storegloskeyval{description}{The cardinality of the set \$\cmd{mathcal}\marg{S}\$}} +\end{oldway} then you will need to replace it with: -\begin{verbatim} -\newglossaryentry{card}{name={$|\mathcal{S}|$}, -description={The cardinality of the set $\mathcal{S}$}} -\end{verbatim} +\begin{newway} +\gls{newglossaryentry}\marg{card}\marg{\gloskeyval{name}{\$\idx{vbar}\cmd{mathcal}\marg{S}\idx{vbar}\$}, +\gloskeyval{description}{The cardinality of the set \$\cmd{mathcal}\marg{S}\$}} +\end{newway} + +The \storegloskey{number} key available in \gls{storeglosentry} +should be replaced with the \gloskey{counter} key in +\gls{newglossaryentry}. The \storegloskey{sort} key in \gls{storeglosentry} +is also called \gloskey{sort} in \gls{newglossaryentry}. -The \csopt{storeglosentry}{format} and -\csopt{storeglosentry}{number} keys available in \ics{storeglosentry} -are not available with \ics{newglossaryentry}. +The \gls{storeglosentry} \storegloskey{format} key doesn't have a +counterpart in \gls{newglossaryentry}. You can, however, specify the +format in the optional argument of commands like \gls{gls} or +\gls{glsadd} or you can change the default format by redefining +\gls{glsnumberformat}. \section{Adding an entry to the glossary} The \styfmt{glossary} package provided two basic means to add information to the glossary: firstly, the term was defined -using \ics{storeglosentry} and the entries for that term were -added using \ics{useglosentry}, \ics{useGlosentry} and \ics{gls}. -Secondly, the term was added to the glossary using \ics{glossary}. +using \gls{storeglosentry} and the entries for that term were +added using \gls{useglosentry}, \gls{useGlosentry} and \gls{gls}. +Secondly, the term was added to the glossary using \gls{glossary}. This second approach is unavailable with the \styfmt{glossaries} -package. +package, since all entries must be defined before they can be +indexed. -\subsection{\texorpdfstring{\cs{useglosentry}}{\textbackslash -useglosentry}} +\subsection{\glsfmttext{useglosentry}} \label{sec:useglosentry} The \styfmt{glossary} package allows you to add information to the glossary for a predefined term without producing any text in the document using \begin{oldway} -\ics{useglosentry}\oarg{old options}\marg{label} +\cmddefsyntax{}{useglosentry} \end{oldway}% Any occurrences of this command will need to be replaced with \begin{newway} -\ics{glsadd}\oarg{new options}\marg{label} +\cmddefsyntax{}{glsadd} \end{newway}% -The \csopt{useglosentry}{format} key in \meta{old options} remains -the same in \meta{new options}. However the -\csopt{useglosentry}{number}\texttt{=}\meta{counter name} key in +The \useglsopt{format} key in \meta{old options} is also called +\glsopt{format} in \meta{new options}. However the +\optdefsyntax{}{useglsopt.number} key in \meta{old options} should be replaced with -\csopt{glsadd}{counter}\texttt{=}\meta{counter name} in \meta{new -options}. +\optdefsyntax{}{glsopt.counter} in \meta{new options}. -\subsection{\texorpdfstring{\cs{useGlosentry}}{\textbackslash -useGlosentry}} +\subsection{\glsfmttext{useGlosentry}} The \styfmt{glossary} package allows you to add information to the glossary for a predefined term with the given text using \begin{oldway} -\ics{useGlosentry}\oarg{old options}\marg{label}\marg{text} +\cmddefsyntax{}{useGlosentry} \end{oldway}% Any occurrences of this command will need to be replaced with \begin{newway} -\ics{glslink}\oarg{new options}\marg{label}\marg{text} +\cmddefsyntax{}{glslink} \end{newway}% The mapping from \meta{old options} to \meta{new options} is the same as that given \sectionref{sec:useglosentry}. -\subsection{\texorpdfstring{\cs{gls}}{\textbackslash gls}} +\subsection{\glsfmttext{oldgls}} -Both the \styfmt{glossary} and the \styfmt{glossaries} packages define -the command \ics{gls}. In this case, the only thing you need to -change is the \csopt{gls}{number} key in the optional argument -to \csopt{gls}{counter}. Note that the new form of \ics{gls} also takes -a final optional argument which can be used to insert text into the -automatically generated text. - -\subsection{\texorpdfstring{\cs{glossary}}{\textbackslash glossary}} +The \styfmt{glossary} defines: +\begin{oldway} +\cmddefsyntax{}{oldgls} +\end{oldway} +The \styfmt{glossaries} package defines a command with the same +name, but be aware that it has a final optional argument: +\begin{newway} +\cmddefsyntax{}{gls} +\end{newway} +In this case, the only thing you need to +change is the \useglsopt{number} key in the optional argument +to \glsopt{counter}. The \meta{insert} optional argument in the +new form of \gls{gls} can be used to insert text into the +automatically generated text, which will put it inside the hyperlink +(if hyperlinks are supported). + +\subsection{\glsfmttext{glossary}} \label{sec:csglossary} When using the \styfmt{glossaries} package, you should not use -\ics{glossary} directly.\footnote{This is because \ics{glossary} -requires the argument to be in a specific format and doesn't use the -\meta{key}=\meta{value} format that the old glossary package used. -The new package's internal commands set this format, as well as +\gls{glossary}. This is because the appropriate indexing syntax (including escaping any of \app{makeindex}'s or \app{xindy}'s special -characters. What's more, the format has changed as from v1.17 to -allow the new package to be used with either \app{makeindex} or -\app{xindy}.} If, with the old package, you have opted to -explicitly use \ics{glossary} instead of storing the glossary -information with \ics{storeglosentry}, then converting from +characters) is generated when the entry is defined. This reduces +overall complexity as it no longer needs to be performed every time +an entry is indexed. By placing the glossary definitions within the +preamble, it also reduces the chance that the indexing special +character may have their category code changed, which can cause +interference. + +If, with the old package, you have opted to +explicitly use \gls{glossary} instead of storing the glossary +information with \gls{storeglosentry}, then converting from \styfmt{glossary} to \styfmt{glossaries} will be more time-consuming, -although in the end, I hope you will see the benefits.\footnote{From -the user's point of view, using \ics{glossary} throughout the +although in the end, I hope you will see the benefits. From +the user's point of view, using \gls{glossary} throughout the document is time consuming, and if you use it more than once for the same term, there's a chance extra spaces may creep in which will cause \app{makeindex} to treat the two entries as different -terms, even though they look the same in the document.} If you have -used \ics{glossary} with the old glossary package, you will instead +terms, even though they look the same in the document. If you have +used \gls{glossary} with the old glossary package, you will instead need to define the relevant glossary terms using -\ics{newglossaryentry} and reference the terms using -\ics{glsadd}, \ics{glslink}, \ics{gls} etc. +\gls{newglossaryentry} and reference the terms using +\gls{glsadd}, \gls{glslink}, \gls{gls} etc. If you don't like the idea of continually scrolling back to the -preamble to type all your \ics{newglossaryentry} commands, you may +preamble to type all your \gls{newglossaryentry} commands, you may prefer to create a new file, in which to store all these commands, and then input that file in your document's preamble. Most text editors and front-ends allow you to have multiple files open, and @@ -377,158 +735,158 @@ you can tab back and forth between them. In the \styfmt{glossary} package, acronyms were treated differently to glossary entries. This resulted in inconsistencies and sprawling unmaintainable code. The new \styfmt{glossaries} package treats -acronyms in exactly the same way as normal glossary terms. In fact, -in the \styfmt{glossaries} package, the default definition of: +acronyms in exactly the same way as normal glossary terms. + +Both packages provide \csfmt{newacronym}, but the syntax is +different. With the \styfmt{glossary} package, the syntax is: +\begin{oldway} +\cmddefsyntax{}{oldnewacronym} +\end{oldway} +With the \styfmt{glossaries} package, the default definition of: \begin{newway} -\ics{newacronym}\oarg{options}\marg{label}\marg{abbrv}\marg{long} +\cmddefsyntax{}{newacronym} \end{newway} is a shortcut for: \begin{newway} -\ics{newglossaryentry}\marg{label}\{type=\cs{acronymtype}, -name=\marg{abbrv}, -description=\marg{long}, -text=\marg{abbrv}, -first=\{\meta{long} (\meta{abbrv})\}, -plural=\{\meta{abbrv}s\}, -firstplural=\{\meta{long}s (\meta{abbrv}s)\}, -\meta{options}\} +\gls{newglossaryentry}\margm{label}\marg{type=\gls{acronymtype}, +\gloskeyval{name}{\meta{abbrv}}, +\gloskeyval{description}{\meta{long}}, +\gloskeyval{text}{\meta{abbrv}}, +\gloskeyval{first}{\meta{long} (\meta{abbrv})}, +\gloskeyval{plural}{\meta{abbrv}s}, +\gloskeyval{firstplural}{\meta{long}s (\meta{abbrv}s)}, +\meta{options}} \end{newway} +(Note that this shortcut default is an older method of defining +acronyms. If you use \gls{setacronymstyle} introduced to +\styfmt{glossaries} v4.02, then a more flexible method is adopted.) This is different to the \styfmt{glossary} package which set the -\csopt{newglossaryentry}{name} key to \meta{long} (\meta{abbrv}) and +\storegloskey{name} key to \meta{long} (\meta{abbrv}) and allowed you to set a description using the -\csopt{newglossaryentry}{description} key. If you still want to do +\storegloskey{description} key. If you still want to do this, you can use one of the description styles, such as \acrstyle{long-short-desc}, and use -the \csopt{newglossaryentry}{description} key in the optional -argument of \ics{newacronym}. +the \gloskey{description} key in the optional +argument of \gls{newacronym}. For example, if your document originally had the following: -\begin{verbatim} -\newacronym{SVM}{Support Vector Machine}{description=Statistical -pattern recognition technique} -\end{verbatim} +\begin{oldway} +\gls{oldnewacronym}\marg{SVM}\marg{Support Vector Machine}\marg{\storegloskeyval{description}{Statistical +pattern recognition technique}} +\end{oldway} Then you would need to first set the style: -\begin{verbatim} -\setacronymstyle{long-short-desc} -\end{verbatim} +\begin{newway} +\gls{setacronymstyle}\marg{\acrstyle{long-short-desc}} +\end{newway} and change the acronym definition to: -\begin{verbatim} -\newacronym[description=Statistical pattern recognition -technique]{svm}{SVM}{Support Vector Machine} -\end{verbatim} +\begin{newway} +\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition +technique}}\marg{svm}\marg{SVM}\marg{Support Vector Machine} +\end{newway} You can then reference the acronym using any of the new referencing -commands, such as \ics{gls} or \ics{glsadd}. +commands, such as \gls{gls} or \gls{glsadd}. With the old \styfmt{glossary} package, when you defined an -acronym, it also defined a command \cs{}\meta{acr-name} which +acronym, it also defined a command \gls{acr-name} which could be used to display the acronym in the text. So the -above SVM example would create the command \cs{SVM} with the old +above SVM example would create the command \csfmt{SVM} with the old package. In the new \styfmt{glossaries} package, the acronyms are just another type of glossary entry, so they are displayed using -\ics{gls}\marg{label}. Therefore, in the above example, you will -also need to replace all occurrences of \cs{SVM} with -\verb|\gls{svm}|. +\code{\gls{gls}\margm{label}}. Therefore, in the above example, you will +also need to replace all occurrences of \csfmt{SVM} with +\code{\gls{gls}\marg{svm}}. -If you have used \ics{useacronym} instead of \cs{}\meta{acr-name}, +If you have used \gls{useacronym} instead of \gls{acr-name}, then you will need to replace all occurrences of \begin{oldway} -\ics{useacronym}\oarg{insert}\marg{acr-name} +\cmddefsyntax{}{useacronym} \end{oldway}% with \begin{newway} -\ics{gls}\marg{label}\oarg{insert} +\gls{gls}\margm{label}\oargm{insert} \end{newway}% -Note that the starred versions of \ics{useacronym} and -\cs{}\meta{acr-name} (which make the first letter uppercase) should -be replaced with \ics{Gls}\marg{label}. +Note that the starred versions of \gls{useacronym} and +\gls{acr-name} (which make the first letter uppercase) should +be replaced with \code{\gls{Gls}\margm{label}}. Alternatively (as from v1.18 of the \styfmt{glossaries} package), -you can use \ics{oldacronym} which uses the same syntax as -the old \styfmt{glossary} package's \ics{newacronym} and also -defines \cs{}\meta{acr-name}. +you can use \gls{oldacronym} which uses the same syntax as +the old \styfmt{glossary} package's \gls{oldnewacronym} and also +defines \gls{acr-name}. For example, if your document originally had the following: \begin{oldway} -\begin{verbatim} -\newacronym{SVM}{Support Vector Machine}{description=Statistical -pattern recognition technique} -\end{verbatim} +\gls{oldnewacronym}\marg{SVM}\marg{Support Vector Machine}\marg{\storegloskeyval{description}{Statistical +pattern recognition technique}} \end{oldway} then you can change this to: \begin{newway} -\begin{verbatim} -\oldacronym{SVM}{Support Vector Machine}{description=Statistical -pattern recognition technique} -\end{verbatim} +\gls{oldacronym}\marg{SVM}\marg{Support Vector Machine}\marg{\gloskeyval{description}{Statistical +pattern recognition technique}} \end{newway} -You can then continue to use \cs{SVM}\@. However, remember that +You can then continue to use \csfmt{SVM}\@. However, remember that \LaTeX\ generally ignores spaces after command names that consist of alphabetical characters. You will therefore need to force a space -after \cs{}\meta{acr-name}, unless you also load the \styfmt{xspace} -package. (See -\xrsectionref{sec:acronyms}{glossaries-user}{Acronyms} -of the \styfmt{glossaries} documentation for further -details.) Note that \ics{oldacronym} uses its first argument to -define the acronym's label (as used by commands like \ics{gls}), so -in the above example, with the new \styfmt{glossaries} package, -\cs{SVM} becomes a shortcut for \verb|\gls{SVM}| and \cs{SVM*} -becomes a shortcut for \verb|\Gls{SVM}|. - -\subsection{\texorpdfstring{\cs{acrln} and -\cs{acrsh}}{\textbackslash acrln and \textbackslash acrsh}} +after \gls{acr-name}, unless you also load the \sty{xspace} package. +(See the \qt{Acronyms} of the \styfmt{glossaries} documentation for +further details.) Note that \gls{oldacronym} uses its first argument +to define the acronym's label (as used by commands like \gls{gls}), +so in the above example, with the new \styfmt{glossaries} package, +\csfmt{SVM} becomes a shortcut for \code{\gls{gls}\marg{SVM}} and +\csfmt{SVM*} becomes a shortcut for \code{\gls{Gls}\marg{SVM}}. + +\subsection{\glsfmttext{acrln} and \glsfmttext{acrsh}} +\label{sec:acrlnsh} In the \styfmt{glossary} package, it is possible to produce the long and short forms of an acronym without adding an entry to -the glossary using \ics{acrln} and \ics{acrsh}. With the +the glossary using \gls{acrln} and \gls{acrsh}. With the \styfmt{glossaries} package (provided you defined the acronym using -\ics{newacronym} or \ics{oldacronym} and provided you haven't -redefined \ics{newacronym}) +\gls{newacronym} or \gls{oldacronym} and provided you haven't +redefined \gls{newacronym}) you can replace \begin{oldway} -\ics{acrsh}\marg{acr-name} +\cmddefsyntax{}{acrsh} \end{oldway}% with \begin{newway} -\ics{acrshort}\marg{label} +\cmddefsyntax{}{acrshort} \end{newway}% and you can replace \begin{oldway} -\ics{acrln}\marg{acr-name} +\cmddefsyntax{}{acrln} \end{oldway}% with \begin{newway} -\ics{acrlong}\marg{label} +\cmddefsyntax{}{acrlong} \end{newway}% The \styfmt{glossaries} package also provides the related commands -\ics{acrshortpl} (plural short form) and \ics{acrlongpl} (plural long +\gls{acrshortpl} (plural short form) and \gls{acrlongpl} (plural long form) as well as upper case variations. If you use the \styfmt{glossaries} \qt{shortcuts} package option, you can use -\ics{acs} in place of \ics{acrshort} and \ics{acl} in place of -\ics{acrlong}. +\gls{acs} in place of \gls{acrshort} and \gls{acl} in place of +\gls{acrlong}. -See -\xrsectionref{sec:acronyms}{glossaries-user}{Acronyms} +See the \qt{Acronyms} of the \styfmt{glossaries} manual for further details of how to use these commands. -\subsection{\texorpdfstring{\cs{ifacronymfirstuse}}{\textbackslash -ifacronymfirstuse}} +\subsection{\glsfmttext{ifacronymfirstuse}} The \styfmt{glossary} package command \begin{oldway} -\ics{ifacronymfirstuse}\marg{acr-name}\marg{text1}\marg{text2} +\cmddefsyntax{}{ifacronymfirstuse} \end{oldway}% can be replaced by the \styfmt{glossaries} command: \begin{newway} -\ics{ifglsused}\marg{label}\marg{text2}\marg{text1} +\cmddefsyntax{}{ifglsused} \end{newway}% -Note that \ics{ifglsused} evaluates the opposite condition to -that of \ics{ifacronymfirstuse} which is why the last two arguments +Note that \gls{ifglsused} evaluates the opposite condition to +that of \gls{ifacronymfirstuse} which is why the last two arguments have been reversed. -\subsection{\texorpdfstring{\cs{resetacronym} and -\cs{unsetacronym}}{\textbackslash resetacronym and \textbackslash -unsetacronym}} +\subsection{\glsfmttext{resetacronym} and \glsfmttext{unsetacronym}} +\label{sec:unreset} The \styfmt{glossary} package allows you to reset and unset the acronym flag which is used to determine whether the acronym has @@ -536,108 +894,110 @@ been used in the document. The \styfmt{glossaries} package also provides a means to do this on either a local or a global level. To reset an acronym, you will need to replace: \begin{oldway} -\ics{resetacronym}\marg{acr-name} +\cmddefsyntax{}{resetacronym} \end{oldway}% with either \begin{newway} -\ics{glsreset}\marg{label} +\cmddefsyntax{}{glsreset} \end{newway}% or \begin{newway} -\ics{glslocalreset}\marg{label} +\cmddefsyntax{}{glslocalreset} \end{newway} To unset an acronym, you will need to replace: \begin{oldway} -\ics{unsetacronym}\marg{acr-name} +\cmddefsyntax{}{unsetacronym} \end{oldway}% with either \begin{newway} -\ics{glsunset}\marg{label} +\cmddefsyntax{}{glsunset} \end{newway}% or \begin{newway} -\ics{glslocalunset}\marg{label} +\cmddefsyntax{}{glslocalunset} \end{newway} To reset all acronyms, you will need to replace: \begin{oldway} -\ics{resetallacronyms} +\cmddefsyntax{}{resetallacronyms} \end{oldway} with \begin{newway} -\ics{glsresetall}[\ics{acronymtype}] +\gls{glsresetall}\oarg{\gls{acronymtype}} \end{newway} or \begin{newway} -\ics{glslocalresetall}[\ics{acronymtype}] +\gls{glslocalresetall}\oarg{\gls{acronymtype}} \end{newway} To unset all acronyms, you will need to replace: \begin{oldway} -\ics{unsetallacronyms} +\cmddefsyntax{}{unsetallacronyms} \end{oldway} with \begin{newway} -\ics{glsunsetall}[\ics{acronymtype}] +\gls{glsunsetall}\oarg{\gls{acronymtype}} \end{newway} or \begin{newway} -\ics{glslocalunsetall}[\ics{acronymtype}] +\gls{glslocalunsetall}\oarg{\gls{acronymtype}} \end{newway} \section{Displaying the glossary} +\label{sec:printgloss} -The \styfmt{glossary} package provides the command \ics{printglossary} -(or \cs{print}\meta{type} for other glossary types) which +The \styfmt{glossary} package provides the command \gls{oldprintglossary} +(or \gls{printtype} for other glossary types) which can be used to print individual glossaries. The \styfmt{glossaries} -package provides the command \ics{printglossaries} which +package provides the command \gls{printglossaries} which will print all the glossaries which have been defined, or -\ics{printglossary}\oarg{options} to print individual glossaries. -So if you just have \ics{printglossary}, then you can leave it as +\cmddefsyntax{}{printglossary} to print individual glossaries. +So if you just have \gls{oldprintglossary}, then you can leave it as it is, but if you have, say: -\begin{verbatim} -\printglossary -\printglossary[acronym] -\end{verbatim} +\begin{oldway} +\gls{oldprintglossary} +\gls{oldprintglossary}\oarg{acronym} +\end{oldway} or -\begin{verbatim} -\printglossary -\printacronym -\end{verbatim} +\begin{oldway} +\gls{oldprintglossary} +\gls{printacronym}* +\end{oldway} then you will need to replace this with either -\begin{verbatim} -\printglossaries -\end{verbatim} +\begin{newway} +\gls{printglossaries} +\end{newway} or -\begin{verbatim} -\printglossary -\printglossary[type=\acronymtype] -\end{verbatim} +\begin{newway} +\gls{printglossary} +\gls{printglossary}\oarg{type=\gls{acronymtype}} +\end{newway} The \styfmt{glossary} package allows you to specify a short title (for the table of contents and page header) by defining a command of -the form \cs{short}\meta{glossary-type}\texttt{name}. The +the form \gls{shortglossary-typename}. The \styfmt{glossaries} package doesn't do this, but instead provides -the \csopt{printglossary}{toctitle} key which can be used in the -optional argument to \ics{printglossary}. For example, if you have -created a new glossary type called \texttt{notation}, and you had +the \printglossopt{toctitle} key which can be used in the +optional argument to \gls{printglossary}. For example, if you have +created a new glossary type called \code{notation}, and you had defined -\begin{verbatim} -\newcommand{\shortnotationname}{Notation} -\end{verbatim} -then you would need to use the \csopt{printglossary}{toctitle} key: -\begin{verbatim} -\printglossary[type=notation,toctitle=Notation] -\end{verbatim} -The \styfmt{glossaries} package will ignore \ics{shortnotationname}, +\begin{oldway} +\cmd{newcommand}\marg{\cmd{shortnotationname}}\marg{Notation} +\end{oldway} +then you would need to use the \printglossopt{toctitle} key: +\begin{newway} +\gls{printglossary}\oarg{\printglossoptval{type}{notation},\printglossoptval{toctitle}{Notation}} +\end{newway} +The \styfmt{glossaries} package will ignore \csfmt{shortnotationname}, so unless you have used it elsewhere in the document, you may as well remove the definition. \section{Processing Your Document} +\label{sec:makeglos} If you convert your document from using the \styfmt{glossary} package to the \styfmt{glossaries} package, you will need to delete any of -the additional files, such as the \filetype{.glo} file, that were +the additional files, such as the \ext+{glo} file, that were created by the \styfmt{glossary} package, as the \styfmt{glossaries} package uses a different format. Remember also, that if you used the \app{makeglos} Perl script, @@ -651,17 +1011,18 @@ non-English documents. If you use the extension package, \app{bib2gls} instead (which also provides multilingual support). For further information on using \app{makeglossaries}, -\app{makeindex} or \app{xindy} to create your glossaries, see -\xrsectionref{sec:makeglossaries}{glossaries-user}{Generating the -Associated Glossary Files} -of the \styfmt{glossaries} documentation. +\app{makeindex} or \app{xindy} to create your glossaries, see the +\qt{Generating the Associated Glossary Files} section of the +\styfmt{glossaries} documentation. \section{Troubleshooting} +\label{sec:troubleshooting} -Please check the \urlfootref{http://www.dickimaw-books.com/faqs/glossariesfaq.html}{FAQ} +Please check the \dickimawhref{faqs/glossariesfaq.html}{FAQ} for the \styfmt{glossaries} package if you have any problems. -\PrintIndex +\printterms +\printuserguideindex \end{document} diff --git a/macros/latex/contrib/glossaries/makeglossaries b/macros/latex/contrib/glossaries/makeglossaries index b37d882285..67afb1a826 100755 --- a/macros/latex/contrib/glossaries/makeglossaries +++ b/macros/latex/contrib/glossaries/makeglossaries @@ -2,13 +2,13 @@ # File : makeglossaries # Author : Nicola Talbot -# Version : 4.49 +# Version : 4.50 # Description: simple Perl script that calls makeindex or xindy. # Intended for use with "glossaries.sty" (saves having to remember # all the various switches) # This file is distributed as part of the glossaries LaTeX package. -# Copyright 2019 Nicola L.C. Talbot +# Copyright 2007-2022 Nicola L.C. Talbot # This work may be distributed and/or modified under the # conditions of the LaTeX Project Public License, either version 1.3 # of this license or any later version. @@ -28,12 +28,18 @@ # glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, # glossary-tree.sty, glossaries-compatible-207.sty, # glossaries-compatible-307.sty, glossaries-accsupp.sty, -# glossaries-babel.sty, glossaries-polyglossia.sty, glossaries.perl. +# glossaries-babel.sty, glossaries-polyglossia.sty, glossaries.l2h. # Also makeglossaries and makeglossaries-lite.lua. -my $version="4.49 (2021-11-01)"; +my $version="4.50 (2022-10-14)"; # History: +# v4.50: +# * Added -e (don't fix encap clashes) +# * Add check for glsignore with encap clashes +# * Don't fix encap clash if counter or prefix different +# * Added check for illegal page +# * Added brazil, brazilian, canadian and canadien mappings # v4.48-4.49: # * No change. (Version number updated in line with glossaries.sty) # v4.47: @@ -142,9 +148,10 @@ use strict; use warnings; # v2.05 added $opt_d # v2.08 added $opt_x and $opt_m +# v4.50 added $opt_e use vars qw($opt_q $opt_t $opt_o $opt_s $opt_p $opt_g $opt_c $opt_r $opt_l $opt_i $opt_L $opt_n $opt_C $opt_d $opt_x $opt_m $opt_Q - $opt_k); + $opt_k $opt_e); $Getopt::Std::STANDARD_HELP_VERSION = 1; @@ -153,7 +160,7 @@ $Getopt::Std::STANDARD_HELP_VERSION = 1; # .tex file) # v1.5 added -n (print the command that would be issued but # don't actually run the command) -getopts('s:o:t:p:L:C:ilqQkrcgnd:x:m:'); +getopts('s:o:t:p:L:C:ilqQkrcgnd:x:m:e'); unless ($#ARGV == 0) { @@ -169,7 +176,11 @@ my %languagemap = ( 'american' => 'english', 'austrian' => 'german', + 'brazil' => 'portuguese',# v4.50 + 'brazilian' => 'portuguese',# v4.50 'british' => 'english', + 'canadian' => 'english',# v4.50 + 'canadien' => 'french',# v4.50 'francais' => 'french', 'frenchb' => 'french', 'germanb' => 'german', @@ -242,10 +253,11 @@ my %xindy_error_text = "\nRemember to use package option 'nomain' if you don't\n". "want to use the main glossary.", #v2.21: fixed spelling of \GlsAddXdyLocation +#v4.50: added reference to esclocations 'badlocation' => "You may have forgotten to add a location \n" . "class with \\GlsAddXdyLocation or you may have \n" - . "the format incorrect.\n", + . "the format incorrect or you may need \nthe package option esclocations=true.\n", 'comp207' => "You may need to add 'compatible-2.07' package option.", 'noxdyfile' => "Style file not found. (Have you used \\noist by mistake?)" ); @@ -363,6 +375,8 @@ unless ($istfile) my $xindyapp = ($opt_x ? $opt_x :'xindy'); my $makeindexapp = ($opt_m ? $opt_m :'makeindex'); +my $fixencapclash = ($opt_e ? 0 : 1); + # v2.11 check for backslash character if on Windows if ($^O=~/Win/) { @@ -386,6 +400,8 @@ my $mkidxopts = ''; if ($opt_i) { +# This option is of limited use as the basename must be supplied to +# makeglossaries $mkidxopts .= " -i"; } @@ -545,7 +561,7 @@ if ($ext) else { &makeindex("$name.$ext",$outfile,$transcript,$istfile, - $mkidxopts,$opt_q, $opt_n, $makeindexapp, 1); + $mkidxopts,$opt_q, $opt_n, $makeindexapp, $fixencapclash); } @@ -672,7 +688,7 @@ else else { &makeindex($inputfile,$outfile,$transcript, - $istfile,$mkidxopts,$opt_q,$opt_n, $makeindexapp, 1); + $istfile,$mkidxopts,$opt_q,$opt_n, $makeindexapp, $fixencapclash); } } } @@ -952,7 +968,16 @@ sub run_app{ } } - if ($log=~/\(0 entries accepted,/ + my $accepted = 1; + my $rejected = 0; + + if ($log=~/\((\d+) entries accepted, (\d+) rejected\)/) + { + $accepted = $1; + $rejected = $2; + } + + if ($accepted == 0 or $rejected > 0 or ( ($log=~/(\d+) warnings?/ and $1 gt 0)) or $log=~/not found/) { @@ -972,8 +997,9 @@ sub run_app{ $errno = $xdynotist; last; } - elsif (/## Warning \(.*\):\s*$/) + elsif (/## Warning \(.*\):\s*$/ or /^!! Input index error/) { + # v4.50: added check for Input index error $warnings .= $_ . ; } } @@ -1023,7 +1049,7 @@ sub makeindex{ "\nPossible cause of problem:\n\n". $diagnostic . "\n\n": "\n" ), - "Check '$trans' for details\n"; + "Exit status: $errno. Check '$trans' for details\n"; } # 2.18: added check and repair for multiple encaps @@ -1031,14 +1057,96 @@ sub makeindex{ { warn $warnings unless $quiet; - if ($repairencaps and $warnings=~/multiple encaps/) + my $multiencaps = $repairencaps and ($warnings=~/multiple encaps/); + + # 4.50: added check for illegal page and cs in page + + my $illegalpage = ($warnings=~/Illegal [A-Za-z]+ (number|digit)/); + + # 'Illegal space within numerals in second argument' + # and 'No closing delimiter for second argument' most likely + # mean that a command has ended up in the location + + my $csinlocation = ($warnings=~/(Illegal space|No closing delimiter).* second argument/); + + # 4.50: added check for illegal page number + if ($multiencaps or $illegalpage or $csinlocation) { unless ($quiet) { - print "Multiple encaps detected. Attempting to remedy.\n"; + my $msg = ''; + + if ($multiencaps) + { + $msg = "multiple encaps"; + } + + if ($illegalpage) + { + if ($msg) + { + $msg .= ', '; + } + + $msg .= "illegal page number"; + } + + if ($csinlocation) + { + if ($msg) + { + $msg .= ', '; + } + + $msg .= "potential LaTeX commands in location"; + } + + print "Encap/location issue: $msg detected. Attempting to remedy.\n"; + print "Reading $in...\n"; } + my $page_invalid_regex = '[^a-zA-Z0-9\.]'; + my $pagecomp = '.'; + my $regexpagecomp = '\.'; + + if ($illegalpage) + { + # get the page compositor from the .ist file + if (open INFD, $ist) + { + while () + { + if (/page_compositor "(.)"/) + { + $pagecomp = $1; + last; + } + } + + close INFD; + } + else + { + warn "Can't open '$ist' $!\n"; + } + + if ($pagecomp eq '.' or $pagecomp eq '-' + or $pagecomp eq '\\'or $pagecomp eq ']') + { + $regexpagecomp = "\\$pagecomp"; + } + else + { + $regexpagecomp = $pagecomp; + } + + if ($pagecomp ne '.') + { + $page_invalid_regex = "[^a-zA-Z0-9$regexpagecomp]"; + } + } + # if $in can't be opened at this point something wrong # has occurred (otherwise how did makeindex manage to open # it?) @@ -1049,65 +1157,185 @@ sub makeindex{ while () { - if (/\\glossaryentry\{(.*)\|([^\|]*)\}\{(.*?)\}/) + # The encap usually starts with setentrycounter but may have + # ( or ) to indicate the start or end of a range. + # The encap will be glsseeformat for cross-references. + # \glossentry and \subglossentry may be preceded by + # \glsnonextpages or \glsnextpages + + if (/\\glossaryentry\{(.*(?:\\glossentry|\\subglossentry\{\d+\}))\{([^\|]*)\}\|([^\|]*)\}\{(.*)\}$/) { my %entry = ( - 'entry' => $1, - 'encap' => $2, - 'location' => $3 + 'entry' => "$1\{$2\}", + 'label' => $2, + 'encap' => $3, + 'location' => $4, + 'counter'=>'', + 'prefix'=>'' ); - my $add = 1; + # Find the page counter (not available with + # cross-references) + if ($entry{'encap'}=~/setentrycounter\[(.*)\]\{([a-zA-Z0-9]+)\}"\\/) + { + $entry{'prefix'} = $1; + $entry{'counter'} = $2; + } - for (my $idx = 0; $idx <= $#entries; $idx++) + # First move any commands out of the location. + if ($csinlocation) { - my $existing = $entries[$idx]; + my $loc = $entry{'location'}; + my $encap = $entry{'encap'}; - if ($entry{'entry'} eq $existing->{'entry'} - and $entry{'location'} eq $existing->{'location'} - and $entry{'encap'} ne $existing->{'encap'}) + # This is only designed for locations in the form + # \cs{num} but allow for \protect\cs + if ($loc=~m/^(?:\\protect *)?\\([A-Za-z\@]+) *\{(.*)\}$/) { - $add = 0 if ($add == 1); + my $cs = $1; + $loc = $2; - # Range encaps should take precedence. + # Normal glossary indexing will have the encap + # start with setentrycounter[prefix]{counter} + # This won't match a cross-reference (see) but + # that has its location always set to Z. - if ($entry{'encap'}=~/^[\(\)]/) + if ($encap=~/^(setentrycounter\[.*\]\{.*\}"\\)(.*)$/) { - $add = 2; + $entry{'encap'} = "$1glslocationcstoencap\{$2\}\{$cs\}"; - if ($existing->{'encap'}=~/^[\(\)]/) + unless ($quiet) { - # too complicated, keep both - - last; + print "Invalid location '$entry{location}' detected for entry '$entry{label}'. Replaced with '$loc'\n"; } - else - { - # remove existing + } + elsif (not $quiet) + { + warn "Invalid location '$entry{location}' detected for entry '$entry{label}' has unexpected encap '$encap'. Location replaced with '$loc'\n"; + } + + $entry{'location'} = $loc; + } + } - splice @entries, $idx, 1; + if ($illegalpage) + { + my $loc = $entry{'location'}; - $idx--; - } + if ($loc=~s/($page_invalid_regex)+/$pagecomp/g) + { + unless ($quiet) + { + print "Invalid location '$entry{location}' detected for entry '$entry{label}'. Replaced with '$loc'\n"; } - elsif ($existing->{'encap'}=~/^[\(\)]/) + + } + + if ($loc=~s/^($regexpagecomp)+//) + { + unless ($quiet) { - if ($entry{'encap'}=~/^[\(\)]/) - { - # too complicated, keep both + print "Invalid location '$entry{location}' (starts with page compositor) detected for entry '$entry{label}'. Replaced with '$loc'\n"; + } + } - $add = 1; - last; - } - # (otherwise drop new entry) + if ($loc=~s/($regexpagecomp)+$//) + { + unless ($quiet) + { + print "Invalid location '$entry{location}' (ends with page compositor) detected for entry '$entry{label}'. Replaced with '$loc'\n"; } - elsif (&encap_overrides($entry{'encap'}, - $existing->{'encap'})) + } + + if ($loc eq '') + { + unless ($quiet) { - $entries[$idx] = \%entry; + print "Invalid empty location detected for entry '$entry{label}'. Replaced with 0 (encap: glsignore).\n"; } - } + + $loc = '0'; + $entry{'encap'} = 'glsignore'; + } + + $entry{'location'} = $loc; + } + + my $add = 1; + + if ($multiencaps) + { + for (my $idx = 0; $idx <= $#entries; $idx++) + { + my $existing = $entries[$idx]; + + #v4.50: added check for prefix and counter + # Since the encap includes the prefix and + # counter information, the same location and + # format for different counters or prefixes + # will be considered an encap clash by + # makeindex, but shouldn't be merged. + + if ($entry{'entry'} eq $existing->{'entry'} + and $entry{'location'} eq $existing->{'location'} + and $entry{'prefix'} eq $existing->{'prefix'} + and $entry{'counter'} eq $existing->{'counter'} + and $entry{'encap'} ne $existing->{'encap'}) + { + unless ($quiet) + { + if ($entry{'counter'} eq '' and $entry{'location'} eq 'Z') + { + print "Encap clash for entry '$entry{label}' possibly caused by multiple cross-reference instances\n"; + } + else + { + print "Encap clash detected for entry '$entry{label}', counter: '$entry{counter}', location: '$entry{location}'. Encap '$entry{encap}' clashes with '$existing->{'encap'}'\n"; + } + } + + $add = 0 if ($add == 1); + + # Range encaps should take precedence. + + if ($entry{'encap'}=~/^[\(\)]/) + { + $add = 2; + + if ($existing->{'encap'}=~/^[\(\)]/) + { + # too complicated, keep both + + last; + } + else + { + # remove existing + + splice @entries, $idx, 1; + + $idx--; + } + } + elsif ($existing->{'encap'}=~/^[\(\)]/) + { + if ($entry{'encap'}=~/^[\(\)]/) + { + # too complicated, keep both + + $add = 1; + last; + } + # (otherwise drop new entry) + } + elsif (&encap_overrides($entry{'encap'}, + $existing->{'encap'})) + { + $entries[$idx] = \%entry; + } + } + } } push @entries, \%entry if $add > 0; @@ -1156,10 +1384,20 @@ sub makeindex{ # as it would need a corresponding LaTeX command. (bib2gls deals # with this better through its --map-formats switcn.) # 2.21 check for range encap moved earlier +# 4.50 add check for glsignore sub encap_overrides{ my ($newencap, $existing) = @_; + if ($newencap=~/\\glsignore\s*$/) + { + return 0; + } + elsif ($existing=~/\\glsignore\s*$/) + { + return 1; + } + ($existing=~/\\glsnumberformat\s*$/ or $newencap!~/\\glsnumberformat\s*$/ ) } @@ -1189,58 +1427,114 @@ sub xindy{ } # most languages work with xindy's default codepage, but - # some don't, so if the codepage isn't specific, check + # some don't, so if the codepage isn't specified, check # the known cases that will generate an error # and supply a default. (For all other cases, it's up to the # user to supply a codepage.) + # + # Now that glossaries.sty v4.50 will default to 'utf8' if + # \inputencodingname hasn't been defined or is empty, this also + # needs to check 'utf8'. # v2.01 changed 'if ($codepage eq "")' to 'unless ($codepage)' - unless ($codepage) +# v4.50 changed to conditional to include encoding without modifiers + + if ($codepage eq '' or $codepage=~/^utf8|latin\d+|cp\d+$/) { if ($language eq 'dutch') { - $codepage = "ij-as-ij"; + if ($codepage eq '') + { + $codepage = "ij-as-ij"; + } + else + { + $codepage = "ij-as-ij-$codepage"; + } } elsif ($language eq 'german') { - $codepage = "din5007"; + if ($codepage eq '') + { + $codepage = "din5007"; + } + else + { + $codepage = "din5007-$codepage"; + } } elsif ($language eq 'gypsy') { - $codepage = "northrussian"; + if ($codepage eq '') + { + $codepage = "northrussian"; + } + else + { + $codepage = "northrussian-$codepage"; + } } - elsif ($language eq 'hausa') + elsif ($language eq 'hausa' and $codepage eq '') { - $codepage = "utf"; + $codepage = "utf8"; } - elsif ($language eq 'klingon') + elsif ($language eq 'klingon' and $codepage eq '') { - $codepage = "utf"; + $codepage = "utf8"; } - elsif ($language eq 'latin') + elsif ($language eq 'latin' and $codepage eq '') { - $codepage = "utf"; + $codepage = "utf8"; } elsif ($language eq 'mongolian') { - $codepage = "cyrillic"; + if ($codepage eq '') + { + $codepage = "cyrillic"; + } + else + { + $codepage = "cyrillic-$codepage"; + } } elsif ($language eq 'slovak') { - $codepage = "small"; + if ($codepage eq '') + { + $codepage = "small"; + } + else + { + $codepage = "small-$codepage"; + } } elsif ($language eq 'spanish') { - $codepage = "modern"; + if ($codepage eq '') + { + $codepage = "modern"; + } + else + { + $codepage = "modern-$codepage"; + } } elsif ($language eq 'vietnamese') { - $codepage = "utf"; + if ($codepage eq '') + { + $codepage = "utf8"; + } + else + { + $codepage = "utf8-$codepage"; + } } } elsif ($language eq 'german' and $codepage!~/(din5007|duden|braille)/) { #v2.16 added check for german din/duden +#v4.50 now redundant? may be removed in the next version $codepage = "din5007-$codepage"; } @@ -1535,6 +1829,7 @@ sub HELP_MESSAGE{ print "(See makeindex documentation for further details on these "; print "options.)\n\n"; print "-c\t\tCompress intermediate blanks.\n"; + print "-e\t\tDon't attempt to fix multiple encaps.\n"; print "-g\t\tEmploy German word ordering.\n"; print "-p \tSet the starting page number to be .\n"; print "-r\t\tDisable implicit page range formation.\n"; @@ -1567,7 +1862,7 @@ makeglossaries - Calls makeindex/xindy for LaTeX documents using glossaries pac B [B<-o> I] [B<-q>] [B<-Q>] [B<-k>] [B<-n>] [B<-s> I] [B<-t> I] [B<-L> I] [B<-c>] [B<-g>] [B<-l>] [B<-p> I] [B<-r>] [B<-d> I] [B<-m> I] [B<-x> I] -[B<--version>] [B<--help>] I +[B<-e>] [B<--version>] [B<--help>] I =head1 DESCRIPTION @@ -1584,38 +1879,27 @@ the option arguments to B. =over 4 -=item B<-q> - -Quiet mode. Reduces chatter to standard output. - -=item B<-Q> - -Silences warning about being unable to fork. +=item B<-e> -=item B<-k> - -Don't try forking with piped redirection. (Lessens the -effect of -q) +Don't attempt to repair multiple encaps or illegal page number (B only). -=item B<-n> +=item B<-c> -Print the commands that would normally be executed but don't run them. +Compress intermediate blanks (B only). -=item B<-o> I +=item B<-d> I -Use I as the output file. (Only suitable for documents -containing a single glossary, otherwise each glossary will be -overridden.) +Specify the directory the .aux, .glo etc files are located. +Defaults to the parent directory of the base file I. -=item B<-s> I +=item B<-g> -Use I as the style file. Note that if you use this option, -you need to know whether B or B will be called, as -they have different style files. +Employ German word ordering (B only). -=item B<-t> I +=item B<-k> -Use I as the transcript file. +Don't try forking with piped redirection. (Lessens the +effect of -q) =item B<-l> @@ -1626,31 +1910,46 @@ Letter ordering. This option only has an effect if B is called. Sets the language. See B documentation for further details. -=item B<-c> +=item B<-m> I -Compress intermediate blanks (B only). +Specify the full path name for B to I in the +event that B isn't on the operating system's path. -=item B<-g> +=item B<-n> -Employ German word ordering (B only). +Print the commands that would normally be executed but don't run them. + +=item B<-o> I + +Use I as the output file. (Only suitable for documents +containing a single glossary, otherwise each glossary will be +overridden.) =item B<-p> I Sets the starting page number to be I (B only). +=item B<-q> + +Quiet mode. Reduces chatter to standard output. + +=item B<-Q> + +Silences warning about being unable to fork. + =item B<-r> -Disable implicit page range formation (B only). +=item B<-s> I -=item B<-d> I +Use I as the style file. Note that if you use this option, +you need to know whether B or B will be called, as +they have different style files. -Specify the directory the .aux, .glo etc files are located. -Defaults to the parent directory of the base file I. +=item B<-t> I -=item B<-m> I +Use I as the transcript file. -Specify the full path name for B to I in the -event that B isn't on the operating system's path. +Disable implicit page range formation (B only). =item B<-x> I diff --git a/macros/latex/contrib/glossaries/makeglossaries-lite.1 b/macros/latex/contrib/glossaries/makeglossaries-lite.1 index 24b1f7253b..1dd2705a1a 100644 --- a/macros/latex/contrib/glossaries/makeglossaries-lite.1 +++ b/macros/latex/contrib/glossaries/makeglossaries-lite.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "MAKEGLOSSARIES-LITE 1" -.TH MAKEGLOSSARIES-LITE 1 "2021-11-01" "perl v5.32.1" "makeglossaries-lite Lua Script" +.TH MAKEGLOSSARIES-LITE 1 "2022-10-17" "perl v5.34.1" "makeglossaries-lite Lua Script" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/macros/latex/contrib/glossaries/makeglossaries-lite.lua b/macros/latex/contrib/glossaries/makeglossaries-lite.lua index 3f735b6625..74a681d88b 100755 --- a/macros/latex/contrib/glossaries/makeglossaries-lite.lua +++ b/macros/latex/contrib/glossaries/makeglossaries-lite.lua @@ -14,7 +14,7 @@ use the Perl makeglossaries script. This file is distributed as part of the glossaries LaTeX package. - Copyright 2019 Nicola L.C. Talbot + Copyright 2015-2022 Nicola L.C. Talbot This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version. @@ -32,11 +32,11 @@ glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, - glossaries-babel.sty, glossaries-polyglossia.sty, glossaries.perl. + glossaries-babel.sty, glossaries-polyglossia.sty, glossaries.l2h. Also makeglossaries and makeglossaries-lite.lua. History: - * 4.48 - 4.49: + * 4.48 - 4.50: - no change. * 4.47: - Added hybrid instructions if record option detected but not \makeglossaries @@ -70,7 +70,7 @@ - changed first line from lua to texlua --]] -thisversion = "4.49 (2021-11-01)" +thisversion = "4.50 (2022-10-14)" quiet = false dryrun = false diff --git a/macros/latex/contrib/glossaries/makeglossaries.1 b/macros/latex/contrib/glossaries/makeglossaries.1 index 93fd8e53cc..145810ba33 100644 --- a/macros/latex/contrib/glossaries/makeglossaries.1 +++ b/macros/latex/contrib/glossaries/makeglossaries.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "MAKEGLOSSARIES 1" -.TH MAKEGLOSSARIES 1 "2021-11-01" "perl v5.32.1" "makeglossaries Perl Script" +.TH MAKEGLOSSARIES 1 "2022-10-17" "perl v5.34.1" "makeglossaries Perl Script" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -145,7 +145,7 @@ makeglossaries \- Calls makeindex/xindy for LaTeX documents using glossaries pa \&\fBmakeglossaries\fR [\fB\-o\fR \fIfile\fR] [\fB\-q\fR] [\fB\-Q\fR] [\fB\-k\fR] [\fB\-n\fR] [\fB\-s\fR \fIfile\fR] [\fB\-t\fR \fIfile\fR] [\fB\-L\fR \fIlanguage\fR] [\fB\-c\fR] [\fB\-g\fR] [\fB\-l\fR] [\fB\-p\fR \fInum\fR] [\fB\-r\fR] [\fB\-d\fR \fIaux dir\fR] [\fB\-m\fR \fIfile\fR] [\fB\-x\fR \fIfile\fR] -[\fB\-\-version\fR] [\fB\-\-help\fR] \fIbasename\fR +[\fB\-e\fR] [\fB\-\-version\fR] [\fB\-\-help\fR] \fIbasename\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBmakeglossaries\fR is designed for use with LaTeX documents that @@ -158,16 +158,34 @@ also be contained in the auxiliary file, but may be overridden by the option arguments to \fBmakeglossaries\fR. .SH "OPTIONS" .IX Header "OPTIONS" -.IP "\fB\-q\fR" 4 -.IX Item "-q" -Quiet mode. Reduces chatter to standard output. -.IP "\fB\-Q\fR" 4 -.IX Item "-Q" -Silences warning about being unable to fork. +.IP "\fB\-e\fR" 4 +.IX Item "-e" +Don't attempt to repair multiple encaps or illegal page number (\fBmakeindex\fR only). +.IP "\fB\-c\fR" 4 +.IX Item "-c" +Compress intermediate blanks (\fBmakeindex\fR only). +.IP "\fB\-d\fR \fIaux dir\fR" 4 +.IX Item "-d aux dir" +Specify the directory the .aux, .glo etc files are located. +Defaults to the parent directory of the base file \fIfilename\fR. +.IP "\fB\-g\fR" 4 +.IX Item "-g" +Employ German word ordering (\fBmakeindex\fR only). .IP "\fB\-k\fR" 4 .IX Item "-k" Don't try forking with piped redirection. (Lessens the effect of \-q) +.IP "\fB\-l\fR" 4 +.IX Item "-l" +Letter ordering. +.IP "\fB\-L\fR \fIlanguage\fR" 4 +.IX Item "-L language" +This option only has an effect if \fBxindy\fR is called. Sets the +language. See \fBxindy\fR documentation for further details. +.IP "\fB\-m\fR \fIfile\fR" 4 +.IX Item "-m file" +Specify the full path name for \fBmakeindex\fR to \fIfile\fR in the +event that \fBmakeindex\fR isn't on the operating system's path. .IP "\fB\-n\fR" 4 .IX Item "-n" Print the commands that would normally be executed but don't run them. @@ -176,41 +194,29 @@ Print the commands that would normally be executed but don't run them. Use \fIfile\fR as the output file. (Only suitable for documents containing a single glossary, otherwise each glossary will be overridden.) +.IP "\fB\-p\fR \fInum\fR" 4 +.IX Item "-p num" +Sets the starting page number to be \fInum\fR (\fBmakeindex\fR only). +.IP "\fB\-q\fR" 4 +.IX Item "-q" +Quiet mode. Reduces chatter to standard output. +.IP "\fB\-Q\fR" 4 +.IX Item "-Q" +Silences warning about being unable to fork. +.IP "\fB\-r\fR" 4 +.IX Item "-r" +.PD 0 .IP "\fB\-s\fR \fIfile\fR" 4 .IX Item "-s file" +.PD Use \fIfile\fR as the style file. Note that if you use this option, you need to know whether \fBmakeindex\fR or \fBxindy\fR will be called, as they have different style files. .IP "\fB\-t\fR \fIfile\fR" 4 .IX Item "-t file" Use \fIfile\fR as the transcript file. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -Letter ordering. -.IP "\fB\-L\fR \fIlanguage\fR" 4 -.IX Item "-L language" -This option only has an effect if \fBxindy\fR is called. Sets the -language. See \fBxindy\fR documentation for further details. -.IP "\fB\-c\fR" 4 -.IX Item "-c" -Compress intermediate blanks (\fBmakeindex\fR only). -.IP "\fB\-g\fR" 4 -.IX Item "-g" -Employ German word ordering (\fBmakeindex\fR only). -.IP "\fB\-p\fR \fInum\fR" 4 -.IX Item "-p num" -Sets the starting page number to be \fInum\fR (\fBmakeindex\fR only). -.IP "\fB\-r\fR" 4 -.IX Item "-r" +.Sp Disable implicit page range formation (\fBmakeindex\fR only). -.IP "\fB\-d\fR \fIaux dir\fR" 4 -.IX Item "-d aux dir" -Specify the directory the .aux, .glo etc files are located. -Defaults to the parent directory of the base file \fIfilename\fR. -.IP "\fB\-m\fR \fIfile\fR" 4 -.IX Item "-m file" -Specify the full path name for \fBmakeindex\fR to \fIfile\fR in the -event that \fBmakeindex\fR isn't on the operating system's path. .IP "\fB\-x\fR \fIfile\fR" 4 .IX Item "-x file" Specify the full path name for \fBxindy\fR to \fIfile\fR in the diff --git a/macros/latex/contrib/glossaries/samples/glossary-lipsum-examples.pdf b/macros/latex/contrib/glossaries/samples/glossary-lipsum-examples.pdf index 1c122be642..5c76457ad5 100644 Binary files a/macros/latex/contrib/glossaries/samples/glossary-lipsum-examples.pdf and b/macros/latex/contrib/glossaries/samples/glossary-lipsum-examples.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/minimalgls.pdf b/macros/latex/contrib/glossaries/samples/minimalgls.pdf index 3cc3933031..bb10c4629e 100644 Binary files a/macros/latex/contrib/glossaries/samples/minimalgls.pdf and b/macros/latex/contrib/glossaries/samples/minimalgls.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/mwe-acr-desc.pdf b/macros/latex/contrib/glossaries/samples/mwe-acr-desc.pdf index 25e33fb118..0c2eda7825 100644 Binary files a/macros/latex/contrib/glossaries/samples/mwe-acr-desc.pdf and b/macros/latex/contrib/glossaries/samples/mwe-acr-desc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/mwe-acr.pdf b/macros/latex/contrib/glossaries/samples/mwe-acr.pdf index b791a5edd3..dd6a3f73b6 100644 Binary files a/macros/latex/contrib/glossaries/samples/mwe-acr.pdf and b/macros/latex/contrib/glossaries/samples/mwe-acr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/mwe-gls.pdf b/macros/latex/contrib/glossaries/samples/mwe-gls.pdf index 82529c18c4..0f5d902578 100644 Binary files a/macros/latex/contrib/glossaries/samples/mwe-gls.pdf and b/macros/latex/contrib/glossaries/samples/mwe-gls.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-FnDesc.pdf b/macros/latex/contrib/glossaries/samples/sample-FnDesc.pdf index 2b8cefeedf..dd9fb5e8fc 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-FnDesc.pdf and b/macros/latex/contrib/glossaries/samples/sample-FnDesc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-chap-hyperfirst.pdf b/macros/latex/contrib/glossaries/samples/sample-chap-hyperfirst.pdf index a72f7f531c..7537891ded 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-chap-hyperfirst.pdf and b/macros/latex/contrib/glossaries/samples/sample-chap-hyperfirst.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-crossref.pdf b/macros/latex/contrib/glossaries/samples/sample-crossref.pdf index c785978e59..820c303bf6 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-crossref.pdf and b/macros/latex/contrib/glossaries/samples/sample-crossref.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-custom-acronym.pdf b/macros/latex/contrib/glossaries/samples/sample-custom-acronym.pdf index bf869b5812..b5f310d937 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-custom-acronym.pdf and b/macros/latex/contrib/glossaries/samples/sample-custom-acronym.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-custom-acronym.tex b/macros/latex/contrib/glossaries/samples/sample-custom-acronym.tex index b148363a25..2104090518 100644 --- a/macros/latex/contrib/glossaries/samples/sample-custom-acronym.tex +++ b/macros/latex/contrib/glossaries/samples/sample-custom-acronym.tex @@ -24,8 +24,12 @@ % document the short form will be displayed in small caps, but in % the list of acronyms the short form is displayed in normal % capitals. To ensure this, the short form should be written in -% lower case when the acronym is defined, and \MakeTextUppercase is +% lower case when the acronym is defined, and \mfirstucMakeUppercase is % used when it's displayed in the list of acronyms. +% +% Note that if glossaries.sty v4.50+ detects mfirstuc.sty 2.08+ +% the textcase package will no longer be loaded so use +% \mfirstucMakeUppercase for uppercase. \newacronymstyle{custom-fn}% new style name {% Check for long form in case of a mixed glossary @@ -79,7 +83,7 @@ }% \renewcommand*{\ACRfullfmt}[3]{% \glslink[##1]{##2}{% - \MakeTextUppercase{% + \mfirstucMakeUppercase{% \glsentrylong{##2}##3\space (\acronymfont{\glsentryshort{##2}})% }% @@ -99,7 +103,7 @@ }% \renewcommand*{\ACRfullplfmt}[3]{% \glslink[##1]{##2}{% - \MakeTextUppercase{% + \mfirstucMakeUppercase{% \glsentrylongpl{##2}##3\space (\acronymfont{\glsentryshortpl{##2}})% }% @@ -113,7 +117,7 @@ % Set the name in the list of acronyms to the long form followed by % the short form (in upper case) in parentheses: \renewcommand*{\acronymentry}[1]{% - \Glsentrylong{##1}\space(\MakeTextUppercase{\glsentryshort{##1}})}% + \Glsentrylong{##1}\space(\mfirstucMakeUppercase{\glsentryshort{##1}})}% } % Now set the new acronym style (to override the default style) diff --git a/macros/latex/contrib/glossaries/samples/sample-dot-abbr.pdf b/macros/latex/contrib/glossaries/samples/sample-dot-abbr.pdf index e487ccebb0..415de9b64d 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-dot-abbr.pdf and b/macros/latex/contrib/glossaries/samples/sample-dot-abbr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-dual.pdf b/macros/latex/contrib/glossaries/samples/sample-dual.pdf index f32bd5aab9..dd2a36445a 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-dual.pdf and b/macros/latex/contrib/glossaries/samples/sample-dual.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-entrycount.pdf b/macros/latex/contrib/glossaries/samples/sample-entrycount.pdf index 072b30e709..5bc5ad9323 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-entrycount.pdf and b/macros/latex/contrib/glossaries/samples/sample-entrycount.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-entryfmt.pdf b/macros/latex/contrib/glossaries/samples/sample-entryfmt.pdf index 6cd63f1b08..fa01cc6365 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-entryfmt.pdf and b/macros/latex/contrib/glossaries/samples/sample-entryfmt.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-font-abbr.pdf b/macros/latex/contrib/glossaries/samples/sample-font-abbr.pdf index f08dd19aa9..828a70c734 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-font-abbr.pdf and b/macros/latex/contrib/glossaries/samples/sample-font-abbr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-ignored.pdf b/macros/latex/contrib/glossaries/samples/sample-ignored.pdf index ac12cd6b91..88ce084092 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-ignored.pdf and b/macros/latex/contrib/glossaries/samples/sample-ignored.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-index.pdf b/macros/latex/contrib/glossaries/samples/sample-index.pdf index 18aca297db..f0accb05b4 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-index.pdf and b/macros/latex/contrib/glossaries/samples/sample-index.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-inline.pdf b/macros/latex/contrib/glossaries/samples/sample-inline.pdf index 6698179ca6..d63413fcd9 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-inline.pdf and b/macros/latex/contrib/glossaries/samples/sample-inline.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-langdict.pdf b/macros/latex/contrib/glossaries/samples/sample-langdict.pdf index b977efca8e..7778924937 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-langdict.pdf and b/macros/latex/contrib/glossaries/samples/sample-langdict.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-newkeys.pdf b/macros/latex/contrib/glossaries/samples/sample-newkeys.pdf index 09848adde7..de675de872 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-newkeys.pdf and b/macros/latex/contrib/glossaries/samples/sample-newkeys.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.pdf b/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.pdf index a1b54f5bda..03dc07979d 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.pdf and b/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.tex b/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.tex index cec83e1d98..55650242df 100644 --- a/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.tex +++ b/macros/latex/contrib/glossaries/samples/sample-noidxapp-utf8.tex @@ -20,9 +20,12 @@ % main entries \newglossaryentry{elite}{% -% first character needs to be grouped if its an extended character -% otherwise first letter uppercasing (\Gls etc) won't work: - name={{é}lite}, +% With old LaTeX kernels and old versions of glossaries.sty and +% mfirstuc.sty, the first character needed to be grouped if +% its an extended character otherwise the sentence-case commands (\Gls etc) won't work: + name={{é}lite},% mfirstuc v2.07 + %name={élite},% mfirstuc v2.08 + sort={elite}, description={select group of people} } @@ -37,7 +40,9 @@ } \newglossaryentry{emigre}{% - name={{é}migré}, + name={{é}migré},% mfirstuc v2.07 + %name={émigré},% mfirstuc v2.08 + sort={emigre}, description={person who has emigrated to another country, especially for political reasons} } diff --git a/macros/latex/contrib/glossaries/samples/sample-noidxapp.pdf b/macros/latex/contrib/glossaries/samples/sample-noidxapp.pdf index 582a44bdb2..c9d5d71b91 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-noidxapp.pdf and b/macros/latex/contrib/glossaries/samples/sample-noidxapp.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-noidxapp.tex b/macros/latex/contrib/glossaries/samples/sample-noidxapp.tex index d675c795fc..0b3022116c 100644 --- a/macros/latex/contrib/glossaries/samples/sample-noidxapp.tex +++ b/macros/latex/contrib/glossaries/samples/sample-noidxapp.tex @@ -17,10 +17,12 @@ % main entries \newglossaryentry{elite}{% -% First letter must be grouped if it isn't a single character in -% order for the first letter uppercasing commands (\Gls etc) to -% work. - name={{\'e}lite}, +% With old LaTeX kernels and old versions of glossaries.sty and +% mfirstuc.sty, it was necessary to group the first letter if +% it isn't a single character in order for the sentence-case commands +% (\Gls etc) to work. + name={{\'e}lite}, % mfirstuc.sty v2.07 and lower + %name={\'elite},% mfirstuc.sty v2.08+ description={select group of people} } diff --git a/macros/latex/contrib/glossaries/samples/sample-nomathhyper.pdf b/macros/latex/contrib/glossaries/samples/sample-nomathhyper.pdf index ad89563aee..a5cf08ed9b 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-nomathhyper.pdf and b/macros/latex/contrib/glossaries/samples/sample-nomathhyper.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-numberlist.pdf b/macros/latex/contrib/glossaries/samples/sample-numberlist.pdf index 11a2b3cb9d..083cd7f66d 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-numberlist.pdf and b/macros/latex/contrib/glossaries/samples/sample-numberlist.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-prefix.pdf b/macros/latex/contrib/glossaries/samples/sample-prefix.pdf index d767daf03f..df5c3e0ba8 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-prefix.pdf and b/macros/latex/contrib/glossaries/samples/sample-prefix.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-si.pdf b/macros/latex/contrib/glossaries/samples/sample-si.pdf index 7016990ab5..fc8b536565 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-si.pdf and b/macros/latex/contrib/glossaries/samples/sample-si.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-storage-abbr-desc.pdf b/macros/latex/contrib/glossaries/samples/sample-storage-abbr-desc.pdf index b214d3e259..8453aff204 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-storage-abbr-desc.pdf and b/macros/latex/contrib/glossaries/samples/sample-storage-abbr-desc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample-storage-abbr.pdf b/macros/latex/contrib/glossaries/samples/sample-storage-abbr.pdf index a38071e11c..b8a782a1d8 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample-storage-abbr.pdf and b/macros/latex/contrib/glossaries/samples/sample-storage-abbr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample.pdf b/macros/latex/contrib/glossaries/samples/sample.pdf index d44df95547..3b46b32396 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample.pdf and b/macros/latex/contrib/glossaries/samples/sample.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sample4col.pdf b/macros/latex/contrib/glossaries/samples/sample4col.pdf index 861d052dde..09176be059 100644 Binary files a/macros/latex/contrib/glossaries/samples/sample4col.pdf and b/macros/latex/contrib/glossaries/samples/sample4col.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleAcr.pdf b/macros/latex/contrib/glossaries/samples/sampleAcr.pdf index 7c4dbaf66f..77ee5019fd 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleAcr.pdf and b/macros/latex/contrib/glossaries/samples/sampleAcr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleAcrDesc.pdf b/macros/latex/contrib/glossaries/samples/sampleAcrDesc.pdf index 64e1381697..3dd718a128 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleAcrDesc.pdf and b/macros/latex/contrib/glossaries/samples/sampleAcrDesc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleCustomAcr.pdf b/macros/latex/contrib/glossaries/samples/sampleCustomAcr.pdf index 2c16b300f4..3d725939a0 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleCustomAcr.pdf and b/macros/latex/contrib/glossaries/samples/sampleCustomAcr.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleDB.pdf b/macros/latex/contrib/glossaries/samples/sampleDB.pdf index b5d26b403c..1a2661b453 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleDB.pdf and b/macros/latex/contrib/glossaries/samples/sampleDB.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleDesc.pdf b/macros/latex/contrib/glossaries/samples/sampleDesc.pdf index c26618e248..4e7a65b117 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleDesc.pdf and b/macros/latex/contrib/glossaries/samples/sampleDesc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleEq.pdf b/macros/latex/contrib/glossaries/samples/sampleEq.pdf index 21b90887d4..00436603a7 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleEq.pdf and b/macros/latex/contrib/glossaries/samples/sampleEq.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleEqPg.pdf b/macros/latex/contrib/glossaries/samples/sampleEqPg.pdf index cedfdafb11..8b36ce58d2 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleEqPg.pdf and b/macros/latex/contrib/glossaries/samples/sampleEqPg.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleFnAcrDesc.pdf b/macros/latex/contrib/glossaries/samples/sampleFnAcrDesc.pdf index 6598cf1a09..434667bf30 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleFnAcrDesc.pdf and b/macros/latex/contrib/glossaries/samples/sampleFnAcrDesc.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleNtn.pdf b/macros/latex/contrib/glossaries/samples/sampleNtn.pdf index 12b4afdd61..7141fdc50e 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleNtn.pdf and b/macros/latex/contrib/glossaries/samples/sampleNtn.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/samplePeople.pdf b/macros/latex/contrib/glossaries/samples/samplePeople.pdf index f6375699ad..14003ebe62 100644 Binary files a/macros/latex/contrib/glossaries/samples/samplePeople.pdf and b/macros/latex/contrib/glossaries/samples/samplePeople.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleSec.pdf b/macros/latex/contrib/glossaries/samples/sampleSec.pdf index ea80da55ca..fcc6f0d2f3 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleSec.pdf and b/macros/latex/contrib/glossaries/samples/sampleSec.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleSort.pdf b/macros/latex/contrib/glossaries/samples/sampleSort.pdf index 582c187a5c..b436a8e3f6 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleSort.pdf and b/macros/latex/contrib/glossaries/samples/sampleSort.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleaccsupp.pdf b/macros/latex/contrib/glossaries/samples/sampleaccsupp.pdf index 83b823d4a5..5665b0dc79 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleaccsupp.pdf and b/macros/latex/contrib/glossaries/samples/sampleaccsupp.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleacronyms.pdf b/macros/latex/contrib/glossaries/samples/sampleacronyms.pdf index fd34b28d6e..647dafc3ba 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleacronyms.pdf and b/macros/latex/contrib/glossaries/samples/sampleacronyms.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampletree.pdf b/macros/latex/contrib/glossaries/samples/sampletree.pdf index 1018d8008f..78e3c54389 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampletree.pdf and b/macros/latex/contrib/glossaries/samples/sampletree.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/sampleutf8.pdf b/macros/latex/contrib/glossaries/samples/sampleutf8.pdf index 01bc7cd9ad..c86b2e9fe1 100644 Binary files a/macros/latex/contrib/glossaries/samples/sampleutf8.pdf and b/macros/latex/contrib/glossaries/samples/sampleutf8.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/samplexdy.pdf b/macros/latex/contrib/glossaries/samples/samplexdy.pdf index ec59009b20..00f9b33973 100644 Binary files a/macros/latex/contrib/glossaries/samples/samplexdy.pdf and b/macros/latex/contrib/glossaries/samples/samplexdy.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/samplexdy.tex b/macros/latex/contrib/glossaries/samples/samplexdy.tex index 08d407027e..7ea2338a7c 100644 --- a/macros/latex/contrib/glossaries/samples/samplexdy.tex +++ b/macros/latex/contrib/glossaries/samples/samplexdy.tex @@ -31,7 +31,7 @@ \usepackage[notext,notextcomp]{stix} \usepackage[colorlinks,plainpages]{hyperref} -\usepackage[xindy,style=altlistgroup]{glossaries} +\usepackage[xindy,esclocations,style=altlistgroup]{glossaries} % Define a new command to do bold italic: diff --git a/macros/latex/contrib/glossaries/samples/samplexdy2.pdf b/macros/latex/contrib/glossaries/samples/samplexdy2.pdf index 24d2486123..8b64f8a9b6 100644 Binary files a/macros/latex/contrib/glossaries/samples/samplexdy2.pdf and b/macros/latex/contrib/glossaries/samples/samplexdy2.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/samplexdy3.pdf b/macros/latex/contrib/glossaries/samples/samplexdy3.pdf index 36d2201509..c9e51ab8d1 100644 Binary files a/macros/latex/contrib/glossaries/samples/samplexdy3.pdf and b/macros/latex/contrib/glossaries/samples/samplexdy3.pdf differ diff --git a/macros/latex/contrib/glossaries/samples/samplexdy3.tex b/macros/latex/contrib/glossaries/samples/samplexdy3.tex index 0ef2694fd4..64fc330bad 100644 --- a/macros/latex/contrib/glossaries/samples/samplexdy3.tex +++ b/macros/latex/contrib/glossaries/samples/samplexdy3.tex @@ -31,7 +31,7 @@ \usepackage{fmtcount} \usepackage[colorlinks,plainpages]{hyperref} -\usepackage[xindy,style=altlistgroup]{glossaries} +\usepackage[xindy,esclocations,style=altlistgroup]{glossaries} % Define a new command to do bold italic: diff --git a/macros/latex/contrib/mismath/mismath.dtx b/macros/latex/contrib/mismath/mismath.dtx index a2c59ce7e8..1475b084fa 100644 --- a/macros/latex/contrib/mismath/mismath.dtx +++ b/macros/latex/contrib/mismath/mismath.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2019-2020 by Antoine Missier +% Copyright (C) 2019-2022 by Antoine Missier % % This file may be distributed and/or modified under the conditions of % the LaTeX Project Public License, either version 1.3 of this license @@ -20,23 +20,24 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{mismath} - [2020/11/15 v1.8 .dtx mismath file] + [2022/10/17 v1.9 .dtx mismath file] %
%<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} -\usepackage{lmodern} +\usepackage{lmodern,mathpazo} +\DeclareTextFontCommand{\extrafont}{\fontfamily{cmr}\selectfont} \usepackage{mismath} \usepackage{amssymb} \usepackage{multicol} %\enumber \inumber -\pinumber +\pinumber[Symbol] % for an example in this doc we substitute [ and ] by \OB and \CB -\DeclareMathSymbol{\OB}\mathclose{UpSh}{093} -\DeclareMathSymbol{\CB}\mathopen{UpSh}{091} +\DeclareMathSymbol{\OB}\mathclose{operators}{093} +\DeclareMathSymbol{\CB}\mathopen{operators}{091} \DisableCrossrefs %\CodelineIndex @@ -58,7 +59,7 @@ % % \fi % -%% \CheckSum{419} +%% \CheckSum{428} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -96,6 +97,11 @@ % \changes{v1.7}{2019/12/27}{Adding a table of contents to the documentation} % \changes{v1.8}{2020/11/15}{Incompatibility and solution mentioned when using i % with accent in beamer titles small changes in documentation} +% \changes{v1.9}{2020/10/17}{UpSh replaced by operators font in math mode, +% PackageWarning "command exist" replaced by PackageWarningNoLine, +% and also used by commands with arguments, +% medspace replaced by thickspace in the \bslash lfrac command, +% changing font in documentation} % % \GetFileInfo{mismath.sty} % @@ -103,7 +109,7 @@ % corresponds to \textsf{mismath}~\fileversion, dated \filedate. % Thanks to François Bastouil for help in English translation.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{November 15, 2020} +% \date{October 17, 2022} % % \maketitle % \tableofcontents @@ -112,7 +118,7 @@ % % According to the International Standards ISO~31-0:1992 to ISO~31-13:1992, % superseded by ISO~80000-2:2009, mathematical constants $\e$, $\i$, $\pi$ -% sould be typeset in upright shape and not in italic (sloping shape) like +% should be typeset in upright shape and not in italic (sloping shape) like % variables (see~\cite{TYPMA}~\cite{NIST}~\cite{ICTNS}~\cite{ISO}). % This package provides some tools to achieve this (automatically). % @@ -133,7 +139,7 @@ % \begin{itemize} % \item some standard operator names, % \item a few useful aliases, -% \item improving some spacings in mathematical formulas, +% \item improving some spacing in mathematical formulas, % \item systems of equations and small matrices, % \item displaymath in double columns for long calculation. % \end{itemize} @@ -145,7 +151,7 @@ % compilation will produce a warning message and \textsf{mismath} definition % will simply be ignored. To keep \textsf{mismath} command, % either load \textsf{mismath} before the other package -% with which it is in conflict for the name of the command +% with which it is in conflict for the name of that command % (assuming the other package supports it), or use % |\let\|\meta{command}|\relax| before loading \textsf{mismath}. % @@ -159,7 +165,7 @@ % % Another package, % \textsf{mathtools} by Morten Høgholm and Lars Madsen~\cite{TOOL} -% is also loaded. It provides many usefull macros. +% is also loaded. It provides many useful macros. % % \medskip % A recommendation, seldom observed, is to typeset uppercase Greek letters in italic shape @@ -176,6 +182,7 @@ % \subsection{Mathematical constants} % % \DescribeMacro{\mathup} +% \DescribeMacro{\e} \DescribeMacro{\i} \DescribeMacro{\j} % As for classic functions identifiers, \emph{predefined} mathematical constants % should be typeset in upright shape (generally in roman family), % even if this practice is not really common and tedious @@ -188,13 +195,12 @@ % produces a font with serif in \textsf{beamer}. This problem is solved by % using \texttt{\bslash mathup} instead % of \texttt{\bslash mathrm}.}), -% \DescribeMacro{\e} \DescribeMacro{\i} \DescribeMacro{\j} % the package provides |\e| command for the base of the natural logarithm % and |\i| or |\j| for imaginary numbers. % Let's notice that |\i| and |\j| already exist in \LaTeX: -% using in LR mode, they produce ``\i'' and ``\j'' without the point +% using in LR mode, they produce ``\extrafont{\i,\ \j}'' without the point % so you can place accents on them, and in mathematical mode they produce -% ``Latex warning: Command invalid in math mode''. +% ``LaTeX Warning: Command |\i| invalid in math mode on input line \meta{line}''. % Redefining |\i| and |\j| concerns only mathematical mode\footnote{Due to this % \texttt{\bslash i} command redefinition, there is an incompatibility with % \textsf{beamer} when using i with accents in beamer titles. @@ -223,9 +229,10 @@ % \DescribeMacro{\pinumber\oarg{font}} % Mathematical constant $\pi$ should also be typeset in upright shape % (see~\cite{ICTNS} and~\cite{ISO}), which differs from italicized $\itpi$. -% This recommendation is even less observed than the one concerning $\e$ and $\i$~\cite{TYPMA}. +% This recommendation is even less observed than the one concerning +% $\e$ and $\i$~\cite{TYPMA}. % The \textsf{upgreek} package by Walter Schmidt~\cite{GREEK} makes it possible to typeset -% greek letters in upright font by using commands such as |\upalpha|, |\upbeta|,\ldots\@ +% Greek letters in upright font by using commands such as |\upalpha|, |\upbeta|, \ldots\@ % To avoid typing a lot of |\uppi|, we provide the |\pinumber| macro, % which has to be put in the preamble. This command loads the \textsf{upgreek} package % with an optional \meta{font} argument: \texttt{Symbol} (by default), \texttt{Euler} @@ -258,7 +265,8 @@ % In \textsf{mismath}, \textsf{esvect} is loaded with the option \texttt{b}: % |\vect{AB}| gives $\vect{AB}$. % To choose another type of arrow, \textsf{esvect} must be called -% with the required option \emph{before} \textsf{mismath}, for instance |\usepackage[d]{esvect}| +% with the required option \emph{before} \textsf{mismath}, +% for instance |\usepackage[d]{esvect}| % will give the arrows produced by default in~\cite{VECT}. % % \medskip @@ -303,7 +311,7 @@ % \DescribeMacro{\hvect} % When vectors with arrows are typeset side by side, % arrows can be set up a bit higher (with a vertical phantom box containing $h$) -% to avoid inelegants effects: +% to avoid inelegant effects: % \begin{itemize} % \item $\vect{AB}=\vect{u}+ \vect{AC}$ is less than $\vect{AB}=\hvect{u}+ \vect{AC}$, % obtained with |\hvect{u}|; @@ -328,8 +336,8 @@ % The norm of a vector is classically produced by the delimiters |\lVert| and |\rVert| % (rather than \texttt{\bslash}$\mid$) or |\left\Vert| and |\right\Vert| % for delimiters adapting to the content. Unfortunately, these delimiters -% are always vertically centred, relatively to the middle of the base line, -% whereas vectors with arrows are asymetrics objects, +% are always vertically centered, relatively to the middle of the base line, +% whereas vectors with arrows are asymmetric objects, % the height above the middle of the base line % being superior to the depth under it. % The code |$\norm{\vec{h}}$| raises the double bar to produce $\norm{\vec{h}}$. @@ -429,7 +437,7 @@ % \DescribeMacro{\oldRe} \DescribeMacro{\oldIm} % The |\Re| and |\Im| macros already existed, to refer to real and imaginary part % of a complex number, producing outdated symbols $\oldRe$ and $\oldIm$. -% They have been redefined according to actual use, as mentionned in the above table, +% They have been redefined according to actual use, as mentioned in the above table, % but it's still possible to get the old symbols with |\oldRe| and |\oldIm|. % % \medskip @@ -455,7 +463,7 @@ % that classic sets of numbers are typeset in bold roman: % $\R, \C, \Z, \N, \Q$, % whereas ``openwork'' letters ($\mathbb{R}, \mathbb{Z}, \ldots$) -% are reserved for writing at blakboard~\cite{LSHORT}; +% are reserved for writing at blackboard~\cite{LSHORT}; % and likewise to designate a field: $\F$ or $\K$ (Körper in German). % We get these symbols with the macros: % \begin{center} @@ -480,19 +488,19 @@ % they are placed on the right, as subscript or exponent. Compare: % $\upzeta(s)=\sum_{n=1}^{\infty }\frac{1}{n^s}$ with % \[\upzeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}.\] -% \DescribeMacro{\dlim} \DescribeMacro{\dsum} \DescribeMacro{\dprod} -% \DescribeMacro{\dcup} \DescribeMacro{\dcap} % With in-line math mode, displaymath behavior can be forced with |\displaystyle| % or its alias |\ds|, but then, all the rest of the current mathematical % environment will be set in displaymath mode too (in the previous example, % the fraction will be expanded). -% Just like the \textsf{amsmath} command |\dfrac| +% \DescribeMacro{\dlim} \DescribeMacro{\dsum} \DescribeMacro{\dprod} +% \DescribeMacro{\dcup} \DescribeMacro{\dcap} +% Just as the \textsf{amsmath} command |\dfrac| % only transforms the required fraction in display style, we can limit % display style effect to the affected symbol, by using the following macros: % |\dlim|, |\dsum|, |\dprod|, |\dcup|, |\dcap|. % So |$\dlim_{x\to +\infty}\frac{1}{x}$| gives $\dlim_{x \to +\infty}\frac{1}{x}$. % -% \medskip +% \bigskip % \DescribeMacro{\lbar} \DescribeMacro{\hlbar} % Large bars over expressions are obtained with |\overline| % or, shorter, its alias |\lbar|, to get for instance $\lbar{z_1z_2}$. @@ -535,11 +543,11 @@ % \DescribeMacro{\iif} % |\iif| is an alias for ``\iif'', to be used in text mode. % -% \subsection{Improving some spacings in mathematical formulas} +% \subsection{Improving some spacing in mathematical formulas} % % \DescribeMacro{\mul} % The multiplication symbol obtained with |\times| produces the same spacing than addition -% or substraction operators, whereas division obtained with $/$ is closer to its arguments. +% or subtraction operators, whereas division obtained with $/$ is closer to its arguments. % This actually hides the priority of the multiplication on $+$ and $-$. % This is why we provide the |\mul| macro, behaving like $/$ % (ordinary symbol) and leaving less space around than |\times|: @@ -549,7 +557,7 @@ % \end{center} % % When using |\mul| before an operator name -% or a |\left...\right| structure, additionnal spacing occur on the right side of |\mul|. +% or a |\left...\right| structure, additional spacing occur on the right side of |\mul|. % A solution to get the same amount of space on the two sides of |\mul|, is to % enclose the operator name (or the structure) with brackets: % \begin{center} @@ -601,7 +609,7 @@ % % \DescribeMacro{\lfrac} % This macro behaves like |\frac| -% but with medium spaces around the arguments, +% but with thick spaces around the arguments, % so the corresponding fraction bar is perceptibly a little bit longer:\\ % \begin{minipage}[t]{8cm} % \begin{verbatim} @@ -665,7 +673,7 @@ % By default, a system is written like an \texttt{array} environment with only one column, % left aligned. The environment has an optional argument to create several columns, % specifying their alignment, with the same syntax than the \texttt{array} environment of -% \LaTeX : |\begin{system}[cl]| produces a two-column system, the first one being centred, +% \LaTeX : |\begin{system}[cl]| produces a two-column system, the first one being centered, % the second being left aligned, such as in the following example:\\ % \begin{minipage}[t]{7cm} % \begin{verbatim} @@ -685,7 +693,7 @@ % This spacing may be changed by typing |\renewcommand{\systemstretch}|\marg{stretch}, % inside the current mathematical environment (for a local change) or outside % (for a global change). By default, stretch's value is 1.2. -% In addition we can use a carriage return with a spacing option such +% In addition we can use the end of line with a spacing option such % as it has been done above with |\\[1ex]|. % % Another example with |\begin{system}[rl@{\quad}l]|\footnote{\texttt{@\{\ldots\}} @@ -745,7 +753,7 @@ % % \DescribeMacro{\changecol} % The |\changecol| macro causes a change of column; -% aligment is produced using the classic delimiters |&| and |\\|. +% alignment is produced using the classic delimiters |&| and |\\|. % % \begin{verbatim} %\begin{mathcols} @@ -778,7 +786,7 @@ % % \medskip % The three following internal commands are meta commands for a -% conditional macro definition with warning message if the macro already exists. +% conditional macro definition with a warning message if the macro already exists. % \DescribeMacro{\bslash} % The |\bslash| macro used inside |\@mwarning| comes from \textsf{doc.sty} package % by Frank Mittelbach. It can also be used in other documents instead of |\textbackslash| @@ -786,16 +794,15 @@ % \begin{macrocode} {\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % the \bslash command \newcommand\@mwarning[1]{ - \PackageWarning{mismath}{ - Command \bslash #1 already exist and will not be redefined - } + \PackageWarningNoLine{mismath}{ + Command \bslash #1 already exist and will not be redefined} } \newcommand\@mmacro[2]{ \@ifundefined{#1}{ \expandafter\def\csname #1\endcsname{#2} }{\@mwarning{#1}} } -\newcommand\@moperator[3][]{% this macro is ugly, TODO: by default #1=#3 +\newcommand\@moperator[3][]{% this macro is ugly, by default #1=#3 \ifthenelse{\equal{#1}{}}{ \@ifundefined{#3}{ \DeclareMathOperator{#2}{#3} @@ -804,17 +811,17 @@ \@ifundefined{#1}{ \DeclareMathOperator{#2}{#3} }{\@mwarning{#1}} - } + } } - + % \end{macrocode} % -% To work correctly with the \textsf{beamer} package, we did not use |\mathrm| -% but |\mathup| (based on |\operatorfont| from the \textsf{mathopn} package) -% to produce the correct upright shape font. +% To produce the correct upright shape font even when working +% with the \textsf{beamer} package, we did not use |\mathrm| +% but |\mathup| (based on |\operatorfont| from the \textsf{amsopn} package). % This command works also fine with other sans serif fonts like \textsf{cmbright}. -% Moreover for \textsf{beamer}, |\enumber| must use -% the family default font defined by the \textsf{beamer} package (sans serif), +% Moreover for \textsf{beamer}, |\enumber| must be typeset in +% the family default font (sans serif), % therefore the |\AtBeginDocument| inside the macro (otherwise it has no effect). % The same holds for |\inumber| and |\jnumber|. % @@ -827,24 +834,18 @@ \@mmacro{e}{\mathup{e}} \AtBeginDocument{\let\oldi\i \let\oldj\j \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}} - \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} -} + \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} } -\DeclareSymbolFont{UpSh}{\encodingdefault}{\familydefault}{m}{n} \newcommand{\enumber}{ - \AtBeginDocument{\DeclareMathSymbol{e}\mathalpha{UpSh}{`e}} -} + \AtBeginDocument{\DeclareMathSymbol{e}\mathalpha{operators}{`e}} } \newcommand{\inumber}{ - \AtBeginDocument{\DeclareMathSymbol{i}\mathalpha{UpSh}{`i}} -} + \AtBeginDocument{\DeclareMathSymbol{i}\mathalpha{operators}{`i}} } \newcommand{\jnumber}{ - \AtBeginDocument{\DeclareMathSymbol{j}\mathalpha{UpSh}{`j}} -} + \AtBeginDocument{\DeclareMathSymbol{j}\mathalpha{operators}{`j}} } \newcommand*{\pinumber}[1][Symbol]{ \@ifpackageloaded{upgreek}{}{\usepackage[#1]{upgreek}} \let\itpi\pi - \renewcommand{\pi}{\uppi} -} + \renewcommand{\pi}{\uppi} } \newboolean{arrowvect} \setboolean{arrowvect}{true} @@ -865,10 +866,11 @@ \newcommand*{\@@@norm}[1]{ \mbox{\tiny\raisebox{1pt}{$\Vert$}} #1 \mbox{\tiny\raisebox{1pt}{$\Vert$}} } -\providecommand*{\norm}[1]{ - \mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}} } +\@ifundefined{norm}{\providecommand*{\norm}[1]{ + \mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}} }}{ + \@mwarning{norm} } -\newcommand{\di}{\mathop{}\!\mathup{d}} +\@mmacro{di}{\mathop{}\!\mathup{d}} \newcommand\probastyle{} \let\Par\P % end of paragraph symbol \renewcommand{\P}{\operatorname{\probastyle{P}}} @@ -876,8 +878,8 @@ \@mmacro{V}{\operatorname{\probastyle{V}}} \newcommand{\PEupright}{ \AtBeginDocument{% necessary for working with beamer - \DeclareMathSymbol{P}\mathalpha{UpSh}{`P} - \DeclareMathSymbol{E}\mathalpha{UpSh}{`E} + \DeclareMathSymbol{P}\mathalpha{operators}{`P} + \DeclareMathSymbol{E}\mathalpha{operators}{`E} } } @@ -922,7 +924,7 @@ \@moperator[bigo]{\bigo}{O} \@moperator[lito]{\lito}{o} -\newcommand{\mathset}{\mathbf} +\@mmacro{mathset}{\mathbf} \@mmacro{R}{\ensuremath{\mathset{R}}\xspace} \@mmacro{C}{\ensuremath{\mathset{C}}\xspace} \@mmacro{N}{\ensuremath{\mathset{N}}\xspace} @@ -937,8 +939,11 @@ \@mmacro{dprod}{\prod\limits} \@mmacro{dcup}{\bigcup\limits} \@mmacro{dcap}{\bigcap\limits} + \@mmacro{lbar}{\overline} -\providecommand*{\hlbar}[1]{\overline{\vphantom{h}#1}} +\@ifundefined{hlbar}{ + \providecommand*{\hlbar}[1]{\overline{\vphantom{h}#1}}}{ + \@mwarning{hlbar} } \@mmacro{eqdef}{\stackrel{\mathup{def}}{=}} \@mmacro{unbr}{\underbrace} \@mmacro{iif}{if and only if\xspace} @@ -949,13 +954,23 @@ % Without |\mbox{}|, the space produced by |\| would be suppressed in tables. % \medskip % \begin{macrocode} -\providecommand*{\txt}[1]{\quad\text{#1}\quad} -\providecommand*{\paren}[1]{\mathopen{\left(#1\right)}} -\providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} -\providecommand*{\abs}[1]{\left\vert#1\right\vert} -\providecommand*{\lfrac}[2]{\frac{\:#1\:}{\:#2\:}} -\DeclareMathSymbol{]}\mathord{UpSh}{093} % originally \mathclose -\DeclareMathSymbol{[}\mathord{UpSh}{091} % originally \mathopen +\@ifundefined{txt}{ + \providecommand*{\txt}[1]{\quad\text{#1}\quad} }{ + \@mwarning{txt} } +\@ifundefined{paren}{ + \providecommand*{\paren}[1]{\mathopen{\left(#1\right)}} }{ + \@mwarning{paren} } +\@ifundefined{pow}{ + \providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{ + \@mwarning{pow} } +\@ifundefined{abs}{ + \providecommand*{\abs}[1]{\left\vert#1\right\vert} }{ + \@mwarning{abs} } +\@ifundefined{lfrac}{ + \providecommand*{\lfrac}[2]{\frac{\;#1\;}{\;#2\;}} }{ + \@mwarning{lfrac} } +\DeclareMathSymbol{]}\mathord{operators}{093} % originally \mathclose +\DeclareMathSymbol{[}\mathord{operators}{091} % originally \mathopen \newcommand{\systemstretch}{1.2} \newcommand{\systemsep}{\medspace} @@ -984,15 +999,15 @@ \begin{math}\begin{aligned}\displaystyle } % \end{macrocode} -% +% \bigskip % \begin{thebibliography}{17} % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), No.~1. % \bibitem{NIST} \emph{Typefaces for Symbols in Scientific Manuscripts}.\\ % https://www.physics.nist.gov/cuu/pdf/typefaces.pdf. % \bibitem{ICTNS} \emph{On the Use of Italic and up Fonts for Symbols in Scientific Text}, -% I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee on Nomenclature and Symbols), -% dec 1999. +% I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee +% on Nomenclature and Symbols), dec 1999. % \bibitem{ISO} \emph{ISO 80000-2}. https://en.wikipedia.org/wiki/ISO\_80000-2 % \bibitem{AMS} \emph{The \textsf{amsmath} package}. Frank Mittelbach, Rainer Schöpf, % Michael Downes, Davis M.~Jones, David Carlisle, CTAN, v2.17b 2018/12/01. @@ -1005,13 +1020,13 @@ % \bibitem{FIXM} \emph{The \textsf{fixmath} package for \LaTeXe}, Walter Schmidt, % CTAN, v0.9 2000/04/11. % \bibitem{ISOM} \emph{\textsf{isomath}. Mathematical style for science and technology}. -% Günter Milde, CTAN, v0.6.1 04/06/2012. +% Günter Milde, CTAN, v0.6.1 2012/09/04. % \bibitem{INT} \emph{The \textsf{interval} package}. Lars Madsen, CTAN, % v0.3 2014/08/04. % \bibitem{SYST} \emph{L'extension pour \TeX\ et \LaTeX\ \textsf{systeme}}. % Christian Tellechea, CTAN v0.32 2019/01/13. % \bibitem{SPAL} \emph{The \textsf{spalign} package}. Joseph Rabinoff, CTAN, 2016/10/05. -% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}. Antoine Missier, CTAN, v1.5 2020/11/02. +% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}. Antoine Missier, CTAN, v1.6 2022/10/16. % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe}. \textsf{lshort} package by % Tobias Oetiker, Hubert Partl, Irene Hyna and Elisabeth Schlegl, CTAN, v6.2 2018/02/28. % \bibitem{COMP} \emph{The \LaTeX\ Companion}. Frank Mittelbach, Michel Goossens, diff --git a/macros/latex/contrib/mismath/mismath.ins b/macros/latex/contrib/mismath/mismath.ins index e1eb94888b..8985defb61 100644 --- a/macros/latex/contrib/mismath/mismath.ins +++ b/macros/latex/contrib/mismath/mismath.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2019-2020 by Antoine Missier +%% Copyright (C) 2019-2022 by Antoine Missier %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -21,7 +21,7 @@ This is a generated file. -Copyright (C) 2019-2020 by Antoine Missier +Copyright (C) 2019-2022 by Antoine Missier This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license diff --git a/macros/latex/contrib/mismath/mismath.pdf b/macros/latex/contrib/mismath/mismath.pdf index 236b631abf..24612b9bd9 100644 Binary files a/macros/latex/contrib/mismath/mismath.pdf and b/macros/latex/contrib/mismath/mismath.pdf differ diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf index 0d8b6bc1ee..0e377d341f 100644 Binary files a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf and b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf differ diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index 1b57126d34..25b0e9471c 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -63,8 +63,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\PLversion{1.3.3} -\def\PLdate{12 Octobre 2022} +\def\PLversion{1.3.5} +\def\PLdate{17 Octobre 2022} \tcbset{vignettes/.style={% nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% @@ -355,6 +355,10 @@ Par défaut, \ctex{minted} est chargé et donc la compilation nécessite d'utili En compilant (notamment avec les packages \ctex{minted} et \ctex{pythontex}) on peut spécifier des répertoires particuliers pour les (ou des) fichiers auxiliaires. Avec l'option \Cle{build}, l'utilisateur a la possibilité de placer les fichiers temporaires de \ctex{minted} et \ctex{pythontex} dans un répertoire \textsf{build} du répertoire courant. + +\smallskip + +Dans ce cas il vaut mieux créer au préalable le répertoire \textsf{build} avant de compiler un fichier ! \end{codeinfo} \begin{codetex}[listing only] @@ -637,7 +641,7 @@ On peut dans ce cas \textit{jouer} sur les coefficients de cette portion pour \t Le plus \og simple \fg{} est donc: % \begin{itemize} - \item de déclarer la liste des points de contrôle, grâce à \ctex{\textbackslash def\textbackslash LISTE\{x1/y1:d1§x2/y2/d2§...\}} ; + \item de déclarer la liste des points de contrôle, grâce à \ctex{\textbackslash def\textbackslash LISTE\{x1/y1/d1§x2/y2/d2§...\}} ; \item de saisir la commande \ctex{\textbackslash splinetikz[liste=\textbackslash LISTE]} ; \item d'ajuster les options et coefficients en fonction du rendu ! \end{itemize} @@ -915,7 +919,7 @@ Peut-être que -- ultérieurement -- des options \textit{booléennes} seront dis \begin{center} \begin{tikzpicture}[x=5cm,y=1.5cm] ... - \def\f{-0.25*\x*\x+\x} + \def\f{1+1/\x} \recurrPL% [fct={\f},no=0,uno=1,nb=7,poslabel=above right,decallabel=0pt,afftermes=false]% [line width=1.25pt,ForestGreen,densely dashed][] @@ -1095,7 +1099,7 @@ Donc, si plusieurs \textit{méthodes} sont utilisées pour insérer du code Pyth \subsection{Présentation de code Python grâce à listings} \begin{codeidee} -L'environnement \ctex{\textbackslash envcodepython} (chargé par \ctex{ProfLycee} permet de présenter du code python, dans une \ctex{tcolorbox} avec un style particulier. +L'environnement \ctex{\textbackslash envcodepython} permet de présenter du code python, dans une \ctex{tcolorbox} avec un style particulier. \end{codeidee} \begin{codetex}[listing only] @@ -1141,7 +1145,7 @@ Si cette méthode est utilisée, il ne faut oublier de charger le package \ctex{ \begin{codetex}[listing only] \begin{envcodepython}{} %les {}, même vides, sont nécessaires (bug avec # sinon !) #environnement par défaut -nb = int(input("Saisir un entier Python positif")) +nb = int(input("Saisir un entier positif")) if (nb %7 == 0) : print(f"{nb} est bien divisible par 7") #endif @@ -1154,7 +1158,7 @@ def f(x) : \begin{codesortie} \begin{envcodepython}{} #environnement par défaut -nb = int(input("Saisir un entier Python positif")) +nb = int(input("Saisir un entier positif")) if (nb %7 == 0) : print(f"{nb} est bien divisible par 7") #endif @@ -1269,11 +1273,11 @@ Le {package} \ctex{pythontex} permet d'insérer et d'exécuter du code Python. O \end{itemize} \end{codeidee} -\begin{codeinfo} +\begin{codeattention} \textbf{Attention : }il faut dans ce cas une compilation en plusieurs étapes, comme par exemple \textsf{pdflatex puis pythontex puis pdflatex} ! Voir par exemple \url{http://lesmathsduyeti.fr/fr/informatique/latex/pythontex/} ! -\end{codeinfo} +\end{codeattention} \begin{codeinfo} Compte tenu de la \textit{relative complexité} pour gérer les options (par paramètres/clés\ldots) des \textit{tcbox} et des \textit{fancyvrb}, le style est \og fixé \fg{} tel quel, et seules la taille et la position de la \textit{tcbox} sont modifiables. Si toutefois vous souhaitez personnaliser davantage, il faudra prendre le code correspondant et appliquer vos modifications ! @@ -1284,7 +1288,7 @@ Cela peut donner -- en tout cas -- des idées de personnalisation en ayant une b \subsection{Présentation de code Python via pythontex}\label{pythontex} \begin{codeidee} -L'environnement \ctex{\textbackslash envcodepythontex} (chargé par \ctex{ProfLycee}, avec l'option \textit{autogobble}) permet de présenter du code python, dans une \ctex{tcolorbox} avec un style particulier. +L'environnement \ctex{\textbackslash envcodepythontex} est donc lié à \ctex{pythontex} (chargé par \ctex{ProfLycee}, avec l'option \textit{autogobble}) permet de présenter du code python, dans une \ctex{tcolorbox} avec un style particulier. \end{codeidee} \begin{codetex}[listing only] @@ -2103,9 +2107,9 @@ Les \Cle{Clés} pour cette possibilité sont : \newpage -\part{Outils pour les probabilités et les statistiques}\label{reglin} +\part{Outils pour les statistiques} -\section{Paramètres d'une régression linéaire par la méthode des moindres carrés} +\section{Paramètres d'une régression linéaire par la méthode des moindres carrés}\label{reglin} \subsection{Idée} @@ -3033,6 +3037,8 @@ Sachant que la hauteur par défaut est de 1, il est -- a priori -- intéressant \newpage +\part{Outils pour les probabilités} + \section{Calculs de probabilités}\label{calcprobas} \subsection{Introduction} @@ -3044,7 +3050,9 @@ L'idée est de proposer des commandes permettant de calculer des probabilités a \item binomiale ; \item normale ; \item exponentielle ; - \item de Poisson + \item de Poisson ; + \item géométrique ; + \item hypergéométrique. \end{itemize} \end{codeidee} @@ -3063,15 +3071,26 @@ De ce fait, les options de \ctex{siunitx} de l'utilisateur affecterons les forma \begin{codetex}[listing only] %loi binomiale B(n,p) -\calcPbinomP{n}{p}{k} %P(X=k) -\calcPbinomC{n}{p}{a}{b} %P(a<=X<=b) +\calcPbinomP{n}{p}{k} %P(X=k) +\calcPbinomC{n}{p}{a}{b} %P(a<=X<=b) + %loi de Poisson P (l) -\calcPpoissP{l}{k} %P(X=k) -\calcPpoissC{l}{a}{b} %P(a<=X<=b) +\calcPpoissP{l}{k} %P(X=k) +\calcPpoissC{l}{a}{b} %P(a<=X<=b) + +%loi géométrique G (p) +\calcPgeomP{p}{k} %P(X=k) +\calcPgeomC{l}{a}{b} %P(a<=X<=b) + +%loi hypergéométrique H (N,n,m) +\calcPhypergeomP{N}{n}{m}{k} %P(X=k) +\calcPhypergeomP{N}{n}{m}{a}{b} %P(a<=X<=b) + %loi normale N(m,s) -\calcPnormC{m}{s}{a}{b} %P(a<=X<=b) +\calcPnormC{m}{s}{a}{b} %P(a<=X<=b) + %loi exponentielle E(l) -\calcPexpoC{l}{a}{b} %P(a<=X<=b) +\calcPexpoC{l}{a}{b} %P(a<=X<=b) \end{codetex} \begin{codecles} @@ -3086,24 +3105,25 @@ Pour les probabilités cumulées, on peut utiliser \ctex{*} comme borne ($a$ ou % X -> B(5,0.4) $P(X=3) \approx \calcPbinomP{5}{0.4}{3}$. $P(X\leqslant1) \approx \calcPbinomC{5}{0.4}{*}{1}$. + % X -> B(100,0.02) $P(X=10) \approx \calcPbinomP{100}{0.02}{10}$. $P(15\leqslant X\leqslant25) \approx \calcPbinomC{100}{0.02}{15}{25}$. + % Y -> P(5) $P(Y=3) \approx \calcPpoissP{5}{3}$. $P(Y\geqslant2) \approx \calcPpoissC{5}{2}{*}$. -% X -> N(0,1) -$P(X\leqslant1) \approx \calcPnormC{0}{1}{*}{1}$. -$P(-1,96\leqslant Z\leqslant1,96) \approx \calcPnormC{0}{1}{-1.96}{1.96}$. -% X -> N(550,30) -$P(Y\geqslant600) \approx \calcPnormC{550}{30}{600}{*}$. -$P(500\leqslant Y\leqslant600) \approx \calcPnormC{550}{30}{500}{600}$. -% Z -> E(0.001) -$P(Z\geqslant400) \approx \calcPexpoC{0.001}{400}{*}$. -$P(300\leqslant Z\leqslant750) \approx \calcPexpoC{0.001}{300}{750}$. + +% T -> G(0.5) +$P(T=100) \approx \calcPgeomP{0.5}{3}$. +$P(T\leqslant5) \approx \calcPgeomC{0.5}{*}{5}$. + +% W -> H(50,10,5) +$P(W=4) \approx \calcPhypergeomP{50}{10}{5}{4}$. +$P(1\leqslant W\leqslant3) \approx \calcPhypergeomP{50}{10}{5}{1}{3}$. \end{codetex} -\begin{codesortie} +\begin{codesortie}[listing only] $\bullet~~~~X \hookrightarrow \mathcal{B}(5\,;\,0,4)$ :\\ $P(X=3) \approx \calcPbinomP{5}{0.4}{3}$.\\ $P(X\leqslant1) \approx \calcPbinomC{5}{0.4}{*}{1}$. @@ -3122,6 +3142,32 @@ $P(Y\geqslant2) \approx \calcPpoissC{5}{2}{*}$. \medskip +$\bullet~~~~T \hookrightarrow \mathcal{G}_{0,5}$ :\\ +$P(T=3) \approx \calcPgeomP{0.5}{3}$.\\ +$P(T\leqslant5) \approx \calcPgeomC{0.5}{*}{5}$. + +\medskip + +$\bullet~~~~W \hookrightarrow \mathcal{H}(50\,;\,10\,;\,5)$ :\\ +$P(W=4) \approx \calcPhypergeomP{50}{10}{5}{4}$.\\ +$P(1\leqslant W\leqslant3) \approx \calcPhypergeomC{50}{10}{5}{1}{3}$. +\end{codesortie} + +\begin{codetex}[listing only] +% X -> N(0,1) +$P(X\leqslant1) \approx \calcPnormC{0}{1}{*}{1}$. +$P(-1,96\leqslant Z\leqslant1,96) \approx \calcPnormC{0}{1}{-1.96}{1.96}$. + +% X -> N(550,30) +$P(Y\geqslant600) \approx \calcPnormC{550}{30}{600}{*}$. +$P(500\leqslant Y\leqslant600) \approx \calcPnormC{550}{30}{500}{600}$. + +% Z -> E(0.001) +$P(Z\geqslant400) \approx \calcPexpoC{0.001}{400}{*}$. +$P(300\leqslant Z\leqslant750) \approx \calcPexpoC{0.001}{300}{750}$. +\end{codetex} + +\begin{codesortie} $\bullet~~~~X \hookrightarrow \mathcal{N}(0\,;\,1)$ :\\ $P(X\leqslant1) \approx \calcPnormC{0}{1}{*}{1}$.\\ $P(-1,96\leqslant Z\leqslant1,96) \approx \calcPnormC{0}{1}{-1.96}{1.96}$. @@ -3175,11 +3221,22 @@ Les commandes sont dans ce cas préfixées par \ctex{num} au lieu de \ctex{calc} %loi binomiale B(n,p) \numPbinomP(*)[prec]{n}{p}{k} %P(X=k) \numPbinomC(*)[prec]{n}{p}{a}{b} %P(a<=X<=b) + %loi de Poisson P (l) \numPpoissP(*)[prec]{l}{k} %P(X=k) \numPpoissC(*)[prec]{l}{a}{b} %P(a<=X<=b) + +%loi géométrique G (p) +\numPgeomP{p}{k} %P(X=k) +\numPgeomC{l}{a}{b} %P(a<=X<=b) + +%loi hypergéométrique H (N,n,m) +\numPhypergeomP{N}{n}{m}{k} %P(X=k) +\numPhypergeomC{N}{n}{m}{a}{b} %P(a<=X<=b) + %loi normale N(m,s) \numPnormC(*)[prec]{m}{s}{a}{b} %P(a<=X<=b) + %loi exponentielle E(l) \numPexpoC(*)[prec]{l}{a}{b} %P(a<=X<=b) \end{codetex} @@ -3200,6 +3257,15 @@ $P(500\leqslant Y\leqslant600) \approx \numPnormC[4]{550}{30}{500}{600}$. % X -> B(100,0.02) $P(X=10) \approx \numPbinomP[7]{100}{0.02}{10} \approx \numPbinomP*[7]{100}{0.02}{10}$. $P(15\leqslant X\leqslant25) \approx \numPbinomC[10]{100}{0.02}{15}{25} \approx \numPbinomC*[10]{100}{0.02}{15}{25}$. +% H -> H(50,10,5) +$P(W=4) \approx \numPhypergeomP[5]{50}{10}{5}{4}$. +$P(1\leqslant W\leqslant3) \approx \numPhypergeomC[4]{50}{10}{5}{1}{3}$. +% Z-> E(0,001)$ : +$P(Z\geqslant400) \approx \numPexpoC{0.001}{400}{*}$. +$P(300\leqslant Z\leqslant750) \approx \numPexpoC{0.001}{300}{750}$. +% T -> P(5) +$P(T=3) \approx \numPpoissP{5}{3}$. +$P(T\geqslant2) \approx \numPpoissC[4]{5}{2}{*}$. \end{codetex} \begin{codesortie} @@ -3216,8 +3282,36 @@ $\bullet~~~~X \hookrightarrow \mathcal{B}(100\,;\,0,02)$ : $P(X=10) \approx \numPbinomP[7]{100}{0.02}{10} \approx \numPbinomP*[7]{100}{0.02}{10}$. $P(15\leqslant X\leqslant25) \approx \numPbinomC[10]{100}{0.02}{15}{25} \approx \numPbinomC*[10]{100}{0.02}{15}{25}$. + +\medskip + +$\bullet~~~~W \hookrightarrow \mathcal{H}(50\,;\,10\,;\,5)$ : + +$P(W=4) \approx \numPhypergeomP[5]{50}{10}{5}{4}$. + +$P(1\leqslant W\leqslant3) \approx \numPhypergeomC[4]{50}{10}{5}{1}{3}$. + +\medskip + +$\bullet~~~~Z \hookrightarrow \mathcal{E}_{0,001}$ : + +$P(Z\geqslant400) \approx \numPexpoC{0.001}{400}{*}$. + +$P(300\leqslant Z\leqslant750) \approx \numPexpoC{0.001}{300}{750}$. + +\medskip + +$\bullet~~~~T \hookrightarrow \mathcal{P}_5$ : + +$P(T=3) \approx \numPpoissP{5}{3}$. + +$P(T\geqslant2) \approx \numPpoissC[4]{5}{2}{*}$. \end{codesortie} +\begin{codeinfo} +\hfill~\includegraphics[height=3cm]{./graphics/pl-doc-probas_a}~~\includegraphics[height=3cm]{./graphics/pl-doc-probas_c}~~\includegraphics[height=3cm]{./graphics/pl-doc-probas_e}~~\includegraphics[height=3cm]{./graphics/pl-doc-probas_f}\hfill~ +\end{codeinfo} + \newpage \section{Arbres de probabilités \og classiques \fg}\label{arbresprobas} @@ -3251,7 +3345,7 @@ Les (deux) commandes sont donc liées à un environnement \ctex{tikzpicture}, et Les \Cle{donnees} seront à préciser sous forme \ctex{//,//,...} avec comme \og sens de lecture \fg{} de la gauche vers la droite puis du haut vers le bas (on balaye les \textit{sous-arbres}), avec comme possibilités : \begin{itemize} - \item une donnée \Cle{} peuvent être laissé vide ; + \item une donnée \Cle{} peut être laissée vide ; \item une donnée \Cle{} peut valoir \Cle{above} (au-dessus), \Cle{below} (en-dessous) ou être laissée \Cle{vide} (sur). \end{itemize} \end{codeinfo} @@ -3380,6 +3474,88 @@ Les nœuds crées par les commandes sont : \newpage +\section{Petits schémas pour des probabilités continues}\label{schemasprobas} + +\subsection{Idée} + +\begin{codeidee} +L'idée est de proposer des commandes pour illustrer, sous forme de schémas en \TikZ, des probabilités avec des lois continues (normales et exponentielles). + +\smallskip + +Ces \og schémas \fg{} peuvent être insérés en tant que graphique explicatif, ou bien en tant que petite illustration rapide ! +\end{codeidee} + +\begin{codetex}[listing only] +\LoiNormaleGraphe[options]{m}{s}{a}{b} + +\LoiExpoGraphe[options]{l}{a}{b} +\end{codetex} + +\begin{codesortie} +\hfill\LoiNormaleGraphe{100}{20}{80}{120}\hspace{3cm}\LoiExpoGraphe{0.001}{250}{1500}\hfill~ +\end{codesortie} + +\begin{codecles} +Les probabilités \textit{illustrables} sont donc des probabilités \textbf{C}umulées ($P(a\leqslant X\leqslant b)$). + +\smallskip + +On peut utiliser \ctex{*} comme borne ($a$ ou $b$), pour les probabilités du type $P(X\leqslant b)$ et $P(X \geqslant a)$. +\end{codecles} + +\subsection{Commandes et options} + +\begin{codecles} +Quelques \Cle{Clés} sont disponibles pour ces commandes : + +\begin{itemize} + \item la clé \Cle{CouleurAire} pour l'aire sous la courbe ; \hfill{}défaut \Cle{LightGray} + \item la clé \Cle{CouleurCourbe} pour la courbe ; \hfill{}défaut \Cle{red} + \item la clé \Cle{Largeur} qui sera la largeur (en cm) du graphique ; \hfill{}défaut \Cle{2} + \item la clé \Cle{Hauteur} qui sera la hauteur (en cm) du graphique ; \hfill{}défaut \Cle{1} + \item un booléen \Cle{AfficheM} qui affiche la moyenne ; \hfill{}défaut \Cle{true} + \item un booléen \Cle{AfficheCadre} qui affiche un cadre pour délimiter le schéma. \hfill{}défaut \Cle{true} +\end{itemize} +\end{codecles} + +\begin{codeinfo} +Les commandes sont donc des environnements \TikZ, sans possibilité de \og rajouter \fg{} des éléments. Ces petis \textit{schémas} sont donc vraiment dédiés à \textit{montrer} rapidement une probabilité continue, sans fioriture. +\end{codeinfo} + +\begin{codetex} +Avec centrage vertical sur l'axe des abscisses : +\LoiNormaleGraphe[AfficheM=false,CouleurCourbe=Blue,CouleurAire=LightBlue]{1000}{100}{950}{*} +\end{codetex} + +\begin{codetex} +Avec quelques modifications : + +\LoiNormaleGraphe[Largeur=4,Hauteur=2]{150}{12.5}{122}{160} + +\medskip + +Avec centrage vertical : +\LoiNormaleGraphe[Largeur=5,Hauteur=2.5]{200}{5}{204}{*} + +\medskip + +Avec centrage vertical sur l'axe des abscisses : +\LoiExpoGraphe[AfficheM=false,CouleurCourbe=Blue,CouleurAire=LightBlue]{0.05}{*}{32} + +\medskip + +\LoiExpoGraphe[Largeur=4,Hauteur=2]{0.00025}{5000}{*} +\end{codetex} + +\subsection{Remarques et compléments} + +\begin{codeinfo} +Pour le moment, seules les lois (continues) exponentielles et normales sont disponibles, peut-être que d'autres lois seront ajoutées, mais il ne me semble pas très pertinent de proposer des schémas similaires pour des lois discrètes, qui ont des \textit{représentations} assez variables\ldots +\end{codeinfo} + +\newpage + \part{Outils divers et variés} \section{Fractions, ensembles} @@ -3831,7 +4007,7 @@ $\PLconvdecbin[affbase=false]{415}$ $\PLconvdecbin*[affbase=false]{415}$ \end{codesortie} -\subsection{Conversion hexadécimal vers binaire} +\subsection{Conversion binaire vers hexadécimal} \begin{codeinfo} L'idée est ici de présenter la conversion, grâce à la conversion \og directe \fg{} par blocs de 4 chiffres : @@ -4598,6 +4774,12 @@ La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0 \part{Historique} +{\small \bverb|v1.3.5|~:~~~~Correction d'un bug avec la loi géométrique (page \pageref{calcprobas}) + +{\small \bverb|v1.3.4|~:~~~~Ajout de petits schémas, en \TikZ{}, de lois normales et exponentielles (page \pageref{schemasprobas}) + +{\small \bverb| |~:~~~~Calculs de probas avec les lois géométriques et hypergéométriques (page \pageref{calcprobas}) + {\small \bverb|v1.3.3|~:~~~~Ajout d'un environnement pour des arbres de probas classiques, en \TikZ{} (page \pageref{arbresprobas}) {\small \bverb|v1.3.2|~:~~~~Correction d'un bug sur les conversions bintohex avec lualatex (page \pageref{conversions}) diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_a.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_a.png new file mode 100644 index 0000000000..ee2a607de3 Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_a.png differ diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_b.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_b.png new file mode 100644 index 0000000000..6eb00e138b Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_b.png differ diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_c.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_c.png new file mode 100644 index 0000000000..78a8fee25d Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_c.png differ diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_d.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_d.png new file mode 100644 index 0000000000..a4020e0f09 Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_d.png differ diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_e.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_e.png new file mode 100644 index 0000000000..be1ff2c03c Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_e.png differ diff --git a/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_f.png b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_f.png new file mode 100644 index 0000000000..7778d450fb Binary files /dev/null and b/macros/latex/contrib/proflycee/doc/graphics/pl-doc-probas_f.png differ diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index f869d6dc80..b4651856e7 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,9 +3,11 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2022/10/12 v1.3.3 - Aide pour l'utilisation de LaTeX en lycee] -% 1.3.2 Ajout de commandes pour des arbres de probas classiques, en tikz -% 1.3.1 Correction d'une commande liée à la conversion bintohex (suppression clé trait) +\ProvidesPackage{ProfLycee}[2022/10/17 v1.3.5 - Aide pour l'utilisation de LaTeX en lycee] +% 1.3.5 Correction de bugs sur les calculs de probas (loi géométrique) +% 1.3.4 Ajout des calculs de probas geomtriques et hypergeometriques + petits schémas probas +% 1.3.3 Ajout de commandes pour des arbres de probas classiques, en tikz +% 1.3.2 Correction d'une commande liée à la conversion bintohex (suppression clé trait) % 1.3.1 Ajout d'une option pour ne pas afficher les bords des cases en pixelart % 1.3.0 Ajout d'une commande pour mettre en forme une conversion depuis la base 10 % 1.2.9 Correction d'une incompatibilité avec simplekv (clés vides...) @@ -2240,6 +2242,32 @@ {} \xintFloatToDecimal{\xintfloateval{add(binomial(#1,i)*#2^i*(1-#2)^(#1-i), i=\BorneInf..\BorneSup)}} } +\newcommand\calcPgeomP[2]{%pk + \xintFloatToDecimal{\xintfloateval{(1-#1)^(#2-1)*(#1)}} +} +\newcommand\calcPgeomC[3]{%pab + \def\BorneInf{#2}\def\BorneSup{#3} + \ifthenelse{\equal{#2}{*}}% + {\def\BorneInf{1}} + {} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneSup{\fpeval{trunc(1/#1*10,0)}}} + {} + \xintFloatToDecimal{\xintfloateval{add((1-#1)^(i-1)*(#1), i=\BorneInf..\BorneSup)}} +} +\newcommand\calcPhypergeomP[4]{%Nnmk + \xintFloatToDecimal{\xintfloateval{binomial(#3,#4)*binomial(#1-#3,#2-#4)/binomial(#1,#2)}} +} +\newcommand\calcPhypergeomC[5]{%Nnmab + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{#1}} + {} + \xintFloatToDecimal{\xintfloateval{add(binomial(#3,i)*binomial(#1-#3,#2-i)/binomial(#1,#2), i=\BorneInf..\BorneSup)}} +} \newcommand\calcPpoissP[2]{%lk \xintFloatToDecimal{\xintfloateval{exp(-#1)*#1^#2/factorial(#2)}} } @@ -2312,6 +2340,60 @@ } } +\NewDocumentCommand{\numPgeomP}{ s O{3} m m }{%*=sci,2=prec,3=p,4=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} + } +} + +\NewDocumentCommand{\numPgeomC}{ s O{3} m m m }{%*=sci,2=prec,3=p,4=a,5=b + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{1}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{\fpeval{trunc(1/#3*10,0)}}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + } +} + +\NewDocumentCommand{\numPhypergeomP}{ s O{3} m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + } +} + +\NewDocumentCommand{\numPhypergeomC}{ s O{3} m m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=a,7=b + \def\BorneInf{#6}\def\BorneSup{#7} + \ifthenelse{\equal{#6}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#7}{*}}% + {\def\BorneSup{#3}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} + } +} + \NewDocumentCommand{\numPpoissP}{ s O{3} m m }{%*=sci,2=prec,3=lbda,4=k \IfBooleanTF{#1}% {% @@ -2832,4 +2914,79 @@ \end{tikzpicture} } +%==============SCHEMASPROBAS============= OK! +%densites utiles +\def\densnorm#1{1/(sqrt(2*pi))*exp(-0.5*(#1*#1))} +\def\densexpo#1{exp(-#1)} + +\defKV[GRPHPROBCONTINUES]{% + CouleurAire=\def\GRPHPROBcoulsurf{#1},% + CouleurCourbe=\def\GRPHPROBcoulcbe{#1},% + Largeur=\def\GRPHPROBlarg{#1},% + Hauteur=\def\GRPHPROBhauteur{#1} +} + +\setKVdefault[GRPHPROBCONTINUES]{% + CouleurAire=LightGray,% + CouleurCourbe=red,% + Largeur=2,% + Hauteur=1,% + AfficheM=true,% + AfficheCadre=true +} + +\NewDocumentCommand\LoiNormaleGraphe{ O{} D<>{} m m m m }{%1=options,2=optionstikz,3=m,4=s,5=a,6=b + %simplekv + \useKVdefault[GRPHPROBCONTINUES]% + \setKV[GRPHPROBCONTINUES]{#1}% + %unites + \def\UNITEX{\fpeval{\GRPHPROBlarg/8}}\def\UNITEY{\fpeval{\GRPHPROBhauteur/0.5}}% + %bornes + \def\BorneInf{\fpeval{(#5-#3)/#4}}\def\BorneSup{\fpeval{(#6-#3)/#4}}% + \ifthenelse{\equal{#5}{*}}{\def\BorneInf{-4}}{}% + \ifthenelse{\equal{#6}{*}}{\def\BorneSup{4}}{}% + %tikzpicture + \begin{tikzpicture}[x=\UNITEX cm,y=\UNITEY cm,#2] + \ifboolKV[GRPHPROBCONTINUES]{AfficheM}% + {\draw (0,-0.0375) node[font=\tiny,scale={2*\UNITEX}] {#3} ;} + {} + \ifboolKV[GRPHPROBCONTINUES]{AfficheCadre}% + {\draw[Gray] (-4,-0.075) rectangle (4,0.425) ;} + {} + \clip (-4,-0.075) rectangle (4,0.425) ; + \draw[black,semithick,fill=\GRPHPROBcoulsurf] ({\BorneInf},0) -- plot [domain={\BorneInf}:{\BorneSup},samples=100] (\x,{\densnorm{\x}}) -- ({\BorneSup},0) -- cycle; + \draw[thick,->,>=stealth] (-4,0)--(4,0) ; + \draw[thick,densely dotted] (0,0)--(0,0.39894) ; + \draw[thick,domain=-4:4,samples=100,\GRPHPROBcoulcbe] plot (\x,{\densnorm{\x}}) ; + \end{tikzpicture} +} + +\NewDocumentCommand\LoiExpoGraphe{ O{} D<>{} m m m }{%1=options,2=optionstikz,3=l,4=a,5=b + %simplekv + \useKVdefault[GRPHPROBCONTINUES]% + \setKV[GRPHPROBCONTINUES]{#1}% + %unites + \def\UNITEX{\fpeval{\GRPHPROBlarg/4}}\def\UNITEY{\fpeval{\GRPHPROBhauteur/1}}% + \def\MOYENNE{\fpeval{trunc(1/#3,0)}}% + %bornes + \def\BorneInf{\fpeval{#3*#4}}\def\BorneSup{\fpeval{#3*#5}}% + \ifthenelse{\equal{#4}{*}}{\def\BorneInf{0}}{}% + \ifthenelse{\equal{#5}{*}}{\def\BorneSup{4}}{}% + %tikzpicture + \begin{tikzpicture}[x=\UNITEX cm,y=\UNITEY cm,#2] + \ifboolKV[GRPHPROBCONTINUES]{AfficheCadre}% + {\draw[Gray] (-0.2,-0.15) rectangle (3.8,0.85) ;} + {} + \clip (-0.2,-0.15) rectangle (3.8,0.85) ; + \draw[black,semithick,fill=\GRPHPROBcoulsurf] ({\BorneInf},0) -- plot [domain={\BorneInf}:{\BorneSup},samples=100] (\x,{0.7*\densexpo{\x}}) -- ({\BorneSup},0) -- cycle; + \ifboolKV[GRPHPROBCONTINUES]{AfficheM}% + {\draw (1,-0.075) node[font=\tiny,scale={\UNITEX}] {\MOYENNE} ; + \draw[thick,densely dotted] (1,0)--(1,{0.7*\densexpo{1}}) ;} + {} + \draw[thick,->,>=stealth] (-0.2,0)--(3.8,0) ; + \draw[thick,->,>=stealth] (0,-0.15)--(0,0.85) ; + \draw[thick,domain=0:3.8,samples=100,\GRPHPROBcoulcbe] plot (\x,{0.7*\densexpo{\x}}) ; + \end{tikzpicture} +} + \endinput \ No newline at end of file diff --git a/macros/unicodetex/latex/bithesis/bithesis.dtx b/macros/unicodetex/latex/bithesis/bithesis.dtx index 215deabaf6..6f50618316 100644 --- a/macros/unicodetex/latex/bithesis/bithesis.dtx +++ b/macros/unicodetex/latex/bithesis/bithesis.dtx @@ -21,7 +21,7 @@ %\ProvidesExplClass{bithesis} %\ProvidesExplClass{bitreport} %\ProvidesExplClass{bitbeamer} -%{2022-09-30}{3.0.4}{BIT Thesis Templates} +%{2022-10-17}{3.0.5}{BIT Thesis Templates} % %\NeedsTeXFormat{LaTeX2e}[2020/10/01] %\ProvidesClass{bitbook} @@ -30,7 +30,7 @@ % [2022/05/09 v2.1.1 BIT Thesis Templates] % %<*driver> -\ProvidesFile{bithesis.dtx}[2022/09/30 3.0.4 BIT Thesis Templates] +\ProvidesFile{bithesis.dtx}[2022/10/17 3.0.5 BIT Thesis Templates] \documentclass[letterpaper]{l3doc} \usepackage{dtx-style} @@ -653,6 +653,8 @@ % % 该选项包含许多子项目,用于录入论文信息。具体内容见下。 % 一般以「En」结尾的项目表示对应的英文字段。 +% +% 这其中的很多字段将用于封面信息的渲染,此时,可以使用 |\\| 来换行,以防止单行内容过长。 % \end{function} % % \begin{function}{info/title,info/titleEn} @@ -978,7 +980,7 @@ % 绘制封面。 % % 在默认配置下,封面中的下划线会自动计算最大宽度。 -% 此时,如果用户需要换行,可以通过「//」控制换行。 +% 此时,如果用户需要换行,可以通过「\\」控制换行。 % % 当关闭自动计算下划线宽度后, % 可以通过 @@ -1910,36 +1912,60 @@ \keys_define:nn { bithesis / info } { title .tl_set:N = \l_@@_value_title_tl, + title .initial:n = {形状记忆聚氨酯的合成及其在织物中的应用(示例)}, titleEn .tl_set:N = \l_@@_value_title_en_tl, + titleEn .initial:n = {Synthesis~and~Application~on~Texttiles~of~the~Shape~Memory~Polyurethane~(example)}, + % 因为是覆盖选项,所以不需要设置初始值。 verticalTitle .tl_set:N = \l_@@_value_vertical_title_tl, school .tl_set:N = \l_@@_value_school_tl, + school .initial:n = {网络空间安全学院(示例)}, major .tl_set:N = \l_@@_value_major_tl, + major .initial:n = {网络空间安全(示例)}, author .tl_set:N = \l_@@_value_author_tl, + author .initial:n = {张三(示例)}, studentId .tl_set:N = \l_@@_value_student_id_tl, + studentId .initial:n = {3120211xxx(示例)}, supervisor .tl_set:N = \l_@@_value_supervisor_tl, + supervisor .initial:n = {李四教授(示例)}, + % 因为默认不显示,所以不需要设置初始值。 externalSupervisor .tl_set:N = \l_@@_value_external_supervisor_tl, keywords .tl_set:N = \l_@@_value_keywords_tl, + keywords .initial:n = {聚氨酯,形状记忆,织物(示例)}, keywordsEn .tl_set:N = \l_@@_value_keywords_en_tl, + keywordsEn .initial:n = {Polyurethane,Shape Memory,Textiles (example)}, translationTitle .tl_set:N = \l_@@_value_trans_title_tl, translationOriginTitle .tl_set:N = \l_@@_value_trans_origin_title_tl, % 中国分类号,研究生学位论文使用 classification .tl_set:N = \l_@@_value_classification_tl, + classification .initial:n = {TQ~028.1(示例)}, % UDC 分类号,研究生学位论文使用 UDC .tl_set:N = \l_@@_value_udc_tl, + UDC .initial:n = {540(示例)}, chairman .tl_set:N = \l_@@_value_chairman_tl, + chairman .initial:n = {王五教授(示例)}, degree .tl_set:N = \l_@@_value_degree_tl, + degree .initial:n = {工学博士(示例)}, degreeEn .tl_set:N = \l_@@_value_degree_en_tl, + degreeEn .initial:n = {Doctor~of~Engineering~(example)}, institute .tl_set:N = \l_@@_value_institute_tl, institute .initial:n = {\c_@@_label_university_tl}, defenseDate .tl_set:N = \l_@@_value_defense_date_tl, + defenseDate .initial:n = {2019年6月(示例)}, authorEn .tl_set:N = \l_@@_value_author_en_tl, + authorEn .initial:n = {San~Zhang~(example)}, schoolEn .tl_set:N = \l_@@_value_school_en_tl, + schoolEn .initial:n = {School~of~Network~Space~Security\\(example)}, supervisorEn .tl_set:N = \l_@@_value_supervisor_en_tl, + supervisorEn .initial:n = {Prof.~Si~Li~(example)}, chairmanEn .tl_set:N = \l_@@_value_chairman_en_tl, + chairmanEn .initial:n = {Prof.~Wu~Wang~(example)}, majorEn .tl_set:N = \l_@@_value_major_en_tl, + majorEn .initial:n = {Cyberspace~Security~and~Technology\\(example)}, instituteEn .tl_set:N = \l_@@_value_institute_en_tl, instituteEn .initial:n = {\c_@@_label_university_en_tl}, defenseDateEn .tl_set:N = \l_@@_value_defense_date_en_tl, + defenseDateEn .initial:n = {June,~2019~(example)}, + % 因为默认不显示,所以不需要设置初始值。 classifiedLevel .tl_set:N = \l_@@_value_classified_level_tl, } % \end{macrocode} @@ -2585,11 +2611,11 @@ % \item \#1: |tl| 为封面信息条目的名称。 % \item \#2: |tl| 为封面信息条目的内容。 % \end{itemize} -% |//| 会被视为换行符,从而实现信息条目换行的效果。 +% |\\| 会被视为换行符,从而实现信息条目换行的效果。 % % \begin{macrocode} \cs_new:Npn \@@_parse_entry #1 #2 { - \seq_set_split:Nnx \l_@@_tmp_right_seq {//} {#2} + \seq_set_split:Nnx \l_@@_tmp_right_seq {\\} {#2} \seq_clear:N \l_@@_tmp_left_seq \seq_map_inline:Nn \l_@@_tmp_right_seq { \seq_put_right:Nn \l_@@_tmp_left_seq {} @@ -2611,9 +2637,9 @@ \seq_set_from_clist:NN \l_@@_input_seq #1 \seq_map_inline:Nn \l_@@_input_seq { % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 // 字符,如果有,则将其分割成多个 + % value 中是否含有 \\ 字符,如果有,则将其分割成多个 % label - value 对。 - % 比如 {label_1} {value // 1} 会被转换成 + % 比如 {label_1} {value \\ 1} 会被转换成 % { {label_1} {value}, {} {1} } \@@_parse_entry ##1 % 然后将这些 label - value 对添加到 \l_@@_right_seq @@ -3974,11 +4000,11 @@ % \item \#1: |tl| 为封面信息条目的名称。 % \item \#2: |tl| 为封面信息条目的内容。 % \end{itemize} -% |//| 会被视为换行符,从而实现信息条目换行的效果。 +% |\\| 会被视为换行符,从而实现信息条目换行的效果。 % % \begin{macrocode} \cs_new:Npn \@@_parse_entry #1 #2 { - \seq_set_split:Nnx \l_@@_tmp_right_seq {//} {#2} + \seq_set_split:Nnx \l_@@_tmp_right_seq {\\} {#2} \seq_clear:N \l_@@_tmp_left_seq \seq_map_inline:Nn \l_@@_tmp_right_seq { \seq_put_right:Nn \l_@@_tmp_left_seq {} @@ -4000,9 +4026,9 @@ \seq_set_from_clist:NN \l_@@_input_seq #1 \seq_map_inline:Nn \l_@@_input_seq { % 然后对于每一对 label 和 value,首先查找 - % value 中是否含有 // 字符,如果有,则将其分割成多个 + % value 中是否含有 \\ 字符,如果有,则将其分割成多个 % label - value 对。 - % 比如 {label_1} {value // 1} 会被转换成 + % 比如 {label_1} {value \\ 1} 会被转换成 % { {label_1} {value}, {} {1} } \@@_parse_entry ##1 % 然后将这些 label - value 对添加到 \l_@@_right_seq diff --git a/macros/unicodetex/latex/bithesis/bithesis.pdf b/macros/unicodetex/latex/bithesis/bithesis.pdf index 9833758cbe..3c3e2dafb7 100644 Binary files a/macros/unicodetex/latex/bithesis/bithesis.pdf and b/macros/unicodetex/latex/bithesis/bithesis.pdf differ -- cgit v1.2.3