diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty | 109 |
1 files changed, 79 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty index e503608aee3..22513d57d1a 100644 --- a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty +++ b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossaries.sty,package') %% %% glossaries.dtx -%% Copyright 2023 Nicola Talbot +%% Copyright 2024 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -42,15 +42,15 @@ \DeclareRelease{v4.46}{2020-03-19}{glossaries-2020-03-19.sty} \DeclareRelease{v4.49}{2021-11-01}{glossaries-2021-11-01.sty} \DeclareRelease{v4.52}{2022-11-03}{glossaries-2022-11-03.sty} -\DeclareCurrentRelease{v4.53}{2023-09-29} -\ProvidesPackage{glossaries}[2023/09/29 v4.53 (NLCT)] +\DeclareCurrentRelease{v4.54}{2024-04-03} +\ProvidesPackage{glossaries}[2024/04/03 v4.54 (NLCT)] \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} \newcommand{\glssentencecase}[1]{\makefirstuc{#1}} \ExplSyntaxOn -\newcommand{\glslowercase}[1]{\text_lowercase:n{#1}} -\newcommand{\glsuppercase}[1]{\text_uppercase:n{#1}} +\newcommand{\glslowercase}[1]{ \text_lowercase:n { #1 } } +\newcommand{\glsuppercase}[1]{ \text_uppercase:n { #1 } } \ifdef\MFUsentencecase {% \newcommand{\glsmfuexcl}[1]{\MFUexcl{#1}} @@ -59,7 +59,7 @@ } { \RequirePackage{textcase} - \providecommand{\MFUsentencecase}[1]{\text_titlecase_first:n{#1}} + \providecommand{\MFUsentencecase}[1]{ \text_titlecase_first:n { #1 } } \providecommand{\glsmfuexcl}[1]{ \tl_if_in:NnF \l_text_case_exclude_arg_tl {#1} { @@ -3060,6 +3060,13 @@ removed. Rollback required or use a newer alternative} \let\glstarget\@secondoftwo \let\@glslink\@secondoftwo } +\ExplSyntaxOn + \tl_if_exist:NT \l_datatool_measure_hook_tl + { + \tl_put_right:Nn \l_datatool_measure_hook_tl + { \gls@start@measuring } + } +\ExplSyntaxOff \newcommand{\gls@stop@measuring}{% \renewcommand*{\glsifmeasuring}{\gls@if@measuring}% \let\refstepcounter\gls@org@refstepcounter @@ -4013,13 +4020,51 @@ removed. Rollback required or use a newer alternative} \glsdoshowtarget{#1}% {% \glsmeasureheight{\gls@tmplen}{#2}% + \glsdohypertargethook{#1}{#2}% \raisebox{\gls@tmplen}{\hypertarget{#1}{}}% #2% }% } +\newcommand*{\glsdohypertargethook}[2]{} +\NewDocumentCommand\glslabelhypertarget{mm}{% + \protected@write\@auxout + {\glslabelhypertargetdefs}% + {% + \string\newlabel + {\glslabelhypertargetprefix#1}% + {% + {\glslabelhypertargetvalue}{\thepage}{#2}{#1}{}% + }% + }% +} +\ExplSyntaxOn +\newcommand\glslabelhypertargetvalue{ + \bool_lazy_and:nnT + { \tl_if_exist_p:N \glscurrententrylabel } + { \bool_not_p:n { \tl_if_empty_p:N \glscurrententrylabel } } + { + \glsentryname \glscurrententrylabel + } +} +\ExplSyntaxOff +\newcommand*\glslabelhypertargetprefix{} +\newcommand*\glslabelhypertargetdefs{% + \let\glossentryname\glsentryname + \let\glossentrydesc\glsentrydesc + \let\glossentrysymbol\glsentrysymbol + \let\Glossentryname\glsentryname + \let\Glossentrydesc\glsentrydesc + \let\Glossentrysymbol\glsentrysymbol + \let\glossentrynameother\@gls@entry@field +} \newcommand*{\glsdohyperlink}[2]{% - \glsdoshowtarget{#1}{\hyperlink{#1}{#2}}% + \glsdoshowtarget{#1}% + {% + \glsdohyperlinkhook{#1}{#2}% + \hyperlink{#1}{#2}% + }% } +\newcommand*{\glsdohyperlinkhook}[2]{} \newcommand*{\glsdonohyperlink}[2]{#2} \ifcsundef{hyperlink}% {% @@ -4758,7 +4803,7 @@ removed. Rollback required or use a newer alternative} \glstexorpdfstring{\protect\@Gls@entryname{#1}}% {\MFUsentencecase{\@gls@entry@field{#1}{name}}}% } -\glsmfuaddmap{\glsentryname}{\Glsentryname} +\glsmfuexcl{\Glsentryname} \newcommand*{\@Gls@entryname}[1]{% \@Gls@entry@field{#1}{name}% } @@ -4807,54 +4852,54 @@ removed. Rollback required or use a newer alternative} } \newcommand*{\glsentrydesc}[1]{\@gls@entry@field{#1}{desc}} \newcommand*{\Glsentrydesc}[1]{\@Glsentryfield{#1}{desc}} -\glsmfuaddmap{\glsentrydesc}{\Glsentrydesc} +\glsmfuexcl{\Glsentrydesc} \newcommand*{\glsentrydescplural}[1]{% \@gls@entry@field{#1}{descplural}% } \newcommand*{\Glsentrydescplural}[1]{% \@Glsentryfield{#1}{descplural}% } -\glsmfuaddmap{\glsentrydescplural}{\Glsentrydescplural} +\glsmfuexcl{\Glsentrydescplural} \newcommand*{\glsentrytext}[1]{\@gls@entry@field{#1}{text}} \newcommand*{\Glsentrytext}[1]{% \@Glsentryfield{#1}{text}% } -\glsmfuaddmap{\glsentrytext}{\Glsentrytext} +\glsmfuexcl{\Glsentrytext} \newcommand*{\glsentryplural}[1]{% \@gls@entry@field{#1}{plural}% } \newcommand*{\Glsentryplural}[1]{% \@Glsentryfield{#1}{plural}% } -\glsmfuaddmap{\glsentryplural}{\Glsentryplural} +\glsmfuexcl{\Glsentryplural} \newcommand*{\glsentrysymbol}[1]{% \@gls@entry@field{#1}{symbol}% } \newcommand*{\Glsentrysymbol}[1]{% \@Glsentryfield{#1}{symbol}% } -\glsmfuaddmap{\glsentrysymbol}{\Glsentrysymbol} +\glsmfuexcl{\Glsentrysymbol} \newcommand*{\glsentrysymbolplural}[1]{% \@gls@entry@field{#1}{symbolplural}% } \newcommand*{\Glsentrysymbolplural}[1]{% \@Glsentryfield{#1}{symbolplural}% } -\glsmfuaddmap{\glsentrysymbolplural}{\Glsentrysymbolplural} +\glsmfuexcl{\Glsentrysymbolplural} \newcommand*{\glsentryfirst}[1]{% \@gls@entry@field{#1}{first}% } \newcommand*{\Glsentryfirst}[1]{% \@Glsentryfield{#1}{first}% } -\glsmfuaddmap{\glsentryfirst}{\Glsentryfirst} +\glsmfuexcl{\Glsentryfirst} \newcommand*{\glsentryfirstplural}[1]{% \@gls@entry@field{#1}{firstpl}% } \newcommand*{\Glsentryfirstplural}[1]{% \@Glsentryfield{#1}{firstpl}% } -\glsmfuaddmap{\glsentryfirstplural}{\Glsentryfirstplural} +\glsmfuexcl{\Glsentryfirstplural} \newcommand{\glscapitalisewords}[1]{% \capitalisewords{#1}% } @@ -4883,76 +4928,76 @@ removed. Rollback required or use a newer alternative} \newcommand*{\Glsentryuseri}[1]{% \@Glsentryfield{#1}{useri}% } -\glsmfuaddmap{\glsentryuseri}{\Glsentryuseri} +\glsmfuexcl{\Glsentryuseri} \newcommand*{\glsentryuserii}[1]{% \@gls@entry@field{#1}{userii}% } \newcommand*{\Glsentryuserii}[1]{% \@Glsentryfield{#1}{userii}% } -\glsmfuaddmap{\glsentryuserii}{\Glsentryuserii} +\glsmfuexcl{\Glsentryuserii} \newcommand*{\glsentryuseriii}[1]{% \@gls@entry@field{#1}{useriii}% } \newcommand*{\Glsentryuseriii}[1]{% \@Glsentryfield{#1}{useriii}% } -\glsmfuaddmap{\glsentryuseriii}{\Glsentryuseriii} +\glsmfuexcl{\Glsentryuseriii} \newcommand*{\glsentryuseriv}[1]{% \@gls@entry@field{#1}{useriv}% } \newcommand*{\Glsentryuseriv}[1]{% \@Glsentryfield{#1}{useriv}% } -\glsmfuaddmap{\glsentryuseriv}{\Glsentryuseriv} +\glsmfuexcl{\Glsentryuseriv} \newcommand*{\glsentryuserv}[1]{% \@gls@entry@field{#1}{userv}% } \newcommand*{\Glsentryuserv}[1]{% \@Glsentryfield{#1}{userv}% } -\glsmfuaddmap{\glsentryuserv}{\Glsentryuserv} +\glsmfuexcl{\Glsentryuserv} \newcommand*{\glsentryuservi}[1]{% \@gls@entry@field{#1}{uservi}% } \newcommand*{\Glsentryuservi}[1]{% \@Glsentryfield{#1}{uservi}% } -\glsmfuaddmap{\glsentryuservi}{\Glsentryuservi} +\glsmfuexcl{\Glsentryuservi} \newcommand*{\glsentryshort}[1]{\@gls@entry@field{#1}{short}} \newcommand*{\Glsentryshort}[1]{% \@Glsentryfield{#1}{short}% } -\glsmfuaddmap{\glsentryshort}{\Glsentryshort} +\glsmfuexcl{\Glsentryshort} \newcommand*{\glsentryshortpl}[1]{\@gls@entry@field{#1}{shortpl}} \newcommand*{\Glsentryshortpl}[1]{% \@Glsentryfield{#1}{shortpl}% } -\glsmfuaddmap{\glsentryshortpl}{\Glsentryshortpl} +\glsmfuexcl{\Glsentryshortpl} \newcommand*{\glsentrylong}[1]{\@gls@entry@field{#1}{long}} \newcommand*{\Glsentrylong}[1]{% \@Glsentryfield{#1}{long}% } -\glsmfuaddmap{\glsentrylong}{\Glsentrylong} +\glsmfuexcl{\Glsentrylong} \newcommand*{\glsentrylongpl}[1]{\@gls@entry@field{#1}{longpl}} \newcommand*{\Glsentrylongpl}[1]{% \@Glsentryfield{#1}{longpl}% } -\glsmfuaddmap{\glsentrylongpl}{\Glsentrylongpl} +\glsmfuexcl{\Glsentrylongpl} \newcommand*{\glsentryfull}[1]{% \glsentrylong{#1} (\glsentryshort{#1})% } \newcommand*{\Glsentryfull}[1]{% \Glsentrylong{#1} (\glsentryshort{#1})% } -\glsmfuaddmap{\glsentryfull}{\Glsentryfull} +\glsmfuexcl{\Glsentryfull} \newcommand*{\glsentryfullpl}[1]{% \acrfullformat{\glsentrylongpl{#1}}{\acronymfont{\glsentryshortpl{#1}}}% } \newcommand*{\Glsentryfullpl}[1]{% \Glsentrylongpl{#1} (\glsentryshortpl{#1})% } -\glsmfuaddmap{\glsentryfullpl}{\Glsentryfullpl} +\glsmfuexcl{\Glsentryfullpl} \newcommand*{\glsentrynumberlist}[1]{% \glsdoifexists{#1}% {% @@ -6204,7 +6249,7 @@ you }% \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% \let\@org@glossaryentrynumbers\glossaryentrynumbers - \bgroup + \gls@printglossary@begin \@printgloss@setsort \setkeys{printgloss}{#1}% \@printgloss@checkexists{\@glo@type}% @@ -6234,10 +6279,14 @@ you \@gls@preglossaryhook #2% }% - \egroup + \gls@printglossary@end \global\let\glossaryentrynumbers\@org@glossaryentrynumbers \global\let\warn@noprintglossary\relax } +\newcommand{\gls@printglossary@begin}{\begingroup} +\newcommand{\gls@printglossary@end}{% + \expandafter\endgroup\if@endpe\@doendpe\fi +} \newcommand{\@print@glossary}{% \makeatletter \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% |