From e4d8f7684792e7652b447e6ad94b82ca72886fe3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 3 Nov 2017 21:38:07 +0000 Subject: glossaries-extra (3nov17) git-svn-id: svn://tug.org/texlive/trunk@45682 c570f23f-e606-0410-a88d-b1316a301751 --- .../example-glossaries-acronym-desc.bib | 1 + .../example-glossaries-acronym.bib | 1 + .../example-glossaries-acronyms-lang.bib | 1 + .../glossaries-extra/example-glossaries-brief.bib | 1 + .../example-glossaries-childnoname.bib | 1 + .../glossaries-extra/example-glossaries-cite.bib | 1 + .../glossaries-extra/example-glossaries-images.bib | 1 + .../glossaries-extra/example-glossaries-long.bib | 1 + .../example-glossaries-multipar.bib | 1 + .../glossaries-extra/example-glossaries-parent.bib | 81 +- .../example-glossaries-symbols.bib | 1 + .../glossaries-extra/example-glossaries-url.bib | 1 + .../bib/glossaries-extra/example-glossaries-xr.bib | 1 + .../texmf-dist/doc/latex/glossaries-extra/CHANGES | 84 + .../texmf-dist/doc/latex/glossaries-extra/README | 4 +- .../glossaries-extra/glossaries-extra-code.pdf | Bin 936527 -> 1048866 bytes .../glossaries-extra/glossaries-extra-manual.html | 14403 ++++++++------ .../glossaries-extra/glossaries-extra-manual.pdf | Bin 742259 -> 820853 bytes .../glossaries-extra/glossaries-extra-manual.tex | 1487 +- .../latex/glossaries-extra/sample-abbr-styles.pdf | Bin 500436 -> 512874 bytes .../latex/glossaries-extra/sample-abbr-styles.tex | 5 + .../doc/latex/glossaries-extra/sample-abbrv.pdf | Bin 44761 -> 44749 bytes .../doc/latex/glossaries-extra/sample-accsupp.pdf | Bin 80757 -> 80745 bytes .../latex/glossaries-extra/sample-acronym-desc.pdf | Bin 50368 -> 50358 bytes .../doc/latex/glossaries-extra/sample-acronym.pdf | Bin 36745 -> 36734 bytes .../doc/latex/glossaries-extra/sample-alias.pdf | Bin 43611 -> 43863 bytes .../latex/glossaries-extra/sample-altmodifier.pdf | Bin 35308 -> 35296 bytes .../glossaries-extra/sample-alttree-marginpar.pdf | Bin 91061 -> 91049 bytes .../latex/glossaries-extra/sample-alttree-sym.pdf | Bin 69532 -> 69519 bytes .../doc/latex/glossaries-extra/sample-alttree.pdf | Bin 54866 -> 54855 bytes .../glossaries-extra/sample-autoindex-hyp.pdf | Bin 142037 -> 142016 bytes .../latex/glossaries-extra/sample-autoindex.pdf | Bin 161503 -> 161462 bytes .../doc/latex/glossaries-extra/sample-crossref.pdf | Bin 41294 -> 41281 bytes .../latex/glossaries-extra/sample-crossref2.pdf | Bin 41613 -> 41603 bytes .../doc/latex/glossaries-extra/sample-docdef.pdf | Bin 45257 -> 45245 bytes .../latex/glossaries-extra/sample-entrycount.pdf | Bin 54623 -> 54610 bytes .../doc/latex/glossaries-extra/sample-external.pdf | Bin 55786 -> 55773 bytes .../doc/latex/glossaries-extra/sample-fmt.pdf | Bin 97564 -> 75114 bytes .../doc/latex/glossaries-extra/sample-footnote.pdf | Bin 63232 -> 63220 bytes .../doc/latex/glossaries-extra/sample-header.pdf | Bin 125199 -> 125899 bytes .../latex/glossaries-extra/sample-indexhook.pdf | Bin 42722 -> 42711 bytes .../latex/glossaries-extra/sample-initialisms.pdf | Bin 81618 -> 81603 bytes .../glossaries-extra/sample-mixed-abbrv-styles.pdf | Bin 57823 -> 57809 bytes .../latex/glossaries-extra/sample-mixedsort.pdf | Bin 45154 -> 45141 bytes .../doc/latex/glossaries-extra/sample-mixture.pdf | Bin 159939 -> 159903 bytes .../latex/glossaries-extra/sample-name-font.pdf | Bin 202094 -> 202082 bytes .../doc/latex/glossaries-extra/sample-nested.pdf | Bin 67736 -> 67724 bytes .../sample-noidx-restricteddocdefs.pdf | Bin 47582 -> 47572 bytes .../doc/latex/glossaries-extra/sample-onelink.pdf | Bin 44527 -> 44514 bytes .../glossaries-extra/sample-onthefly-utf8.pdf | Bin 106071 -> 106058 bytes .../glossaries-extra/sample-onthefly-xetex.pdf | Bin 19863 -> 19857 bytes .../doc/latex/glossaries-extra/sample-onthefly.pdf | Bin 43481 -> 43469 bytes .../doc/latex/glossaries-extra/sample-pages.pdf | Bin 38801 -> 38788 bytes .../doc/latex/glossaries-extra/sample-postdot.pdf | Bin 37059 -> 37047 bytes .../doc/latex/glossaries-extra/sample-postlink.pdf | Bin 67890 -> 67878 bytes .../doc/latex/glossaries-extra/sample-prefix.pdf | Bin 33119 -> 33107 bytes .../latex/glossaries-extra/sample-record.glstex | 15 +- .../doc/latex/glossaries-extra/sample-record.pdf | Bin 49091 -> 48035 bytes .../doc/latex/glossaries-extra/sample-record.tex | 11 +- .../glossaries-extra/sample-restricteddocdefs.pdf | Bin 47895 -> 47883 bytes .../latex/glossaries-extra/sample-suppl-hyp.pdf | Bin 34944 -> 34931 bytes .../glossaries-extra/sample-suppl-main-hyp.pdf | Bin 46402 -> 46388 bytes .../latex/glossaries-extra/sample-suppl-main.pdf | Bin 31607 -> 31596 bytes .../doc/latex/glossaries-extra/sample-suppl.pdf | Bin 13423 -> 13411 bytes .../doc/latex/glossaries-extra/sample-trans.pdf | Bin 49455 -> 49443 bytes .../doc/latex/glossaries-extra/sample-undef.pdf | Bin 33231 -> 33219 bytes .../glossaries-extra/sample-unitentrycount.pdf | Bin 61051 -> 61040 bytes .../doc/latex/glossaries-extra/sample.pdf | Bin 45747 -> 45734 bytes .../latex/glossaries-extra/glossaries-extra.dtx | 19075 +++++++++++-------- .../latex/glossaries-extra/glossaries-extra.ins | 6 +- .../glossaries-extra/example-glossaries-xr.tex | 2 +- .../glossaries-extra-stylemods.sty | 738 +- .../latex/glossaries-extra/glossaries-extra.sty | 1413 +- .../latex/glossaries-extra/glossary-bookindex.sty | 210 + 74 files changed, 23455 insertions(+), 14091 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/glossaries-extra/glossary-bookindex.sty (limited to 'Master') diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym-desc.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym-desc.bib index b09edbd6f74..962b7fce810 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym-desc.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym-desc.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @acronym{ndl, description = {fringilla a, euismod sodales, sollicitudin vel, wisi}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym.bib index 8316f97d9f7..83e22b0f217 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronym.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @acronym{lid, short = {LID}, long = {lorem ipsum dolor} diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronyms-lang.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronyms-lang.bib index b9ac0034f11..f4b140a45b0 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronyms-lang.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-acronyms-lang.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @acronym{li, user1 = {love itself}, short = {LI}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-brief.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-brief.bib index b4b50e54a17..8b7641e29a1 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-brief.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-brief.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{lorem, name = {lorem}, description = {ipsum} diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-childnoname.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-childnoname.bib index f910b83aff6..c305df182ec 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-childnoname.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-childnoname.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{scelerisque, name = {scelerisque}, description = {at} diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-cite.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-cite.bib index adc1a90d765..953203be2e0 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-cite.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-cite.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{fusce, user1 = {article-minimal}, name = {fusce}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-images.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-images.bib index 22f8d690a1a..90628820e4f 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-images.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-images.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{sedfeugiat, user1 = {example-image}, name = {sed feugiat}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-long.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-long.bib index da3198e2b09..84e1306b500 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-long.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-long.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{loremipsum, name = {lorem ipsum}, description = {dolor sit amet, consectetuer adipiscing elit. Ut purus diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-multipar.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-multipar.bib index 9ca1fa9b1d3..b52135ad592 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-multipar.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-multipar.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{loremi-ii, name = {lorem 1--2}, description = {Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-parent.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-parent.bib index 80ded4369b7..e10a9ebbbe7 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-parent.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-parent.bib @@ -1,8 +1,37 @@ +% Encoding: UTF-8 @entry{sedmattis, name = {sed mattis}, description = {erat sit amet} } +@entry{nunc, + name = {nunc}, + description = {nisl vitae} +} + +@entry{nonconvallis, + name = {non +convallis}, + description = {lectus orci ut nibh} +} + +@entry{condimentum, + name = {condimentum}, + description = {at +nisl} +} + +@entry{aliquamet, + name = {aliquam et}, + description = {augue} +} + +@entry{rutrum, + name = {rutrum}, + description = {id, enim} +} + + @entry{gravida, parent = {sedmattis}, name = {gravida}, @@ -21,11 +50,6 @@ description = {scelerisque} } -@entry{nunc, - name = {nunc}, - description = {nisl vitae} -} - @entry{libero, parent = {nunc}, name = {libero}, @@ -52,12 +76,6 @@ in eleifend} description = {leo rutrum dui} } -@entry{nonconvallis, - name = {non -convallis}, - description = {lectus orci ut nibh} -} - @entry{sedlorem, parent = {nonconvallis}, name = {sedlorem}, @@ -71,23 +89,12 @@ quis}, description = {egestas id} } -@entry{condimentum, - name = {condimentum}, - description = {at -nisl} -} - @entry{maecenas, parent = {condimentum}, name = {maecenas}, description = {at nibh} } -@entry{aliquamet, - name = {aliquam et}, - description = {augue} -} - @entry{atnunc, parent = {aliquamet}, name = {at nunc}, @@ -95,6 +102,19 @@ nisl} ullamcorper} } +@entry{phasellus, + parent = {rutrum}, + name = {phasellus}, + description = {odio} +} + +@entry{nullanulla, + parent = {rutrum}, + name = {nulla nulla}, + description = {elit, molestie non} +} + + @entry{duisnisl, parent = {atnunc}, name = {duisnisl}, @@ -108,20 +128,3 @@ suscipit} description = {convallis ut} } -@entry{rutrum, - name = {rutrum}, - description = {id, enim} -} - -@entry{phasellus, - parent = {rutrum}, - name = {phasellus}, - description = {odio} -} - -@entry{nullanulla, - parent = {rutrum}, - name = {nulla nulla}, - description = {elit, molestie non} -} - diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-symbols.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-symbols.bib index 196d148ad54..9a40ed73757 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-symbols.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-symbols.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{alpha, symbol = {\ensuremath{\alpha}}, name = {alpha}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-url.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-url.bib index ccf61024b53..b2167996e9e 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-url.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-url.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{aenean-url, user1 = {http://uk.tug.org/}, name = {aenean}, diff --git a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-xr.bib b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-xr.bib index e98957c198d..a89b974488a 100644 --- a/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-xr.bib +++ b/Master/texmf-dist/bibtex/bib/glossaries-extra/example-glossaries-xr.bib @@ -1,3 +1,4 @@ +% Encoding: UTF-8 @entry{lorem, name = {lorem}, description = {ipsum} diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/CHANGES b/Master/texmf-dist/doc/latex/glossaries-extra/CHANGES index 8847364c4f2..d54f50169df 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/CHANGES +++ b/Master/texmf-dist/doc/latex/glossaries-extra/CHANGES @@ -1,3 +1,87 @@ +1.21 (2017-11-03): + + * glossaries-extra.sty: + + - fixed shortcuts=ac and shortcuts=none settings + + - new package option postpunc + + - added extra debug settings (debug=showwrgloss and debug=all) + + - modified \glsseeitemformat + + - new commands: \glsuseabbrvfont and \glsuselongfont + + - new commands: \ifglsxtr@hyperoutside and + \glsxtrinithyperoutside and associated key hyperoutside + and category attribute hyperoutside. + + - new attribute textformat + + - patched \glsnavhyperlink + + - \glsenablehyper and \glsdisablehyper now use \def rather + than \let to allow for redefinitions of \glsdohyperlink etc + + - added \@glsxtr@checkgroup (letter group check is now + in \@print@unsrt@glossary during the construction of + \@glsxtr@doglossary to avoid complications caused + by the tabular-like styles) + + - added \glshex, \glsxtrresourceinit + + - added \GlsXtrTotalRecordCount, \GlsXtrRecordCount, + \GlsXtrLocationRecordCount, \glsxtrdetoklocation, + \glsxtrenablerecordcount, \glsxtrrecordtriggervalue, + \GlsXtrSetRecordCountAttribute, \glsxtrifrecordtrigger + + - added \rgls, \rglspl, \rGls, \rGlspl, \rGLS, \rGLSpl, + \rglsformat, \rglsplformat, \rGlsformat, \rGlsplformat, + \rGLSformat, \rGLSplformat + + - added \glsxtrnewgls, \glsxtrnewglslike, \glsxtrnewrgls, + \glsxtrnewrglslike + + - added \printunsrtglossaryentryprocesshook, + \printunsrtglossaryskipentry, + \printunsrtglossarypredoglossary, + \glsxtriflabelinlist + + - added \GlsXtrIfFieldEqStr + + - new abbreviation styles: nolong-short, nolong-short-noreg, + nolong-short-sm, nolong-short-sc + + * glossary-bookindex.sty: new + + * glossaries-extra-stylemods.sty: + + - added package option "all" + + - added \glsxtrprelocation + + - added \glstreeprelocation and \glstreechildprelocation + + - added \glslistprelocation, \glslistchildprelocation, + and \glslistchildpostlocation + + - patched indexgroup, indexhypergroup, treegroup, + treehypergroup, treenonamegroup, treenonamehypergroup, + alttreegroup, alttreehypergroup, mcolindexgroup, + mcolindexhypergroup, mcolindexspannav, mcoltreegroup, + mcoltreehypergroup, mcoltreespannav, mcoltreenonamegroup, + mcoltreenonamehypergroup, mcoltreenonamespannav, + mcolalttreegroup, mcolalttreehypergroup, mcolalttreespannav, + listgroup, listhypergroup, altlistgroup, altlisthypergroup + styles to discourage page breaks after + letter group headings. + + - added \gglssetwidest + + - ensured that all tabular-like styles have the + \ifglsnogroupskip moved outside of the definition + of \glsgroupskip + 1.20 (2017-09-11): * New 'printgloss' key targetnameprefix diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/README b/Master/texmf-dist/doc/latex/glossaries-extra/README index 695a88fd053..c0b6fc268b7 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/README +++ b/Master/texmf-dist/doc/latex/glossaries-extra/README @@ -1,6 +1,6 @@ -LaTeX Package : glossaries-extra v1.20 +LaTeX Package : glossaries-extra v1.21 -Last Modified : 2017-09-11 +Last Modified : 2017-11-03 Author : Nicola Talbot diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-code.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-code.pdf index d49590fb5cf..a880aa1e2bb 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-code.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-code.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.html b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.html index 46f0c965061..3d32a73bacd 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.html +++ b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.html @@ -202,22 +202,22 @@ a span.HoLogo-TeX span.HoLogo-e{text-decoration:none;} -

-

+

-

+

-

-

glossaries-extra.sty v1.20: an extension to the +

+

glossaries-extra.sty v1.21: an extension to the glossaries package

@@ -240,22 +240,22 @@ class="td11">http://www.dickimaw-books.com/
-

2017-09-11

+

2017-11-03

-

+

-

-

+

Abstract

-

The

The glossaries-extra package is an extension to the glossaries package, providing additional features. Some of the features provided by this package are only available @@ -263,7 +263,7 @@ with glossaries version 4.19 (or above). This document assumes familiarity with the glossaries package. -

The file

The file example-glossaries-xr.tex contains dummy entries with cross-references that may be used for creating minimal working examples for testing the bib2gls

-

Since

-

-

Additional resources:

+

+

Additional resources:

-

1.

1. Introduction

-

The

The glossaries package is a flexible package, but it’s also a heavy-weight package that uses a lot of resources. As package developer, I’m caught between those users who complain about the drawbacks of a heavy-weight package with a large user manual and those users who want more features (which necessarily adds to the package weight and manual size). -

The

The glossaries-extra package is an attempt to provide a compromise for this conflict. Version 4.22 of the glossaries package is the last version to incorporate new @@ -449,10 +462,10 @@ of package loading time and allocation of resources, but those users who do want extra features available will have more of a chance of getting their feature requests accepted.

-

Top

1.1 Package Defaults

-

I’m not happy with some of the default settings assumed by the

I’m not happy with some of the default settings assumed by the glossaries package, and, judging from code I’ve seen, other users also seem unhappy with them, as certain package options are often used in questions posted on various sites. I can’t @@ -462,28 +475,38 @@ but since glossaries-extra is a separate package, I have decided to implement some of these commonly-used options by default. You can switch them back if they’re not appropriate. -

The new defaults are:

+

The new defaults are:

-

This is like: +

This is like: @@ -547,7 +576,7 @@ Commands and Styles).  
\usepackage[toc,nopostdot]{glossaries}  
\usepackage{glossaries-extra}

-

+

  • @@ -559,7 +588,7 @@ Commands and Styles).  
    \usepackage{babel}  
    \usepackage{glossaries-extra} -

    This is like: +

    This is like: @@ -570,7 +599,7 @@ Commands and Styles).  
    \usepackage[toc,nopostdot,translate=babel]{glossaries}  
    \usepackage{glossaries-extra} -

    +

  • @@ -581,7 +610,7 @@ Commands and Styles). \documentclass{memoir}  
    \usepackage{glossaries-extra} -

    This is like: +

    This is like: @@ -591,7 +620,7 @@ Commands and Styles).  
    \usepackage[toc,nopostdot,noredefwarn]{glossaries}  
    \usepackage{glossaries-extra} -

    However @@ -602,7 +631,7 @@ class="cmti-10">However  
    \usepackage{glossaries}  
    \usepackage{glossaries-extra} -

    This is like: +

    This is like: @@ -612,19 +641,19 @@ class="cmti-10">However  
    \usepackage[toc,nopostdot]{glossaries}  
    \usepackage{glossaries-extra} -

    Since by the time

    Since by the time glossaries-extra has been loaded, glossaries has already redefined memoir’s glossary-related commands.

  • -

    Another noticeable change is that by default

    Another noticeable change is that by default \printglossary will now display information text in the document if the external glossary file doesn’t exist. This is explanatory text to help new users who can’t work out what to do next to complete the document build. Once the document is set up correctly and the external files have been generated, this text will disappear. -

    This change is mostly likely to be noticed by users with one or more +

    This change is mostly likely to be noticed by users with one or more redundant empty glossaries who ignore transcript messages, explicitly use \printglossaries  
    \end{document} -

    The above document will only display the list of acronyms at the place where +

    The above document will only display the list of acronyms at the place where \printglossaries occurs. However it will also attempt to input the .gls file associated with the main glossary. -

    If you use

    If you use makeglossaries, you’ll get the warning message: @@ -675,7 +704,7 @@ Warning: File 'test.glo' is empty.  
    Remember to use package option 'nomain' if you  
    don't want to use the main glossary. -

    (where the original file is called

    (where the original file is called test.tex) but if you simply call No file test.gls. -

    This doesn’t occur with

    This doesn’t occur with makeglossaries as it will create the .gls file containing the single command \null. -

    If you simply change from

    If you simply change from glossaries to glossaries-extra in this document, you’ll find a change in the resulting PDF if you don’t use .acr file with makeindex. -

    The transcript file will still contain the message about the missing

    The transcript file will still contain the message about the missing .gls, but now you’ll also see information in the actual PDF document. The simplest remedy is to follow the advice inserted into the document at that point, which is to add the -nomainnomain package option: @@ -732,19 +762,19 @@ class="cmss-10">nomain\printglossaries  
    \end{document} -

    (Note the need to set the acronym style using

    (Note the need to set the acronym style using \setabbreviationstyle before \newacronym. See §3 Abbreviations for further details.) -

    +

    -

    Top

    1.2 New or Modified Package Options

    -

    If you haven’t already loaded

    If you haven’t already loaded glossaries, you can use any of the package options provided by glossaries when you load \setupglossariesglossaries package options may be used in that command. -

    This section only lists options that are either unrecognised by the

    This section only lists options that are either unrecognised by the glossaries package or are a modified version of options of the same name provided by glossaries. See the glossaries user manual for details about the unmodified options.
    -

    -

    The new and modified options provided by

    +

    The new and modified options provided by glossaries-extra are described below: @@ -775,108 +805,339 @@ below:

    postdotdebug
    (New to version 1.12.) This option is just a shortcut for +class="description">The glossaries package has a debug option that allows the values false, + true and showtargets. The debug=showtargets option was introduced to nopostdot=false. +class="cmss-10">glossaries v4.32, so if you want to use this option with glossaries-extra you + must make sure that your version of glossaries supports it. +

    The glossaries-extra package extends this option to provide the additional + values debug=showwrgloss and debug=all. +

    The debug=showwrgloss option implements debug=true and uses +


    \glsxtrwrglossmark  \glsxtrwrglossmark

    +

    + to show a mark just before the write operation performed by the + indexing commands. If you use record=alsoindex there will be a mark + for the write operation to the .aux file for bib2gls and a mark for + the write operation to the associated glossary file for makeindex or + xindy. +

    The debug=all option implements both debug=showtargets and + debug=showwrgloss. +

    +postdot
    (New to version 1.12.) This option is just a shortcut for nopostdot=false.
    +postpunc
    (New to version 1.21.) This option sets the post-description punctuation to + the given value. For example: postpunc=; does + + + +
    + \renewcommand{\glspostdescription}{;} +
    +

    The value may also be one of the following keywords: +

    + comma:
    postpunc=comma is equivalent to + + + +
    + \renewcommand{\glspostdescription}{,} +
    +

    +

    + dot:
    postpunc=dot is equivalent to + + + +
    + \renewcommand{\glspostdescription}{.\spacefactor\sfcode`\. } +
    +

    +

    + none:
    postpunc=none is equivalent to + + + +
    + \renewcommand{\glspostdescription}{} +
    +

    +

    The default definition is + + + +

    +
    + \newcommand*{\glspostdescription}{% +  
      \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi +  
    } +
    +

    where the conditional is determined by the nopostdot package option. + The postpunc option removes the conditional from the definition of + \glspostdescription. The package options nopostdot and postdot will restore + the original definition of \glspostdescription. +

    The glossaries-extra-stylemods package adjusts the predefined styles + that had a hard-coded \space before the number list so that they use + \glsxtrprelocation instead (which is defined to \space). You can therefore + redefine this command in combination with postpunc to alter the separator + before the number list. For example, to have a comma followed by + \hfil: + + + +

    +
    + \usepackage[postpunc=comma,stylemods]{glossaries-extra} +  
    \renewcommand{\glsxtrprelocation}{\hfil} +
    +

    Be careful with doing this as it will look odd if the number list is missing. + (With bib2gls you can instead redefine \glsxtrprelocation to do nothing + and set the location prefixes with loc-prefix which will only apply if the entry + has a number list.) +

    accsupp
    Load the glossaries-accsupp package (if not already loaded). -

    If you want to define styles that can interface with the accessibility support + id="dx1-4036"> package (if not already loaded). +

    If you want to define styles that can interface with the accessibility support provided by glossaries-accsupp use the use the \glsaccessxxx⟩ type of commands - instead of \glsentryxxx⟩ (for example, xxx⟩ (for example, \glsaccesstext instead of + id="dx1-4038"> instead of \glsentrytext). If ). If glossaries-accsupp hasn’t been loaded those commands - are equivalent (for example, hasn’t been loaded those commands are + equivalent (for example, \glsaccesstext just does \glsentrytext) - but if it has been loaded, then the \glsentrytext) but if it + has been loaded, then the \glsaccessxxx⟩ commands will add - the accessibility information. (See xxx⟩ commands will add the + accessibility information. (See §11.2 Accessibility Support for further details.) -

    Note that the accsupp option can only be used as a package option (not - through

    Note that the accsupp option can only be used as a package option (not + through \glossariesextrasetup) since the ) since the glossaries-accsupp package - must be loaded before package must be + loaded before glossaries-extra if it’s required.

    stylemods
    This is a ⟨key⟩=⟨value⟩ option used to load the glossaries-extra-stylemods - package. The value may be a comma-separated list of options to pass to - that package. (Remember to group ⟨value⟩ if it contains any commas.) The - value may be omitted if no options need to be passed. See + package. The value may be a comma-separated list of options to pass to that + package. (Remember to group ⟨value⟩ if it contains any commas.) The value may + be omitted if no options need to be passed. See §2.8 Glossary - Style Modifications for further details. +class="cmsy-10">§2.9 Glossary Style + Modifications for further details. There are two special keyword values: + stylemods=default (equivalent to omitting the value) and stylemods=all, which + loads all the predefined styles.
    undefaction
    This is a ⟨key⟩=⟨value⟩ option, which has two allowed values: warn - and error. This indicates what to do if an undefined glossary entry is - referenced. The default behaviour is undefaction=error, which produces an - error message (the default for glossaries). You can switch this to a warning - message (and ?? appearing in the text) with undefaction=warn. -

    Undefined entries can’t be picked up by any commands that iterate +class="cmss-10">warn and + error. This indicates what to do if an undefined glossary entry is referenced. The + default behaviour is undefaction=error, which produces an error message (the + default for glossaries). You can switch this to a warning message (and ?? + appearing in the text) with undefaction=warn. +

    Undefined entries can’t be picked up by any commands that iterate over a glossary list. This includes \forglsentries and and \glsaddall. + id="dx1-4052">.
    -

    + + + +

    indexcrossrefs
    This is a boolean option. If true, this will automatically index any cross-referenced entries that haven’t been marked as used at the end of the @@ -885,104 +1146,108 @@ class="cmss-10">true, this will automatically index any class="cmss-10">false, but it will be automatically switched on if you use the see or or seealso keys + id="dx1-4055"> keys in any entries (unless autoseeindex=false). To force it off, even if you + id="dx1-4056">). To force it off, even if you use the see or or seealso key, you need to explicitly set indexcrossrefs to + id="dx1-4058"> key, you need to explicitly set indexcrossrefs to false. - - - -

    Note that

    Note that bib2gls can automatically find dependent entries when it + id="dx1-4061"> can automatically find dependent entries when it parses the .bib source file. The record option automatically implements - indexcrossrefs=false. +class="cmtt-10">.bib source file. The record option automatically implements + indexcrossrefs=false.

    autoseeindex
    (New to v1.16.) This is a boolean option. If true (default), this makes the see and and seealso keys automatically index the cross-reference when an entry + id="dx1-4066"> keys automatically index the cross-reference when an entry is defined. If false, the value of those keys will still be stored in their corresponding fields (and can be accessed using commands like \glsxtrusesee and \glsxtruseseealso) but cross-reference won’t be automatically indexed. -

    Note that the

    Note that the record=only option automatically implements autoseeindex=false. -

    For example, if an entry is defined as + id="dx1-4067"> option automatically implements autoseeindex=false. +

    For example, if an entry is defined as

    -
    +
    \newglossaryentry{foo}{name={foo},description={},see={bar,baz}}
    -

    then with

    then with autoseeindex=true, this is equivalent to

    -
    +
    \newglossaryentry{foo}{name={foo},description={}}  
    \glssee{foo}{bar,baz}  
    \glossariesextrasetup{indexcrossrefs=true}  
    \GlsXtrSetField{foo}{see}{bar,baz}
    -

    but with

    but with autoseeindex=false, this is equivalent to

    -
    +
    \newglossaryentry{foo}{name={foo},description={}}  
    \GlsXtrSetField{foo}{see}{bar,baz}
    -

    Note that

    Note that indexcrossrefs isn’t automatically implemented by the presence of the + id="dx1-4069"> isn’t automatically implemented by the presence of the see key when autoseeindex is false. -

    It’s therefore possible to remove the cross-references from the location lists and + id="dx1-4070"> key when autoseeindex is false. +

    It’s therefore possible to remove the cross-references from the location lists and set their position within the glossary style. -

    Another method of preventing the automatic indexing is to define the entries +

    Another method of preventing the automatic indexing is to define the entries before the external indexing files have been opened with \makeglossaries. Since the appropriate file isn’t open, the information can’t be written to it. @@ -994,105 +1259,199 @@ class="cmss-10">glossaries) to record

    (New to v1.08.) This is a ⟨key⟩=⟨value⟩ option, which has three allowed values: - off (default), only and alsoindex. If the value is omitted only is assumed. The - option is provided for the benefit of value⟩ option provided for the benefit of + bib2gls (see (see §9 bib2gls: Managing - Reference Databases). -

    The option may only be set in the preamble. -

    The record=off option switches off the recording, as per the default behaviour. - It implements bib2gls: Managing Reference Databases). +

    The option may only be set in the preamble and can’t be used after + \GlsXtrLoadResources. If the value is missing record=only is assumed. + Permitted values: +

    + off
    This is the default setting. The indexing is performed as normal using + either \makeglossaries or \makenoidxglossaries. This setting + implements undefaction=error. -

    The other values switch on the recording and also . +

    + only
    The indexing is performed by bib2gls (see §9 bib2gls: + Managing Reference Databases). Neither \makeglossaries nor + \makenoidxglossaries is permitted. This setting implements + undefaction=warn, - but record=only will also switch off the indexing mechanism (even if - \makeglossaries or \makenoidxglossaries has been used) whereas - record=alsoindex will both record and index. Note that record=only will prevent - the . +

    The glossaries should be displayed using \printunsrtglossary (or + \printunsrtglossaries). +

    The document build process is (assuming the file is called myDoc.tex): + + + +

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

    +

    Note that record=only will prevent the see from automatically implementing from automatically + implementing \glssee. (bib2gls deals with the deals with the see - field.) You may explicitly use field.) You + may explicitly use \glssee in the document, but bib2gls - will ignore the cross-reference if the will + ignore the cross-reference if the see field was already set for that - entry. -

    The record=only option will automatically set the glossaries package’s sort=none - option if available. (That option value was only introduced to glossaries - v4.30.) -

    With the recording on, any of the commands that would typically index the - entry (such as field was already set for that + entry. +

    The record=only option will automatically set the glossaries package’s + sort=none option if available. (That option value was only introduced to + glossaries v4.30.) +

    + alsoindex
    This is a hybrid setting that uses bib2gls to fetch entry information + from .bib files, but uses makeindex or xindy to create the glossary + files. This option should be used with \makeglossaries but not + with its optional argument. This option should not be used with + \makenoidxglossaries. You may need to change the transcript file used + by bib2gls to avoid a clash with the transcript file used by makeindex + or xindy. (This can be done with bib2gls’s --log-file or -t + option.) +

    The glossaries should be displayed using \printglossary (or + \printglossaries). +

    The document build process is (assuming the file is called myDoc.tex): + + + +

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

    +

    With the recording on (record=only or record=alsoindex), any of the commands + that would typically index the entry (such as \gls, \glstext or \glsadd) will add a \glsxtr@record entry - to the \glsadd) + will add a \glsxtr@record entry to the .aux file. bib2gls can then read these lines to find out which entries - have been used. (Remember that commands like \glsentryname don’t index, - so any use of these commands won’t add a corresponding \glsxtr@record - entry to the can then + read these lines to find out which entries have been used. (Remember + that commands like \glsentryname don’t index, so any use of these + commands won’t add a corresponding \glsxtr@record entry to the + .aux file.) See §9 bib2gls: Managing Reference Databases for - further details. - - - +href="#sec:bib2gls">bib2gls: Managing Reference Databases for further + details.

    docdef
    This option governs the use of \newglossaryentry. It was originally a boolean option, but as from version 1.06, it can now take one of three values (if @@ -1101,10 +1460,10 @@ class="cmss-10">true is assumed):
    • \newglossaryentry is not permitted in the is not permitted in the document environment + id="dx1-4107"> environment (default).
    • \newglossaryentry behaves as it does in the base glossaries package. That is, where its use is permitted in the document environment, it + id="dx1-4110"> environment, it uses the .glsdefs temporary file to store the entry definitions so that on the next LATEX run the entries are defined at the beginning of the document environment. This allows the entry information + id="dx1-4112"> environment. This allows the entry information to be referenced in the glossary, even if the glossary occurs before \newglossaryentry. (For example, when the glossary is displayed in @@ -1130,14 +1489,34 @@ class="cmtt-10">\newglossaryentry. (For example, when the glossary is dis class="E">EX run has drawbacks that are detailed in the glossaries user manual. -
    • +

      Remember that if \newglossaryentry wouldn’t be allowed in the + document environment with the base glossaries package, then it still + won’t be allowed with docdefs=true. If your glossaries occur at the + end of the document, consider using docdef=restricted instead. +

    • (new to version 1.06) \newglossaryentry is permitted in the + id="dx1-4119"> is permitted in the + + + document environment without using the environment without using the .glsdefs file. This means that all entries must be defined before the glossary is displayed, but it avoids the complications associated with saving the entry details @@ -1146,15 +1525,15 @@ class="cmtt-10">.glsdefs file. This means class="cmti-10">key⟩=⟨value⟩ mechanism (that is, the comma and equal sign) and any makeindex or xindy character that occurs in the sort key or label. If any of those characters + id="dx1-4124"> key or label. If any of those characters are made active in the document, then it can cause problems with the entry definition. This option will allow \newglossaryentry to @@ -1162,12 +1541,12 @@ class="cmtt-10">\newglossaryentry to class="cmtt-10">\makenoidxglossaries, but note that \longnewglossaryentry remains a preamble-only command. -

      With this option, if an entry appears in the glossary before it has been +

      With this option, if an entry appears in the glossary before it has been defined, an error will occur (or a warning if the undefaction=warn + id="dx1-4125"> option is used.) If you edit your document and either remove an entry or change its label, you may need to delete the document’s temporary files (such as the .aux and .gls files).

    -

    The

    The glossaries package allows \newglossaryentry within the document + id="dx1-4126"> environment (when used with makeindex or xindy) but the user manual warns + id="dx1-4128">makeindex or xindy) but the user manual warns against this usage. By default the glossaries-extra package prohibits - this, only allowing definitions within the preamble. If you are really - determined to define entries in the prohibits this, only + allowing definitions within the preamble. If you are really determined to define + entries in the document environment, despite all the - associated drawbacks, you can restore this with docdef=true. Note that this - - - - doesn’t change the prohibitions that the glossaries package has in certain - circumstances (for example, when using “option 1”). See the glossaries user - manual for further details. A better option if document definitions are - required is docdef=restricted. Only use docdef=true if document definitions + id="dx1-4130"> environment, despite all the associated drawbacks, you + can restore this with docdef=true. Note that this doesn’t change the + prohibitions that the glossaries package has in certain circumstances (for + example, when using “option 1”). See the glossaries user manual for + further details. A better option if document definitions are required + is docdef=restricted. Only use docdef=true if document definitions are necessary and one or more of the glossaries occurs in the front matter. -

    This option affects commands that internally use

    This option affects commands that internally use \newglossaryentry, such as \newabbreviation, but not the “on-the-fly” commands described in On-the-Fly Document Definitions



    \printabbreviations  \printabbreviations[options]

    -

    +

    which is equivalent to

    options]
    The title of the new glossary is given by -



    \abbreviationsname  \abbreviationsname

    -

    +

    If this command is already defined, it’s left unchanged. Otherwise it’s defined to “Abbreviations” if babel hasn’t been loaded or hasn’t been loaded or \acronymname if babel has been loaded. However, if you’re using has been loaded. However, if you’re using babel it’s likely you + id="dx1-4141"> it’s likely you will need to change this. (See §13 Multi-Lingual Support for further details.) -

    If you don’t use the abbreviations package option, the

    If you don’t use the abbreviations package option, the \abbreviationsname command won’t be defined (unless it’s defined by an included language file).
    -

    - - - -

    If the abbreviations option is used and the acronym option provided by the +

    +

    If the abbreviations option is used and the acronym option provided by the glossaries package hasn’t been used, then \acronymtype will be set to + id="dx1-4145"> will be set to \glsxtrabbrvtype so that acronyms defined with so that acronyms defined with \newacronym can be added + id="dx1-4147"> can be added to the list of abbreviations. If you want acronyms in the main glossary and other abbreviations in the main:

    -
    +
    \renewcommand*{\acronymtype}{main}
    -

    -

    Note that there are no analogous options to the glossaries package’s acronymlists +

    +

    Note that there are no analogous options to the glossaries package’s acronymlists option (or associated commands) as the abbreviation mechanism is handled differently with glossaries-extra. @@ -1328,13 +1716,13 @@ class="cmss-10">glossaries-extra. symbols

    This is passed to glossaries but will additionally define -



    \glsxtrnewsymbol  \glsxtrnewsymbol[options]{}{symbol}

    -

    +

    which is equivalent to

    }
    Note that the sort key is set to the ⟨ key is set to the ⟨label⟩ not the ⟨symbol⟩ as the symbol will likely contain commands. @@ -1371,19 +1759,19 @@ class="cmti-10">symbol⟩ as the symbol will numbers
    This is passed to glossaries but will additionally define -



    \glsxtrnewnumber  \glsxtrnewnumber[options]{number}

    -

    +

    which is equivalent to

    } shortcuts
    Unlike the glossaries package option of the same name, this option isn’t boolean but has multiple values: @@ -1414,18 +1802,31 @@ class="cmss-10">glossaries package option of the same name, this option i
      -
    • shortcuts=acronyms (or shortcuts=acro): set the shortcuts provided - by the shortcuts=acronyms (or shortcuts=acro): set the shortcuts provided by + the glossaries package for acronyms (such as \ac). +class="cmtt-10">\ac). Note that the short + and long forms don’t use \glsxtrshort and \glsxtrlong but use + the original \acrshort and \acrlong, which don’t recognise multiple + abbreviation styles.
    • -
    • shortcuts=ac: set the shortcuts provided by the shortcuts=ac: set the shortcuts provided by the glossaries package for acronyms (such as \ac) but uses the \ac is defined class="cmtt-10">\cgls rather than \gls.
    • -
    • shortcuts=abbreviations (or shortcuts=abbr): +
    • shortcuts=abbreviations (or shortcuts=abbr): set the abbreviation shortcuts provided by glossaries-extra. (See Shortcut Commands shortcuts provided by the glossaries package.
    • -
    • shortcuts=other: set the “other” shortcut commands, but not the shortcut +
    • shortcuts=other: set the “other” shortcut commands, but not the shortcut commands for abbreviations or the acronym shortcuts provided by glossaries. The “other” shortcuts are:
      • \newentry equivalent to equivalent to \newglossaryentry + id="dx1-4162">
      • \newsym equivalent to equivalent to \glsxtrnewsymbol (see the symbols + id="dx1-4164"> (see the symbols option).
      • \newnum equivalent to equivalent to \glsxtrnewnumber (see the numbers + id="dx1-4167"> (see the numbers option).
    • -
    • shortcuts=all (or shortcuts=true): define all the shortcut commands. +
    • shortcuts=all (or shortcuts=true): implements both shortcuts=ac and + shortcuts=other
    • -
    • shortcuts=none (or shortcuts=false): don’t define any of the shortcut +
    • shortcuts=none (or shortcuts=false): don’t define any of the shortcut commands (default).
    -

    Note that multiple invocations of the shortcuts option

    Note that multiple invocations of the shortcuts option within the same option list will override each other.

    -

    After the

    After the glossaries-extra package has been loaded, you can set available options using -



    \glossariesextrasetup  \glossariesextrasetup{options}

    -

    +

    The abbreviations and and docdef options may only be used in the preamble. Additionally, + id="dx1-4178"> options may only be used in the preamble. Additionally, docdef can’t be used after can’t be used after \makenoidxglossaries. + id="dx1-4180">.

    -

    -

    +

    Top

    2. Modifications to Existing Commands and Styles

    -

    The commands used by glossaries to automatically produce an error if an entry is -undefined (such as \glsdoifexists) are changed to take the undefaction option into -account. -

    The \newignoredglossary{type} command now (as from v1.11) has a starred -version that doesn’t automatically switch off the hyperlinks. This starred version may +

    The glossaries package provides +


    \glsseeitemformat  \glsseeitemformat{label}

    +

    +to format items in a cross-reference list (identified with the see key or \glssee). This +was originally defined to use \glsentryname{label} since it makes more sense for the +cross-reference to match the way the term appears in the glossary. Unfortunately this +caused a problem when the name field was sanitized, which used to be the default +setting, so glossaries v3.0 changed the default definition of this command to +use \glsentrytext instead. Since the name and text field are quite often +the same, this change usually doesn’t have a noticeable effect. However, +now that the name field is no longer sanitized (following the redesign of +glossaries v4.0) it makes more sense to restore this command to its original +behaviour, but to take account of abbreviations glossaries-extra redefines this +as: + + + +

    +
    +\renewcommand*{\glsseeitemformat}[1]{% + 
      \glsifregular{#1}{\glsaccessname{#1}}{\glsaccesstext{#1}}% + 
    } +
    +

    If you want to restore the glossaries v3.0+ definition just do: + + + +

    +
    +\renewcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} +
    +

    +

    The commands used by glossaries to automatically produce an error if an entry is +undefined (such as \glsdoifexists) are changed to take the undefaction option into +account. +

    The \newignoredglossary{type} command now (as from v1.11) has a starred +version that doesn’t automatically switch off the hyperlinks. This starred version may be used with the targeturl attribute to create a link to an external URL. (See attribute to create a link to an external URL. (See §5 Categories for furt check that the glossary doesn’t already exist. (The glossaries package omits this check.) -

    You can now provide an ignored glossary with: -


    You can now provide an ignored glossary with: +


    \provideignoredglossary  \provideignoredglossary{type}

    -

    +

    which will only define the glossary if it doesn’t already exist. This also has a starred version that doesn’t automatically switch off hyperlinks. -

    The individual glossary displaying commands

    The individual glossary displaying commands \printglossary, , \printnoidxglossary + id="dx1-5013"> and \printunsrtglossary have two extra keys:

    • target. This is a boolean key which can be used to switch off the automatic + id="dx1-5014">. This is a boolean key which can be used to switch off the automatic hypertarget for each entry. Unlike \glsdisablehyper this doesn’t switch off hyperlinks, so any cross-references within the glossary won’t be affected. @@ -1591,7 +2076,7 @@ class="cmtt-10">\glsdisablehyper this doesn’t switch
    • targetnameprefix={prefix}. Another way of avoiding duplicate target names @@ -1599,12 +2084,12 @@ class="cmtt-10">}. Another way of avoiding duplicate target names class="cmtt-10">\glolinkprefix this doesn’t affect any hyperlinks (such as those created with \gls).
    -

    The

    The \newglossaryentry command has three new keys:

    • category, which sets the category label for the given entry. By default this + id="dx1-5016">, which sets the category label for the given entry. By default this is general. See Categories for furt
    • alias, which allows an entry to be alias to another entry. See , which allows an entry to be alias to another entry. See §10.3 §10.4 Entry Aliases for further details.
    • seealso, which performs much like , which performs much like see, but allows for separate “see” and + id="dx1-5019">, but allows for separate “see” and + + + “see also” treatment. See §2.2 Cross-References (“see” and “see also”) for further details.
    -

    The test file

    The test file example-glossaries-xr.tex contains dummy entries with a mixture of - - - see, , alias and and seealso keys for use with minimal working examples. There are also + id="dx1-5022"> keys for use with minimal working examples. There are also example-glossaries-*.bib files that correspond to each example-glossaries-*.tex file for testing bib2gls. -

    The . +

    The \longnewglossaryentry command now has a starred version (as from v1.12) that doesn’t automatically insert

    -
    +
    \leavevmode\unskip\nopostdesc
    -

    at the end of the description field. -


    at the end of the description field. +


    \longnewglossaryentry  \longnewglossaryentry*{label}{} class="cmtt-10">{description}

    -

    +

    The descriptionplural key is left unset unless explicitly set in ⟨ key is left unset unless explicitly set in ⟨options⟩. -

    The unstarred version no longer hard-codes the above code (which removes +

    The unstarred version no longer hard-codes the above code (which removes trailing space and suppresses the post-description hook) but instead uses: -



    \glsxtrpostlongdescription  \glsxtrpostlongdescription

    -

    +

    This can be redefined to allow the post-description hook to work but retain the \unskip part if required. For example: @@ -1693,59 +2178,60 @@ class="cmtt-10">\unskip part if required. For example:

    -
    +
    \renewcommand*{\glsxtrpostlongdescription}{\leavevmode\unskip}
    -

    This will discarded unwanted trailing space at the end of the description but won’t +

    This will discarded unwanted trailing space at the end of the description but won’t suppress the post-description hook. -

    The unstarred version also alters the base

    The unstarred version also alters the base glossaries package’s treatment of the + id="dx1-5028"> package’s treatment of the descriptionplural key. Since a plural description doesn’t make much sense for + id="dx1-5029"> key. Since a plural description doesn’t make much sense for multi-paragraph descriptions, the default behaviour with glossaries-extra’s + id="dx1-5030">’s \longnewglossaryentry is to simply leave the plural description unset unless explicitly set using the descriptionplural key. The key. The glossaries.sty version of this command sets the description’s plural form to the same as the singular.2.1 -

    Note that this modified unstarred version doesn’t append +

    Note that this modified unstarred version doesn’t append \glsxtrpostlongdescription to the description’s plural form. -

    The

    The \newterm command (defined through the index package option) is modified + id="dx1-5038"> command (defined through the index package option) is modified so that the category defaults to index. The . The \newacronym command is modified + id="dx1-5041"> command is modified to use the new abbreviation interface provided by glossaries-extra. (See §3 Abbreviations.) -

    The

    The \makeglossaries command now has an optional argument. -



    \makeglossaries  \makeglossaries[list]

    -

    +

    If ⟨list⟩ is empty, \makeglossaries behaves as per its original definition in the @@ -1753,65 +2239,83 @@ class="cmtt-10">\makeglossaries behaves as per its original definition in class="cmss-10">glossaries package, otherwise ⟨list⟩ can be a comma-separated list of glossaries that need processing with an external indexing application. -

    It should then be possible to use

    This command is not permitted with the record=only package option. Without +the optional argument, it’s permitted with record=alsoindex. With the optional +argument, it’s only permitted with the default record=off. +

    It should then be possible to use \printglossary for those glossaries listed in ⟨list⟩ and \printnoidxglossary for the other glossaries. (See the accompanying file sample-mixedsort.tex for an example.) -

    If you use the optional argument ⟨

    If you use the optional argument ⟨list⟩, you can’t define entries in the document (even with the docdef option).
    -

    -

    You will need at least version 2.20 of option).

    +

    +

    You will need at least version 2.20 of makeglossaries or at least version 1.3 of the Lua alternative makeglossaries-lite.lua (both distributed with glossaries -v4.27) to allow for this use of makeglossaries-lite (both distributed with glossaries v4.27) to +allow for this use of \makeglossaries[list]. Alternatively, use the -automake option. +class="cmtt-10">]. Alternatively, use the automake +option.

    -

    Top

    2.1 Entry Indexing

    -

    The

    The glossaries-extra package provides extra keys for commands like \gls and \glstext: + + +

    noindex
    This is a boolean key. If true, this suppresses the indexing. (That is, - - - it prevents \gls or whatever from adding a line to the external glossary - file.) This is more useful than the indexonlyfirstindexonlyfirst package option provided by glossaries, as the first use might not be the most pertinent use. (If you - want to apply indexonlyfirstindexonlyfirst to selected entries, rather than all of them, you can use the wrgloss=after for specific instances. Note that this opti settings (such as noindex). -

    The default value is set up using -


    The default value is set up using +


    \glsxtrinitwrgloss  \glsxtrinitwrgloss

    -

    +

    which is defined as:

    -
    +
    \newcommand*{\glsxtrinitwrgloss}{%  
     \glsifattribute{\glslabel}{wrgloss}{after}%  
     {% @@ -1872,15 +2376,15 @@ class="cmtt-10">\glsxtrinitwrgloss

     
     }%  
    }
    -

    This sets the conditional -


    This sets the conditional +


    \ifglsxtrinitwrglossbefore  \ifglsxtrinitwrgloss

    -

    +

    which is used to determine where to perform the indexing. -

    This means you can set the

    This means you can set the wrgloss attribute to \GlsXtrSetDefaultGlsOpts will override \glsxtrinitwrgloss.) +

    +hyperoutside
    (New to v1.21.) This is a boolean key. The default is hyperoutside=true, + which puts the hyperlink outside \glstextformat, so that commands like \gls + will effectively do
    +
    + \hyperlink{target}{\glstextformat{link text}} +
    +
    This is the same behaviour as with the base glossaries package. With + hyperoutside=false, \hyperlink is placed inside the argument of + \glstextformat:
    +
    + \glstextformat{\hyperlink{target}{link text}} +
    +
    You can use the hyperoutside category attribute to set the default for a + given category. This can be combined with the use of the textformat + attribute to counteract any interference caused by \hyperlink. For + example: + + + +
    + \glssetcategoryattribute{mathrelation}{hyperoutside}{false} +
    +

    will set hyperoutside=false for all entries that are assigned to the category + mathrelation and + + +

    -
    -

    There is a new hook that’s used each time indexing information is written to the +

    + \glssetcategoryattribute{mathrelation}{textformat}{mathrel} +
    +

    will use \mathrel instead of \glstextformat resulting in:

    +
    + \mathrel{\hyperlink{target}{link text}} +
    +
    for entries with the category key set to mathrelation. +

    There is a new hook that’s used each time indexing information is written to the external glossary files: -



    \glsxtrdowrglossaryhook  \glsxtrdowrglossaryhook{label}

    -

    +

    where ⟨label⟩ is the entry’s label. This does nothing by default but may be redefined. (See, for example, the accompanying sample file sample-indexhook.tex, which uses this hook to determine which entries haven’t been indexed.) -

    As from version 1.14, there are two new keys for

    As from version 1.14, there are two new keys for \glsadd: thevalue and and theHvalue. + id="dx1-6022">. These keys are designed for manually adding explicit locations rather than obtaining the value from the associated counter. As from version 1.19, these two keys are also available for commands like \gls and \glslink. The thevalue keys is intended + id="dx1-6023"> keys is intended primarily for adding locations in supplementary material that can’t be obtained from a counter. -

    The principle key

    The principle key thevalue is for the location value. The other key is for the location value. The other key theHvalue can + id="dx1-6025"> can be used to extract a prefix value for the first argument of commands like \glsnoidxdisplayloc. It’s value must be in the format ⟨. It’s value must be in the format ⟨prefix⟩⟨location⟩. In general, there’s little need for this key as the prefix is typically associated with a counter that can be used to form hypertargets. - - - -

    If you use

    If you use thevalue, you must make sure that you use an indexing application + id="dx1-6027">, you must make sure that you use an indexing application that will accept the given value.
    -

    -

    For example,

    +

    For example, makeindex will only accept locations in the form [⟨ will only accept locations in the form [⟨num⟩⟨sep⟩]*⟨num⟩ @@ -1961,38 +2548,38 @@ instances of a number followed by the recognised separator character (set with \glsSetCompositor). This means that makeindex won’t accept, for + id="dx1-6029"> won’t accept, for example,

    -
    +
    \glsadd[thevalue={Supplementary Material}]{sample}
    -

    This location value will be accepted by

    This location value will be accepted by bib2gls, since it will allow any location and + id="dx1-6031">, since it will allow any location and will only try forming ranges if the location matches any of its numerical patterns. In the case of xindy, you’ll need to add a rule that can match the value. + id="dx1-6032">, you’ll need to add a rule that can match the value. If you’re using hyperref, you may need to use the , you may need to use the format key to prevent a + id="dx1-6034"> key to prevent a hyperlink if one can’t naturally be formed from the prefix, counter and location value. -

    For example, suppose the file

    For example, suppose the file suppl.tex contains:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \newglossaryentry{sample}{name={sample},description={an example}} @@ -2003,17 +2590,17 @@ class="cmtt-10">suppl.tex contains:  
    \gls{sample}.  
    \end{document}
    -

    This has an entry on page S.2. Suppose another document wants to include this +

    This has an entry on page S.2. Suppose another document wants to include this location in the glossary. Then this can be done by setting thevalue to to S.2. For example:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \makeglossaries @@ -2024,59 +2611,59 @@ example:  
    \glsadd[thevalue={S.2}]{sample}  
    \end{document}
    -

    This location value will be accepted by

    This location value will be accepted by makeindex as it’s in the form ⟨ as it’s in the form ⟨num⟩⟨sep⟩⟨num⟩. -

    If you want hyperlinks, things are more complicated. First you need to set the +

    If you want hyperlinks, things are more complicated. First you need to set the externallocation to the location of the PDF file. For example: + id="dx1-6037"> to the location of the PDF file. For example:

    -
    +
    \glssetcategoryattribute{supplemental}{externallocation}{suppl.pdf}  
    \newglossaryentry{sample}{category=supplemental,  
     name={sample},description={an example}}
    -

    Next you need to add

    Next you need to add glsxtrsupphypernumber as the format:

    -
    +
    \glsadd[thevalue={S.2},format=glsxtrsupphypernumber]{sample}
    -

    Both documents will need to use the

    Both documents will need to use the hyperref package. Remember that the counter + id="dx1-6038"> package. Remember that the counter used for the location also needs to match. If \theHcounter⟩ is defined in the other document and doesn’t match in the referencing document, then you need to use theHvalue to set the appropriate value. See the accompanying sample files + id="dx1-6039"> to set the appropriate value. See the accompanying sample files sample-suppl-hyp.tex and sample-suppl-main-hyp.tex for an example that uses hyperref. -

    The hyperlink for the supplementary location may or . +

    The hyperlink for the supplementary location may or may not take you to the relevant place in the external PDF file depending on your PDF viewer. Some may not support external links, and some may take you to the first page or last visited page.
    -

    -

    For example, if both

    +

    For example, if both sample-suppl-hyp.pdf and sample-suppl-main-hyp.pdf are in the same directory, then viewing sample-suppl-main-hyp.pdf in Evince will take you to the correct location in the linked document (when you click on the S.2 external link), but Okular will take you to the top of the first page of the linked document. -

    +

    -

    Top

    2.2 Cross-References (“see” and “see also”)

    -

    The value of the

    The value of the see key is now saved as a field. This isn’t the case with glossaries, @@ -2116,20 +2703,20 @@ class="cmss-10">document environment on the next run. -

    This modification allows

    This modification allows glossaries-extra to provide -



    \glsxtraddallcrossrefs  \glsxtraddallcrossrefs

    -

    +

    which is used at the end of the document to automatically add any unused cross-references unless the package option indexcrossrefs was set to false. -

    As a by-product of this enhancement, the

    As a by-product of this enhancement, the see key will now work for entries defined in the see\makeglossaries. Note that glossaries v4.24 introduced the seenoindexglossaries v4.24 introduced the seenoindex package option, which can be used to suppress the error when the see key is used before \makeglossaries, so seenoindex=ignore\makeglossaries, so seenoindex=ignore will allow the see value to be stored even though it may not be possible to index it at that point. -

    As from version 1.06, you can display the cross-referenced information for a given +

    As from version 1.06, you can display the cross-referenced information for a given entry using -



    \glsxtrusesee  \glsxtrusesee{label}

    -

    +

    This internally uses -



    \glsxtruseseeformat  tag}{xr list}

    -

    +

    where ⟨tag⟩ and ⟨xr list⟩ are obtained from the value of the entry’s see field hasn’t been set for the entry given by ⟨label⟩. -

    Suppose you want to suppress the number list using nonumberlist

    Suppose you want to suppress the number list using nonumberlist. This will automatically prevent the cross-references from being displayed. The -seeautonumberlistseeautonumberlist package option will automatically enable the number list for entries that have the see key set, but this will also show the rest of the number list. -

    Another approach in this situation is to use the post description hook +

    Another approach in this situation is to use the post description hook with \glsxtrusesee to append the cross-reference after the description. For example: @@ -2222,18 +2814,18 @@ example:

    -
    +
    \renewcommand*{\glsxtrpostdescgeneral}{%  
     \ifglshasfield{see}{\glscurrententrylabel}  
     {, \glsxtrusesee{\glscurrententrylabel}}%  
     {}%  
    }
    -

    Now the cross-references can appear even though the

    Now the cross-references can appear even though the number list has been suppressed. -

    As from v1.16, there’s a separate

    As from v1.16, there’s a separate seealso key. Unlike see\seealsoname or \glsxtruseseealsoformat, described below). -

    You can display the formatted list of cross-references stored in the

    You can display the formatted list of cross-references stored in the seealso key using: -



    \glsxtruseseealso  \glsxtruseseealso{label}

    -

    +

    This works in much the same way as \glsxtrusesee but it internally uses -



    \glsxtruseseeformat  \glsxtruseseealsoformat{xr list}

    -

    +

    For example:

    -
    +
    \renewcommand*{\glsxtrpostdescgeneral}{%  
     \ifglshasfield{see}{\glscurrententrylabel}  
     {, \glsxtrusesee{\glscurrententrylabel}}% @@ -2290,20 +2882,20 @@ For example:  
     {}%  
    }
    -

    -

    The actual unformatted comma-separated list ⟨

    +

    The actual unformatted comma-separated list ⟨xr-list⟩ stored in the seealso field can be accessed with: -



    \glsxtrseealsolabels  \glsxtrseealsolabels{label}

    -

    +

    This will just expand to the ⟨xr-labels⟩ provided in the value of the seealso[⟨tag], so it can’t be automatically treated as a simple comma-separated list. -

    The base

    The base glossaries package provides \glsseelist, which requires a @@ -2329,20 +2921,20 @@ class="cmti-10">label⟩} as the argument. For convenience, glossaries-extra provides -



    \glsxtrseelist  \glsxtrseelist{xr list}

    -

    +

    which fully expands its argument and passes it to \glsseelist. -

    The

    The seealso key implements the automatic indexing using -



    \glsxtrindexseealso  label}{xr list}

    -

    +

    which just does

    xr list}
    -
    unless the xindy unless the xindy option is used with glossaries v4.30+, in which case a distinct seealso cross-reference class is used instead. -

    +

    -

    Top

    2.3 Entry Display Style Modifications

    -

    Recall from the

    Recall from the glossaries package that commands such as \gls display text at that point in the document (optionally with a hyperlink to the relevant @@ -2388,7 +2981,7 @@ whether or not it actually has a hyperlink. The actual text and the way it’s displayed depends on the command used (such as \gls) and the entry format. -

    The default entry format (

    The default entry format (\glsentryfmt) used in the §3.2 Abbreviation Styles). -

    This means that entries with a short form can be treated as regular entries rather +

    This means that entries with a short form can be treated as regular entries rather than abbreviations if it’s more appropriate for the desired style. -

    As from version 1.04,

    As from version 1.04, \glsentryfmt now puts \glsgenentry in the argument of the new command -



    \glsxtrregularfont  \glsxtrregularfont{text}

    -

    +

    This just does its argument ⟨text⟩ by default. This means that if you want regular entries in a different font but don’t want that font to apply to abbreviations, then @@ -2494,95 +3087,87 @@ you can redefine \glsxtrregularfont. This is more precise than changing \glstextformat which will be applied to all linking commands for all entries. -

    For example: + id="dx1-8027"> which is applied to all linking commands for all entries, unless +overridden by the textformat attribute. +

    For example:

    -
    +
    \renewcommand*{\glsxtrregularfont}[1]{\textsf{#1}}
    -

    You can access the label through

    You can access the label through \glslabel. For example, you can query the category:

    -
    +
    \renewcommand*{\glsxtrregularfont}[1]{%  
     \glsifcategory{\glslabel}{general}{\textsf{#1}}{#1}}
    -

    or query the category attribute: +

    or query the category attribute, for example, provide a custom attribute called +font:

    -
    +
    \glssetcategoryattribute{general}{font}{sf}  
    \renewcommand*{\glsxtrregularfont}[1]{%  
     \glsifattribute{\glslabel}{font}{sf}{\textsf{#1}}{#1}}
    -

    or use the attribute to store the control sequence name: +

    As from version 1.21, it’s simpler to just do, for example:

    -
    -\glssetcategoryattribute{general}{font}{textsf} - 
    \glssetcategoryattribute{acronym}{font}{emph} - 
    \renewcommand*{\glsxtrregularfont}[1]{% - 
      \glshasattribute{\glslabel}{font}% - 
      {\csuse{\glsgetattribute{\glslabel}{font}}{#1}}% - 
      {#1}% - 
    } +
    +\glssetcategoryattribute{general}{textformat}{textsf}
    -

    (Remember the category and attribute settings will only queried here for regular -entries, so if the abbreviation style for the acronym category in the above example -changes the regular attribute to “false”, \glsxtrregularfont will no longer -apply.) -

    The

    without redefining \glsxtrregularfont. +

    The \glspostlinkhook provided by the glossaries package to insert information after the link-text produced by commands like \gls and \glstext is redefined to -



    \glsxtrpostlinkhook  \glsxtrpostlinkhook

    -

    +

    This command will discard a following full stop (period) if the discardperiod attribute + id="dx1-8031"> attribute is set to “true” for the current entry’s category. It will also do -



    \glsxtrpostlink  \glsxtrpostlink

    -

    +

    if a full stop hasn’t be discarded and -



    \glsxtrpostlinkendsentence  \glsxtrpostlinkendsentence

    -

    +

    if a full stop has been discarded. -

    Avoid the use of

    Avoid the use of \gls-like and \glstext-like commands within the post-link hook as they will cause interference. Consider using commands like @@ -2594,205 +3179,204 @@ href="#sec:nested">§2.6 Nested Links) instead.
    -

    -

    By default

    +

    By default \glsxtrpostlink just does \glsxtrpostlinkcategory if + id="dx1-8034"> if it exists, where ⟨category⟩ is the category label for the current entry. (For example, for the general category, category, \glsxtrpostlinkgeneral if it has been defined.) -

    The sentence-ending hook is slightly more complicated. If the command +

    The sentence-ending hook is slightly more complicated. If the command \glsxtrpostlinkcategory is defined the hook will do that and then insert a + id="dx1-8036"> is defined the hook will do that and then insert a full stop with the space factor adjusted to match the end of sentence. If \glsxtrpostlinkcategory hasn’t been defined, the space factor is adjusted to match + id="dx1-8037"> hasn’t been defined, the space factor is adjusted to match the end of sentence. This means that if you have, for example, an entry that ends with a full stop, a redundant following full stop will be discarded and the space factor - - - adjusted (in case the entry is in uppercase) unless the entry is followed by additional material, in which case the following full stop is no longer redundant and needs to be reinserted. -

    There are some convenient commands you might want to use when customizing +

    There are some convenient commands you might want to use when customizing the post-link-text category hooks: -


    link-text category hooks: +


    \glsxtrpostlinkAddDescOnFirstUse  \glsxtrpostlinkAddDescOnFirstUse

    -

    +

    This will add the description in parentheses on first use. -

    For example, suppose you want to append the description in parentheses on first + + + +

    For example, suppose you want to append the description in parentheses on first use for entries in the symbol category: + id="dx1-8042"> category:

    -
    +
    \newcommand*{\glsxtrpostlinksymbol}{%  
      \glsxtrpostlinkAddDescOnFirstUse  
    }
    -

    -


    +


    \glsxtrpostlinkAddSymbolOnFirstUse  \glsxtrpostlinkAddSymbolOnFirstUse

    -

    +

    This will append the symbol (if defined) in parentheses on first use. -

    If you want to provide your own custom format be aware that you can’t use +

    If you want to provide your own custom format be aware that you can’t use \ifglsused within the post- within the post-link-text hook as by this point the first use flag will have been unset. Instead you can use -



    \glsxtrifwasfirstuse  \glsxtrifwasfirstuse{true}{false}

    -

    +

    This will do ⟨true⟩ if the last used entry was the first use for that entry, otherwise it + id="dx1-8049">first use for that entry, otherwise it will do ⟨false⟩. (Requires at least glossaries v4.19 to work properly.) This command is locally set by commands like \gls, so don’t rely on it outside of the post-link-text + id="dx1-8050">link-text hook. -

    Note that commands like

    Note that commands like \glsfirst and and \glsxtrfull fake first use for the + id="dx1-8052"> fake first use for the benefit of the post-link-text hooks by setting link-text hooks by setting \glsxtrifwasfirstuse to \@firstoftwo. (Although, depending on the styles in use, they may not exactly match the text produced by \gls-like commands on first use.) However, the + id="dx1-8055">-like commands on first use.) However, the short-postfootnote style alters style alters \glsxtrfull so that it fakes non-first use otherwise + id="dx1-8058">first use otherwise the inline full format would include the footnote, which is inappropriate.
    -

    -

    For example, if you want to place the description in a footnote after the link-text +

    +

    For example, if you want to place the description in a footnote after the link-text on first use for the first use for the general category: + id="dx1-8061"> category:

    -
    +
    \newcommand*{\glsxtrpostlinkgeneral}{%  
      \glsxtrifwasfirstuse{\footnote{\glsentrydesc{\glslabel}}}{}%  
    }
    -

    -

    The

    +

    The short-postfootnote abbreviation style uses the post- abbreviation style uses the post-link-text hook to place the footnote after trailing punctuation characters. -

    You can set the default options used by

    You can set the default options used by \glslink, , \gls etc with: -


    etc with: +


    \GlsXtrSetDefaultGlsOpts  \GlsXtrSetDefaultGlsOpts{options}

    -

    +

    For example, if you mostly don’t want to index entries then you can do:

    -
    +
    \GlsXtrSetDefaultGlsOpts{noindex}
    -

    and then use, for example,

    and then use, for example, \gls[noindex=false]{sample} when you actually want the location added to the number list. These defaults may be overridden by other settings (such as category attributes) in addition to any settings passed in the option argument of commands like \glslink and \gls. -

    Note that if you don’t want

    Note that if you don’t want any indexing, just omit \makeglossaries and \printglossaries (or analogous commands). If you want to adjust the default for wrgloss, it’s better to do this by redefining , it’s better to do this by redefining \glsxtrinitwrgloss + id="dx1-8069"> instead. -

    \GlsXtrSetDefaultGlsOpts doesn’t affect \glsadd.
    -

    -

    If you want to change the default value of

    +

    If you want to change the default value of format, you can instead use: -


    , you can instead use: +


    \GlsXtrSetDefaultNumberFormat{format}

    -

    +

    This has the advantage of also working for \glsadd. For example, if you want all locations in the back matter to appear in italic (unless explicitly @@ -2801,14 +3385,14 @@ overridden):

    -
    +
    \backmatter  
    \GlsXtrSetDefaultNumberFormat{hyperit}
    -

    -

    Commands like

    +

    Commands like \gls have star ( have star (*) and plus (+) modifiers as a short cut for hyper=false and hyper=true. The glossaries-extra package provides a way to add a third modifier, if required, using -



    \GlsXtrSetAltModifier  \GlsXtrSetAltModifier{char}{options}

    -

    +

    where ⟨char⟩ is the character used as the modifier and ⟨options⟩ is the default set of options (which may be overridden). Note that ⟨char⟩ must be a single character (not a UTF-8 character, unless you are using XƎLATEX or LuaLATEX). -

    When choosing the character ⟨

    When choosing the character ⟨char⟩ take care of any changes in category code.
    -

    -

    Example: +

    +

    Example:

    -
    +
    \GlsXtrSetAltModifier{!}{noindex}
    -

    This means that

    This means that \gls!{sample} will be equivalent to \gls[noindex]{sample}. It’s not possible to mix modifiers. For example, if you want to do @@ -2853,23 +3437,23 @@ not possible to mix modifiers. For example, if you want to do

    -
    +
    \gls[noindex,hyper=false]{sample}
    -

    you can use

    you can use \gls*[noindex]{sample} or \gls![hyper=false]{sample} but you can’t combine the * and ! modifiers. -

    Location lists displayed with \printnoidxglossary internally use -



    \glsnoidxdisplayloc  \glsnoidxdisplayloc{prefix}{} class="cmtt-10">{location}

    -

    +

    This command is provided by glossaries, but is modified by glossaries-extra to check @@ -2890,53 +3474,53 @@ class="cmtt-10">( and ) which are discarded to obtain the actual control sequence name that forms the location formatting command. -

    If the range identifiers aren’t present, this just uses -


    If the range identifiers aren’t present, this just uses +


    \glsxtrdisplaysingleloc  \glsxtrdisplaysingleloc{format}{location}

    -

    +

    otherwise it uses -



    \glsxtrdisplaystartloc  \glsxtrdisplaystartloc{format}{location}

    -

    +

    for the start of a range (where the identifier has been stripped from ⟨format⟩) or -



    \glsxtrdisplayendloc  \glsxtrdisplayendloc{format}{location}

    -

    +

    for the end of a range (where the identifier has been stripped from ⟨format⟩). -

    By default the start range command saves the format in -


    By default the start range command saves the format in +


    \glsxtrlocrangefmt  \glsxtrlocrangefmt

    -

    +

    and does
    \glsxtrdisplaysingleloc{}
    (If the format is empty, it will be replaced with glsnumberformat.) -

    The end command checks that the format matches the start of the range, +

    The end command checks that the format matches the start of the range, does -



    \glsxtrdisplayendlochook  \glsxtrdisplayendlochook{format}{location}

    -

    +

    (which does nothing by default), followed by
    \glsxtrdisplaysingleloc{\glsxtrlocrangefmt to empty. -

    This means that the list +

    This means that the list

    -
    +
    \glsnoidxdisplayloc{}{page}{(textbf}{1},  
    \glsnoidxdisplayloc{}{page}{textbf}{1},  
    \glsnoidxdisplayloc{}{page}{)textbf}{1}.
    -

    doesn’t display any differently from +

    doesn’t display any differently from

    -
    +
    \glsnoidxdisplayloc{}{page}{textbf}{1},  
    \glsnoidxdisplayloc{}{page}{textbf}{1},  
    \glsnoidxdisplayloc{}{page}{textbf}{1}.
    -

    but it does make it easier to define your own custom list handler that can +

    but it does make it easier to define your own custom list handler that can accommodate the ranges. -

    +

    -

    Top

    2.4 Entry Counting Modifications

    -

    The

    If you are using bib2gls you may find it more convenient to use the record +count commands described in §9 bib2gls: Managing Reference Databases +instead. +

    The \glsenableentrycount command is modified to allow for the command is modified to allow for the entrycount + id="dx1-9004"> attribute. This means that you not only need to enable entry counting with \glsenableentrycount, but you also need to set the appropriate attribute (see §5 Categories). -

    For example, instead of just doing: +

    For example, instead of just doing:

    -
    +
    \glsenableentrycount
    -

    you now need to do: +

    you now need to do:

    -
    +
    \glsenableentrycount  
    \glssetcategoryattribute{abbreviation}{entrycount}{1}
    -

    This will enable the entry counting for entries in the

    This will enable the entry counting for entries in the abbreviation category, but any + id="dx1-9005"> category, but any entries assigned to other categories will be unchanged. -

    Further information about entry counting, including the new per-unit feature, is +

    Further information about entry counting, including the new per-unit feature, is described in §6 Entry Counting. -

    +

    -

    Top

    2.5 Plurals

    -

    Some languages, such as English, have a general rule that plurals are formed from +

    Some languages, such as English, have a general rule that plurals are formed from the singular with a suffix appended. This isn’t an absolute rule. There are plenty of exceptions (for example, geese, children, churches, elves, fairies, sheep). The plural

    To make life easier for languages where the majority of plurals can simply be +

    To make life easier for languages where the majority of plurals can simply be formed by appending a suffix to the singular, the glossaries package sets lets the package lets the plural field default to the value of the plural supplied as well, and you only need to use it for the exceptions. -

    For languages that don’t have this general rule, the

    For languages that don’t have this general rule, the plural field will always need to be supplied, where needed. -

    There are other plural fields, such as

    There are other plural fields, such as firstplural, longpluralshortplural

    If these fields are omitted, the

    If these fields are omitted, the glossaries package follows these rules:

      @@ -3149,7 +3743,7 @@ class="cmtt-10">\acrpluralsuffixshort field.
    -

    This

    This last case is changed with glossaries-extra. With this extension package, the \abbrvpluralsuffix is redefined. In most cases its redefined to use -



    \glsxtrabbrvpluralsuffix  \glsxtrabbrvpluralsuffix

    -

    +

    which defaults to just \glspluralsuffix. Some of the abbreviation styles have their own command for the plural suffix, such as \abbrvpluralsuffix, which changes with the style. Redefining \acrpluralsuffix will have no affect, since it’s not used by the new abbreviation mechanism. -

    If you require a mixture (for example, in a multilingual document), there are two +

    If you require a mixture (for example, in a multilingual document), there are two attributes that affect the short plural suffix formation. The first is aposplural -

    +
    '\abbrvpluralsuffix
    -

    That is, an apostrophe followed by

    That is, an apostrophe followed by \abbrvpluralsuffix is appended. The second attribute is shortpluralshort. -

    +

    -

    Top

    2.6 Nested Links

    -

    Complications arise when you use

    Complications arise when you use \gls in the value of the name

    Things can go wrong if we try the following with the

    Things can go wrong if we try the following with the glossaries package:

    -
    +
    \newacronym{ssi}{SSI}{Server Side Includes}  
    \newacronym{html}{HTML}{Hypertext Markup Language}  
    \newacronym{shtml}{S\gls{html}}{\gls{ssi} enabled \gls{html}}
    -

    -

    The main problems are: +

    +

    The main problems are:

    1. first use if the long form is displayed before the shor -
      +
      \gls{\uppercase ssi} enabled \gls{html}
      -

      which just doesn’t work. Grouping the

      which just doesn’t work. Grouping the \gls{ssi} doesn’t work either as this will effectively try to do

      -
      +
      \uppercase{\gls{ssi}} enabled \gls{html}
      -

      This will upper case the label

      This will upper case the label ssi so the entry won’t be recognised. This problem will also occur if you use the all capitals version, such as shtml. For example: -

      +
      This section discusses \gls{ssi}, \gls{html} and \gls{shtml}.
      -

      This produces: +

      This produces:

      -

      This section discusses server side includes (SSI), hypertext +

      This section discusses server side includes (SSI), hypertext markup language (HTML) and SSI enabled HTML (SHTML).

      -

      So the

      So the first use of the shtml entry produces “SSI enabled HTML (SHTML)”. -

      Now let’s suppose the

      Now let’s suppose the html entry is used before the shtml but the ssi entry is @@ -3324,41 +3918,41 @@ class="cmtt-10">shtml entry, for example:

      -
      +
      The sample files are either \gls{html} or \gls{shtml}, but let's  
      first discuss \gls{ssi}.
      -

      This produces: +

      This produces:

      -

      The sample files are either hypertext markup language (HTML) +

      The sample files are either hypertext markup language (HTML) or server side includes (SSI) enabled HTML (SHTML), but let’s first discuss SSI.

      -

      So the

      So the first use of the shtml entry now produces “server side includes (SSI) enabled HTML (SHTML)”, which looks a bit strange. -

      Now let’s suppose the

      Now let’s suppose the shtml entry is used before (or without) the other two entries:

      -
      +
      This article is an introduction to \gls{shtml}.
      -

      This produces: +

      This produces:

      -

      This article is an introduction to server side includes (SSI) +

      This article is an introduction to server side includes (SSI) enabled hypertext markup language (HTML) (SHTML).

      -

      So the

      So the first use of the shtml entry now produces “server side includes (SSI) enabled hypertext markup language (HTML) (SHTML)”, which is even more strange. -

      This is all aggravated by setting the style using the

      This is all aggravated by setting the style using the glossaries package’s \setacronymstyle. For example: @@ -3366,10 +3960,10 @@ class="cmtt-10">\setacronymstyle. For example:

      -
      +
      \setacronymstyle{long-short}
      -

      as this references the label through the use of

      as this references the label through the use of \glslabel when displaying the long and short forms, but this value changes with each use of \gls, so @@ -3381,7 +3975,7 @@ class="cmtt-10">\glslabel has been changed to html by \gls{html}. -

      Another oddity occurs if you reset the

      Another oddity occurs if you reset the html entry between uses of the shtml entry. For example: @@ -3389,13 +3983,13 @@ class="cmtt-10">shtml

      -
      +
      \gls{shtml} ... \glsreset{html}\gls{shtml}
      -

      The next use of

      The next use of shtml produces “Shypertext markup language (HTML)”, which is downright weird. -

      Even without this, the short form has nested formatting commands, which +

      Even without this, the short form has nested formatting commands, which amount to \acronymfont{S\acronymfont{HTML}}. This may not be a problem for some styles, but if you use one of the “sm” styles (that use hyperref

    -

    For these reasons it’s better to use the simple expandable commands +

    For these reasons it’s better to use the simple expandable commands like \glsentrytext or -

    +
    \newacronym  
     [description={\acrshort{ssi} enabled \acrshort{html}}]  
     {shtml}{SHTML}{SSI enabled HTML}
    -

    with

    with glossaries or:

    -
    +
    \newabbreviation  
     [description={\glsxtrshort{ssi} enabled \glsxtrshort{html}}]  
     {shtml}{SHTML}{SSI enabled HTML}
    -

    with

    with glossaries-extra. This fixes all the above listed problems (as long as you don’t use \glsdescfirst use issue, but it doesn’t fix any of the other problems listed above. -

    If it’s simply that you want to use the abbreviation font, you can use +

    If it’s simply that you want to use the abbreviation font, you can use \glsabbrvfont:

    -
    +
    \setabbreviationstyle{long-short-sc}  
    \newabbreviation{ssi}{ssi}{server-side includes}  
    \newabbreviation{html}{html}{hypertext markup language}  
    \newabbreviation{shtml}{shtml}{\glsabbrvfont{ssi} enabled  
    \glsabbrvfont{html}}
    -

    This will pick up the font style setting of the outer entry (shtml, in the above case). +

    This will pick up the font style setting of the outer entry (shtml, in the above case). This isn’t a problem in the above example as all the abbreviations use the same style. -

    However if you’re really determined to use

    However if you’re really determined to use \gls in a field that may be included within some -

    +
    \gls{ssi} enabled \gls{html}
    -

    is treated as +

    is treated as

    -
    +
    {\glstext[hyper=false,noindex]{ssi}} enabled  
    {\glstext[hyper=false,noindex]{html}}
    -

    This overcomes problems 

    This overcomes problems 4, 5 and 6 listed above, but still doesn’t fix problems long-noshort-desc). -

    Additionally, any instance of the long form commands, such as

    Additionally, any instance of the long form commands, such as \glsxtrlong or shtml entry had instead been defined as: -

    +
    \newacronym{shtml}{SHTML}{\acrshort{ssi} enabled \acrshort{html}}
    -

    then (using the

    then (using the long-short style) the first use will be like

    -
    +
    {\acronymfont{\glsentryshort{ssi}}} enabled  
    {\acronymfont{\glsentryshort{html}}} (SHTML)
    -

    whereas if the entry is defined as: +

    whereas if the entry is defined as:

    -
    +
    \newabbreviation{shtml}{SHTML}{\glsxtrshort{ssi} enabled  
    \glsxtrshort{html}}
    -

    then the

    then the first use will be like:

    -
    +
    {\glsabbrvfont{\glsentryshort{ssi}}} enabled  
    {\glsabbrvfont{\glsentryshort{html}}} (SHTML)
    -

    Note that the first optional argument of

    Note that the first optional argument of \acrshort or \glsxtrshort is ignored in this context. (The final optional argument will be inserted, if present.) The @@ -3616,8 +4210,8 @@ class="cmtt-10">\glsxtrshort. Note that \acrshort doesn’t set the abbreviation style. -

    Alternatively you can use: -


    Alternatively you can use: +


    \glsxtrp  field}{label}

    -

    +

    where ⟨field⟩ is the field label and corresponds to a command in the form \gls\glstext) or in the form \glsxtrfield⟩ (e.g. \glsxtrshort). -

    There’s a shortcut command for the most common fields: -


    There’s a shortcut command for the most common fields: +


    \glsps  \glsps{label}

    -

    +

    which is equivalent to \glsxtrp{short}{label}, and -



    \glspt  \glspt{label}

    -

    +

    which is equivalent to \glsxtrp{text}{label}. -

    The

    The \glsxtrp command behaves much like the \glsfmtfield⟩ commands described @@ -3680,104 +4274,104 @@ class="cmss-10">noindex to true. If you want to change this, you can use -



    \glsxtrsetpopts  \glsxtrsetpopts{options}

    -

    +

    For example:

    -
    +
    \glsxtrsetpopts{hyper=false}
    -

    will just switch off the hyperlinks but not the indexing. Be careful using +

    will just switch off the hyperlinks but not the indexing. Be careful using this command or you can end up back to the original problem of nested links. -

    The hyper link is re-enabled within glossaries. This is done through the +

    The hyper link is re-enabled within glossaries. This is done through the command: -



    \glossxtrsetpopts  \glossxtrsetpopts

    -

    +

    which by default just does

    -
    +
    \glsxtrsetpopts{noindex}
    -

    You can redefine this if you want to adjust the setting when

    You can redefine this if you want to adjust the setting when \glsxtrp is used in the glossary. For example:

    -
    +
    \renewcommand{\glossxtrsetpopts}{\glsxtrsetpopts{noindex=false}}
    -

    -

    For example, +

    +

    For example,

    -
    +
    \glsxtrp{short}{ssi}
    -

    is equivalent to +

    is equivalent to

    -
    +
    {\let\glspostlinkhook\relax  
     \glsxtrshort[hyper=false,noindex]{ssi}[]%  
    }
    -

    in the main body of the document or +

    in the main body of the document or

    -
    +
    {\let\glspostlinkhook\relax  
     \glsxtrshort[noindex]{ssi}[]%  
    }
    -

    inside the glossary. (Note the post-link hook is locally disabled.) -

    If

    inside the glossary. (Note the post-link hook is locally disabled.) +

    If \glsxtrp{short}{ssi} occurs in a sectioning mark, it’s equivalent to

    -
    +
    {\glsxtrheadshort{ssi}}
    -

    (which recognises the

    (which recognises the headuc attribute.) -

    If

    If hyperref has been loaded, then the bookmark will use \glsentryfield⟩ (\glsentryshort{ssi} in the above example). -

    There are similar commands -


    There are similar commands +


    \Glsxtrp  field}{label}

    -

    +

    for first letter upper case and -



    \Glsxtrp  field}{label}

    -

    +

    for all upper case. -

    If you use any of the case-changing commands, such as

    If you use any of the case-changing commands, such as \Gls or \Glstext\gls\glstext, in the definition of entries for any of the fields that may be used by those case-changing commands.
    -

    -

    You can, with care, protect against issue 

    +

    You can, with care, protect against issue 1 by inserting an empty group at the start if the long form starts with a command that breaks the first letter uppercasing commands like \Gls, but you still won’t be able to use the all caps commands, such as \GLS. -

    If you

    If you really need nested commands, the safest method is

    -
    +
    \newabbreviation{shtml}{shtml}{{}\glsxtrp{short}{ssi} enabled  
    \glsxtrp{short}{html}}
    -

    but be aware that it may have some unexpected results occasionally. -

    Example document: +

    but be aware that it may have some unexpected results occasionally. +

    Example document:

    -
    +
    \documentclass{report}  
    \usepackage[utf8]{inputenc}  
    \usepackage[T1]{fontenc} @@ -3860,16 +4454,16 @@ class="cmti-10">really need nested commands, the safest method is  
    \printglossaries  
    \end{document}
    -

    -

    +

    +

    -

    Top

    2.7 Acronym Style Modifications

    -

    The

    The glossaries-extra package provides a new way of dealing with abbreviations and redefines \newacronymglossaries-extra is do just add

    -
    +
    \setabbreviationstyle[acronym]{long-short}
    -

    before you define any entries. For example, the following document using just +

    before you define any entries. For example, the following document using just glossaries

    -
    +
    \documentclass{article}  
    \usepackage[acronym,nopostdot,toc]{glossaries}  
    \makeglossaries @@ -3908,13 +4502,13 @@ class="cmss-10">glossaries  
    \printglossaries  
    \end{document}
    -

    can be easily adapted to use

    can be easily adapted to use glossaries-extra:

    -
    +
    \documentclass{article}  
    \usepackage[acronym]{glossaries-extra}  
    \makeglossaries @@ -3925,7 +4519,7 @@ class="cmss-10">glossaries-extra:  
    \printglossaries  
    \end{document}
    -

    Table 

    Table 2.1 lists the nearest equivalent glossaries-extra abbreviation styles for the predefined acronym styles provided by


    @@ -3964,34 +4558,34 @@ cellspacing="0" cellpadding="0" id="TBL-2-1" />

    Old Style Name

    New Style Name

    long-sc-short

    long-short-sc

    long-sm-short

    long-short-sm

    long-sp-short

    long-short
    #1}}

    short-long

    short-long

    sc-short-long

    short-sc-long

    sm-short-long

    short-sm-long

    long-short-desc

    long-short-desc

    long-sc-short-desc

    long-short-sc-desc

    long-sm-short-desc

    long-short-sm-desc

    long-sp-short-desc

    long-short-desc
    #1}}

    short-long-desc

    short-long-desc

    sc-short-long-desc

    short-sc-long-desc

    sm-short-long-desc

    short-sm-long-desc

    dua

    long-noshort

    dua-desc

    long-noshort-desc

    footnote

    short-footnote

    footnote-sc

    short-sc-footnote

    footnote-sm

    short-sm-footnote

    footnote-desc

    short-footnote-desc

    footnote-sc-desc

    short-sc-footnote-desc

    footnote-sm-desc

    short-sm-footnote-desc

    @@ -4184,7 +4778,7 @@ class="cmss-10">short-sm-footnote-desc
    -

    The reason for introducing the new style of abbreviation commands provided by +

    The reason for introducing the new style of abbreviation commands provided by glossaries-extra is because the original acronym commands provided by glossaries are @@ -4193,15 +4787,15 @@ class="cmss-10">glossaries-extra. However, if you really want to restore the generic acronym function provided by glossaries you can use -



    \RestoreAcronyms  \RestoreAcronyms

    -

    +

    (before any use of \newacronym). -

    \RestoreAcronyms should not be used in combination with the newer glossaries-extra abbreviations. Don’t combine old and new style entries with the same @@ -4211,7 +4805,7 @@ class="cmss-10">typeglossaries acronym mechanism doesn’t work well with the newer glossaries-extra commands. -

    If you use

    -

    -

    In general, there’s rarely any need for

    +

    In general, there’s rarely any need for \RestoreAcronyms. If you have a document that uses \newacronymstyle§3.5 Defining New Abbreviation Styles for further details.) -



    \glsacspace  \glsacspace{label}

    -

    +

    The space command \glsacspace used by the long-sp-short acronym style provided by glossaries is modified so that it uses -



    \glsacspacemax  \glsacspacemax

    -

    +

    instead of the hard-coded 3em. This is a command not a length and so can be changed using \renewcommand. -

    Any of the new abbreviation styles that use

    Any of the new abbreviation styles that use \glsxtrfullsep (such as \glsacspace with

    -
    +
    \renewcommand*{\glsxtrfullsep}[1]{\glsacspace{#1}}
    -

    -

    The

    +

    The first use acronym font command -



    \firstacronymfont{text}

    -

    +

    is redefined to use the first use abbreviation font command \glsfirstabbrvfont. This will be reset if you use \RestoreAcronyms. -

    The subsequent use acronym font command -


    The subsequent use acronym font command +


    \acronymfont{text}

    -

    +

    is redefined to use the subsequent use abbreviation font command \glsabbrvfont. This will be reset if you use \RestoreAcronyms.

    -

    Top

    2.8 Glossary Style Modifications

    -

    The default value of \glslistdottedwidth is changed so that it’s set at the start -of the document (if it hasn’t been changed in the preamble). This should -take into account situations where \hsize isn’t set until the start of the -document. -

    The glossaries package tries to determine the group title from its label by first -checking if \labelgroupname exists. If it doesn’t exist, then the title is assumed to be -the same as the label. For example, when typesetting the “A” letter group, glossariesglossary-bookindex package +

    As from v1.21, glossaries-extra has a new supplementary package glossary-bookindex +which provides the glossary style bookindex. This is very similar to the mcolindexgroup -first checks if \Agroupname exists. This could potentially cause conflict with another -package that may have some other meaning for \Agroupname, so glossaries-extra first -checks for the existence of the internal command \glsxtr@grouptitle@label⟩ -which shouldn’t clash with another package. You can set the group title -using -


    \glsxtrsetgrouptitle  \glsxtrsetgrouptitle{label}{title}

    -

    -For example: +style but is designed for indexes, so by default only the name and location list +are displayed. You can either load this package explicitly and then set the +style:

    -
    -\glsxtrsetgrouptitle{A}{A (a)} +
    +\usepackage{glossaries-extra} + 
    \usepackage{glossary-bookindex} + 
    \setglossarystyle{bookindex}
    -

    -

    -

    -

    Top

    2.8.1 Style Hooks

    -

    The commands \glossentryname and

    or use both the stylemods and style options: + + + +

    +
    +\usepackage[stylemods=bookindex,style=bookindex]{glossaries-extra} +
    +

    The bookindex style only supports a maximum hierarchical level of 2 (top-level, +level 1 and level 2). +

    The number of columns is given by +


    \glsxtrbookindexcols  \glsxtrbookindexcols

    +

    +which defaults to 2. +

    This style uses the multicols environment. If the command +


    \glsxtrbookindexcolspread  \glsxtrbookindexcolspread

    +

    +isn’t empty then it’s supplied as the optional argument following \begin{multicols} +{n}. +

    Each top-level entry is displayed using +


    \glsxtrbookindexname  \glsxtrbookindexname{label}

    +

    +where the entry is identified by ⟨label⟩. This just does \glossentryname{label} by +default. For example, if you want the symbol to be included: + + + +

    +
    +\renewcommand*{\glsxtrbookindexname}[1]{% + 
     \glossentryname{#1}% + 
     \ifglshassymbol{#1}{\space (\glossentrysymbol{#1})}{}% + 
    } +
    +

    Alternatively you can use the \glsxtrpostnamecategory⟩ hook. +

    Sub-entries are displayed using +


    \glsxtrbookindexsubname  \glsxtrbookindexsubname{label}

    +

    +which just defaults to \glsxtrbookindexname{label}. +

    The separator used before the location list for top-level entries is given +by +


    \glsxtrbookindexprelocation  \glsxtrbookindexprelocation{label} +

    +

    +where ⟨label⟩ is the entry’s label. This checks if the location field has been set. If it +has, it does + + + +

    +
    +\ifglsnopostdot,\fi\glsxtrprelocation +
    +

    otherwise it just does \glsxtrprelocation (which defaults to \space). If you’re not +using bib2gls, the location field won’t be set. +

    The separator used before the location list for sub-entries is given by +


    \glsxtrbookindexsubprelocation  \glsxtrbookindexsubprelocation{label} +

    +

    +which defaults to \glsxtrbookindexprelocation{label}. +

    The separator used between a top-level parent and child entry is given +by +


    \glsxtrbookindexparentchildsep  \glsxtrbookindexparentchildsep +

    +

    +This defaults to \nopagebreak. +

    The separator used between a sub-level parent and child entry is given +by +


    \glsxtrbookindexparentsubchildsep  \glsxtrbookindexparentsubchildsep +

    +

    +This defaults to \glsxtrbookindexparentchildsep. +

    The separator between top-level entries is given by +


    \glsxtrbookindexbetween  \glsxtrbookindexbetween{label1}{label2} +

    +

    +This comes after the entry given by ⟨label1⟩, if the entry has no children, or after the +last descendent otherwise, so it always comes immediately before the entry given by +⟨label2⟩ unless the entry occurs at the start of a group. This does nothing by +default. +

    The separator between two level 1 entries is given by +


    \glsxtrbookindexsubbetween  \glsxtrbookindexsubbetween{label1}{label2} +

    +

    +

    The separator between two level 2 entries is given by +


    \glsxtrbookindexsubsubbetween  \glsxtrbookindexsubsubbetween{label1} +{label2}

    +

    +At the end of each letter group, the following hooks are done in order: +


    \glsxtrbookindexsubsubatendgroup  \glsxtrbookindexsubsubatendgroup +{sub-sub-label}

    + + + +

    +


    \glsxtrbookindexsubatendgroup  \glsxtrbookindexsubatendgroup{sub-label} +

    +

    +


    \glsxtrbookindexatendgroup  \glsxtrbookindexatendgroup{label} +

    +

    +where ⟨sub-sub-label⟩ is the label of the last level 2 entry, ⟨sub-label⟩ is the label of the +last level 1 entry and ⟨label⟩ is the label of the last level 0 entry. +

    For example, the resource option seealso=omit instructs bib2gls to omit the +seealso cross-reference from the location list. (The see cross-reference will still be +added unless you also have see=omit.) The seealso cross-reference can instead be +appended after the child entries using: + + + +

    +
    +\renewcommand{\glsxtrbookindexatendgroup}[1]{% + 
      \glsxtrifhasfield{seealso}{#1}{\glstreesubitem\glsxtruseseealso{#1}}{}% + 
    } + 
    \renewcommand{\glsxtrbookindexbetween}[2]{% + 
      \glsxtrbookindexatendgroup{#1}% + 
    }% + 
    \renewcommand{\glsxtrbookindexsubatendgroup}[1]{% + 
      \glsxtrifhasfield{seealso}{#1}{\glstreesubsubitem\glsxtruseseealso{#1}}{}% + 
    } + 
    \renewcommand{\glsxtrbookindexsubbetween}[2]{% + 
      \glsxtrbookindexsubatendgroup{#1}% + 
    } + 
    \renewcommand{\glsxtrbookindexsubsubatendgroup}[1]{% + 
      \glsxtrifhasfield{seealso}{#1}% + 
      {\glstreeitem\hspace*{40pt}\glsxtruseseealso{#1}}{}% + 
    } + 
    \renewcommand{\glsxtrbookindexsubsubbetween}[2]{% + 
      \glsxtrbookindexsubsubatendgroup{#1}% + 
    } +
    +

    This uses \glstreesubitem and \glstreesubsubitem to indent the cross-reference +according to the next level down, so the cross-reference for a top-level entry is aligned +with the sub-entries, and a level 1 entry has its cross-reference aligned with +sub-sub-entries. In the event that a level 2 entry has a cross-reference, this is +indented a bit further (but it won’t be aligned with any deeper level as the bookindex +style only supports a maximum of two sub-levels). +

    The bookindex style uses group headings. (If you use bib2gls remember to invoke +it with the --group or -g switch.) The heading will use +


    \glsxtrbookindexbookmark  \glsxtrbookindexbookmark{group title}{name} +

    +

    +If \pdfbookmark has been defined, this will use that command to bookmark the +group title. If section=chapter is set (default if chapters are defined) then this +uses level 1 otherwise it uses level 2. You can redefine this command if this +isn’t appropriate. If \pdfbookmark hasn’t been defined, this command does +nothin. +

    The group heading is formatted according to +


    \glsxtrbookindexformatheader  \glsxtrbookindexformatheader{group title} +

    + + + +

    +which is defined as + + + +

    +
    +\newcommand*{\glsxtrbookindexformatheader}[1]{% + 
      \par{\centering\glstreegroupheaderfmt{#1}\par}% + 
    } +
    +

    where \glstreegroupheaderfmt is provided by the glossary-tree package, which is +automatically loaded. Note that the entry names aren’t encapsulated with +\glstreenamefmt. +

    The glossary-bookindex package provides some supplementary commands that +aren’t used by default, but may be used when adjusting the style. These commands +should only be used within one of the \print…glossary commands. (That is, they +should only be used in glossary styles.) +


    \glsxtrbookindexmarkentry  \glsxtrbookindexmarkentry{label}

    +

    +This writes information to the .aux file that can be read on the next run to obtain +the first and last entry on each page of the glossary. +

    You can display the first entry associated with the current page using: +


    \glsxtrbookindexfirstmark  \glsxtrbookindexfirstmark

    +

    +and the last entry associated with the current page using: +


    \glsxtrbookindexlastmark  \glsxtrbookindexlastmark

    +

    +These do nothing if there are no entries marked on the current page (or if the +document build isn’t up to date). +

    The entry is formatted using: +


    \glsxtrbookindexfirstmarkfmt  \glsxtrbookindexfirstmarkfmt{label} +

    +

    +for the first instance and +


    \glsxtrbookindexlastmarkfmt  \glsxtrbookindexlastmarkfmt{label} +

    +

    +for the last. +

    These commands are designed for use in page headers or footers where the page +number is stable. For example, \glsxtrbookindexname can be redefined to mark the +current entry: + + + +

    +
    +\renewcommand{\glsxtrbookindexname}[1]{% + 
      \glsxtrbookindexmarkentry{#1}% + 
      \glossentryname{#1}% + 
    } +
    +

    If you only want to mark the top-level entries, remember to redefine +\glsxtrbookindexsubname as it defaults to \glsxtrbookindexname: + + + +

    +
    +\renewcommand{\glsxtrbookindexsubname}[1]{% + 
      \glossentryname{#1}% + 
    } +
    +

    +

    Then if you’re using fancyhdr you can set the page style to show the first and last +entry for the current page with: + + + +

    +
    +  \pagestyle{fancy}% + 
      \lhead{\thepage}% + 
      \lfoot{\glsxtrbookindexfirstmark}% + 
      \cfoot{}% + 
      \rfoot{\glsxtrbookindexlastmark}% +
    +

    +

    +

    +

    Top

    2.9 Glossary Style Modifications

    +

    The glossaries-extra-stylemods package (more conveniently loaded through the +glossaries-extra stylemods option) modifies some of the predefined styles that are +provided with the glossaries package. These modifications are described in more detail +in §2.9.3 The glossaries-extra-stylemods Package. +

    The glossaries package tries to determine the group title from its label by first +checking if \labelgroupname exists. If it doesn’t exist, then the title is assumed to be +the same as the label. For example, when typesetting the “A” letter group, glossaries +first checks if \Agroupname exists. This could potentially cause conflict with another +package that may have some other meaning for \Agroupname, so glossaries-extra first +checks for the existence of the internal command \glsxtr@grouptitle@label⟩ +which shouldn’t clash with another package. You can set the group title +using +


    \glsxtrsetgrouptitle  \glsxtrsetgrouptitle{label}{title}

    +

    +For example: + + + +

    +
    +\glsxtrsetgrouptitle{A}{A (a)} +
    +

    +

    +

    +

    Top

    2.9.1 Style Hooks

    +

    The commands \glossentryname and \glossentrydesc are modified to take into + id="dx1-15002"> are modified to take into account the glossname, , glossdesc and and glossdescfont attributes (see attributes (see §5 Categories). This means you can make simple case-changing modifications to the name and description without defining a new glossary style. -

    There is a hook after

    There is a hook after \glossentryname and and \Glossentryname: -


    : +


    \glsxtrpostnamehook  \glsxtrpostnamehook{label}

    -

    +

    By default this checks the indexname attribute. If the attribute exists for the + id="dx1-15009"> attribute. If the attribute exists for the category to which the label belongs, then the name is automatically indexed using -



    \glsxtrdoautoindexname{label}{indexname}

    -

    +

    See §7 Auto-Indexing for further details. -

    As from version 1.04, the post-name hook

    As from version 1.04, the post-name hook \glsxtrpostnamehook will also use \glsxtrpostnamecategory⟩ if it exists. You can use \glscurrententrylabel to + id="dx1-15011"> to obtain the entry label with the definition of this command. For example, suppose you are using a glossary style the doesn’t display the symbol, you can insert the symbol after the name for a particular category, say, the “symbol” @@ -4426,25 +5495,27 @@ category:

    -
    +
    \newcommand*{\glsxtrpostnamesymbol}{\space  
     (\glsentrysymbol{\glscurrententrylabel})}
    -

    -

    The post-description code used within the glossary is modified so that it also +

    +

    The post-description code used within the glossary is modified so that it also does -



    \glsxtrpostdescription  \glsxtrpostdescription

    -

    +

    This occurs before the original \glspostdescription, so if the nopostdot=false +class="cmtt-10">\glspostdescription, so if the nopostdot=false option is used, it will be inserted before the terminating full stop. -

    This new command will do

    This new command will do \glsxtrpostdesccategory⟩ if it exists, where ⟨category⟩ is the category label associated with th \glsxtrpostdescgeneral for entries with the category set to general or + id="dx1-15014"> or \glsxtrpostdescacronym for entries with the category set to acronym. -

    Since both . +

    Since both \glossentry and \subglossentry set -



    \glscurrententrylabel  \glscurrententrylabel

    -

    +

    to the label for the current entry, you can use this within the definition of these post-description hooks if you need to reference the label. -

    For example, suppose you want to insert the plural form in brackets after the +

    For example, suppose you want to insert the plural form in brackets after the description in the glossary, but only for entries in the general category, then you could + id="dx1-15017"> category, then you could do:

    -
    +
    \renewcommand{\glsxtrpostdescgeneral}{\space  
     (plural: \glsentryplural{\glscurrententrylabel})}
    -

    This means you don’t have to define a custom glossary style, which you may find +

    This means you don’t have to define a custom glossary style, which you may find more complicated. (It also allows more flexibility if you decide to change the underlying glossary style.) -

    This feature can’t be used for glossary styles that ignore

    This feature can’t be used for glossary styles that ignore \glspostdescription or if you redefine \glspostdescription without including \glsxtrpostdescription. (For example, if you redefine \glspostdescription to do nothing instead of using -the nopostdot option to suppress the terminating full stop.) See §2.8.3 The +the nopostdot option to suppress the terminating full stop.) See §2.9.3 The glossaries-extra-stylemods Package to patch the predefined styles provided by glossaries that are missing \glspostdescription.
    -

    -

    +

    +

    -

    Top

    2.8.2

    Top

    2.9.2 Number List

    -

    The

    The number list is now placed inside the argument of -



    \GlsXtrFormatLocationList  \GlsXtrFormatLocationList{number list}

    -

    +

    This is internally used by \glossaryentrynumbers. The nonumberlist option +class="cmtt-10">\glossaryentrynumbers. The nonumberlist option redefines \glossaryentrynumbers so that it doesn’t display the number list, but it + id="dx1-16004">number list, but it still saves the number list in case it’s required. -

    If you want to suppress the number list always use the nonumberlist option + id="dx1-16005">number list in case it’s required. +

    If you want to suppress the number list always use the nonumberlist option instead of redefining \glossaryentrynumbers to do nothing.
    -

    -

    If you want to, for example, change the font for the entire number list +

    +

    If you want to, for example, change the font for the entire number list then redefine \GlsXtrFormatLocationList as appropriate. Don’t modify \glossaryentrynumbers. -

    Sometimes users like to insert “page” or “pages” in front of the number list. This +

    Sometimes users like to insert “page” or “pages” in front of the number list. This is quite fiddly to do with the base glossaries package, but glossaries-extra provides a way of doing this. First you need to enable this option and specify the text to display using: -



    \GlsXtrEnablePreLocationTag  \GlsXtrEnablePreLocationTag{page}{pages}

    -

    +

    where ⟨page⟩ is the text to display if the number list only contains a single location and + id="dx1-16011">number list only contains a single location and ⟨pages⟩ is the text to display otherwise. For example:

    -
    +
    \GlsXtrEnablePreLocationTag{Page: }{Pages: }
    -

    An extra run is required when using this command. -

    Use

    An extra run is required when using this command. +

    Use glsignore not @gobble as the format if you want to suppress the page number (and only index the entry once).
    -

    -

    See the accompanying sample file

    +

    See the accompanying sample file sample-pages.tex. -

    Note that

    Note that bib2gls can be instructed to insert a prefix at the start of non-empty + id="dx1-16013"> can be instructed to insert a prefix at the start of non-empty location lists, which can be used as an alternative to \GlsXtrEnablePreLocationTag. -

    +

    -

    Top

    2.8.3 The

    Top

    2.9.3 The glossaries-extra-stylemods Package

    -

    As from v1.02,

    As from v1.02, glossaries-extra now includes the package glossaries-extra-stylemods that + id="dx1-17001"> that will redefine the predefined styles to include the post-description hook (for those that are missing it). You will need to make sure the styles have already been defined before loading glossaries-extra. For example:

    -
    +
    \usepackage{glossaries-extra}  
    \usepackage{glossary-longragged}  
    \usepackage{glossaries-extra-stylemods}
    -

    Alternatively you can load

    Alternatively you can load glossary-name.sty at the same time by passing ⟨name⟩ as a package option to glossaries-extra-stylemods. For example: + id="dx1-17002">. For example:

    -
    +
    \usepackage{glossaries-extra}  
    \usepackage[longragged]{glossaries-extra-stylemods}
    -

    Another option is to use the

    Another option is to use the stylemods key when you load key when you load glossaries-extra. You can omit a value if you only want to use the predefined styles that are automatically loaded by glossaries (for example, the long3col style): + id="dx1-17004"> style):

    -
    +
    \usepackage[style=long3col,stylemods]{glossaries-extra}
    -

    Or the value of

    Or the value of stylemods may be a comma-separated list of the style package + id="dx1-17005"> may be a comma-separated list of the style package identifiers. For example:

    -
    +
    \usepackage[style=mcoltree,stylemods=mcols]{glossaries-extra}
    -

    Remember to group the value if it contains any commas: +

    Remember to group the value if it contains any commas:

    -
    +
    \usepackage[stylemods={mcols,longbooktabs}]{glossaries-extra}
    -

    -

    Note that the

    +

    Note that the inline style is dealt with slightly differently. The original definition + id="dx1-17006"> style is dealt with slightly differently. The original definition provided by the glossary-inline package uses package uses \glspostdescription at the end of the glossary (not after each entry description) within the definition of \glspostinline. @@ -4684,152 +5758,298 @@ class="cmtt-10">\glsxtrpostdescription (not \glspostdescription). This means that the modified inline style isn’t affected by the nopostdot option, but the post-description + id="dx1-17008"> style isn’t affected by the nopostdot option, but the post-description category hook can still be used. -

    As from version 1.05, the

    The tabular-like styles, such as long are adjusted so that the \ifglsnogroupskip +conditional (set with nogroupskip) is moved outside of the definition of +\glsgroupskip to avoid problems that cause an “Incomplete \iftrue” error with +\printunsrtglossary and \printnoidxglossary. This means that if you want to +change this conditional using \setupglossaries or using the nogroupskip option in +\printglossary, \printnoidxglossary or \printunsrtglossary, you must also +reset the glossary style. +

    As from version 1.21, the hard-coded \space before the number list in many of +the predefined styles is replaced with +


    \glsxtrprelocation  \glsxtrprelocation

    +

    +This just defaults to \space but may be redefined as required. For example: + + + +

    +
    +\renewcommand{\glsxtrprelocation}{\dotfill} +
    +

    +

    The list styles use +


    \glsxtrprelocation  \glslistprelocation

    +

    +(which defaults to \glsxtrprelocation) for top-level items and +


    \glslistchildprelocation  \glslistchildprelocation

    +

    +(which defaults to \glslistprelocation) for child items. +

    For just the list style and its letter group variations (not the altlist or listdotted +variations) the number list for child entries is followed by +


    \glslistchildpostlocation  \glslistchildpostlocation

    +

    +which defaults to a full stop. +

    The default value of \glslistdottedwidth is changed so that it’s set at the start +of the document (if it hasn’t been changed in the preamble). This should +take into account situations where \hsize isn’t set until the start of the +document. +

    The index-like and tree-like styles insert the pre-number list space with +


    \glstreeprelocation  \glstreeprelocation

    +

    +(which defaults to \glsxtrprelocation) for top-level items and +


    \glstreechildprelocation  \glstreechildprelocation

    +

    +(which defaults to \glstreeprelocation) for child items. +

    As from version 1.05, the glossaries-extra-stylemods package provides some additional commands for use with the alttree style to make it easier to modify. These + id="dx1-17032"> style to make it easier to modify. These commands are only defined if the glossary-tree package has already been loaded, -which is typically the case unless the notree option has been used when loading + id="dx1-17033"> package has already been loaded, +which is typically the case unless the notree option has been used when loading glossaries. -



    \gglssetwidest  \gglssetwidest[level]{name}

    +

    +(New to version 1.21.) This is like \glssetwidest (provided by glossary-tree) but +performs a global assignment. +


    \eglssetwidest  \eglssetwidest[level]{name}

    -

    +

    This is like \glssetwidest (provided by glossary-tree) but performs a protected -expansion on ⟨name⟩. This has a localised effect. For a global setting, use -


    \glssetwidest but performs a protected expansion on ⟨name⟩. This has a +localised effect. For a global setting, use +


    \xglssetwidest  \xglssetwidest[level]{name}

    -

    +

    The widest entry value can later be retrieved using -



    \glsgetwidestname  \glsgetwidestname

    -

    +

    for the top-level entries and -



    \glsgetwidestsubname  \glsgetwidestsubname{level}

    -

    +

    for sub-entries, where ⟨level⟩ is the level number. -

    The command

    Note that if you are using bib2gls, you can use the resource option set-widest +which will try to determine the widest name of all the selected entries. This isn’t +guaranteed to work as it may depend on fonts or commands that bib2gls +can’t replicate, but it should be suitable for names that just consist of text, +and can be more efficient than iterating over all the defined entries using +TEX. +

    The command \glsfindwidesttoplevelname provided by glossary-tree has a + id="dx1-17045"> has a CamelCase synonym: -



    \glsFindWidestTopLevelName  \glsFindWidestTopLevelName[glossary list]

    -

    +

    Similar commands are also provided: -



    \glsFindWidestUsedTopLevelName  \glsFindWidestUsedTopLevelName[glossary list]

    -

    +

    This has an additional check that the entry has been used. Naturally this is only useful if the glossaries that use the alttree style occur at the end of the document. + id="dx1-17048"> style occur at the end of the document. This command should be placed just before the start of the glossary. (Alternatively, - - - place it at the end of the document and save the value in the auxiliary file for the next run.) -



    \glsFindWidestUsedAnyName  \glsFindWidestUsedAnyName[glossary list]

    -

    +

    This is like the previous command but if doesn’t check the parent key. This is useful if + id="dx1-17050"> key. This is useful if all levels should have the same width for the name. -



    \glsFindWidestAnyName  \glsFindWidestAnyName[glossary list]

    -

    +

    This is like the previous command but doesn’t check if the entry has been used. -



    \glsFindWidestUsedLevelTwo  \glsFindWidestUsedLevelTwo[glossary list]

    -

    +

    This is like \glsFindWidestUsedTopLevelName but also sets the first two sub-levels as well. Any entry that has a great-grandparent is ignored. -



    \glsFindWidestLevelTwo  \glsFindWidestLevelTwo[glossary list]

    -

    +

    This is like the previous command but doesn’t check if the entry has been used. -



    \glsFindWidestUsedAnyNameSymbol  \glsFindWidestUsedAnyNameSymbol [glossary list]{register}

    -

    +

    This is like \glsFindWidestUsedAnyName but also measures the symbol. The length of the widest symbol is stored in ⟨register⟩. -



    \glsFindWidestAnyNameSymbol  \glsFindWidestAnyNameSymbol[glossary list]{register}

    -

    +

    This is like the previous command but it doesn’t check if the entry has been used. -



    \glsFindWidestUsedAnyNameSymbolLocation  \glsFindWidestUsedAnyNameSymbolLocation [symbol register}{location register}

    -

    +

    This is like \glsFindWidestUsedAnyNameSymbol but also measures the number list. This requires \glsentrynumberlist (see the (see the glossaries user manual). The length of the widest symbol is stored in ⟨symbol register⟩ and the length of the widest number + id="dx1-17059">number list is stored in ⟨location register⟩. -



    \glsFindWidestAnyNameSymbolLocation  \glsFindWidestAnyNameSymbolLocation [symbol register}{location register}

    -

    +

    This is like the previous command but it doesn’t check if the entry has been used. -



    \glsFindWidestUsedAnyNameLocation  \glsFindWidestUsedAnyNameLocation [glossary list]{register}

    - - - -

    +

    This is like \glsFindWidestUsedAnyNameSymbolLocation but doesn’t measure the symbol. The length of the widest number list is stored in ⟨number list is stored in ⟨register⟩. -



    \glsFindWidestAnyNameLocation  \glsFindWidestAnyNameLocation[glossary list]{register}

    -

    +

    This is like the previous command but doesn’t check if the entry has been used. -

    The layout of the symbol, description and number list is governed by -


    The layout of the symbol, description and number list is governed by +


    \glsxtralttreeSymbolDescLocation  \glsxtralttreeSymbolDescLocation {label}{number list}

    -

    +

    for top-level entries and -



    \glsxtralttreeSubSymbolDescLocation  \glsxtralttreeSubSymbolDescLocation {label}{number list}

    -

    +

    for sub-entries. -

    There is now a user level command that performs the initialisation for the

    There is now a user level command that performs the initialisation for the alttree + id="dx1-17067"> style: -



    \glsxtralttreeInit  \glsxtralttreeInit

    -

    -

    The paragraph indent for subsequent paragraphs in multi-paragraph descriptions +

    + + + +

    The paragraph indent for subsequent paragraphs in multi-paragraph descriptions is provided by the length -



    \glsxtrAltTreeIndent  \glsxtrAltTreeIndent

    -

    -

    For additional commands that are available with the

    +

    For additional commands that are available with the alttree style, see the + id="dx1-17070"> style, see the documented code (glossaries-extra-code.pdf). For examples, see the accompanying sample files sample-alttree-marginpar.tex.

    -

    -

    +

    Top

    3. Abbreviations

    -

    Abbreviations include acronyms (words formed from initial letters, such as +

    Abbreviations include acronyms (words formed from initial letters, such as “laser”), initialisms (initial letters of a phrase, such as “html”, that aren’t pronounced as words) and contractions (where parts of words are omitted, often replaced by an apostrophe, such as “don’t”). The “acronym” code provided by the @@ -5006,19 +6225,19 @@ replaced by an apostrophe, such as “don’t”). The “acrony class="cmss-10">glossaries package is misnamed as it’s more often than not used for initialisms instead. Acronyms tend not to be expanded on first use (although they may need to be described for readers unfamiliar with the term). They are therefore more like a regular term, which may or may not require a description in the glossary. -

    The

    The glossaries-extra package corrects this misnomer, and provides better abbreviation handling, with -



    \newabbreviation  \newabbreviation[options]{}{long}

    -

    -

    This sets the

    +

    This sets the category key to key to abbreviation by default, but that value may be overridden in ⟨options⟩. The category may have attributes that modify the way abbreviations are defined. For example, the insertdots attribute will automatically + id="dx1-18004"> attribute will automatically insert full stops (periods) into ⟨short⟩ or the noshortplural attribute will set the default + id="dx1-18005"> attribute will set the default value of the shortplural key to just ⟨ key to just ⟨short⟩ (without appending the plural suffix). See §5 Categories for further details. -

    See

    See §2.6 Nested Links regarding the pitfalls of using commands like \gls or + id="dx1-18007"> or \glsxtrshort within ⟨ within ⟨short⟩ or ⟨long⟩. -

    Make sure that you set the category attributes before defining new abbreviations +

    Make sure that you set the category attributes before defining new abbreviations or they may not be correctly applied.
    -

    -

    The

    +

    The \newacronym command provided by the command provided by the glossaries package is redefined by glossaries-extra to use \newabbreviation with the category set to set to acronym (see also §2.7 Acronym Style Modifications) so -



    \newacronym  \newacronym[options]{short}{long}

    -

    +

    is now equivalent @@ -5120,7 +6339,7 @@ class="cmtt-10">}
    -

    The

    The \newabbreviation command is superficially similar to the glossaries package’s \newacronym but you can apply different styles to differe default style is short-nolong for entries in the for entries in the acronym category and category and short-long for + id="dx1-18014"> for entries in the abbreviation category. (These aren’t the same as the acronym + id="dx1-18015"> category. (These aren’t the same as the acronym styles provided by the glossaries package, although they may produce similar results.) -

    The way the abbreviations are displayed by commands like

    The way the abbreviations are displayed by commands like \gls varies according to the abbreviation style. The styles are set according to the entry’s category so, unlike the base glossaries package, you can have different abbreviation styles within the same glossary. -

    There are two types of full forms. The display full form, which is used on +

    There are two types of full forms. The display full form, which is used on first use by commands like \gls and the inline full form, which is used by + id="dx1-18017"> and the inline full form, which is used by commands like \glsxtrfull. For some of the abbreviation styles, such as + id="dx1-18018">. For some of the abbreviation styles, such as long-short, the display and inline forms are the same. In the case of styles + id="dx1-18019">, the display and inline forms are the same. In the case of styles such as short-nolong or or short-footnote, the display and inline full forms are + id="dx1-18021">, the display and inline full forms are different. -

    These formatting commands aren’t stored in the

    These formatting commands aren’t stored in the short, , shortplural, , long or + id="dx1-18024"> or longplural fields, which means they won’t be used within commands like + id="dx1-18025"> fields, which means they won’t be used within commands like \glsentryshort (but they are used within commands like \glsxtrshort and \glsfmtshort). Note that \glsxtrlong and the case-changing variants don’t use + id="dx1-18026"> and the case-changing variants don’t use \glsfirstlongfont. +

    You can apply the formatting command used for the short form to some arbitrary +text using +


    \glsuseabbrvfont  \glsuseabbrvfont{text}{category}

    +

    +where ⟨category⟩ is the category label that identifies the abbreviation style. Similarly +for the formatting command use by the long form: +


    \glsuselongfont  \glsuselongfont{text}{category}

    +

    -

    Top

    3.1 Tagging Initials

    -

    If you would like to tag the initial letters in the long form such that those letters are +

    If you would like to tag the initial letters in the long form such that those letters are underlined in the glossary but not in the main part of the document, you can use -



    \GlsXtrEnableInitialTagging  \GlsXtrEnableInitialTagging{categories} @@ -5204,76 +6448,76 @@ class="cmtt-10">} class="cmtt-10">{⟨cs}

    -

    +

    before you define your abbreviations. -

    This command (robustly) defines ⟨

    This command (robustly) defines ⟨cs⟩ (a control sequence) to accept a single argument, which is the letter (or letters) that needs to be tagged. The normal behaviour of this command within the document is to simply do its argument, but in + + + the glossary it’s activated for those categories that have the tagging attribute set to + id="dx1-19002"> attribute set to “true”. For those cases it will use -



    \glsxtrtagfont  \glsxtrtagfont{text}

    -

    +

    This command defaults to \underline{text} but may be redefined as required. -

    The control sequence ⟨

    The control sequence ⟨cs⟩ can’t already be defined when used with the unstarred version of \GlsXtrEnableInitialTagging for safety reasons. The starred version will overwrite any previous definition of ⟨cs⟩. As with redefining any commands, ensure that you don’t redefine something important. In fact, just - - - forget the existence of the starred version and let’s pretend I didn’t mention it. -

    The first argument of

    The first argument of \GlsXtrEnableInitialTagging is a comma-separated list of category names. The tagging attribute will automatically be set for those + id="dx1-19005"> attribute will automatically be set for those categories. You can later set this attribute for other categories (see §5 Categories) but this must be done before the glossary is displayed. -

    The accompanying sample file

    The accompanying sample file sample-mixtures.tex uses initial tagging for both the acronym and and abbreviation categories: + id="dx1-19007"> categories:

    -
    +
    \GlsXtrEnableInitialTagging{acronym,abbreviation}{\itag}
    -

    This defines the command

    This defines the command \itag which can be used in the definitions. For example:

    -
    +
    \newacronym  
     [description={a system for detecting the location and  
     speed of ships, aircraft, etc, through the use of radio @@ -5285,28 +6529,28 @@ example:  
    \newabbreviation{xml}{XML}  
     {e\itag{x}tensible \itag{m}arkup \itag{l}anguage}
    -

    The underlining of the tagged letters only occurs in the glossary and then only for +

    The underlining of the tagged letters only occurs in the glossary and then only for entries with the tagging attribute set. -

    + id="dx1-19008"> attribute set. +

    -

    Top

    3.2 Abbreviation Styles

    -

    The abbreviation style must be set before abbreviations are defined using: -


    The abbreviation style must be set before abbreviations are defined using: +


    \setabbreviationstyle  \setabbreviationstyle[category]{style-name}

    -

    +

    where ⟨style-name⟩ is the name of the style and ⟨category⟩ is the category label @@ -5319,22 +6563,22 @@ modify one or more of the attributes associated with the given category. For example, the long-noshort and and short-nolong styles set the styles set the regular attribute to + id="dx1-20004"> attribute to true. -

    If you want to apply different styles to groups of abbreviations, assign a +

    If you want to apply different styles to groups of abbreviations, assign a different category to each group and set the style for the given category.
    -

    -

    Note that

    +

    Note that \setacronymstyle is disabled by is disabled by glossaries-extra. Use

    }
    instead. The original acronym interface can be restored with \RestoreAcronyms (see + id="dx1-20006"> (see §2.7 Acronym Style Modifications). However the original acronym interface is incompatible with all the commands described here. -

    Abbreviations can be used with the standard

    Abbreviations can be used with the standard glossaries commands, such as \gls, + id="dx1-20007">, but don’t use the acronym commands like \acrshort (which use (which use \acronymfont). + id="dx1-20009">). The short form can be produced with: -



    \glsxtrshort  \glsxtrshort[options]{label}[insert]

    -

    +

    (Use this instead of \acrshort.) -

    The long form can be produced with -


    .) +

    The long form can be produced with +


    \glsxtrlong  \glsxtrlong[options]{label}[insert]

    -

    +

    (Use this instead of \acrlong.) -

    The .) +

    The inline full form can be produced with -



    \glsxtrfull  \glsxtrfull[options]{label}[insert]

    -

    +

    (This this instead of \acrfull.) -

    In general, it’s best not to use commands like .) +

    In general, it’s best not to use commands like \glsfirst for abbreviations, + id="dx1-20016"> for abbreviations, especially if you use the ⟨insert⟩ optional argument. Use either \gls (possibly with a reset) or \glsxtrfull.
    -

    -

    As mentioned earlier, the inline full form may not necessarily match the format +

    +

    As mentioned earlier, the inline full form may not necessarily match the format used on first use with \gls. For example, the short-nolong style only displays the + id="dx1-20018"> style only displays the short form on first use, but the full form will display the long form followed by the + id="dx1-20019">first use, but the full form will display the long form followed by the short form in parentheses. -

    If you want to use an abbreviation in a chapter or section title, use the +

    If you want to use an abbreviation in a chapter or section title, use the commands described in §4 Entries in Sectioning Titles, Headers, Captions and Contents instead.
    -

    -

    The arguments ⟨

    +

    The arguments ⟨options⟩, ⟨label⟩ and ⟨insert⟩ are the same as for commands such as \glstext. There are also analogous case-changing commands: -

    First letter upper case short form: -


    First letter upper case short form: +


    \Glsxtrshort  \Glsxtrshort[options]{label}[insert]

    -

    -

    First letter upper case long form: -


    +

    First letter upper case long form: +


    \Glsxtrlong  \Glsxtrlong[options]{label}[insert]

    -

    -

    First letter upper case inline full form: -


    +

    First letter upper case inline full form: +


    \Glsxtrfull  \Glsxtrfull[options]{label}[insert]

    -

    -

    All upper case short form: +

    +

    All upper case short form: -



    \Glsxtrshort  \GLSxtrshort[options]{label}[insert]

    -

    -

    All upper case long form: -


    +

    All upper case long form: +


    \Glsxtrlong  \GLSxtrlong[options]{label}[insert]

    -

    -

    All upper case inline full form: -


    +

    All upper case inline full form: +


    \GLSxtrfull  \GLSxtrfull[options]{label}[insert]

    -

    -

    Plural forms are also available. -

    Short form plurals: -


    +

    Plural forms are also available. +

    Short form plurals: +


    \glsxtrshortpl  \glsxtrshortpl[options]{label}[insert]

    -

    -


    +


    \Glsxtrshortpl  \Glsxtrshortpl[options]{label}[insert]

    -

    -


    +


    \GLSxtrshortpl  \GLSxtrshortpl[options]{label}[insert]

    -

    -

    Long form plurals: -


    +

    Long form plurals: +


    \glsxtrlongpl  \glsxtrlongpl[options]{label}[insert]

    -

    -


    +


    \Glsxtrlongpl  \Glsxtrlongpl[options]{label}[insert]

    -

    -


    +


    \GLSxtrlongpl  \GLSxtrlongpl[options]{label}[insert]

    -

    -

    Full form plurals: -


    +

    Full form plurals: +


    \glsxtrfullpl  \glsxtrfullpl[options]{label}[insert]

    -

    -


    +


    \Glsxtrfullpl  \Glsxtrfullpl[options]{label}[insert]

    -

    -


    +


    \GLSxtrfullpl  \GLSxtrfullpl[options]{label}[insert]

    -

    -

    Be careful about using

    +

    Be careful about using \glsentryfull, \Glsentryfull, \glsentryfullpl and @@ -5646,32 +6890,32 @@ class="cmtt-10">\Glsentryfullpl. These commands will use the currently ap than the style in use when the entry was defined. If you have mixed styles, you’ll need to use \glsxtrfull instead. Similarly for instead. Similarly for \glsentryshort etc.
    -

    -

    +

    +

    -

    Top

    3.3 Shortcut Commands

    -

    The abbreviation shortcut commands can be enabled using the package option +

    The abbreviation shortcut commands can be enabled using the package option shortcuts=abbreviation (or (or shortcuts=abbr) or ) or shortcuts=ac. (You can use + id="dx1-21003">. (You can use both settings at the same time.) The provided shortcut commands listed in table 3.1. @@ -5680,7 +6924,7 @@ href="#tab:abbrshortcuts">table 3.1. -


    @@ -5688,7 +6932,7 @@ href="#tab:abbrshortcuts">table 3.1.
    Table 3.1: Abbreviation Shortcut Commands
    +class="content">Abbreviation Shortcut Commands
    Equivalent Command + id="dx1-21009"> + id="dx1-21012"> + id="dx1-21015"> + id="dx1-21018"> + id="dx1-21021"> + id="dx1-21024"> + id="dx1-21027"> + id="dx1-21030"> + id="dx1-21033"> + id="dx1-21036"> + id="dx1-21039"> + id="dx1-21042"> + id="dx1-21045"> + id="dx1-21048"> + id="dx1-21051"> + id="dx1-21054"> + id="dx1-21057"> + id="dx1-21060"> + id="dx1-21063"> + id="dx1-21066"> + id="dx1-21069"> + id="dx1-21072"> + id="dx1-21075"> + id="dx1-21078">
    (shortcuts=abbreviation(shortcuts=abbreviation)(shortcuts=ac(shortcuts=ac)
    \ab \ac \cgls
    \abp \acp \cglspl
    \as \acs \glsxtrshort
    \asp \acsp \glsxtrshortpl
    \al \acl \glsxtrlong
    \alp \aclp \glsxtrlongpl
    \af \acf \glsxtrfull
    \afp \acfp \glsxtrfullpl
    \Ab \Ac \cgls
    \Abp \Acp \cglspl
    \As \Acs \Glsxtrshort
    \Asp \Acsp \Glsxtrshortpl
    \Al \Acl \Glsxtrlong
    \Alp \Aclp \Glsxtrlongpl
    \Af \Acf \Glsxtrfull
    \Afp \Acfp \Glsxtrfullpl
    \AB \AC \cGLS
    \ABP \ACP \cGLSpl
    \AS \ACS \GLSxtrshort
    \ASP \ACSP \GLSxtrshortpl
    \AL \ACL \GLSxtrlong
    \ALP \ACLP \GLSxtrlongpl
    \AF \ACF \GLSxtrfull
    \AFP \ACFP \GLSxtrfullpl
    \newabbr \newabbr \newabbreviation
    + id="dx1-21081">

    -

    Top

    3.4 Predefined Abbreviation Styles

    -

    There are two types of abbreviation styles: those that treat the abbreviation as a +

    There are two types of abbreviation styles: those that treat the abbreviation as a regular entry (so that \gls uses uses \glsgenentryfmt) and those that don’t treat the + id="dx1-22002">) and those that don’t treat the abbreviation as a regular entry (so that \gls uses uses \glsxtrgenabbrvfmt). -

    The regular entry abbreviation styles set the ). +

    The regular entry abbreviation styles set the regular attribute to “true” for the + id="dx1-22005"> attribute to “true” for the category assigned to each abbreviation with that style. This means that on first use, \gls uses the value of the uses the value of the first field and on subsequent use field and on subsequent use \gls uses the value of the + id="dx1-22009"> uses the value of the text field (and analogously for the plural and case-changing versions). The field (and analogously for the plural and case-changing versions). The short and + id="dx1-22011"> and long fields are set as appropriate and may be accessed through commands like + id="dx1-22012"> fields are set as appropriate and may be accessed through commands like \glsxtrshort. -

    The other abbreviation styles don’t modify the . +

    The other abbreviation styles don’t modify the regular attribute. The attribute. The first + id="dx1-22015"> and text fields (and their plural forms) are set and can be accessed through + id="dx1-22016"> fields (and their plural forms) are set and can be accessed through commands like \glsfirst, but they aren’t used by commands like \gls, which + id="dx1-22017">, which instead use the short form (stored in the short key) and the display full + id="dx1-22018"> key) and the display full format (through commands like \glsxtrfullformat that are defined by the + id="dx1-22019"> that are defined by the style). -

    In both cases, the first use of

    In both cases, the first use of \gls may not match the text produced by + id="dx1-22021"> may not match the text produced by \glsfirst (and likewise for the plural and case-changing versions). -

    The sample file (and likewise for the plural and case-changing versions). +

    The sample file sample-abbr-styles.tex demonstrates all predefined styles described here. -

    For the “sc” styles that use

    For the “sc” styles that use \textsc, be careful about your choice of fonts as + id="dx1-22023">, be careful about your choice of fonts as some only have limited support. For example, you may not be able to combine bold and small-caps. I recommend that you at least use the fontenc package with the package with the T1 option or something similar.
    -

    -

    The parenthetical styles, such as

    +

    The parenthetical styles, such as long-short, use -


    , use +


    \glsxtrparen  \glsxtrparen{text}

    -

    +

    to set the parenthetical material. This just puts parentheses around the text: (⟨text⟩). -

    The basic abbreviation styles, such as

    The basic abbreviation styles, such as long-short and and short-long use -


    use +


    \glsabbrvdefaultfont  \glsabbrvdefaultfont{text}

    -

    +

    for the short form. This just does ⟨text⟩ by default. (That is, no font change is applied.) On first use, -



    \glsfirstabbrvdefaultfont  \glsfirstabbrvdefaultfont{text}

    -

    +

    is used instead. By default, this just does \glsabbrvdefaultfont. The long form is formatted according to -



    \glslongdefaultfont  \glslongdefaultfont{text}

    -

    +

    which again just does ⟨text⟩ (no font change). On first use, -



    \glsfirstlongdefaultfont  \glsfirstlongdefaultfont{text}

    -

    +

    is used instead. This just does \glslongdefaultfont. The plural suffix used for the short form is given by -



    \glsxtrabbrvpluralsuffix  \glsxtrabbrvpluralsuffix

    -

    +

    which defaults to \glspluralsuffix. -

    The small-cap styles, such as . +

    The small-cap styles, such as long-short-sc and and short-sc-long, use -


    , use +


    \glsabbrvscfont  \glsabbrvscfont{text}

    -

    +

    which uses \textsc.3.1 + id="x1-22038f1"> On first use -



    \glsabbrvdefaultfont  \glsfirstabbrvscfont{text}

    -

    +

    is used instead. This uses \glsabbrvscfont by default. So redefine, \glsabbrvscfont to change first and subsequent uses or \glsfirstabbrvscfont to change just the first use. -

    The long form for the small-cap styles uses

    The long form for the small-cap styles uses \glslongdefaultfont or \glsfirstlongdefaultfont, as with the basic style. The suffix is given by -



    \glsxtrscsuffix  \glsxtrscsuffix

    -

    +

    This is defined as

    -
    +
    \newcommand*{\glsxtrscsuffix}{\glstextup{\glsxtrabbrvpluralsuffix}}
    -

    The

    The \glstextup command is provided by command is provided by glossaries and is used to switch off the small caps font for the suffix. If you override the default short plural using the shortplural key when you define the abbreviation you will need to make the + id="dx1-22042"> key when you define the abbreviation you will need to make the appropriate adjustment if necessary. (Remember that the default plural suffix behaviour can be modified through the use of the aposplural and and noshortplural + id="dx1-22044"> attributes. See §5 Categories for further details.) -

    The small styles, such as

    The small styles, such as long-short-sm and and short-sm-long, use -


    , use +


    \glsabbrvsmfont  \glsabbrvsmfont{text}

    -

    +

    which uses \textsmaller. (This requires the relsizes package, which isn’t loaded by + id="dx1-22048"> package, which isn’t loaded by glossaries-extra, so must be loaded explicitly.) On first use -



    \glsfirstabbrvsmfont  \glsfirstabbrvsmfont{text}

    -

    +

    is used instead. This uses \glsabbrvsmfont by default. -

    The long form for the smaller styles uses

    The long form for the smaller styles uses \glslongdefaultfont or \glsfirstlongdefaultfont, as with the basic style. The suffix is given by -



    \glsxtrsmsuffix  \glsxtrsmsuffix

    -

    +

    which defaults to just \glsxtrabbrvpluralsuffix. -

    The “short-em” (emphasize short) styles, such as

    The “short-em” (emphasize short) styles, such as long-short-em or or short-em-long, + id="dx1-22052">, use -



    \glsabbrvemfont  \glsabbrvemfont{text}

    -

    +

    On first use -



    \glsfirstabbrvemfont  \glsfirstabbrvemfont{text}

    -

    +

    is used instead. This uses \glsabbrvemfont by default. The suffix is given by -



    \glsxtremsuffix  \glsxtremsuffix

    -

    +

    which defaults to just \glsxtrabbrvpluralsuffix. The long form is as for the basic style unless the style is a “long-em” style. -

    The “long-em” (emphasize long) styles, such as

    The “long-em” (emphasize long) styles, such as long-em-short-em or or short-em-long-em, + id="dx1-22057">, use -



    \glsfirstlongemfont  \glsfirstlongemfont{long-form}

    -

    +

    instead of \glsfirstlongdefaultfont{long-form} and -



    \glslongemfont  \glslongemfont{long-form}

    -

    +

    instead of \glslongdefaultfont{long-form}. The first form \glsfirstlongemfont is initialised to use \glslongemfont. -

    The user styles have similar commands: -


    The user styles have similar commands: +


    \glsabbrvuserfont  \glsabbrvuserfont{text}

    -

    +

    for the short form, -



    \glsfirstabbrvuserfont  \glsfirstabbrvuserfont{text}

    -

    +

    for the first use short form, -



    \glslonguserfont  \glslonguserfont{text}

    -

    +

    for the long form, -



    \glsfirstlonguserfont  \glsfirstlonguserfont{text}

    -

    +

    for the first use long form, and -



    \glsxtrusersuffix  \glsxtrusersuffix

    -

    +

    for the short plural suffix. -

    Similarly for the hyphen styles: -


    Similarly for the hyphen styles: +


    \glsabbrvhyphenfont  \glsabbrvhyphenfont{text}

    -

    +

    for the short form, -



    \glsfirstabbrvhyphenfont  \glsfirstabbrvhyphenfont{text}

    -

    +

    for the first use short form, -



    \glslonghyphenfont  \glslonghyphenfont{text}

    -

    +

    for the long form, -



    \glsfirstlonghyphenfont  \glsfirstlonghyphenfont{text}

    -

    +

    for the first use long form, and -



    \glsxtrhyphensuffix  \glsxtrhyphensuffix

    -

    +

    for the short plural suffix. -

    Similarly for the “only” styles, such as

    Similarly for the “only” styles, such as long-only-short-only: -


    : +


    \glsabbrvonlyfont  \glsabbrvonlyfont{text}

    -

    +

    for the short form, -



    \glsfirstabbrvonlyfont  \glsfirstabbrvonlyfont{text}

    -

    +

    for the first use short form, -



    \glslongonlyfont  \glslongonlyfont{text}

    -

    +

    for the long form, -



    \glsfirstlongonlyfont  \glsfirstlongonlyfont{text}

    -

    +

    for the first use long form, and -



    \glsxtronlysuffix  \glsxtronlysuffix

    -

    +

    for the short plural suffix. -

    Note that by default inserted material (provided in the final optional argument of +

    Note that by default inserted material (provided in the final optional argument of commands like \gls), is placed outside the font command in the predefined styles. To move it inside, use: -



    \glsxtrinsertinsidetrue  \glsxtrinsertinsidetrue

    -

    +

    This applies to all the predefined styles. For example:

    -
    +
    \setabbreviationstyle{long-short}  
    \renewcommand*{\glsfirstlongdefaultfont}[1]{\emph{#1}}  
    \glsxtrinsertinsidetrue
    -

    This will make the long form and the inserted text emphasized, whereas the default +

    This will make the long form and the inserted text emphasized, whereas the default (without \glsxtrinsertinsidetrue) would place the inserted text outside of the emphasized font. -

    Note that for some styles, such as the

    Note that for some styles, such as the short-long, the inserted text would be + id="dx1-22077">, the inserted text would be placed inside the font command for the short form (rather than the long form in the above example). -

    Remember that

    Remember that \textsc renders lowercase letters as small capitals. Uppercase letters are rendered as normal uppercase letters, so if you specify the short form in @@ -6521,49 +7769,49 @@ convert its argument to lowercase. For example:

    -
    +
    \renewcommand*{\glsabbrvscfont}[1]{\textsc{\MakeLowercase{#1}}}
    -

    -

    If you want to easily switch between the “sc” and “sm” styles, you may find it +

    +

    If you want to easily switch between the “sc” and “sm” styles, you may find it easier to redefine this command to convert case:

    -
    +
    \renewcommand*{\glsabbrvscfont}[1]{\textsc{\MakeTextLowercase{#1}}}  
    \renewcommand*{\glsabbrvsmfont}[1]{\textsmaller{\MakeTextUppercase{#1}}}
    -

    -

    Some of the styles use -


    +

    Some of the styles use +


    \glsxtrfullsep  \glsxtrfullsep{label}

    -

    +

    as a separator between the long and short forms. This is defined as a space by default, but may be changed as required. For example:

    -
    +
    \renewcommand*{\glsxtrfullsep}[1]{~}
    -

    or +

    or

    -
    +
    \renewcommand*{\glsxtrfullsep}[1]{\glsacspace{#1}}
    -

    -

    The new naming scheme for abbreviation styles is as follows:

    +

    +

    The new naming scheme for abbreviation styles is as follows:

    • field1⟩[field2⟩[-modifier2⟩][-user] -

      This is for the parenthetical styles. The

      This is for the parenthetical styles. The -modifier⟩ parts may be omitted. These styles display ⟨field1⟩ followed by ⟨field2⟩ in parentheses. If ⟨field2⟩ starts - with “no” then the parenthetical element is omitted from the display style - but is included in the inline style. -

      If the field1⟩ or + ⟨field2⟩ starts with “no” then that element is omitted from the display style + (no parenthetical part) but is included in the inline style. +

      If the -modifier⟩ part is present, then the field has a font changing command - applied to it. -

      If -only indicates that field is only present + according to whether or not the entry has been used. +

      If post is present then ⟨field2⟩ is placed after the link-text using the post-link hook. -

      If the

      If the -user part is present, then the user1 value, if provided, is inserted + id="dx1-22080"> value, if provided, is inserted into the parenthetical material . (The field used for the inserted material may be changed.) -

      Examples:

      +

      Examples:

      • long-noshort-sc: ⟨: ⟨field1⟩ is the long form, the short form is set in smallcaps but omitted in the display style.
      • long-em-short-em: both the long form and the short form are + id="dx1-22082">: both the long form and the short form are emphasized. The short form is in parentheses.
      • long-short-em: the short form is emphasized but not the long form. + id="dx1-22083">: the short form is emphasized but not the long form. The short form is in parentheses.
      • long-short-user: if the : if the user1 key has been set, this produces the style + id="dx1-22085"> key has been set, this produces the style ⟨long⟩ (⟨short⟩, ⟨short⟩).
      • long-hyphen-postshort-hyphen: the short form and the inserted + id="dx1-22086">: the short form and the inserted material (provided by the final optional argument of commands like \gls) is moved to the post-link hook. The long form is formatted @@ -6655,31 +7906,31 @@ class="cmtt-10">\glsfirstabbrvhyphenfont on first
      • style-noreg -

        Some styles set the

        Some styles set the regular attribute. In some cases, there’s a version of the + id="dx1-22087"> attribute. In some cases, there’s a version of the style that doesn’t set this attribute. For example, long-em-noshort-em sets the + id="dx1-22088"> sets the regular attribute. The attribute. The long-em-noshort-em-noreg style is a minor variation that + id="dx1-22090"> style is a minor variation that style that doesn’t set the attribute. -

        There are a few “noshort” styles, such as

        There are a few “noshort” styles, such as long-hyphen-noshort-noreg, that have + id="dx1-22091">, that have “-noreg” version without a regular version. This is because the style won’t work properly with the regular set, but the naming scheme is maintained for + id="dx1-22092"> set, but the naming scheme is maintained for consistency with the other “noshort” styles.

      • modifier1⟩]-[post]footnote -

        The display style uses ⟨

        The display style uses ⟨field1⟩ followed by a footnote with the other field in it. If post is present then the footnote is placed after the link-text using the post-link hook. The inline style does ⟨field1⟩ followed by the other field in parentheses. -

        If

        If -modifier1⟩ is present, ⟨field1⟩ has a font-changing command applied to it. -

        Examples:

        +

        Examples:

        • short-footnote: short form in the text with the long form in the + id="dx1-22094">: short form in the text with the long form in the footnote.
        • short-sc-postfootnote: short form in smallcaps with the long form in + id="dx1-22095">: short form in smallcaps with the long form in the footnote outside of the link-text.
        -

        Take care with the footnote styles. Remember that there are some situations + id="dx1-22096">link-text.
      +

      Take care with the footnote styles. Remember that there are some situations where \footnote doesn’t work.
      -

      + id="dx1-22097"> doesn’t work.

    +

  • style-desc -

    Like ⟨

    Like ⟨style⟩ but the description key must be provided when defining abbreviations + id="dx1-22098"> key must be provided when defining abbreviations with this style. -

    Examples:

    +

    Examples:

  • -

    Not all combinations that fit the above syntax are provided. Pre-version 1.04 +

    Not all combinations that fit the above syntax are provided. Pre-version 1.04 styles that didn’t fit this naming scheme are either provided with a synonym (where the former name wasn’t ambiguous) or provided with a deprecated synonym (where the former name was confusing). The deprecated style names generate a warning using: -



    \GlsXtrWarnDeprecatedAbbrStyle  \GlsXtrWarnDeprecatedAbbrStyle {old-name}{new-name}

    -

    +

    where ⟨old-name⟩ is the deprecated name and ⟨new-name⟩ is the preferred name. You can suppress these warnings by redefining this command to do nothing. -

    +

    -

    Top

    3.4.1 Predefined Abbreviation Styles that Set the Regular Attribute

    -

    The following abbreviation styles set the

    The following abbreviation styles set the regular attribute to “true” for all categories + id="dx1-23001"> attribute to “true” for all categories that have abbreviations defined with any of these styles.

    short-nolong
    This only displays the short form on first use. The name is set to + id="dx1-23004"> is set to the short form. The description is set to the long form. The inline full form + id="dx1-23005"> is set to the long form. The inline full form displays ⟨short⟩ (⟨long⟩). The long form on its own can be displayed through commands like \glsxtrlong. + id="dx1-23006">.
    short
    A synonym for short-nolong. + id="dx1-23008">. +
    +nolong-short
    Like short-nolong but the inline full form displays ⟨long⟩ (⟨short⟩).
    short-sc-nolong
    Like short-nolong but redefines but redefines \glsabbrvfont to use \glsabbrvscfont (which defaults to (which defaults to \textsc).
    short-sc
    A synonym for short-sc-nolong + id="dx1-23015"> +
    +nolong-short-sc
    Like short-sc-nolong but the inline full form displays ⟨long⟩ + (⟨short⟩).
    short-sm-nolong
    Like short-nolong but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont (which defaults to (which defaults to \textsmaller). + + +
    short-sm
    A synonym for short-sm-nolong. + id="dx1-23022">. +
    +nolong-short-sm
    Like short-sm-nolong but the inline full form displays ⟨long⟩ + (⟨short⟩).
    short-em-nolong
    Like short-nolong but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. - - - + id="dx1-23027">.
    short-em
    A synonym for short-em-nolong + id="dx1-23029"> +
    +nolong-short-em
    Like short-em-nolong but the inline full form displays ⟨long⟩ + (⟨short⟩).
    short-nolong-desc
    Like the short-nolong style, but the style, but the name is set to the full + id="dx1-23034"> is set to the full form and the description must be supplied by the user. You may prefer + id="dx1-23035"> must be supplied by the user. You may prefer to use the short-nolong style with the post-description hook set to display + id="dx1-23036"> style with the post-description hook set to display the long form and override the description key. (See the sample file + id="dx1-23037"> key. (See the sample file sample-acronym-desc.tex.)
    short-desc
    A synonym for short-nolong-desc. + id="dx1-23039">.
    short-sc-nolong-desc
    Like short-nolong but redefines but redefines \glsabbrvfont to use \glsabbrvscfont (which defaults to (which defaults to \textsc).
    short-sc-desc
    A synonym for short-sc-nolong-desc. + id="dx1-23044">.
    short-sm-nolong-desc
    Like short-nolong-desc but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont (which defaults to (which defaults to \textsmaller).
    short-sm-desc
    A synonym for short-sm-nolong-desc. + id="dx1-23049">.
    short-em-nolong-desc
    Like short-nolong-desc but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. + id="dx1-23052">.
    short-em-desc
    A synonym for short-em-nolong-desc. + id="dx1-23054">. + + +
    long-noshort-desc
    This style only displays the long form, regardless of first or subsequent use of commands \gls. The short form may be accessed + id="dx1-23056">. The short form may be accessed through commands like \glsxtrshort. The inline full form displays ⟨. The inline full form displays ⟨long⟩ (⟨short⟩). -

    The

    The name and and sort keys are set to the long form and the keys are set to the long form and the description must + id="dx1-23060"> must be provided by the user. The predefined glossary styles won’t display the short form. You can use the post-description hook to automatically append the short form to the description. The inline full form will display ⟨short⟩). long-desc

    A synonym for long-noshort-desc. - - - + id="dx1-23062">.
    long-noshort-sc-desc
    Like the long-noshort-desc style but the short form + id="dx1-23064"> style but the short form (accessed through commands like \glsxtrshort) use ) use \glsabbrvscfont. + id="dx1-23066">. (This style was originally called long-desc-sc. Renamed in version + id="dx1-23067">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    long-noshort-sm-desc
    Like long-noshort-desc but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. (This style was originally called . (This style was originally called long-desc-sm. + id="dx1-23071">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    long-noshort-em-desc
    Like long-noshort-desc but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. The long form isn’t emphasized. (This style was + id="dx1-23074">. The long form isn’t emphasized. (This style was originally called long-desc-em. Renamed in version 1.04, but original name + id="dx1-23075">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    long-em-noshort-em-desc
    New to version 1.04, like long-noshort-desc but + id="dx1-23077"> but redefines \glsabbrvfont to use \glsabbrvemfont. The long form uses + id="dx1-23078">. The long form uses \glsfirstlongemfont and and \glslongemfont. + id="dx1-23080">.
    long-noshort
    This style doesn’t really make sense if you don’t use the short form anywhere in the document, but is provided for completeness. This is like the long-noshort-desc style, but the style, but the name and and sort keys are set to the + id="dx1-23084"> keys are set to the short form and the description is set to the long form. + id="dx1-23085"> is set to the long form.
    long
    A synonym for long-noshort + id="dx1-23087"> + + +
    long-noshort-sc
    Like the long-noshort style but the short form (accessed through + id="dx1-23089"> style but the short form (accessed through commands like \glsxtrshort) use ) use \glsabbrvscfont. (This style was + id="dx1-23091">. (This style was originally called long-sc. Renamed in version 1.04, but original name + id="dx1-23092">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    long-noshort-sm
    Like long-noshort but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. (This style was originally called . (This style was originally called long-sm. Renamed in + id="dx1-23096">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    long-noshort-em
    This style is like long-noshort but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. The long form isn’t emphasized. (This style + id="dx1-23099">. The long form isn’t emphasized. (This style was originally called long-em. Renamed in version 1.04, but original name + id="dx1-23100">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.) - - -
    long-em-noshort-em
    New to version 1.04, this style is like long-noshort but + id="dx1-23102"> but redefines \glsabbrvfont to use \glsabbrvemfont, , \glsfirstlongfont to use \glsfirstlongemfont and \glslongfont to use \glslongemfont. The short form isn’t used by commands like \gls, but can be obtained + id="dx1-23104">, but can be obtained using \glsxtrshort. The related style . The related style long-em-noshort-em-noreg doesn’t + id="dx1-23106"> doesn’t set the regular attribute. + id="dx1-23107"> attribute.
    -

    +

    -

    Top

    3.4.2 Predefined Abbreviation Styles that Don’t Set the Regular Attribute

    -

    The following abbreviation styles will set the

    The following abbreviation styles will set the regular attribute to “false” if it has + id="dx1-24001"> attribute to “false” if it has previously been set. If it hasn’t already been set, it’s left unset. Other attributes may also be set, depending on the style.

    long-short
    On first use, this style uses the format ⟨long⟩ (⟨short⟩). The inline and display full forms are the same. The name and and sort keys are + id="dx1-24005"> keys are set to the short form. (The name key additionally includes the font + id="dx1-24006"> key additionally includes the font command \glsabbrvfont.) The description is set to the long form. The + id="dx1-24007"> is set to the long form. The long and short forms are separated by \glsxtrfullsep. If you want to insert material within the parentheses (such as a translation), try the long-short-user style. + id="dx1-24008"> style. + + +
    long-short-sc
    Like long-short but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. + id="dx1-24011">.
    long-short-sm
    Like long-short but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. + id="dx1-24014">.
    long-short-em
    Like long-short but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. + id="dx1-24017">.
    long-em-short-em
    New to version 1.04, this style is like long-short-em but + id="dx1-24019"> but redefines \glsfirstlongfont to use \glsfirstlongemfont. + id="dx1-24020">.
    long-only-short-only
    New to version 1.17, this style only shows the long form on first use and only shows the short form on subsequent use. The inline full form \glsxtrfull shows the long form followed by the short form in parentheses. - - -
    long-only-short-only-desc
    New to version 1.17, this style is like long-only-short-only but the user must supply the description. + id="dx1-24023"> but the user must supply the description.
    long-em-noshort-em-noreg
    New to version 1.17, this style is like long-em-noshort-em but doesn’t set the but doesn’t set the regular attribute. + id="dx1-24026"> attribute.
    long-short-user
    This style was introduced in version 1.04. It’s like the long-short style + id="dx1-24028"> style but additional information can be inserted into the parenthetical material. This checks the value of the field given by -



    \glsxtruserfield  \glsxtruserfield

    -

    +

    (which defaults to useri) using \ifglshasfield (provided by (provided by glossaries). If the field hasn’t been set, the style behaves like the long-short style and produces + id="dx1-24031"> style and produces ⟨long⟩ (⟨short⟩) but if the field has been set, the contents of that field are inserted @@ -7370,30 +8668,33 @@ class="cmti-10">long⟩ (⟨short⟩, ⟨field-value⟩). The format is governed by -



    \glsxtruserparen  \glsxtruserparen{text}{label}

    -

    +

    where ⟨text⟩ is the short form (for the long-short-user style) or the long form (for + id="dx1-24033"> style) or the long form (for the short-long-user style). This command first inserts a space using + id="dx1-24034"> style). This command first inserts a space using \glsxtrfullsep and then the parenthetical content (using \glsxtrparen). -

    The ⟨). + + + +

    The ⟨text⟩ argument includes the font formatting command, \glsfirstabbrvfont short} in the case of the long-short-user style and style and \glsfirstlongfont{long} in the case of the short-long-user style. -

    For example: + id="dx1-24037"> style. +

    For example:

    -
    +
    \setabbreviationstyle[acronym]{long-short-user}  
    \newacronym{tug}{TUG}{\TeX\ User Group}  
    \newacronym  
     [user1={German Speaking \TeX\ User Group}]  
     {dante}{DANTE}{Deutschsprachige Anwendervereinigung \TeX\ e.V}
    -

    On first use,

    On first use, \gls{tug} will appear as:

    -

    T

    TEX User Group (TUG)

    -

    whereas

    whereas \gls{dante} will appear as:

    -

    Deutschsprachige Anwendervereinigung T

    Deutschsprachige Anwendervereinigung TEX e.V (DANTE, German Speaking TEX User Group)

    -

    The short form is formatted according to -


    The short form is formatted according to +


    \glsabbrvuserfont  \glsabbrvuserfont{text}

    -

    +

    and the plural suffix is given by -



    \glsxtrusersuffix  \glsxtrusersuffix

    -

    -

    These may be redefined as appropriate. For example, if you want a smallcaps +

    +

    These may be redefined as appropriate. For example, if you want a smallcaps style, you can just set these commands to those used by the long-short-sc + id="dx1-24040"> style:

    -
    +
    \renewcommand{\glsabbruserfont}[1]{\glsabbrvscfont{#1}}  
    \renewcommand{\glsxtrusersuffix}{\glsxtrscsuffix}
    -

    +

    long-noshort-noreg
    This style is like long-noshort but it doesn’t set the but it doesn’t set the regular + id="dx1-24043"> attribute.
    long-noshort-desc-noreg
    This style is like long-noshort-desc but it doesn’t set the + id="dx1-24045"> but it doesn’t set the regular attribute. + id="dx1-24046"> attribute.
    long-short-desc
    On first use, this style uses the format ⟨long⟩ (⟨short⟩). The inline and display full forms are the same. The name is set to the full + id="dx1-24049"> is set to the full form. The sort key is set to ⟨ key is set to ⟨long⟩ (⟨short⟩). Before version 1.04, this was incorrectly set to the short form. If you want to revert back to this you can redefine -



    \glsxtrlongshortdescsort  \glsxtrlongshortdescsort

    -

    +

    For example:

    -
    +
    \renewcommand*{\glsxtrlongshortdescsort}{\the\glsshorttok}
    -

    The

    The description must be supplied by the user. The long and short forms are + id="dx1-24052"> must be supplied by the user. The long and short forms are separated by \glsxtrfullsep.

    long-short-sc-desc
    Like long-short-desc but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. + id="dx1-24055">.
    long-short-sm-desc
    Like long-short-desc but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. + id="dx1-24058">.
    long-short-em-desc
    Like long-short-desc but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. + id="dx1-24061">.
    long-em-short-em-desc
    New to version 1.04, this style is like long-short-em-desc but + id="dx1-24063"> but redefines \glsfirstlongfont to use \glsfirstlongemfont. + id="dx1-24064">.
    long-em-noshort-em-desc-noreg
    New to version 1.17, this style is like long-em-noshort-em-desc but doesn’t set the but doesn’t set the regular attribute. + id="dx1-24067"> attribute.
    long-short-user-desc
    New to version 1.04, this style is like a cross between the long-short-desc style and the style and the long-short-user style. The display and inline forms + id="dx1-24070"> style. The display and inline forms are as for long-short-user and the and the name key is as key is as long-short-desc. The . The description + id="dx1-24074"> key must be supplied in the optional argument of \newabbreviation (or \newacronym). The sort key is set to ⟨ key is set to ⟨long⟩ (⟨short⟩) as per the long-short-desc + id="dx1-24076"> style.
    short-nolong-noreg
    This is like short-nolong but doesn’t set the but doesn’t set the regular attribute. +
    +nolong-short-noreg
    This is like nolong-short but doesn’t set the regular attribute. + id="dx1-24082"> attribute.
    short-long
    On first use, this style uses the format ⟨short⟩ (⟨long⟩). The inline and display full forms are the same. The name and and sort keys are set to the + id="dx1-24086"> keys are set to the short form. The description is set to the long form. The short and long + id="dx1-24087"> is set to the long form. The short and long + + + forms are separated by \glsxtrfullsep. If you want to insert material within the parentheses (such as a translation), try the short-long-user + id="dx1-24088"> style. - - -
    short-sc-long
    Like short-long but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. + id="dx1-24091">.
    short-sm-long
    Like short-long but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. + id="dx1-24094">.
    short-em-long
    Like short-long but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. + id="dx1-24097">.
    short-em-long-em
    New to version 1.04, this style is like short-em-long but redefines + id="dx1-24099"> but redefines \glsfirstlongfont to use \glsfirstlongemfont. + id="dx1-24100">.
    short-long-user
    New to version 1.04. This style is like the long-short-user + id="dx1-24102"> style but with the long and short forms switched. The parenthetical material is governed by the same command \glsxtruserparen, but + id="dx1-24103">, but the first argument supplied to it is the long form instead of the short form.
    short-nolong-desc-noreg
    This style is like short-nolong-desc but it doesn’t set the + id="dx1-24105"> but it doesn’t set the regular attribute. + id="dx1-24106"> attribute.
    short-long-desc
    On first use, this style uses the format ⟨short⟩ (⟨long⟩). The inline and display full forms are the same. The name is set to the full form. The is set to the full form. The description + id="dx1-24110"> must be supplied by the user. The short and long forms are separated by \glsxtrfullsep. @@ -7770,81 +9083,81 @@ class="cmtt-10">\glsxtrfullsep. short-sc-long-desc
    Like short-long-desc but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. + id="dx1-24113">.
    short-sm-long-desc
    Like short-long-desc but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. + id="dx1-24116">.
    short-em-long-desc
    Like short-long-desc but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. + id="dx1-24119">.
    short-em-long-em-desc
    New to version 1.04, this style is like short-em-long-desc but + id="dx1-24121"> but redefines \glsfirstlongfont to use \glsfirstlongemfont. + id="dx1-24122">. + + +
    short-long-user-desc
    New to version 1.04, this style is like a cross between the short-long-desc style and the style and the short-long-user style. The display and inline forms + id="dx1-24125"> style. The display and inline forms are as for short-long-user and the and the name key is as key is as short-long-desc. The . The description - - - + id="dx1-24129"> key must be supplied in the optional argument of \newabbreviation (or \newacronym). short-footnote
    On first use, this style displays the short form with the long form as a footnote. This style automatically sets the nohyperfirst attribute to “true” for + id="dx1-24132"> attribute to “true” for the supplied category, so the first use won’t be hyperlinked (but the footnote + id="dx1-24133">first use won’t be hyperlinked (but the footnote marker may be, if the hyperref package is used). -

    The inline full form uses the ⟨ package is used). +

    The inline full form uses the ⟨short⟩ (⟨long⟩) style. The name is set to the short + id="dx1-24135"> is set to the short form. The description is set to the long form. -

    As from version 1.05, all the footnote styles use: -


    is set to the long form. +

    As from version 1.05, all the footnote styles use: +


    \glsfirstlongfootnotefont  \glsfirstlongfootnotefont{text}

    -

    +

    to format the long form on first use or for the full form and -


    first use or for the full form and +


    \glslongfootnotefont  \glslongfootnotefont{text}

    -

    +

    to format the long form elsewhere (for example, when used with \glsxtrlong). -

    As from version 1.07, all the footnote styles use: -


    As from version 1.07, all the footnote styles use: +


    \glsxtrabbrvfootnote  \glsxtrabbrvfootnote{label}{long}

    -

    +

    By default, this just does \footnote{long} (the first argument is ignored). For @@ -7919,22 +9232,22 @@ class="cmtt-10">} (the first argument is ignored). For

    -
    +
    \renewcommand{\glsxtrabbrvfootnote}[2]{%  
      \footnote{\glshyperlink[#2]{#1}}%  
    }
    -

    or to include the short form with a hyperlink: +

    or to include the short form with a hyperlink:

    -
    +
    \renewcommand{\glsxtrabbrvfootnote}[2]{%  
      \footnote{\glshyperlink[\glsfmtshort{#1}]{#1}: #2}%  
    }
    -

    Note that I haven’t used commands like

    Note that I haven’t used commands like \glsxtrshort to avoid interference (see Nested Links). footnote

    A synonym for short-footnote. + id="dx1-24143">.
    short-sc-footnote
    Like short-footnote but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. (This style was originally called . (This style was originally called footnote-sc. Renamed in + id="dx1-24147">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-sc-footnote
    Like short-footnote but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. (This style was originally called . (This style was originally called footnote-sm. Renamed in + id="dx1-24151">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-em-footnote
    Like short-footnote but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. (This style was originally called . (This style was originally called footnote-em. Renamed in + id="dx1-24155">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-postfootnote
    This is similar to the short-footnote style but doesn’t modify the + id="dx1-24157"> style but doesn’t modify the category attribute. Instead it changes \glsxtrpostlinkcategory to insert the + id="dx1-24158"> to insert the footnote after the link-text on first use. This will also defer the footnote until after any following punctuation character that’s recognised by \glsxtrifnextpunc. -

    The inline full form uses the ⟨. +

    The inline full form uses the ⟨short⟩ (⟨long⟩) style. The name is set to the short + id="dx1-24162"> is set to the short form. The description is set to the long form. Note that this style will change + id="dx1-24163"> is set to the long form. Note that this style will change \glsxtrfull (and it’s variants) so that it fakes non-first use. (Otherwise the + id="dx1-24164">first use. (Otherwise the footnote would appear after the inline form.)

    postfootnote
    A synonym for short-postfootnote. + id="dx1-24166">. @@ -8053,63 +9366,63 @@ class="cmss-10">short-postfootnoteshort-sc-postfootnote
    Like short-postfootnote but redefines but redefines \glsabbrvfont to use \glsabbrvscfont. (This style was originally called . (This style was originally called postfootnote-sc. Renamed in + id="dx1-24170">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-sm-postfootnote
    Like short-postfootnote but redefines but redefines \glsabbrvfont to use \glsabbrvsmfont. (This style was originally called . (This style was originally called postfootnote-sm. Renamed + id="dx1-24174">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-em-postfootnote
    Like short-postfootnote but redefines but redefines \glsabbrvfont to use \glsabbrvemfont. (This style was originally called . (This style was originally called postfootnote-em. Renamed + id="dx1-24178">. Renamed in version 1.04, but original name retained as a deprecated synonym for backward-compatibility.)
    short-postlong-user
    This style was introduced in version 1.12. It’s like the short-long-user style but defers the parenthetical material to after the + id="dx1-24180"> style but defers the parenthetical material to after the link-text. This means that you don’t have such a long hyperlink (which can cause problems for the DVI LATEX format) and it also means @@ -8119,58 +9432,58 @@ class="E">EX format) and it also means short-postlong-user-desc
    This style was introduced in version 1.12. It’s like the above short-postlong-user style but the style but the description must be + id="dx1-24183"> must be specified.
    long-postshort-user
    This style was introduced in version 1.12. It’s like the above short-postlong-user style but the long form is shown first and + id="dx1-24185"> style but the long form is shown first and the short form is in the parenthetical material (as for long-short-user) + id="dx1-24186">) style.
    long-postshort-user-desc
    This style was introduced in version 1.12. It’s like the above long-postshort-user style but the style but the description must be + id="dx1-24189"> must be specified.
    long-hyphen-short-hyphen
    This style (new to v1.17) is designed to work with the markwords category attribute. The full form is formatted + id="dx1-24191"> category attribute. The full form is formatted using -



    \glsxtrlonghyphenshort  \glsxtrlonghyphenshort{label}{}

    -

    +

    where ⟨insert⟩ is the inserted material provided in the final optional argument of commands like \insert. If ⟨insert⟩ start with a hyphen, then this locally redefines \glsxtrwordsep to a hyphen, which means that if the to a hyphen, which means that if the markwords + id="dx1-24194"> attribute is set then the long form will become hyphenated. (If this attribute isn’t set, there’s no alteration to the way the long form is displayed.) -

    Unlike the other ⟨

    Unlike the other ⟨long⟩ (⟨short⟩) type of styles, such as long-short, this style also + id="dx1-24195">, this style also repeats the insertion in the parenthetical part, so that the first use form is:

    -

    \glsfirstlonghyphenfont{long}\glsfirstabbrvhyphenfont{short}insert⟩)

    -

    The space before the parenthetical material is actually given by +

    The space before the parenthetical material is actually given by \glsxtrfullsep{labelinsert⟩ may be moved into the formatting commands according to the conditional \ifglsxtrinsertinside. -

    For example, if

    For example, if ip is defined using:

    -
    +
    \glssetcategoryattribute{english}{markwords}{true}  
    \setabbreviationstyle[english]{long-hyphen-short-hyphen}  
    \newabbreviation[category=english]{ip}{IP}{Internet Protocol}
    -

    then +

    then

    -
    +
    \gls{ip}[-Adressen]
    -

    will do +

    will do

    -

    Internet-Protocol-Adressen (IP-Adressen)

    -

    on first use, whereas +

    Internet-Protocol-Adressen (IP-Adressen)

    +

    on first use, whereas

    -
    +
    \gls{ip}[ Address]
    -

    will do +

    will do

    -

    Internet Protocol Address (IP Address)

    -

    on first use. -

    Note that the hyphenation isn’t applied when using commands like +

    Internet Protocol Address (IP Address)

    +

    on first use. +

    Note that the hyphenation isn’t applied when using commands like \glsxtrlong. This means that

    -
    +
    \glsxtrlong{ip}[-Adressen]
    -

    will do +

    will do

    -

    Internet Protocol-Adressen

    +

    Internet Protocol-Adressen

    -

    -

    If the

    +

    If the markwords attribute hadn’t been set, then the first use of + id="dx1-24196"> attribute hadn’t been set, then the first use of

    -
    +
    \gls{ip}[-Adressen]
    -

    would do +

    would do

    -

    Internet Protocol-Adressen (IP-Adressen)

    -

    instead. -

    If the inserted material ⟨

    Internet Protocol-Adressen (IP-Adressen)

    +

    instead. +

    If the inserted material ⟨insert⟩ is likely to contain commands like \gls, then use long-hyphen-postshort-hyphen instead to avoid nested links. + id="dx1-24197"> instead to avoid nested links.
    -

    -

    If you want the short version in small-caps, you can just redefine +

    +

    If you want the short version in small-caps, you can just redefine \glsabbrvhyphenfont and \glsxtrhyphensuffix to use the small-caps @@ -8310,21 +9623,21 @@ class="cmtt-10">\glsxtrhyphensuffix to use the small-caps

    -
    +
    \renewcommand{\glsabbrvhyphenfont}{\glsabbrvscfont}  
    \renewcommand{\glsxtrhyphensuffix}{\glsxtrscsuffix}
    -

    Similarly for other font-changing variations. +

    Similarly for other font-changing variations.

    long-hyphen-noshort-desc-noreg
    New to version 1.17, this style is like long-hyphen-short-hyphen-desc except that the parenthetical part is omitted and + id="dx1-24199"> except that the parenthetical part is omitted and the long form is displayed on subsequent use. The short form can be accessed with \glsxtrshort but just uses the default abbreviation font. There’s no @@ -8334,34 +9647,34 @@ class="cmtt-10">\glsxtrshort but just uses the default abbreviation font. long-hyphen-noshort-noreg
    New to version 1.17, this style is like long-hyphen-noshort-desc-noreg but the name is set to the short form and the + id="dx1-24201"> but the name is set to the short form and the description is set to the long form.
    long-hyphen-short-hyphen-desc
    -

    New to version 1.17. This is similar to

    New to version 1.17. This is similar to long-hyphen-short-hyphen but the user + id="dx1-24203"> but the user supplies the description.

    long-hyphen-postshort-hyphen
    -

    New to version 1.17. This is similar to

    New to version 1.17. This is similar to long-hyphen-short-hyphen but the + id="dx1-24205"> but the inserted and parenthetical material are moved to the post-link hook. On first use, \gls{}insert
    where -



    \glsxtrposthyphenshort  \glsxtrposthyphenshort{label}insert

    -

    +

    is in the post-link hook. This uses the format:
    insert⟩ (isnert⟩) -

    The singular short form is always used here, even with

    The singular short form is always used here, even with \glspl. (Unlike long-hyphen-long-hyphen.)
    -

    -

    The part in the link-text on first use: -


    .)
    +

    +

    The part in the link-text on first use: +


    \glsxtrlonghyphen  \glsxtrlonghyphen{long}{}{insert}

    -

    +

    checks if ⟨insert⟩ starts with a hyphen. If it does, then \glsxtrwordsep is locally @@ -8438,15 +9751,15 @@ class="cmti-10">insert⟩ for this style without causing nested hyperlinks, but only for commands like \gls. -

    Don’t use

    Don’t use \gls in the ⟨insert⟩ part for commands like \glsxtrfull, \glsxtrshort or \glsxtrlong.
    -

    -

    The inline full display format used by commands like

    +

    The inline full display format used by commands like \glsxtrfull behaves differently to the first use of \gls with this style. It’s better @@ -8461,28 +9774,28 @@ class="cmtt-10">} if you want to ensure the full long-hyphen-postshort-hyphen-desc

    -

    New to version 1.17. This is similar to

    New to version 1.17. This is similar to long-hyphen-postshort-hyphen but the + id="dx1-24210"> but the user supplies the description.

    short-hyphen-long-hyphen
    This style (new to v1.17) is like long-hyphen-short-hyphen, + id="dx1-24212">, except that the short form is displayed first followed by the long form in parentheses. The full form is formatted using -



    \glsxtrshorthyphenlong  \glsxtrshorthyphenlong{label}{} class="cmtt-10">{insert}

    -

    +

    which behaves in an analogous way to \glsxtrlonghyphenshort.

    short-hyphen-long-hyphen-desc
    -

    New to version 1.17. This is similar to

    New to version 1.17. This is similar to short-hyphen-long-hyphen but the user + id="dx1-24215"> but the user supplies the description. @@ -8515,12 +9828,12 @@ class="cmss-10">short-hyphen-long-hyphenshort-hyphen-postlong-hyphen

    This style (new to v1.17) is like long-hyphen-postshort-hyphen, but the short form is displayed first followed by + id="dx1-24217">, but the short form is displayed first followed by the long form in parentheses. On first use, \gls{label}insert
    where -



    \glsxtrposthyphenlong  \glsxtrposthyphenlong{label}insert

    -

    +

    is in the post-link hook. These commands behave in an analogous manner to those used with long-hyphen-postshort-hyphen. -

    Don’t use . +

    Don’t use \gls in the ⟨insert⟩ part for commands like \glsxtrfull, \glsxtrshort or \glsxtrlong.
    -

    -

    The inline full display format used by commands like

    +

    The inline full display format used by commands like \glsxtrfull behaves differently to the first use of \gls with this style. It’s better @@ -8581,25 +9894,25 @@ class="cmtt-10">} if you want to ensure the full short-hyphen-postlong-hyphen-desc

    -

    New to version 1.17. This is similar to

    New to version 1.17. This is similar to short-hyphen-postlong-hyphen but the + id="dx1-24221"> but the user supplies the description.

    -

    +

    -

    Top

    3.5 Defining New Abbreviation Styles

    -

    New abbreviation styles may be defined using: -


    New abbreviation styles may be defined using: +


    \newabbreviationstyle  \newabbreviationstyle{name}{}{fmts}

    -

    -

    where ⟨

    +

    where ⟨name⟩ is the name of the new style (as used in the mandatory argument of \setabbreviationstyle). This is similar but not identical to the ). This is similar but not identical to the glossaries package’s \newacronymstyle command. + id="dx1-25003"> command. -

    You can’t use styles defined by

    You can’t use styles defined by \newacronymstyle with glossaries-extra unless you have reverted \newacronym back to its generic definition from + id="dx1-25004"> back to its generic definition from glossaries (using \RestoreAcronyms). The acronym styles from the ). The acronym styles from the glossaries package can’t be used with abbreviations defined with \newabbreviation.
    -

    -

    The ⟨

    +

    The ⟨setup⟩ argument deals with the way the entry is defined and may set attributes for the given abbreviation category. This argument should redefine -



    \CustomAbbreviationFields  \CustomAbbreviationFields

    -

    +

    to set the entry fields including the name (defaults to the short form if omitted), + id="dx1-25007"> (defaults to the short form if omitted), sort, , first, , firstplural. Other fields may also be set, such as . Other fields may also be set, such as text, , plural and + id="dx1-25012"> and description. -

    . +

    \CustomAbbreviationFields is expanded by \newabbreviation so take care to protect commands that shouldn’t be expanded.
    -

    -

    For example, the

    +

    For example, the long-short style has the following in ⟨ style has the following in ⟨setup⟩:

    -
    +
      \renewcommand*{\CustomAbbreviationFields}{%  
        name={\protect\glsabbrvfont{\the\glsshorttok}},  
        sort={\the\glsshorttok}, @@ -8690,24 +10003,24 @@ class="cmti-10">setup⟩:  
        plural={\protect\glsabbrvfont{\the\glsshortpltok}},%  
        description={\the\glslongtok}}%
    -

    Note that the

    Note that the first and and firstplural are set even though they’re not used by + id="dx1-25016"> are set even though they’re not used by \gls. -

    The basic styles, such as

    The basic styles, such as long-short, use commands like , use commands like \glsabbrvfont (which are redefined whenever the style formatting is set) within \CustomAbbreviationFields. Other styles, such as long-em-short-em directly use their own custom commands, such + id="dx1-25018"> directly use their own custom commands, such as \glsabbrvemfont. With these styles, commands like \glsabbrvfont still need to @@ -8715,26 +10028,26 @@ be defined as appropriate in the ⟨fmts⟩ argument even if they’re not used within \CustomAbbreviationFields. -

    The ⟨

    The ⟨setup⟩ argument may also redefine -



    \GlsXtrPostNewAbbreviation  \GlsXtrPostNewAbbreviation

    -

    +

    which can be used to assign attributes. (This will automatically be initialised to do nothing.) -

    For example, the

    For example, the short-footnote includes the following in ⟨ includes the following in ⟨setup⟩:

    -
    +
      \renewcommand*{\GlsXtrPostNewAbbreviation}{%  
        \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}%  
        \glshasattribute{\the\glslabeltok}{regular}% @@ -8744,252 +10057,252 @@ class="cmti-10">setup⟩:  
        {}%  
      }%
    -

    This sets the

    This sets the nohyperfirst attribute to “true”. It also unsets the attribute to “true”. It also unsets the regular attribute if it + id="dx1-25022"> attribute if it has previously been set. Note that the nohyperfirst attribute doesn’t get unset by + id="dx1-25023"> attribute doesn’t get unset by other styles, so take care not to switch styles for the same category. -

    You can access the short, long, short plural and long plural values through the +

    You can access the short, long, short plural and long plural values through the following token registers. -

    Short value (defined by

    Short value (defined by glossaries): -



    \glsshorttok  \glsshorttok

    -

    -

    Short plural value (defined by

    +

    Short plural value (defined by glossaries-extra): -



    \glsshortpltok  \glsshortpltok

    -

    +

    (This may be the default value or, if provided, the value provided by the user through the shortplural key in the optional argument of key in the optional argument of \newabbreviation.) -

    Long value (defined by .) +

    Long value (defined by glossaries): -



    \glslongtok  \glslongtok

    -

    -

    Long plural value (defined by

    +

    Long plural value (defined by glossaries-extra): -



    \glslongpltok  \glslongpltok

    -

    +

    (This may be the default value or, if provided, the value provided by the user through the longplural key in the optional argument of key in the optional argument of \newabbreviation.) -

    The short or long values may be modified by attributes (such as .) +

    The short or long values may be modified by attributes (such as markwords). The + id="dx1-25032">). The above registers reflect the modification. If you want to access the original (unmodified) short or long form (as provided in the final two arguments of \newabbreviation), then use the commands: -



    \glsxtrorgshort  \glsxtrorgshort

    -

    +

    for the short form and -



    \glsxtrorglong  \glsxtrorglong

    -

    +

    for the long form. (These may be useful for the sort key to avoid any formatting that + id="dx1-25035"> key to avoid any formatting that may be added by the attribute setting.) -

    There are two other registers available that are defined by

    There are two other registers available that are defined by glossaries: -



    \glslabeltok  \glslabeltok

    -

    +

    which contains the entry’s label and -



    \glskeylisttok  \glskeylisttok

    -

    +

    which contains the values provided in the optional argument of \newabbreviation. -

    Remember put . +

    Remember put \the in front of the register command as in the examples above. The category label can be access through the command (not a register): -



    \glscategorylabel  \glscategorylabel

    -

    +

    This may be used inside the definition of \GlsXtrPostNewAbbreviation. -

    If you want to base a style on an existing style, you can use -


    If you want to base a style on an existing style, you can use +


    \GlsXtrUseAbbrStyleSetup  \GlsXtrUseAbbrStyleSetup{name}

    -

    +

    where ⟨name⟩ is the name of the existing style. For example, the long-noshort-sc-desc + id="dx1-25041"> style simply does

    -
    +
    \GlsXtrUseAbbrStyleSetup{long-noshort-desc}
    -

    within ⟨

    within ⟨setup⟩. -

    The ⟨

    The ⟨fmts⟩ argument deals with the way the entry is displayed in the document. This argument should redefine the following commands. -

    The default suffix for the plural short form (if not overridden by the

    The default suffix for the plural short form (if not overridden by the shortplural + id="dx1-25042"> key): -



    \abbrvpluralsuffix  \abbrvpluralsuffix

    -

    +

    (Note that this isn’t used for the plural long form, which just uses the regular \glspluralsuffix.) -

    The font used for the short form on

    The font used for the short form on first use or in the full forms: -



    \glsfirstabbrvfont  \glsfirstabbrvfont{text}

    -

    -

    The font used for the short form on subsequent use or through commands like +

    +

    The font used for the short form on subsequent use or through commands like \glsxtrshort: -


    : +


    \glsabbrvfont  \glsabbrvfont{text}

    -

    -

    The font used for the long form on first use or in the full forms: -


    +

    The font used for the long form on first use or in the full forms: +


    \glsfirstlongfont  \glsfirstlongfont{text}

    -

    -

    The font used for the long form in commands like

    +

    The font used for the long form in commands like \glsxtrlong use: -



    \glslongfont  \glslongfont{text}

    -

    -

    Display full form singular no case-change (used by

    +

    Display full form singular no case-change (used by \gls on first use for + id="dx1-25051"> on first use for abbreviations without the regular attribute set): -


    attribute set): +


    \glsxtrfullformat  \glsxtrfullformat{label}{insert}

    -

    -

    Display full form singular first letter converted to upper case (used by

    +

    Display full form singular first letter converted to upper case (used by \Gls on + id="dx1-25055"> on first use for abbreviations without the first use for abbreviations without the regular attribute set): -


    attribute set): +


    \Glsxtrfullformat  \Glsxtrfullformat{label}{insert}

    -

    -

    Display full form plural no case-change (used by

    +

    Display full form plural no case-change (used by \glspl on first use for + id="dx1-25059"> on first use for abbreviations without the regular attribute set): -


    attribute set): +


    \glsxtrfullplformat  \glsxtrfullplformat{label}{}

    -

    -

    Display full form plural first letter converted to upper case (used by

    +

    Display full form plural first letter converted to upper case (used by \Glspl on + id="dx1-25063"> on first use for abbreviations without the regular attribute set): -


    attribute set): +


    \Glsxtrfullplformat  \Glsxtrfullplformat{label}{insert}

    -

    -

    In addition ⟨

    +

    In addition ⟨fmts⟩ may also redefine the following commands that govern the inline full formats. If the style doesn’t redefine them, they will default to the same as the display full forms. -

    Inline singular no case-change (used by

    Inline singular no case-change (used by \glsentryfull, , \glsxtrfull and + id="dx1-25068"> and \GLSxtrfull): -


    ): +


    \glsxtrinlinefullformat  \glsxtrinlinefullformat{label}{insert}

    -

    -

    Inline singular first letter converted to upper case (used by

    +

    Inline singular first letter converted to upper case (used by \Glsentryfull and + id="dx1-25071"> and \Glsxtrfull): -


    ): +


    \Glsxtrinlinefullformat  \Glsxtrinlinefullformat{label}{insert}

    -

    -

    Inline plural no case-change (used by

    +

    Inline plural no case-change (used by \glsentryfullpl, , \glsxtrfullpl and + id="dx1-25075"> and \GLSxtrfullpl): -


    ): +


    \glsxtrinlinefullplformat  \glsxtrinlinefullplformat{label}{insert}

    -

    -

    Inline plural first letter converted to upper case (used by

    +

    Inline plural first letter converted to upper case (used by \Glsentryfullpl and + id="dx1-25078"> and \Glsxtrfullpl): -


    ): +


    \Glsxtrinlinefullplformat  \Glsxtrinlinefullplformat{label}{insert}

    -

    -

    (New to version 1.17.) You can also modify the way the subsequent use is +

    +

    (New to version 1.17.) You can also modify the way the subsequent use is formatted by redefining the following four commands, but these won’t be used for abbreviations with the regular attribute set. If the style doesn’t redefine these + id="dx1-25081"> attribute set. If the style doesn’t redefine these commands, the default values are used. -

    Singular with no case-change: -


    Singular with no case-change: +


    \glsxtrsubsequentfmt  \glsxtrsubsequentfmt{label}{insert}

    -

    -

    Singular with first letter upper case: -


    +

    Singular with first letter upper case: +


    \Glsxtrsubsequentfmt  \Glsxtrsubsequentfmt{label}{insert}

    -

    +

    -

    Plural with no case-change: -


    Plural with no case-change: +


    \glsxtrsubsequentplfmt  \glsxtrsubsequentplfmt{label}{insert}

    -

    -

    Plural with first letter upper case: -


    +

    Plural with first letter upper case: +


    \Glsxtrsubsequentplfmt  \Glsxtrsubsequentplfmt{label}{insert}

    -

    -

    If you want to provide support for

    +

    If you want to provide support for glossaries-accsupp use the following + id="dx1-25086"> use the following \glsaccessxxx⟩ commands (\glsentry⟨xxx⟩ commands. (If you don’t use glossaries-accsupp, they will just do the corresponding , they will just do the corresponding \glsentryxxx⟩ command.) -

    For example, the

    For example, the short-long style has the following in ⟨ style has the following in ⟨fmts⟩:

    -
    +
      \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}%  
      \renewcommand*{\glsabbrvfont}[1]{\glsabbrvdefaultfont{##1}}%  
      \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% @@ -9207,44 +10520,44 @@ class="cmti-10">fmts⟩:  
        \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}%  
      }%
    -

    Since the inline full commands aren’t redefined, they default to the same as the +

    Since the inline full commands aren’t redefined, they default to the same as the display versions. -

    If you want to base a style on an existing style, you can use -


    If you want to base a style on an existing style, you can use +


    \GlsXtrUseAbbrStyleFmts  \GlsXtrUseAbbrStyleFmts{name}

    -

    +

    within ⟨fmts⟩, where ⟨name⟩ is the name of the existing style. For example, the long-short-desc style has the following in ⟨ style has the following in ⟨fmts⟩:

    -
    +
      \GlsXtrUseAbbrStyleFmts{long-short}%
    -

    -

    Here’s an example of an abbreviation style that’s based on

    +

    Here’s an example of an abbreviation style that’s based on long-short that displays + id="dx1-25091"> that displays the short form within \textsf:

    -
    +
    \newabbreviationstyle  
    {custom-sf}% label  
    {% setup @@ -9255,37 +10568,37 @@ class="cmtt-10">\textsf:  
      \renewcommand*{\glsabbrvfont}[1]{\textsf{##1}}%  
    }
    -

    Note that this wouldn’t work if it was instead based on one of the modified versions +

    Note that this wouldn’t work if it was instead based on one of the modified versions such as short-sc-long as they explicitly use their own formatting commands, such as + id="dx1-25092"> as they explicitly use their own formatting commands, such as \glsabbrvemfont. The base styles, such as short-long, use the more generic + id="dx1-25093">, use the more generic \glsabbrvfont etc which makes them easier to adapt than the modified styles. -

    For further details, see the “Abbreviations” section in the documented code +

    For further details, see the “Abbreviations” section in the documented code (glossaries-extra-code.pdf).

    -

    -

    +

    Top

    4. Entries in Sectioning Titles, Headers, Captions and Contents

    -

    The

    The glossaries user manual cautions against using commands like \gls in chapter or section titles. The principle problems are:

    • if you have a table of contents, the first use flag will be unset in the contents rather than later in the document;
    • @@ -9302,27 +10615,27 @@ class="cmtt-10">\gls etc) will be converted to upper case and the
    • if you use hyperref, commands like , commands like \gls can’t be expanded to a simple string and only the label will appear in the PDF bookmark (with a warning from hyperref); + id="dx1-26003">);
    • if you use hyperref, you will end up with nested hyperlinks in the table of + id="dx1-26004">, you will end up with nested hyperlinks in the table of contents.
    -

    Similar problems can also occur with captions (except for the page header and bookmark +

    Similar problems can also occur with captions (except for the page header and bookmark issues). -

    To get around all these problems, the

    To get around all these problems, the glossaries user manual recommends using the expandable non-hyperlink commands, such as \glsentrytext + id="dx1-26005"> (for regular entries) or \glsentryshort (for abbreviations). This is the + id="dx1-26006"> (for abbreviations). This is the simplest solution, but doesn’t allow for special formatting that’s applied to the entry through commands like \glstext or \glsxtrshort. This means that if, for example, you are using one of the abbreviation styles that uses \textsc then the short form displayed with then the short form displayed with \glsentryshort won’t use small caps. If you only have one abbreviation style in use, you can explicitly enclose -

    +
    \chapter{A Chapter about \glsabbrvfont{\glsentryshort{html}}}
    -

    Or, if you are using

    Or, if you are using hyperref: + id="dx1-26008">:

    -
    +
    \chapter{A Chapter about  
    \texorpdfstring{\glsabbrvfont{\glsentryshort{html}}}{\glsentryshort{html}}}
    -

    -

    Since this is a bit cumbersome, you might want to define a new command to do +

    +

    Since this is a bit cumbersome, you might want to define a new command to do this for you. However, if you have mixed styles this won’t work as commands like \gls and \MakeUppercase. -

    The . +

    The glossaries-extra package tries to resolve this by modifying \markright and + id="dx1-26010"> and \markboth. If you don’t like this change, you can restore their former definitions -using -


    and \@starttoc. If you don’t like this change, you can restore their +former definitions using +


    \glsxtrRevertMarks  \glsxtrRevertMarks

    -

    +

    In this case, you’ll have to use the glossaries manual’s recommendations of either simply using -

    +
    \chapter[A Chapter about \glsentryshort{html}]{A Chapter about \gls{html}}
    -

    -

    If you don’t revert the mark commands back with

    Alternatively, you need to find a way to insert \glsxtrmarkhook and \@glsxtrinmark +at the start of the header or table of contents either scoped or afterwards cancelled +with \@glsxtrnotinmark and \glsxtrrestoremarkhook. +

    If you don’t revert the mark commands back with \glsxtrRevertMarks, you can use the commands described below in the argument of sectioning commands. You can still use them even if the mark commands have been reverted, but only where they don’t conflict with the page style. -

    The commands listed below all use

    The commands listed below all use \texorpdfstring if if hyperref has been + id="dx1-26014"> has been loaded so that the expandable non-formatted version is added to the PDF bookmarks. Note that since the commands that convert the first letter to upper case aren’t expandable, the non-case-changing version is used for the bookmarks. -

    These commands essentially behave as though you have used

    These commands essentially behave as though you have used \glsxtrshort (or equivalent) with the options noindex and and hyper=false. The text produced won’t be + id="dx1-26016">. The text produced won’t be converted to upper case in the page headings by default. If you want the text converted to upper case you need to set the headuc attribute to “true” for the + id="dx1-26017"> attribute to “true” for the appropriate category. -

    If you use one of the

    If you use one of the \textsc styles, be aware that the default fonts don’t + id="dx1-26018"> styles, be aware that the default fonts don’t provide bold small-caps or italic small-caps. This means that if the chapter or section title style uses bold, this may override the small-caps setting, in which case the abbreviation will just appear as lower case bold. If the @@ -9438,300 +10758,322 @@ heading style uses italic, the abbreviation may appear in upright small-caps, class="cmti-10">even if you have set the headuc attribute since the all-capitals form still uses \glsabbrvfont. You may want to consider using the slantsc package in this case. + id="dx1-26020"> package in this case.
    -

    -

    Display the short form: -


    +

    Display the short form: +


    \glsfmtshort  \glsfmtshort{label}

    -

    -

    Display the plural short form: -


    +

    Display the plural short form: +


    \glsfmtshortpl  \glsfmtshortpl{label}

    -

    -

    First letter upper case singular short form: -


    +

    First letter upper case singular short form: +


    \Glsfmtshort  \Glsfmtshort{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    First letter upper case plural short form: -


    First letter upper case plural short form: + + + +


    \Glsfmtshortpl  \Glsfmtshortpl{label}

    - - - -

    +

    (No case-change applied to PDF bookmarks.) -

    Display the long form: -


    Display the long form: +


    \glsfmtlong  \glsfmtlong{label}

    -

    -

    Display the plural long form: -


    +

    Display the plural long form: +


    \glsfmtlongpl  \glsfmtlongpl{label}

    -

    -

    First letter upper case singular long form: -


    +

    First letter upper case singular long form: +


    \Glsfmtlong  \Glsfmtlong{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    First letter upper case plural long form: -


    First letter upper case plural long form: +


    \Glsfmtlongpl  \Glsfmtlongpl{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    There are similar commands for the full form, but note that these use the

    There are similar commands for the full form, but note that these use the inline full form, which may be different from the full form used by \gls. -

    Display the full form: -


    Display the full form: +


    \glsfmtfull  \glsfmtfull{label}

    -

    -

    Display the plural full form: -


    +

    Display the plural full form: +


    \glsfmtfullpl  \glsfmtfullpl{label}

    -

    -

    First letter upper case singular full form: -


    +

    First letter upper case singular full form: +


    \Glsfmtfull  \Glsfmtfull{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    First letter upper case plural full form: -


    First letter upper case plural full form: +


    \Glsfmtfullpl  \Glsfmtfullpl{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    There are also equivalent commands for the value of the

    There are also equivalent commands for the value of the text field: -


    field: +


    \glsfmttext  \glsfmttext{label}

    -

    -

    First letter converted to upper case: -


    +

    First letter converted to upper case: +


    \Glsfmttext  \Glsfmttext{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    The plural equivalents: -


    The plural equivalents: + + + +


    \glsfmtplural  \glsfmtplural{label}

    - - - -

    +

    and -



    \Glsfmtplural  \Glsfmtplural{label}

    -

    -

    Similarly for the value of the

    +

    Likewise for the value of the name field: +


    \glsfmtname  \glsfmtname{label}

    +

    +

    First letter converted to upper case: +


    \Glsfmtname  \Glsfmtname{label}

    +

    +(No case-change applied to PDF bookmarks.) +

    Similarly for the value of the first field: -


    field: +


    \glsfmtfirst  \glsfmtfirst{label}

    -

    -

    First letter converted to upper case: -


    +

    First letter converted to upper case: +


    \Glsfmtfirst  \Glsfmtfirst{label}

    -

    +

    (No case-change applied to PDF bookmarks.) -

    The plural equivalents: -


    The plural equivalents: +


    \glsfmtfirstpl  \glsfmtfirstpl{label}

    -

    +

    and -



    \Glsfmtfirstpl  \Glsfmtfirstpl{label}

    -

    +

    -

    -

    +

    Top

    5. Categories

    -

    Each entry defined by

    Each entry defined by \newglossaryentry (or commands that internally use it + id="dx1-27001"> (or commands that internally use it such as \newabbreviation) is assigned a category through the ) is assigned a category through the category key. You may + id="dx1-27003"> key. You may add any category that you like, but since the category is a label used in the creation of some control sequences, avoid problematic characters within the category label. (So take care if you have babel shorthands on that make some characters + id="dx1-27004"> shorthands on that make some characters active.) -

    The use of categories can give you more control over the way entries are displayed +

    The use of categories can give you more control over the way entries are displayed in the text or glossary. Note that an entry’s category is independent of the glossary type. Be careful not to confuse category with with type. -

    The default category assumed by . +

    The default category assumed by \newglossaryentry is labelled general. + id="dx1-27007">. Abbreviations defined with \newabbreviation have the category set to abbreviation + id="dx1-27008"> by default. Abbreviations defined with \newacronym have the category set to acronym by default. -

    Additionally, if you have enabled by default. +

    Additionally, if you have enabled \newterm with the index package option + id="dx1-27010"> with the index package option that command will set the category to index by default. If you have enabled + id="dx1-27012"> by default. If you have enabled \glsxtrnewsymbol with the with the symbols package option, that command will set the + id="dx1-27014"> package option, that command will set the category to symbol. If you have enabled . If you have enabled \glsxtrnewnumber with the with the numbers package + id="dx1-27017"> package option, that command will set the category to number. -

    You can obtain the category label for a given entry using -


    . +

    You can obtain the category label for a given entry using +


    \glscategory  \glscategory{label}

    -

    +

    This is equivalent to commands like \glsentryname and so may be used in an expandable context. No error is generated if the entry doesn’t exist. -

    You can test the category for a given entry using -


    You can test the category for a given entry using +


    \glsifcategory  \glsifcategory{entry-label}{part}{false part}

    -

    +

    This is equivalent to

    \ifglsfieldeq{entry-label}}
    so any restrictions that apply to \ifglsfieldeq also apply to \glsifcategory. -

    Each category may have a set of attributes. For example, the

    Each category may have a set of attributes. For example, the general and and acronym + id="dx1-27023"> categories have the attribute regular set to “true” to indicate that all entries with + id="dx1-27024"> set to “true” to indicate that all entries with either of those categories are regular entries (as opposed to abbreviations). This attribute is accessed by \glsentryfmt to determine whether to use \glsgenentryfmt or \glsxtrgenabbrvfmt. -

    Other attributes recognised by

    Other attributes recognised by glossaries-extra are:

    nohyperfirst
    When using commands like \gls this will automatically suppress the + id="dx1-27026"> this will automatically suppress the hyperlink on first use for entries with a category that has this attribute set to “true”. (This settings can be overridden by explicitly setting the hyper key on + id="dx1-27028"> key on or off in the optional argument of commands like \gls.) As from version 1.07, \glsfirst, \Glsfirst, \GLSfirst and their plural versions (which should ideally behave in a similar way to the first use of first use of \gls or \glspl) now honour - this attribute (but not the package-wide hyperfirst=false option, which + this attribute (but not the package-wide hyperfirst=false option, which matches the behaviour of glossaries). If you want commands these + id="dx1-27031">). If you want commands these \glsfirst etc commands to ignore the nohyperfirst attribute then just + id="dx1-27032"> attribute then just redefine -



    \glsxtrchecknohyperfirst  \glsxtrchecknohyperfirst{label}

    -

    +

    to do nothing.

    nohyper
    When using commands like \gls this will automatically suppress the + id="dx1-27035"> this will automatically suppress the hyperlink for entries with a category that has this attribute set to “true”. (This settings can be overridden by explicitly setting the hyper key on or off in the + id="dx1-27036"> key on or off in the optional argument of commands like \gls.)
    indexonlyfirst
    This is similar to the indexonlyfirst package option but only for entries + id="dx1-27037">
    This is similar to the indexonlyfirst package option but only for entries that have a category with this attribute set to “true”.
    wrgloss
    When using commands like \gls, if this attribute is set to “after”, it will + id="dx1-27040">, if this attribute is set to “after”, it will automatically implement wrgloss=after. (New to v1.14.)
    discardperiod
    If set to “true”, the post-link-text hook will discard a full stop (period) that follows non-plural commands like \gls or \glstext. (Provided for entries such as abbreviations that end with a full stop.) -

    Note that this can cause a problem if you access a field that doesn’t end with a +

    Note that this can cause a problem if you access a field that doesn’t end with a full stop. For example:

    -
    +
    \newabbreviation  
     [user1={German Speaking \TeX\ User Group}]  
     {dante}{DANTE e.V.}{Deutschsprachige Anwendervereinigung \TeX\  
    e.V.}
    -

    Here the

    Here the short and and long fields end with a full stop, but the fields end with a full stop, but the user1 field doesn’t. + id="dx1-27046"> field doesn’t. The simplest solution in this situation is to put the sentence terminator in the final optional argument. For example:

    -
    +
    \glsuseri{dante}[.]
    -

    This will bring the punctuation character inside the

    This will bring the punctuation character inside the link-text and it won’t be discarded.

    pluraldiscardperiod
    If this attribute is set to “true” and the discardperiod attribute is + id="dx1-27049"> attribute is set to “true”, this will behave as above for the plural commands like \glspl or \glsplural. retainfirstuseperiod
    If this attribute is set to “true” then the full stop won’t be discarded for first use instances, even if discardperiod or or pluraldiscardperiod are + id="dx1-27053"> are set. This is useful for ⟨short⟩ (⟨long⟩) abbreviation styles where only the short form @@ -9951,52 +11296,52 @@ class="cmti-10">long⟩) abbreviation styles where only the short fo markwords
    If this attribute is set to “true” any entry defined using \newabbreviation + id="dx1-27055"> will automatically have spaces in the long form replaced with -



    \glsxtrwordsep  \glsxtrwordsep

    -

    +

    and each word is encapsulated with -



    \glsxtrword  \glsxtrword{word}

    -

    +

    For example:

    -
    +
    \glssetcategoryattribute{abbreviation}{markwords}{true}  
    \newabbreviation{ip}{IP}{Internet Protocol}
    -

    is essentially the same as +

    is essentially the same as

    -
    +
    \newabbreviation{ip}{IP}  
    {\glsxtrword{Internet}\glsxtrwordsep\glsxtrword{Protocol}}
    -

    The “hyphen” styles, such as

    The “hyphen” styles, such as long-hyphen-short-hyphen, take advantage of this + id="dx1-27058">, take advantage of this markup. If the inserted material (provided in the final argument of commands like \gls) starts with a hyphen then ) starts with a hyphen then \glsxtrwordsep is locally redefined to a hyphen. (The default value is a space). Note that this only applies to commands like \glsxtrlong. You can provide your own

    -
    +
    \newcommand{\hyplong}[2][]{%  
     {\def\glsxtrwordsep{-}\glsxtrlong[#1]{#2}}}
    -

    -

    This setting will also adjust the long plural. -

    This setting may result in the

    +

    This setting will also adjust the long plural. +

    This setting may result in the \glsxtrword and \glsxtrwordsep markup ending up in the sort field, depending on the style in use.
    -

    + id="dx1-27060"> field, depending on the style in use.

    +

    markshortwords
    This is similar to markwords but applies to the short form. (Only + id="dx1-27062"> but applies to the short form. (Only useful for abbreviations that contain spaces.) -

    This setting will only adjust the short plural if the

    This setting will only adjust the short plural if the shortplural key isn’t used. + id="dx1-27063"> key isn’t used. This setting will take precedence over insertdots. -

    This setting may result in the . +

    This setting may result in the \glsxtrword and \glsxtrwordsep markup ending up in the sort field, depending on the style in use.
    -

    + id="dx1-27065"> field, depending on the style in use.

    +

    insertdots
    If this attribute is set to “true” any entry defined using \newabbreviation + id="dx1-27067"> will automatically have full stops (periods) inserted after each letter. The entry will be defined with those dots present as though they had been present in the ⟨This setting is class="cmti-10">incompatible with markshortwords. -

    If you explicitly override the short plural using the

    If you explicitly override the short plural using the shortplural key, you must + id="dx1-27069"> key, you must explicitly insert the dots yourself (since there’s no way for the code to determine if the plural has a suffix that shouldn’t be followed by a dot).
    -

    -

    This attribute is best used with the

    +

    This attribute is best used with the discardperiod attribute set to “true”. + id="dx1-27070"> attribute set to “true”.

    aposplural
    If this attribute is set to “true”, \newabbreviation will insert an + id="dx1-27072"> will insert an apostrophe (’) before the plural suffix for the short plural form (unless @@ -10093,52 +11438,52 @@ class="cmti-10">short plural form (unless explicitly overridden with the shortplural key). The long plural form is + id="dx1-27073"> key). The long plural form is unaffected by this setting. This setting overrides noshortplural. + id="dx1-27074">.
    noshortplural
    If this attribute is set to “true”, \newabbreviation won’t append the + id="dx1-27076"> won’t append the plural suffix for the short plural form. This means the short and and shortplural + id="dx1-27078"> values will be the same unless explicitly overridden. This setting is incompatible with aposplural.
    headuc
    If this attribute is set to “true”, commands like \glsfmtshort will use the + id="dx1-27081"> will use the upper case version in the page headers.
    tagging
    If this attribute is set to “true”, the tagging command defined by \GlsXtrEnableInitialTagging will be activated to use will be activated to use \glsxtrtagfont in + id="dx1-27084"> in the glossary (see §3.1 Tagging Initials). entrycount
    Unlike the above attributes, this attribute isn’t boolean but instead must be an integer value and is used in combination with \glsenableentrycount + id="dx1-27086"> (see §2.4 Entry Counting Modifications

    With

    With glossaries, commands like \cgls use \cglsformat only if the previous @@ -10172,17 +11517,17 @@ class="cmss-10">glossaries-extra the test is now for entries that have the entrycount attribute set and where the previous + id="dx1-27089"> attribute set and where the previous usage count for that entry is less than or equal to the value of that attribute.

    glossdesc
    The \glossentrydesc command (used in the predefined glossary styles) is + id="dx1-27091"> command (used in the predefined glossary styles) is modified by glossaries-extra to check for this attribute. The attribute may have one of the following values: @@ -10191,34 +11536,34 @@ class="cmss-10">glossaries-extra to check for this attribute. The attribu class="cmtt-10">firstuc: the first letter of the description will be converted to upper case (using \Glsentrydesc). + id="dx1-27092">).
  • title: the description will be used in the argument of the title casing command \capitalisewords (provided by (provided by mfirstuc). If you want to use a + id="dx1-27094">). If you want to use a different command you can redefine: -



    \glsxtrfieldtitlecasecs  \glsxtrfieldtitlecasecs{phrase cs}

    -

    +

    For example:

    -
    +
    \newcommand*{\glsxtrfieldtitlecasecs}[1]{\xcapitalisefmtwords*{#1}}
    -

    (Note that the argument to

    (Note that the argument to \glsxtrfieldtitlecasecs will be a control sequence whose replacement text is the entry’s description, which is why \xcapitalisefmtwords is needed instead of \capitalisefmtwords.)

  • -

    Any other values of this attribute are ignored. Remember that there are design +

    Any other values of this attribute are ignored. Remember that there are design limitations for both the first letter uppercasing and the title casing commands. See the mfirstuc user manual for further details. + id="dx1-27096"> user manual for further details.

    glossdescfont
    (New to version 1.04) In addition to the above, the modified \glossentrydesc command also checks this attribute. If set, it should be the + id="dx1-27098"> command also checks this attribute. If set, it should be the name of a control sequence (without the leading backslash) that takes one argument. This control sequence will be applied to the description text. For example: -
    +
    \glssetcategoryattribute{general}{glossdescfont}{emph}
    -

    +

    glossname
    As glossdesc but applies to but applies to \glossentryname. Additionally, if this + id="dx1-27101">. Additionally, if this attribute is set to “uc” the name is converted to all capitals.
    indexname
    If set, the \glsxtrpostnamehook hook used at the end of \glossentyname +class="cmtt-10">\glossentryname will index the entry using \index. See . See §7 Auto-Indexing for further @@ -10282,41 +11627,72 @@ href="#sec:autoindex">Auto-Indexing for fur glossnamefont
    (New to version 1.04) In addition to the above, the modified \glossentryname command also checks this attribute. If set, it should be the + id="dx1-27106"> command also checks this attribute. If set, it should be the name of a control sequence (without the leading backslash) that takes one argument. This control sequence will be applied to the name text. For example: -
    +
    \glssetcategoryattribute{general}{glossnamefont}{emph}
    -

    Note that this overrides

    Note that this overrides \glsnamefont which will only be used if this attribute hasn’t been set. -

    Remember that glossary styles may additionally apply a font change, +

    Remember that glossary styles may additionally apply a font change, such as the list styles which put the name in the optional argument of \item.

    +textformat
    (New to version 1.21.) Commands like \gls and \glstext have the link + text encapsulated in the argument of \glstextformat by default. If this + attribute is set, the control sequence given by the attribute value will be used + instead. As with the above, the attribute value should be the name (without + the leading backslash) of a command that takes a single argument (the link + text). Remember that the abbreviation styles may apply an additional font + change. +
    +hyperoutside
    (New to v1.21.) The attribute value may be false, true or unset. If + unset, true is assumed. This indicates the default setting of the hyperoutside + key, described in §2.1 Entry Indexing. +
    dualindex
    If set, whenever a glossary entry has information written to the external glossary file through commands like \gls and and \glsadd, a corresponding line + id="dx1-27112">, a corresponding line will be written to the indexing file using \index. See . See §7 Auto-Indexing for @@ -10325,17 +11701,17 @@ href="#sec:autoindex">Auto-Indexing for targeturl
    If set, the hyperlink generated by commands like \gls will be set to the URL provided by this attributes value. For example: -
    +
    \glssetcategoryattribute{general}{targeturl}{master-doc.pdf}
    -

    (See also the accompanying sample file

    (See also the accompanying sample file sample-external.tex.) If the URL contains awkward characters (such as % or ~) remember that the base glossaries package provides commands like \glspercentchar and and \glstildechar that expand to literal characters. -

    If you want to a named anchor within the target URL (notionally adding +

    If you want to a named anchor within the target URL (notionally adding #name⟩ to the URL), then you also need to set targetname to the anchor ⟨ to the anchor ⟨name⟩. You may use \glslabel within ⟨name⟩ which is set by commands like \gls to the entry’s label. -

    All the predefined glossary styles start each entry listing with

    All the predefined glossary styles start each entry listing with \glstarget which sets the anchor to \glolinkprefix\glslabel, so if you want entries to link to glossaries in the URL given by targeturl, you can just + id="dx1-27117">, you can just do:

    -
    +
    \glssetcategoryattribute{general}{targetname}{\glolinkprefix\glslabel}
    -

    (If the target document changed

    (If the target document changed \glolinkprefix then you will need to adjust the above as appropriate.) -

    If the anchor is in the form ⟨

    If the anchor is in the form ⟨name1.name2⟩ then use targetname for the ⟨ for the ⟨name2⟩ part and targetcategory for the ⟨ for the ⟨name1⟩ part. -

    For example: +

    For example:

    -
    +
    \glssetcategoryattribute{general}{targeturl}{master-doc.pdf}  
    \glssetcategoryattribute{general}{targetcategory}{page}  
    \glssetcategoryattribute{general}{targetname}{7}
    -

    will cause all link text for

    will cause all link text for general entries to link to master-doc.pdf#page.7 (page 7 of that PDF). -

    If you want a mixture in your document of entries that link to an internal +

    If you want a mixture in your document of entries that link to an internal glossary and entries that link to an external URL then you can use the starred form of \newignoredglossary for the external list. For + id="dx1-27120"> for the external list. For example:

    -
    +
    \newignoredglossary*{external}  
    \glssetcategoryattribute{external}{targeturl}{master-doc.pdf}  
    \glssetcategoryattribute{general}{targetname}{\glolinkprefix\glslabel} @@ -10425,14 +11801,14 @@ class="cmtt-10">\newignoredglossary  category=external,  
      description={external example}}
    -

    +

    -

    An attribute can be set using: -


    An attribute can be set using: +


    \glssetcategoryattribute  \glssetcategoryattribute{category-label} @@ -10442,31 +11818,31 @@ class="cmitt-10">attribute-label}{value}

    -

    +

    where ⟨category-label⟩ is the category label, ⟨attribute-label⟩ is the attribute label and ⟨value⟩ is the new value for the attribute. -

    There is a shortcut version to set the

    There is a shortcut version to set the regular attribute to “true”: -


    attribute to “true”: +


    \glssetregularcategory  \glssetregularcategory{category-label}

    -

    -

    If you need to lookup the category label for a particular entry, you can use the +

    +

    If you need to lookup the category label for a particular entry, you can use the shortcut command: -



    \glssetattribute  \glssetattribute{entry-label}{} class="cmtt-10">{value}

    -

    +

    This uses \glssetcategoryattribute with \glscategory to set the attribute. Note that this will affect all other entries that share this entry’s category. -

    You can fetch the value of an attribute for a particular category using: -


    You can fetch the value of an attribute for a particular category using: +


    \glsgetcategoryattribute  \glsgetcategoryattribute{category-label} @@ -10493,13 +11869,13 @@ class="cmtt-10">} class="cmtt-10">{⟨attribute-label}

    -

    +

    Again there is a shortcut if you need to lookup the category label for a given entry: -



    \glsgetattribute  \glsgetattribute{entry-label}{} -

    -

    You can test if an attribute has been assigned to a given category using: -


    +

    You can test if an attribute has been assigned to a given category using: +


    \glshascategoryattribute  \glshascategoryattribute{category-label} @@ -10526,19 +11902,19 @@ class="cmitt-10">true code}{false code}

    -

    +

    This uses etoolbox’s ’s \ifcsvoid and does ⟨true code⟩ if the attribute has been set and isn’t blank and isn’t \relax. The shortcut if you need to lookup the category label from an entry is: -



    \glshasattribute  \glshasattribute{entry-label}{code}{false code}

    -

    -

    You can test the value of an attribute for a particular category using: -


    +

    You can test the value of an attribute for a particular category using: +


    \glsifcategoryattribute  \glsifcategoryattribute{category-label} @@ -10569,7 +11945,7 @@ class="cmitt-10">true-part}{false-part}

    -

    +

    This tests if the attribute (given by ⟨attribute-label⟩) for the category (given by ⟨true-part⟩ is done. If the attribute isn’t set or is set but isn’t equal to ⟨value⟩, ⟨false part⟩ is done. -

    For example: +

    For example:

    -
    +
    \glsifcategoryattribute{general}{nohyper}{true}{NO HYPER}{HYPER}
    -

    This does “NO HYPER” if the

    This does “NO HYPER” if the general category has the category has the nohyper attribute set to + id="dx1-27132"> attribute set to true otherwise if does “HYPER”. -

    With boolean-style attributes like

    With boolean-style attributes like nohyper, make sure you always test for , make sure you always test for true not false in case the attribute hasn’t been set. -

    Again there’s a shortcut if you need to lookup the category label from a particular +

    Again there’s a shortcut if you need to lookup the category label from a particular entry: -



    \glsifattribute  \glsifattribute{entry-label}{true-part} {false-part}

    -

    -

    There’s also a shortcut to determine if a particular category has the

    +

    There’s also a shortcut to determine if a particular category has the regular + id="dx1-27135"> attribute set to “true”: -



    \glsifregularcategory  \glsifregularcategory{category-label} @@ -10640,12 +12016,12 @@ class="cmitt-10">true-part}{false-part}

    -

    +

    Alternatively, if you need to lookup the category for a particular entry: -



    \glsifregular  \glsifregular{entry-label}{}{false-part}

    -

    +

    Note that if the regular attribute hasn’t be set, the above do ⟨ attribute hasn’t be set, the above do ⟨false-part⟩. There are also reverse commands that test if the regular attribute has been set to + id="dx1-27139"> attribute has been set to “false”: -



    \glsifnotregularcategory  \glsifnotregularcategory{category-label} @@ -10678,12 +12054,12 @@ class="cmitt-10">true-part}{false-part}

    -

    +

    or for a particular entry: -



    \glsifnotregular  \glsifnotregular{entry-label}{}{false-part}

    -

    +

    Again, if the regular attribute hasn’t been set, the above do ⟨ attribute hasn’t been set, the above do ⟨false-part⟩, so these reverse commands aren’t logically opposite in the strict sense. -

    You can iterate through all entries with a given category using: -


    You can iterate through all entries with a given category using: +


    \glsforeachincategory[glossary-labels]{label-cs}{body}

    -

    +

    This iterates through all entries in the glossaries identified by the comma-separated list ⟨glossary-labels⟩ that have the category given by ⟨

    Similarly, you can iterate through all entries that have a category with a given +

    Similarly, you can iterate through all entries that have a category with a given attribute using: -



    \glsforeachwithattribute  \glsforeachwithattribute[glossary-labels] @@ -10752,42 +12128,42 @@ class="cmtt-10">}{body}

    -

    +

    This will do ⟨body⟩ for each entry that has a category with the attribute ⟨attribute-label⟩ set to ⟨attribute-value⟩. The remaining arguments are as the previous command. -

    You can change the category for a particular entry using the standard glossary +

    You can change the category for a particular entry using the standard glossary field changing commands, such as \glsfielddef. Alternatively, you can + id="dx1-27144">. Alternatively, you can use -



    \glsxtrsetcategory  \glsxtrsetcategory{entry-labels}{category-label}

    -

    +

    This will change the category to ⟨category-label⟩ for each entry listed in the comma-separated list ⟨entry-labels⟩. This command uses \glsfieldxdef so it will + id="dx1-27146"> so it will expand ⟨category-label⟩ and make the change global. -

    You can also change the category for all entries with a glossary or glossaries +

    You can also change the category for all entries with a glossary or glossaries using: -



    \glsxtrsetcategoryforall  \glsxtrsetcategoryforall{glossary-labels} @@ -10795,82 +12171,82 @@ class="cmtt-10">} class="cmtt-10">{⟨category-label}

    -

    +

    where ⟨glossary-labels⟩ is a comma-separated list of glossary labels.

    -

    -

    +

    Top

    6. Entry Counting

    -

    As mentioned in

    As mentioned in §2.4 Entry Counting Modifications, glossaries-extra modifies the \glsenableentrycount command to allow for the command to allow for the entrycount attribute. This means + id="dx1-28002"> attribute. This means that you not only need to enable entry counting with \glsenableentrycount, but + id="dx1-28003">, but you also need to set the appropriate attribute (see §5 Categories). -

    Remember that entry counting only counts the number of times an entry is used +

    Remember that entry counting only counts the number of times an entry is used by commands that change the first use flag. (That is, all those commands that mark the entry as having been used.) There are many commands that don’t modify this flag and they won’t contribute to the entry use count.
    -

    -

    With

    +

    With glossaries-extra, you may use \cgls instead of instead of \gls even if you haven’t enabled + id="dx1-28006"> even if you haven’t enabled entry counting. You will only get a warning if you use \glsenableentrycount without setting the entrycount attribute. (With attribute. (With glossaries, commands like \cgls + id="dx1-28008"> will generate a warning if \glsenableentrycount hasn’t been used.) The abbreviation shortcut \ab uses uses \cgls (see §3.3 Shortcut Commands) unlike the acronym shortcut \ac which uses which uses \gls (except when it’s defined through shortcuts=ac). -

    All upper case versions (not provided by ). +

    All upper case versions (not provided by glossaries) are also available: -



    \cGLS  \cGLS[options]{label}[insert]

    -

    +

    and -



    \cGLSpl  \cGLSpl[options]{label}[insert]

    -

    +

    These are analogous to \cgls and \cglspl but they use -



    \cGLSformat  \cGLSformat{label}{insert}

    -

    +

    and -



    \cGLSplformat  \cGLSplformat{label}{insert}

    -

    +

    which convert the analogous \cglsformat and \cglsplformat to upper case. -

    Just using

    Just using glossaries:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries}  
    \makeglossaries @@ -10939,17 +12315,17 @@ class="cmss-10">glossaries:  
    \printglossaries  
    \end{document}
    -

    -

    If you switch to

    +

    If you switch to glossaries-extra you must set the entrycount attribute: + id="dx1-28016"> attribute:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \makeglossaries @@ -10963,16 +12339,16 @@ class="cmss-10">entrycount\printglossaries  
    \end{document}
    -

    -

    When activated with

    +

    When activated with \glsenableentrycount, commands such as \cgls now + id="dx1-28017"> now use -



    \glsxtrifcounttrigger  \glsxtrifcounttrigger{label}{} class="cmtt-10">{normal code}

    -

    +

    to determine if the entry trips the entry count trigger. The ⟨trigger code⟩ uses commands like \cglsformat and unsets the first use flag. The ⟨normal code⟩ is the code that would ordinarily be performed by whatever the equivalent command is (for @@ -10998,12 +12374,12 @@ class="cmti-10">trigger code⟩ but the usual \gls behaviour in ⟨normal code⟩). -

    The default definition is: +

    The default definition is:

    -
    +
    \newcommand*{\glsxtrifcounttrigger}[3]{%  
     \glshasattribute{#1}{entrycount}%  
     {% @@ -11016,37 +12392,37 @@ class="cmti-10">normal code⟩).  
     {#3}%  
    }
    -

    This means that if an entry is assigned to a category that has the

    This means that if an entry is assigned to a category that has the entrycount + id="dx1-28020"> attribute then the ⟨trigger code⟩ will be used if the previous count value (the number of times the entry was used on the last run) is greater than the value of the attribute. -

    For example, to trigger normal use if the previous count value is greater than +

    For example, to trigger normal use if the previous count value is greater than four:

    -
    +
    \glssetcategoryattribute{abbreviation}{entrycount}{4}
    -

    -

    There is a convenient command provided to enable entry counting, set the +

    +

    There is a convenient command provided to enable entry counting, set the entrycount attribute and redefine attribute and redefine \gls, etc to use , etc to use \cgls etc: -


    etc: +


    \GlsXtrEnableEntryCounting  \GlsXtrEnableEntryCounting{categories} @@ -11054,19 +12430,19 @@ class="cmtt-10">} class="cmtt-10">{⟨value}

    -

    +

    The first argument ⟨categories⟩ is a comma-separated list of categories. For each category, the entrycount attribute is set to ⟨ attribute is set to ⟨value⟩. In addition, this does:

    -
    +
    \renewcommand*{\gls}{\cgls}%  
    \renewcommand*{\Gls}{\cGls}%  
    \renewcommand*{\glspl}{\cglspl}% @@ -11074,19 +12450,19 @@ class="cmti-10">value⟩. In addition, this does:  
    \renewcommand*{\GLS}{\cGLS}%  
    \renewcommand*{\GLSpl}{\cGLSpl}%
    -

    This makes it easier to enable entry-counting on existing documents. -

    If you use

    This makes it easier to enable entry-counting on existing documents. +

    If you use \GlsXtrEnableEntryCounting more than once, subsequent uses will just set the entrycount attribute for each listed category. -

    The above example document can then become: + id="dx1-28026"> attribute for each listed category. +

    The above example document can then become:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \makeglossaries @@ -11099,15 +12475,15 @@ class="cmss-10">entrycount\printglossaries  
    \end{document}
    -

    -

    The standard entry-counting function describe above counts the number of times +

    +

    The standard entry-counting function describe above counts the number of times an entry has been marked as used throughout the document. (The reset commands will reset the total back to zero.) If you prefer to count per sectional-unit, you can use -



    \GlsXtrEnableEntryUnitCounting  \GlsXtrEnableEntryUnitCounting {value}{counter-name}

    -

    +

    where ⟨categories⟩ is a comma-separated list of categories to which this feature should be applied, ⟨value⟩ is the trigger value and ⟨counter-name⟩ is the name of the counter used by the sectional unit. -

    Due to the asynchronous nature of T

    Due to the asynchronous nature of TEX’s output routine, discrepancies will occur in page spanning paragraphs if you use the page counter.
    -

    -

    Note that you can’t use both the document-wide counting and the per-unit + id="dx1-28028"> counter.

    +

    +

    Note that you can’t use both the document-wide counting and the per-unit counting in the same document. -

    The counter value is used as part of a label, which means that

    The counter value is used as part of a label, which means that \thecounter-name⟩ needs to be expandable. Since hyperref also has a similar requirement and provides + id="dx1-28029"> also has a similar requirement and provides \theHcounter-name⟩ as an expandable alternative, \theHcounter-name⟩ if it exists otherwise it will use \thecounter-name⟩. -

    The per-unit counting function uses two attributes:

    The per-unit counting function uses two attributes: entrycount (as before) and + id="dx1-28030"> (as before) and unitcount (the name of the counter). + id="dx1-28031"> (the name of the counter). -

    Both the original document-wide counting mechanism and the per-unit counting +

    Both the original document-wide counting mechanism and the per-unit counting mechanism provide a command that can be used to access the current count value for this run: -



    \glsentrycurrcount  \glsentrycurrcount{label}

    -

    +

    and the final value from the previous run: -



    \glsentryprevcount  \glsentryprevcount{label}

    -

    +

    In the case of the per-unit counting, this is the final value for the current unit. In both commands ⟨label⟩ is the entry’s label. -

    The per-unit counting mechanism additionally provides: -


    The per-unit counting mechanism additionally provides: +


    \glsentryprevtotalcount  \glsentryprevtotalcount{label}

    -

    +

    which gives the sum of all the per-unit totals from the previous run for the entry given by ⟨label⟩, and -



    \glsentryprevmaxcount  \glsentryprevmaxcount{label}

    -

    +

    which gives the maximum per-unit total from the previous run. -

    The above two commands are unavailable for the document-wide counting. -

    Example of per-unit counting, where the unit is the chapter: +

    The above two commands are unavailable for the document-wide counting. +

    Example of per-unit counting, where the unit is the chapter:

    -
    +
    \documentclass{report}  
    \usepackage{glossaries-extra}  
    \GlsXtrEnableEntryUnitCounting{abbreviation}{2}{chapter} @@ -11228,11 +12604,11 @@ which gives the maximum per-unit total from the previous run.  
    \printglossaries  
    \end{document}
    -

    In this document, the

    In this document, the css entry is used three times in the first chapter. This is more than the trigger value of 2, so \gls{css} is expanded on first use with the short form used on subsequent use, and the css entries in that @@ -11242,19 +12618,19 @@ only used once, which trips the suppression trigger, so in that chapter, the long form is used and \gls{css} doesn’t get a line added to the glossary file. -

    The

    The html is used a total of three times, but the expansion and indexing suppression trigger is tripped in both chapters because the per-unit total (1 for the first chapter and 2 for the second chapter) is less than or equal to the trigger value. -

    The

    The sample entry has only been used once, but it doesn’t trip the indexing suppression because it’s in the general category, which hasn’t been listed in + id="dx1-28037"> category, which hasn’t been listed in \GlsXtrEnableEntryUnitCounting. -

    The per-unit entry counting can be used for other purposes. In the following +

    The per-unit entry counting can be used for other purposes. In the following @@ -11262,20 +12638,20 @@ example document the trigger value is set to zero, which means the index suppres won’t be triggered, but the unit entry count is used to automatically suppress the hyperlink for commands like \gls by modifying the hook -


    by modifying the hook +


    \glslinkcheckfirsthyperhook  \glslinkcheckfirsthyperhook

    -

    +

    which is used at the end of the macro the determines whether or not to suppress the hyperlink.

    -
    +
    \documentclass{article}  
    \usepackage[colorlinks]{hyperref}  
    \usepackage{glossaries-extra} @@ -11296,12 +12672,12 @@ hyperlink.  
    \printglossaries  
    \end{document}
    -

    This only produces a hyperlink for the first instance of

    This only produces a hyperlink for the first instance of \gls{sample} on each page. -

    The earlier warning about using the

    The earlier warning about using the page counter still applies. If the + id="dx1-28040"> counter still applies. If the first instance of \gls occurs at the top of the page within a paragraph that started on the previous page, then the count will continue from the previous @@ -11310,101 +12686,101 @@ page.

    -

    -

    +

    Top

    7. Auto-Indexing

    -

    It’s possible that you may also want a normal index as well as the glossary, +

    It’s possible that you may also want a normal index as well as the glossary, and you may want entries to automatically be added to the index (as in this document). There are two attributes that govern this: indexname and + id="dx1-29001"> and dualindex. -

    The . +

    The \glsxtrpostnamehook macro, used at the end of macro, used at the end of \glossentryname and + id="dx1-29004"> and \Glossentryname, checks the , checks the indexname attribute for the category associated with + id="dx1-29006"> attribute for the category associated with that entry. Since \glossentryname is used in the default glossary styles, this makes a convenient way of automatically indexing each entry name at its location in the glossary without fiddling around with the value of the name + id="dx1-29007"> key. -

    The internal macro used by the

    The internal macro used by the glossaries package to write the information to the external glossary file is modified to check for the dualindex attribute. -

    In both cases, the indexing is done through -


    attribute. +

    In both cases, the indexing is done through +


    \glsxtrdoautoindexname  \glsxtrdoautoindexname{label}{attribute-label}

    -

    +

    This uses the standard \index command with the sort value taken from the entry’s + id="dx1-29010"> command with the sort value taken from the entry’s sort key and the actual value set to key and the actual value set to \glsentryname{label}. As from v1.16, there are user-level commands available to change the sort and actual value used by the automated index. -

    The actual value is given by -


    The actual value is given by +


    \glsxtrautoindexentry  \glsxtrautoindexentry{label}

    -

    +

    where ⟨label⟩ is the entry’s label. The default definition is:

    -
    +
    \newcommand*{\glsxtrautoindexentry}[1]{\string\glsentryname{#1}}
    -

    Note the use of

    Note the use of \string to prevent \glsentryname from being expanded as it’s written to the index file. -

    The sort value is assigned using: -


    The sort value is assigned using: +


    \glsxtrautoindexassignsort  \glsxtrautoindexassignsort{cs}{label}

    -

    +

    where ⟨label⟩ is the entry label and ⟨cs⟩ is the command which needs to be set to the @@ -11413,211 +12789,212 @@ sort value. The default definition is:

    -
    +
    \newcommand*{\glsxtrautoindexassignsort}[2]{%  
      \glsletentryfield{#1}{#2}{sort}%  
    }
    -

    After this macro is called, ⟨

    After this macro is called, ⟨cs⟩ is then processed to escape any of makeindex’s special + id="dx1-29014">’s special characters. Note that this escaping is only performed on the sort not on the actual value. -

    The command used to perform the actual indexing is: -


    The command used to perform the actual indexing is: +


    \glsxtrautoindex  \glsxtrautoindex{text}

    -

    +

    This just does \index{text} by default. -

    The entry’s

    The entry’s parent field isn’t referenced in this automated indexing. + id="dx1-29016"> field isn’t referenced in this automated indexing.
    -

    -

    For example, to index the value of the

    +

    For example, to index the value of the first key, instead of the key, instead of the name key: + id="dx1-29018"> key:

    -
    +
    \renewcommand*{\glsxtrautoindexentry}[1]{\string\glsentryfirst{#1}}
    -

    and if the sort value also needs to be set to the

    and if the sort value also needs to be set to the long field, if present, otherwise the + id="dx1-29019"> field, if present, otherwise the sort field: + id="dx1-29020"> field:

    -
    +
    \renewcommand*{\glsxtrautoindexassignsort}[2]{%  
      \ifglshaslong{#2}%  
      {\glsletentryfield{#1}{#2}{long}}%  
      {\glsletentryfield{#1}{#2}{sort}}%  
    }
    -

    -

    If the value of the attribute given by ⟨

    +

    If the value of the attribute given by ⟨attribute-label⟩ is “true”, no encap will be added, otherwise the encap will be the attribute value. For example:

    -
    +
    \glssetcategoryattribute{general}{indexname}{textbf}
    -

    will set the encap to

    will set the encap to textbf which will display the relevant page number in bold whereas

    -
    +
    \glssetcategoryattribute{general}{dualindex}{true}
    -

    won’t apply any formatting to the page number in the index. -

    The location used in the index will always be the page number not the counter +

    won’t apply any formatting to the page number in the index. +

    The location used in the index will always be the page number not the counter used in the glossary. (Unless some other loaded package has modified the definition of \index to use some thing else.)
    -

    -

    By default the

    +

    By default the format key won’t be used with the key won’t be used with the dualindex attribute. You can + id="dx1-29022"> attribute. You can allow the format key to override the attribute value by using the preamble-only + id="dx1-29023"> key to override the attribute value by using the preamble-only command: -



    \GlsXtrEnableIndexFormatOverride  \GlsXtrEnableIndexFormatOverride

    -

    +

    If you use this command and hyperref has been loaded, then the has been loaded, then the theindex + id="dx1-29026"> environment will be modified to redefine \glshypernumber to allow formats that use + id="dx1-29028"> to allow formats that use that command. -

    The

    The dualindex attribute will still be used on subsequent use even if the + id="dx1-29029"> attribute will still be used on subsequent use even if the indexonlyfirst attribute (or indexonlyfirst package option) is set. However, the attribute (or indexonlyfirst package option) is set. However, the dualindex + id="dx1-29032"> attribute will honour the noindex key.
    -

    -

    The key.

    +

    +

    The \glsxtrdoautoindexname command will attempt to escape any of \makeindex’s special characters, but there may be special cases where it fails, so take + id="dx1-29034">’s special characters, but there may be special cases where it fails, so take care. This assumes the default makeindex actual, level, quote and encap values (unless any of the commands \actualchar, , \levelchar, , \quotechar or or \encapchar + id="dx1-29039"> have been defined before glossaries-extra is loaded). -

    If this isn’t the case, you can use the following preamble-only commands to set +

    If this isn’t the case, you can use the following preamble-only commands to set the correct characters. -

    Be very careful of possible shifting category codes!
    -

    -


    Be very careful of possible shifting category codes!
    +

    +


    \GlsXtrSetActualChar  \GlsXtrSetActualChar{char}

    -

    +

    Set the actual character to ⟨char⟩. -



    \GlsXtrSetLevelChar  \GlsXtrSetLevelChar{char}

    -

    +

    Set the level character to ⟨char⟩. -



    \GlsXtrSetEscChar  \GlsXtrSetEscChar{char}

    -

    +

    Set the escape (quote) character to ⟨char⟩. -



    \GlsXtrSetEncapChar  \GlsXtrSetEncapChar{char}

    -

    +

    Set the encap character to ⟨char⟩.

    -

    -

    +

    Top

    8. On-the-Fly Document Definitions

    -

    The commands described here may superficially look like ⟨

    The commands described here may superficially look like ⟨word\index{word\index then just use \index.
    -

    -

    The

    +

    The glossaries package advises against defining entries in the document + id="dx1-30001"> environment. As mentioned in §1.2 glossaries-extra but can be enabled using the docdefs package options. -

    Although this can be problematic, the package options. +

    Although this can be problematic, the glossaries-extra package provides a way of defining and using entries within the document environment without the tricks used + id="dx1-30004"> environment without the tricks used with the docdefs option. option. There are limitations with this approach, so take care with it. This function is disabled by default, but can be enabled using the preamble-only command: -



    \GlsXtrEnableOnTheFly  \GlsXtrEnableOnTheFly

    -

    +

    When used, this defines the commands described below. -

    The commands

    The commands \glsxtr, \glsxtrpl, \Glsxtr and \Glsxtrpl can’t be used after the glossaries have been displayed (through \printglossary etc). It’s best not to + id="dx1-30008"> etc). It’s best not to mix these commands with the standard glossary commands, such as \gls or there may be unexpected results.
    -

    -


    +


    \glsxtr  \glsxtr[gls-options][dfn-options]{label}

    -

    +

    If an entry with the label ⟨label⟩ has already been defined, this just does \gls @@ -11720,68 +13097,68 @@ class="cmitt-10">dfn-options⟩}

    -

    The ⟨

    The ⟨label⟩ must contain any non-expandable commands, such as formatting commands or problematic characters. If the term requires any of these, they must be omitted from the ⟨label⟩ and placed in the name key must be provided in the optional + id="dx1-30010"> key must be provided in the optional argument ⟨dfn-options⟩.
    -

    +

    -

    The second optional argument ⟨

    The second optional argument ⟨dfn-options⟩ should be empty if the entry has already been defined, since it’s too late for them. If it’s not empty, a warning will be generated with -



    \GlsXtrWarning  \GlsXtrWarning{dfn-options}{label}

    -

    -

    For example, this warning will be generated on the second instance of

    +

    For example, this warning will be generated on the second instance of \glsxtr below:

    -
    +
    \glsxtr[][plural=geese]{goose}  
     ... later  
    \glsxtr[][plural=geese]{goose}
    -

    -

    If you are considering doing something like: +

    +

    If you are considering doing something like:

    -
    +
    \newcommand*{\goose}{\glsxtr[][plural=geese]{goose}}  
    \renewcommand*{\GlsXtrWarning}[2]{}  
     ... later  
    \goose\ some more text here
    -

    then don’t bother. It’s simpler and less problematic to just define the entries in the +

    then don’t bother. It’s simpler and less problematic to just define the entries in the preamble with \newglossaryentry and then use and then use \gls in the document. -

    There are plural and case-changing alternatives to

    There are plural and case-changing alternatives to \glsxtr: -



    \glsxtrpl  \glsxtrpl[gls-options][dfn-options]{label}

    -

    +

    This is like \glsxtr but uses \glspl instead of \gls. -



    \Glsxtr  \Glsxtr[gls-options][dfn-options]{label}

    -

    +

    This is like \glsxtr but uses \Gls instead of \gls. -



    \Glsxtrpl  \Glsxtrpl[gls-options][dfn-options]{label}

    -

    +

    This is like \glsxtr but uses \Glspl instead of \gls. -

    If you use UTF-8 and don’t want the inconvenient of needing to use an +

    If you use UTF-8 and don’t want the inconvenient of needing to use an ASCII-only label, then it’s better to use XƎLATEX or LuaLATEX instead of LATEX (or pdfLATEX). If you really desperately want to use UTF-8 entry labels @@ -11835,24 +13212,24 @@ without switching to X\GlsXtrEnableOnTheFly that allows you to use UTF-8 characters in ⟨label⟩, but it’s experimental and may not work in some cases. -

    If you use the starred version of

    If you use the starred version of \GlsXtrEnableOnTheFly don’t use any commands in the ⟨label⟩, even if they expand to just text.
    -

    +

    -

    -

    +

    Top

    9. bib2gls: Managing Reference Databases

    -

    There is a new command line application called

    There is a new command line application called bib2gls, which works in much + id="dx1-31002">, which works in much the same way as a combination of bibtex and makeindex/\input or \loadglsentries, the entries can instead be stored in a .bib file and bib2gls can + id="dx1-31004"> can selectively write the appropriate commands to a .glstex file which is loaded using \glsxtrresourcefile (or \GlsXtrLoadResources). -

    This means that you can use a reference managing system, such as JabRef, to +

    This means that you can use a reference managing system, such as JabRef, to maintain the database and it reduces the TEX overhead by only defining the entries that are actually required in the document. If you currently have a .tex file containing glossary definitions to a .bib file using convertgls2bib, supplied with + id="dx1-31005">, supplied with bib2gls.) -

    There are some new commands and options added to .) +

    There are some new commands and options added to glossaries-extra to help assist the integration of bib2gls into the document build process. -

    An example of the contents of into the document build process. +

    An example of the contents of .bib file that stores glossary entries that can be extracted with bib2gls: + id="dx1-31011">:

    -
    +
    @entry{bird,  
      name={bird},  
      description = {feathered animal}, @@ -11920,13 +13297,13 @@ class="cmtt-10">bib2gls  description={a waterbird with a long neck}  
    }
    -

    -

    The follow provides some abbreviations: +

    +

    The follow provides some abbreviations:

    -
    + -

    -

    Here are some symbols: +

    +

    Here are some symbols:

    -
    +
    preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"}  
    @symbol{M,  
      name={$\mtx{M}$}, @@ -11969,73 +13346,73 @@ preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"}  
      description={a set}  
    }
    -

    -

    To ensure that

    +

    To ensure that bib2gls can find out which entries have been used in the + id="dx1-31013"> can find out which entries have been used in the document, you need the record package option: + id="dx1-31014"> package option:

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

    If this option’s value is omitted (as above), the normal indexing will be switched off, +

    If this option’s value is omitted (as above), the normal indexing will be switched off, since bib2gls can also sort the entries and collate the locations. -

    If you still want to use an indexing application (for example, you need a custom + id="dx1-31016"> can also sort the entries and collate the locations. +

    If you still want to use an indexing application (for example, you need a custom xindy rule), then just use record=alsoindex and continue to use and continue to use \makeglossaries and \printglossary (or \printglossaries), but it’s a good idea to also instruct bib2gls to omit sorting to save time. -

    The to omit sorting to save time. +

    The .glstex file created by \bib2gls is loaded using: -



    \glsxtrresourcefile  \glsxtrresourcefile[options]{filename}

    -

    +

    (Don’t include the file extension in ⟨filename⟩.) There’s a shortcut version (recommended over the above) that sets ⟨filename⟩ to use \jobname: -



    \GlsXtrLoadResources  \GlsXtrLoadResources[options]

    -

    +

    On the first use, this command is a shortcut for

    }
    On subsequent use,9.1 this + id="x1-31023f1"> this command is a shortcut for
    }
    where ⟨n⟩ is the current value of -



    \glsxtrresourcecount

    -

    +

    which is incremented at the end of \GlsXtrLoadResources. Any advisory notes regarding \glsxtrresourcefile also apply to \GlsXtrLoadResources. -

    The

    The \glsxtrresourcefile command writes the line

    filename.glstex if it exists.9.2 + id="x1-31024f2"> -

    Since the

    Since the .glstex won’t exist on the first LATEX run, the record package option + id="dx1-31025"> package option additionally switches on undefaction=warn. Any use of commands like . Any use of commands like \gls or \glstext will produce ?? in the document, since they are undefined at this point. Once bib2gls has created the has created the .glstex file the references should be resolved. This may cause a shift in the locations if the actual text produced once the entry is defined is larger than the placeholder ?? (as can occur with long citations). -

    Note that \glsaddall doesn’t work with

    Note that as from v1.12, \glsxtrresourcefile temporarily switches the +category code of @ to 11 (letter) while it reads the file to allow for any internal +commands stored in the location field. +

    +

    Top

    9.1 Selection

    +

    The default behaviour is for bib2gls as the command has to iterate -over the internal lists of defined entry labels, which will be empty on the first run and -on subsequent runs will only contain those entries that have been selected by - to select all entries that have a record in the +.aux file, and any dependent entries (including parent and cross-references). The +glsignore format (for example, \gls[format=glsignore]{duck}) is recognised +by bib2gls as a special ignored record. This means that it will match the +selection criteria but the record won’t be added to the location list. This means +that you won’t get spurious commas in the location list, so you can do, for +example, + + + +

    +
    +\GlsXtrSetDefaultNumberFormat{glsignore} +
    +

    at the start of the front matter and + + + +

    +
    +\GlsXtrSetDefaultNumberFormat{glsnumberformat} +
    +

    at the start of the main matter to prevent any records in the front matter from +occurring in the location lists. +

    Note that commands like \glsaddall and \glsaddallunused don’t +work with bib2gls as the command has to iterate over the internal lists of +defined entry labels, which will be empty on the first run and on subsequent +runs will only contain those entries that have been selected by bib2gls.
    -

    -

    If you want to add all entries to the glossary, you need to tell . +

    +

    +

    If you want to add all entries to the glossary, you need to tell bib2gls this in the + id="dx1-32010"> this in the options list. For example:

    -
    +
    \GlsXtrLoadResources[src={terms},selection={all}]
    -

    See the

    This will add all entries, regardless of whether or not they have any records in the +.aux file. Those that don’t have any records will have an empty location list. See the +bib2gls user manual for more details of this and other available -options. -

    Note that as from v1.12, \glsxtrresourcefile temporarily switches the -category code of @ to 11 (letter) while it reads the file to allow for any internal -commands stored in the location field. -

    Since the .glstex file only defines those references used within the document and -the definitions have been written in the order corresponding to user manual for more details of this option. +

    +

    +

    Top

    9.2 Sorting and Displaying the Glossary

    +

    There are many sorting options provided by bib2gls sorted -list, the glossaries can simply be displayed using \printunsrtglossary (or + id="dx1-33002">. The default is to sort +according to the system locale. If the document has a language setting, you can use sort=doc to instruct bib2gls to sort according to that. (The language tag obtained +from tracklang’s interface is written to the .aux file.) For a multilingual document +you need to explicitly set the locale using a well-formed language tag. For +example: + + + +

    +
    +\GlsXtrLoadResources[ + 
      src=terms, % data in terms.bib + 
      sort=de-DE-1996 % sort according to this locale + 
    ] +
    +

    The locale-sensitive sort methods usually ignore most punctuation so for lists of +symbols you may find it more appropriate to use one of the letter-base sort methods +that sort according to the Unicode value of each character. See the bib2gls manual +for full details of all the available sort methods. +

    Since the .glstex file only defines those references required within the document +(selected according to the selection option) and the definitions have been written in +the order corresponding to bib2gls sorted list, the glossaries can simply be displayed +using \printunsrtglossary (or \printunsrtglossaries), described in §10.2 Display All Entries Without Sorting or -Indexing. -

    Suppose the §10.2 +Display All Entries Without Sorting or Indexing. +

    Suppose the .bib examples shown above have been stored in the files terms.bib, EX’s path. Then the document might look like:

    -
    +
    \documentclass{article}  
    \usepackage[record]{glossaries-extra}  
    \setabbreviationstyle{long-short-desc} @@ -12186,18 +13645,18 @@ class="E">EX’s path. Then the document might look like:  
    \printunsrtglossaries  
    \end{document}
    -

    The document build process (assuming the document is called

    The document build process (assuming the document is called mydoc) is:

    -
    +
    pdflatex mydoc  
    bib2gls mydoc  
    pdflatex mydoc
    -

    This creates a single glossary containing the entries:

    This creates a single glossary containing the entries: bird, duck, goose, bird, shtml and M entries were added because bib2gls detected (from the detected (from the .aux file) that they had been used in the document. The other entries were added because bib2gls detected (from the detected (from the .bib files) that they are referenced by the used entries. In the case of duck and goose, they are in the see field for field for bird. In the case of ssi and html, they are referenced in the description field of field of shtml. These cross-referenced entries won’t have a location list when the glossary is first displayed, but depending on how they are referenced, they may pick up a location list on the next document build. -

    The entries can be separated into different glossaries with different sort +

    The entries can be separated into different glossaries with different sort methods:

    -
    +
    \documentclass{article}  
    \usepackage[record,abbreviations,symbols]{glossaries-extra}  
    \setabbreviationstyle{long-short-desc}  
    \GlsXtrLoadResources[src={terms},sort={en-GB},type=main] - 
    \glsxtrresourcefile + 
    \GlsXtrLoadResources  
     [src={abbrvs},sort={letter-nocase},type=abbreviations] - 
     {\jobname-abr} - 
    \glsxtrresourcefile + 
    \GlsXtrLoadResources  
     [src={symbols},sort={use},type={symbols}] - 
     {\jobname-sym}  
    \begin{document}  
    \gls{bird}  
    \gls{shtml} @@ -12260,133 +13717,1179 @@ methods:  
    \printunsrtglossaries  
    \end{document}
    -

    (By default, entries are sorted according to the operating system’s locale. -If this doesn’t match the document language, you need to set this in the -option list, for example sort=de-CH-1996 for Swiss German using the new -orthography.) +

    +

    Or you can have multiple instance of \GlsXtrLoadResources with the same +type, which will produce a glossary with ordered sub-blocks. For example:

    -

    -

    Top

    10. Miscellaneous New Commands

    -

    The glossaries package provides \glsrefentry entry to cross-reference entries -when used with the entrycounter or subentrycounter options. The glossaries-extra -package provides a supplementary command -


    \glsxtrpageref  \glsxtrpageref{label}

    -

    -that works in the same way except that it uses \pageref instead of \ref. -

    You can copy an entry to another glossary using -


    \glsxtrcopytoglossary  \glsxtrcopytoglossary{entry-label}{glossary-type} -

    -

    -This appends ⟨entry-label⟩ to the end of the internal list for the glossary given by -⟨glossary-type⟩. Be careful if you use the hyperref package as this may cause duplicate -hypertargets. You will need to change \glolinkprefix to another value or disable -hyperlinks when you display the duplicate. Alternatively, use the new target key to -switch off the targets: +

    +\documentclass{article} + 
    \usepackage[record,style=indexgroup]{glossaries-extra} + 
    \setabbreviationstyle{long-short-desc} + 
    \GlsXtrLoadResources + 
     [src={abbrvs},sort={letter-nocase},type=main, + 
      group={Abbreviations}] + 
    \GlsXtrLoadResources + 
     [src={symbols},sort={use},type=main, + 
      group={Symbols}] + 
    \GlsXtrLoadResources[src={terms},sort={en-GB},type=main] + 
    \begin{document} + 
    \gls{bird} + 
    \gls{shtml} + 
    \gls{M} + 
    \printunsrtglossaries + 
    \end{document} +
    +

    This will result in a glossary where the first group has the title “Abbreviations”, the +second group has the title “Symbols” and then follow the usual letter groups. Note +that for this example to work, you must run bib2gls with the --group (or -g) +switch. For example, if the document is called myDoc.tex:

    -
    -\printunsrtglossary[target=false] +
    +pdflatex myDoc + 
    bib2gls -g myDoc + 
    pdflatex myDoc
    -

    -

    The glossaries package allows you to set preamble code for a given glossary -type using \setglossarypreamble. This overrides any previous setting. -With glossaries-extra (as from v1.12) you can instead append to the preamble -using -


    \apptoglossarypreamble  \apptoglossarypreamble[type]{code}

    -

    -or prepend using -


    \pretoglossarypreamble  \pretoglossarypreamble[type]{code}

    -

    +

    +

    You can provide your own custom sort rule. For example, if you are using +XƎLATEX or LuaLATEX:

    +
    +\GlsXtrLoadResources[ +
      src=terms, % entries in terms.bib +
      sort=custom, % custom sort rule +
      sort-rule=% required with sort=custom +
      < æ;Æ < a;á;å;ä,Ä;Á;Å;Ä < b,B +
      < c;ć,C;Ć < d,D < e;é,E;É < f,F < g,G +
      < h,H < i;í,I;Í < j,J < l;ł,L;Ł < m,M < n,N +
      < o;ö;ø,O;Ö < p,P < q,Q < r,R < s;ś,S;Ś +
      < t,T < u;ú,U;Ú < v,V < w,W < x,X < y,Y < +
      z;ż,Z;Ż +
       +
    ] +
    +
    Remember that if you are using inputenc then extended characters, such as é or ø, +are active and will expand when written to the .aux file. So with PDFLATEX the +above would have to be changed to protect against expansion. Some of the options, +including sort-rule, may have Unicode characters indicated in the format +\uhexin the .aux file. bib2gls will recognise this format as indicating the +character given by the hexadecimal value ⟨hex⟩. The \u also needs protection from +expansion, so with a non-Unicode aware engine the above needs to be written as: +
    +
    +\GlsXtrLoadResources[ +
      src=terms, % entries in terms.bib +
      sort=custom, % custom sort rule +
      sort-rule=% required with sort=custom +
      < \string\uE6;\string\uC6 < a;\string\uE1;\string\uE5,\string\uE4,A;\string\uC1;\string\uC5;\string\uC4 < b,B +
      < c;\string\u0107,C;\string\u0106 < d,D < e;\string\uE9,E;\string\uC9 < f,F < g,G +
      < h,H < i;\string\uED,I;\string\uCD < j,J < l;\string\u0142,L;\string\u0141 < m,M < n,N + + + +
      < o;\string\uF6;\string\uF8,O;\string\uD6;\string\uD8 < p,P < q,Q < r,R < s;\string\u013F,S;\string\u015A +
      < t,T < u;\string\uFA,U;\string\uDA < v,V < w,W < x,X < y,Y < +
      z;\string\u017C,Z;\string\u017B +
       +
    ] +
    +
    +

    -

    Top

    10.1 Entry Fields

    -

    A field may now be used to store the name of a text-block command that takes a -single argument. The field is given by -


    \GlsXtrFmtField  \GlsXtrFmtField

    -

    -The default value is useri. Note that the value must be the control sequence name +

    Top

    9.3 Supplementary Commands

    +

    These commands are provided by glossaries-extra for use with bib2gls. +


    \glshex  \glshex

    +

    +This is just defined as \string\u, which is required when you need to indicate a +Unicode character in the form \uhex⟩ in some of the resource options (as described +above). +

    The information provided with \GlsXtrLoadResources is written to the .aux file +using

    +
    without the initial backslash. -

    For example: +class="cmtt-10">\protected@write\@auxout{\glsxtrresourceinit}{information} +

    +
    where ⟨information⟩ is the information to pass to bib2gls. The command in the +second argument +


    \glsxtrresourceinit  \glsxtrresourceinit

    +

    +may be used to temporarily redefine commands before the information is written to +the file. This does nothing by default, but may be redefined to allow the use of short +commands for convenience. For example, with:

    -
    -\newcommand*{\mtx}[1]{\boldsymbol{#1}} - 
    \newcommand*{\mtxinv}[1]{\mtx{#1}\sp{-1}} - 
    \newglossaryentry{matrix}{% - 
      name={matrix}, - 
      symbol={\ensuremath{\mtx{M}}}, - 
      plural={matrices}, - 
      user1={mtx}, - 
      description={rectangular array of values} +
    +\renewcommand{\glsxtrresourceinit}{\let\u\glshex} +
    +

    you can just use, for example, \uE6 instead of \string\uE6 in the custom rule. This +redefinition of \u is scoped so its original definition is restored after the write +operation. +

    It’s possible to specify label prefixes. For example, modifying the earlier +example: + + + +

    +
    +\documentclass{article} + 
    \usepackage[record,style=indexgroup]{glossaries-extra} + 
    \setabbreviationstyle{long-short-desc} + 
    \GlsXtrLoadResources + 
     [src={abbrvs},sort={letter-nocase},type=main, + 
      label-prefix={abr.}, + 
      group={Abbreviations}] + 
    \GlsXtrLoadResources + 
     [src={symbols},sort={use},type=main, + 
      label-prefix={sym.}, + 
      group={Symbols}] + 
    \GlsXtrLoadResources[src={terms},sort={en-GB},type=main + 
      label-prefix={trm.}] + 
    \begin{document} + 
    \gls{trm.bird} + 
    \gls{abr.shtml} + 
    \gls{sym.M} + 
    \printunsrtglossaries + 
    \end{document} +
    +

    If you do something like this, you may find it more convenient to define custom +commands that set the prefix. For example: + + + +

    +
    +\newcommand*{\sym}[2][]{\gls[#1]{sym.#2}} +
    +

    The problem with this is that the custom command \sym does allow for modifiers +(such as \gls* or \gls+). Instead you can use: +


    \glsxtrnewgls  \glsxtrnewgls[default options]{prefix}{cs}

    +

    +which defines the command ⟨cs⟩ that behaves like

    +
    +\glsmodifier[default options,options]{prefix⟩⟨label}[insert] +
    +
    For example: + + + +
    +\glsxtrnewgls{sym.}{\sym} +
    +

    or (to default to no hyperlinks) + + + +

    +
    +\glsxtrnewgls[hyper=false]{sym.}{\sym} +
    +

    now you can use \sym+{M} to behave like \gls+{sym.M}. +

    If you also want the plural and first letter upper case versions you can +use +


    \glsxtrnewglslike  \glsxtrnewglslike[default options]{prefix} +{\gls-like cs}{\glspl-like cs}{\Gls-like cs}{\Glspl-like cs} +

    +

    +For example: + + + +

    +
    +\glsxtrnewglslike[hyper=false]{idx.}{\idx}{\idxpl}{\Idx}{\Idxpl} +
    +

    For the all caps versions: +


    \glsxtrnewGLSlike  \glsxtrnewGLSlike[default options]{prefix} +{\GLS-like cs}{\GLSpl-like cs}

    +

    +For example: + + + +

    +
    +\glsxtrnewGLSlike[hyper=false]{idx.}{\IDX}{\IDXpl} +
    +

    +

    There’s an analogous command for \rgls: +


    \glsxtrnewrgls  \glsxtrnewrgls[default options]{prefix}{cs} +

    +

    +and for \rgls, \rglspl, \rGls and \rGlspl: +


    \glsxtrnewrglslike  \glsxtrnewrglslike[default options]{prefix} +{\rgls-like cs}{\rglspl-like cs}{\rGls-like cs}{\rGlspl-like cs} +

    +

    +and for the all caps: +


    \glsxtrnewrGLSlike  \glsxtrnewrGLSlike[default options]{prefix} +{\rGLS-like cs}{\rGLSpl-like cs}

    +

    +

    +

    +

    Top

    9.4 Record Counting

    +

    As from version 1.1 of bib2gls, you can save the total record count for each entry by +invoking bib2gls with the --record-count or --record-count-unit switches. +These options will ensure that when each entry is written to the .glstex file +bib2gls will additionally set the following internal fields for that entry: +

    +
      +
    • recordcount: set to the total number of records found for the entry; +
    • +
    • recordcount.counter⟩: set to the total number of records found for the + entry for the given counter.
    +

    If --record-count-unit is used then additionally:

    +
      +
    • recordcount.counter.location⟩: set to the total number of records + found for the entry for the given counter with the given location.
    + + + +

    Only use the unit counting option if the locations don’t contain any special characters. If +you really need it with locations that may contain formatting commands, then you +can try redefining: +


    \glsxtrdetoklocation  \glsxtrdetoklocation{location}

    +

    +so that it detokenizes ⟨location⟩ but take care when using \GlsXtrLocationRecordCount +with commands like \thepage as they can end up becoming detokenized too +early. +

    Note that the record count includes locations that bib2gls discards, such as +ignored records, duplicates and partial duplicates. It doesn’t include cross-reference +records. For example, if \gls{bird} is used twice on page 1, once on page 2 and +fours times on page 3, and \gls[counter=section]{bird} is used once in +section 3, then the total record count (stored in the recordcount field) is +2 + 1 + 4 + 1 = 8, the total for the page counter (stored in the recordcount.page +field) is 2 + 1 + 4 = 7, and the total for the section counter (stored in the +recordcount.section field) is 1. +

    With the unit counting on as well, the field recordcount.page.1 is set to +2, recordcount.page.2 is set to 1, recordcount.page.3 is set to 4 and +recordcount.section.3 is set to 1. +

    You can access these fields using the following commands which will expand to +the field value if set or to 0 if unset: +


    \GlsXtrTotalRecordCount  \GlsXtrTotalRecordCount{label}

    +

    +This expands to the total record count for the entry given by ⟨label⟩. + + + +

    +
    +\GlsXtrTotalRecordCount{bird} +
    +

    expands to 8. +


    \GlsXtrRecordCount  \GlsXtrRecordCount{label}{counter}

    +

    +This expands to the counter total for the entry given by ⟨label⟩ where ⟨counter⟩ is the +counter name. For example: + + + +

    +
    +\GlsXtrRecordCount{bird}{page} +
    +

    expands to 7 and + + + +

    +
    +\GlsXtrRecordCount{bird}{section} +
    +

    expands to 1. +


    \GlsXtrLocationRecordCount  \GlsXtrLocationRecordCount{label}{counter} +{location}

    +

    +This expands to the total for the given location. For example + + + +

    +
    +\GlsXtrLocationRecordCount{bird}{page}{3} +
    +

    expands to 4. Be careful about using \thepage in the ⟨location⟩ part. Remember that +due to TEX’s asynchronous output routine, \thepage may not be correct. +

    There are commands analogous to the entry counting commands like \cgls +and \cglsformat that are triggered by the record count. These are listed +below. +


    \rgls  \rglsmodifier[options]{label}[insert]

    +

    +


    \rglspl  \rglsplmodifier[options]{label}[insert]

    +

    +


    \rGls  \rGlsmodifier[options]{label}[insert]

    +

    +


    \rGlspl  \rGlsplmodifier[options]{label}[insert]

    +

    +


    \rGLS  \rGLSmodifier[options]{label}[insert]

    +

    +


    \rGLSpl  \rGLSplmodifier[options]{label}[insert]

    +

    +These commands check the recordcount attribute which, if set, should be a number. +For example: + + + +

    +
    +\glssetcategoryattribute{abbreviation}{recordcount}{1} +
    +

    For convenience, you can use +


    \GlsXtrSetRecordCountAttribute  \GlsXtrSetRecordCountAttribute{category +list}{n}

    +

    +to set the recordcount attribute to ⟨n⟩ for all the categories listed in ⟨category +list⟩. +

    The \rgls-like commands use +


    \glsxtrifrecordtrigger  \glsxtrifrecordtrigger{label}{trigger code} +{normal}

    +

    +to determine whether the \rgls-like command should behave like its \gls +counterpart (⟨normal⟩) or whether it should instead use ⟨trigger code⟩. +

    This command checks if the recordcount attribute is set. If not is just does +⟨normal⟩, otherwise it tests if +


    \glsxtrrecordtriggervalue  \glsxtrrecordtriggervalue{label}

    +

    +is greater than the value given in the recordcount attribute for that entry’s category. +If true, this does ⟨normal⟩ otherwise it does ⟨trigger code⟩. The default definition of the +trigger value command is: + + + +

    +
    +\newcommand*{\glsxtrrecordtriggervalue}[1]{% + 
     \GlsXtrTotalRecordCount{#1}% + 
    } +
    +

    The ⟨trigger code⟩ part writes a record with the format set to glstriggerrecordformat +(which bib2gls v1.1+ recognises as a special type of ignored location format) and +does ⟨trigger format⟩. Then it unsets the first use flag. Note that it doesn’t implement +the post-link hook. This ensures that the record count is correct on the next +run. +

    The ⟨trigger format⟩ depends on the \rgls-like command used and will be one of +the following: +


    \rglsformat  \rglsformat{label}{insert}

    +

    +


    \rglsplformat  \rglsplformat{label}{insert}

    +

    +


    \rGlsformat  \rGlsformat{label}{insert}

    +

    +


    \rGlsplformat  \rGlsplformat{label}{insert}

    +

    +


    \rGLSformat  \rGLSformat{label}{insert}

    +

    +


    \rGLSplformat  \rGLSplformat{label}{insert}

    +

    +These all behave much like their \cglsformat counterparts. If the entry’s regular +attribute is set or if the entry doesn’t have a long form, the first or first plural is +used, otherwise the long or long plural form is used. +

    You can use +


    \glsxtrenablerecordcount  \glsxtrenablerecordcount

    +

    +to redefine \gls, \glspl, \Gls, \Glspl, \GLS, \GLSpl to \rgls, \rglspl, \rGls, +\rGlspl, \rGLS, \rGLSpl, respectively, for convenience. +

    If you don’t want the entries that use ⟨trigger code⟩ to appear in the glossary, you +need to use the resource option trigger-type to assign them to another glossary. +For example: + + + +

    +
    +\documentclass{article} + 
    \usepackage[record]{glossaries-extra} + 
    \newignoredglossary{ignored} + 
    \GlsXtrLoadResources[ + 
     src=example-glossaries-acronym, + 
     trigger-type=ignored, + 
     category=abbreviation + 
    ] + 
    \glsxtrenablerecordcount + 
    \GlsXtrSetRecordCountAttribute{abbreviation}{1} + 
    \begin{document} + 
    \gls{lid}.  \gls{stc}. \gls{lid}.  \gls{aeu}. + 
    \gls{upa}. \gls{aeu}. + 
    \printunsrtglossaries + 
    \end{document} +
    +

    In the above, stc and upa both only have one record, so they are assigned to the +ignored glossary instead of the main one. + + + +

    +

    +

    Top

    10. Miscellaneous New Commands

    +

    The glossaries package provides \glsrefentry entry to cross-reference entries +when used with the entrycounter or subentrycounter options. The glossaries-extra +package provides a supplementary command +


    \glsxtrpageref  \glsxtrpageref{label}

    +

    +that works in the same way except that it uses \pageref instead of \ref. +

    You can copy an entry to another glossary using +


    \glsxtrcopytoglossary  \glsxtrcopytoglossary{entry-label}{glossary-type} +

    +

    +This appends ⟨entry-label⟩ to the end of the internal list for the glossary given by +⟨glossary-type⟩. Be careful if you use the hyperref package as this may cause duplicate +hypertargets. You will need to change \glolinkprefix to another value or disable +hyperlinks when you display the duplicate. Alternatively, use the new target key to +switch off the targets: + + + +

    +
    +\printunsrtglossary[target=false] +
    +

    +

    The glossaries package allows you to set preamble code for a given glossary +type using \setglossarypreamble. This overrides any previous setting. +With glossaries-extra (as from v1.12) you can instead append to the preamble +using +


    \apptoglossarypreamble  \apptoglossarypreamble[type]{code}

    +

    +or prepend using +


    \pretoglossarypreamble  \pretoglossarypreamble[type]{code}

    +

    +

    +

    Top

    10.1 Entry Fields

    +

    A field may now be used to store the name of a text-block command that takes a +single argument. The field is given by +


    \GlsXtrFmtField  \GlsXtrFmtField

    +

    +The default value is useri. Note that the value must be the control sequence name +without the initial backslash. +

    For example: + + + +

    +
    +\newcommand*{\mtx}[1]{\boldsymbol{#1}} + 
    \newcommand*{\mtxinv}[1]{\mtx{#1}\sp{-1}} + 
    \newglossaryentry{matrix}{% + 
      name={matrix}, + 
      symbol={\ensuremath{\mtx{M}}}, + 
      plural={matrices}, + 
      user1={mtx}, + 
      description={rectangular array of values}  
    }  
    \newglossaryentry{identitymatrix}{%  
      name={identity matrix}, @@ -12403,13 +14906,13 @@ class="cmti-10">without the initial backslash.  
       $\mtx{M}\mtxinv{M}=\glssymbol{identitymatrix}$}  
    }
    -

    -

    There are two commands provided that allow you to apply the command to an +

    +

    There are two commands provided that allow you to apply the command to an argument: -



    \glsxtrfmt  \glsxtrfmt[options]{label}{text}

    -

    +

    This effectively does

    \glslink[options]{label}{⟨⟨cs{text}} +class="cmtt-10">}{cs{text}}
    where ⟨cs⟩ is the command obtained from the control sequence name supplied in the @@ -12439,12 +14943,12 @@ class="cmtt-10">\glsxtrfmt
    will simply do ⟨text⟩. The default ⟨options⟩ are given by -



    \GlsXtrFmtDefaultOptions  \GlsXtrFmtDefaultOptions

    -

    +

    @@ -12454,12 +14958,12 @@ replacement text of \GlsXtrFmtDefaultOptions is prepended to the optional argument of \glslink. -

    For example: +

    For example:

    -
    +
    \[  
      \glsxtrfmt{matrix}{A}  
      \glsxtrfmt{matrixinv}{A} @@ -12467,34 +14971,34 @@ class="cmtt-10">\glslink.  
      \glssymbol{identitymatrix}  
    \]
    -

    If the default options are set to

    If the default options are set to noindex then \glsxtrfmt won’t index, but will create a hyperlink (if hyperref has been loaded). This can be changed so that it also + id="dx1-37004"> has been loaded). This can be changed so that it also suppresses the hyperlink:

    -
    +
    \renewcommand{\GlsXtrFmtDefaultOptions}{hyper=false,noindex}
    -

    -

    Note that

    +

    Note that \glsxtrfmt won’t work with PDF bookmarks. Instead you can use -



    \glsxtrentryfmt  \glsxtrentryfmt{label}{text}

    -

    +

    This uses \texorpdfstring and will simply expand to ⟨text⟩ within the PDF @@ -12505,17 +15009,17 @@ class="cmti-10">text⟩} if a control sequence name has been provided or just ⟨text⟩ otherwise. -

    The

    The glossaries package provides \glsaddstoragekey to add new keys. This command will cause an error if the key has already been defined. The glossaries-extra package provides a supplementary command that will only define the key if it doesn’t already exist: -



    \glsxtrprovidestoragekey  \glsxtrprovidestoragekey{key}{}{cs}

    -

    +

    If the key has already been defined, it will still provide the command given in the third argument ⟨cs⟩ (if it hasn’t already been defined). Unlike cs⟩ may be left empty if you’re happy to just use \glsfieldfetch to fetch the value of this new key. -

    You can test if a key has been provided with: -


    You can test if a key has been provided with: +


    \glsxtrifkeydefined  \glsxtrifkeydefined{key}{true}{false}

    -

    +

    This tests if ⟨key⟩ is available for use in the ⟨key⟩= list in the second argument of @@ -12554,22 +15058,22 @@ class="cmtt-10">\newglossaryentry (or the optional argument of commands l class="cmtt-10">\newabbreviation). The corresponding field may not have been set for any of the entries if no default was provided. -

    There are now commands provided to set individual fields. Note that +

    There are now commands provided to set individual fields. Note that these only change the specified field, not any related values. For example, changing the value of the text field won’t update the field won’t update the plural field. There are also + id="dx1-37009"> field. There are also some fields that should really only be set when entries are defined (such as the parent field). Unexpected results may occur if they are subsequently + id="dx1-37010"> field). Unexpected results may occur if they are subsequently changed. -



    \GlsXtrSetField  \GlsXtrSetField{label}{field}{value}

    -

    +

    Sets the field given by ⟨field⟩ to ⟨value⟩ for the entry given by ⟨

    \GlsXtrSetField uses -



    \glsxtrsetfieldifexists  \glsxtrsetfieldifexists{label}{}{code}

    -

    +

    where ⟨label⟩ is the entry label and ⟨code⟩ is the assignment code. -

    This command just uses

    This command just uses \glsdoifexists{label}{undefaction=warn. You can redefine + id="dx1-37014">. You can redefine \glsxtrsetfieldifexists to simply do ⟨code⟩ if you want to skip the existence check. Alternatively you can instead use -



    \glsxtrdeffield  \glsxtrdeffield{label}{replacement text}

    -

    +

    This simply uses etoolbox’s ’s \csdef without any checks. This command isn’t robust. There is also a version that uses \csedef instead: -



    \glsxtredeffield  \glsxtredeffield{label}{replacement text}

    -

    -


    +


    \gGlsXtrSetField  \gGlsXtrSetField{label}{field}{value}

    -

    +

    As \GlsXtrSetField but globally. -



    \eGlsXtrSetField  \eGlsXtrSetField{label}{field}{value}

    -

    +

    As \GlsXtrSetField but uses protected expansion. -



    \xGlsXtrSetField  \xGlsXtrSetField{label}{field}{value}

    -

    +

    As \gGlsXtrSetField but uses protected expansion. -



    \GlsXtrLetField  \GlsXtrLetField{label}{field}{cs}

    -

    +

    Sets the field given by ⟨field⟩ to the replacement text of ⟨cs⟩ for the entry given by ⟨label⟩ (using \let). -



    \csGlsXtrLetField  \csGlsXtrLetField{label}{}{cs name}

    -

    +

    As \GlsXtrLetField but the control sequence name is supplied instead. -



    \GlsXtrLetFieldToField  \GlsXtrLetFieldToField{label-1}{label-2}{field-2}

    -

    +

    Sets the field given by ⟨field-1⟩ for the entry given by ⟨label-1⟩ to the field given by @@ -12776,19 +15280,19 @@ class="cmti-10">code⟩} is still used, as for \GlsXtrSetField. -

    The

    The glossaries package provides \ifglshasfield to determine if a field has been + id="dx1-37024"> to determine if a field has been set. The glossaries-extra package provides a simpler version: -



    \glsxtrifhasfield  \glsxtrifhasfield{label}{}{false}

    -

    +

    (New to v1.19.) Unlike \ifglshasfield, this version doesn’t complain if the entry (given by ⟨true⟩ part is done otherwise it does ⟨false⟩. Within ⟨true⟩ you may use -



    \glscurrentfieldvalue  \glscurrentfieldvalue

    -

    +

    to access the field value. This command includes grouping which scopes the ⟨true⟩ and ⟨false⟩ parts. The starred version -



    \glsxtrifhasfield*  \glsxtrifhasfield*{label}{}{false}

    -

    +

    omits the implicit grouping. -

    The

    You can test if a field value equals a string using +


    \GlsXtrIfFieldEqStr  \GlsXtrIfFieldEqStr{label}{field}{text}{true} +{false}

    +

    +If the entry exists and has the given field set to the given text then this does ⟨true⟩ +otherwise it does ⟨false⟩. This is just a shortcut that uses \glsxtrifhasfield to test if +the field exists and then compares the replacement text of \glscurrentfieldvalue +with ⟨text⟩ using etoolbox’s \ifdefstring. +

    The glossaries package provides \glsfieldfetch which can be used to fetch the + id="dx1-37030"> which can be used to fetch the value of the given field and store it in a control sequence. The glossaries-extra package provides another way of accessing the field value: -



    \glsxtrusefield  \glsxtrusefield{entry-label}{field-label}

    -

    +

    This works in the same way as commands like \glsentrytext but the field label is specified in the first argument. Note that the ⟨field-label⟩ corresponds to the internal field tag, which isn’t always the same as the key name. See Table 4.1 of the glossaries + id="dx1-37032"> manual. No error occurs if the entry or field haven’t been defined. This command is not robust. -

    There is also a version that converts the first letter to uppercase (analogous to +

    There is also a version that converts the first letter to uppercase (analogous to \Glsentrytext): -



    \Glsxtrusefield  \Glsxtrusefield{entry-label}{field-label}

    -

    -

    If you want to use a field to store a list that can be used as an

    +

    If you want to use a field to store a list that can be used as an etoolbox internal + id="dx1-37034"> internal list, you can use the following command that adds an item to the field using etoolbox’s ’s \listcsadd: -



    \glsxtrfieldlistadd  \glsxtrfieldlistadd{label}{}{item}

    -

    +

    where ⟨label⟩ is the entry’s label, ⟨field⟩ is the entry’s field and ⟨item⟩ is the item to add. There are analogous commands that use \listgadd, \listeadd and + + + \listxadd: -



    \glsxtrfieldlistgadd  \glsxtrfieldlistgadd{label}{}{item}

    -

    -


    +


    \glsxtrfieldlisteadd  \glsxtrfieldlisteadd{label}{}{item}

    - - - -

    -


    +


    \glsxtrfieldlistxadd  \glsxtrfieldlistxadd{label}{}{item}

    -

    +

    You can then iterate over the list using: -



    \glsxtrfielddolistloop  \glsxtrfielddolistloop{label}{field}

    -

    +

    or -



    \glsxtrfieldforlistloop  \glsxtrfieldforlistloop{label}{} class="cmtt-10">{handler}

    -

    +

    that internally use \dolistcsloop and \forlistloop, respectively. -

    There are also commands that use

    There are also commands that use \ifinlistcs: -



    \glsxtrfieldifinlist  \glsxtrfieldifinlist{label}{} class="cmtt-10">{false}

    -

    +

    and \xifinlistcs -



    \glsxtrfieldxifinlist  \glsxtrfieldxifinlist{label}{true}{false}

    -

    -

    See the

    +

    See the etoolbox’s user manual for further details of these commands, in particular + id="dx1-37044">’s user manual for further details of these commands, in particular the limitations of \ifinlist. -

    When using the

    When using the record option, in addition to recording the usual location, you can + id="dx1-37045"> option, in addition to recording the usual location, you can also record the current value of another counter at the same time using the preamble-only command: -



    \GlsXtrRecordCounter  \GlsXtrRecordCounter{counter name}

    -

    +

    For example:

    -
    +
    \usepackage[record]{glossaries-extra}  
    \GlsXtrRecordCounter{section}
    -

    Each time an entry is referenced with commands like

    Each time an entry is referenced with commands like \gls or \glstext, the \gls{bird} is used in section 1.2 th -

    +
    \glsxtrfieldlistgadd{bird}{record.section}{1.2}
    -

    Note that there’s no key corresponding to this new

    Note that there’s no key corresponding to this new record.section field, but its value can be accessed with \glsxtrfielduse or the list can be iterated over with \glsxtrfielddolistloop etc. -

    +

    -

    Top

    10.2 Display All Entries Without Sorting or Indexing

    -



    \printunsrtglossary  \printunsrtglossary[options]

    -

    +

    This behaves like \printnoidxglossary but never sorts the entries and always lists all the defined entries for the given glossary (and doesn’t require \makenoidxglossaries). -

    There’s also a starred form -


    \makenoidxglossaries). If you want to use one of the tabular-like styles with +\printunsrtglossary, make sure you load glossaries-extra-stylemods which modifies +the definition of \glsgroupskip to avoid the “Incomplete \iftrue” error that may +otherwise occur. +

    There’s also a starred form +


    \printunsrtglossary*  \printunsrtglossary*[options]{code}

    -

    +

    which is equivalent to

    \endgroup class="cmtt-10">\glossarypreamble, the supplied ⟨code⟩ is done before the glossary header. -

    This means you now have the option to simply list all entries on the first +

    This means you now have the option to simply list all entries on the first LATEX run without the need for a post-processor, however there will be no number list in this case, as that has to be set by a post-processor such as bib2gls (see (see §9 bib2gls: Managing Reference Databases). -

    No attempt is made to gather hierarchical elements. If child entries aren’t defined +

    No attempt is made to gather hierarchical elements. If child entries aren’t defined immediately after their parent entry, they won’t be together in the glossary when using \printunsrtglossary.
    -

    -

    If you have any entries with the

    + + + +

    If you have any entries with the see key set, you will need the key set, you will need the glossaries package -option seenoindex=ignore or seenoindex=warn to prevent an error occurring from the + id="dx1-38010"> package +option seenoindex=ignore or seenoindex=warn to prevent an error occurring from the automated \glssee normally triggered by this key. The record=only package option + id="dx1-38013"> package option will automatically deal with this. -

    For example: +

    For example:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \newglossaryentry{zebra}{name={zebra},description={stripy animal}} @@ -13195,99 +15748,160 @@ will automatically deal with this.  
    \printunsrtglossaries  
    \end{document}
    -

    In the above, zebra will be listed before ant as it was defined first. -

    If you allow document definitions with the

    In the above, zebra will be listed before ant as it was defined first. +

    If you allow document definitions with the docdefs option, the document will + id="dx1-38014"> option, the document will require a second LATEX run if the entries are defined after \printunsrtglossary. -

    The optional argument is as for

    The optional argument is as for \printnoidxglossary (except for the sort key, + id="dx1-38015"> key, which isn’t available). -

    All glossaries may be displayed in the order of their definition using: -


    All glossaries may be displayed in the order of their definition using: +


    \printunsrtglossaries  \printunsrtglossaries

    -

    +

    which is analogous to \printnoidxglossaries. This just iterates over all defined glossaries (that aren’t on the ignored list) and does \printunsrtglossary[type=⟨type⟩]. -

    The \printunsrtglossary command internally uses -


    To avoid complications caused by tabular-like glossary styles, \printunsrtglossary +iterates over all entries in the selected glossary and appends the appropriate code to +an internal command. Once the construction of this command is complete, then it’s +performed to display the glossary. This puts the loop outside the style code. For +convenience, there’s a hook used within the loop: +


    \printunsrtglossaryentryprocesshook  \printunsrtglossaryentryprocesshook +{label}

    +

    +This hook should not display any content, but may be used to perform calculations. +For example, to calculate widths. Within this hook you can use: +


    \printunsrtglossaryskipentry  \printunsrtglossaryskipentry

    +

    +to skip the current entry. This will prevent the entry from being added to the internal +command. +

    There’s another hook immediately before the internal command containing the +glossary code is performed: +


    \printunsrtglossarypredoglossary  \printunsrtglossarypredoglossary +

    +

    + + + +

    The internal command uses +


    \printunsrtglossaryhandler  \printunsrtglossaryhandler{label}

    -

    -for each item in the list, where ⟨

    +to display each item in the list, where ⟨label⟩ is the current label. -

    By default this just does -


    By default the handler just does +


    \glsxtrunsrtdo  \glsxtrunsrtdo{label}

    -

    +

    which determines whether to use \glossentry or \subglossentry and checks the location and and loclist fields for the fields for the number list. -

    You can redefine the handler if required. -

    If you redefine the handler to exclude entries, you may end up with an empty +

    You can redefine the handler if required. For example, you may want to filter +entries according to the category label. You can test if a label is contained in a +comma-separated list of labels using: +


    \glsxtriflabelinlist  \glsxtriflabelinlist{label}{label list}{true} +{false}

    +

    +The ⟨label⟩ and ⟨label list⟩ will be fully expanded. +

    If you redefine the handler to exclude entries, you may end up with an empty glossary. This could cause a problem for the list-based styles.
    -

    -

    For example, if the preamble includes: +

    +

    For example, if the preamble includes:

    -
    +
    \usepackage[record,style=index]{glossaries-extra}  
    \GlsXtrRecordCounter{section}
    -

    then you can print the glossary but first redefine the handler to only select entries +

    then you can print the glossary but first redefine the handler to only select entries that include the current section number in the record.section field:

    -
    +
    \renewcommand{\printunsrtglossaryhandler}[1]{%  
      \glsxtrfieldxifinlist{#1}{record.section}{\thesection}  
      {\glsxtrunsrtdo{#1}}%  
      {}%  
    }
    -

    -

    Alternatively you can use the starred form of

    +

    Alternatively you can use the starred form of \printunsrtglossary which will localise the change:

    -
    +
    \printunsrtglossary*{%  
      \renewcommand{\printunsrtglossaryhandler}[1]{%  
        \glsxtrfieldxifinlist{#1}{record.section}{\thesection} @@ -13296,10 +15910,10 @@ localise the change:  
      }%  
    }
    -

    -

    If you are using the

    +

    If you are using the hyperref package and want to display the same glossary more + id="dx1-38028"> package and want to display the same glossary more than once, you can also add a temporary redefinition of \glolinkprefix to avoid duplicate hypertarget names. For example: @@ -13307,7 +15921,7 @@ duplicate hypertarget names. For example:

    -
    +
    \printunsrtglossary*{%  
      \renewcommand{\printunsrtglossaryhandler}[1]{%  
        \glsxtrfieldxifinlist{#1}{record.section}{\thesection} @@ -13323,7 +15937,7 @@ duplicate hypertarget names. For example:  
      }%  
    }
    -

    Note that this will cause a problem if your descriptions contain commands like

    Note that this will cause a problem if your descriptions contain commands like \gls that need to link an entry that doesn’t appear in the summary. In this case, it’s a better approach to use: @@ -13331,7 +15945,7 @@ better approach to use:

    -
    +
    \printunsrtglossary*{%  
      \renewcommand{\printunsrtglossaryhandler}[1]{%  
        \glsxtrfieldxifinlist{#1}{record.section}{\thesection} @@ -13347,14 +15961,14 @@ better approach to use:  
      }%  
    }
    -

    -

    If it’s a short summary at the start of a section, you might also want to suppress +

    +

    If it’s a short summary at the start of a section, you might also want to suppress the glossary header and add some vertical space afterwards:

    -
    +
    \printunsrtglossary*{%  
      \renewcommand{\printunsrtglossaryhandler}[1]{%  
        \glsxtrfieldxifinlist{#1}{record.section}{\thesection} @@ -13372,12 +15986,12 @@ the glossary header and add some vertical space afterwards:  
      \appto\glossarypostamble{\glspar\medskip\glspar}%  
    }
    -

    -

    There’s a shortcut command that essentially does this: -


    +

    There’s a shortcut command that essentially does this: +


    \printunsrtglossaryunit  \printunsrtglossaryunit[options]{counter name}

    -

    +

    The above example can simply be replaced with:

    -
    +
    \printunsrtglossaryunit{section}
    -

    -

    This shortcut command is actually defined to use

    +

    This shortcut command is actually defined to use \printunsrtglossary* with -



    \printunsrtglossaryunitsetup  \printunsrtglossaryunitsetup{counter name}

    -

    +

    so if you want to just make some minor modifications you can do

    -
    +
    \printunsrtglossary*{\printunsrtglossaryunitsetup{section}%  
      \renewcommand*{\glossarysection}[2][]{\subsection*{Summary}}%  
    }
    -

    which will start the list with a subsection header with the title “Summary” +

    which will start the list with a subsection header with the title “Summary” (overriding the glossary’s title). -

    Note that this shortcut command is only available with the

    Note that this shortcut command is only available with the record (or + id="dx1-38031"> (or record=alsoindex) package option. -

    This temporary change in the hypertarget prefix means you need to explicitly use + id="dx1-38032">) package option. +

    This temporary change in the hypertarget prefix means you need to explicitly use \hyperlink to create a link to it as commands like \gls will try to link to the target @@ -13441,32 +16055,222 @@ the front or back matter) which can be the target for all glossary references an just use \printunsrtglossaryunit for a quick summary at the start of a section etc. -

    +

    -

    Top

    10.3 Standalone Definitions

    +

    It may be that you don’t want a list but would rather display entry details +throughout the document. You can simply do \glsentryname followed by +\glsentrydesc. (Remember that if you don’t want a sorted list, use sort=none to +skip the construction of the sort field.) For example, in the preamble provide a +custom command: + + + +

    +
    +\newcommand{\displayterm}[1]{% + 
     \par\medskip\par\noindent + 
     Definition: \glsentryname{#1}.\par + 
     \glsentrydesc{#1} + 
     \par\medskip + 
    } +
    +

    define your entries + + + +

    +
    +\newglossaryentry{function}{name={function}, + 
      description={a relation or expression involving variables} + 
    } +
    +

    and then later in the text: + + + +

    +
    +\displayterm{function} +
    +

    +

    However, if may be that you want to use hyperref and have commands like \gls +link back to the place where the term is described. Instead of using \glsentryname +use +


    \glsxtrglossentry  \glsxtrglossentry{label}

    +

    +where ⟨label⟩ is the entry’s label. +

    This is designed to behave much like the way the name is displayed in the +glossary. It performs the following:

    +
      +
    • Defines \glscurrententrylabel to the entry’s label. This is usually + done at the start of the glossary style commands \glossentry and + \subglossentry and may be used by hooks, such as the post-name + hooks. Here the definition is localised so that it’s only available for use in + \glossentryname. +
    • +
    • Defines \currentglossary to the entry’s glossary type. This is usually + done at the start of commands like \printglossary and may be used by + style hooks. Here the definition is localised so that it’s only available for + use in \glsentryitem and \glssubentryitem. +
    • +
    • Increments and display the entry counters if the entrycounter or subentrycounter + package options are set. If the entry has a parent, then this does +
        +
      • \glssubentryitem{label}
      +

      otherwise it does

      +
        +
      • \glsentryitem{label}
      +
    • +
    • Sets the hyper-target if supported (using \glstarget). +
    • +
    • Displays the entry name using \glossentryname{label}. Remember that this + command uses \glsnamefont or picks up the style from category attributes + such as glossnamefont.
    +

    This means that my custom command can be changed to: + + + +

    +
    +\newcommand{\displayterm}[1]{% + 
     \par\medskip\par\noindent + 
     Definition: \glsxtrglossentry{#1}.\par + 
     \glsentrydesc{#1} + 
     \par\medskip + 
    } +
    +

    If you wanted numbered definitions, then use the package option entrycounter and +remove the colon: + + + +

    +
    +\newcommand{\displayterm}[1]{% + 
     \par\medskip\par\noindent + 
     Definition \glsxtrglossentry{#1}.\par + 
     \glsentrydesc{#1} + 
     \par\medskip + 
    } +
    +

    The counter label uses a dot after the number by default but this can be changed to +a colon: + + + +

    +
    +\renewcommand*{\glsentrycounterlabel}{\theglossaryentry:\space}% +
    +

    You can now not only use \gls to link back to the definition but also use +\glsrefentry to reference the counter and \glsxtrpageref to reference the page +number. +

    You can also use \glsxtrglossentry within section headings. For example: + + + +

    +
    +\section{\glsxtrglossentry{function}} +
    +

    This will use \glsentryname in PDF bookmarks (if \texorpdfstring is defined) +and will use \glsxtrheadname in page headers and table of contents. (If you’re using +a page style or table of contents that doesn’t use \markright or \markbook or +\@starttoc then you need to insert \glsxtrmarkhook and \@glsxtrinmark at the +start of the header or table of contents either scoped or afterwards cancelled with +\@glsxtrnotinmark and \glsxtrrestoremarkhook.) +

    +

    +

    Top

    10.4 Entry Aliases

    -

    An entry can be made an alias of another entry using the

    An entry can be made an alias of another entry using the alias key. The + id="dx1-40001"> key. The value should be the label of the other term. There’s no check for the other’s existence when the aliased entry is defined. This is to allow the possibility of defining the other entry after the aliased entry. (For example, when used with bib2gls.) -

    If an entry ⟨.) +

    If an entry ⟨entry-1⟩ is made an alias of ⟨entry-2⟩ then:

    • If the see field wasn’t provided when ⟨ field wasn’t provided when ⟨entry-1⟩ was defined, the alias key will + id="dx1-40005"> key will automatically trigger
      }
    • If the hyperref package has been loaded then package has been loaded then \gls{entry-1} will link to @@ -13488,31 +16292,28 @@ class="cmtt-10">} will link to class="cmti-10">entry-2⟩’s target. (Unless the targeturl attribute has been set for ⟨ attribute has been set for ⟨entry-1⟩’s category.) - - -
    • With record=off or or record=alsoindex, the , the noindex setting will automatically + id="dx1-40010"> setting will automatically be triggered when referencing ⟨entry-1⟩ with commands like \gls or \glstext. This prevents ⟨entry-1⟩ from have a location list (aside from the cross-reference added with \glssee) unless it’s been explicitly @@ -13520,99 +16321,100 @@ class="cmtt-10">\glssee) unless it’s been explicitly class="cmtt-10">\glsadd or if the indexing has been explicitly set using noindex=false. -

      Note that with

      Note that with record=only, the location list for aliased entries is controlled + id="dx1-40012">, the location list for aliased entries is controlled with bib2gls’s settings.

    -

    The index suppression trigger is performed by -


    ’s settings.

    +

    The index suppression trigger is performed by +


    \glsxtrsetaliasnoindex  \glsxtrsetaliasnoindex

    -

    +

    This is performed after the default options provided by \GlsXtrSetDefaultGlsOpts + id="dx1-40017"> have been set. With record=only, , \glsxtrsetaliasnoindex will default to do nothing. -

    Within the definition of

    Within the definition of \glsxtrsetaliasnoindex you can use -



    \glsxtrindexaliased  \glsxtrindexaliased

    -

    +

    to index ⟨entry-2⟩. -

    The index suppression command can be redefined to index the main term instead. +

    The index suppression command can be redefined to index the main term instead. For example:

    -
    +
    \renewcommand{\glsxtrsetaliasnoindex}{%  
     \glsxtrindexaliased  
     \setkeys{glslink}{noindex}%  
    }
    -

    -

    The value of the

    +

    The value of the alias field can be accessed using -


    field can be accessed using +


    \glsxtralias  \glsxtralias{label}

    -

    +

    -

    -

    +

    Top

    11. Supplemental Packages

    -

    The

    The glossaries bundle provides additional support packages glossaries-prefix (for + id="dx1-41001"> (for prefixing) and glossaries-accsupp (for accessibility support). These packages aren’t + id="dx1-41002"> (for accessibility support). These packages aren’t automatically loaded.

    -

    Top

    11.1 Prefixes or Determiners

    -

    If prefixing is required, you can simply load

    If prefixing is required, you can simply load glossaries-prefix after after glossaries-extra. For example:

    -
    +
    \documentclass{article}  
    \usepackage{glossaries-extra}  
    \usepackage{glossaries-prefix} @@ -13627,32 +16429,32 @@ example:  
    \printglossaries  
    \end{document}
    -

    -

    +

    +

    -

    Top

    11.2 Accessibility Support

    -

    The

    The glossaries-accsupp needs to be loaded before glossaries-extra or through the - package needs to be loaded before glossaries-extra or through +the accsupp package option: + id="dx1-43002"> package option:

    -
    +
    \usepackage[accsupp]{glossaries-extra}
    -

    If you don’t load

    If you don’t load glossaries-accsupp or you load or you load glossaries-accsupp after after glossaries-extra the new \glsaccessxxx⟩ commands described below will simply be equiv corresponding \glsentryxxx⟩ commands. -

    The following

    The following \glsaccessxxx⟩ commands add accessibility information wrapped around the corresponding \glsentryxxx⟩ commands. There is no check for existence of the entry nor do any of these commands add formatting, hyperlinks or indexing information. -



    \glsaccessname  \glsaccessname{label}

    -

    +

    This displays the value of the name field for the entry identified by ⟨ field for the entry identified by ⟨label⟩. -

    If the

    If the glossaries-accsupp package isn’t loaded, this is simply defined as: + id="dx1-43007"> package isn’t loaded, this is simply defined as:

    -
    +
    \newcommand*{\glsaccessname}[1]{\glsentryname{#1}}
    -

    otherwise it’s defined as: +

    otherwise it’s defined as:

    -
    +
    \newcommand*{\glsaccessname}[1]{%  
      \glsnameaccessdisplay  
      {% @@ -13704,38 +16506,38 @@ class="cmss-10">glossaries-accsupp  {#1}%  
    }
    -

    (

    (\glsnameaccessdisplay is defined by the is defined by the glossaries-accsupp package.) The first + id="dx1-43009"> package.) The first letter upper case version is: -



    \Glsaccessname  \Glsaccessname{label}

    -

    +

    Without the glossaries-accsupp package this is just defined as: + id="dx1-43011"> package this is just defined as:

    -
    +
    \newcommand*{\Glsaccessname}[1]{\Glsentryname{#1}}
    -

    With the

    With the glossaries-accsupp package this is defined as: + id="dx1-43012"> package this is defined as:

    -
    +
    \newcommand*{\Glsaccessname}[1]{%  
      \glsnameaccessdisplay  
      {% @@ -13744,299 +16546,299 @@ class="cmss-10">glossaries-accsupp  {#1}%  
    }
    -

    -

    The following commands are all defined in an analogous manner. -


    +

    The following commands are all defined in an analogous manner. +


    \glsaccesstext  \glsaccesstext{label}

    -

    +

    This displays the value of the text field. -


    field. +


    \Glsaccesstext  \Glsaccesstext{label}

    -

    +

    This displays the value of the text field with the first letter converted to upper + id="dx1-43016"> field with the first letter converted to upper case. -



    \glsaccessplural  \glsaccessplural{label}

    -

    +

    This displays the value of the plural field. -


    field. +


    \Glsaccessplural  \Glsaccessplural{label}

    -

    +

    This displays the value of the plural field with the first letter converted to upper + id="dx1-43020"> field with the first letter converted to upper case. -



    \glsaccessfirst  \glsaccessfirst{label}

    -

    +

    This displays the value of the first field. -


    field. +


    \Glsaccessfirst  \Glsaccessfirst{label}

    -

    +

    This displays the value of the first field with the first letter converted to upper + id="dx1-43024"> field with the first letter converted to upper case. -



    \glsaccessfirstplural  \glsaccessfirstplural{label}

    -

    +

    This displays the value of the firstplural field. -


    field. +


    \Glsaccessfirstplural  \Glsaccessfirstplural{label}

    -

    +

    This displays the value of the firstplural field with the first letter converted to upper + id="dx1-43028"> field with the first letter converted to upper case. -



    \glsaccesssymbol  \glsaccesssymbol{label}

    -

    +

    This displays the value of the symbol field. -


    field. +


    \Glsaccesssymbol  \Glsaccesssymbol{label}

    -

    +

    This displays the value of the symbol field with the first letter converted to upper + id="dx1-43032"> field with the first letter converted to upper case. -



    \glsaccesssymbolplural  \glsaccesssymbolplural{label}

    -

    +

    This displays the value of the symbolplural field. -


    field. +


    \Glsaccesssymbolplural  \Glsaccesssymbolplural{label}

    -

    +

    This displays the value of the symbolplural field with the first letter converted to + id="dx1-43036"> field with the first letter converted to upper case. -



    \glsaccessdesc  \glsaccessdesc{label}

    -

    +

    This displays the value of the desc field. -


    field. +


    \Glsaccessdesc  \Glsaccessdesc{label}

    -

    +

    This displays the value of the desc field with the first letter converted to upper + id="dx1-43040"> field with the first letter converted to upper case. -



    \glsaccessdescplural  \glsaccessdescplural{label}

    -

    +

    This displays the value of the descplural field. -


    field. +


    \Glsaccessdescplural  \Glsaccessdescplural{label}

    -

    +

    This displays the value of the descplural field with the first letter converted to upper + id="dx1-43044"> field with the first letter converted to upper case. -



    \glsaccessshort  \glsaccessshort{label}

    -

    +

    This displays the value of the short field. -


    field. +


    \Glsaccessshort  \Glsaccessshort{label}

    -

    +

    This displays the value of the short field with the first letter converted to upper + id="dx1-43048"> field with the first letter converted to upper case. -



    \glsaccessshortpl  \glsaccessshortpl{label}

    -

    +

    This displays the value of the shortplural field. -


    field. +


    \Glsaccessshortpl  \Glsaccessshortpl{label}

    -

    +

    This displays the value of the shortplural field with the first letter converted to upper + id="dx1-43052"> field with the first letter converted to upper case. -



    \glsaccesslong  \glsaccesslong{label}

    -

    +

    This displays the value of the long field. -


    field. +


    \Glsaccesslong  \Glsaccesslong{label}

    -

    +

    This displays the value of the long field with the first letter converted to upper + id="dx1-43056"> field with the first letter converted to upper case. -



    \glsaccesslongpl  \glsaccesslongpl{label}

    -

    +

    This displays the value of the longplural field. -


    field. +


    \Glsaccesslongpl  \Glsaccesslongpl{label}

    -

    +

    This displays the value of the longplural field with the first letter converted to upper + id="dx1-43060"> field with the first letter converted to upper case.

    -

    -

    +

    Top

    12. Sample Files

    -

    The following sample files are provided with this package: +

    The following sample files are provided with this package:

    sample.tex
    General abbreviations. sample-acronym.tex
    Acronyms aren’t initialisms and don’t expand on first use.
    @@ -14114,7 +16916,7 @@ class="description">Another initialisms example. sample-postlink.tex
    Automatically inserting text after the link-text produced by commands like \gls (outside of hyperlink, if present). @@ -14128,28 +16930,28 @@ class="cmbx-10">sample-autoindex.tex
    Using the dualindex and and indexname attributes to + id="dx1-44004"> attributes to automatically add glossary entries to the index (in addition to the glossary location list).
    sample-autoindex-hyp.tex
    As previous but uses hyperref. + id="dx1-44006">.
    sample-nested.tex
    Using \gls within the value of the within the value of the name key. + id="dx1-44008"> key.
    sample-entrycount.tex
    sample-external.tex
    Uses the targeturl attribute to allow for entries that + id="dx1-44009"> attribute to allow for entries that should link to an external URL rather than to an internal glossary. @@ -14205,38 +17007,38 @@ class="cmtt-10">\glsxtrfmt. class="cmbx-10">sample-alias.tex
    Uses the alias key. (See key. (See §10.3 §10.4 Entry Aliases.)
    sample-alttree.tex
    Uses the glossaries-extra-stylemods package with the package with the alttree + id="dx1-44012"> style (see §2.8.3 The §2.9.3 The glossaries-extra-stylemods Package).
    sample-alttree-sym.tex
    Another alttree example that measures the symbol + id="dx1-44013"> example that measures the symbol widths.
    sample-alttree-marginpar.tex
    Another alttree example that puts the + id="dx1-44014"> example that puts the number list in the margin.
    sample-onthefly.tex
    Using on-the-fly commands. Terms with accents must have the name key explicitly set. + id="dx1-44016"> key explicitly set.
    sample-onthefly-xetex.tex
    Using on-the-fly commands with XƎLATEX. Terms with UTF-8 characters don’t need to have the name key explicitly + id="dx1-44017"> key explicitly set. Terms that contain commands must have the name key explicitly set + id="dx1-44018"> key explicitly set with the commands removed from the label.
    Tries to emulate the previous sample file for use with LATEX through the starred version of \GlsXtrEnableOnTheFly. + id="dx1-44019">. This is a bit iffy and may not always work. Terms that contain commands must have the name key explicitly set with the commands removed from + id="dx1-44020"> key explicitly set with the commands removed from the label.
    sample-accsupp.tex
    Integrate glossaries-accsupp. + id="dx1-44021">.
    sample-prefix.tex
    Integrate glossaries-prefix. + id="dx1-44022">.
    sample-suppl-main.tex
    Uses thevalue to reference a location in the + id="dx1-44023"> to reference a location in the supplementary file sample-suppl.tex.
    @@ -14295,7 +17097,7 @@ class="cmbx-10">sample-suppl-main-hyp.tex
    A more complicated version to the above that uses the hyperref package to reference a location in the supplementary file + id="dx1-44024"> package to reference a location in the supplementary file sample-suppl-hyp.tex. @@ -14305,95 +17107,95 @@ class="cmtt-10">sample-suppl-hyp.tex. -

    -

    +

    Top

    13. Multi-Lingual Support

    -

    There’s only one command provided by

    There’s only one command provided by glossaries-extra that you’re likely to want to change in your document and that’s \abbreviationsname ( (§1.2 New or Modified Package Options) if you use the abbreviations package option to + id="dx1-45002"> package option to automatically create the glossary labelled abbreviations. If this command doesn’t already exist, it will be defined to “Abbreviations” if babel hasn’t + id="dx1-45003"> hasn’t been loaded, otherwise it will be defined as \acronymname (provided by glossaries). -

    You can redefine it in the usual way. For example: +

    You can redefine it in the usual way. For example:

    -
    +
    \renewcommand*{\abbreviationsname}{List of Abbreviations}
    -

    Or using

    Or using babel or or polyglossia captions hook: + id="dx1-45005"> captions hook:

    -
    +
    \appto\captionsenglish{%  
     \renewcommand*{\abbreviationsname}{List of Abbreviations}%  
    }
    -

    -

    Alternatively you can use the

    +

    Alternatively you can use the title key when you print the list of abbreviations. + id="dx1-45006"> key when you print the list of abbreviations. For example:

    -
    +
    \printabbreviations[title={List of Abbreviations}]
    -

    or +

    or

    -
    +
    \printglossary[type=abbreviations,title={List of Abbreviations}]
    -

    -

    The other fixed text commands are the diagnostic messages, which shouldn’t +

    +

    The other fixed text commands are the diagnostic messages, which shouldn’t appear in the final draft of your document. -

    The

    The glossaries-extra package has the facility to load language modules if they exist, but won’t warn if they don’t. -

    If you want to write your own language module, you just need to create a file +

    If you want to write your own language module, you just need to create a file called glossariesxtr-lang.ldf, where ⟨lang⟩ is the language name (see the tracklang + id="dx1-45007"> package). For example, glossariesxtr-french.ldf. -

    The simplest code for this file is: +

    The simplest code for this file is:

    -
    +
    \ProvidesGlossariesExtraLang{french}[2015/12/09 v1.0]  
    \newcommand*{\glossariesxtrcaptionsfrench}{%  
     \def\abbreviationsname{Abr\'eviations}% @@ -14419,8 +17221,8 @@ class="cmtt-10">glossariesxtr-french.ldf.  
      \glossariesxtrcaptionsfrench  
    }
    -

    -

    You can adapt this for other languages by replacing all instances of the language +

    +

    You can adapt this for other languages by replacing all instances of the language identifier french and the translated text Abr\’eviations as appropriate. This EX’s path so that it can be found by class="cmss-10">glossaries-extra. You might also want to consider uploading it to CTAN so that it can be useful to others. (Please don’t send it to me. I already have more packages than I am able to maintain.) -

    If you additionally want to provide translations for the diagnostic messages used +

    If you additionally want to provide translations for the diagnostic messages used when a glossary is missing, you need to redefine the following commands: -



    \GlsXtrNoGlsWarningHead  \GlsXtrNoGlsWarningHead{label}{file}

    -

    +

    This produces the following text in English:

    -

    This document is incomplete. The external file associated with the +

    This document is incomplete. The external file associated with the glossary ‘⟨label⟩’ (which should be called ⟨file⟩) hasn’t been created.

    -



    \GlsXtrNoGlsWarningEmptyStart  \GlsXtrNoGlsWarningEmptyStart

    -

    +

    This produces the following text in English:

    -

    This has probably happened because there are no entries defined in +

    This has probably happened because there are no entries defined in this glossary.

    -



    \GlsXtrNoGlsWarningEmptyMain  \GlsXtrNoGlsWarningEmptyMain

    -

    +

    This produces the following text in English:

    -

    If you don’t want this glossary, add

    If you don’t want this glossary, add nomain to your package option list when you load glossaries-extra.sty. For example:

    -



    \GlsXtrNoGlsWarningEmptyNotMain  \GlsXtrNoGlsWarningEmptyNotMain{label}

    -

    +

    This produces the following text in English:

    -

    Did you forget to use

    Did you forget to use type=label⟩ when you defined your entries? If you tried to load entries into this glossary with ] as the optional argument? If you did, check that the definitions in the file you loaded all had the type set to \glsdefaulttype.

    -



    \GlsXtrNoGlsWarningCheckFile  \GlsXtrNoGlsWarningCheckFile{file}

    -

    +

    This produces the following text in English:

    -

    Check the contents of the file ⟨

    Check the contents of the file ⟨file⟩. If it’s empty, that means you haven’t indexed any of your entries in this glossary (using commands like \gls or \glsadd) so this list can’t be generated. If the file isn’t empty, the document build process hasn’t been completed.

    -



    \GlsXtrNoGlsWarningMisMatch  \GlsXtrNoGlsWarningMisMatch

    -

    +

    This produces the following text in English:

    -

    You need +

    You need to either replace \makenoidxglossaries with \makeglossaries or @@ -14538,17 +17340,17 @@ class="cmtt-10">\printglossaries) class="cmtt-10">\printnoidxglossary (or \printnoidxglossaries) and then rebuild this document.

    -



    \GlsXtrNoGlsWarningNoOut  \GlsXtrNoGlsWarningNoOut{file}

    -

    +

    This produces the following text in English:

    -

    The file ⟨

    The file ⟨file⟩ doesn’t exist. This most likely means you haven’t used \makeglossaries or you have used \nofiles. If this is just a draft version of the document, you can suppress this message using the nomissingglstext package option.

    -



    \GlsXtrNoGlsWarningTail  \GlsXtrNoGlsWarningTail

    -

    +

    This produces the following text in English:

    -

    This message will be removed once the problem has been fixed.

    -


    This message will be removed once the problem has been fixed.

    +


    \GlsXtrNoGlsWarningBuildInfo  \GlsXtrNoGlsWarningBuildInfo

    -

    +

    This is advice on how to generate the glossary files. See the documented code (glossaries-extra-code.pdf) for further details. -



    \GlsXtrNoGlsWarningAutoMake  \GlsXtrNoGlsWarningAutoMake{label}

    -

    -This is the message produced when the automake option is used, but the document +

    +This is the message produced when the automake option is used, but the document needs a rerun or the shell escape setting doesn’t permit the execution of the external application. This command also generates a warning in the transcript file. See the documented code for further details. @@ -14602,22 +17405,22 @@ documented code for further details.

    Top

    Glossary

    + id="x1-4600013">Glossary

    bib2gls
    A command line Java application that selects entries from a .bib file and converts them to glossary definitions (like bibtex but also performs hierarchical sorting and collation, thus omitting the need for xindy or makeindex). Further details at: http://www.dickimaw-books.com/software/bib2gls/. 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. @@ -14635,80 +17438,80 @@ class="description">The location of the entry in the document. This defaults to 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, + id="dx1-46009">, \glspl, , \Glspl, , \GLSpl or or \glsdisp. + id="dx1-46013">.
    first use flag
    A conditional that determines whether or not the entry has been used according to the rules of first use.
    first use text
    The text that is displayed on first use, which is governed by the + id="dx1-46017">first use, which is governed by the first and and firstplural keys of keys of \newglossaryentry. (May be overridden by + id="dx1-46020">. (May be overridden by \glsdisp.) + id="dx1-46021">.)
    link-text
    The text produced by commands such as \gls. It may or may not + id="dx1-46023">. It may or may not have a hyperlink to the glossary.
    location list
    A list of entry locations. See number list.
    makeglossaries
    A custom designed Perl script interface provided with the glossaries package to run xindy or makeindex according to the document settings. @@ -14717,3190 +17520,3708 @@ class="cmtt-10">makeindex according to the document
    makeglossaries-lite.lua
    makeglossaries-lite
    A custom designed Lua script interface to xindy - and makeindex provided with the glossaries package. This is a cut-down + id="dx1-46032">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. Note that TeX Live creates a symbolic link - called makeglossaries-lite (without the .lua extension) to the actual - makeglossaries-lite.lua script. + use the Perl script instead. This script is distributed in the source code + on CTAN 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, and TEX distributions on Windows convert the script to an + executable makeglossaries-lite.exe.
    makeindex
    An indexing application.
    number list
    A list of entry locations (also called a location list). The number - list can be suppressed using the nonumberlist package option. + list can be suppressed using the nonumberlist package option.
    xindy
    An flexible indexing application with multilingual support written in Perl.

    Index

    + id="x1-4700013">Index

    A

    abbreviation styles (deprecated):
        footnote-em  1
    +href="glossaries-extra-manual.html#dx1-24155" >1
        footnote-sc  2
    +href="glossaries-extra-manual.html#dx1-24147" >2
        footnote-sm  3
    +href="glossaries-extra-manual.html#dx1-24151" >3
        long-desc-em  4
    +href="glossaries-extra-manual.html#dx1-23075" >4
        long-desc-sc  5
    +href="glossaries-extra-manual.html#dx1-23067" >5
        long-desc-sm  6
    +href="glossaries-extra-manual.html#dx1-23071" >6
        long-em  7
    +href="glossaries-extra-manual.html#dx1-23100" >7
        long-sc  8
    +href="glossaries-extra-manual.html#dx1-23092" >8
        long-sm  9
    +href="glossaries-extra-manual.html#dx1-23096" >9
        postfootnote-em  10
    +href="glossaries-extra-manual.html#dx1-24178" >10
        postfootnote-sc  11
    +href="glossaries-extra-manual.html#dx1-24170" >11
        postfootnote-sm  12
    +href="glossaries-extra-manual.html#dx1-24174" >12
    abbreviation styles:
        footnote  13
    +href="glossaries-extra-manual.html#dx1-24142" >13
        long  14
    +href="glossaries-extra-manual.html#dx1-23086" >14
        long-desc  15
    +href="glossaries-extra-manual.html#dx1-23061" >15
        long-em-noshort-em  16, 17, 18
    +href="glossaries-extra-manual.html#dx1-22088" >16, 17, 18
        long-em-noshort-em-desc  19, 20
    +href="glossaries-extra-manual.html#dx1-23076" >19, 20
        long-em-noshort-em-desc-noreg  21
    +href="glossaries-extra-manual.html#dx1-24065" >21
        long-em-noshort-em-noreg  22, 23, 24
    +href="glossaries-extra-manual.html#dx1-22090" >22, 23, 24
        long-em-short-em  25, 26, 27, 28
    +href="glossaries-extra-manual.html#dx1-22056" >25, 26, 27, 28
        long-em-short-em-desc  29
    +href="glossaries-extra-manual.html#dx1-24062" >29
        long-hyphen-long-hyphen  30
    +href="glossaries-extra-manual.html#dx1-24207" >30
        long-hyphen-noshort-desc-noreg  31, 32
    +href="glossaries-extra-manual.html#dx1-24198" >31, 32
        long-hyphen-noshort-noreg  33, 34
    +href="glossaries-extra-manual.html#dx1-22091" >33, 34
        long-hyphen-postshort-hyphen  35, 36, 37, 38, 39, 40
    +href="glossaries-extra-manual.html#dx1-22086" >35, 36, 37, 38, 39, 40
        long-hyphen-postshort-hyphen-desc  41
    +href="glossaries-extra-manual.html#dx1-24209" >41
        long-hyphen-short-hyphen  42, 43, 44, 45, 46
    +href="glossaries-extra-manual.html#dx1-24190" >42, 43, 44, 45, 46
        long-hyphen-short-hyphen-desc  47, 48
    +href="glossaries-extra-manual.html#dx1-24199" >47, 48
        long-noshort  49, 50, 51, 52, 53, 54, 55, 56, 57
    +href="glossaries-extra-manual.html#dx1-20002" >50, 51, 52, 53, 54, 55, 56, 57
        long-noshort-desc  58, 59, 60, 61, 62, 63, 64, 65, 66, 67
    +href="glossaries-extra-manual.html#dx1-23055" >60, 61, 62, 63, 64, 65, 66, 67
        long-noshort-desc-noreg  68
    +href="glossaries-extra-manual.html#dx1-24044" >68
        long-noshort-em  69
    +href="glossaries-extra-manual.html#dx1-23097" >69
        long-noshort-em-desc  70
    +href="glossaries-extra-manual.html#dx1-23072" >70
        long-noshort-noreg  71
    +href="glossaries-extra-manual.html#dx1-24041" >71
        long-noshort-sc  72, 73
    +href="glossaries-extra-manual.html#dx1-22081" >72, 73
        long-noshort-sc-desc  74, 75
    +href="glossaries-extra-manual.html#dx1-23063" >74, 75
        long-noshort-sm  76
    +href="glossaries-extra-manual.html#dx1-23093" >76
        long-noshort-sm-desc  77
    +href="glossaries-extra-manual.html#dx1-23068" >77
        long-only-short-only  78, 79, 80
    +href="glossaries-extra-manual.html#dx1-22070" >78, 79, 80
        long-only-short-only-desc  81
    +href="glossaries-extra-manual.html#dx1-24022" >81
        long-postshort-user  82, 83
    +href="glossaries-extra-manual.html#dx1-24184" >82, 83
        long-postshort-user-desc  84
    +href="glossaries-extra-manual.html#dx1-24187" >84
        long-short  85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
    +href="glossaries-extra-manual.html#dx1-18019" >88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
        long-short-desc  101, 102, 103, 104, 105, 106, 107, 108, 109, 110
    +href="glossaries-extra-manual.html#dx1-24047" >103, 104, 105, 106, 107, 108, 109, 110
        long-short-em  111, 112, 113, 114
    +href="glossaries-extra-manual.html#dx1-22051" >111, 112, 113, 114
        long-short-em-desc  115, 116
    +href="glossaries-extra-manual.html#dx1-24059" >115, 116
        long-short-sc  117, 118, 119, 120
    +href="glossaries-extra-manual.html#dx1-22035" >118, 119, 120
        long-short-sc-desc  121, 122
    +href="glossaries-extra-manual.html#dx1-24053" >122
        long-short-sm  123, 124, 125
    +href="glossaries-extra-manual.html#dx1-22045" >124, 125
        long-short-sm-desc  126, 127
    +href="glossaries-extra-manual.html#dx1-24056" >127
        long-short-user  128, 129, 130, 131, 132, 133, 134, 135, 136
    +href="glossaries-extra-manual.html#dx1-22084" >128, 129, 130, 131, 132, 133, 134, 135, 136
        long-short-user-desc  137
    +href="glossaries-extra-manual.html#dx1-24068" >137
    +    nolong-short  138, 139
    +    nolong-short-em  140
    +    nolong-short-noreg  141
    +    nolong-short-sc  142
    +    nolong-short-sm  143
        postfootnote  138
    +href="glossaries-extra-manual.html#dx1-24165" >144
        short  139
    +href="glossaries-extra-manual.html#dx1-23007" >145
        short-desc  140
    +href="glossaries-extra-manual.html#dx1-23038" >146
        short-em  141
    +href="glossaries-extra-manual.html#dx1-23028" >147
        short-em-desc  142
    +href="glossaries-extra-manual.html#dx1-23053" >148
        short-em-footnote  143, 144
    +href="glossaries-extra-manual.html#dx1-22102" >149, 150
        short-em-footnote-desc  145
    +href="glossaries-extra-manual.html#dx1-22101" >151
        short-em-long  146, 147, 148
    +href="glossaries-extra-manual.html#dx1-22052" >152, 153, 154
        short-em-long-desc  149, 150
    +href="glossaries-extra-manual.html#dx1-24117" >155, 156
        short-em-long-em  151, 152
    +href="glossaries-extra-manual.html#dx1-22057" >157, 158
        short-em-long-em-desc  153
    +href="glossaries-extra-manual.html#dx1-24120" >159
        short-em-nolong  154, 155
    +href="glossaries-extra-manual.html#dx1-23025" >160, 161, 162
        short-em-nolong-desc  156, 157
    +href="glossaries-extra-manual.html#dx1-23050" >163, 164
        short-em-postfootnote  158
    +href="glossaries-extra-manual.html#dx1-24175" >165
        short-footnote  159, 160, 161, 162, 163, 164, 165, 166, 167, 168
    +href="glossaries-extra-manual.html#dx1-12034" >166, 167, 168, 169, 170, 171, 172, 173, 174, 175
        short-footnote-desc  169
    +href="glossaries-extra-manual.html#dx1-12040" >176
        short-hyphen-long-hyphen  170, 171
    +href="glossaries-extra-manual.html#dx1-24211" >177, 178
        short-hyphen-long-hyphen-desc  172
    +href="glossaries-extra-manual.html#dx1-24214" >179
        short-hyphen-postlong-hyphen  173, 174
    +href="glossaries-extra-manual.html#dx1-24216" >180, 181
        short-hyphen-postlong-hyphen-desc  175
    +href="glossaries-extra-manual.html#dx1-24220" >182
    + + +     short-long  176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186
    +href="glossaries-extra-manual.html#dx1-12010" >183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193
        short-long-desc  187, 188, 189, 190, 191, 192, 193, 194
    +href="glossaries-extra-manual.html#dx1-12024" >194, 195, 196, 197, 198, 199, 200, 201
        short-long-user  195, 196, 197, 198, 199, 200, 201
    +href="glossaries-extra-manual.html#dx1-24034" >202, 203, 204, 205, 206, 207, 208
        short-long-user-desc  202
    +href="glossaries-extra-manual.html#dx1-24123" >209
        short-nolong  203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215
    - - - +href="glossaries-extra-manual.html#dx1-18012" >210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223
        short-nolong-desc  216, 217, 218, 219, 220
    +href="glossaries-extra-manual.html#dx1-23032" >224, 225, 226, 227, 228
        short-nolong-desc-noreg  221
    +href="glossaries-extra-manual.html#dx1-24104" >229
        short-nolong-noreg  222
    +href="glossaries-extra-manual.html#dx1-24077" >230
        short-postfootnote  223, 224, 225, 226, 227, 228, 229
    +href="glossaries-extra-manual.html#dx1-8057" >231, 232, 233, 234, 235, 236, 237
        short-postlong-user  230, 231, 232
    +href="glossaries-extra-manual.html#dx1-24179" >238, 239, 240
        short-postlong-user-desc  233
    +href="glossaries-extra-manual.html#dx1-24181" >241
        short-sc  234
    +href="glossaries-extra-manual.html#dx1-23014" >242
        short-sc-desc  235
    +href="glossaries-extra-manual.html#dx1-23043" >243
        short-sc-footnote  236, 237, 238
    +href="glossaries-extra-manual.html#dx1-12036" >244, 245, 246
        short-sc-footnote-desc  239
    +href="glossaries-extra-manual.html#dx1-12042" >247
        short-sc-long  240, 241, 242, 243
    +href="glossaries-extra-manual.html#dx1-12012" >248, 249, 250, 251
        short-sc-long-desc  244, 245
    +href="glossaries-extra-manual.html#dx1-12026" >252, 253
        short-sc-nolong  246, 247
    +href="glossaries-extra-manual.html#dx1-23011" >254, 255, 256
        short-sc-nolong-desc  248, 249
    +href="glossaries-extra-manual.html#dx1-23040" >257, 258
        short-sc-postfootnote  250, 251
    +href="glossaries-extra-manual.html#dx1-22095" >259, 260
        short-sm  252
    +href="glossaries-extra-manual.html#dx1-23021" >261
        short-sm-desc  253
    +href="glossaries-extra-manual.html#dx1-23048" >262
        short-sm-footnote  254
    +href="glossaries-extra-manual.html#dx1-12038" >263
        short-sm-footnote-desc  255
    +href="glossaries-extra-manual.html#dx1-12044" >264
        short-sm-long  256, 257, 258
    +href="glossaries-extra-manual.html#dx1-12014" >265, 266, 267
        short-sm-long-desc  259, 260
    +href="glossaries-extra-manual.html#dx1-12028" >268, 269
        short-sm-nolong  261, 262
    +href="glossaries-extra-manual.html#dx1-23018" >270, 271, 272
        short-sm-nolong-desc  263, 264
    +href="glossaries-extra-manual.html#dx1-23045" >273, 274
        short-sm-postfootnote  265
    +href="glossaries-extra-manual.html#dx1-24171" >275
    \abbreviationsname  266
    +href="glossaries-extra-manual.html#dx1-4138" >276
    \abbrvpluralsuffix  267
    +href="glossaries-extra-manual.html#dx1-25043" >277
    acronym styles (glossaries):
        dua  268
    +href="glossaries-extra-manual.html#dx1-12029" >278
        dua-desc  269
    +href="glossaries-extra-manual.html#dx1-12031" >279
        footnote  270
    +href="glossaries-extra-manual.html#dx1-12033" >280
        footnote-desc  271
    +href="glossaries-extra-manual.html#dx1-12039" >281
        footnote-sc  272
    +href="glossaries-extra-manual.html#dx1-12035" >282
        footnote-sc-desc  273
    +href="glossaries-extra-manual.html#dx1-12041" >283
        footnote-sm  274
    +href="glossaries-extra-manual.html#dx1-12037" >284
        footnote-sm-desc  275
    +href="glossaries-extra-manual.html#dx1-12043" >285
        long-sc-short  276
    +href="glossaries-extra-manual.html#dx1-12003" >286
        long-sc-short-desc  277
    +href="glossaries-extra-manual.html#dx1-12017" >287
        long-short-desc  278
    +href="glossaries-extra-manual.html#dx1-12015" >288
        long-sm-short  279
    +href="glossaries-extra-manual.html#dx1-12005" >289
        long-sm-short-desc  280
    +href="glossaries-extra-manual.html#dx1-12019" >290
        long-sp-short  281, 282
    +href="glossaries-extra-manual.html#dx1-12007" >291, 292
    + + +     long-sp-short-desc  283
    +href="glossaries-extra-manual.html#dx1-12021" >293
        sc-short-long  284
    +href="glossaries-extra-manual.html#dx1-12011" >294
        sc-short-long-desc  285
    +href="glossaries-extra-manual.html#dx1-12025" >295
        short-long  286
    +href="glossaries-extra-manual.html#dx1-12009" >296
        short-long-desc  287
    - - - +href="glossaries-extra-manual.html#dx1-12023" >297
        sm-short-long  288
    +href="glossaries-extra-manual.html#dx1-12013" >298
        sm-short-long-desc  289
    +href="glossaries-extra-manual.html#dx1-12027" >299
    amsgen package  290
    +href="glossaries-extra-manual.html#dx1-11" >300
    \apptoglossarypreamble  291
    +href="glossaries-extra-manual.html#dx1-36010" >301

    B babel package  292, 293, 294, 295, 296, 297, 298, 299
    +href="glossaries-extra-manual.html#dx1-3010" >302, 303, 304, 305, 306, 307, 308, 309
    bib2gls  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
    +href="glossaries-extra-manual.html#dx1-2" >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
    bib2gls  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
    +href="glossaries-extra-manual.html#dx1-3" >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

    C categories:
        abbreviation  358, 359, 360, 361
    +href="glossaries-extra-manual.html#dx1-9005" >420, 421, 422, 423
        acronym  362, 363, 364, 365, 366, 367
    +href="glossaries-extra-manual.html#dx1-15015" >424, 425, 426, 427, 428
        general  368, 369, 370, 371, 372, 373, 374, 375
    +href="glossaries-extra-manual.html#dx1-8035" >429, 430, 431, 432, 433, 434, 435, 436
        index  376, 377
    +href="glossaries-extra-manual.html#dx1-5040" >437, 438
        number  378
    +href="glossaries-extra-manual.html#dx1-27018" >439
        symbol  379, 380
    +href="glossaries-extra-manual.html#dx1-8042" >440, 441
    category attributes:
        aposplural  381, 382, 383, 384
    +href="glossaries-extra-manual.html#dx1-10036" >442, 443, 444, 445
        discardperiod  385, 386, 387, 388, 389
    +href="glossaries-extra-manual.html#dx1-8031" >446, 447, 448, 449, 450
        dualindex  390, 391, 392, 393, 394, 395, 396
    +href="glossaries-extra-manual.html#dx1-27110" >451, 452, 453, 454, 455, 456, 457
        entrycount  397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407
    +href="glossaries-extra-manual.html#dx1-9004" >458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468
        externallocation  408
    +href="glossaries-extra-manual.html#dx1-6037" >469
        glossdesc  409, 410, 411
    +href="glossaries-extra-manual.html#dx1-15004" >470, 471, 472
        glossdescfont  412, 413
    +href="glossaries-extra-manual.html#dx1-15005" >473, 474
        glossname  414, 415
    +href="glossaries-extra-manual.html#dx1-15003" >475, 476
        glossnamefont  416
    +href="glossaries-extra-manual.html#dx1-27105" >477, 478
        headuc  417, 418, 419, 420
    +href="glossaries-extra-manual.html#dx1-11059" >479, 480, 481, 482
    +    hyperoutside  483, 484
        indexname  421, 422, 423, 424, 425
    +href="glossaries-extra-manual.html#dx1-15009" >485, 486, 487, 488, 489
        indexonlyfirst  426, 427, 428
    +href="glossaries-extra-manual.html#dx1-6005" >490, 491, 492
        insertdots  429, 430, 431
    +href="glossaries-extra-manual.html#dx1-18004" >493, 494, 495
        markshortwords  432, 433
    +href="glossaries-extra-manual.html#dx1-27061" >496, 497
        markwords  434, 435, 436, 437, 438, 439
    +href="glossaries-extra-manual.html#dx1-24191" >498, 499, 500, 501, 502, 503
        nohyper  440, 441, 442
    +href="glossaries-extra-manual.html#dx1-27034" >504, 505, 506
        nohyperfirst  443, 444, 445, 446, 447
    +href="glossaries-extra-manual.html#dx1-24132" >507, 508, 509, 510, 511
    + + +     noshortplural  448, 449, 450, 451, 452
    +href="glossaries-extra-manual.html#dx1-10037" >512, 513, 514, 515, 516
        pluraldiscardperiod  453, 454
    +href="glossaries-extra-manual.html#dx1-27048" >517, 518
    +    recordcount  519, 520, 521, 522
        regular  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
    +href="glossaries-extra-manual.html#dx1-8010" >523, 524, 525, 526, 527, 528, 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
        retainfirstuseperiod  486
    +href="glossaries-extra-manual.html#dx1-27050" >555
        tagging  487, 488, 489, 490
    - - - +href="glossaries-extra-manual.html#dx1-19002" >556, 557, 558, 559
        targetcategory  491
    +href="glossaries-extra-manual.html#dx1-27119" >560
        targetname  492, 493
    +href="glossaries-extra-manual.html#dx1-27116" >561, 562
        targeturl  494, 495, 496, 497, 498
    +href="glossaries-extra-manual.html#dx1-5010" >563, 564, 565, 566, 567
    +    textformat  568, 569, 570
        unitcount  499
    +href="glossaries-extra-manual.html#dx1-28031" >571
        wrgloss  500, 501
    +href="glossaries-extra-manual.html#dx1-6013" >572, 573
    \cGLS  502
    +href="glossaries-extra-manual.html#dx1-28012" >574
    \cGLSformat  503
    +href="glossaries-extra-manual.html#dx1-28014" >575
    \cGLSpl  504
    +href="glossaries-extra-manual.html#dx1-28013" >576
    \cGLSplformat  505
    +href="glossaries-extra-manual.html#dx1-28015" >577
    convertgls2bib  506
    +href="glossaries-extra-manual.html#dx1-31005" >578
    \csGlsXtrLetField  507
    +href="glossaries-extra-manual.html#dx1-37022" >579
    \CustomAbbreviationFields  508
    +href="glossaries-extra-manual.html#dx1-25006" >580

    D datatool-base package  509
    +href="glossaries-extra-manual.html#dx1-10" >581

    E \eglssetwidest  510
    +href="glossaries-extra-manual.html#dx1-17037" >582
    \eGlsXtrSetField  511
    +href="glossaries-extra-manual.html#dx1-37019" >583
    entry location  512, 513, 514
    +href="glossaries-extra-manual.html#dx1-46005" >584, 585, 586
    +entrycounter package  587
    etoolbox package  515, 516, 517, 518, 519, 520
    +href="glossaries-extra-manual.html#dx1-6" >588, 589, 590, 591, 592, 593, 594

    F +fancyhdr package  595
    first use  521, 522, 523, 524, 525, 526, 527, 528, 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, 570, 571, 572
    +href="glossaries-extra-manual.html#dx1-6003" >596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647
    first use flag  573, 574, 575, 576, 577
    +href="glossaries-extra-manual.html#dx1-8047" >648, 649, 650, 651, 652, 653
    first use text  578, 579
    +href="glossaries-extra-manual.html#dx1-46016" >654, 655
    fontenc package  580
    +href="glossaries-extra-manual.html#dx1-22024" >656

    G \gglssetwidest  657
    +\gGlsXtrSetField  581
    +href="glossaries-extra-manual.html#dx1-37018" >658
    + + + glossaries package  582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592
    +href="glossaries-extra-manual.html#dx1-5028" >659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669
    glossaries-accsupp package  593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607
    +href="glossaries-extra-manual.html#dx1-4036" >670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684
    glossaries-extra package  608, 609
    +href="glossaries-extra-manual.html#dx1-5030" >685, 686
    glossaries-extra-stylemods package  610, 611, 612, 613
    +href="glossaries-extra-manual.html#dx1-4027" >687, 688, 689, 690, 691, 692, 693
    glossaries-prefix package  614, 615, 616
    +href="glossaries-extra-manual.html#dx1-41001" >694, 695, 696
    \glossariesextrasetup  617
    +href="glossaries-extra-manual.html#dx1-4176" >697
    glossary styles:
        altlist  698
    +    alttree  618, 619, 620, 621, 622, 623, 624
    +href="glossaries-extra-manual.html#dx1-17032" >699, 700, 701, 702, 703, 704, 705
    +    bookindex  706, 707, 708, 709
    +    index  710
        inline  625, 626
    +href="glossaries-extra-manual.html#dx1-17006" >711, 712
    +    list  713, 714
    +    listdotted  715
    +    long  716
        long3col  627
    +href="glossaries-extra-manual.html#dx1-17004" >717
    +    mcolindexgroup  718
    +    tree  719
    +glossary-bookindex package  720, 721
    glossary-inline package  628
    +href="glossaries-extra-manual.html#dx1-17007" >722
    glossary-tree package  629, 630, 631
    - - - +href="glossaries-extra-manual.html#dx1-13035" >723, 724, 725, 726
    \glossxtrsetpopts  632
    +class="cmti-10">727
    \glsabbrvdefaultfont  633, 634
    +href="glossaries-extra-manual.html#dx1-22029" >728, 729
    \glsabbrvemfont  635
    +href="glossaries-extra-manual.html#dx1-22053" >730
    \glsabbrvfont  636
    +href="glossaries-extra-manual.html#dx1-25047" >731
    \glsabbrvhyphenfont  637
    +href="glossaries-extra-manual.html#dx1-22065" >732
    \glsabbrvonlyfont  638
    +href="glossaries-extra-manual.html#dx1-22071" >733
    \glsabbrvscfont  639
    +href="glossaries-extra-manual.html#dx1-22037" >734
    \glsabbrvsmfont  640
    +href="glossaries-extra-manual.html#dx1-22047" >735
    \glsabbrvuserfont  641, 642
    +href="glossaries-extra-manual.html#dx1-22060" >736, 737
    \Glsaccessdesc  643
    +href="glossaries-extra-manual.html#dx1-43039" >738
    \glsaccessdesc  644
    +href="glossaries-extra-manual.html#dx1-43037" >739
    \Glsaccessdescplural  645
    +href="glossaries-extra-manual.html#dx1-43043" >740
    \glsaccessdescplural  646
    +href="glossaries-extra-manual.html#dx1-43041" >741
    \Glsaccessfirst  647
    +href="glossaries-extra-manual.html#dx1-43023" >742
    \glsaccessfirst  648
    +href="glossaries-extra-manual.html#dx1-43021" >743
    \Glsaccessfirstplural  649
    +href="glossaries-extra-manual.html#dx1-43027" >744
    \glsaccessfirstplural  650
    +href="glossaries-extra-manual.html#dx1-43025" >745
    \Glsaccesslong  651
    +href="glossaries-extra-manual.html#dx1-43055" >746
    \glsaccesslong  652
    +href="glossaries-extra-manual.html#dx1-43053" >747
    \Glsaccesslongpl  653
    +href="glossaries-extra-manual.html#dx1-43059" >748
    \glsaccesslongpl  654
    +href="glossaries-extra-manual.html#dx1-43057" >749
    \Glsaccessname  655
    +href="glossaries-extra-manual.html#dx1-43010" >750
    \glsaccessname  656
    +href="glossaries-extra-manual.html#dx1-43005" >751
    \Glsaccessplural  657
    +href="glossaries-extra-manual.html#dx1-43019" >752
    \glsaccessplural  658
    +href="glossaries-extra-manual.html#dx1-43017" >753
    + + + \Glsaccessshort  659
    +href="glossaries-extra-manual.html#dx1-43047" >754
    \glsaccessshort  660
    +href="glossaries-extra-manual.html#dx1-43045" >755
    \Glsaccessshortpl  661
    +href="glossaries-extra-manual.html#dx1-43051" >756
    \glsaccessshortpl  662
    +href="glossaries-extra-manual.html#dx1-43049" >757
    \Glsaccesssymbol  663
    +href="glossaries-extra-manual.html#dx1-43031" >758
    \glsaccesssymbol  664
    +href="glossaries-extra-manual.html#dx1-43029" >759
    \Glsaccesssymbolplural  665
    +href="glossaries-extra-manual.html#dx1-43035" >760
    \glsaccesssymbolplural  666
    +href="glossaries-extra-manual.html#dx1-43033" >761
    \Glsaccesstext  667
    +href="glossaries-extra-manual.html#dx1-43015" >762
    \glsaccesstext  668
    +href="glossaries-extra-manual.html#dx1-43013" >763
    \glsacspace  669
    +class="cmti-10">764
    \glsacspacemax  670
    +class="cmti-10">765
    \glsadd options
        format  671
    +href="glossaries-extra-manual.html#dx1-8070" >766
        theHvalue  672, 673
    +href="glossaries-extra-manual.html#dx1-6022" >767, 768
        thevalue  674, 675, 676, 677, 678
    +href="glossaries-extra-manual.html#dx1-6021" >769, 770, 771, 772, 773
    \glscategory  679
    +href="glossaries-extra-manual.html#dx1-27019" >774
    \glscategorylabel  680
    +href="glossaries-extra-manual.html#dx1-25039" >775
    \glscurrententrylabel  681
    +href="glossaries-extra-manual.html#dx1-15016" >776
    \glscurrentfieldvalue  682
    +href="glossaries-extra-manual.html#dx1-37026" >777
    \glsentrycurrcount  683
    - - - +href="glossaries-extra-manual.html#dx1-28032" >778
    \glsentryprevcount  684
    +href="glossaries-extra-manual.html#dx1-28033" >779
    \glsentryprevmaxcount  685
    +href="glossaries-extra-manual.html#dx1-28035" >780
    \glsentryprevtotalcount  686
    +href="glossaries-extra-manual.html#dx1-28034" >781
    \glsFindWidestAnyName  687
    +href="glossaries-extra-manual.html#dx1-17051" >782
    \glsFindWidestAnyNameLocation  688
    +href="glossaries-extra-manual.html#dx1-17063" >783
    \glsFindWidestAnyNameSymbol  689
    +href="glossaries-extra-manual.html#dx1-17055" >784
    \glsFindWidestAnyNameSymbolLocation  690
    +href="glossaries-extra-manual.html#dx1-17060" >785
    \glsFindWidestLevelTwo  691
    +href="glossaries-extra-manual.html#dx1-17053" >786
    \glsFindWidestTopLevelName  692
    +href="glossaries-extra-manual.html#dx1-17046" >787
    \glsFindWidestUsedAnyName  693
    +href="glossaries-extra-manual.html#dx1-17049" >788
    \glsFindWidestUsedAnyNameLocation  694
    +href="glossaries-extra-manual.html#dx1-17061" >789
    \glsFindWidestUsedAnyNameSymbol  695
    +href="glossaries-extra-manual.html#dx1-17054" >790
    \glsFindWidestUsedAnyNameSymbolLocation  696
    +href="glossaries-extra-manual.html#dx1-17056" >791
    \glsFindWidestUsedLevelTwo  697
    +href="glossaries-extra-manual.html#dx1-17052" >792
    \glsFindWidestUsedTopLevelName  698
    +href="glossaries-extra-manual.html#dx1-17047" >793
    \glsfirstabbrvdefaultfont  699
    +href="glossaries-extra-manual.html#dx1-22030" >794
    \glsfirstabbrvemfont  700
    +href="glossaries-extra-manual.html#dx1-22054" >795
    \glsfirstabbrvfont  701
    +href="glossaries-extra-manual.html#dx1-25045" >796
    \glsfirstabbrvhyphenfont  702
    +href="glossaries-extra-manual.html#dx1-22066" >797
    \glsfirstabbrvonlyfont  703
    +href="glossaries-extra-manual.html#dx1-22072" >798
    \glsfirstabbrvsmfont  704
    +href="glossaries-extra-manual.html#dx1-22049" >799
    \glsfirstabbrvuserfont  705
    +href="glossaries-extra-manual.html#dx1-22061" >800
    \glsfirstlongdefaultfont  706
    +href="glossaries-extra-manual.html#dx1-22032" >801
    \glsfirstlongemfont  707
    +href="glossaries-extra-manual.html#dx1-22058" >802
    \glsfirstlongfont  708
    +href="glossaries-extra-manual.html#dx1-25049" >803
    + + + \glsfirstlongfootnotefont  709
    +href="glossaries-extra-manual.html#dx1-24137" >804
    \glsfirstlonghyphenfont  710
    +href="glossaries-extra-manual.html#dx1-22068" >805
    \glsfirstlongonlyfont  711
    +href="glossaries-extra-manual.html#dx1-22074" >806
    \glsfirstlonguserfont  712
    +href="glossaries-extra-manual.html#dx1-22063" >807
    \Glsfmtfirst  713
    +href="glossaries-extra-manual.html#dx1-26043" >808
    \glsfmtfirst  714
    +href="glossaries-extra-manual.html#dx1-26042" >809
    \Glsfmtfirstpl  715
    +href="glossaries-extra-manual.html#dx1-26045" >810
    \glsfmtfirstpl  716
    +href="glossaries-extra-manual.html#dx1-26044" >811
    \Glsfmtfull  717
    +href="glossaries-extra-manual.html#dx1-26031" >812
    \glsfmtfull  718
    +href="glossaries-extra-manual.html#dx1-26029" >813
    \Glsfmtfullpl  719
    +href="glossaries-extra-manual.html#dx1-26032" >814
    \glsfmtfullpl  720
    +href="glossaries-extra-manual.html#dx1-26030" >815
    \Glsfmtlong  721
    +href="glossaries-extra-manual.html#dx1-26027" >816
    \glsfmtlong  722
    +href="glossaries-extra-manual.html#dx1-26025" >817
    \Glsfmtlongpl  723
    +href="glossaries-extra-manual.html#dx1-26028" >818
    \glsfmtlongpl  724
    +href="glossaries-extra-manual.html#dx1-26026" >819
    +\Glsfmtname  820
    +\glsfmtname  821
    \Glsfmtplural  725
    +href="glossaries-extra-manual.html#dx1-26037" >822
    \glsfmtplural  726
    +href="glossaries-extra-manual.html#dx1-26036" >823
    \Glsfmtshort  727
    +href="glossaries-extra-manual.html#dx1-26023" >824
    \glsfmtshort  728
    +href="glossaries-extra-manual.html#dx1-26021" >825
    \Glsfmtshortpl  729
    - - - +href="glossaries-extra-manual.html#dx1-26024" >826
    \glsfmtshortpl  730
    +href="glossaries-extra-manual.html#dx1-26022" >827
    \Glsfmttext  731
    +href="glossaries-extra-manual.html#dx1-26035" >828
    \glsfmttext  732
    +href="glossaries-extra-manual.html#dx1-26034" >829
    \glsforeachwithattribute  733
    +href="glossaries-extra-manual.html#dx1-27143" >830
    \glsgetattribute  734
    +href="glossaries-extra-manual.html#dx1-27126" >831
    \glsgetcategoryattribute  735
    +href="glossaries-extra-manual.html#dx1-27125" >832
    \glsgetwidestname  736
    +href="glossaries-extra-manual.html#dx1-17039" >833
    \glsgetwidestsubname  737
    +href="glossaries-extra-manual.html#dx1-17040" >834
    \glshasattribute  738
    +href="glossaries-extra-manual.html#dx1-27129" >835
    \glshascategoryattribute  739
    +href="glossaries-extra-manual.html#dx1-27127" >836
    +\glshex  837
    \glsifattribute  740
    +href="glossaries-extra-manual.html#dx1-27134" >838
    \glsifcategory  741
    +href="glossaries-extra-manual.html#dx1-27020" >839
    \glsifcategoryattribute  742
    +href="glossaries-extra-manual.html#dx1-27130" >840
    \glsifnotregular  743
    +href="glossaries-extra-manual.html#dx1-27141" >841
    \glsifnotregularcategory  744
    +href="glossaries-extra-manual.html#dx1-27140" >842
    \glsifregular  745
    +href="glossaries-extra-manual.html#dx1-27137" >843
    \glsifregularcategory  746
    +href="glossaries-extra-manual.html#dx1-27136" >844
    \glskeylisttok  747
    +href="glossaries-extra-manual.html#dx1-25037" >845
    \glslabeltok  748
    +href="glossaries-extra-manual.html#dx1-25036" >846
    \glslink options
        format  749, 750, 751
    +href="glossaries-extra-manual.html#dx1-6034" >847, 848, 849, 850
        hyper  752, 753, 754
    +href="glossaries-extra-manual.html#dx1-11055" >851, 852, 853
    + + +     hyper=false  755
    +href="glossaries-extra-manual.html#dx1-26016" >854
    +    hyperoutside  855, 856
        noindex  756, 757, 758, 759, 760, 761, 762
    +href="glossaries-extra-manual.html#dx1-6001" >857, 858, 859, 860, 861, 862, 863
        theHvalue  763
    +href="glossaries-extra-manual.html#dx1-6025" >864
        thevalue  764
    +href="glossaries-extra-manual.html#dx1-6024" >865
        wrgloss  765, 766, 767, 768
    +href="glossaries-extra-manual.html#dx1-6009" >866, 867, 868, 869
    \glslinkcheckfirsthyperhook  769
    +href="glossaries-extra-manual.html#dx1-28039" >870
    +\glslistchildpostlocation  871
    +\glslistchildprelocation  872
    \glslongdefaultfont  770
    +href="glossaries-extra-manual.html#dx1-22031" >873
    \glslongemfont  771
    +href="glossaries-extra-manual.html#dx1-22059" >874
    \glslongfont  772
    +href="glossaries-extra-manual.html#dx1-25050" >875
    \glslongfootnotefont  773
    +href="glossaries-extra-manual.html#dx1-24139" >876
    \glslonghyphenfont  774
    +href="glossaries-extra-manual.html#dx1-22067" >877
    \glslongonlyfont  775
    +href="glossaries-extra-manual.html#dx1-22073" >878
    \glslongpltok  776
    +href="glossaries-extra-manual.html#dx1-25029" >879
    \glslongtok  777
    +href="glossaries-extra-manual.html#dx1-25028" >880
    \glslonguserfont  778
    +href="glossaries-extra-manual.html#dx1-22062" >881
    \glsnoidxdisplayloc  779
    +href="glossaries-extra-manual.html#dx1-8074" >882
    \glsps  780
    +class="cmti-10">883
    \glspt  781
    +class="cmti-10">884
    +\glsseeitemformat  885
    \glssetattribute  782
    +href="glossaries-extra-manual.html#dx1-27124" >886
    \glssetcategoryattribute  783
    +href="glossaries-extra-manual.html#dx1-27121" >887
    \glssetregularcategory  784
    +href="glossaries-extra-manual.html#dx1-27123" >888
    \glsshortpltok  785
    +href="glossaries-extra-manual.html#dx1-25025" >889
    \glsshorttok  786
    +href="glossaries-extra-manual.html#dx1-25024" >890
    +\glstreechildprelocation  891
    +\glstreeprelocation  892
    +\glsuseabbrvfont  893
    +\glsuselongfont  894
    \Glsxtr  787
    - - - +href="glossaries-extra-manual.html#dx1-30014" >895
    \glsxtr  788
    +href="glossaries-extra-manual.html#dx1-30009" >896
    \glsxtrabbrvfootnote  789
    +href="glossaries-extra-manual.html#dx1-24140" >897
    \glsxtrabbrvpluralsuffix  790, 791
    +class="cmti-10">898, 899
    \glsxtraddallcrossrefs  792
    +class="cmti-10">900
    \glsxtralias  793
    +href="glossaries-extra-manual.html#dx1-40021" >901
    \glsxtrAltTreeIndent  794
    +href="glossaries-extra-manual.html#dx1-17069" >902
    \glsxtralttreeInit  795
    +href="glossaries-extra-manual.html#dx1-17068" >903
    \glsxtralttreeSubSymbolDescLocation  796
    +href="glossaries-extra-manual.html#dx1-17066" >904
    \glsxtralttreeSymbolDescLocation  797
    +href="glossaries-extra-manual.html#dx1-17065" >905
    \glsxtrautoindex  798
    +href="glossaries-extra-manual.html#dx1-29015" >906
    \glsxtrautoindexassignsort  799
    +href="glossaries-extra-manual.html#dx1-29013" >907
    \glsxtrautoindexentry  800
    +href="glossaries-extra-manual.html#dx1-29012" >908
    +\glsxtrbookindexatendgroup  909
    +\glsxtrbookindexbetween  910
    + + + +\glsxtrbookindexbookmark  911
    +\glsxtrbookindexcols  912
    +\glsxtrbookindexcolspread  913
    +\glsxtrbookindexfirstmark  914
    +\glsxtrbookindexfirstmarkfmt  915
    +\glsxtrbookindexformatheader  916
    +\glsxtrbookindexlastmark  917
    +\glsxtrbookindexlastmarkfmt  918
    +\glsxtrbookindexmarkentry  919
    +\glsxtrbookindexname  920
    +\glsxtrbookindexparentchildsep  921
    +\glsxtrbookindexparentsubchildsep  922
    +\glsxtrbookindexprelocation  923
    +\glsxtrbookindexsubatendgroup  924
    +\glsxtrbookindexsubbetween  925
    +\glsxtrbookindexsubname  926
    +\glsxtrbookindexsubprelocation  927
    +\glsxtrbookindexsubsubatendgroup  928
    +\glsxtrbookindexsubsubbetween  929
    \glsxtrchecknohyperfirst  801
    +href="glossaries-extra-manual.html#dx1-27033" >930
    \glsxtrcopytoglossary  802
    +href="glossaries-extra-manual.html#dx1-36007" >931
    \glsxtrdeffield  803
    +href="glossaries-extra-manual.html#dx1-37015" >932
    +\glsxtrdetoklocation  933
    \glsxtrdisplayendloc  804
    +href="glossaries-extra-manual.html#dx1-8077" >934
    \glsxtrdisplayendlochook  805
    +href="glossaries-extra-manual.html#dx1-8079" >935
    \glsxtrdisplaysingleloc  806
    +href="glossaries-extra-manual.html#dx1-8075" >936
    \glsxtrdisplaystartloc  807
    +href="glossaries-extra-manual.html#dx1-8076" >937
    \glsxtrdoautoindexname  808
    +href="glossaries-extra-manual.html#dx1-29009" >938
    \glsxtrdowrglossaryhook  809
    +href="glossaries-extra-manual.html#dx1-6020" >939
    \glsxtredeffield  810
    +href="glossaries-extra-manual.html#dx1-37017" >940
    \glsxtremsuffix  811
    +href="glossaries-extra-manual.html#dx1-22055" >941
    \GlsXtrEnableEntryCounting  812
    +href="glossaries-extra-manual.html#dx1-28024" >942
    \GlsXtrEnableEntryUnitCounting  813
    +href="glossaries-extra-manual.html#dx1-28027" >943
    \GlsXtrEnableIndexFormatOverride  814
    +href="glossaries-extra-manual.html#dx1-29024" >944
    \GlsXtrEnableInitialTagging  815
    +href="glossaries-extra-manual.html#dx1-19001" >945
    \GlsXtrEnableOnTheFly  816
    +href="glossaries-extra-manual.html#dx1-30007" >946
    \GlsXtrEnablePreLocationTag  817
    +href="glossaries-extra-manual.html#dx1-16010" >947
    +\glsxtrenablerecordcount  948
    \glsxtrentryfmt  818
    +href="glossaries-extra-manual.html#dx1-37005" >949
    \glsxtrfielddolistloop  819
    +href="glossaries-extra-manual.html#dx1-37040" >950
    \glsxtrfieldforlistloop  820
    +href="glossaries-extra-manual.html#dx1-37041" >951
    \glsxtrfieldifinlist  821
    +href="glossaries-extra-manual.html#dx1-37042" >952
    \glsxtrfieldlistadd  822
    +href="glossaries-extra-manual.html#dx1-37036" >953
    \glsxtrfieldlisteadd  823
    +href="glossaries-extra-manual.html#dx1-37038" >954
    \glsxtrfieldlistgadd  824
    +href="glossaries-extra-manual.html#dx1-37037" >955
    \glsxtrfieldlistxadd  825
    +href="glossaries-extra-manual.html#dx1-37039" >956
    + + + \glsxtrfieldtitlecasecs  826
    +href="glossaries-extra-manual.html#dx1-27095" >957
    \glsxtrfieldxifinlist  827
    +href="glossaries-extra-manual.html#dx1-37043" >958
    \glsxtrfmt  828
    +href="glossaries-extra-manual.html#dx1-37002" >959
    \GlsXtrFmtDefaultOptions  829
    +href="glossaries-extra-manual.html#dx1-37003" >960
    \GlsXtrFmtField  830
    +href="glossaries-extra-manual.html#dx1-37001" >961
    \GlsXtrFormatLocationList  831
    +href="glossaries-extra-manual.html#dx1-16002" >962
    \GLSxtrfull  832
    +href="glossaries-extra-manual.html#dx1-20025" >963
    \Glsxtrfull  833
    +href="glossaries-extra-manual.html#dx1-20022" >964
    \glsxtrfull  834
    - - - +href="glossaries-extra-manual.html#dx1-20014" >965
    \Glsxtrfullformat  835
    +href="glossaries-extra-manual.html#dx1-25058" >966
    \glsxtrfullformat  836
    +href="glossaries-extra-manual.html#dx1-25054" >967
    \GLSxtrfullpl  837
    +href="glossaries-extra-manual.html#dx1-20034" >968
    \Glsxtrfullpl  838
    +href="glossaries-extra-manual.html#dx1-20033" >969
    \glsxtrfullpl  839
    +href="glossaries-extra-manual.html#dx1-20032" >970
    \Glsxtrfullplformat  840
    +href="glossaries-extra-manual.html#dx1-25066" >971
    \glsxtrfullplformat  841
    +href="glossaries-extra-manual.html#dx1-25062" >972
    \glsxtrfullsep  842
    +href="glossaries-extra-manual.html#dx1-22078" >973
    +\glsxtrglossentry  974
    \glsxtrhyphensuffix  843
    +href="glossaries-extra-manual.html#dx1-22069" >975
    \glsxtrifcounttrigger  844
    +href="glossaries-extra-manual.html#dx1-28018" >976
    +\GlsXtrIfFieldEqStr  977
    \glsxtrifhasfield  845
    +href="glossaries-extra-manual.html#dx1-37025" >978
    \glsxtrifhasfield*  846
    +href="glossaries-extra-manual.html#dx1-37027" >979
    \glsxtrifkeydefined  847
    +href="glossaries-extra-manual.html#dx1-37007" >980
    +\glsxtriflabelinlist  981
    +\glsxtrifrecordtrigger  982
    \glsxtrifwasfirstuse  848
    +href="glossaries-extra-manual.html#dx1-8048" >983
    \glsxtrindexaliased  849
    +href="glossaries-extra-manual.html#dx1-40019" >984
    \glsxtrindexseealso  850
    +class="cmti-10">985
    \glsxtrinitwrgloss  851
    +class="cmti-10">986
    \Glsxtrinlinefullformat  852
    +href="glossaries-extra-manual.html#dx1-25073" >987
    \glsxtrinlinefullformat  853
    +href="glossaries-extra-manual.html#dx1-25070" >988
    \Glsxtrinlinefullplformat  854
    +href="glossaries-extra-manual.html#dx1-25080" >989
    \glsxtrinlinefullplformat  855
    +href="glossaries-extra-manual.html#dx1-25077" >990
    \glsxtrinsertinsidetrue  856
    +href="glossaries-extra-manual.html#dx1-22076" >991
    \GlsXtrLetField  857
    +href="glossaries-extra-manual.html#dx1-37021" >992
    \GlsXtrLetFieldToField  858
    +href="glossaries-extra-manual.html#dx1-37023" >993
    \GlsXtrLoadResources  859
    +href="glossaries-extra-manual.html#dx1-31022" >994
    +\GlsXtrLocationRecordCount  995
    \glsxtrlocrangefmt  860
    +href="glossaries-extra-manual.html#dx1-8078" >996
    \Glsxtrlong  861, 862
    +href="glossaries-extra-manual.html#dx1-20021" >997, 998
    \glsxtrlong  863
    +href="glossaries-extra-manual.html#dx1-20012" >999
    \glsxtrlonghyphen  864
    +href="glossaries-extra-manual.html#dx1-24208" >1000
    \glsxtrlonghyphenshort  865
    +href="glossaries-extra-manual.html#dx1-24192" >1001
    \GLSxtrlongpl  866
    +href="glossaries-extra-manual.html#dx1-20031" >1002
    \Glsxtrlongpl  867
    +href="glossaries-extra-manual.html#dx1-20030" >1003
    + + + \glsxtrlongpl  868
    +href="glossaries-extra-manual.html#dx1-20029" >1004
    \glsxtrlongshortdescsort  869
    +href="glossaries-extra-manual.html#dx1-24051" >1005
    +\glsxtrnewgls  1006
    +\glsxtrnewGLSlike  1007
    +\glsxtrnewglslike  1008
    \glsxtrnewnumber  870
    +href="glossaries-extra-manual.html#dx1-4153" >1009
    +\glsxtrnewrgls  1010
    +\glsxtrnewrGLSlike  1011
    +\glsxtrnewrglslike  1012
    \glsxtrnewsymbol  871
    +href="glossaries-extra-manual.html#dx1-4150" >1013
    \GlsXtrNoGlsWarningAutoMake  872
    +href="glossaries-extra-manual.html#dx1-45017" >1014
    \GlsXtrNoGlsWarningBuildInfo  873
    +href="glossaries-extra-manual.html#dx1-45016" >1015
    \GlsXtrNoGlsWarningCheckFile  874
    +href="glossaries-extra-manual.html#dx1-45012" >1016
    \GlsXtrNoGlsWarningEmptyMain  875
    +href="glossaries-extra-manual.html#dx1-45010" >1017
    \GlsXtrNoGlsWarningEmptyNotMain  876
    +href="glossaries-extra-manual.html#dx1-45011" >1018
    \GlsXtrNoGlsWarningEmptyStart  877
    +href="glossaries-extra-manual.html#dx1-45009" >1019
    \GlsXtrNoGlsWarningHead  878
    +href="glossaries-extra-manual.html#dx1-45008" >1020
    \GlsXtrNoGlsWarningMisMatch  879
    +href="glossaries-extra-manual.html#dx1-45013" >1021
    \GlsXtrNoGlsWarningNoOut  880
    +href="glossaries-extra-manual.html#dx1-45014" >1022
    \GlsXtrNoGlsWarningTail  881
    - - - +href="glossaries-extra-manual.html#dx1-45015" >1023
    \glsxtronlysuffix  882
    +href="glossaries-extra-manual.html#dx1-22075" >1024
    \glsxtrorglong  883
    +href="glossaries-extra-manual.html#dx1-25034" >1025
    \glsxtrorgshort  884
    +href="glossaries-extra-manual.html#dx1-25033" >1026
    \Glsxtrp  885, 1027, 886
    +class="cmti-10">1028
    \glsxtrp  887
    +class="cmti-10">1029
    \glsxtrpageref  888
    +href="glossaries-extra-manual.html#dx1-36004" >1030
    \glsxtrparen  889
    +href="glossaries-extra-manual.html#dx1-22026" >1031
    \Glsxtrpl  890
    +href="glossaries-extra-manual.html#dx1-30015" >1032
    \glsxtrpl  891
    +href="glossaries-extra-manual.html#dx1-30013" >1033
    \glsxtrpostdescription  892
    +href="glossaries-extra-manual.html#dx1-15012" >1034
    \glsxtrposthyphenlong  893
    +href="glossaries-extra-manual.html#dx1-24218" >1035
    \glsxtrposthyphenshort  894
    +href="glossaries-extra-manual.html#dx1-24206" >1036
    \glsxtrpostlink  895
    +href="glossaries-extra-manual.html#dx1-8032" >1037
    \glsxtrpostlinkAddDescOnFirstUse  896
    +href="glossaries-extra-manual.html#dx1-8039" >1038
    \glsxtrpostlinkAddSymbolOnFirstUse  897
    +href="glossaries-extra-manual.html#dx1-8043" >1039
    \glsxtrpostlinkendsentence  898
    +href="glossaries-extra-manual.html#dx1-8033" >1040
    \glsxtrpostlinkhook  899
    +href="glossaries-extra-manual.html#dx1-8030" >1041
    \glsxtrpostlongdescription  900
    +href="glossaries-extra-manual.html#dx1-5027" >1042
    \glsxtrpostnamehook  901
    +href="glossaries-extra-manual.html#dx1-15008" >1043
    \GlsXtrPostNewAbbreviation  902
    +href="glossaries-extra-manual.html#dx1-25019" >1044
    +\glsxtrprelocation  1045, 1046
    \glsxtrprovidestoragekey  903
    +href="glossaries-extra-manual.html#dx1-37006" >1047
    +\GlsXtrRecordCount  1048
    \GlsXtrRecordCounter  904
    +href="glossaries-extra-manual.html#dx1-37046" >1049
    +\glsxtrrecordtriggervalue  1050
    \glsxtrregularfont  905
    +class="cmti-10">1051
    + + + \glsxtrresourcefile  906
    +href="glossaries-extra-manual.html#dx1-31021" >1052
    +\glsxtrresourceinit  1053
    \glsxtrRevertMarks  907
    +href="glossaries-extra-manual.html#dx1-26012" >1054
    \glsxtrscsuffix  908
    +href="glossaries-extra-manual.html#dx1-22040" >1055
    \glsxtrseealsolabels  909
    +class="cmti-10">1056
    \glsxtrseelist  910
    +class="cmti-10">1057
    \GlsXtrSetActualChar  911
    +href="glossaries-extra-manual.html#dx1-29040" >1058
    \glsxtrsetaliasnoindex  912
    +href="glossaries-extra-manual.html#dx1-40016" >1059
    \GlsXtrSetAltModifier  913
    +href="glossaries-extra-manual.html#dx1-8072" >1060
    \glsxtrsetcategory  914
    +href="glossaries-extra-manual.html#dx1-27145" >1061
    \glsxtrsetcategoryforall  915
    +href="glossaries-extra-manual.html#dx1-27147" >1062
    \GlsXtrSetDefaultGlsOpts  916
    +href="glossaries-extra-manual.html#dx1-8066" >1063
    \GlsXtrSetEncapChar  917
    +href="glossaries-extra-manual.html#dx1-29043" >1064
    \GlsXtrSetEscChar  918
    +href="glossaries-extra-manual.html#dx1-29042" >1065
    \GlsXtrSetField  919
    +href="glossaries-extra-manual.html#dx1-37011" >1066
    \glsxtrsetfieldifexists  920
    +href="glossaries-extra-manual.html#dx1-37012" >1067
    \glsxtrsetgrouptitle  921
    +href="glossaries-extra-manual.html#dx1-14006" >1068
    \GlsXtrSetLevelChar  922
    +href="glossaries-extra-manual.html#dx1-29041" >1069
    \glsxtrsetpopts  923
    +class="cmti-10">1070
    +\GlsXtrSetRecordCountAttribute  1071
    \Glsxtrshort  924, 925
    +href="glossaries-extra-manual.html#dx1-20020" >1072, 1073
    \glsxtrshort  926
    +href="glossaries-extra-manual.html#dx1-20010" >1074
    \glsxtrshorthyphenlong  927
    +href="glossaries-extra-manual.html#dx1-24213" >1075
    \GLSxtrshortpl  928
    +href="glossaries-extra-manual.html#dx1-20028" >1076
    \Glsxtrshortpl  929
    - - - +href="glossaries-extra-manual.html#dx1-20027" >1077
    \glsxtrshortpl  930
    +href="glossaries-extra-manual.html#dx1-20026" >1078
    \glsxtrsmsuffix  931
    +href="glossaries-extra-manual.html#dx1-22050" >1079
    \Glsxtrsubsequentfmt  932
    +href="glossaries-extra-manual.html#dx1-25083" >1080
    \glsxtrsubsequentfmt  933
    +href="glossaries-extra-manual.html#dx1-25082" >1081
    \Glsxtrsubsequentplfmt  934
    +href="glossaries-extra-manual.html#dx1-25085" >1082
    \glsxtrsubsequentplfmt  935
    +href="glossaries-extra-manual.html#dx1-25084" >1083
    \glsxtrtagfont  936
    +href="glossaries-extra-manual.html#dx1-19003" >1084
    +\GlsXtrTotalRecordCount  1085
    \glsxtrunsrtdo  937
    +href="glossaries-extra-manual.html#dx1-38023" >1086
    \GlsXtrUseAbbrStyleFmts  938
    +href="glossaries-extra-manual.html#dx1-25089" >1087
    \GlsXtrUseAbbrStyleSetup  939
    +href="glossaries-extra-manual.html#dx1-25040" >1088
    \Glsxtrusefield  940
    +href="glossaries-extra-manual.html#dx1-37033" >1089
    \glsxtrusefield  941
    +href="glossaries-extra-manual.html#dx1-37031" >1090
    \glsxtruserfield  942
    +href="glossaries-extra-manual.html#dx1-24029" >1091
    \glsxtruserparen  943
    +href="glossaries-extra-manual.html#dx1-24032" >1092
    \glsxtrusersuffix  944, 945
    +href="glossaries-extra-manual.html#dx1-22064" >1093, 1094
    \glsxtrusesee  946
    +class="cmti-10">1095
    \glsxtruseseealso  947
    +class="cmti-10">1096
    \glsxtruseseeformat  948, 1097, 949
    +class="cmti-10">1098
    \GlsXtrWarnDeprecatedAbbrStyle  950
    +href="glossaries-extra-manual.html#dx1-22103" >1099
    \GlsXtrWarning  951
    +href="glossaries-extra-manual.html#dx1-30011" >1100
    + + + \glsxtrword  952
    +href="glossaries-extra-manual.html#dx1-27057" >1101
    \glsxtrwordsep  953
    +href="glossaries-extra-manual.html#dx1-27056" >1102
    +\glsxtrwrglossmark  1103

    H hyperref package  954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972
    +href="glossaries-extra-manual.html#dx1-6033" >1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123

    I \ifglsxtrinitwrglossbefore  973
    +class="cmti-10">1124
    +inputenc package  1125

    L link-text  974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992
    +href="glossaries-extra-manual.html#dx1-8001" >1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144
    location list  993, 994, 995, 996, 997
    +href="glossaries-extra-manual.html#dx1-8073" >1145, 1146, 1147, 1148, 1149
    \longnewglossaryentry  998
    +href="glossaries-extra-manual.html#dx1-5025" >1150

    M makeglossaries  999, 1000, 1001, 1002, 1003
    +href="glossaries-extra-manual.html#dx1-3027" >1151, 1152, 1153, 1154, 1155
    \makeglossaries  1004
    +href="glossaries-extra-manual.html#dx1-5042" >1156
    makeglossaries-lite.lua  1005, 1006
    +class="cmtt-10">makeglossaries-lite  1157, 1158
    makeglossaries-lite.lua  1007, 1008
    +class="cmtt-10">makeglossaries-lite  1159, 1160
    makeindex  1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018
    +href="glossaries-extra-manual.html#dx1-3022" >1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173
    makeindex  1019, 1020, 1021, 1022
    +href="glossaries-extra-manual.html#dx1-6028" >1174, 1175, 1176, 1177
    memoir class  1023
    - - - +href="glossaries-extra-manual.html#dx1-3021" >1178
    mfirstuc package  1024, 1025, 1026
    +href="glossaries-extra-manual.html#dx1-5" >1179, 1180, 1181

    N \newabbreviation  1027
    +href="glossaries-extra-manual.html#dx1-18002" >1182
    \newabbreviationstyle  1028
    +href="glossaries-extra-manual.html#dx1-25001" >1183
    \newacronym  1029
    +href="glossaries-extra-manual.html#dx1-18011" >1184
    \newglossaryentry options
        alias  1030, 1031, 1032, 1033, 1034, 1035
    +href="glossaries-extra-manual.html#dx1-5017" >1185, 1186, 1187, 1188, 1189, 1190
        category  1036, 1037, 1038, 1039, 1040
    +href="glossaries-extra-manual.html#dx1-5016" >1191, 1192, 1193, 1194, 1195, 1196
        desc  1041, 1042
    +href="glossaries-extra-manual.html#dx1-43038" >1197, 1198
        descplural  1043, 1044
    +href="glossaries-extra-manual.html#dx1-43042" >1199, 1200
        description  1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063
    +href="glossaries-extra-manual.html#dx1-22098" >1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219
        descriptionplural  1064, 1065, 1066, 1067
    +href="glossaries-extra-manual.html#dx1-5026" >1220, 1221, 1222, 1223
        first  1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080
    +href="glossaries-extra-manual.html#dx1-8013" >1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236
        firstplural  1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090
    +href="glossaries-extra-manual.html#dx1-8014" >1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246
        location  1091
    +href="glossaries-extra-manual.html#dx1-13016" >1247, 1248
    + + +     loclist  1092
    +href="glossaries-extra-manual.html#dx1-38025" >1249
        long  1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101
    +href="glossaries-extra-manual.html#dx1-10026" >1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258
        longplural  1102, 1103, 1104, 1105, 1106, 1107
    +href="glossaries-extra-manual.html#dx1-10010" >1259, 1260, 1261, 1262, 1263, 1264
        name  1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132
    +href="glossaries-extra-manual.html#dx1-5003" >1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293
        parent  1133, 1134, 1135
    +href="glossaries-extra-manual.html#dx1-17050" >1294, 1295, 1296
        plural  1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148
    +href="glossaries-extra-manual.html#dx1-8017" >1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309
        see  1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174
    +href="glossaries-extra-manual.html#dx1-4054" >1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336
        seealso  1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184
    +href="glossaries-extra-manual.html#dx1-4055" >1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346
        short  1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198
    +href="glossaries-extra-manual.html#dx1-8011" >1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360
        shortplural  1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213
    +href="glossaries-extra-manual.html#dx1-10011" >1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375
        sort  1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229
    +href="glossaries-extra-manual.html#dx1-4124" >1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392
        symbol  1230, 1231, 1232
    +href="glossaries-extra-manual.html#dx1-43030" >1393, 1394, 1395
        symbolplural  1233, 1234
    +href="glossaries-extra-manual.html#dx1-43034" >1396, 1397
        text  1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246
    +href="glossaries-extra-manual.html#dx1-5005" >1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410
        type  1247, 1248
    +href="glossaries-extra-manual.html#dx1-12046" >1411, 1412
        user1  1249, 1250, 1251
    +href="glossaries-extra-manual.html#dx1-22080" >1413, 1414, 1415
    number list  1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273
    +href="glossaries-extra-manual.html#dx1-4028" >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

    P package options:
        abbreviations  1274, 1275, 1276, 1277, 1278
    +href="glossaries-extra-manual.html#dx1-4136" >1445, 1446, 1447, 1448, 1449
        accsupp  1279, 1280, 1281
    +href="glossaries-extra-manual.html#dx1-4035" >1450, 1451, 1452
        acronym  1282
    +href="glossaries-extra-manual.html#dx1-4144" >1453
        acronymlists  1283
    - - - +href="glossaries-extra-manual.html#dx1-4148" >1454
        automake  1284, 1285
    +href="glossaries-extra-manual.html#dx1-5050" >1455, 1456
        autoseeindex  1286, 1287
    +href="glossaries-extra-manual.html#dx1-4064" >1457, 1458
            false  1288, 1289
    +href="glossaries-extra-manual.html#dx1-4056" >1459, 1460
    +    debug  1461
    +        all  1462, 1463
    +        showtargets  1464, 1465
    +        showwrgloss  1466, 1467, 1468
    +        true  1469
        docdef  1290, 1291, 1292, 1293
    +href="glossaries-extra-manual.html#dx1-4104" >1470, 1471, 1472, 1473
            restricted  1294
    +href="glossaries-extra-manual.html#dx1-4117" >1474, 1475
            true  1295, 1296
    +href="glossaries-extra-manual.html#dx1-4132" >1476, 1477
        docdefs  1297, 1298, 1299
    +href="glossaries-extra-manual.html#dx1-30003" >1478, 1479, 1480
    +        true  1481
        entrycounter  1300
    +href="glossaries-extra-manual.html#dx1-36002" >1482, 1483
        hyperfirst
            false  1301
    +href="glossaries-extra-manual.html#dx1-27030" >1484
        index  1302, 1303
    +href="glossaries-extra-manual.html#dx1-5039" >1485, 1486
        indexcrossrefs  1304, 1305, 1306, 1307
    +href="glossaries-extra-manual.html#dx1-4053" >1487, 1488, 1489, 1490
    + + +         false  1308
    +href="glossaries-extra-manual.html#dx1-4063" >1491
        indexonlyfirst  1309, 1310, 1311, 1312
    +href="glossaries-extra-manual.html#dx1-6002" >1492, 1493, 1494, 1495
    +    nogroupskip  1496
        nomain  1313
    +href="glossaries-extra-manual.html#dx1-3032" >1497
        nomissingglstext  1314
    +href="glossaries-extra-manual.html#dx1-4135" >1498
        nonumberlist  1315, 1316, 1317, 1318
    +href="glossaries-extra-manual.html#dx1-7026" >1499, 1500, 1501, 1502
        nopostdot  1319, 1320
    +href="glossaries-extra-manual.html#dx1-4023" >1503, 1504, 1505, 1506
            false  1321, 1322, 1323
    +href="glossaries-extra-manual.html#dx1-3004" >1507, 1508, 1509
            true  1324
    +href="glossaries-extra-manual.html#dx1-3003" >1510
        noredefwarn
            false  1325
    +href="glossaries-extra-manual.html#dx1-3009" >1511
            true  1326
    +href="glossaries-extra-manual.html#dx1-3006" >1512
        notree  1327
    +href="glossaries-extra-manual.html#dx1-17034" >1513
        numbers  1328, 1329, 1330
    +href="glossaries-extra-manual.html#dx1-4152" >1514, 1515, 1516
        postdot  1331, 1332
    +href="glossaries-extra-manual.html#dx1-3005" >1517, 1518, 1519
    +    postpunc  1520, 1521, 1522
    +        comma  1523
    +        dot  1524
    +        none  1525
        record  1333, 1334, 1335, 1336, 1337, 1338
    +href="glossaries-extra-manual.html#dx1-4062" >1526, 1527, 1528, 1529, 1530, 1531
            alsoindex  1339, 1340, 1341, 1342
    +href="glossaries-extra-manual.html#dx1-4009" >1532, 1533, 1534, 1535, 1536, 1537
            off  1343, 1344
    +href="glossaries-extra-manual.html#dx1-5045" >1538, 1539
            only  1345, 1346, 1347, 1348, 1349, 1350, 1351
    +href="glossaries-extra-manual.html#dx1-4067" >1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548
    +    section
    +        chapter  1549
        seeautonumberlist  1352
    +href="glossaries-extra-manual.html#dx1-7027" >1550
        seenoindex  1353
    +href="glossaries-extra-manual.html#dx1-7016" >1551
            ignore  1354, 1355
    +href="glossaries-extra-manual.html#dx1-7018" >1552, 1553
            warn  1356
    +href="glossaries-extra-manual.html#dx1-38012" >1554
        shortcuts  1357, 1358
    +href="glossaries-extra-manual.html#dx1-4154" >1555, 1556
            abbr  1359, 1360
    +href="glossaries-extra-manual.html#dx1-4159" >1557, 1558
            abbreviation  1361, 1362
    +href="glossaries-extra-manual.html#dx1-21001" >1559, 1560
            abbreviations  1363
    +href="glossaries-extra-manual.html#dx1-4158" >1561
            ac  1364, 1365, 1366, 1367
    +href="glossaries-extra-manual.html#dx1-4157" >1562, 1563, 1564, 1565, 1566
            acro  1368
    +href="glossaries-extra-manual.html#dx1-4156" >1567
            acronyms  1369
    +href="glossaries-extra-manual.html#dx1-4155" >1568
            all  1370
    +href="glossaries-extra-manual.html#dx1-4169" >1569
            false  1371
    +href="glossaries-extra-manual.html#dx1-4174" >1570
            none  1372
    +href="glossaries-extra-manual.html#dx1-4173" >1571
            other  1373
    +href="glossaries-extra-manual.html#dx1-4160" >1572, 1573
            true  1374
    - - - +href="glossaries-extra-manual.html#dx1-4170" >1574
        sort
            none  1375
    +href="glossaries-extra-manual.html#dx1-4089" >1575, 1576
        stylemods  1376, 1377, 1378
    +href="glossaries-extra-manual.html#dx1-4044" >1577, 1578, 1579, 1580, 1581
    +        all  1582
    +        default  1583
    + + +     subentrycounter  1379
    +href="glossaries-extra-manual.html#dx1-36003" >1584, 1585
        symbols  1380, 1381, 1382
    +href="glossaries-extra-manual.html#dx1-4149" >1586, 1587, 1588
        toc
            false  1383
    +href="glossaries-extra-manual.html#dx1-3002" >1589
            true  1384
    +href="glossaries-extra-manual.html#dx1-3001" >1590
        translate
            babel  1385
    +href="glossaries-extra-manual.html#dx1-3011" >1591
            true  1386
    +href="glossaries-extra-manual.html#dx1-3013" >1592
        undefaction  1387, 1388
    +href="glossaries-extra-manual.html#dx1-4048" >1593, 1594
            error  1389, 1390
    +href="glossaries-extra-manual.html#dx1-4049" >1595, 1596
            warn  1391, 1392, 1393, 1394, 1395
    +href="glossaries-extra-manual.html#dx1-4050" >1597, 1598, 1599, 1600, 1601
        xindy  1396
    +href="glossaries-extra-manual.html#dx1-7046" >1602
    page (counter)  1397, 1398
    +href="glossaries-extra-manual.html#dx1-28028" >1603, 1604
    polyglossia package  1399
    +href="glossaries-extra-manual.html#dx1-45005" >1605
    \pretoglossarypreamble  1400
    +href="glossaries-extra-manual.html#dx1-36011" >1606
    \printabbreviations  1401
    +href="glossaries-extra-manual.html#dx1-4137" >1607
    \printglossary options
        nogroupskip  1608
    +    target  1402, 1403
    +href="glossaries-extra-manual.html#dx1-5014" >1609, 1610
        targetnameprefix  1404
    +href="glossaries-extra-manual.html#dx1-5015" >1611
        title  1405
    +href="glossaries-extra-manual.html#dx1-45006" >1612
    \printnoidxglossary options
        sort  1406
    +href="glossaries-extra-manual.html#dx1-38015" >1613
    \printunsrtglossaries  1407
    +href="glossaries-extra-manual.html#dx1-38016" >1614
    \printunsrtglossary  1408
    +href="glossaries-extra-manual.html#dx1-38001" >1615
    \printunsrtglossary*  1409
    +href="glossaries-extra-manual.html#dx1-38005" >1616
    +\printunsrtglossaryentryprocesshook  1617
    \printunsrtglossaryhandler  1410
    +href="glossaries-extra-manual.html#dx1-38022" >1618
    +\printunsrtglossarypredoglossary  1619
    +\printunsrtglossaryskipentry  1620
    \printunsrtglossaryunit  1411
    +href="glossaries-extra-manual.html#dx1-38029" >1621
    \printunsrtglossaryunitsetup  1412
    +href="glossaries-extra-manual.html#dx1-38030" >1622
    \provideignoredglossary  1413
    +href="glossaries-extra-manual.html#dx1-5011" >1623

    R relsizes package  1414
    +href="glossaries-extra-manual.html#dx1-22048" >1624
    \RestoreAcronyms  1415
    +class="cmti-10">1625
    +\rGLS  1626
    +\rGls  1627
    +\rgls  1628
    +\rGLSformat  1629
    +\rGlsformat  1630
    +\rglsformat  1631
    +\rGLSpl  1632
    +\rGlspl  1633
    + + + +\rglspl  1634
    +\rGLSplformat  1635
    +\rGlsplformat  1636
    +\rglsplformat  1637

    S \setabbreviationstyle  1416
    +href="glossaries-extra-manual.html#dx1-20001" >1638
    slantsc package  1417
    +href="glossaries-extra-manual.html#dx1-26020" >1639
    +style package  1640

    T textcase package  1418
    - - - +href="glossaries-extra-manual.html#dx1-8" >1641
    tracklang package  1419, 1420
    +href="glossaries-extra-manual.html#dx1-4" >1642, 1643, 1644
    translator package  1421
    +href="glossaries-extra-manual.html#dx1-3012" >1645

    X xfor package  1422
    +href="glossaries-extra-manual.html#dx1-9" >1646
    \xglssetwidest  1423
    +href="glossaries-extra-manual.html#dx1-17038" >1647
    \xGlsXtrSetField  1424
    +href="glossaries-extra-manual.html#dx1-37020" >1648
    xindy  1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432
    +href="glossaries-extra-manual.html#dx1-3023" >1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659
    xindy  1433
    +href="glossaries-extra-manual.html#dx1-6032" >1660
    xkeyval package  1434
    +href="glossaries-extra-manual.html#dx1-7" >1661

    1.14.21 was originally intended as the last release of glossaries to incorporate new features, but a few new minor features slipped in with some bug fixes in v4.21.

    -

    2.1The descriptionplural key is a throwback to the base package’s original acronym mechanism before the introduction of the long and short keys, where the long form was stored in the description + id="dx1-5036"> field and the short form was stored in the symbol field.

    -

    3.1For compatibility with earlier versions, \glsabbrvscfont \glsxtrscfont is now deprecated. Likewise for similar commands.

    -

    9.1Version 1.11 only allowed one use of \GlsXtrLoadResources per document.

    -

    9.2v1.08 assumed filename#1={\protect\ttfamily#1}|main}} \index{glsxtrpostlinkcategory=\cs{glsxtrpostlink}\meta{category}|hyperpage}% } -\newcommand*{\styopt}[2][]{% +\renewcommand*{\pkgopt}[2][]{% \hyperlink{styopt.#2}{\pkgoptfmt{#2}}% \ifstrempty{#1}{}{\pkgoptfmt{=#1}}% \ipkgopt[#1]{#2}% } -\newcommand*{\styoptdef}[1]{% +\newcommand*{\pkgoptdef}[1]{% \htarget{styopt.#1}{\pkgoptfmt{#1}}% \ipkgopt{#1}% } @@ -205,13 +210,13 @@ styles (glossaries):>#1={\protect\ttfamily#1}|main}} \DeleteShortVerb{\|} \MakeShortVerb{"} - \title{glossaries-extra.sty v1.20: + \title{glossaries-extra.sty v1.21: an extension to the glossaries package} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} - \date{2017-09-11} + \date{2017-11-03} \maketitle \begin{abstract} @@ -308,7 +313,7 @@ contents). Use \pkgopt[false]{toc} to switch this back off. \item \pkgopt[true]{nopostdot} (suppress the terminating full stop after the description in the glossary). Use -\pkgopt[false]{nopostdot} or just \styopt{postdot} to restore the +\pkgopt[false]{nopostdot} or just \pkgopt{postdot} to restore the terminating full stop (period). \item \pkgopt[true]{noredefwarn} (suppress the warnings that occur when @@ -497,10 +502,93 @@ The new and modified options provided by \styfmt{glossaries-extra} are described below: \begin{description} -\item[{\styoptdef{postdot}}] (New to version 1.12.) + +\item[{\pkgoptdef{debug}}] The \styfmt{glossaries} package +has a \pkgoptfmt{debug} option that allows the values +\pkgoptfmt{false}, \pkgoptfmt{true} and \pkgoptfmt{showtargets}. +The \pkgopt[showtargets]{debug} option was introduced to +\styfmt{glossaries} v4.32, so if you want to use this option +with \styfmt{glossaries-extra} you must make sure that +your version of \styfmt{glossaries} supports it. + +The \styfmt{glossaries-extra} package extends this option +to provide the additional values \pkgopt[showwrgloss]{debug} +and \pkgopt[all]{debug}. + +The \pkgopt[showwrgloss]{debug} option implements +\pkgopt[true]{debug} and uses +\begin{definition}[\DescribeMacro\glsxtrwrglossmark] +\cs{glsxtrwrglossmark} +\end{definition} +to show a mark \ensuremath{\cdot} just before the write operation +performed by the indexing commands. If you use +\pkgopt[alsoindex]{record} there will be a mark for the +write operation to the \texttt{.aux} file for \gls{bib2gls} +and a mark for the write operation to the associated glossary +file for \gls{makeindex} or \gls{xindy}. + +The \pkgopt[all]{debug} option implements both \pkgopt[showtargets]{debug} +and \pkgopt[showwrgloss]{debug}. + +\item[{\pkgoptdef{postdot}}] (New to version 1.12.) This option is just a shortcut for \pkgopt[false]{nopostdot}. -\item[{\styoptdef{accsupp}}] Load the \sty{glossaries-accsupp} +\item[{\pkgoptdef{postpunc}}] (New to version 1.21.) +This option sets the post-description punctuation to the given +value. For example: \pkgoptfmt{postpunc={;}} does +\begin{verbatim} +\renewcommand{\glspostdescription}{;} +\end{verbatim} +The value may also be one of the following keywords: +\begin{description} +\item[\texttt{comma}:] \pkgopt[comma]{postpunc} is +equivalent to +\begin{verbatim} +\renewcommand{\glspostdescription}{,} +\end{verbatim} + +\item[\texttt{dot}:] \pkgopt[dot]{postpunc} is +equivalent to +\begin{verbatim} +\renewcommand{\glspostdescription}{.\spacefactor\sfcode`\. } +\end{verbatim} + +\item[\texttt{none}:] \pkgopt[none]{postpunc} is +equivalent to +\begin{verbatim} +\renewcommand{\glspostdescription}{} +\end{verbatim} +\end{description} +The default definition is +\begin{verbatim} +\newcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi +} +\end{verbatim} +where the conditional is determined by the \pkgopt{nopostdot} +package option. The \pkgopt{postpunc} option removes the conditional +from the definition of \cs{glspostdescription}. The package options +\pkgopt{nopostdot} and \pkgopt{postdot} will restore the original definition of +\cs{glspostdescription}. + +The \sty{glossaries-extra-stylemods} package adjusts +the predefined styles that had a hard-coded \cs{space} +before the \gls{numberlist} so that they use \cs{glsxtrprelocation} +instead (which is defined to \cs{space}). You can therefore +redefine this command in combination with \pkgopt{postpunc} +to alter the separator before the \gls{numberlist}. +For example, to have a comma followed by \cs{hfil}: +\begin{verbatim} +\usepackage[postpunc=comma,stylemods]{glossaries-extra} +\renewcommand{\glsxtrprelocation}{\hfil} +\end{verbatim} +Be careful with doing this as it will look odd if the \gls{numberlist} is +missing. (With \gls{bib2gls} you can instead redefine +\cs{glsxtrprelocation} to do nothing and set the +location prefixes with \texttt{loc-prefix} which will only +apply if the entry has a \gls{numberlist}.) + +\item[{\pkgoptdef{accsupp}}] Load the \sty{glossaries-accsupp} package (if not already loaded). If you want to define styles that can interface with the @@ -518,15 +606,18 @@ a~package option (not through \ics{glossariesextrasetup}) since the \sty{glossar package must be loaded before \styfmt{glossaries-extra} if it's required. -\item[{\styoptdef{stylemods}}] This is a +\item[{\pkgoptdef{stylemods}}] This is a \meta{key}=\meta{value} option used to load the \sty{glossaries-extra-stylemods} package. The value may be a comma-separated list of options to pass to that package. (Remember to group \meta{value} if it contains any commas.) The value may be omitted if no options need to be passed. See \sectionref{sec:glosstylemods} -for further details. +for further details. There are two special keyword values: +\pkgopt[default]{stylemods} (equivalent to omitting the value) +and \pkgopt[all]{stylemods}, which loads all the +predefined styles. -\item[{\styoptdef{undefaction}}] This is a \meta{key}=\meta{value} +\item[{\pkgoptdef{undefaction}}] This is a \meta{key}=\meta{value} option, which has two allowed values: \pkgoptfmt{warn} and \pkgoptfmt{error}. This indicates what to do if an undefined glossary entry is referenced. The default behaviour is @@ -541,7 +632,7 @@ over a glossary list. This includes \ics{forglsentries} and \ics{glsaddall}. \end{important} -\item[{\styoptdef{indexcrossrefs}}] This is a boolean option. +\item[{\pkgoptdef{indexcrossrefs}}] This is a boolean option. If \pkgoptfmt{true}, this will automatically index any cross-referenced entries that haven't been marked as used at the end of the document. Note that this necessarily adds to @@ -549,7 +640,7 @@ the overall document build time, especially if you have defined a large number of entries, so this defaults to \pkgoptfmt{false}, but it will be automatically switched on if you use the \gloskey{see} or \gloskey{seealso} keys in any entries (unless -\styopt[false]{autoseeindex}). To force it off, even if you use the +\pkgopt[false]{autoseeindex}). To force it off, even if you use the \gloskey{see} or \gloskey{seealso} key, you need to explicitly set \pkgopt{indexcrossrefs} to \pkgoptfmt{false}. @@ -558,7 +649,7 @@ entries when it parses the \texttt{.bib} source file. The \pkgopt{record} option automatically implements \pkgopt[false]{indexcrossrefs}. -\item[{\styoptdef{autoseeindex}}]\label{opt:autoseeindex} (New to +\item[{\pkgoptdef{autoseeindex}}]\label{opt:autoseeindex} (New to v1.16.) This is a boolean option. If true (default), this makes the \gloskey{see} and \gloskey{seealso} keys automatically index the cross-reference when an entry is defined. If false, the value @@ -567,7 +658,7 @@ of those keys will still be stored in their corresponding fields \cs{glsxtruseseealso}) but cross-reference won't be automatically indexed. -Note that the \styopt[only]{record} option automatically implements +Note that the \pkgopt[only]{record} option automatically implements \pkgopt[false]{autoseeindex}. For example, if an entry is defined as @@ -586,7 +677,7 @@ but with \texttt{autoseeindex=false}, this is equivalent to \newglossaryentry{foo}{name={foo},description={}} \GlsXtrSetField{foo}{see}{bar,baz} \end{verbatim} -Note that \styopt{indexcrossrefs} isn't automatically implemented +Note that \pkgopt{indexcrossrefs} isn't automatically implemented by the presence of the \gloskey{see} key when \pkgopt{autoseeindex} is false. @@ -600,22 +691,34 @@ open, the information can't be written to it. This will need the package option \pkgoptfmt{seenoindex=ignore} (provided by \styfmt{glossaries}) to prevent an error occurring. -\item[{\styoptdef{record}}]\label{opt:record}(New to v1.08.) This is a \meta{key}=\meta{value} -option, which has three allowed values: \pkgoptfmt{off} (default), -\pkgoptfmt{only} and \pkgoptfmt{alsoindex}. If the value is omitted -\pkgoptfmt{only} is assumed. The option is provided for the benefit -of \gls{bib2gls} (see \sectionref{sec:bib2gls}). +\item[{\pkgoptdef{record}}]\label{opt:record}(New to v1.08.) This is +a \meta{key}=\meta{value} option provided for the benefit of +\gls{bib2gls} (see \sectionref{sec:bib2gls}). -The option may only be set in the preamble. +The option may only be set in the preamble and can't be used after +\cs{GlsXtrLoadResources}. If the value is missing +\pkgopt[only]{record} is assumed. Permitted values: +\begin{description} +\item[\pkgoptfmt{off}] This is the default setting. The indexing +is performed as normal using either \cs{makeglossaries} +or \cs{makenoidxglossaries}. This setting implements \pkgopt[error]{undefaction}. -The \pkgopt[off]{record} option switches off the recording, as per -the default behaviour. It implements \styopt[error]{undefaction}. +\item[\pkgoptfmt{only}] The indexing is performed by +\gls{bib2gls} (see \sectionref{sec:bib2gls}). Neither +\cs{makeglossaries} nor \cs{makenoidxglossaries} is permitted. +This setting implements \pkgopt[warn]{undefaction}. + +The glossaries should be displayed using \cs{printunsrtglossary} +(or \cs{printunsrtglossaries}). + +The document build process is (assuming the file is called +\texttt{myDoc.tex}): +\begin{verbatim} +pdflatex myDoc +bib2gls myDoc +pdflatex myDoc +\end{verbatim} -The other values switch on the recording and also -\styopt[warn]{undefaction}, but \pkgopt[only]{record} -will also switch off the indexing mechanism (even if \cs{makeglossaries} -or \cs{makenoidxglossaries} has been used) whereas -\pkgopt[alsoindex]{record} will both record and index. Note that \pkgopt[only]{record} will prevent the \gloskey{see} from automatically implementing \cs{glssee}. (\gls{bib2gls} deals with the \gloskey{see} field.) You may explicitly use \cs{glssee} in the @@ -627,7 +730,33 @@ the \styfmt{glossaries} package's \pkgopt[none]{sort} option if available. (That option value was only introduced to \styfmt{glossaries} v4.30.) -With the recording on, any of the commands that would typically +\item[\pkgoptfmt{alsoindex}] This is a hybrid setting +that uses \gls{bib2gls} to fetch entry information from +\texttt{.bib} files, but uses \gls{makeindex} or \gls{xindy} +to create the glossary files. This option should be used +with \cs{makeglossaries} but not with its optional argument. +This option should not be used with \cs{makenoidxglossaries}. +You may need to change the transcript file used by \gls{bib2gls} +to avoid a clash with the transcript file used by +\gls{makeindex} or \gls{xindy}. (This can be done with +\gls{bib2gls}['s] \verb|--log-file| or \verb|-t| option.) + +The glossaries should be displayed using \cs{printglossary} +(or \cs{printglossaries}). + +The document build process is (assuming the file is called +\texttt{myDoc.tex}): +\begin{verbatim} +pdflatex myDoc +bib2gls myDoc +pdflatex myDoc +makeglossaries myDoc +pdflatex myDoc +\end{verbatim} +\end{description} + +With the recording on (\pkgopt[only]{record} or +\pkgopt[alsoindex]{record}), any of the commands that would typically index the entry (such as \cs{gls}, \cs{glstext} or \cs{glsadd}) will add a \cs{glsxtr@record} entry to the \texttt{.aux} file. \gls{bib2gls} can then read these lines to find @@ -636,13 +765,14 @@ out which entries have been used. (Remember that commands like add a corresponding \cs{glsxtr@record} entry to the \texttt{.aux} file.) See \sectionref{sec:bib2gls} for further details. -\item[{\styoptdef{docdef}}] This option governs the use of +\item[{\pkgoptdef{docdef}}] This option governs the use of \cs{newglossaryentry}. It was originally a boolean option, but as from version 1.06, it can now take one of three values (if the value is omitted, \pkgoptfmt{true} is assumed): \begin{itemize} \item[{\pkgopt[false]{docdef}}] \ics{newglossaryentry} is not permitted in the \env{document} environment (default). + \item[{\pkgopt[true]{docdef}}] \cs{newglossaryentry} behaves as it does in the base \styfmt{glossaries} package. That is, where its use is permitted in the \env{document} environment, it @@ -655,6 +785,14 @@ even if the glossary occurs before \cs{newglossaryentry}. This method of saving the definitions for the next \LaTeX\ run has drawbacks that are detailed in the \styfmt{glossaries} user manual. + +Remember that if \cs{newglossaryentry} wouldn't be allowed +in the \env{document} environment with the +base \styfmt{glossaries} package, then it still won't +be allowed with \pkgopt[true]{docdefs}. +If your glossaries occur at the end of the document, consider using +\pkgopt[restricted]{docdef} instead. + \item[{\pkgopt[restricted]{docdef}}] (new to version 1.06) \ics{newglossaryentry} is permitted in the \env{document} environment without using the \texttt{.glsdefs} file. This means @@ -673,7 +811,7 @@ remains a preamble-only command. With this option, if an entry appears in the glossary before it has been defined, an error will occur (or a warning if -the \styopt[warn]{undefaction} option is used.) If you edit your +the \pkgopt[warn]{undefaction} option is used.) If you edit your document and either remove an entry or change its label, you may need to delete the document's temporary files (such as the \texttt{.aux} and \texttt{.gls} files). @@ -702,14 +840,14 @@ This option affects commands that internally use the \qt{on-the-fly} commands described in \sectionref{sec:onthefly}. \end{sloppypar} -\item[{\styoptdef{nomissingglstext}}] This is a boolean option. +\item[{\pkgoptdef{nomissingglstext}}] This is a boolean option. If true, this will suppress the warning text that will appear in the document if the external glossary files haven't been generated due to an incomplete document build. However, it's probably simpler just to fix whatever has caused the failure to build the external file or files. -\item[{\styoptdef{abbreviations}}] This option has no value and can't +\item[{\pkgoptdef{abbreviations}}] This option has no value and can't be cancelled. If used, it will automatically create a new glossary with the label \texttt{abbreviations} and redefines \cs{glsxtrabbrvtype} to this @@ -754,7 +892,7 @@ package's \pkgopt{acronymlists} option (or associated commands) as the abbreviation mechanism is handled differently with \styfmt{glossaries-extra}. -\item[{\styoptdef{symbols}}] This is passed to \styfmt{glossaries} but +\item[{\pkgoptdef{symbols}}] This is passed to \styfmt{glossaries} but will additionally define \begin{definition}[\DescribeMacro\glsxtrnewsymbol] \cs{glsxtrnewsymbol}\oarg{options}\marg{label}\marg{symbol} @@ -767,7 +905,7 @@ which is equivalent to Note that the \gloskey{sort} key is set to the \meta{label} not the \meta{symbol} as the symbol will likely contain commands. -\item[{\styoptdef{numbers}}] This is passed to \styfmt{glossaries} but +\item[{\pkgoptdef{numbers}}] This is passed to \styfmt{glossaries} but will additionally define \begin{definition}[\DescribeMacro\glsxtrnewnumber] \cs{glsxtrnewnumber}\oarg{options}\marg{number} @@ -778,12 +916,16 @@ which is equivalent to sort=\marg{label},type=numbers,category=number,\meta{options}\} \end{alltt} -\item[{\styoptdef{shortcuts}}] Unlike the \styfmt{glossaries} package +\item[{\pkgoptdef{shortcuts}}] Unlike the \styfmt{glossaries} package option of the same name, this option isn't boolean but has multiple values: \begin{itemize} \item \pkgopt[acronyms]{shortcuts} (or \pkgopt[acro]{shortcuts}): -set the shortcuts provided by the \styfmt{glossaries} package for acronyms (such as \cs{ac}). +set the shortcuts provided by the \styfmt{glossaries} package for +acronyms (such as \cs{ac}). Note that the short and long forms don't +use \cs{glsxtrshort} and \cs{glsxtrlong} but use the original +\cs{acrshort} and \cs{acrlong}, which don't recognise multiple +abbreviation styles. \item \pkgopt[ac]{shortcuts}: set the shortcuts provided by the \styfmt{glossaries} package for @@ -811,7 +953,7 @@ The \qt{other} shortcuts are: \end{itemize} \item \pkgopt[all]{shortcuts} (or \pkgopt[true]{shortcuts}): -define all the shortcut commands. +implements both \pkgopt[ac]{shortcuts} and \pkgopt[other]{shortcuts} \item \pkgopt[none]{shortcuts} (or \pkgopt[false]{shortcuts}): don't define any of the shortcut commands (default). @@ -826,16 +968,44 @@ set available options using \begin{definition}[\DescribeMacro\glossariesextrasetup] \cs{glossariesextrasetup}\marg{options} \end{definition} -The \styopt{abbreviations} and \styopt{docdef} options may only be -used in the preamble. Additionally, \styopt{docdef} can't be used +The \pkgopt{abbreviations} and \pkgopt{docdef} options may only be +used in the preamble. Additionally, \pkgopt{docdef} can't be used after \ics{makenoidxglossaries}. \chapter{Modifications to Existing Commands and Styles} \label{sec:modifications} +The \styfmt{glossaries} package provides +\begin{definition}[\DescribeMacro\glsseeitemformat] +\cs{glsseeitemformat}\marg{label} +\end{definition} +to format items in a cross-reference list (identified with the +\gloskey{see} key or \cs{glssee}). This was originally defined to +use \cs{glsentryname}\marg{label} since it makes more sense for the +cross-reference to match the way the term appears in the glossary. +Unfortunately this caused a problem when the \gloskey{name} field +was sanitized, which used to be the default setting, so +\styfmt{glossaries} v3.0 changed the default definition of this +command to use \cs{glsentrytext} instead. Since the \gloskey{name} +and \gloskey{text} field are quite often the same, this change +usually doesn't have a noticeable effect. However, now that the +\gloskey{name} field is no longer sanitized (following the redesign +of \styfmt{glossaries} v4.0) it makes more sense to restore this +command to its original behaviour, but to take account of +abbreviations \styfmt{glossaries-extra} redefines this as: +\begin{verbatim} +\renewcommand*{\glsseeitemformat}[1]{% + \glsifregular{#1}{\glsaccessname{#1}}{\glsaccesstext{#1}}% +} +\end{verbatim} +If you want to restore the \styfmt{glossaries} v3.0+ definition just do: +\begin{verbatim} +\renewcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} +\end{verbatim} + The commands used by \styfmt{glossaries} to automatically produce an error if an entry is undefined (such as \ics{glsdoifexists}) are -changed to take the \styopt{undefaction} option into account. +changed to take the \pkgopt{undefaction} option into account. The \ics{newignoredglossary}\marg{type} command now (as from v1.11) has a starred version that doesn't automatically switch off the hyperlinks. @@ -951,6 +1121,11 @@ its original definition in the \styfmt{glossaries} package, otherwise \meta{list} can be a comma-separated list of glossaries that need processing with an external indexing application. +This command is not permitted with the \pkgopt[only]{record} +package option. Without the optional argument, it's permitted +with \pkgopt[alsoindex]{record}. With the optional argument, +it's only permitted with the default \pkgopt[off]{record}. + It should then be possible to use \cs{printglossary} for those glossaries listed in \meta{list} and \cs{printnoidxglossary} for the other glossaries. (See the accompanying file @@ -958,7 +1133,7 @@ for the other glossaries. (See the accompanying file \begin{important} If you use the optional argument \meta{list}, you can't define -entries in the document (even with the \styopt{docdef} option). +entries in the document (even with the \pkgopt{docdef} option). \end{important} You will need at least version 2.20 of \gls{makeglossaries} or at @@ -1029,6 +1204,38 @@ adding \gloskey[glslink]{wrgloss} to the default options in \ics{GlsXtrSetDefaultGlsOpts} will override \cs{glsxtrinitwrgloss}.) +\item[{\gloskey[glslink]{hyperoutside}}] (New to v1.21.) This is a +boolean key. The default is \texttt{hyperoutside=true}, which puts +the hyperlink outside \cs{glstextformat}, so that commands like +\cs{gls} will effectively do +\begin{alltt} +\cs{hyperlink}\marg{target}\{\cs{glstextformat}\marg{link text}\} +\end{alltt} +This is the same behaviour as with the base \styfmt{glossaries} +package. With \texttt{hyperoutside=false}, \cs{hyperlink} is placed +inside the argument of \cs{glstextformat}: +\begin{alltt} +\cs{glstextformat}\{\cs{hyperlink}\marg{target}\marg{link text}\} +\end{alltt} +You can use the \catattr{hyperoutside} category attribute to set +the default for a given category. This can be combined +with the use of the \catattr{textformat} attribute to counteract +any interference caused by \cs{hyperlink}. +For example: +\begin{verbatim} +\glssetcategoryattribute{mathrelation}{hyperoutside}{false} +\end{verbatim} +will set \texttt{hyperoutside=false} for all entries that are +assigned to the category \texttt{mathrelation} and +\begin{verbatim} +\glssetcategoryattribute{mathrelation}{textformat}{mathrel} +\end{verbatim} +will use \cs{mathrel} instead of \cs{glstextformat} resulting in: +\begin{alltt} +\cs{mathrel}\{\cs{hyperlink}\marg{target}\marg{link text}\} +\end{alltt} +for entries with the \gloskey{category} key set to +\texttt{mathrelation}. \end{description} There is a new hook that's used each time indexing information is @@ -1179,7 +1386,7 @@ This modification allows \styfmt{glossaries-extra} to provide \end{definition} which is used at the end of the document to automatically add any unused cross-references unless the package option -\styopt{indexcrossrefs} was set to false. +\pkgopt{indexcrossrefs} was set to false. As a by-product of this enhancement, the \gloskey{see} key will now work for entries defined in the \env{document} environment, but it's still @@ -1347,8 +1554,9 @@ This just does its argument \meta{text} by default. This means that if you want regular entries in a different font but don't want that font to apply to abbreviations, then you can redefine \cs{glsxtrregularfont}. This is more precise than changing -\ics{glstextformat} which will be applied to all linking commands -for all entries. +\ics{glstextformat} which is applied to all linking commands +for all entries, unless overridden by the \catattr{textformat} +attribute. For example: \begin{verbatim} @@ -1360,29 +1568,19 @@ you can query the category: \renewcommand*{\glsxtrregularfont}[1]{% \glsifcategory{\glslabel}{general}{\textsf{#1}}{#1}} \end{verbatim} -or query the category attribute: +or query the category attribute, for example, provide a custom +attribute called \texttt{font}: \begin{verbatim} \glssetcategoryattribute{general}{font}{sf} \renewcommand*{\glsxtrregularfont}[1]{% \glsifattribute{\glslabel}{font}{sf}{\textsf{#1}}{#1}} \end{verbatim} -or use the attribute to store the control sequence name: +As from version 1.21, it's simpler to just do, for example: \begin{verbatim} -\glssetcategoryattribute{general}{font}{textsf} -\glssetcategoryattribute{acronym}{font}{emph} - -\renewcommand*{\glsxtrregularfont}[1]{% - \glshasattribute{\glslabel}{font}% - {\csuse{\glsgetattribute{\glslabel}{font}}{#1}}% - {#1}% -} +\glssetcategoryattribute{general}{textformat}{textsf} \end{verbatim} -(Remember the category and attribute settings will only queried -here for \catattr{regular} entries, so if the abbreviation style -for the \category{acronym} category in the above example changes -the regular attribute to \qt{false}, \cs{glsxtrregularfont} will -no longer apply.) +without redefining \cs{glsxtrregularfont}. The \cs{glspostlinkhook} provided by the \styfmt{glossaries} package to insert information after the \gls{linktext} produced by commands like \cs{gls} and \cs{glstext} is @@ -1625,6 +1823,10 @@ that can accommodate the ranges. \section{Entry Counting Modifications} \label{sec:entrycountmods} +If you are using \gls{bib2gls} you may find it more convenient +to use the record count commands described in +\sectionref{sec:bib2gls} instead. + The \ics{glsenableentrycount} command is modified to allow for the \catattr{entrycount} attribute. This means that you not only need to enable entry counting with @@ -1660,7 +1862,7 @@ the plural may be identical to the singular. To make life easier for languages where the majority of plurals can simply be formed by appending a suffix to the singular, the -\sty{glossaries} package sets lets the \gloskey{plural} field default +\sty{glossaries} package lets the \gloskey{plural} field default to the value of the \gloskey{text} field with \ics{glspluralsuffix} appended. This command is defined to be just the letter \qt{s}. This means that the majority of terms don't need to have the @@ -2260,13 +2462,275 @@ is redefined to use the subsequent use abbreviation font command \ics{glsabbrvfont}. This will be reset if you use \cs{RestoreAcronyms}. +\section{\styfmt{glossary-bookindex} package} +\label{sec:bookindex} + +As from v1.21, \styfmt{glossaries-extra} has a new supplementary +package \sty{glossary-bookindex} which provides the glossary style +\glostyle{bookindex}. This is very similar to the +\glostyle{mcolindexgroup} style but is designed for indexes, so by +default only the name and location list are displayed. You can +either load this package explicitly and then set the style: +\begin{verbatim} +\usepackage{glossaries-extra} +\usepackage{glossary-bookindex} +\setglossarystyle{bookindex} +\end{verbatim} +or use both the \pkgopt{stylemods} and \sty{style} options: +\begin{verbatim} +\usepackage[stylemods=bookindex,style=bookindex]{glossaries-extra} +\end{verbatim} +The \glostyle{bookindex} style only supports a maximum +hierarchical level of 2 (top-level, level~1 and level~2). + +The number of columns is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexcols] +\cs{glsxtrbookindexcols} +\end{definition} +which defaults to 2. + +This style uses the \env{multicols} environment. If +the command +\begin{definition}[\DescribeMacro\glsxtrbookindexcolspread] +\cs{glsxtrbookindexcolspread} +\end{definition} +isn't empty then it's supplied as the optional argument +following \verb|\begin{multicols}|\marg{n}. + +Each top-level entry is displayed using +\begin{definition}[\DescribeMacro\glsxtrbookindexname] +\cs{glsxtrbookindexname}\marg{label} +\end{definition} +where the entry is identified by \meta{label}. This just +does \cs{glossentryname}\marg{label} by default. +For example, if you want the symbol to be included: +\begin{verbatim} +\renewcommand*{\glsxtrbookindexname}[1]{% + \glossentryname{#1}% + \ifglshassymbol{#1}{\space (\glossentrysymbol{#1})}{}% +} +\end{verbatim} +Alternatively you can use the \cs{glsxtrpostname\meta{category}} +hook. + +Sub-entries are displayed using +\begin{definition}[\DescribeMacro\glsxtrbookindexsubname] +\cs{glsxtrbookindexsubname}\marg{label} +\end{definition} +which just defaults to \cs{glsxtrbookindexname}\marg{label}. + +The separator used before the location list for top-level +entries is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexprelocation] +\cs{glsxtrbookindexprelocation}\marg{label} +\end{definition} +where \meta{label} is the entry's label. This checks if +the \texttt{location} field has been set. If it has, it +does +\begin{verbatim} +\ifglsnopostdot,\fi\glsxtrprelocation +\end{verbatim} +otherwise it just does \cs{glsxtrprelocation} (which defaults +to \cs{space}). If you're not using +\gls{bib2gls}, the \gloskey{location} field won't be set. + +The separator used before the +location list for sub-entries is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexsubprelocation] +\cs{glsxtrbookindexsubprelocation}\marg{label} +\end{definition} +which defaults to \cs{glsxtrbookindexprelocation}\marg{label}. + +The separator used between a top-level parent and child entry is +given by +\begin{definition}[\DescribeMacro\glsxtrbookindexparentchildsep] +\cs{glsxtrbookindexparentchildsep} +\end{definition} +This defaults to \cs{nopagebreak}. + +The separator used between a sub-level parent and child entry is +given by +\begin{definition}[\DescribeMacro\glsxtrbookindexparentsubchildsep] +\cs{glsxtrbookindexparentsubchildsep} +\end{definition} +This defaults to \cs{glsxtrbookindexparentchildsep}. + +The separator between top-level entries is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexbetween] +\cs{glsxtrbookindexbetween}\marg{label1}\marg{label2} +\end{definition} +This comes after the entry given by \meta{label1}, if the entry +has no children, or after the last descendent otherwise, +so it always comes immediately before the entry given +by \meta{label2} unless the entry occurs at the start of +a group. This does nothing by default. + +The separator between two level~1 entries is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexsubbetween] +\cs{glsxtrbookindexsubbetween}\marg{label1}\marg{label2} +\end{definition} + +The separator between two level~2 entries is given by +\begin{definition}[\DescribeMacro\glsxtrbookindexsubsubbetween] +\cs{glsxtrbookindexsubsubbetween}\marg{label1}\marg{label2} +\end{definition} +At the end of each letter group, the following hooks +are done in order: +\begin{definition}[\DescribeMacro\glsxtrbookindexsubsubatendgroup] +\cs{glsxtrbookindexsubsubatendgroup}\marg{sub-sub-label} +\end{definition} +\begin{definition}[\DescribeMacro\glsxtrbookindexsubatendgroup] +\cs{glsxtrbookindexsubatendgroup}\marg{sub-label} +\end{definition} +\begin{definition}[\DescribeMacro\glsxtrbookindexatendgroup] +\cs{glsxtrbookindexatendgroup}\marg{label} +\end{definition} +where \meta{sub-sub-label} is the label of the last +level~2 entry, \meta{sub-label} is the label of the last +level~1 entry and \meta{label} is the label of the last +level~0 entry. + +For example, the resource option \texttt{seealso=omit} +instructs \gls{bib2gls} to omit the \texttt{seealso} cross-reference +from the location list. (The \texttt{see} cross-reference +will still be added unless you also have \texttt{see=omit}.) +The \texttt{seealso} cross-reference can instead be appended after +the child entries using: +\begin{verbatim} +\renewcommand{\glsxtrbookindexatendgroup}[1]{% + \glsxtrifhasfield{seealso}{#1}{\glstreesubitem\glsxtruseseealso{#1}}{}% +} +\renewcommand{\glsxtrbookindexbetween}[2]{% + \glsxtrbookindexatendgroup{#1}% +}% + +\renewcommand{\glsxtrbookindexsubatendgroup}[1]{% + \glsxtrifhasfield{seealso}{#1}{\glstreesubsubitem\glsxtruseseealso{#1}}{}% +} + +\renewcommand{\glsxtrbookindexsubbetween}[2]{% + \glsxtrbookindexsubatendgroup{#1}% +} + +\renewcommand{\glsxtrbookindexsubsubatendgroup}[1]{% + \glsxtrifhasfield{seealso}{#1}% + {\glstreeitem\hspace*{40pt}\glsxtruseseealso{#1}}{}% +} + +\renewcommand{\glsxtrbookindexsubsubbetween}[2]{% + \glsxtrbookindexsubsubatendgroup{#1}% +} +\end{verbatim} +This uses \cs{glstreesubitem} and \cs{glstreesubsubitem} +to indent the cross-reference according to the next level down, +so the cross-reference for a top-level entry is aligned with +the sub-entries, and a level~1 entry has its cross-reference +aligned with sub-sub-entries. In the event that a level~2 +entry has a cross-reference, this is indented a bit further +(but it won't be aligned with any deeper level as the +\glostyle{bookindex} style only supports a maximum of two +sub-levels). + +The \glostyle{bookindex} style uses group headings. (If you +use \gls{bib2gls} remember to invoke it with the \verb|--group| +or \verb|-g| switch.) The heading will use +\begin{definition}[\DescribeMacro\glsxtrbookindexbookmark] +\cs{glsxtrbookindexbookmark}\marg{group title}\marg{name} +\end{definition} +If \cs{pdfbookmark} has been defined, this will +use that command to bookmark the group title. If +\pkgopt[chapter]{section} is set (default if chapters are defined) +then this uses level~1 otherwise it uses level~2. You can +redefine this command if this isn't appropriate. +If \cs{pdfbookmark} hasn't been defined, this command does nothin. + +The group heading is formatted according to +\begin{definition}[\DescribeMacro\glsxtrbookindexformatheader] +\cs{glsxtrbookindexformatheader}\marg{group title} +\end{definition} +which is defined as +\begin{verbatim} +\newcommand*{\glsxtrbookindexformatheader}[1]{% + \par{\centering\glstreegroupheaderfmt{#1}\par}% +} +\end{verbatim} +where \cs{glstreegroupheaderfmt} is provided by the +\sty{glossary-tree} package, which is automatically loaded. +Note that the entry names aren't encapsulated with +\cs{glstreenamefmt}. + +The \sty{glossary-bookindex} package provides some supplementary +commands that aren't used by default, but may be used when +adjusting the style. These commands should only be +used within one of the \cs{print\ldots glossary} commands. +(That is, they should only be used in glossary styles.) +\begin{definition}[\DescribeMacro\glsxtrbookindexmarkentry] +\cs{glsxtrbookindexmarkentry}\marg{label} +\end{definition} +This writes information to the \texttt{.aux} file that +can be read on the next run to obtain the first and last entry on +each page of the glossary. + +You can display the first entry +associated with the current page using: +\begin{definition}[\DescribeMacro\glsxtrbookindexfirstmark] +\cs{glsxtrbookindexfirstmark} +\end{definition} +and the last entry associated with the current page +using: +\begin{definition}[\DescribeMacro\glsxtrbookindexlastmark] +\cs{glsxtrbookindexlastmark} +\end{definition} +These do nothing if there are no entries marked on the current page +(or if the document build isn't up to date). + +The entry is formatted using: +\begin{definition}[\DescribeMacro\glsxtrbookindexfirstmarkfmt] +\cs{glsxtrbookindexfirstmarkfmt}\marg{label} +\end{definition} +for the first instance and +\begin{definition}[\DescribeMacro\glsxtrbookindexlastmarkfmt] +\cs{glsxtrbookindexlastmarkfmt}\marg{label} +\end{definition} +for the last. + +These commands are designed for use in page headers or footers +where the page number is stable. For example, \cs{glsxtrbookindexname} +can be redefined to mark the current entry: +\begin{verbatim} +\renewcommand{\glsxtrbookindexname}[1]{% + \glsxtrbookindexmarkentry{#1}% + \glossentryname{#1}% +} +\end{verbatim} +If you only want to mark the top-level entries, remember +to redefine \cs{glsxtrbookindexsubname} as it defaults +to \cs{glsxtrbookindexname}: +\begin{verbatim} +\renewcommand{\glsxtrbookindexsubname}[1]{% + \glossentryname{#1}% +} +\end{verbatim} + +Then if you're using \sty{fancyhdr} you can set the page style +to show the first and last entry for the current page with: +\begin{verbatim} + \pagestyle{fancy}% + \lhead{\thepage}% + \lfoot{\glsxtrbookindexfirstmark}% + \cfoot{}% + \rfoot{\glsxtrbookindexlastmark}% +\end{verbatim} + \section{Glossary Style Modifications} \label{sec:glosstylemods} -The default value of \ics{glslistdottedwidth} is changed so that -it's set at the start of the document (if it hasn't been changed in -the preamble). This should take into account situations where -\cs{hsize} isn't set until the start of the document. +The \sty{glossaries-extra-stylemods} package (more conveniently +loaded through the \styfmt{glossaries-extra} +\pkgopt{stylemods} option) modifies some of the predefined +styles that are provided with the \styfmt{glossaries} package. +These modifications are described in more detail in +\sectionref{sec:stylemods}. The \sty{glossaries} package tries to determine the group title from its label by first checking if @@ -2440,14 +2904,14 @@ passing \meta{name} as a package option to \usepackage{glossaries-extra} \usepackage[longragged]{glossaries-extra-stylemods} \end{verbatim} -Another option is to use the \styopt{stylemods} key when you +Another option is to use the \pkgopt{stylemods} key when you load \styfmt{glossaries-extra}. You can omit a value if you only want to use the predefined styles that are automatically loaded by \styfmt{glossaries} (for example, the \glostyle{long3col} style): \begin{verbatim} \usepackage[style=long3col,stylemods]{glossaries-extra} \end{verbatim} -Or the value of \styopt{stylemods} may be a comma-separated list +Or the value of \pkgopt{stylemods} may be a comma-separated list of the style package identifiers. For example: \begin{verbatim} \usepackage[style=mcoltree,stylemods=mcols]{glossaries-extra} @@ -2471,6 +2935,64 @@ that the modified \glostyle{inline} style isn't affected by the \pkgopt{nopostdot} option, but the post-description category hook can still be used. +The \env{tabular}-like styles, such as \glostyle{long} are +adjusted so that the \ics{ifglsnogroupskip} conditional (set with +\pkgopt{nogroupskip}) is moved outside of the definition of +\cs{glsgroupskip} to avoid problems that cause an \qt{Incomplete +\cs{iftrue}} error with \cs{printunsrtglossary} and +\cs{printnoidxglossary}. This means that if you want to change this +conditional using \cs{setupglossaries} or using the +\gloskey[printglossary]{nogroupskip} option in \cs{printglossary}, +\cs{printnoidxglossary} or \cs{printunsrtglossary}, you must also +reset the glossary style. + +As from version 1.21, the hard-coded \cs{space} before the +\gls{numberlist} in many of the predefined styles is replaced +with +\begin{definition}[\DescribeMacro\glsxtrprelocation] +\cs{glsxtrprelocation} +\end{definition} +This just defaults to \cs{space} but may be redefined as required. +For example: +\begin{verbatim} +\renewcommand{\glsxtrprelocation}{\dotfill} +\end{verbatim} + +The \glostyle{list} styles use +\begin{definition}[\DescribeMacro\glsxtrprelocation] +\cs{glslistprelocation} +\end{definition} +(which defaults to \cs{glsxtrprelocation}) for top-level items and +\begin{definition}[\DescribeMacro\glslistchildprelocation] +\cs{glslistchildprelocation} +\end{definition} +(which defaults to \cs{glslistprelocation}) for child items. + +For just the \glostyle{list} style and its letter group variations +(not the \glostyle{altlist} or \glostyle{listdotted} variations) the +\gls{numberlist} for child entries is followed by +\begin{definition}[\DescribeMacro\glslistchildpostlocation] +\cs{glslistchildpostlocation} +\end{definition} +which defaults to a full stop. + +The default value of \ics{glslistdottedwidth} is changed so that +it's set at the start of the document (if it hasn't been changed in +the preamble). This should take into account situations where +\cs{hsize} isn't set until the start of the document. + +The \glostyle{index}-like and \glostyle{tree}-like styles +insert the pre-\gls{numberlist} space with +\begin{definition}[\DescribeMacro\glstreeprelocation] +\cs{glstreeprelocation} +\end{definition} +(which defaults to \cs{glsxtrprelocation}) for top-level items and +\begin{definition}[\DescribeMacro\glstreechildprelocation] +\cs{glstreechildprelocation} +\end{definition} +(which defaults to \cs{glstreeprelocation}) for child items. + + As from version 1.05, the \styfmt{glossaries-extra-stylemods} package provides some additional commands for use with the \glostyle{alttree} style to make it easier to modify. @@ -2479,10 +3001,17 @@ These commands are only defined if the typically the case unless the \pkgopt{notree} option has been used when loading \styfmt{glossaries}. +\begin{definition}[\DescribeMacro\gglssetwidest] +\cs{gglssetwidest}\oarg{level}\marg{name} +\end{definition} +(New to version 1.21.) +This is like \cs{glssetwidest} (provided by \sty{glossary-tree}) +but performs a global assignment. + \begin{definition}[\DescribeMacro\eglssetwidest] \cs{eglssetwidest}\oarg{level}\marg{name} \end{definition} -This is like \cs{glssetwidest} (provided by \sty{glossary-tree}) +This is like \cs{glssetwidest} but performs a protected expansion on \meta{name}. This has a localised effect. For a global setting, use \begin{definition}[\DescribeMacro\xglssetwidest] @@ -2498,6 +3027,14 @@ for the top-level entries and \end{definition} for sub-entries, where \meta{level} is the level number. +Note that if you are using \gls{bib2gls}, you can use the +resource option \texttt{set-widest} which will try to determine the +widest name of all the selected entries. This isn't guaranteed +to work as it may depend on fonts or commands that \gls{bib2gls} +can't replicate, but it should be suitable for names that just +consist of text, and can be more efficient than iterating over all +the defined entries using \TeX. + The command \cs{glsfindwidesttoplevelname} provided by \sty{glossary-tree} has a CamelCase synonym: \begin{definition}[\DescribeMacro\glsFindWidestTopLevelName] @@ -2701,6 +3238,18 @@ fields, which means they won't be used within commands like Note that \ics{glsxtrlong} and the case-changing variants don't use \cs{glsfirstlongfont}. +You can apply the formatting command used for the short form +to some arbitrary text using +\begin{definition}[\DescribeMacro\glsuseabbrvfont] +\cs{glsuseabbrvfont}\marg{text}\marg{category} +\end{definition} +where \meta{category} is the category label that identifies +the abbreviation style. Similarly for the formatting command +use by the long form: +\begin{definition}[\DescribeMacro\glsuselongfont] +\cs{glsuselongfont}\marg{text}\marg{category} +\end{definition} + \section{Tagging Initials} \label{sec:tagging} @@ -2922,8 +3471,8 @@ entry was defined. If you have mixed styles, you'll need to use \label{sec:abbrshortcuts} The abbreviation shortcut commands can be enabled using -the package option \styopt[abbreviation]{shortcuts} -(or \styopt[abbr]{shortcuts}) or \styopt[ac]{shortcuts}. +the package option \pkgopt[abbreviation]{shortcuts} +(or \pkgopt[abbr]{shortcuts}) or \pkgopt[ac]{shortcuts}. (You can use both settings at the same time.) The provided shortcut commands listed in \tableref{tab:abbrshortcuts}. @@ -3254,12 +3803,14 @@ The new naming scheme for abbreviation styles is as follows: This is for the parenthetical styles. The \texttt{-}\meta{modifier} parts may be omitted. These styles display \meta{field1} followed by -\meta{field2} in parentheses. If \meta{field2} starts with \qt{no} -then the parenthetical element is omitted from the display style but -is included in the inline style. +\meta{field2} in parentheses. If \meta{field1} or \meta{field2} starts +with \qt{no} then that element is omitted from the display style (no +parenthetical part) but is included in the inline style. If the \texttt{-}\meta{modifier} part is present, then the field has -a font changing command applied to it. +a font changing command applied to it. The special modifier +\texttt{-only} indicates that field is only present according to +whether or not the entry has been used. If \texttt{post} is present then \meta{field2} is placed after the \gls{linktext} using the post-link hook. @@ -3377,24 +3928,40 @@ displayed through commands like \ics{glsxtrlong}. \item[\abbrstyledef{short}] A synonym for \abbrstyle{short-nolong}. +\item[\abbrstyledef{nolong-short}] Like \abbrstyle{short-nolong} +but the inline full form displays +\meta{long} (\meta{short}). + \item[\abbrstyledef{short-sc-nolong}] Like \abbrstyle{short-nolong} but redefines \cs{glsabbrvfont} to use \ics{glsabbrvscfont} (which defaults to \cs{textsc}). \item[\abbrstyledef{short-sc}] A synonym for \abbrstyle{short-sc-nolong} +\item[\abbrstyledef{nolong-short-sc}] Like \abbrstyle{short-sc-nolong} +but the inline full form displays +\meta{long} (\meta{short}). + \item[\abbrstyledef{short-sm-nolong}] Like \abbrstyle{short-nolong} but redefines \cs{glsabbrvfont} to use \ics{glsabbrvsmfont} (which defaults to \cs{textsmaller}). \item[\abbrstyledef{short-sm}] A synonym for \abbrstyle{short-sm-nolong}. +\item[\abbrstyledef{nolong-short-sm}] Like \abbrstyle{short-sm-nolong} +but the inline full form displays +\meta{long} (\meta{short}). + \item[\abbrstyledef{short-em-nolong}] Like \abbrstyle{short-nolong} but redefines \cs{glsabbrvfont} to use \ics{glsabbrvemfont}. \item[\abbrstyledef{short-em}] A synonym for \abbrstyle{short-em-nolong} +\item[\abbrstyledef{nolong-short-em}] Like \abbrstyle{short-em-nolong} +but the inline full form displays +\meta{long} (\meta{short}). + \item[\abbrstyledef{short-nolong-desc}] Like the \abbrstyle{short-nolong} style, but the \gloskey{name} is set to the full form and the \gloskey{description} must be supplied by the @@ -3692,6 +4259,10 @@ supplied in the optional argument of \cs{newabbreviation} This is like \abbrstyle{short-nolong} but doesn't set the \catattr{regular} attribute. +\item[\abbrstyledef{nolong-short-noreg}] +This is like \abbrstyle{nolong-short} but doesn't set the +\catattr{regular} attribute. + \item[\abbrstyledef{short-long}] On \gls{firstuse}, this style uses the format \meta{short} (\meta{long}). The inline and display full forms are the same. The \gloskey{name} @@ -4524,7 +5095,7 @@ page styles that display the chapter or section title in the page header using \ics{MakeUppercase}. The \styfmt{glossaries-extra} package tries to resolve this by -modifying \ics{markright} and \ics{markboth}. If you don't like this +modifying \ics{markright} and \ics{markboth} and \cs{@starttoc}. If you don't like this change, you can restore their former definitions using \begin{definition}[\DescribeMacro\glsxtrRevertMarks] \cs{glsxtrRevertMarks} @@ -4536,6 +5107,10 @@ alternative for the table of contents and page header. For example: \begin{verbatim} \chapter[A Chapter about \glsentryshort{html}]{A Chapter about \gls{html}} \end{verbatim} +Alternatively, you need to find a way to insert \cs{glsxtrmarkhook} and +\cs{@glsxtrinmark} at the start of the header or table of contents +either scoped or afterwards cancelled with \cs{@glsxtrnotinmark} and +\cs{glsxtrrestoremarkhook}. If you don't revert the mark commands back with \cs{glsxtrRevertMarks}, you can use the commands described below in @@ -4661,6 +5236,18 @@ and \cs{Glsfmtplural}\marg{label} \end{definition} +Likewise for the value of the +\gloskey{name} field: +\begin{definition}[\DescribeMacro\glsfmtname] +\cs{glsfmtname}\marg{label} +\end{definition} + +First letter converted to upper case: +\begin{definition}[\DescribeMacro\Glsfmtname] +\cs{Glsfmtname}\marg{label} +\end{definition} +(No case-change applied to PDF bookmarks.) + Similarly for the value of the \gloskey{first} field: \begin{definition}[\DescribeMacro\glsfmtfirst] @@ -4709,9 +5296,9 @@ default. Additionally, if you have enabled \ics{newterm} with the \pkgopt{index} package option that command will set the category to \category{index} by default. If you have -enabled \ics{glsxtrnewsymbol} with the \styopt{symbols} package +enabled \ics{glsxtrnewsymbol} with the \pkgopt{symbols} package option, that command will set the category to \category{symbol}. If you have -enabled \ics{glsxtrnewnumber} with the \styopt{numbers} package +enabled \ics{glsxtrnewnumber} with the \pkgopt{numbers} package option, that command will set the category to \category{number}. You can obtain the category label for a given entry using @@ -4974,7 +5561,7 @@ to \ics{glossentryname}. Additionally, if this attribute is set to \qt{uc} the name is converted to all capitals. \item[\catattrdef{indexname}] If set, the \cs{glsxtrpostnamehook} hook -used at the end of \ics{glossentyname} +used at the end of \ics{glossentryname} will index the entry using \ics{index}. See \sectionref{sec:autoindex} for further details. @@ -4994,6 +5581,21 @@ Remember that glossary styles may additionally apply a font change, such as the list styles which put the name in the optional argument of \cs{item}. +\item[\catattrdef{textformat}] (New to version 1.21.) +Commands like \cs{gls} and \cs{glstext} have the link text +encapsulated in the argument of \cs{glstextformat} by default. If +this attribute is set, the control sequence given by the attribute +value will be used instead. As with the above, the attribute value +should be the name (without the leading backslash) of a command that +takes a single argument (the link text). Remember that the +abbreviation styles may apply an additional font change. + +\item[\catattrdef{hyperoutside}] (New to v1.21.) The attribute value +may be \texttt{false}, \texttt{true} or unset. If unset, +\texttt{true} is assumed. This indicates the default setting +of the \gloskey[glslink]{hyperoutside} key, described in +\sectionref{sec:wrglossary}. + \item[\catattrdef{dualindex}] If set, whenever a glossary entry has information written to the external glossary file through commands like \ics{gls} and \ics{glsadd}, a~corresponding @@ -5233,7 +5835,7 @@ commands like \ics{cgls} will generate a warning if shortcut \ics{ab} uses \cs{cgls} (see \sectionref{sec:abbrshortcuts}) unlike the acronym shortcut \ics{ac} which uses \cs{gls} (except when it's defined through -\styopt[ac]{shortcuts}). +\pkgopt[ac]{shortcuts}). All upper case versions (not provided by \styfmt{glossaries}) are also available: @@ -5734,12 +6336,12 @@ The \styfmt{glossaries} package advises against defining entries in the \env{document} environment. As mentioned in \sectionref{sec:pkgopts} above, this ability is disabled by default with \styfmt{glossaries-extra} but can be enabled using -the \styopt{docdefs} package options. +the \pkgopt{docdefs} package options. Although this can be problematic, the \styfmt{glossaries-extra} package provides a way of defining and using entries within the \env{document} environment without the tricks used with the -\styopt{docdefs} option. \emph{There are limitations with this +\pkgopt{docdefs} option. \emph{There are limitations with this approach, so take care with it.} This function is disabled by default, but can be enabled using the preamble-only command: \begin{definition}[\DescribeMacro\GlsXtrEnableOnTheFly] @@ -5932,7 +6534,7 @@ preamble{"\providecommand{\mtx}[1]{\boldsymbol{#1}}"} \end{verbatim} To ensure that \gls{bib2gls} can find out which entries have been -used in the document, you need the \styopt{record} package option: +used in the document, you need the \pkgopt{record} package option: \begin{verbatim} \usepackage[record]{glossaries-extra} \end{verbatim} @@ -5942,7 +6544,7 @@ collate the locations. If you still want to use an indexing application (for example, you need a custom \gls{xindy} rule), then just use -\styopt[alsoindex]{record} and continue to use \cs{makeglossaries} +\pkgopt[alsoindex]{record} and continue to use \cs{makeglossaries} and \cs{printglossary} (or \cs{printglossaries}), but it's a good idea to also instruct \gls{bib2gls} to omit sorting to save time. @@ -5983,8 +6585,8 @@ for example, \meta{filename} happens to be the same as \cs{jobname}. The \texttt{.glstex} extension was enforced by version 1.11.} Since the \texttt{.glstex} won't exist on the first \LaTeX\ run, the -\styopt{record} package option additionally switches on -\styopt[warn]{undefaction}. Any use of commands like \cs{gls} or +\pkgopt{record} package option additionally switches on +\pkgopt[warn]{undefaction}. Any use of commands like \cs{gls} or \cs{glstext} will produce ?? in the document, since they are undefined at this point. Once \gls{bib2gls} has created the \texttt{.glstex} file the references should be resolved. @@ -5992,8 +6594,34 @@ This may cause a shift in the locations if the actual text produced once the entry is defined is larger than the placeholder ?? (as can occur with long citations). +Note that as from v1.12, \cs{glsxtrresourcefile} temporarily +switches the category code of \texttt{@} to 11 (letter) while it +reads the file to allow for any internal commands stored in the +location field. + +\section{Selection} + +The default behaviour is for \gls{bib2gls} to select all entries +that have a record in the \texttt{.aux} file, and any dependent +entries (including parent and cross-references). The +\texttt{glsignore} format (for example, +\verb|\gls[format=glsignore]{duck}|) is recognised by \gls{bib2gls} +as a special ignored record. This means that it will match +the selection criteria but the record won't be added to +the location list. This means that you won't get spurious +commas in the location list, so you can do, for example, +\begin{verbatim} +\GlsXtrSetDefaultNumberFormat{glsignore} +\end{verbatim} +at the start of the front matter and +\begin{verbatim} +\GlsXtrSetDefaultNumberFormat{glsnumberformat} +\end{verbatim} +at the start of the main matter to prevent any records in the +front matter from occurring in the location lists. + \begin{important} -Note that \cs{glsaddall} doesn't work with \gls{bib2gls} as the command +Note that commands like \cs{glsaddall} and \cs{glsaddallunused} don't work with \gls{bib2gls} as the command has to iterate over the internal lists of defined entry labels, which will be empty on the first run and on subsequent runs will only contain those entries that have been selected by \gls{bib2gls}. @@ -6005,16 +6633,38 @@ options list. For example: \begin{verbatim} \GlsXtrLoadResources[src={terms},selection={all}] \end{verbatim} -See the \gls{bib2gls} user manual for more details of this and other -available options. - -Note that as from v1.12, \cs{glsxtrresourcefile} temporarily -switches the category code of \texttt{@} to 11 (letter) while it -reads the file to allow for any internal commands stored in the -location field. - -Since the \texttt{.glstex} file only defines those references used -within the document and the definitions have been written in the +This will add all entries, regardless of whether or not they +have any records in the \texttt{.aux} file. Those that don't +have any records will have an empty location list. +See the \gls{bib2gls} user manual for more details of this option. + +\section{Sorting and Displaying the Glossary} + +There are many sorting options provided by \gls{bib2gls}. +The default is to sort according to the system locale. +If the document has a language setting, you can use +\texttt{sort=doc} to instruct \gls{bib2gls} to sort according to +that. (The language tag obtained from \sty{tracklang}'s +interface is written to the \texttt{.aux} file.) For a multilingual +document you need to explicitly set the locale using a well-formed +language tag. For example: +\begin{verbatim} +\GlsXtrLoadResources[ + src=terms, % data in terms.bib + sort=de-DE-1996 % sort according to this locale +] +\end{verbatim} +The locale-sensitive sort methods usually ignore most +punctuation so for lists of symbols you may find it more +appropriate to use one of the letter-base sort methods +that sort according to the Unicode value of each character. +See the \gls{bib2gls} manual for full details of all the available +sort methods. + +Since the \texttt{.glstex} file only defines those references +required +within the document (selected according to the \texttt{selection} +option) and the definitions have been written in the order corresponding to \gls{bib2gls} sorted list, the glossaries can simply be displayed using \cs{printunsrtglossary} (or \cs{printunsrtglossaries}), described in \sectionref{sec:printunsrt}. @@ -6076,13 +6726,11 @@ different sort methods: \GlsXtrLoadResources[src={terms},sort={en-GB},type=main] -\glsxtrresourcefile +\GlsXtrLoadResources [src={abbrvs},sort={letter-nocase},type=abbreviations] - {\jobname-abr} -\glsxtrresourcefile +\GlsXtrLoadResources [src={symbols},sort={use},type={symbols}] - {\jobname-sym} \begin{document} \gls{bird} @@ -6094,11 +6742,434 @@ different sort methods: \printunsrtglossaries \end{document} \end{verbatim} -(By default, entries are sorted according to the operating system's -locale. If this doesn't match the document language, you need to -set this in the option list, for example \verb|sort=de-CH-1996| -for Swiss German using the new orthography.) +Or you can have multiple instance of \cs{GlsXtrLoadResources} +with the same \texttt{type}, which will produce a glossary +with ordered sub-blocks. For example: +\begin{verbatim} +\documentclass{article} + +\usepackage[record,style=indexgroup]{glossaries-extra} + +\setabbreviationstyle{long-short-desc} + +\GlsXtrLoadResources + [src={abbrvs},sort={letter-nocase},type=main, + group={Abbreviations}] + +\GlsXtrLoadResources + [src={symbols},sort={use},type=main, + group={Symbols}] + +\GlsXtrLoadResources[src={terms},sort={en-GB},type=main] + +\begin{document} +\gls{bird} + +\gls{shtml} + +\gls{M} + +\printunsrtglossaries +\end{document} +\end{verbatim} +This will result in a glossary where the first group has +the title \qt{Abbreviations}, the second group has the +title \qt{Symbols} and then follow the usual letter groups. +Note that for this example to work, you must run \gls{bib2gls} +with the \verb|--group| (or \verb|-g|) switch. For example, +if the document is called \texttt{myDoc.tex}: +\begin{verbatim} +pdflatex myDoc +bib2gls -g myDoc +pdflatex myDoc +\end{verbatim} + +You can provide your own custom sort rule. For example, +if you are using \XeLaTeX\ or \LuaLaTeX: +\begin{alltt} +\cs{GlsXtrLoadResources}[ + src=terms, % entries in terms.bib + sort=custom, % custom sort rule + sort-rule={% required with sort=custom + < \ae;\AE\ < a;\'a;\aa;\"a,\"A;\'A;\AA;\"A < b,B + < c;\'c,C;\'C < d,D < e;\'e,E;\'E < f,F < g,G + < h,H < i;\'i,I;\'I < j,J < l;\l,L;\L < m,M < n,N + < o;\"o;\o,O;\"O;\O\ < p,P < q,Q < r,R < s;\'s,S;\'S + < t,T < u;\'u,U;\'U < v,V < w,W < x,X < y,Y < + z;\.z,Z;\.Z + } +] +\end{alltt} +Remember that if you are using \sty{inputenc} then extended +characters, such as \'e or \o, are active and will expand when +written to the \texttt{.aux} file. So with PDF\LaTeX\ the +above would have to be changed to protect against expansion. +Some of the options, including \texttt{sort-rule}, +may have Unicode characters indicated in the format +\cs{u}\meta{hex} \emph{in the \texttt{.aux} file}. \gls{bib2gls} +will recognise this format as indicating the character +given by the hexadecimal value \meta{hex}. The \cs{u} also needs +protection from expansion, so with a non-Unicode aware +engine the above needs to be written as: +\begin{alltt} +\cs{GlsXtrLoadResources}[ + src=terms, % entries in terms.bib + sort=custom, % custom sort rule + sort-rule={% required with sort=custom + < \cs{string}\cs{u}E6;\cs{string}\cs{u}C6 < a;\cs{string}\cs{u}E1;\cs{string}\cs{u}E5,\cs{string}\cs{u}E4,A;\cs{string}\cs{u}C1;\cs{string}\cs{u}C5;\cs{string}\cs{u}C4 < b,B + < c;\cs{string}\cs{u}0107,C;\cs{string}\cs{u}0106 < d,D < e;\cs{string}\cs{u}E9,E;\cs{string}\cs{u}C9 < f,F < g,G + < h,H < i;\cs{string}\cs{u}ED,I;\cs{string}\cs{u}CD < j,J < l;\cs{string}\cs{u}0142,L;\cs{string}\cs{u}0141 < m,M < n,N + < o;\cs{string}\cs{u}F6;\cs{string}\cs{u}F8,O;\cs{string}\cs{u}D6;\cs{string}\cs{u}D8 < p,P < q,Q < r,R < s;\cs{string}\cs{u}013F,S;\cs{string}\cs{u}015A + < t,T < u;\cs{string}\cs{u}FA,U;\cs{string}\cs{u}DA < v,V < w,W < x,X < y,Y < + z;\cs{string}\cs{u}017C,Z;\cs{string}\cs{u}017B + } +] +\end{alltt} + +\section{Supplementary Commands} + +These commands are provided by \styfmt{glossaries-extra} +for use with \gls{bib2gls}. + +\begin{definition}[\DescribeMacro\glshex] +\cs{glshex} +\end{definition} +This is just defined as \verb|\string\u|, which is required +when you need to indicate a Unicode character in the form +\cs{u}\meta{hex} in some of +the resource options (as described above). + +The information provided with \cs{GlsXtrLoadResources} +is written to the \texttt{.aux} file using +\begin{alltt} +\cs{protected@write}\cs{@auxout}\{\cs{glsxtrresourceinit}\}\marg{information} +\end{alltt} +where \meta{information} is the information to pass to +\gls{bib2gls}. The command in the second argument +\begin{definition}[\DescribeMacro\glsxtrresourceinit] +\cs{glsxtrresourceinit} +\end{definition} +may be used to temporarily redefine commands before the +information is written to the file. This does nothing +by default, but may be redefined to allow the use of +short commands for convenience. For example, with: +\begin{verbatim} +\renewcommand{\glsxtrresourceinit}{\let\u\glshex} +\end{verbatim} +you can just use, for example, \verb|\uE6| instead of +\verb|\string\uE6| in the custom rule. This redefinition of \cs{u} +is scoped so its original definition is restored after the write operation. + +It's possible to specify label prefixes. For example, modifying +the earlier example: +\begin{verbatim} +\documentclass{article} + +\usepackage[record,style=indexgroup]{glossaries-extra} + +\setabbreviationstyle{long-short-desc} + +\GlsXtrLoadResources + [src={abbrvs},sort={letter-nocase},type=main, + label-prefix={abr.}, + group={Abbreviations}] + +\GlsXtrLoadResources + [src={symbols},sort={use},type=main, + label-prefix={sym.}, + group={Symbols}] + +\GlsXtrLoadResources[src={terms},sort={en-GB},type=main + label-prefix={trm.}] + +\begin{document} +\gls{trm.bird} + +\gls{abr.shtml} + +\gls{sym.M} + +\printunsrtglossaries +\end{document} +\end{verbatim} +If you do something like this, you may find it more convenient +to define custom commands that set the prefix. For example: +\begin{verbatim} +\newcommand*{\sym}[2][]{\gls[#1]{sym.#2}} +\end{verbatim} +The problem with this is that the custom command \cs{sym} +does allow for modifiers (such as \cs{gls*} or \cs{gls+}). +Instead you can use: +\begin{definition}[\DescribeMacro\glsxtrnewgls] +\cs{glsxtrnewgls}\oarg{default options}\marg{prefix}\marg{cs} +\end{definition} +which defines the command \meta{cs} that behaves like +\begin{alltt} +\cs{gls}\meta{modifier}[\meta{default options},options]\{\meta{prefix}\meta{label}\}\oarg{insert} +\end{alltt} +For example: +\begin{verbatim} +\glsxtrnewgls{sym.}{\sym} +\end{verbatim} +or (to default to no hyperlinks) +\begin{verbatim} +\glsxtrnewgls[hyper=false]{sym.}{\sym} +\end{verbatim} +now you can use \verb|\sym+{M}| to behave like \verb|\gls+{sym.M}|. + +If you also want the plural and first letter upper case +versions you can use +\begin{definition}[\DescribeMacro\glsxtrnewglslike] +\cs{glsxtrnewglslike}\oarg{default +options}\marg{prefix}\marg{\cs{gls}-like cs}\marg{\cs{glspl}-like cs}\marg{\cs{Gls}-like cs}\marg{\cs{Glspl}-like cs} +\end{definition} +For example: +\begin{verbatim} +\glsxtrnewglslike[hyper=false]{idx.}{\idx}{\idxpl}{\Idx}{\Idxpl} +\end{verbatim} +For the all caps versions: +\begin{definition}[\DescribeMacro\glsxtrnewGLSlike] +\cs{glsxtrnewGLSlike}\oarg{default +options}\marg{prefix}\marg{\cs{GLS}-like cs}\marg{\cs{GLSpl}-like cs} +\end{definition} +For example: +\begin{verbatim} +\glsxtrnewGLSlike[hyper=false]{idx.}{\IDX}{\IDXpl} +\end{verbatim} + +There's an analogous command for \cs{rgls}: +\begin{definition}[\DescribeMacro\glsxtrnewrgls] +\cs{glsxtrnewrgls}\oarg{default options}\marg{prefix}\marg{cs} +\end{definition} +and for \cs{rgls}, \cs{rglspl}, \cs{rGls} +and \cs{rGlspl}: +\begin{definition}[\DescribeMacro\glsxtrnewrglslike] +\cs{glsxtrnewrglslike}\oarg{default +options}\marg{prefix}\marg{\cs{rgls}-like cs}\marg{\cs{rglspl}-like +cs}\marg{\cs{rGls}-like cs}\marg{\cs{rGlspl}-like cs} +\end{definition} +and for the all caps: +\begin{definition}[\DescribeMacro\glsxtrnewrGLSlike] +\cs{glsxtrnewrGLSlike}\oarg{default +options}\marg{prefix}\marg{\cs{rGLS}-like cs}\marg{\cs{rGLSpl}-like cs} +\end{definition} + +\section{Record Counting} + +As from version 1.1 of \gls{bib2gls}, you can save the total +record count for each entry by invoking \gls{bib2gls} +with the \texttt{-{}-record-count} or \texttt{-{}-record-count-unit} +switches. These options will ensure that when each entry +is written to the \texttt{.glstex} file \gls{bib2gls} will +additionally set the following internal fields for that entry: +\begin{itemize} +\item \texttt{recordcount}: set to the total +number of records found for the entry; +\item \texttt{recordcount.\meta{counter}}: set to the total +number of records found for the entry for the given counter. +\end{itemize} +If \texttt{-{}-record-count-unit} is used then additionally: +\begin{itemize} +\item \texttt{recordcount.\meta{counter}.\meta{location}}: set to the total +number of records found for the entry for the given counter with the +given location. +\end{itemize} +Only use the unit counting option if the locations don't contain any special +characters. If you really need it with locations that may contain +formatting commands, then you can try redefining: +\begin{definition}[\DescribeMacro\glsxtrdetoklocation] +\cs{glsxtrdetoklocation}\marg{location} +\end{definition} +so that it detokenizes \meta{location} but take care when +using \cs{GlsXtrLocationRecordCount} with commands like +\cs{thepage} as they can end up becoming detokenized +too early. + +Note that the record count includes locations that \gls{bib2gls} +discards, such as ignored records, duplicates and partial +duplicates. It doesn't include cross-reference records. For +example, if \verb|\gls{bird}| is used twice on page~1, once on +page~2 and fours times on page~3, and +\verb|\gls[counter=section]{bird}| is used once in section~3, then +the total record count (stored in the \texttt{recordcount} field) is +$2+1+4+1=8$, the total for the \texttt{page} counter (stored in the +\texttt{recordcount.page} field) is $2+1+4=7$, and the total for the +\texttt{section} counter (stored in the \texttt{recordcount.section} +field) is 1. + +With the unit counting on as well, the field +\texttt{recordcount.page.1} is set to 2, \texttt{recordcount.page.2} +is set to 1, \texttt{recordcount.page.3} is set to 4 and +\texttt{recordcount.section.3} is set to 1. + +You can access these fields using the following commands which +will expand to the field value if set or to 0 if unset: +\begin{definition}[\DescribeMacro\GlsXtrTotalRecordCount] +\cs{GlsXtrTotalRecordCount}\marg{label} +\end{definition} +This expands to the total record count for the entry given by +\meta{label}. +\begin{verbatim} +\GlsXtrTotalRecordCount{bird} +\end{verbatim} +expands to 8. + +\begin{definition}[\DescribeMacro\GlsXtrRecordCount] +\cs{GlsXtrRecordCount}\marg{label}\marg{counter} +\end{definition} +This expands to the counter total for the entry given by +\meta{label} where \meta{counter} is the counter name. +For example: +\begin{verbatim} +\GlsXtrRecordCount{bird}{page} +\end{verbatim} +expands to 7 and +\begin{verbatim} +\GlsXtrRecordCount{bird}{section} +\end{verbatim} +expands to 1. + +\begin{definition}[\DescribeMacro\GlsXtrLocationRecordCount] +\cs{GlsXtrLocationRecordCount}\marg{label}\marg{counter}\marg{location} +\end{definition} +This expands to the total for the given location. For example +\begin{verbatim} +\GlsXtrLocationRecordCount{bird}{page}{3} +\end{verbatim} +expands to 4. Be careful about using \cs{thepage} in the +\meta{location} part. Remember that due to \TeX's asynchronous +output routine, \cs{thepage} may not be correct. + +There are commands analogous to the entry counting commands like +\cs{cgls} and \cs{cglsformat} that are triggered by the record count. +These are listed below. + +\begin{definition}[\DescribeMacro\rgls] +\cs{rgls}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rglspl] +\cs{rglspl}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGls] +\cs{rGls}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGlspl] +\cs{rGlspl}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGLS] +\cs{rGLS}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGLSpl] +\cs{rGLSpl}\meta{modifier}\oarg{options}\marg{label}\oarg{insert} +\end{definition} +These commands check the \catattr{recordcount} attribute +which, if set, should be a number. For example: +\begin{verbatim} +\glssetcategoryattribute{abbreviation}{recordcount}{1} +\end{verbatim} +For convenience, you can use +\begin{definition}[\DescribeMacro\GlsXtrSetRecordCountAttribute] +\cs{GlsXtrSetRecordCountAttribute}\marg{category list}\marg{n} +\end{definition} +to set the \catattr{recordcount} attribute to \meta{n} +for all the categories listed in \meta{category list}. + +The \cs{rgls}-like commands use +\begin{definition}[\DescribeMacro\glsxtrifrecordtrigger] +\cs{glsxtrifrecordtrigger}\marg{label}\marg{trigger +code}\marg{normal} +\end{definition} +to determine whether the \cs{rgls}-like command should behave like +its \cs{gls} counterpart (\meta{normal}) or whether it should +instead use \meta{trigger code}. + +This command checks if the \catattr{recordcount} attribute is set. +If not is just does \meta{normal}, otherwise it tests +if +\begin{definition}[\DescribeMacro\glsxtrrecordtriggervalue] +\cs{glsxtrrecordtriggervalue}\marg{label} +\end{definition} +is greater than the value given in the \catattr{recordcount} +attribute for that entry's category. If true, this does +\meta{normal} otherwise it does \meta{trigger code}. +The default definition of the trigger value command is: +\begin{verbatim} +\newcommand*{\glsxtrrecordtriggervalue}[1]{% + \GlsXtrTotalRecordCount{#1}% +} +\end{verbatim} +The \meta{trigger code} part writes a record with +the \gloskey[glslink]{format} set to \texttt{glstriggerrecordformat} (which +\gls{bib2gls} v1.1+ recognises as a special type of ignored location +format) and does \meta{trigger format}. Then it +unsets the \gls{firstuseflag}. Note that it doesn't +implement the post-link hook. This ensures that the record +count is correct on the next run. + +The \meta{trigger format} depends on the \cs{rgls}-like +command used and will be one of the following: +\begin{definition}[\DescribeMacro\rglsformat] +\cs{rglsformat}\marg{label}\marg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rglsplformat] +\cs{rglsplformat}\marg{label}\marg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGlsformat] +\cs{rGlsformat}\marg{label}\marg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGlsplformat] +\cs{rGlsplformat}\marg{label}\marg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGLSformat] +\cs{rGLSformat}\marg{label}\marg{insert} +\end{definition} +\begin{definition}[\DescribeMacro\rGLSplformat] +\cs{rGLSplformat}\marg{label}\marg{insert} +\end{definition} +These all behave much like their \cs{cglsformat} counterparts. If +the entry's \catattr{regular} attribute is set or if the entry +doesn't have a long form, the first or first plural is used, +otherwise the long or long plural form is used. + +You can use +\begin{definition}[\DescribeMacro\glsxtrenablerecordcount] +\cs{glsxtrenablerecordcount} +\end{definition} +to redefine \cs{gls}, \cs{glspl}, \cs{Gls}, \cs{Glspl}, +\cs{GLS}, \cs{GLSpl} to \cs{rgls}, \cs{rglspl}, \cs{rGls}, \cs{rGlspl}, +\cs{rGLS}, \cs{rGLSpl}, respectively, for convenience. + +If you don't want the entries that use \meta{trigger code} +to appear in the glossary, you need to use the resource option +\texttt{trigger-type} to assign them to another glossary. +For example: +\begin{verbatim} +\documentclass{article} + +\usepackage[record]{glossaries-extra} + +\newignoredglossary{ignored} + +\GlsXtrLoadResources[ + src=example-glossaries-acronym, + trigger-type=ignored, + category=abbreviation +] + +\glsxtrenablerecordcount +\GlsXtrSetRecordCountAttribute{abbreviation}{1} + +\begin{document} +\gls{lid}. \gls{stc}. \gls{lid}. \gls{aeu}. +\gls{upa}. \gls{aeu}. + +\printunsrtglossaries +\end{document} +\end{verbatim} +In the above, \texttt{stc} and \texttt{upa} both only have +one record, so they are assigned to the \texttt{ignored} +glossary instead of the \texttt{main} one. \chapter{Miscellaneous New Commands} \label{sec:miscnew} @@ -6190,7 +7261,7 @@ command to an argument: \end{definition} This effectively does \begin{alltt} -\cs{glslink}\oarg{options}\marg{label}\marg{\meta{cs}\marg{text}} +\cs{glslink}\oarg{options}\marg{label}\{\meta{cs}\marg{text}\} \end{alltt} where \meta{cs} is the command obtained from the control sequence name supplied in the provided field. If the field @@ -6285,7 +7356,7 @@ assignment code. This command just uses \ics{glsdoifexists}\marg{label}\marg{code} (ignoring the \meta{field} argument), so by default it causes an error if the entry doesn't exist. This can be changed to a warning -with \styopt[warn]{undefaction}. You can redefine +with \pkgopt[warn]{undefaction}. You can redefine \cs{glsxtrsetfieldifexists} to simply do \meta{code} if you want to skip the existence check. Alternatively you can instead use \begin{definition}[\DescribeMacro\glsxtrdeffield] @@ -6358,6 +7429,19 @@ The starred version \end{definition} omits the implicit grouping. +You can test if a field value equals a string using +\begin{definition}[\DescribeMacro{\GlsXtrIfFieldEqStr}] +\cs{GlsXtrIfFieldEqStr}\marg{label}\marg{field}\marg{text}\marg{true}\marg{false} +\end{definition} +If the entry exists and has the given field set to the +given text then this does \meta{true} otherwise it does +\meta{false}. +This is just a shortcut that uses \cs{glsxtrifhasfield} +to test if the field exists and then compares the replacement +text of \cs{glscurrentfieldvalue} with \meta{text} using +\sty{etoolbox}'s \cs{ifdefstring}. + + The \styfmt{glossaries} package provides \ics{glsfieldfetch} which can be used to fetch the value of the given field and store it in a control sequence. The \styfmt{glossaries-extra} package provides @@ -6422,7 +7506,7 @@ See the \sty{etoolbox}'s user manual for further details of these commands, in particular the limitations of \cs{ifinlist}. -When using the \styopt{record} option, in addition to recording the +When using the \pkgopt{record} option, in addition to recording the usual location, you can also record the current value of another counter at the same time using the preamble-only command: \begin{definition}[\DescribeMacro\GlsXtrRecordCounter] @@ -6464,6 +7548,11 @@ iterated over with \cs{glsxtrfielddolistloop} etc. This behaves like \cs{printnoidxglossary} but never sorts the entries and always lists all the defined entries for the given glossary (and doesn't require \cs{makenoidxglossaries}). +If you want to use one of the \env{tabular}-like +styles with \cs{printunsrtglossary}, make sure you load +\sty{glossaries-extra-stylemods} which modifies +the definition of \cs{glsgroupskip} to avoid the +\qt{Incomplete \cs{iftrue}} error that may otherwise occur. There's also a starred form \begin{definition}[\DescribeMacro{\printunsrtglossary*}] @@ -6495,7 +7584,7 @@ If you have any entries with the \gloskey{see} key set, you will need the \sty{glossaries} package option \pkgopt[ignore]{seenoindex} or \pkgopt[warn]{seenoindex} to prevent an error occurring from the automated \cs{glssee} normally triggered by this key. The -\styopt[only]{record} package option will automatically deal with +\pkgopt[only]{record} package option will automatically deal with this. For example: @@ -6516,7 +7605,7 @@ For example: In the above, zebra will be listed before ant as it was defined first. -If you allow document definitions with the \styopt{docdefs} option, +If you allow document definitions with the \pkgopt{docdefs} option, the document will require a second \LaTeX\ run if the entries are defined after \cs{printunsrtglossary}. @@ -6532,13 +7621,38 @@ which is analogous to \cs{printnoidxglossaries}. This just iterates over all defined glossaries (that aren't on the ignored list) and does \cs{printunsrtglossary}[type=\meta{type}]. -The \cs{printunsrtglossary} command internally uses +To avoid complications caused by \env{tabular}-like glossary +styles, \cs{printunsrtglossary} iterates over all entries +in the selected glossary and appends the appropriate code +to an internal command. Once the construction of this +command is complete, then it's performed to display the +glossary. This puts the loop outside the style code. +For convenience, there's a hook used within the loop: +\begin{definition}[\DescribeMacro\printunsrtglossaryentryprocesshook] +\cs{printunsrtglossaryentryprocesshook}\marg{label} +\end{definition} +This hook should not display any content, but may be used +to perform calculations. For example, to calculate widths. +Within this hook you can use: +\begin{definition}[\DescribeMacro\printunsrtglossaryskipentry] +\cs{printunsrtglossaryskipentry} +\end{definition} +to skip the current entry. This will prevent the entry from +being added to the internal command. + +There's another hook immediately before the internal command +containing the glossary code is performed: +\begin{definition}[\DescribeMacro\printunsrtglossarypredoglossary] +\cs{printunsrtglossarypredoglossary} +\end{definition} + +The internal command uses \begin{definition}[\DescribeMacro\printunsrtglossaryhandler] \cs{printunsrtglossaryhandler}\marg{label} \end{definition} -for each item in the list, where \meta{label} is the current label. +to display each item in the list, where \meta{label} is the current label. -By default this just does +By default the handler just does \begin{definition}[\DescribeMacro\glsxtrunsrtdo] \cs{glsxtrunsrtdo}\marg{label} \end{definition} @@ -6546,7 +7660,14 @@ which determines whether to use \cs{glossentry} or \cs{subglossentry} and checks the \gloskey{location} and \gloskey{loclist} fields for the \gls{numberlist}. -You can redefine the handler if required. +You can redefine the handler if required. For example, +you may want to filter entries according to the category +label. You can test if a label is contained in a comma-separated +list of labels using: +\begin{definition}[\DescribeMacro\glsxtriflabelinlist] +\cs{glsxtriflabelinlist}\marg{label}\marg{label list}\marg{true}\marg{false} +\end{definition} +The \meta{label} and \meta{label list} will be fully expanded. \begin{important} If you redefine the handler to exclude entries, you may end @@ -6671,7 +7792,7 @@ which will start the list with a subsection header with the title \qt{Summary} (overriding the glossary's title). Note that this shortcut command is only available with the -\styopt{record} (or \styopt[alsoindex]{record}) package option. +\pkgopt{record} (or \pkgopt[alsoindex]{record}) package option. This temporary change in the hypertarget prefix means you need to explicitly use \cs{hyperlink} to create a link to it @@ -6683,6 +7804,122 @@ matter) which can be the target for all glossary references and then just use \cs{printunsrtglossaryunit} for a quick summary at the start of a section etc. +\section{Standalone Definitions} +\label{sec:glossentry} + +It may be that you don't want a list but would rather display +entry details throughout the document. You can simply +do \cs{glsentryname} followed by \cs{glsentrydesc}. +(Remember that if you don't want a sorted list, use +\pkgopt[none]{sort} to skip the construction of the +\gloskey{sort} field.) +For example, in the preamble provide a custom command: +\begin{verbatim} +\newcommand{\displayterm}[1]{% + \par\medskip\par\noindent + Definition: \glsentryname{#1}.\par + \glsentrydesc{#1} + \par\medskip +} +\end{verbatim} +define your entries +\begin{verbatim} +\newglossaryentry{function}{name={function}, + description={a relation or expression involving variables} +} +\end{verbatim} +and then later in the text: +\begin{verbatim} +\displayterm{function} +\end{verbatim} + +However, if may be that you want to use \sty{hyperref} and +have commands like \cs{gls} link back to the place where +the term is described. Instead of using \cs{glsentryname} +use +\begin{definition}[\DescribeMacro\glsxtrglossentry] +\cs{glsxtrglossentry}\marg{label} +\end{definition} +where \meta{label} is the entry's label. + +This is designed to behave much like the way the name is displayed +in the glossary. It performs the following: +\begin{itemize} +\item Defines \cs{glscurrententrylabel} to the entry's label. +This is usually done at the start of the glossary style commands +\cs{glossentry} and \cs{subglossentry} and may be used by hooks, +such as the post-name hooks. Here the definition is localised +so that it's only available for use in \cs{glossentryname}. + +\item Defines \cs{currentglossary} to the entry's glossary type. +This is usually done at the start of commands like +\cs{printglossary} and may be used by style hooks. +Here the definition is localised so that it's only available for use +in \cs{glsentryitem} and \cs{glssubentryitem}. + +\item Increments and display the entry counters + if the \pkgopt{entrycounter} or \pkgopt{subentrycounter} + package options are set. If the entry has a parent, then + this does + \begin{itemize} + \item \cs{glssubentryitem}\marg{label} + \end{itemize} + otherwise it does + \begin{itemize} + \item \cs{glsentryitem}\marg{label} + \end{itemize} + +\item Sets the hyper-target if supported (using \cs{glstarget}). + +\item Displays the entry name using + \cs{glossentryname}\marg{label}. + Remember that this command uses \cs{glsnamefont} or picks up + the style from category attributes such as + \catattr{glossnamefont}. +\end{itemize} + +This means that my custom command can be changed to: +\begin{verbatim} +\newcommand{\displayterm}[1]{% + \par\medskip\par\noindent + Definition: \glsxtrglossentry{#1}.\par + \glsentrydesc{#1} + \par\medskip +} +\end{verbatim} +If you wanted numbered definitions, then use the +package option \sty{entrycounter} and remove the colon: +\begin{verbatim} +\newcommand{\displayterm}[1]{% + \par\medskip\par\noindent + Definition \glsxtrglossentry{#1}.\par + \glsentrydesc{#1} + \par\medskip +} +\end{verbatim} +The counter label uses a dot after the number by default +but this can be changed to a colon: +\begin{verbatim} +\renewcommand*{\glsentrycounterlabel}{\theglossaryentry:\space}% +\end{verbatim} +You can now not only use \cs{gls} to link back to the +definition but also use \cs{glsrefentry} to reference +the counter and \cs{glsxtrpageref} to reference the page number. + +You can also use \cs{glsxtrglossentry} within section headings. +For example: +\begin{verbatim} +\section{\glsxtrglossentry{function}} +\end{verbatim} +This will use \cs{glsentryname} in PDF bookmarks (if +\cs{texorpdfstring} is defined) and will use \cs{glsxtrheadname} in +page headers and table of contents. (If you're using a page style or +table of contents that doesn't use \cs{markright} or \cs{markbook} +or \cs{@starttoc} then you need to insert \cs{glsxtrmarkhook} and +\cs{@glsxtrinmark} at the start of the header or table of contents +either scoped or afterwards cancelled with \cs{@glsxtrnotinmark} and +\cs{glsxtrrestoremarkhook}.) + \section{Entry Aliases} \label{sec:alias} @@ -6704,7 +7941,7 @@ was defined, the \gloskey{alias} key will automatically trigger \cs{gls}\marg{entry-1} will link to \meta{entry-2}'s target. (Unless the \catattr{targeturl} attribute has been set for \meta{entry-1}'s category.) -\item With \styopt[off]{record} or \styopt[alsoindex]{record}, the \gloskey[glslink]{noindex} setting will automatically be triggered +\item With \pkgopt[off]{record} or \pkgopt[alsoindex]{record}, the \gloskey[glslink]{noindex} setting will automatically be triggered when referencing \meta{entry-1} with commands like \cs{gls} or \cs{glstext}. This prevents \meta{entry-1} from have a \gls{locationlist} (aside from the cross-reference added with @@ -6712,7 +7949,7 @@ when referencing \meta{entry-1} with commands like \cs{gls} or if the indexing has been explicitly set using \texttt{noindex=false}. -Note that with \styopt[only]{record}, the \gls{locationlist} +Note that with \pkgopt[only]{record}, the \gls{locationlist} for aliased entries is controlled with \gls{bib2gls}['s] settings. \end{itemize} @@ -6722,7 +7959,7 @@ The index suppression trigger is performed by \end{definition} This is performed after the default options provided by \ics{GlsXtrSetDefaultGlsOpts} have been set. -With \styopt[only]{record}, \cs{glsxtrsetaliasnoindex} will +With \pkgopt[only]{record}, \cs{glsxtrsetaliasnoindex} will default to do nothing. Within the definition of \cs{glsxtrsetaliasnoindex} you can use @@ -6784,8 +8021,8 @@ Next use: \pgls{svm}. \section{Accessibility Support} \label{sec:accsupp} -The \sty{glossaries-accsupp} needs to be loaded before -\styfmt{glossaries-extra} or through the \styopt{accsupp} package +The \sty{glossaries-accsupp} package needs to be loaded before +\styfmt{glossaries-extra} or through the \pkgopt{accsupp} package option: \begin{verbatim} \usepackage[accsupp]{glossaries-extra} @@ -7112,7 +8349,7 @@ in the supplementary file \texttt{sample-suppl-hyp.tex}. There's only one command provided by \styfmt{glossaries-extra} that you're likely to want to change in your document and that's \ics{abbreviationsname} (\sectionref{sec:pkgopts}) if you use -the \styopt{abbreviations} package option to automatically +the \pkgopt{abbreviations} package option to automatically create the glossary labelled \texttt{abbreviations}. If this command doesn't already exist, it will be defined to \qt{Abbreviations} if \sty{babel} hasn't been loaded, otherwise diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.pdf index 009a541e310..b7af69393a9 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.tex index 7825a22dcb2..e123813d212 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.tex +++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbr-styles.tex @@ -86,6 +86,8 @@ %\teststyle{short}% synonym: short-nolong \teststyle{short-nolong} \teststyle{short-nolong-noreg} +\teststyle{nolong-short} +\teststyle{nolong-short-noreg} %\teststyle{long}% synonym: long-noshort \teststyle{long-noshort} \teststyle{long-noshort-noreg} @@ -94,6 +96,7 @@ \teststyle{short-sc-long} %\teststyle{short-sc}% synonym: short-sc-nolong \teststyle{short-sc-nolong} +\teststyle{nolong-short-sc} \teststyle{long-noshort-sc} %\teststyle{long-sc}% deprecated synonym of long-noshort-sc \teststyle{short-sc-footnote} @@ -104,6 +107,7 @@ \teststyle{short-sm-long} %\teststyle{short-sm}% synonym: short-sm-nolong \teststyle{short-sm-nolong} +\teststyle{nolong-short-sm} %\teststyle{long-sm}% deprecated synonym of long-noshort-sm \teststyle{long-noshort-sm} \teststyle{short-sm-footnote} @@ -116,6 +120,7 @@ \teststyle{short-em-long-em} \teststyle{short-em-nolong} %\teststyle{short-em}% synonym: short-em-nolong +\teststyle{nolong-short-em} \teststyle{long-noshort-em} %\teststyle{long-em}% deprecated synonym of long-noshort-em \teststyle{long-em-noshort-em} diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbrv.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbrv.pdf index bf85bd47982..cae4a8acda7 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbrv.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-abbrv.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-accsupp.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-accsupp.pdf index 7cda7b41e32..e2ec450e18a 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-accsupp.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-accsupp.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym-desc.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym-desc.pdf index febcab39d2a..542918295d4 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym-desc.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym-desc.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym.pdf index 4c353514e87..499e33e96ed 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-acronym.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alias.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alias.pdf index 3b3b47d884d..b1180e4d04a 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alias.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alias.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-altmodifier.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-altmodifier.pdf index a1237da0907..4d7b86d9006 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-altmodifier.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-altmodifier.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-marginpar.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-marginpar.pdf index cd769ec76a7..2a8c0c1387e 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-marginpar.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-marginpar.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.pdf index 780ea7f9db0..dacafc4c07e 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree.pdf index ee67ac81758..117845aea1f 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex-hyp.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex-hyp.pdf index 2b1f6b0d11a..4f30f0108b0 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex-hyp.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex-hyp.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.pdf index 2b9bf20afdd..e33a8609443 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-autoindex.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref.pdf index 5b407335f71..856c9cb2ca3 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref2.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref2.pdf index b18f835acb3..a25f2654db6 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref2.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-crossref2.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-docdef.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-docdef.pdf index 102574c095d..6085431ba82 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-docdef.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-docdef.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-entrycount.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-entrycount.pdf index 3d944f5cbba..b61eae62f1c 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-entrycount.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-entrycount.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-external.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-external.pdf index 8372cf14cee..e786437b228 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-external.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-external.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-fmt.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-fmt.pdf index b2c01f2181d..64808f0761f 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-fmt.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-fmt.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-footnote.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-footnote.pdf index 79aca7ef653..06686623c39 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-footnote.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-footnote.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-header.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-header.pdf index 1737882e6f3..a9c5ce3f8f4 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-header.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-header.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-indexhook.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-indexhook.pdf index 9b1bab71974..9a51935e5e9 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-indexhook.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-indexhook.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-initialisms.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-initialisms.pdf index 24f4354b641..3a46f6ee084 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-initialisms.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-initialisms.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixed-abbrv-styles.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixed-abbrv-styles.pdf index 651b152fd83..d7991202a71 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixed-abbrv-styles.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixed-abbrv-styles.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixedsort.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixedsort.pdf index 6e143a8c950..5963384c8ef 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixedsort.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixedsort.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixture.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixture.pdf index ee11f4ac5ef..6fd87019edf 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixture.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-mixture.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-name-font.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-name-font.pdf index a72fe8f9ba4..8c504cc6305 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-name-font.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-name-font.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-nested.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-nested.pdf index b8006b95067..ee7ba03d0fb 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-nested.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-nested.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-noidx-restricteddocdefs.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-noidx-restricteddocdefs.pdf index 8f08f5482d4..6b4904bc7ac 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-noidx-restricteddocdefs.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-noidx-restricteddocdefs.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onelink.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onelink.pdf index 76f413303a1..2f76c14bbe8 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onelink.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onelink.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-utf8.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-utf8.pdf index e3ac091f528..fc4080e89b6 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-utf8.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-utf8.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-xetex.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-xetex.pdf index 34c921f9aa8..e3f43be5bb3 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-xetex.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-xetex.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly.pdf index b81dc9035a7..dfd83b1dceb 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-pages.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-pages.pdf index 3d3fe73ee15..50a8f3f0004 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-pages.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-pages.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-postdot.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postdot.pdf index 143062734f2..42a9babf2f2 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-postdot.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postdot.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.pdf index af5cdcb258a..3647d34b693 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-postlink.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-prefix.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-prefix.pdf index 7f3430da2f9..d39bd012bdc 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-prefix.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-prefix.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.glstex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.glstex index b52ad045bbd..22a7b8bc1df 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.glstex +++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.glstex @@ -1,7 +1,13 @@ +\glsnoexpandfields +\providecommand{\bibglsusesee}[1]{\glsxtrusesee{#1}} +\providecommand{\bibglsuseseealso}[1]{\glsxtruseseealso{#1}} +\providecommand{\bibglsdelimN}{\delimN} +\providecommand{\bibglslastDelimN}{,~} \providecommand{\bibglsrange}[1]{#1} -\providecommand{\bibglsinterloper}[1]{#1\delimN } +\providecommand{\bibglsinterloper}[1]{#1\bibglsdelimN } \providecommand{\bibglspassimname}{passim} \providecommand{\bibglspassim}{ \bibglspassimname} +\providecommand*{\bibglshyperlink}[2]{\glshyperlink[#1]{#2}} \providecommand{\bibglsseesep}{, } @@ -11,8 +17,8 @@ \appto\glossarypreamble{% \providecommand{\bibglslocprefix}[1]{% \ifcase#1 - \or \unskip , page\bibglspostlocprefix - \else \unskip , pages\bibglspostlocprefix + \or , page\bibglspostlocprefix + \else , pages\bibglspostlocprefix \fi }% } @@ -31,6 +37,7 @@ sort={amet}}% {consectetuer} \glsxtrfieldlistadd{amet}{loclist}{\glsnoidxdisplayloc{}{page}{glsnumberformat}{1}} + \bibglsnewentry{dolor}% {location={\bibglslocprefix{1}\setentrycounter[]{page}\glsnumberformat{1}\bibglslocsuffix{1}}, sort={dolor}}% @@ -38,6 +45,7 @@ sort={dolor}}% {sit} \glsxtrfieldlistadd{dolor}{loclist}{\glsnoidxdisplayloc{}{page}{glsnumberformat}{1}} + \bibglsnewentry{lorem}% {location={\bibglslocprefix{1}\setentrycounter[]{page}\glsnumberformat{1}\bibglslocsuffix{1}}, sort={lorem}}% @@ -45,3 +53,4 @@ sort={lorem}}% {ipsum} \glsxtrfieldlistadd{lorem}{loclist}{\glsnoidxdisplayloc{}{page}{glsnumberformat}{1}} + diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.pdf index d33b91240c9..b1abfde0aa3 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.tex index 760a866f0c4..81606978af8 100644 --- a/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.tex +++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-record.tex @@ -5,14 +5,19 @@ \usepackage[colorlinks]{hyperref} \usepackage[record,% use bib2gls + stylemods,% load glossaries-extra-stylemods.sty style=index]{glossaries-extra} \GlsXtrRecordCounter{section} +% suppress the space that normally occurs before the locations: +\renewcommand{\glsxtrprelocation}{} + \GlsXtrLoadResources[ src={example-glossaries-brief},% entries defined in example-glossaries-brief.bib sort={en-GB},% sort according to en-GB locale - loc-prefix={{\unskip, page},{\unskip, pages}},% prefix for location list + %selection=all,% select all entries provided in the .bib file + loc-prefix={{, page},{, pages}},% prefix for location list loc-suffix% suffix for location list ] @@ -27,8 +32,8 @@ \gls{dolor}, \gls{amet}. -See \url{http://www.dickimaw-books.com/software/bib2gls} for converting -.bib to .glstex files. +See \url{https://ctan.org/pkg/bib2gls} for converting +\texttt{.bib} to \texttt{.glstex} files. \section{Another Section} \printunsrtglossaryunit[nonumberlist]{section} diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-restricteddocdefs.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-restricteddocdefs.pdf index 287ca08da64..2c1e069b722 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-restricteddocdefs.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-restricteddocdefs.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-hyp.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-hyp.pdf index 1bc2dfbb3f6..302c84fa3c9 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-hyp.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-hyp.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main-hyp.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main-hyp.pdf index 34ddde821ad..e636f80f6c7 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main-hyp.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main-hyp.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main.pdf index 31722e07d70..e6b95c246b9 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl-main.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl.pdf index 3a6202a0725..fabffa3e192 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-suppl.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.pdf index b2afc521098..28605012154 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-undef.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-undef.pdf index 28a489fb8aa..c17a7d89070 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-undef.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-undef.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-unitentrycount.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample-unitentrycount.pdf index c624abcfe3d..a99a83c2c61 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample-unitentrycount.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample-unitentrycount.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample.pdf b/Master/texmf-dist/doc/latex/glossaries-extra/sample.pdf index 36a5c63b233..359a8d00366 100644 Binary files a/Master/texmf-dist/doc/latex/glossaries-extra/sample.pdf and b/Master/texmf-dist/doc/latex/glossaries-extra/sample.pdf differ diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx index e5c743bed66..f43abcd99c1 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx @@ -1,21 +1,22 @@ %\iffalse % glossaries-extra.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -comment ".*\.tex" -% -comment ".*\.bib" -% -doc "glossaries-extra-codedoc.tex" -% -macrocode ".*\.tex" -% -macrocode ".*\.bib" -% -section "chapter" -% -setambles ".*\.bib=>\nopreamble\nopostamble" % -author "Nicola Talbot" % -src "glossaries-extra.sty\Z=>glossaries-extra.sty" % -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" +% -src "glossary-bookindex.sty\Z=>glossary-bookindex.sty" % -src "(example-glossaries-.+\.tex)\Z=>\1" % -src "(example-glossaries-.+\.bib)\Z=>\1" +% -section "chapter" +% -macrocode ".*\.tex" +% -macrocode ".*\.bib" +% -comment ".*\.tex" +% -comment ".*\.bib" +% -doc "glossaries-extra-codedoc.tex" +% -setambles ".*\.bib=>\nopreamble\nopostamble" % -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" % glossaries-extra -% Created on 2017/9/11 14:10 +% Created on 2017/11/3 16:35 %\fi %\iffalse %<*package> @@ -125,7 +126,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{17580} +\CheckSum{19892} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -165,13 +166,13 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \raggedright } -\title{glossaries-extra.sty v1.20: +\title{glossaries-extra.sty v1.21: documented code} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} -\date{2017-09-11} +\date{2017-11-03} \begin{document} \DocInput{glossaries-extra.dtx} @@ -216,7 +217,7 @@ Dickimaw Books\\ %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2017/09/11 v1.20 (NLCT)] +\ProvidesPackage{glossaries-extra}[2017/11/03 v1.21 (NLCT)] % \end{macrocode} % Requires \sty{xkeyval} to define package options. % \begin{macrocode} @@ -409,82 +410,158 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%The \pkgopt{record} option is somewhat problematic. On the first +%\LaTeX\ run the entries aren't defined. This isn't as +%straight-forward as commands like \cs{cite} since attributes +%associated with the entry's category may switch off the indexing +%or the entry's glossary type might require a particular counter. +%This kind of information can't be determined until the entry has +%been defined. So there are two different commands here. One that's +%used if the entry hasn't been defined, which tries to use sensible +%defaults, and one which is used when the entry has been defined. +% +%\begin{macro}{\@glsxtr@do@record@wrglossary} +%\changes{1.21}{2017-11-03}{new} +%The \pkgopt[only]{record} option sets \cs{@@do@wrglossary} to this +%command, which means it's done within \cs{glsadd} and +%\cs{@gls@link}, and so is only done if the entry exists. +% \begin{macrocode} +\newcommand*{\@glsxtr@do@record@wrglossary}[1]{% + \begingroup + \ifKV@glslink@noindex + \else + \edef\@gls@label{\glsdetoklabel{#1}}% + \let\glslabel\@gls@label + \glswriteentry{#1}% + {% + \ifdefempty{\@glsxtr@thevalue}% + {% + \ifx\@glsxtr@org@theHvalue\@glsxtr@theHvalue + \else + \let\theHglsentrycounter\@glsxtr@theHvalue + \fi + \glsxtr@saveentrycounter + \let\@@do@@wrglossary\@glsxtr@dorecord + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \let\theHglsentrycounter\@glsxtr@theHvalue + \let\@@do@@wrglossary\@glsxtr@dorecordnodefer + }% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \glsxtr@@do@wrglossary{#1}% + \else + \@@glsxtrwrglossmark + \@@do@@wrglossary + \fi + }% + \fi + \endgroup +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@do@alsoindex@wrglossary} +%\changes{1.21}{2017-11-03}{new} +%The \pkgopt[alsoindex]{record} option needs to both record and +%index. +% \begin{macrocode} +\newcommand*{\glsxtr@do@alsoindex@wrglossary}[1]{% + \glsxtr@@do@wrglossary{#1}% + \@glsxtr@do@record@wrglossary{#1}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@@glsxtr@record} %\changes{1.08}{2016-12-13}{new} -%This is the actual code that does the recording +%The \pkgopt[only]{record} option sets \cs{@glsxtr@record} to this. +%This performs the recording if the entry doesn't exist and is done +%at the start of \cs{@gls@field@link} and commands like \cs{@gls@} +%(before the existence test). This means that it disregards the +%\gloskey[glslink]{wrgloss} key. +% %The first argument is the option list (as passed in the first optional %argument to commands like \cs{gls}). This allows the \gloskey[glslink]{noindex} -%setting to be picked up. The third argument is the key family +%setting to be picked up. The second argument is the entry's label. +% The third argument is the key family %(\texttt{glslink} in most cases, \texttt{glossadd} for \cs{glsadd}). % \begin{macrocode} \newcommand*{\@@glsxtr@record}[3]{% - \begingroup - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \def\@glsxtr@thevalue{}% - \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% - \let\@glsxtr@org@theHvalue\@glsxtr@theHvalue - \ifcsdef{glo@#2@counter}% - {% - \edef\@gls@counter{\csname glo@#2@counter\endcsname}% - }% - {% + \ifglsentryexists{#2}{}% + {% + \@@glsxtrwrglossmark + \begingroup +% \end{macrocode} +%Save the label in case it's needed. +% \begin{macrocode} + \edef\@gls@label{\glsdetoklabel{#2}}% + \let\glslabel\@gls@label + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \let\@glsxtr@org@theHvalue\@glsxtr@theHvalue % \end{macrocode} %Entry hasn't been defined, so we'll have to assume the page number by %default. % \begin{macrocode} \def\@gls@counter{page}% - }% - \setkeys{#3}{#1}% - \ifKV@glslink@noindex - \else - \glswriteentry{#2}% - {% % \end{macrocode} -%Check if \gloskey[glsadd]{thevalue} has been set. +%Check for default options (which may switch off indexing). +%\changes{1.21}{2017-11-03}{added check for default options} % \begin{macrocode} - \ifdefempty{\@glsxtr@thevalue}% + \@gls@setdefault@glslink@opts + \setkeys{#3}{#1}% + \ifKV@glslink@noindex + \else + \glswriteentry{#2}% {% % \end{macrocode} +%Check if \gloskey[glsadd]{thevalue} has been set. +% \begin{macrocode} + \ifdefempty{\@glsxtr@thevalue}% + {% +% \end{macrocode} %Key \gloskey[glsadd]{thevalue} hasn't been set, but check if %\gloskey[glsadd]{theHvalue} has been set. (Not particularly likely, %but allow for it.) % \begin{macrocode} - \ifx\@glsxtr@org@theHvalue\@glsxtr@theHvalue - \else - \let\theHglsentrycounter\@glsxtr@theHvalue - \fi + \ifx\@glsxtr@org@theHvalue\@glsxtr@theHvalue + \else + \let\theHglsentrycounter\@glsxtr@theHvalue + \fi % \end{macrocode} %Save the entry counter. % \begin{macrocode} - \glsxtr@saveentrycounter + \glsxtr@saveentrycounter % \end{macrocode} %Temporarily redefine \cs{@@do@@wrglossary} for use with %\cs{glsxtr@@do@wrglossary}. % \begin{macrocode} - \let\@@do@@wrglossary\@glsxtr@dorecord - }% - {% + \let\@@do@@wrglossary\@glsxtr@dorecord + }% + {% % \end{macrocode} %\gloskey[glsadd]{thevalue} has been set, so there's no need to %defer writing the location value. (If it's dependent on the page %counter, the \gloskey[glslink]{counter} key should be set instead.) % \begin{macrocode} - \let\theglsentrycounter\@glsxtr@thevalue - \let\theHglsentrycounter\@glsxtr@theHvalue - \let\@@do@@wrglossary\@glsxtr@dorecordnodefer - }% - \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex - \glsxtr@@do@wrglossary{#2}% - \else + \let\theglsentrycounter\@glsxtr@thevalue + \let\theHglsentrycounter\@glsxtr@theHvalue + \let\@@do@@wrglossary\@glsxtr@dorecordnodefer + }% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \glsxtr@@do@wrglossary{#2}% + \else % \end{macrocode} -%No need to escape special characters, but need to save the label. +%No need to escape special characters. % \begin{macrocode} - \edef\@gls@label{\glsdetoklabel{#2}}% - \@@do@@wrglossary - \fi - }% - \fi - \endgroup + \@@do@@wrglossary + \fi + }% + \fi + \endgroup + }% } % \end{macrocode} %\end{macro} @@ -577,6 +654,7 @@ Dickimaw Books\\ %Deal with \cs{glssee} in record mode. % \begin{macrocode} \newcommand*{\@glsxtr@recordsee}[2]{% + \@@glsxtrwrglossmark \def\@gls@xref{#2}% \@onelevel@sanitize\@gls@xref \protected@write\@auxout{}{\string\glsxtr@recordsee{#1}{\@gls@xref}}% @@ -597,7 +675,7 @@ Dickimaw Books\\ %\changes{1.08}{2016-12-13}{new} %Initialise. % \begin{macrocode} -\newcommand*{\glsxtr@setup@record}{} +\newcommand*{\glsxtr@setup@record}{\let\@@do@wrglossary\glsxtr@@do@wrglossary} % \end{macrocode} %\end{macro} % @@ -680,6 +758,20 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@record@setting@only} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@record@setting@only}{only} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@record@setting@off} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@record@setting@off}{off} +% \end{macrocode} +%\end{macro} +% %Now define the \pkgopt{record} package option. %\changes{1.08}{2016-12-13}{added \pkgopt{record} package option} % \begin{macrocode} @@ -693,7 +785,7 @@ Dickimaw Books\\ %Don't record. % \begin{macrocode} \def\glsxtr@setup@record{% - \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% + \renewcommand*{\@do@seeglossary}{\@glsxtr@doseeglossary}% \renewcommand*{\@glsxtr@record}[3]{}% \let\@@do@wrglossary\glsxtr@@do@wrglossary \let\@gls@saveentrycounter\glsxtr@indexonly@saveentrycounter @@ -711,7 +803,7 @@ Dickimaw Books\\ \@glsxtr@autoseeindexfalse \let\@do@seeglossary\@glsxtr@recordsee \let\@glsxtr@record\@@glsxtr@record - \let\@@do@wrglossary\@gobble + \let\@@do@wrglossary\@glsxtr@do@record@wrglossary \let\@gls@saveentrycounter\relax \let\glsxtrundefaction\@glsxtr@warn@undefaction \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo @@ -738,9 +830,9 @@ Dickimaw Books\\ %Record and index. % \begin{macrocode} \def\glsxtr@setup@record{% - \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% + \renewcommand*{\@do@seeglossary}{\@glsxtr@dosee@alsoindex@glossary}% \let\@glsxtr@record\@@glsxtr@record - \let\@@do@wrglossary\glsxtr@@do@wrglossary + \let\@@do@wrglossary\glsxtr@do@alsoindex@wrglossary \let\@gls@saveentrycounter\glsxtr@indexonly@saveentrycounter \let\glsxtrundefaction\@glsxtr@warn@undefaction \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo @@ -877,12 +969,78 @@ Dickimaw Books\\ } % \end{macrocode} % +%\begin{macro}{\@glsxtr@defpostpunc} +%Redefines \cs{glspostdescription}. The \pkgopt{postdot} and +%\pkgopt{nopostdot} options will have to redefine this. +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@defpostpunc}{} +% \end{macrocode} +%\end{macro} +% %\begin{option}{postdot} %Shortcut for \pkgopt[false]{nopostdot} %\changes{1.12}{2017-02-03}{new} % \begin{macrocode} \@glsxtr@declareoption{postdot}{% \glsxtr@dooption{nopostdot=false}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi}% + }% +} +% \end{macrocode} +%\end{option} + +%\begin{option}{nopostdot} +%Needs to redefine \cs{@glsxtr@defpostpunc} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\define@choicekey{glossaries-extra.sty}{nopostdot}{true,false}[true]{% + \glsxtr@dooption{nopostdot=#1}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi}% + }% +} +% +%\begin{option}{postpunc} +%Set the post-description punctuation. This also sets +%the \cs{ifglsnopostdot} conditional for easier integration +%with \cs{glsxtrbookindexprelocation} provided by +%\sty{glossary-bookindex}. +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\define@key{glossaries-extra.sty}{postpunc}{% + \glsxtr@dooption{nopostdot=false}% + \ifstrequal{#1}{dot}% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{.\spacefactor\sfcode`\. }% + }% + }% + {% + \ifstrequal{#1}{comma}% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{,}% + }% + }% + {% + \ifstrequal{#1}{none}% + {% + \glsxtr@dooption{nopostdot=true}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{}% + }% + }% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{#1}% + }% + }% + }% + }% } % \end{macrocode} %\end{option} @@ -1063,7 +1221,7 @@ Dickimaw Books\\ %\pkgopt[all]{shortcuts} as it conflicts with other shortcuts). % \begin{macrocode} \define@choicekey{glossaries-extra.sty}{shortcuts}[\val\nr]% - {acronyms,acro,abbreviations,abbr,other,all,true,none,false,ac}[true]{% + {acronyms,acro,abbreviations,abbr,other,all,true,ac,none,false}[true]{% \let\@glsxtr@shortcutsval\val \ifcase\nr\relax % acronyms \renewcommand*{\@glsxtr@setupshortcuts}{% @@ -1090,24 +1248,38 @@ Dickimaw Books\\ \or % all \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue - \DefineAcronymSynonyms +% \end{macrocode} +%\changes{1.21}{2017-11-03}{changed true setting to use shortcuts=ac +%instead of shortcuts=acronym} +% \begin{macrocode} + \GlsXtrDefineAcShortcuts \GlsXtrDefineAbbreviationShortcuts \GlsXtrDefineOtherShortcuts }% \or % true \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue - \DefineAcronymSynonyms +% \end{macrocode} +%\changes{1.21}{2017-11-03}{changed true setting to use shortcuts=ac +%instead of shortcuts=acronym} +% \begin{macrocode} + \GlsXtrDefineAcShortcuts \GlsXtrDefineAbbreviationShortcuts \GlsXtrDefineOtherShortcuts }% - \or % none, false - \renewcommand*{\@glsxtr@setupshortcuts}{}% +% \end{macrocode} +%\changes{1.21}{2017-11-03}{corrected shortcuts=ac} +% \begin{macrocode} \or % ac \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue \GlsXtrDefineAcShortcuts }% +% \end{macrocode} +%Leave none and false as last option. +% \begin{macrocode} + \else % none, false + \renewcommand*{\@glsxtr@setupshortcuts}{}% \fi } % \end{macrocode} @@ -1176,23 +1348,32 @@ Dickimaw Books\\ \RequirePackage{glossaries-extra-stylemods}}% }% {% - \renewcommand*{\@glsxtr@redefstyles}{}% - \@for\@glsxtr@tmp:=#1\do{% - \IfFileExists{glossary-\@glsxtr@tmp.sty}% - {% - \eappto\@glsxtr@redefstyles{% - \noexpand\RequirePackage{glossary-\@glsxtr@tmp}}% - }% - {% - \PackageError{glossaries-extra}% - {Glossaries style package `glossary-\@glsxtr@tmp.sty' - doesn't exist (did you mean to use the `style' key?)}% - {The list of values (#1) in the `stylemods' key should - match the glossary-xxx.sty files provided with - glossaries.sty}% + \ifstrequal{#1}{all}% + {% + \renewcommand*{\@glsxtr@redefstyles}{% + \PassOptionsToPackage{all}{glossaries-extra-stylemods}% + \RequirePackage{glossaries-extra-stylemods}% }% }% - \appto\@glsxtr@redefstyles{\RequirePackage{glossaries-extra-stylemods}}% + {% + \renewcommand*{\@glsxtr@redefstyles}{}% + \@for\@glsxtr@tmp:=#1\do{% + \IfFileExists{glossary-\@glsxtr@tmp.sty}% + {% + \eappto\@glsxtr@redefstyles{% + \noexpand\RequirePackage{glossary-\@glsxtr@tmp}}% + }% + {% + \PackageError{glossaries-extra}% + {Glossaries style package `glossary-\@glsxtr@tmp.sty' + doesn't exist (did you mean to use the `style' key?)}% + {The list of values (#1) in the `stylemods' key should + match the glossary-xxx.sty files provided with + glossaries.sty}% + }% + }% + \appto\@glsxtr@redefstyles{\RequirePackage{glossaries-extra-stylemods}}% + } }% } % \end{macrocode} @@ -1229,6 +1410,58 @@ Dickimaw Books\\ % \end{macrocode} %\end{option} % +%\begin{macro}{\@glsxtrwrglossmark} +%\changes{1.21}{2017-11-03}{new} +%Marks the place where indexing occurs. +%Does nothing by default. +% \begin{macrocode} +\newcommand*{\@glsxtrwrglossmark}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glsxtrwrglossmark} +%\changes{1.21}{2017-11-03}{new} +%Since \cs{glsadd} can be used in the preamble, this action needs to +%be disabled until the start of the document. +% \begin{macrocode} +\newcommand*{\@@glsxtrwrglossmark}{} +\AtBeginDocument{\renewcommand*{\@@glsxtrwrglossmark}{\@glsxtrwrglossmark}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrwrglossmark} +%\changes{1.21}{2017-11-03}{new} +%Does nothing by default. +% \begin{macrocode} +\newcommand*{\glsxtrwrglossmark}{\ensuremath{\cdot}} +% \end{macrocode} +%\end{macro} +% +%\begin{option}{debug} +%\changes{1.21}{2017-11-03}{new} +% Provide extra debug options. +% \begin{macrocode} +\define@choicekey{glossaries-extra.sty}{debug}[\val\nr]% + {true,false,showtargets,showwrgloss,all}[true]{% + \ifcase\nr\relax % true + \glsxtr@dooption{debug=true}% + \renewcommand*{\@glsxtrwrglossmark}{}% + \or % false + \glsxtr@dooption{debug=false}% + \renewcommand*{\@glsxtrwrglossmark}{}% + \or % showtargets + \glsxtr@dooption{debug=showtargets}% + \or % showwrgloss + \glsxtr@dooption{debug=true}% + \renewcommand*{\@glsxtrwrglossmark}{\glsxtrwrglossmark}% + \or % all + \glsxtr@dooption{debug=showtargets}% + \renewcommand*{\@glsxtrwrglossmark}{\glsxtrwrglossmark}% + \fi + } +% \end{macrocode} +%\end{option} +% % Pass all other options to \styfmt{glossaries}. % \begin{macrocode} \DeclareOptionX*{% @@ -1246,6 +1479,34 @@ Dickimaw Books\\ % \begin{macrocode} \@glsxtr@doaccsupp % \end{macrocode} +% Redefine \cs{glspostdescription} if required. +% \begin{macrocode} +\@glsxtr@defpostpunc +% \end{macrocode} +% +%\begin{macro}{\glsshowtarget} +%This command was introduced to \sty{glossaries} v4.32 so it may not +%be defined. Therefore it's defined here using \cs{def}. +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\def\glsshowtarget#1{% + \glsxtrtitleorpdforheading + {% + \ifmmode + \texttt{\small [#1]}% + \else + \ifinner + \texttt{\small [#1]}% + \else + \marginpar{\texttt{\small #1}}% + \fi + \fi + }% + {[#1]}% + {\texttt{\small [#1]}}% +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\@glsxtr@org@doseeglossary} %Save original definition of \cs{@do@seeglossary} @@ -1254,6 +1515,29 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@doseeglossary} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@doseeglossary}[2]{% + \glsdoifexists{#1}% + {% + \@@glsxtrwrglossmark + \@glsxtr@org@doseeglossary{#1}{#2}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@dosee@alsoindex@glossary} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@dosee@alsoindex@glossary}[2]{% + \@glsxtr@recordsee{#1}{#2}% + \@glsxtr@doseeglossary{#1}{#2}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@org@gloautosee} %\changes{1.14}{2017-04-18}{new} %Save and restore original definition of \cs{@glo@autosee}. @@ -1342,11 +1626,22 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtr@org@@do@wrglossary} +%\changes{1.21}{2017-11-03}{new} +%Save original definition of \cs{@@do@wrglossary}. +% \begin{macrocode} +\let\glsxtr@org@@do@wrglossary\@@do@wrglossary +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtr@@do@wrglossary} %\changes{1.08}{2016-12-13}{new} -%Save original definition of \cs{@@do@wrglossary}. +%The new version adds code that can show a marker for debugging. % \begin{macrocode} -\let\glsxtr@@do@wrglossary\@@do@wrglossary +\newcommand*{\glsxtr@@do@wrglossary}[1]{% + \@@glsxtrwrglossmark + \glsxtr@org@@do@wrglossary{#1}% +} % \end{macrocode} %\end{macro} % @@ -1670,15 +1965,16 @@ Dickimaw Books\\ % %\begin{macro}{\s@glsxtrifhasfield} %\changes{1.19}{2017-09-09}{new} +%\changes{1.21}{2017-11-03}{switched from \cs{ifdef} to \cs{ifundef}} % Starred version omits grouping. % \begin{macrocode} \newcommand{\s@glsxtrifhasfield}[4]{% \letcs{\glscurrentfieldvalue}{glo@\glsdetoklabel{#2}@#1}% - \ifdef\glscurrentfieldvalue + \ifundef\glscurrentfieldvalue + {#4}% {% \ifdefempty\glscurrentfieldvalue{#4}{#3}% }% - {#4}% } % \end{macrocode} %\end{macro} @@ -1808,6 +2104,19 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\GlsXtrIfFieldEqStr} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newrobustcmd*{\GlsXtrIfFieldEqStr}[5]{% + \glsxtrifhasfield{#1}{#2}% + {% + \ifdefstring{\glscurrentfieldvalue}{#3}{#4}{#5}% + }% + {#5}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtrpageref} % Like \cs{glsrefentry} but references the page number instead (if % entry counting is on). @@ -2304,6 +2613,22 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsseeitemformat} +%\changes{1.21}{2017-11-03}{new} +%\styfmt{glossaries} originally defined \cs{glsseeitemformat} +%to use \cs{glsentryname} but in v3.0 this was switched to +%use \cs{glsentrytext} due to problems occurring with the +%\gloskey{name} field being sanitized. Since this is no longer a +%problem, \styfmt{glossaries-extra} restores the original +%definition as it makes more sense to use the \gloskey{name} +%in the cross-reference list. +% \begin{macrocode} +\renewcommand*{\glsseeitemformat}[1]{% + \glsifregular{#1}{\glsaccessname{#1}}{\glsaccesstext{#1}}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtruseseealso} %\changes{1.16}{2017-06-15}{new} %Apply \cs{glsseeformat} to the \gloskey{seealso} key if not empty. @@ -2383,17 +2708,25 @@ Dickimaw Books\\ % \end{macrocode} %This essentially works like \cs{@do@seeglossary} but uses the %\texttt{seealso} class. +%\changes{1.21}{2017-11-03}{added check that the entry exists} % \begin{macrocode} \newrobustcmd*{\glsxtrindexseealso}[2]{% - \def\@gls@xref{#2}% - \@onelevel@sanitize\@gls@xref - \@gls@checkmkidxchars\@gls@xref - \gls@glossary{\csname glo@#1@type\endcsname}{% - (indexentry - :tkey (\csname glo@#1@index\endcsname) - :xref (\string"\@gls@xref\string") - :attr \string"seealso\string" - ) + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \@glsxtr@recordsee{#1}{#2}% + \fi + \glsdoifexists{#1}% + {% + \@@glsxtrwrglossmark + \def\@gls@xref{#2}% + \@onelevel@sanitize\@gls@xref + \@gls@checkmkidxchars\@gls@xref + \gls@glossary{\csname glo@#1@type\endcsname}{% + (indexentry + :tkey (\csname glo@#1@index\endcsname) + :xref (\string"\@gls@xref\string") + :attr \string"seealso\string" + ) + }% }% } } @@ -2633,39 +2966,68 @@ Dickimaw Books\\ %\begin{macro}{\makenoidxglossaries} %Modify \cs{makenoidxglossaries} so that it automatically switches %off (unless the restricted setting is on) and disables the \pkgopt{docdef} key. +%This command isn't allow with the \pkgopt{record} option. % \begin{macrocode} \let\glsxtr@orgmakenoidxglossaries\makenoidxglossaries \renewcommand{\makenoidxglossaries}{% - \glsxtr@orgmakenoidxglossaries - \if@glsxtrdocdefrestricted + \ifdefequal\@glsxtr@record@setting\@glsxtr@record@setting@off + {% + \glsxtr@orgmakenoidxglossaries % \end{macrocode} -%If restricted document definitions allowed, adjust -%\cs{@gls@reference} so that it doesn't test for existence. +%Add marker to \cs{@do@seeglossary} % \begin{macrocode} - \renewcommand*{\@gls@reference}[3]{% - \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}% + \renewcommand{\@do@seeglossary}[2]{% + \@@glsxtrwrglossmark + \edef\@gls@label{\glsdetoklabel{##1}}% + \protected@write\@auxout{}{% + \string\@gls@reference + {\csname glo@\@gls@label @type\endcsname}% + {\@gls@label}% + {% + \string\glsseeformat##2{}% + }% + }% }% - \else % \end{macrocode} -%Disable document definitions. +%Check for \pkgopt[restricted]{docdefs}: % \begin{macrocode} - \@glsxtrdocdeffalse - \fi - \disable@keys{glossaries-extra.sty}{docdef}% -} + \if@glsxtrdocdefrestricted % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\gls@defdocnewglossaryentry} -% Modify \cs{gls@defdocnewglossaryentry} so that it checks -% the \pkgopt{docdef} value. +%If restricted document definitions allowed, adjust +%\cs{@gls@reference} so that it doesn't test for existence. +% \begin{macrocode} + \renewcommand*{\@gls@reference}[3]{% + \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}% + }% + \else +% \end{macrocode} +%Disable document definitions. +% \begin{macrocode} + \@glsxtrdocdeffalse + \fi + \disable@keys{glossaries-extra.sty}{docdef}% + }% + {% + \PackageError{glossaries-extra}{\string\makenoidxglossaries\space + not permitted\MessageBreak + with record=\@glsxtr@record@setting\space package option}% + {You may only use \string\makenoidxglossaries\ space with the + record=off option}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@defdocnewglossaryentry} +% Modify \cs{gls@defdocnewglossaryentry} so that it checks +% the \pkgopt{docdef} value. % \begin{macrocode} \renewcommand*{\gls@defdocnewglossaryentry}{% \ifcase\@glsxtr@docdefval @@ -3255,8 +3617,8 @@ Dickimaw Books\\ \renewcommand{\@gls@field@link}[4][]{% % \end{macrocode} %If the \pkgopt{record} option has been used, the information needs -%to be written to the aux file regardless of whether the enter -%exists. +%to be written to the aux file regardless of whether the entry +%exists (unless indexing has been switched off). %\changes{1.08}{2016-12-13}{added \cs{@glsxtr@record}} % \begin{macrocode} \@glsxtr@record{#2}{#3}{glslink}% @@ -3451,6 +3813,32 @@ Dickimaw Books\\ \define@key{glslink}{theHvalue}{\def\@glsxtr@theHvalue{#1}} % \end{macrocode} % +%\begin{macro}{\ifglsxtr@hyperoutside} +%\changes{1.21}{2017-11-03}{new} +% Define a \gloskey[glslink]{hyperoutside} key to determine whether +% \cs{hyperlink} should be outside \cs{glstextformat}. +% \begin{macrocode} +\define@boolkey{glslink}[glsxtr@]{hyperoutside}[true]{} +\glsxtr@hyperoutsidetrue +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\glsxtrinithyperoutside} +%\changes{1.21}{2017-11-03}{new} +%Set the default if the \gloskey[glslink]{hyperoutside} is omitted. +% \begin{macrocode} +\newcommand*{\glsxtrinithyperoutside}{% + \glsifattribute{\glslabel}{hyperoutside}{false}% + {% + \glsxtr@hyperoutsidefalse + }% + {% + \glsxtr@hyperoutsidetrue + }% +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\@gls@link} %\changes{1.14}{2017-04-18}{added redefinition} @@ -3479,6 +3867,11 @@ Dickimaw Books\\ % \begin{macrocode} \glsxtrinitwrgloss % \end{macrocode} +% Initialise whether \cs{hyperlink} should be outside \cs{glstextformat} +% (new to v1.21). +% \begin{macrocode} + \glsxtrinithyperoutside +% \end{macrocode} % As the original definition. Note that the default link options may % override \cs{glsxtrinitwrgloss}. % \begin{macrocode} @@ -3501,6 +3894,26 @@ Dickimaw Books\\ }% \@gls@setsort{\glslabel}% % \end{macrocode} +% Check \catattr{textformat} attribute (new to v1.21). +% \begin{macrocode} + \glshasattribute{\glslabel}{textformat}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{\glslabel}{textformat}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@textformat}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in textformat attribute + for entry `\glslabel'. Reverting to default \string\glstextformat}% + \let\@glsxtr@textformat\glstextformat + }% + }% + {% + \let\@glsxtr@textformat\glstextformat + }% +% \end{macrocode} % Do write if it should occur before the link text: % \begin{macrocode} \ifglsxtrinitwrglossbefore @@ -3510,9 +3923,17 @@ Dickimaw Books\\ % Do the link text: % \begin{macrocode} \ifKV@glslink@hyper - \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \ifglsxtr@hyperoutside + \@glslink{\glolinkprefix\glslabel}{\@glsxtr@textformat{#3}}% + \else + \@glsxtr@textformat{\@glslink{\glolinkprefix\glslabel}{#3}}% + \fi \else - \glsdonohyperlink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \ifglsxtr@hyperoutside + \glsdonohyperlink{\glolinkprefix\glslabel}{\@glsxtr@textformat{#3}}% + \else + \@glsxtr@textformat{\glsdonohyperlink{\glolinkprefix\glslabel}{#3}}% + \fi \fi % \end{macrocode} % Do write if it should occur after the link text: @@ -3541,27 +3962,31 @@ Dickimaw Books\\ % %\begin{macro}{\glsadd} %\changes{1.08}{2016-12-13}{added \cs{@glsxtr@record}} -%Redefine to include \cs{@glsxtr@record} +%Redefine to include \cs{@glsxtr@record} and suppress in headings % \begin{macrocode} \renewrobustcmd*{\glsadd}[2][]{% - \@gls@adjustmode - \@glsxtr@record{#1}{#2}{glossadd}% - \glsdoifexists{#2}% + \glsxtrifinmark + {}% {% - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% - \def\@glsxtr@thevalue{}% - \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% - \setkeys{glossadd}{#1}% - \ifdefempty{\@glsxtr@thevalue}% - {% - \@gls@saveentrycounter - }% + \@gls@adjustmode + \@glsxtr@record{#1}{#2}{glossadd}% + \glsdoifexists{#2}% {% - \let\theglsentrycounter\@glsxtr@thevalue - \def\theHglsentrycounter{\@glsxtr@theHvalue}% + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \setkeys{glossadd}{#1}% + \ifdefempty{\@glsxtr@thevalue}% + {% + \@gls@saveentrycounter + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \def\theHglsentrycounter{\@glsxtr@theHvalue}% + }% + \@@do@wrglossary{#2}% }% - \@@do@wrglossary{#2}% }% } % \end{macrocode} @@ -4724,9 +5149,11 @@ Dickimaw Books\\ % %\begin{macro}{\@glsxtrsetaliasnoindex} %\changes{1.12}{2017-02-03}{new} +%\changes{1.21}{2017-11-03}{changed to use \cs{glsxtrifhasfield} instead of +%\cs{ifglshasfield}} % \begin{macrocode} \newcommand*{\@glsxtrsetaliasnoindex}{% - \ifglshasfield{alias}{\glslabel}% + \glsxtrifhasfield{alias}{\glslabel}% {% \let\glsxtrindexaliased\@glsxtrindexaliased \glsxtrsetaliasnoindex @@ -4914,6 +5341,41 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtr@org@dohyperlink} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\let\glsxtr@org@dohyperlink\glsdohyperlink +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsnavhyperlink} +%\changes{1.21}{2017-11-03}{patched} +%Now that \cs{glsdohyperlink} (used by \cs{@glslink}) references +%\cs{glslabel} it's necessary to patch \cs{glsnavhyperlink} to +%avoid using it (since \cs{glslabel} won't be defined). This means +%temporarily redefining \cs{glsdohyperlink} to its original +%definition. +% +%This command is provided by \sty{glossary-hypernav} so it may not +%exist. +% \begin{macrocode} +\ifdef\glsnavhyperlink +{ + \renewcommand*{\glsnavhyperlink}[3][\@glo@type]{% + \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% +% \end{macrocode} +%Scope: +% \begin{macrocode} + {% + \let\glsdohyperlink\glsxtr@org@dohyperlink + \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}% + }% + }% +} +{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsdohyperlink} % Unpleasant complications can occur if the \gloskey{text} or % \gloskey{first} key etc contains \cs{gls}, particularly if there @@ -5000,34 +5462,50 @@ Dickimaw Books\\ % definition of \cs{glslabel}. The original internal command % {@glo@label} could probably be simply replaced with \cs{glslabel}, % but it's retained in case its removal causes unexpected problems. +%\changes{1.21}{2017-11-03}{added check for existence} % \begin{macrocode} \renewrobustcmd*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% - \def\@glo@label{#2}% - {\edef\glslabel{#2}% - \@glslink{\glolinkprefix\glslabel}{#1}}% + \glsdoifexists{#2}% + {% + \def\@glo@label{#2}% + {\edef\glslabel{#2}% + \@glslink{\glolinkprefix\glslabel}{#1}}% + }% } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsdisablehyper} %\changes{0.5.4}{2015-12-15}{added} +%\changes{1.21}{2017-11-03}{changed to use \cs{def} rather than \cs{let}} % Redefine in case we have an old version of \styfmt{glossaries}. +%This now uses \cs{def} rather than \cs{let} to allow for +%redefinitions of \cs{glsdonohyperlink}. % \begin{macrocode} -\ifundef\glsdonohyperlink -{% - \renewcommand{\glsdisablehyper}{% - \KV@glslink@hyperfalse - \let\@glslink\glsdonohyperlink - \let\@glstarget\@secondoftwo - } +\renewcommand{\glsdisablehyper}{% + \KV@glslink@hyperfalse + \def\@glslink{\glsdonohyperlink}% + \let\@glstarget\@secondoftwo +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsenablehyper} +%\changes{1.21}{2017-11-03}{changed to use \cs{def} rather than \cs{let}} +%This now uses \cs{def} rather than \cs{let} to allow for +%redefinitions of \cs{glsdohypertarget} and \cs{glsdohyperlink}. +% \begin{macrocode} +\renewcommand{\glsenablehyper}{% + \KV@glslink@hypertrue + \def\@glslink{\glsdohyperlink}% + \def\@glstarget{\glsdohypertarget}% } -{} % \end{macrocode} %\end{macro} % %\begin{macro}{\glsdonohyperlink} % This command was only introduced in \styfmt{glossaries} v4.20, so it may -% not be defined. For older \styfmt{glossaries} versions, this won't be +% not be defined (therefore use \cs{def}). For older \styfmt{glossaries} versions, this won't be % used if \sty{hyperref} hasn't been loaded, which means the % indexing will still take place. The generated text is scoped. %\changes{0.5.4}{2015-12-15}{added} @@ -5036,16 +5514,19 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glslink} % Reset \cs{@glslink} with patched versions: +%\changes{1.21}{2017-11-03}{changed \cs{let} to \cs{def}} % \begin{macrocode} \ifcsundef{hyperlink}% {% - \let\@glslink\glsdonohyperlink + \def\@glslink{\glsdonohyperlink} }% {% - \let\@glslink\glsdohyperlink + \def\@glslink{\glsdohyperlink} } % \end{macrocode} +%\end{macro} % %\begin{macro}{\glsxtrprotectlinks} %\changes{0.5.4}{2015-12-15}{new} @@ -5930,7 +6411,7 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % -%\begin{macro}{\@@cgls@} +%\begin{macro}{\@@cglspl@} % \begin{macrocode} \def\@@cglspl@#1#2[#3]{% \glsxtrifcounttrigger{#2}% @@ -6709,189 +7190,209 @@ Dickimaw Books\\ % This should be empty for the usual behaviour (all glossaries % need processing with an indexing application) or a comma-separated % list of glossary labels indicating those glossaries that should be -% processed with an indexing application. +% processed with an indexing application. The optional argument +% version shouldn't be used with \pkgopt{record}. %\begin{macro}{\makeglossaries} %\changes{1.0}{2016-01-24}{new} % \begin{macrocode} \renewcommand*{\makeglossaries}[1][]{% - \ifblank{#1}% - {\@glsxtr@org@makeglossaries}% - {% - \edef\@glsxtr@reg@glosslist{#1}% - \ifundef{\glswrite}{\newwrite\glswrite}{}% - \protected@write\@auxout{}{\string\providecommand - \string\@glsorder[1]{}} - \protected@write\@auxout{}{\string\providecommand - \string\@istfilename[1]{}} - \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% - \protected@write\@auxout{}{\string\@glsorder{\glsorder}} - \protected@write\@auxout{}{\string\glsxtr@makeglossaries{#1}} - \write\@auxout{\string\providecommand\string\@gls@reference[3]{}}% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@only + \PackageError{glossaries-extra}{\string\makeglossaries\space + not permitted\MessageBreak with record=only package option}% + {You may only use \string\makeglossaries\space with + record=off or record=alsoindex options}% + \else + \ifblank{#1}% + {\@glsxtr@org@makeglossaries}% + {% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \PackageError{glossaries-extra}{\string\makeglossaries[#1]\space + not permitted\MessageBreak with record=alsoindex package option}% + {You may only use the hybrid \string\makeglossaries[...]\space with + record=off option}% + \else + \edef\@glsxtr@reg@glosslist{#1}% + \ifundef{\glswrite}{\newwrite\glswrite}{}% + \protected@write\@auxout{}{\string\providecommand + \string\@glsorder[1]{}} + \protected@write\@auxout{}{\string\providecommand + \string\@istfilename[1]{}} + \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% + \protected@write\@auxout{}{\string\@glsorder{\glsorder}} + \protected@write\@auxout{}{\string\glsxtr@makeglossaries{#1}} + \write\@auxout{\string\providecommand\string\@gls@reference[3]{}}% % \end{macrocode} % Iterate through each supplied glossary type and activate it. % \begin{macrocode} - \@for\@glo@type:=#1\do{% - \ifdefempty{\@glo@type}{}{\@makeglossary{\@glo@type}}% - }% + \@for\@glo@type:=#1\do{% + \ifdefempty{\@glo@type}{}{\@makeglossary{\@glo@type}}% + }% % \end{macrocode} % New glossaries must be created before \cs{makeglossaries}: % \begin{macrocode} - \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}}% + \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}}% % \end{macrocode} % Any subsequence instances of this command should have no effect % \begin{macrocode} - \let\@makeglossary\relax - \let\makeglossary\relax - \renewcommand\makeglossaries[1][]{}% + \let\@makeglossary\relax + \let\makeglossary\relax + \renewcommand\makeglossaries[1][]{}% % \end{macrocode} % Disable all commands that have no effect after \cs{makeglossaries} % \begin{macrocode} - \@disable@onlypremakeg + \@disable@onlypremakeg % \end{macrocode} % Allow \gloskey{see} key: % \begin{macrocode} - \let\gls@checkseeallowed\relax + \let\gls@checkseeallowed\relax % \end{macrocode} -%Adjust \cs{@do@seeglossary} +%Adjust \cs{@do@seeglossary}. This needs to check for the entries +%existence. % \begin{macrocode} - \renewcommand*{\@do@seeglossary}[2]{% - \edef\@gls@label{\glsdetoklabel{##1}}% - \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {\@glsxtr@org@doseeglossary{##1}{##2}}% - {% - \protected@write\@auxout{}{% - \string\@gls@reference - {\gls@type}{\@gls@label}{\string\glsseeformat##2{}}% + \renewcommand*{\@do@seeglossary}[2]{% + \glsdoifexists{##1}% + {% + \edef\@gls@label{\glsdetoklabel{##1}}% + \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {\@glsxtr@org@doseeglossary{##1}{##2}}% + {% + \@@glsxtrwrglossmark + \protected@write\@auxout{}{% + \string\@gls@reference + {\gls@type}{\@gls@label}{\string\glsseeformat##2{}}% + }% + }% + }% }% - }% - }% % \end{macrocode} % Adjust \cs{@@do@@wrglossary} % \begin{macrocode} - \let\@glsxtr@@do@@wrglossary\@@do@@wrglossary - \def\@@do@@wrglossary{% - \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {\@glsxtr@@do@@wrglossary}% - {\gls@noidxglossary}% - }% + \let\@glsxtr@@do@@wrglossary\@@do@@wrglossary + \def\@@do@@wrglossary{% + \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {\@glsxtr@@do@@wrglossary}% + {\gls@noidxglossary}% + }% % \end{macrocode} % Suppress warning about no \cs{makeglossaries} % \begin{macrocode} - \let\warn@nomakeglossaries\relax - \def\warn@noprintglossary{% - \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}% - }% + \let\warn@nomakeglossaries\relax + \def\warn@noprintglossary{% + \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}% + }% % \end{macrocode} % Only warn for glossaries not listed. % \begin{macrocode} - \renewcommand{\@gls@noref@warn}[1]{% - \edef\@gls@type{##1}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {% - \GlossariesExtraWarning{Can't use - \string\printnoidxglossary[type={\@gls@type}] - when `\@gls@type' is listed in the optional argument of - \string\makeglossaries}% - }% - {% - \GlossariesWarning{Empty glossary for - \string\printnoidxglossary[type={##1}]. - Rerun may be required (or you may have forgotten to use - commands like \string\gls)}% - }% - }% + \renewcommand{\@gls@noref@warn}[1]{% + \edef\@gls@type{##1}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {% + \GlossariesExtraWarning{Can't use + \string\printnoidxglossary[type={\@gls@type}] + when `\@gls@type' is listed in the optional argument of + \string\makeglossaries}% + }% + {% + \GlossariesWarning{Empty glossary for + \string\printnoidxglossary[type={##1}]. + Rerun may be required (or you may have forgotten to use + commands like \string\gls)}% + }% + }% % \end{macrocode} % Adjust display number list to check for type: % \begin{macrocode} - \renewcommand*{\glsdisplaynumberlist}[1]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {\@glsxtr@idx@displaynumberlist{##1}}% - {\@glsxtr@noidx@displaynumberlist{##1}}% - }% + \renewcommand*{\glsdisplaynumberlist}[1]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {\@glsxtr@idx@displaynumberlist{##1}}% + {\@glsxtr@noidx@displaynumberlist{##1}}% + }% % \end{macrocode} % Adjust entry list: % \begin{macrocode} - \renewcommand*{\glsentrynumberlist}[1]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {\@glsxtr@idx@entrynumberlist{##1}}% - {\@glsxtr@noidx@entrynumberlist{##1}}% - }% + \renewcommand*{\glsentrynumberlist}[1]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {\@glsxtr@idx@entrynumberlist{##1}}% + {\@glsxtr@noidx@entrynumberlist{##1}}% + }% % \end{macrocode} % Adjust number list loop % \begin{macrocode} - \renewcommand*{\glsnumberlistloop}[2]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {% - \PackageError{glossaries-extra}{\string\glsnumberlistloop\space - not available for glossary `##1'}{}% - }% - {\@glsxtr@noidx@numberlistloop{##1}{##2}}% - }% + \renewcommand*{\glsnumberlistloop}[2]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {% + \PackageError{glossaries-extra}{\string\glsnumberlistloop\space + not available for glossary `##1'}{}% + }% + {\@glsxtr@noidx@numberlistloop{##1}{##2}}% + }% % \end{macrocode} % Only sanitize sort for normal indexing glossaries. % \begin{macrocode} - \renewcommand*{\glsprestandardsort}[3]{% - \expandafter\DTLifinlist\expandafter{##2}{\@glsxtr@reg@glosslist}% - {% - \glsdosanitizesort - }% - {% - \ifglssanitizesort - \@gls@noidx@sanitizesort - \else - \@gls@noidx@nosanitizesort - \fi - }% - }% + \renewcommand*{\glsprestandardsort}[3]{% + \expandafter\DTLifinlist\expandafter{##2}{\@glsxtr@reg@glosslist}% + {% + \glsdosanitizesort + }% + {% + \ifglssanitizesort + \@gls@noidx@sanitizesort + \else + \@gls@noidx@nosanitizesort + \fi + }% + }% % \end{macrocode} % Unlike \cs{makenoidxglossaries} we can't automatically set % sanitizesort=false. All entries must be defined in the preamble. % \begin{macrocode} - \renewcommand*\new@glossaryentry[2]{% - \PackageError{glossaries-extra}{Glossary entries must be defined - in the preamble\MessageBreak when you use the optional argument - of \string\makeglossaries}{Either move your definitions to the - preamble or don't use the optional argument of - \string\makeglossaries}% - }% + \renewcommand*\new@glossaryentry[2]{% + \PackageError{glossaries-extra}{Glossary entries must be defined + in the preamble\MessageBreak when you use the optional argument + of \string\makeglossaries}{Either move your definitions to the + preamble or don't use the optional argument of + \string\makeglossaries}% + }% % \end{macrocode} % Only activate sort key for glossaries that aren't listed in % \verb|#1| (glossary label is stored in \cs{@glo@type} but this % defaults to \cs{glsdefaulttype} so some expansion is required). % \begin{macrocode} - \let\@glo@assign@sortkey\@glsxtr@mixed@assign@sortkey - \renewcommand*{\@printgloss@setsort}{% + \let\@glo@assign@sortkey\@glsxtr@mixed@assign@sortkey + \renewcommand*{\@printgloss@setsort}{% % \end{macrocode} % Need to extract just the \gloskey[printglossary]{type} value. % \begin{macrocode} - \expandafter\@glsxtr@gettype\expandafter,\@glsxtr@printglossopts,% - type=\glsdefaulttype,\@end@glsxtr@gettype - \def\@glo@sorttype{\@glo@default@sorttype}% - }% + \expandafter\@glsxtr@gettype\expandafter,\@glsxtr@printglossopts,% + type=\glsdefaulttype,\@end@glsxtr@gettype + \def\@glo@sorttype{\@glo@default@sorttype}% + }% % \end{macrocode} % Check \pkgopt{automake} setting: % \begin{macrocode} - \ifglsautomake - \renewcommand*{\@gls@doautomake}{% - \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% - \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% - }% - }% - \fi + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% + \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% + }% + }% + \fi % \end{macrocode} % Check the sort setting (\sty{glossaries} v4.30 onwards): % \begin{macrocode} - \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% - }% + \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% + \fi + }% + \fi } % \end{macrocode} %\end{macro} @@ -7723,8 +8224,13 @@ Dickimaw Books\\ %enforces a .glstex extension to avoid conflict. % \begin{macrocode} \newcommand*{\glsxtrresourcefile}[2][]{% +% \end{macrocode} +%The \pkgopt{record} option can't be set after this command. +%\changes{1.21}{2017-11-03}{now disables record key} +% \begin{macrocode} + \disable@keys{glossaries-extra.sty}{record}% \glsxtr@writefields - \protected@write\@auxout{}{\string\glsxtr@resource{#1}{#2}}% + \protected@write\@auxout{\glsxtrresourceinit}{\string\glsxtr@resource{#1}{#2}}% \let\@glsxtr@org@see@noindex\@gls@see@noindex \let\@gls@see@noindex\relax \IfFileExists{#2.glstex}% @@ -7966,6 +8472,51 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrglossentry} +%Users may prefer to have entries displayed throughout the document +%rather than gathered together in a list. This command emulates +%the way \cs{glossentry} behaves (without the style formatting +%commands like \cs{item}). This needs to define \cs{currentglossary} +%to the current glossary type (normally set at the start of +%\cs{@printglossary}) and needs to define \cs{glscurrententrylabel} +%to the entry's label (normally set before \cs{glossentry} and +%\cs{subglossentry}). This needs some protection in case it's used +%in a section heading. +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\glsxtrglossentry}[1]{% + \glsxtrtitleorpdforheading + {\@glsxtrglossentry{#1}}% + {\glsentryname{#1}}% + {\glsxtrheadname{#1}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glsxtrglossentry} +%\changes{1.21}{2017-11-03}{new} +%Another test is needed in case \cs{@glsxtrglossentry} has been +%written to the table of contents. +% \begin{macrocode} +\newrobustcmd*{\@glsxtrglossentry}[1]{% + \glsxtrtitleorpdforheading + {% + \glsdoifexists{#1}% + {% + \begingroup + \edef\glscurrententrylabel{\glsdetoklabel{#1}}% + \edef\currentglossary{\glsentrytype{\glscurrententrylabel}}% + \ifglshasparent{#1}% + {\glssubentryitem{#1}}% + {\glsentryitem{#1}}% + \glstarget{#1}{\glossentryname{#1}}% + \endgroup + }% + }% + {\glsentryname{#1}}% + {\glsxtrheadname{#1}}% +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\printunsrtglossary} %\changes{1.08}{2016-12-13}{new} @@ -8047,10 +8598,32 @@ Dickimaw Books\\ :\expandafter=\csname glolist@\@glo@type\endcsname\do{% \ifdefempty{\glscurrententrylabel} {}% - {\eappto\@glsxtr@doglossary{% - \noexpand\@printunsrt@glossary@handler{\glscurrententrylabel}}}% + {% +% \end{macrocode} +%Provide a hook (for example to measure width). +% \begin{macrocode} + \let\glsxtr@process\@firstofone + \let\printunsrtglossaryskipentry + \@glsxtr@printunsrtglossaryskipentry + \printunsrtglossaryentryprocesshook{\glscurrententrylabel}% +% \end{macrocode} +%Don't check group for child entries. +% \begin{macrocode} + \glsxtr@process + {% + \ifglshasparent{\glscurrententrylabel}{}% + {% + \@glsxtr@checkgroup\glscurrententrylabel + \expandafter\appto\expandafter\@glsxtr@doglossary\expandafter + {\@glsxtr@groupheading}% + }% + \eappto\@glsxtr@doglossary{% + \noexpand\@printunsrt@glossary@handler{\glscurrententrylabel}}% + }% + }% }% \appto\@glsxtr@doglossary{\end{theglossary}}% + \printunsrtglossarypredoglossary \@glsxtr@doglossary }% \glossarypostamble @@ -8058,6 +8631,39 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\printunsrtglossaryentryprocesshook} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\printunsrtglossaryentryprocesshook}[1]{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\printunsrtglossaryentryprocesshook} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\printunsrtglossaryskipentry}{% + \PackageError{glossaries-extra}{\string\printunsrtglossaryskipentry\space +can only be used within \string\printunsrtglossaryentryprocesshook}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\printunsrtglossaryentryprocesshook} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@printunsrtglossaryskipentry}{% + \let\glsxtr@process\@gobble +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\printunsrtglossarypredoglossary} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\printunsrtglossarypredoglossary}{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@printunsrt@glossary@handler} %\changes{1.16}{2017-06-15}{new} % \begin{macrocode} @@ -8077,6 +8683,20 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtriflabelinlist} +%\changes{1.21}{2017-11-03}{new} +%Might be useful for the handler to check if an entry label +%or category label is contained in a list, so provide a user-level +%version of \cs{@gls@ifinlist} which ensures the label and list are +%fully expanded. +% \begin{macrocode} +\newrobustcmd*{\glsxtriflabelinlist}[4]{% + \protected@edef\@glsxtr@doiflabelinlist{\noexpand\@gls@ifinlist{#1}{#2}}% + \@glsxtr@doiflabelinlist{#3}{#4}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\print@op@unsrtglossaryunit} %\changes{1.12}{2017-02-03}{new} % \begin{macrocode} @@ -8149,4115 +8769,5523 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrgroupfield} +%\app{bib2gls} provides a supplementary field labelled +%\texttt{secondarygroup} for secondary glossaries, so +%provide a way of switching to that field. (The \gloskey{group} +%key still needs checking. There's no associated key with the +%internal field). +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\glsxtrgroupfield}{group} +% \end{macrocode} +%\end{macro} +% +%The \env{tabular}-like glossary styles cause quite a problem +%with the iterative approach. In particular for the group skip. +%To compensate for this, the groups are now determined while +%\cs{@glsxtr@doglossary} is being constructed rather than in the +%handler. +%\begin{macro}{\@glsxtr@checkgroup} +%\changes{1.21}{2017-11-03}{new} +%The argument is the entry's label. (This block of code was +%formerly in \cs{@glsxtr@noidx@do}.) Now that this is no longer +%within a tabular environment, the global definitions aren't needed. +%The result is now stored in \cs{@glsxtr@groupheading}, which will +%be empty if no heading is required. +% \begin{macrocode} +\newcommand*{\@glsxtr@checkgroup}[1]{% + \def\@glsxtr@groupheading{}% + \key@ifundefined{glossentry}{group}% + {% + \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% + \expandafter\glo@grabfirst\@gls@sort{}{}\@nil + }% + {% +% \end{macrocode} +%\changes{1.16}{2017-06-15}{use \cs{csuse} instead of \cs{csname}} +% \begin{macrocode} + \protected@edef\@glo@thislettergrp{% + \csuse{glo@\glsdetoklabel{#1}@\glsxtrgroupfield}}% + }% + \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% + {}% + {% + \ifdefempty{\@gls@currentlettergroup}{}% + {\def\@glsxtr@groupheading{\glsgroupskip}}% + \eappto\@glsxtr@groupheading{% + \noexpand\glsgroupheading{\expandonce\@glo@thislettergrp}% + }% + }% + \let\@gls@currentlettergroup\@glo@thislettergrp +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@noidx@do} %\changes{1.11}{2017-01-19}{new} %Minor modification of \cs{@gls@noidx@do} to check for location -%field if present. +%field if present, but also need to check for the \gloskey{group} +%field. % \begin{macrocode} \newcommand{\@glsxtr@noidx@do}[1]{% - \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% - \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% - \ifglshasparent{#1}% + \ifglsentryexists{#1}% {% - \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax - \ifdefvoid{\@gls@location}% + \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% + \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% + \ifglshasparent{#1}% {% - \ifdefvoid{\@gls@loclist}% + \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax + \ifdefvoid{\@gls@location}% {% - \subglossentry{\gls@level}{#1}{}% - }% - {% - \subglossentry{\gls@level}{#1}% + \ifdefvoid{\@gls@loclist}% + {% + \subglossentry{\gls@level}{#1}{}% + }% {% - \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + \subglossentry{\gls@level}{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% }% }% - }% - {% - \subglossentry{\gls@level}{#1}{\glossaryentrynumbers{\@gls@location}}% - }% - }% - {% - \key@ifundefined{glossentry}{group}% - {% - \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% - \expandafter\glo@grabfirst\@gls@sort{}{}\@nil + {% + \subglossentry{\gls@level}{#1}{\glossaryentrynumbers{\@gls@location}}% + }% }% {% % \end{macrocode} -%\changes{1.16}{2017-06-15}{use \cs{csuse} instead of \cs{csname}} +%\changes{1.21}{2017-11-03}{removed code dealing with the group} % \begin{macrocode} - \protected@xdef\@glo@thislettergrp{% - \csuse{glo@\glsdetoklabel{#1}@group}}% - }% - \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% - {}% - {% - \ifdefempty{\@gls@currentlettergroup}{}{\glsgroupskip}% - \expandafter\glsgroupheading\expandafter - {\@glo@thislettergrp}% - }% - \global\let\@gls@currentlettergroup\@glo@thislettergrp - \ifdefvoid{\@gls@location}% - {% - \ifdefvoid{\@gls@loclist} + \ifdefvoid{\@gls@location}% {% - \glossentry{#1}{}% + \ifdefvoid{\@gls@loclist} + {% + \glossentry{#1}{}% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% }% {% \glossentry{#1}% {% - \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + \glossaryentrynumbers{\@gls@location}% }% }% }% - {% - \glossentry{#1}% - {% - \glossaryentrynumbers{\@gls@location}% - }% - }% }% + {}% } % \end{macrocode} %\end{macro} % -%\section{Integration with glossaries-accsupp} -% Provide better integration with the \sty{glossaries-accsupp} -% package. (Must be loaded before the main code of -% \styfmt{glossaries-extra} either explicitly or through the -% \pkgopt{accsupp} package option.) -% -% These commands have their definitions set according to whether -% or not \styfmt{glossaries-extra} has been loaded. -%\changes{0.5.2}{2015-12-08}{fixed typo in glossaries-accsupp and tidied up code to use -% just one \cs{@ifpackageloaded}} +%\subsection{Support for \app{bib2gls}} +%Some useful commands for \app{bib2gls} users. +%\begin{macro}{\glshex} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\@ifpackageloaded{glossaries-accsupp} -{ +\newcommand*{\glshex}{\string\u} % \end{macrocode} -% Define (or redefine) commands to use the accessibility -% information. -%\begin{macro}{\glsaccessname} -% Display the \gloskey{name} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\end{macro} +%\begin{macro}{\glsxtrresourceinit} +%\changes{1.21}{2017-11-03}{new} +%Code used during the protected write operation. % \begin{macrocode} - \newcommand*{\glsaccessname}[1]{% - \glsnameaccessdisplay - {% - \glsentryname{#1}% - }% - {#1}% - } +\newcommand*{\glsxtrresourceinit}{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessname} -% Display the \gloskey{name} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%Provide a way to conveniently define commands that behaves like +%\cs{gls} with a label prefix. +% +%It's possible that the user might want minor variations +%with the same prefix but different default options, so +%use a counter to provide unique inner commands. +%\begin{macro}{\glsxtrnewgls} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessname}[1]{% - \glsnameaccessdisplay - {% - \Glsentryname{#1}% - }% - {#1}% - } +\newcount\@glsxtrnewgls@inner % \end{macrocode} %\end{macro} +%(The default options supplied in \meta{options} below +%could possibly be used to form the inner control sequence name to +%help make it unique, but it might feasibly contain +%\gloskey[glslink]{thevalue} where the value might contain commands.) +% +%\begin{macro}{\@glsxtrnewgls} +%\changes{1.21}{2017-11-03}{new} +%\begin{definition} +%\cs{glsxtrnewgls}\oarg{options}\marg{prefix}\marg{cs}\marg{inner cs +%name} +%\end{definition} % -%\begin{macro}{\GLSaccessname} -% Display the \gloskey{name} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} - \newcommand*{\GLSaccessname}[1]{% - \glsnameaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryname{#1}}% - }% - {#1}% - } +\newcommand*{\@glsxtrnewgls}[4]{% + \ifdef{#3}% + {% + \PackageError{glossaries-extra}{Command \string#3\space already +defined}{}% + }% + {% + \ifcsdef{@#4like@#2}% + {% + \advance\@glsxtrnewgls@inner by \@ne + \def\@glsxtrnewgls@innercsname{@#4like\number\@glsxtrnewgls@inner @#2}% + }% + {\def\@glsxtrnewgls@innercsname{@#4like@#2}}% + \expandafter\newrobustcmd\expandafter*\expandafter + #3\expandafter{\expandafter\@gls@hyp@opt\csname\@glsxtrnewgls@innercsname\endcsname}% + \ifstrempty{#1}% + {% + \expandafter\newcommand\expandafter*\csname\@glsxtrnewgls@innercsname\endcsname[2][]{% + \new@ifnextchar[% + {\csname @#4@\endcsname{##1}{#2##2}}% + {\csname @#4@\endcsname{##1}{#2##2}[]}% + }% + }% + {% + \expandafter\newcommand\expandafter*\csname\@glsxtrnewgls@innercsname\endcsname[2][]{% + \new@ifnextchar[% + {\csname @#4@\endcsname{#1,##1}{#2##2}}% + {\csname @#4@\endcsname{#1,##1}{#2##2}[]}% + }% + }% + }% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccesstext} -% Display the \gloskey{text} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\glsxtrnewgls} +%\begin{definition} +%\cs{glsxtrnewgls}\oarg{options}\marg{prefix}\marg{cs} +%\end{definition} +%The first argument prepends to the options and the second argument is the prefix. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccesstext}[1]{% - \glstextaccessdisplay - {% - \glsentrytext{#1}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewgls}[3][]{% + \@glsxtrnewgls{#1}{#2}{#3}{gls}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccesstext} -% Display the \gloskey{text} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-02}{new} +%\begin{macro}{\glsxtrnewglslike} +%Provide a way to conveniently define commands that behave like +%\cs{gls}, \cs{glspl}, \cs{Gls} and \cs{Glspl} with a label prefix. +%The first argument prepends to the options and the second argument is the prefix. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccesstext}[1]{% - \glstextaccessdisplay - {% - \Glsentrytext{#1}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewglslike}[6][]{% + \@glsxtrnewgls{#1}{#2}{#3}{gls}% + \@glsxtrnewgls{#1}{#2}{#4}{glspl}% + \@glsxtrnewgls{#1}{#2}{#5}{Gls}% + \@glsxtrnewgls{#1}{#2}{#6}{Glspl}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccesstext} -% Display the \gloskey{text} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\glsxtrnewGLSlike} +%Provide a way to conveniently define commands that behave like +%\cs{GLS}, \cs{GLSpl} with a label prefix. +%The first argument prepends to the options and the second argument is the prefix. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccesstext}[1]{% - \glstextaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrytext{#1}}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewGLSlike}[4][]{% + \@glsxtrnewgls{#1}{#2}{#3}{GLS}% + \@glsxtrnewgls{#1}{#2}{#4}{GLSpl}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessplural} -% Display the \gloskey{plural} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\glsxtrnewrgls} +%As \cs{glsxtrnewgls} but for \cs{rgls}. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessplural}[1]{% - \glspluralaccessdisplay - {% - \glsentryplural{#1}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewrgls}[3][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rgls}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessplural} -% Display the \gloskey{plural} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\glsxtrnewrglslike} +%As \cs{glsxtrnewglslike} but for \cs{rgls} etc. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessplural}[1]{% - \glspluralaccessdisplay - {% - \Glsentryplural{#1}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewrglslike}[6][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rgls}% + \@glsxtrnewgls{#1}{#2}{#4}{rglspl}% + \@glsxtrnewgls{#1}{#2}{#5}{rGls}% + \@glsxtrnewgls{#1}{#2}{#6}{rGlspl}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccessplural} -% Display the \gloskey{plural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\glsxtrnewrGLSlike} +%\changes{1.21}{2017-11-03}{new} +%As \cs{glsxtrnewGLSlike} but for \cs{rGLS} etc. % \begin{macrocode} - \newcommand*{\GLSaccessplural}[1]{% - \glspluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryplural{#1}}% - }% - {#1}% - } +\newrobustcmd*{\glsxtrnewrGLSlike}[4][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rGLS}% + \@glsxtrnewgls{#1}{#2}{#4}{rGLSpl}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessfirst} -% Display the \gloskey{first} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%Provide easy access to record count fields. +%\begin{macro}{\GlsXtrTotalRecordCount} +%\changes{1.21}{2017-11-03}{new} +%Access total record count. This is designed to +%be expandable. The argument is the label. % \begin{macrocode} - \newcommand*{\glsaccessfirst}[1]{% - \glsfirstaccessdisplay - {% - \glsentryfirst{#1}% - }% - {#1}% - } +\newcommand*{\GlsXtrTotalRecordCount}[1]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount}% + {\csname glo@\glsdetoklabel{#1}@recordcount\endcsname}% + {0}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\Glsaccessfirst} -% Display the \gloskey{first} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\GlsXtrRecordCount} +%\changes{1.21}{2017-11-03}{new} +%Access record count for a particular counter. The first argument is the label. +%The second argument is the counter name. % \begin{macrocode} - \newcommand*{\Glsaccessfirst}[1]{% - \glsfirstaccessdisplay - {% - \Glsentryfirst{#1}% - }% - {#1}% - } +\newcommand*{\GlsXtrRecordCount}[2]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount.#2}% + {\csname glo@\glsdetoklabel{#1}@recordcount.#2\endcsname}% + {0}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccessfirst} -% Display the \gloskey{first} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\GlsXtrLocationRecordCount} +%\changes{1.21}{2017-11-03}{new} +%Access record count for a particular counter and location. +%The first argument is the label. +%The second argument is the counter name. +%The third argument is the location. +%This command shouldn't be used if the location doesn't fully +%expand unless \cs{glsxtrdetoklocation} can be set to something +%sensible. % \begin{macrocode} - \newcommand*{\GLSaccessfirst}[1]{% - \glsfirstaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryfirst{#1}}% - }% - {#1}% - } +\newcommand*{\GlsXtrLocationRecordCount}[3]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount.#2.\glsxtrdetoklocation{#3}}% + {\csname glo@\glsdetoklabel{#1}@recordcount.#2.\glsxtrdetoklocation{#3}\endcsname}% + {0}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessfirstplural} -% Display the \gloskey{firstplural} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\glsxtrdetoklocation} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessfirstplural}[1]{% - \glsfirstpluralaccessdisplay - {% - \glsentryfirstplural{#1}% - }% - {#1}% - } +\newcommand*{\glsxtrdetoklocation}[1]{#1} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessfirstplural} -% Display the \gloskey{firstplural} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\glsxtrenablerecordcount} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessfirstplural}[1]{% - \glsfirstpluralaccessdisplay - {% - \Glsentryfirstplural{#1}% - }% - {#1}% - } +\newcommand*{\glsxtrenablerecordcount}{% + \renewcommand*{\gls}{\rgls}% + \renewcommand*{\Gls}{\rGls}% + \renewcommand*{\glspl}{\rglspl}% + \renewcommand*{\Glspl}{\rGlspl}% + \renewcommand*{\GLS}{\rGLS}% + \renewcommand*{\GLSpl}{\rGLSpl}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccessfirstplural} -% Display the \gloskey{firstplural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\glsxtrrecordtriggervalue} +%\changes{1.21}{2017-11-03}{new} +%The value used by the record trigger test. +%The argument is the entry's label. % \begin{macrocode} - \newcommand*{\GLSaccessfirstplural}[1]{% - \glsfirstpluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryfirstplural{#1}}% - }% - {#1}% - } +\newcommand*{\glsxtrrecordtriggervalue}[1]{% + \GlsXtrTotalRecordCount{#1}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccesssymbol} -% Display the \gloskey{symbol} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\GlsXtrSetRecordCountAttribute} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccesssymbol}[1]{% - \glssymbolaccessdisplay - {% - \glsentrysymbol{#1}% - }% - {#1}% - } +\newcommand*{\GlsXtrSetRecordCountAttribute}[2]{% + \@for\@glsxtr@cat:=#1\do + {% + \ifdefempty{\@glsxtr@cat}{}% + {% + \glssetcategoryattribute{\@glsxtr@cat}{recordcount}{#2}% + }% + }% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccesssymbol} -% Display the \gloskey{symbol} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\glsxtrifrecordtrigger} +%\begin{definition} +%\cs{glsxtrifrecordtrigger}\marg{label}\marg{trigger format}\marg{normal} +%\end{definition} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccesssymbol}[1]{% - \glssymbolaccessdisplay - {% - \Glsentrysymbol{#1}% - }% - {#1}% - } +\newcommand*{\glsxtrifrecordtrigger}[3]{% + \glshasattribute{#1}{recordcount}% + {% + \ifnum\glsxtrrecordtriggervalue{#1}>\glsgetattribute{#1}{recordcount}\relax + #3% + \else + #2% + \fi + }% + {#3}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccesssymbol} -% Display the \gloskey{symbol} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@glsxtr@rglstrigger@record} +%\changes{1.21}{2017-11-03}{new} +%Still need a record to ensure that \app{bib2gls} selects the entry. % \begin{macrocode} - \newcommand*{\GLSaccesssymbol}[1]{% - \glssymbolaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrysymbol{#1}}% - }% - {#1}% - } +\newcommand*{\@glsxtr@rglstrigger@record}[3]{% + \edef\glslabel{\glsdetoklabel{#2}}% + \let\@gls@link@label\glslabel + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \def\@glsnumberformat{glstriggerrecordformat}% + \edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% + \edef\glstype{\csname glo@\glslabel @type\endcsname}% + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \glsxtrinitwrgloss + \setkeys{glslink}{#1}% + \glslinkpostsetkeys + \ifdefempty{\@glsxtr@thevalue}% + {% + \@gls@saveentrycounter + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \def\theHglsentrycounter{\@glsxtr@theHvalue}% + }% + \ifglsxtrinitwrglossbefore + \@do@wrglossary{#2}% + \fi + #3% + \ifglsxtrinitwrglossbefore + \else + \@do@wrglossary{#2}% + \fi + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccesssymbolplural} -% Display the \gloskey{symbolplural} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\glstriggerrecordformat} +%\changes{1.21}{2017-11-03}{new} +%Typically won't be used as it should be recognised as a special +%type of ignored location by \app{bib2gls}. % \begin{macrocode} - \newcommand*{\glsaccesssymbolplural}[1]{% - \glssymbolpluralaccessdisplay - {% - \glsentrysymbolplural{#1}% - }% - {#1}% - } +\newcommand*{\glstriggerrecordformat}[1]{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccesssymbolplural} -% Display the \gloskey{symbolplural} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\rgls} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccesssymbolplural}[1]{% - \glssymbolpluralaccessdisplay - {% - \Glsentrysymbolplural{#1}% - }% - {#1}% - } +\newrobustcmd*{\rgls}{\@gls@hyp@opt\@rgls} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccesssymbolplural} -% Display the \gloskey{symbolplural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rgls} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccesssymbolplural}[1]{% - \glssymbolpluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrysymbolplural{#1}}% - }% - {#1}% - } +\newcommand*{\@rgls}[2][]{% + \new@ifnextchar[{\@rgls@{#1}{#2}}{\@rgls@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsaccessdesc} -% Display the \gloskey{desc} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@rgls@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessdesc}[1]{% - \glsdescriptionaccessdisplay - {% - \glsentrydesc{#1}% - }% - {#1}% - } +\def\@rgls@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rglsformat{#2}{#3}}% + }% + {% + \@gls@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessdesc} -% Display the \gloskey{desc} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\rglspl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessdesc}[1]{% - \glsdescriptionaccessdisplay - {% - \Glsentrydesc{#1}% - }% - {#1}% - } +\newrobustcmd*{\rglspl}{\@gls@hyp@opt\@rglspl} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccessdesc} -% Display the \gloskey{desc} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rglspl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccessdesc}[1]{% - \glsdescriptionaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrydesc{#1}}% - }% - {#1}% - } +\newcommand*{\@rglspl}[2][]{% + \new@ifnextchar[{\@rglspl@{#1}{#2}}{\@rglspl@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessdescplural} -% Display the \gloskey{descplural} value (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@rglspl@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessdescplural}[1]{% - \glsdescriptionpluralaccessdisplay - {% - \glsentrydescplural{#1}% - }% - {#1}% - } +\def\@rglspl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rglsplformat{#2}{#3}}% + }% + {% + \@glspl@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessdescplural} -% Display the \gloskey{descplural} value (no link and no check for existence) -% with the first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{new} +%\begin{macro}{\rGls} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessdescplural}[1]{% - \glsdescriptionpluralaccessdisplay - {% - \Glsentrydescplural{#1}% - }% - {#1}% - } +\newrobustcmd*{\rGls}{\@gls@hyp@opt\@rGls} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccessdescplural} -% Display the \gloskey{descplural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rGls} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccessdescplural}[1]{% - \glsdescriptionpluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrydescplural{#1}}% - }% - {#1}% - } +\newcommand*{\@rGls}[2][]{% + \new@ifnextchar[{\@rGls@{#1}{#2}}{\@rGls@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsaccessshort} -% Display the short form (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@rGls@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessshort}[1]{% - \glsshortaccessdisplay - {% - \glsentryshort{#1}% - }% - {#1}% - } +\def\@rGls@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGlsformat{#2}{#3}}% + }% + {% + \@Gls@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessshort} -% Display the short form with first letter converted to uppercase -% (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\rGlspl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessshort}[1]{% - \glsshortaccessdisplay - {% - \Glsentryshort{#1}% - }% - {#1}% - } +\newrobustcmd*{\rGlspl}{\@gls@hyp@opt\@rGlspl} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccessshort} -% Display the \gloskey{short} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rGlspl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccessshort}[1]{% - \glsshortaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryshort{#1}}% - }% - {#1}% - } +\newcommand*{\@rGlspl}[2][]{% + \new@ifnextchar[{\@rGlspl@{#1}{#2}}{\@rGlspl@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccessshortpl} -% Display the short plural form (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@rGlspl@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccessshortpl}[1]{% - \glsshortpluralaccessdisplay - {% - \glsentryshortpl{#1}% - }% - {#1}% - } +\def\@rGlspl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGlsplformat{#2}{#3}}% + }% + {% + \@Glspl@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccessshortpl} -% Display the short plural form with first letter converted to -% uppercase (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\rGLS} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\Glsaccessshortpl}[1]{% - \glsshortpluralaccessdisplay - {% - \Glsentryshortpl{#1}% - }% - {#1}% - } +\newrobustcmd*{\rGLS}{\@gls@hyp@opt\@rGLS} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccessshortpl} -% Display the \gloskey{shortplural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rGLS} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccessshortpl}[1]{% - \glsshortpluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentryshortpl{#1}}% - }% - {#1}% - } +\newcommand*{\@rGLS}[2][]{% + \new@ifnextchar[{\@rGLS@{#1}{#2}}{\@rGLS@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccesslong} -% Display the long form (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@rGLS@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccesslong}[1]{% - \glslongaccessdisplay{\glsentrylong{#1}}{#1}% - } +\def\@rGLS@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGLSformat{#2}{#3}}% + }% + {% + \@GLS@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccesslong} -% Display the long form (no link and no check for existence). -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\rGLSpl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - - \newcommand*{\Glsaccesslong}[1]{% - \glslongaccessdisplay{\Glsentrylong{#1}}{#1}% - } +\newrobustcmd*{\rGLSpl}{\@gls@hyp@opt\@rGLSpl} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GLSaccesslong} -% Display the \gloskey{long} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rGLSpl} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccesslong}[1]{% - \glslongaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrylong{#1}}% - }% - {#1}% - } +\newcommand*{\@rGLSpl}[2][]{% + \new@ifnextchar[{\@rGLSpl@{#1}{#2}}{\@rGLSpl@{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsaccesslongpl} -% Display the long plural form (no link and no check for existence). -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\@rGLSpl@} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsaccesslongpl}[1]{% - \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}% - } +\def\@rGLSpl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGLSplformat{#2}{#3}}% + }% + {% + \@GLSpl@{#1}{#2}[#3]% + }% +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsaccesslongpl} -% Display the long plural form (no link and no check for existence). -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\rglsformat} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - - \newcommand*{\Glsaccesslongpl}[1]{% - \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}% - } +\newcommand*{\rglsformat}[2]{% + \glsifregular{#1} + {\glsentryfirst{#1}}% + {\ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}}#2% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSaccesslongpl} -% Display the \gloskey{longplural} value (no link and no check for existence) -% converted to upper case. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\rglsplformat} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\GLSaccesslongpl}[1]{% - \glslongpluralaccessdisplay - {% - \mfirstucMakeUppercase{\glsentrylongpl{#1}}% - }% - {#1}% - } +\newcommand*{\rglsplformat}[2]{% + \glsifregular{#1} + {\glsentryfirstplural{#1}}% + {\ifglshaslong{#1}{\glsentrylongplural{#1}}{\glsentryfirstplural{#1}}}#2% +} % \end{macrocode} %\end{macro} % -% End of if part +%\begin{macro}{\rGlsformat} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\rGlsformat}[2]{% + \glsifregular{#1} + {\Glsentryfirst{#1}}% + {\ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}}#2% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\rGlsplformat} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\rGlsplformat}[2]{% + \glsifregular{#1} + {\Glsentryfirstplural{#1}}% + {\ifglshaslong{#1}{\Glsentrylongplural{#1}}{\Glsentryfirstplural{#1}}}#2% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\rGLSformat} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\rGLSformat}[2]{% + \expandafter\mfirstucMakeUppercase\expandafter{\rglsformat{#1}{#2}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\rGLSplformat} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} +\newcommand*{\rGLSplformat}[2]{% + \expandafter\mfirstucMakeUppercase\expandafter{\rglsplformat{#1}{#2}}% } +% \end{macrocode} +%\end{macro} +% +%\section{Integration with glossaries-accsupp} +% Provide better integration with the \sty{glossaries-accsupp} +% package. (Must be loaded before the main code of +% \styfmt{glossaries-extra} either explicitly or through the +% \pkgopt{accsupp} package option.) +% +% These commands have their definitions set according to whether +% or not \styfmt{glossaries-extra} has been loaded. +%\changes{0.5.2}{2015-12-08}{fixed typo in glossaries-accsupp and tidied up code to use +% just one \cs{@ifpackageloaded}} +% \begin{macrocode} +\@ifpackageloaded{glossaries-accsupp} { % \end{macrocode} -% No accessibility support. Just define these commands to do -% \cs{glsentry}\meta{xxx} +% Define (or redefine) commands to use the accessibility +% information. %\begin{macro}{\glsaccessname} % Display the \gloskey{name} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessname}[1]{\glsentryname{#1}} + \newcommand*{\glsaccessname}[1]{% + \glsnameaccessdisplay + {% + \glsentryname{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessname} % Display the \gloskey{name} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessname}[1]{\Glsentryname{#1}} + \newcommand*{\Glsaccessname}[1]{% + \glsnameaccessdisplay + {% + \Glsentryname{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessname} -% Display the \gloskey{name} value (no link and no check for existence). +% Display the \gloskey{name} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessname}[1]{% - \protect\mfirstucMakeUppercase{\glsentryname{#1}}} + \glsnameaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryname{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccesstext} % Display the \gloskey{text} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccesstext}[1]{\glsentrytext{#1}} + \newcommand*{\glsaccesstext}[1]{% + \glstextaccessdisplay + {% + \glsentrytext{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccesstext} % Display the \gloskey{text} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\Glsaccesstext}[1]{\Glsentrytext{#1}} + \newcommand*{\Glsaccesstext}[1]{% + \glstextaccessdisplay + {% + \Glsentrytext{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccesstext} -% Display the \gloskey{text} value (no link and no check for existence). +% Display the \gloskey{text} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccesstext}[1]{% - \protect\mfirstucMakeUppercase{\glsentrytext{#1}}} + \glstextaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrytext{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessplural} % Display the \gloskey{plural} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessplural}[1]{\glsentryplural{#1}} + \newcommand*{\glsaccessplural}[1]{% + \glspluralaccessdisplay + {% + \glsentryplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessplural} % Display the \gloskey{plural} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessplural}[1]{\Glsentryplural{#1}} + \newcommand*{\Glsaccessplural}[1]{% + \glspluralaccessdisplay + {% + \Glsentryplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessplural} -% Display the \gloskey{plural} value (no link and no check for existence). +% Display the \gloskey{plural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessplural}[1]{% - \protect\mfirstucMakeUppercase{\glsentryplural{#1}}} + \glspluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryplural{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessfirst} % Display the \gloskey{first} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessfirst}[1]{\glsentryfirst{#1}} + \newcommand*{\glsaccessfirst}[1]{% + \glsfirstaccessdisplay + {% + \glsentryfirst{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessfirst} % Display the \gloskey{first} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessfirst}[1]{\Glsentryfirst{#1}} + \newcommand*{\Glsaccessfirst}[1]{% + \glsfirstaccessdisplay + {% + \Glsentryfirst{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessfirst} -% Display the \gloskey{first} value (no link and no check for existence). +% Display the \gloskey{first} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessfirst}[1]{% - \protect\mfirstucMakeUppercase{\glsentryfirst{#1}}} + \glsfirstaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryfirst{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessfirstplural} % Display the \gloskey{firstplural} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessfirstplural}[1]{\glsentryfirstplural{#1}} + \newcommand*{\glsaccessfirstplural}[1]{% + \glsfirstpluralaccessdisplay + {% + \glsentryfirstplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessfirstplural} % Display the \gloskey{firstplural} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessfirstplural}[1]{\Glsentryfirstplural{#1}} + \newcommand*{\Glsaccessfirstplural}[1]{% + \glsfirstpluralaccessdisplay + {% + \Glsentryfirstplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessfirstplural} -% Display the \gloskey{firstplural} value (no link and no check for existence). +% Display the \gloskey{firstplural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessfirstplural}[1]{% - \protect\mfirstucMakeUppercase{\glsentryfirstplural{#1}}} + \glsfirstpluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryfirstplural{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccesssymbol} % Display the \gloskey{symbol} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccesssymbol}[1]{\glsentrysymbol{#1}} + \newcommand*{\glsaccesssymbol}[1]{% + \glssymbolaccessdisplay + {% + \glsentrysymbol{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccesssymbol} % Display the \gloskey{symbol} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccesssymbol}[1]{\Glsentrysymbol{#1}} + \newcommand*{\Glsaccesssymbol}[1]{% + \glssymbolaccessdisplay + {% + \Glsentrysymbol{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccesssymbol} -% Display the \gloskey{symbol} value (no link and no check for existence). +% Display the \gloskey{symbol} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccesssymbol}[1]{% - \protect\mfirstucMakeUppercase{\glsentrysymbol{#1}}} + \glssymbolaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrysymbol{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccesssymbolplural} % Display the \gloskey{symbolplural} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccesssymbolplural}[1]{\glsentrysymbolplural{#1}} + \newcommand*{\glsaccesssymbolplural}[1]{% + \glssymbolpluralaccessdisplay + {% + \glsentrysymbolplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccesssymbolplural} % Display the \gloskey{symbolplural} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccesssymbolplural}[1]{\Glsentrysymbolplural{#1}} + \newcommand*{\Glsaccesssymbolplural}[1]{% + \glssymbolpluralaccessdisplay + {% + \Glsentrysymbolplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccesssymbolplural} -% Display the \gloskey{symbolplural} value (no link and no check for existence). +% Display the \gloskey{symbolplural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccesssymbolplural}[1]{% - \protect\mfirstucMakeUppercase{\glsentrysymbolplural{#1}}} + \glssymbolpluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrysymbolplural{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessdesc} % Display the \gloskey{desc} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessdesc}[1]{\glsentrydesc{#1}} + \newcommand*{\glsaccessdesc}[1]{% + \glsdescriptionaccessdisplay + {% + \glsentrydesc{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessdesc} % Display the \gloskey{desc} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessdesc}[1]{\Glsentrydesc{#1}} + \newcommand*{\Glsaccessdesc}[1]{% + \glsdescriptionaccessdisplay + {% + \Glsentrydesc{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessdesc} -% Display the \gloskey{desc} value (no link and no check for existence). +% Display the \gloskey{desc} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessdesc}[1]{% - \protect\mfirstucMakeUppercase{\glsentrydesc{#1}}} + \glsdescriptionaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrydesc{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessdescplural} % Display the \gloskey{descplural} value (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessdescplural}[1]{\glsentrydescplural{#1}} + \newcommand*{\glsaccessdescplural}[1]{% + \glsdescriptionpluralaccessdisplay + {% + \glsentrydescplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessdescplural} % Display the \gloskey{descplural} value (no link and no check for existence) % with the first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{new} % \begin{macrocode} - \newcommand*{\Glsaccessdescplural}[1]{\Glsentrydescplural{#1}} + \newcommand*{\Glsaccessdescplural}[1]{% + \glsdescriptionpluralaccessdisplay + {% + \Glsentrydescplural{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessdescplural} -% Display the \gloskey{descplural} value (no link and no check for existence). +% Display the \gloskey{descplural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessdescplural}[1]{% - \protect\mfirstucMakeUppercase{\glsentrydescplural{#1}}} + \glsdescriptionpluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrydescplural{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessshort} % Display the short form (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessshort}[1]{\glsentryshort{#1}} + \newcommand*{\glsaccessshort}[1]{% + \glsshortaccessdisplay + {% + \glsentryshort{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessshort} % Display the short form with first letter converted to uppercase % (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\Glsaccessshort}[1]{\Glsentryshort{#1}} + \newcommand*{\Glsaccessshort}[1]{% + \glsshortaccessdisplay + {% + \Glsentryshort{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessshort} -% Display the \gloskey{short} value (no link and no check for existence). +% Display the \gloskey{short} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessshort}[1]{% - \protect\mfirstucMakeUppercase{\glsentryshort{#1}}} + \glsshortaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryshort{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccessshortpl} % Display the short plural form (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccessshortpl}[1]{\glsentryshortpl{#1}} + \newcommand*{\glsaccessshortpl}[1]{% + \glsshortpluralaccessdisplay + {% + \glsentryshortpl{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccessshortpl} % Display the short plural form with first letter converted to % uppercase (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\Glsaccessshortpl}[1]{\Glsentryshortpl{#1}} + \newcommand*{\Glsaccessshortpl}[1]{% + \glsshortpluralaccessdisplay + {% + \Glsentryshortpl{#1}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccessshortpl} -% Display the \gloskey{shortplural} value (no link and no check for existence). +% Display the \gloskey{shortplural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccessshortpl}[1]{% - \protect\mfirstucMakeUppercase{\glsentryshortpl{#1}}} + \glsshortpluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentryshortpl{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccesslong} % Display the long form (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\glsaccesslong}[1]{\glsentrylong{#1}} + \newcommand*{\glsaccesslong}[1]{% + \glslongaccessdisplay{\glsentrylong{#1}}{#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccesslong} % Display the long form (no link and no check for existence). +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \newcommand*{\Glsaccesslong}[1]{\Glsentrylong{#1}} + + \newcommand*{\Glsaccesslong}[1]{% + \glslongaccessdisplay{\Glsentrylong{#1}}{#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccesslong} -% Display the \gloskey{long} value (no link and no check for existence). +% Display the \gloskey{long} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccesslong}[1]{% - \protect\mfirstucMakeUppercase{\glsentrylong{#1}}} + \glslongaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrylong{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\glsaccesslongpl} % Display the long plural form (no link and no check for existence). +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} - \newcommand*{\glsaccesslongpl}[1]{\glsentrylongpl{#1}} + \newcommand*{\glsaccesslongpl}[1]{% + \glslongpluralaccessdisplay{\glsentrylongpl{#1}}{#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\Glsaccesslongpl} % Display the long plural form (no link and no check for existence). +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} - \newcommand*{\Glsaccesslongpl}[1]{\Glsentrylongpl{#1}} + + \newcommand*{\Glsaccesslongpl}[1]{% + \glslongpluralaccessdisplay{\Glsentrylongpl{#1}}{#1}% + } % \end{macrocode} %\end{macro} % %\begin{macro}{\GLSaccesslongpl} -% Display the \gloskey{longplural} value (no link and no check for existence). +% Display the \gloskey{longplural} value (no link and no check for existence) % converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} \newcommand*{\GLSaccesslongpl}[1]{% - \protect\mfirstucMakeUppercase{\glsentrylongpl{#1}}} + \glslongpluralaccessdisplay + {% + \mfirstucMakeUppercase{\glsentrylongpl{#1}}% + }% + {#1}% + } % \end{macrocode} %\end{macro} % -% End of else part +% End of if part % \begin{macrocode} } +{ % \end{macrocode} -% -%\section{Categories} -%\begin{macro}{\glscategory} -% Add a new storage key that can be used to indicate a category. The -% default category is \category{general}. +% No accessibility support. Just define these commands to do +% \cs{glsentry}\meta{xxx} +%\begin{macro}{\glsaccessname} +% Display the \gloskey{name} value (no link and no check for existence). % \begin{macrocode} -\glsaddstoragekey{category}{general}{\glscategory} + \newcommand*{\glsaccessname}[1]{\glsentryname{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifcategory} -% Convenient shortcut to determine if an entry has the given -% category. +%\begin{macro}{\Glsaccessname} +% Display the \gloskey{name} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\newcommand{\glsifcategory}[4]{% - \ifglsfieldeq{#1}{category}{#2}{#3}{#4}% -} + \newcommand*{\Glsaccessname}[1]{\Glsentryname{#1}} % \end{macrocode} %\end{macro} % -% Categories can have attributes. -%\begin{macro}{\glssetcategoryattribute} -%\begin{definition} -%\cs{glssetcategoryattribute}\marg{category}\marg{attribute-label}\marg{value} -%\end{definition} -% Set (or override if already set) an attribute for the given -% category. +%\begin{macro}{\GLSaccessname} +% Display the \gloskey{name} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\glssetcategoryattribute}[3]{% - \csdef{@glsxtr@categoryattr@@#1@#2}{#3}% -} + \newcommand*{\GLSaccessname}[1]{% + \protect\mfirstucMakeUppercase{\glsentryname{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsgetcategoryattribute} -%\begin{definition} -%\cs{glsgetcategoryattribute}\marg{category}\marg{attribute-label} -%\end{definition} -% Get the value of the given attribute for the given -% category. Does nothing if the attribute isn't defined. +%\begin{macro}{\glsaccesstext} +% Display the \gloskey{text} value (no link and no check for existence). % \begin{macrocode} -\newcommand*{\glsgetcategoryattribute}[2]{% - \csuse{@glsxtr@categoryattr@@#1@#2}% -} + \newcommand*{\glsaccesstext}[1]{\glsentrytext{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glshascategoryattribute} -%\begin{definition} -%\cs{glshascategoryattribute}\marg{category}\marg{attribute-label}\marg{true}\marg{false} -%\end{definition} -%\changes{0.5}{2015-12-07}{new} -% Tests if the category has the given attribute set. +%\begin{macro}{\Glsaccesstext} +% Display the \gloskey{text} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\newcommand*{\glshascategoryattribute}[4]{% - \ifcsvoid{@glsxtr@categoryattr@@#1@#2}{#4}{#3}% -} + \newcommand*{\Glsaccesstext}[1]{\Glsentrytext{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glssetattribute} -%\begin{definition} -%\cs{glssetattribute}\marg{entry label}\marg{attribute-label}\marg{value} -%\end{definition} -% Short cut where the category label is obtained from the entry -% information. +%\begin{macro}{\GLSaccesstext} +% Display the \gloskey{text} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\glssetattribute}[3]{% - \glssetcategoryattribute{\glscategory{#1}}{#2}{#3}% -} + \newcommand*{\GLSaccesstext}[1]{% + \protect\mfirstucMakeUppercase{\glsentrytext{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsgetattribute} -%\begin{definition} -%\cs{glsgetattribute}\marg{entry label}\marg{attribute-label} -%\end{definition} -% Short cut where the category label is obtained from the entry -% information. +%\begin{macro}{\glsaccessplural} +% Display the \gloskey{plural} value (no link and no check for existence). % \begin{macrocode} -\newcommand*{\glsgetattribute}[2]{% - \glsgetcategoryattribute{\glscategory{#1}}{#2}% -} + \newcommand*{\glsaccessplural}[1]{\glsentryplural{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glshasattribute} -%\begin{definition} -%\cs{glshasattribute}\marg{entry -%label}\marg{attribute-label}\marg{true}\marg{false} -%\end{definition} -%\changes{0.5}{2015-12-07}{new} -%\changes{0.5.4}{2015-12-15}{added check for entry's existence} -% Short cut to test if the given attribute has been set where the -% category label is obtained from the entry information. +%\begin{macro}{\Glsaccessplural} +% Display the \gloskey{plural} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\newcommand*{\glshasattribute}[4]{% - \ifglsentryexists{#1}% - {\glshascategoryattribute{\glscategory{#1}}{#2}{#3}{#4}}% - {#4}% -} + \newcommand*{\Glsaccessplural}[1]{\Glsentryplural{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifcategoryattribute} -%\begin{definition} -%\cs{glsifcategoryattribute}\marg{category}\marg{attribute-label}\marg{value}\marg{true -%part}\marg{false part} -%\end{definition} -% True if category has the attribute with the given value. +%\begin{macro}{\GLSaccessplural} +% Display the \gloskey{plural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand{\glsifcategoryattribute}[5]{% - \ifcsundef{@glsxtr@categoryattr@@#1@#2}% - {#5}% - {\ifcsstring{@glsxtr@categoryattr@@#1@#2}{#3}{#4}{#5}}% -} + \newcommand*{\GLSaccessplural}[1]{% + \protect\mfirstucMakeUppercase{\glsentryplural{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifattribute} -%\begin{definition} -%\cs{glsifattribute}\marg{entry label}\marg{attribute-label}\marg{value}\marg{true -%part}\marg{false part} -%\end{definition} -%Short cut to determine if the given entry has a category with the -%given attribute set. -%\changes{0.5.4}{2015-12-15}{added check for entry's existence} +%\begin{macro}{\glsaccessfirst} +% Display the \gloskey{first} value (no link and no check for existence). % \begin{macrocode} -\newcommand{\glsifattribute}[5]{% - \ifglsentryexists{#1}% - {\glsifcategoryattribute{\glscategory{#1}}{#2}{#3}{#4}{#5}}% - {#5}% -} + \newcommand*{\glsaccessfirst}[1]{\glsentryfirst{#1}} % \end{macrocode} %\end{macro} % -% Set attributes for the default \category{general} category: -% \begin{macrocode} -\glssetcategoryattribute{general}{regular}{true} -% \end{macrocode} -% Acronyms are regular by default, since they're typically just -% treated like normal words. +%\begin{macro}{\Glsaccessfirst} +% Display the \gloskey{first} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\glssetcategoryattribute{acronym}{regular}{true} + \newcommand*{\Glsaccessfirst}[1]{\Glsentryfirst{#1}} % \end{macrocode} +%\end{macro} % -%\begin{macro}{\glssetregularcategory} -%Convenient shortcut to create add the regular attribute. +%\begin{macro}{\GLSaccessfirst} +% Display the \gloskey{first} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\glssetregularcategory}[1]{% - \glssetcategoryattribute{#1}{regular}{true}% -} + \newcommand*{\GLSaccessfirst}[1]{% + \protect\mfirstucMakeUppercase{\glsentryfirst{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifregularcategory} -%\begin{definition} -%\cs{glsifregularcategory}\marg{category}\marg{true part}\marg{false part} -%\end{definition} -% Short cut to determine if a category has the regular attribute -% explicitly set to true. +%\begin{macro}{\glsaccessfirstplural} +% Display the \gloskey{firstplural} value (no link and no check for existence). % \begin{macrocode} -\newcommand{\glsifregularcategory}[3]{% - \glsifcategoryattribute{#1}{regular}{true}{#2}{#3}% -} + \newcommand*{\glsaccessfirstplural}[1]{\glsentryfirstplural{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifnotregularcategory} -%\begin{definition} -%\cs{glsifnotregularcategory}\marg{category}\marg{true part}\marg{false part} -%\end{definition} -% Short cut to determine if a category has the regular attribute -% explicitly set to false. -%\changes{1.04}{2016-05-02}{new} +%\begin{macro}{\Glsaccessfirstplural} +% Display the \gloskey{firstplural} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\newcommand{\glsifnotregularcategory}[3]{% - \glsifcategoryattribute{#1}{regular}{false}{#2}{#3}% -} + \newcommand*{\Glsaccessfirstplural}[1]{\Glsentryfirstplural{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifregular} -%\begin{definition} -%\cs{glsifregular}\marg{entry label}\marg{true part}\marg{false part} -%\end{definition} -% Short cut to determine if an entry has a regular attribute set to -% true. +%\begin{macro}{\GLSaccessfirstplural} +% Display the \gloskey{firstplural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand{\glsifregular}[3]{% - \glsifregularcategory{\glscategory{#1}}{#2}{#3}% -} + \newcommand*{\GLSaccessfirstplural}[1]{% + \protect\mfirstucMakeUppercase{\glsentryfirstplural{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsifnotregular} -%\begin{definition} -%\cs{glsifnotregular}\marg{entry label}\marg{true part}\marg{false part} -%\end{definition} -% Short cut to determine if an entry has a regular attribute set to -% false. +%\begin{macro}{\glsaccesssymbol} +% Display the \gloskey{symbol} value (no link and no check for existence). % \begin{macrocode} -\newcommand{\glsifnotregular}[3]{% - \glsifnotregularcategory{\glscategory{#1}}{#2}{#3}% -} + \newcommand*{\glsaccesssymbol}[1]{\glsentrysymbol{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsforeachincategory} -%\begin{definition} -%\cs{glsforeachincategory}\oarg{glossary -%labels}\marg{category-label}\marg{glossary-cs}\marg{label-cs}\marg{body} -%\end{definition} -% Iterates through all entries in all the glossaries (or just those -% listed in \meta{glossary labels}) and does \meta{body} if the -% category matches \meta{category-label}. The control sequences -% \meta{glossary-cs} and \meta{label-cs} may be used in \meta{body} -% to access the glossary label and entry label for the current -% iteration. +%\begin{macro}{\Glsaccesssymbol} +% Display the \gloskey{symbol} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -\newcommand{\glsforeachincategory}[5][\@glo@types]{% - \forallglossaries[#1]{#3}% - {% - \forglsentries[#3]{#4}% - {% - \glsifcategory{#4}{#2}{#5}{}% - }% - }% -} + \newcommand*{\Glsaccesssymbol}[1]{\Glsentrysymbol{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsforeachwithattribute} -%\begin{definition} -%\cs{glsforeachwithattribute}\oarg{glossary -%labels}\marg{attribute-label}\marg{attribute-value}\marg{glossary-cs}\marg{label-cs}\marg{body} -%\end{definition} -% Iterates through all entries in all the glossaries (or just those -% listed in \meta{glossary labels}) and does \meta{body} if the -% category attribute \meta{attribute-label} matches -% \meta{attribute-value}. The control sequences -% \meta{glossary-cs} and \meta{label-cs} may be used in \meta{body} -% to access the glossary label and entry label for the current -% iteration. +%\begin{macro}{\GLSaccesssymbol} +% Display the \gloskey{symbol} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand{\glsforeachwithattribute}[6][\@glo@types]{% - \forallglossaries[#1]{#4}% - {% - \forglsentries[#4]{#5}% - {% - \glsifattribute{#5}{#2}{#3}{#6}{}% - }% - }% -} + \newcommand*{\GLSaccesssymbol}[1]{% + \protect\mfirstucMakeUppercase{\glsentrysymbol{#1}}} % \end{macrocode} %\end{macro} % -% If \cs{newterm} has been defined, redefine it so that it -% automatically sets the category label to \category{index} and add -% \cs{glsxtrpostdescription}. +%\begin{macro}{\glsaccesssymbolplural} +% Display the \gloskey{symbolplural} value (no link and no check for existence). % \begin{macrocode} -\ifdef\newterm -{% + \newcommand*{\glsaccesssymbolplural}[1]{\glsentrysymbolplural{#1}} % \end{macrocode} -%\begin{macro}{\newterm} -%\changes{0.4}{2015-12-03}{fixed name argument} +%\end{macro} +% +%\begin{macro}{\Glsaccesssymbolplural} +% Display the \gloskey{symbolplural} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} - \renewcommand*{\newterm}[2][]{% - \newglossaryentry{#2}% - {type={index},category=index,name={#2},% - description={\glsxtrpostdescription\nopostdesc},#1}% - } + \newcommand*{\Glsaccesssymbolplural}[1]{\Glsentrysymbolplural{#1}} % \end{macrocode} %\end{macro} -% Indexed terms are regular by default. +% +%\begin{macro}{\GLSaccesssymbolplural} +% Display the \gloskey{symbolplural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} - \glssetcategoryattribute{index}{regular}{true} + \newcommand*{\GLSaccesssymbolplural}[1]{% + \protect\mfirstucMakeUppercase{\glsentrysymbolplural{#1}}} % \end{macrocode} -%\begin{macro}{\glsxtrpostdescindex} +%\end{macro} +% +%\begin{macro}{\glsaccessdesc} +% Display the \gloskey{desc} value (no link and no check for existence). % \begin{macrocode} - \newcommand*{\glsxtrpostdescindex}{} + \newcommand*{\glsaccessdesc}[1]{\glsentrydesc{#1}} % \end{macrocode} %\end{macro} +% +%\begin{macro}{\Glsaccessdesc} +% Display the \gloskey{desc} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} -} -{} + \newcommand*{\Glsaccessdesc}[1]{\Glsentrydesc{#1}} % \end{macrocode} +%\end{macro} % -%If the \pkgopt{symbols} package option was used, define a similar -%command for symbols, but set the default sort to the label rather -%than the name as the symbols will typically contain commands that -%will confuse makeindex and xindy. +%\begin{macro}{\GLSaccessdesc} +% Display the \gloskey{desc} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\ifdef\printsymbols -{% + \newcommand*{\GLSaccessdesc}[1]{% + \protect\mfirstucMakeUppercase{\glsentrydesc{#1}}} % \end{macrocode} -%\begin{macro}{\glsxtrnewsymbol} -%\changes{0.4}{2015-12-03}{added extra argument} -% Unlike \cs{newterm}, this has a separate argument for the label -% (since the symbol will likely contain commands). +%\end{macro} +% +%\begin{macro}{\glsaccessdescplural} +% Display the \gloskey{descplural} value (no link and no check for existence). % \begin{macrocode} - \newcommand*{\glsxtrnewsymbol}[3][]{% - \newglossaryentry{#2}{name={#3},sort={#2},type=symbols,category=symbol,#1}% - } + \newcommand*{\glsaccessdescplural}[1]{\glsentrydescplural{#1}} % \end{macrocode} %\end{macro} -% Symbols are regular by default. +% +%\begin{macro}{\Glsaccessdescplural} +% Display the \gloskey{descplural} value (no link and no check for existence) +% with the first letter converted to upper case. % \begin{macrocode} - \glssetcategoryattribute{symbol}{regular}{true} + \newcommand*{\Glsaccessdescplural}[1]{\Glsentrydescplural{#1}} % \end{macrocode} -%\begin{macro}{\glsxtrpostdescsymbol} +%\end{macro} +% +%\begin{macro}{\GLSaccessdescplural} +% Display the \gloskey{descplural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} - \newcommand*{\glsxtrpostdescsymbol}{} + \newcommand*{\GLSaccessdescplural}[1]{% + \protect\mfirstucMakeUppercase{\glsentrydescplural{#1}}} % \end{macrocode} %\end{macro} +% +%\begin{macro}{\glsaccessshort} +% Display the short form (no link and no check for existence). % \begin{macrocode} -} -{} + \newcommand*{\glsaccessshort}[1]{\glsentryshort{#1}} % \end{macrocode} +%\end{macro} % -% Similar for the numbers option. +%\begin{macro}{\Glsaccessshort} +% Display the short form with first letter converted to uppercase +% (no link and no check for existence). % \begin{macrocode} -\ifdef\printnumbers -{% + \newcommand*{\Glsaccessshort}[1]{\Glsentryshort{#1}} % \end{macrocode} -%\begin{macro}{\glsxtrnewnumber} -%\changes{0.4}{2015-12-03}{added extra argument} +%\end{macro} +% +%\begin{macro}{\GLSaccessshort} +% Display the \gloskey{short} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\ifdef\printnumbers - \newcommand*{\glsxtrnewnumber}[3][]{% - \newglossaryentry{#2}{name={#3},sort={#2},type=numbers,category=number,#1}% - } + \newcommand*{\GLSaccessshort}[1]{% + \protect\mfirstucMakeUppercase{\glsentryshort{#1}}} % \end{macrocode} %\end{macro} -% Numbers are regular by default. +% +%\begin{macro}{\glsaccessshortpl} +% Display the short plural form (no link and no check for existence). % \begin{macrocode} - \glssetcategoryattribute{number}{regular}{true} + \newcommand*{\glsaccessshortpl}[1]{\glsentryshortpl{#1}} % \end{macrocode} -%\begin{macro}{\glsxtrpostdescnumber} +%\end{macro} +% +%\begin{macro}{\Glsaccessshortpl} +% Display the short plural form with first letter converted to +% uppercase (no link and no check for existence). % \begin{macrocode} - \newcommand*{\glsxtrpostdescnumber}{} + \newcommand*{\Glsaccessshortpl}[1]{\Glsentryshortpl{#1}} % \end{macrocode} %\end{macro} +% +%\begin{macro}{\GLSaccessshortpl} +% Display the \gloskey{shortplural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -} -{} + \newcommand*{\GLSaccessshortpl}[1]{% + \protect\mfirstucMakeUppercase{\glsentryshortpl{#1}}} % \end{macrocode} +%\end{macro} % -%\begin{macro}{\glsxtrsetcategory} -% Set the category for all listed labels. The first argument is the -% list of entry labels and the second argument is the category label. +%\begin{macro}{\glsaccesslong} +% Display the long form (no link and no check for existence). % \begin{macrocode} -\newcommand*{\glsxtrsetcategory}[2]{% - \@for\@glsxtr@label:=#1\do - {% - \glsfieldxdef{\@glsxtr@label}{category}{#2}% - }% -} + \newcommand*{\glsaccesslong}[1]{\glsentrylong{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrsetcategoryforall} -% Set the category for all entries in the listed glossaries. The first argument -% is the list of glossary labels and the second argument is the category label. +%\begin{macro}{\Glsaccesslong} +% Display the long form (no link and no check for existence). % \begin{macrocode} -\newcommand*{\glsxtrsetcategoryforall}[2]{% - \forallglossaries[#1]{\@glsxtr@type}{% - \forglsentries[\@glsxtr@type]{\@glsxtr@label}% - {% - \glsfieldxdef{\@glsxtr@label}{category}{#2}% - }% - }% -} + \newcommand*{\Glsaccesslong}[1]{\Glsentrylong{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrfieldtitlecase} -%\begin{definition} -%\cs{glsxtrfieldtitlecase}\marg{label}\marg{field} -%\end{definition} -% Apply title casing to the contents of the given field. +%\begin{macro}{\GLSaccesslong} +% Display the \gloskey{long} value (no link and no check for existence). +% converted to upper case. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\glsxtrfieldtitlecase}[2]{% - \expandafter\glsxtrfieldtitlecasecs\expandafter - {\csname glo@\glsdetoklabel{#1}@#2\endcsname}% -} + \newcommand*{\GLSaccesslong}[1]{% + \protect\mfirstucMakeUppercase{\glsentrylong{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrfieldtitlecasecs} -%The command used by \cs{glsxtrfieldtitlecase}. May be -%redefined to use a different command, for example, -%\cs{xcapitalisefmtwords}. -%\changes{1.07}{2016-08-15}{new} +%\begin{macro}{\glsaccesslongpl} +% Display the long plural form (no link and no check for existence). % \begin{macrocode} -\newcommand*{\glsxtrfieldtitlecasecs}[1]{\xcapitalisewords{#1}} + \newcommand*{\glsaccesslongpl}[1]{\glsentrylongpl{#1}} % \end{macrocode} %\end{macro} % -% Provide a convenient way to modify glossary styles without having -% to define a new style just to convert the first letter of fields -% to upper case. -%\begin{macro}{\glossentrydesc} -% If the \catattr{glossdesc} attribute is \qt{firstuc} convert first -% letter to upper case. If the attribute is \qt{title} use title -% case. +%\begin{macro}{\Glsaccesslongpl} +% Display the long plural form (no link and no check for existence). % \begin{macrocode} -\@ifpackageloaded{glossaries-accsupp} -{ - \renewcommand*{\glossentrydesc}[1]{% - \glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% + \newcommand*{\Glsaccesslongpl}[1]{\Glsentrylongpl{#1}} % \end{macrocode} -% As from version 1.04, allow the \catattr{glossdescfont} attribute -% to determine the font applied. -%\changes{1.04}{2016-05-02}{added glossdescfont attribute check} +%\end{macro} +% +%\begin{macro}{\GLSaccesslongpl} +% Display the \gloskey{longplural} value (no link and no check for existence). +% converted to upper case. +%\changes{0.5.2}{2015-12-08}{new} +% \begin{macrocode} + \newcommand*{\GLSaccesslongpl}[1]{% + \protect\mfirstucMakeUppercase{\glsentrylongpl{#1}}} +% \end{macrocode} +%\end{macro} +% +% End of else part % \begin{macrocode} - \glshasattribute{#1}{glossdescfont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossdescfont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossdescfont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossdescfont attribute - for entry `#1'. Ignoring}% - \let\@glsxtr@glossdescfont\@firstofone - }% - }% - {\let\@glsxtr@glossdescfont\@firstofone}% - \glsifattribute{#1}{glossdesc}{firstuc}% - {% - \@glsxtr@glossdescfont{\Glsaccessdesc{#1}}% - }% - {% - \glsifattribute{#1}{glossdesc}{title}% - {% - \@glsxtr@do@titlecaps@warn - \glsdescriptionaccessdisplay - {% - \@glsxtr@glossdescfont{\glsxtrfieldtitlecase{#1}{desc}}% - }% - {#1}% - }% - {% - \@glsxtr@glossdescfont{\glsaccessdesc{#1}}% - }% - }% - }% - } -} -{ - \renewcommand*{\glossentrydesc}[1]{% - \glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% - \glshasattribute{#1}{glossdescfont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossdescfont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossdescfont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossdescfont attribute - for entry `#1'. Ignoring}% - \let\@glsxtr@glossdescfont\@firstofone - }% - }% - {\let\@glsxtr@glossdescfont\@firstofone}% - \glsifattribute{#1}{glossdesc}{firstuc}% - {% - \@glsxtr@glossdescfont{\Glsentrydesc{#1}}% - }% - {% - \glsifattribute{#1}{glossdesc}{title}% - {% - \@glsxtr@do@titlecaps@warn - \@glsxtr@glossdescfont{\glsxtrfieldtitlecase{#1}{desc}}% - }% - {% - \@glsxtr@glossdescfont{\glsentrydesc{#1}}% - }% - }% - }% - } } % \end{macrocode} +% +%\section{Categories} +%\begin{macro}{\glscategory} +% Add a new storage key that can be used to indicate a category. The +% default category is \category{general}. +% \begin{macrocode} +\glsaddstoragekey{category}{general}{\glscategory} +% \end{macrocode} %\end{macro} % -%\begin{macro}{\glossentryname} -% If the \catattr{glossname} attribute is \qt{firstuc} convert first -% letter to upper case. If the attribute is \qt{title} use title -% case. +%\begin{macro}{\glsifcategory} +% Convenient shortcut to determine if an entry has the given +% category. % \begin{macrocode} -\@ifpackageloaded{glossaries-accsupp} -{ - \renewcommand*{\glossentryname}[1]{% - \@glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% +\newcommand{\glsifcategory}[4]{% + \ifglsfieldeq{#1}{category}{#2}{#3}{#4}% +} % \end{macrocode} -% As from version 1.04, allow the \catattr{glossnamefont} attribute -% to determine the font applied. -%\changes{1.04}{2016-05-02}{added glossnamefont attribute check} +%\end{macro} +% +% Categories can have attributes. +%\begin{macro}{\glssetcategoryattribute} +%\begin{definition} +%\cs{glssetcategoryattribute}\marg{category}\marg{attribute-label}\marg{value} +%\end{definition} +% Set (or override if already set) an attribute for the given +% category. % \begin{macrocode} - \glshasattribute{#1}{glossnamefont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossnamefont attribute - for entry `#1'. Reverting to default \string\glsnamefont}% - \let\@glsxtr@glossnamefont\glsnamefont - }% - }% - {\let\@glsxtr@glossnamefont\glsnamefont}% - \glsifattribute{#1}{glossname}{firstuc}% - {% - \glsnameaccessdisplay - {% - \@glsxtr@glossnamefont{\Glsentryname{#1}}% - }% - {#1}% - }% - {% - \glsifattribute{#1}{glossname}{title}% - {% - \@glsxtr@do@titlecaps@warn - \glsnameaccessdisplay - {% - \@glsxtr@glossnamefont{\glsxtrfieldtitlecase{#1}{name}}% - }% - {#1}% - }% - {% - \glsifattribute{#1}{glossname}{uc}% - {% - \glsnameaccessdisplay - {% -% \end{macrocode} -% Hide the label from the upper-casing command. -% \begin{macrocode} - \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% - \@glsxtr@glossnamefont{\mfirstucMakeUppercase{\glo@name}}% - }% - {#1}% - }% - {% - \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% - \glsnameaccessdisplay - {% - \expandafter\@glsxtr@glossnamefont\expandafter{\glo@name}% - }% - {#1}% - }% - }% - }% -% \end{macrocode} -% Do post-name hook: -% \begin{macrocode} - \glsxtrpostnamehook{#1}% - }% - } +\newcommand*{\glssetcategoryattribute}[3]{% + \csdef{@glsxtr@categoryattr@@#1@#2}{#3}% } -{ - \renewcommand*{\glossentryname}[1]{% - \@glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% - \glshasattribute{#1}{glossnamefont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossnamefont attribute - for entry `#1'. Reverting to default \string\glsnamefont}% - \let\@glsxtr@glossnamefont\glsnamefont - }% - }% - {\let\@glsxtr@glossnamefont\glsnamefont}% - \glsifattribute{#1}{glossname}{firstuc}% - {% - \@glsxtr@glossnamefont{\Glsentryname{#1}}% - }% - {% - \glsifattribute{#1}{glossname}{title}% - {% - \@glsxtr@do@titlecaps@warn - \@glsxtr@glossnamefont{\glsxtrfieldtitlecase{#1}{name}}% - }% - {% - \glsifattribute{#1}{glossname}{uc}% - {% -% \end{macrocode} -% Hide the label from the upper-casing command. -% \begin{macrocode} - \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% - \@glsxtr@glossnamefont{\mfirstucMakeUppercase{\glo@name}}% - }% - {% -% \end{macrocode} -% This little trick is used by \styfmt{glossaries} to allow the user to -% redefine \ics{glsnamefont} to use \cs{makefirstuc}. Support it -% even though they can now use the \catattr{firstuc} attribute. -% \begin{macrocode} - \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% - \expandafter\@glsxtr@glossnamefont\expandafter{\glo@name}% - }% - }% - }% % \end{macrocode} -% Do post-name hook. -%\changes{1.04}{2016-05-02}{moved post name hook inside condition} +%\end{macro} +% +%\begin{macro}{\glsgetcategoryattribute} +%\begin{definition} +%\cs{glsgetcategoryattribute}\marg{category}\marg{attribute-label} +%\end{definition} +% Get the value of the given attribute for the given +% category. Does nothing if the attribute isn't defined. % \begin{macrocode} - \glsxtrpostnamehook{#1}% - }% - } +\newcommand*{\glsgetcategoryattribute}[2]{% + \csuse{@glsxtr@categoryattr@@#1@#2}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glossentryname} -% Redefine to set the abbreviation format and accessibility support. -%\changes{0.5.2}{2015-12-08}{added} -% \begin{macrocode} -\@ifpackageloaded{glossaries-accsupp} -{ - \renewcommand*{\Glossentryname}[1]{% - \@glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% -% \end{macrocode} -% As from version 1.04, allow the \catattr{glossnamefont} attribute -% to determine the font applied. -%\changes{1.04}{2016-05-02}{added glossnamefont attribute check} -% \begin{macrocode} - \glshasattribute{#1}{glossnamefont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossnamefont attribute - for entry `#1'. Reverting to default \string\glsnamefont}% - \let\@glsxtr@glossnamefont\glsnamefont - }% - }% - {\let\@glsxtr@glossnamefont\glsnamefont}% - \glsnameaccessdisplay - {% - \@glsxtr@glossnamefont{\Glsentryname{#1}}% - }% - {#1}% -% \end{macrocode} -% Do post-name hook: +%\begin{macro}{\glshascategoryattribute} +%\begin{definition} +%\cs{glshascategoryattribute}\marg{category}\marg{attribute-label}\marg{true}\marg{false} +%\end{definition} +%\changes{0.5}{2015-12-07}{new} +% Tests if the category has the given attribute set. % \begin{macrocode} - \glsxtrpostnamehook{#1}% - }% - } +\newcommand*{\glshascategoryattribute}[4]{% + \ifcsvoid{@glsxtr@categoryattr@@#1@#2}{#4}{#3}% } -{ - \renewcommand*{\Glossentryname}[1]{% - \@glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% - \glshasattribute{#1}{glossnamefont}% - {% - \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% - \ifcsdef{\@glsxtr@attrval}% - {% - \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% - }% - {% - \GlossariesExtraWarning{Unknown control sequence name - `\@glsxtr@attrval' supplied in glossnamefont attribute - for entry `#1'. Reverting to default \string\glsnamefont}% - \let\@glsxtr@glossnamefont\glsnamefont - }% - }% - {\let\@glsxtr@glossnamefont\glsnamefont}% - \@glsxtr@glossnamefont{\Glsentryname{#1}}% % \end{macrocode} -% Do post-name hook: +%\end{macro} +% +%\begin{macro}{\glssetattribute} +%\begin{definition} +%\cs{glssetattribute}\marg{entry label}\marg{attribute-label}\marg{value} +%\end{definition} +% Short cut where the category label is obtained from the entry +% information. % \begin{macrocode} - \glsxtrpostnamehook{#1}% - }% - } +\newcommand*{\glssetattribute}[3]{% + \glssetcategoryattribute{\glscategory{#1}}{#2}{#3}% } % \end{macrocode} %\end{macro} % -% Provide a convenient way to also index the entries using the -% standard \ics{index} mechanism. This may use different actual, -% encap and escape characters to those used for the glossaries. -% -%\begin{macro}{\glsxtrpostnamehook} -%\changes{0.5.3}{2015-12-09}{new} -% Hook to append stuff after the name is displayed in the glossary. -% The argument is the entry's label. -% \begin{macrocode} -\newcommand*{\glsxtrpostnamehook}[1]{% - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \glsxtrdoautoindexname{#1}{indexname}% -% \end{macrocode} -% Allow categories to hook in here. -%\changes{1.04}{2016-05-02}{added category check} +%\begin{macro}{\glsgetattribute} +%\begin{definition} +%\cs{glsgetattribute}\marg{entry label}\marg{attribute-label} +%\end{definition} +% Short cut where the category label is obtained from the entry +% information. % \begin{macrocode} - \csuse{glsxtrpostname\glscategory{#1}}% +\newcommand*{\glsgetattribute}[2]{% + \glsgetcategoryattribute{\glscategory{#1}}{#2}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\if@glsxtr@format@override} -%\changes{0.5.3}{2015-12-09}{new} -% Determines if the \gloskey[glslink]{format} key should override -% the indexing attribute value. +%\begin{macro}{\glshasattribute} +%\begin{definition} +%\cs{glshasattribute}\marg{entry +%label}\marg{attribute-label}\marg{true}\marg{false} +%\end{definition} +%\changes{0.5}{2015-12-07}{new} +%\changes{0.5.4}{2015-12-15}{added check for entry's existence} +% Short cut to test if the given attribute has been set where the +% category label is obtained from the entry information. % \begin{macrocode} -\newif\if@glsxtr@format@override -\@glsxtr@format@overridefalse +\newcommand*{\glshasattribute}[4]{% + \ifglsentryexists{#1}% + {\glshascategoryattribute{\glscategory{#1}}{#2}{#3}{#4}}% + {#4}% +} % \end{macrocode} %\end{macro} % -%If overriding is enabled, the \ics{glshypernumber} command will have to -%be redefined in the index to use \cs{hyperpage} instead. -%\begin{macro}{\GlsXtrEnableIndexFormatOverride} -% \begin{macrocode} -\@ifpackageloaded{hyperref} -{ -% \end{macrocode} -% If \sty{hyperref}'s \pkgoptfmt{hyperindex} option is on, then -% \sty{hyperref} will automatically add \cs{hyperpage}, so don't -% add it. +%\begin{macro}{\glsifcategoryattribute} +%\begin{definition} +%\cs{glsifcategoryattribute}\marg{category}\marg{attribute-label}\marg{value}\marg{true +%part}\marg{false part} +%\end{definition} +% True if category has the attribute with the given value. % \begin{macrocode} - \ifHy@hyperindex - \newcommand*{\GlsXtrEnableIndexFormatOverride}{% - \@glsxtr@format@overridetrue - \appto\theindex{\let\glshypernumber\@firstofone}% - } - \else - \newcommand*{\GlsXtrEnableIndexFormatOverride}{% - \@glsxtr@format@overridetrue - \appto\theindex{\let\glshypernumber\hyperpage}% - } - \fi +\newcommand{\glsifcategoryattribute}[5]{% + \ifcsundef{@glsxtr@categoryattr@@#1@#2}% + {#5}% + {\ifcsstring{@glsxtr@categoryattr@@#1@#2}{#3}{#4}{#5}}% } -{ - \newcommand*{\GlsXtrEnableIndexFormatOverride}{% - \@glsxtr@format@overridetrue - } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsifattribute} +%\begin{definition} +%\cs{glsifattribute}\marg{entry label}\marg{attribute-label}\marg{value}\marg{true +%part}\marg{false part} +%\end{definition} +%Short cut to determine if the given entry has a category with the +%given attribute set. +%\changes{0.5.4}{2015-12-15}{added check for entry's existence} +% \begin{macrocode} +\newcommand{\glsifattribute}[5]{% + \ifglsentryexists{#1}% + {\glsifcategoryattribute{\glscategory{#1}}{#2}{#3}{#4}{#5}}% + {#5}% } -\@onlypreamble\GlsXtrEnableIndexFormatOverride % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrdoautoindexname} -%\changes{0.5.3}{2015-12-09}{new} +% Set attributes for the default \category{general} category: % \begin{macrocode} -\newcommand*{\glsxtrdoautoindexname}[2]{% - \glshasattribute{#1}{#2}% - {% +\glssetcategoryattribute{general}{regular}{true} % \end{macrocode} -% Escape any makeindex/xindy characters in the value of the \gloskey{name} -% field. Take care with \sty{babel} as this won't work if the -% category code has changed for those characters. +% Acronyms are regular by default, since they're typically just +% treated like normal words. % \begin{macrocode} - \@glsxtr@autoindex@setname{#1}% +\glssetcategoryattribute{acronym}{regular}{true} % \end{macrocode} -% If the attribute value is simply \qt{true} don't add an encap, -% otherwise use the value as the encap. +% +%\begin{macro}{\glssetregularcategory} +%Convenient shortcut to create add the regular attribute. % \begin{macrocode} - \protected@edef\@glsxtr@attrval{\glsgetattribute{#1}{#2}}% - \if@glsxtr@format@override +\newcommand*{\glssetregularcategory}[1]{% + \glssetcategoryattribute{#1}{regular}{true}% +} % \end{macrocode} -%\changes{1.19}{2017-09-09}{changed format test} +%\end{macro} +% +%\begin{macro}{\glsifregularcategory} +%\begin{definition} +%\cs{glsifregularcategory}\marg{category}\marg{true part}\marg{false part} +%\end{definition} +% Short cut to determine if a category has the regular attribute +% explicitly set to true. % \begin{macrocode} - \ifx\@glsnumberformat\@glsxtr@defaultnumberformat - \else - \let\@glsxtr@attrval\@glsnumberformat - \fi - \fi - \ifdefstring{\@glsxtr@attrval}{true}% - {}% - {\eappto\@glo@name{\@glsxtr@autoindex@encap\@glsxtr@attrval}}% - \expandafter\glsxtrautoindex\expandafter{\@glo@name}% - }% - {}% +\newcommand{\glsifregularcategory}[3]{% + \glsifcategoryattribute{#1}{regular}{true}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrautoindex} -%\changes{1.16}{2017-06-15}{new} +%\begin{macro}{\glsifnotregularcategory} +%\begin{definition} +%\cs{glsifnotregularcategory}\marg{category}\marg{true part}\marg{false part} +%\end{definition} +% Short cut to determine if a category has the regular attribute +% explicitly set to false. +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\glsxtrautoindex}{\index} +\newcommand{\glsifnotregularcategory}[3]{% + \glsifcategoryattribute{#1}{regular}{false}{#2}{#3}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@autoindex@setname} -%\changes{0.5.3}{2015-12-09}{new} -% Assign \cs{@glo@name} for use with \catattr{indexname} attribute. +%\begin{macro}{\glsifregular} +%\begin{definition} +%\cs{glsifregular}\marg{entry label}\marg{true part}\marg{false part} +%\end{definition} +% Short cut to determine if an entry has a regular attribute set to +% true. % \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@setname}[1]{% - \protected@edef\@glo@name{\glsxtrautoindexentry{#1}}% - \glsxtrautoindexassignsort{\@glo@sort}{#1}% - \@gls@checkmkidxchars\@glo@sort - \@glsxtr@autoindex@doextra@esc\@glo@sort - \epreto\@glo@name{\@glo@sort\@glsxtr@autoindex@at}% +\newcommand{\glsifregular}[3]{% + \glsifregularcategory{\glscategory{#1}}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrautoindexentry} -%\changes{1.16}{2017-06-15}{new} -%Command used for the actual part when auto-indexing. +%\begin{macro}{\glsifnotregular} +%\begin{definition} +%\cs{glsifnotregular}\marg{entry label}\marg{true part}\marg{false part} +%\end{definition} +% Short cut to determine if an entry has a regular attribute set to +% false. % \begin{macrocode} -\newcommand*{\glsxtrautoindexentry}[1]{\string\glsentryname{#1}} +\newcommand{\glsifnotregular}[3]{% + \glsifnotregularcategory{\glscategory{#1}}{#2}{#3}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrautoindexsort} -%\changes{1.16}{2017-06-15}{new} -%Used to assign the sort value when auto-indexing. +%\begin{macro}{\glsforeachincategory} +%\begin{definition} +%\cs{glsforeachincategory}\oarg{glossary +%labels}\marg{category-label}\marg{glossary-cs}\marg{label-cs}\marg{body} +%\end{definition} +% Iterates through all entries in all the glossaries (or just those +% listed in \meta{glossary labels}) and does \meta{body} if the +% category matches \meta{category-label}. The control sequences +% \meta{glossary-cs} and \meta{label-cs} may be used in \meta{body} +% to access the glossary label and entry label for the current +% iteration. % \begin{macrocode} -\newcommand*{\glsxtrautoindexassignsort}[2]{% - \glsletentryfield{#1}{#2}{sort}% +\newcommand{\glsforeachincategory}[5][\@glo@types]{% + \forallglossaries[#1]{#3}% + {% + \forglsentries[#3]{#4}% + {% + \glsifcategory{#4}{#2}{#5}{}% + }% + }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@autoindex@doextra@esc} +%\begin{macro}{\glsforeachwithattribute} +%\begin{definition} +%\cs{glsforeachwithattribute}\oarg{glossary +%labels}\marg{attribute-label}\marg{attribute-value}\marg{glossary-cs}\marg{label-cs}\marg{body} +%\end{definition} +% Iterates through all entries in all the glossaries (or just those +% listed in \meta{glossary labels}) and does \meta{body} if the +% category attribute \meta{attribute-label} matches +% \meta{attribute-value}. The control sequences +% \meta{glossary-cs} and \meta{label-cs} may be used in \meta{body} +% to access the glossary label and entry label for the current +% iteration. % \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@doextra@esc}[1]{% +\newcommand{\glsforeachwithattribute}[6][\@glo@types]{% + \forallglossaries[#1]{#4}% + {% + \forglsentries[#4]{#5}% + {% + \glsifattribute{#5}{#2}{#3}{#6}{}% + }% + }% +} % \end{macrocode} -% Escape the escape character unless it has already been escaped. +%\end{macro} +% +% If \cs{newterm} has been defined, redefine it so that it +% automatically sets the category label to \category{index} and add +% \cs{glsxtrpostdescription}. % \begin{macrocode} - \ifx\@glsxtr@autoindex@esc\@gls@quotechar - \else - \def\@gls@checkedmkidx{}% - \edef\@@glsxtr@checkspch{% - \noexpand\@glsxtr@autoindex@escquote\expandonce{#1}% - \noexpand\@empty\@glsxtr@autoindex@esc\noexpand\@nnil - \@glsxtr@autoindex@esc\noexpand\@empty\noexpand\@glsxtr@endescspch}% - \@@glsxtr@checkspch - \let#1\@gls@checkedmkidx\relax - \fi +\ifdef\newterm +{% % \end{macrocode} -% Escape actual character unless it has already been escaped. +%\begin{macro}{\newterm} +%\changes{0.4}{2015-12-03}{fixed name argument} % \begin{macrocode} - \ifx\@glsxtr@autoindex@at\@gls@actualchar - \else - \def\@gls@checkedmkidx{}% - \edef\@@glsxtr@checkspch{% - \noexpand\@glsxtr@autoindex@escat\expandonce{#1}% - \noexpand\@empty\@glsxtr@autoindex@at\noexpand\@nnil - \@glsxtr@autoindex@at\noexpand\@empty\noexpand\@glsxtr@endescspch}% - \@@glsxtr@checkspch - \let#1\@gls@checkedmkidx\relax - \fi + \renewcommand*{\newterm}[2][]{% + \newglossaryentry{#2}% + {type={index},category=index,name={#2},% + description={\glsxtrpostdescription\nopostdesc},#1}% + } % \end{macrocode} -% Escape level character unless it has already been escaped. +%\end{macro} +% Indexed terms are regular by default. % \begin{macrocode} - \ifx\@glsxtr@autoindex@level\@gls@levelchar - \else - \def\@gls@checkedmkidx{}% - \edef\@@glsxtr@checkspch{% - \noexpand\@glsxtr@autoindex@esclevel\expandonce{#1}% - \noexpand\@empty\@glsxtr@autoindex@level\noexpand\@nnil - \@glsxtr@autoindex@level\noexpand\@empty\noexpand\@glsxtr@endescspch}% - \@@glsxtr@checkspch - \let#1\@gls@checkedmkidx\relax - \fi + \glssetcategoryattribute{index}{regular}{true} % \end{macrocode} -% Escape encap character unless it has already been escaped. +%\begin{macro}{\glsxtrpostdescindex} % \begin{macrocode} - \ifx\@glsxtr@autoindex@encap\@gls@encapchar - \else - \def\@gls@checkedmkidx{}% - \edef\@@glsxtr@checkspch{% - \noexpand\@glsxtr@autoindex@escencap\expandonce{#1}% - \noexpand\@empty\@glsxtr@autoindex@encap\noexpand\@nnil - \@glsxtr@autoindex@encap\noexpand\@empty\noexpand\@glsxtr@endescspch}% - \@@glsxtr@checkspch - \let#1\@gls@checkedmkidx\relax - \fi -} + \newcommand*{\glsxtrpostdescindex}{} % \end{macrocode} %\end{macro} -% -% The user commands here have a preamble-only restriction to ensure -% they are set before required and also to reduce the chances of -% complications caused by \sty{babel}'s shorthands. -% -%\begin{macro}{\@glsxtr@autoindex@at} -%\changes{0.5.3}{2015-12-09}{new} -% Actual character for use with \cs{index}. % \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@at}{} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\GlsXtrSetActualChar} -% Set the actual character. -% \begin{macrocode} -\newcommand*{\GlsXtrSetActualChar}[1]{% - \gdef\@glsxtr@autoindex@at{#1}% - \def\@glsxtr@autoindex@escat##1#1##2#1##3\@glsxtr@endescspch{% - \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escat}{##1}{##2}{##3}% - }% } -\@onlypreamble\GlsXtrSetActualChar -\makeatother -\GlsXtrSetActualChar{@} -\makeatletter -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtr@autoindex@encap} -%\changes{0.5.3}{2015-12-09}{new} -% Encap character for use with \cs{index}. -% \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@encap}{} +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\GlsXtrSetEncapChar} -% Set the encap character. +%If the \pkgopt{symbols} package option was used, define a similar +%command for symbols, but set the default sort to the label rather +%than the name as the symbols will typically contain commands that +%will confuse makeindex and xindy. % \begin{macrocode} -\newcommand*{\GlsXtrSetEncapChar}[1]{% - \gdef\@glsxtr@autoindex@encap{#1}% - \def\@glsxtr@autoindex@escencap##1#1##2#1##3\@glsxtr@endescspch{% - \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escencap}{##1}{##2}{##3}% - }% -} -\GlsXtrSetEncapChar{|} -\@onlypreamble\GlsXtrSetEncapChar +\ifdef\printsymbols +{% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtr@autoindex@level} -%\changes{0.5.3}{2015-12-09}{new} -% Level character for use with \cs{index}. +%\begin{macro}{\glsxtrnewsymbol} +%\changes{0.4}{2015-12-03}{added extra argument} +% Unlike \cs{newterm}, this has a separate argument for the label +% (since the symbol will likely contain commands). % \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@level}{} + \newcommand*{\glsxtrnewsymbol}[3][]{% + \newglossaryentry{#2}{name={#3},sort={#2},type=symbols,category=symbol,#1}% + } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GlsXtrSetLevelChar} -% Set the encap character. +% Symbols are regular by default. % \begin{macrocode} -\newcommand*{\GlsXtrSetLevelChar}[1]{% - \gdef\@glsxtr@autoindex@level{#1}% - \def\@glsxtr@autoindex@esclevel##1#1##2#1##3\@glsxtr@endescspch{% - \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@esclevel}{##1}{##2}{##3}% - }% -} -\GlsXtrSetLevelChar{!} -\@onlypreamble\GlsXtrSetLevelChar + \glssetcategoryattribute{symbol}{regular}{true} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtr@autoindex@esc} -%\changes{0.5.3}{2015-12-09}{new} -% Escape character for use with \cs{index}. +%\begin{macro}{\glsxtrpostdescsymbol} % \begin{macrocode} -\newcommand*{\@glsxtr@autoindex@esc}{"} + \newcommand*{\glsxtrpostdescsymbol}{} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\GlsXtrSetEscChar} -% Set the escape character. % \begin{macrocode} -\newcommand*{\GlsXtrSetEscChar}[1]{% - \gdef\@glsxtr@autoindex@esc{#1}% - \def\@glsxtr@autoindex@escquote##1#1##2#1##3\@glsxtr@endescspch{% - \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escquote}{##1}{##2}{##3}% - }% } -\GlsXtrSetEscChar{"} -\@onlypreamble\GlsXtrSetEscChar +{} % \end{macrocode} -%\end{macro} % -% Set if defined. (For example, if \sty{doc} package has been -% loaded.) Actual character \ics{actualchar}: -% \begin{macrocode} -\ifdef\actualchar - {\expandafter\GlsXtrSetActualChar\expandafter{\actualchar}} - {} -% \end{macrocode} -% Quote character \ics{quotechar}: -% \begin{macrocode} -\ifdef\quotechar - {\expandafter\GlsXtrSetEscChar\expandafter{\quotechar}} - {} -% \end{macrocode} -% Level character \ics{levelchar}: +% Similar for the numbers option. % \begin{macrocode} -\ifdef\levelchar - {\expandafter\GlsXtrSetLevelChar\expandafter{\levelchar}} - {} +\ifdef\printnumbers +{% % \end{macrocode} -% Encap character \ics{encapchar}: +%\begin{macro}{\glsxtrnewnumber} +%\changes{0.4}{2015-12-03}{added extra argument} % \begin{macrocode} -\ifdef\encapchar - {\expandafter\GlsXtrSetEncapChar\expandafter{\encapchar}} - {} +\ifdef\printnumbers + \newcommand*{\glsxtrnewnumber}[3][]{% + \newglossaryentry{#2}{name={#3},sort={#2},type=numbers,category=number,#1}% + } % \end{macrocode} -% -%\begin{macro}{\@glsxtr@gobbleto@endescspch} +%\end{macro} +% Numbers are regular by default. % \begin{macrocode} -\def\@glsxtr@gobbleto@endescspch#1\@glsxtr@endescspch{} + \glssetcategoryattribute{number}{regular}{true} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@@glsxtr@autoindex@esc@spch} -%\begin{definition} -%\cs{@@glsxtr@autoindex@escspch}\marg{char}\marg{cs}\marg{pre}\marg{mid}\marg{post} -%\end{definition} +%\begin{macro}{\glsxtrpostdescnumber} % \begin{macrocode} -\newcommand*{\@@glsxtr@autoindex@escspch}[5]{% - \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% - \toks@={#3}% - \ifx\@nnil#3\relax - \def\@@glsxtr@checkspch{\@glsxtr@gobbleto@endescspch#5\@glsxtr@endescspch}% - \else - \ifx\@nnil#4\relax - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@glsxtr@checkspch{\@glsxtr@gobbleto@endescspch - #4#5\@glsxtr@endescspch}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@glsxtr@autoindex@esc#1}% - \def\@@glsxtr@checkspch{#2#5#1\@nnil#1\@glsxtr@endescspch}% - \fi - \fi - \@@glsxtr@checkspch -} + \newcommand*{\glsxtrpostdescnumber}{} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\Glossentrydesc} -% Redefine to set the abbreviation format and accessibility support. -%\changes{0.5.2}{2015-12-08}{added} % \begin{macrocode} -\renewcommand*{\Glossentrydesc}[1]{% - \glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% - \Glsaccessdesc{#1}% - }% } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glossentrysymbol} -% Redefine to set the abbreviation format and accessibility support. -%\changes{0.5.2}{2015-12-08}{added} +%\begin{macro}{\glsxtrsetcategory} +% Set the category for all listed labels. The first argument is the +% list of entry labels and the second argument is the category label. % \begin{macrocode} -\renewcommand*{\glossentrysymbol}[1]{% - \glsdoifexistsorwarn{#1}% +\newcommand*{\glsxtrsetcategory}[2]{% + \@for\@glsxtr@label:=#1\do {% - \glssetabbrvfmt{\glscategory{#1}}% - \glsaccesssymbol{#1}% + \glsfieldxdef{\@glsxtr@label}{category}{#2}% }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glossentrysymbol} -% Redefine to set the abbreviation format and accessibility support. -%\changes{0.5.2}{2015-12-08}{added} +%\begin{macro}{\glsxtrsetcategoryforall} +% Set the category for all entries in the listed glossaries. The first argument +% is the list of glossary labels and the second argument is the category label. % \begin{macrocode} -\renewcommand*{\Glossentrysymbol}[1]{% - \glsdoifexistsorwarn{#1}% - {% - \glssetabbrvfmt{\glscategory{#1}}% - \Glsaccesssymbol{#1}% +\newcommand*{\glsxtrsetcategoryforall}[2]{% + \forallglossaries[#1]{\@glsxtr@type}{% + \forglsentries[\@glsxtr@type]{\@glsxtr@label}% + {% + \glsfieldxdef{\@glsxtr@label}{category}{#2}% + }% }% } % \end{macrocode} %\end{macro} % -%Allow initials to be marked but only use the formatting for the -%tag in the glossary. -%\begin{macro}{\GlsXtrEnableInitialTagging} -% Allow initial tagging. The first argument is a list of categories -% to apply this to. The second argument is the name of the command to -% use to tag the initials. This can't already be defined for safety -% unless the starred version is used. +%\begin{macro}{\glsxtrfieldtitlecase} +%\begin{definition} +%\cs{glsxtrfieldtitlecase}\marg{label}\marg{field} +%\end{definition} +% Apply title casing to the contents of the given field. %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\GlsXtrEnableInitialTagging}{% - \@ifstar\s@glsxtr@enabletagging\@glsxtr@enabletagging +\newcommand*{\glsxtrfieldtitlecase}[2]{% + \expandafter\glsxtrfieldtitlecasecs\expandafter + {\csname glo@\glsdetoklabel{#1}@#2\endcsname}% } -\@onlypreamble\GlsXtrEnableInitialTagging % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@enabletagging} -% Starred version undefines command. +%\begin{macro}{\glsxtrfieldtitlecasecs} +%The command used by \cs{glsxtrfieldtitlecase}. May be +%redefined to use a different command, for example, +%\cs{xcapitalisefmtwords}. +%\changes{1.07}{2016-08-15}{new} % \begin{macrocode} -\newcommand*{\s@glsxtr@enabletagging}[2]{% - \undef#2% - \@glsxtr@enabletagging{#1}{#2}% -} +\newcommand*{\glsxtrfieldtitlecasecs}[1]{\xcapitalisewords{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\@glsxtr@enabletagging} -% Internal command. +% +% Provide a convenient way to modify glossary styles without having +% to define a new style just to convert the first letter of fields +% to upper case. +%\begin{macro}{\glossentrydesc} +% If the \catattr{glossdesc} attribute is \qt{firstuc} convert first +% letter to upper case. If the attribute is \qt{title} use title +% case. % \begin{macrocode} -\newcommand*{\@glsxtr@enabletagging}[2]{% +\@ifpackageloaded{glossaries-accsupp} +{ + \renewcommand*{\glossentrydesc}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% % \end{macrocode} -% Set attributes for categories given in the first argument. +% As from version 1.04, allow the \catattr{glossdescfont} attribute +% to determine the font applied. +%\changes{1.04}{2016-05-02}{added glossdescfont attribute check} % \begin{macrocode} - \@for\@glsxtr@cat:=#1\do - {% - \ifdefempty\@glsxtr@cat - {}% - {\glssetcategoryattribute{\@glsxtr@cat}{tagging}{true}}% - }% - \newrobustcmd*#2[1]{##1}% - \def\@glsxtr@taggingcs{#2}% - \renewcommand*\@glsxtr@activate@initialtagging{% - \let#2\@glsxtr@tag - }% - \ifundef\@gls@preglossaryhook - {\GlossariesExtraWarning{Initial tagging requires at least - glossaries.sty v4.19 to work correctly}}% - {}% + \glshasattribute{#1}{glossdescfont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossdescfont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossdescfont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossdescfont attribute + for entry `#1'. Ignoring}% + \let\@glsxtr@glossdescfont\@firstofone + }% + }% + {\let\@glsxtr@glossdescfont\@firstofone}% + \glsifattribute{#1}{glossdesc}{firstuc}% + {% + \@glsxtr@glossdescfont{\Glsaccessdesc{#1}}% + }% + {% + \glsifattribute{#1}{glossdesc}{title}% + {% + \@glsxtr@do@titlecaps@warn + \glsdescriptionaccessdisplay + {% + \@glsxtr@glossdescfont{\glsxtrfieldtitlecase{#1}{desc}}% + }% + {#1}% + }% + {% + \@glsxtr@glossdescfont{\glsaccessdesc{#1}}% + }% + }% + }% + } +} +{ + \renewcommand*{\glossentrydesc}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \glshasattribute{#1}{glossdescfont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossdescfont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossdescfont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossdescfont attribute + for entry `#1'. Ignoring}% + \let\@glsxtr@glossdescfont\@firstofone + }% + }% + {\let\@glsxtr@glossdescfont\@firstofone}% + \glsifattribute{#1}{glossdesc}{firstuc}% + {% + \@glsxtr@glossdescfont{\Glsentrydesc{#1}}% + }% + {% + \glsifattribute{#1}{glossdesc}{title}% + {% + \@glsxtr@do@titlecaps@warn + \@glsxtr@glossdescfont{\glsxtrfieldtitlecase{#1}{desc}}% + }% + {% + \@glsxtr@glossdescfont{\glsentrydesc{#1}}% + }% + }% + }% + } } % \end{macrocode} %\end{macro} % -%Are we using an old version of \sty{mfirstuc} that has a bug in -%\cs{capitalisewords}? If so, patch it so we don't have a problem -% with a combination of tagging and title case. -%\begin{macro}{\mfu@checkword@do} -%If this command hasn't been defined, then we have pre v2.02 of -%\sty{mfirstuc} -%\changes{0.5.2}{2015-12-08}{added} +%\begin{macro}{\glossentryname} +% If the \catattr{glossname} attribute is \qt{firstuc} convert first +% letter to upper case. If the attribute is \qt{title} use title +% case. % \begin{macrocode} -\ifundef\mfu@checkword@do +\@ifpackageloaded{glossaries-accsupp} { - \newcommand*{\mfu@checkword@do}[1]{% - \ifdefstring{\mfu@checkword@arg}{#1}% - {% - \let\@mfu@domakefirstuc\@firstofone - \listbreak - }% - {}% + \renewcommand*{\glossentryname}[1]{% + \@glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% +% \end{macrocode} +% As from version 1.04, allow the \catattr{glossnamefont} attribute +% to determine the font applied. +%\changes{1.04}{2016-05-02}{added glossnamefont attribute check} +% \begin{macrocode} + \glshasattribute{#1}{glossnamefont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossnamefont attribute + for entry `#1'. Reverting to default \string\glsnamefont}% + \let\@glsxtr@glossnamefont\glsnamefont + }% + }% + {\let\@glsxtr@glossnamefont\glsnamefont}% + \glsifattribute{#1}{glossname}{firstuc}% + {% + \glsnameaccessdisplay + {% + \@glsxtr@glossnamefont{\Glsentryname{#1}}% + }% + {#1}% + }% + {% + \glsifattribute{#1}{glossname}{title}% + {% + \@glsxtr@do@titlecaps@warn + \glsnameaccessdisplay + {% + \@glsxtr@glossnamefont{\glsxtrfieldtitlecase{#1}{name}}% + }% + {#1}% + }% + {% + \glsifattribute{#1}{glossname}{uc}% + {% + \glsnameaccessdisplay + {% +% \end{macrocode} +% Hide the label from the upper-casing command. +% \begin{macrocode} + \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% + \@glsxtr@glossnamefont{\mfirstucMakeUppercase{\glo@name}}% + }% + {#1}% + }% + {% + \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% + \glsnameaccessdisplay + {% + \expandafter\@glsxtr@glossnamefont\expandafter{\glo@name}% + }% + {#1}% + }% + }% + }% +% \end{macrocode} +% Do post-name hook: +% \begin{macrocode} + \glsxtrpostnamehook{#1}% + }% + } +} +{ + \renewcommand*{\glossentryname}[1]{% + \@glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \glshasattribute{#1}{glossnamefont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossnamefont attribute + for entry `#1'. Reverting to default \string\glsnamefont}% + \let\@glsxtr@glossnamefont\glsnamefont + }% + }% + {\let\@glsxtr@glossnamefont\glsnamefont}% + \glsifattribute{#1}{glossname}{firstuc}% + {% + \@glsxtr@glossnamefont{\Glsentryname{#1}}% + }% + {% + \glsifattribute{#1}{glossname}{title}% + {% + \@glsxtr@do@titlecaps@warn + \@glsxtr@glossnamefont{\glsxtrfieldtitlecase{#1}{name}}% + }% + {% + \glsifattribute{#1}{glossname}{uc}% + {% +% \end{macrocode} +% Hide the label from the upper-casing command. +% \begin{macrocode} + \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% + \@glsxtr@glossnamefont{\mfirstucMakeUppercase{\glo@name}}% + }% + {% +% \end{macrocode} +% This little trick is used by \styfmt{glossaries} to allow the user to +% redefine \ics{glsnamefont} to use \cs{makefirstuc}. Support it +% even though they can now use the \catattr{firstuc} attribute. +% \begin{macrocode} + \letcs{\glo@name}{glo@\glsdetoklabel{#1}@name}% + \expandafter\@glsxtr@glossnamefont\expandafter{\glo@name}% + }% + }% + }% +% \end{macrocode} +% Do post-name hook. +%\changes{1.04}{2016-05-02}{moved post name hook inside condition} +% \begin{macrocode} + \glsxtrpostnamehook{#1}% + }% } +} % \end{macrocode} %\end{macro} -%\begin{macro}{\mfu@checkword} -% \cs{capitalisewords} was introduced in \sty{mfirstuc} v1.06. -% If \cs{mfu@checkword} hasn't been defined \sty{mfirstuc} is too -% old to support the title case attribute. +% +%\begin{macro}{\Glossentryname} +% Redefine to set the abbreviation format and accessibility support. +%\changes{0.5.2}{2015-12-08}{added} +% \begin{macrocode} +\@ifpackageloaded{glossaries-accsupp} +{ + \renewcommand*{\Glossentryname}[1]{% + \@glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% +% \end{macrocode} +% As from version 1.04, allow the \catattr{glossnamefont} attribute +% to determine the font applied. +%\changes{1.04}{2016-05-02}{added glossnamefont attribute check} +% \begin{macrocode} + \glshasattribute{#1}{glossnamefont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossnamefont attribute + for entry `#1'. Reverting to default \string\glsnamefont}% + \let\@glsxtr@glossnamefont\glsnamefont + }% + }% + {\let\@glsxtr@glossnamefont\glsnamefont}% + \glsnameaccessdisplay + {% + \@glsxtr@glossnamefont{\Glsentryname{#1}}% + }% + {#1}% +% \end{macrocode} +% Do post-name hook: +% \begin{macrocode} + \glsxtrpostnamehook{#1}% + }% + } +} +{ + \renewcommand*{\Glossentryname}[1]{% + \@glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \glshasattribute{#1}{glossnamefont}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{#1}{glossnamefont}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@glossnamefont}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in glossnamefont attribute + for entry `#1'. Reverting to default \string\glsnamefont}% + \let\@glsxtr@glossnamefont\glsnamefont + }% + }% + {\let\@glsxtr@glossnamefont\glsnamefont}% + \@glsxtr@glossnamefont{\Glsentryname{#1}}% +% \end{macrocode} +% Do post-name hook: +% \begin{macrocode} + \glsxtrpostnamehook{#1}% + }% + } +} +% \end{macrocode} +%\end{macro} +% +% Provide a convenient way to also index the entries using the +% standard \ics{index} mechanism. This may use different actual, +% encap and escape characters to those used for the glossaries. +% +%\begin{macro}{\glsxtrpostnamehook} +%\changes{0.5.3}{2015-12-09}{new} +% Hook to append stuff after the name is displayed in the glossary. +% The argument is the entry's label. +% \begin{macrocode} +\newcommand*{\glsxtrpostnamehook}[1]{% + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \glsxtrdoautoindexname{#1}{indexname}% +% \end{macrocode} +% Allow categories to hook in here. +%\changes{1.04}{2016-05-02}{added category check} +% \begin{macrocode} + \csuse{glsxtrpostname\glscategory{#1}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\if@glsxtr@format@override} +%\changes{0.5.3}{2015-12-09}{new} +% Determines if the \gloskey[glslink]{format} key should override +% the indexing attribute value. +% \begin{macrocode} +\newif\if@glsxtr@format@override +\@glsxtr@format@overridefalse +% \end{macrocode} +%\end{macro} +% +%If overriding is enabled, the \ics{glshypernumber} command will have to +%be redefined in the index to use \cs{hyperpage} instead. +%\begin{macro}{\GlsXtrEnableIndexFormatOverride} +% \begin{macrocode} +\@ifpackageloaded{hyperref} +{ +% \end{macrocode} +% If \sty{hyperref}'s \pkgoptfmt{hyperindex} option is on, then +% \sty{hyperref} will automatically add \cs{hyperpage}, so don't +% add it. +% \begin{macrocode} + \ifHy@hyperindex + \newcommand*{\GlsXtrEnableIndexFormatOverride}{% + \@glsxtr@format@overridetrue + \appto\theindex{\let\glshypernumber\@firstofone}% + } + \else + \newcommand*{\GlsXtrEnableIndexFormatOverride}{% + \@glsxtr@format@overridetrue + \appto\theindex{\let\glshypernumber\hyperpage}% + } + \fi +} +{ + \newcommand*{\GlsXtrEnableIndexFormatOverride}{% + \@glsxtr@format@overridetrue + } +} +\@onlypreamble\GlsXtrEnableIndexFormatOverride +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrdoautoindexname} +%\changes{0.5.3}{2015-12-09}{new} +% \begin{macrocode} +\newcommand*{\glsxtrdoautoindexname}[2]{% + \glshasattribute{#1}{#2}% + {% +% \end{macrocode} +% Escape any makeindex/xindy characters in the value of the \gloskey{name} +% field. Take care with \sty{babel} as this won't work if the +% category code has changed for those characters. +% \begin{macrocode} + \@glsxtr@autoindex@setname{#1}% +% \end{macrocode} +% If the attribute value is simply \qt{true} don't add an encap, +% otherwise use the value as the encap. +% \begin{macrocode} + \protected@edef\@glsxtr@attrval{\glsgetattribute{#1}{#2}}% + \if@glsxtr@format@override +% \end{macrocode} +%\changes{1.19}{2017-09-09}{changed format test} +% \begin{macrocode} + \ifx\@glsnumberformat\@glsxtr@defaultnumberformat + \else + \let\@glsxtr@attrval\@glsnumberformat + \fi + \fi + \ifdefstring{\@glsxtr@attrval}{true}% + {}% + {\eappto\@glo@name{\@glsxtr@autoindex@encap\@glsxtr@attrval}}% + \expandafter\glsxtrautoindex\expandafter{\@glo@name}% + }% + {}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrautoindex} +%\changes{1.16}{2017-06-15}{new} +% \begin{macrocode} +\newcommand*{\glsxtrautoindex}{\index} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@autoindex@setname} +%\changes{0.5.3}{2015-12-09}{new} +% Assign \cs{@glo@name} for use with \catattr{indexname} attribute. +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@setname}[1]{% + \protected@edef\@glo@name{\glsxtrautoindexentry{#1}}% + \glsxtrautoindexassignsort{\@glo@sort}{#1}% + \@gls@checkmkidxchars\@glo@sort + \@glsxtr@autoindex@doextra@esc\@glo@sort + \epreto\@glo@name{\@glo@sort\@glsxtr@autoindex@at}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrautoindexentry} +%\changes{1.16}{2017-06-15}{new} +%Command used for the actual part when auto-indexing. +% \begin{macrocode} +\newcommand*{\glsxtrautoindexentry}[1]{\string\glsentryname{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrautoindexsort} +%\changes{1.16}{2017-06-15}{new} +%Used to assign the sort value when auto-indexing. +% \begin{macrocode} +\newcommand*{\glsxtrautoindexassignsort}[2]{% + \glsletentryfield{#1}{#2}{sort}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@autoindex@doextra@esc} +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@doextra@esc}[1]{% +% \end{macrocode} +% Escape the escape character unless it has already been escaped. +% \begin{macrocode} + \ifx\@glsxtr@autoindex@esc\@gls@quotechar + \else + \def\@gls@checkedmkidx{}% + \edef\@@glsxtr@checkspch{% + \noexpand\@glsxtr@autoindex@escquote\expandonce{#1}% + \noexpand\@empty\@glsxtr@autoindex@esc\noexpand\@nnil + \@glsxtr@autoindex@esc\noexpand\@empty\noexpand\@glsxtr@endescspch}% + \@@glsxtr@checkspch + \let#1\@gls@checkedmkidx\relax + \fi +% \end{macrocode} +% Escape actual character unless it has already been escaped. +% \begin{macrocode} + \ifx\@glsxtr@autoindex@at\@gls@actualchar + \else + \def\@gls@checkedmkidx{}% + \edef\@@glsxtr@checkspch{% + \noexpand\@glsxtr@autoindex@escat\expandonce{#1}% + \noexpand\@empty\@glsxtr@autoindex@at\noexpand\@nnil + \@glsxtr@autoindex@at\noexpand\@empty\noexpand\@glsxtr@endescspch}% + \@@glsxtr@checkspch + \let#1\@gls@checkedmkidx\relax + \fi +% \end{macrocode} +% Escape level character unless it has already been escaped. +% \begin{macrocode} + \ifx\@glsxtr@autoindex@level\@gls@levelchar + \else + \def\@gls@checkedmkidx{}% + \edef\@@glsxtr@checkspch{% + \noexpand\@glsxtr@autoindex@esclevel\expandonce{#1}% + \noexpand\@empty\@glsxtr@autoindex@level\noexpand\@nnil + \@glsxtr@autoindex@level\noexpand\@empty\noexpand\@glsxtr@endescspch}% + \@@glsxtr@checkspch + \let#1\@gls@checkedmkidx\relax + \fi +% \end{macrocode} +% Escape encap character unless it has already been escaped. +% \begin{macrocode} + \ifx\@glsxtr@autoindex@encap\@gls@encapchar + \else + \def\@gls@checkedmkidx{}% + \edef\@@glsxtr@checkspch{% + \noexpand\@glsxtr@autoindex@escencap\expandonce{#1}% + \noexpand\@empty\@glsxtr@autoindex@encap\noexpand\@nnil + \@glsxtr@autoindex@encap\noexpand\@empty\noexpand\@glsxtr@endescspch}% + \@@glsxtr@checkspch + \let#1\@gls@checkedmkidx\relax + \fi +} +% \end{macrocode} +%\end{macro} +% +% The user commands here have a preamble-only restriction to ensure +% they are set before required and also to reduce the chances of +% complications caused by \sty{babel}'s shorthands. +% +%\begin{macro}{\@glsxtr@autoindex@at} +%\changes{0.5.3}{2015-12-09}{new} +% Actual character for use with \cs{index}. +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@at}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrSetActualChar} +% Set the actual character. +% \begin{macrocode} +\newcommand*{\GlsXtrSetActualChar}[1]{% + \gdef\@glsxtr@autoindex@at{#1}% + \def\@glsxtr@autoindex@escat##1#1##2#1##3\@glsxtr@endescspch{% + \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escat}{##1}{##2}{##3}% + }% +} +\@onlypreamble\GlsXtrSetActualChar +\makeatother +\GlsXtrSetActualChar{@} +\makeatletter +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@autoindex@encap} +%\changes{0.5.3}{2015-12-09}{new} +% Encap character for use with \cs{index}. +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@encap}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrSetEncapChar} +% Set the encap character. +% \begin{macrocode} +\newcommand*{\GlsXtrSetEncapChar}[1]{% + \gdef\@glsxtr@autoindex@encap{#1}% + \def\@glsxtr@autoindex@escencap##1#1##2#1##3\@glsxtr@endescspch{% + \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escencap}{##1}{##2}{##3}% + }% +} +\GlsXtrSetEncapChar{|} +\@onlypreamble\GlsXtrSetEncapChar +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@autoindex@level} +%\changes{0.5.3}{2015-12-09}{new} +% Level character for use with \cs{index}. +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@level}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrSetLevelChar} +% Set the encap character. +% \begin{macrocode} +\newcommand*{\GlsXtrSetLevelChar}[1]{% + \gdef\@glsxtr@autoindex@level{#1}% + \def\@glsxtr@autoindex@esclevel##1#1##2#1##3\@glsxtr@endescspch{% + \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@esclevel}{##1}{##2}{##3}% + }% +} +\GlsXtrSetLevelChar{!} +\@onlypreamble\GlsXtrSetLevelChar +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@autoindex@esc} +%\changes{0.5.3}{2015-12-09}{new} +% Escape character for use with \cs{index}. +% \begin{macrocode} +\newcommand*{\@glsxtr@autoindex@esc}{"} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrSetEscChar} +% Set the escape character. +% \begin{macrocode} +\newcommand*{\GlsXtrSetEscChar}[1]{% + \gdef\@glsxtr@autoindex@esc{#1}% + \def\@glsxtr@autoindex@escquote##1#1##2#1##3\@glsxtr@endescspch{% + \@@glsxtr@autoindex@escspch{#1}{\@glsxtr@autoindex@escquote}{##1}{##2}{##3}% + }% +} +\GlsXtrSetEscChar{"} +\@onlypreamble\GlsXtrSetEscChar +% \end{macrocode} +%\end{macro} +% +% Set if defined. (For example, if \sty{doc} package has been +% loaded.) Actual character \ics{actualchar}: +% \begin{macrocode} +\ifdef\actualchar + {\expandafter\GlsXtrSetActualChar\expandafter{\actualchar}} + {} +% \end{macrocode} +% Quote character \ics{quotechar}: +% \begin{macrocode} +\ifdef\quotechar + {\expandafter\GlsXtrSetEscChar\expandafter{\quotechar}} + {} +% \end{macrocode} +% Level character \ics{levelchar}: +% \begin{macrocode} +\ifdef\levelchar + {\expandafter\GlsXtrSetLevelChar\expandafter{\levelchar}} + {} +% \end{macrocode} +% Encap character \ics{encapchar}: +% \begin{macrocode} +\ifdef\encapchar + {\expandafter\GlsXtrSetEncapChar\expandafter{\encapchar}} + {} +% \end{macrocode} +% +%\begin{macro}{\@glsxtr@gobbleto@endescspch} +% \begin{macrocode} +\def\@glsxtr@gobbleto@endescspch#1\@glsxtr@endescspch{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glsxtr@autoindex@esc@spch} +%\begin{definition} +%\cs{@@glsxtr@autoindex@escspch}\marg{char}\marg{cs}\marg{pre}\marg{mid}\marg{post} +%\end{definition} +% \begin{macrocode} +\newcommand*{\@@glsxtr@autoindex@escspch}[5]{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#3}% + \ifx\@nnil#3\relax + \def\@@glsxtr@checkspch{\@glsxtr@gobbleto@endescspch#5\@glsxtr@endescspch}% + \else + \ifx\@nnil#4\relax + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@glsxtr@checkspch{\@glsxtr@gobbleto@endescspch + #4#5\@glsxtr@endescspch}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@glsxtr@autoindex@esc#1}% + \def\@@glsxtr@checkspch{#2#5#1\@nnil#1\@glsxtr@endescspch}% + \fi + \fi + \@@glsxtr@checkspch +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Glossentrydesc} +% Redefine to set the abbreviation format and accessibility support. +%\changes{0.5.2}{2015-12-08}{added} +% \begin{macrocode} +\renewcommand*{\Glossentrydesc}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \Glsaccessdesc{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glossentrysymbol} +% Redefine to set the abbreviation format and accessibility support. +%\changes{0.5.2}{2015-12-08}{added} +% \begin{macrocode} +\renewcommand*{\glossentrysymbol}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \glsaccesssymbol{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Glossentrysymbol} +% Redefine to set the abbreviation format and accessibility support. +%\changes{0.5.2}{2015-12-08}{added} +% \begin{macrocode} +\renewcommand*{\Glossentrysymbol}[1]{% + \glsdoifexistsorwarn{#1}% + {% + \glssetabbrvfmt{\glscategory{#1}}% + \Glsaccesssymbol{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% +%Allow initials to be marked but only use the formatting for the +%tag in the glossary. +%\begin{macro}{\GlsXtrEnableInitialTagging} +% Allow initial tagging. The first argument is a list of categories +% to apply this to. The second argument is the name of the command to +% use to tag the initials. This can't already be defined for safety +% unless the starred version is used. +%\changes{0.5.2}{2015-12-08}{new} +% \begin{macrocode} +\newcommand*{\GlsXtrEnableInitialTagging}{% + \@ifstar\s@glsxtr@enabletagging\@glsxtr@enabletagging +} +\@onlypreamble\GlsXtrEnableInitialTagging +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@enabletagging} +% Starred version undefines command. +% \begin{macrocode} +\newcommand*{\s@glsxtr@enabletagging}[2]{% + \undef#2% + \@glsxtr@enabletagging{#1}{#2}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glsxtr@enabletagging} +% Internal command. +% \begin{macrocode} +\newcommand*{\@glsxtr@enabletagging}[2]{% +% \end{macrocode} +% Set attributes for categories given in the first argument. +% \begin{macrocode} + \@for\@glsxtr@cat:=#1\do + {% + \ifdefempty\@glsxtr@cat + {}% + {\glssetcategoryattribute{\@glsxtr@cat}{tagging}{true}}% + }% + \newrobustcmd*#2[1]{##1}% + \def\@glsxtr@taggingcs{#2}% + \renewcommand*\@glsxtr@activate@initialtagging{% + \let#2\@glsxtr@tag + }% + \ifundef\@gls@preglossaryhook + {\GlossariesExtraWarning{Initial tagging requires at least + glossaries.sty v4.19 to work correctly}}% + {}% +} +% \end{macrocode} +%\end{macro} +% +%Are we using an old version of \sty{mfirstuc} that has a bug in +%\cs{capitalisewords}? If so, patch it so we don't have a problem +% with a combination of tagging and title case. +%\begin{macro}{\mfu@checkword@do} +%If this command hasn't been defined, then we have pre v2.02 of +%\sty{mfirstuc} +%\changes{0.5.2}{2015-12-08}{added} +% \begin{macrocode} +\ifundef\mfu@checkword@do +{ + \newcommand*{\mfu@checkword@do}[1]{% + \ifdefstring{\mfu@checkword@arg}{#1}% + {% + \let\@mfu@domakefirstuc\@firstofone + \listbreak + }% + {}% + } +% \end{macrocode} +%\end{macro} +%\begin{macro}{\mfu@checkword} +% \cs{capitalisewords} was introduced in \sty{mfirstuc} v1.06. +% If \cs{mfu@checkword} hasn't been defined \sty{mfirstuc} is too +% old to support the title case attribute. +% \begin{macrocode} + \ifundef\mfu@checkword + { + \newcommand{\@glsxtr@do@titlecaps@warn}{% + \GlossariesExtraWarning{mfirstuc.sty too old. Title Caps + support not available}% +% \end{macrocode} +% One warning should suffice. +% \begin{macrocode} + \let\@glsxtr@do@titlecaps@warn\relax + } + } + { + \renewcommand*{\mfu@checkword}[1]{% + \def\mfu@checkword@arg{#1}% + \let\@mfu@domakefirstuc\makefirstuc + \forlistloop\mfu@checkword@do\@mfu@nocaplist + } + } +} +{}% no patch required +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@do@titlecaps@warn} +% Do warning if title case not supported. +%\changes{0.5.2}{2015-12-08}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@do@titlecaps@warn}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@activate@initialtagging} +% Used in \cs{printglossary} but at least v4.19 of \styfmt{glossaries} +% required. +%\changes{0.5.2}{2015-12-08}{new} +% \begin{macrocode} +\newcommand*\@glsxtr@activate@initialtagging{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@tag} +%\changes{0.5.2}{2015-12-08}{new} +% Definition of tagging command when used in glossary. +% \begin{macrocode} +\newrobustcmd*{\@glsxtr@tag}[1]{% + \glsifattribute{\glscurrententrylabel}{tagging}{true}% + {\glsxtrtagfont{#1}}{#1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrtagfont} +% Used in the glossary. +%\changes{0.5.2}{2015-12-08}{new} +% \begin{macrocode} +\newcommand*{\glsxtrtagfont}[1]{\underline{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@preglossaryhook} +% This macro was introduced in \styfmt{glossaries} version 4.19, so it +% may not be defined. If it hasn't been defined this feature is +% unavailable. A check is added for the entry's existence to prevent +% errors from occurring if the user removes an entry or changes the +% label, which can interrupt the build process. +%\changes{1.04}{2016-05-02}{added check for entry's existence} +% \begin{macrocode} +\ifdef\@gls@preglossaryhook +{ + \renewcommand*{\@gls@preglossaryhook}{% + \@glsxtr@activate@initialtagging +% \end{macrocode} +%\changes{1.12}{2017-02-03}{check for definition} +%Since the glossaries are automatically scoped, +%\cs{@glsxtr@org@postdescription} shouldn't already be defined, but +%check anyway just as a precautionary measure. +% \begin{macrocode} + \ifundef\@glsxtr@org@postdescription + {% + \let\@glsxtr@org@postdescription\glspostdescription + \renewcommand*{\glspostdescription}{% + \ifglsentryexists{\glscurrententrylabel}% + {% + \glsxtrpostdescription + \@glsxtr@org@postdescription + }% + {}% + }% + }% + {}% +% \end{macrocode} +%\changes{1.07}{2016-08-15}{added \cs{glossxtrsetpopts}} +%Enable the options used by \cs{@@glsxtrp}: +% \begin{macrocode} + \glossxtrsetpopts + }% +} +{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostdescription} +%This command will only be used if \cs{@gls@preglossaryhook} is +%available \emph{and} the glossary style uses +%\cs{glspostdescription} without modifying it. (\cs{nopostdesc} +%will suppress this.) The \sty{glossaries-extra-stylemods} package will +%add the post description hook to all the predefined styles that +%don't include it. +% \begin{macrocode} +\newcommand*{\glsxtrpostdescription}{% + \csuse{glsxtrpostdesc\glscategory{\glscurrententrylabel}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostdescgeneral} +% \begin{macrocode} +\newcommand*{\glsxtrpostdescgeneral}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostdescterm} +% \begin{macrocode} +\newcommand*{\glsxtrpostdescterm}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostdescacronym} +% \begin{macrocode} +\newcommand*{\glsxtrpostdescacronym}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostdescabbreviation} +% \begin{macrocode} +\newcommand*{\glsxtrpostdescabbreviation}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glspostlinkhook} +% Redefine the post link hook used by commands like \cs{gls} to +% make it easier for categories or attributes to modify this action. +% Since this hook occurs outside the existence check of commands like +% \cs{gls}, this needs to be checked again here. Do nothing if the +% entry hasn't been defined. +%\changes{0.5.4}{2015-12-15}{added existence check} +% \begin{macrocode} +\renewcommand*{\glspostlinkhook}{% + \ifglsentryexists{\glslabel}{\glsxtrpostlinkhook}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostlinkhook} +% The entry label should already be stored in \cs{glslabel} by +% \cs{@gls@link}. +% \begin{macrocode} +\newcommand*{\glsxtrpostlinkhook}{% + \glsxtrdiscardperiod{\glslabel}% + {\glsxtrpostlinkendsentence}% + {\glsxtrpostlink}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostlink} +% \begin{macrocode} +\newcommand*{\glsxtrpostlink}{% + \csuse{glsxtrpostlink\glscategory{\glslabel}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostlinkendsentence} +%\changes{0.3}{2015-12-02}{new} +% Done by \cs{glsxtrpostlinkhook} if a full stop is discarded. +% \begin{macrocode} +\newcommand*{\glsxtrpostlinkendsentence}{% + \ifcsdef{glsxtrpostlink\glscategory{\glslabel}} + {% + \csuse{glsxtrpostlink\glscategory{\glslabel}}% +% \end{macrocode} +% Put the full stop back. +% \begin{macrocode} + .\spacefactor\sfcode`\. \relax + }% + {% +% \end{macrocode} +% Assume the full stop was discarded because the entry ends with a +% period, so adjust the spacefactor. +% \begin{macrocode} + \spacefactor\sfcode`\. \relax + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostlinkAddDescOnFirstUse} +%\changes{0.3}{2015-12-02}{new} +% Provide a command for appending the description in parentheses on +% first use, for the convenience of users wanting to add this to the +% post link hook. +% \begin{macrocode} +\newcommand*{\glsxtrpostlinkAddDescOnFirstUse}{% + \glsxtrifwasfirstuse{\space(\glsaccessdesc{\glslabel})}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrpostlinkAddSymbolOnFirstUse} +%\changes{0.3}{2015-12-02}{new} +% Provide a command for appending the symbol (if defined) in parentheses on +% first use, for the convenience of users wanting to add this to the +% post link hook. +% \begin{macrocode} +\newcommand*{\glsxtrpostlinkAddSymbolOnFirstUse}{% + \glsxtrifwasfirstuse + {% + \ifglshassymbol{\glslabel}{\space(\glsaccesssymbol{\glslabel})}{}% + }% + {}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrdiscardperiod} +% Discard following period (if present) if the +% \catattr{discardperiod} attribute is true. If a period is +% discarded, do the second argument otherwise do the third +% argument. The entry label is in the first argument. +% Since this is designed for abbreviations that end with a period, +% check if the plural form was used (which typically won't end with +% a period). +%\changes{0.3}{2015-12-02}{added check for plural} +%\changes{1.01}{2016-02-02}{added check for first use} +% \begin{macrocode} +\newcommand*{\glsxtrdiscardperiod}[3]{% + \glsxtrifwasfirstuse + {% + \glsifattribute{#1}{retainfirstuseperiod}{true}% + {#3}% + {% + \glsifattribute{#1}{discardperiod}{true}% + {% + \glsifplural + {% + \glsifattribute{#1}{pluraldiscardperiod}{true}% + {\glsxtrifperiod{#2}{#3}}% + {#3}% + }% + {% + \glsxtrifperiod{#2}{#3}% + }% + }% + {#3}% + }% + }% + {% + \glsifattribute{#1}{discardperiod}{true}% + {% + \glsifplural + {% + \glsifattribute{#1}{pluraldiscardperiod}{true}% + {\glsxtrifperiod{#2}{#3}}% + {#3}% + }% + {% + \glsxtrifperiod{#2}{#3}% + }% + }% + {#3}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrifperiod} +% Make a convenient user command to check if the next character is a +% full stop (period). Works like \cs{@ifstar} but uses +% \cs{new@ifnextchar} rather than \cs{@ifnextchar} +% \begin{macrocode} +\newcommand*{\glsxtrifperiod}[1]{\new@ifnextchar.{\@firstoftwo{#1}}} +% \end{macrocode} +%\end{macro} +% +% Sometimes it's useful to test if there's a punctuation character +% following the glossary entry. +%\begin{macro}{\glsxtr@punclist} +% List of characters identified as punctuation marks. (Be careful of +% \sty{babel} shorthands!) This doesn't allow for punctuation marks +% made up from multiple characters (such as \verb|''|). +% \begin{macrocode} +\newcommand*{\glsxtr@punclist}{.,:;?!} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtraddpunctuationmark} +% Add character to punctuation list. +% \begin{macrocode} +\newcommand*{\glsxtraddpunctuationmark}[1]{\appto\glsxtr@punclist{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrsetpunctuationmarks} +% Reset the punctuation list. +% \begin{macrocode} +\newcommand*{\glsxtrsetpunctuationmarks}[1]{\def\glsxtr@punclist{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrifpunc} +%\begin{definition} +%\cs{glsxtrifnextpunc}\marg{true part}\marg{false part} +%\end{definition} +%Test if this is followed by a punctuation mark. (Adapted from +%\cs{new@ifnextchar}.) +% \begin{macrocode} +\newcommand*{\glsxtrifnextpunc}[2]{% + \def\reserved@a{#1}% + \def\reserved@b{#2}% + \futurelet\@glspunc@token\glsxtr@ifnextpunc +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@ifnextpunc} +% \begin{macrocode} +\newcommand*{\glsxtr@ifnextpunc}{% + \glsxtr@ifpunctoken{\@glspunc@token}{\let\reserved@b\reserved@a}{}% + \reserved@b +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@ifpunctoken} +% Test if the token given in the first argument is in the +% punctuation list. +% \begin{macrocode} +\newcommand*{\glsxtr@ifpunctoken}[1]{% + \expandafter\@glsxtr@ifpunctoken\expandafter#1\glsxtr@punclist\@nnil +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@ifpunctoken} +% \begin{macrocode} +\def\@glsxtr@ifpunctoken#1#2{% + \let\reserved@d=#2% + \ifx\reserved@d\@nnil + \let\glsxtr@next\@glsxtr@notfoundinlist + \else + \ifx#1\reserved@d + \let\glsxtr@next\@glsxtr@foundinlist + \else + \let\glsxtr@next\@glsxtr@ifpunctoken + \fi + \fi + \glsxtr@next#1% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@foundinlist} +% \begin{macrocode} +\def\@glsxtr@foundinlist#1\@nnil{\@firstoftwo} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@notfoundinlist} +% \begin{macrocode} +\def\@glsxtr@notfoundinlist#1{\@secondoftwo} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrdopostpunc} +%\begin{definition} +%\cs{glsxtrdopostpunc}\marg{code} +%\end{definition} +% If this is followed be a punctuation character, do \meta{code} +% after the character otherwise do \meta{code} before whatever comes +% next. +% \begin{macrocode} +\newcommand{\glsxtrdopostpunc}[1]{% + \glsxtrifnextpunc{\@glsxtr@swaptwo{#1}}{#1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@swaptwo} +% \begin{macrocode} +\newcommand{\@glsxtr@swaptwo}[2]{#2#1} +% \end{macrocode} +%\end{macro} +% +%\section{Abbreviations} +% +%The \qt{acronym} code from \styfmt{glossaries} is misnamed as it's more +%often used for other forms of abbreviations. This code corrects +%this inconsistency, but rather than just having synonyms, provide +% commands for abbreviations that have a similar, but not identical, +% underlying mechanism to acronyms. +% +% If there's a style for the given category, apply it. +% \begin{macrocode} +\define@key{glsxtrabbrv}{category}{% + \edef\glscategorylabel{#1}% + \ifcsdef{@glsabbrv@current@#1}% + {% +% \end{macrocode} +% Warning should already have been issued. +% \begin{macrocode} + \let\@glsxtr@orgwarndep\GlsXtrWarnDeprecatedAbbrStyle + \let\GlsXtrWarnDeprecatedAbbrStyle\@gobbletwo + \glsxtr@applyabbrvstyle{\csname @glsabbrv@current@#1\endcsname}% + \let\GlsXtrWarnDeprecatedAbbrStyle\@glsxtr@orgwarndep + }% + {}% +} +% \end{macrocode} +% Save the short plural form. This may be needed before the entry is +% defined. +% \begin{macrocode} +\define@key{glsxtrabbrv}{shortplural}{% + \def\@gls@shortpl{#1}% +} +% \end{macrocode} +% Similarly for the long plural form. +% \begin{macrocode} +\define@key{glsxtrabbrv}{longplural}{% + \def\@gls@longpl{#1}% +} +% \end{macrocode} +% +% Token registers for the short plural and long plural, provided for +% use in the abbreviation style definitions. +%\begin{macro}{\glsshortpltok} +%\changes{0.3}{2015-12-02}{new} +% \begin{macrocode} +\newtoks\glsshortpltok +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslongpltok} +%\changes{0.3}{2015-12-02}{new} +% \begin{macrocode} +\newtoks\glslongpltok +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@insertdots} +%\changes{0.3}{2015-12-02}{new} +% Provided in case user wants to automatically insert dots between +% each letter of the abbreviation. This should be applied before +% defining the abbreviation to optimise the document build. +% (Otherwise, it would have to be done each time the short form is +% required, which is an unnecessary waste of time.) For this to work +% the short form must be expanded when passed to +% \cs{newabbreviation}. Note that explicitly using the +% \gloskey{short} or \gloskey{shortplural} keys will override this. +% \begin{macrocode} +\newcommand*{\@glsxtr@insertdots}[2]{% + \def#1{}% + \@glsxtr@insert@dots#1#2\@nnil +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@insert@dots} +% \begin{macrocode} +\newcommand*{\@glsxtr@insert@dots}[2]{% + \ifx\@nnil#2\relax + \let\@glsxtr@insert@dots@next\@gobble + \else + \ifx\relax#2\relax + \else + \appto#1{#2.}% + \fi + \let\@glsxtr@insert@dots@next\@glsxtr@insert@dots + \fi + \@glsxtr@insert@dots@next#1% +} +% \end{macrocode} +%\end{macro} +% +%Similarly provide a way of replacing spaces with +%\cs{glsxtrwordsep}, which first needs to be defined: +%\begin{macro}{\glsxtrwordsep} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsxtrwordsep}{\space} +% \end{macrocode} +%\end{macro} +%Each word is marked with +%\begin{macro}{\glsxtrword} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsxtrword}[1]{#1} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glsxtr@markwordseps} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@markwordseps}[2]{% + \def#1{}% + \@glsxtr@mark@wordseps#1#2 \@nnil +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glsxtr@mark@wordseps} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\def\@glsxtr@mark@wordseps#1#2 #3{% + \ifdefempty{#1}% + {\def#1{\protect\glsxtrword{#2}}}% + {\appto#1{\protect\glsxtrwordsep\protect\glsxtrword{#2}}}% + \ifx\@nnil#3\relax + \let\@glsxtr@mark@wordseps@next\relax + \else + \def\@glsxtr@mark@wordseps@next{% + \@glsxtr@mark@wordseps#1#3}% + \fi + \@glsxtr@mark@wordseps@next +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\newabbreviation} +% Define a new generic abbreviation. +% \begin{macrocode} +\newcommand*{\newabbreviation}[4][]{% + \glsxtr@newabbreviation{#1}{#2}{#3}{#4}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@newabbreviation} +% Internal macro. (bib2gls has an option that needs to +% temporarily redefine \cs{newabbreviation}. This is just makes +% it easier to save and restore the original definition.) +%\changes{1.12}{2017-02-03}{new} +% \begin{macrocode} +\newcommand*{\glsxtr@newabbreviation}[4]{% + \glskeylisttok{#1}% + \glslabeltok{#2}% + \glsshorttok{#3}% + \glslongtok{#4}% +% \end{macrocode} +%Save the original short and long values (before attribute settings +%modify them). +%\changes{1.17}{2017-08-09}{added \cs{glsxtrorgshort} and \cs{glsxtrorglong}} +% \begin{macrocode} + \def\glsxtrorgshort{#3}% + \def\glsxtrorglong{#4}% +% \end{macrocode} +% Get the category. +%\changes{0.3}{2015-12-02}{fixed family name in \cs{setkeys}} +% \begin{macrocode} + \def\glscategorylabel{abbreviation}% + \glsxtr@applyabbrvstyle{\@glsabbrv@current@abbreviation}% +% \end{macrocode} +% Ignore the shortplural and longplural keys. +% \begin{macrocode} + \setkeys*{glsxtrabbrv}[shortplural,longplural]{#1}% +% \end{macrocode} +% Set the default long plural +% \begin{macrocode} + \def\@gls@longpl{#4\glspluralsuffix}% + \let\@gls@default@longpl\@gls@longpl +% \end{macrocode} +% Has the \catattr{markwords} attribute been set? +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{markwords}{true}% + {% + \@glsxtr@markwordseps\@gls@long{#4}% + \expandafter\def\expandafter\@gls@longpl\expandafter + {\@gls@long\glspluralsuffix}% + \let\@gls@default@longpl\@gls@longpl +% \end{macrocode} +% Update \cs{glslongtok}. +% \begin{macrocode} + \expandafter\glslongtok\expandafter{\@gls@long}% + }% + {}% +% \end{macrocode} +% Has the \catattr{markshortwords} attribute been set? (Not +% compatible with \catattr{insertdots}.) +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{markshortwords}{true}% + {% + \@glsxtr@markwordseps\@gls@short{#3}% + }% + {% +% \end{macrocode} +% Has the \catattr{insertdots} attribute been set? +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{insertdots}{true}% + {% + \@glsxtr@insertdots\@gls@short{#3}% + \expandafter\glsshorttok\expandafter{\@gls@short\spacefactor1000 \relax}% + }% + {\def\@gls@short{#3}}% + }% +% \end{macrocode} +% Has the \catattr{aposplural} attribute been set? (Not compatible +% with \catattr{noshortplural}.) +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{aposplural}{true}% + {% + \expandafter\def\expandafter\@gls@shortpl\expandafter{\@gls@short + '\abbrvpluralsuffix}% + }% + {% +% \end{macrocode} +% Has the \catattr{noshortplural} attribute been set? +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{noshortplural}{true}% + {% + \let\@gls@shortpl\@gls@short + }% + {% + \expandafter\def\expandafter\@gls@shortpl\expandafter{\@gls@short + \abbrvpluralsuffix}% + }% + }% +% \end{macrocode} +% Update \cs{glsshorttok}: +% \begin{macrocode} + \expandafter\glsshorttok\expandafter{\@gls@short}% +% \end{macrocode} +% Hook for further customisation if required: +% \begin{macrocode} + \glsxtrnewabbrevpresetkeyhook{#1}{#2}{#3}% +% \end{macrocode} +% Get the short and long plurals provided by user in optional +% argument to override defaults, if necessary. +% Ignore the category key (already obtained). +% \begin{macrocode} + \setkeys*{glsxtrabbrv}[category]{#1}% +% \end{macrocode} +% Has the plural been explicitly set? +% \begin{macrocode} + \ifx\@gls@default@longpl\@gls@longpl + \else +% \end{macrocode} +% Has the \catattr{markwords} attribute been set? +% \begin{macrocode} + \glsifcategoryattribute{\glscategorylabel}{markwords}{true}% + {% + \expandafter\@glsxtr@markwordseps\expandafter\@gls@longpl\expandafter + {\@gls@longpl}% + }% + {}% + \fi +% \end{macrocode} +% Set the plural token registers so the values can be accessed by +% the abbreviation styles. +% \begin{macrocode} + \expandafter\glsshortpltok\expandafter{\@gls@shortpl}% + \expandafter\glslongpltok\expandafter{\@gls@longpl}% +% \end{macrocode} +% Do any extra setup provided by hook: % \begin{macrocode} - \ifundef\mfu@checkword - { - \newcommand{\@glsxtr@do@titlecaps@warn}{% - \GlossariesExtraWarning{mfirstuc.sty too old. Title Caps - support not available}% + \newabbreviationhook % \end{macrocode} -% One warning should suffice. +% Define this entry: % \begin{macrocode} - \let\@glsxtr@do@titlecaps@warn\relax - } - } - { - \renewcommand*{\mfu@checkword}[1]{% - \def\mfu@checkword@arg{#1}% - \let\@mfu@domakefirstuc\makefirstuc - \forlistloop\mfu@checkword@do\@mfu@nocaplist - } - } + \protected@edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\glsxtrabbrvtype,% + category=abbreviation,% + short={\the\glsshorttok},% + shortplural={\the\glsshortpltok},% + long={\the\glslongtok},% + longplural={\the\glslongpltok},% + name={\the\glsshorttok},% + \CustomAbbreviationFields,% + \the\glskeylisttok + }% + }% + \@do@newglossaryentry + \GlsXtrPostNewAbbreviation } -{}% no patch required % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@do@titlecaps@warn} -% Do warning if title case not supported. +%\begin{macro}{\glsxtrnewabbrevpresetkeyhook} +% Hook for extra stuff in \cs{newabbreviation} %\changes{0.5.2}{2015-12-08}{new} % \begin{macrocode} -\newcommand*{\@glsxtr@do@titlecaps@warn}{} +\newcommand*{\glsxtrnewabbrevpresetkeyhook}[3]{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@activate@initialtagging} -% Used in \cs{printglossary} but at least v4.19 of \styfmt{glossaries} -% required. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\GlsXtrPostNewAbbreviation} +% Hook used by abbreviation styles. % \begin{macrocode} -\newcommand*\@glsxtr@activate@initialtagging{} +\newcommand*{\GlsXtrPostNewAbbreviation}{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@tag} -%\changes{0.5.2}{2015-12-08}{new} -% Definition of tagging command when used in glossary. +%\begin{macro}{\newabbreviationhook} +% Hook for use with \cs{newabbreviation}. % \begin{macrocode} -\newrobustcmd*{\@glsxtr@tag}[1]{% - \glsifattribute{\glscurrententrylabel}{tagging}{true}% - {\glsxtrtagfont{#1}}{#1}% -} +\newcommand*{\newabbreviationhook}{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrtagfont} -% Used in the glossary. -%\changes{0.5.2}{2015-12-08}{new} +%\begin{macro}{\CustomAbbreviationFields} % \begin{macrocode} -\newcommand*{\glsxtrtagfont}[1]{\underline{#1}} +\newcommand*{\CustomAbbreviationFields}{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@gls@preglossaryhook} -% This macro was introduced in \styfmt{glossaries} version 4.19, so it -% may not be defined. If it hasn't been defined this feature is -% unavailable. A check is added for the entry's existence to prevent -% errors from occurring if the user removes an entry or changes the -% label, which can interrupt the build process. -%\changes{1.04}{2016-05-02}{added check for entry's existence} +%\begin{macro}{\glsxtrparen} +%\changes{1.17}{2017-08-09}{new} +%For the parenthetical styles. % \begin{macrocode} -\ifdef\@gls@preglossaryhook -{ - \renewcommand*{\@gls@preglossaryhook}{% - \@glsxtr@activate@initialtagging +\newcommand*{\glsxtrparen}[1]{(#1)} % \end{macrocode} -%\changes{1.12}{2017-02-03}{check for definition} -%Since the glossaries are automatically scoped, -%\cs{@glsxtr@org@postdescription} shouldn't already be defined, but -%check anyway just as a precautionary measure. +%\end{macro} +% +%\begin{macro}{\glsxtrfullformat} +% Full format without case change. % \begin{macrocode} - \ifundef\@glsxtr@org@postdescription - {% - \let\@glsxtr@org@postdescription\glspostdescription - \renewcommand*{\glspostdescription}{% - \ifglsentryexists{\glscurrententrylabel}% - {% - \glsxtrpostdescription - \@glsxtr@org@postdescription - }% - {}% - }% - }% - {}% +\newcommand*{\glsxtrfullformat}[2]{% + \glsfirstlongfont{\glsaccesslong{#1}}#2\glsxtrfullsep{#1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{#1}}}% +} % \end{macrocode} -%\changes{1.07}{2016-08-15}{added \cs{glossxtrsetpopts}} -%Enable the options used by \cs{@@glsxtrp}: +%\end{macro} +% +%\begin{macro}{\Glsxtrfullformat} +% Full format with case change. % \begin{macrocode} - \glossxtrsetpopts - }% +\newcommand*{\Glsxtrfullformat}[2]{% + \glsfirstlongfont{\Glsaccesslong{#1}}#2\glsxtrfullsep{#1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{#1}}}% } -{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostdescription} -%This command will only be used if \cs{@gls@preglossaryhook} is -%available \emph{and} the glossary style uses -%\cs{glspostdescription} without modifying it. (\cs{nopostdesc} -%will suppress this.) The \sty{glossaries-extra-stylemods} package will -%add the post description hook to all the predefined styles that -%don't include it. +%\begin{macro}{\glsxtrfullplformat} +% Plural full format without case change. % \begin{macrocode} -\newcommand*{\glsxtrpostdescription}{% - \csuse{glsxtrpostdesc\glscategory{\glscurrententrylabel}}% +\newcommand*{\glsxtrfullplformat}[2]{% + \glsfirstlongfont{\glsaccesslongpl{#1}}#2\glsxtrfullsep{#1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{#1}}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostdescgeneral} +%\begin{macro}{\Glsxtrfullplformat} +% Plural full format with case change. % \begin{macrocode} -\newcommand*{\glsxtrpostdescgeneral}{} +\newcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstlongfont{\Glsaccesslongpl{#1}}#2\glsxtrfullsep{#1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{#1}}}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostdescterm} +%\begin{macro}{\glsxtrfullsep} +% Separator used by full format is a space by default. The argument +% is the entry's label. % \begin{macrocode} -\newcommand*{\glsxtrpostdescterm}{} +\newcommand*{\glsxtrfullsep}[1]{\space} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostdescacronym} +% In-line formats in case first use isn't compatible with +% \cs{glsentryfull} (for example, first use suppresses the long form +% or uses a footnote). +%\begin{macro}{\glsxtrinlinefullformat} +% Full format without case change. % \begin{macrocode} -\newcommand*{\glsxtrpostdescacronym}{} +\newcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostdescabbreviation} +%\begin{macro}{\Glsxtrinlinefullformat} +% Full format with case change. % \begin{macrocode} -\newcommand*{\glsxtrpostdescabbreviation}{} +\newcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glspostlinkhook} -% Redefine the post link hook used by commands like \cs{gls} to -% make it easier for categories or attributes to modify this action. -% Since this hook occurs outside the existence check of commands like -% \cs{gls}, this needs to be checked again here. Do nothing if the -% entry hasn't been defined. -%\changes{0.5.4}{2015-12-15}{added existence check} +%\begin{macro}{\glsxtrfullplformat} +% Plural full format without case change. % \begin{macrocode} -\renewcommand*{\glspostlinkhook}{% - \ifglsentryexists{\glslabel}{\glsxtrpostlinkhook}{}% -} +\newcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostlinkhook} -% The entry label should already be stored in \cs{glslabel} by -% \cs{@gls@link}. +%\begin{macro}{\Glsxtrinlinefullplformat} +% Plural full format with case change. % \begin{macrocode} -\newcommand*{\glsxtrpostlinkhook}{% - \glsxtrdiscardperiod{\glslabel}% - {\glsxtrpostlinkendsentence}% - {\glsxtrpostlink}% -} +\newcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostlink} +% Redefine \cs{glsentryfull} etc to use the inline format. +% Since these commands as supposed to be expandable, they can only +% use the currently applied style. If there are mixed styles, you'll +% need to use the \cs{glsxtrfull} set of commands instead. +%\begin{macro}{\glsentryfull} % \begin{macrocode} -\newcommand*{\glsxtrpostlink}{% - \csuse{glsxtrpostlink\glscategory{\glslabel}}% -} +\renewcommand*{\glsentryfull}[1]{\glsxtrinlinefullformat{#1}{}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostlinkendsentence} -%\changes{0.3}{2015-12-02}{new} -% Done by \cs{glsxtrpostlinkhook} if a full stop is discarded. +%\begin{macro}{\Glsentryfull} % \begin{macrocode} -\newcommand*{\glsxtrpostlinkendsentence}{% - \ifcsdef{glsxtrpostlink\glscategory{\glslabel}} - {% - \csuse{glsxtrpostlink\glscategory{\glslabel}}% +\renewcommand*{\Glsentryfull}[1]{\Glsxtrinlinefullformat{#1}{}} % \end{macrocode} -% Put the full stop back. +%\end{macro} +% +%\begin{macro}{\glsentryfullpl} % \begin{macrocode} - .\spacefactor\sfcode`\. \relax - }% - {% +\renewcommand*{\glsentryfullpl}[1]{\glsxtrinlinefullplformat{#1}{}} % \end{macrocode} -% Assume the full stop was discarded because the entry ends with a -% period, so adjust the spacefactor. +%\end{macro} +% +%\begin{macro}{\Glsentryfullpl} % \begin{macrocode} - \spacefactor\sfcode`\. \relax - }% -} +\renewcommand*{\Glsentryfullpl}[1]{\Glsxtrinlinefullplformat{#1}{}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostlinkAddDescOnFirstUse} -%\changes{0.3}{2015-12-02}{new} -% Provide a command for appending the description in parentheses on -% first use, for the convenience of users wanting to add this to the -% post link hook. +%\begin{macro}{\glsfirstabbrvfont} +% Font changing command used for the abbreviation on first use or in +% the full format. % \begin{macrocode} -\newcommand*{\glsxtrpostlinkAddDescOnFirstUse}{% - \glsxtrifwasfirstuse{\space(\glsaccessdesc{\glslabel})}{}% -} +\newcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrpostlinkAddSymbolOnFirstUse} -%\changes{0.3}{2015-12-02}{new} -% Provide a command for appending the symbol (if defined) in parentheses on -% first use, for the convenience of users wanting to add this to the -% post link hook. +%\begin{macro}{\glsfirstabbrvdefaultfont} +% Font changing command used for the abbreviation on first use or in +% the full format. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsxtrpostlinkAddSymbolOnFirstUse}{% - \glsxtrifwasfirstuse - {% - \ifglshassymbol{\glslabel}{\space(\glsaccesssymbol{\glslabel})}{}% - }% - {}% -} +\newcommand*{\glsfirstabbrvdefaultfont}[1]{\glsabbrvfont{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsabbrvfont} +% Font changing command used for the abbreviation on subsequent use. +% \begin{macrocode} +\newcommand*{\glsabbrvfont}[1]{\glsabbrvdefaultfont{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsabbrvdefaultfont} +%\changes{0.3}{2015-12-02}{renamed from \cs{abbrvdefaultfont}} +% \begin{macrocode} +\newcommand*{\glsabbrvdefaultfont}[1]{#1} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrdiscardperiod} -% Discard following period (if present) if the -% \catattr{discardperiod} attribute is true. If a period is -% discarded, do the second argument otherwise do the third -% argument. The entry label is in the first argument. -% Since this is designed for abbreviations that end with a period, -% check if the plural form was used (which typically won't end with -% a period). -%\changes{0.3}{2015-12-02}{added check for plural} -%\changes{1.01}{2016-02-02}{added check for first use} +%\begin{macro}{\glslongfont} +%\changes{1.04}{2016-05-02}{new} +% Font changing command used for the long form in commands like +% \cs{glsxtrlong}. % \begin{macrocode} -\newcommand*{\glsxtrdiscardperiod}[3]{% - \glsxtrifwasfirstuse - {% - \glsifattribute{#1}{retainfirstuseperiod}{true}% - {#3}% - {% - \glsifattribute{#1}{discardperiod}{true}% - {% - \glsifplural - {% - \glsifattribute{#1}{pluraldiscardperiod}{true}% - {\glsxtrifperiod{#2}{#3}}% - {#3}% - }% - {% - \glsxtrifperiod{#2}{#3}% - }% - }% - {#3}% - }% - }% - {% - \glsifattribute{#1}{discardperiod}{true}% - {% - \glsifplural - {% - \glsifattribute{#1}{pluraldiscardperiod}{true}% - {\glsxtrifperiod{#2}{#3}}% - {#3}% - }% - {% - \glsxtrifperiod{#2}{#3}% - }% - }% - {#3}% - }% -} +\newcommand*{\glslongfont}[1]{\glslongdefaultfont{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrifperiod} -% Make a convenient user command to check if the next character is a -% full stop (period). Works like \cs{@ifstar} but uses -% \cs{new@ifnextchar} rather than \cs{@ifnextchar} +%\begin{macro}{\glslongdefaultfont} +% Default font changing command used for the long form in commands like +%\changes{1.04}{2016-05-02}{new} +% \cs{glsxtrlong}. % \begin{macrocode} -\newcommand*{\glsxtrifperiod}[1]{\new@ifnextchar.{\@firstoftwo{#1}}} +\newcommand*{\glslongdefaultfont}[1]{#1} % \end{macrocode} %\end{macro} % -% Sometimes it's useful to test if there's a punctuation character -% following the glossary entry. -%\begin{macro}{\glsxtr@punclist} -% List of characters identified as punctuation marks. (Be careful of -% \sty{babel} shorthands!) This doesn't allow for punctuation marks -% made up from multiple characters (such as \verb|''|). +%\begin{macro}{\glsfirstlongfont} +% Font changing command used for the long form on first use or in +% the full format. % \begin{macrocode} -\newcommand*{\glsxtr@punclist}{.,:;?!} +\newcommand*{\glsfirstlongfont}[1]{\glslongfont{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtraddpunctuationmark} -% Add character to punctuation list. +%\begin{macro}{\glsfirstlongdefaultfont} +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsxtraddpunctuationmark}[1]{\appto\glsxtr@punclist{#1}} +\newcommand*{\glsfirstlongdefaultfont}[1]{\glslongdefaultfont{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrsetpunctuationmarks} -% Reset the punctuation list. +%\begin{macro}{\glsxtrabbrvpluralsuffix} +% Default plural suffix. +%\changes{1.12}{2017-02-03}{new} +%Allow an alternative default suffix for abbreviations. % \begin{macrocode} -\newcommand*{\glsxtrsetpunctuationmarks}[1]{\def\glsxtr@punclist{#1}} +\newcommand*{\glsxtrabbrvpluralsuffix}{\glspluralsuffix} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrifpunc} -%\begin{definition} -%\cs{glsxtrifnextpunc}\marg{true part}\marg{false part} -%\end{definition} -%Test if this is followed by a punctuation mark. (Adapted from -%\cs{new@ifnextchar}.) +%\begin{macro}{\abbrvpluralsuffix} +% Default plural suffix. % \begin{macrocode} -\newcommand*{\glsxtrifnextpunc}[2]{% - \def\reserved@a{#1}% - \def\reserved@b{#2}% - \futurelet\@glspunc@token\glsxtr@ifnextpunc -} +\newcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtr@ifnextpunc} +%\begin{macro}{\glsxtrfull} +% Full form (no case-change). % \begin{macrocode} -\newcommand*{\glsxtr@ifnextpunc}{% - \glsxtr@ifpunctoken{\@glspunc@token}{\let\reserved@b\reserved@a}{}% - \reserved@b +\newrobustcmd*{\glsxtrfull}{\@gls@hyp@opt\ns@glsxtrfull} +\newcommand*\ns@glsxtrfull[2][]{% + \new@ifnextchar[{\@glsxtr@full{#1}{#2}}% + {\@glsxtr@full{#1}{#2}[]}% } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsxtr@ifpunctoken} -% Test if the token given in the first argument is in the -% punctuation list. +%\begin{macro}{\@glsxtr@full} +% Low-level macro: % \begin{macrocode} -\newcommand*{\glsxtr@ifpunctoken}[1]{% - \expandafter\@glsxtr@ifpunctoken\expandafter#1\glsxtr@punclist\@nnil +\def\@glsxtr@full#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{\glsxtrinlinefullformat{#2}{#3}}% +% \end{macrocode} +% What should \cs{glsxtrifwasfirstuse} be set to here? Where the inline +% and display full forms are the same, this is essentially emulating +% first use, to it make sense for the postlink hook to pretend it +% was a first use instance. It makes less sense if the inline and +% display forms are different. Provide a hook to make it easier to +% reconfigure. +% \begin{macrocode} + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@ifpunctoken} +%\begin{macro}{\glsxtrsetupfulldefs} % \begin{macrocode} -\def\@glsxtr@ifpunctoken#1#2{% - \let\reserved@d=#2% - \ifx\reserved@d\@nnil - \let\glsxtr@next\@glsxtr@notfoundinlist - \else - \ifx#1\reserved@d - \let\glsxtr@next\@glsxtr@foundinlist - \else - \let\glsxtr@next\@glsxtr@ifpunctoken - \fi - \fi - \glsxtr@next#1% +\newcommand*{\glsxtrsetupfulldefs}{% + \let\glsxtrifwasfirstuse\@firstoftwo } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@foundinlist} +%\begin{macro}{\Glsxtrfull} +% Full form (first letter uppercase). % \begin{macrocode} -\def\@glsxtr@foundinlist#1\@nnil{\@firstoftwo} +\newrobustcmd*{\Glsxtrfull}{\@gls@hyp@opt\ns@Glsxtrfull} +\newcommand*\ns@Glsxtrfull[2][]{% + \new@ifnextchar[{\@Glsxtr@full{#1}{#2}}% + {\@Glsxtr@full{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsxtr@notfoundinlist} +%\begin{macro}{\@Glsxtr@full} +% Low-level macro: % \begin{macrocode} -\def\@glsxtr@notfoundinlist#1{\@secondoftwo} +\def\@Glsxtr@full#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{\Glsxtrinlinefullformat{#2}{#3}}% + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrdopostpunc} -%\begin{definition} -%\cs{glsxtrdopostpunc}\marg{code} -%\end{definition} -% If this is followed be a punctuation character, do \meta{code} -% after the character otherwise do \meta{code} before whatever comes -% next. +%\begin{macro}{\GLSxtrfull} +% Full form (all uppercase). % \begin{macrocode} -\newcommand{\glsxtrdopostpunc}[1]{% - \glsxtrifnextpunc{\@glsxtr@swaptwo{#1}}{#1}% +\newrobustcmd*{\GLSxtrfull}{\@gls@hyp@opt\ns@GLSxtrfull} +\newcommand*\ns@GLSxtrfull[2][]{% + \new@ifnextchar[{\@GLSxtr@full{#1}{#2}}% + {\@GLSxtr@full{#1}{#2}[]}% } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\@glsxtr@swaptwo} +%\begin{macro}{\@GLSxtr@full} +% Low-level macro: % \begin{macrocode} -\newcommand{\@glsxtr@swaptwo}[2]{#2#1} +\def\@GLSxtr@full#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{\mfirstucMakeUppercase{\glsxtrinlinefullformat{#2}{#3}}}% + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} %\end{macro} % -%\section{Abbreviations} -% -%The \qt{acronym} code from \styfmt{glossaries} is misnamed as it's more -%often used for other forms of abbreviations. This code corrects -%this inconsistency, but rather than just having synonyms, provide -% commands for abbreviations that have a similar, but not identical, -% underlying mechanism to acronyms. -% -% If there's a style for the given category, apply it. +%\begin{macro}{\glsxtrfullpl} +% Plural full form (no case-change). % \begin{macrocode} -\define@key{glsxtrabbrv}{category}{% - \edef\glscategorylabel{#1}% - \ifcsdef{@glsabbrv@current@#1}% - {% +\newrobustcmd*{\glsxtrfullpl}{\@gls@hyp@opt\ns@glsxtrfullpl} +\newcommand*\ns@glsxtrfullpl[2][]{% + \new@ifnextchar[{\@glsxtr@fullpl{#1}{#2}}% + {\@glsxtr@fullpl{#1}{#2}[]}% +} % \end{macrocode} -% Warning should already have been issued. +%\end{macro} +%\begin{macro}{\@glsxtr@fullpl} +% Low-level macro: % \begin{macrocode} - \let\@glsxtr@orgwarndep\GlsXtrWarnDeprecatedAbbrStyle - \let\GlsXtrWarnDeprecatedAbbrStyle\@gobbletwo - \glsxtr@applyabbrvstyle{\csname @glsabbrv@current@#1\endcsname}% - \let\GlsXtrWarnDeprecatedAbbrStyle\@glsxtr@orgwarndep - }% - {}% +\def\@glsxtr@fullpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{\glsxtrinlinefullplformat{#2}{#3}}% + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} -% Save the short plural form. This may be needed before the entry is -% defined. +%\end{macro} +% +%\begin{macro}{\Glsxtrfullpl} +% Plural full form (first letter uppercase). % \begin{macrocode} -\define@key{glsxtrabbrv}{shortplural}{% - \def\@gls@shortpl{#1}% +\newrobustcmd*{\Glsxtrfullpl}{\@gls@hyp@opt\ns@Glsxtrfullpl} +\newcommand*\ns@Glsxtrfullpl[2][]{% + \new@ifnextchar[{\@Glsxtr@fullpl{#1}{#2}}% + {\@Glsxtr@fullpl{#1}{#2}[]}% } % \end{macrocode} -% Similarly for the long plural form. +%\end{macro} +%\begin{macro}{\@Glsxtr@fullpl} +% Low-level macro: % \begin{macrocode} -\define@key{glsxtrabbrv}{longplural}{% - \def\@gls@longpl{#1}% +\def\@Glsxtr@fullpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{\Glsxtrinlinefullplformat{#2}{#3}}% + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} +%\end{macro} % -% Token registers for the short plural and long plural, provided for -% use in the abbreviation style definitions. -%\begin{macro}{\glsshortpltok} -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\GLSxtrfullpl} +% Plural full form (all upper case). % \begin{macrocode} -\newtoks\glsshortpltok +\newrobustcmd*{\GLSxtrfullpl}{\@gls@hyp@opt\ns@GLSxtrfullpl} +\newcommand*\ns@GLSxtrfullpl[2][]{% + \new@ifnextchar[{\@GLSxtr@fullpl{#1}{#2}}% + {\@GLSxtr@fullpl{#1}{#2}[]}% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glslongpltok} -%\changes{0.3}{2015-12-02}{new} +%\begin{macro}{\@GLSxtr@fullpl} +% Low-level macro: % \begin{macrocode} -\newtoks\glslongpltok +\def\@GLSxtr@fullpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\glsxtrinlinefullplformat{#2}{#3}}}% + \glsxtrsetupfulldefs + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@insertdots} -%\changes{0.3}{2015-12-02}{new} -% Provided in case user wants to automatically insert dots between -% each letter of the abbreviation. This should be applied before -% defining the abbreviation to optimise the document build. -% (Otherwise, it would have to be done each time the short form is -% required, which is an unnecessary waste of time.) For this to work -% the short form must be expanded when passed to -% \cs{newabbreviation}. Note that explicitly using the -% \gloskey{short} or \gloskey{shortplural} keys will override this. +% The short and long forms work in a similar way to acronyms. +%\begin{macro}{\glsxtrshort} % \begin{macrocode} -\newcommand*{\@glsxtr@insertdots}[2]{% - \def#1{}% - \@glsxtr@insert@dots#1#2\@nnil +\newrobustcmd*{\glsxtrshort}{\@gls@hyp@opt\ns@glsxtrshort} +% \end{macrocode} +% Define the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\ns@glsxtrshort}[2][]{% + \new@ifnextchar[{\@glsxtrshort{#1}{#2}}{\@glsxtrshort{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtr@insert@dots} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\@glsxtr@insert@dots}[2]{% - \ifx\@nnil#2\relax - \let\@glsxtr@insert@dots@next\@gobble - \else - \ifx\relax#2\relax - \else - \appto#1{#2.}% - \fi - \let\@glsxtr@insert@dots@next\@glsxtr@insert@dots - \fi - \@glsxtr@insert@dots@next#1% +\def\@glsxtrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% +% \end{macrocode} +% Need to make sure \cs{glsabbrvfont} is set correctly. +% \begin{macrocode} + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsabbrvfont{\glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%Similarly provide a way of replacing spaces with -%\cs{glsxtrwordsep}, which first needs to be defined: -%\begin{macro}{\glsxtrwordsep} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\Glsxtrshort} % \begin{macrocode} -\newcommand*{\glsxtrwordsep}{\space} +\newrobustcmd*{\Glsxtrshort}{\@gls@hyp@opt\ns@Glsxtrshort} % \end{macrocode} -%\end{macro} -%Each word is marked with -%\begin{macro}{\glsxtrword} -%\changes{1.17}{2017-08-09}{new} +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsxtrword}[1]{#1} +\newcommand*{\ns@Glsxtrshort}[2][]{% + \new@ifnextchar[{\@Glsxtrshort{#1}{#2}}{\@Glsxtrshort{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glsxtr@markwordseps} -%\changes{1.17}{2017-08-09}{new} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\@glsxtr@markwordseps}[2]{% - \def#1{}% - \@glsxtr@mark@wordseps#1#2 \@nnil +\def\@Glsxtrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsabbrvfont{\Glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} %\end{macro} -%\begin{macro}{\@glsxtr@mark@wordseps} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\GLSxtrshort} % \begin{macrocode} -\def\@glsxtr@mark@wordseps#1#2 #3{% - \ifdefempty{#1}% - {\def#1{\protect\glsxtrword{#2}}}% - {\appto#1{\protect\glsxtrwordsep\protect\glsxtrword{#2}}}% - \ifx\@nnil#3\relax - \let\@glsxtr@mark@wordseps@next\relax - \else - \def\@glsxtr@mark@wordseps@next{% - \@glsxtr@mark@wordseps#1#3}% - \fi - \@glsxtr@mark@wordseps@next +\newrobustcmd*{\GLSxtrshort}{\@gls@hyp@opt\ns@GLSxtrshort} +% \end{macrocode} +% Define the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\ns@GLSxtrshort}[2][]{% + \new@ifnextchar[{\@GLSxtrshort{#1}{#2}}{\@GLSxtrshort{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\newabbreviation} -% Define a new generic abbreviation. +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\newabbreviation}[4][]{% - \glsxtr@newabbreviation{#1}{#2}{#3}{#4}% +\def\@GLSxtrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase + {\glsabbrvfont{\glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtr@newabbreviation} -% Internal macro. (bib2gls has an option that needs to -% temporarily redefine \cs{newabbreviation}. This is just makes -% it easier to save and restore the original definition.) -%\changes{1.12}{2017-02-03}{new} +%\begin{macro}{\glsxtrlong} % \begin{macrocode} -\newcommand*{\glsxtr@newabbreviation}[4]{% - \glskeylisttok{#1}% - \glslabeltok{#2}% - \glsshorttok{#3}% - \glslongtok{#4}% +\newrobustcmd*{\glsxtrlong}{\@gls@hyp@opt\ns@glsxtrlong} % \end{macrocode} -%Save the original short and long values (before attribute settings -%modify them). -%\changes{1.17}{2017-08-09}{added \cs{glsxtrorgshort} and \cs{glsxtrorglong}} +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \def\glsxtrorgshort{#3}% - \def\glsxtrorglong{#4}% +\newcommand*{\ns@glsxtrlong}[2][]{% + \new@ifnextchar[{\@glsxtrlong{#1}{#2}}{\@glsxtrlong{#1}{#2}[]}% +} % \end{macrocode} -% Get the category. -%\changes{0.3}{2015-12-02}{fixed family name in \cs{setkeys}} +% Read in the final optional argument: % \begin{macrocode} - \def\glscategorylabel{abbreviation}% - \glsxtr@applyabbrvstyle{\@glsabbrv@current@abbreviation}% +\def\@glsxtrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glslongfont{\glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} -% Ignore the shortplural and longplural keys. +%\end{macro} +% +%\begin{macro}{\Glsxtrlong} % \begin{macrocode} - \setkeys*{glsxtrabbrv}[shortplural,longplural]{#1}% +\newrobustcmd*{\Glsxtrlong}{\@gls@hyp@opt\ns@Glsxtrlong} % \end{macrocode} -% Set the default long plural +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \def\@gls@longpl{#4\glspluralsuffix}% - \let\@gls@default@longpl\@gls@longpl +\newcommand*{\ns@Glsxtrlong}[2][]{% + \new@ifnextchar[{\@Glsxtrlong{#1}{#2}}{\@Glsxtrlong{#1}{#2}[]}% +} % \end{macrocode} -% Has the \catattr{markwords} attribute been set? +% Read in the final optional argument: % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{markwords}{true}% +\def\@Glsxtrlong#1#2[#3]{% + \glsdoifexists{#2}% {% - \@glsxtr@markwordseps\@gls@long{#4}% - \expandafter\def\expandafter\@gls@longpl\expandafter - {\@gls@long\glspluralsuffix}% - \let\@gls@default@longpl\@gls@longpl -% \end{macrocode} -% Update \cs{glslongtok}. -% \begin{macrocode} - \expandafter\glslongtok\expandafter{\@gls@long}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glslongfont{\Glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - {}% + \glspostlinkhook +} % \end{macrocode} -% Has the \catattr{markshortwords} attribute been set? (Not -% compatible with \catattr{insertdots}.) +%\end{macro} +% +%\begin{macro}{\GLSxtrlong} % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{markshortwords}{true}% - {% - \@glsxtr@markwordseps\@gls@short{#3}% - }% - {% +\newrobustcmd*{\GLSxtrlong}{\@gls@hyp@opt\ns@GLSxtrlong} % \end{macrocode} -% Has the \catattr{insertdots} attribute been set? +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{insertdots}{true}% - {% - \@glsxtr@insertdots\@gls@short{#3}% - \expandafter\glsshorttok\expandafter{\@gls@short\spacefactor1000 \relax}% - }% - {\def\@gls@short{#3}}% - }% +\newcommand*{\ns@GLSxtrlong}[2][]{% + \new@ifnextchar[{\@GLSxtrlong{#1}{#2}}{\@GLSxtrlong{#1}{#2}[]}% +} % \end{macrocode} -% Has the \catattr{aposplural} attribute been set? (Not compatible -% with \catattr{noshortplural}.) +% Read in the final optional argument: % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{aposplural}{true}% +\def\@GLSxtrlong#1#2[#3]{% + \glsdoifexists{#2}% {% - \expandafter\def\expandafter\@gls@shortpl\expandafter{\@gls@short - '\abbrvpluralsuffix}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase + {\glslongfont{\glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - {% + \glspostlinkhook +} % \end{macrocode} -% Has the \catattr{noshortplural} attribute been set? +%\end{macro} +% +% Plural short forms: +%\begin{macro}{\glsxtrshortpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{noshortplural}{true}% - {% - \let\@gls@shortpl\@gls@short - }% - {% - \expandafter\def\expandafter\@gls@shortpl\expandafter{\@gls@short - \abbrvpluralsuffix}% - }% - }% +\newrobustcmd*{\glsxtrshortpl}{\@gls@hyp@opt\ns@glsxtrshortpl} % \end{macrocode} -% Update \cs{glsshorttok}: +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \expandafter\glsshorttok\expandafter{\@gls@short}% +\newcommand*{\ns@glsxtrshortpl}[2][]{% + \new@ifnextchar[{\@glsxtrshortpl{#1}{#2}}{\@glsxtrshortpl{#1}{#2}[]}% +} % \end{macrocode} -% Hook for further customisation if required: +% Read in the final optional argument: % \begin{macrocode} - \glsxtrnewabbrevpresetkeyhook{#1}{#2}{#3}% +\def\@glsxtrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsabbrvfont{\glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} -% Get the short and long plurals provided by user in optional -% argument to override defaults, if necessary. -% Ignore the category key (already obtained). +%\end{macro} +% +%\begin{macro}{\Glsxtrshortpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \setkeys*{glsxtrabbrv}[category]{#1}% +\newrobustcmd*{\Glsxtrshortpl}{\@gls@hyp@opt\ns@Glsxtrshortpl} % \end{macrocode} -% Has the plural been explicitly set? +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \ifx\@gls@default@longpl\@gls@longpl - \else +\newcommand*{\ns@Glsxtrshortpl}[2][]{% + \new@ifnextchar[{\@Glsxtrshortpl{#1}{#2}}{\@Glsxtrshortpl{#1}{#2}[]}% +} % \end{macrocode} -% Has the \catattr{markwords} attribute been set? +% Read in the final optional argument: % \begin{macrocode} - \glsifcategoryattribute{\glscategorylabel}{markwords}{true}% - {% - \expandafter\@glsxtr@markwordseps\expandafter\@gls@longpl\expandafter - {\@gls@longpl}% +\def\@Glsxtrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glsabbrvfont{\Glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi }% - {}% - \fi + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} -% Set the plural token registers so the values can be accessed by -% the abbreviation styles. +%\end{macro} +% +%\begin{macro}{\GLSxtrshortpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} - \expandafter\glsshortpltok\expandafter{\@gls@shortpl}% - \expandafter\glslongpltok\expandafter{\@gls@longpl}% +\newrobustcmd*{\GLSxtrshortpl}{\@gls@hyp@opt\ns@GLSxtrshortpl} % \end{macrocode} -% Do any extra setup provided by hook: +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \newabbreviationhook +\newcommand*{\ns@GLSxtrshortpl}[2][]{% + \new@ifnextchar[{\@GLSxtrshortpl{#1}{#2}}{\@GLSxtrshortpl{#1}{#2}[]}% +} % \end{macrocode} -% Define this entry: +% Read in the final optional argument: % \begin{macrocode} - \protected@edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\glsxtrabbrvtype,% - category=abbreviation,% - short={\the\glsshorttok},% - shortplural={\the\glsshortpltok},% - long={\the\glslongtok},% - longplural={\the\glslongpltok},% - name={\the\glsshorttok},% - \CustomAbbreviationFields,% - \the\glskeylisttok +\def\@GLSxtrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \glssetabbrvfmt{\glscategory{#2}}% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase + {\glsabbrvfont{\glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% }% - \@do@newglossaryentry - \GlsXtrPostNewAbbreviation + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrnewabbrevpresetkeyhook} -% Hook for extra stuff in \cs{newabbreviation} -%\changes{0.5.2}{2015-12-08}{new} +% Plural long forms: +%\begin{macro}{\glsxtrlongpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} -\newcommand*{\glsxtrnewabbrevpresetkeyhook}[3]{} +\newrobustcmd*{\glsxtrlongpl}{\@gls@hyp@opt\ns@glsxtrlongpl} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\GlsXtrPostNewAbbreviation} -% Hook used by abbreviation styles. +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\GlsXtrPostNewAbbreviation}{} +\newcommand*{\ns@glsxtrlongpl}[2][]{% + \new@ifnextchar[{\@glsxtrlongpl{#1}{#2}}{\@glsxtrlongpl{#1}{#2}[]}% +} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@glsxtrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glslongfont{\glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\newabbreviationhook} -% Hook for use with \cs{newabbreviation}. +%\begin{macro}{\Glsxtrlongpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} -\newcommand*{\newabbreviationhook}{} +\newrobustcmd*{\Glsxtrlongpl}{\@gls@hyp@opt\ns@Glsxtrlongpl} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\CustomAbbreviationFields} +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\CustomAbbreviationFields}{} +\newcommand*{\ns@Glsxtrlongpl}[2][]{% + \new@ifnextchar[{\@Glsxtrlongpl{#1}{#2}}{\@Glsxtrlongpl{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrparen} -%\changes{1.17}{2017-08-09}{new} -%For the parenthetical styles. +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsxtrparen}[1]{(#1)} +\def\@Glsxtrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \glslongfont{\Glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrfullformat} -% Full format without case change. +%\begin{macro}{\GLSxtrlongpl} +%\changes{0.3}{2015-12-02}{new} % \begin{macrocode} -\newcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongfont{\glsaccesslong{#1}}#2\glsxtrfullsep{#1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{#1}}}% -} +\newrobustcmd*{\GLSxtrlongpl}{\@gls@hyp@opt\ns@GLSxtrlongpl} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrfullformat} -% Full format with case change. +% Define the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongfont{\Glsaccesslong{#1}}#2\glsxtrfullsep{#1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{#1}}}% +\newcommand*{\ns@GLSxtrlongpl}[2][]{% + \new@ifnextchar[{\@GLSxtrlongpl{#1}{#2}}{\@GLSxtrlongpl{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrfullplformat} -% Plural full format without case change. +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongfont{\glsaccesslongpl{#1}}#2\glsxtrfullsep{#1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{#1}}}% +\def\@GLSxtrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper + \let\glsxtrifwasfirstuse\@secondoftwo + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase + {\glslongfont{\glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% + \ifglsxtrinsertinside\else#3\fi + }% + }% + \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + }% + \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrfullplformat} -% Plural full format with case change. +%\begin{macro}{\glssetabbrvfmt} +% Set the current format for the given category (or the +% \category{abbreviation} category if unset). % \begin{macrocode} -\newcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongfont{\Glsaccesslongpl{#1}}#2\glsxtrfullsep{#1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{#1}}}% +\newcommand*{\glssetabbrvfmt}[1]{% + \ifcsdef{@glsabbrv@current@#1}% + {\glsxtr@applyabbrvfmt{\csname @glsabbrv@current@#1\endcsname}}% + {\glsxtr@applyabbrvfmt{\@glsabbrv@current@abbreviation}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrfullsep} -% Separator used by full format is a space by default. The argument -% is the entry's label. +%\begin{macro}{\glsuseabbrvfont} +% Provide a way to use the abbreviation font for a given category +% for arbitrary text. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\glsxtrfullsep}[1]{\space} +\newrobustcmd*{\glsuseabbrvfont}[2]{{\glssetabbrvfmt{#2}\glsabbrvfont{#1}}} % \end{macrocode} %\end{macro} % -% In-line formats in case first use isn't compatible with -% \cs{glsentryfull} (for example, first use suppresses the long form -% or uses a footnote). -%\begin{macro}{\glsxtrinlinefullformat} -% Full format without case change. +%\begin{macro}{\glsuselongfont} +% Provide a way to use the long font for a given category +% for arbitrary text. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat} +\newrobustcmd*{\glsuselongfont}[2]{{\glssetabbrvfmt{#2}\glslongfont{#1}}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrinlinefullformat} -% Full format with case change. +%\changes{0.5.2}{2015-12-08}{removed \cs{glsxtrabbrvfmt}} +%\begin{macro}{\glsxtrgenabbrvfmt} +% Similar to \cs{glsgenacfmt}, but for abbreviations. +%\changes{1.17}{2017-08-09}{added check for \cs{ifglsxtrinsertinside}} % \begin{macrocode} -\newcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat} +\newcommand*{\glsxtrgenabbrvfmt}{% + \ifdefempty\glscustomtext + {% + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrfullplformat} -% Plural full format without case change. +% Subsequent use: % \begin{macrocode} -\newcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat} + \glsifplural + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrinlinefullplformat} -% Plural full format with case change. +% Subsequent plural form: % \begin{macrocode} -\newcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat} + \glscapscase + {% % \end{macrocode} -%\end{macro} -% -% Redefine \cs{glsentryfull} etc to use the inline format. -% Since these commands as supposed to be expandable, they can only -% use the currently applied style. If there are mixed styles, you'll -% need to use the \cs{glsxtrfull} set of commands instead. -%\begin{macro}{\glsentryfull} +% Subsequent plural form, don't adjust case: % \begin{macrocode} -\renewcommand*{\glsentryfull}[1]{\glsxtrinlinefullformat{#1}{}} + \glsxtrsubsequentplfmt{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsentryfull} +% Subsequent plural form, make first letter upper case: % \begin{macrocode} -\renewcommand*{\Glsentryfull}[1]{\Glsxtrinlinefullformat{#1}{}} + \Glsxtrsubsequentplfmt{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryfullpl} +% Subsequent plural form, all caps: % \begin{macrocode} -\renewcommand*{\glsentryfullpl}[1]{\glsxtrinlinefullplformat{#1}{}} + \mfirstucMakeUppercase + {\glsxtrsubsequentplfmt{\glslabel}{\glsinsert}}% + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsentryfullpl} +% Subsequent singular form % \begin{macrocode} -\renewcommand*{\Glsentryfullpl}[1]{\Glsxtrinlinefullplformat{#1}{}} + \glscapscase + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsfirstabbrvfont} -% Font changing command used for the abbreviation on first use or in -% the full format. +% Subsequent singular form, don't adjust case: % \begin{macrocode} -\newcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{#1}} + \glsxtrsubsequentfmt{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsfirstabbrvdefaultfont} -% Font changing command used for the abbreviation on first use or in -% the full format. -%\changes{0.5}{2015-12-07}{new} +% Subsequent singular form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsfirstabbrvdefaultfont}[1]{\glsabbrvfont{#1}} + \Glsxtrsubsequentfmt{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsabbrvfont} -% Font changing command used for the abbreviation on subsequent use. +% Subsequent singular form, all caps: % \begin{macrocode} -\newcommand*{\glsabbrvfont}[1]{\glsabbrvdefaultfont{#1}} + \mfirstucMakeUppercase + {\glsxtrsubsequentfmt{\glslabel}{\glsinsert}}% + }% + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsabbrvdefaultfont} -%\changes{0.3}{2015-12-02}{renamed from \cs{abbrvdefaultfont}} +% First use: % \begin{macrocode} -\newcommand*{\glsabbrvdefaultfont}[1]{#1} + \glsifplural + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glslongfont} -%\changes{1.04}{2016-05-02}{new} -% Font changing command used for the long form in commands like -% \cs{glsxtrlong}. +% First use plural form: % \begin{macrocode} -\newcommand*{\glslongfont}[1]{\glslongdefaultfont{#1}} + \glscapscase + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glslongdefaultfont} -% Default font changing command used for the long form in commands like -%\changes{1.04}{2016-05-02}{new} -% \cs{glsxtrlong}. +% First use plural form, don't adjust case: % \begin{macrocode} -\newcommand*{\glslongdefaultfont}[1]{#1} + \glsxtrfullplformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsfirstlongfont} -% Font changing command used for the long form on first use or in -% the full format. +% First use plural form, make first letter upper case: % \begin{macrocode} -\newcommand*{\glsfirstlongfont}[1]{\glslongfont{#1}} + \Glsxtrfullplformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsfirstlongdefaultfont} -%\changes{0.5}{2015-12-07}{new} +% First use plural form, all caps: % \begin{macrocode} -\newcommand*{\glsfirstlongdefaultfont}[1]{\glslongdefaultfont{#1}} + \mfirstucMakeUppercase + {\glsxtrfullplformat{\glslabel}{\glsinsert}}% + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrabbrvpluralsuffix} -% Default plural suffix. -%\changes{1.12}{2017-02-03}{new} -%Allow an alternative default suffix for abbreviations. +% First use singular form % \begin{macrocode} -\newcommand*{\glsxtrabbrvpluralsuffix}{\glspluralsuffix} + \glscapscase + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\abbrvpluralsuffix} -% Default plural suffix. +% First use singular form, don't adjust case: % \begin{macrocode} -\newcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix} + \glsxtrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrfull} -% Full form (no case-change). +% First use singular form, make first letter upper case: % \begin{macrocode} -\newrobustcmd*{\glsxtrfull}{\@gls@hyp@opt\ns@glsxtrfull} -\newcommand*\ns@glsxtrfull[2][]{% - \new@ifnextchar[{\@glsxtr@full{#1}{#2}}% - {\@glsxtr@full{#1}{#2}[]}% -} + \Glsxtrfullformat{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glsxtr@full} -% Low-level macro: +% First use singular form, all caps: % \begin{macrocode} -\def\@glsxtr@full#1#2[#3]{% - \glsdoifexists{#2}% + \mfirstucMakeUppercase + {\glsxtrfullformat{\glslabel}{\glsinsert}}% + }% + }% + }% + }% {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{\glsxtrinlinefullformat{#2}{#3}}% % \end{macrocode} -% What should \cs{glsxtrifwasfirstuse} be set to here? Where the inline -% and display full forms are the same, this is essentially emulating -% first use, to it make sense for the postlink hook to pretend it -% was a first use instance. It makes less sense if the inline and -% display forms are different. Provide a hook to make it easier to -% reconfigure. +% User supplied text. % \begin{macrocode} - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \glscustomtext }% - \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrsetupfulldefs} +%\begin{macro}{\glsxtrsubsequentfmt} +% Subsequent use format (singular no case change). +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newcommand*{\glsxtrsetupfulldefs}{% - \let\glsxtrifwasfirstuse\@firstoftwo +\newcommand*{\glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\glsaccessshort{#1}\ifglsxtrinsertinside #2\fi}% + \ifglsxtrinsertinside \else#2\fi } +\let\glsxtrdefaultsubsequentfmt\glsxtrsubsequentfmt % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrfull} -% Full form (first letter uppercase). +%\begin{macro}{\glsxtrsubsequentplfmt} +% Subsequent use format (plural no case change). +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newrobustcmd*{\Glsxtrfull}{\@gls@hyp@opt\ns@Glsxtrfull} -\newcommand*\ns@Glsxtrfull[2][]{% - \new@ifnextchar[{\@Glsxtr@full{#1}{#2}}% - {\@Glsxtr@full{#1}{#2}[]}% +\newcommand*{\glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\glsaccessshortpl{#1}\ifglsxtrinsertinside #2\fi}% + \ifglsxtrinsertinside \else#2\fi } +\let\glsxtrdefaultsubsequentplfmt\glsxtrsubsequentplfmt % \end{macrocode} %\end{macro} -%\begin{macro}{\@Glsxtr@full} -% Low-level macro: +% +%\begin{macro}{\Glsxtrsubsequentfmt} +% Subsequent use format (singular, first letter uppercase). +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\def\@Glsxtr@full#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{\Glsxtrinlinefullformat{#2}{#3}}% - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook +\newcommand*{\Glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\Glsaccessshort{#1}\ifglsxtrinsertinside #2\fi}% + \ifglsxtrinsertinside \else#2\fi } +\let\Glsxtrdefaultsubsequentfmt\Glsxtrsubsequentfmt % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSxtrfull} -% Full form (all uppercase). +%\begin{macro}{\Glsxtrsubsequentplfmt} +% Subsequent use format (plural, first letter uppercase). +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newrobustcmd*{\GLSxtrfull}{\@gls@hyp@opt\ns@GLSxtrfull} -\newcommand*\ns@GLSxtrfull[2][]{% - \new@ifnextchar[{\@GLSxtr@full{#1}{#2}}% - {\@GLSxtr@full{#1}{#2}[]}% +\newcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\Glsaccessshortpl{#1}\ifglsxtrinsertinside #2\fi}% + \ifglsxtrinsertinside \else#2\fi } +\let\Glsxtrdefaultsubsequentplfmt\Glsxtrsubsequentplfmt % \end{macrocode} %\end{macro} -%\begin{macro}{\@GLSxtr@full} -% Low-level macro: +% +%\subsection{Abbreviation Styles Setup} +% +%\begin{macro}{\setabbreviationstyle} % \begin{macrocode} -\def\@GLSxtr@full#1#2[#3]{% - \glsdoifexists{#2}% +\newcommand*{\setabbreviationstyle}[2][abbreviation]{% + \ifcsundef{@glsabbrv@dispstyle@setup@#2} {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{\mfirstucMakeUppercase{\glsxtrinlinefullformat{#2}{#3}}}% - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \PackageError{glossaries-extra}{Undefined abbreviation style `#2'}{}% }% - \glspostlinkhook -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrfullpl} -% Plural full form (no case-change). -% \begin{macrocode} -\newrobustcmd*{\glsxtrfullpl}{\@gls@hyp@opt\ns@glsxtrfullpl} -\newcommand*\ns@glsxtrfullpl[2][]{% - \new@ifnextchar[{\@glsxtr@fullpl{#1}{#2}}% - {\@glsxtr@fullpl{#1}{#2}[]}% -} + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glsxtr@fullpl} -% Low-level macro: +% Have abbreviations already been defined for this category? +%\changes{0.5.2}{2015-12-08}{added check for post-definition style switch} % \begin{macrocode} -\def\@glsxtr@fullpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{\glsxtrinlinefullplformat{#2}{#3}}% - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} + \ifcsstring{@glsabbrv@current@#1}{#2}% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrfullpl} -% Plural full form (first letter uppercase). +% Style already set. % \begin{macrocode} -\newrobustcmd*{\Glsxtrfullpl}{\@gls@hyp@opt\ns@Glsxtrfullpl} -\newcommand*\ns@Glsxtrfullpl[2][]{% - \new@ifnextchar[{\@Glsxtr@fullpl{#1}{#2}}% - {\@Glsxtr@fullpl{#1}{#2}[]}% -} + }% + {% + \def\@glsxtr@dostylewarn{}% + \glsforeachincategory{#1}{\@gls@type}{\@gls@label}% + {% + \def\@glsxtr@dostylewarn{\GlossariesWarning{Abbreviation + style has been switched \MessageBreak + for category `#1', \MessageBreak + but there have already been entries \MessageBreak + defined for this category. Unwanted \MessageBreak + side-effects may result}}% + \@endfortrue + }% + \@glsxtr@dostylewarn % \end{macrocode} -%\end{macro} -%\begin{macro}{\@Glsxtr@fullpl} -% Low-level macro: +% Set up the style for the given category. % \begin{macrocode} -\def\@Glsxtr@fullpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{\Glsxtrinlinefullplformat{#2}{#3}}% - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \csdef{@glsabbrv@current@#1}{#2}% + \glsxtr@applyabbrvstyle{#2}% + }% }% - \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSxtrfullpl} -% Plural full form (all upper case). +%\begin{macro}{\glsxtr@applyabbrvstyle} +% Apply the abbreviation style without existence check. % \begin{macrocode} -\newrobustcmd*{\GLSxtrfullpl}{\@gls@hyp@opt\ns@GLSxtrfullpl} -\newcommand*\ns@GLSxtrfullpl[2][]{% - \new@ifnextchar[{\@GLSxtr@fullpl{#1}{#2}}% - {\@GLSxtr@fullpl{#1}{#2}[]}% +\newcommand*{\glsxtr@applyabbrvstyle}[1]{% + \csuse{@glsabbrv@dispstyle@setup@#1}% + \csuse{@glsabbrv@dispstyle@fmts@#1}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\@GLSxtr@fullpl} -% Low-level macro: +% +%\begin{macro}{\glsxtr@applyabbrvfmt} +% Only apply the style formats. % \begin{macrocode} -\def\@GLSxtr@fullpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase{\glsxtrinlinefullplformat{#2}{#3}}}% - \glsxtrsetupfulldefs - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook +\newcommand*{\glsxtr@applyabbrvfmt}[1]{% + \csuse{@glsabbrv@dispstyle@fmts@#1}% } % \end{macrocode} %\end{macro} % -% The short and long forms work in a similar way to acronyms. -%\begin{macro}{\glsxtrshort} +%\begin{macro}{\newabbreviationstyle} +% This is different from \cs{newacronymstyle}. The first argument is +% the label, the second argument sets the information required when +% defining the new abbreviation and the third argument sets the +% commands used to display the full format. +%\changes{1.04}{2016-05-02}{bug fix: corrected test for existence} % \begin{macrocode} -\newrobustcmd*{\glsxtrshort}{\@gls@hyp@opt\ns@glsxtrshort} +\newcommand*{\newabbreviationstyle}[3]{% + \ifcsdef{@glsabbrv@dispstyle@setup@#1} + {% + \PackageError{glossaries-extra}{Abbreviation style `#1' already + defined}{}% + }% + {% + \csdef{@glsabbrv@dispstyle@setup@#1}{% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +% Initialise hook to do nothing. The style may change this. % \begin{macrocode} -\newcommand*{\ns@glsxtrshort}[2][]{% - \new@ifnextchar[{\@glsxtrshort{#1}{#2}}{\@glsxtrshort{#1}{#2}[]}% -} + \renewcommand*{\GlsXtrPostNewAbbreviation}{}% + #2}% + \csdef{@glsabbrv@dispstyle@fmts@#1}{% % \end{macrocode} -% Read in the final optional argument: +% Assume in-line form is the same as first use. The style may change +% this. % \begin{macrocode} -\def\@glsxtrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% + \renewcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat}% + \renewcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat}% + \renewcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat}% + \renewcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat}% % \end{macrocode} -% Need to make sure \cs{glsabbrvfont} is set correctly. +% Reset \cs{glsxtrsubsequentfmt} etc in case a style changes this. % \begin{macrocode} - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsabbrvfont{\glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \let\glsxtrsubsequentfmt\glsxtrdefaultsubsequentfmt + \let\glsxtrsubsequentplfmt\glsxtrdefaultsubsequentplfmt + \let\Glsxtrsubsequentfmt\Glsxtrdefaultsubsequentfmt + \let\Glsxtrsubsequentplfmt\Glsxtrdefaultsubsequentplfmt + #3}% }% - \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrshort} +%\begin{macro}{\renewabbreviationstyle} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newrobustcmd*{\Glsxtrshort}{\@gls@hyp@opt\ns@Glsxtrshort} +\newcommand*{\renewabbreviationstyle}[3]{% + \ifcsundef{@glsabbrv@dispstyle@setup@#1} + {% + \PackageError{glossaries-extra}{Abbreviation style `#1' not defined}{}% + }% + {% + \csdef{@glsabbrv@dispstyle@setup@#1}{% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +% Initialise hook to do nothing. The style may change this. % \begin{macrocode} -\newcommand*{\ns@Glsxtrshort}[2][]{% - \new@ifnextchar[{\@Glsxtrshort{#1}{#2}}{\@Glsxtrshort{#1}{#2}[]}% -} + \renewcommand*{\GlsXtrPostNewAbbreviation}{}% + #2}% + \csdef{@glsabbrv@dispstyle@fmts@#1}{% % \end{macrocode} -% Read in the final optional argument: +% Assume in-line form is the same as first use. The style may change +% this. % \begin{macrocode} -\def\@Glsxtrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsabbrvfont{\Glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \renewcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat}% + \renewcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat}% + \renewcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat}% + \renewcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat}% + #3}% }% - \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSxtrshort} -% \begin{macrocode} -\newrobustcmd*{\GLSxtrshort}{\@gls@hyp@opt\ns@GLSxtrshort} -% \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\begin{macro}{\letabbreviationstyle} +%\changes{1.04}{2016-05-02}{new} +% Define a synonym for an abbreviation style. The first argument is +% the new name. The second argument is the original style's name. % \begin{macrocode} -\newcommand*{\ns@GLSxtrshort}[2][]{% - \new@ifnextchar[{\@GLSxtrshort{#1}{#2}}{\@GLSxtrshort{#1}{#2}[]}% +\newcommand*{\letabbreviationstyle}[2]{% + \csletcs{@glsabbrv@dispstyle@setup@#1}{@glsabbrv@dispstyle@setup@#2}% + \csletcs{@glsabbrv@dispstyle@fmts@#1}{@glsabbrv@dispstyle@fmts@#2}% } % \end{macrocode} -% Read in the final optional argument: +%\end{macro} +%\begin{macro}{\@glsxtr@deprecated@abbrstyle} +%\changes{1.04}{2016-05-02}{new} +%\begin{definition} +%\cs{@glsxtr@deprecated@abbrstyle}\marg{old-name}\marg{new-name} +%\end{definition} +% Define a synonym for a deprecated abbreviation style. % \begin{macrocode} -\def\@GLSxtrshort#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase - {\glsabbrvfont{\glsaccessshort{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% +\newcommand*{\@glsxtr@deprecated@abbrstyle}[2]{% + \csdef{@glsabbrv@dispstyle@setup@#1}{% + \GlsXtrWarnDeprecatedAbbrStyle{#1}{#2}% + \csuse{@glsabbrv@dispstyle@setup@#2}% }% - \glspostlinkhook + \csletcs{@glsabbrv@dispstyle@fmts@#1}{@glsabbrv@dispstyle@fmts@#2}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrlong} +%\begin{macro}{\GlsXtrWarnDeprecatedAbbrStyle} +%Generate warning for deprecated style use. +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newrobustcmd*{\glsxtrlong}{\@gls@hyp@opt\ns@glsxtrlong} +\newcommand*{\GlsXtrWarnDeprecatedAbbrStyle}[2]{% + \GlossariesExtraWarning{Deprecated abbreviation style name `#1', + use `#2' instead}% +} % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\end{macro} +% +%\begin{macro}{\GlsXtrUseAbbrStyleSetup} % \begin{macrocode} -\newcommand*{\ns@glsxtrlong}[2][]{% - \new@ifnextchar[{\@glsxtrlong{#1}{#2}}{\@glsxtrlong{#1}{#2}[]}% +\newcommand*{\GlsXtrUseAbbrStyleSetup}[1]{% + \ifcsundef{@glsabbrv@dispstyle@setup@#1}% + {% + \PackageError{glossaries-extra}% + {Unknown abbreviation style definitions `#1'}{}% + }% + {% + \csname @glsabbrv@dispstyle@setup@#1\endcsname + }% } % \end{macrocode} -% Read in the final optional argument: +%\end{macro} +% +%\begin{macro}{\GlsXtrUseAbbrStyleFmts} % \begin{macrocode} -\def\@glsxtrlong#1#2[#3]{% - \glsdoifexists{#2}% +\newcommand*{\GlsXtrUseAbbrStyleFmts}[1]{% + \ifcsundef{@glsabbrv@dispstyle@fmts@#1}% {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glslongfont{\glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \PackageError{glossaries-extra}% + {Unknown abbreviation style formats `#1'}{}% + }% + {% + \csname @glsabbrv@dispstyle@fmts@#1\endcsname }% - \glspostlinkhook } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrlong} +%\subsection{Predefined Styles (Default Font)} +% Define some common styles. These will set the \gloskey{first}, +% \gloskey{firstplural}, \gloskey{text} and \gloskey{plural} +% keys, even if the \catattr{regular} attribute isn't set to +% \qt{true}. If this attribute is set, commands like \cs{gls} will +% use them as per a regular entry, otherwise those keys will be +% ignored unless explicitly invoked by the user with commands like +% \cs{glsfirst}. In order for the first letter uppercase versions to +% work correctly, \cs{glsxtrfullformat} needs to be expanded when +% those keys are set. The final optional argument of \cs{glsfirst} +% will behave differently to the final optional argument of \cs{gls} +% with some styles. +% +%\begin{macro}{\ifglsxtrinsertinside} +%\changes{1.02}{2016-04-25}{new} +% Switch to determine if the insert text should be inside or outside +% the font changing command. The default is outside. % \begin{macrocode} -\newrobustcmd*{\Glsxtrlong}{\@gls@hyp@opt\ns@Glsxtrlong} +\newif\ifglsxtrinsertinside +\glsxtrinsertinsidefalse % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\end{macro} +% +%\changes{1.17}{2017-08-09}{removed some inconsistencies in the abbreviation +%styles} +%\begin{abbrvstyle}{long-short} % \begin{macrocode} -\newcommand*{\ns@Glsxtrlong}[2][]{% - \new@ifnextchar[{\@Glsxtrlong{#1}{#2}}{\@Glsxtrlong{#1}{#2}[]}% -} +\newabbreviationstyle{long-short}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlongfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},% % \end{macrocode} -% Read in the final optional argument: +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} % \begin{macrocode} -\def\@Glsxtrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glslongfont{\Glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook -} + plural={\protect\glsabbrvfont{\the\glsshortpltok}},% + description={\the\glslongtok}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\GLSxtrlong} +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} -\newrobustcmd*{\GLSxtrlong}{\@gls@hyp@opt\ns@GLSxtrlong} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} -\newcommand*{\ns@GLSxtrlong}[2][]{% - \new@ifnextchar[{\@GLSxtrlong{#1}{#2}}{\@GLSxtrlong{#1}{#2}[]}% -} + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% Read in the final optional argument: +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} -\def\@GLSxtrlong#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@secondoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase - {\glslongfont{\glsaccesslong{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% }% - \glspostlinkhook } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -% Plural short forms: -%\begin{macro}{\glsxtrshortpl} -%\changes{0.3}{2015-12-02}{new} +% Set this as the default style for general abbreviations: % \begin{macrocode} -\newrobustcmd*{\glsxtrshortpl}{\@gls@hyp@opt\ns@glsxtrshortpl} +\setabbreviationstyle{long-short} % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +% +%\begin{macro}{\glsxtrlongshortdescsort} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\ns@glsxtrshortpl}[2][]{% - \new@ifnextchar[{\@glsxtrshortpl{#1}{#2}}{\@glsxtrshortpl{#1}{#2}[]}% +\newcommand*{\glsxtrlongshortdescsort}{% + \expandonce\glsxtrorglong\space (\expandonce\glsxtrorgshort)% } % \end{macrocode} -% Read in the final optional argument: +%\end{macro} +% +%\begin{macro}{\glsxtrlongshortdescname} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\def\@glsxtrshortpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsabbrvfont{\glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook +\newcommand*{\glsxtrlongshortdescname}{% + \protect\glslongfont{\the\glslongtok} + \glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsxtrshortpl} -%\changes{0.3}{2015-12-02}{new} +%\begin{abbrvstyle}{long-short-desc} +% User supplies description. The long form is included in the name. +%\changes{0.3}{2015-12-02}{fixed name to use \cs{glslabeltok}} % \begin{macrocode} -\newrobustcmd*{\Glsxtrshortpl}{\@gls@hyp@opt\ns@Glsxtrshortpl} +\newabbreviationstyle{long-short-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort},% + first={\protect\glsfirstlongfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%The \gloskey{text} key should only have the short form. +%\changes{1.07}{2016-08-15}{added missing text key} % \begin{macrocode} -\newcommand*{\ns@Glsxtrshortpl}[2][]{% - \new@ifnextchar[{\@Glsxtrshortpl{#1}{#2}}{\@Glsxtrshortpl{#1}{#2}[]}% -} + text={\protect\glsabbrvfont{\the\glsshorttok}},% % \end{macrocode} -% Read in the final optional argument: +%\changes{1.07}{2016-08-15}{fixed misspelling of \cs{glsabbrvfont}} % \begin{macrocode} -\def\@Glsxtrshortpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glsabbrvfont{\Glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + }% +% \end{macrocode} +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + {}% }% - \glspostlinkhook +}% +{% + \GlsXtrUseAbbrStyleFmts{long-short}% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\GLSxtrshortpl} -%\changes{0.3}{2015-12-02}{new} +%\begin{abbrvstyle}{short-long} +% Short form followed by long form in parenthesis on first use. % \begin{macrocode} -\newrobustcmd*{\GLSxtrshortpl}{\@gls@hyp@opt\ns@GLSxtrshortpl} +\newabbreviationstyle{short-long}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\the\glslongtok},% + first={\protect\glsfirstabbrvfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongfont{\the\glslongpltok}}},% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} % \begin{macrocode} -\newcommand*{\ns@GLSxtrshortpl}[2][]{% - \new@ifnextchar[{\@GLSxtrshortpl{#1}{#2}}{\@GLSxtrshortpl{#1}{#2}[]}% -} + plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% % \end{macrocode} -% Read in the final optional argument: +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} -\def\@GLSxtrshortpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \glssetabbrvfmt{\glscategory{#2}}% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase - {\glsabbrvfont{\glsaccessshortpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + {}% }% - \glspostlinkhook -} -% \end{macrocode} -%\end{macro} -% -% Plural long forms: -%\begin{macro}{\glsxtrlongpl} -%\changes{0.3}{2015-12-02}{new} -% \begin{macrocode} -\newrobustcmd*{\glsxtrlongpl}{\@gls@hyp@opt\ns@glsxtrlongpl} +}% +{% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} -\newcommand*{\ns@glsxtrlongpl}[2][]{% - \new@ifnextchar[{\@glsxtrlongpl{#1}{#2}}{\@glsxtrlongpl{#1}{#2}[]}% -} + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% Read in the final optional argument: +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} -\def\@glsxtrlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@firstofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glslongfont{\glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% }% - \glspostlinkhook } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\Glsxtrlongpl} -%\changes{0.3}{2015-12-02}{new} -% \begin{macrocode} -\newrobustcmd*{\Glsxtrlongpl}{\@gls@hyp@opt\ns@Glsxtrlongpl} -% \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\begin{macro}{\glsxtrshortlongdescsort} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newcommand*{\ns@Glsxtrlongpl}[2][]{% - \new@ifnextchar[{\@Glsxtrlongpl{#1}{#2}}{\@Glsxtrlongpl{#1}{#2}[]}% -} +\newcommand*{\glsxtrshortlongdescsort}{\the\glsshorttok} % \end{macrocode} -% Read in the final optional argument: +%\end{macro} +% +%\begin{macro}{\glsxtrshortlongdescname} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\def\@Glsxtrlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@secondofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \glslongfont{\Glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% - }% - \glspostlinkhook +\newcommand*{\glsxtrshortlongdescname}{% + \protect\glsabbrvfont{\the\glsshorttok} + \glsxtrparen{\protect\glslongfont{\the\glslongtok}}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\GLSxtrlongpl} -%\changes{0.3}{2015-12-02}{new} +%\begin{abbrvstyle}{short-long-desc} +% User supplies description. The long form is included in the name. +%\changes{0.3}{2015-12-02}{fixed name to use \cs{glslabeltok}} % \begin{macrocode} -\newrobustcmd*{\GLSxtrlongpl}{\@gls@hyp@opt\ns@GLSxtrlongpl} +\newabbreviationstyle{short-long-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrshortlongdescname}, + sort={\glsxtrshortlongdescsort}, + first={\protect\glsfirstabbrvfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongfont{\the\glslongpltok}}},% % \end{macrocode} -% Define the un-starred form. Need to determine if there is -% a final optional argument +%\changes{1.07}{2016-08-15}{added text key} % \begin{macrocode} -\newcommand*{\ns@GLSxtrlongpl}[2][]{% - \new@ifnextchar[{\@GLSxtrlongpl{#1}{#2}}{\@GLSxtrlongpl{#1}{#2}[]}% -} + text={\protect\glsabbrvfont{\the\glsshorttok}},% % \end{macrocode} -% Read in the final optional argument: +%\changes{1.07}{2016-08-15}{fixed misspelling of \cs{glsabbrvfont} in plural +%key} % \begin{macrocode} -\def\@GLSxtrlongpl#1#2[#3]{% - \glsdoifexists{#2}% - {% - \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper - \let\glsxtrifwasfirstuse\@secondoftwo - \let\glsifplural\@firstoftwo - \let\glscapscase\@thirdofthree - \let\glsinsert\@empty - \def\glscustomtext{% - \mfirstucMakeUppercase - {\glslongfont{\glsaccesslongpl{#2}\ifglsxtrinsertinside#3\fi}% - \ifglsxtrinsertinside\else#3\fi - }% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + }% +% \end{macrocode} +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% }% - \@gls@link[#1]{#2}{\csname gls@\glstype @entryfmt\endcsname}% + {}% }% - \glspostlinkhook +}% +{% + \GlsXtrUseAbbrStyleFmts{short-long}% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\glssetabbrvfmt} -% Set the current format for the given category (or the -% \category{abbreviation} category if unset). +%\begin{macro}{\glsfirstlongfootnotefont} +%\changes{1.05}{2016-06-10}{new} +%Only used by the \qt{footnote} styles. % \begin{macrocode} -\newcommand*{\glssetabbrvfmt}[1]{% - \ifcsdef{@glsabbrv@current@#1}% - {\glsxtr@applyabbrvfmt{\csname @glsabbrv@current@#1\endcsname}}% - {\glsxtr@applyabbrvfmt{\@glsabbrv@current@abbreviation}}% -} +\newcommand*{\glsfirstlongfootnotefont}[1]{\glslongfootnotefont{#1}}% % \end{macrocode} %\end{macro} % -%\changes{0.5.2}{2015-12-08}{removed \cs{glsxtrabbrvfmt}} -%\begin{macro}{\glsxtrgenabbrvfmt} -% Similar to \cs{glsgenacfmt}, but for abbreviations. -%\changes{1.17}{2017-08-09}{added check for \cs{ifglsxtrinsertinside}} -% \begin{macrocode} -\newcommand*{\glsxtrgenabbrvfmt}{% - \ifdefempty\glscustomtext - {% - \ifglsused\glslabel - {% -% \end{macrocode} -% Subsequent use: -% \begin{macrocode} - \glsifplural - {% -% \end{macrocode} -% Subsequent plural form: +%\begin{macro}{\glslongfootnotefont} +%\changes{1.05}{2016-06-10}{new} +%Only used by the \qt{footnote} styles. % \begin{macrocode} - \glscapscase - {% +\newcommand*{\glslongfootnotefont}[1]{\glslongdefaultfont{#1}}% % \end{macrocode} -% Subsequent plural form, don't adjust case: +%\end{macro} +% +%\begin{macro}{\glsxtrabbrvfootnote} +%\begin{definition} +%\cs{glsxtrabbrvfootnote}\marg{label}\marg{long} +%\end{definition} +%\changes{1.07}{2016-08-15}{new} +%Command used by footnote abbreviation styles. The default +%definition ignores the first argument. The second argument +%\meta{long} includes the font changing command and may be the +%singular or plural form, depending on the command that was used +%(for example, \cs{gls} or \cs{glspl}). % \begin{macrocode} - \glsxtrsubsequentplfmt{\glslabel}{\glsinsert}% - }% - {% +\newcommand*{\glsxtrabbrvfootnote}[2]{\footnote{#2}} % \end{macrocode} -% Subsequent plural form, make first letter upper case: +%\end{macro} +% +%\begin{abbrvstyle}{footnote} +% Short form followed by long form in footnote on first use. % \begin{macrocode} - \Glsxtrsubsequentplfmt{\glslabel}{\glsinsert}% - }% - {% +\newabbreviationstyle{footnote}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\the\glslongtok},% % \end{macrocode} -% Subsequent plural form, all caps: +%\changes{1.07}{2016-08-15}{changed first forms to use +%\cs{glsfirstlongfootnotefont}} % \begin{macrocode} - \mfirstucMakeUppercase - {\glsxtrsubsequentplfmt{\glslabel}{\glsinsert}}% - }% - }% - {% + first={\protect\glsfirstabbrvfont{\the\glsshorttok}% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% % \end{macrocode} -% Subsequent singular form +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} % \begin{macrocode} - \glscapscase - {% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% % \end{macrocode} -% Subsequent singular form, don't adjust case: +% Switch off hyperlinks on first use to prevent nested hyperlinks, +% and unset the \catattr{regular} attribute if it has been set. +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % \begin{macrocode} - \glsxtrsubsequentfmt{\glslabel}{\glsinsert}% - }% - {% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% % \end{macrocode} -% Subsequent singular form, make first letter upper case: +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \Glsxtrsubsequentfmt{\glslabel}{\glsinsert}% - }% - {% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} -% Subsequent singular form, all caps: +% The full format displays the short form followed by the long form +% as a footnote. % \begin{macrocode} - \mfirstucMakeUppercase - {\glsxtrsubsequentfmt{\glslabel}{\glsinsert}}% - }% - }% - }% - {% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% % \end{macrocode} -% First use: +% The first use full form and the inline full form use the short +% (long) style. % \begin{macrocode} - \glsifplural - {% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% +} % \end{macrocode} -% First use plural form: +%\end{abbrvstyle} +%\begin{abbrvstyle}{short-footnote} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} - \glscapscase - {% +\letabbreviationstyle{short-footnote}{footnote} % \end{macrocode} -% First use plural form, don't adjust case: +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{postfootnote} +% Similar to the above but the footnote is placed afterwards, +% outside the link. This avoids nested links and can also move the +% footnote marker after any following punctuation mark. +% Pre v1.07 included \cs{footnote} in the first keys, which was +% incorrect as it caused duplicate footnotes. +%\changes{1.07}{2016-08-15}{removed \cs{footnote} from first keys} % \begin{macrocode} - \glsxtrfullplformat{\glslabel}{\glsinsert}% - }% - {% +\newabbreviationstyle{postfootnote}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\the\glslongtok},% + first={\protect\glsfirstabbrvfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}},% % \end{macrocode} -% First use plural form, make first letter upper case: +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} % \begin{macrocode} - \Glsxtrfullplformat{\glslabel}{\glsinsert}% - }% - {% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% % \end{macrocode} -% First use plural form, all caps: +% Make this category insert a footnote after the link if this was +% the first use, and +% unset the \catattr{regular} attribute if it has been set. +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % \begin{macrocode} - \mfirstucMakeUppercase - {\glsxtrfullplformat{\glslabel}{\glsinsert}}% - }% - }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse {% % \end{macrocode} -% First use singular form +% Needs the specific font command here as the style may have been +% lost by the time the footnote occurs. % \begin{macrocode} - \glscapscase - {% + \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% + {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% + }% + {}% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% % \end{macrocode} -% First use singular form, don't adjust case: +%\changes{1.02}{2016-04-25}{added redef of \cs{glsxtrsetupfulldefs}} +% The footnote needs to be suppressed in the inline form, so +% \cs{glsxtrfull} must set the first use switch off. % \begin{macrocode} - \glsxtrfullformat{\glslabel}{\glsinsert}% - }% - {% + \renewcommand*{\glsxtrsetupfulldefs}{% + \let\glsxtrifwasfirstuse\@secondoftwo + }% +}% +{% % \end{macrocode} -% First use singular form, make first letter upper case: +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \Glsxtrfullformat{\glslabel}{\glsinsert}% - }% - {% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} -% First use singular form, all caps: +% The full format displays the short form. The long form is +% deferred. % \begin{macrocode} - \mfirstucMakeUppercase - {\glsxtrfullformat{\glslabel}{\glsinsert}}% - }% - }% - }% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% - {% % \end{macrocode} -% User supplied text. +% The first use full form and the inline full form use the short +% (long) style. +%\changes{1.07}{2016-08-15}{switched from \cs{glsfirstlongfont} to +%\cs{glsfirstlongfootnotefont}} % \begin{macrocode} - \glscustomtext + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\glsxtrsubsequentfmt} -% Subsequent use format (singular no case change). -%\changes{1.17}{2017-08-09}{new} +%\begin{abbrvstyle}{short-postfootnote} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\glsaccessshort{#1}\ifglsxtrinsertinside #2\fi}% - \ifglsxtrinsertinside \else#2\fi -} -\let\glsxtrdefaultsubsequentfmt\glsxtrsubsequentfmt +\letabbreviationstyle{short-postfootnote}{postfootnote} % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\glsxtrsubsequentplfmt} -% Subsequent use format (plural no case change). -%\changes{1.17}{2017-08-09}{new} +%\begin{abbrvstyle}{short} +% Provide a style that only displays the short form on first use, +% but the short and long form can be displayed with the \qt{full} +% commands that use the inline format. If the user supplies a +% description, the long form won't be displayed in the predefined +% glossary styles, but the post description hook can be employed to +% automatically insert it. % \begin{macrocode} -\newcommand*{\glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\glsaccessshortpl{#1}\ifglsxtrinsertinside #2\fi}% - \ifglsxtrinsertinside \else#2\fi -} -\let\glsxtrdefaultsubsequentplfmt\glsxtrsubsequentplfmt +\newabbreviationstyle{short}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstabbrvfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}}, + text={\protect\glsabbrvfont{\the\glsshorttok}}, + plural={\protect\glsabbrvfont{\the\glsshortpltok}}, + description={\the\glslongtok}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% +}% +{% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrsubsequentfmt} -% Subsequent use format (singular, first letter uppercase). -%\changes{1.17}{2017-08-09}{new} +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} -\newcommand*{\Glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\Glsaccessshort{#1}\ifglsxtrinsertinside #2\fi}% - \ifglsxtrinsertinside \else#2\fi + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% +% \end{macrocode} +% The inline full form displays the short form followed by the +% long form in parentheses. +%\changes{0.2}{2015-11-30}{switched inline full form to short (long)} +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstabbrvfont{\glsaccessshort{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstabbrvfont{\glsaccessshortpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstabbrvfont{\glsaccessshort{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\Glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstabbrvfont{\glsaccessshortpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\Glsaccesslongpl{##1}}}% + }% +% \end{macrocode} +% The first use full form only displays the short form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% } -\let\Glsxtrdefaultsubsequentfmt\Glsxtrsubsequentfmt % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrsubsequentplfmt} -% Subsequent use format (plural, first letter uppercase). -%\changes{1.17}{2017-08-09}{new} +%\end{abbrvstyle} +% Set this as the default style for acronyms: % \begin{macrocode} -\newcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\Glsaccessshortpl{#1}\ifglsxtrinsertinside #2\fi}% - \ifglsxtrinsertinside \else#2\fi -} -\let\Glsxtrdefaultsubsequentplfmt\Glsxtrsubsequentplfmt +\setabbreviationstyle[acronym]{short} % \end{macrocode} -%\end{macro} % -%\subsection{Abbreviation Styles Setup} -% -%\begin{macro}{\setabbreviationstyle} -% \begin{macrocode} -\newcommand*{\setabbreviationstyle}[2][abbreviation]{% - \ifcsundef{@glsabbrv@dispstyle@setup@#2} - {% - \PackageError{glossaries-extra}{Undefined abbreviation style `#2'}{}% - }% - {% -% \end{macrocode} -% Have abbreviations already been defined for this category? -%\changes{0.5.2}{2015-12-08}{added check for post-definition style switch} +%\begin{abbrvstyle}{short-nolong} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} - \ifcsstring{@glsabbrv@current@#1}{#2}% - {% +\letabbreviationstyle{short-nolong}{short} % \end{macrocode} -% Style already set. +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{short-nolong-noreg} +%\changes{1.17}{2017-08-09}{new} +% Like \abbrstyle{short-nolong} but doesn't set the \catattr{regular} attribute. % \begin{macrocode} - }% - {% - \def\@glsxtr@dostylewarn{}% - \glsforeachincategory{#1}{\@gls@type}{\@gls@label}% - {% - \def\@glsxtr@dostylewarn{\GlossariesWarning{Abbreviation - style has been switched \MessageBreak - for category `#1', \MessageBreak - but there have already been entries \MessageBreak - defined for this category. Unwanted \MessageBreak - side-effects may result}}% - \@endfortrue - }% - \@glsxtr@dostylewarn +\newabbreviationstyle{short-nolong-noreg}% +{% + \GlsXtrUseAbbrStyleSetup{short-nolong}% % \end{macrocode} -% Set up the style for the given category. +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} - \csdef{@glsabbrv@current@#1}{#2}% - \glsxtr@applyabbrvstyle{#2}% - }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-nolong}% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\glsxtr@applyabbrvstyle} -% Apply the abbreviation style without existence check. -% \begin{macrocode} -\newcommand*{\glsxtr@applyabbrvstyle}[1]{% - \csuse{@glsabbrv@dispstyle@setup@#1}% - \csuse{@glsabbrv@dispstyle@fmts@#1}% -} -% \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtr@applyabbrvfmt} -% Only apply the style formats. +%\begin{macro}{\glsxtrshortdescname} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newcommand*{\glsxtr@applyabbrvfmt}[1]{% - \csuse{@glsabbrv@dispstyle@fmts@#1}% +\newcommand*{\glsxtrshortdescname}{% + \protect\glsabbrvfont{\the\glsshorttok}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\newabbreviationstyle} -% This is different from \cs{newacronymstyle}. The first argument is -% the label, the second argument sets the information required when -% defining the new abbreviation and the third argument sets the -% commands used to display the full format. -%\changes{1.04}{2016-05-02}{bug fix: corrected test for existence} +%\begin{abbrvstyle}{short-desc} +% The user must supply the description in this style. The long form +% is added to the name. The \abbrstyle{short} style (possibly with the +% post-description hooks set) might be a better option. +%\changes{1.01}{2016-02-02}{fixed typo in +%\cs{glsxtrinlinefullformat} and added missing second argument} % \begin{macrocode} -\newcommand*{\newabbreviationstyle}[3]{% - \ifcsdef{@glsabbrv@dispstyle@setup@#1} - {% - \PackageError{glossaries-extra}{Abbreviation style `#1' already - defined}{}% - }% - {% - \csdef{@glsabbrv@dispstyle@setup@#1}{% +\newabbreviationstyle{short-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrshortdescname}, + sort={\the\glsshorttok}, + first={\protect\glsfirstabbrvfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}}, + text={\protect\glsabbrvfont{\the\glsshorttok}}, + plural={\protect\glsabbrvfont{\the\glsshortpltok}}, + description={\the\glslongtok}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% +}% +{% % \end{macrocode} -% Initialise hook to do nothing. The style may change this. +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{}% - #2}% - \csdef{@glsabbrv@dispstyle@fmts@#1}{% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% Assume in-line form is the same as first use. The style may change -% this. +% The inline full form displays the short format followed by the +% long form in parentheses. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat}% - \renewcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat}% - \renewcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat}% - \renewcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + }% % \end{macrocode} -% Reset \cs{glsxtrsubsequentfmt} etc in case a style changes this. +% The first use full form only displays the short form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} - \let\glsxtrsubsequentfmt\glsxtrdefaultsubsequentfmt - \let\glsxtrsubsequentplfmt\glsxtrdefaultsubsequentplfmt - \let\Glsxtrsubsequentfmt\Glsxtrdefaultsubsequentfmt - \let\Glsxtrsubsequentplfmt\Glsxtrdefaultsubsequentplfmt - #3}% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\renewabbreviationstyle} +%\end{abbrvstyle} +%\begin{abbrvstyle}{short-nolong-desc} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\renewabbreviationstyle}[3]{% - \ifcsundef{@glsabbrv@dispstyle@setup@#1} - {% - \PackageError{glossaries-extra}{Abbreviation style `#1' not defined}{}% - }% - {% - \csdef{@glsabbrv@dispstyle@setup@#1}{% -% \end{macrocode} -% Initialise hook to do nothing. The style may change this. -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{}% - #2}% - \csdef{@glsabbrv@dispstyle@fmts@#1}{% -% \end{macrocode} -% Assume in-line form is the same as first use. The style may change -% this. -% \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}{\glsxtrfullformat}% - \renewcommand*{\Glsxtrinlinefullformat}{\Glsxtrfullformat}% - \renewcommand*{\glsxtrinlinefullplformat}{\glsxtrfullplformat}% - \renewcommand*{\Glsxtrinlinefullplformat}{\Glsxtrfullplformat}% - #3}% - }% -} +\letabbreviationstyle{short-nolong-desc}{short-desc} % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\letabbreviationstyle} -%\changes{1.04}{2016-05-02}{new} -% Define a synonym for an abbreviation style. The first argument is -% the new name. The second argument is the original style's name. +%\begin{abbrvstyle}{short-nolong-desc-noreg} +%\changes{1.17}{2017-08-09}{new} +% Like \abbrstyle{short-nolong-desc} but doesn't set the \catattr{regular} attribute. % \begin{macrocode} -\newcommand*{\letabbreviationstyle}[2]{% - \csletcs{@glsabbrv@dispstyle@setup@#1}{@glsabbrv@dispstyle@setup@#2}% - \csletcs{@glsabbrv@dispstyle@fmts@#1}{@glsabbrv@dispstyle@fmts@#2}% -} +\newabbreviationstyle{short-nolong-desc-noreg}% +{% + \GlsXtrUseAbbrStyleSetup{short-nolong-desc}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glsxtr@deprecated@abbrstyle} -%\changes{1.04}{2016-05-02}{new} -%\begin{definition} -%\cs{@glsxtr@deprecated@abbrstyle}\marg{old-name}\marg{new-name} -%\end{definition} -% Define a synonym for a deprecated abbreviation style. +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} -\newcommand*{\@glsxtr@deprecated@abbrstyle}[2]{% - \csdef{@glsabbrv@dispstyle@setup@#1}{% - \GlsXtrWarnDeprecatedAbbrStyle{#1}{#2}% - \csuse{@glsabbrv@dispstyle@setup@#2}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% - \csletcs{@glsabbrv@dispstyle@fmts@#1}{@glsabbrv@dispstyle@fmts@#2}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-nolong-desc}% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\GlsXtrWarnDeprecatedAbbrStyle} -%Generate warning for deprecated style use. -%\changes{1.04}{2016-05-02}{new} +%\begin{abbrvstyle}{nolong-short} +% Similar to \abbrstyle{short-nolong} but the full form shows the +% long form followed by the short form in parentheses. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\GlsXtrWarnDeprecatedAbbrStyle}[2]{% - \GlossariesExtraWarning{Deprecated abbreviation style name `#1', - use `#2' instead}% -} +\newabbreviationstyle{nolong-short}% +{% + \GlsXtrUseAbbrStyleSetup{short-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-nolong}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\GlsXtrUseAbbrStyleSetup} +% The inline full form displays the long form followed by the +% short form in parentheses. % \begin{macrocode} -\newcommand*{\GlsXtrUseAbbrStyleSetup}[1]{% - \ifcsundef{@glsabbrv@dispstyle@setup@#1}% - {% - \PackageError{glossaries-extra}% - {Unknown abbreviation style definitions `#1'}{}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% }% - {% - \csname @glsabbrv@dispstyle@setup@#1\endcsname + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% }% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\GlsXtrUseAbbrStyleFmts} -% \begin{macrocode} -\newcommand*{\GlsXtrUseAbbrStyleFmts}[1]{% - \ifcsundef{@glsabbrv@dispstyle@fmts@#1}% - {% - \PackageError{glossaries-extra}% - {Unknown abbreviation style formats `#1'}{}% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\Glsaccessshort{##1}}}% }% - {% - \csname @glsabbrv@dispstyle@fmts@#1\endcsname + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\Glsaccessshortpl{##1}}}% }% } % \end{macrocode} -%\end{macro} -% -%\subsection{Predefined Styles (Default Font)} -% Define some common styles. These will set the \gloskey{first}, -% \gloskey{firstplural}, \gloskey{text} and \gloskey{plural} -% keys, even if the \catattr{regular} attribute isn't set to -% \qt{true}. If this attribute is set, commands like \cs{gls} will -% use them as per a regular entry, otherwise those keys will be -% ignored unless explicitly invoked by the user with commands like -% \cs{glsfirst}. In order for the first letter uppercase versions to -% work correctly, \cs{glsxtrfullformat} needs to be expanded when -% those keys are set. The final optional argument of \cs{glsfirst} -% will behave differently to the final optional argument of \cs{gls} -% with some styles. -% -%\begin{macro}{\ifglsxtrinsertinside} -%\changes{1.02}{2016-04-25}{new} -% Switch to determine if the insert text should be inside or outside -% the font changing command. The default is outside. -% \begin{macrocode} -\newif\ifglsxtrinsertinside -\glsxtrinsertinsidefalse -% \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\changes{1.17}{2017-08-09}{removed some inconsistencies in the abbreviation -%styles} -%\begin{abbrvstyle}{long-short} +%\begin{abbrvstyle}{nolong-short-noreg} +%\changes{1.21}{2017-11-03}{new} +% Like \abbrstyle{nolong-short} but doesn't set the \catattr{regular} attribute. % \begin{macrocode} -\newabbreviationstyle{long-short}% +\newabbreviationstyle{nolong-short-noreg}% {% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}},% - description={\the\glslongtok}}% + \GlsXtrUseAbbrStyleSetup{nolong-short}% % \end{macrocode} -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% @@ -12268,96 +14296,184 @@ Dickimaw Books\\ {}% }% }% +{% + \GlsXtrUseAbbrStyleFmts{nolong-short}% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-desc} +% Provide a style that only displays the long form, +% but the long and short form can be displayed with the \qt{full} +% commands that use the inline format. The predefined glossary styles +% won't show the short form. The user must supply a description for +% this style. +% \begin{macrocode} +\newabbreviationstyle{long-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\protect\glslongfont{\the\glslongtok}}, + sort={\the\glslongtok}, + first={\protect\glsfirstlongfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongfont{\the\glslongpltok}}, + text={\glslongfont{\the\glslongtok}}, + plural={\glslongfont{\the\glslongpltok}}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% +}% {% % \end{macrocode} % In case the user wants to mix and match font styles, these are % redefined here. % \begin{macrocode} \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% The format for subsequent use (not used when the regular attribute +% is set). +% \begin{macrocode} + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glslongfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glslongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glslongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glslongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% +% \end{macrocode} +% The inline full form displays the long format followed by the +% short form in parentheses. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + }% +% \end{macrocode} +% The first use full form only displays the long form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% + \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -% -% Set this as the default style for general abbreviations: -% \begin{macrocode} -\setabbreviationstyle{long-short} -% \end{macrocode} -% -%\begin{macro}{\glsxtrlongshortdescsort} +%\begin{abbrvstyle}{long-noshort-desc} %\changes{1.04}{2016-05-02}{new} +%Provide a synonym that matches similar styles. % \begin{macrocode} -\newcommand*{\glsxtrlongshortdescsort}{% - \expandonce\glsxtrorglong\space (\expandonce\glsxtrorgshort)% -} +\letabbreviationstyle{long-noshort-desc}{long-desc} % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{macro}{\glsxtrlongshortdescname} +%\begin{abbrvstyle}{long-noshort-desc-noreg} %\changes{1.17}{2017-08-09}{new} +% Like long-noshort-desc but doesn't set the \catattr{regular} attribute. % \begin{macrocode} -\newcommand*{\glsxtrlongshortdescname}{% - \protect\glslongfont{\the\glslongtok} - \glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}% +\newabbreviationstyle{long-noshort-desc-noreg}% +{% + \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-noshort-desc}% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{abbrvstyle}{long-short-desc} -% User supplies description. The long form is included in the name. -%\changes{0.3}{2015-12-02}{fixed name to use \cs{glslabeltok}} +%\begin{abbrvstyle}{long} +% It doesn't really make a great deal of sense to have a long-only +% style that doesn't have a description (unless no glossary is +% required), but the best course of +% action here is to use the short form as the name and the long +% form as the description. % \begin{macrocode} -\newabbreviationstyle{long-short-desc}% +\newabbreviationstyle{long}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort},% - first={\protect\glsfirstlongfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlongfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongfont{\the\glslongpltok}}, + text={\glslongfont{\the\glslongtok}}, + plural={\glslongfont{\the\glslongpltok}},% + description={\the\glslongtok}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-desc}% +} % \end{macrocode} -%The \gloskey{text} key should only have the short form. -%\changes{1.07}{2016-08-15}{added missing text key} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-noshort} +%\changes{1.04}{2016-05-02}{new} +%Provide a synonym that matches similar styles. % \begin{macrocode} - text={\protect\glsabbrvfont{\the\glsshorttok}},% +\letabbreviationstyle{long-noshort}{long} % \end{macrocode} -%\changes{1.07}{2016-08-15}{fixed misspelling of \cs{glsabbrvfont}} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-noshort-noreg} +%\changes{1.17}{2017-08-09}{new} +% Like long-noshort but doesn't set the \catattr{regular} attribute. % \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}}% - }% +\newabbreviationstyle{long-noshort-noreg}% +{% + \GlsXtrUseAbbrStyleSetup{long-noshort}% % \end{macrocode} -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% @@ -12369,34 +14485,64 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-short}% + \GlsXtrUseAbbrStyleFmts{long-noshort}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-long} -% Short form followed by long form in parenthesis on first use. +%\subsection{Predefined Styles (Small Capitals)} +%These styles use \cs{textsc} for the short form. +%\begin{macro}{\glsxtrscfont} +%\changes{0.5}{2015-12-07}{new} +%Maintained for backward-compatibility. % \begin{macrocode} -\newabbreviationstyle{short-long}% +\newcommand*{\glsxtrscfont}[1]{\textsc{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsabbrvscfont} +%\changes{1.17}{2017-08-09}{new} +%Added for consistent naming. +% \begin{macrocode} +\newcommand*{\glsabbrvscfont}{\glsxtrscfont} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrfirstscfont} +%\changes{1.04}{2016-05-02}{new} +%Maintained for backward-compatibility. +% \begin{macrocode} +\newcommand*{\glsxtrfirstscfont}[1]{\glsabbrvscfont{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsfirstabbrvscfont} +%\changes{1.17}{2017-08-09}{new} +%Added for consistent naming. +% \begin{macrocode} +\newcommand*{\glsfirstabbrvscfont}{\glsxtrfirstscfont} +% \end{macrocode} +%\end{macro} +% and for the default short form suffix: +%\begin{macro}{\glsxtrscsuffix} +%\changes{0.5}{2015-12-07}{new} +% \begin{macrocode} +\newcommand*{\glsxtrscsuffix}{\glstextup{\glsxtrabbrvpluralsuffix}} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-short-sc} +% \begin{macrocode} +\newabbreviationstyle{long-short-sc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, + name={\protect\glsabbrvscfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvfont{\the\glsshorttok}% + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongfont{\the\glslongpltok}}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% -% \end{macrocode} -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} -% Unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} + \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshortpltok}}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}},% + description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -12407,12 +14553,14 @@ Dickimaw Books\\ }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. +% \begin{macrocode} + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% +% \end{macrocode} +% Use the default long fonts. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -12420,72 +14568,44 @@ Dickimaw Books\\ % this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% } % \end{macrocode} -%\end{abbrvstyle} -% -%\begin{macro}{\glsxtrshortlongdescsort} -%\changes{1.17}{2017-08-09}{new} -% \begin{macrocode} -\newcommand*{\glsxtrshortlongdescsort}{\the\glsshorttok} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrshortlongdescname} -%\changes{1.17}{2017-08-09}{new} -% \begin{macrocode} -\newcommand*{\glsxtrshortlongdescname}{% - \protect\glsabbrvfont{\the\glsshorttok} - \glsxtrparen{\protect\glslongfont{\the\glslongtok}}% -} -% \end{macrocode} -%\end{macro} % -%\begin{abbrvstyle}{short-long-desc} -% User supplies description. The long form is included in the name. -%\changes{0.3}{2015-12-02}{fixed name to use \cs{glslabeltok}} +%\begin{abbrvstyle}{long-short-sc-desc} % \begin{macrocode} -\newabbreviationstyle{short-long-desc}% +\newabbreviationstyle{long-short-sc-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname}, - sort={\glsxtrshortlongdescsort}, - first={\protect\glsfirstabbrvfont{\the\glsshorttok}% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort},% + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongfont{\the\glslongpltok}}},% -% \end{macrocode} -%\changes{1.07}{2016-08-15}{added text key} -% \begin{macrocode} - text={\protect\glsabbrvfont{\the\glsshorttok}},% -% \end{macrocode} -%\changes{1.07}{2016-08-15}{fixed misspelling of \cs{glsabbrvfont} in plural -%key} -% \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshortpltok}}},% + text={\protect\glsabbrvscfont{\the\glsshorttok}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}% }% % \end{macrocode} %\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} @@ -12500,72 +14620,32 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{short-long}% -} -% \end{macrocode} -%\end{abbrvstyle} -% -%\begin{macro}{\glsfirstlongfootnotefont} -%\changes{1.05}{2016-06-10}{new} -%Only used by the \qt{footnote} styles. -% \begin{macrocode} -\newcommand*{\glsfirstlongfootnotefont}[1]{\glslongfootnotefont{#1}}% -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glslongfootnotefont} -%\changes{1.05}{2016-06-10}{new} -%Only used by the \qt{footnote} styles. -% \begin{macrocode} -\newcommand*{\glslongfootnotefont}[1]{\glslongdefaultfont{#1}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrabbrvfootnote} -%\begin{definition} -%\cs{glsxtrabbrvfootnote}\marg{label}\marg{long} -%\end{definition} -%\changes{1.07}{2016-08-15}{new} -%Command used by footnote abbreviation styles. The default -%definition ignores the first argument. The second argument -%\meta{long} includes the font changing command and may be the -%singular or plural form, depending on the command that was used -%(for example, \cs{gls} or \cs{glspl}). +% As long-short-sc style: % \begin{macrocode} -\newcommand*{\glsxtrabbrvfootnote}[2]{\footnote{#2}} + \GlsXtrUseAbbrStyleFmts{long-short-sc}% +} % \end{macrocode} -%\end{macro} % -%\begin{abbrvstyle}{footnote} -% Short form followed by long form in footnote on first use. +% Now the short (long) version % \begin{macrocode} -\newabbreviationstyle{footnote}% +\newabbreviationstyle{short-sc-long}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, + name={\protect\glsabbrvscfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% % \end{macrocode} -%\changes{1.07}{2016-08-15}{changed first forms to use -%\cs{glsfirstlongfootnotefont}} -% \begin{macrocode} - first={\protect\glsfirstabbrvfont{\the\glsshorttok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% -% \end{macrocode} -% Switch off hyperlinks on first use to prevent nested hyperlinks, -% and unset the \catattr{regular} attribute if it has been set. -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% @@ -12575,462 +14655,404 @@ Dickimaw Books\\ }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The full format displays the short form followed by the long form -% as a footnote. +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% - }% -% \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. -% \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-footnote} -%\changes{1.04}{2016-05-02}{new} -% \begin{macrocode} -\letabbreviationstyle{short-footnote}{footnote} -% \end{macrocode} -%\end{abbrvstyle} % -%\begin{abbrvstyle}{postfootnote} -% Similar to the above but the footnote is placed afterwards, -% outside the link. This avoids nested links and can also move the -% footnote marker after any following punctuation mark. -% Pre v1.07 included \cs{footnote} in the first keys, which was -% incorrect as it caused duplicate footnotes. -%\changes{1.07}{2016-08-15}{removed \cs{footnote} from first keys} +% As before but user provides description % \begin{macrocode} -\newabbreviationstyle{postfootnote}% +\newabbreviationstyle{short-sc-long-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% + name={\glsxtrshortlongdescname}, + sort={\glsxtrshortlongdescsort}, + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% + text={\protect\glsabbrvscfont{\the\glsshorttok}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}% + }% % \end{macrocode} -% Make this category insert a footnote after the link if this was -% the first use, and -% unset the \catattr{regular} attribute if it has been set. -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% -% \end{macrocode} -% Needs the specific font command here as the style may have been -% lost by the time the footnote occurs. -% \begin{macrocode} - \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% - {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% - }% - {}% - }% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% }% {}% }% +}% +{% % \end{macrocode} -%\changes{1.02}{2016-04-25}{added redef of \cs{glsxtrsetupfulldefs}} -% The footnote needs to be suppressed in the inline form, so -% \cs{glsxtrfull} must set the first use switch off. +% As short-sc-long style: % \begin{macrocode} - \renewcommand*{\glsxtrsetupfulldefs}{% - \let\glsxtrifwasfirstuse\@secondoftwo - }% + \GlsXtrUseAbbrStyleFmts{short-sc-long}% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{short-sc} +% \begin{macrocode} +\newabbreviationstyle{short-sc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvscfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}}, + text={\protect\glsabbrvscfont{\the\glsshorttok}}, + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}, + description={\the\glslongtok}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The full format displays the short form. The long form is -% deferred. +% The inline full form displays the short form followed by the +% long form in parentheses. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstabbrvscfont{\glsaccessshort{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% + }% +% \end{macrocode} +%\changes{1.21}{2017-11-03}{corrected first letter uppercasing} +% \begin{macrocode} + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstabbrvscfont{\Glsaccessshort{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstabbrvscfont{\Glsaccessshortpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% + }% +% \end{macrocode} +% The first use full form only displays the short form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% -% \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. -%\changes{1.07}{2016-08-15}{switched from \cs{glsfirstlongfont} to -%\cs{glsfirstlongfootnotefont}} -% \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% - }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-postfootnote} +%\begin{abbrvstyle}{short-sc-nolong} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-postfootnote}{postfootnote} +\letabbreviationstyle{short-sc-nolong}{short-sc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short} -% Provide a style that only displays the short form on first use, -% but the short and long form can be displayed with the \qt{full} -% commands that use the inline format. If the user supplies a -% description, the long form won't be displayed in the predefined -% glossary styles, but the post description hook can be employed to -% automatically insert it. +%\begin{abbrvstyle}{short-sc-desc} % \begin{macrocode} -\newabbreviationstyle{short}% +\newabbreviationstyle{short-sc-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, + name={\glsxtrshortdescname}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}}, - text={\protect\glsabbrvfont{\the\glsshorttok}}, - plural={\protect\glsabbrvfont{\the\glsshortpltok}}, + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}}, + text={\protect\glsabbrvscfont{\the\glsshorttok}}, + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}, description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The inline full form displays the short form followed by the +% The inline full form displays the short format followed by the % long form in parentheses. -%\changes{0.2}{2015-11-30}{switched inline full form to short (long)} % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvfont{\glsaccessshort{##1}% - \ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvfont{\glsaccessshortpl{##1}% - \ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvfont{\glsaccessshort{##1}% - \ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvfont{\glsaccessshortpl{##1}% - \ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the short form, but it % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -% Set this as the default style for acronyms: -% \begin{macrocode} -\setabbreviationstyle[acronym]{short} -% \end{macrocode} -% -%\begin{abbrvstyle}{short-nolong} +%\begin{abbrvstyle}{short-sc-nolong-desc} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-nolong}{short} +\letabbreviationstyle{short-sc-nolong-desc}{short-sc-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-nolong-noreg} -%\changes{1.17}{2017-08-09}{new} -% Like \abbrstyle{short-nolong} but doesn't set the \catattr{regular} attribute. +%\begin{abbrvstyle}{nolong-short-sc} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newabbreviationstyle{short-nolong-noreg}% +\newabbreviationstyle{nolong-short-sc}% {% - \GlsXtrUseAbbrStyleSetup{short-nolong}% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% + \GlsXtrUseAbbrStyleSetup{short-sc-nolong}% }% {% - \GlsXtrUseAbbrStyleFmts{short-nolong}% -} + \GlsXtrUseAbbrStyleFmts{short-sc-nolong}% % \end{macrocode} -%\end{abbrvstyle} -% -% -%\begin{macro}{\glsxtrshortdescname} -%\changes{1.17}{2017-08-09}{new} +% The inline full form displays the long form followed by the +% short form in parentheses. % \begin{macrocode} -\newcommand*{\glsxtrshortdescname}{% - \protect\glsabbrvfont{\the\glsshorttok}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + }% } % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{abbrvstyle}{short-desc} -% The user must supply the description in this style. The long form -% is added to the name. The \abbrstyle{short} style (possibly with the -% post-description hooks set) might be a better option. -%\changes{1.01}{2016-02-02}{fixed typo in -%\cs{glsxtrinlinefullformat} and added missing second argument} +%\begin{abbrvstyle}{long-noshort-sc} +%\changes{1.04}{2016-05-02}{renamed from \qt{long-sc}} +% The smallcaps font will only be used if +% the short form is explicitly invoked through commands like +% \cs{glsxtrshort}. % \begin{macrocode} -\newabbreviationstyle{short-desc}% +\newabbreviationstyle{long-noshort-sc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortdescname}, + name={\protect\glsabbrvscfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}}, - text={\protect\glsabbrvfont{\the\glsshorttok}}, - plural={\protect\glsabbrvfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}}, + text={\protect\glslongdefaultfont{\the\glslongtok}}, + plural={\protect\glslongdefaultfont{\the\glslongpltok}},% + description={\the\glslongtok}% + }% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The inline full form displays the short format followed by the -% long form in parentheses. +% The format for subsequent use (not used when the regular attribute +% is set). +% \begin{macrocode} + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% +% \end{macrocode} +% The inline full form displays the long format followed by the +% short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslong{##1}}}% + \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% % \end{macrocode} -% The first use full form only displays the short form, but it +% The first use full form only displays the long form, but it % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-nolong-desc} -%\changes{1.04}{2016-05-02}{new} -% \begin{macrocode} -\letabbreviationstyle{short-nolong-desc}{short-desc} -% \end{macrocode} -%\end{abbrvstyle} -% -%\begin{abbrvstyle}{short-nolong-desc-noreg} -%\changes{1.17}{2017-08-09}{new} -% Like \abbrstyle{short-nolong-desc} but doesn't set the \catattr{regular} attribute. -% \begin{macrocode} -\newabbreviationstyle{short-nolong-desc-noreg}% -{% - \GlsXtrUseAbbrStyleSetup{short-nolong-desc}% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\begin{abbrvstyle}{long-sc} +%Backward compatibility: % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-nolong-desc}% -} +\@glsxtr@deprecated@abbrstyle{long-sc}{long-noshort-sc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-desc} -% Provide a style that only displays the long form, -% but the long and short form can be displayed with the \qt{full} -% commands that use the inline format. The predefined glossary styles -% won't show the short form. The user must supply a description for -% this style. +%\begin{abbrvstyle}{long-noshort-sc-desc} +%\changes{1.04}{2016-05-02}{renamed from \qt{long-desc-sc}} +% The smallcaps font will only be used if +% the short form is explicitly invoked through commands like +% \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{long-desc}% +\newabbreviationstyle{long-noshort-sc-desc}% {% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\protect\glslongfont{\the\glslongtok}}, - sort={\the\glslongtok}, - first={\protect\glsfirstlongfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongfont{\the\glslongpltok}}, - text={\glslongfont{\the\glslongtok}}, - plural={\glslongfont{\the\glslongpltok}}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% + \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% }% {% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13038,19 +15060,19 @@ Dickimaw Books\\ % is set). % \begin{macrocode} \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% \ifglsxtrinsertinside \else##2\fi }% \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% \ifglsxtrinsertinside \else##2\fi }% \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% \ifglsxtrinsertinside \else##2\fi }% \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% \ifglsxtrinsertinside \else##2\fi }% % \end{macrocode} @@ -13058,67 +15080,79 @@ Dickimaw Books\\ % short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the long form, but it % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-noshort-desc} -%\changes{1.04}{2016-05-02}{new} -%Provide a synonym that matches similar styles. +%\begin{abbrvstyle}{long-desc-sc} +%Backward compatibility: % \begin{macrocode} -\letabbreviationstyle{long-noshort-desc}{long-desc} +\@glsxtr@deprecated@abbrstyle{long-desc-sc}{long-noshort-sc-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-desc-noreg} -%\changes{1.17}{2017-08-09}{new} -% Like long-noshort-desc but doesn't set the \catattr{regular} attribute. +%\begin{abbrvstyle}{short-sc-footnote} +%\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2016-05-02}{renamed from \qt{footnote-sc}} % \begin{macrocode} -\newabbreviationstyle{long-noshort-desc-noreg}% +\newabbreviationstyle{short-sc-footnote}% {% - \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvscfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\the\glslongtok},% + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +% Switch off hyperlinks on first use to prevent nested hyperlinks, +% and unset the \catattr{regular} attribute if it has been set. +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% @@ -13127,122 +15161,238 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-noshort-desc}% -} % \end{macrocode} -%\end{abbrvstyle} -% -%\begin{abbrvstyle}{long} -% It doesn't really make a great deal of sense to have a long-only -% style that doesn't have a description (unless no glossary is -% required), but the best course of -% action here is to use the short form as the name and the long -% form as the description. +% Use smallcaps and adjust the plural suffix to revert to upright. % \begin{macrocode} -\newabbreviationstyle{long}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongfont{\the\glslongpltok}}, - text={\glslongfont{\the\glslongtok}}, - plural={\glslongfont{\the\glslongpltok}},% - description={\the\glslongtok}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% +% \end{macrocode} +% The full format displays the short form followed by the long form +% as a footnote. +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% +% \end{macrocode} +% The first use full form and the inline full form use the short +% (long) style. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-desc}% } % \end{macrocode} %\end{abbrvstyle} -% -%\begin{abbrvstyle}{long-noshort} -%\changes{1.04}{2016-05-02}{new} -%Provide a synonym that matches similar styles. +%\begin{abbrvstyle}{footnote-sc} +%Backward compatibility: % \begin{macrocode} -\letabbreviationstyle{long-noshort}{long} +\@glsxtr@deprecated@abbrstyle{footnote-sc}{short-sc-footnote} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-noreg} -%\changes{1.17}{2017-08-09}{new} -% Like long-noshort but doesn't set the \catattr{regular} attribute. +%\begin{abbrvstyle}{short-sc-postfootnote} +%\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-sc}} % \begin{macrocode} -\newabbreviationstyle{long-noshort-noreg}% +\newabbreviationstyle{short-sc-postfootnote}% {% - \GlsXtrUseAbbrStyleSetup{long-noshort}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvscfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\the\glslongtok},% + first={\protect\glsfirstabbrvscfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}},% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +% Make this category insert a footnote after the link if this was +% the first use, and +% unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% +% \end{macrocode} +% Needs the specific font command here as the style may have been +% lost by the time the footnote occurs. +% \begin{macrocode} + \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% + {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% + }% + {}% + }% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% }% {}% }% +% \end{macrocode} +% The footnote needs to be suppressed in the inline form, so +% \cs{glsxtrfull} must set the first use switch off. +% \begin{macrocode} + \renewcommand*{\glsxtrsetupfulldefs}{% + \let\glsxtrifwasfirstuse\@secondoftwo + }% }% {% - \GlsXtrUseAbbrStyleFmts{long-noshort}% +% \end{macrocode} +% Use smallcaps and adjust the plural suffix to revert to upright. +% \begin{macrocode} + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% +% \end{macrocode} +% The full format displays the short form. The long form is +% deferred. +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% +% \end{macrocode} +% The first use full form and the inline full form use the short +% (long) style. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% } % \end{macrocode} %\end{abbrvstyle} +%\begin{abbrvstyle}{postfootnote-sc} +%Backward compatibility: +% \begin{macrocode} +\@glsxtr@deprecated@abbrstyle{postfootnote-sc}{short-sc-postfootnote} +% \end{macrocode} +%\end{abbrvstyle} % -%\subsection{Predefined Styles (Small Capitals)} -%These styles use \cs{textsc} for the short form. -%\begin{macro}{\glsxtrscfont} +%\subsection{Predefined Styles (Fake Small Capitals)} +% These styles require the \sty{relsize} package, which must be +% loaded by the user. These styles all use: +%\begin{macro}{\glsxtrsmfont} %\changes{0.5}{2015-12-07}{new} -%Maintained for backward-compatibility. +%Maintained for backward compatibility. % \begin{macrocode} -\newcommand*{\glsxtrscfont}[1]{\textsc{#1}} +\newcommand*{\glsxtrsmfont}[1]{\textsmaller{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsabbrvscfont} +%\begin{macro}{\glsabbrvsmfont} %\changes{1.17}{2017-08-09}{new} %Added for consistent naming. % \begin{macrocode} -\newcommand*{\glsabbrvscfont}{\glsxtrscfont} +\newcommand*{\glsabbrvsmfont}{\glsxtrsmfont} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsxtrfirstscfont} +%\begin{macro}{\glsxtrfirstsmfont} %\changes{1.04}{2016-05-02}{new} -%Maintained for backward-compatibility. +%Maintained for backward compatibility. % \begin{macrocode} -\newcommand*{\glsxtrfirstscfont}[1]{\glsabbrvscfont{#1}} +\newcommand*{\glsxtrfirstsmfont}[1]{\glsabbrvsmfont{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstabbrvscfont} +%\begin{macro}{\glsfirstabbrvsmfont} %\changes{1.17}{2017-08-09}{new} %Added for consistent naming. % \begin{macrocode} -\newcommand*{\glsfirstabbrvscfont}{\glsxtrfirstscfont} +\newcommand*{\glsfirstabbrvsmfont}{\glsxtrfirstsmfont} % \end{macrocode} %\end{macro} % and for the default short form suffix: -%\begin{macro}{\glsxtrscsuffix} +%\begin{macro}{\glsxtrsmsuffix} %\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsxtrscsuffix}{\glstextup{\glsxtrabbrvpluralsuffix}} +\newcommand*{\glsxtrsmsuffix}{\glsxtrabbrvpluralsuffix} % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-short-sc} +%\begin{abbrvstyle}{long-short-sm} +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{long-short-sc}% +\newabbreviationstyle{long-short-sm}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshorttok}}},% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshorttok}}},% firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshortpltok}}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}},% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}},% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}},% description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glshasattribute{\the\glslabeltok}{regular}% @@ -13253,12 +15403,9 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% % \end{macrocode} % Use the default long fonts. % \begin{macrocode} @@ -13272,44 +15419,45 @@ Dickimaw Books\\ \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% } % \end{macrocode} +%\end{abbrvstyle} % -%\begin{abbrvstyle}{long-short-sc-desc} +%\begin{abbrvstyle}{long-short-sm-desc} +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{long-short-sc-desc}% +\newabbreviationstyle{long-short-sm-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrlongshortdescname}, sort={\glsxtrlongshortdescsort},% first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshorttok}}},% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshorttok}}},% firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\the\glsshortpltok}}},% - text={\protect\glsabbrvscfont{\the\glsshorttok}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}},% + text={\protect\glsabbrvsmfont{\the\glsshorttok}},% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}% }% % \end{macrocode} -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% @@ -13322,27 +15470,30 @@ Dickimaw Books\\ }% {% % \end{macrocode} -% As long-short-sc style: +% As long-short-sm style: % \begin{macrocode} - \GlsXtrUseAbbrStyleFmts{long-short-sc}% + \GlsXtrUseAbbrStyleFmts{long-short-sm}% } % \end{macrocode} +%\end{abbrvstyle} % +%\begin{abbrvstyle}{short-sm-long} % Now the short (long) version +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sc-long}% +\newabbreviationstyle{short-sm-long}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -13355,12 +15506,9 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13368,24 +15516,24 @@ Dickimaw Books\\ % this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% @@ -13393,21 +15541,23 @@ Dickimaw Books\\ % \end{macrocode} %\end{abbrvstyle} % +%\begin{abbrvstyle}{short-sm-long-desc} % As before but user provides description +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sc-long-desc}% +\newabbreviationstyle{short-sm-long-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrshortlongdescname}, sort={\glsxtrshortlongdescsort}, - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% - text={\protect\glsabbrvscfont{\the\glsshorttok}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}% + text={\protect\glsabbrvsmfont{\the\glsshorttok}},% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}% }% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. @@ -13422,35 +15572,33 @@ Dickimaw Books\\ }% {% % \end{macrocode} -% As short-sc-long style: +% As short-sm-long style: % \begin{macrocode} - \GlsXtrUseAbbrStyleFmts{short-sc-long}% + \GlsXtrUseAbbrStyleFmts{short-sm-long}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sc} +%\begin{abbrvstyle}{short-sm} +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sc}% +\newabbreviationstyle{short-sm}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}}, - text={\protect\glsabbrvscfont{\the\glsshorttok}}, - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}, + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}, + text={\protect\glsabbrvsmfont{\the\glsshorttok}}, + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}, description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13458,82 +15606,83 @@ Dickimaw Books\\ % long form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvsmfont{\glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% +% \end{macrocode} +%\changes{1.21}{2017-11-03}{corrected first letter uppercasing} +% \begin{macrocode} \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvsmfont{\Glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvsmfont{\Glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the short form, but it % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sc-nolong} +%\begin{abbrvstyle}{short-sm-nolong} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-sc-nolong}{short-sc} +\letabbreviationstyle{short-sm-nolong}{short-sm} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sc-desc} +%\begin{abbrvstyle}{short-sm-desc} +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sc-desc}% +\newabbreviationstyle{short-sm-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrshortdescname}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}}, - text={\protect\glsabbrvscfont{\the\glsshorttok}}, - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}, + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}, + text={\protect\glsabbrvsmfont{\the\glsshorttok}}, + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}, description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13541,22 +15690,22 @@ Dickimaw Books\\ % long form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% @@ -13565,41 +15714,83 @@ Dickimaw Books\\ % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-sc-nolong-desc} +%\begin{abbrvstyle}{short-sm-nolong-desc} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-sc-nolong-desc}{short-sc-desc} +\letabbreviationstyle{short-sm-nolong-desc}{short-sm-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-sc} -%\changes{1.04}{2016-05-02}{renamed from \qt{long-sc}} +%\begin{abbrvstyle}{nolong-short-sm} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newabbreviationstyle{nolong-short-sm}% +{% + \GlsXtrUseAbbrStyleSetup{short-sm-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-sm-nolong}% +% \end{macrocode} +% The inline full form displays the long form followed by the +% short form in parentheses. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + }% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-noshort-sm} +%\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2016-05-02}{renamed from \qt{long-sm}} % The smallcaps font will only be used if % the short form is explicitly invoked through commands like -% \cs{glsxtrshort}. +% \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{long-noshort-sc}% +\newabbreviationstyle{long-noshort-sm}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, first={\protect\glsfirstlongdefaultfont{\the\glslongtok}}, firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}}, @@ -13611,12 +15802,9 @@ Dickimaw Books\\ \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13646,22 +15834,22 @@ Dickimaw Books\\ \renewcommand*{\glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the long form, but it @@ -13686,30 +15874,28 @@ Dickimaw Books\\ } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-sc} +%\begin{abbrvstyle}{long-sm} %Backward compatibility: % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-sc}{long-noshort-sc} +\@glsxtr@deprecated@abbrstyle{long-sm}{long-noshort-sm} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-sc-desc} -%\changes{1.04}{2016-05-02}{renamed from \qt{long-desc-sc}} -% The smallcaps font will only be used if +%\begin{abbrvstyle}{long-noshort-sm-desc} +%\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2016-05-02}{renamed from \cs{long-desc-sm}} +% The smaller font will only be used if % the short form is explicitly invoked through commands like % \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{long-noshort-sc-desc}% +\newabbreviationstyle{long-noshort-sm-desc}% {% \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -13739,22 +15925,22 @@ Dickimaw Books\\ \renewcommand*{\glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the long form, but it @@ -13779,30 +15965,30 @@ Dickimaw Books\\ } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-desc-sc} +%\begin{abbrvstyle}{long-desc-sm} %Backward compatibility: % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-desc-sc}{long-noshort-sc-desc} +\@glsxtr@deprecated@abbrstyle{long-desc-sm}{long-noshort-sm-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sc-footnote} +%\begin{abbrvstyle}{short-sm-footnote} %\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{footnote-sc}} +%\changes{1.04}{2016-05-02}{renamed from \qt{footnote-sm}} % \begin{macrocode} -\newabbreviationstyle{short-sc-footnote}% +\newabbreviationstyle{short-sm-footnote}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}% + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% \protect\glsxtrabbrvfootnote{\the\glslabeltok}% {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}% + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% \protect\glsxtrabbrvfootnote{\the\glslabeltok}% {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% % \end{macrocode} % Switch off hyperlinks on first use to prevent nested hyperlinks, % and unset the \catattr{regular} attribute if it has been set. @@ -13818,12 +16004,9 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} @@ -13831,25 +16014,25 @@ Dickimaw Books\\ % as a footnote. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \protect\glsxtrabbrvfootnote{##1}% {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \protect\glsxtrabbrvfootnote{##1}% {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \protect\glsxtrabbrvfootnote{##1}% {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \protect\glsxtrabbrvfootnote{##1}% {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% @@ -13859,48 +16042,48 @@ Dickimaw Books\\ % (long) style. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{footnote-sc} +%\begin{abbrvstyle}{footnote-sm} %Backward compatibility: % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{footnote-sc}{short-sc-footnote} +\@glsxtr@deprecated@abbrstyle{footnote-sm}{short-sm-footnote} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sc-postfootnote} +%\begin{abbrvstyle}{short-sm-postfootnote} %\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-sc}} +%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-sm}} % \begin{macrocode} -\newabbreviationstyle{short-sc-postfootnote}% +\newabbreviationstyle{short-sm-postfootnote}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvscfont{\the\glsshorttok}}, + name={\protect\glsabbrvsmfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% - first={\protect\glsfirstabbrvscfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}},% - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% + first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}},% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% % \end{macrocode} % Make this category insert a footnote after the link if this was % the first use, and @@ -13934,12 +16117,9 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% Use smallcaps and adjust the plural suffix to revert to upright. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvscfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvscfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} @@ -13947,19 +16127,19 @@ Dickimaw Books\\ % deferred. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% % \end{macrocode} @@ -13967,90 +16147,198 @@ Dickimaw Books\\ % (long) style. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvscfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{postfootnote-sc} +%\begin{abbrvstyle}{postfootnote-sm} %Backward compatibility: % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{postfootnote-sc}{short-sc-postfootnote} +\@glsxtr@deprecated@abbrstyle{postfootnote-sm}{short-sm-postfootnote} % \end{macrocode} %\end{abbrvstyle} % -%\subsection{Predefined Styles (Fake Small Capitals)} -% These styles require the \sty{relsize} package, which must be -% loaded by the user. These styles all use: -%\begin{macro}{\glsxtrsmfont} -%\changes{0.5}{2015-12-07}{new} -%Maintained for backward compatibility. +%\subsection{Predefined Styles (Emphasized)} +% These styles use \ics{emph} for the short form. +%\begin{macro}{\glsabbrvemfont} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\glsxtrsmfont}[1]{\textsmaller{#1}} +\newcommand*{\glsabbrvemfont}[1]{\emph{#1}}% % \end{macrocode} %\end{macro} -%\begin{macro}{\glsabbrvsmfont} -%\changes{1.17}{2017-08-09}{new} -%Added for consistent naming. +%\begin{macro}{\glsfirstabbrvemfont} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newcommand*{\glsabbrvsmfont}{\glsxtrsmfont} +\newcommand*{\glsfirstabbrvemfont}[1]{\glsabbrvemfont{#1}}% % \end{macrocode} %\end{macro} -%\begin{macro}{\glsxtrfirstsmfont} +% The default short form suffix: +%\begin{macro}{\glsxtremsuffix} +%\changes{0.5}{2015-12-07}{new} +% \begin{macrocode} +\newcommand*{\glsxtremsuffix}{\glsxtrabbrvpluralsuffix} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsfirstlongemfont} %\changes{1.04}{2016-05-02}{new} -%Maintained for backward compatibility. +%Only used by the \qt{long-em} styles. % \begin{macrocode} -\newcommand*{\glsxtrfirstsmfont}[1]{\glsabbrvsmfont{#1}} +\newcommand*{\glsfirstlongemfont}[1]{\glslongemfont{#1}}% % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstabbrvsmfont} -%\changes{1.17}{2017-08-09}{new} -%Added for consistent naming. +% +%\begin{macro}{\glslongemfont} +%\changes{1.04}{2016-05-02}{new} +%Only used by the \qt{long-em} styles. % \begin{macrocode} -\newcommand*{\glsfirstabbrvsmfont}{\glsxtrfirstsmfont} +\newcommand*{\glslongemfont}[1]{\emph{#1}}% % \end{macrocode} %\end{macro} -% and for the default short form suffix: -%\begin{macro}{\glsxtrsmsuffix} +% +%\begin{abbrvstyle}{long-short-em} %\changes{0.5}{2015-12-07}{new} +% The long form is just set in the default long font. % \begin{macrocode} -\newcommand*{\glsxtrsmsuffix}{\glsxtrabbrvpluralsuffix} +\newabbreviationstyle{long-short-em}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvemfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}},% + description={\the\glslongtok}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% +% \end{macrocode} +% Use the default long fonts. +% \begin{macrocode} + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% +% \end{macrocode} +% The first use full form and the inline full form are the same for +% this style. +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-short-em-desc} +%\changes{0.5}{2015-12-07}{new} +% \begin{macrocode} +\newabbreviationstyle{long-short-em-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort},% + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% + text={\protect\glsabbrvemfont{\the\glsshorttok}},% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% + }% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% +% \end{macrocode} +% As long-short-em style: +% \begin{macrocode} + \GlsXtrUseAbbrStyleFmts{long-short-em}% +} % \end{macrocode} -%\end{macro} +%\end{abbrvstyle} % -%\begin{abbrvstyle}{long-short-sm} -%\changes{0.5}{2015-12-07}{new} +%\begin{abbrvstyle}{long-em-short-em} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newabbreviationstyle{long-short-sm}% +\newabbreviationstyle{long-em-short-em}% {% +% \end{macrocode} +%\cs{glslongemfont} is used in the description since \cs{glsdesc} +%doesn't set the style. +% \begin{macrocode} \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, + name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% + first={\protect\glsfirstlongemfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}},% - description={\the\glslongtok}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvemfont{\the\glsshortpltok}},% + description={\protect\glslongemfont{\the\glslongtok}}}% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -14060,59 +16348,56 @@ Dickimaw Books\\ }% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% -% \end{macrocode} -% Use the default long fonts. -% \begin{macrocode} - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% % \end{macrocode} % The first use full form and the inline full form are the same for % this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-short-sm-desc} -%\changes{0.5}{2015-12-07}{new} +%\begin{abbrvstyle}{long-em-short-em-desc} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newabbreviationstyle{long-short-sm-desc}% +\newabbreviationstyle{long-em-short-em-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrlongshortdescname}, sort={\glsxtrlongshortdescsort},% - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% + first={\protect\glsfirstlongemfont{\the\glslongtok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}},% - text={\protect\glsabbrvsmfont{\the\glsshorttok}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% + text={\protect\glsabbrvemfont{\the\glsshorttok}},% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% }% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. @@ -14126,31 +16411,28 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% As long-short-sm style: -% \begin{macrocode} - \GlsXtrUseAbbrStyleFmts{long-short-sm}% + \GlsXtrUseAbbrStyleFmts{long-em-short-em}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm-long} +%\begin{abbrvstyle}{short-em-long} % Now the short (long) version %\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sm-long}% +\newabbreviationstyle{short-em-long}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, + name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -14163,9 +16445,13 @@ Dickimaw Books\\ }% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% +% \end{macrocode} +% Mostly as short-long style: +%\changes{1.05}{2016-06-10}{fixed incorrect font used by long form} +% \begin{macrocode} + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvemfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -14173,24 +16459,24 @@ Dickimaw Books\\ % this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi \glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% @@ -14198,24 +16484,64 @@ Dickimaw Books\\ % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm-long-desc} +%\begin{abbrvstyle}{short-em-long-desc} % As before but user provides description %\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sm-long-desc}% +\newabbreviationstyle{short-em-long-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrshortlongdescname}, sort={\glsxtrshortlongdescsort}, - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% - text={\protect\glsabbrvsmfont{\the\glsshorttok}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}% + text={\protect\glsabbrvemfont{\the\glsshorttok}},% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% + }% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-em-long}% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{short-em-long-em} +%\changes{1.04}{2016-05-02}{new} +% \begin{macrocode} +\newabbreviationstyle{short-em-long-em}% +{% +% \end{macrocode} +%\cs{glslongemfont} is used in the description since \cs{glsdesc} +%doesn't set the style. +% \begin{macrocode} + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvemfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\protect\glslongemfont{\the\glslongtok}},% + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongpltok}}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -14228,34 +16554,95 @@ Dickimaw Books\\ }% }% {% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% % \end{macrocode} -% As short-sm-long style: +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} - \GlsXtrUseAbbrStyleFmts{short-sm-long}% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongemfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongemfont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongemfont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongemfont{\glsaccesslongpl{##1}}}% + }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm} +%\begin{abbrvstyle}{short-em-long-em-desc} +%\changes{1.04}{2016-05-02}{new} +% \begin{macrocode} +\newabbreviationstyle{short-em-long-em-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrshortlongdescname},% + sort={\glsxtrshortlongdescsort},% + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongpltok}}},% + text={\protect\glsabbrvemfont{\the\glsshorttok}},% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% + }% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-em-long-em}% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{short-em} %\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sm}% +\newabbreviationstyle{short-em}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, + name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}, - text={\protect\glsabbrvsmfont{\the\glsshorttok}}, - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}, + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}}, + text={\protect\glsabbrvemfont{\the\glsshorttok}}, + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}, description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -14263,79 +16650,83 @@ Dickimaw Books\\ % long form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvemfont{\glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% +% \end{macrocode} +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvemfont{\Glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvemfont{\Glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the short form, but it % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-sm-nolong} +% +%\begin{abbrvstyle}{short-em-nolong} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-sm-nolong}{short-sm} +\letabbreviationstyle{short-em-nolong}{short-em} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm-desc} +%\begin{abbrvstyle}{short-em-desc} %\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{short-sm-desc}% +\newabbreviationstyle{short-em-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\glsxtrshortdescname}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}, - text={\protect\glsabbrvsmfont{\the\glsshorttok}}, - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}, + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}}, + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}}, + text={\protect\glsabbrvemfont{\the\glsshorttok}}, + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}, description={\the\glslongtok}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -14343,22 +16734,22 @@ Dickimaw Books\\ % long form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% @@ -14367,147 +16758,96 @@ Dickimaw Books\\ % typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-sm-nolong-desc} +%\begin{abbrvstyle}{short-em-nolong-desc} %\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\letabbreviationstyle{short-sm-nolong-desc}{short-sm-desc} +\letabbreviationstyle{short-em-nolong-desc}{short-em-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-sm} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{long-sm}} -% The smallcaps font will only be used if -% the short form is explicitly invoked through commands like -% \cs{glsshort}. +%\begin{abbrvstyle}{nolong-short-em} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newabbreviationstyle{long-noshort-sm}% +\newabbreviationstyle{nolong-short-em}% {% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}}, - text={\protect\glslongdefaultfont{\the\glslongtok}}, - plural={\protect\glslongdefaultfont{\the\glslongpltok}},% - description={\the\glslongtok}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% + \GlsXtrUseAbbrStyleSetup{short-em-nolong}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% -% \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). -% \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% + \GlsXtrUseAbbrStyleFmts{short-em-nolong}% % \end{macrocode} -% The inline full form displays the long format followed by the +% The inline full form displays the long form followed by the % short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% - }% -% \end{macrocode} -% The first use full form only displays the long form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. -% \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-sm} -%Backward compatibility: -% \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-sm}{long-noshort-sm} -% \end{macrocode} -%\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-sm-desc} +%\begin{abbrvstyle}{long-noshort-em} %\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \cs{long-desc-sm}} -% The smaller font will only be used if -% the short form is explicitly invoked through commands like +%\changes{1.04}{2016-05-02}{renamed from \qt{long-em}} +% The short form is explicitly invoked through commands like % \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{long-noshort-sm-desc}% +\newabbreviationstyle{long-noshort-em}% {% - \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvemfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlongdefaultfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}}, + text={\protect\glslongdefaultfont{\the\glslongtok}}, + plural={\protect\glslongdefaultfont{\the\glslongpltok}},% + description={\the\glslongtok}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} @@ -14537,22 +16877,22 @@ Dickimaw Books\\ \renewcommand*{\glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% % \end{macrocode} % The first use full form only displays the long form, but it @@ -14577,440 +16917,320 @@ Dickimaw Books\\ } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-desc-sm} +%\begin{abbrvstyle}{long-em} %Backward compatibility: % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-desc-sm}{long-noshort-sm-desc} +\@glsxtr@deprecated@abbrstyle{long-em}{long-noshort-em} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm-footnote} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{footnote-sm}} +%\begin{abbrvstyle}{long-em-noshort-em} +%\changes{1.04}{2016-05-02}{new} +% The short form is explicitly invoked through commands like +% \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{short-sm-footnote}% +\newabbreviationstyle{long-em-noshort-em}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, + name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% -% \end{macrocode} -% Switch off hyperlinks on first use to prevent nested hyperlinks, -% and unset the \catattr{regular} attribute if it has been set. -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% + first={\protect\glsfirstlongemfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}}, + text={\protect\glslongemfont{\the\glslongtok}}, + plural={\protect\glslongemfont{\the\glslongpltok}},% + description={\protect\glslongemfont{\the\glslongtok}}% }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% % \end{macrocode} -% The full format displays the short form followed by the long form -% as a footnote. +% The format for subsequent use (not used when the regular attribute +% is set). % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glslongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glslongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glslongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glslongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% % \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. +% The inline full form displays the long format followed by the +% short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% -} % \end{macrocode} -%\end{abbrvstyle} -%\begin{abbrvstyle}{footnote-sm} -%Backward compatibility: +% The first use full form only displays the long form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{footnote-sm}{short-sm-footnote} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% +} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-sm-postfootnote} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-sm}} +%\begin{abbrvstyle}{long-em-noshort-em-noreg} +%\changes{1.17}{2017-08-09}{new} +% Like long-em-noshort-em but doesn't set the \catattr{regular} attribute. % \begin{macrocode} -\newabbreviationstyle{short-sm-postfootnote}% +\newabbreviationstyle{long-em-noshort-em-noreg}% {% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvsmfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}},% - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% + \GlsXtrUseAbbrStyleSetup{long-em-noshort-em}% % \end{macrocode} -% Make this category insert a footnote after the link if this was -% the first use, and -% unset the \catattr{regular} attribute if it has been set. +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% -% \end{macrocode} -% Needs the specific font command here as the style may have been -% lost by the time the footnote occurs. -% \begin{macrocode} - \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% - {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% - }% - {}% - }% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% }% {}% }% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-em-noshort-em}% +} % \end{macrocode} -% The footnote needs to be suppressed in the inline form, so -% \cs{glsxtrfull} must set the first use switch off. +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-noshort-em-desc} +%\changes{1.04}{2016-05-02}{renamed from \qt{long-desc-em}} +%\changes{0.5}{2015-12-07}{new} +% The emphasized font will only be used if +% the short form is explicitly invoked through commands like +% \cs{glsshort}. % \begin{macrocode} - \renewcommand*{\glsxtrsetupfulldefs}{% - \let\glsxtrifwasfirstuse\@secondoftwo - }% +\newabbreviationstyle{long-noshort-em-desc}% +{% + \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% }% {% - \renewcommand*\glsabbrvfont[1]{\glsabbrvsmfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvsmfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrsmsuffix}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The full format displays the short form. The long form is -% deferred. +% The format for subsequent use (not used when the regular attribute +% is set). % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi }% % \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. +% The inline full form displays the long format followed by the +% short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvsmfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% - }% -} -% \end{macrocode} -%\end{abbrvstyle} -%\begin{abbrvstyle}{postfootnote-sm} -%Backward compatibility: -% \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{postfootnote-sm}{short-sm-postfootnote} -% \end{macrocode} -%\end{abbrvstyle} -% -%\subsection{Predefined Styles (Emphasized)} -% These styles use \ics{emph} for the short form. -%\begin{macro}{\glsabbrvemfont} -%\changes{1.04}{2016-05-02}{new} -% \begin{macrocode} -\newcommand*{\glsabbrvemfont}[1]{\emph{#1}}% -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsfirstabbrvemfont} -%\changes{1.04}{2016-05-02}{new} -% \begin{macrocode} -\newcommand*{\glsfirstabbrvemfont}[1]{\glsabbrvemfont{#1}}% -% \end{macrocode} -%\end{macro} -% The default short form suffix: -%\begin{macro}{\glsxtremsuffix} -%\changes{0.5}{2015-12-07}{new} -% \begin{macrocode} -\newcommand*{\glsxtremsuffix}{\glsxtrabbrvpluralsuffix} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsfirstlongemfont} -%\changes{1.04}{2016-05-02}{new} -%Only used by the \qt{long-em} styles. -% \begin{macrocode} -\newcommand*{\glsfirstlongemfont}[1]{\glslongemfont{#1}}% -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glslongemfont} -%\changes{1.04}{2016-05-02}{new} -%Only used by the \qt{long-em} styles. -% \begin{macrocode} -\newcommand*{\glslongemfont}[1]{\emph{#1}}% -% \end{macrocode} -%\end{macro} -% -%\begin{abbrvstyle}{long-short-em} -%\changes{0.5}{2015-12-07}{new} -% The long form is just set in the default long font. -% \begin{macrocode} -\newabbreviationstyle{long-short-em}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}},% - description={\the\glslongtok}}% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% -% \end{macrocode} -% Use the default long fonts. -% \begin{macrocode} - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% + \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% The first use full form only displays the long form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} -% -%\begin{abbrvstyle}{long-short-em-desc} -%\changes{0.5}{2015-12-07}{new} -% \begin{macrocode} -\newabbreviationstyle{long-short-em-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort},% - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% - text={\protect\glsabbrvemfont{\the\glsshorttok}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% - }% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% -% \end{macrocode} -% As long-short-em style: +%\begin{abbrvstyle}{long-desc-em} +%Backward compatibility: % \begin{macrocode} - \GlsXtrUseAbbrStyleFmts{long-short-em}% -} +\@glsxtr@deprecated@abbrstyle{long-desc-em}{long-noshort-em-desc} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-em-short-em} +%\begin{abbrvstyle}{long-em-noshort-em-desc} %\changes{1.04}{2016-05-02}{new} +% The short form is explicitly invoked through commands like +% \cs{glsshort}. The long form is emphasized. % \begin{macrocode} -\newabbreviationstyle{long-em-short-em}% +\newabbreviationstyle{long-em-noshort-em-desc}% {% -% \end{macrocode} -%\cs{glslongemfont} is used in the description since \cs{glsdesc} -%doesn't set the style. -% \begin{macrocode} \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongemfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvemfont{\the\glsshortpltok}},% - description={\protect\glslongemfont{\the\glslongtok}}}% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% + name={\protect\protect\glslongemfont{\the\glslongtok}}, + sort={\the\glslongtok}, + first={\protect\glsfirstlongemfont{\the\glslongtok}}, + firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}}, + text={\glslongemfont{\the\glslongtok}}, + plural={\glslongemfont{\the\glslongpltok}}% }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% The format for subsequent use (not used when the regular attribute +% is set). +% \begin{macrocode} + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glslongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glslongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glslongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glslongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% + \ifglsxtrinsertinside \else##2\fi + }% +% \end{macrocode} +% The inline full form displays the long format followed by the +% short form in parentheses. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% +% \end{macrocode} +% The first use full form only displays the long form, but it +% typically won't be used as the \catattr{regular} attribute is set by this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-em-short-em-desc} -%\changes{1.04}{2016-05-02}{new} +%\begin{abbrvstyle}{long-em-noshort-em-desc-noreg} +%\changes{1.17}{2017-08-09}{new} +% Like long-em-noshort-em-desc but doesn't set the \catattr{regular} attribute. % \begin{macrocode} -\newabbreviationstyle{long-em-short-em-desc}% +\newabbreviationstyle{long-em-noshort-em-desc-noreg}% {% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort},% - first={\protect\glsfirstlongemfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\the\glsshortpltok}}},% - text={\protect\glsabbrvemfont{\the\glsshorttok}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% - }% + \GlsXtrUseAbbrStyleSetup{long-em-noshort-em-desc}% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -15023,32 +17243,35 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-em-short-em}% + \GlsXtrUseAbbrStyleFmts{long-em-noshort-em-desc}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-em-long} -% Now the short (long) version +%\begin{abbrvstyle}{short-em-footnote} %\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2015-04-30}{renamed from \qt{footnote-em}} % \begin{macrocode} -\newabbreviationstyle{short-em-long}% +\newabbreviationstyle{short-em-footnote}% {% \renewcommand*{\CustomAbbreviationFields}{% name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +% Switch off hyperlinks on first use to prevent nested hyperlinks, +% and unset the \catattr{regular} attribute if it has been set. +%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% @@ -15057,540 +17280,717 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% Mostly as short-long style: -%\changes{1.05}{2016-06-10}{fixed incorrect font used by long form} -% \begin{macrocode} \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% The full format displays the short form followed by the long form +% as a footnote. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% +% \end{macrocode} +% The first use full form and the inline full form use the short +% (long) style. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} -% -%\begin{abbrvstyle}{short-em-long-desc} -% As before but user provides description -%\changes{0.5}{2015-12-07}{new} -% \begin{macrocode} -\newabbreviationstyle{short-em-long-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname}, - sort={\glsxtrshortlongdescsort}, - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongdefaultfont{\the\glslongpltok}}},% - text={\protect\glsabbrvemfont{\the\glsshorttok}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% - }% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\begin{abbrvstyle}{footnote-em} +%Backward compatibility: % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-em-long}% -} +\@glsxtr@deprecated@abbrstyle{footnote-em}{short-em-footnote} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-em-long-em} -%\changes{1.04}{2016-05-02}{new} +%\begin{abbrvstyle}{short-em-postfootnote} +%\changes{0.5}{2015-12-07}{new} +%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-em}} % \begin{macrocode} -\newabbreviationstyle{short-em-long-em}% +\newabbreviationstyle{short-em-postfootnote}% {% -% \end{macrocode} -%\cs{glslongemfont} is used in the description since \cs{glsdesc} -%doesn't set the style. -% \begin{macrocode} \renewcommand*{\CustomAbbreviationFields}{% name={\protect\glsabbrvemfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - description={\protect\glslongemfont{\the\glslongtok}},% - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongpltok}}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} + description={\the\glslongtok},% + first={\protect\glsfirstabbrvemfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}},% plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +% Make this category insert a footnote after the link if this was +% the first use, and +% unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% +% \end{macrocode} +% Needs the specific font command here as the style may have been +% lost by the time the footnote occurs. +% \begin{macrocode} + \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% + {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% + }% + {}% + }% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% }% {}% }% +% \end{macrocode} +% The footnote needs to be suppressed in the inline form, so +% \cs{glsxtrfull} must set the first use switch off. +% \begin{macrocode} + \renewcommand*{\glsxtrsetupfulldefs}{% + \let\glsxtrifwasfirstuse\@secondoftwo + }% }% {% \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% The full format displays the short form. The long form is +% deferred. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongemfont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongemfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongemfont{\glsaccesslong{##1}}}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% +% \end{macrocode} +% The first use full form and the inline full form use the short +% (long) style. +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongemfont{\glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} +%\begin{abbrvstyle}{postfootnote-em} +%Backward compatibility: +% \begin{macrocode} +\@glsxtr@deprecated@abbrstyle{postfootnote-em}{short-em-postfootnote} +% \end{macrocode} +%\end{abbrvstyle} % -%\begin{abbrvstyle}{short-em-long-em-desc} +%\subsection{Predefined Styles (User Parentheses Hook)} +% These styles allow the user to adjust the parenthetical forms. +% These styles all test for the existence of the +% field given by: +%\begin{macro}{\glsxtruserfield} %\changes{1.04}{2016-05-02}{new} +% Default is the useri field. % \begin{macrocode} -\newabbreviationstyle{short-em-long-em-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname},% - sort={\glsxtrshortlongdescsort},% - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlongemfont{\the\glslongpltok}}},% - text={\protect\glsabbrvemfont{\the\glsshorttok}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}% - }% +\newcommand*{\glsxtruserfield}{useri} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\glsxtruserparen} +%\changes{1.04}{2016-05-02}{new} +% The format of the parenthetical information. +% The first argument is the long/short form. The second argument +% is the entry's label. If \cs{glscurrentfieldvalue} has been +% defined, then we have at least \styfmt{glossaries} v4.23, which makes +% it easier for the user to adjust this. % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-em-long-em}% +\ifdef\glscurrentfieldvalue +{ + \newcommand*{\glsxtruserparen}[2]{% + \glsxtrfullsep{#2}% + \glsxtrparen + {#1\ifglshasfield{\glsxtruserfield}{#2}{, \glscurrentfieldvalue}{}}% + } +} +{ + \newcommand*{\glsxtruserparen}[2]{% + \glsxtrfullsep{#2}% + \glsxtrparen + {#1\ifglshasfield{\glsxtruserfield}{#2}{, \@glo@thisvalue}{}}% + } } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} +% Font used for short form: +%\begin{macro}{\glsabbrvuserfont} +%\changes{1.04}{2016-05-02}{new} +%\changes{1.17}{2017-08-09}{initialised to default font} +% \begin{macrocode} +\newcommand*{\glsabbrvuserfont}[1]{\glsabbrvdefaultfont{#1}} +% \end{macrocode} +%\end{macro} +% Font used for short form on first use: +%\begin{macro}{\glsfirstabbrvuserfont} +%\changes{1.04}{2016-05-02}{new} +% \begin{macrocode} +\newcommand*{\glsfirstabbrvuserfont}[1]{\glsabbrvuserfont{#1}} +% \end{macrocode} +%\end{macro} +% Font used for long form: +%\begin{macro}{\glslonguserfont} +%\changes{1.04}{2016-05-02}{new} +%\changes{1.17}{2017-08-09}{initialised to default font} +% \begin{macrocode} +\newcommand*{\glslonguserfont}[1]{\glslongdefaultfont{#1}} +% \end{macrocode} +%\end{macro} +% Font used for long form on first use: +%\begin{macro}{\glsfirstlonguserfont} +%\changes{1.04}{2016-05-02}{new} +% \begin{macrocode} +\newcommand*{\glsfirstlonguserfont}[1]{\glslonguserfont{#1}} +% \end{macrocode} +%\end{macro} +% The default short form suffix: +%\begin{macro}{\glsxtrusersuffix} +%\changes{1.04}{2016-05-02}{new} +% \begin{macrocode} +\newcommand*{\glsxtrusersuffix}{\glsxtrabbrvpluralsuffix} +% \end{macrocode} +%\end{macro} % -%\begin{abbrvstyle}{short-em} -%\changes{0.5}{2015-12-07}{new} +%\begin{abbrvstyle}{long-short-user} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newabbreviationstyle{short-em}% +\newabbreviationstyle{long-short-user}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, + name={\protect\glsabbrvuserfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}}, - text={\protect\glsabbrvemfont{\the\glsshorttok}}, - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + first={\protect\glsfirstlonguserfont{\the\glslongtok}% + \protect\glsxtruserparen{\protect\glsfirstabbrvuserfont{\the\glsshorttok}}% + {\the\glslabeltok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}% + \protect\glsxtruserparen + {\protect\glsfirstabbrvuserfont{\the\glsshortpltok}}{\the\glslabeltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% + description={\protect\glslonguserfont{\the\glslongtok}}}% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% }% {% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The inline full form displays the short form followed by the -% long form in parentheses. +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshort{##1}% - \ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}% - \ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshort{##1}% - \ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}% - \ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% - }% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% % \end{macrocode} -% The first use full form only displays the short form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-em-nolong} -%\changes{1.04}{2016-05-02}{new} -% \begin{macrocode} -\letabbreviationstyle{short-em-nolong}{short-em} -% \end{macrocode} -%\end{abbrvstyle} % -%\begin{abbrvstyle}{short-em-desc} -%\changes{0.5}{2015-12-07}{new} +%\begin{abbrvstyle}{long-postshort-user} +%\changes{1.12}{2017-02-03}{new} +%Like \abbrstyle{long-short-user} but defers the parenthetical +%matter to after the link. % \begin{macrocode} -\newabbreviationstyle{short-em-desc}% +\newabbreviationstyle{long-postshort-user}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortdescname}, + name={\protect\glsabbrvuserfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}}, - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}}, - text={\protect\glsabbrvemfont{\the\glsshorttok}}, - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + first={\protect\glsfirstlonguserfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% + description={\protect\glslonguserfont{\the\glslongtok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% + \glsxtruserparen + {\glsfirstabbrvuserfont{\glsentryshort{\glslabel}}}% + {\glslabel}% + }% + {}% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% }% {% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The inline full form displays the short format followed by the -% long form in parentheses. +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% - }% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% % \end{macrocode} -% The first use full form only displays the short form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +%First use full form: % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + }% +% \end{macrocode} +% In-line format: +% \begin{macrocode} + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{short-em-nolong-desc} -%\changes{1.04}{2016-05-02}{new} +% +%\begin{abbrvstyle}{long-postshort-user-desc} +%\changes{1.12}{2017-02-03}{new} +%Like \abbrstyle{long-postshort-user} but the user supplies the +%description. % \begin{macrocode} -\letabbreviationstyle{short-em-nolong-desc}{short-em-desc} +\newabbreviationstyle{long-postshort-user-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glslonguserfont{\the\glslongtok}% + \protect\glsxtruserparen + {\protect\glsabbrvuserfont{\the\glsshorttok}}{\the\glslabeltok}}, + sort={\the\glslongtok}, + first={\protect\glsfirstlonguserfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + text={\protect\glsabbrvuserfont{\the\glsshorttok}},% + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% + \glsxtruserparen + {\glsfirstabbrvuserfont{\glsentryshort{\glslabel}}}% + {\glslabel}% + }% + {}% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-postshort-user}% +} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-em} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{long-em}} -% The short form is explicitly invoked through commands like -% \cs{glsshort}. +%\begin{abbrvstyle}{short-postlong-user} +%\changes{1.12}{2017-02-03}{new} +%Like \abbrstyle{short-long-user} but defers the parenthetical +%matter to after the link. % \begin{macrocode} -\newabbreviationstyle{long-noshort-em}% +\newabbreviationstyle{short-postlong-user}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, + name={\protect\glsabbrvuserfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstlongdefaultfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongdefaultfont{\the\glslongpltok}}, - text={\protect\glslongdefaultfont{\the\glslongtok}}, - plural={\protect\glslongdefaultfont{\the\glslongpltok}},% - description={\the\glslongtok}% + first={\protect\glsfirstlonguserfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% + description={\protect\glslonguserfont{\the\glslongtok}}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% + \glsxtruserparen + {\glsfirstlonguserfont{\glsentrylong{\glslabel}}}% + {\glslabel}% + }% + {}% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% }% {% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% % \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% % \end{macrocode} -% The inline full form displays the long format followed by the -% short form in parentheses. +%First use full form: % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + \renewcommand*{\glsxtrfullformat}[2]{% + \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi }% % \end{macrocode} -% The first use full form only displays the long form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +% In-line format: % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{long-em} -%Backward compatibility: +% +%\begin{abbrvstyle}{short-postlong-user-desc} +%\changes{1.12}{2017-02-03}{new} +%Like \abbrstyle{short-postlong-user} but leaves the user to specify +%the description. % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-em}{long-noshort-em} +\newabbreviationstyle{short-postlong-user-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvuserfont{\the\glsshorttok}% + \protect\glsxtruserparen + {\protect\glslonguserfont{\the\glslongpltok}}% + {\the\glslabeltok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlonguserfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + text={\protect\glsabbrvuserfont{\the\glsshorttok}},% + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% + \glsxtruserparen + {\glsfirstlonguserfont{\glsentrylong{\glslabel}}}% + {\glslabel}% + }% + {}% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-postlong-user}% +} % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-em-noshort-em} +%\begin{abbrvstyle}{long-short-user-desc} %\changes{1.04}{2016-05-02}{new} -% The short form is explicitly invoked through commands like -% \cs{glsshort}. % \begin{macrocode} -\newabbreviationstyle{long-em-noshort-em}% +\newabbreviationstyle{long-short-user-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongemfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}}, - text={\protect\glslongemfont{\the\glslongtok}}, - plural={\protect\glslongemfont{\the\glslongpltok}},% - description={\protect\glslongemfont{\the\glslongtok}}% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort},% +% \end{macrocode} +%\changes{1.17}{2017-08-09}{corrected first forms} +% \begin{macrocode} + first={\protect\glsfirstlonguserfont{\the\glslongtok}% + \protect\glsxtruserparen{\protect\glsfirstabbrvuserfont{\the\glsshorttok}}% + {\the\glslabeltok}},% + firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}% + \protect\glsxtruserparen + {\protect\glsfirstabbrvuserfont{\the\glsshortpltok}}{\the\glslabeltok}},% + text={\protect\glsabbrvfont{\the\glsshorttok}},% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% }% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% }% {% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% + \GlsXtrUseAbbrStyleFmts{long-short-user}% +} % \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{short-long-user} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% +\newabbreviationstyle{short-long-user}% +{% % \end{macrocode} -% The inline full form displays the long format followed by the -% short form in parentheses. +%\cs{glslonguserfont} is used in the description since \cs{glsdesc} +%doesn't set the style. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvuserfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + description={\protect\glslonguserfont{\the\glslongtok}},% + first={\protect\glsfirstabbrvuserfont{\the\glsshorttok}% + \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongtok}}% + {\the\glslabeltok}},% + firstplural={\protect\glsfirstabbrvuserfont{\the\glsshortpltok}% + \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongpltok}}% + {\the\glslabeltok}},% +% \end{macrocode} +%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% \begin{macrocode} + plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}}% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% +}% +{% +% \end{macrocode} +% In case the user wants to mix and match font styles, these are +% redefined here. +% \begin{macrocode} + \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvuserfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% % \end{macrocode} -% The first use full form only displays the long form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi + \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-em-noshort-em-noreg} -%\changes{1.17}{2017-08-09}{new} -% Like long-em-noshort-em but doesn't set the \catattr{regular} attribute. +%\begin{abbrvstyle}{short-long-user-desc} +%\changes{1.04}{2016-05-02}{new} % \begin{macrocode} -\newabbreviationstyle{long-em-noshort-em-noreg}% +\newabbreviationstyle{short-long-user-desc}% {% - \GlsXtrUseAbbrStyleSetup{long-em-noshort-em}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrshortlongdescname}, + sort={\glsxtrshortlongdescsort},% +% \end{macrocode} +%\changes{1.17}{2017-08-09}{corrected first forms} +% \begin{macrocode} + first={\protect\glsfirstabbrvuserfont{\the\glsshorttok}% + \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongtok}}% + {\the\glslabeltok}},% + firstplural={\protect\glsfirstabbrvuserfont{\the\glsshortpltok}% + \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongpltok}}% + {\the\glslabeltok}},% + text={\protect\glsabbrvfont{\the\glsshorttok}},% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + }% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -15603,201 +18003,182 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-em-noshort-em}% + \GlsXtrUseAbbrStyleFmts{short-long-user}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-noshort-em-desc} -%\changes{1.04}{2016-05-02}{renamed from \qt{long-desc-em}} -%\changes{0.5}{2015-12-07}{new} -% The emphasized font will only be used if -% the short form is explicitly invoked through commands like -% \cs{glsshort}. +%\subsection{Predefined Styles (Hyphen)} +%These styles are designed to work with the \catattr{markwords} +%attribute. They check if the inserted material (provided by the final +%optional argument of commands like \cs{gls}) starts with a hyphen. +%If it does, the insert is added to the parenthetical material. +%Note that commands like \cs{glsxtrlong} set \cs{glsinsert} to empty +%with the entire link-text stored in \cs{glscustomtext}. +% +%\begin{macro}{\glsxtrifhyphenstart} +%Checks if the argument starts with a hyphen. The argument may be +%\cs{glsinsert} so check for that and expand. +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newabbreviationstyle{long-noshort-em-desc}% -{% - \GlsXtrUseAbbrStyleSetup{long-noshort-desc}% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% +\newrobustcmd*{\glsxtrifhyphenstart}[3]{% + \ifx\glsinsert#1\relax + \expandafter\@glsxtrifhyphenstart#1\relax\relax + \@end@glsxtrifhyphenstart{#2}{#3}% + \else + \@glsxtrifhyphenstart#1\relax\relax\@end@glsxtrifhyphenstart{#2}{#3}% + \fi +} % \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). +%\end{macro} +% +%\begin{macro}{\@glsxtrifhyphenstart} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% +\def\@glsxtrifhyphenstart#1#2\@end@glsxtrifhyphenstart#3#4{% + \ifx-#1\relax#3\else #4\fi +} % \end{macrocode} -% The inline full form displays the long format followed by the -% short form in parentheses. +%\end{macro} +% +%\begin{macro}{\glsxtrlonghyphenshort} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrlonghyphenshort}\marg{label}\marg{long}\marg{short}\marg{insert} +%\end{definition} +%The \meta{long} and \meta{short} arguments may be the plural form. +%The \meta{long} argument may also be the first letter uppercase form. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongdefaultfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% - }% +\newcommand*{\glsxtrlonghyphenshort}[4]{% % \end{macrocode} -% The first use full form only displays the long form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +% Grouping is needed to localise the redefinitions. % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongdefaultfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% + {% +% \end{macrocode} +% If \meta{insert} starts with a hyphen, redefine \ics{glsxtrwordsep} +% to a hyphen. The inserted material is also inserted into the +% parenthetical part. (The inserted material is grouped as a +% precautionary measure.) No change is made to \cs{glsxtrwordsep} if +% \meta{insert} doesn't start with a hyphen. +% \begin{macrocode} + \glsxtrifhyphenstart{#4}{\def\glsxtrwordsep{-}}{}% + \glsfirstlonghyphenfont{#2\ifglsxtrinsertinside{#4}\fi}% + \ifglsxtrinsertinside\else{#4}\fi + \glsxtrfullsep{#1}% + \glsxtrparen{\glsfirstabbrvhyphenfont{#3\ifglsxtrinsertinside{#4}\fi}% + \ifglsxtrinsertinside\else{#4}\fi}% + }% } % \end{macrocode} -%\end{abbrvstyle} -%\begin{abbrvstyle}{long-desc-em} -%Backward compatibility: +%\end{macro} +% +%\begin{macro}{\glsabbrvhyphenfont} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{long-desc-em}{long-noshort-em-desc} +\newcommand*{\glsabbrvhyphenfont}{\glsabbrvdefaultfont}% % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} +%\begin{macro}{\glsfirstabbrvhyphenfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsfirstabbrvhyphenfont}{\glsabbrvhyphenfont}% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslonghyphenfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glslonghyphenfont}{\glslongdefaultfont}% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsfirstlonghyphenfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsfirstlonghyphenfont}{\glslonghyphenfont}% +% \end{macrocode} +%\end{macro} +% The default short form suffix: +%\begin{macro}{\glsxtrhyphensuffix} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsxtrhyphensuffix}{\glsxtrabbrvpluralsuffix} +% \end{macrocode} +%\end{macro} % -%\begin{abbrvstyle}{long-em-noshort-em-desc} -%\changes{1.04}{2016-05-02}{new} -% The short form is explicitly invoked through commands like -% \cs{glsshort}. The long form is emphasized. +%\begin{abbrvstyle}{long-hyphen-short-hyphen} +%\changes{1.17}{2017-08-09}{new} +%Designed for use with the \catattr{markwords} attribute. % \begin{macrocode} -\newabbreviationstyle{long-em-noshort-em-desc}% +\newabbreviationstyle{long-hyphen-short-hyphen}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\protect\glslongemfont{\the\glslongtok}}, - sort={\the\glslongtok}, - first={\protect\glsfirstlongemfont{\the\glslongtok}}, - firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}}, - text={\glslongemfont{\the\glslongtok}}, - plural={\glslongemfont{\the\glslongpltok}}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{regular}{true}}% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% -% \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). -% \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glslongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glslongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glslongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glslongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside ##2\fi}% - \ifglsxtrinsertinside \else##2\fi - }% + name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% + description={\protect\glslonghyphenfont{\the\glslongtok}}}% % \end{macrocode} -% The inline full form displays the long format followed by the -% short form in parentheses. +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongemfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongemfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% +}% +{% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrhyphensuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% % \end{macrocode} -% The first use full form only displays the long form, but it -% typically won't be used as the \catattr{regular} attribute is set by this style. +% The first use full form and the inline full form are the same for +% this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphenshort{##1}{\glsaccesslong{##1}}{\glsaccessshort{##1}}{##2}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphenshort{##1}{\glsaccesslongpl{##1}}% + {\glsaccessshortpl{##1}}{##2}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongemfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphenshort{##1}{\Glsaccesslong{##1}}{\glsaccessshort{##1}}{##2}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongemfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphenshort{##1}{\Glsaccesslongpl{##1}}% + {\glsaccessshortpl{##1}}{##2}% }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-em-noshort-em-desc-noreg} +%\begin{abbrvstyle}{long-hyphen-short-hyphen-desc} %\changes{1.17}{2017-08-09}{new} -% Like long-em-noshort-em-desc but doesn't set the \catattr{regular} attribute. +%Like \abbrstyle{long-hyphen-short-hyphen} but the description +%must be supplied by the user. % \begin{macrocode} -\newabbreviationstyle{long-em-noshort-em-desc-noreg}% +\newabbreviationstyle{long-hyphen-short-hyphen-desc}% {% - \GlsXtrUseAbbrStyleSetup{long-em-noshort-em-desc}% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort}, + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}}},% + text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% + }% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -15810,35 +18191,58 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-em-noshort-em-desc}% + \GlsXtrUseAbbrStyleFmts{long-hyphen-short-hyphen}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-em-footnote} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2015-04-30}{renamed from \qt{footnote-em}} +%\begin{macro}{\glsxtrlonghyphennoshort} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrlonghyphennoshort}\marg{label}\marg{long}\marg{insert} +%\end{definition} % \begin{macrocode} -\newabbreviationstyle{short-em-footnote}% +\newcommand*{\glsxtrlonghyphennoshort}[3]{% +% \end{macrocode} +% Grouping is needed to localise the redefinitions. +% \begin{macrocode} + {% +% \end{macrocode} +% If \meta{insert} starts with a hyphen, redefine \ics{glsxtrwordsep} +% to a hyphen. The inserted material is also inserted into the +% parenthetical part. (The inserted material is grouped as a +% precautionary measure.) No change is made to \cs{glsxtrwordsep} if +% \meta{insert} doesn't start with a hyphen. +% \begin{macrocode} + \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% + \glsfirstlonghyphenfont{#2\ifglsxtrinsertinside{#3}\fi}% + \ifglsxtrinsertinside\else{#3}\fi + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-hyphen-noshort-desc-noreg} +%\changes{1.17}{2017-08-09}{new} +%This version doesn't show the short form (except +%explicitly with \cs{glsxtrshort}). Since \cs{glsxtrshort} doesn't +%support the hyphen switch, the short form just uses the default +%short-form font command. This style won't work with the +%\catattr{regular} as the regular form isn't flexible enough. +% \begin{macrocode} +\newabbreviationstyle{long-hyphen-noshort-desc-noreg}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}% - \protect\glsxtrabbrvfootnote{\the\glslabeltok}% - {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% + name={\protect\protect\glslonghyphenfont{\the\glslongtok}}, + sort={\expandonce\glsxtrorglong}, + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% + plural={\protect\glslonghyphenfont{\the\glslongpltok}}% + }% % \end{macrocode} -% Switch off hyperlinks on first use to prevent nested hyperlinks, -% and unset the \catattr{regular} attribute if it has been set. -%\changes{0.5.1}{2015-12-07}{switch off regular attribute if set} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% @@ -15847,103 +18251,196 @@ Dickimaw Books\\ }% }% {% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% + \GlsXtrUseAbbrStyleFmts{long-hyphen-short-hyphen}% % \end{macrocode} -% The full format displays the short form followed by the long form -% as a footnote. +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +% \end{macrocode} +% The format for subsequent use (not used when the regular attribute +% is set). +% \begin{macrocode} + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \protect\glsxtrabbrvfootnote{##1}% - {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% }% % \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. +% The inline full form displays the long format followed by the +% short form in parentheses. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + }% +% \end{macrocode} +% The first use full form only displays the long form. +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% + }% + \renewcommand*{\glsxtrfullplformat}[2]{% + \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% + }% + \renewcommand*{\Glsxtrfullformat}[2]{% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% + }% + \renewcommand*{\Glsxtrfullplformat}[2]{% + \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% + }% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{abbrvstyle}{long-hyphen-noshort-noreg} +% It doesn't really make a great deal of sense to have a long-only +% style that doesn't have a descriptionnless no glossary is +% required), but the best course of +% action here is to use the short form as the name and the long +% form as the description. +% \begin{macrocode} +\newabbreviationstyle{long-hyphen-noshort-noreg}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% + text={\protect\glslonghyphenfont{\the\glslongtok}},% + plural={\protect\glslonghyphenfont{\the\glslongpltok}},% + description={\the\glslongtok}% + }% +% \end{macrocode} +% Unset the \catattr{regular} attribute if it has been set. +% \begin{macrocode} + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% }% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-desc}% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{footnote-em} -%Backward compatibility: +% +%\begin{macro}{\glsxtrlonghyphen} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrlonghyphen}\marg{long}\marg{label}\marg{insert} +%\end{definition} +%Used by \abbrstyle{long-hyphen-postshort-hyphen}. The \meta{insert} +%is check to determine if it starts with a hyphen but isn't used +%here as it's moved to the post-link hook. % \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{footnote-em}{short-em-footnote} +\newcommand*{\glsxtrlonghyphen}[3]{% % \end{macrocode} -%\end{abbrvstyle} +% Grouping is needed to localise the redefinitions. +% \begin{macrocode} + {% + \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% + \glsfirstlonghyphenfont{#1}% + }% +} +% \end{macrocode} +%\end{macro} % -%\begin{abbrvstyle}{short-em-postfootnote} -%\changes{0.5}{2015-12-07}{new} -%\changes{1.04}{2016-05-02}{renamed from \qt{postfootnote-em}} +%\begin{macro}{\glsxtrposthyphenshort} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrposthyphenshort}\marg{label}\marg{insert} +%\end{definition} +%Used in the post-link hook for the +%\abbrstyle{long-hyphen-postshort-hyphen} style. Much like +%\cs{glsxtrlonghyphenshort} but omits the \meta{long} part. This +%always uses the singular short form. % \begin{macrocode} -\newabbreviationstyle{short-em-postfootnote}% +\newcommand*{\glsxtrposthyphenshort}[2]{% + {% + \glsxtrifhyphenstart{#2}{\def\glsxtrwordsep{-}}{}% + \ifglsxtrinsertinside{\glsfirstlonghyphenfont{#2}}\else{#2}\fi + \glsxtrfullsep{#1}% + \glsxtrparen + {\glsfirstabbrvhyphenfont{\glsentryshort{#1}\ifglsxtrinsertinside{#2}\fi}% + \ifglsxtrinsertinside\else{#2}\fi + }% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrposthyphensubsequent} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrposthyphensubsequent}\marg{label}\marg{insert} +%\end{definition} +%Format in the post-link hook for subsequent use. The label is +%ignored by default. +% \begin{macrocode} +\newcommand*{\glsxtrposthyphensubsequent}[2]{% + \glsabbrvfont{\ifglsxtrinsertinside {#2}\fi}% + \ifglsxtrinsertinside \else{#2}\fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-hyphen-postshort-hyphen} +%\changes{1.17}{2017-08-09}{new} +%Like \abbrstyle{long-hyphen-short-hyphen} but shifts the insert +%and parenthetical material to the post-link hook. +% \begin{macrocode} +\newabbreviationstyle{long-hyphen-postshort-hyphen}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvemfont{\the\glsshorttok}}, + name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - description={\the\glslongtok},% - first={\protect\glsfirstabbrvemfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}},% - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% -% \end{macrocode} -% Make this category insert a footnote after the link if this was -% the first use, and -% unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% + description={\protect\glslonghyphenfont{\the\glslongtok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \csdef{glsxtrpostlink\glscategorylabel}{% \glsxtrifwasfirstuse {% + \glsxtrposthyphenshort{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -% Needs the specific font command here as the style may have been -% lost by the time the footnote occurs. +% Put the insertion into the post-link: % \begin{macrocode} - \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% - {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% + \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% }% - {}% }% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -15951,168 +18448,162 @@ Dickimaw Books\\ }% {}% }% +}% +{% % \end{macrocode} -% The footnote needs to be suppressed in the inline form, so -% \cs{glsxtrfull} must set the first use switch off. +% In case the user wants to mix and match font styles, these are +% redefined here. % \begin{macrocode} - \renewcommand*{\glsxtrsetupfulldefs}{% - \let\glsxtrifwasfirstuse\@secondoftwo + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +% \end{macrocode} +% Subsequent use needs to omit the insertion: +% \begin{macrocode} + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\glsaccessshort{##1}}% + }% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\glsaccessshortpl{##1}}% + }% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\Glsaccessshort{##1}}% + }% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\Glsaccessshortpl{##1}}% }% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtremsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} -% The full format displays the short form. The long form is -% deferred. +% First use full form: % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphen{\glsaccesslong{##1}}{##1}{##2}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphen{\glsaccesslongpl{##1}}{##1}{##2}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphen{\Glsaccesslong{##1}}{##1}{##2}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrlonghyphen{\Glsaccesslongpl{##1}}{##1}{##2}% }% % \end{macrocode} -% The first use full form and the inline full form use the short -% (long) style. +% In-line format. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsfirstlonghyphenfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsfirstlonghyphenfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% + \glsfirstlonghyphenfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvemfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% + \glsfirstlonghyphenfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% } % \end{macrocode} %\end{abbrvstyle} -%\begin{abbrvstyle}{postfootnote-em} -%Backward compatibility: -% \begin{macrocode} -\@glsxtr@deprecated@abbrstyle{postfootnote-em}{short-em-postfootnote} -% \end{macrocode} -%\end{abbrvstyle} -% -%\subsection{Predefined Styles (User Parentheses Hook)} -% These styles allow the user to adjust the parenthetical forms. -% These styles all test for the existence of the -% field given by: -%\begin{macro}{\glsxtruserfield} -%\changes{1.04}{2016-05-02}{new} -% Default is the useri field. -% \begin{macrocode} -\newcommand*{\glsxtruserfield}{useri} -% \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtruserparen} -%\changes{1.04}{2016-05-02}{new} -% The format of the parenthetical information. -% The first argument is the long/short form. The second argument -% is the entry's label. If \cs{glscurrentfieldvalue} has been -% defined, then we have at least \styfmt{glossaries} v4.23, which makes -% it easier for the user to adjust this. -% \begin{macrocode} -\ifdef\glscurrentfieldvalue -{ - \newcommand*{\glsxtruserparen}[2]{% - \glsxtrfullsep{#2}% - \glsxtrparen - {#1\ifglshasfield{\glsxtruserfield}{#2}{, \glscurrentfieldvalue}{}}% - } -} -{ - \newcommand*{\glsxtruserparen}[2]{% - \glsxtrfullsep{#2}% - \glsxtrparen - {#1\ifglshasfield{\glsxtruserfield}{#2}{, \@glo@thisvalue}{}}% - } -} -% \end{macrocode} -%\end{macro} -% Font used for short form: -%\begin{macro}{\glsabbrvuserfont} -%\changes{1.04}{2016-05-02}{new} -%\changes{1.17}{2017-08-09}{initialised to default font} +%\begin{abbrvstyle}{long-hyphen-postshort-hyphen-desc} +%\changes{1.17}{2017-08-09}{new} +%Like \abbrstyle{long-hyphen-postshort-hyphen} but the description +%must be supplied by the user. % \begin{macrocode} -\newcommand*{\glsabbrvuserfont}[1]{\glsabbrvdefaultfont{#1}} +\newabbreviationstyle{long-hyphen-postshort-hyphen-desc}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\glsxtrlongshortdescname}, + sort={\glsxtrlongshortdescsort},% + first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% + text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% + }% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \csdef{glsxtrpostlink\glscategorylabel}{% + \glsxtrifwasfirstuse + {% + \glsxtrposthyphenshort{\glslabel}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% Font used for short form on first use: -%\begin{macro}{\glsfirstabbrvuserfont} -%\changes{1.04}{2016-05-02}{new} +% Put the insertion into the post-link: % \begin{macrocode} -\newcommand*{\glsfirstabbrvuserfont}[1]{\glsabbrvuserfont{#1}} + \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% + }% + }% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{long-hyphen-postshort-hyphen}% +} % \end{macrocode} -%\end{macro} -% Font used for long form: -%\begin{macro}{\glslonguserfont} -%\changes{1.04}{2016-05-02}{new} -%\changes{1.17}{2017-08-09}{initialised to default font} +%\end{abbrvstyle} +% +%\begin{macro}{\glsxtrshorthyphenlong} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrshorthyphenlong}\marg{label}\marg{short}\marg{long}\marg{insert} +%\end{definition} +%The \meta{long} and \meta{short} arguments may be the plural form. +%The \meta{long} argument may also be the first letter uppercase form. % \begin{macrocode} -\newcommand*{\glslonguserfont}[1]{\glslongdefaultfont{#1}} +\newcommand*{\glsxtrshorthyphenlong}[4]{% % \end{macrocode} -%\end{macro} -% Font used for long form on first use: -%\begin{macro}{\glsfirstlonguserfont} -%\changes{1.04}{2016-05-02}{new} +% Grouping is needed to localise the redefinitions. % \begin{macrocode} -\newcommand*{\glsfirstlonguserfont}[1]{\glslonguserfont{#1}} + {% % \end{macrocode} -%\end{macro} -% The default short form suffix: -%\begin{macro}{\glsxtrusersuffix} -%\changes{1.04}{2016-05-02}{new} +% If \meta{insert} starts with a hyphen, redefine \cs{glsxtrwordsep} +% to a hyphen. The inserted material is also inserted into the +% parenthetical part. (The inserted material is grouped as a +% precautionary measure.) % \begin{macrocode} -\newcommand*{\glsxtrusersuffix}{\glsxtrabbrvpluralsuffix} + \glsxtrifhyphenstart{#4}{\def\glsxtrwordsep{-}}{}% + \glsfirstabbrvhyphenfont{#2\ifglsxtrinsertinside{#4}\fi}% + \ifglsxtrinsertinside\else{#4}\fi + \glsxtrfullsep{#1}% + \glsxtrparen{\glsfirstlonghyphenfont{#3\ifglsxtrinsertinside{#4}\fi}% + \ifglsxtrinsertinside\else{#4}\fi}% + }% +} % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-short-user} -%\changes{1.04}{2016-05-02}{new} +%\begin{abbrvstyle}{short-hyphen-long-hyphen} +%\changes{1.17}{2017-08-09}{new} +%Designed for use with the \catattr{markwords} attribute. % \begin{macrocode} -\newabbreviationstyle{long-short-user}% +\newabbreviationstyle{short-hyphen-long-hyphen}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvuserfont{\the\glsshorttok}}, + name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstlonguserfont{\the\glslongtok}% - \protect\glsxtruserparen{\protect\glsfirstabbrvuserfont{\the\glsshorttok}}% - {\the\glslabeltok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}% - \protect\glsxtruserparen - {\protect\glsfirstabbrvuserfont{\the\glsshortpltok}}{\the\glslabeltok}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% - description={\protect\glslonguserfont{\the\glslongtok}}}% + first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongpltok}}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% + description={\protect\glslonghyphenfont{\the\glslongtok}}}% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} @@ -16125,69 +18616,140 @@ Dickimaw Books\\ }% }% {% -% \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrhyphensuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% % \end{macrocode} % The first use full form and the inline full form are the same for % this style. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + \glsxtrshorthyphenlong{##1}{\glsaccessshort{##1}}{\glsaccesslong{##1}}{##2}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% + \glsxtrshorthyphenlong{##1}% + {\glsaccessshortpl{##1}}{\glsaccesslongpl{##1}}{##2}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + \glsxtrshorthyphenlong{##1}{\glsaccessshort{##1}}{\Glsaccesslong{##1}}{##2}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% + \glsxtrshorthyphenlong{##1}% + {\glsaccessshortpl{##1}}{\Glsaccesslongpl{##1}}{##2}% }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-postshort-user} -%\changes{1.12}{2017-02-03}{new} -%Like \abbrstyle{long-short-user} but defers the parenthetical -%matter to after the link. +%\begin{abbrvstyle}{short-hyphen-long-hyphen-desc} +%\changes{1.17}{2017-08-09}{new} +%Like \abbrstyle{short-hyphen-long-hyphen} but the description +%must be supplied by the user. % \begin{macrocode} -\newabbreviationstyle{long-postshort-user}% +\newabbreviationstyle{short-hyphen-long-hyphen-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvuserfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlonguserfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% + name={\glsxtrshortlongdescname}, + sort={\glsxtrshortlongdescsort}, + first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongtok}}},% + firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongpltok}}},% + text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% + }% % \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% - description={\protect\glslonguserfont{\the\glslongtok}}}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-hyphen-long-hyphen}% +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glsxtrshorthyphen} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrshorthyphen}\marg{short}\marg{label}\marg{insert} +%\end{definition} +%Used by \abbrstyle{short-hyphen-postlong-hyphen}. The \meta{insert} +%is check to determine if it starts with a hyphen but isn't used +%here as it's moved to the post-link hook. +% \begin{macrocode} +\newcommand*{\glsxtrshorthyphen}[3]{% +% \end{macrocode} +% Grouping is needed to localise the redefinitions. +% \begin{macrocode} + {% + \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% + \glsfirstabbrvhyphenfont{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrposthyphenlong} +%\changes{1.17}{2017-08-09}{new} +%\begin{definition} +%\cs{glsxtrposthyphenlong}\marg{label}\marg{insert} +%\end{definition} +%Used in the post-link hook for the +%\abbrstyle{short-hyphen-postlong-hyphen} style. Much like +%\cs{glsxtrshorthyphenlong} but omits the \meta{short} part. This +%always uses the singular long form. +% \begin{macrocode} +\newcommand*{\glsxtrposthyphenlong}[2]{% + {% + \glsxtrifhyphenstart{#2}{\def\glsxtrwordsep{-}}{}% + \ifglsxtrinsertinside{\glsfirstabbrvhyphenfont{#2}}\else{#2}\fi + \glsxtrfullsep{#1}% + \glsxtrparen + {\glsfirstlonghyphenfont{\glsentrylong{#1}\ifglsxtrinsertinside{#2}\fi}% + \ifglsxtrinsertinside\else{#2}\fi + }% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{short-hyphen-postlong-hyphen} +%\changes{1.17}{2017-08-09}{new} +%Like \abbrstyle{short-hyphen-long-hyphen} but shifts the insert +%and parenthetical material to the post-link hook. +% \begin{macrocode} +\newabbreviationstyle{short-hyphen-postlong-hyphen}% +{% + \renewcommand*{\CustomAbbreviationFields}{% + name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, + sort={\the\glsshorttok}, + first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% + description={\protect\glslonghyphenfont{\the\glslongtok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \csdef{glsxtrpostlink\glscategorylabel}{% \glsxtrifwasfirstuse {% - \glsxtruserparen - {\glsfirstabbrvuserfont{\glsentryshort{\glslabel}}}% - {\glslabel}% + \glsxtrposthyphenlong{\glslabel}{\glsinsert}% + }% + {% +% \end{macrocode} +% Put the insertion into the post-link: +% \begin{macrocode} + \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% }% - {}% }% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -16201,86 +18763,97 @@ Dickimaw Books\\ % In case the user wants to mix and match font styles, these are % redefined here. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% + \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% % \end{macrocode} -%First use full form: +% Subsequent use needs to omit the insertion: % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \renewcommand*{\glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\glsaccessshort{##1}}% + }% + \renewcommand*{\glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\glsaccessshortpl{##1}}% + }% + \renewcommand*{\Glsxtrsubsequentfmt}[2]{% + \glsabbrvfont{\Glsaccessshort{##1}}% + }% + \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% + \glsabbrvfont{\Glsaccessshortpl{##1}}% + }% +% \end{macrocode} +% First use full form: +% \begin{macrocode} + \renewcommand*{\glsxtrfullformat}[2]{% + \glsxtrshorthyphen{\glsaccessshort{##1}}{##1}{##2}% }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrshorthyphen{\glsaccessshortpl{##1}}{##1}{##2}% }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrshorthyphen{\Glsaccessshort{##1}}{##1}{##2}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi + \glsxtrshorthyphen{\Glsaccessshortpl{##1}}{##1}{##2}% }% % \end{macrocode} -% In-line format: +% In-line format. Commands like \cs{glsxtrfull} set \cs{glsinsert} +% to empty. The entire link-text (provided by the following +% commands) is stored in \cs{glscustomtext}. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlonguserfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + \glsfirstabbrvhyphenfont{\glsaccessshort{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlonguserfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% + \glsfirstabbrvhyphenfont{\glsaccessshortpl{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshort{##1}}}{##1}% + \glsfirstabbrvhyphenfont{\Glsaccessshort{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlonguserfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstabbrvuserfont{\glsaccessshortpl{##1}}}{##1}% + \glsfirstabbrvhyphenfont{\Glsaccessshortpl{##1}% + \ifglsxtrinsertinside{##2}\fi}% + \ifglsxtrinsertinside \else{##2}\fi }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{long-postshort-user-desc} -%\changes{1.12}{2017-02-03}{new} -%Like \abbrstyle{long-postshort-user} but the user supplies the -%description. +%\begin{abbrvstyle}{short-hyphen-postlong-hyphen-desc} +%\changes{1.17}{2017-08-09}{new} +%Like \abbrstyle{short-hyphen-postlong-hyphen} but the description +%must be supplied by the user. % \begin{macrocode} -\newabbreviationstyle{long-postshort-user-desc}% +\newabbreviationstyle{short-hyphen-postlong-hyphen-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glslonguserfont{\the\glslongtok}% - \protect\glsxtruserparen - {\protect\glsabbrvuserfont{\the\glsshorttok}}{\the\glslabeltok}}, - sort={\the\glslongtok}, - first={\protect\glsfirstlonguserfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% -% \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} -% \begin{macrocode} - text={\protect\glsabbrvuserfont{\the\glsshorttok}},% - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}% + name={\glsxtrshortlongdescname}, + sort={\glsxtrshortlongdescsort},% + first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}},% + text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% + plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% }% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \csdef{glsxtrpostlink\glscategorylabel}{% \glsxtrifwasfirstuse {% - \glsxtruserparen - {\glsfirstabbrvuserfont{\glsentryshort{\glslabel}}}% - {\glslabel}% + \glsxtrposthyphenlong{\glslabel}{\glsinsert}% + }% + {% +% \end{macrocode} +% Put the insertion into the post-link: +% \begin{macrocode} + \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% }% - {}% }% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -16290,38 +18863,62 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-postshort-user}% + \GlsXtrUseAbbrStyleFmts{short-hyphen-postlong-hyphen}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-postlong-user} -%\changes{1.12}{2017-02-03}{new} -%Like \abbrstyle{short-long-user} but defers the parenthetical -%matter to after the link. +%\subsection{Predefined Styles (No Short on First Use)} +%These styles show only the long form on first use and only the +%short form on subsequent use. +%\begin{macro}{\glsabbrvonlyfont} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newabbreviationstyle{short-postlong-user}% +\newcommand*{\glsabbrvonlyfont}{\glsabbrvdefaultfont}% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsfirstabbrvonlyfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsfirstabbrvonlyfont}{\glsabbrvonlyfont}% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslongonlyfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glslongonlyfont}{\glslongdefaultfont}% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsfirstlongonlyfont} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsfirstlongonlyfont}{\glslongonlyfont}% +% \end{macrocode} +%\end{macro} +% The default short form suffix: +%\begin{macro}{\glsxtronlysuffix} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newcommand*{\glsxtronlysuffix}{\glsxtrabbrvpluralsuffix} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-only-short-only} +%\changes{1.17}{2017-08-09}{new} +% \begin{macrocode} +\newabbreviationstyle{long-only-short-only}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvuserfont{\the\glsshorttok}}, + name={\protect\glsabbrvonlyfont{\the\glsshorttok}}, sort={\the\glsshorttok}, - first={\protect\glsfirstlonguserfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% + first={\protect\glsfirstlongonlyfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlongonlyfont{\the\glslongpltok}},% + plural={\protect\glsabbrvonlyfont{\the\glsshortpltok}},% + description={\protect\glslongonlyfont{\the\glslongtok}}}% % \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +% Unset the \catattr{regular} attribute if it has been set. % \begin{macrocode} - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}},% - description={\protect\glslonguserfont{\the\glslongtok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtruserparen - {\glsfirstlonguserfont{\glsentrylong{\glslabel}}}% - {\glslabel}% - }% - {}% - }% \glshasattribute{\the\glslabeltok}{regular}% {% \glssetattribute{\the\glslabeltok}{regular}{false}% @@ -16330,124 +18927,89 @@ Dickimaw Books\\ }% }% {% + \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtronlysuffix}% + \renewcommand*{\glsabbrvfont}[1]{\glsabbrvonlyfont{##1}}% + \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvonlyfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongonlyfont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongonlyfont{##1}}% % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. -% \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvuserfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% -% \end{macrocode} -%First use full form: +% The first use full form doesn't show the short form. % \begin{macrocode} \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi }% % \end{macrocode} -% In-line format: +% The inline full form does show the short form. % \begin{macrocode} \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshort{##1}}}% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshortpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% + \glsfirstlongonlyfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% + \glsxtrfullsep{##1}% + \glsxtrparen{\protect\glsfirstabbrvonlyfont{\Glsaccessshortpl{##1}}}% }% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-postlong-user-desc} -%\changes{1.12}{2017-02-03}{new} -%Like \abbrstyle{short-postlong-user} but leaves the user to specify -%the description. +%\begin{macro}{\glsxtronlydescsort} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newabbreviationstyle{short-postlong-user-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvuserfont{\the\glsshorttok}% - \protect\glsxtruserparen - {\protect\glslonguserfont{\the\glslongpltok}}% - {\the\glslabeltok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlonguserfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}},% +\newcommand*{\glsxtronlydescsort}{\the\glslongtok} % \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +%\end{macro} +% +%\begin{macro}{\glsxtronlydescname} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} - text={\protect\glsabbrvuserfont{\the\glsshorttok}},% - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtruserparen - {\glsfirstlonguserfont{\glsentrylong{\glslabel}}}% - {\glslabel}% - }% - {}% - }% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-postlong-user}% +\newcommand*{\glsxtronlydescname}{% + \protect\glslongfont{\the\glslongtok}% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{long-short-user-desc} -%\changes{1.04}{2016-05-02}{new} +%\begin{abbrvstyle}{long-only-short-only-desc} +%\changes{1.17}{2017-08-09}{new} % \begin{macrocode} -\newabbreviationstyle{long-short-user-desc}% +\newabbreviationstyle{long-only-short-only-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort},% -% \end{macrocode} -%\changes{1.17}{2017-08-09}{corrected first forms} -% \begin{macrocode} - first={\protect\glsfirstlonguserfont{\the\glslongtok}% - \protect\glsxtruserparen{\protect\glsfirstabbrvuserfont{\the\glsshorttok}}% - {\the\glslabeltok}},% - firstplural={\protect\glsfirstlonguserfont{\the\glslongpltok}% - \protect\glsxtruserparen - {\protect\glsfirstabbrvuserfont{\the\glsshortpltok}}{\the\glslabeltok}},% - text={\protect\glsabbrvfont{\the\glsshorttok}},% - plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + name={\glsxtronlydescname}, + sort={\glsxtronlydescsort},% + first={\protect\glsfirstlongonlyfont{\the\glslongtok}},% + firstplural={\protect\glsfirstlongonlyfont{\the\glslongpltok}},% + text={\protect\glsabbrvonlyfont{\the\glsshorttok}},% + plural={\protect\glsabbrvonlyfont{\the\glsshortpltok}}% }% % \end{macrocode} % Unset the \catattr{regular} attribute if it has been set. @@ -16461,3427 +19023,3829 @@ Dickimaw Books\\ }% }% {% - \GlsXtrUseAbbrStyleFmts{long-short-user}% + \GlsXtrUseAbbrStyleFmts{long-only-short-only}% } % \end{macrocode} %\end{abbrvstyle} % -%\begin{abbrvstyle}{short-long-user} -%\changes{1.04}{2016-05-02}{new} +%\section{Using Entries in Headings} +% +% There are four main problems with using entries in sectioning +% commands: they can mess with the first use flag if they end up in +% the table of contents, they can add unwanted numbers to the +% entry's location list, the label is corrupted if used inside +% \ics{MakeUppercase} (which is used by the default headings style) +% and they need to be expandable for PDF bookmarks. The +% \styfmt{glossaries} package therefore recommends the use of the +% expandable commands, such as \cs{glsentryshort}, instead but this +% doesn't reflect the formatting since it doesn't include +% \cs{glsabbrvfont}. The commands below are an attempt to get around +% these problems. +% +% The PDF bookmark issue can easily be fixed with \sty{hyperref}'s +% \cs{texorpdfstring} which can simply use the expandable command +% in the PDF string case. The \TeX\ string case can now use +% \cs{glsxtrshort} with the \gloskey[glslink]{noindex} key set, which +% prevents the unwanted additions to the location list, and the +% \gloskey[glslink]{hyper} key set to false, which prevents the problem of +% nested links. This just leaves one thing left that needs to be +% dealt with, and that's what to do if the heading style +% uses \cs{MakeUppercase}. +% +% Note that \styfmt{glossaries} automatically loads \sty{textcase}, so +% the label can be protected from case change with \sty{textcase}'s +% \cs{NoCaseChange}. This means that we don't have a problem +% provided the page style uses \cs{MakeTextUppercase}, but the +% default heading page style uses \cs{MakeUppercase}. +% +% To get around this, save the original definition of \cs{markboth} +% and \cs{markright} and adjust it so that \cs{MakeUppercase} is +% temporarily redefined to \cs{MakeTextUppercase}. Some packages or +% classes redefine these commands, so we can't just assume they +% still have the original kernel definition. +% +%\begin{macro}{\markright} +% Save original definition: % \begin{macrocode} -\newabbreviationstyle{short-long-user}% -{% +\let\@glsxtr@org@markright\markright % \end{macrocode} -%\cs{glslonguserfont} is used in the description since \cs{glsdesc} -%doesn't set the style. +% Redefine (grouping not added in case it interferes with the +% original code): % \begin{macrocode} - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvuserfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - description={\protect\glslonguserfont{\the\glslongtok}},% - first={\protect\glsfirstabbrvuserfont{\the\glsshorttok}% - \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongtok}}% - {\the\glslabeltok}},% - firstplural={\protect\glsfirstabbrvuserfont{\the\glsshortpltok}% - \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongpltok}}% - {\the\glslabeltok}},% +\renewcommand*{\markright}[1]{% + \glsxtrmarkhook + \@glsxtr@org@markright{\@glsxtrinmark#1\@glsxtrnotinmark}% + \glsxtrrestoremarkhook +} % \end{macrocode} -%\changes{1.15}{2017-05-10}{fixed spelling of \cs{glsabbrvfont}} +%\end{macro} +% +%\begin{macro}{\markboth} +% Save original definition: % \begin{macrocode} - plural={\protect\glsabbrvuserfont{\the\glsshortpltok}}}% +\let\@glsxtr@org@markboth\markboth % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +% Redefine (grouping not added in case it interferes with the +% original code): % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% +\renewcommand*{\markboth}[2]{% + \glsxtrmarkhook + \@glsxtr@org@markboth + {\@glsxtrinmark#1\@glsxtrnotinmark}% + {\@glsxtrinmark#2\@glsxtrnotinmark}% + \glsxtrrestoremarkhook +} % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +%\end{macro} +% +%Also do this for \cs{@starttoc} +%\begin{macro}{\@starttoc} +% Save original definition: % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrusersuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvuserfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvuserfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonguserfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonguserfont{##1}}% +\let\@glsxtr@org@@starttoc\@starttoc % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +% Redefine: % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstabbrvuserfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslong{##1}}}{##1}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstabbrvuserfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtruserparen{\glsfirstlonguserfont{\glsaccesslongpl{##1}}}{##1}% - }% +\renewcommand*{\@starttoc}[1]{% + \glsxtrmarkhook + \@glsxtrinmark + \@glsxtr@org@@starttoc{#1}% + \@glsxtrnotinmark + \glsxtrrestoremarkhook } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{short-long-user-desc} -%\changes{1.04}{2016-05-02}{new} +% If this causes a problem provide a simple way of switching back to +% the original definitions: +%\begin{macro}{\glsxtrRevertMarks} % \begin{macrocode} -\newabbreviationstyle{short-long-user-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname}, - sort={\glsxtrshortlongdescsort},% +\newcommand*{\glsxtrRevertMarks}{% + \let\markright\@glsxtr@org@markright + \let\markboth\@glsxtr@org@markboth + \let\@starttoc\@glsxtr@org@@starttoc +} % \end{macrocode} -%\changes{1.17}{2017-08-09}{corrected first forms} +%\end{macro} +% +%\begin{macro}{\glsxtrifinmark} +%\changes{1.07}{2016-08-15}{new} % \begin{macrocode} - first={\protect\glsfirstabbrvuserfont{\the\glsshorttok}% - \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongtok}}% - {\the\glslabeltok}},% - firstplural={\protect\glsfirstabbrvuserfont{\the\glsshortpltok}% - \protect\glsxtruserparen{\protect\glsfirstlonguserfont{\the\glslongpltok}}% - {\the\glslabeltok}},% - text={\protect\glsabbrvfont{\the\glsshorttok}},% - plural={\protect\glsabbrvfont{\the\glsshortpltok}}% - }% +\newcommand*{\glsxtrifinmark}[2]{#2} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\@glsxtrinmark} +%\changes{1.07}{2016-08-15}{new} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-long-user}% +\newrobustcmd*{\@glsxtrinmark}{% + \let\glsxtrifinmark\@firstoftwo } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\subsection{Predefined Styles (Hyphen)} -%These styles are designed to work with the \catattr{markwords} -%attribute. They check if the inserted material (provided by the final -%optional argument of commands like \cs{gls}) starts with a hyphen. -%If it does, the insert is added to the parenthetical material. -%Note that commands like \cs{glsxtrlong} set \cs{glsinsert} to empty -%with the entire link-text stored in \cs{glscustomtext}. +%\begin{macro}{\@glsxtrnotinmark} +%\changes{1.07}{2016-08-15}{new} +% \begin{macrocode} +\newrobustcmd*{\@glsxtrnotinmark}{% + \let\glsxtrifinmark\@secondoftwo +} +% \end{macrocode} +%\end{macro} % -%\begin{macro}{\glsxtrifhyphenstart} -%Checks if the argument starts with a hyphen. The argument may be -%\cs{glsinsert} so check for that and expand. -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsxtrtitleorpdforheading} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newrobustcmd*{\glsxtrifhyphenstart}[3]{% - \ifx\glsinsert#1\relax - \expandafter\@glsxtrifhyphenstart#1\relax\relax - \@end@glsxtrifhyphenstart{#2}{#3}% - \else - \@glsxtrifhyphenstart#1\relax\relax\@end@glsxtrifhyphenstart{#2}{#3}% - \fi +\ifdef\texorpdfstring +{ + \newcommand*{\glsxtrtitleorpdforheading}[3]{\texorpdfstring{#1}{#2}} +} +{ + \newcommand*{\glsxtrtitleorpdforheading}[3]{#1} +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrmarkhook} +% Hook used in new definition of \cs{markboth} and \cs{markright} +% to make some changes to apply to the marks: +% \begin{macrocode} +\newcommand*{\glsxtrmarkhook}{% +% \end{macrocode} +% Save current definitions: +% \begin{macrocode} + \let\@glsxtr@org@MakeUppercase\MakeUppercase + \let\@glsxtr@org@glsxtrtitleorpdforheading\glsxtrtitleorpdforheading + \let\@glsxtr@org@glsxtrtitleshort\glsxtrtitleshort + \let\@glsxtr@org@glsxtrtitleshortpl\glsxtrtitleshortpl + \let\@glsxtr@org@Glsxtrtitleshort\Glsxtrtitleshort + \let\@glsxtr@org@Glsxtrtitleshortpl\Glsxtrtitleshortpl + \let\@glsxtr@org@glsxtrtitlename\glsxtrtitlename + \let\@glsxtr@org@Glsxtrtitlename\Glsxtrtitlename + \let\@glsxtr@org@glsxtrtitletext\glsxtrtitletext + \let\@glsxtr@org@Glsxtrtitletext\Glsxtrtitletext + \let\@glsxtr@org@glsxtrtitleplural\glsxtrtitleplural + \let\@glsxtr@org@Glsxtrtitleplural\Glsxtrtitleplural + \let\@glsxtr@org@glsxtrtitlefirst\glsxtrtitlefirst + \let\@glsxtr@org@Glsxtrtitlefirst\Glsxtrtitlefirst + \let\@glsxtr@org@glsxtrtitlefirstplural\glsxtrtitlefirstplural + \let\@glsxtr@org@Glsxtrtitlefirstplural\Glsxtrtitlefirstplural + \let\@glsxtr@org@glsxtrtitlelong\glsxtrtitlelong + \let\@glsxtr@org@glsxtrtitlelongpl\glsxtrtitlelongpl + \let\@glsxtr@org@Glsxtrtitlelong\Glsxtrtitlelong + \let\@glsxtr@org@Glsxtrtitlelongpl\Glsxtrtitlelongpl + \let\@glsxtr@org@glsxtrtitlefull\glsxtrtitlefull + \let\@glsxtr@org@glsxtrtitlefullpl\glsxtrtitlefullpl + \let\@glsxtr@org@Glsxtrtitlefull\Glsxtrtitlefull + \let\@glsxtr@org@Glsxtrtitlefullpl\Glsxtrtitlefullpl +% \end{macrocode} +% New definitions +% \begin{macrocode} + \let\glsxtrifinmark\@firstoftwo + \let\MakeUppercase\MakeTextUppercase + \let\glsxtrtitleorpdforheading\@thirdofthree + \let\glsxtrtitleshort\glsxtrheadshort + \let\glsxtrtitleshortpl\glsxtrheadshortpl + \let\Glsxtrtitleshort\Glsxtrheadshort + \let\Glsxtrtitleshortpl\Glsxtrheadshortpl + \let\glsxtrtitlename\glsxtrheadname + \let\Glsxtrtitlename\Glsxtrheadname + \let\glsxtrtitletext\glsxtrheadtext + \let\Glsxtrtitletext\Glsxtrheadtext + \let\glsxtrtitleplural\glsxtrheadplural + \let\Glsxtrtitleplural\Glsxtrheadplural + \let\glsxtrtitlefirst\glsxtrheadfirst + \let\Glsxtrtitlefirst\Glsxtrheadfirst + \let\glsxtrtitlefirstplural\glsxtrheadfirstplural + \let\Glsxtrtitlefirstplural\Glsxtrheadfirstplural + \let\glsxtrtitlelong\glsxtrheadlong + \let\glsxtrtitlelongpl\glsxtrheadlongpl + \let\Glsxtrtitlelong\Glsxtrheadlong + \let\Glsxtrtitlelongpl\Glsxtrheadlongpl + \let\glsxtrtitlefull\glsxtrheadfull + \let\glsxtrtitlefullpl\glsxtrheadfullpl + \let\Glsxtrtitlefull\Glsxtrheadfull + \let\Glsxtrtitlefullpl\Glsxtrheadfullpl } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtrifhyphenstart} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsxtrrestoremarkhook} +% Hook used in new definition of \cs{markboth} and \cs{markright} +% to restore the modified definitions. (This is in case the original +% \cs{markboth} and \cs{markright} shouldn't be grouped for some +% reason. There already is some grouping within those original +% definitions, but some of the code lies outside that grouping, and +% possibly there's a reason for it.) % \begin{macrocode} -\def\@glsxtrifhyphenstart#1#2\@end@glsxtrifhyphenstart#3#4{% - \ifx-#1\relax#3\else #4\fi +\newcommand*{\glsxtrrestoremarkhook}{% + \let\glsxtrifinmark\@secondoftwo + \let\MakeUppercase\@glsxtr@org@MakeUppercase + \let\glsxtrtitleorpdforheading\@glsxtr@org@glsxtrtitleorpdforheading + \let\glsxtrtitleshort\@glsxtr@org@glsxtrtitleshort + \let\glsxtrtitleshortpl\@glsxtr@org@glsxtrtitleshortpl + \let\Glsxtrtitleshort\@glsxtr@org@Glsxtrtitleshort + \let\Glsxtrtitleshortpl\@glsxtr@org@Glsxtrtitleshortpl + \let\glsxtrtitlename\@glsxtr@org@glsxtrtitlename + \let\Glsxtrtitlename\@glsxtr@org@Glsxtrtitlename + \let\glsxtrtitletext\@glsxtr@org@glsxtrtitletext + \let\Glsxtrtitletext\@glsxtr@org@Glsxtrtitletext + \let\glsxtrtitleplural\@glsxtr@org@glsxtrtitleplural + \let\Glsxtrtitleplural\@glsxtr@org@Glsxtrtitleplural + \let\glsxtrtitlefirst\@glsxtr@org@glsxtrtitlefirst + \let\Glsxtrtitlefirst\@glsxtr@org@Glsxtrtitlefirst + \let\glsxtrtitlefirstplural\@glsxtr@org@glsxtrtitlefirstplural + \let\Glsxtrtitlefirstplural\@glsxtr@org@Glsxtrtitlefirstplural + \let\glsxtrtitlelong\@glsxtr@org@glsxtrtitlelong + \let\glsxtrtitlelongpl\@glsxtr@org@glsxtrtitlelongpl + \let\Glsxtrtitlelong\@glsxtr@org@Glsxtrtitlelong + \let\Glsxtrtitlelongpl\@glsxtr@org@Glsxtrtitlelongpl + \let\glsxtrtitlefull\@glsxtr@org@glsxtrtitlefull + \let\glsxtrtitlefullpl\@glsxtr@org@glsxtrtitlefullpl + \let\Glsxtrtitlefull\@glsxtr@org@Glsxtrtitlefull + \let\Glsxtrtitlefullpl\@glsxtr@org@Glsxtrtitlefullpl } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrlonghyphenshort} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrlonghyphenshort}\marg{label}\marg{long}\marg{short}\marg{insert} -%\end{definition} -%The \meta{long} and \meta{short} arguments may be the plural form. -%The \meta{long} argument may also be the first letter uppercase form. -% \begin{macrocode} -\newcommand*{\glsxtrlonghyphenshort}[4]{% -% \end{macrocode} -% Grouping is needed to localise the redefinitions. +%\changes{0.5.1}{2015-12-07}{removed \cs{ifglsxtruseuchead}} +% Instead of using one document-wide conditional, use +% \catattr{headuc} attribute to determine whether or not to use the +% all upper case form. +% +%\begin{macro}{\glsxtrheadshort} +% Command used to display short form in the page header. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} +\newcommand*{\glsxtrheadshort}[1]{% + \protect\NoCaseChange {% -% \end{macrocode} -% If \meta{insert} starts with a hyphen, redefine \ics{glsxtrwordsep} -% to a hyphen. The inserted material is also inserted into the -% parenthetical part. (The inserted material is grouped as a -% precautionary measure.) No change is made to \cs{glsxtrwordsep} if -% \meta{insert} doesn't start with a hyphen. -% \begin{macrocode} - \glsxtrifhyphenstart{#4}{\def\glsxtrwordsep{-}}{}% - \glsfirstlonghyphenfont{#2\ifglsxtrinsertinside{#4}\fi}% - \ifglsxtrinsertinside\else{#4}\fi - \glsxtrfullsep{#1}% - \glsxtrparen{\glsfirstabbrvhyphenfont{#3\ifglsxtrinsertinside{#4}\fi}% - \ifglsxtrinsertinside\else{#4}\fi}% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrshort[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrshort[noindex,hyper=false]{#1}[]% + }% }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsabbrvhyphenfont} -%\changes{1.17}{2017-08-09}{new} -% \begin{macrocode} -\newcommand*{\glsabbrvhyphenfont}{\glsabbrvdefaultfont}% -% \end{macrocode} -%\end{macro} -%\begin{macro}{\glsfirstabbrvhyphenfont} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsxtrtitleshort} +% Command to display short form of abbreviation in section title and +% table of contents. % \begin{macrocode} -\newcommand*{\glsfirstabbrvhyphenfont}{\glsabbrvhyphenfont}% +\newrobustcmd*{\glsxtrtitleshort}[1]{% + \glsxtrshort[noindex,hyper=false]{#1}[]% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glslonghyphenfont} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\glsxtrheadshortpl} +% Command used to display plural short form in the page header. +% If you want the text converted to upper case, this needs to be +% redefined to use \cs{GLSxtrshortpl} instead. If you are using a +% smallcaps style, the default fonts don't provide italic smallcaps. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} -\newcommand*{\glslonghyphenfont}{\glslongdefaultfont}% +\newcommand*{\glsxtrheadshortpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrshortpl[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrshortpl[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstlonghyphenfont} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\glsxtrtitleshortpl} +% Command to display plural short form of abbreviation in section title and +% table of contents. +%\changes{1.03}{2016-04-27}{bug fix: changed \cs{glsxtrshort} to +%\cs{glsxtrshortpl}} % \begin{macrocode} -\newcommand*{\glsfirstlonghyphenfont}{\glslonghyphenfont}% +\newrobustcmd*{\glsxtrtitleshortpl}[1]{% + \glsxtrshortpl[noindex,hyper=false]{#1}[]% +} % \end{macrocode} %\end{macro} -% The default short form suffix: -%\begin{macro}{\glsxtrhyphensuffix} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\Glsxtrheadshort} +% Command used to display short form in the page header with the +% first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} -\newcommand*{\glsxtrhyphensuffix}{\glsxtrabbrvpluralsuffix} +\newcommand*{\Glsxtrheadshort}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrshort[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrshort[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-hyphen-short-hyphen} -%\changes{1.17}{2017-08-09}{new} -%Designed for use with the \catattr{markwords} attribute. -% \begin{macrocode} -\newabbreviationstyle{long-hyphen-short-hyphen}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% - description={\protect\glslonghyphenfont{\the\glslongtok}}}% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. -% \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\glsxtrhyphensuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% -% \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +%\begin{macro}{\Glsxtrtitleshort} +% Command to display short form of abbreviation in section title and +% table of contents with the first letter converted to upper case. % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsxtrlonghyphenshort{##1}{\glsaccesslong{##1}}{\glsaccessshort{##1}}{##2}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsxtrlonghyphenshort{##1}{\glsaccesslongpl{##1}}% - {\glsaccessshortpl{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsxtrlonghyphenshort{##1}{\Glsaccesslong{##1}}{\glsaccessshort{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsxtrlonghyphenshort{##1}{\Glsaccesslongpl{##1}}% - {\glsaccessshortpl{##1}}{##2}% - }% +\newrobustcmd*{\Glsxtrtitleshort}[1]{% + \Glsxtrshort[noindex,hyper=false]{#1}[]% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{long-hyphen-short-hyphen-desc} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{long-hyphen-short-hyphen} but the description -%must be supplied by the user. -% \begin{macrocode} -\newabbreviationstyle{long-hyphen-short-hyphen-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort}, - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}}},% - text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% - }% -% \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\begin{macro}{\Glsxtrheadshortpl} +% Command used to display plural short form in the page header with the +% first letter converted to upper case. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-hyphen-short-hyphen}% +\newcommand*{\Glsxtrheadshortpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrshortpl[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrshortpl[noindex,hyper=false]{#1}[]% + }% + }% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{macro}{\glsxtrlonghyphennoshort} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrlonghyphennoshort}\marg{label}\marg{long}\marg{insert} -%\end{definition} +%\begin{macro}{\Glsxtrtitleshortpl} +% Command to display plural short form of abbreviation in section title and +% table of contents with the first letter converted to upper case. % \begin{macrocode} -\newcommand*{\glsxtrlonghyphennoshort}[3]{% +\newrobustcmd*{\Glsxtrtitleshortpl}[1]{% + \Glsxtrshortpl[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Grouping is needed to localise the redefinitions. +%\end{macro} +% +%\begin{macro}{\glsxtrheadname} +% As above but for the \gloskey{name} value. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} +\newcommand*{\glsxtrheadname}[1]{% + \protect\NoCaseChange {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSname[noindex,hyper=false]{#1}[]% + }% + {% + \glsname[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% If \meta{insert} starts with a hyphen, redefine \ics{glsxtrwordsep} -% to a hyphen. The inserted material is also inserted into the -% parenthetical part. (The inserted material is grouped as a -% precautionary measure.) No change is made to \cs{glsxtrwordsep} if -% \meta{insert} doesn't start with a hyphen. +%\end{macro} +% +%\begin{macro}{\glsxtrtitlename} +% Command to display \gloskey{name} value in section title and +% table of contents. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% - \glsfirstlonghyphenfont{#2\ifglsxtrinsertinside{#3}\fi}% - \ifglsxtrinsertinside\else{#3}\fi +\newrobustcmd*{\glsxtrtitlename}[1]{% + \glsname[noindex,hyper=false]{#1}[]% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Glsxtrheadname} +% First letter converted to upper case +%\changes{1.21}{2017-11-03}{new} +% \begin{macrocode} +\newcommand*{\Glsxtrheadname}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSname[noindex,hyper=false]{#1}[]% + }% + {% + \Glsname[noindex,hyper=false]{#1}[]% + }% }% } % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-hyphen-noshort-desc-noreg} -%\changes{1.17}{2017-08-09}{new} -%This version doesn't show the short form (except -%explicitly with \cs{glsxtrshort}). Since \cs{glsxtrshort} doesn't -%support the hyphen switch, the short form just uses the default -%short-form font command. This style won't work with the -%\catattr{regular} as the regular form isn't flexible enough. +%\begin{macro}{\Glsxtrtitlename} +% Command to display \gloskey{name} value in section title and +% table of contents with the first letter changed to upper case. % \begin{macrocode} -\newabbreviationstyle{long-hyphen-noshort-desc-noreg}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\protect\glslonghyphenfont{\the\glslongtok}}, - sort={\expandonce\glsxtrorglong}, - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% - plural={\protect\glslonghyphenfont{\the\glslongpltok}}% - }% +%\changes{1.21}{2017-11-03}{new} +\newrobustcmd*{\Glsxtrtitlename}[1]{% + \Glsname[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\glsxtrheadtext} +% As above but for the \gloskey{text} value. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-hyphen-short-hyphen}% +\newcommand*{\glsxtrheadtext}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLStext[noindex,hyper=false]{#1}[]% + }% + {% + \glstext[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +%\end{macro} +% +%\begin{macro}{\glsxtrtitletext} +% Command to display \gloskey{text} value in section title and +% table of contents. % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +\newrobustcmd*{\glsxtrtitletext}[1]{% + \glstext[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% The format for subsequent use (not used when the regular attribute -% is set). +%\end{macro} +% +% +%\begin{macro}{\Glsxtrheadtext} +% First letter converted to upper case +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% - }% +\newcommand*{\Glsxtrheadtext}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLStext[noindex,hyper=false]{#1}[]% + }% + {% + \Glstext[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% The inline full form displays the long format followed by the -% short form in parentheses. +%\end{macro} +% +%\begin{macro}{\Glsxtrtitletext} +% Command to display \gloskey{text} value in section title and +% table of contents with the first letter changed to upper case. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% - }% +\newrobustcmd*{\Glsxtrtitletext}[1]{% + \Glstext[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% The first use full form only displays the long form. +%\end{macro} +% +%\begin{macro}{\glsxtrheadplural} +% As above but for the \gloskey{plural} value. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\glsaccesslongpl{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsxtrlonghyphennoshort{##1}{\Glsaccesslongpl{##1}}{##2}% - }% +\newcommand*{\glsxtrheadplural}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSplural[noindex,hyper=false]{#1}[]% + }% + {% + \glsplural[noindex,hyper=false]{#1}[]% + }% + }% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{long-hyphen-noshort-noreg} -% It doesn't really make a great deal of sense to have a long-only -% style that doesn't have a descriptionnless no glossary is -% required), but the best course of -% action here is to use the short form as the name and the long -% form as the description. +%\begin{macro}{\glsxtrtitleplural} +% Command to display \gloskey{plural} value in section title and +% table of contents. % \begin{macrocode} -\newabbreviationstyle{long-hyphen-noshort-noreg}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% - text={\protect\glslonghyphenfont{\the\glslongtok}},% - plural={\protect\glslonghyphenfont{\the\glslongpltok}},% - description={\the\glslongtok}% - }% +\newrobustcmd*{\glsxtrtitleplural}[1]{% + \glsplural[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\Glsxtrheadplural} +% Convert first letter to upper case. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-desc}% +\newcommand*{\Glsxtrheadplural}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSplural[noindex,hyper=false]{#1}[]% + }% + {% + \Glsplural[noindex,hyper=false]{#1}[]% + }% + }% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{macro}{\glsxtrlonghyphen} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrlonghyphen}\marg{long}\marg{label}\marg{insert} -%\end{definition} -%Used by \abbrstyle{long-hyphen-postshort-hyphen}. The \meta{insert} -%is check to determine if it starts with a hyphen but isn't used -%here as it's moved to the post-link hook. -% \begin{macrocode} -\newcommand*{\glsxtrlonghyphen}[3]{% -% \end{macrocode} -% Grouping is needed to localise the redefinitions. +%\begin{macro}{\Glsxtrtitleplural} +% Command to display \gloskey{plural} value in section title and +% table of contents with the first letter changed to upper case. % \begin{macrocode} - {% - \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% - \glsfirstlonghyphenfont{#1}% - }% +\newrobustcmd*{\Glsxtrtitleplural}[1]{% + \Glsplural[noindex,hyper=false]{#1}[]% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrposthyphenshort} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrposthyphenshort}\marg{label}\marg{insert} -%\end{definition} -%Used in the post-link hook for the -%\abbrstyle{long-hyphen-postshort-hyphen} style. Much like -%\cs{glsxtrlonghyphenshort} but omits the \meta{long} part. This -%always uses the singular short form. +%\begin{macro}{\glsxtrheadfirst} +% As above but for the \gloskey{first} value. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} -\newcommand*{\glsxtrposthyphenshort}[2]{% +\newcommand*{\glsxtrheadfirst}[1]{% + \protect\NoCaseChange {% - \glsxtrifhyphenstart{#2}{\def\glsxtrwordsep{-}}{}% - \ifglsxtrinsertinside{\glsfirstlonghyphenfont{#2}}\else{#2}\fi - \glsxtrfullsep{#1}% - \glsxtrparen - {\glsfirstabbrvhyphenfont{\glsentryshort{#1}\ifglsxtrinsertinside{#2}\fi}% - \ifglsxtrinsertinside\else{#2}\fi + \glsifattribute{#1}{headuc}{true}% + {% + \GLSfirst[noindex,hyper=false]{#1}[]% + }% + {% + \glsfirst[noindex,hyper=false]{#1}[]% }% }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrposthyphensubsequent} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrposthyphensubsequent}\marg{label}\marg{insert} -%\end{definition} -%Format in the post-link hook for subsequent use. The label is -%ignored by default. +%\begin{macro}{\glsxtrtitlefirst} +% Command to display \gloskey{first} value in section title and +% table of contents. % \begin{macrocode} -\newcommand*{\glsxtrposthyphensubsequent}[2]{% - \glsabbrvfont{\ifglsxtrinsertinside {#2}\fi}% - \ifglsxtrinsertinside \else{#2}\fi +\newrobustcmd*{\glsxtrtitlefirst}[1]{% + \glsfirst[noindex,hyper=false]{#1}[]% } % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-hyphen-postshort-hyphen} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{long-hyphen-short-hyphen} but shifts the insert -%and parenthetical material to the post-link hook. +%\begin{macro}{\Glsxtrheadfirst} +% First letter converted to upper case +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} -\newabbreviationstyle{long-hyphen-postshort-hyphen}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% - description={\protect\glslonghyphenfont{\the\glslongtok}}}% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtrposthyphenshort{\glslabel}{\glsinsert}% - }% - {% +\newcommand*{\Glsxtrheadfirst}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSfirst[noindex,hyper=false]{#1}[]% + }% + {% + \Glsfirst[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Put the insertion into the post-link: +%\end{macro} +% +%\begin{macro}{\Glsxtrtitlefirst} +% Command to display \gloskey{first} value in section title and +% table of contents with the first letter changed to upper case. % \begin{macrocode} - \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% - }% - }% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% +\newrobustcmd*{\Glsxtrtitlefirst}[1]{% + \Glsfirst[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +%\end{macro} +% +%\begin{macro}{\glsxtrheadfirstplural} +% As above but for the \gloskey{firstplural} value. +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +\newcommand*{\glsxtrheadfirstplural}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSfirstplural[noindex,hyper=false]{#1}[]% + }% + {% + \glsfirstplural[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Subsequent use needs to omit the insertion: +%\end{macro} +% +%\begin{macro}{\glsxtrtitlefirstplural} +% Command to display \gloskey{firstplural} value in section title and +% table of contents. % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\glsaccessshort{##1}}% - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\glsaccessshortpl{##1}}% - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\Glsaccessshort{##1}}% - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\Glsaccessshortpl{##1}}% - }% +\newrobustcmd*{\glsxtrtitlefirstplural}[1]{% + \glsfirstplural[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% First use full form: +%\end{macro} +% +%\begin{macro}{\Glsxtrheadfirstplural} +% First letter converted to upper case +%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsxtrlonghyphen{\glsaccesslong{##1}}{##1}{##2}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsxtrlonghyphen{\glsaccesslongpl{##1}}{##1}{##2}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsxtrlonghyphen{\Glsaccesslong{##1}}{##1}{##2}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsxtrlonghyphen{\Glsaccesslongpl{##1}}{##1}{##2}% - }% +\newcommand*{\Glsxtrheadfirstplural}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSfirstplural[noindex,hyper=false]{#1}[]% + }% + {% + \Glsfirstplural[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% In-line format. +%\end{macro} +% +%\begin{macro}{\Glsxtrtitlefirstplural} +% Command to display \gloskey{first} value in section title and +% table of contents with the first letter changed to upper case. % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlonghyphenfont{\glsaccesslong{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlonghyphenfont{\glsaccesslongpl{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlonghyphenfont{\Glsaccesslong{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlonghyphenfont{\Glsaccesslongpl{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% +\newrobustcmd*{\Glsxtrtitlefirstplural}[1]{% + \Glsfirstplural[noindex,hyper=false]{#1}[]% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{long-hyphen-postshort-hyphen-desc} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{long-hyphen-postshort-hyphen} but the description -%must be supplied by the user. +%\begin{macro}{\glsxtrheadlong} +% Command used to display long form in the page header. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newabbreviationstyle{long-hyphen-postshort-hyphen-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrlongshortdescname}, - sort={\glsxtrlongshortdescsort},% - first={\protect\glsfirstlonghyphenfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlonghyphenfont{\the\glslongpltok}},% - text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtrposthyphenshort{\glslabel}{\glsinsert}% - }% - {% +\newcommand*{\glsxtrheadlong}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrlong[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrlong[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Put the insertion into the post-link: +%\end{macro} +% +%\begin{macro}{\glsxtrtitlelong} +% Command to display long form of abbreviation in section title and +% table of contents. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% - }% - }% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-hyphen-postshort-hyphen}% +\newrobustcmd*{\glsxtrtitlelong}[1]{% + \glsxtrlong[noindex,hyper=false]{#1}[]% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{macro}{\glsxtrshorthyphenlong} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrshorthyphenlong}\marg{label}\marg{short}\marg{long}\marg{insert} -%\end{definition} -%The \meta{long} and \meta{short} arguments may be the plural form. -%The \meta{long} argument may also be the first letter uppercase form. +%\begin{macro}{\glsxtrheadlongpl} +% Command used to display plural long form in the page header. +% If you want the text converted to upper case, this needs to be +% redefined to use \cs{GLSxtrlongpl} instead. If you are using a +% smallcaps style, the default fonts don't provide italic smallcaps. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\glsxtrshorthyphenlong}[4]{% +\newcommand*{\glsxtrheadlongpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrlongpl[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrlongpl[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Grouping is needed to localise the redefinitions. +%\end{macro} +% +%\begin{macro}{\glsxtrtitlelongpl} +% Command to display plural long form of abbreviation in section title and +% table of contents. +%\changes{1.02}{2016-04-25}{new} +%\changes{1.03}{2016-04-27}{bug fix: changed \cs{glsxtrlong} to +%\cs{glsxtrlongpl}} % \begin{macrocode} - {% +\newrobustcmd*{\glsxtrtitlelongpl}[1]{% + \glsxtrlongpl[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% If \meta{insert} starts with a hyphen, redefine \cs{glsxtrwordsep} -% to a hyphen. The inserted material is also inserted into the -% parenthetical part. (The inserted material is grouped as a -% precautionary measure.) +%\end{macro} +% +%\begin{macro}{\Glsxtrheadlong} +% Command used to display long form in the page header with the +% first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \glsxtrifhyphenstart{#4}{\def\glsxtrwordsep{-}}{}% - \glsfirstabbrvhyphenfont{#2\ifglsxtrinsertinside{#4}\fi}% - \ifglsxtrinsertinside\else{#4}\fi - \glsxtrfullsep{#1}% - \glsxtrparen{\glsfirstlonghyphenfont{#3\ifglsxtrinsertinside{#4}\fi}% - \ifglsxtrinsertinside\else{#4}\fi}% +\newcommand*{\Glsxtrheadlong}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrlong[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrlong[noindex,hyper=false]{#1}[]% + }% }% } % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{short-hyphen-long-hyphen} -%\changes{1.17}{2017-08-09}{new} -%Designed for use with the \catattr{markwords} attribute. +%\begin{macro}{\Glsxtrtitlelong} +% Command to display long form of abbreviation in section title and +% table of contents with the first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newabbreviationstyle{short-hyphen-long-hyphen}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongpltok}}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% - description={\protect\glslonghyphenfont{\the\glslongtok}}}% +\newrobustcmd*{\Glsxtrtitlelong}[1]{% + \Glsxtrlong[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\Glsxtrheadlongpl} +% Command used to display plural long form in the page header with the +% first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\glsxtrhyphensuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +\newcommand*{\Glsxtrheadlongpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrlongpl[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrlongpl[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% The first use full form and the inline full form are the same for -% this style. +%\end{macro} +% +%\begin{macro}{\Glsxtrtitlelongpl} +% Command to display plural long form of abbreviation in section title and +% table of contents with the first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsxtrshorthyphenlong{##1}{\glsaccessshort{##1}}{\glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsxtrshorthyphenlong{##1}% - {\glsaccessshortpl{##1}}{\glsaccesslongpl{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsxtrshorthyphenlong{##1}{\glsaccessshort{##1}}{\Glsaccesslong{##1}}{##2}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsxtrshorthyphenlong{##1}% - {\glsaccessshortpl{##1}}{\Glsaccesslongpl{##1}}{##2}% - }% +\newrobustcmd*{\Glsxtrtitlelongpl}[1]{% + \Glsxtrlongpl[noindex,hyper=false]{#1}[]% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{abbrvstyle}{short-hyphen-long-hyphen-desc} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{short-hyphen-long-hyphen} but the description -%must be supplied by the user. +%\begin{macro}{\glsxtrheadfull} +% Command used to display full form in the page header. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newabbreviationstyle{short-hyphen-long-hyphen-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname}, - sort={\glsxtrshortlongdescsort}, - first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}% - \protect\glsxtrfullsep{\the\glslabeltok}% - \glsxtrparen{\protect\glsfirstlonghyphenfont{\the\glslongpltok}}},% - text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% - }% +\newcommand*{\glsxtrheadfull}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrfull[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrfull[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\glsxtrtitlefull} +% Command to display full form of abbreviation in section title and +% table of contents. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-hyphen-long-hyphen}% +\newrobustcmd*{\glsxtrtitlefull}[1]{% + \glsxtrfull[noindex,hyper=false]{#1}[]% } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{macro}{\glsxtrshorthyphen} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrshorthyphen}\marg{short}\marg{label}\marg{insert} -%\end{definition} -%Used by \abbrstyle{short-hyphen-postlong-hyphen}. The \meta{insert} -%is check to determine if it starts with a hyphen but isn't used -%here as it's moved to the post-link hook. +%\begin{macro}{\glsxtrheadfullpl} +% Command used to display plural full form in the page header. +% If you want the text converted to upper case, this needs to be +% redefined to use \cs{GLSxtrfullpl} instead. If you are using a +% smallcaps style, the default fonts don't provide italic smallcaps. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\glsxtrshorthyphen}[3]{% +\newcommand*{\glsxtrheadfullpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrfullpl[noindex,hyper=false]{#1}[]% + }% + {% + \glsxtrfullpl[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% Grouping is needed to localise the redefinitions. +%\end{macro} +% +%\begin{macro}{\glsxtrtitlefullpl} +% Command to display plural full form of abbreviation in section title and +% table of contents. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - {% - \glsxtrifhyphenstart{#3}{\def\glsxtrwordsep{-}}{}% - \glsfirstabbrvhyphenfont{#1}% - }% +\newrobustcmd*{\glsxtrtitlefullpl}[1]{% + \glsxtrfullpl[noindex,hyper=false]{#1}[]% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrposthyphenlong} -%\changes{1.17}{2017-08-09}{new} -%\begin{definition} -%\cs{glsxtrposthyphenlong}\marg{label}\marg{insert} -%\end{definition} -%Used in the post-link hook for the -%\abbrstyle{short-hyphen-postlong-hyphen} style. Much like -%\cs{glsxtrshorthyphenlong} but omits the \meta{short} part. This -%always uses the singular long form. +%\begin{macro}{\Glsxtrheadfull} +% Command used to display full form in the page header with the +% first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\glsxtrposthyphenlong}[2]{% +\newcommand*{\Glsxtrheadfull}[1]{% + \protect\NoCaseChange {% - \glsxtrifhyphenstart{#2}{\def\glsxtrwordsep{-}}{}% - \ifglsxtrinsertinside{\glsfirstabbrvhyphenfont{#2}}\else{#2}\fi - \glsxtrfullsep{#1}% - \glsxtrparen - {\glsfirstlonghyphenfont{\glsentrylong{#1}\ifglsxtrinsertinside{#2}\fi}% - \ifglsxtrinsertinside\else{#2}\fi + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrfull[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrfull[noindex,hyper=false]{#1}[]% }% }% } % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{short-hyphen-postlong-hyphen} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{short-hyphen-long-hyphen} but shifts the insert -%and parenthetical material to the post-link hook. +%\begin{macro}{\Glsxtrtitlefull} +% Command to display full form of abbreviation in section title and +% table of contents with the first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newabbreviationstyle{short-hyphen-postlong-hyphen}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvhyphenfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}},% - description={\protect\glslonghyphenfont{\the\glslongtok}}}% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtrposthyphenlong{\glslabel}{\glsinsert}% - }% - {% +\newrobustcmd*{\Glsxtrtitlefull}[1]{% + \Glsxtrfull[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Put the insertion into the post-link: +%\end{macro} +% +%\begin{macro}{\Glsxtrheadfullpl} +% Command used to display plural full form in the page header with the +% first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% - }% - }% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% +\newcommand*{\Glsxtrheadfullpl}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSxtrfullpl[noindex,hyper=false]{#1}[]% + }% + {% + \Glsxtrfullpl[noindex,hyper=false]{#1}[]% + }% + }% +} % \end{macrocode} -% In case the user wants to mix and match font styles, these are -% redefined here. +%\end{macro} +% +%\begin{macro}{\Glsxtrtitlefullpl} +% Command to display plural full form of abbreviation in section title and +% table of contents with the first letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbrvpluralsuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvhyphenfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlonghyphenfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslonghyphenfont{##1}}% +\newrobustcmd*{\Glsxtrtitlefullpl}[1]{% + \Glsxtrfullpl[noindex,hyper=false]{#1}[]% +} % \end{macrocode} -% Subsequent use needs to omit the insertion: +%\end{macro} +% +%\begin{macro}{\glsfmtshort} +% Provide a way of using the formatted short form in section +% headings. If \sty{hyperref} has been loaded, use +% \cs{texorpdfstring} for convenience in PDF bookmarks. +%\changes{0.2}{2015-11-30}{new} +%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshort}} +%\changes{0.5}{2015-12-07}{changed to use \cs{glsxtrtitleshort}} +%\changes{0.5}{2015-12-07}{renamed from \cs{glsentryfmtshort}} % \begin{macrocode} - \renewcommand*{\glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\glsaccessshort{##1}}% - }% - \renewcommand*{\glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\glsaccessshortpl{##1}}% - }% - \renewcommand*{\Glsxtrsubsequentfmt}[2]{% - \glsabbrvfont{\Glsaccessshort{##1}}% - }% - \renewcommand*{\Glsxtrsubsequentplfmt}[2]{% - \glsabbrvfont{\Glsaccessshortpl{##1}}% - }% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtshort}[1]{% + \texorpdfstring + {\glsxtrtitleshort{#1}}% + {\glsentryshort{#1}}% + } +} +{ + \newcommand*{\glsfmtshort}[1]{% + \glsxtrtitleshort{#1}} +} % \end{macrocode} -% First use full form: +%\end{macro} +%Similarly for the plural version. +%\begin{macro}{\glsfmtshortpl} +%\changes{0.2}{2015-11-30}{new} +%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshortpl}} +%\changes{0.5}{2015-12-07}{changed to use \cs{glsxtrtitleshortpl}} +%\changes{0.5}{2015-12-07}{renamed from \cs{glsentryfmtshortpl}} % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsxtrshorthyphen{\glsaccessshort{##1}}{##1}{##2}% - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsxtrshorthyphen{\glsaccessshortpl{##1}}{##1}{##2}% - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsxtrshorthyphen{\Glsaccessshort{##1}}{##1}{##2}% - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsxtrshorthyphen{\Glsaccessshortpl{##1}}{##1}{##2}% - }% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtshortpl}[1]{% + \texorpdfstring + {\glsxtrtitleshortpl{#1}}% + {\glsentryshortpl{#1}}% + } +} +{ + \newcommand*{\glsfmtshortpl}[1]{% + \glsxtrtitleshortpl{#1}} +} % \end{macrocode} -% In-line format. Commands like \cs{glsxtrfull} set \cs{glsinsert} -% to empty. The entire link-text (provided by the following -% commands) is stored in \cs{glscustomtext}. +%\end{macro} +% The case-changing version isn't suitable for PDF bookmarks, so the +% PDF alternative uses the non-case-changing version. +%\begin{macro}{\Glsfmtshort} +% Singular form (first letter uppercase). +%\changes{0.2}{2015-11-30}{new} +%\changes{0.4}{2015-12-03}{changed to use \cs{Glsxtrshort}} +%\changes{0.5}{2015-12-07}{changed to use \cs{Glsxtrtitleshort}} +%\changes{0.5}{2015-12-07}{renamed from \cs{Glsentryfmtshort}} % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstabbrvhyphenfont{\glsaccessshort{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvhyphenfont{\glsaccessshortpl{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstabbrvhyphenfont{\Glsaccessshort{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstabbrvhyphenfont{\Glsaccessshortpl{##1}% - \ifglsxtrinsertinside{##2}\fi}% - \ifglsxtrinsertinside \else{##2}\fi - }% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtshort}[1]{% + \texorpdfstring + {\Glsxtrtitleshort{#1}}% + {\glsentryshort{#1}}% + } +} +{ + \newcommand*{\Glsfmtshort}[1]{% + \Glsxtrtitleshort{#1}} } % \end{macrocode} -%\end{abbrvstyle} -% -%\begin{abbrvstyle}{short-hyphen-postlong-hyphen-desc} -%\changes{1.17}{2017-08-09}{new} -%Like \abbrstyle{short-hyphen-postlong-hyphen} but the description -%must be supplied by the user. +%\end{macro} +%\begin{macro}{\Glsfmtshortpl} +%Plural form (first letter uppercase). +%\changes{0.2}{2015-11-30}{new} +%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshortpl}} +%\changes{0.5}{2015-12-07}{changed to use \cs{Glsxtrtitleshortpl}} +%\changes{0.5}{2015-12-07}{renamed from \cs{Glsentryfmtshortpl}} % \begin{macrocode} -\newabbreviationstyle{short-hyphen-postlong-hyphen-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtrshortlongdescname}, - sort={\glsxtrshortlongdescsort},% - first={\protect\glsfirstabbrvhyphenfont{\the\glsshorttok}},% - firstplural={\protect\glsfirstabbrvhyphenfont{\the\glsshortpltok}},% - text={\protect\glsabbrvhyphenfont{\the\glsshorttok}},% - plural={\protect\glsabbrvhyphenfont{\the\glsshortpltok}}% - }% - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \csdef{glsxtrpostlink\glscategorylabel}{% - \glsxtrifwasfirstuse - {% - \glsxtrposthyphenlong{\glslabel}{\glsinsert}% - }% - {% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtshortpl}[1]{% + \texorpdfstring + {\Glsxtrtitleshortpl{#1}}% + {\glsentryshortpl{#1}}% + } +} +{ + \newcommand*{\Glsfmtshortpl}[1]{% + \Glsxtrtitleshortpl{#1}} +} % \end{macrocode} -% Put the insertion into the post-link: +%\end{macro} +% +%\begin{macro}{\glsfmtname} +%As above but for the \gloskey{name} value. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \glsxtrposthyphensubsequent{\glslabel}{\glsinsert}% - }% - }% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{short-hyphen-postlong-hyphen}% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtname}[1]{% + \texorpdfstring + {\glsxtrtitlename{#1}}% + {\glsentryname{#1}}% + } +} +{ + \newcommand*{\glsfmtname}[1]{% + \glsxtrtitlename{#1}} } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\subsection{Predefined Styles (No Short on First Use)} -%These styles show only the long form on first use and only the -%short form on subsequent use. -%\begin{macro}{\glsabbrvonlyfont} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\Glsfmtname} +%First letter converted to upper case. +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\glsabbrvonlyfont}{\glsabbrvdefaultfont}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtname}[1]{% + \texorpdfstring + {\Glsxtrtitlename{#1}}% + {\glsentryname{#1}}% + } +} +{ + \newcommand*{\Glsfmtname}[1]{% + \Glsxtrtitlename{#1}} +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstabbrvonlyfont} -%\changes{1.17}{2017-08-09}{new} +% +% +%\begin{macro}{\glsfmttext} +%As above but for the \gloskey{text} value. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsfirstabbrvonlyfont}{\glsabbrvonlyfont}% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmttext}[1]{% + \texorpdfstring + {\glsxtrtitletext{#1}}% + {\glsentrytext{#1}}% + } +} +{ + \newcommand*{\glsfmttext}[1]{% + \glsxtrtitletext{#1}} +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glslongonlyfont} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\Glsfmttext} +%First letter converted to upper case. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glslongonlyfont}{\glslongdefaultfont}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmttext}[1]{% + \texorpdfstring + {\Glsxtrtitletext{#1}}% + {\glsentrytext{#1}}% + } +} +{ + \newcommand*{\Glsfmttext}[1]{% + \Glsxtrtitletext{#1}} +} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsfirstlongonlyfont} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\glsfmtplural} +%As above but for the \gloskey{plural} value. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsfirstlongonlyfont}{\glslongonlyfont}% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtplural}[1]{% + \texorpdfstring + {\glsxtrtitleplural{#1}}% + {\glsentryplural{#1}}% + } +} +{ + \newcommand*{\glsfmtplural}[1]{% + \glsxtrtitleplural{#1}} +} % \end{macrocode} %\end{macro} -% The default short form suffix: -%\begin{macro}{\glsxtronlysuffix} -%\changes{1.17}{2017-08-09}{new} +% +%\begin{macro}{\Glsfmtplural} +%First letter converted to upper case. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newcommand*{\glsxtronlysuffix}{\glsxtrabbrvpluralsuffix} +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtplural}[1]{% + \texorpdfstring + {\Glsxtrtitleplural{#1}}% + {\glsentryplural{#1}}% + } +} +{ + \newcommand*{\Glsfmtplural}[1]{% + \Glsxtrtitleplural{#1}} +} % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-only-short-only} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsfmtfirst} +%As above but for the \gloskey{first} value. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} -\newabbreviationstyle{long-only-short-only}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\protect\glsabbrvonlyfont{\the\glsshorttok}}, - sort={\the\glsshorttok}, - first={\protect\glsfirstlongonlyfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlongonlyfont{\the\glslongpltok}},% - plural={\protect\glsabbrvonlyfont{\the\glsshortpltok}},% - description={\protect\glslongonlyfont{\the\glslongtok}}}% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtfirst}[1]{% + \texorpdfstring + {\glsxtrtitlefirst{#1}}% + {\glsentryfirst{#1}}% + } +} +{ + \newcommand*{\glsfmtfirst}[1]{% + \glsxtrtitlefirst{#1}} +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\Glsfmtfirst} +%First letter converted to upper case. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtronlysuffix}% - \renewcommand*{\glsabbrvfont}[1]{\glsabbrvonlyfont{##1}}% - \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvonlyfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongonlyfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongonlyfont{##1}}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtfirst}[1]{% + \texorpdfstring + {\Glsxtrtitlefirst{#1}}% + {\glsentryfirst{#1}}% + } +} +{ + \newcommand*{\Glsfmtfirst}[1]{% + \Glsxtrtitlefirst{#1}} +} % \end{macrocode} -% The first use full form doesn't show the short form. +%\end{macro} +% +%\begin{macro}{\glsfmtfirstpl} +%As above but for the \gloskey{firstplural} value. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} - \renewcommand*{\glsxtrfullformat}[2]{% - \glsfirstlongonlyfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\glsxtrfullplformat}[2]{% - \glsfirstlongonlyfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullformat}[2]{% - \glsfirstlongonlyfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% - \renewcommand*{\Glsxtrfullplformat}[2]{% - \glsfirstlongonlyfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - }% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtfirstpl}[1]{% + \texorpdfstring + {\glsxtrtitlefirstplural{#1}}% + {\glsentryfirstplural{#1}}% + } +} +{ + \newcommand*{\glsfmtfirstpl}[1]{% + \glsxtrtitlefirstplural{#1}} +} % \end{macrocode} -% The inline full form does show the short form. +%\end{macro} +% +%\begin{macro}{\Glsfmtfirstpl} +%First letter converted to upper case. +%\changes{0.5}{2015-12-07}{new} % \begin{macrocode} - \renewcommand*{\glsxtrinlinefullformat}[2]{% - \glsfirstlongonlyfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshort{##1}}}% - }% - \renewcommand*{\glsxtrinlinefullplformat}[2]{% - \glsfirstlongonlyfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \glsfirstlongonlyfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvonlyfont{\glsaccessshortpl{##1}}}% - }% - \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \glsfirstlongonlyfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}% - \ifglsxtrinsertinside\else##2\fi - \glsxtrfullsep{##1}% - \glsxtrparen{\protect\glsfirstabbrvonlyfont{\Glsaccessshortpl{##1}}}% - }% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtfirstpl}[1]{% + \texorpdfstring + {\Glsxtrtitlefirstplural{#1}}% + {\glsentryfirstplural{#1}}% + } +} +{ + \newcommand*{\Glsfmtfirstpl}[1]{% + \Glsxtrtitlefirstplural{#1}} } % \end{macrocode} -%\end{abbrvstyle} +%\end{macro} % -%\begin{macro}{\glsxtronlydescsort} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsfmtlong} +%As above but for the \gloskey{long} value. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\glsxtronlydescsort}{\the\glslongtok} +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtlong}[1]{% + \texorpdfstring + {\glsxtrtitlelong{#1}}% + {\glsentrylong{#1}}% + } +} +{ + \newcommand*{\glsfmtlong}[1]{% + \glsxtrtitlelong{#1}} +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtronlydescname} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\Glsfmtlong} +%First letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\glsxtronlydescname}{% - \protect\glslongfont{\the\glslongtok}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtlong}[1]{% + \texorpdfstring + {\Glsxtrtitlelong{#1}}% + {\glsentrylong{#1}}% + } +} +{ + \newcommand*{\Glsfmtlong}[1]{% + \Glsxtrtitlelong{#1}} } % \end{macrocode} %\end{macro} % -%\begin{abbrvstyle}{long-only-short-only-desc} -%\changes{1.17}{2017-08-09}{new} +%\begin{macro}{\glsfmtlongpl} +%As above but for the \gloskey{longplural} value. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newabbreviationstyle{long-only-short-only-desc}% -{% - \renewcommand*{\CustomAbbreviationFields}{% - name={\glsxtronlydescname}, - sort={\glsxtronlydescsort},% - first={\protect\glsfirstlongonlyfont{\the\glslongtok}},% - firstplural={\protect\glsfirstlongonlyfont{\the\glslongpltok}},% - text={\protect\glsabbrvonlyfont{\the\glsshorttok}},% - plural={\protect\glsabbrvonlyfont{\the\glsshortpltok}}% - }% +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtlongpl}[1]{% + \texorpdfstring + {\glsxtrtitlelongpl{#1}}% + {\glsentrylongpl{#1}}% + } +} +{ + \newcommand*{\glsfmtlongpl}[1]{% + \glsxtrtitlelongpl{#1}} +} % \end{macrocode} -% Unset the \catattr{regular} attribute if it has been set. +%\end{macro} +% +%\begin{macro}{\Glsfmtlongpl} +%First letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} - \renewcommand*{\GlsXtrPostNewAbbreviation}{% - \glshasattribute{\the\glslabeltok}{regular}% - {% - \glssetattribute{\the\glslabeltok}{regular}{false}% - }% - {}% - }% -}% -{% - \GlsXtrUseAbbrStyleFmts{long-only-short-only}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtlongpl}[1]{% + \texorpdfstring + {\Glsxtrtitlelongpl{#1}}% + {\glsentrylongpl{#1}}% + } +} +{ + \newcommand*{\Glsfmtlongpl}[1]{% + \Glsxtrtitlelongpl{#1}} } % \end{macrocode} -%\end{abbrvstyle} -% -%\section{Using Entries in Headings} -% -% There are four main problems with using entries in sectioning -% commands: they can mess with the first use flag if they end up in -% the table of contents, they can add unwanted numbers to the -% entry's location list, the label is corrupted if used inside -% \ics{MakeUppercase} (which is used by the default headings style) -% and they need to be expandable for PDF bookmarks. The -% \styfmt{glossaries} package therefore recommends the use of the -% expandable commands, such as \cs{glsentryshort}, instead but this -% doesn't reflect the formatting since it doesn't include -% \cs{glsabbrvfont}. The commands below are an attempt to get around -% these problems. -% -% The PDF bookmark issue can easily be fixed with \sty{hyperref}'s -% \cs{texorpdfstring} which can simply use the expandable command -% in the PDF string case. The \TeX\ string case can now use -% \cs{glsxtrshort} with the \gloskey[glslink]{noindex} key set, which -% prevents the unwanted additions to the location list, and the -% \gloskey[glslink]{hyper} key set to false, which prevents the problem of -% nested links. This just leaves one thing left that needs to be -% dealt with, and that's what to do if the heading style -% uses \cs{MakeUppercase}. +%\end{macro} % -% Note that \styfmt{glossaries} automatically loads \sty{textcase}, so -% the label can be protected from case change with \sty{textcase}'s -% \cs{NoCaseChange}. This means that we don't have a problem -% provided the page style uses \cs{MakeTextUppercase}, but the -% default heading page style uses \cs{MakeUppercase}. +%\begin{macro}{\glsfmtfull} +%In-line full format. +%\changes{1.02}{2016-04-25}{new} +% \begin{macrocode} +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtfull}[1]{% + \texorpdfstring + {\glsxtrtitlefull{#1}}% + {\glsxtrinlinefullformat{#1}{}}% + } +} +{ + \newcommand*{\glsfmtfull}[1]{% + \glsxtrtitlefull{#1}} +} +% \end{macrocode} +%\end{macro} % -% To get around this, save the original definition of \cs{markboth} -% and \cs{markright} and adjust it so that \cs{MakeUppercase} is -% temporarily redefined to \cs{MakeTextUppercase}. Some packages or -% classes redefine these commands, so we can't just assume they -% still have the original kernel definition. +%\begin{macro}{\Glsfmtfull} +%First letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} +% \begin{macrocode} +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtfull}[1]{% + \texorpdfstring + {\Glsxtrtitlefull{#1}}% + {\Glsxtrinlinefullformat{#1}{}}% + } +} +{ + \newcommand*{\Glsfmtfull}[1]{% + \Glsxtrtitlefull{#1}} +} +% \end{macrocode} +%\end{macro} % -%\begin{macro}{\markright} -% Save original definition: +%\begin{macro}{\glsfmtfullpl} +%In-line full plural format. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\let\@glsxtr@org@markright\markright +\ifdef\texorpdfstring +{ + \newcommand*{\glsfmtfullpl}[1]{% + \texorpdfstring + {\glsxtrtitlefullpl{#1}}% + {\glsxtrinlinefullplformat{#1}{}}% + } +} +{ + \newcommand*{\glsfmtfullpl}[1]{% + \glsxtrtitlefullpl{#1}} +} % \end{macrocode} -% Redefine (grouping not added in case it interferes with the -% original code): +%\end{macro} +% +%\begin{macro}{\Glsfmtfullpl} +%First letter converted to upper case. +%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\renewcommand*{\markright}[1]{% - \glsxtrmarkhook - \@glsxtr@org@markright{\@glsxtrinmark#1\@glsxtrnotinmark}% - \glsxtrrestoremarkhook +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtfullpl}[1]{% + \texorpdfstring + {\Glsxtrtitlefullpl{#1}}% + {\Glsxtrinlinefullplformat{#1}{}}% + } +} +{ + \newcommand*{\Glsfmtfullpl}[1]{% + \Glsxtrtitlefullpl{#1}} } % \end{macrocode} %\end{macro} % -%\begin{macro}{\markboth} -% Save original definition: +%\section{Multi-Lingual Support} +% Add the facility to load language modules, if they are installed, +% but none are provided with this package. +% +%\begin{macro}{\RequireGlossariesExtraLang} +%\changes{0.5.3}{2015-12-09}{new} % \begin{macrocode} -\let\@glsxtr@org@markboth\markboth +\newcommand*{\RequireGlossariesExtraLang}[1]{% + \@ifundefined{ver@glossariesxtr-#1.ldf}{\input{glossariesxtr-#1.ldf}}{}% +} % \end{macrocode} -% Redefine (grouping not added in case it interferes with the -% original code): +%\end{macro} +% +%\begin{macro}{\ProvidesGlossariesExtraLang} +%\changes{0.5.3}{2015-12-09}{new} % \begin{macrocode} -\renewcommand*{\markboth}[2]{% - \glsxtrmarkhook - \@glsxtr@org@markboth - {\@glsxtrinmark#1\@glsxtrnotinmark}% - {\@glsxtrinmark#2\@glsxtrnotinmark}% - \glsxtrrestoremarkhook +\newcommand*{\ProvidesGlossariesExtraLang}[1]{% + \ProvidesFile{glossariesxtr-#1.ldf}% } % \end{macrocode} %\end{macro} % -% If this causes a problem provide a simple way of switching back to -% the original definitions: -%\begin{macro}{\glsxtrRevertMarks} +% Load any required language modules that are available. This +% doesn't generate any warning if none are found, since they're not +% essential. (The only command that really needs defining for the +% document is \ics{abbreviationsname}, which can simply be redefined.) % \begin{macrocode} -\newcommand*{\glsxtrRevertMarks}{% - \let\markright\@glsxtr@org@markright - \let\markboth\@glsxtr@org@markboth +\@ifpackageloaded{tracklang} +{% + \AnyTrackedLanguages + {% + \ForEachTrackedDialect{\this@dialect}{% + \IfTrackedLanguageFileExists{\this@dialect}% + {glossariesxtr-}% prefix + {.ldf}% + {% + \RequireGlossariesExtraLang{\CurrentTrackedTag}% + }% + {% + }% + }% + }% + {}% } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrifinmark} -%\changes{1.07}{2016-08-15}{new} +% Load \sty{glossaries-extra-stylemods} if required. % \begin{macrocode} -\newcommand*{\glsxtrifinmark}[2]{#2} +\@glsxtr@redefstyles % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtrinmark} -%\changes{1.07}{2016-08-15}{new} +% and set the style: % \begin{macrocode} -\newrobustcmd*{\@glsxtrinmark}{% - \let\glsxtrifinmark\@firstoftwo -} +\@glsxtr@do@style % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsxtrnotinmark} -%\changes{1.07}{2016-08-15}{new} +%\iffalse % \begin{macrocode} -\newrobustcmd*{\@glsxtrnotinmark}{% - \let\glsxtrifinmark\@secondoftwo -} +% % \end{macrocode} -%\end{macro} -% -% -%\begin{macro}{\glsxtrmarkhook} -% Hook used in new definition of \cs{markboth} and \cs{markright} -% to make some changes to apply to the marks: +%\fi +%\iffalse % \begin{macrocode} -\newcommand*{\glsxtrmarkhook}{% +%<*glossaries-extra-stylemods.sty> % \end{macrocode} -% Save current definitions: +%\fi +%\chapter{Style Adjustments (\styfmt{glossaries-extra-stylemods.sty})} +% This package adjusts the predefined styles so that they include the post +% description hook. Also, some other minor adjustments may be made +% to make existing styles more flexible. +% +%\section{Package Initialisation} +% First identify package: % \begin{macrocode} - \let\@glsxtr@org@MakeUppercase\MakeUppercase - \let\@glsxtr@org@glsxtrtitleshort\glsxtrtitleshort - \let\@glsxtr@org@glsxtrtitleshortpl\glsxtrtitleshortpl - \let\@glsxtr@org@Glsxtrtitleshort\Glsxtrtitleshort - \let\@glsxtr@org@Glsxtrtitleshortpl\Glsxtrtitleshortpl - \let\@glsxtr@org@glsxtrtitletext\glsxtrtitletext - \let\@glsxtr@org@Glsxtrtitletext\Glsxtrtitletext - \let\@glsxtr@org@glsxtrtitleplural\glsxtrtitleplural - \let\@glsxtr@org@Glsxtrtitleplural\Glsxtrtitleplural - \let\@glsxtr@org@glsxtrtitlefirst\glsxtrtitlefirst - \let\@glsxtr@org@Glsxtrtitlefirst\Glsxtrtitlefirst - \let\@glsxtr@org@glsxtrtitlefirstplural\glsxtrtitlefirstplural - \let\@glsxtr@org@Glsxtrtitlefirstplural\Glsxtrtitlefirstplural - \let\@glsxtr@org@glsxtrtitlelong\glsxtrtitlelong - \let\@glsxtr@org@glsxtrtitlelongpl\glsxtrtitlelongpl - \let\@glsxtr@org@Glsxtrtitlelong\Glsxtrtitlelong - \let\@glsxtr@org@Glsxtrtitlelongpl\Glsxtrtitlelongpl - \let\@glsxtr@org@glsxtrtitlefull\glsxtrtitlefull - \let\@glsxtr@org@glsxtrtitlefullpl\glsxtrtitlefullpl - \let\@glsxtr@org@Glsxtrtitlefull\Glsxtrtitlefull - \let\@glsxtr@org@Glsxtrtitlefullpl\Glsxtrtitlefullpl +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-extra-stylemods}[2017/11/03 v1.21 (NLCT)] % \end{macrocode} -% New definitions +% Provide package options to automatically load required predefined +% styles. The simplest method is to just test for the existence of +% the file \texttt{glossary-}\meta{option}\texttt{.sty}. Packages +% can't be loaded whilst the options are being processed, so save +% the list in \cs{@glsxtr@loadstyles}. +%\begin{macro}{\@glsxtr@loadstyles} % \begin{macrocode} - \let\glsxtrifinmark\@firstoftwo - \let\MakeUppercase\MakeTextUppercase - \let\glsxtrtitleshort\glsxtrheadshort - \let\glsxtrtitleshortpl\glsxtrheadshortpl - \let\Glsxtrtitleshort\Glsxtrheadshort - \let\Glsxtrtitleshortpl\Glsxtrheadshortpl - \let\glsxtrtitletext\glsxtrheadtext - \let\Glsxtrtitletext\Glsxtrheadtext - \let\glsxtrtitleplural\glsxtrheadplural - \let\Glsxtrtitleplural\Glsxtrheadplural - \let\glsxtrtitlefirst\glsxtrheadfirst - \let\Glsxtrtitlefirst\Glsxtrheadfirst - \let\glsxtrtitlefirstplural\glsxtrheadfirstplural - \let\Glsxtrtitlefirstplural\Glsxtrheadfirstplural - \let\glsxtrtitlelong\glsxtrheadlong - \let\glsxtrtitlelongpl\glsxtrheadlongpl - \let\Glsxtrtitlelong\Glsxtrheadlong - \let\Glsxtrtitlelongpl\Glsxtrheadlongpl - \let\glsxtrtitlefull\glsxtrheadfull - \let\glsxtrtitlefullpl\glsxtrheadfullpl - \let\Glsxtrtitlefull\Glsxtrheadfull - \let\Glsxtrtitlefullpl\Glsxtrheadfullpl -} +\newcommand*{\@glsxtr@loadstyles}{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrrestoremarkhook} -% Hook used in new definition of \cs{markboth} and \cs{markright} -% to restore the modified definitions. (This is in case the original -% \cs{markboth} and \cs{markright} shouldn't be grouped for some -% reason. There already is some grouping within those original -% definitions, but some of the code lies outside that grouping, and -% possibly there's a reason for it.) +%\begin{option}{all} +%\changes{1.21}{2017-11-03}{new} +%Provide all known styles. % \begin{macrocode} -\newcommand*{\glsxtrrestoremarkhook}{% - \let\glsxtrifinmark\@secondoftwo - \let\MakeUppercase\@glsxtr@org@MakeUppercase - \let\glsxtrtitleshort\@glsxtr@org@glsxtrtitleshort - \let\glsxtrtitleshortpl\@glsxtr@org@glsxtrtitleshortpl - \let\Glsxtrtitleshort\@glsxtr@org@Glsxtrtitleshort - \let\Glsxtrtitleshortpl\@glsxtr@org@Glsxtrtitleshortpl - \let\glsxtrtitletext\@glsxtr@org@glsxtrtitletext - \let\Glsxtrtitletext\@glsxtr@org@Glsxtrtitletext - \let\glsxtrtitleplural\@glsxtr@org@glsxtrtitleplural - \let\Glsxtrtitleplural\@glsxtr@org@Glsxtrtitleplural - \let\glsxtrtitlefirst\@glsxtr@org@glsxtrtitlefirst - \let\Glsxtrtitlefirst\@glsxtr@org@Glsxtrtitlefirst - \let\glsxtrtitlefirstplural\@glsxtr@org@glsxtrtitlefirstplural - \let\Glsxtrtitlefirstplural\@glsxtr@org@Glsxtrtitlefirstplural - \let\glsxtrtitlelong\@glsxtr@org@glsxtrtitlelong - \let\glsxtrtitlelongpl\@glsxtr@org@glsxtrtitlelongpl - \let\Glsxtrtitlelong\@glsxtr@org@Glsxtrtitlelong - \let\Glsxtrtitlelongpl\@glsxtr@org@Glsxtrtitlelongpl - \let\glsxtrtitlefull\@glsxtr@org@glsxtrtitlefull - \let\glsxtrtitlefullpl\@glsxtr@org@glsxtrtitlefullpl - \let\Glsxtrtitlefull\@glsxtr@org@Glsxtrtitlefull - \let\Glsxtrtitlefullpl\@glsxtr@org@Glsxtrtitlefullpl +\DeclareOption{all}{% + \appto\@glsxtr@loadstyles{% + \RequirePackage{glossary-inline}% + \RequirePackage{glossary-list}% + \RequirePackage{glossary-tree}% + \RequirePackage{glossary-mcols}% + \RequirePackage{glossary-long}% + \RequirePackage{glossary-longragged}% + \RequirePackage{glossary-longbooktabs}% + \RequirePackage{glossary-super}% + \RequirePackage{glossary-superragged}% + \RequirePackage{glossary-bookindex}% + } } % \end{macrocode} -%\end{macro} -% -%\changes{0.5.1}{2015-12-07}{removed \cs{ifglsxtruseuchead}} -% Instead of using one document-wide conditional, use -% \catattr{headuc} attribute to determine whether or not to use the -% all upper case form. +%\end{option} % -%\begin{macro}{\glsxtrheadshort} -% Command used to display short form in the page header. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} % \begin{macrocode} -\newcommand*{\glsxtrheadshort}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrshort[noindex,hyper=false]{#1}[]% +\DeclareOption*{% + \IfFileExists{glossary-\CurrentOption.sty} + {\eappto\@glsxtr@loadstyles{% + \noexpand\RequirePackage{glossary-\CurrentOption}}% }% {% - \glsxtrshort[noindex,hyper=false]{#1}[]% + \PackageError{glossaries-extra-styles}% + {Unknown option `\CurrentOption'}{}% }% - }% } % \end{macrocode} -%\end{macro} +% Process the package options: +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} % -%\begin{macro}{\glsxtrtitleshort} -% Command to display short form of abbreviation in section title and -% table of contents. +% Load the required packages: % \begin{macrocode} -\newrobustcmd*{\glsxtrtitleshort}[1]{% - \glsxtrshort[noindex,hyper=false]{#1}[]% -} +\@glsxtr@loadstyles +% \end{macrocode} +% Adjust the styles so that they all have the post description hook. +% Also, instead of having a hard-coded \cs{space} before the +% location, use: +%\begin{macro}{\glsxtrprelocation} +%\changes{1.21}{2017-11-03}{new} +%This uses \cs{providecommand} as the same command is also +%provided by \sty{glossary-bookindex}. +% \begin{macrocode} +\providecommand*{\glsxtrprelocation}{\space} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrheadshortpl} -% Command used to display plural short form in the page header. -% If you want the text converted to upper case, this needs to be -% redefined to use \cs{GLSxtrshortpl} instead. If you are using a -% smallcaps style, the default fonts don't provide italic smallcaps. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%In case we have an old version of \sty{glossaries}: +%\begin{macro}{\renewglossarystyle} % \begin{macrocode} -\newcommand*{\glsxtrheadshortpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrshortpl[noindex,hyper=false]{#1}[]% - }% - {% - \glsxtrshortpl[noindex,hyper=false]{#1}[]% - }% - }% +\providecommand{\renewglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries-extra}{Glossary style `#1' isn't already defined}{}% + }% + {% + \csdef{@glsstyle@#1}{#2}% + }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrtitleshortpl} -% Command to display plural short form of abbreviation in section title and -% table of contents. -%\changes{1.03}{2016-04-27}{bug fix: changed \cs{glsxtrshort} to -%\cs{glsxtrshortpl}} +%\section{List-Like Styles} +% The list-like styles mostly already use the post description hook. +% Only the \glostyle{listdotted} style need modifying to add this. % \begin{macrocode} -\newrobustcmd*{\glsxtrtitleshortpl}[1]{% - \glsxtrshortpl[noindex,hyper=false]{#1}[]% +\ifdef{\@glsstyle@listdotted} +{% + \renewglossarystyle{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}\glspostdescription}% + \renewcommand*{\subglossentry}[3]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{\glossentryname{##2}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}% + \glossentrydesc{##2}\glspostdescription}% + } } +{% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrheadshort} -% Command used to display short form in the page header with the -% first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +% Assume the style isn't required if it hasn't already been defined. % \begin{macrocode} -\newcommand*{\Glsxtrheadshort}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrshort[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrshort[noindex,hyper=false]{#1}[]% - }% - }% } % \end{macrocode} -%\end{macro} +% The \glostyle{sublistdotted} style doesn't display the description +% for top-level entries. Sub-level entries use the +% \glostyle{listdottedstyle}. % -%\begin{macro}{\Glsxtrtitleshort} -% Command to display short form of abbreviation in section title and -% table of contents with the first letter converted to upper case. +%The other list styles would be easier to adapt if the space +%before the number list wasn't hard coded. +%\changes{1.21}{2017-11-03}{modified list to remove hard coded \cs{space}} % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitleshort}[1]{% - \Glsxtrshort[noindex,hyper=false]{#1}[]% -} +\ifdef{\@glsstyle@list} +{% +% \end{macrocode} +%\begin{macro}{\glslistprelocation} +%\changes{1.21}{2017-11-03}{new} +%Space before number list for top-level entries. +% \begin{macrocode} + \newcommand{\glslistprelocation}{\glsxtrprelocation} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslistchildprelocation} +%\changes{1.21}{2017-11-03}{new} +%Space before number list for child entries. +% \begin{macrocode} + \newcommand{\glslistchildprelocation}{\glslistprelocation} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\Glsxtrheadshortpl} -% Command used to display plural short form in the page header with the -% first letter converted to upper case. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%\begin{macro}{\glslistchildpostlocation} +%\changes{1.21}{2017-11-03}{new} +%Full stop after number list. % \begin{macrocode} -\newcommand*{\Glsxtrheadshortpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrshortpl[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrshortpl[noindex,hyper=false]{#1}[]% - }% - }% -} + \newcommand{\glslistchildpostlocation}{.} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\Glsxtrtitleshortpl} -% Command to display plural short form of abbreviation in section title and -% table of contents with the first letter converted to upper case. +%Redefine \glostyle{list} to use these commands. % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitleshortpl}[1]{% - \Glsxtrshortpl[noindex,hyper=false]{#1}[]% + \renewglossarystyle{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\glslistprelocation ##2}% + \renewcommand*{\subglossentry}[3]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\space + \glossentrydesc{##2}\glspostdescription + \glslistchildprelocation ##3\glslistchildpostlocation}% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadtext} -% As above but for the \gloskey{text} value. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%Similarly for \glostyle{altlist}. Since it requires \glostyle{list}, +%the new commands should have been defined above. % \begin{macrocode} -\newcommand*{\glsxtrheadtext}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLStext[noindex,hyper=false]{#1}[]% - }% - {% - \glstext[noindex,hyper=false]{#1}[]% - }% - }% +\ifdef{\@glsstyle@altlist} +{% + \renewglossarystyle{altlist}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}]% + \mbox{}\par\nobreak\@afterheading + \glossentrydesc{##1}\glspostdescription\glslistprelocation ##2}% + \renewcommand{\subglossentry}[3]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glslistchildprelocation ##3}% + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrtitletext} -% Command to display \gloskey{text} value in section title and -% table of contents. +%Redefine \glostyle{listgroup} so that it discourages a break +%after group headings. +%\changes{1.21}{2017-11-03}{redefined \texttt{listgroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newrobustcmd*{\glsxtrtitletext}[1]{% - \glstext[noindex,hyper=false]{#1}[]% +\ifdef{\@glsstyle@listgroup} +{% + \renewglossarystyle{listgroup}{% + \setglossarystyle{list}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]% + \mbox{}\par\nobreak\@afterheading + }% + } } +{} % \end{macrocode} -%\end{macro} -% -% -%\begin{macro}{\Glsxtrheadtext} -% First letter converted to upper case -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%Similarly for \glostyle{listhypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{listhypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newcommand*{\Glsxtrheadtext}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLStext[noindex,hyper=false]{#1}[]% - }% - {% - \Glstext[noindex,hyper=false]{#1}[]% - }% - }% +\ifdef{\@glsstyle@listhypergroup} +{% + \renewglossarystyle{listhypergroup}{% + \setglossarystyle{list}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]% + \mbox{}\par\nobreak\@afterheading + }% + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitletext} -% Command to display \gloskey{text} value in section title and -% table of contents with the first letter changed to upper case. +%Similarly for \glostyle{altlistgroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{altlistgroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitletext}[1]{% - \Glstext[noindex,hyper=false]{#1}[]% +\ifdef{\@glsstyle@altlistgroup} +{% + \renewglossarystyle{altlistgroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt{\glsgetgrouptitle{##1}}]% + \mbox{}\par\nobreak\@afterheading + }% + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadplural} -% As above but for the \gloskey{plural} value. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%Similarly for \glostyle{altlisthypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{altlisthypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newcommand*{\glsxtrheadplural}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSplural[noindex,hyper=false]{#1}[]% - }% - {% - \glsplural[noindex,hyper=false]{#1}[]% - }% - }% +\ifdef{\@glsstyle@altlisthypergroup} +{% + \renewglossarystyle{altlisthypergroup}{% + \setglossarystyle{altlist}% + \renewcommand*{\glossaryheader}{% + \glslistnavigationitem{\glsnavigation}}% + \renewcommand*{\glsgroupheading}[1]{% + \item[\glslistgroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}]% + \mbox{}\par\nobreak\@afterheading + }% + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtrtitleplural} -% Command to display \gloskey{plural} value in section title and -% table of contents. +%\section{Longtable Styles} +% The three and four column styles require adjustment to add the +% post-description hook. The two column styles need the hard-coded +% \cs{space} changed to \cs{glsxtrprelocation}. % \begin{macrocode} -\newrobustcmd*{\glsxtrtitleplural}[1]{% - \glsplural[noindex,hyper=false]{#1}[]% +\ifcsdef{@glsstyle@long} +{% + \renewglossarystyle{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 + \glsxtrprelocation ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glsxtrprelocation ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrheadplural} -% Convert first letter to upper case. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%Three column style: % \begin{macrocode} -\newcommand*{\Glsxtrheadplural}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSplural[noindex,hyper=false]{#1}[]% - }% - {% - \Glsplural[noindex,hyper=false]{#1}[]% - }% - }% +\ifcsdef{@glsstyle@long3col} +{% + \renewglossarystyle{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}\glspostdescription & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + ##3\tabularnewline + }% +% \end{macrocode} +%Conditional needs to be outside of \cs{glsgroupskip} otherwise it +%can cause \qt{Incomplete \cs{iftrue}} errors. +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} +% \begin{macrocode} + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitleplural} -% Command to display \gloskey{plural} value in section title and -% table of contents with the first letter changed to upper case. +% Four column style: % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitleplural}[1]{% - \Glsplural[noindex,hyper=false]{#1}[]% +\ifcsdef{@glsstyle@long4col} +{% + \renewglossarystyle{long4col}{% + \renewenvironment{theglossary}% + {\begin{longtable}{llll}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription & + \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + \glossentrysymbol{##2} & ##3\tabularnewline + }% +% \end{macrocode} +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} +% \begin{macrocode} + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtrheadfirst} -% As above but for the \gloskey{first} value. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%The styles in \sty{glossary-longbooktabs} are all based on the +%styles in \sty{glossary-long}, so no adjustments are needed for +%that package. +% +%\section{Long Ragged Styles} +% The three and four column styles require adjustment for the +% post-description hook, but not the two column styles. However, the +% two-column styles need to have \cs{space} replaced with +% \cs{glsxtrprelocation}. % \begin{macrocode} -\newcommand*{\glsxtrheadfirst}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSfirst[noindex,hyper=false]{#1}[]% - }% - {% - \glsfirst[noindex,hyper=false]{#1}[]% - }% - }% +\ifcsdef{@glsstyle@longragged} +{% + \renewglossarystyle{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\glsxtrprelocation ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}% + \glspostdescription\glsxtrprelocation ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi + } } +{} +% \end{macrocode} +%Three and four column styles don't use \cs{glsxtrprelocation} since the number +%list is in its own column. +% \begin{macrocode} +\ifcsdef{@glsstyle@longragged3col} +{% + \renewglossarystyle{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}\glspostdescription & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrtitlefirst} -% Command to display \gloskey{first} value in section title and -% table of contents. +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlefirst}[1]{% - \glsfirst[noindex,hyper=false]{#1}[]% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrheadfirst} -% First letter converted to upper case -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +% Four column style: % \begin{macrocode} -\newcommand*{\Glsxtrheadfirst}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSfirst[noindex,hyper=false]{#1}[]% - }% - {% - \Glsfirst[noindex,hyper=false]{#1}[]% - }% - }% -} +\ifcsdef{@glsstyle@altlongragged4col} +{% + \renewglossarystyle{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}\glspostdescription & \glossentrysymbol{##1} & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + \glossentrysymbol{##2} & ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitlefirst} -% Command to display \gloskey{first} value in section title and -% table of contents with the first letter changed to upper case. +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlefirst}[1]{% - \Glsfirst[noindex,hyper=false]{#1}[]% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtrheadfirstplural} -% As above but for the \gloskey{firstplural} value. -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%\section{Supertabular Styles} +% The three and four column styles require adjustment to add the +% post-description hook. The two column styles need the hard-coded +% \cs{space} changed to \cs{glsxtrprelocation}. % \begin{macrocode} -\newcommand*{\glsxtrheadfirstplural}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSfirstplural[noindex,hyper=false]{#1}[]% - }% - {% - \glsfirstplural[noindex,hyper=false]{#1}[]% - }% - }% +\ifcsdef{@glsstyle@super} +{% + \renewglossarystyle{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 + \glsxtrprelocation ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glsxtrprelocation ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrtitlefirstplural} -% Command to display \gloskey{firstplural} value in section title and -% table of contents. +%Three column style: % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlefirstplural}[1]{% - \glsfirstplural[noindex,hyper=false]{#1}[]% -} +\ifcsdef{@glsstyle@super3col} +{% + \renewglossarystyle{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}\glspostdescription & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrheadfirstplural} -% First letter converted to upper case -%\changes{0.5.1}{2015-12-07}{now uses headuc attribute} +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newcommand*{\Glsxtrheadfirstplural}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSfirstplural[noindex,hyper=false]{#1}[]% - }% - {% - \Glsfirstplural[noindex,hyper=false]{#1}[]% - }% - }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitlefirstplural} -% Command to display \gloskey{first} value in section title and -% table of contents with the first letter changed to upper case. +% Four column styles: % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlefirstplural}[1]{% - \Glsfirstplural[noindex,hyper=false]{#1}[]% -} +\ifcsdef{@glsstyle@super4col} +{% + \renewglossarystyle{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}\glspostdescription & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + \glossentrysymbol{##2} & ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadlong} -% Command used to display long form in the page header. -%\changes{1.02}{2016-04-25}{new} +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newcommand*{\glsxtrheadlong}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrlong[noindex,hyper=false]{#1}[]% - }% - {% - \glsxtrlong[noindex,hyper=false]{#1}[]% - }% - }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtrtitlelong} -% Command to display long form of abbreviation in section title and -% table of contents. -%\changes{1.02}{2016-04-25}{new} +%\section{Super Ragged Styles} +% The three and four column styles require adjustment for the +% post-description hook, but not the two column styles. However, the +% two-column styles need to have \cs{space} replaced with +% \cs{glsxtrprelocation}. % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlelong}[1]{% - \glsxtrlong[noindex,hyper=false]{#1}[]% +\ifcsdef{@glsstyle@superragged} +{% + \renewglossarystyle{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\glsxtrprelocation ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glsxtrprelocation ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadlongpl} -% Command used to display plural long form in the page header. -% If you want the text converted to upper case, this needs to be -% redefined to use \cs{GLSxtrlongpl} instead. If you are using a -% smallcaps style, the default fonts don't provide italic smallcaps. -%\changes{1.02}{2016-04-25}{new} +%Three column style: % \begin{macrocode} -\newcommand*{\glsxtrheadlongpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrlongpl[noindex,hyper=false]{#1}[]% - }% - {% - \glsxtrlongpl[noindex,hyper=false]{#1}[]% - }% - }% -} +\ifcsdef{@glsstyle@superragged3col} +{% + \renewglossarystyle{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}\glspostdescription & + ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrtitlelongpl} -% Command to display plural long form of abbreviation in section title and -% table of contents. -%\changes{1.02}{2016-04-25}{new} -%\changes{1.03}{2016-04-27}{bug fix: changed \cs{glsxtrlong} to -%\cs{glsxtrlongpl}} +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlelongpl}[1]{% - \glsxtrlongpl[noindex,hyper=false]{#1}[]% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrheadlong} -% Command used to display long form in the page header with the -% first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +% Four columns: % \begin{macrocode} -\newcommand*{\Glsxtrheadlong}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrlong[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrlong[noindex,hyper=false]{#1}[]% - }% - }% -} +\ifcsdef{@glsstyle@altsuperragged4col} +{% + \renewglossarystyle{altsuperragged4col}{% + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription & + \glossentrysymbol{##1} & ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & + \glossentrysymbol{##2} & ##3\tabularnewline + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitlelong} -% Command to display long form of abbreviation in section title and -% table of contents with the first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\changes{1.21}{2017-11-03}{moved conditional outside of \cs{glsgroupskip}} % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlelong}[1]{% - \Glsxtrlong[noindex,hyper=false]{#1}[]% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\Glsxtrheadlongpl} -% Command used to display plural long form in the page header with the -% first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\section{Inline Style} +% The \glostyle{inline} style is dealt with slightly differently. +% The \cs{glspostdescription} hook is actually in +% \cs{glspostinline}, which is called at the end of the glossary. +% The original definition of \cs{glspostinline} also includes a +% space, which is unnecessary. Here, instead of redefining the +% \glostyle{inline} style, just redefine \cs{glspostinline} and +% \cs{glsinlinedescformat}. % \begin{macrocode} -\newcommand*{\Glsxtrheadlongpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrlongpl[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrlongpl[noindex,hyper=false]{#1}[]% - }% - }% -} +\ifdef{\@glsstyle@inline} +{% + \renewcommand*{\glspostinline}{.\spacefactor\sfcode`\.} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Glsxtrtitlelongpl} -% Command to display plural long form of abbreviation in section title and -% table of contents with the first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +% Just use \cs{glsxtrpostdescription} instead of +% \cs{glspostdescription}. % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlelongpl}[1]{% - \Glsxtrlongpl[noindex,hyper=false]{#1}[]% -} + \renewcommand*{\glsinlinedescformat}[3]{% + \space#1\glsxtrpostdescription} + \renewcommand*{\glsinlinesubdescformat}[3]{% + #1\glsxtrpostdescription} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadfull} -% Command used to display full form in the page header. -%\changes{1.02}{2016-04-25}{new} +% The default settings don't show the location lists, so there's no +% adjustment for \cs{glsxtrprelocation}. % \begin{macrocode} -\newcommand*{\glsxtrheadfull}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrfull[noindex,hyper=false]{#1}[]% - }% - {% - \glsxtrfull[noindex,hyper=false]{#1}[]% - }% - }% } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsxtrtitlefull} -% Command to display full form of abbreviation in section title and -% table of contents. -%\changes{1.02}{2016-04-25}{new} +%\section{Tree Styles} +% The \glostyle{index} style is redefined so that the space before +% the number list isn't hard coded. +%\changes{1.21}{2017-11-03}{modified index to remove hard coded \cs{space}} % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlefull}[1]{% - \glsxtrfull[noindex,hyper=false]{#1}[]% -} +\ifdef{\@glsstyle@index} +{ % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrheadfullpl} -% Command used to display plural full form in the page header. -% If you want the text converted to upper case, this needs to be -% redefined to use \cs{GLSxtrfullpl} instead. If you are using a -% smallcaps style, the default fonts don't provide italic smallcaps. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glstreeprelocation} +%\changes{1.21}{2017-11-03}{new} +%The space before the number list for top-level entries. This is +%shared by the other tree styles. % \begin{macrocode} -\newcommand*{\glsxtrheadfullpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrfullpl[noindex,hyper=false]{#1}[]% - }% - {% - \glsxtrfullpl[noindex,hyper=false]{#1}[]% - }% - }% -} + \newcommand*{\glstreeprelocation}{\glsxtrprelocation} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsxtrtitlefullpl} -% Command to display plural full form of abbreviation in section title and -% table of contents. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glstreechildprelocation} +%\changes{1.21}{2017-11-03}{new} +%The space before the number list for child entries. This is +%shared by the other tree styles. % \begin{macrocode} -\newrobustcmd*{\glsxtrtitlefullpl}[1]{% - \glsxtrfullpl[noindex,hyper=false]{#1}[]% -} + \newcommand*{\glstreechildprelocation}{\glstreeprelocation} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\Glsxtrheadfull} -% Command used to display full form in the page header with the -% first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} % \begin{macrocode} -\newcommand*{\Glsxtrheadfull}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrfull[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrfull[noindex,hyper=false]{#1}[]% - }% - }% + \renewglossarystyle{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 + \glstreeprelocation ##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + \item + \or + \subitem + \glssubentryitem{##2}% + \else + \subsubitem + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription + \glstreechildprelocation ##3% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\Glsxtrtitlefull} -% Command to display full form of abbreviation in section title and -% table of contents with the first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +% The \glostyle{indexgroup} style is redefined to discourage a page +% break after the heading. +%\changes{1.21}{2017-11-03}{redefined \texttt{indexgroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlefull}[1]{% - \Glsxtrfull[noindex,hyper=false]{#1}[]% +\ifdef{\@glsstyle@indexgroup} +{% + \renewglossarystyle{indexgroup}{% + \setglossarystyle{index}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace + \nobreak\@afterheading + }% + } } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\Glsxtrheadfullpl} -% Command used to display plural full form in the page header with the -% first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%Similarly for \glostyle{indexhypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{indexhypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\newcommand*{\Glsxtrheadfullpl}[1]{% - \protect\NoCaseChange - {% - \glsifattribute{#1}{headuc}{true}% - {% - \GLSxtrfullpl[noindex,hyper=false]{#1}[]% - }% - {% - \Glsxtrfullpl[noindex,hyper=false]{#1}[]% - }% - }% +\ifdef{\@glsstyle@indexhypergroup} +{% + \renewglossarystyle{indexhypergroup}{% + \setglossarystyle{index}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}% + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace + \nobreak\@afterheading}% + }% } +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\Glsxtrtitlefullpl} -% Command to display plural full form of abbreviation in section title and -% table of contents with the first letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%Adjust \glostyle{tree} style to remove hard coded space before +%number list. % \begin{macrocode} -\newrobustcmd*{\Glsxtrtitlefullpl}[1]{% - \Glsxtrfullpl[noindex,hyper=false]{#1}[]% +\ifdef{\@glsstyle@tree} +{% + \renewglossarystyle{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 + \glstreeprelocation##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 + \glstreechildprelocation ##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + }% } +{} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsfmtshort} -% Provide a way of using the formatted short form in section -% headings. If \sty{hyperref} has been loaded, use -% \cs{texorpdfstring} for convenience in PDF bookmarks. -%\changes{0.2}{2015-11-30}{new} -%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshort}} -%\changes{0.5}{2015-12-07}{changed to use \cs{glsxtrtitleshort}} -%\changes{0.5}{2015-12-07}{renamed from \cs{glsentryfmtshort}} +% +% The \glostyle{treegroup} style is redefined to discourage a page +% break after the heading. +%\changes{1.21}{2017-11-03}{redefined \texttt{treegroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtshort}[1]{% - \texorpdfstring - {\glsxtrtitleshort{#1}}% - {\glsentryshort{#1}}% +\ifdef{\@glsstyle@treegroup} +{% + \renewglossarystyle{treegroup}{% + \setglossarystyle{tree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par + \nopagebreak\indexspace\nobreak\@afterheading}% } } -{ - \newcommand*{\glsfmtshort}[1]{% - \glsxtrtitleshort{#1}} -} +{} % \end{macrocode} -%\end{macro} -%Similarly for the plural version. -%\begin{macro}{\glsfmtshortpl} -%\changes{0.2}{2015-11-30}{new} -%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshortpl}} -%\changes{0.5}{2015-12-07}{changed to use \cs{glsxtrtitleshortpl}} -%\changes{0.5}{2015-12-07}{renamed from \cs{glsentryfmtshortpl}} +% +%Similarly for \glostyle{treehypergroup} +%\changes{1.21}{2017-11-03}{redefined \texttt{treehypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtshortpl}[1]{% - \texorpdfstring - {\glsxtrtitleshortpl{#1}}% - {\glsentryshortpl{#1}}% +\ifdef{\@glsstyle@treehypergroup} +{% + \renewglossarystyle{treehypergroup}{% + \setglossarystyle{tree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \nopagebreak\indexspace\nobreak\@afterheading}% } } -{ - \newcommand*{\glsfmtshortpl}[1]{% - \glsxtrtitleshortpl{#1}} -} +{} % \end{macrocode} -%\end{macro} -% The case-changing version isn't suitable for PDF bookmarks, so the -% PDF alternative uses the non-case-changing version. -%\begin{macro}{\Glsfmtshort} -% Singular form (first letter uppercase). -%\changes{0.2}{2015-11-30}{new} -%\changes{0.4}{2015-12-03}{changed to use \cs{Glsxtrshort}} -%\changes{0.5}{2015-12-07}{changed to use \cs{Glsxtrtitleshort}} -%\changes{0.5}{2015-12-07}{renamed from \cs{Glsentryfmtshort}} +% +%Adjust \glostyle{treenoname} style to remove hard coded space before +%number list. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtshort}[1]{% - \texorpdfstring - {\Glsxtrtitleshort{#1}}% - {\glsentryshort{#1}}% +\ifdef{\@glsstyle@treenoname} +{% + \renewglossarystyle{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 + \glstreeprelocation##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\glstreechildprelocation##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% } } -{ - \newcommand*{\Glsfmtshort}[1]{% - \Glsxtrtitleshort{#1}} -} +{} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsfmtshortpl} -%Plural form (first letter uppercase). -%\changes{0.2}{2015-11-30}{new} -%\changes{0.4}{2015-12-03}{changed to use \cs{glsxtrshortpl}} -%\changes{0.5}{2015-12-07}{changed to use \cs{Glsxtrtitleshortpl}} -%\changes{0.5}{2015-12-07}{renamed from \cs{Glsentryfmtshortpl}} +% +% The \glostyle{treenonamegroup} style is redefined to discourage a page +% break after the heading. +%\changes{1.21}{2017-11-03}{redefined \texttt{treenonamegroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtshortpl}[1]{% - \texorpdfstring - {\Glsxtrtitleshortpl{#1}}% - {\glsentryshortpl{#1}}% +\ifdef{\@glsstyle@treenonamegroup} +{% + \renewglossarystyle{treenonamegroup}{% + \setglossarystyle{treenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt + {\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% } } -{ - \newcommand*{\Glsfmtshortpl}[1]{% - \Glsxtrtitleshortpl{#1}} -} +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsfmttext} -%As above but for the \gloskey{text} value. -%\changes{0.5}{2015-12-07}{new} +%Similarly for \glostyle{treenonamehypergroup} +%\changes{1.21}{2017-11-03}{redefined \texttt{treenonamehypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmttext}[1]{% - \texorpdfstring - {\glsxtrtitletext{#1}}% - {\glsentrytext{#1}}% +\ifdef{\@glsstyle@treenonamehypergroup} +{% + \renewglossarystyle{treenonamehypergroup}{% + \setglossarystyle{treenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% } } -{ - \newcommand*{\glsfmttext}[1]{% - \glsxtrtitletext{#1}} -} +{} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\Glsfmttext} -%First letter converted to upper case. -%\changes{0.5}{2015-12-07}{new} +% The \glostyle{alttree} style is redefined to make it easier to +% made minor adjustments. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmttext}[1]{% - \texorpdfstring - {\Glsxtrtitletext{#1}}% - {\glsentrytext{#1}}% +\ifdef{\@glsstyle@alttree} +{% +% \end{macrocode} +% Only redefine this style if it's already been defined. +% +%\begin{macro}{\glsxtralttreeSymbolDescLocation} +%\changes{1.05}{2016-06-10}{new} +%\begin{definition} +%\cs{glsxtralttreeSymbolDescLocation}\marg{label}\marg{location +%list} +%\end{definition} +%Layout the symbol, description and location for top-level entries. +% \begin{macrocode} + \newcommand{\glsxtralttreeSymbolDescLocation}[2]{% + {% + \let\par\glsxtrAltTreePar + \ifglshassymbol{#1}{(\glossentrysymbol{#1})\space}{}% + \glossentrydesc{#1}\glspostdescription\glstreeprelocation #2\par + }% } -} -{ - \newcommand*{\Glsfmttext}[1]{% - \Glsxtrtitletext{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtplural} -%As above but for the \gloskey{plural} value. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\glsxtrAltTreeIndent} +%\changes{1.05}{2016-06-10}{new} +% Paragraph indent for subsequent paragraphs in multi-paragraph +% descriptions. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtplural}[1]{% - \texorpdfstring - {\glsxtrtitleplural{#1}}% - {\glsentryplural{#1}}% - } -} -{ - \newcommand*{\glsfmtplural}[1]{% - \glsxtrtitleplural{#1}} -} + \newlength\glsxtrAltTreeIndent % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtplural} -%First letter converted to upper case. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\glsxtrAltTreePar} +%\changes{1.05}{2016-06-10}{new} +%Multi-paragraph descriptions need to keep the hanging indent. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtplural}[1]{% - \texorpdfstring - {\Glsxtrtitleplural{#1}}% - {\glsentryplural{#1}}% + \newcommand{\glsxtrAltTreePar}{% + \@@par + \glsxtrAltTreeSetHangIndent + \setlength{\parindent}{\dimexpr\hangindent+\glsxtrAltTreeIndent}% } -} -{ - \newcommand*{\Glsfmtplural}[1]{% - \Glsxtrtitleplural{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtfirst} -%As above but for the \gloskey{first} value. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\glsxtralttreeSubSymbolDescLocation} +%\changes{1.05}{2016-06-10}{new} +%\begin{definition} +%\cs{glsxtralttreeSubSymbolDescLocation}\marg{level}\marg{label}\marg{location +%list} +%\end{definition} +%Layout the symbol, description and location for sub-entries. +% Defaults to the same as the top-level. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtfirst}[1]{% - \texorpdfstring - {\glsxtrtitlefirst{#1}}% - {\glsentryfirst{#1}}% + \newcommand{\glsxtralttreeSubSymbolDescLocation}[3]{% + \glsxtralttreeSymbolDescLocation{#2}{#3}% } -} -{ - \newcommand*{\glsfmtfirst}[1]{% - \glsxtrtitlefirst{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtfirst} -%First letter converted to upper case. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\glsxtrtreetopindent} +%\changes{1.05}{2016-06-10}{new} +% The original style has to keep computing the width of the name at +% each entry. This register allows the style to compute it once for +% the top-level at the start of the glossary. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtfirst}[1]{% - \texorpdfstring - {\Glsxtrtitlefirst{#1}}% - {\glsentryfirst{#1}}% + \newlength\glsxtrtreetopindent +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtralttreeInit} +%\changes{1.05}{2016-06-10}{new} +% User-level initialisation for the \glostyle{alttree} style. +% \begin{macrocode} + \newcommand*{\glsxtralttreeInit}{% + \settowidth{\glsxtrtreetopindent}{\glstreenamefmt{\glsgetwidestname\space}}% + \glsxtrAltTreeIndent=\parindent } -} -{ - \newcommand*{\Glsfmtfirst}[1]{% - \Glsxtrtitlefirst{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtfirstpl} -%As above but for the \gloskey{firstplural} value. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\gglssetwidest} +%\changes{1.21}{2017-11-03}{new} +% The original \cs{glssetwidest} only uses \cs{def}. This uses +% \cs{gdef}. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtfirstpl}[1]{% - \texorpdfstring - {\glsxtrtitlefirstplural{#1}}% - {\glsentryfirstplural{#1}}% + \newcommand*{\gglssetwidest}[2][0]{% + \csgdef{@glswidestname\romannumeral#1}{#2}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\eglssetwidest} +%\changes{1.05}{2016-06-10}{new} +% The original \cs{glssetwidest} only uses \cs{def}. This uses +% \cs{protected@csedef}. +% \begin{macrocode} + \newcommand*{\eglssetwidest}[2][0]{% + \protected@csedef{@glswidestname\romannumeral#1}{#2}% } -} -{ - \newcommand*{\glsfmtfirstpl}[1]{% - \glsxtrtitlefirstplural{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtfirstpl} -%First letter converted to upper case. -%\changes{0.5}{2015-12-07}{new} +%\begin{macro}{\xglssetwidest} +%\changes{1.05}{2016-06-10}{new} +%Like the above but uses \cs{protected@csxdef}. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtfirstpl}[1]{% - \texorpdfstring - {\Glsxtrtitlefirstplural{#1}}% - {\glsentryfirstplural{#1}}% + \newcommand*{\xglssetwidest}[2][0]{% + \protected@csxdef{@glswidestname\romannumeral#1}{#2}% } -} -{ - \newcommand*{\Glsfmtfirstpl}[1]{% - \Glsxtrtitlefirstplural{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtlong} -%As above but for the \gloskey{long} value. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsgetwidestname} +%\changes{1.05}{2016-06-10}{new} +% Provide a user-level macro to obtain the widest top-level name. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtlong}[1]{% - \texorpdfstring - {\glsxtrtitlelong{#1}}% - {\glsentrylong{#1}}% - } -} -{ - \newcommand*{\glsfmtlong}[1]{% - \glsxtrtitlelong{#1}} -} + \newcommand*{\glsgetwidestname}{\@glswidestname} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtlong} -%First letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsgetwidestsubname} +%\changes{1.05}{2016-06-10}{new} +% Provide a user-level macro to obtain the widest sub-entry name. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtlong}[1]{% - \texorpdfstring - {\Glsxtrtitlelong{#1}}% - {\glsentrylong{#1}}% + \newcommand*{\glsgetwidestsubname}[1]{% + \ifcsundef{@glswidestname\romannumeral#1}% + {\@glswidestname}% + {\csuse{@glswidestname\romannumeral#1}}% } -} -{ - \newcommand*{\Glsfmtlong}[1]{% - \Glsxtrtitlelong{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtlongpl} -%As above but for the \gloskey{longplural} value. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestTopLevelName} +%CamelCase is easier for long command names. Provide a CamelCase +%synonym of \ics{glsfindwidesttoplevelname}. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtlongpl}[1]{% - \texorpdfstring - {\glsxtrtitlelongpl{#1}}% - {\glsentrylongpl{#1}}% - } -} -{ - \newcommand*{\glsfmtlongpl}[1]{% - \glsxtrtitlelongpl{#1}} -} + \let\glsFindWidestTopLevelName\glsfindwidesttoplevelname % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtlongpl} -%First letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestUsedTopLevelName} +%\changes{1.05}{2016-06-10}{new} +% Like \cs{glsfindwidesttoplevelname} but has an additional check +% that the entry has been used. Only useful if the glossaries occur +% at the end of the document, in which case this command should go +% at the start of the glossary. Alternatively, place at the end of +% the document and save for the next run. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtlongpl}[1]{% - \texorpdfstring - {\Glsxtrtitlelongpl{#1}}% - {\glsentrylongpl{#1}}% + \newrobustcmd*{\glsFindWidestUsedTopLevelName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + {}% + }% + }% } -} -{ - \newcommand*{\Glsfmtlongpl}[1]{% - \Glsxtrtitlelongpl{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtfull} -%In-line full format. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestUsedAnyName} +%\changes{1.05}{2016-06-10}{new} +% Like the above but doesn't check the parent key. Useful if all +% levels should have the same width for the name. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtfull}[1]{% - \texorpdfstring - {\glsxtrtitlefull{#1}}% - {\glsxtrinlinefullformat{#1}{}}% + \newrobustcmd*{\glsFindWidestUsedAnyName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + {}% + }% + }% } -} -{ - \newcommand*{\glsfmtfull}[1]{% - \glsxtrtitlefull{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtfull} -%First letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestAnyName} +%\changes{1.05}{2016-06-10}{new} +% Like the above but doesn't check is the entry has been used. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtfull}[1]{% - \texorpdfstring - {\Glsxtrtitlefull{#1}}% - {\Glsxtrinlinefullformat{#1}{}}% + \newrobustcmd*{\glsFindWidestAnyName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% } -} -{ - \newcommand*{\Glsfmtfull}[1]{% - \Glsxtrtitlefull{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsfmtfullpl} -%In-line full plural format. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestUsedLevelTwo} +%\changes{1.05}{2016-06-10}{new} +% This is like \cs{glsFindWidestUsedTopLevelName} but also sets the +% first two sub-levels as well. Any entry that has a +% great-grandparent is ignored. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\glsfmtfullpl}[1]{% - \texorpdfstring - {\glsxtrtitlefullpl{#1}}% - {\glsxtrinlinefullplformat{#1}{}}% + \newrobustcmd*{\glsFindWidestUsedLevelTwo}[1][\@glo@types]{% + \dimen@=0pt\relax + \dimen@i=0pt\relax + \dimen@ii=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% + \ifglshasparent{\@glo@parent}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% + \ifglshasparent{\@glo@parent}% + {}% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ii + \dimen@ii=\gls@tmplen + \eglssetwidest[2]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@i + \dimen@i=\gls@tmplen + \eglssetwidest[1]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ + \dimen@=\gls@tmplen + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + {}% + }% + }% } -} -{ - \newcommand*{\glsfmtfullpl}[1]{% - \glsxtrtitlefullpl{#1}} -} % \end{macrocode} %\end{macro} % -%\begin{macro}{\Glsfmtfullpl} -%First letter converted to upper case. -%\changes{1.02}{2016-04-25}{new} +%\begin{macro}{\glsFindWidestLevelTwo} +%\changes{1.05}{2016-06-10}{new} +% This is like \cs{glsFindWidestUsedLevelTwo} but doesn't check if the +% entry has been used. % \begin{macrocode} -\ifdef\texorpdfstring -{ - \newcommand*{\Glsfmtfullpl}[1]{% - \texorpdfstring - {\Glsxtrtitlefullpl{#1}}% - {\Glsxtrinlinefullplformat{#1}{}}% + \newrobustcmd*{\glsFindWidestLevelTwo}[1][\@glo@types]{% + \dimen@=0pt\relax + \dimen@i=0pt\relax + \dimen@ii=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% + \ifglshasparent{\@glo@parent}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% + \ifglshasparent{\@glo@parent}% + {}% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ii + \dimen@ii=\gls@tmplen + \eglssetwidest[2]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@i + \dimen@i=\gls@tmplen + \eglssetwidest[1]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ + \dimen@=\gls@tmplen + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + }% } -} -{ - \newcommand*{\Glsfmtfullpl}[1]{% - \Glsxtrtitlefullpl{#1}} -} % \end{macrocode} %\end{macro} % -%\section{Multi-Lingual Support} -% Add the facility to load language modules, if they are installed, -% but none are provided with this package. -% -%\begin{macro}{\RequireGlossariesExtraLang} -%\changes{0.5.3}{2015-12-09}{new} +%\begin{macro}{\glsFindWidestUsedAnyNameSymbol} +%\changes{1.05}{2016-06-10}{new} +% Like the \cs{glsFindWidestUsedAnyName} but also measures the +% symbol. The length of the widest symbol is stored in the second argument +% should be a length register. % \begin{macrocode} -\newcommand*{\RequireGlossariesExtraLang}[1]{% - \@ifundefined{ver@glossariesxtr-#1.ldf}{\input{glossariesxtr-#1.ldf}}{}% -} + \newrobustcmd*{\glsFindWidestUsedAnyNameSymbol}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + {}% + }% + }% + } % \end{macrocode} %\end{macro} % -%\begin{macro}{\ProvidesGlossariesExtraLang} -%\changes{0.5.3}{2015-12-09}{new} +%\begin{macro}{\glsFindWidestAnyNameSymbol} +%\changes{1.05}{2016-06-10}{new} +% Like the above but doesn't check if the entry has been used. % \begin{macrocode} -\newcommand*{\ProvidesGlossariesExtraLang}[1]{% - \ProvidesFile{glossariesxtr-#1.ldf}% -} + \newrobustcmd*{\glsFindWidestAnyNameSymbol}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + }% + } % \end{macrocode} %\end{macro} % -% Load any required language modules that are available. This -% doesn't generate any warning if none are found, since they're not -% essential. (The only command that really needs defining for the -% document is \ics{abbreviationsname}, which can simply be redefined.) +%\begin{macro}{\glsFindWidestUsedAnyNameSymbolLocation} +%\changes{1.05}{2016-06-10}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbol} but also measures the +% location list. This requires \ics{glsentrynumberlist}. +% The length of the widest symbol is stored in the second argument +% should be a length register. The length of the widest location +% list is stored in the third argument, which should also be a +% length register. % \begin{macrocode} -\@ifpackageloaded{tracklang} -{% - \AnyTrackedLanguages - {% - \ForEachTrackedDialect{\this@dialect}{% - \IfTrackedLanguageFileExists{\this@dialect}% - {glossariesxtr-}% prefix - {.ldf}% - {% - \RequireGlossariesExtraLang{\CurrentTrackedTag}% - }% + \newrobustcmd*{\glsFindWidestUsedAnyNameSymbolLocation}[3][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + #3=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#3\relax + #3=\dimen@ + \fi + }% + {}% }% }% - }% - {}% -} -{} -% \end{macrocode} -% Load \sty{glossaries-extra-stylemods} if required. -% \begin{macrocode} -\@glsxtr@redefstyles -% \end{macrocode} -% and set the style: -% \begin{macrocode} -\@glsxtr@do@style -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossaries-extra-stylemods.sty> + } % \end{macrocode} -%\fi -%\chapter{Style Adjustments (\styfmt{glossaries-extra-stylemods.sty})} -% This package adjusts the predefined styles so that they include the post -% description hook. Also, some other minor adjustments may be made -% to make existing styles more flexible. +%\end{macro} % -%\section{Package Initialisation} -% First identify package: -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2017/09/11 v1.20 (NLCT)] -% \end{macrocode} -% Provide package options to automatically load required predefined -% styles. The simplest method is to just test for the existence of -% the file \texttt{glossary-}\meta{option}\texttt{.sty}. Packages -% can't be loaded whilst the options are being processed, so save -% the list in \cs{@glsxtr@loadstyles}. -%\begin{macro}{\@glsxtr@loadstyles} +%\begin{macro}{\glsFindWidestAnyNameSymbolLocation} +%\changes{1.05}{2016-06-10}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbol} but doesn't check if +% the entry has been used. % \begin{macrocode} -\newcommand*{\@glsxtr@loadstyles}{} + \newrobustcmd*{\glsFindWidestAnyNameSymbolLocation}[3][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + #3=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#3\relax + #3=\dimen@ + \fi + }% + }% + } % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsFindWidestUsedAnyNameLocation} +%\changes{1.05}{2016-06-10}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbolLocation} but doesn't +% measure the symbol. The length of the widest location +% list is stored in the second argument, which should be a +% length register. % \begin{macrocode} -\DeclareOption*{% - \IfFileExists{glossary-\CurrentOption.sty} - {\eappto\@glsxtr@loadstyles{% - \noexpand\RequirePackage{glossary-\CurrentOption}}}% - {\PackageError{glossaries-extra-styles}% - {Unknown option `\CurrentOption'}{}} -} -% \end{macrocode} -% Process the package options: -% \begin{macrocode} -\ProcessOptions -% \end{macrocode} -% -% Load the required packages: -% \begin{macrocode} -\@glsxtr@loadstyles + \newrobustcmd*{\glsFindWidestUsedAnyNameLocation}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + {}% + }% + }% + } % \end{macrocode} -% Adjust the styles that the post description hook added, but only -% for styles that have already been defined. All the tree styles in -% \sty{glossary-tree} include the post description hook, so they -% don't require adjustment. Similarly for \sty{glossary-mcols} which -% builds on the tree styles. +%\end{macro} % -%In case we have an old version of \sty{glossaries}: -%\begin{macro}{\renewglossarystyle} +%\begin{macro}{\glsFindWidestAnyNameLocation} +%\changes{1.05}{2016-06-10}{new} +% Like the \cs{glsFindWidestAnyNameLocation} but doesn't +% check the \gls{firstuse} flag. % \begin{macrocode} -\providecommand{\renewglossarystyle}[2]{% - \ifcsundef{@glsstyle@#1}% - {% - \PackageError{glossaries-extra}{Glossary style `#1' isn't already defined}{}% - }% - {% - \csdef{@glsstyle@#1}{#2}% - }% -} + \newrobustcmd*{\glsFindWidestAnyNameLocation}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + }% + } % \end{macrocode} %\end{macro} % -%\section{List-Like Styles} -% The list-like styles mostly already use the post description hook. -% Only the \glostyle{listdotted} style need modifying. +%\begin{macro}{\glsxtrComputeTreeIndent} +%\changes{1.05}{2016-06-10}{new} +% Compute the value of \cs{glstreeindent}. Argument is the entry label. +% (Ignored in default definition, but this command may be redefined +% to take the particular entry into account.) Note that the +% sub-levels modify \cs{glstreeindent}. % \begin{macrocode} -\ifdef{\@glsstyle@listdotted} -{% - \renewglossarystyle{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}\glspostdescription}% - \renewcommand*{\subglossentry}[3]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glssubentryitem{##2}% - \glstarget{##2}{\glossentryname{##2}}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}% - \glossentrydesc{##2}\glspostdescription}% - } -} -{} + \newcommand*{\glsxtrComputeTreeIndent}[1]{% + \glstreeindent=\glsxtrtreetopindent\relax + } % \end{macrocode} -% The \glostyle{sublistdotted} style doesn't display the description -% for top-level entries. Sub-level entries use the -% \glostyle{listdottedstyle}. +%\end{macro} % -%\section{Longtable Styles} -% The three and four column styles require adjustment, but not the -% two column styles. +%\begin{macro}{\glsxtrComputeTreeSubIndent} +%\changes{1.05}{2016-06-10}{new} +%\begin{definition} +%\cs{glsxtrComputeTreeSubIndent}\marg{level}\marg{label}\marg{register} +%\end{definition} +% Compute the indent for the sub-entries. The first argument is the +% level, the second argument is the entry label and the third +% argument is the length register used to store the computed indent. % \begin{macrocode} -\ifcsdef{@glsstyle@long3col} -{% - \renewglossarystyle{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}\glspostdescription & ##2\tabularnewline + \newcommand*{\glsxtrComputeTreeSubIndent}[3]{% + \ifcsundef{@glswidestname\romannumeral#1}% + {% + \settowidth{#3}{\glstreenamefmt{\@glswidestname\space}}% }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - ##3\tabularnewline + {% + \settowidth{#3}{\glstreenamefmt{% + \csname @glswidestname\romannumeral#1\endcsname\space}}% }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & &\tabularnewline\fi}% } -} -{} % \end{macrocode} -% Four column style: +%\end{macro} +% +%\begin{macro}{\glsxtrAltTreeSetHangIndent} +%\changes{1.05}{2016-06-10}{new} +% Set \cs{hangindent} for top-level entries: % \begin{macrocode} -\ifcsdef{@glsstyle@long4col} -{% - \renewglossarystyle{long4col}{% - \renewenvironment{theglossary}% - {\begin{longtable}{llll}}% - {\end{longtable}}% - \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{}% - \renewcommand{\glossentry}[2]{% - \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & - \glossentrydesc{##1}\glspostdescription & - \glossentrysymbol{##1} & - ##2\tabularnewline - }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - \glossentrysymbol{##2} & ##3\tabularnewline - }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & & &\tabularnewline\fi}% - } -} -{} + \newcommand*{\glsxtrAltTreeSetHangIndent}{\hangindent\glstreeindent} % \end{macrocode} +%\end{macro} % -%The styles in \sty{glossary-longbooktabs} are all based on the -%styles in \sty{glossary-long}, so no adjustments are needed for -%that package. +%\begin{macro}{\glsxtrAltTreeSetSubHangIndent} +%\changes{1.05}{2016-06-10}{new} +% Set \cs{hangindent} for sub-entries: +% \begin{macrocode} + \newcommand*{\glsxtrAltTreeSetSubHangIndent}[1]{\hangindent\glstreeindent} +% \end{macrocode} +%\end{macro} % -%\section{Long Ragged Styles} -% The three and four column styles require adjustment, but not the -% two column styles. +% Redefine \glostyle{alttree}: % \begin{macrocode} -\ifcsdef{@glsstyle@longragged3col} -{% - \renewglossarystyle{longragged3col}{% + \renewglossarystyle{alttree}{% \renewenvironment{theglossary}% - {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{longtable}}% + {% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \mbox{}\par}% + {\par}% \renewcommand*{\glossaryheader}{}% \renewcommand*{\glsgroupheading}[1]{}% \renewcommand{\glossentry}[2]{% - \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & - \glossentrydesc{##1}\glspostdescription & ##2\tabularnewline - }% + \ifnum\@gls@prevlevel=0\relax + \else + \glsxtrComputeTreeIndent{##1}% + \fi + \parindent\glstreeindent + \glsxtrAltTreeSetHangIndent + \makebox[0pt][r]% + {% + \glstreenamebox{\glstreeindent}% + {% + \glsentryitem{##1}% + \glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + }% + }% + \glsxtralttreeSymbolDescLocation{##1}{##2}% + \def\@gls@prevlevel{0}% + } \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - ##3\tabularnewline + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \glsxtrComputeTreeSubIndent{##1}{##2}{\gls@tmplen}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \ifnum\@gls@prevlevel=0\relax + \glsxtrComputeTreeIndent{##2}% + \else + \glsxtrComputeTreeSubIndent{\@gls@prevlevel}{##2}{\glstreeindent}% + \fi + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \glsxtrAltTreeSetSubHangIndent{##1}% + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% + \glsxtralttreeSubSymbolDescLocation{##1}{##2}{##3}% + \def\@gls@prevlevel{##1}% }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & &\tabularnewline\fi}% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% } +}% +{% } -{} % \end{macrocode} -% Four column style: +%Redefine \glostyle{alttreegroup} so that it discourages a break +%after group headings. +%\changes{1.21}{2017-11-03}{redefined \texttt{alttreegroup} to discourage +%breaks after group headings} +%Can't use \cs{@afterheading} here as it messes with the first item +%of the group. % \begin{macrocode} -\ifcsdef{@glsstyle@altlongragged4col} +\ifdef{\@glsstyle@alttreegroup} {% - \renewglossarystyle{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}\glspostdescription & \glossentrysymbol{##1} & - ##2\tabularnewline + \renewglossarystyle{alttreegroup}{% + \setglossarystyle{alttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nopagebreak }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - \glossentrysymbol{##2} & ##3\tabularnewline + }% +}% +{% +} +% \end{macrocode} +%Similarly for \glostyle{alttreehypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{alttreehypergroup} to discourage +%breaks after group headings} +% \begin{macrocode} +\ifdef{\@glsstyle@alttreehypergroup} +{% + \renewglossarystyle{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 + \nopagebreak\indexspace\nopagebreak }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & & &\tabularnewline\fi}% } +}% +{% } -{} % \end{macrocode} % -%\section{Supertabular Styles} -% The three and four column styles require adjustment, but not the -% two column styles. +%\section{Multicolumn Styles} +%Adjust \glostyle{mcolindexgroup} to discourage page breaks after +%the group headings. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolindexgroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifcsdef{@glsstyle@super3col} +\ifdef{\@glsstyle@mcolindexgroup} {% - \renewglossarystyle{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}\glspostdescription & ##2\tabularnewline - }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - ##3\tabularnewline + \renewglossarystyle{mcolindexgroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & &\tabularnewline\fi}% } +}% +{% } -{} % \end{macrocode} -% Four column styles: +%Similarly for \glostyle{mcolindexhypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolindexhypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifcsdef{@glsstyle@super4col} +\ifdef{\@glsstyle@mcolindexhypergroup} {% - \renewglossarystyle{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}\glspostdescription & - \glossentrysymbol{##1} & ##2\tabularnewline + \renewglossarystyle{mcolindexhypergroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}% + \indexspace }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - \glossentrysymbol{##2} & ##3\tabularnewline + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & & &\tabularnewline\fi}% } +}% +{% } -{} % \end{macrocode} -% -%\section{Super Ragged Styles} -% The three and four column styles require adjustment, but not the -% two column styles. +%Similarly for \glostyle{mcolindexspannav}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolindexspannav} to discourage +%breaks after group headings} % \begin{macrocode} -\ifcsdef{@glsstyle@superragged3col} +\ifdef{\@glsstyle@mcolindexspannav} {% - \renewglossarystyle{superragged3col}{% + \renewglossarystyle{mcolindexspannav}{% + \setglossarystyle{index}% \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}\glspostdescription & - ##2\tabularnewline - }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - ##3\tabularnewline + {% + \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}}}% + \nopagebreak\indexspace\nobreak\@afterheading }% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & - &\tabularnewline\fi}% } +}% +{% } -{} % \end{macrocode} -% Four columns: +%Similarly for \glostyle{mcoltreegroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreegroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifcsdef{@glsstyle@altsuperragged4col} +\ifdef{\@glsstyle@mcoltreegroup} {% - \renewglossarystyle{altsuperragged4col}{% - \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{supertabular}}% - \renewcommand*{\glossaryheader}{}% - \renewcommand{\glossentry}[2]{% - \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & - \glossentrydesc{##1}\glspostdescription & - \glossentrysymbol{##1} & ##2\tabularnewline - }% - \renewcommand{\subglossentry}[3]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & - \glossentrysymbol{##2} & ##3\tabularnewline + \renewglossarystyle{mcoltreegroup}{% + \setglossarystyle{mcoltree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading }% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & - &\tabularnewline\fi}% } +}% +{% } -{} % \end{macrocode} -% -%\section{Inline Style} -% The \glostyle{inline} style is dealt with slightly differently. -% The \cs{glspostdescription} hook is actually in -% \cs{glspostinline}, which is called at the end of the glossary. -% The original definition of \cs{glspostinline} also includes a -% space, which is unnecessary. Here, instead of redefining the -% \glostyle{inline} style, just redefine \cs{glspostinline} and -% \cs{glsinlinedescformat}. +%Similarly for \glostyle{mcoltreehypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreehypergroup} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef{\@glsstyle@inline} +\ifdef{\@glsstyle@mcoltreehypergroup} +{% + \renewglossarystyle{mcoltreehypergroup}{% + \setglossarystyle{mcoltree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace + }% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% {% - \renewcommand*{\glspostinline}{.\spacefactor\sfcode`\.} -% \end{macrocode} -% Just use \cs{glsxtrpostdescription} instead of -% \cs{glspostdescription}. -% \begin{macrocode} - \renewcommand*{\glsinlinedescformat}[3]{% - \space#1\glsxtrpostdescription} - \renewcommand*{\glsinlinesubdescformat}[3]{% - #1\glsxtrpostdescription} } -{} % \end{macrocode} -% -%\section{Tree Styles} -% The \glostyle{alttree} style is redefined to make it easier to -% made minor adjustments. +%Similarly for \glostyle{mcoltreespannav}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreespannav} to discourage +%breaks after group headings} % \begin{macrocode} -\ifdef{\@glsstyle@alttree} +\ifdef{\@glsstyle@mcoltreespannav} {% -% \end{macrocode} -% Only redefine this style if it's already been defined. -% -%\begin{macro}{\glsxtralttreeSymbolDescLocation} -%\changes{1.05}{2016-06-10}{new} -%\begin{definition} -%\cs{glsxtralttreeSymbolDescLocation}\marg{label}\marg{location -%list} -%\end{definition} -%Layout the symbol, description and location for top-level entries. -% \begin{macrocode} - \newcommand{\glsxtralttreeSymbolDescLocation}[2]{% + \renewglossarystyle{mcoltreespannav}{% + \setglossarystyle{tree}% + \renewenvironment{theglossary}% {% - \let\par\glsxtrAltTreePar - \ifglshassymbol{#1}{(\glossentrysymbol{#1})\space}{}% - \glossentrydesc{#1}\glspostdescription \space #2\par + \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}}}% + \nopagebreak\indexspace\nobreak\@afterheading }% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrAltTreeIndent} -%\changes{1.05}{2016-06-10}{new} -% Paragraph indent for subsequent paragraphs in multi-paragraph -% descriptions. -% \begin{macrocode} - \newlength\glsxtrAltTreeIndent -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrAltTreePar} -%\changes{1.05}{2016-06-10}{new} -%Multi-paragraph descriptions need to keep the hanging indent. -% \begin{macrocode} - \newcommand{\glsxtrAltTreePar}{% - \@@par - \glsxtrAltTreeSetHangIndent - \setlength{\parindent}{\dimexpr\hangindent+\glsxtrAltTreeIndent}% - } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtralttreeSubSymbolDescLocation} -%\changes{1.05}{2016-06-10}{new} -%\begin{definition} -%\cs{glsxtralttreeSubSymbolDescLocation}\marg{level}\marg{label}\marg{location -%list} -%\end{definition} -%Layout the symbol, description and location for sub-entries. -% Defaults to the same as the top-level. -% \begin{macrocode} - \newcommand{\glsxtralttreeSubSymbolDescLocation}[3]{% - \glsxtralttreeSymbolDescLocation{#2}{#3}% - } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtrtreetopindent} -%\changes{1.05}{2016-06-10}{new} -% The original style has to keep computing the width of the name at -% each entry. This register allows the style to compute it once for -% the top-level at the start of the glossary. -% \begin{macrocode} - \newlength\glsxtrtreetopindent -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsxtralttreeInit} -%\changes{1.05}{2016-06-10}{new} -% User-level initialisation for the \glostyle{alttree} style. -% \begin{macrocode} - \newcommand*{\glsxtralttreeInit}{% - \settowidth{\glsxtrtreetopindent}{\glstreenamefmt{\glsgetwidestname\space}}% - \glsxtrAltTreeIndent=\parindent - } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\eglssetwidest} -%\changes{1.05}{2016-06-10}{new} -% The original \cs{glssetwidest} only uses \cs{def}. This uses -% \cs{protected@csedef}. -% \begin{macrocode} - \newcommand*{\eglssetwidest}[2][0]{% - \protected@csedef{@glswidestname\romannumeral#1}{#2}% - } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\xglssetwidest} -%\changes{1.05}{2016-06-10}{new} -%Like the above but uses \cs{protected@csxdef}. -% \begin{macrocode} - \newcommand*{\xglssetwidest}[2][0]{% - \protected@csxdef{@glswidestname\romannumeral#1}{#2}% - } -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsgetwidestname} -%\changes{1.05}{2016-06-10}{new} -% Provide a user-level macro to obtain the widest top-level name. -% \begin{macrocode} - \newcommand*{\glsgetwidestname}{\@glswidestname} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsgetwidestsubname} -%\changes{1.05}{2016-06-10}{new} -% Provide a user-level macro to obtain the widest sub-entry name. +%Similarly for \glostyle{mcoltreenonamegroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreenonamegroup} to discourage +%breaks after group headings} % \begin{macrocode} - \newcommand*{\glsgetwidestsubname}[1]{% - \ifcsundef{@glswidestname\romannumeral#1}% - {\@glswidestname}% - {\csuse{@glswidestname\romannumeral#1}}% +\ifdef{\@glsstyle@mcoltreenonamegroup} +{% + \renewglossarystyle{mcoltreenonamegroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestTopLevelName} -%CamelCase is easier for long command names. Provide a CamelCase -%synonym of \ics{glsfindwidesttoplevelname}. +%Similarly for \glostyle{mcoltreenonamehypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreenonamehypergroup} to discourage +%breaks after group headings} % \begin{macrocode} - \let\glsFindWidestTopLevelName\glsfindwidesttoplevelname +\ifdef{\@glsstyle@mcoltreenonamehypergroup} +{% + \renewglossarystyle{mcoltreenonamehypergroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% + } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestUsedTopLevelName} -%\changes{1.05}{2016-06-10}{new} -% Like \cs{glsfindwidesttoplevelname} but has an additional check -% that the entry has been used. Only useful if the glossaries occur -% at the end of the document, in which case this command should go -% at the start of the glossary. Alternatively, place at the end of -% the document and save for the next run. +%Similarly for \glostyle{mcoltreenonamespannav}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcoltreenonamespannav} to discourage +%breaks after group headings} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedTopLevelName}[1][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - \forallglossaries[#1]{\@gls@type}% +\ifdef{\@glsstyle@mcoltreenonamespannav} +{% + \renewglossarystyle{mcoltreenonamespannav}{% + \setglossarystyle{treenoname}% + \renewenvironment{theglossary}% {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \ifglshasparent{\@glo@label}% - {}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - }% - }% - {}% - }% - }% + \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}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestUsedAnyName} -%\changes{1.05}{2016-06-10}{new} -% Like the above but doesn't check the parent key. Useful if all -% levels should have the same width for the name. +%\glostyle{mcolalttree} needs adjusting so that it uses \cs{glsxtralttreeInit} +%This doesn't use \verb|\mbox{}\par| which would unbalance the top +%of the columns. +%\changes{1.21}{2017-11-03}{adjusted mcolalttree} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedAnyName}[1][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - \forallglossaries[#1]{\@gls@type}% +\ifdef{\@glsstyle@mcolalttree} +{% + \renewglossarystyle{mcolalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - }% - {}% - }% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \begin{multicols}{\glsmcols}% }% + {\par\end{multicols}}% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestAnyName} -%\changes{1.05}{2016-06-10}{new} -% Like the above but doesn't check is the entry has been used. +%Redefine \glostyle{mcolalttreegroup} to discourage page breaks +%after the group headings. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolalttreegroup} to discourage +%breaks after group headings} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestAnyName}[1][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - }% +\ifdef{\@glsstyle@mcolalttreegroup} +{% + \renewglossarystyle{mcolalttreegroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nopagebreak }% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestUsedLevelTwo} -%\changes{1.05}{2016-06-10}{new} -% This is like \cs{glsFindWidestUsedTopLevelName} but also sets the -% first two sub-levels as well. Any entry that has a -% great-grandparent is ignored. +%Similarly for \glostyle{mcolalttreehypergroup}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolalttreehypergroup} to discourage +%breaks after group headings} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedLevelTwo}[1][\@glo@types]{% - \dimen@=0pt\relax - \dimen@i=0pt\relax - \dimen@ii=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \ifglshasparent{\@glo@label}% - {% - \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% - \ifglshasparent{\@glo@parent}% - {% - \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% - \ifglshasparent{\@glo@parent}% - {}% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@ii - \dimen@ii=\gls@tmplen - \eglssetwidest[2]{\glsentryname{\@glo@label}}% - \fi - }% - }% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@i - \dimen@i=\gls@tmplen - \eglssetwidest[1]{\glsentryname{\@glo@label}}% - \fi - }% - }% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@ - \dimen@=\gls@tmplen - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - }% - }% - {}% - }% +\ifdef{\@glsstyle@mcolalttreehypergroup} +{% + \renewglossarystyle{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}}}% + \nopagebreak\indexspace\nopagebreak }% } +}% +{% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestLevelTwo} -%\changes{1.05}{2016-06-10}{new} -% This is like \cs{glsFindWidestUsedLevelTwo} but doesn't check if the -% entry has been used. +%Similarly for \glostyle{mcolalttreespannav}. +%\changes{1.21}{2017-11-03}{redefined \texttt{mcolalttreespannav} to discourage +%breaks after group headings} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestLevelTwo}[1][\@glo@types]{% - \dimen@=0pt\relax - \dimen@i=0pt\relax - \dimen@ii=0pt\relax - \forallglossaries[#1]{\@gls@type}% +\ifdef{\@glsstyle@mcolalttreespannav} +{% + \renewglossarystyle{mcolalttreespannav}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglshasparent{\@glo@label}% - {% - \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% - \ifglshasparent{\@glo@parent}% - {% - \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% - \ifglshasparent{\@glo@parent}% - {}% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@ii - \dimen@ii=\gls@tmplen - \eglssetwidest[2]{\glsentryname{\@glo@label}}% - \fi - }% - }% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@i - \dimen@i=\gls@tmplen - \eglssetwidest[1]{\glsentryname{\@glo@label}}% - \fi - }% - }% - {% - \settowidth{\gls@tmplen}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\gls@tmplen>\dimen@ - \dimen@=\gls@tmplen - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - }% - }% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \begin{multicols}{\glsmcols}% + [\noindent\glstreenavigationfmt{\glsnavigation}]% + }% + {\par\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nopagebreak }% } +}% +{% +} +% \end{macrocode} +% +% Reset the default style +% \begin{macrocode} +\ifx\@glossary@default@style\relax +\else + \setglossarystyle{\@glsxtr@current@style} +\fi +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-bookindex.sty> +% \end{macrocode} +%\fi +%\chapter{bookindex style (\styfmt{glossary-bookindex.sty})} +%\changes{1.21}{2017-11-03}{new} +%\section{Package Initialisation and Options} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossary-bookindex}[2017/11/03 v1.21 (NLCT)] +% \end{macrocode} +%Load required packages. +% \begin{macrocode} +\RequirePackage{multicol} +\RequirePackage{glossary-tree} +% \end{macrocode} +%\begin{macro}{\glsxtrbookindexcols} +%\changes{1.21}{2017-11-03}{new} +% Number of columns. +% \begin{macrocode} +\newcommand{\glsxtrbookindexcols}{2} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexname} +%\changes{1.21}{2017-11-03}{new} +%Format used for top-level entries. +% (Argument is the label.) +% \begin{macrocode} +\newcommand*{\glsxtrbookindexname}[1]{\glossentryname{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubname} +%\changes{1.21}{2017-11-03}{new} +%Format used for sub entries. +% \begin{macrocode} +\newcommand*{\glsxtrbookindexsubname}[1]{\glsxtrbookindexname{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsFindWidestUsedAnyNameSymbol} -%\changes{1.05}{2016-06-10}{new} -% Like the \cs{glsFindWidestUsedAnyName} but also measures the -% symbol. The length of the widest symbol is stored in the second argument -% should be a length register. +%\begin{macro}{\glsxtrprelocation} +%\changes{1.21}{2017-11-03}{new} +%Provide in case \sty{glossaries-stylemods} isn't loaded. % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedAnyNameSymbol}[2][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\glsentrysymbol{\@glo@label}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - }% - {}% - }% - }% - } +\providecommand*{\glsxtrprelocation}{\space} +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\glsxtrbookindexprelocation} +%\changes{1.21}{2017-11-03}{new} +%Separator used before location list for top-level entries. +% \begin{macrocode} +\newcommand*{\glsxtrbookindexprelocation}[1]{% + \glsxtrifhasfield{location}{#1}% + {\ifglsnopostdot,\fi\glsxtrprelocation}% + {\glsxtrprelocation}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubprelocation} +%\changes{1.21}{2017-11-03}{new} +%Separator used before location list for sub-entries. +% \begin{macrocode} +\newcommand*{\glsxtrbookindexsubprelocation}[1]{% + \glsxtrbookindexprelocation{#1}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsFindWidestAnyNameSymbol} -%\changes{1.05}{2016-06-10}{new} -% Like the above but doesn't check if the entry has been used. +%\begin{macro}{\glsxtrbookindexparentchildsep} +%\changes{1.21}{2017-11-03}{new} +%Separator used between top-level parent and child entry. % \begin{macrocode} - \newrobustcmd*{\glsFindWidestAnyNameSymbol}[2][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\glsentrysymbol{\@glo@label}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - }% - }% - } +\newcommand{\glsxtrbookindexparentchildsep}{\nopagebreak} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexparentsubchildsep} +%\changes{1.21}{2017-11-03}{new} +%Separator used between sub-level parent and child entry. +% \begin{macrocode} +\newcommand{\glsxtrbookindexparentsubchildsep}{\glsxtrbookindexparentchildsep} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsFindWidestUsedAnyNameSymbolLocation} -%\changes{1.05}{2016-06-10}{new} -% Like the \cs{glsFindWidestUsedAnyNameSymbol} but also measures the -% location list. This requires \ics{glsentrynumberlist}. -% The length of the widest symbol is stored in the second argument -% should be a length register. The length of the widest location -% list is stored in the third argument, which should also be a -% length register. +%\begin{macro}{\glsxtrbookindexbetween} +%\changes{1.21}{2017-11-03}{new} +%Between two top-level entries identified by the labels in the +%arguments. % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedAnyNameSymbolLocation}[3][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - #3=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\glsentrysymbol{\@glo@label}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - \settowidth{\dimen@}% - {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% - \ifdim\dimen@>#3\relax - #3=\dimen@ - \fi - }% - {}% - }% - }% - } +\newcommand{\glsxtrbookindexbetween}[2]{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubbetween} +%\changes{1.21}{2017-11-03}{new} +%Between two level~1 entries identified by the labels in the +%arguments. +% \begin{macrocode} +\newcommand{\glsxtrbookindexsubbetween}[2]{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubsubbetween} +%\changes{1.21}{2017-11-03}{new} +%Between two level~2 entries identified by the labels in the +%arguments. +% \begin{macrocode} +\newcommand{\glsxtrbookindexsubsubbetween}[2]{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexatendgroup} +%\changes{1.21}{2017-11-03}{new} +%At the end of a letter group. The argument is the index of the last +%top-level entry. +% \begin{macrocode} +\newcommand{\glsxtrbookindexatendgroup}[1]{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubatendgroup} +%\changes{1.21}{2017-11-03}{new} +%At the end of a letter group. The argument is the index of the last +%level~1 entry. +% \begin{macrocode} +\newcommand{\glsxtrbookindexsubatendgroup}[1]{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexsubsubatendgroup} +%\changes{1.21}{2017-11-03}{new} +%At the end of a letter group. The argument is the index of the last +%level~2 entry. +% \begin{macrocode} +\newcommand{\glsxtrbookindexsubsubatendgroup}[1]{} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsFindWidestAnyNameSymbolLocation} -%\changes{1.05}{2016-06-10}{new} -% Like the \cs{glsFindWidestUsedAnyNameSymbol} but doesn't check if -% the entry has been used. +%\begin{macro}{\glsxtrbookindexgroupskip} +%\changes{1.21}{2017-11-03}{new} +%Group separator. % \begin{macrocode} - \newrobustcmd*{\glsFindWidestAnyNameSymbolLocation}[3][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - #3=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\glsentrysymbol{\@glo@label}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - \settowidth{\dimen@}% - {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% - \ifdim\dimen@>#3\relax - #3=\dimen@ - \fi - }% - }% +\newcommand{\glsxtrbookindexgroupskip}{\ifglsnogroupskip\else\indexspace\fi} +% \end{macrocode} +%\end{macro} +% +%Format group title. +%\begin{macro}{\glsxtrbookindexformatheader} +%\changes{1.21}{2017-11-03}{new} +%Group separator. +% \begin{macrocode} +\newcommand*{\glsxtrbookindexformatheader}[1]{% + \par{\centering\glstreegroupheaderfmt{#1}\par}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrbookindexbookmark} +%\changes{1.21}{2017-11-03}{new} +%Book mark group heading if supported. +% \begin{macrocode} +\ifdef\pdfbookmark +{% + \newcommand*{\glsxtrbookindexbookmark}[2]{% + \ifdefstring{\@@glossarysec}{chapter}% + {\pdfbookmark[1]{#1}{#2}}% + {\pdfbookmark[2]{#1}{#2}}% } +} +{% + \newcommand*{\glsxtrbookindexbookmark}[2]{} +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsFindWidestUsedAnyNameLocation} -%\changes{1.05}{2016-06-10}{new} -% Like the \cs{glsFindWidestUsedAnyNameSymbolLocation} but doesn't -% measure the symbol. The length of the widest location -% list is stored in the second argument, which should be a -% length register. +%\begin{macro}{\glsxtrbookindexcolspread} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newrobustcmd*{\glsFindWidestUsedAnyNameLocation}[2][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \ifglsused{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - }% - {}% - }% +\newcommand*{\glsxtrbookindexcolspread}{} +% \end{macrocode} +%\end{macro} +%Define the style. +% \begin{macrocode} +\newglossarystyle{bookindex}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \ifdefempty\glsxtrbookindexcolspread + {\begin{multicols}{\glsxtrbookindexcols}}% + {\begin{multicols}{\glsxtrbookindexcols}[\glsxtrbookindexcolspread]}% + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\@glsxtr@bookindex@sep\glsxtrbookindexparentchildsep + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \let\@glsxtr@bookindex@between\@gobble + \let\@glsxtr@bookindex@subbetween\@gobble + \let\@glsxtr@bookindex@subsubbetween\@gobble + \let\@glsxtr@bookindex@atendgroup\relax + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax + \let\@glsxtr@bookindexgroupskip\relax + }% + {% +% \end{macrocode} +% Do end group hooks. +% \begin{macrocode} + \@glsxtr@bookindex@subsubatendgroup + \@glsxtr@bookindex@subatendgroup + \@glsxtr@bookindex@atendgroup +% \end{macrocode} +%End \env{multicols} environment. +% \begin{macrocode} + \end{multicols}% + }% +% \end{macrocode} +%Use ragged right as columns are likely to be narrow and +%indexes tend not to be fully justified. +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\raggedright}% +% \end{macrocode} +%Top level entry format. +% \begin{macrocode} + \renewcommand*{\glossentry}[2]{% +% \end{macrocode} +%Do separator. +% \begin{macrocode} + \@glsxtr@bookindex@between{##1}% +% \end{macrocode} +%Update separators. +% \begin{macrocode} + \let\@glsxtr@bookindex@sep\glsxtrbookindexparentchildsep + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \let\@glsxtr@bookindex@subbetween\@gobble + \let\@glsxtr@bookindex@subsubbetween\@gobble + \edef\@glsxtr@bookindex@between{% + \noexpand\glsxtrbookindexbetween{##1}% }% - } + \edef\@glsxtr@bookindex@atendgroup{% + \noexpand\glsxtrbookindexatendgroup{##1}% + }% + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax +% \end{macrocode} +%Format entry. +% \begin{macrocode} + \glstreeitem + \glsentryitem{##1}% + \glstarget{##1}{\glsxtrbookindexname{##1}}% + \glsxtrbookindexprelocation{##1}##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax +% \end{macrocode} +% Level 0 (shouldn't happen as that's formatted with \cs{glossentry}). +% \begin{macrocode} + \glstreeitem + \or +% \end{macrocode} +% Level 1. +% \begin{macrocode} + \@glsxtr@bookindex@sep + \@glsxtr@bookindex@subbetween{##2}% + \let\@glsxtr@bookindex@sep\relax +% \end{macrocode} +% Update separators. +% \begin{macrocode} + \let\@glsxtr@bookindex@subsubbetween\@gobble + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \edef\@glsxtr@bookindex@subbetween{% + \noexpand\glsxtrbookindexsubbetween{##2}% + }% + \edef\@glsxtr@bookindex@atsubendgroup{% + \noexpand\glsxtrbookindexatsubendgroup{##1}% + }% +% \end{macrocode} +% Start sub-item. +% \begin{macrocode} + \glstreesubitem + \glssubentryitem{##2}% + \else +% \end{macrocode} +% All other levels. +% \begin{macrocode} + \@glsxtr@bookindex@subsep + \@glsxtr@bookindex@subsubbetween{##2}% +% \end{macrocode} +% Update separators. +% \begin{macrocode} + \let\@glsxtr@bookindex@subsep\relax + \edef\@glsxtr@bookindex@subsubbetween{% + \noexpand\glsxtrbookindexsubsubbetween{##2}% + }% + \edef\@glsxtr@bookindex@atsubsubendgroup{% + \noexpand\glsxtrbookindexatsubsubendgroup{##1}% + }% +% \end{macrocode} +% Start sub-sub-item. +% \begin{macrocode} + \glstreesubsubitem + \fi +% \end{macrocode} +% Format entry. +% \begin{macrocode} + \glstarget{##2}{\glsxtrbookindexsubname{##2}}% + \glsxtrbookindexsubprelocation{##2}##3% + }% +% \end{macrocode} +% The group skip is moved to the group heading to avoid interfering +% with the end letter group hooks. +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{}% +% \end{macrocode} +% Group heading format. +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% +% \end{macrocode} +% Do end group hooks. +% \begin{macrocode} + \@glsxtr@bookindex@subsubatendgroup + \@glsxtr@bookindex@subatendgroup + \@glsxtr@bookindex@atendgroup + \@glsxtr@bookindexgroupskip +% \end{macrocode} +% Update separators. +% \begin{macrocode} + \let\@glsxtr@bookindexgroupskip\glsxtrbookindexgroupskip + \let\@glsxtr@bookindex@between\@gobble + \let\@glsxtr@bookindex@atendgroup\relax + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax +% \end{macrocode} +% Fetch the group title from the label supplied in \verb|#1|. +% \begin{macrocode} + \glsxtrgetgrouptitle{##1}{\thisgrptitle}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsFindWidestAnyNameLocation} -%\changes{1.05}{2016-06-10}{new} -% Like the \cs{glsFindWidestAnyNameLocation} but doesn't -% check the \gls{firstuse} flag. +% Do the PDF bookmark if supported. % \begin{macrocode} - \newrobustcmd*{\glsFindWidestAnyNameLocation}[2][\@glo@types]{% - \dimen@=0pt\relax - \gls@tmplen=0pt\relax - #2=0pt\relax - \forallglossaries[#1]{\@gls@type}% - {% - \forglsentries[\@gls@type]{\@glo@label}% - {% - \settowidth{\dimen@}% - {\glstreenamefmt{\glsentryname{\@glo@label}}}% - \ifdim\dimen@>\gls@tmplen - \gls@tmplen=\dimen@ - \eglssetwidest{\glsentryname{\@glo@label}}% - \fi - \settowidth{\dimen@}% - {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% - \ifdim\dimen@>#2\relax - #2=\dimen@ - \fi - }% - }% - } + \glsxtrbookindexbookmark{\thisgrptitle}{index.##1}% +% \end{macrocode} +% Format the group title. +% \begin{macrocode} + \glsxtrbookindexformatheader{\thisgrptitle}% + \nopagebreak\indexspace\nopagebreak\@afterheading + }% +} +% \end{macrocode} +% Some supplementary commands that may be useful. +% These store the entry label for the current page. Since the page +% number is needed in the control sequence, this uses +% \cs{glsxtrbookindexthepage} instead of \cs{thepage} in case +% the page numbering has been set to something that contains +% formatting commands. +%\begin{macro}{\glsxtrbookindexthepage} +%\changes{1.21}{2017-11-03}{new} +%The \cs{@printglossary} sets \cs{currentglossary} to the current +%glossary label. This is used as a prefix in case the page number is +%reset. +% \begin{macrocode} +\newcommand{\glsxtrbookindexthepage}{% + \ifdef\currentglossary{\currentglossary.\arabic{page}}{\arabic{page}}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrComputeTreeIndent} -%\changes{1.05}{2016-06-10}{new} -% Compute the value of \cs{glstreeindent}. Argument is the entry label. -% (Ignored in default definition, but this command may be redefined -% to take the particular entry into account.) Note that the -% sub-levels modify \cs{glstreeindent}. +%\begin{macro}{\glsxtrbookindexmarkentry} +%\changes{1.21}{2017-11-03}{new} +%Writes entry information to the \texttt{.aux} file. The argument is +%the entry label. % \begin{macrocode} - \newcommand*{\glsxtrComputeTreeIndent}[1]{% - \glstreeindent=\glsxtrtreetopindent\relax - } +\newcommand*{\glsxtrbookindexmarkentry}[1]{% + \protected@write\@auxout + {\let\glsxtrbookindexthepage\relax}% + {\string\glsxtr@setbookindexmark{\glsxtrbookindexthepage}{#1}}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsxtrComputeTreeSubIndent} -%\changes{1.05}{2016-06-10}{new} -%\begin{definition} -%\cs{glsxtrComputeTreeSubIndent}\marg{level}\marg{label}\marg{register} -%\end{definition} -% Compute the indent for the sub-entries. The first argument is the -% level, the second argument is the entry label and the third -% argument is the length register used to store the computed indent. +%\begin{macro}{\glsxtr@setbookindexmark} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \newcommand*{\glsxtrComputeTreeSubIndent}[3]{% - \ifcsundef{@glswidestname\romannumeral#1}% - {% - \settowidth{#3}{\glstreenamefmt{\@glswidestname\space}}% - }% - {% - \settowidth{#3}{\glstreenamefmt{% - \csname @glswidestname\romannumeral#1\endcsname\space}}% - }% - } +\newcommand*{\glsxtr@setbookindexmark}[2]{% + \ifcsundef{glsxtr@idxfirstmark@#1}% + {\csgdef{glsxtr@idxfirstmark@#1}{#2}}% + {}% + \csgdef{glsxtr@idxlastmark@#1}{#2}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsxtrAltTreeSetHangIndent} -%\changes{1.05}{2016-06-10}{new} -% Set \cs{hangindent} for top-level entries: +%\begin{macro}{\glsxtrbookindexfirstmarkfmt} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\glsxtrAltTreeSetHangIndent}{\hangindent\glstreeindent} +\newcommand*{\glsxtrbookindexfirstmarkfmt}[1]{% + \glsentryname{#1}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsxtrAltTreeSetSubHangIndent} -%\changes{1.05}{2016-06-10}{new} -% Set \cs{hangindent} for sub-entries: +%\begin{macro}{\glsxtrbookindexfirstmark} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} -\newcommand*{\glsxtrAltTreeSetSubHangIndent}[1]{\hangindent\glstreeindent} +\newcommand*{\glsxtrbookindexfirstmark}{% + \letcs{\glsxtr@label}{glsxtr@idxfirstmark@\glsxtrbookindexthepage}% + \ifdef\glsxtr@label + {\glsxtrbookindexfirstmarkfmt{\glsxtr@label}}% + {}% +} % \end{macrocode} %\end{macro} % -% Redefine \glostyle{alttree}: +%\begin{macro}{\glsxtrbookindexlastmarkfmt} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} - \renewglossarystyle{alttree}{% - \renewenvironment{theglossary}% - {% - \glsxtralttreeInit - \def\@gls@prevlevel{-1}% - \mbox{}\par}% - {\par}% - \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{}% - \renewcommand{\glossentry}[2]{% - \ifnum\@gls@prevlevel=0\relax - \else - \glsxtrComputeTreeIndent{##1}% - \fi - \parindent\glstreeindent - \glsxtrAltTreeSetHangIndent - \makebox[0pt][r]% - {% - \glstreenamebox{\glstreeindent}% - {% - \glsentryitem{##1}% - \glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% - }% - }% - \glsxtralttreeSymbolDescLocation{##1}{##2}% - \def\@gls@prevlevel{0}% - } - \renewcommand{\subglossentry}[3]{% - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \ifnum\@gls@prevlevel=##1\relax - \else - \glsxtrComputeTreeSubIndent{##1}{##2}{\gls@tmplen}% - \ifnum\@gls@prevlevel<##1\relax - \setlength\glstreeindent\gls@tmplen - \addtolength\glstreeindent\parindent - \parindent\glstreeindent - \else - \ifnum\@gls@prevlevel=0\relax - \glsxtrComputeTreeIndent{##2}% - \else - \glsxtrComputeTreeSubIndent{\@gls@prevlevel}{##2}{\glstreeindent}% - \fi - \addtolength\parindent{-\glstreeindent}% - \setlength\glstreeindent\parindent - \fi - \fi - \glsxtrAltTreeSetSubHangIndent{##1}% - \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% - \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% - \glsxtralttreeSubSymbolDescLocation{##1}{##2}{##3}% - \def\@gls@prevlevel{##1}% - }% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% - } -}% -{% +\newcommand*{\glsxtrbookindexlastmarkfmt}[1]{% + \glsentryname{#1}% +} % \end{macrocode} -% Assume the style isn't required if it hasn't already been defined. +%\end{macro} +%\begin{macro}{\glsxtrbookindexlastmark} +%\changes{1.21}{2017-11-03}{new} % \begin{macrocode} +\newcommand*{\glsxtrbookindexlastmark}{% + \letcs{\glsxtr@label}{glsxtr@idxlastmark@\glsxtrbookindexthepage}% + \ifdef\glsxtr@label + {\glsxtrbookindexlastmarkfmt{\glsxtr@label}}% + {}% } % \end{macrocode} +%\end{macro} % -% Reset the default style -% \begin{macrocode} -\ifx\@glossary@default@style\relax -\else - \setglossarystyle{\@glsxtr@current@style} -\fi -% \end{macrocode} %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse @@ -20042,7 +23006,9 @@ Dickimaw Books\\ %\fi %\iffalse % \begin{macrocode} +%<{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\glsxtrprelocation ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}% + \glspostdescription\glsxtrprelocation ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & \tabularnewline}% + \fi } } {} @@ -145,8 +315,11 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& &\tabularnewline}% + \fi } } {} @@ -170,8 +343,39 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & \glossentrysymbol{##2} & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & & &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } +} +{} +\ifcsdef{@glsstyle@super} +{% + \renewglossarystyle{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 + \glsxtrprelocation ##2\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glsxtrprelocation ##3\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi } } {} @@ -194,8 +398,11 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & &\tabularnewline}% + \fi } } {} @@ -219,8 +426,40 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & \glossentrysymbol{##2} & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{% - \ifglsnogroupskip\else & & &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi + } +} +{} +\ifcsdef{@glsstyle@superragged} +{% + \renewglossarystyle{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\glsxtrprelocation ##2% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription + \glsxtrprelocation ##3% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& \tabularnewline}% + \fi } } {} @@ -245,8 +484,11 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & - &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{ & &\tabularnewline}% + \fi } } {} @@ -270,8 +512,11 @@ \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & \glossentrysymbol{##2} & ##3\tabularnewline }% - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & - &\tabularnewline\fi}% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & &\tabularnewline}% + \fi } } {} @@ -284,13 +529,194 @@ #1\glsxtrpostdescription} } {} +\ifdef{\@glsstyle@index} +{ + \newcommand*{\glstreeprelocation}{\glsxtrprelocation} + \newcommand*{\glstreechildprelocation}{\glstreeprelocation} + \renewglossarystyle{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 + \glstreeprelocation ##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + \item + \or + \subitem + \glssubentryitem{##2}% + \else + \subsubitem + \fi + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \glstreechildpredesc\glossentrydesc{##2}\glspostdescription + \glstreechildprelocation ##3% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + } +} +{} +\ifdef{\@glsstyle@indexgroup} +{% + \renewglossarystyle{indexgroup}{% + \setglossarystyle{index}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace + \nobreak\@afterheading + }% + } +} +{} +\ifdef{\@glsstyle@indexhypergroup} +{% + \renewglossarystyle{indexhypergroup}{% + \setglossarystyle{index}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}% + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace + \nobreak\@afterheading}% + }% +} +{} +\ifdef{\@glsstyle@tree} +{% + \renewglossarystyle{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 + \glstreeprelocation##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 + \glstreechildprelocation ##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + }% +} +{} +\ifdef{\@glsstyle@treegroup} +{% + \renewglossarystyle{treegroup}{% + \setglossarystyle{tree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}\par + \nopagebreak\indexspace\nobreak\@afterheading}% + } +} +{} +\ifdef{\@glsstyle@treehypergroup} +{% + \renewglossarystyle{treehypergroup}{% + \setglossarystyle{tree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \nopagebreak\indexspace\nobreak\@afterheading}% + } +} +{} +\ifdef{\@glsstyle@treenoname} +{% + \renewglossarystyle{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 + \glstreeprelocation##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\glstreechildprelocation##3\par + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + } +} +{} +\ifdef{\@glsstyle@treenonamegroup} +{% + \renewglossarystyle{treenonamegroup}{% + \setglossarystyle{treenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt + {\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +} +{} +\ifdef{\@glsstyle@treenonamehypergroup} +{% + \renewglossarystyle{treenonamehypergroup}{% + \setglossarystyle{treenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par + \nobreak\@afterheading\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% + } +} +{} \ifdef{\@glsstyle@alttree} {% \newcommand{\glsxtralttreeSymbolDescLocation}[2]{% {% \let\par\glsxtrAltTreePar \ifglshassymbol{#1}{(\glossentrysymbol{#1})\space}{}% - \glossentrydesc{#1}\glspostdescription \space #2\par + \glossentrydesc{#1}\glspostdescription\glstreeprelocation #2\par }% } \newlength\glsxtrAltTreeIndent @@ -307,6 +733,9 @@ \settowidth{\glsxtrtreetopindent}{\glstreenamefmt{\glsgetwidestname\space}}% \glsxtrAltTreeIndent=\parindent } + \newcommand*{\gglssetwidest}[2][0]{% + \csgdef{@glswidestname\romannumeral#1}{#2}% + } \newcommand*{\eglssetwidest}[2][0]{% \protected@csedef{@glswidestname\romannumeral#1}{#2}% } @@ -643,8 +1072,8 @@ \csname @glswidestname\romannumeral#1\endcsname\space}}% }% } -\newcommand*{\glsxtrAltTreeSetHangIndent}{\hangindent\glstreeindent} -\newcommand*{\glsxtrAltTreeSetSubHangIndent}[1]{\hangindent\glstreeindent} + \newcommand*{\glsxtrAltTreeSetHangIndent}{\hangindent\glstreeindent} + \newcommand*{\glsxtrAltTreeSetSubHangIndent}[1]{\hangindent\glstreeindent} \renewglossarystyle{alttree}{% \renewenvironment{theglossary}% {% @@ -704,6 +1133,267 @@ }% {% } +\ifdef{\@glsstyle@alttreegroup} +{% + \renewglossarystyle{alttreegroup}{% + \setglossarystyle{alttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nopagebreak + }% + }% +}% +{% +} +\ifdef{\@glsstyle@alttreehypergroup} +{% + \renewglossarystyle{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 + \nopagebreak\indexspace\nopagebreak + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcolindexgroup} +{% + \renewglossarystyle{mcolindexgroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcolindexhypergroup} +{% + \renewglossarystyle{mcolindexhypergroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glossaryheader}{% + \item\glstreenavigationfmt{\glsnavigation}% + \indexspace + }% + \renewcommand*{\glsgroupheading}[1]{% + \item\glstreegroupheaderfmt + {\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcolindexspannav} +{% + \renewglossarystyle{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}}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreegroup} +{% + \renewglossarystyle{mcoltreegroup}{% + \setglossarystyle{mcoltree}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreehypergroup} +{% + \renewglossarystyle{mcoltreehypergroup}{% + \setglossarystyle{mcoltree}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace + }% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreespannav} +{% + \renewglossarystyle{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}}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreenonamegroup} +{% + \renewglossarystyle{mcoltreenonamegroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand{\glsgroupheading}[1]{\par + \noindent\glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nobreak\@afterheading + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreenonamehypergroup} +{% + \renewglossarystyle{mcoltreenonamehypergroup}{% + \setglossarystyle{mcoltreenoname}% + \renewcommand*{\glossaryheader}{% + \par\noindent\glstreenavigationfmt{\glsnavigation}\par\indexspace}% + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% + } +}% +{% +} +\ifdef{\@glsstyle@mcoltreenonamespannav} +{% + \renewglossarystyle{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}}}% + \nopagebreak\indexspace\nobreak\@afterheading}% + } +}% +{% +} +\ifdef{\@glsstyle@mcolalttree} +{% + \renewglossarystyle{mcolalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \begin{multicols}{\glsmcols}% + }% + {\par\end{multicols}}% + } +}% +{% +} +\ifdef{\@glsstyle@mcolalttreegroup} +{% + \renewglossarystyle{mcolalttreegroup}{% + \setglossarystyle{mcolalttree}% + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsgetgrouptitle{##1}}% + \nopagebreak\indexspace\nopagebreak + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcolalttreehypergroup} +{% + \renewglossarystyle{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}}}% + \nopagebreak\indexspace\nopagebreak + }% + } +}% +{% +} +\ifdef{\@glsstyle@mcolalttreespannav} +{% + \renewglossarystyle{mcolalttreespannav}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \begin{multicols}{\glsmcols}% + [\noindent\glstreenavigationfmt{\glsnavigation}]% + }% + {\par\end{multicols}}% + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \glstreegroupheaderfmt{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \nopagebreak\indexspace\nopagebreak + }% + } +}% +{% +} \ifx\@glossary@default@style\relax \else \setglossarystyle{\@glsxtr@current@style} diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty index 6cef1c74f7c..22e40c389af 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. +%% This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. %% %% \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 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2017/09/11 v1.20 (NLCT)] +\ProvidesPackage{glossaries-extra}[2017/11/03 v1.21 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{etoolbox} \@ifpackageloaded{glossaries} @@ -120,23 +120,13 @@ \newcommand*{\GlsXtrSetDefaultNumberFormat}[1]{% \renewcommand*{\@glsxtr@defaultnumberformat}{#1}% }% -\newcommand*{\@@glsxtr@record}[3]{% +\newcommand*{\@glsxtr@do@record@wrglossary}[1]{% \begingroup - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \def\@glsxtr@thevalue{}% - \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% - \let\@glsxtr@org@theHvalue\@glsxtr@theHvalue - \ifcsdef{glo@#2@counter}% - {% - \edef\@gls@counter{\csname glo@#2@counter\endcsname}% - }% - {% - \def\@gls@counter{page}% - }% - \setkeys{#3}{#1}% \ifKV@glslink@noindex \else - \glswriteentry{#2}% + \edef\@gls@label{\glsdetoklabel{#1}}% + \let\glslabel\@gls@label + \glswriteentry{#1}% {% \ifdefempty{\@glsxtr@thevalue}% {% @@ -153,15 +143,61 @@ \let\@@do@@wrglossary\@glsxtr@dorecordnodefer }% \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex - \glsxtr@@do@wrglossary{#2}% + \glsxtr@@do@wrglossary{#1}% \else - \edef\@gls@label{\glsdetoklabel{#2}}% + \@@glsxtrwrglossmark \@@do@@wrglossary \fi }% \fi \endgroup } +\newcommand*{\glsxtr@do@alsoindex@wrglossary}[1]{% + \glsxtr@@do@wrglossary{#1}% + \@glsxtr@do@record@wrglossary{#1}% +} +\newcommand*{\@@glsxtr@record}[3]{% + \ifglsentryexists{#2}{}% + {% + \@@glsxtrwrglossmark + \begingroup + \edef\@gls@label{\glsdetoklabel{#2}}% + \let\glslabel\@gls@label + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \let\@glsxtr@org@theHvalue\@glsxtr@theHvalue + \def\@gls@counter{page}% + \@gls@setdefault@glslink@opts + \setkeys{#3}{#1}% + \ifKV@glslink@noindex + \else + \glswriteentry{#2}% + {% + \ifdefempty{\@glsxtr@thevalue}% + {% + \ifx\@glsxtr@org@theHvalue\@glsxtr@theHvalue + \else + \let\theHglsentrycounter\@glsxtr@theHvalue + \fi + \glsxtr@saveentrycounter + \let\@@do@@wrglossary\@glsxtr@dorecord + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \let\theHglsentrycounter\@glsxtr@theHvalue + \let\@@do@@wrglossary\@glsxtr@dorecordnodefer + }% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \glsxtr@@do@wrglossary{#2}% + \else + \@@do@@wrglossary + \fi + }% + \fi + \endgroup + }% +} \newcommand*\@glsxtr@dorecord{% \global\let\@glsrecordlocref\theglsentrycounter \let\@glsxtr@orgprefix\@glo@counterprefix @@ -206,6 +242,7 @@ \eappto\@glsxtr@counterrecordhook{\noexpand\@glsxtr@docounterrecord{#1}}% } \newcommand*{\@glsxtr@recordsee}[2]{% + \@@glsxtrwrglossmark \def\@gls@xref{#2}% \@onelevel@sanitize\@gls@xref \protected@write\@auxout{}{\string\glsxtr@recordsee{#1}{\@gls@xref}}% @@ -213,7 +250,7 @@ \newcommand{\printunsrtglossaryunit}{% \print@noop@unsrtglossaryunit } -\newcommand*{\glsxtr@setup@record}{} +\newcommand*{\glsxtr@setup@record}{\let\@@do@wrglossary\glsxtr@@do@wrglossary} \newcommand*{\glsxtr@indexonly@saveentrycounter}{% \ifKV@glslink@noindex \else @@ -257,6 +294,8 @@ } \newcommand*{\@glsxtr@record@setting}{off} \newcommand*{\@glsxtr@record@setting@alsoindex}{alsoindex} +\newcommand*{\@glsxtr@record@setting@only}{only} +\newcommand*{\@glsxtr@record@setting@off}{off} \define@choicekey{glossaries-extra.sty}{record}[\val\nr]% {off,only,alsoindex}% [only]% @@ -264,7 +303,7 @@ \let\@glsxtr@record@setting\val \ifcase\nr\relax \def\glsxtr@setup@record{% - \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% + \renewcommand*{\@do@seeglossary}{\@glsxtr@doseeglossary}% \renewcommand*{\@glsxtr@record}[3]{}% \let\@@do@wrglossary\glsxtr@@do@wrglossary \let\@gls@saveentrycounter\glsxtr@indexonly@saveentrycounter @@ -279,7 +318,7 @@ \@glsxtr@autoseeindexfalse \let\@do@seeglossary\@glsxtr@recordsee \let\@glsxtr@record\@@glsxtr@record - \let\@@do@wrglossary\@gobble + \let\@@do@wrglossary\@glsxtr@do@record@wrglossary \let\@gls@saveentrycounter\relax \let\glsxtrundefaction\@glsxtr@warn@undefaction \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo @@ -292,9 +331,9 @@ }% \or \def\glsxtr@setup@record{% - \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% + \renewcommand*{\@do@seeglossary}{\@glsxtr@dosee@alsoindex@glossary}% \let\@glsxtr@record\@@glsxtr@record - \let\@@do@wrglossary\glsxtr@@do@wrglossary + \let\@@do@wrglossary\glsxtr@do@alsoindex@wrglossary \let\@gls@saveentrycounter\glsxtr@indexonly@saveentrycounter \let\glsxtrundefaction\@glsxtr@warn@undefaction \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo @@ -338,8 +377,52 @@ \let\GlossariesExtraWarningNoLine\@gobble \glsxtr@dooption{nowarn}% } +\newcommand*{\@glsxtr@defpostpunc}{} \@glsxtr@declareoption{postdot}{% \glsxtr@dooption{nopostdot=false}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi}% + }% +} + +\define@choicekey{glossaries-extra.sty}{nopostdot}{true,false}[true]{% + \glsxtr@dooption{nopostdot=#1}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{% + \ifglsnopostdot\else.\spacefactor\sfcode`\. \fi}% + }% +} +\define@key{glossaries-extra.sty}{postpunc}{% + \glsxtr@dooption{nopostdot=false}% + \ifstrequal{#1}{dot}% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{.\spacefactor\sfcode`\. }% + }% + }% + {% + \ifstrequal{#1}{comma}% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{,}% + }% + }% + {% + \ifstrequal{#1}{none}% + {% + \glsxtr@dooption{nopostdot=true}% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{}% + }% + }% + {% + \renewcommand*{\@glsxtr@defpostpunc}{% + \renewcommand*{\glspostdescription}{#1}% + }% + }% + }% + }% } \newcommand*{\glsxtrabbrvtype}{\glsdefaulttype} \newcommand*{\@glsxtr@abbreviationsdef}{} @@ -433,7 +516,7 @@ \newcommand*{\@glsxtr@setupshortcuts}{} \newcommand*{\@glsxtr@shortcutsval}{\ifglsacrshortcuts acro\else none\fi}% \define@choicekey{glossaries-extra.sty}{shortcuts}[\val\nr]% - {acronyms,acro,abbreviations,abbr,other,all,true,none,false,ac}[true]{% + {acronyms,acro,abbreviations,abbr,other,all,true,ac,none,false}[true]{% \let\@glsxtr@shortcutsval\val \ifcase\nr\relax % acronyms \renewcommand*{\@glsxtr@setupshortcuts}{% @@ -460,24 +543,24 @@ \or % all \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue - \DefineAcronymSynonyms + \GlsXtrDefineAcShortcuts \GlsXtrDefineAbbreviationShortcuts \GlsXtrDefineOtherShortcuts }% \or % true \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue - \DefineAcronymSynonyms + \GlsXtrDefineAcShortcuts \GlsXtrDefineAbbreviationShortcuts \GlsXtrDefineOtherShortcuts }% - \or % none, false - \renewcommand*{\@glsxtr@setupshortcuts}{}% \or % ac \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue \GlsXtrDefineAcShortcuts }% + \else % none, false + \renewcommand*{\@glsxtr@setupshortcuts}{}% \fi } \newcommand*{\@glsxtr@doaccsupp}{} @@ -506,23 +589,32 @@ \RequirePackage{glossaries-extra-stylemods}}% }% {% - \renewcommand*{\@glsxtr@redefstyles}{}% - \@for\@glsxtr@tmp:=#1\do{% - \IfFileExists{glossary-\@glsxtr@tmp.sty}% - {% - \eappto\@glsxtr@redefstyles{% - \noexpand\RequirePackage{glossary-\@glsxtr@tmp}}% - }% - {% - \PackageError{glossaries-extra}% - {Glossaries style package `glossary-\@glsxtr@tmp.sty' - doesn't exist (did you mean to use the `style' key?)}% - {The list of values (#1) in the `stylemods' key should - match the glossary-xxx.sty files provided with - glossaries.sty}% + \ifstrequal{#1}{all}% + {% + \renewcommand*{\@glsxtr@redefstyles}{% + \PassOptionsToPackage{all}{glossaries-extra-stylemods}% + \RequirePackage{glossaries-extra-stylemods}% }% }% - \appto\@glsxtr@redefstyles{\RequirePackage{glossaries-extra-stylemods}}% + {% + \renewcommand*{\@glsxtr@redefstyles}{}% + \@for\@glsxtr@tmp:=#1\do{% + \IfFileExists{glossary-\@glsxtr@tmp.sty}% + {% + \eappto\@glsxtr@redefstyles{% + \noexpand\RequirePackage{glossary-\@glsxtr@tmp}}% + }% + {% + \PackageError{glossaries-extra}% + {Glossaries style package `glossary-\@glsxtr@tmp.sty' + doesn't exist (did you mean to use the `style' key?)}% + {The list of values (#1) in the `stylemods' key should + match the glossary-xxx.sty files provided with + glossaries.sty}% + }% + }% + \appto\@glsxtr@redefstyles{\RequirePackage{glossaries-extra-stylemods}}% + } }% } \newcommand*{\@glsxtr@do@style}{} @@ -532,12 +624,62 @@ \setglossarystyle{#1}% }% } +\newcommand*{\@glsxtrwrglossmark}{} +\newcommand*{\@@glsxtrwrglossmark}{} +\AtBeginDocument{\renewcommand*{\@@glsxtrwrglossmark}{\@glsxtrwrglossmark}} +\newcommand*{\glsxtrwrglossmark}{\ensuremath{\cdot}} +\define@choicekey{glossaries-extra.sty}{debug}[\val\nr]% + {true,false,showtargets,showwrgloss,all}[true]{% + \ifcase\nr\relax % true + \glsxtr@dooption{debug=true}% + \renewcommand*{\@glsxtrwrglossmark}{}% + \or % false + \glsxtr@dooption{debug=false}% + \renewcommand*{\@glsxtrwrglossmark}{}% + \or % showtargets + \glsxtr@dooption{debug=showtargets}% + \or % showwrgloss + \glsxtr@dooption{debug=true}% + \renewcommand*{\@glsxtrwrglossmark}{\glsxtrwrglossmark}% + \or % all + \glsxtr@dooption{debug=showtargets}% + \renewcommand*{\@glsxtrwrglossmark}{\glsxtrwrglossmark}% + \fi + } \DeclareOptionX*{% \expandafter\glsxtr@dooption\expandafter{\CurrentOption}} \ProcessOptionsX \RequirePackage{glossaries} \@glsxtr@doaccsupp +\@glsxtr@defpostpunc +\def\glsshowtarget#1{% + \glsxtrtitleorpdforheading + {% + \ifmmode + \texttt{\small [#1]}% + \else + \ifinner + \texttt{\small [#1]}% + \else + \marginpar{\texttt{\small #1}}% + \fi + \fi + }% + {[#1]}% + {\texttt{\small [#1]}}% +} \let\@glsxtr@org@doseeglossary\@do@seeglossary +\newcommand*{\@glsxtr@doseeglossary}[2]{% + \glsdoifexists{#1}% + {% + \@@glsxtrwrglossmark + \@glsxtr@org@doseeglossary{#1}{#2}% + }% +} +\newcommand*{\@glsxtr@dosee@alsoindex@glossary}[2]{% + \@glsxtr@recordsee{#1}{#2}% + \@glsxtr@doseeglossary{#1}{#2}% +} \let\@glsxtr@org@gloautosee\@glo@autosee \if@glsxtr@autoseeindex \else @@ -573,7 +715,11 @@ \glsxtr@setup@record \@glsxtr@redef@forglsentries } -\let\glsxtr@@do@wrglossary\@@do@wrglossary +\let\glsxtr@org@@do@wrglossary\@@do@wrglossary +\newcommand*{\glsxtr@@do@wrglossary}[1]{% + \@@glsxtrwrglossmark + \glsxtr@org@@do@wrglossary{#1}% +} \let\glsxtr@saveentrycounter\@gls@saveentrycounter \let\@gls@saveentrycounter\glsxtr@indexonly@saveentrycounter \glsxtr@setup@record @@ -699,11 +845,11 @@ } \newcommand{\s@glsxtrifhasfield}[4]{% \letcs{\glscurrentfieldvalue}{glo@\glsdetoklabel{#2}@#1}% - \ifdef\glscurrentfieldvalue + \ifundef\glscurrentfieldvalue + {#4}% {% \ifdefempty\glscurrentfieldvalue{#4}{#3}% }% - {#4}% } \newcommand*{\glsxtrusefield}[2]{% \@gls@entry@field{#1}{#2}% @@ -742,6 +888,13 @@ \glsxtrsetfieldifexists{#1}{#2}% {\protected@csedef{glo@\glsdetoklabel{#1}@#2}{#3}}% } +\newrobustcmd*{\GlsXtrIfFieldEqStr}[5]{% + \glsxtrifhasfield{#1}{#2}% + {% + \ifdefstring{\glscurrentfieldvalue}{#3}{#4}{#5}% + }% + {#5}% +} \ifglsentrycounter \newcommand*{\glsxtrpageref}[1]{\pageref{glsentry-\glsdetoklabel{#1}}} \else @@ -1038,6 +1191,9 @@ \newcommand*{\glsxtruseseeformat}[2]{% \glsseeformat[#1]{#2}{}% } +\renewcommand*{\glsseeitemformat}[1]{% + \glsifregular{#1}{\glsaccessname{#1}}{\glsaccesstext{#1}}% +} \newcommand*{\glsxtruseseealso}[1]{% \glsdoifexists{#1}% {% @@ -1068,15 +1224,22 @@ } \appto\@xdylocationclassorder{\space\string"seealso\string"} \newrobustcmd*{\glsxtrindexseealso}[2]{% - \def\@gls@xref{#2}% - \@onelevel@sanitize\@gls@xref - \@gls@checkmkidxchars\@gls@xref - \gls@glossary{\csname glo@#1@type\endcsname}{% - (indexentry - :tkey (\csname glo@#1@index\endcsname) - :xref (\string"\@gls@xref\string") - :attr \string"seealso\string" - ) + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \@glsxtr@recordsee{#1}{#2}% + \fi + \glsdoifexists{#1}% + {% + \@@glsxtrwrglossmark + \def\@gls@xref{#2}% + \@onelevel@sanitize\@gls@xref + \@gls@checkmkidxchars\@gls@xref + \gls@glossary{\csname glo@#1@type\endcsname}{% + (indexentry + :tkey (\csname glo@#1@index\endcsname) + :xref (\string"\@gls@xref\string") + :attr \string"seealso\string" + ) + }% }% } } @@ -1198,22 +1361,44 @@ \newcommand*{\glsxtrunusedformat}[1]{\unskip} \let\glsxtr@orgmakenoidxglossaries\makenoidxglossaries \renewcommand{\makenoidxglossaries}{% - \glsxtr@orgmakenoidxglossaries - \if@glsxtrdocdefrestricted - \renewcommand*{\@gls@reference}[3]{% - \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}% + \ifdefequal\@glsxtr@record@setting\@glsxtr@record@setting@off + {% + \glsxtr@orgmakenoidxglossaries + \renewcommand{\@do@seeglossary}[2]{% + \@@glsxtrwrglossmark + \edef\@gls@label{\glsdetoklabel{##1}}% + \protected@write\@auxout{}{% + \string\@gls@reference + {\csname glo@\@gls@label @type\endcsname}% + {\@gls@label}% + {% + \string\glsseeformat##2{}% + }% + }% }% - \else - \@glsxtrdocdeffalse - \fi - \disable@keys{glossaries-extra.sty}{docdef}% + \if@glsxtrdocdefrestricted + \renewcommand*{\@gls@reference}[3]{% + \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}% + }% + \else + \@glsxtrdocdeffalse + \fi + \disable@keys{glossaries-extra.sty}{docdef}% + }% + {% + \PackageError{glossaries-extra}{\string\makenoidxglossaries\space + not permitted\MessageBreak + with record=\@glsxtr@record@setting\space package option}% + {You may only use \string\makenoidxglossaries\ space with the + record=off option}% + }% } \renewcommand*{\gls@defdocnewglossaryentry}{% \ifcase\@glsxtr@docdefval @@ -1600,6 +1785,17 @@ } \define@key{glslink}{thevalue}{\def\@glsxtr@thevalue{#1}} \define@key{glslink}{theHvalue}{\def\@glsxtr@theHvalue{#1}} +\define@boolkey{glslink}[glsxtr@]{hyperoutside}[true]{} +\glsxtr@hyperoutsidetrue +\newcommand*{\glsxtrinithyperoutside}{% + \glsifattribute{\glslabel}{hyperoutside}{false}% + {% + \glsxtr@hyperoutsidefalse + }% + {% + \glsxtr@hyperoutsidetrue + }% +} \def\@gls@link[#1]#2#3{% \leavevmode \edef\glslabel{\glsdetoklabel{#2}}% @@ -1612,6 +1808,7 @@ \def\@glsxtr@thevalue{}% \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% \glsxtrinitwrgloss + \glsxtrinithyperoutside \@gls@setdefault@glslink@opts \do@glsdisablehyperinlist \do@gls@link@checkfirsthyper @@ -1626,13 +1823,38 @@ \def\theHglsentrycounter{\@glsxtr@theHvalue}% }% \@gls@setsort{\glslabel}% + \glshasattribute{\glslabel}{textformat}% + {% + \edef\@glsxtr@attrval{\glsgetattribute{\glslabel}{textformat}}% + \ifcsdef{\@glsxtr@attrval}% + {% + \letcs{\@glsxtr@textformat}{\@glsxtr@attrval}% + }% + {% + \GlossariesExtraWarning{Unknown control sequence name + `\@glsxtr@attrval' supplied in textformat attribute + for entry `\glslabel'. Reverting to default \string\glstextformat}% + \let\@glsxtr@textformat\glstextformat + }% + }% + {% + \let\@glsxtr@textformat\glstextformat + }% \ifglsxtrinitwrglossbefore \@do@wrglossary{#2}% \fi \ifKV@glslink@hyper - \@glslink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \ifglsxtr@hyperoutside + \@glslink{\glolinkprefix\glslabel}{\@glsxtr@textformat{#3}}% + \else + \@glsxtr@textformat{\@glslink{\glolinkprefix\glslabel}{#3}}% + \fi \else - \glsdonohyperlink{\glolinkprefix\glslabel}{\glstextformat{#3}}% + \ifglsxtr@hyperoutside + \glsdonohyperlink{\glolinkprefix\glslabel}{\@glsxtr@textformat{#3}}% + \else + \@glsxtr@textformat{\glsdonohyperlink{\glolinkprefix\glslabel}{#3}}% + \fi \fi \ifglsxtrinitwrglossbefore \else @@ -1643,24 +1865,28 @@ \define@key{glossadd}{thevalue}{\def\@glsxtr@thevalue{#1}} \define@key{glossadd}{theHvalue}{\def\@glsxtr@theHvalue{#1}} \renewrobustcmd*{\glsadd}[2][]{% - \@gls@adjustmode - \@glsxtr@record{#1}{#2}{glossadd}% - \glsdoifexists{#2}% + \glsxtrifinmark + {}% {% - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% - \def\@glsxtr@thevalue{}% - \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% - \setkeys{glossadd}{#1}% - \ifdefempty{\@glsxtr@thevalue}% - {% - \@gls@saveentrycounter - }% + \@gls@adjustmode + \@glsxtr@record{#1}{#2}{glossadd}% + \glsdoifexists{#2}% {% - \let\theglsentrycounter\@glsxtr@thevalue - \def\theHglsentrycounter{\@glsxtr@theHvalue}% + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \setkeys{glossadd}{#1}% + \ifdefempty{\@glsxtr@thevalue}% + {% + \@gls@saveentrycounter + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \def\theHglsentrycounter{\@glsxtr@theHvalue}% + }% + \@@do@wrglossary{#2}% }% - \@@do@wrglossary{#2}% }% } \newcommand*{\@glsxtr@field@linkdefs}{% @@ -2248,7 +2474,7 @@ \KV@glslink@noindextrue } \newcommand*{\@glsxtrsetaliasnoindex}{% - \ifglshasfield{alias}{\glslabel}% + \glsxtrifhasfield{alias}{\glslabel}% {% \let\glsxtrindexaliased\@glsxtrindexaliased \glsxtrsetaliasnoindex @@ -2332,6 +2558,18 @@ \def\@gls@alt@hyp@opt@char{#1}% \def\@gls@alt@hyp@opt@keys{#2}% } +\let\glsxtr@org@dohyperlink\glsdohyperlink +\ifdef\glsnavhyperlink +{ + \renewcommand*{\glsnavhyperlink}[3][\@glo@type]{% + \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% + {% + \let\glsdohyperlink\glsxtr@org@dohyperlink + \@glslink{\glsnavhyperlinkname{#1}{#2}}{#3}% + }% + }% +} +{} \renewcommand*{\glsdohyperlink}[2]{% \glshasattribute{\glslabel}{targeturl}% {% @@ -2381,26 +2619,30 @@ \newcommand{\glsxtrhyperlink}[2]{\hyperlink{#1}{#2}}% } \renewrobustcmd*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% - \def\@glo@label{#2}% - {\edef\glslabel{#2}% - \@glslink{\glolinkprefix\glslabel}{#1}}% + \glsdoifexists{#2}% + {% + \def\@glo@label{#2}% + {\edef\glslabel{#2}% + \@glslink{\glolinkprefix\glslabel}{#1}}% + }% } -\ifundef\glsdonohyperlink -{% - \renewcommand{\glsdisablehyper}{% - \KV@glslink@hyperfalse - \let\@glslink\glsdonohyperlink - \let\@glstarget\@secondoftwo - } +\renewcommand{\glsdisablehyper}{% + \KV@glslink@hyperfalse + \def\@glslink{\glsdonohyperlink}% + \let\@glstarget\@secondoftwo +} +\renewcommand{\glsenablehyper}{% + \KV@glslink@hypertrue + \def\@glslink{\glsdohyperlink}% + \def\@glstarget{\glsdohypertarget}% } -{} \def\glsdonohyperlink#1#2{{\glsxtrprotectlinks #2}} \ifcsundef{hyperlink}% {% - \let\@glslink\glsdonohyperlink + \def\@glslink{\glsdonohyperlink} }% {% - \let\@glslink\glsdohyperlink + \def\@glslink{\glsdohyperlink} } \newcommand*{\glsxtrprotectlinks}{% \KV@glslink@hyperfalse @@ -3296,127 +3538,145 @@ \newcommand*{\@glsxtr@reg@glosslist}{} \let\@glsxtr@org@makeglossaries\makeglossaries \renewcommand*{\makeglossaries}[1][]{% - \ifblank{#1}% - {\@glsxtr@org@makeglossaries}% - {% - \edef\@glsxtr@reg@glosslist{#1}% - \ifundef{\glswrite}{\newwrite\glswrite}{}% - \protected@write\@auxout{}{\string\providecommand - \string\@glsorder[1]{}} - \protected@write\@auxout{}{\string\providecommand - \string\@istfilename[1]{}} - \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% - \protected@write\@auxout{}{\string\@glsorder{\glsorder}} - \protected@write\@auxout{}{\string\glsxtr@makeglossaries{#1}} - \write\@auxout{\string\providecommand\string\@gls@reference[3]{}}% - \@for\@glo@type:=#1\do{% - \ifdefempty{\@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\relax - \let\makeglossary\relax - \renewcommand\makeglossaries[1][]{}% - \@disable@onlypremakeg - \let\gls@checkseeallowed\relax - \renewcommand*{\@do@seeglossary}[2]{% - \edef\@gls@label{\glsdetoklabel{##1}}% - \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {\@glsxtr@org@doseeglossary{##1}{##2}}% - {% - \protected@write\@auxout{}{% - \string\@gls@reference - {\gls@type}{\@gls@label}{\string\glsseeformat##2{}}% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@only + \PackageError{glossaries-extra}{\string\makeglossaries\space + not permitted\MessageBreak with record=only package option}% + {You may only use \string\makeglossaries\space with + record=off or record=alsoindex options}% + \else + \ifblank{#1}% + {\@glsxtr@org@makeglossaries}% + {% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex + \PackageError{glossaries-extra}{\string\makeglossaries[#1]\space + not permitted\MessageBreak with record=alsoindex package option}% + {You may only use the hybrid \string\makeglossaries[...]\space with + record=off option}% + \else + \edef\@glsxtr@reg@glosslist{#1}% + \ifundef{\glswrite}{\newwrite\glswrite}{}% + \protected@write\@auxout{}{\string\providecommand + \string\@glsorder[1]{}} + \protected@write\@auxout{}{\string\providecommand + \string\@istfilename[1]{}} + \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% + \protected@write\@auxout{}{\string\@glsorder{\glsorder}} + \protected@write\@auxout{}{\string\glsxtr@makeglossaries{#1}} + \write\@auxout{\string\providecommand\string\@gls@reference[3]{}}% + \@for\@glo@type:=#1\do{% + \ifdefempty{\@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\relax + \let\makeglossary\relax + \renewcommand\makeglossaries[1][]{}% + \@disable@onlypremakeg + \let\gls@checkseeallowed\relax + \renewcommand*{\@do@seeglossary}[2]{% + \glsdoifexists{##1}% + {% + \edef\@gls@label{\glsdetoklabel{##1}}% + \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {\@glsxtr@org@doseeglossary{##1}{##2}}% + {% + \@@glsxtrwrglossmark + \protected@write\@auxout{}{% + \string\@gls@reference + {\gls@type}{\@gls@label}{\string\glsseeformat##2{}}% + }% + }% + }% }% - }% - }% - \let\@glsxtr@@do@@wrglossary\@@do@@wrglossary - \def\@@do@@wrglossary{% - \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {\@glsxtr@@do@@wrglossary}% - {\gls@noidxglossary}% - }% - \let\warn@nomakeglossaries\relax - \def\warn@noprintglossary{% - \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}% - }% - \renewcommand{\@gls@noref@warn}[1]{% - \edef\@gls@type{##1}% - \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% - {% - \GlossariesExtraWarning{Can't use - \string\printnoidxglossary[type={\@gls@type}] - when `\@gls@type' is listed in the optional argument of + \let\@glsxtr@@do@@wrglossary\@@do@@wrglossary + \def\@@do@@wrglossary{% + \edef\@gls@type{\csname glo@\@gls@label @type\endcsname}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {\@glsxtr@@do@@wrglossary}% + {\gls@noidxglossary}% + }% + \let\warn@nomakeglossaries\relax + \def\warn@noprintglossary{% + \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}% + }% + \renewcommand{\@gls@noref@warn}[1]{% + \edef\@gls@type{##1}% + \expandafter\DTLifinlist\expandafter{\@gls@type}{\@glsxtr@reg@glosslist}% + {% + \GlossariesExtraWarning{Can't use + \string\printnoidxglossary[type={\@gls@type}] + when `\@gls@type' is listed in the optional argument of + \string\makeglossaries}% + }% + {% + \GlossariesWarning{Empty glossary for + \string\printnoidxglossary[type={##1}]. + Rerun may be required (or you may have forgotten to use + commands like \string\gls)}% + }% + }% + \renewcommand*{\glsdisplaynumberlist}[1]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {\@glsxtr@idx@displaynumberlist{##1}}% + {\@glsxtr@noidx@displaynumberlist{##1}}% + }% + \renewcommand*{\glsentrynumberlist}[1]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {\@glsxtr@idx@entrynumberlist{##1}}% + {\@glsxtr@noidx@entrynumberlist{##1}}% + }% + \renewcommand*{\glsnumberlistloop}[2]{% + \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% + {% + \PackageError{glossaries-extra}{\string\glsnumberlistloop\space + not available for glossary `##1'}{}% + }% + {\@glsxtr@noidx@numberlistloop{##1}{##2}}% + }% + \renewcommand*{\glsprestandardsort}[3]{% + \expandafter\DTLifinlist\expandafter{##2}{\@glsxtr@reg@glosslist}% + {% + \glsdosanitizesort + }% + {% + \ifglssanitizesort + \@gls@noidx@sanitizesort + \else + \@gls@noidx@nosanitizesort + \fi + }% + }% + \renewcommand*\new@glossaryentry[2]{% + \PackageError{glossaries-extra}{Glossary entries must be defined + in the preamble\MessageBreak when you use the optional argument + of \string\makeglossaries}{Either move your definitions to the + preamble or don't use the optional argument of \string\makeglossaries}% - }% - {% - \GlossariesWarning{Empty glossary for - \string\printnoidxglossary[type={##1}]. - Rerun may be required (or you may have forgotten to use - commands like \string\gls)}% - }% - }% - \renewcommand*{\glsdisplaynumberlist}[1]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {\@glsxtr@idx@displaynumberlist{##1}}% - {\@glsxtr@noidx@displaynumberlist{##1}}% - }% - \renewcommand*{\glsentrynumberlist}[1]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {\@glsxtr@idx@entrynumberlist{##1}}% - {\@glsxtr@noidx@entrynumberlist{##1}}% - }% - \renewcommand*{\glsnumberlistloop}[2]{% - \expandafter\DTLifinlist\expandafter{##1}{\@glsxtr@reg@glosslist}% - {% - \PackageError{glossaries-extra}{\string\glsnumberlistloop\space - not available for glossary `##1'}{}% - }% - {\@glsxtr@noidx@numberlistloop{##1}{##2}}% - }% - \renewcommand*{\glsprestandardsort}[3]{% - \expandafter\DTLifinlist\expandafter{##2}{\@glsxtr@reg@glosslist}% - {% - \glsdosanitizesort - }% - {% - \ifglssanitizesort - \@gls@noidx@sanitizesort - \else - \@gls@noidx@nosanitizesort - \fi - }% - }% - \renewcommand*\new@glossaryentry[2]{% - \PackageError{glossaries-extra}{Glossary entries must be defined - in the preamble\MessageBreak when you use the optional argument - of \string\makeglossaries}{Either move your definitions to the - preamble or don't use the optional argument of - \string\makeglossaries}% - }% - \let\@glo@assign@sortkey\@glsxtr@mixed@assign@sortkey - \renewcommand*{\@printgloss@setsort}{% - \expandafter\@glsxtr@gettype\expandafter,\@glsxtr@printglossopts,% - type=\glsdefaulttype,\@end@glsxtr@gettype - \def\@glo@sorttype{\@glo@default@sorttype}% - }% - \ifglsautomake - \renewcommand*{\@gls@doautomake}{% - \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% - \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% }% - }% - \fi - \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% - }% + \let\@glo@assign@sortkey\@glsxtr@mixed@assign@sortkey + \renewcommand*{\@printgloss@setsort}{% + \expandafter\@glsxtr@gettype\expandafter,\@glsxtr@printglossopts,% + type=\glsdefaulttype,\@end@glsxtr@gettype + \def\@glo@sorttype{\@glo@default@sorttype}% + }% + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% + \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% + }% + }% + \fi + \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% + \fi + }% + \fi } \newcommand{\@glsxtr@orgprintglossary}[2]{% \def\@glo@type{\glsdefaulttype}% @@ -3919,8 +4179,9 @@ \GlsXtrNoGlsWarningTail } \newcommand*{\glsxtrresourcefile}[2][]{% + \disable@keys{glossaries-extra.sty}{record}% \glsxtr@writefields - \protected@write\@auxout{}{\string\glsxtr@resource{#1}{#2}}% + \protected@write\@auxout{\glsxtrresourceinit}{\string\glsxtr@resource{#1}{#2}}% \let\@glsxtr@org@see@noindex\@gls@see@noindex \let\@gls@see@noindex\relax \IfFileExists{#2.glstex}% @@ -4015,6 +4276,30 @@ \protected@write\@auxout{}{\string\glsxtr@counterrecord {\@gls@label}{#1}{\csuse{the#1}}}% } +\newcommand*{\glsxtrglossentry}[1]{% + \glsxtrtitleorpdforheading + {\@glsxtrglossentry{#1}}% + {\glsentryname{#1}}% + {\glsxtrheadname{#1}}% +} +\newrobustcmd*{\@glsxtrglossentry}[1]{% + \glsxtrtitleorpdforheading + {% + \glsdoifexists{#1}% + {% + \begingroup + \edef\glscurrententrylabel{\glsdetoklabel{#1}}% + \edef\currentglossary{\glsentrytype{\glscurrententrylabel}}% + \ifglshasparent{#1}% + {\glssubentryitem{#1}}% + {\glsentryitem{#1}}% + \glstarget{#1}{\glossentryname{#1}}% + \endgroup + }% + }% + {\glsentryname{#1}}% + {\glsxtrheadname{#1}}% +} \newcommand*{\printunsrtglossary}{% \@ifstar\s@printunsrtglossary\@printunsrtglossary } @@ -4052,14 +4337,39 @@ :\expandafter=\csname glolist@\@glo@type\endcsname\do{% \ifdefempty{\glscurrententrylabel} {}% - {\eappto\@glsxtr@doglossary{% - \noexpand\@printunsrt@glossary@handler{\glscurrententrylabel}}}% + {% + \let\glsxtr@process\@firstofone + \let\printunsrtglossaryskipentry + \@glsxtr@printunsrtglossaryskipentry + \printunsrtglossaryentryprocesshook{\glscurrententrylabel}% + \glsxtr@process + {% + \ifglshasparent{\glscurrententrylabel}{}% + {% + \@glsxtr@checkgroup\glscurrententrylabel + \expandafter\appto\expandafter\@glsxtr@doglossary\expandafter + {\@glsxtr@groupheading}% + }% + \eappto\@glsxtr@doglossary{% + \noexpand\@printunsrt@glossary@handler{\glscurrententrylabel}}% + }% + }% }% \appto\@glsxtr@doglossary{\end{theglossary}}% + \printunsrtglossarypredoglossary \@glsxtr@doglossary }% \glossarypostamble } +\newcommand*{\printunsrtglossaryentryprocesshook}[1]{} +\newcommand*{\printunsrtglossaryskipentry}{% + \PackageError{glossaries-extra}{\string\printunsrtglossaryskipentry\space +can only be used within \string\printunsrtglossaryentryprocesshook}{}% +} +\newcommand*{\@glsxtr@printunsrtglossaryskipentry}{% + \let\glsxtr@process\@gobble +} +\newcommand*{\printunsrtglossarypredoglossary}{} \newcommand{\@printunsrt@glossary@handler}[1]{% \xdef\glscurrententrylabel{#1}% \printunsrtglossaryhandler\glscurrententrylabel @@ -4067,100 +4377,362 @@ \newcommand{\printunsrtglossaryhandler}[1]{% \glsxtrunsrtdo{#1}% } +\newrobustcmd*{\glsxtriflabelinlist}[4]{% + \protected@edef\@glsxtr@doiflabelinlist{\noexpand\@gls@ifinlist{#1}{#2}}% + \@glsxtr@doiflabelinlist{#3}{#4}% +} \newcommand{\print@op@unsrtglossaryunit}[2][]{% \s@printunsrtglossary[type=\glsdefaulttype,#1]{% \printunsrtglossaryunitsetup{#2}% }% } -\newcommand*{\printunsrtglossaryunitsetup}[1]{% - \renewcommand{\printunsrtglossaryhandler}[1]{% - \glsxtrfieldxifinlist{##1}{record.#1}{\csuse{the#1}} - {\glsxtrunsrtdo{##1}}% - {}% +\newcommand*{\printunsrtglossaryunitsetup}[1]{% + \renewcommand{\printunsrtglossaryhandler}[1]{% + \glsxtrfieldxifinlist{##1}{record.#1}{\csuse{the#1}} + {\glsxtrunsrtdo{##1}}% + {}% + }% + \ifcsundef{theH#1}% + {% + \renewcommand*{\@glsxtrhypernameprefix}{record.#1.\csuse{the#1}.\@gobble}% + }% + {% + \renewcommand*{\@glsxtrhypernameprefix}{record.#1.\csuse{theH#1}.\@gobble}% + }% + \renewcommand*{\glossarysection}[2][]{}% + \appto\glossarypostamble{\glspar\medskip\glspar}% +} +\newcommand{\print@noop@unsrtglossaryunit}[2][]{% + \PackageError{glossaries-extra}{\string\printunsrtglossaryunit\space + requires the record=only or record=alsoindex package option}{}% +} +\newrobustcmd*{\@glsxtr@unsrt@getgrouptitle}[2]{% + \protected@edef\@glsxtr@titlelabel{glsxtr@grouptitle@#1}% + \@onelevel@sanitize\@glsxtr@titlelabel + \ifcsdef{\@glsxtr@titlelabel} + {\letcs{#2}{\@glsxtr@titlelabel}}% + {\def#2{#1}}% +} +\newcommand{\glsxtrunsrtdo}{\@glsxtr@noidx@do} +\newcommand*{\glsxtrgroupfield}{group} +\newcommand*{\@glsxtr@checkgroup}[1]{% + \def\@glsxtr@groupheading{}% + \key@ifundefined{glossentry}{group}% + {% + \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% + \expandafter\glo@grabfirst\@gls@sort{}{}\@nil + }% + {% + \protected@edef\@glo@thislettergrp{% + \csuse{glo@\glsdetoklabel{#1}@\glsxtrgroupfield}}% + }% + \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% + {}% + {% + \ifdefempty{\@gls@currentlettergroup}{}% + {\def\@glsxtr@groupheading{\glsgroupskip}}% + \eappto\@glsxtr@groupheading{% + \noexpand\glsgroupheading{\expandonce\@glo@thislettergrp}% + }% + }% + \let\@gls@currentlettergroup\@glo@thislettergrp +} +\newcommand{\@glsxtr@noidx@do}[1]{% + \ifglsentryexists{#1}% + {% + \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% + \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% + \ifglshasparent{#1}% + {% + \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax + \ifdefvoid{\@gls@location}% + {% + \ifdefvoid{\@gls@loclist}% + {% + \subglossentry{\gls@level}{#1}{}% + }% + {% + \subglossentry{\gls@level}{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% + {% + \subglossentry{\gls@level}{#1}{\glossaryentrynumbers{\@gls@location}}% + }% + }% + {% + \ifdefvoid{\@gls@location}% + {% + \ifdefvoid{\@gls@loclist} + {% + \glossentry{#1}{}% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\@gls@location}% + }% + }% + }% + }% + {}% +} +\newcommand*{\glshex}{\string\u} +\newcommand*{\glsxtrresourceinit}{} +\newcount\@glsxtrnewgls@inner +\newcommand*{\@glsxtrnewgls}[4]{% + \ifdef{#3}% + {% + \PackageError{glossaries-extra}{Command \string#3\space already +defined}{}% + }% + {% + \ifcsdef{@#4like@#2}% + {% + \advance\@glsxtrnewgls@inner by \@ne + \def\@glsxtrnewgls@innercsname{@#4like\number\@glsxtrnewgls@inner @#2}% + }% + {\def\@glsxtrnewgls@innercsname{@#4like@#2}}% + \expandafter\newrobustcmd\expandafter*\expandafter + #3\expandafter{\expandafter\@gls@hyp@opt\csname\@glsxtrnewgls@innercsname\endcsname}% + \ifstrempty{#1}% + {% + \expandafter\newcommand\expandafter*\csname\@glsxtrnewgls@innercsname\endcsname[2][]{% + \new@ifnextchar[% + {\csname @#4@\endcsname{##1}{#2##2}}% + {\csname @#4@\endcsname{##1}{#2##2}[]}% + }% + }% + {% + \expandafter\newcommand\expandafter*\csname\@glsxtrnewgls@innercsname\endcsname[2][]{% + \new@ifnextchar[% + {\csname @#4@\endcsname{#1,##1}{#2##2}}% + {\csname @#4@\endcsname{#1,##1}{#2##2}[]}% + }% + }% + }% +} +\newrobustcmd*{\glsxtrnewgls}[3][]{% + \@glsxtrnewgls{#1}{#2}{#3}{gls}% +} +\newrobustcmd*{\glsxtrnewglslike}[6][]{% + \@glsxtrnewgls{#1}{#2}{#3}{gls}% + \@glsxtrnewgls{#1}{#2}{#4}{glspl}% + \@glsxtrnewgls{#1}{#2}{#5}{Gls}% + \@glsxtrnewgls{#1}{#2}{#6}{Glspl}% +} +\newrobustcmd*{\glsxtrnewGLSlike}[4][]{% + \@glsxtrnewgls{#1}{#2}{#3}{GLS}% + \@glsxtrnewgls{#1}{#2}{#4}{GLSpl}% +} +\newrobustcmd*{\glsxtrnewrgls}[3][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rgls}% +} +\newrobustcmd*{\glsxtrnewrglslike}[6][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rgls}% + \@glsxtrnewgls{#1}{#2}{#4}{rglspl}% + \@glsxtrnewgls{#1}{#2}{#5}{rGls}% + \@glsxtrnewgls{#1}{#2}{#6}{rGlspl}% +} +\newrobustcmd*{\glsxtrnewrGLSlike}[4][]{% + \@glsxtrnewgls{#1}{#2}{#3}{rGLS}% + \@glsxtrnewgls{#1}{#2}{#4}{rGLSpl}% +} +\newcommand*{\GlsXtrTotalRecordCount}[1]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount}% + {\csname glo@\glsdetoklabel{#1}@recordcount\endcsname}% + {0}% +} +\newcommand*{\GlsXtrRecordCount}[2]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount.#2}% + {\csname glo@\glsdetoklabel{#1}@recordcount.#2\endcsname}% + {0}% +} +\newcommand*{\GlsXtrLocationRecordCount}[3]{% + \ifcsdef{glo@\glsdetoklabel{#1}@recordcount.#2.\glsxtrdetoklocation{#3}}% + {\csname glo@\glsdetoklabel{#1}@recordcount.#2.\glsxtrdetoklocation{#3}\endcsname}% + {0}% +} +\newcommand*{\glsxtrdetoklocation}[1]{#1} +\newcommand*{\glsxtrenablerecordcount}{% + \renewcommand*{\gls}{\rgls}% + \renewcommand*{\Gls}{\rGls}% + \renewcommand*{\glspl}{\rglspl}% + \renewcommand*{\Glspl}{\rGlspl}% + \renewcommand*{\GLS}{\rGLS}% + \renewcommand*{\GLSpl}{\rGLSpl}% +} +\newcommand*{\glsxtrrecordtriggervalue}[1]{% + \GlsXtrTotalRecordCount{#1}% +} +\newcommand*{\GlsXtrSetRecordCountAttribute}[2]{% + \@for\@glsxtr@cat:=#1\do + {% + \ifdefempty{\@glsxtr@cat}{}% + {% + \glssetcategoryattribute{\@glsxtr@cat}{recordcount}{#2}% + }% + }% +} +\newcommand*{\glsxtrifrecordtrigger}[3]{% + \glshasattribute{#1}{recordcount}% + {% + \ifnum\glsxtrrecordtriggervalue{#1}>\glsgetattribute{#1}{recordcount}\relax + #3% + \else + #2% + \fi + }% + {#3}% +} +\newcommand*{\@glsxtr@rglstrigger@record}[3]{% + \edef\glslabel{\glsdetoklabel{#2}}% + \let\@gls@link@label\glslabel + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \def\@glsnumberformat{glstriggerrecordformat}% + \edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% + \edef\glstype{\csname glo@\glslabel @type\endcsname}% + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \glsxtrinitwrgloss + \setkeys{glslink}{#1}% + \glslinkpostsetkeys + \ifdefempty{\@glsxtr@thevalue}% + {% + \@gls@saveentrycounter + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \def\theHglsentrycounter{\@glsxtr@theHvalue}% + }% + \ifglsxtrinitwrglossbefore + \@do@wrglossary{#2}% + \fi + #3% + \ifglsxtrinitwrglossbefore + \else + \@do@wrglossary{#2}% + \fi + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi +} +\newcommand*{\glstriggerrecordformat}[1]{} +\newrobustcmd*{\rgls}{\@gls@hyp@opt\@rgls} +\newcommand*{\@rgls}[2][]{% + \new@ifnextchar[{\@rgls@{#1}{#2}}{\@rgls@{#1}{#2}[]}% +} +\def\@rgls@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rglsformat{#2}{#3}}% + }% + {% + \@gls@{#1}{#2}[#3]% + }% +}% +\newrobustcmd*{\rglspl}{\@gls@hyp@opt\@rglspl} +\newcommand*{\@rglspl}[2][]{% + \new@ifnextchar[{\@rglspl@{#1}{#2}}{\@rglspl@{#1}{#2}[]}% +} +\def\@rglspl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rglsplformat{#2}{#3}}% }% - \ifcsundef{theH#1}% {% - \renewcommand*{\@glsxtrhypernameprefix}{record.#1.\csuse{the#1}.\@gobble}% + \@glspl@{#1}{#2}[#3]% + }% +}% +\newrobustcmd*{\rGls}{\@gls@hyp@opt\@rGls} +\newcommand*{\@rGls}[2][]{% + \new@ifnextchar[{\@rGls@{#1}{#2}}{\@rGls@{#1}{#2}[]}% +} +\def\@rGls@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGlsformat{#2}{#3}}% }% {% - \renewcommand*{\@glsxtrhypernameprefix}{record.#1.\csuse{theH#1}.\@gobble}% + \@Gls@{#1}{#2}[#3]% }% - \renewcommand*{\glossarysection}[2][]{}% - \appto\glossarypostamble{\glspar\medskip\glspar}% +}% +\newrobustcmd*{\rGlspl}{\@gls@hyp@opt\@rGlspl} +\newcommand*{\@rGlspl}[2][]{% + \new@ifnextchar[{\@rGlspl@{#1}{#2}}{\@rGlspl@{#1}{#2}[]}% } -\newcommand{\print@noop@unsrtglossaryunit}[2][]{% - \PackageError{glossaries-extra}{\string\printunsrtglossaryunit\space - requires the record=only or record=alsoindex package option}{}% +\def\@rGlspl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGlsplformat{#2}{#3}}% + }% + {% + \@Glspl@{#1}{#2}[#3]% + }% +}% +\newrobustcmd*{\rGLS}{\@gls@hyp@opt\@rGLS} +\newcommand*{\@rGLS}[2][]{% + \new@ifnextchar[{\@rGLS@{#1}{#2}}{\@rGLS@{#1}{#2}[]}% } -\newrobustcmd*{\@glsxtr@unsrt@getgrouptitle}[2]{% - \protected@edef\@glsxtr@titlelabel{glsxtr@grouptitle@#1}% - \@onelevel@sanitize\@glsxtr@titlelabel - \ifcsdef{\@glsxtr@titlelabel} - {\letcs{#2}{\@glsxtr@titlelabel}}% - {\def#2{#1}}% +\def\@rGLS@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% + {% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGLSformat{#2}{#3}}% + }% + {% + \@GLS@{#1}{#2}[#3]% + }% +}% +\newrobustcmd*{\rGLSpl}{\@gls@hyp@opt\@rGLSpl} +\newcommand*{\@rGLSpl}[2][]{% + \new@ifnextchar[{\@rGLSpl@{#1}{#2}}{\@rGLSpl@{#1}{#2}[]}% } -\newcommand{\glsxtrunsrtdo}{\@glsxtr@noidx@do} -\newcommand{\@glsxtr@noidx@do}[1]{% - \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% - \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% - \ifglshasparent{#1}% +\def\@rGLSpl@#1#2[#3]{% + \glsxtrifrecordtrigger{#2}% {% - \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax - \ifdefvoid{\@gls@location}% - {% - \ifdefvoid{\@gls@loclist}% - {% - \subglossentry{\gls@level}{#1}{}% - }% - {% - \subglossentry{\gls@level}{#1}% - {% - \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% - }% - }% - }% - {% - \subglossentry{\gls@level}{#1}{\glossaryentrynumbers{\@gls@location}}% - }% + \@glsxtr@rglstrigger@record{#1}{#2}{\rGLSplformat{#2}{#3}}% }% {% - \key@ifundefined{glossentry}{group}% - {% - \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% - \expandafter\glo@grabfirst\@gls@sort{}{}\@nil - }% - {% - \protected@xdef\@glo@thislettergrp{% - \csuse{glo@\glsdetoklabel{#1}@group}}% - }% - \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% - {}% - {% - \ifdefempty{\@gls@currentlettergroup}{}{\glsgroupskip}% - \expandafter\glsgroupheading\expandafter - {\@glo@thislettergrp}% - }% - \global\let\@gls@currentlettergroup\@glo@thislettergrp - \ifdefvoid{\@gls@location}% - {% - \ifdefvoid{\@gls@loclist} - {% - \glossentry{#1}{}% - }% - {% - \glossentry{#1}% - {% - \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% - }% - }% - }% - {% - \glossentry{#1}% - {% - \glossaryentrynumbers{\@gls@location}% - }% - }% + \@GLSpl@{#1}{#2}[#3]% }% +}% +\newcommand*{\rglsformat}[2]{% + \glsifregular{#1} + {\glsentryfirst{#1}}% + {\ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}}#2% +} +\newcommand*{\rglsplformat}[2]{% + \glsifregular{#1} + {\glsentryfirstplural{#1}}% + {\ifglshaslong{#1}{\glsentrylongplural{#1}}{\glsentryfirstplural{#1}}}#2% +} +\newcommand*{\rGlsformat}[2]{% + \glsifregular{#1} + {\Glsentryfirst{#1}}% + {\ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}}#2% +} +\newcommand*{\rGlsplformat}[2]{% + \glsifregular{#1} + {\Glsentryfirstplural{#1}}% + {\ifglshaslong{#1}{\Glsentrylongplural{#1}}{\Glsentryfirstplural{#1}}}#2% +} +\newcommand*{\rGLSformat}[2]{% + \expandafter\mfirstucMakeUppercase\expandafter{\rglsformat{#1}{#2}}% +} +\newcommand*{\rGLSplformat}[2]{% + \expandafter\mfirstucMakeUppercase\expandafter{\rglsplformat{#1}{#2}}% } \@ifpackageloaded{glossaries-accsupp} { @@ -5770,6 +6342,8 @@ {\glsxtr@applyabbrvfmt{\csname @glsabbrv@current@#1\endcsname}}% {\glsxtr@applyabbrvfmt{\@glsabbrv@current@abbreviation}}% } +\newrobustcmd*{\glsuseabbrvfont}[2]{{\glssetabbrvfmt{#2}\glsabbrvfont{#1}}} +\newrobustcmd*{\glsuselongfont}[2]{{\glssetabbrvfmt{#2}\glslongfont{#1}}} \newcommand*{\glsxtrgenabbrvfmt}{% \ifdefempty\glscustomtext {% @@ -6428,6 +7002,51 @@ {% \GlsXtrUseAbbrStyleFmts{short-nolong-desc}% } +\newabbreviationstyle{nolong-short}% +{% + \GlsXtrUseAbbrStyleSetup{short-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-nolong}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\Glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvfont{\Glsaccessshortpl{##1}}}% + }% +} +\newabbreviationstyle{nolong-short-noreg}% +{% + \GlsXtrUseAbbrStyleSetup{nolong-short}% + \renewcommand*{\GlsXtrPostNewAbbreviation}{% + \glshasattribute{\the\glslabeltok}{regular}% + {% + \glssetattribute{\the\glslabeltok}{regular}{false}% + }% + {}% + }% +}% +{% + \GlsXtrUseAbbrStyleFmts{nolong-short}% +} \newabbreviationstyle{long-desc}% {% \renewcommand*{\CustomAbbreviationFields}{% @@ -6733,16 +7352,16 @@ \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvscfont{\Glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvscfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvscfont{\Glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvscfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% @@ -6819,6 +7438,37 @@ }% } \letabbreviationstyle{short-sc-nolong-desc}{short-sc-desc} +\newabbreviationstyle{nolong-short-sc}% +{% + \GlsXtrUseAbbrStyleSetup{short-sc-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-sc-nolong}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvscfont{\glsaccessshortpl{##1}}}% + }% +} \newabbreviationstyle{long-noshort-sc}% {% \renewcommand*{\CustomAbbreviationFields}{% @@ -7289,16 +7939,16 @@ \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvsmfont{\Glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvsmfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvsmfont{\Glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvsmfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% @@ -7375,6 +8025,37 @@ }% } \letabbreviationstyle{short-sm-nolong-desc}{short-sm-desc} +\newabbreviationstyle{nolong-short-sm}% +{% + \GlsXtrUseAbbrStyleSetup{short-sm-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-sm-nolong}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvsmfont{\glsaccessshortpl{##1}}}% + }% +} \newabbreviationstyle{long-noshort-sm}% {% \renewcommand*{\CustomAbbreviationFields}{% @@ -7994,16 +8675,16 @@ \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshort{##1}% + \protect\glsfirstabbrvemfont{\Glsaccessshort{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslong{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% - \protect\glsfirstabbrvemfont{\glsaccessshortpl{##1}% + \protect\glsfirstabbrvemfont{\Glsaccessshortpl{##1}% \ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - \glsxtrparen{\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}}}% + \glsxtrparen{\glsfirstlongdefaultfont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvemfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% @@ -8080,6 +8761,37 @@ }% } \letabbreviationstyle{short-em-nolong-desc}{short-em-desc} +\newabbreviationstyle{nolong-short-em}% +{% + \GlsXtrUseAbbrStyleSetup{short-em-nolong}% +}% +{% + \GlsXtrUseAbbrStyleFmts{short-em-nolong}% + \renewcommand*{\glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslong{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshort{##1}}}% + }% + \renewcommand*{\Glsxtrinlinefullplformat}[2]{% + \protect\glsfirstlongdefaultfont{\Glsaccesslongpl{##1}% + \ifglsxtrinsertinside##2\fi}% + \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% + \glsxtrparen{\glsfirstabbrvemfont{\glsaccessshortpl{##1}}}% + }% +} \newabbreviationstyle{long-noshort-em}% {% \renewcommand*{\CustomAbbreviationFields}{% @@ -9535,9 +10247,18 @@ {\@glsxtrinmark#2\@glsxtrnotinmark}% \glsxtrrestoremarkhook } +\let\@glsxtr@org@@starttoc\@starttoc +\renewcommand*{\@starttoc}[1]{% + \glsxtrmarkhook + \@glsxtrinmark + \@glsxtr@org@@starttoc{#1}% + \@glsxtrnotinmark + \glsxtrrestoremarkhook +} \newcommand*{\glsxtrRevertMarks}{% \let\markright\@glsxtr@org@markright \let\markboth\@glsxtr@org@markboth + \let\@starttoc\@glsxtr@org@@starttoc } \newcommand*{\glsxtrifinmark}[2]{#2} \newrobustcmd*{\@glsxtrinmark}{% @@ -9546,12 +10267,22 @@ \newrobustcmd*{\@glsxtrnotinmark}{% \let\glsxtrifinmark\@secondoftwo } +\ifdef\texorpdfstring +{ + \newcommand*{\glsxtrtitleorpdforheading}[3]{\texorpdfstring{#1}{#2}} +} +{ + \newcommand*{\glsxtrtitleorpdforheading}[3]{#1} +} \newcommand*{\glsxtrmarkhook}{% \let\@glsxtr@org@MakeUppercase\MakeUppercase + \let\@glsxtr@org@glsxtrtitleorpdforheading\glsxtrtitleorpdforheading \let\@glsxtr@org@glsxtrtitleshort\glsxtrtitleshort \let\@glsxtr@org@glsxtrtitleshortpl\glsxtrtitleshortpl \let\@glsxtr@org@Glsxtrtitleshort\Glsxtrtitleshort \let\@glsxtr@org@Glsxtrtitleshortpl\Glsxtrtitleshortpl + \let\@glsxtr@org@glsxtrtitlename\glsxtrtitlename + \let\@glsxtr@org@Glsxtrtitlename\Glsxtrtitlename \let\@glsxtr@org@glsxtrtitletext\glsxtrtitletext \let\@glsxtr@org@Glsxtrtitletext\Glsxtrtitletext \let\@glsxtr@org@glsxtrtitleplural\glsxtrtitleplural @@ -9570,10 +10301,13 @@ \let\@glsxtr@org@Glsxtrtitlefullpl\Glsxtrtitlefullpl \let\glsxtrifinmark\@firstoftwo \let\MakeUppercase\MakeTextUppercase + \let\glsxtrtitleorpdforheading\@thirdofthree \let\glsxtrtitleshort\glsxtrheadshort \let\glsxtrtitleshortpl\glsxtrheadshortpl \let\Glsxtrtitleshort\Glsxtrheadshort \let\Glsxtrtitleshortpl\Glsxtrheadshortpl + \let\glsxtrtitlename\glsxtrheadname + \let\Glsxtrtitlename\Glsxtrheadname \let\glsxtrtitletext\glsxtrheadtext \let\Glsxtrtitletext\Glsxtrheadtext \let\glsxtrtitleplural\glsxtrheadplural @@ -9594,10 +10328,13 @@ \newcommand*{\glsxtrrestoremarkhook}{% \let\glsxtrifinmark\@secondoftwo \let\MakeUppercase\@glsxtr@org@MakeUppercase + \let\glsxtrtitleorpdforheading\@glsxtr@org@glsxtrtitleorpdforheading \let\glsxtrtitleshort\@glsxtr@org@glsxtrtitleshort \let\glsxtrtitleshortpl\@glsxtr@org@glsxtrtitleshortpl \let\Glsxtrtitleshort\@glsxtr@org@Glsxtrtitleshort \let\Glsxtrtitleshortpl\@glsxtr@org@Glsxtrtitleshortpl + \let\glsxtrtitlename\@glsxtr@org@glsxtrtitlename + \let\Glsxtrtitlename\@glsxtr@org@Glsxtrtitlename \let\glsxtrtitletext\@glsxtr@org@glsxtrtitletext \let\Glsxtrtitletext\@glsxtr@org@Glsxtrtitletext \let\glsxtrtitleplural\@glsxtr@org@glsxtrtitleplural @@ -9675,6 +10412,36 @@ \newrobustcmd*{\Glsxtrtitleshortpl}[1]{% \Glsxtrshortpl[noindex,hyper=false]{#1}[]% } +\newcommand*{\glsxtrheadname}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSname[noindex,hyper=false]{#1}[]% + }% + {% + \glsname[noindex,hyper=false]{#1}[]% + }% + }% +} +\newrobustcmd*{\glsxtrtitlename}[1]{% + \glsname[noindex,hyper=false]{#1}[]% +} +\newcommand*{\Glsxtrheadname}[1]{% + \protect\NoCaseChange + {% + \glsifattribute{#1}{headuc}{true}% + {% + \GLSname[noindex,hyper=false]{#1}[]% + }% + {% + \Glsname[noindex,hyper=false]{#1}[]% + }% + }% +} +\newrobustcmd*{\Glsxtrtitlename}[1]{% + \Glsname[noindex,hyper=false]{#1}[]% +} \newcommand*{\glsxtrheadtext}[1]{% \protect\NoCaseChange {% @@ -9964,6 +10731,30 @@ \Glsxtrtitleshortpl{#1}} } \ifdef\texorpdfstring +{ + \newcommand*{\glsfmtname}[1]{% + \texorpdfstring + {\glsxtrtitlename{#1}}% + {\glsentryname{#1}}% + } +} +{ + \newcommand*{\glsfmtname}[1]{% + \glsxtrtitlename{#1}} +} +\ifdef\texorpdfstring +{ + \newcommand*{\Glsfmtname}[1]{% + \texorpdfstring + {\Glsxtrtitlename{#1}}% + {\glsentryname{#1}}% + } +} +{ + \newcommand*{\Glsfmtname}[1]{% + \Glsxtrtitlename{#1}} +} +\ifdef\texorpdfstring { \newcommand*{\glsfmttext}[1]{% \texorpdfstring diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-bookindex.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-bookindex.sty new file mode 100644 index 00000000000..ccc4bb32f57 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-bookindex.sty @@ -0,0 +1,210 @@ +%% +%% This is file `glossary-bookindex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries-extra.dtx (with options: `glossary-bookindex.sty,package') +%% +%% glossaries-extra.dtx +%% Copyright 2017 Nicola 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 (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. +%% +%% \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 +%% Lower-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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossary-bookindex}[2017/11/03 v1.21 (NLCT)] +\RequirePackage{multicol} +\RequirePackage{glossary-tree} +\newcommand{\glsxtrbookindexcols}{2} +\newcommand*{\glsxtrbookindexname}[1]{\glossentryname{#1}} +\newcommand*{\glsxtrbookindexsubname}[1]{\glsxtrbookindexname{#1}} +\providecommand*{\glsxtrprelocation}{\space} + +\newcommand*{\glsxtrbookindexprelocation}[1]{% + \glsxtrifhasfield{location}{#1}% + {\ifglsnopostdot,\fi\glsxtrprelocation}% + {\glsxtrprelocation}% +} +\newcommand*{\glsxtrbookindexsubprelocation}[1]{% + \glsxtrbookindexprelocation{#1}% +} +\newcommand{\glsxtrbookindexparentchildsep}{\nopagebreak} +\newcommand{\glsxtrbookindexparentsubchildsep}{\glsxtrbookindexparentchildsep} +\newcommand{\glsxtrbookindexbetween}[2]{} +\newcommand{\glsxtrbookindexsubbetween}[2]{} +\newcommand{\glsxtrbookindexsubsubbetween}[2]{} +\newcommand{\glsxtrbookindexatendgroup}[1]{} +\newcommand{\glsxtrbookindexsubatendgroup}[1]{} +\newcommand{\glsxtrbookindexsubsubatendgroup}[1]{} +\newcommand{\glsxtrbookindexgroupskip}{\ifglsnogroupskip\else\indexspace\fi} +\newcommand*{\glsxtrbookindexformatheader}[1]{% + \par{\centering\glstreegroupheaderfmt{#1}\par}% +} +\ifdef\pdfbookmark +{% + \newcommand*{\glsxtrbookindexbookmark}[2]{% + \ifdefstring{\@@glossarysec}{chapter}% + {\pdfbookmark[1]{#1}{#2}}% + {\pdfbookmark[2]{#1}{#2}}% + } +} +{% + \newcommand*{\glsxtrbookindexbookmark}[2]{} +} +\newcommand*{\glsxtrbookindexcolspread}{} +\newglossarystyle{bookindex}{% + \setglossarystyle{index}% + \renewenvironment{theglossary}% + {% + \ifdefempty\glsxtrbookindexcolspread + {\begin{multicols}{\glsxtrbookindexcols}}% + {\begin{multicols}{\glsxtrbookindexcols}[\glsxtrbookindexcolspread]}% + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\@glsxtr@bookindex@sep\glsxtrbookindexparentchildsep + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \let\@glsxtr@bookindex@between\@gobble + \let\@glsxtr@bookindex@subbetween\@gobble + \let\@glsxtr@bookindex@subsubbetween\@gobble + \let\@glsxtr@bookindex@atendgroup\relax + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax + \let\@glsxtr@bookindexgroupskip\relax + }% + {% + \@glsxtr@bookindex@subsubatendgroup + \@glsxtr@bookindex@subatendgroup + \@glsxtr@bookindex@atendgroup + \end{multicols}% + }% + \renewcommand*{\glossaryheader}{\raggedright}% + \renewcommand*{\glossentry}[2]{% + \@glsxtr@bookindex@between{##1}% + \let\@glsxtr@bookindex@sep\glsxtrbookindexparentchildsep + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \let\@glsxtr@bookindex@subbetween\@gobble + \let\@glsxtr@bookindex@subsubbetween\@gobble + \edef\@glsxtr@bookindex@between{% + \noexpand\glsxtrbookindexbetween{##1}% + }% + \edef\@glsxtr@bookindex@atendgroup{% + \noexpand\glsxtrbookindexatendgroup{##1}% + }% + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax + \glstreeitem + \glsentryitem{##1}% + \glstarget{##1}{\glsxtrbookindexname{##1}}% + \glsxtrbookindexprelocation{##1}##2% + }% + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + \glstreeitem + \or + \@glsxtr@bookindex@sep + \@glsxtr@bookindex@subbetween{##2}% + \let\@glsxtr@bookindex@sep\relax + \let\@glsxtr@bookindex@subsubbetween\@gobble + \let\@glsxtr@bookindex@subsep\glsxtrbookindexparentsubchildsep + \edef\@glsxtr@bookindex@subbetween{% + \noexpand\glsxtrbookindexsubbetween{##2}% + }% + \edef\@glsxtr@bookindex@atsubendgroup{% + \noexpand\glsxtrbookindexatsubendgroup{##1}% + }% + \glstreesubitem + \glssubentryitem{##2}% + \else + \@glsxtr@bookindex@subsep + \@glsxtr@bookindex@subsubbetween{##2}% + \let\@glsxtr@bookindex@subsep\relax + \edef\@glsxtr@bookindex@subsubbetween{% + \noexpand\glsxtrbookindexsubsubbetween{##2}% + }% + \edef\@glsxtr@bookindex@atsubsubendgroup{% + \noexpand\glsxtrbookindexatsubsubendgroup{##1}% + }% + \glstreesubsubitem + \fi + \glstarget{##2}{\glsxtrbookindexsubname{##2}}% + \glsxtrbookindexsubprelocation{##2}##3% + }% + \renewcommand*{\glsgroupskip}{}% + \renewcommand*{\glsgroupheading}[1]{% + \@glsxtr@bookindex@subsubatendgroup + \@glsxtr@bookindex@subatendgroup + \@glsxtr@bookindex@atendgroup + \@glsxtr@bookindexgroupskip + \let\@glsxtr@bookindexgroupskip\glsxtrbookindexgroupskip + \let\@glsxtr@bookindex@between\@gobble + \let\@glsxtr@bookindex@atendgroup\relax + \let\@glsxtr@bookindex@subatendgroup\relax + \let\@glsxtr@bookindex@subsubatendgroup\relax + \glsxtrgetgrouptitle{##1}{\thisgrptitle}% + \glsxtrbookindexbookmark{\thisgrptitle}{index.##1}% + \glsxtrbookindexformatheader{\thisgrptitle}% + \nopagebreak\indexspace\nopagebreak\@afterheading + }% +} +\newcommand{\glsxtrbookindexthepage}{% + \ifdef\currentglossary{\currentglossary.\arabic{page}}{\arabic{page}}% +} +\newcommand*{\glsxtrbookindexmarkentry}[1]{% + \protected@write\@auxout + {\let\glsxtrbookindexthepage\relax}% + {\string\glsxtr@setbookindexmark{\glsxtrbookindexthepage}{#1}}% +} +\newcommand*{\glsxtr@setbookindexmark}[2]{% + \ifcsundef{glsxtr@idxfirstmark@#1}% + {\csgdef{glsxtr@idxfirstmark@#1}{#2}}% + {}% + \csgdef{glsxtr@idxlastmark@#1}{#2}% +} +\newcommand*{\glsxtrbookindexfirstmarkfmt}[1]{% + \glsentryname{#1}% +} +\newcommand*{\glsxtrbookindexfirstmark}{% + \letcs{\glsxtr@label}{glsxtr@idxfirstmark@\glsxtrbookindexthepage}% + \ifdef\glsxtr@label + {\glsxtrbookindexfirstmarkfmt{\glsxtr@label}}% + {}% +} +\newcommand*{\glsxtrbookindexlastmarkfmt}[1]{% + \glsentryname{#1}% +} +\newcommand*{\glsxtrbookindexlastmark}{% + \letcs{\glsxtr@label}{glsxtr@idxlastmark@\glsxtrbookindexthepage}% + \ifdef\glsxtr@label + {\glsxtrbookindexlastmarkfmt{\glsxtr@label}}% + {}% +} +\endinput +%% +%% End of file `glossary-bookindex.sty'. -- cgit v1.2.3