diff options
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.tex | 52 |
1 files changed, 47 insertions, 5 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 96fb37ddb5d..e041fe1f146 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 @@ -210,13 +210,13 @@ styles (glossaries):>#1={\protect\ttfamily#1}|main}} \DeleteShortVerb{\|} \MakeShortVerb{"} - \title{glossaries-extra.sty v1.23: + \title{glossaries-extra.sty v1.24: an extension to the glossaries package} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} - \date{2017-11-12} + \date{2017-11-14} \maketitle \begin{abstract} @@ -2791,6 +2791,11 @@ For example: \begin{verbatim} \glsxtrsetgrouptitle{A}{A (a)} \end{verbatim} +This uses a global assignment. If you need to scope the change +you can use +\begin{definition}[\DescribeMacro\glsxtrlocalsetgrouptitle] +\cs{glsxtrlocalsetgrouptitle}\marg{label}\marg{title} +\end{definition} \subsection{Style Hooks} \label{sec:stylehooks} @@ -7516,7 +7521,7 @@ The \styfmt{glossaries} package provides \ics{ifglshasfield} to determine if a field has been set. The \styfmt{glossaries-extra} package provides a simpler version: \begin{definition}[\DescribeMacro\glsxtrifhasfield] -\cs{glsxtrifhasfield}\marg{label}\marg{field}\marg{true}\marg{false} +\cs{glsxtrifhasfield}\marg{field}\marg{label}\marg{true}\marg{false} \end{definition} (New to v1.19.) Unlike \cs{ifglshasfield}, this version doesn't complain if the @@ -7531,7 +7536,7 @@ to access the field value. This command includes grouping which scopes the \meta{true} and \meta{false} parts. The starred version \begin{definition}[\DescribeMacro{\glsxtrifhasfield*}] -\cs{glsxtrifhasfield*}\marg{label}\marg{field}\marg{true}\marg{false} +\cs{glsxtrifhasfield*}\marg{field}\marg{label}\marg{true}\marg{false} \end{definition} omits the implicit grouping. @@ -7542,9 +7547,24 @@ need to check if the field is defined without accessing it: \cs{GlsXtrIfFieldUndef}\marg{field}\marg{label}\marg{true}\marg{false} \end{definition} +\begin{important} +There's a difference between an undefined field and an unset field. +An undefined field hasn't been assigned any value (no +associated internal control sequence has been defined). If a defined +field has been defined to empty, then it's considered unset. +\cs{GlsXtrIfFieldUndef} implement \meta{false} for a defined +but empty field whereas \cs{glsxtrifhasfield} and \cs{ifglshasfield} +will implement \meta{false} a defined but empty field. +Remember that any keys that may be used in \cs{newglossaryentry} +will have a default value if not provided. In many cases, the +default value is empty, so only use \cs{GlsXtrIfFieldUndef} +for fields that can only be defined through commands like +\cs{GlsXtrSetField}. +\end{important} + 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} +\cs{GlsXtrIfFieldEqStr}\marg{field}\marg{label}\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 @@ -7619,6 +7639,28 @@ See the \sty{etoolbox}'s user manual for further details of these commands, in particular the limitations of \cs{ifinlist}. +If the field has a comma-separated list value instead, you +can iterate over it using: +\begin{definition}[\DescribeMacro\glsxtrforcsvfield] +\cs{glsxtrforcsvfield}\marg{label}\marg{field}\marg{handler} +\end{definition} +where again \meta{handler} is a control sequence that takes +a single argument. Unlike the \sty{etoolbox} loops, this +doesn't ignore empty elements nor does it discard leading / trailing +spaces. Internally it uses \cs{@for} (modified by \sty{xfor} +which is automatically loaded by \sty{glossaries}). The +\sty{xfor} package modifies the behaviour of \cs{@for} to allow +the loop to be broken prematurely using \cs{@endfortrue}. +The \cs{glsxtrforcsvfield} command locally defines +a user level command: +\begin{definition}[\DescribeMacro\glsxtrendfor] +\cs{glsxtrendfor} +\end{definition} +which is just a synonym for \cs{@endfortrue}. + +The loop is performed within the true part of \cs{glsxtrifhasfield} +so scoping is automatically applied. + 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: |