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 | 136 |
1 files changed, 106 insertions, 30 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 3f24278c631..d7e258b4683 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty @@ -7,7 +7,7 @@ %% glossaries-extra.dtx (with options: `glossaries-extra.sty,package') %% %% glossaries-extra.dtx -%% Copyright 2018 Nicola Talbot +%% Copyright 2019 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-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, glossary-longextra.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. +%% This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, glossary-longextra.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbolnames.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. %% %% \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,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2018/12/01 1.38 (NLCT)] +\ProvidesPackage{glossaries-extra}[2019/03/22 1.39 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{etoolbox} \@ifpackageloaded{glossaries} @@ -217,8 +217,12 @@ \ifx\theglsentrycounter\theHglsentrycounter \def\@glo@counterprefix{}% \else - \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix - {\theglsentrycounter}{\theHglsentrycounter}% + \protected@edef\@glsxtr@theentrycounter{\theglsentrycounter}% + \protected@edef\@glsxtr@theHentrycounter{\theHglsentrycounter}% + \@onelevel@sanitize\@glsxtr@theentrycounter + \@onelevel@sanitize\@glsxtr@theHentrycounter + \protected@edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\@glsxtr@theentrycounter}{\@glsxtr@theHentrycounter}% }% \@do@gls@getcounterprefix \fi @@ -1036,13 +1040,25 @@ \ifdefempty\glscurrentfieldvalue{#4}{#3}% }% } -\newcommand{\GlsXtrIfFieldNonZero}[4]{% - \GlsXtrIfFieldCmpNum{#1}{#2}{=}{0}{#4}{#3}% +\newcommand{\GlsXtrIfFieldNonZero}{% + \@ifstar\s@GlsXtrIfFieldNonZero\@GlsXtrIfFieldNonZero +} +\newcommand{\@GlsXtrIfFieldNonZero}[4]{% + \@GlsXtrIfFieldCmpNum{#1}{#2}{=}{0}{#4}{#3}% +} +\newcommand{\GlsXtrIfFieldEqNum}{% + \@ifstar\s@GlsXtrIfFieldEqNum\@GlsXtrIfFieldEqNum } -\newcommand{\GlsXtrIfFieldEqNum}[5]{% - \GlsXtrIfFieldCmpNum{#1}{#2}{=}{#3}{#4}{#5}% +\newcommand{\@GlsXtrIfFieldEqNum}[5]{% + \@GlsXtrIfFieldCmpNum{#1}{#2}{=}{#3}{#4}{#5}% } -\newcommand{\GlsXtrIfFieldCmpNum}[6]{% +\newcommand{\s@GlsXtrIfFieldEqNum}[5]{% + \s@GlsXtrIfFieldCmpNum{#1}{#2}{=}{#3}{#4}{#5}% +} +\newcommand{\GlsXtrIfFieldCmpNum}{% + \@ifstar\s@GlsXtrIfFieldCmpNum\@GlsXtrIfFieldCmpNum +} +\newcommand{\@GlsXtrIfFieldCmpNum}[6]{% {% \letcs{\glscurrentfieldvalue}{glo@\glsdetoklabel{#2}@#1}% \ifundef\glscurrentfieldvalue @@ -1055,6 +1071,17 @@ \ifnum\glscurrentfieldvalue#3#4\relax #5\else #6\fi }% } +\newcommand{\s@GlsXtrIfFieldCmpNum}[6]{% + \letcs{\glscurrentfieldvalue}{glo@\glsdetoklabel{#2}@#1}% + \ifundef\glscurrentfieldvalue + {\def\glscurrentfieldvalue{0}}% + {% + \ifdefempty\glscurrentfieldvalue + {\def\glscurrentfieldvalue{0}}% + {}% + }% + \ifnum\glscurrentfieldvalue#3#4\relax #5\else #6\fi +} \newcommand{\GlsXtrIfFieldUndef}[2]{% \ifcsundef{glo@\glsdetoklabel{#2}@#1}% } @@ -1087,6 +1114,11 @@ \glsdoifexists{#1}{\mfirstucMakeUppercase{\@gls@entry@field{#1}{#2}}}% } } +\newcommand*{\glsxtrentryparentname}[1]{% + \ifcsdef{glo@\glsdetoklabel{#1}@parent}% + {\csuse{glo@\csuse{glo@\glsdetoklabel{#1}@parent}@name}}% + {}% +} \newcommand*{\glsxtrdeffield}[2]{\csdef{glo@\glsdetoklabel{#1}@#2}} \newcommand*{\glsxtredeffield}[2]{\protected@csedef{glo@\glsdetoklabel{#1}@#2}} \newcommand*{\glsxtrsetfieldifexists}[3]{\glsdoifexists{#1}{#3}} @@ -1118,23 +1150,57 @@ \glsxtrsetfieldifexists{#1}{#2}% {\protected@csedef{glo@\glsdetoklabel{#1}@#2}{#3}}% } -\newrobustcmd*{\GlsXtrIfFieldEqStr}[5]{% - \glsxtrifhasfield{#1}{#2}% +\newcommand*{\GlsXtrIfFieldEqStr}{% + \@ifstar\s@GlsXtrIfFieldEqStr\@GlsXtrIfFieldEqStr +} +\newrobustcmd*{\@GlsXtrIfFieldEqStr}[5]{% + \@glsxtrifhasfield{#1}{#2}% {% \ifdefstring{\glscurrentfieldvalue}{#3}{#4}{#5}% }% {#5}% } -\newrobustcmd*{\GlsXtrIfFieldEqXpStr}[5]{% - \glsxtrifhasfield{#1}{#2}% +\newrobustcmd*{\s@GlsXtrIfFieldEqStr}[5]{% + \s@glsxtrifhasfield{#1}{#2}% + {% + \ifdefstring{\glscurrentfieldvalue}{#3}{#4}{#5}% + }% + {#5}% +} +\newcommand*{\GlsXtrIfFieldEqXpStr}{% + \@ifstar\s@GlsXtrIfFieldEqXpStr\@GlsXtrIfFieldEqXpStr +} +\newrobustcmd*{\@GlsXtrIfFieldEqXpStr}[5]{% + \@glsxtrifhasfield{#1}{#2}% {% \protected@edef\@gls@tmp{#3}% \ifdefequal{\glscurrentfieldvalue}{\@gls@tmp}{#4}{#5}% }% {#5}% } -\newrobustcmd*{\GlsXtrIfXpFieldEqXpStr}[5]{% - \glsxtrifhasfield{#1}{#2}% +\newrobustcmd*{\s@GlsXtrIfFieldEqXpStr}[5]{% + \s@glsxtrifhasfield{#1}{#2}% + {% + \protected@edef\@gls@tmp{#3}% + \ifdefequal{\glscurrentfieldvalue}{\@gls@tmp}{#4}{#5}% + }% + {#5}% +} +\newcommand*{\GlsXtrIfXpFieldEqXpStr}{% + \@ifstar\s@GlsXtrIfXpFieldEqXpStr\@GlsXtrIfXpFieldEqXpStr +} +\newrobustcmd*{\@GlsXtrIfXpFieldEqXpStr}[5]{% + \@glsxtrifhasfield{#1}{#2}% + {% + \protected@edef\@gls@tmp{\glscurrentfieldvalue}% + \let\glscurrentfieldvalue\@gls@tmp + \protected@edef\@gls@tmp{#3}% + \ifdefequal{\glscurrentfieldvalue}{\@gls@tmp}{#4}{#5}% + }% + {#5}% +} +\newrobustcmd*{\s@GlsXtrIfXpFieldEqXpStr}[5]{% + \s@glsxtrifhasfield{#1}{#2}% {% \protected@edef\@gls@tmp{\glscurrentfieldvalue}% \let\glscurrentfieldvalue\@gls@tmp @@ -3009,9 +3075,11 @@ {#2}% \else \glsifattribute{#1}{indexonlyfirst}{true}% - {\ifglsused{#1} - {\glsxtrdoautoindexname{#1}{dualindex}}% - {#2}}% + {% + \ifglsused{#1}% + {\glsxtrdoautoindexname{#1}{dualindex}}% + {#2}% + }% {#2}% \fi }% @@ -4112,6 +4180,7 @@ {You may only use the hybrid \string\makeglossaries[...]\space with record=off option}% \else + \ifdef\@gls@@automake@immediate{\@gls@@automake@immediate}{}% \edef\@glsxtr@reg@glosslist{#1}% \ifundef{\glswrite}{\newwrite\glswrite}{}% \protected@write\@auxout{}{\string\providecommand @@ -4340,6 +4409,15 @@ \define@key{printgloss}{prefix}{% \renewcommand{\glolinkprefix}{#1}% } +\define@key{printgloss}{label}{% + \glsxtrsetglossarylabel{#1}% +} +\newcommand{\glsxtrsetglossarylabel}[1]{% + \renewcommand*{\@@glossaryseclabel}{% + \protected@edef\@currentlabelname{\glossarytoctitle}% + \label{#1}% + }% +} \let\@glsxtr@org@glsdohypertarget\glsdohypertarget \renewcommand{\glsdohypertarget}[2]{% \@glsxtr@org@glsdohypertarget{\@glsxtrhypernameprefix#1}{#2}% @@ -4570,8 +4648,8 @@ \def\@gls@removespaces#1 #2\@nil{% \toks@=\expandafter{\the\toks@#1}% \ifx\\#2\\% - \edef\x{\the\toks@}% - \ifx\x\empty + \edef\@glo@tmp{\the\toks@}% + \ifx\@glo@tmp\empty \else \expandafter\glsxtrlocationhyperlink\expandafter \glsentrycounter\expandafter\@glo@counterprefix\expandafter{\the\toks@}% @@ -4689,7 +4767,7 @@ \begin{itemize} \item Run the external (Lua) application: - \texttt{makeglossaries-lite.lua \string"\jobname\string"} + \texttt{makeglossaries-lite \string"\jobname\string"} \item Run the external (Perl) application: @@ -7957,6 +8035,8 @@ defined}{}% } \newcommand*{\glsxtrshortdescname}{% \protect\glsabbrvfont{\the\glsshorttok}% + \protect\glsxtrfullsep{\the\glslabeltok}% + \protect\glsxtrparen{\protect\glslongfont{\the\glslongtok}}% } \newabbreviationstyle{short-desc}% {% @@ -7966,8 +8046,7 @@ defined}{}% first={\protect\glsfirstabbrvfont{\the\glsshorttok}}, firstplural={\protect\glsfirstabbrvfont{\the\glsshortpltok}}, text={\protect\glsabbrvfont{\the\glsshorttok}}, - plural={\protect\glsabbrvfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + plural={\protect\glsabbrvfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% @@ -8422,8 +8501,7 @@ defined}{}% first={\protect\glsfirstabbrvscfont{\the\glsshorttok}}, firstplural={\protect\glsfirstabbrvscfont{\the\glsshortpltok}}, text={\protect\glsabbrvscfont{\the\glsshorttok}}, - plural={\protect\glsabbrvscfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + plural={\protect\glsabbrvscfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% @@ -9009,8 +9087,7 @@ defined}{}% first={\protect\glsfirstabbrvsmfont{\the\glsshorttok}}, firstplural={\protect\glsfirstabbrvsmfont{\the\glsshortpltok}}, text={\protect\glsabbrvsmfont{\the\glsshorttok}}, - plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + plural={\protect\glsabbrvsmfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% @@ -9745,8 +9822,7 @@ defined}{}% first={\protect\glsfirstabbrvemfont{\the\glsshorttok}}, firstplural={\protect\glsfirstabbrvemfont{\the\glsshortpltok}}, text={\protect\glsabbrvemfont{\the\glsshorttok}}, - plural={\protect\glsabbrvemfont{\the\glsshortpltok}}, - description={\the\glslongtok}}% + plural={\protect\glsabbrvemfont{\the\glsshortpltok}}}% \renewcommand*{\GlsXtrPostNewAbbreviation}{% \glssetattribute{\the\glslabeltok}{regular}{true}}% }% |