diff options
author | Karl Berry <karl@freefriends.org> | 2017-01-19 22:07:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-01-19 22:07:21 +0000 |
commit | b83fe0210c4b3eb248892e1c50424808d8880498 (patch) | |
tree | 0c1bd465b09edb8c4048b052d168b5c3baaf58e1 /Master/texmf-dist/tex/latex/glossaries-extra | |
parent | 460e2fdeae5c294d5575ad3ad7b3115ad6349c98 (diff) |
glossaries-extra (19jan17)
git-svn-id: svn://tug.org/texlive/trunk@42994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries-extra')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-stylemods.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra.sty | 247 |
2 files changed, 239 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-stylemods.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-stylemods.sty index 178636cd2a7..52c42f275ea 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-stylemods.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossaries-extra-stylemods.sty @@ -7,7 +7,7 @@ %% glossaries-extra.dtx (with options: `glossaries-extra-stylemods.sty,package') %% %% glossaries-extra.dtx -%% Copyright 2016 Nicola Talbot +%% Copyright 2017 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2016/12/17 v1.10 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2017/01/19 v1.11 (NLCT)] \newcommand*{\@glsxtr@loadstyles}{} \DeclareOption*{% \IfFileExists{glossary-\CurrentOption.sty} 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 df593184edd..159b4e1d552 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 2016 Nicola Talbot +%% Copyright 2017 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2016/12/17 v1.10 (NLCT)] +\ProvidesPackage{glossaries-extra}[2017/01/19 v1.11 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{etoolbox} \@ifpackageloaded{glossaries} @@ -79,21 +79,39 @@ \@glsxtrundeftag\PackageError{glossaries-extra}{#1}{#2}% } \newcommand*{\@glsxtr@warn@onexistsordo}[1]{% - \GlossariesExtraWarning{glossaries-extra}{% - \string#1\space hasn't been defined, so + \GlossariesExtraWarning{\string#1\space hasn't been defined, so some errors won't be converted to warnings. (This most likely means your version of glossaries.sty is below version 4.19.)}% } + +\newcommand*{\@glsxtr@redef@forglsentries}{} +\newcommand*{\@glsxtr@do@redef@forglsentries}{% + \renewcommand*{\forglsentries}[3][\glsdefaulttype]{% + \edef\@@glo@list{\csname glolist@##1\endcsname}% + \ifdefstring{\@@glo@list}{,}% + {% + \GlossariesExtraWarning{No entries defined in glossary `##1'}% + }% + {% + \@for##2:=\@@glo@list\do + {% + \ifdefempty{##2}{}{##3}% + }% + }% + }% +}% \define@choicekey{glossaries-extra.sty}{undefaction}[\val\nr]% {warn,error}% {% \ifcase\nr\relax \let\glsxtrundefaction\@glsxtr@warn@undefaction \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo + \let\@glsxtr@redef@forglsentries\@glsxtr@do@redef@forglsentries \or \let\glsxtrundefaction\@glsxtr@err@undefaction \let\glsxtr@warnonexistsordo\@gobble + \let\@glsxtr@redef@forglsentries\relax \fi } \newcommand*{\@glsxtr@record}[2]{} @@ -141,6 +159,29 @@ \appto\@newglossaryentryposthook{% \gls@assign@field{}{\@glo@label}{loclist}{\@glo@loclist}% }% + \glssetnoexpandfield{loclist}% + }% + {}% + \key@ifundefined{glossentry}{location}% + {% + \define@key{glossentry}{location}{\def\@glo@location{##1}}% + \appto\@gls@keymap{,{location}{location}}% + \appto\@newglossaryentryprehook{\def\@glo@location{}}% + \appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{location}{\@glo@location}% + }% + \glssetnoexpandfield{location}% + }% + {}% + \key@ifundefined{glossentry}{group}% + {% + \define@key{glossentry}{group}{\def\@glo@group{##1}}% + \appto\@gls@keymap{,{group}{group}}% + \appto\@newglossaryentryprehook{\def\@glo@group{}}% + \appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{group}{\@glo@group}% + }% + \glssetnoexpandfield{group}% }% {}% } @@ -268,8 +309,10 @@ \let\GlsXtrDefineOtherShortcuts\relax } \newcommand*{\@glsxtr@setupshortcuts}{} +\newcommand*{\@glsxtr@shortcutsval}{\ifglsacrshortcuts acro\else none\fi}% \define@choicekey{glossaries-extra.sty}{shortcuts}[\val\nr]% {acronyms,acro,abbreviations,abbr,other,all,true,none,false}[true]{% + \let\@glsxtr@shortcutsval\val \ifcase\nr\relax % acronyms \renewcommand*{\@glsxtr@setupshortcuts}{% \glsacrshortcutstrue @@ -370,15 +413,18 @@ \@glsxtr@abbreviationsdef \let\@glsxtr@abbreviationsdef\relax \@glsxtr@setupshortcuts +\@glsxtr@redef@forglsentries \renewcommand{\glsxtr@dooption}[1]{\setupglossaries{#1}}% \newcommand*{\glossariesextrasetup}[1]{% \let\glsxtr@setup@record\relax \let\@glsxtr@setupshortcuts\relax + \let\@glsxtr@redef@forglsentries\relax \setkeys{glossaries-extra.sty}{#1}% \@glsxtr@abbreviationsdef \let\@glsxtr@abbreviationsdef\relax \@glsxtr@setupshortcuts \glsxtr@setup@record + \@glsxtr@redef@forglsentries } \let\glsxtr@@do@wrglossary\@@do@wrglossary \let\glsxtr@saveentrycounter\@gls@saveentrycounter @@ -398,6 +444,34 @@ #2% }% } +\ifglsentrycounter + \newcommand*{\glsxtrpageref}[1]{\pageref{glsentry-\glsdetoklabel{#1}}} +\else + \ifglssubentrycounter + \newcommand*{\glsxtrpageref}[1]{\pageref{glsentry-\glsdetoklabel{#1}}} + \else + \newcommand*{\glsxtrpageref}[1]{\gls{#1}} + \fi +\fi +\let\glsxtr@org@newignoredglossary\newignoredglossary +\newcommand*{\glsxtr@s@newignoredglossary}[1]{% + \ifdefempty\@ignored@glossaries + {% + \edef\@ignored@glossaries{#1}% + }% + {% + \eappto\@ignored@glossaries{,#1}% + }% + \csgdef{glolist@#1}{,}% + \ifcsundef{gls@#1@entryfmt}% + {% + \defglsentryfmt[#1]{\glsentryfmt}% + }% + {}% +} +\renewcommand{\newignoredglossary}{% + \@ifstar\glsxtr@s@newignoredglossary\glsxtr@org@newignoredglossary +} \renewcommand{\glsdoifexists}[2]{% \ifglsentryexists{#1}{#2}% {% @@ -1539,7 +1613,33 @@ \def\@gls@alt@hyp@opt@keys{#2}% } \renewcommand*{\glsdohyperlink}[2]{% - \hyperlink{#1}{{\glsxtrprotectlinks#2}}} + \glshasattribute{\glslabel}{targeturl}% + {% + \glshasattribute{\glslabel}{targetname}% + {% + \glshasattribute{\glslabel}{targetcategory}% + {% + \hyperref{\glsgetattribute{\glslabel}{targeturl}}% + {\glsgetattribute{\glslabel}{targetcategory}}% + {\glsgetattribute{\glslabel}{targetname}}% + {{\glsxtrprotectlinks#2}}% + }% + {% + \hyperref{\glsgetattribute{\glslabel}{targeturl}}% + {}% + {\glsgetattribute{\glslabel}{targetname}}% + {{\glsxtrprotectlinks#2}}% + }% + }% + {% + \href{\glsgetattribute{\glslabel}{targeturl}}% + {{\glsxtrprotectlinks#2}}% + }% + }% + {% + \hyperlink{#1}{{\glsxtrprotectlinks#2}}% + }% +} \ifundef\glsdonohyperlink {% \renewcommand{\glsdisablehyper}{% @@ -2655,6 +2755,33 @@ }% }% \newcommand*{\@glsxtr@idx@entrynumberlist}[1]{\glsentrynumberlist{#1}} +\renewcommand*{\@print@noidx@glossary}{% + \ifcsdef{@glsref@\@glo@type}% + {% + \ifcsdef{@glo@sortmacro@\@glo@sorttype}% + {% + \csuse{@glo@sortmacro@\@glo@sorttype}{\@glo@type}% + }% + {% + \PackageError{glossaries}{Unknown sort handler `\@glo@sorttype'}{}% + }% + \glossarysection[\glossarytoctitle]{\glossarytitle}% + \glossarypreamble + \def\@gls@currentlettergroup{}% + \begin{theglossary}% + \glossaryheader + \glsresetentrylist + \forlistcsloop{\@gls@noidx@do}{@glsref@\@glo@type}% + \end{theglossary}% + \glossarypostamble + }% + {% + \glsxtrifemptyglossary{\@glo@type}% + {}% + {\glossarysection[\glossarytoctitle]{\glossarytitle}}% + \@gls@noref@warn{\@glo@type}% + }% +} \renewcommand{\@print@glossary}{% \makeatletter \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% @@ -2846,13 +2973,46 @@ } \newcommand*{\glsxtrresourcefile}[2][]{% \protected@write\@auxout{}{\string\glsxtr@resource{#1}{#2}}% - \InputIfFileExists{#2}{}% + \glsxtr@writefields + \let\@glsxtr@org@see@noindex\@gls@see@noindex + \let\@gls@see@noindex\relax + \InputIfFileExists{#2.glstex}{}% {% - \GlossariesExtraWarning{No file `#2'}% + \GlossariesExtraWarning{No file `#2.glstex'}% }% + \let\@gls@see@noindex\@glsxtr@org@see@noindex } \@onlypreamble\glsxtrresourcefile +\newcommand*{\GlsXtrLoadResources}[1][]{% + \glsxtrresourcefile[#1]{\jobname}% + \renewcommand*{\GlsXtrLoadResources}[1][]{% + \PackageError{glossaries-extra}% + {Only 1 \string\GlsXtrLoadResources\space permitted per + document. Use \string\glsxtrresourcefile\space for additional + resources}% + {}% + }% +} \newcommand*{\glsxtr@resource}[2]{} +\newcommand*{\glsxtr@fields}[1]{} +\newcommand*{\glsxtr@texencoding}[1]{} +\newcommand*{\glsxtr@shortcutsval}[1]{} +\newcommand*{\glsxtr@linkprefix}[1]{} +\newcommand*{\glsxtr@writefields}{% + \protected@write\@auxout{}{\string\glsxtr@fields{\@gls@keymap}}% + \ifdef\inputencodingname + {% + \protected@write\@auxout{}{\string\glsxtr@texencoding{\inputencodingname}}% + }% + {% + \@ifpackageloaded{fontspec}% + {\protected@write\@auxout{}{\string\glsxtr@texencoding{utf8}}}% + {}% + }% + \protected@write\@auxout{}{\string\glsxtr@shortcutsval{\@glsxtr@shortcutsval}}% + \protected@write\@auxout{}{\string\glsxtr@linkprefix{\glolinkprefix}}% + \let\glsxtr@writefields\relax +} \newcommand*{\printunsrtglossary}[1][type=\glsdefaulttype]{% \@printglossary{#1}{\@print@unsrt@glossary}% } @@ -2863,11 +3023,14 @@ \newcommand*{\@print@unsrt@glossary}{% \glossarysection[\glossarytoctitle]{\glossarytitle}% \glossarypreamble - \ifcsempty{glolist@\@glo@type} + \glsxtrifemptyglossary{\@glo@type}% {% - \GlossariesExtraWarning{No entries defined in glossary `\@glo@type'}% + \GlossariesExtraWarning{No entries defined in glossary `\@glo@type'}% }% {% + \key@ifundefined{glossentry}{group}% + {\let\@gls@getgrouptitle\@glsxtr@noidx@getgrouptitle}% + {\let\@gls@getgrouptitle\@glsxtr@unsrt@getgrouptitle}% \begin{theglossary}% \glossaryheader \glsresetentrylist @@ -2876,12 +3039,76 @@ :\expandafter=\csname glolist@\@glo@type\endcsname\do{% \ifdefempty{\glscurrententrylabel} {}% - {\@gls@noidx@do\glscurrententrylabel}% + {\@glsxtr@noidx@do\glscurrententrylabel}% }% \end{theglossary}% }% \glossarypostamble } +\newcommand*{\@glsxtr@unsrt@getgrouptitle}[2]{% + \def#2{#1}% +} +\newcommand{\@glsxtr@noidx@do}[1]{% + \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% + \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% + \ifglshasparent{#1}% + {% + \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax + \ifdefvoid{\@gls@location}% + {% + \ifdefvoid{\@gls@loclist}% + {% + \subglossentry{\gls@level}{#1}{}% + }% + {% + \subglossentry{\gls@level}{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% + {% + \subglossentry{\gls@level}{#1}{\glossaryentrynumbers{\@gls@location}}% + }% + }% + {% + \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% + \key@ifundefined{glossentry}{group}% + {% + \expandafter\glo@grabfirst\@gls@sort{}{}\@nil + }% + {% + \protected@xdef\@glo@thislettergrp{% + \csname glo@\glsdetoklabel{#1}@group\endcsname}% + }% + \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% + {}% + {% + \ifdefempty{\@gls@currentlettergroup}{}{\glsgroupskip}% + \glsgroupheading{\@glo@thislettergrp}% + }% + \let\@gls@currentlettergroup\@glo@thislettergrp + \ifdefvoid{\@gls@location}% + {% + \ifdefvoid{\@gls@loclist} + {% + \glossentry{#1}{}% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\glsnoidxloclist{\@gls@loclist}}% + }% + }% + }% + {% + \glossentry{#1}% + {% + \glossaryentrynumbers{\@gls@location}% + }% + }% + }% +} \@ifpackageloaded{glossaries-accsupp} { \newcommand*{\glsaccessname}[1]{% |