summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-04-26 03:02:07 +0000
committerNorbert Preining <norbert@preining.info>2023-04-26 03:02:07 +0000
commit1ea4eef62d24f4f0574afba646c635f677eeb7cc (patch)
tree63fbd204a87d79c6fdbccb59221df6581c863ddf /macros/latex/contrib/glossaries-extra/glossaries-extra.dtx
parent800f3919ea46f82dc11cbfb51f08d2f3a1c43a70 (diff)
CTAN sync 202304260302
Diffstat (limited to 'macros/latex/contrib/glossaries-extra/glossaries-extra.dtx')
-rw-r--r--macros/latex/contrib/glossaries-extra/glossaries-extra.dtx245
1 files changed, 217 insertions, 28 deletions
diff --git a/macros/latex/contrib/glossaries-extra/glossaries-extra.dtx b/macros/latex/contrib/glossaries-extra/glossaries-extra.dtx
index a3490e00d9..f66830207b 100644
--- a/macros/latex/contrib/glossaries-extra/glossaries-extra.dtx
+++ b/macros/latex/contrib/glossaries-extra/glossaries-extra.dtx
@@ -1,15 +1,15 @@
%\iffalse
% glossaries-extra.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
+% -macrocode ".*\.tex"
+% -macrocode ".*\.bib"
+% -author "Nicola Talbot"
+% -doc "glossaries-extra-codedoc.tex"
% -setambles ".*\.bib=>\nopreamble\nopostamble"
-% -codetitle "Main Package Code (glossaries-extra.sty)"
% -section "section"
+% -codetitle "Main Package Code (glossaries-extra.sty)"
% -comment ".*\.tex"
% -comment ".*\.bib"
-% -author "Nicola Talbot"
-% -macrocode ".*\.tex"
-% -macrocode ".*\.bib"
-% -doc "glossaries-extra-codedoc.tex"
% -src "glossaries-extra.sty\Z=>glossaries-extra.sty"
% -src "(.+)\.def\Z=>\1.def"
% -src "glossaries-extra-bib2gls.sty\Z=>glossaries-extra-bib2gls.sty"
@@ -22,7 +22,7 @@
% -src "(example-glossaries-.+\.bib)\Z=>\1"
% -src "(glossar.+-2021-11-22.sty)\Z=>\1"
% glossaries-extra
-% Created on 2022/11/8 19:11
+% Created on 2023/4/24 22:04
%\fi
%\iffalse
%<*package>
@@ -45,7 +45,7 @@
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2022 Nicola Talbot, all rights reserved.
+% Copyright (C) 2023 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
@@ -57,7 +57,7 @@ glossaries-extra.dtx
\documentclass{article}
\usepackage{doc}
-\CheckSum{70912}
+\CheckSum{71177}
\RecordChanges
\PageIndex
@@ -116,13 +116,13 @@ glossaries-extra.dtx
\providecommand\oarg[1]{%
\allowbreak{\ttfamily[}\meta{#1}{\ttfamily]}}
-\title{glossaries-extra.sty v1.50:
+\title{glossaries-extra.sty v1.51:
documented code}
\author{Nicola L.C. Talbot\\[10pt]
Dickimaw Books\\
\url{http://www.dickimaw-books.com/}}
-\date{2022-11-08}
+\date{2023-04-24}
\begin{document}
\DocInput{glossaries-extra.dtx}
@@ -153,11 +153,11 @@ Dickimaw Books\\
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossaries-extra-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossaries-extra}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossaries-extra}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
% Requires \sty{xkeyval} to define package options.
% \begin{macrocode}
@@ -1285,6 +1285,14 @@ Dickimaw Books\\
% \end{macrocode}
%\end{option}
%
+%\begin{macro}{\GlossariesExtraInfo}
+%\changes{1.51}{2023-04-24}{new}
+%Allow users to suppress information messages.
+% \begin{macrocode}
+\newcommand*{\GlossariesExtraInfo}[1]{\PackageInfo{glossaries-extra}{#1}}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\GlossariesExtraWarning}
%Allow users to suppress warnings.
% \begin{macrocode}
@@ -10737,6 +10745,15 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\glsxtrpInit}
+%Initialisation code at the start of the group inserted by
+%\cs{@@glsxtrp}.
+%\changes{1.51}{2023-04-24}{new}
+% \begin{macrocode}
+\newcommand{\glsxtrpInit}[2]{\let\glspostlinkhook\relax}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\@@glsxtrp}
%\changes{1.07}{2016-08-15}{new}
% \begin{macrocode}
@@ -10745,7 +10762,7 @@ Dickimaw Books\\
%Add scope.
% \begin{macrocode}
{%
- \let\glspostlinkhook\relax
+ \glsxtrpInit{#1}{#2}%
\csname#1\expandafter\endcsname\expandafter[\@glsxtrp@opt]{#2}[]%
}%
}
@@ -10967,6 +10984,35 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%Provide case-changing versions of synonyms.
+%\begin{macro}{\Glsps}
+%\changes{1.51}{2023-04-24}{new}
+% \begin{macrocode}
+\newcommand*{\Glsps}{\Glsxtrp{short}}
+\glsmfuaddmap{\glsps}{\Glsps}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\GLSps}
+%\changes{1.51}{2023-04-24}{new}
+% \begin{macrocode}
+\newcommand*{\GLSps}{\GLSxtrp{short}}
+\glsmfublocker{\GLSps}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\Glspt}
+%\changes{1.51}{2023-04-24}{new}
+% \begin{macrocode}
+\newcommand*{\Glspt}{\Glsxtrp{text}}
+\glsmfuaddmap{\glspt}{\Glspt}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\GLSpt}
+%\changes{1.51}{2023-04-24}{new}
+% \begin{macrocode}
+\newcommand*{\GLSpt}{\GLSxtrp{text}}
+\glsmfublocker{\GLSpt}
+% \end{macrocode}
+%\end{macro}
%
%\subsubsection{Entry Counting}
%
@@ -14139,8 +14185,18 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\glsxtr@locale}
+%\changes{1.51}{2023-04-24}{new}
+%Used to identify all languages tracked in the document.
+% \begin{macrocode}
+\newcommand*{\glsxtr@locale}[1]{}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\glsxtr@langtag}
%\changes{1.12}{2017-02-03}{new}
+%Identifies the current language at the time
+%\cs{glsxtr@writefields} is used.
% \begin{macrocode}
\newcommand*{\glsxtr@langtag}[1]{}
% \end{macrocode}
@@ -14208,6 +14264,10 @@ Dickimaw Books\\
% \begin{macrocode}
\ifdef\CurrentTrackedLanguageTag
{%
+ \ForEachTrackedDialect{\@glsxtr@currentdialect}{%
+ \protected@write\@auxout{}{%
+ \string\glsxtr@locale{\GetTrackedLanguageTag\@glsxtr@currentdialect}}%
+ }%
\protected@write\@auxout{}{%
\string\glsxtr@langtag{\CurrentTrackedLanguageTag}}%
}%
@@ -14557,6 +14617,36 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\glsxtrtarget}
+%\changes{1.51}{2023-04-24}{new}
+%Similar to \cs{glstarget} but will only create the target if the
+%field identified by \cs{glsxtrtargetfield} has been defined.
+%If the target hasn't been defined, the target is created and the
+%target name is saved in the given field.
+%If \cs{glstarget} is redefined to use this command then duplicate
+%targets can be avoid if the same entry appears in multiple
+%glossaries.
+%TODO: possibly extend this to allow a comma-separated list of
+%targets in the field?
+% \begin{macrocode}
+\newcommand{\glsxtrtarget}[2]{%
+ \GlsXtrIfFieldUndef{\glsxtrtargetfield}{#1}%
+ {%
+ \@glstarget{\glolinkprefix #1}{#2}%
+ \xGlsXtrSetField{#1}{\glsxtrtargetfield}{\glolinkprefix #1}%
+ }{#2}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\glsxtrtargetfield}
+%\changes{1.51}{2023-04-24}{new}
+%The field name used by \cs{glsxtrtarget}.
+% \begin{macrocode}
+\newcommand{\glsxtrtargetfield}{target}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\printunsrtglossary}
%\changes{1.08}{2016-12-13}{new}
%\changes{1.12}{2017-02-03}{added starred form}
@@ -24564,6 +24654,10 @@ defined}{}%
\let\@glsxtr@org@GLSxtrtitleshortpl\GLSxtrtitleshortpl
\let\@glsxtr@org@glsxtrtitlename\glsxtrtitlename
\let\@glsxtr@org@Glsxtrtitlename\Glsxtrtitlename
+% \end{macrocode}
+%\changes{1.51}{2023-04-24}{save missing \cs{GLSxtrtitlename}}
+% \begin{macrocode}
+ \let\@glsxtr@org@GLSxtrtitlename\GLSxtrtitlename
\let\@glsxtr@org@glsxtrtitletext\glsxtrtitletext
\let\@glsxtr@org@Glsxtrtitletext\Glsxtrtitletext
\let\@glsxtr@org@GLSxtrtitletext\GLSxtrtitletext
@@ -24572,6 +24666,10 @@ defined}{}%
\let\@glsxtr@org@GLSxtrtitleplural\GLSxtrtitleplural
\let\@glsxtr@org@glsxtrtitlefirst\glsxtrtitlefirst
\let\@glsxtr@org@Glsxtrtitlefirst\Glsxtrtitlefirst
+% \end{macrocode}
+%\changes{1.51}{2023-04-24}{save missing \cs{GLSxtrtitlefirst}}
+% \begin{macrocode}
+ \let\@glsxtr@org@GLSxtrtitlefirst\GLSxtrtitlefirst
\let\@glsxtr@org@glsxtrtitlefirstplural\glsxtrtitlefirstplural
\let\@glsxtr@org@Glsxtrtitlefirstplural\Glsxtrtitlefirstplural
\let\@glsxtr@org@GLSxtrtitlefirstplural\GLSxtrtitlefirstplural
@@ -36890,11 +36988,12 @@ defined}{}%
%
%\begin{macro}{\glsxtrshortlonguserdescname}
%\changes{1.25}{2017-11-24}{new}
+%\changes{1.51}{??}{changed \cs{glslongpltok} to \cs{glslongtok}}
% \begin{macrocode}
\newcommand*{\glsxtrshortlonguserdescname}{%
\protect\glsabbrvuserfont{\the\glsshorttok}%
\protect\glsxtruserparen
- {\protect\glslonguserfont{\the\glslongpltok}}%
+ {\protect\glslonguserfont{\the\glslongtok}}%
{\the\glslabeltok}%
}
% \end{macrocode}
@@ -39753,11 +39852,11 @@ defined}{}%
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossaries-extra-bib2gls-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossaries-extra-bib2gls}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossaries-extra-bib2gls}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
%Provide convenient shortcut commands for predefined glossary types.
%\begin{macro}{\printunsrtacronyms}
@@ -39873,6 +39972,61 @@ defined}{}%
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\GlsXtrResourceInitEscSequences}
+%\changes{1.51}{2023-04-24}{new}
+% Protect commands that shouldn't expand in resource options as they
+% have a special meaning in the context of those options.
+% This command may be added to the definition of
+% \cs{glsxtrresourceinit}.
+% \begin{macrocode}
+\newcommand*{\GlsXtrResourceInitEscSequences}{%
+ \def\u{\string\u}%
+ \def\.{\string\.}%
+ \def\\{\string\\}%
+ \def\/{\string\/}%
+ \def\|{\string\|}%
+ \def\&{\string\&}%
+ \def\+{\string\+}%
+ \def\<{\string\<}%
+ \def\>{\string\>}%
+ \def\*{\string\*}%
+ \def\${\string\$}%
+ \def\^{\string\^}%
+ \def\~{\string\~}%
+ \def\({\string\(}%
+ \def\){\string\)}%
+ \def\[{\string\[}%
+ \def\]{\string\]}%
+ \def\"{\string\"}%
+ \def\-{\string\-}%
+ \def\?{\string\?}%
+ \def\#{\string\#}%
+ \def\:{\string\:}%
+ \def\cs##1{\glsbackslash##1}%
+ \def\CS{\string\CS}%
+ \def\NULL{\string\NULL\space}%
+ \def\IN{\string\IN\space}%
+ \def\NIN{\string\NIN\space}%
+ \def\PREFIXOF{\string\PREFIXOF\space}%
+ \def\NOTPREFIXOF{\string\NOTPREFIXOF\space}%
+ \def\SUFFIXOF{\string\SUFFIXOF\space}%
+ \def\NOTSUFFIXOF{\string\NOTSUFFIXOF\space}%
+ \def\LC{\string\LC}%
+ \def\UC{\string\UC}%
+ \def\FIRSTLC{\string\FIRSTLC}%
+ \def\FIRSTUC{\string\FIRSTUC}%
+ \def\TITLE{\string\TITLE}%
+ \def\MGP{\string\MGP}%
+ \def\LEN{\string\LEN}%
+ \def\TRIM{\string\TRIM}%
+ \def\INTERPRET{\string\INTERPRET}%
+ \def\LABELIFY{\string\LABELIFY}%
+ \def\LABELIFYLIST{\string\LABELIFYLIST}%
+ \def\CAT{\string\CAT}%
+}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\GlsXtrIfHasNonZeroChildCount}
%\changes{1.31}{2018-05-09}{new}
%\changes{1.47}{2021-11-04}{added starred version}
@@ -40997,11 +41151,38 @@ defined}{}%
\ifx\@gls@fallbacklabel\relax
\ifcsvoid
{glo@\glsdetoklabel{\@gls@thislabel}@\dglsfieldfallbackfieldlabel}%
- {}%
+ {%
+ \GlossariesExtraInfo{Found entry `\@gls@thislabel' that
+ matches prefix `\@glsxtr@prefix' but field `#2' not set
+ and fallback field `\dglsfieldfallbackfieldlabel' not set}%
+ }%
{%
\let\@gls@fallbacklabel\@gls@thislabel
+ \GlossariesExtraInfo{Found entry `\@gls@thislabel' that
+ matches prefix `\@glsxtr@prefix' but field `#2' not set.
+ Fallback field `\dglsfieldfallbackfieldlabel' is set
+ so setting fallback entry to `\@gls@fallbacklabel' with
+ field `\dglsfieldfallbackfieldlabel'}%
}%
+ \else
+ \GlossariesExtraInfo{Found entry `\@gls@thislabel' that
+ matches prefix `\@glsxtr@prefix' but field `#2' not set.
+ Fallback entry: `\@gls@fallbacklabel'}%
\fi
+% \end{macrocode}
+%\changes{1.51}{2023-04-24}{add found entry to list}
+% Add to list. (A new entry with the desired field may have been
+% added, so allow it to be selected.)
+% \begin{macrocode}
+ \ifdefempty\@glsxtr@prefixedlist
+ {\let\@glsxtr@prefixedlist\@gls@thislabel}%
+ {%
+ \ifGlsXtrPrefixLabelFallbackLast
+ \epreto\@glsxtr@prefixedlist{\expandonce\@gls@thislabel,}%
+ \else
+ \eappto\@glsxtr@prefixedlist{,\expandonce\@gls@thislabel}%
+ \fi
+ }%
}%
{%
\@endfortrue
@@ -41035,6 +41216,7 @@ defined}{}%
% Label not found. Was the fallback field found?
% \begin{macrocode}
\ifx\@gls@fallbacklabel\relax
+ \GlossariesExtraWarning{No fallback found for `#1'}%
% \end{macrocode}
% No field fallback found.
% \begin{macrocode}
@@ -41054,10 +41236,15 @@ defined}{}%
\fi
\else
% \end{macrocode}
-% Fallback field was found.
+% Fallback field was found. Use the fallback entry.
% \begin{macrocode}
\let\@gls@thislabel\@gls@fallbacklabel
\let\dglsfieldactualfieldlabel\dglsfieldfallbackfieldlabel
+% \end{macrocode}
+%Clear prefix candidate list.
+%\changes{1.51}{2023-04-24}{clear list}
+% \begin{macrocode}
+ \let\@glsxtr@prefixedlist\@empty
\fi
\fi
% \end{macrocode}
@@ -43944,11 +44131,11 @@ defined}{}%
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossaries-extra-stylemods-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossaries-extra-stylemods}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossaries-extra-stylemods}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
% Provide package options to automatically load required predefined
% styles. The simplest method is to just test for the existence of
@@ -46951,11 +47138,11 @@ defined}{}%
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossary-bookindex-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossary-bookindex}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossary-bookindex}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
%Load required packages.
% \begin{macrocode}
@@ -47567,11 +47754,11 @@ defined}{}%
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossary-longextra-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossary-longextra}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossary-longextra}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
%Load required packages.
% \begin{macrocode}
@@ -50886,11 +51073,11 @@ defined}{}%
% Rollback releases:
% \begin{macrocode}
\DeclareRelease{v1.48}{2021-11-22}{glossary-topic-2021-11-22.sty}
-\DeclareCurrentRelease{v1.50}{2022-11-08}
+\DeclareCurrentRelease{v1.51}{2023-04-24}
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossary-topic}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossary-topic}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
%Load required package.
% \begin{macrocode}
@@ -51318,7 +51505,7 @@ defined}{}%
% \end{macrocode}
% Declare package:
% \begin{macrocode}
-\ProvidesPackage{glossary-table}[2022/11/08 v1.50 (NLCT)]
+\ProvidesPackage{glossary-table}[2023/04/24 v1.51 (NLCT)]
% \end{macrocode}
%Load required packages.
% \begin{macrocode}
@@ -52153,10 +52340,11 @@ defined}{}%
%
%\begin{macro}{\glstableOtherNoDesc}
%\changes{1.49}{2022-10-14}{new}
+% \begin{macrocode}
\newcommand{\glstableOtherNoDesc}[1]{%
\glstableOtherIfSet{#1}%
}
-% \begin{macrocode}
+% \end{macrocode}
%\end{macro}
%
%\begin{macro}{\glstableOtherIfSet}
@@ -52174,6 +52362,7 @@ defined}{}%
\newcommand{\glstableSubOtherNoDesc}[1]{%
\glstableOtherNoDesc{#1}%
}
+% \end{macrocode}
%\end{macro}
%\begin{macro}{\glstableSubOtherIfSet}
%\changes{1.50}{2022-11-08}{new}