diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty | 315 |
1 files changed, 287 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty index 10001a2fc31..f8f73786126 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2016/06/18 v1.06 (NLCT)] +\ProvidesPackage{glossaries-extra}[2016/08/15 v1.07 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{etoolbox} \@ifpackageloaded{glossaries} @@ -743,11 +743,13 @@ \renewcommand{\@gls@field@link}[4][]{% \glsdoifexists{#3}% {% + \let\glsxtrorg@ifKV@glslink@hyper\ifKV@glslink@hyper \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper \def\glscustomtext{#4}% \@glsxtr@field@linkdefs #1% \@gls@link[#2]{#3}{#4}% + \let\ifKV@glslink@hyper\glsxtrorg@ifKV@glslink@hyper }% \glspostlinkhook } @@ -785,16 +787,23 @@ \@gls@field@link[\let\glscapscase\@secondofthree]{#1}{#2}% {\@gls@field@font{\Glsaccesstext{#2}#3}}% } +\newcommand*{\glsxtrchecknohyperfirst}[1]{% + \glsifattribute{#1}{nohyperfirst}{true}{\KV@glslink@hyperfalse}{}% +} \def\@glsfirst@#1#2[#3]{% \glsxtrassignfieldfont{#2}% - \@gls@field@link[\let\glsxtrifwasfirstuse\@firstoftwo]{#1}{#2}% - {\@gls@field@font{\glsaccessfirst{#2}#3}}% + \@gls@field@link + [\let\glsxtrifwasfirstuse\@firstoftwo + \glsxtrchecknohyperfirst{#2}% + ]{#1}{#2}% + {\@gls@field@font{\glsaccessfirst{#2}#3}}% } \def\@Glsfirst@#1#2[#3]{% \glsxtrassignfieldfont{#2}% \@gls@field@link [\let\glsxtrifwasfirstuse\@firstoftwo \let\glscapscase\@secondofthree + \glsxtrchecknohyperfirst{#2}% ]% {#1}{#2}{\@gls@field@font{\Glsaccessfirst{#2}#3}}% } @@ -803,6 +812,7 @@ \@gls@field@link [\let\glsxtrifwasfirstuse\@firstoftwo \let\glscapscase\@thirdofthree + \glsxtrchecknohyperfirst{#2}% ]% {#1}{#2}{\@gls@field@font{\GLSaccessfirst{#2}\mfirstucMakeUppercase{#3}}}% } @@ -832,6 +842,7 @@ \@gls@field@link [\let\glsxtrifwasfirstuse\@firstoftwo \let\glsifplural\@firstoftwo + \glsxtrchecknohyperfirst{#2}% ]% {#1}{#2}{\@gls@field@font{\glsaccessfirstplural{#2}#3}}% } @@ -841,6 +852,7 @@ [\let\glsxtrifwasfirstuse\@firstoftwo \let\glsifplural\@firstoftwo \let\glscapscase\@secondofthree + \glsxtrchecknohyperfirst{#2}% ]% {#1}{#2}{\@gls@field@font{\Glsaccessfirstplural{#2}#3}}% } @@ -850,6 +862,7 @@ [\let\glsxtrifwasfirstuse\@firstoftwo \let\glsifplural\@firstoftwo \let\glscapscase\@thirdofthree + \glsxtrchecknohyperfirst{#2}% ]% {#1}{#2}% {\@gls@field@font{\GLSaccessfirstplural{#2}\mfirstucMakeUppercase{#3}}}% @@ -1488,6 +1501,225 @@ \def\@Glsxtr@p@acrlongpl@#1#2[#3]{{\Glsentrylongpl{#2}#3}} \def\@GLSxtr@p@acrlongpl@#1#2[#3]{% {\mfirstucMakeUppercase{\glsentrylongpl{#2}#3}}} +\newcommand*{\@glsxtrp@opt}{hyper=false,noindex} +\newcommand*{\glsxtrsetpopts}[1]{% + \renewcommand*{\@glsxtrp@opt}{#1}% +} +\newcommand*{\glossxtrsetpopts}{% + \glsxtrsetpopts{noindex}% +} +\newrobustcmd*{\@@glsxtrp}[2]{% + {% + \let\glspostlinkhook\relax + \csname#1\expandafter\endcsname\expandafter[\@glsxtrp@opt]{#2}[]% + }% +} +\newrobustcmd*{\@glsxtrp}[2]{% + \ifcsdef{gls#1}% + {% + \@@glsxtrp{gls#1}{#2}% + }% + {% + \ifcsdef{glsxtr#1}% + {% + \@@glsxtrp{glsxtr#1}{#2}% + }% + {% + \PackageError{glossaries-extra}{`#1' not recognised by + \string\glsxtrp}{}% + }% + }% +} +\newrobustcmd*{\@Glsxtrp}[2]{% + \ifcsdef{Gls#1}% + {% + \@@glsxtrp{Gls#1}{#2}% + }% + {% + \ifcsdef{Glsxtr#1}% + {% + \@@glsxtrp{Glsxtr#1}{#2}% + }% + {% + \PackageError{glossaries-extra}{`#1' not recognised by + \string\Glsxtrp}{}% + }% + }% +} +\newrobustcmd*{\@GLSxtrp}[2]{% + \ifcsdef{GLS#1}% + {% + \@@glsxtrp{GLS#1}{#2}% + }% + {% + \ifcsdef{GLSxtr#1}% + {% + \@@glsxtrp{GLSxtr#1}{#2}% + }% + {% + \PackageError{glossaries-extra}{`#1' not recognised by + \string\GLSxtrp}{}% + }% + }% +} +\newrobustcmd*{\glsxtr@headentry@p}[2]{% + \glsifattribute{#1}{headuc}{true}% + {% + \mfirstucMakeUppercase{\@gls@entry@field{#1}{#2}}% + }% + {% + \@gls@entry@field{#1}{#2}% + }% +} +\ifdef\texorpdfstring +{ + \newcommand{\glsxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\texorpdfstring + {% + \protect\glsxtrifinmark + {% + \ifcsdef{glsxtrhead#1}% + {% + {\protect\csuse{glsxtrhead#1}{#2}}% + }% + {% + \glsxtr@headentry@p{#2}{#1}% + }% + }% + {% + \@glsxtrp{#1}{#2}% + }% + }% + {% + \protect\@gls@entry@field{#2}{#1}% + }% + }% + } +} +{ + \newcommand{\glsxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\glsxtrifinmark + {% + \ifcsdef{glsxtrhead#1}% + {% + {\protect\csuse{glsxtrhead#1}}% + }% + {% + \glsxtr@headentry@p{#2}{#1}% + }% + }% + {% + \@glsxtrp{#1}{#2}% + }% + }% + } +} +\newcommand*{\glsps}{\glsxtrp{short}} +\newcommand*{\glspt}{\glsxtrp{text}} +\ifdef\texorpdfstring +{ + \newcommand{\Glsxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\texorpdfstring + {% + \protect\glsxtrifinmark + {% + \ifcsdef{Glsxtrhead#1}% + {% + {\protect\csuse{Glsxtrhead#1}{#2}}% + }% + {% + \protect\@Gls@entry@field{#2}{#1}% + }% + }% + {% + \@Glsxtrp{#1}{#2}% + }% + }% + {% + \protect\@gls@entry@field{#2}{#1}% + }% + }% + } +} +{ + \newcommand{\Glsxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\glsxtrifinmark + {% + \ifcsdef{Glsxtrhead#1}% + {% + {\protect\csuse{Glsxtrhead#1}}% + }% + {% + \protect\@Gls@entry@field{#2}{#1}% + }% + }% + {% + \@Glsxtrp{#1}{#2}% + }% + }% + } +} +\ifdef\texorpdfstring +{ + \newcommand{\GLSxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\texorpdfstring + {% + \protect\glsxtrifinmark + {% + \ifcsdef{GLSxtr#1}% + {% + {\protect\GLSxtrshort[noindex,hyper=false]{#1}[]}% + }% + {% + \protect\mfirstucMakeUppercase + {% + \protect\@gls@entry@field{#2}{#1}% + }% + }% + }% + {% + \@GLSxtrp{#1}{#2}% + }% + }% + {% + \protect\@gls@entry@field{#2}{#1}% + }% + }% + } +} +{ + \newcommand{\GLSxtrp}[2]{% + \protect\NoCaseChange + {% + \protect\glsxtrifinmark + {% + \ifcsdef{GLSxtr#1}% + {% + {\protect\GLSxtrshort[noindex,hyper=false]{#1}[]}% + }% + {% + \protect\mfirstucMakeUppercase + {% + \protect\@gls@entry@field{#2}{#1}% + }% + }% + }% + {% + \@GLSxtrp{#1}{#2}% + }% + }% + } +} \renewcommand*{\@glsunset}[1]{% \@@glsunset{#1}% \glsxtrpostunset{#1}% @@ -2046,7 +2278,12 @@ \renewcommand{\acronymfont}[1]{##1}% \let\setacronymstyle\@glsxtr@org@setacronymstyle \let\newacronymstyle\@glsxtr@org@newacronymstyle - \let\@gls@link@checkfirsthyper\@glsxtr@org@checkfirsthyper + \renewcommand*\@gls@link@checkfirsthyper{% + \ifglsused{\glslabel}% + {\let\glsxtrifwasfirstuse\@secondoftwo} + {\let\glsxtrifwasfirstuse\@firstoftwo}% + \@glsxtr@org@checkfirsthyper + } \glssetcategoryattribute{acronym}{regular}{false}% \setacronymstyle{long-short}% } @@ -2833,9 +3070,10 @@ want }% } \newcommand*{\glsxtrfieldtitlecase}[2]{% - \expandafter\xcapitalisewords\expandafter + \expandafter\glsxtrfieldtitlecasecs\expandafter {\csname glo@\glsdetoklabel{#1}@#2\endcsname}% } +\newcommand*{\glsxtrfieldtitlecasecs}[1]{\xcapitalisewords{#1}} \@ifpackageloaded{glossaries-accsupp} { \renewcommand*{\glossentrydesc}[1]{% @@ -3332,6 +3570,7 @@ want \@glsxtr@org@postdescription }{}% }% + \glossxtrsetpopts }% } {} @@ -4195,7 +4434,9 @@ want firstplural={\protect\glsfirstlongfont{\the\glslongpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% (\protect\glsfirstabbrvfont{\the\glsshortpltok})},% - plural={\protect\glsabbvfont{\the\glsshortpltok}}}% + text={\protect\glsabbrvfont{\the\glsshorttok}},% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + }% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -4268,7 +4509,9 @@ want firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% \protect\glsxtrfullsep{\the\glslabeltok}% (\protect\glsfirstlongfont{\the\glslongpltok})},% - plural={\protect\glsabbvfont{\the\glsshortpltok}}}% + text={\protect\glsabbrvfont{\the\glsshorttok}},% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}% + }% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glshasattribute{\the\glslabeltok}{regular}% {% @@ -4282,6 +4525,7 @@ want } \newcommand*{\glsfirstlongfootnotefont}[1]{\glslongfootnotefont{#1}}% \newcommand*{\glslongfootnotefont}[1]{\glslongdefaultfont{#1}}% +\newcommand*{\glsxtrabbrvfootnote}[2]{\footnote{#2}} \newabbreviationstyle{footnote}% {% \renewcommand*{\CustomAbbreviationFields}{% @@ -4289,9 +4533,11 @@ want sort={\the\glsshorttok}, description={\the\glslongtok},% first={\protect\glsfirstabbrvfont{\the\glsshorttok}% - \protect\footnote{\protect\glsfirstlongfont{\the\glslongtok}}},% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongtok}}},% firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% - \protect\footnote{\protect\glsfirstlongfont{\the\glslongpltok}}},% + \protect\glsxtrabbrvfootnote{\the\glslabeltok}% + {\protect\glsfirstlongfootnotefont{\the\glslongpltok}}},% plural={\protect\glsabbvfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{nohyperfirst}{true}% @@ -4311,42 +4557,46 @@ want \renewcommand*{\glsxtrfullformat}[2]{% \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\footnote{\glsfirstlongfont{\glsaccesslong{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\glsxtrfullplformat}[2]{% \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\footnote{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\Glsxtrfullformat}[2]{% \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\footnote{\glsfirstlongfont{\glsaccesslong{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslong{##1}}}% }% \renewcommand*{\Glsxtrfullplformat}[2]{% \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi - \protect\footnote{\glsfirstlongfont{\glsaccesslongpl{##1}}}% + \protect\glsxtrabbrvfootnote{##1}% + {\glsfirstlongfootnotefont{\glsaccesslongpl{##1}}}% }% \renewcommand*{\glsxtrinlinefullformat}[2]{% \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslong{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslong{##1}})% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslongpl{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslongpl{##1}})% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslong{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslong{##1}})% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslongpl{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslongpl{##1}})% }% } \letabbreviationstyle{short-footnote}{footnote} @@ -4356,16 +4606,14 @@ want name={\protect\glsabbrvfont{\the\glsshorttok}}, sort={\the\glsshorttok}, description={\the\glslongtok},% - first={\protect\glsfirstabbrvfont{\the\glsshorttok}% - \protect\footnote{\protect\glsfirstlongfont{\the\glslongtok}}},% - firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}% - \protect\footnote{\protect\glsfirstlongfont{\the\glslongpltok}}},% + first={\protect\glsfirstabbrvfont{\the\glsshorttok}},% + firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}},% plural={\protect\glsabbvfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \csdef{glsxtrpostlink\glscategorylabel}{% \glsxtrifwasfirstuse {% - \glsxtrdopostpunc{\protect\footnote + \glsxtrdopostpunc{\protect\glsxtrabbrvfootnote{\glslabel}% {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% }% {}% @@ -4405,22 +4653,22 @@ want \renewcommand*{\glsxtrinlinefullformat}[2]{% \glsfirstabbrvfont{\glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslong{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslong{##1}})% }% \renewcommand*{\glsxtrinlinefullplformat}[2]{% \glsfirstabbrvfont{\glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslongpl{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslongpl{##1}})% }% \renewcommand*{\Glsxtrinlinefullformat}[2]{% \glsfirstabbrvfont{\Glsaccessshort{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslong{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslong{##1}})% }% \renewcommand*{\Glsxtrinlinefullplformat}[2]{% \glsfirstabbrvfont{\Glsaccessshortpl{##1}\ifglsxtrinsertinside##2\fi}% \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}% - (\glsfirstlongfont{\glsaccesslongpl{##1}})% + (\glsfirstlongfootnotefont{\glsaccesslongpl{##1}})% }% } \letabbreviationstyle{short-postfootnote}{postfootnote} @@ -5174,19 +5422,28 @@ want \let\@glsxtr@org@markright\markright \renewcommand*{\markright}[1]{% \glsxtrmarkhook - \@glsxtr@org@markright{#1}% + \@glsxtr@org@markright{\@glsxtrinmark#1\@glsxtrnotinmark}% \glsxtrrestoremarkhook } \let\@glsxtr@org@markboth\markboth \renewcommand*{\markboth}[2]{% \glsxtrmarkhook - \@glsxtr@org@markboth{#1}{#2}% + \@glsxtr@org@markboth + {\@glsxtrinmark#1\@glsxtrnotinmark}% + {\@glsxtrinmark#2\@glsxtrnotinmark}% \glsxtrrestoremarkhook } \newcommand*{\glsxtrRevertMarks}{% \let\markright\@glsxtr@org@markright \let\markboth\@glsxtr@org@markboth } +\newcommand*{\glsxtrifinmark}[2]{#2} +\newrobustcmd*{\@glsxtrinmark}{% + \let\glsxtrifinmark\@firstoftwo +} +\newrobustcmd*{\@glsxtrnotinmark}{% + \let\glsxtrifinmark\@secondoftwo +} \newcommand*{\glsxtrmarkhook}{% \let\@glsxtr@org@MakeUppercase\MakeUppercase \let\@glsxtr@org@glsxtrtitleshort\glsxtrtitleshort @@ -5209,6 +5466,7 @@ want \let\@glsxtr@org@glsxtrtitlefullpl\glsxtrtitlefullpl \let\@glsxtr@org@Glsxtrtitlefull\Glsxtrtitlefull \let\@glsxtr@org@Glsxtrtitlefullpl\Glsxtrtitlefullpl + \let\glsxtrifinmark\@firstoftwo \let\MakeUppercase\MakeTextUppercase \let\glsxtrtitleshort\glsxtrheadshort \let\glsxtrtitleshortpl\glsxtrheadshortpl @@ -5232,6 +5490,7 @@ want \let\Glsxtrtitlefullpl\Glsxtrheadfullpl } \newcommand*{\glsxtrrestoremarkhook}{% + \let\glsxtrifinmark\@secondoftwo \let\MakeUppercase\@glsxtr@org@MakeUppercase \let\glsxtrtitleshort\@glsxtr@org@glsxtrtitleshort \let\glsxtrtitleshortpl\@glsxtr@org@glsxtrtitleshortpl |