summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty
diff options
context:
space:
mode:
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.sty118
1 files changed, 97 insertions, 21 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 d0ac279264e..3302b6ed25d 100644
--- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty
+++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty
@@ -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-stylemods.sty, example-glossaries-xr.tex.
+%% This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.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.
%%
%% \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}[2017/08/10 v1.18 (NLCT)]
+\ProvidesPackage{glossaries-extra}[2017/09/08 v1.19 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{etoolbox}
\@ifpackageloaded{glossaries}
@@ -116,11 +116,16 @@
}
\newcommand*{\@glsxtr@record}[3]{}
\newcommand*{\glsxtr@recordsee}[2]{}
+\newcommand*{\@glsxtr@defaultnumberformat}{glsnumberformat}%
+\newcommand*{\GlsXtrSetDefaultNumberFormat}[1]{%
+ \renewcommand*{\@glsxtr@defaultnumberformat}{#1}%
+}%
\newcommand*{\@@glsxtr@record}[3]{%
\begingroup
- \def\@glsnumberformat{glsnumberformat}%
+ \let\@glsnumberformat\@glsxtr@defaultnumberformat
\def\@glsxtr@thevalue{}%
\def\@glsxtr@theHvalue{\@glsxtr@thevalue}%
+ \let\@glsxtr@org@theHvalue\@glsxtr@theHvalue
\ifcsdef{glo@#2@counter}%
{%
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
@@ -135,29 +140,59 @@
{%
\ifdefempty{\@glsxtr@thevalue}%
{%
+ \ifx\@glsxtr@org@theHvalue\@glsxtr@theHvalue
+ \else
+ \let\theHglsentrycounter\@glsxtr@theHvalue
+ \fi
\glsxtr@saveentrycounter
\let\@@do@@wrglossary\@glsxtr@dorecord
}%
{%
\let\theglsentrycounter\@glsxtr@thevalue
- \def\theHglsentrycounter{\@glsxtr@theHvalue}%
+ \let\theHglsentrycounter\@glsxtr@theHvalue
\let\@@do@@wrglossary\@glsxtr@dorecordnodefer
}%
- \glsxtr@@do@wrglossary{#2}%
+ \ifx\@glsxtr@record@setting\@glsxtr@record@setting@alsoindex
+ \glsxtr@@do@wrglossary{#2}%
+ \else
+ \edef\@gls@label{\glsdetoklabel{#2}}%
+ \@@do@@wrglossary
+ \fi
}%
\fi
\endgroup
}
\newcommand*\@glsxtr@dorecord{%
- \protected@write\@auxout{\let\@glslocref\relax}{\string\glsxtr@record
+ \global\let\@glsrecordlocref\theglsentrycounter
+ \let\@glsxtr@orgprefix\@glo@counterprefix
+ \ifx\theglsentrycounter\theHglsentrycounter
+ \def\@glo@counterprefix{}%
+ \else
+ \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix
+ {\theglsentrycounter}{\theHglsentrycounter}%
+ }%
+ \@do@gls@getcounterprefix
+ \fi
+ \protected@write\@auxout{\let\@glsrecordlocref\relax}{\string\glsxtr@record
{\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}%
- {\@glslocref}}%
+ {\@glsrecordlocref}}%
\@glsxtr@counterrecordhook
+ \let\@glo@counterprefix\@glsxtr@orgprefix
}
\newcommand*\@glsxtr@dorecordnodefer{%
- \protected@write\@auxout{}{\string\glsxtr@record
- {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}%
- {\@glslocref}}%
+ \ifx\theglsentrycounter\theHglsentrycounter
+ \protected@write\@auxout{}{\string\glsxtr@record
+ {\@gls@label}{}{\@gls@counter}{\@glsnumberformat}%
+ {\theglsentrycounter}}%
+ \else
+ \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix
+ {\theglsentrycounter}{\theHglsentrycounter}%
+ }%
+ \@do@gls@getcounterprefix
+ \protected@write\@auxout{}{\string\glsxtr@record
+ {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}%
+ {\theglsentrycounter}}%
+ \fi
\@glsxtr@counterrecordhook
}
\newcommand*{\@@glsxtr@recordcounter}{%
@@ -220,10 +255,13 @@
}%
{}%
}
+\newcommand*{\@glsxtr@record@setting}{off}
+\newcommand*{\@glsxtr@record@setting@alsoindex}{alsoindex}
\define@choicekey{glossaries-extra.sty}{record}[\val\nr]%
{off,only,alsoindex}%
[only]%
{%
+ \let\@glsxtr@record@setting\val
\ifcase\nr\relax
\def\glsxtr@setup@record{%
\renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}%
@@ -653,6 +691,20 @@
\newcommand*{\glsxtrfieldxifinlist}[5]{%
\xifinlistcs{#3}{glo@\glsdetoklabel{#1}@#2}{#4}{#5}%
}
+\newrobustcmd{\glsxtrifhasfield}{%
+ \@ifstar{\s@glsxtrifhasfield}{\@glsxtrifhasfield}%
+}
+\newcommand{\@glsxtrifhasfield}[4]{%
+ {\s@glsxtrifhasfield{#1}{#2}{#3}{#4}}%
+}
+\newcommand{\s@glsxtrifhasfield}[4]{%
+ \letcs{\glscurrentfieldvalue}{glo@\glsdetoklabel{#2}@#1}%
+ \ifdef\glscurrentfieldvalue
+ {%
+ \ifdefempty\glscurrentfieldvalue{#4}{#3}%
+ }%
+ {#4}%
+}
\newcommand*{\glsxtrusefield}[2]{%
\@gls@entry@field{#1}{#2}%
}
@@ -1546,22 +1598,33 @@
\glsxtrinitwrglossbeforefalse
\fi
}
+\define@key{glslink}{thevalue}{\def\@glsxtr@thevalue{#1}}
+\define@key{glslink}{theHvalue}{\def\@glsxtr@theHvalue{#1}}
\def\@gls@link[#1]#2#3{%
\leavevmode
\edef\glslabel{\glsdetoklabel{#2}}%
\def\@gls@link@opts{#1}%
\let\@gls@link@label\glslabel
- \def\@glsnumberformat{glsnumberformat}%
+ \let\@glsnumberformat\@glsxtr@defaultnumberformat
\edef\@gls@counter{\csname glo@\glslabel @counter\endcsname}%
\edef\glstype{\csname glo@\glslabel @type\endcsname}%
\let\org@ifKV@glslink@hyper\ifKV@glslink@hyper
+ \def\@glsxtr@thevalue{}%
+ \def\@glsxtr@theHvalue{\@glsxtr@thevalue}%
\glsxtrinitwrgloss
\@gls@setdefault@glslink@opts
\do@glsdisablehyperinlist
\do@gls@link@checkfirsthyper
\setkeys{glslink}{#1}%
\glslinkpostsetkeys
- \@gls@saveentrycounter
+ \ifdefempty{\@glsxtr@thevalue}%
+ {%
+ \@gls@saveentrycounter
+ }%
+ {%
+ \let\theglsentrycounter\@glsxtr@thevalue
+ \def\theHglsentrycounter{\@glsxtr@theHvalue}%
+ }%
\@gls@setsort{\glslabel}%
\ifglsxtrinitwrglossbefore
\@do@wrglossary{#2}%
@@ -1584,7 +1647,7 @@
\@glsxtr@record{#1}{#2}{glossadd}%
\glsdoifexists{#2}%
{%
- \def\@glsnumberformat{glsnumberformat}%
+ \let\@glsnumberformat\@glsxtr@defaultnumberformat
\edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}%
\def\@glsxtr@thevalue{}%
\def\@glsxtr@theHvalue{\@glsxtr@thevalue}%
@@ -2197,7 +2260,7 @@
\ifKV@glslink@noindex
\else
\begingroup
- \def\@glsnumberformat{glsnumberformat}%
+ \let\@glsnumberformat\@glsxtr@defaultnumberformat
\edef\@gls@counter{\csname glo@\glsdetoklabel{\glslabel}@counter\endcsname}%
\glsxtr@saveentrycounter
\@@do@wrglossary{\glsxtralias{\glslabel}}%
@@ -2297,15 +2360,26 @@
\glsfieldfetch{\glslabel}{alias}{\gloaliaslabel}%
\ifdefvoid\gloaliaslabel
{%
- \hyperlink{#1}{{\glsxtrprotectlinks#2}}%
+ \glsxtrhyperlink{#1}{{\glsxtrprotectlinks#2}}%
}%
{%
- \hyperlink
+ \glsxtrhyperlink
{\glolinkprefix\glsdetoklabel{\gloaliaslabel}}%
{{\glsxtrprotectlinks#2}}%
}%
}%
}
+
+\ifdef\@glsshowtarget
+{
+ \newcommand{\glsxtrhyperlink}[2]{%
+ \@glsshowtarget{#1}%
+ \hyperlink{#1}{#2}%
+ }%
+}
+{
+ \newcommand{\glsxtrhyperlink}[2]{\hyperlink{#1}{#2}}%
+}
\renewrobustcmd*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{%
\def\@glo@label{#2}%
{\edef\glslabel{#2}%
@@ -3628,7 +3702,7 @@
\newcommand*{\glsxtrlocationhyperlink}[3]{%
\ifdefvoid\glsxtrsupplocationurl
{%
- \hyperlink{#1#2#3}{#3}%
+ \glsxtrhyperlink{#1#2#3}{#3}%
}%
{%
\hyperref{\glsxtrsupplocationurl}{}{#1#2#3}{#3}%
@@ -3906,7 +3980,7 @@
\let\glsxtr@writefields\relax
\ifglsautomake
\IfFileExists{\jobname.aux}%
- {\immediate\write18{bib2gls "\jobname"}}{}%
+ {\immediate\write18{bib2gls \jobname}}{}%
\ifx\@gls@doautomake\@gls@doautomake@err
\let\@gls@doautomake\relax
\fi
@@ -4758,7 +4832,7 @@
}
}
\newcommand*{\glsxtrpostnamehook}[1]{%
- \def\@glsnumberformat{glsnumberformat}%
+ \let\@glsnumberformat\@glsxtr@defaultnumberformat
\glsxtrdoautoindexname{#1}{indexname}%
\csuse{glsxtrpostname\glscategory{#1}}%
}
@@ -4790,8 +4864,10 @@
\@glsxtr@autoindex@setname{#1}%
\protected@edef\@glsxtr@attrval{\glsgetattribute{#1}{#2}}%
\if@glsxtr@format@override
- \ifdefstring{\@glsnumberformat}{glsnumberformat}{}%
- {\let\@glsxtr@attrval\@glsnumberformat}%
+ \ifx\@glsnumberformat\@glsxtr@defaultnumberformat
+ \else
+ \let\@glsxtr@attrval\@glsnumberformat
+ \fi
\fi
\ifdefstring{\@glsxtr@attrval}{true}%
{}%