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 | 333 |
1 files changed, 251 insertions, 82 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty index f1ced1aab7a..0fc58a04229 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 2020 Nicola Talbot +%% Copyright 2021 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbolnames.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childmultipar.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-longchild.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbolnames.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, glossaries-2020-03-19.sty, glossaries.perl. %% %% \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,9 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2020/03/19 v4.46 (NLCT)] +\DeclareRelease{v4.46}{2020-03-19}{glossaries-2020-03-19.sty} +\DeclareCurrentRelease{v4.47}{2021-09-20} +\ProvidesPackage{glossaries}[2021/09/20 v4.47 (NLCT)] \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} @@ -369,13 +371,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% \expandafter\gdef\csname glo@##2@sort\endcsname{}% }% \def\@gls@setsort##1{% - \edef\@glo@parent{\csname glo@##1@parent\endcsname}% + \protected@edef\@glo@parent{\csname glo@##1@parent\endcsname}% \ifx\@glo@parent\@empty \else \expandafter\@gls@setsort\expandafter{\@glo@parent}% \fi - \edef\@glo@type{\csname glo@##1@type\endcsname}% - \edef\@gls@tmp{\csname glo@##1@sort\endcsname}% + \protected@edef\@glo@type{\csname glo@##1@type\endcsname}% + \protected@edef\@gls@tmp{\csname glo@##1@sort\endcsname}% \ifx\@gls@tmp\@empty \expandafter\global\expandafter \advance\csname glossary@\@glo@type @sortcount\endcsname by 1\relax @@ -462,7 +464,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}% } \newcommand{\glsIfListOfAcronyms}[1]{% - \edef\@do@gls@islistofacronyms{% + \protected@edef\@do@gls@islistofacronyms{% \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}% \@do@gls@islistofacronyms } @@ -905,11 +907,34 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\@@do@write@glslabels}{% \newwrite\@gls@labelsfile \immediate\openout\@gls@labelsfile=\jobname.glslabels - \forallglsentries[\@glo@types,\@ignored@glossaries]{\@glsentry}% - {\ifdefempty{\@glsentry}{}{\immediate\write\@gls@labelsfile{\@glsentry}}}% + \protected@edef\@gls@fulllist{\@glo@types}% + \ifdefempty{\@ignored@glossaries}{}% + {\protected@eappto\@gls@fulllist{,\@ignored@glossaries}}% + \forallglsentries[\@gls@fulllist]{\@glsentry}% + {% + \ifdefempty{\@glsentry}{}% + {% + \ifx\do@write@glslabelsname\@gobble + \def\@gls@thisentryname{}% + \else + \letcs{\@gls@thisentryname}{glo@\glsdetoklabel{\@glsentry}@name}% + \@onelevel@sanitize\@gls@thisentryname + \fi + \immediate\write\@gls@labelsfile + {\@glsentry\do@write@glslabelsname{\@gls@thisentryname}}% + }% + }% \immediate\closeout\@gls@labelsfile } -\@gls@declareoption{writeglslabels}{\@do@write@glslabels} +\newcommand*{\do@write@glslabelsname}[1]{} +\begingroup +\catcode`\^^I12 +\gdef\@write@glslabelsname#1{^^I#1} +\endgroup +\@gls@declareoption{writeglslabels}{\@do@write@glslabels + \let\do@write@glslabelsname\@gobble} +\@gls@declareoption{writeglslabelnames}{\@do@write@glslabels + \let\do@write@glslabelsname\@write@glslabelsname} \newif\ifglsautomake \newcommand{\gls@automake@nr}{1} \define@choicekey{glossaries.sty}{automake}% @@ -1521,10 +1546,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \protected@edef\@gls@roman{\@roman{0\string" \string"roman-numbers-lowercase\string" :sep \string"}}% \@onelevel@sanitize\@gls@roman - \edef\@tmp{\string" \string"roman-numbers-lowercase\string" + \edef\@gls@tmp{\string" \string"roman-numbers-lowercase\string" :sep \string"}% - \@onelevel@sanitize\@tmp - \ifx\@tmp\@gls@roman + \@onelevel@sanitize\@gls@tmp + \ifx\@gls@tmp\@gls@roman \expandafter \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{% \string"roman-numbers-lowercase\string"% @@ -1696,7 +1721,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@for#1:=\@glsacronymlists\do{\ifx#1\@empty\else#2\fi}% } \newcommand*{\forglsentries}[3][\glsdefaulttype]{% - \edef\@@glo@list{\csname glolist@#1\endcsname}% + \protected@edef\@@glo@list{\csname glolist@#1\endcsname}% \@for#2:=\@@glo@list\do {% \ifdefempty{#2}{}{#3}% @@ -1761,7 +1786,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsdoifexists{#1}% {% \def\do@glshaschildren{#3}% - \edef\@gls@thislabel{\glsdetoklabel{#1}}% + \protected@edef\@gls@thislabel{\glsdetoklabel{#1}}% \expandafter\forglsentries\expandafter [\csname glo@\@gls@thislabel @type\endcsname] {\glo@label}% @@ -1907,7 +1932,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% \gdef\glsdefaulttype{#2}% }{}% - \toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}% + \toks@{#2}\protected@edef\@glo@types{\@glo@types\the\toks@,}% \expandafter\gdef\csname glolist@#2\endcsname{,}% \expandafter\edef\csname @glotype@#2@log\endcsname{#1}% \expandafter\edef\csname @glotype@#2@in\endcsname{#3}% @@ -1954,10 +1979,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\newignoredglossary}[1]{% \ifdefempty\@ignored@glossaries {% - \edef\@ignored@glossaries{#1}% + \protected@edef\@ignored@glossaries{#1}% }% {% - \eappto\@ignored@glossaries{,#1}% + \protected@eappto\@ignored@glossaries{,#1}% }% \csgdef{glolist@#1}{,}% \ifcsundef{gls@#1@entryfmt}% @@ -1970,12 +1995,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \renewcommand*{\@gls@nohyperlist}{#1}% }% {% - \eappto\@gls@nohyperlist{,#1}% + \protected@eappto\@gls@nohyperlist{,#1}% }% } \newcommand*{\@ignored@glossaries}{} \newcommand*{\ifignoredglossary}[3]{% - \edef\@gls@igtype{#1}% + \protected@edef\@gls@igtype{#1}% \expandafter\DTLifinlist\expandafter {\@gls@igtype}{\@ignored@glossaries}{#2}{#3}% } @@ -2039,7 +2064,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@gls@see@noindex } \newcommand*{\gls@checkseeallowed@preambleonly}{% - \GlossariesWarning{glossaries}% + \GlossariesWarning {`\gls@xr@key' key doesn't have any effect when used in the document environment. Move the definition to the preamble after \string\makeglossaries\space @@ -2216,7 +2241,6 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% } \newcommand*{\gls@defdocnewglossaryentry}{% - \let\gls@checkseeallowed\gls@checkseeallowed@preambleonly \let\newglossaryentry\new@glossaryentry } \newrobustcmd{\provideglossaryentry}[2]{% @@ -2227,6 +2251,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% } \@onlypreamble{\provideglossaryentry} +\newcommand*{\gls@glsdefs@labellist}{} +\newcommand*{\gls@glsdefs@addlabel}[1]{\listxadd{\gls@glsdefs@labellist}{#1}} +\newcommand*{\gls@docdef@labellist}{} +\newcommand*{\gls@docdef@addlabel}[1]{\listxadd{\gls@docdef@labellist}{#1}} \newrobustcmd{\new@glossaryentry}[2]{% \ifundef\@gls@deffile {% @@ -2234,11 +2262,33 @@ false,nolabel,autolabel,nameref}[nolabel]{% \immediate\openout\@gls@deffile=\jobname.glsdefs }% {}% - \ifglsentryexists{#1}{}% + \ifglsentryexists{#1}% + {% + \xifinlist{#1}{\gls@docdef@labellist}% + {% + \GlossariesWarning{Entry `#1' has already been defined in the + document environment (ignoring new definition)}% + }% + {% + \xifinlist{#1}{\gls@glsdefs@labellist}% + {% + \gls@defglossaryentry{#1}{#2}% + \gls@docdef@addlabel{#1}% + \@gls@writedef{#1}% + }% + {% + \GlossariesWarning{Entry `#1' has already been defined in + the preamble (in which case remove the duplicate definition) + or you have just updated to glossaries.sty + v4.47 (in which case delete `\jobname.glsdefs')}% + }% + }% + }% {% \gls@defglossaryentry{#1}{#2}% + \gls@docdef@addlabel{#1}% + \@gls@writedef{#1}% }% - \@gls@writedef{#1}% } \AtBeginDocument{\gls@begindocdefs} \AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} @@ -2251,13 +2301,21 @@ false,nolabel,autolabel,nameref}[nolabel]{% \undef\@gls@restoreat \gls@defdocnewglossaryentry } +\newcommand*{\glsdefs@newdocentry}[2]{% + \ifglsentryexists{#1}% + {\GlossariesWarning{entry `#1' has already been defined in the preamble + (if you have moved the definition there from the document + environment, delete \jobname.glsdefs)}}% + {% + \gls@glsdefs@addlabel{#1}% + \gls@defglossaryentry{#1}{#2}% + }% +} \newcommand*{\@gls@writedef}[1]{% \immediate\write\@gls@deffile {% - \string\ifglsentryexists{#1}{}\glspercentchar^^J% - \expandafter\@gobble\string\{\glspercentchar^^J% - \string\gls@defglossaryentry{\glsdetoklabel{#1}}\glspercentchar^^J% - \expandafter\@gobble\string\{\glspercentchar% + \string\glsdefs@newdocentry{\glsdetoklabel{#1}}\glspercentchar^^J% + \expandafter\@gobble\string\{\glspercentchar% }% \@for\@gls@map:=\@gls@keymap\do {% @@ -2277,9 +2335,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glswritedefhook \immediate\write\@gls@deffile {% - \glspercentchar^^J% - \expandafter\@gobble\string\}\glspercentchar^^J% - \expandafter\@gobble\string\}\glspercentchar% + \glspercentchar^^J% + \expandafter\@gobble\string\}\glspercentchar^^J% }% } \newcommand*{\@gls@keymap}{% @@ -2436,7 +2493,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\glsfieldxdef}[3]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \protected@csxdef{glo@\@glo@label @#2}{#3}% @@ -2449,7 +2506,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\glsfieldedef}[3]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \protected@csedef{glo@\@glo@label @#2}{#3}% @@ -2462,7 +2519,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\glsfieldgdef}[3]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \expandafter\gdef\csname glo@\@glo@label @#2\endcsname{#3}% @@ -2475,7 +2532,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\glsfielddef}[3]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \expandafter\def\csname glo@\@glo@label @#2\endcsname{#3}% @@ -2488,7 +2545,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\glsfieldfetch}[3]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \letcs#3{glo@\@glo@label @#2}% @@ -2501,7 +2558,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\ifglsfieldeq}[5]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \ifcsstring{glo@\@glo@label @#2}{#3}{#4}{#5}% @@ -2514,7 +2571,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\ifglsfielddefeq}[5]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \expandafter\ifdefstrequal @@ -2528,7 +2585,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\ifglsfieldcseq}[5]{% \glsdoifexists{#1}% {% - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \ifcsdef{glo@\@glo@label @#2}% {% \ifcsstrequal{glo@\@glo@label @#2}{#3}{#4}{#5}% @@ -2568,7 +2625,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@onlypreamble{\longprovideglossaryentry} \newcommand{\gls@defglossaryentry}[2]{% \let\GlsSetQuote\gls@nosetquote - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \let\glslabel\@glo@label \let\@glo@name\@glsnoname \let\@glo@desc\@glsnodesc @@ -2607,7 +2664,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% {}% \gls@assign@field{\glsdefaulttype}{\@glo@label}{type}{\@glo@type}% - \edef\@glo@type{\glsentrytype{\@glo@label}}% + \protected@edef\@glo@type{\glsentrytype{\@glo@label}}% \ifcsundef{glolist@\@glo@type}% {% \PackageError{glossaries}% @@ -2625,7 +2682,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% }% \protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}% - \expandafter\xdef\csname glolist@\@glo@type\endcsname{% + \expandafter\protected@xdef\csname glolist@\@glo@type\endcsname{% \@glolist@{\@glo@label},}% }% \gls@level=0\relax @@ -2641,7 +2698,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% {% \ifglsentryexists{\@glo@parent}% {% - \expandafter\xdef\csname glo@\@glo@label @parent\endcsname{% + \expandafter\protected@xdef\csname glo@\@glo@label @parent\endcsname{% \@glo@parent}% \gls@level=\csname glo@\@glo@parent @level\endcsname\relax \advance\gls@level by 1\relax @@ -2736,12 +2793,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \gls@assign@field\expandafter {\csname glo@\@glo@label @symbol\endcsname} {\@glo@label}{symbolplural}{\@glo@symbolplural}% - \expandafter\xdef\csname glo@\@glo@label @flagfalse\endcsname{% + \expandafter\protected@xdef\csname glo@\@glo@label @flagfalse\endcsname{% \noexpand\global \noexpand\let\expandafter\noexpand \csname ifglo@\@glo@label @flag\endcsname\noexpand\iffalse }% - \expandafter\xdef\csname glo@\@glo@label @flagtrue\endcsname{% + \expandafter\protected@xdef\csname glo@\@glo@label @flagtrue\endcsname{% \noexpand\global \noexpand\let\expandafter\noexpand \csname ifglo@\@glo@label @flag\endcsname\noexpand\iftrue @@ -2773,13 +2830,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\@newglossaryentryposthook}{} \newcommand*{\@newglossaryentry@defcounters}{} \newcommand*{\glsmoveentry}[2]{% - \edef\@glo@thislabel{\glsdetoklabel{#1}}% - \edef\glo@type{\csname glo@\@glo@thislabel @type\endcsname}% + \protected@edef\@glo@thislabel{\glsdetoklabel{#1}}% + \protected@edef\glo@type{\csname glo@\@glo@thislabel @type\endcsname}% \def\glo@list{,}% \forglsentries[\glo@type]{\glo@label}% {% \ifdefequal\@glo@thislabel\glo@label - {}{\eappto\glo@list{\glo@label,}}% + {}{\protected@eappto\glo@list{\glo@label,}}% }% \cslet{glolist@\glo@type}{\glo@list}% \csdef{glo@\@glo@thislabel @type}{#2}% @@ -2797,12 +2854,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \string\subglossentry} \fi \newcommand{\@glo@storeentry}[1]{% - \edef\@glo@esclabel{#1}% + \protected@edef\@glo@esclabel{#1}% \@gls@checkmkidxchars\@glo@esclabel \protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% \@gls@checkmkidxchars\@glo@sort \@gls@checkmkidxchars\@glo@prefix - \edef\@glo@parent{\csname glo@#1@parent\endcsname}% + \protected@edef\@glo@parent{\csname glo@#1@parent\endcsname}% \ifglsxindy \ifx\@glo@parent\@empty \expandafter\protected@xdef\csname glo@#1@index\endcsname{% @@ -3508,12 +3565,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\@gls@setdefault@glslink@opts}{} \def\@gls@link[#1]#2#3{% \leavevmode - \edef\glslabel{\glsdetoklabel{#2}}% + \protected@edef\glslabel{\glsdetoklabel{#2}}% \def\@gls@link@opts{#1}% \let\@gls@link@label\glslabel \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% - \edef\glstype{\csname glo@\glslabel @type\endcsname}% + \protected@edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}% + \protected@edef\glstype{\csname glo@\glslabel @type\endcsname}% \let\org@ifKV@glslink@hyper\ifKV@glslink@hyper \@gls@setdefault@glslink@opts \do@glsdisablehyperinlist @@ -3653,6 +3710,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% \def\@gls@checkedmkidx{}% \expandafter\@gls@checklevel#1\@nil!!\null \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkesclevel#1\@nil\!\!\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \edef\@do@gls@checkesc{% + \noexpand\@gls@checkesc\expandonce{#1}\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null + }% + \@do@gls@checkesc + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% \fi } \def\@gls@updatechecked#1\@nil#2{\def#2{#1}} @@ -3845,6 +3912,33 @@ false,nolabel,autolabel,nameref}[nolabel]{% \fi \@@gls@checkactual } +\bgroup +\catcode`\|0\relax +\catcode`\\12\relax +|gdef|@gls@checkesc#1\#2\#3|null{% + |@gls@tmpb=|expandafter{|@gls@checkedmkidx}% + |toks@={#1}% + |ifx|null#2|null + |ifx|null#3|null + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@}% + |def|@@gls@checkesc{|relax}% + |else + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@ + |@gls@quotechar|@backslashchar|@gls@quotechar|@backslashchar}% + |def|@@gls@checkesc{|@gls@checkesc#3|null}% + |fi + |else + |edef|@gls@checkedmkidx{|the|@gls@tmpb|the|toks@ + |@gls@quotechar|@backslashchar}% + |ifx|null#3|null + |def|@@gls@checkesc{|@gls@checkesc#2\\|null}% + |else + |def|@@gls@checkesc{|@gls@checkesc#2\#3|null}% + |fi + |fi + |@@gls@checkesc +} +|egroup \def\@gls@xdycheckquote#1"#2"#3\null{% \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% \toks@={#1}% @@ -4817,7 +4911,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsdoifexists{#1}% {% \bgroup - \edef\@glo@label{\glsdetoklabel{#1}}% + \protected@edef\@glo@label{\glsdetoklabel{#1}}% \let\@org@glsnumberformat\glsnumberformat \def\glsnumberformat##1{##1}% \protected@edef\the@numberlist{% @@ -4860,7 +4954,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsdoifexists{#2}% {% \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \protected@edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% \setkeys{glossadd}{#1}% \@gls@saveentrycounter \@gls@setsort{#2}% @@ -4870,7 +4964,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\@gls@adjustmode}{} \AtBeginDocument{\renewcommand*{\@gls@adjustmode}{\ifvmode\mbox{}\fi}} \newrobustcmd*{\glsaddall}[1][]{% - \edef\@glo@type{\@glo@types}% + \protected@edef\@glo@type{\@glo@types}% \setkeys{glossadd}{#1}% \forallglsentries[\@glo@type]{\@glo@entry}{% \glsadd[#1]{\@glo@entry}% @@ -5236,6 +5330,16 @@ false,nolabel,autolabel,nameref}[nolabel]{% \noexpand!\noexpand!\noexpand\null \noexpand\expandafter\noexpand\@gls@updatechecked \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkesclevel####1\noexpand\@nil + \noexpand\!\noexpand\!\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% + \noexpand\def\noexpand\@gls@checkedmkidx{}% + \noexpand\expandafter\noexpand\@gls@checkesc####1\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null + \noexpand\expandafter\noexpand\@gls@updatechecked + \noexpand\@gls@checkedmkidx{####1}% }% }% \@gls@docheckquotedef @@ -5463,19 +5567,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@disable@onlypremakeg \let\gls@checkseeallowed\relax \let\warn@nomakeglossaries\relax - \def\warn@noprintglossary{% - \ifdefstring{\@glo@types}{,}% - {% - \GlossariesWarningNoLine{No glossaries have been defined}% - }% - {% - \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@noprintglossary\@makeglossaries@warn@noprintglossary \ifglssavenumberlist \edef\@gls@dodeflistparser{\noexpand\DeclareListParser {\noexpand\glsnumlistparser}{\delimN}}% @@ -5497,6 +5589,19 @@ false,nolabel,autolabel,nameref}[nolabel]{% }% } \@onlypreamble{\makeglossaries} +\newcommand\@makeglossaries@warn@noprintglossary{% + \ifdefstring{\@glo@types}{,}% + {% + \GlossariesWarningNoLine{No glossaries have been defined}% + }% + {% + \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}% + }% +}% \AtEndDocument{% \warn@nomakeglossaries \warn@noprintglossary @@ -5516,7 +5621,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \let\@gls@getgrouptitle\@gls@noidx@getgrouptitle \let\gls@checkseeallowed\relax \renewcommand{\@do@seeglossary}[2]{% - \edef\@gls@label{\glsdetoklabel{##1}}% + \protected@edef\@gls@label{\glsdetoklabel{##1}}% \protected@write\@auxout{}{% \string\@gls@reference {\csname glo@\@gls@label @type\endcsname}% @@ -5736,9 +5841,9 @@ you \newcommand*{\gls@romanpage}{\romannumeral\c@page} \newcommand*{\gls@Romanpage}{\@Roman\c@page} \newcommand*{\glsaddprotectedpagefmt}[1]{% - \eappto\gls@protected@pagefmts{,\expandonce{\csname gls#1page\endcsname}}% + \protected@eappto\gls@protected@pagefmts{,\expandonce{\csname gls#1page\endcsname}}% \csedef{gls#1page}{\expandonce{\csname#1\endcsname}\noexpand\c@page}% - \eappto\@wrglossarynumberhook{% + \protected@eappto\@wrglossarynumberhook{% \noexpand\let\expandonce{\csname org@gls#1\endcsname}% \expandonce{\csname#1\endcsname}% \noexpand\def\expandonce{\csname#1\endcsname}{% @@ -5770,7 +5875,7 @@ you }% \@do@gls@getcounterprefix \fi - \edef\@gls@label{\glsdetoklabel{#1}}% + \protected@edef\@gls@label{\glsdetoklabel{#1}}% \@@do@@wrglossary } \newif\ifglswrallowprimitivemods @@ -5817,7 +5922,7 @@ you }% \@do@gls@getcounterprefix \fi - \edef\@gls@label{\glsdetoklabel{#1}}% + \protected@edef\@gls@label{\glsdetoklabel{#1}}% \@@do@@wrglossary } \newcommand*{\@@do@@wrglossary}{% @@ -5924,7 +6029,7 @@ you \newcommand*{\gls@save@numberlist}[1]{% \ifglssavenumberlist \toks@{#1}% - \edef\@do@writeaux@info{% + \protected@edef\@do@writeaux@info{% \noexpand\csgdef{glo@\glscurrententrylabel @numberlist}{\the\toks@}% }% \@onelevel@sanitize\@do@writeaux@info @@ -6005,11 +6110,11 @@ you \let\gls@org@glossaryentryfield\glossentry \let\gls@org@glossarysubentryfield\subglossentry \renewcommand{\glossentry}[1]{% - \xdef\glscurrententrylabel{\glsdetoklabel{##1}}% + \protected@xdef\glscurrententrylabel{\glsdetoklabel{##1}}% \gls@org@glossaryentryfield{##1}% }% \renewcommand{\subglossentry}[2]{% - \xdef\glscurrententrylabel{\glsdetoklabel{##2}}% + \protected@xdef\glscurrententrylabel{\glsdetoklabel{##2}}% \gls@org@glossarysubentryfield{##1}{##2}% }% \@gls@preglossaryhook @@ -6068,7 +6173,7 @@ you \glosortentrieswarning \def\@glo@sortinglist{}% \def\@glo@sortinghandler{#1}% - \edef\@glo@type{#2}% + \protected@edef\@glo@type{#2}% \forlistcsloop{\@glo@do@sortentries}{@glsref@#2}% \csdef{@glsref@#2}{}% \@for\@this@label:=\@glo@sortinglist\do{% @@ -6106,7 +6211,7 @@ you \newcommand*{\@glo@do@sortentries}[1]{% \ifglshasparent{#1}% {% - \edef\@glo@parent{\csuse{glo@\glsdetoklabel{#1}@parent}}% + \protected@edef\@glo@parent{\csuse{glo@\glsdetoklabel{#1}@parent}}% \ifcsundef{@glo@sortingchildren@\@glo@parent}% {% \csdef{@glo@sortingchildren@\@glo@parent}{}% @@ -6497,7 +6602,7 @@ you } \newcommand*{\glsstepsubentry}[1]{% \ifglssubentrycounter - \edef\currentglssubentry{\glsdetoklabel{#1}}% + \protected@edef\currentglssubentry{\glsdetoklabel{#1}}% \refstepcounter{glossarysubentry}% \label{\GlsEntryCounterLabelPrefix\currentglssubentry}% \fi @@ -6759,8 +6864,8 @@ you \def\@gls@removespaces#1 #2\@nil{% \toks@=\expandafter{\the\toks@#1}% \ifx\\#2\\% - \edef\x{\the\toks@}% - \ifx\x\empty + \edef\@gls@x{\the\toks@}% + \ifx\@gls@x\empty \else \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}% {\the\toks@}% @@ -7438,7 +7543,25 @@ you \let\gls@assign@firstpl\@org@gls@assign@firstpl \let\gls@assign@plural\@org@gls@assign@plural \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \@@gls@noexpand@assign@default@plurals +} +\newcommand*{\@@gls@noexpand@assign@default@plurals}{% + \expandafter\ifx\csname glo@\the\glslabeltok @plural\endcsname\@@gls@@default@acr@plural + \csxdef{glo@\the\glslabeltok @plural}{\expandonce\@glo@shortpl}% + \fi + \expandafter\ifx\csname glo@\the\glslabeltok @firstpl\endcsname\@@gls@@default@acr@firstplural + \csxdef{glo@\the\glslabeltok @firstpl}{% + \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)}% + \fi + \expandafter\ifx\csname glo@\the\glslabeltok @descplural\endcsname\@@gls@@default@acr@descplural + \csxdef{glo@\the\glslabeltok @descplural}{\expandonce\@glo@longpl}% + \fi } +\newcommand*{\@@gls@@default@acr@plural}{\expandonce\@glo@shortpl} +\newcommand*{\@@gls@@default@acr@firstplural}{% + \expandonce\@glo@longpl\glsspace(\expandonce\@glo@shortpl)% +} +\newcommand*{\@@gls@@default@acr@descplural}{\expandonce\@glo@longpl} \newcommand*{\SetDefaultAcronymStyle}{% \@for\@gls@type:=\@glsacronymlists\do{% \SetDefaultAcronymDisplayStyle{\@gls@type}% @@ -7529,6 +7652,18 @@ you \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } \newcommand*{\SetDescriptionFootnoteAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{footnote,smallcaps,description}% + {footnote-sc-desc}{short-sc-footnote-desc}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{footnote,smaller,description}% + {footnote-sm-desc}{short-sm-footnote-desc}% + \else + \@gls@deprecated@acr@warning{footnote,description}% + {footnote-desc}{short-footnote-desc}% + \fi + \fi \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -7609,6 +7744,7 @@ you can't both be set}{}% \fi \fi + \@gls@deprecated@acr@warning{dua,description}{dua-desc}{long-noshort-desc}% \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -7698,6 +7834,18 @@ you \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } \newcommand*{\SetDescriptionAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{smallcaps,description}% + {long-sc-short-desc}{long-short-sc-desc}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{smaller,description}% + {long-sm-short-desc}{long-short-sm-desc}% + \else + \@gls@deprecated@acr@warning{description}% + {long-short-desc}{long-short-desc}% + \fi + \fi \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -7790,6 +7938,15 @@ you \let\gls@assign@descplural\@org@gls@assign@descplural } \newcommand*{\SetFootnoteAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{footnote,smallcaps}{footnote-sc}{short-sc-footnote}% + \else + \ifglsacrsmaller + \@gls@deprecated@acr@warning{footnote,smaller}{footnote-sm}{short-sm-footnote}% + \else + \@gls@deprecated@acr@warning{footnote}{footnote}{short-footnote}% + \fi + \fi \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -7909,6 +8066,11 @@ you \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } \newcommand*{\SetSmallAcronymStyle}{% + \ifglsacrsmallcaps + \@gls@deprecated@acr@warning{smallcaps}{long-sc-short}{long-short-sc}% + \else + \@gls@deprecated@acr@warning{smaller}{long-sm-short}{long-short-sm}% + \fi \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -7989,6 +8151,7 @@ you \let\gls@assign@descplural\@org@gls@assign@descplural } \newcommand*{\SetDUAStyle}{% + \@gls@deprecated@acr@warning{dua}{dua}{long-noshort}% \renewcommand{\newacronym}[4][]{% \ifx\@glsacronymlists\@empty \def\@glo@type{\acronymtype}% @@ -8007,6 +8170,12 @@ you \SetDUADisplayStyle{\@gls@type}% }% } +\newcommand*{\@gls@deprecated@acr@warning}[3]{% + \GlossariesWarning{Acronym style option #1 deprecated. + Use \string\setacronymstyle{#2} with just glossaries.sty or + use \string\setabbreviationstyle[acronym]{#3} with + glossaries-extra.sty}% +} \newcommand*{\SetAcronymStyle}{% \SetDefaultAcronymStyle \ifglsacrdescription |