diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-18 22:00:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-18 22:00:18 +0000 |
commit | a2108d8fb8bcdf43db03cb2bd3a7d9ebde44e634 (patch) | |
tree | da8b60a49916f9313a9325943dd48c8250f5ef06 /Master/texmf-dist/tex | |
parent | 0bac232781697b3a0f1796a6264fd68bffc4a6ee (diff) |
glossaries-extra (18jun16)
git-svn-id: svn://tug.org/texlive/trunk@41486 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-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 | 75 |
2 files changed, 64 insertions, 15 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 ef638614c51..a354a746026 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 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2016/06/10 v1.05 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2016/06/18 v1.06 (NLCT)] \newcommand*{\@glsxtr@loadstyles}{} \DeclareOption*{% \IfFileExists{glossary-\CurrentOption.sty} @@ -293,7 +293,7 @@ \glossentrydesc{#1}\glspostdescription \space #2\par }% } -\newlength\glsxtrAltTreeIndent + \newlength\glsxtrAltTreeIndent \newcommand{\glsxtrAltTreePar}{% \@@par \glsxtrAltTreeSetHangIndent 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 26e052d1c64..10001a2fc31 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/10 v1.05 (NLCT)] +\ProvidesPackage{glossaries-extra}[2016/06/18 v1.06 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{etoolbox} \@ifpackageloaded{glossaries} @@ -93,7 +93,20 @@ \renewcommand*{\glsxtr@warnonexistsordo}[1]{}% \fi } -\define@boolkey{glossaries-extra.sty}[@glsxtr]{docdef}[true]{} +\newcount\@glsxtr@docdefval +\newcommand*{\if@glsxtrdocdef}{\ifnum\@glsxtr@docdefval>0 } +\newcommand*{\@glsxtrdocdeftrue}{\@glsxtr@docdefval=1 } +\newcommand*{\@glsxtrdocdeffalse}{\@glsxtr@docdefval=0 } +\define@choicekey{glossaries-extra.sty}{docdef}[\val\nr]% + {false,true,restricted}[true]% +{% + \@glsxtr@docdefval=\nr\relax + \ifnum\@glsxtr@docdefval=2\relax + \renewcommand*{\@glsdoifexistsorwarn}{\glsdoifexists}% + \fi +} +\newcommand*{\if@glsxtrdocdefrestricted}{\ifnum\@glsxtr@docdefval=2 } +\newcommand*{\@glsdoifexistsorwarn}{\glsdoifexistsorwarn} \define@boolkey{glossaries-extra.sty}[@glsxtr]{indexcrossrefs}[true]{% \if@glsxtrindexcrossrefs \else @@ -283,7 +296,7 @@ \@glsxtr@setupshortcuts } \AtBeginDocument{% - \disable@keys{glossaries-extra.sty}{abbreviations}% + \disable@keys{glossaries-extra.sty}{abbreviations,docdef}% \def\@glsxtrundeftag{\glsxtrundeftag}% } \newcommand{\glsxtrifemptyglossary}[3]{% @@ -365,6 +378,26 @@ }% } \appto\@gls@keymap{,{see}{see}} +\newcommand*{\glsxtrusesee}[1]{% + \glsdoifexists{#1}% + {% + \letcs{\@glo@see}{glo@\glsdetoklabel{#1}@see}% + \ifdefempty\@glo@see + {}% + {% + \expandafter\glsxtr@usesee\@glo@see\@end@glsxtr@usesee + }% + }% +} +\newcommand*{\glsxtr@usesee}[1][\seename]{% + \@glsxtr@usesee[#1]% +} +\def\@glsxtr@usesee[#1]#2\@end@glsxtr@usesee{% + \glsxtruseseeformat{#1}{#2}% +} +\newcommand*{\glsxtruseseeformat}[2]{% + \glsseeformat[#1]{#2}{}% +} \AtEndDocument{\if@glsxtrindexcrossrefs\glsxtraddallcrossrefs\fi} \newcommand*{\glsxtraddallcrossrefs}{% \forallglossaries{\@glo@type}% @@ -401,21 +434,37 @@ \let\glsxtr@orgmakenoidxglossaries\makenoidxglossaries \renewcommand{\makenoidxglossaries}{% \glsxtr@orgmakenoidxglossaries - \@glsxtrdocdeffalse + \if@glsxtrdocdefrestricted + \renewcommand*{\@gls@reference}[3]{% + \ifcsundef{@glsref@##1}{\csgdef{@glsref@##1}{}}{}% + \ifinlistcs{##2}{@glsref@##1}% + {}% + {\listcsgadd{@glsref@##1}{##2}}% + \ifcsundef{glo@\glsdetoklabel{##2}@loclist}% + {\csgdef{glo@\glsdetoklabel{##2}@loclist}{}}% + {}% + \listcsgadd{glo@\glsdetoklabel{##2}@loclist}{##3}% + }% + \else + \@glsxtrdocdeffalse + \fi \disable@keys{glossaries-extra.sty}{docdef}% } \renewcommand*{\gls@defdocnewglossaryentry}{% - \if@glsxtrdocdef - \let\gls@checkseeallowed\relax - \let\newglossaryentry\new@glossaryentry - \else + \ifcase\@glsxtr@docdefval \renewcommand*{\newglossaryentry}[2]{% \PackageError{glossaries-extra}{Glossary entries must be \MessageBreak defined in the preamble with \MessageBreak - package option `docdef=false'}{Move your glossary definitions to + package option `docdef=false'\MessageBreak(consider using + `docdef=restricted')}{Move your glossary definitions to the preamble. You can also put them in a \MessageBreak separate file and load them with \string\loadglsentries.}% }% + \or + \let\gls@checkseeallowed\relax + \let\newglossaryentry\new@glossaryentry + \or + \let\gls@checkseeallowed\relax \fi }% \newcommand*{\GlsXtrEnableOnTheFly}{% @@ -2869,7 +2918,7 @@ want \@ifpackageloaded{glossaries-accsupp} { \renewcommand*{\glossentryname}[1]{% - \glsdoifexistsorwarn{#1}% + \@glsdoifexistsorwarn{#1}% {% \glssetabbrvfmt{\glscategory{#1}}% \glshasattribute{#1}{glossnamefont}% @@ -2931,7 +2980,7 @@ want } { \renewcommand*{\glossentryname}[1]{% - \glsdoifexistsorwarn{#1}% + \@glsdoifexistsorwarn{#1}% {% \glssetabbrvfmt{\glscategory{#1}}% \glshasattribute{#1}{glossnamefont}% @@ -2978,7 +3027,7 @@ want \@ifpackageloaded{glossaries-accsupp} { \renewcommand*{\Glossentryname}[1]{% - \glsdoifexistsorwarn{#1}% + \@glsdoifexistsorwarn{#1}% {% \glssetabbrvfmt{\glscategory{#1}}% \glshasattribute{#1}{glossnamefont}% @@ -3007,7 +3056,7 @@ want } { \renewcommand*{\Glossentryname}[1]{% - \glsdoifexistsorwarn{#1}% + \@glsdoifexistsorwarn{#1}% {% \glssetabbrvfmt{\glscategory{#1}}% \glshasattribute{#1}{glossnamefont}% |