summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex356
1 files changed, 336 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex
index 29754c4658a..a4acda830c1 100644
--- a/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex
+++ b/Master/texmf-dist/doc/latex/glossaries-extra/glossaries-extra-manual.tex
@@ -226,13 +226,13 @@ styles (glossaries):>#1={\protect\ttfamily#1}|main}}
\DeleteShortVerb{\|}
\MakeShortVerb{"}
- \title{glossaries-extra.sty v1.30:
+ \title{glossaries-extra.sty v1.31:
an extension to the glossaries package}
\author{Nicola L.C. Talbot\\[10pt]
Dickimaw Books\\
\url{http://www.dickimaw-books.com/}}
- \date{2018-04-25}
+ \date{2018-05-09}
\maketitle
\begin{abstract}
@@ -276,6 +276,9 @@ Additional resources:
\item The
\href{http://www.dickimaw-books.com/gallery/#glossaries-extra}{\styfmt{glossaries-extra} gallery}.
+\item \styfmt{glossaries-extra} and \gls{bib2gls}: An Introductory
+Guide. (\href{http://mirrors.ctan.org/support/bib2gls/bib2gls-begin.pdf}{\texttt{bib2gls-begin.pdf}}).
+
\item \href{http://www.dickimaw-books.com/software/bib2gls}{\appfmt{bib2gls}}
\item
@@ -1151,6 +1154,11 @@ be displayed multiple times.
of avoiding duplicate target names is to set a prefix
used for the names. Unlike changing \cs{glolinkprefix} this doesn't affect
any hyperlinks (such as those created with \cs{gls}).
+\item
+\gloskey[printglossary]{prefix}\texttt{=}\marg{prefix}. If you do
+actually want to locally change \cs{glolinkprefix}, you can use
+the \gloskey{prefix} key instead. You need to use the matching
+\gloskey[glslink]{prefix} key in commands like \cs{gls}.
\end{itemize}
The \cs{newglossaryentry} command has three new keys:
@@ -1256,6 +1264,15 @@ with \styfmt{glossaries} v4.27) to allow for this use of
\section{Entry Indexing}
\label{sec:wrglossary}
+As from version 1.31, there is a new command like \cs{glsadd}
+where the mandatory argument is a comma-separated list
+of labels:
+\begin{definition}[\DescribeMacro\glsaddeach]
+\cs{glsaddeach}\oarg{options}\marg{list}
+\end{definition}
+This simply iterates over \meta{list} and does
+\cs{glsadd}\oarg{options}\marg{label} for each entry in the list.
+
The \styfmt{glossaries-extra} package provides extra keys for
commands like \cs{gls} and \cs{glstext}:
\begin{description}
@@ -1355,6 +1372,10 @@ this name must exist and must take one argument. (Use
the \catattr{textformat} attribute and \cs{glstextformat}.
See the \sty{soul} example in \sectionref{sec:glsunset}.
+\item[{\gloskey[glslink]{prefix}}] Locally redefines
+\ics{glolinkprefix} to the given value. It should match the prefix
+for the desired glossary.
+
\end{description}
There is a new hook that's used each time indexing information is
@@ -1791,6 +1812,23 @@ By default \cs{glsxtrpostlink} just does \postlinkcat\ if it exists, where
(For example, for the \category{general} category,
\cs{glsxtrpostlinkgeneral} if it has been defined.)
+You can define the post-link hook command using \cs{newcommand}, for
+example:
+\begin{verbatim}
+\newcommand*{\glsxtrpostlinkgeneral}{%
+ \glsxtrpostlinkAddDescOnFirstUse
+}
+\end{verbatim}
+or, as from v1.31, you can use
+\begin{definition}[\DescribeMacro\glsdefpostlink]
+\cs{glsdefpostlink}\marg{category}\marg{definition}
+\end{definition}
+This is simply a shortcut for:
+\begin{alltt}
+\cs{csdef}{glsxtrpostlink\meta{category}}\marg{definition}
+\end{alltt}
+Note that it doesn't check if the command has already been defined.
+
\begin{sloppypar}
The sentence-ending hook is slightly more complicated.
If the command \postlinkcat\ is defined the hook will do that
@@ -1825,7 +1863,15 @@ category:
\cs{glsxtrpostlinkAddSymbolOnFirstUse}
\end{definition}
This will append the symbol (if defined) in parentheses on
-\gls{firstuse}.
+\gls{firstuse}. (Does nothing if the symbol hasn't been set.)
+
+\begin{definition}[\DescribeMacro\glsxtrpostlinkAddSymbolDescOnFirstUse]
+\cs{glsxtrpostlinkAddSymbolDescOnFirstUse}
+\end{definition}
+(New to v1.31.) On \gls{firstuse},
+this will append \cs{space}(\meta{symbol}, \meta{description}) if
+the symbol is defined otherwise it just appends
+\cs{space}(\meta{description}).
If you want to provide your own custom format be aware that you
can't use \ics{ifglsused} within the post-\gls{linktext} hook as by this point
@@ -2031,6 +2077,17 @@ new per-unit feature, is described in \sectionref{sec:entrycount}.
\section{Unsetting the First Use Flag}
\label{sec:glsunset}
+There are two new commands provided with version 1.31+:
+\begin{definition}[\DescribeMacro\glslocalreseteach]
+\cs{glslocalreseteach}\marg{list}
+\end{definition}
+and
+\begin{definition}[\DescribeMacro\glslocalunseteach]
+\cs{glslocalunseteach}\marg{list}
+\end{definition}
+These behave like \cs{glslocalreset} and \cs{glslocalunset}
+but the argument is a comma-separated list of labels.
+
The internal command used by \cs{glsunset} is modified first to
allow for the changing in entry counting, described above, but
also to allow for buffering pending unsets when commands like
@@ -2062,6 +2119,13 @@ entry's label but doesn't actually perform the change:
\begin{definition}[\DescribeMacro\GlsXtrStartUnsetBuffering]
\cs{GlsXtrStartUnsetBuffering}
\end{definition}
+The unstarred version doesn't check for duplicates, so the internal
+list may end up with multiple occurrences of the same label. The
+starred version only adds a label to the internal list if it's not
+already in it. Note that this buffering only applies to the
+global \cs{glsunset} and does not affect the local
+\cs{glslocalunset}.
+
Later you can restore \cs{glsunset} and unset all buffered
labels using:
\begin{definition}[\DescribeMacro\GlsXtrStopUnsetBuffering]
@@ -2086,6 +2150,14 @@ The starred form \cs{GlsXtrStopUnsetBuffering*} uses
Next use: \gls{html}.
\end{document}
\end{verbatim}
+Before you stop the unset buffering, you can iterate over the
+current buffer using
+\begin{definition}[\DescribeMacro\GlsXtrForUnsetBufferedList]
+\cs{GlsXtrForUnsetBufferedList}\marg{cs}
+\end{definition}
+where \meta{cs} is a control sequence that takes a single argument
+(which is the entry label). This is best used with the starred
+version \cs{GlsXtrStartUnsetBuffering*} to avoid duplicates.
\begin{important}
Note that since the change in the first use flag now doesn't
@@ -3110,6 +3182,16 @@ the \qt{symbol} category:
\newcommand*{\glsxtrpostnamesymbol}{\space
(\glsentrysymbol{\glscurrententrylabel})}
\end{verbatim}
+For convenience, as from v1.31, you can use
+\begin{definition}[\DescribeMacro\glsdefpostname]
+\cs{glsdefpostname}\marg{category}\marg{definition}
+\end{definition}
+This is simply a shortcut for:
+\begin{alltt}
+\cs{csdef}{glsxtrpostname\meta{category}}\marg{definition}
+\end{alltt}
+Note that it doesn't check if the command has already been defined.
+
As from version 1.25, the post-name hook also does
\begin{definition}[\DescribeMacro\glsextrapostnamehook]
\cs{glsextrapostnamehook}\marg{label}
@@ -3133,6 +3215,15 @@ with the current entry. For example \cs{glsxtrpostdescgeneral}
for entries with the category set to \category{general}
or \cs{glsxtrpostdescacronym} for entries with the category set to
\category{acronym}.
+For convenience, as from v1.31, you can use
+\begin{definition}[\DescribeMacro\glsdefpostdesc]
+\cs{glsdefpostdesc}\marg{category}\marg{definition}
+\end{definition}
+This is simply a shortcut for:
+\begin{alltt}
+\cs{csdef}{glsxtrpostdesc\meta{category}}\marg{definition}
+\end{alltt}
+Note that it doesn't check if the command has already been defined.
Since both \cs{glossentry} and \cs{subglossentry} set
\begin{definition}[\DescribeMacro\glscurrententrylabel]
@@ -3298,6 +3389,14 @@ The \glostyle{list} styles use
\end{definition}
(which defaults to \cs{glslistprelocation}) for child items.
+As from v1.31, the description (including the post-description hook)
+is governed by:
+\begin{definition}[\DescribeMacro\glslistdesc]
+\cs{glslistdesc}\marg{label}
+\end{definition}
+for the \glostyle{list} and \glostyle{altlist} styles (but not the
+\glostyle{listdotted} variations).
+
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
@@ -3311,6 +3410,31 @@ 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{glossary-tree} package introduced two new commands in
+\sty{glossaries} version 4.22, \ics{glstreegroupheaderfmt}
+and \ics{glstreenavigationfmt}, which are used to format
+the letter group headings and the navigation elements for the
+appropriate styles. These two new commands are defined in terms of
+\ics{glstreenamefmt} since that was the command originally used
+for the group headings and navigation. This now allows these
+different elements to be defined independently, but the most common
+redefinition is for \cs{glstreenamefmt} to remove the bold in the
+name. If the bold is still required for the group heading and navigation
+elements, then both other commands also need redefining. To simplify
+matters, if \cs{glstreenamefmt} has been defined, as from v1.31
+\sty{glossaries-extra-stylemods} defines:
+\begin{definition}[\DescribeMacro\glstreedefaultnamefmt]
+\cs{glstreedefaultnamefmt}\marg{text}
+\end{definition}
+which simply does \cs{textbf}\marg{text} and redefines
+\cs{glstreenamefmt}, \cs{glstreegroupheaderfmt} and
+\cs{glstreenavigationfmt} all in terms of
+\cs{glstreedefaultnamefmt}. This means that if you want to change
+all three to use a particular style you only need to redefine
+\cs{glstreedefaultnamefmt}, but if you only want to redefine
+\cs{glstreenamefmt} without affecting the other two commands, then
+you now can.
+
The \glostyle{index}-like and \glostyle{tree}-like styles
insert the pre-\gls{numberlist} space with
\begin{definition}[\DescribeMacro\glstreeprelocation]
@@ -3322,6 +3446,44 @@ insert the pre-\gls{numberlist} space with
\end{definition}
(which defaults to \cs{glstreeprelocation}) for child items.
+As from version 1.31, the \styfmt{glossaries-extra-stylemods}
+package also provides:
+\begin{definition}[\DescribeMacro\glstreenonamedesc]
+\cs{glstreenonamedesc}\marg{label}
+\end{definition}
+which is used by the \glostyle{treenoname} styles to display the
+pre-description separator, the description and the post-description
+hook. Similarly for the symbol:
+\begin{definition}[\DescribeMacro\glstreenonamesymbol]
+\cs{glstreenonamesymbol}\marg{label}
+\end{definition}
+The above are just used for top-level entries. Child entries don't
+have the name or symbol displayed for the \glostyle{treenoname}
+styles, so there's only a command for the child description:
+\begin{definition}[\DescribeMacro\glstreenonamechilddesc]
+\cs{glstreenonamechilddesc}\marg{label}
+\end{definition}
+
+For the \glostyle{tree} styles (but not the \glostyle{treenoname} or
+\glostyle{alttree} styles), the description is displayed using:
+\begin{definition}[\DescribeMacro\glstreedesc]
+\cs{glstreedesc}\marg{label}
+\end{definition}
+and the symbol with:
+\begin{definition}[\DescribeMacro\glstreesymbol]
+\cs{glstreesymbol}\marg{label}
+\end{definition}
+Again the above two commands are just for top-level entries. The
+child entries use:
+\begin{definition}[\DescribeMacro\glstreechilddesc]
+\cs{glstreechilddesc}\marg{label}
+\end{definition}
+for the description and
+\begin{definition}[\DescribeMacro\glstreechildsymbol]
+\cs{glstreechildsymbol}\marg{label}
+\end{definition}
+for the symbol.
+
As from version 1.05, the \styfmt{glossaries-extra-stylemods}
package provides some additional commands for use with the
@@ -5610,7 +5772,11 @@ change, you can restore their former definitions using
\begin{definition}[\DescribeMacro\glsxtrRevertMarks]
\cs{glsxtrRevertMarks}
\end{definition}
-In this case, you'll have to use the \styfmt{glossaries} manual's
+If you only want to restore \cs{@starttoc} you can use:
+\begin{definition}[\DescribeMacro\glsxtrRevertTocMarks]
+\cs{glsxtrRevertTocMarks}
+\end{definition}
+If you restore the header or table of contents commands, you'll have to use the \styfmt{glossaries} manual's
recommendations of either simply using \cs{glsentryshort} (as above)
or use the sectioning command's option argument to provide an
alternative for the table of contents and page header. For example:
@@ -5880,7 +6046,11 @@ implement \gloskey[glslink]{wrgloss}\optfmt{=after}. (New to v1.14.)
\item[\catattrdef{discardperiod}] If set to \qt{true}, the
post-\gls{linktext} hook will
discard a~full stop (period) that follows \emph{non-plural} commands like \cs{gls} or
-\cs{glstext}. (Provided for entries such as abbreviations that end with a full stop.)
+\cs{glstext}. (Provided for entries such as abbreviations that end
+with a full stop.) This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.) This attribute
+doesn't apply to the accessibility fields.
Note that this can cause a problem if you access a field that
doesn't end with a full stop. For example:
@@ -5903,14 +6073,19 @@ and it won't be discarded.
\item[\catattrdef{pluraldiscardperiod}] If this attribute is set to
\qt{true} \emph{and} the \catattr{discardperiod} attribute is set to
\qt{true}, this will behave as above for the plural commands like
-\cs{glspl} or \cs{glsplural}.
+\cs{glspl} or \cs{glsplural}. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
\item[\catattrdef{retainfirstuseperiod}] If this attribute is set
to \qt{true} then the full stop won't be discarded for
\gls{firstuse} instances, even if \catattr{discardperiod} or
\catattr{pluraldiscardperiod} are set. This is useful for
\meta{short} (\meta{long}) abbreviation styles where only the short
-form has a trailing full stop.
+form has a trailing full stop. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.) This attribute doesn't apply to the
+accessibility fields.
\item[\catattrdef{markwords}] If this attribute is set to \qt{true}
any entry defined using \ics{newabbreviation} will automatically
@@ -5945,7 +6120,9 @@ localised switch, if required. For example:
{\def\glsxtrwordsep{-}\glsxtrlong[#1]{#2}}}
\end{verbatim}
-This setting will also adjust the long plural.
+This setting will also adjust the long plural. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
\begin{important}
This setting may result in the
@@ -5955,7 +6132,9 @@ This setting may result in the
\item[\catattrdef{markshortwords}] This is similar to
\catattr{markwords} but applies to the short form. (Only useful for
-abbreviations that contain spaces.)
+abbreviations that contain spaces.) This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
This setting will only adjust the short plural if the
\gloskey{shortplural} key isn't used. This setting will
@@ -5975,7 +6154,9 @@ in the \meta{short} argument of \cs{newabbreviation} (rather than
inserting them every time the entry is used). The short plural
form defaults to the new dotted version of the original \meta{short}
form with the plural suffix appended. \emph{This setting is incompatible
-with \catattr{markshortwords}.}
+with \catattr{markshortwords}.} This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
\begin{important}
If you explicitly override
@@ -5993,13 +6174,75 @@ attribute set to \qt{true}.
the plural suffix for the \emph{short} plural form (unless explicitly
overridden with the \gloskey{shortplural} key). The long plural form
is unaffected by this setting. This setting overrides
-\catattr{noshortplural}.
+\catattr{noshortplural}. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.) Check with your supervisor, publisher or
+editor if you want to use this attribute as this
+usage is controversial.
+
\item[\catattrdef{noshortplural}] If this attribute is set to
\qt{true}, \ics{newabbreviation} won't append the plural suffix for
the short plural form. This means the \gloskey{short} and
\gloskey{shortplural} values will be the same unless explicitly
-overridden. \emph{This setting is incompatible with \catattr{aposplural}.}
+overridden. \emph{This setting is incompatible with \catattr{aposplural}.} This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
+
+\item[\catattrdef{accessinsertdots}] If this attribute is set to
+\qt{true} and the \sty{glossaries-accsupp} package has been loaded
+(with the \pkgopt{accsupp} option), then this behaves like
+\catattr{insertdots} but for the \gloskey{shortaccess} field instead
+of the \gloskey{short} field. This can be used to assist the
+screen reader for initialisms that should be read out letter by
+letter rather than as a word. For example:
+\begin{verbatim}
+\glssetcategoryattribute{initialism}{accessinsertdots}{true}
+
+\newabbreviation[category=initialism]{pi}{PI}{Private Investigator}
+\end{verbatim}
+This setting will be overridden by an explicit use of
+the \gloskey{shortaccess} key in the optional argument
+of \cs{newabbreviation} (or \cs{newacronym}). This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
+
+\item[\catattrdef{nameshortaccess}] If this attribute is set to
+\qt{true}, the \gloskey{access} field (used for the \gloskey{name}
+field's accessibility support) is set to the \gloskey{shortaccess}
+value. This attribute has no effect if there's no accessibility
+support or if the \gloskey{shortaccess} field hasn't been assigned
+or if the \gloskey{access} field is used explicitly. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
+
+\item[\catattrdef{textshortaccess}] Like \gloskey{nameshortaccess}
+but applies to the \gloskey{textaccess} field (for use with
+regular abbreviations).
+
+\item[\catattrdef{firstshortaccess}] Like \gloskey{nameshortaccess}
+but applies to the \gloskey{firstaccess} field (for use with
+regular abbreviations).
+
+\item[\catattrdef{accessaposplural}] This boolean attribute overrides
+\catattr{aposplural} for the \gloskey{shortpluralaccess} key.
+Has no effect if there's no accessibility support or if
+the \gloskey{shortaccess} key hasn't been set or if the
+\gloskey{shortpluralaccess} key is explicitly set. If
+the \catattr{aposplural} is set and this attribute isn't set
+and the \gloskey{shortaccess} key is set, then the
+\catattr{aposplural} setting governs the default
+\gloskey{shortpluralaccess} setting. If you want
+\catattr{aposplural} but don't want it applied to the accessibility
+support, set the \catattr{accessaposplural} attribute to \qt{false}. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
+
+\item[\catattrdef{accessnoshortplural}] This boolean attribute overrides
+\catattr{noshortplural} for the \gloskey{shortpluralaccess} key.
+The same conditions apply as for \catattr{accessaposplural}. This attribute is only applicable to entries
+defined using \cs{newabbreviation} (or \cs{newacronym} if it's using
+\cs{newabbreviation}.)
\item[\catattrdef{headuc}] If this attribute is set to \qt{true},
commands like \ics{glsfmtshort} will use the upper case version
@@ -7590,6 +7833,28 @@ when you need to indicate a Unicode character in the form
\cs{u}\meta{hex} in some of
the resource options (as illustrated above).
+\begin{definition}[\DescribeMacro\glscapturedgroup]
+\cs{glscapturedgroup}
+\end{definition}
+This is just defined as \verb|\string\$| and is used for
+the captured group reference in a replacement part of a regular
+expression substitution (requires at least \gls{bib2gls} version 1.5). For example:
+\begin{verbatim}
+sort-replace={{([a-zA-Z])\string\.}{\glscapturedgroup1}}
+\end{verbatim}
+This only removes a full stop that follows any of the characters
+a,\ldots,z or A,\ldots,Z.
+
+If you use the \texttt{save-child-count} resource option,
+you can test if the \texttt{childcount} field is non-zero using:
+\begin{definition}[\DescribeMacro{\GlsXtrIfHasNonZeroChildCount}]
+\cs{GlsXtrIfHasNonZeroChildCount}\marg{label}\marg{true}\marg{false}
+\end{definition}
+This internally uses \cs{GlsXtrIfFieldNonZero} and will do
+\meta{false} if the field isn't set. Within \meta{true} and
+\meta{false} you can use \cs{glscurrentfieldvalue} to access the
+value. (It will be 0 in \meta{false} if the field isn't set.)
+
\begin{definition}[\DescribeMacro\glsxtrprovidecommand]
\cs{glsxtrprovidecommand}
\end{definition}
@@ -8968,12 +9233,48 @@ You can test if a field value equals a string using
\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}
+\meta{false}. This is just a shortcut that uses:
+\begin{definition}[\DescribeMacro{\GlsXtrIfFieldCmpStr}]
+\cs{GlsXtrIfFieldCmpStr}\marg{field}\marg{label}\marg{comparison}\marg{text}\marg{true}\marg{false}
+\end{definition}
+This in turn 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}.
+\sty{etoolbox}'s \cs{ifdefstring}. The \meta{comparison} argument
+must be one of \texttt{=} (equality), \texttt{<} (less
+than) or \texttt{>} (greater than).
+
+As from version 1.31, there's a similar command:
+\begin{definition}[\DescribeMacro{\GlsXtrIfFieldEqXpStr}]
+\cs{GlsXtrIfFieldEqXpStr}\marg{field}\marg{label}\marg{text}\marg{true}\marg{false}
+\end{definition}
+This is like \cs{GlsXtrIfFieldEqStr} but first (protected) fully
+expands \meta{text} (but not the field value). If you want to
+compare the (protected) full expansion of both the field value and \meta{text}
+use:
+\begin{definition}[\DescribeMacro{\GlsXtrIfXpFieldEqXpStr}]
+\cs{GlsXtrIfXpFieldEqXpStr}\marg{field}\marg{label}\marg{text}\marg{true}\marg{false}
+\end{definition}
+As from v1.31, if a field represents a numeric (integer) value, you
+can use the following two numeric tests. If the field is set, it must
+expand to an integer. You may use \cs{glscurrentfieldvalue}
+within \meta{true} or \meta{false} to access the actual value. Both \meta{true}
+and \meta{false} are scoped. If the field is undefined or empty,
+the value is assumed to be 0, and \cs{glscurrentfieldvalue} is set
+accordingly.
+
+To test if the value is non-zero:
+\begin{definition}[\DescribeMacro{\GlsXtrIfFieldNonZero}]
+\cs{GlsXtrIfFieldNonZero}\marg{field}\marg{label}\marg{true}\marg{false}
+\end{definition}
+Alternatively, you can test if the field expands to a specific
+number using:
+\begin{definition}[\DescribeMacro{\GlsXtrIfFieldEqNum}]
+\cs{GlsXtrIfFieldEqNum}\marg{field}\marg{label}\marg{n}\marg{true}\marg{false}
+\end{definition}
+This does \meta{true} if the field value equals \meta{n}
+(using \cs{ifnum} for the comparison) otherwise it does \meta{false}.
The \styfmt{glossaries} package provides \ics{glsfieldfetch} which
can be used to fetch the value of the given field and store it in a
@@ -9437,19 +9738,34 @@ so that it's only available for use in \cs{glossentryname}.
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}.
+in \cs{glsentryitem} and \cs{glssubentryitem}. The value is obtained
+by fully expanding:
+\begin{definition}[\DescribeMacro\GlsXtrStandaloneGlossaryType]
+\cs{GlsXtrStandaloneGlossaryType}
+\end{definition}
+which defaults to the value of the \gloskey{type} field for the
+current entry.
\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
+ package options are set. If the entry doesn't have a parent, then
this does
\begin{itemize}
- \item \cs{glssubentryitem}\marg{label}
+ \item \cs{glsentryitem}\marg{label}
\end{itemize}
- otherwise it does
+ otherwise it does (as from v1.31)
\begin{itemize}
- \item \cs{glsentryitem}\marg{label}
+ \item \ics{GlsXtrStandaloneSubEntryItem}\marg{label}
+which defaults to \cs{glssubentryitem}\marg{label} if the entry
+has a parent but not a grandparent.
\end{itemize}
+ This reflects the behaviour of the predefined hierarchical styles.
+A bug in pre-version~1.31 used \cs{glsentryitem} for all child levels,
+which doesn't match the hierarchical glossary styles. If you want to
+restore this behaviour, just do:
+\begin{verbatim}
+\renewcommand*{\GlsXtrStandaloneSubEntryItem}[1]{\glssubentryitem{#1}}
+\end{verbatim}
\item Sets the hyper-target if supported (using \cs{glstarget}).