diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-01 22:48:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-01 22:48:17 +0000 |
commit | b4449269786ca00b3c302d244f99e83d31a6b0d6 (patch) | |
tree | 4ed4229a57dec9589dde0d209eb61c3985a6d5b8 /Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty | |
parent | d2e8f53cdae6de5f7ae5dca67ef39847fd96d88d (diff) |
glossaries-extra (1dec18)
git-svn-id: svn://tug.org/texlive/trunk@49297 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty | 284 |
1 files changed, 282 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty index 7dca62e8c98..02f5440640c 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-bib2gls.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-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.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-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,13 +39,25 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-bib2gls}[2018/08/18 v1.36 (NLCT)] +\ProvidesPackage{glossaries-extra-bib2gls}[2018/11/30 1.37 (NLCT)] \newcommand*{\glshex}{\string\u} \newcommand*{\glscapturedgroup}{\string\$} \newcommand*{\GlsXtrIfHasNonZeroChildCount}[3]{% \GlsXtrIfFieldNonZero{childcount}{#1}{#2}{#3}% } \newcommand*{\glsxtrprovidecommand}{\providecommand} +\newcommand*{\glsrenewcommand}{\@star@or@long\glsxtr@renewcommand} +\newcommand*{\glsxtr@renewcommand}[1]{% + \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup + \expandafter\@ifundefined\@gtempa + {% + \GlossariesExtraWarning{can't redefine \noexpand#1(not already defined)}% + }% + \relax + \relax + \let\@ifdefinable\@rc@ifdefinable + \new@command#1% +} \newcommand*{\glsxtr@wrglossarylocation}[2]{#1} \ifdef\hyperref {% @@ -111,6 +123,274 @@ \setentrycounter[#1]{#2}% \glsxtrmultisupplocation{#5}{#4}{#3}% } +\ifundef\hyperlink +{ + \newcommand*{\glsxtrdisplaylocnameref}[8]{% + \glsnoidxdisplayloc{#1}{#2}{#3}{#4}% + } +} +{ + \newcommand*{\glsxtrdisplaylocnameref}[8]{% + \ifstrequal{#2}{equation}% + {\glsxtrnamereflink{#3}{(#4)}{#2.#7}{#8}}% + {% + \ifstrempty{#5}% + {% + \glsxtrnamereflink{#3}{#4}{#2.#7}{#8}% + }% + {% + \ifstrequal{#2}{page}% + {\glsxtrnamereflink{#3}{#4}{#2.#7}{#8}}% + {\glsxtrnamereflink{#3}{#5}{#2.#7}{#8}}% + }% + }% + } +} +\newcommand*{\glsxtrnamereflink}[4]{% + \begingroup + \let\glshypernumber\@firstofone + \ifstrempty{#4}% + {\glsxtrfmtinternalnameref{#3}{#1}{#2}}% + {\glsxtrfmtexternalnameref{#3}{#1}{#2}{#4}}% + \endgroup +} +\newcommand{\glsxtrnameloclink}[6]{% + \begingroup + \setentrycounter[#1]{#2}% + \def\glsxtr@locationhypertext{#5}% + \let\glshypernumber\@firstofone + \def\@glsnumberformat{#3}% + \def\glsxtrsupplocationurl{#6}% + \toks@={}% + \@glsxtr@bibgls@removespaces#4 \@nil + \endgroup +} +\def\@glsxtr@bibgls@removespaces#1 #2\@nil{% + \toks@=\expandafter{\the\toks@#1}% + \ifx\\#2\\% + \edef\x{\the\toks@}% + \ifx\x\empty + \else + \protected@edef\x{\glsentrycounter\@glo@counterprefix\the\toks@}% + \ifdefvoid\glsxtrsupplocationurl + {% + \expandafter\glsxtrfmtinternalnameref\expandafter{\x}% + {\@glsnumberformat}{\glsxtr@locationhypertext}% + }% + {% + \expandafter\glsxtrfmtexternalnameref\expandafter{\x}% + {\@glsnumberformat}{\glsxtr@locationhypertext}{\glsxtrsupplocationurl}% + }% + \fi + \else + \@gls@ReturnAfterFi{% + \@glsxtr@bibgls@removespaces#2\@nil + }% + \fi +} +\newcommand*{\glsxtrfmtinternalnameref}[3]{% + \csuse{#2}{\glsdohyperlink{#1}{#3}}% +} +\newcommand*{\glsxtrfmtexternalnameref}[4]{% + \csuse{#2}{\hyperref{#4}{}{#1}{#3}}% +} +\newcommand*{\glsxtrSetWidest}[3]{% + \ifdef\glsupdatewidest + {% + \ifdef\glslongextraUpdateWidest + {% + \ifstrempty{#1} + {% + \glsupdatewidest[#2]{#3}% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \apptoglossarypreamble[#1]{\glsupdatewidest[#2]{#3}}% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% + {% + \ifstrempty{#1} + {% + \glsupdatewidest[#2]{#3}% + }% + {% + \apptoglossarypreamble[#1]{\glsupdatewidest[#2]{#3}}% + }% + }% + }% + {% + \ifdef\glssetwidest + {% + \ifdef\glslongextraUpdateWidest + {% + \ifstrempty{#1} + {% + \glssetwidest[#2]{#3}% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \apptoglossarypreamble[#1]{\glssetwidest[#2]{#3}}% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% + {% + \ifstrempty{#1} + {% + \glssetwidest[#2]{#3}% + }% + {% + \apptoglossarypreamble[#1]{\glssetwidest[#2]{#3}}% + }% + }% + }% + {% + \ifdef\glslongextraUpdateWidest + {% + \ifstrempty{#1} + {% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% + {}% + }% + }% +} +\newcommand*{\glsxtrSetWidestFallback}[2]{% + \ifnum#1=0\relax + \ifdef\glsFindWidestTopLevelName + {% + \glsFindWidestTopLevelName[#2]% + }% + {% + \GlossariesExtraWarning{You need stylemods={tree} to + provide a fallback for set-widest}% + }% + \else + \ifdef\glsFindWidestLevelTwo + {% + \glsFindWidestLevelTwo[#2]% + \ifdef\glslongextraUpdateWidestChild + {% + \glslongextraUpdateWidestChild{#1}{\csuse{@glswidestnamei}}% + \glslongextraUpdateWidestChild{#1}{\csuse{@glswidestnameii}}% + }% + {}% + }% + {% + \GlossariesExtraWarning{You need stylemods={tree} to + provide a fallback for set-widest}% + }% + \fi +} +\newcommand*{\@glsxtr@labelprefixes}{} +\newcommand*{\glsxtrclearlabelprefixes}{% + \renewcommand*{\@glsxtr@labelprefixes}{}% +} +\newcommand*{\glsxtraddlabelprefix}[1]{% + \ifstrempty{#1}% + {\glsxtraddlabelprefix{\empty}}% + {% + \ifdefempty\@glsxtr@labelprefixes + {\def\@glsxtr@labelprefixes{#1}}% + {\appto\@glsxtr@labelprefixes{,#1}}% + }% +} +\newcommand*{\glsxtrprependlabelprefix}[1]{% + \ifstrempty{#1}% + {\glsxtrprependlabelprefix{\empty}}% + {% + \ifdefempty\@glsxtr@labelprefixes + {\def\@glsxtr@labelprefixes{#1}}% + {\preto\@glsxtr@labelprefixes{#1,}}% + }% +} +\newcommand*{\glsxtrifinlabelprefixlist}[3]{% + \ifstrempty{#1}% + {\glsxtrifinlabelprefixlist{\empty}{#2}{#3}}% + {% + \DTLifinlist{#1}{\@glsxtr@labelprefixes}{#2}{#3}% + }% +} +\AtBeginDocument{% + \protected@write\@auxout{}{\string\providecommand{\string\@glsxtr@prefixlabellist}[1]{}}% + \protected@write\@auxout{}{\string\@glsxtr@prefixlabellist{\@glsxtr@labelprefixes}}% +} +\newcommand*{\@glsxtr@get@prefixedlabel}[1]{% + \begingroup + \edef\@gls@thislabel{#1}% + \@for\@glsxtr@prefix:=\@glsxtr@labelprefixes\do + {% + \edef\@gls@thislabel{\@glsxtr@prefix#1}% + \ifglsentryexists{\@gls@thislabel}{\@endfortrue}{}% + }% + \edef\x{\endgroup\noexpand\def\noexpand\@gls@thislabel{\@gls@thislabel}}\x +} +\newrobustcmd*{\dgls}{\@gls@hyp@opt\@dgls} +\newcommand*{\@dgls}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@gls@{#1}{\@gls@thislabel}}{\@gls@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dglspl}{\@gls@hyp@opt\@dglspl} +\newcommand*{\@dglspl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@glspl@{#1}{\@gls@thislabel}}{\@glspl@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dGls}{\@gls@hyp@opt\@dGls} +\newcommand*{\@dGls}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@Gls@{#1}{\@gls@thislabel}}{\@Gls@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dGlspl}{\@gls@hyp@opt\@dGlspl} +\newcommand*{\@dGlspl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@Glspl@{#1}{\@gls@thislabel}}{\@Glspl@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dGLS}{\@gls@hyp@opt\@dGLS} +\newcommand*{\@dGLS}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@GLS@{#1}{\@gls@thislabel}}{\@GLS@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dGLSpl}{\@gls@hyp@opt\@dGLSpl} +\newcommand*{\@dGLSpl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@GLSpl@{#1}{\@gls@thislabel}}{\@GLSpl@{#1}{\@gls@thislabel}[]}% +} +\newrobustcmd*{\dglslink}[3][]{% + \@glsxtr@get@prefixedlabel{#2}% + \glslink[#1]{\@gls@thislabel}{#3}% +} +\newrobustcmd*{\dglsdisp}[3][]{% + \@glsxtr@get@prefixedlabel{#2}% + \glsdisp[#1]{\@gls@thislabel}{#3}% +} \providecommand*{\Alpha}{\mathrm{A}} \providecommand*{\Beta}{\mathrm{B}} \providecommand*{\Epsilon}{\mathrm{E}} |