diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty | 143 |
1 files changed, 108 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty index 490dc9f04b7..045b63c8ba8 100644 --- a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty +++ b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, minimalgls.tex, glossary-lipsum-examples.tex, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, sample-chap-hyperfirst.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dot-abbr.tex, sample-dual.tex, sample-entrycount.tex, sample-entryfmt.tex, sample-FnDesc.tex, sample-font-abbr.tex, sample-ignored.tex, sample-index.tex, sample-inline.tex, sample-langdict.tex, sample-newkeys.tex, sample-noidxapp-utf8.tex, sample-noidxapp.tex, sample-nomathhyper.tex, sample-numberlist.tex, sample-prefix.tex, sample-si.tex, sample-storage-abbr-desc.tex, sample-storage-abbr.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleCustomAcr.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleFnAcrDesc.tex, sampleNtn.tex, samplePeople.tex, sampleSec.tex, sampleSort.tex, sampletree.tex, sampleutf8.tex, samplexdy.tex, samplexdy2.tex, mwe-acr-desc.tex, mwe-acr.tex, mwe-gls.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longbooktabs.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, minimalgls.tex, glossary-lipsum-examples.tex, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbolnames.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, sample-chap-hyperfirst.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dot-abbr.tex, sample-dual.tex, sample-entrycount.tex, sample-entryfmt.tex, sample-FnDesc.tex, sample-font-abbr.tex, sample-ignored.tex, sample-index.tex, sample-inline.tex, sample-langdict.tex, sample-newkeys.tex, sample-noidxapp-utf8.tex, sample-noidxapp.tex, sample-nomathhyper.tex, sample-numberlist.tex, sample-prefix.tex, sample-si.tex, sample-storage-abbr-desc.tex, sample-storage-abbr.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleCustomAcr.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleFnAcrDesc.tex, sampleNtn.tex, samplePeople.tex, sampleSec.tex, sampleSort.tex, sampletree.tex, sampleutf8.tex, samplexdy.tex, samplexdy2.tex, samplexdy3.tex, mwe-acr-desc.tex, mwe-acr.tex, mwe-gls.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl. %% %% \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}[2017/08/24 v4.32 (NLCT)] +\ProvidesPackage{glossaries}[2017/09/20 v4.33 (NLCT)] \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} @@ -102,10 +102,18 @@ \newcommand*{\@gls@see@noindex}{% \PackageError{glossaries}% {`\gls@xr@key' key may only be used after \string\makeglossaries\space - or \string\makenoidxglossaries}% + or \string\makenoidxglossaries\space (or move + \string\newglossaryentry\space + definitions into the preamble)}% {You must use \string\makeglossaries\space or \string\makenoidxglossaries\space before defining - any entries that have a `\gls@xr@key' key}% + any entries that have a `\gls@xr@key' key. It may + be that the `see' key has been written to the .glsdefs + file from the previous run, in which case you need to + move your definitions + to the preamble if you don't want to use + \string\makeglossaries\space + or \string\makenoidxglossaries}% } \define@choicekey{glossaries.sty}{seenoindex}[\val\nr]{error,warn,ignore}{% \ifcase\nr @@ -177,6 +185,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% \def\@glo@prefix{\glsnextpages}% }% } +\define@boolkey{glossaries.sty}[gls]{esclocations}[true]{} +\glsesclocationstrue \newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}} \@gls@declareoption{nolong}{\renewcommand*{\@gls@loadlong}{}} \IfFileExists{supertabular.sty}{% @@ -437,8 +447,19 @@ false,nolabel,autolabel,nameref}[nolabel]{% \renewcommand*{\GlossariesWarning}[1]{}% \renewcommand*{\GlossariesWarningNoLine}[1]{}% \renewcommand*{\glosortentrieswarning}{}% + \renewcommand*{\@gls@missinglang@warn}[2]{}% \fi } +\newcommand*{\@gls@missinglang@warn}[2]{% + \PackageWarningNoLine{glossaries}% + {No language module detected for `#1'.\MessageBreak + Language modules need to be installed separately.\MessageBreak + Please check on CTAN for a bundle called\MessageBreak + `glossaries-#2' or similar}% +} +\@gls@declareoption{nolangwarn}{% + \renewcommand*{\@gls@missinglang@warn}[2]{}% +} \newcommand*{\@gls@warnonglossdefined}{% \GlossariesWarning{Overriding \string\printglossary}% } @@ -948,11 +969,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \RequireGlossariesLang{\CurrentTrackedTag}% }% {% - \PackageWarningNoLine{glossaries}% - {No language module detected for `\this@dialect'.\MessageBreak - Language modules need to be installed separately.\MessageBreak - Please check on CTAN for a bundle called\MessageBreak - `glossaries-\CurrentTrackedLanguage' or similar}% + \@gls@missinglang@warn\this@dialect\CurrentTrackedLanguage }% }% }% @@ -1447,7 +1464,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \string"2\string" \string"3\string" \string"4\string" \string"5\string" \string"6\string" \string"7\string" \string"8\string" \string"9\string")^^J\space\space\space - :before \string"\@glsfirstletter\string")} + \@xdynumbergrouporder)} \else \def\@xdylettergroups{} \fi @@ -4637,12 +4654,41 @@ false,nolabel,autolabel,nameref}[nolabel]{% \ifglsxindy \newcommand*{\@glsfirstletter}{A} \fi +\newcommand*{\GlsSetXdyFirstLetterAfterDigits}{% + \@ifstar\s@GlsSetXdyFirstLetterAfterDigits\@GlsSetXdyFirstLetterAfterDigits} \ifglsxindy - \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% \renewcommand*{\@glsfirstletter}{#1}} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}% + \@onelevel@sanitize\@glsfirstletter + } \else - \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% + \newcommand*{\@GlsSetXdyFirstLetterAfterDigits}[1]{% \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} + \newcommand*{\s@GlsSetXdyFirstLetterAfterDigits}{% + \@GlsSetXdyFirstLetterAfterDigits + } +\fi +\ifglsxindy + \newcommand*{\@xdynumbergrouporder}{:before \string"\@glsfirstletter\string"} +\fi +\newcommand*{\GlsSetXdyNumberGroupOrder}[1]{% + \@ifstar\s@GlsSetXdyNumberGroupOrder\@GlsSetXdyNumberGroupOrder +} +\ifglsxindy + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + } + \newcommand*{\s@GlsSetXdyNumberGroupOrder}[1]{% + \renewcommand*{\@xdynumbergrouporder}{#1}% + \@onelevel@sanitize\@xdynumbergrouporder + } +\else + \newcommand*{\@GlsSetXdyNumberGroupOrder}[1]{% + \glsnoxindywarning\GlsSetXdyNumberGroupOrder} + \newcommand*{\s@GlsSetXdyNumberGroupOrder}{% + \@GlsSetXdyNumberGroupOrder} \fi \newcommand*{\@glsminrange}{2} \ifglsxindy @@ -5402,33 +5448,56 @@ you \newcommand{\@wrglossary@pageformat}[3]{% \ifx#3\c@page #1\else #2#3\fi } +\newcommand*{\@@do@wrglossary}[1]{% + \ifglsesclocations + \@@do@esc@wrglossary{#1}% + \else + \@@do@noesc@wrglossary{#1}% + \fi +} +\newcommand*{\@@do@noesc@wrglossary}[1]{% + \expandafter\def\expandafter\@glslocref\expandafter{\theglsentrycounter}% + \expandafter\def\expandafter\@glsHlocref\expandafter{\theHglsentrycounter}% + \ifx\@glsHlocref\@glslocref + \def\@glo@counterprefix{}% + \else + \protected@edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\@glslocref}{\@glsHlocref}% + }% + \@do@gls@getcounterprefix + \fi + \edef\@gls@label{\glsdetoklabel{#1}}% + \@@do@@wrglossary +} \newif\ifglswrallowprimitivemods \glswrallowprimitivemodstrue -\newcommand*{\@@do@wrglossary}[1]{% +\newcommand*{\@@do@esc@wrglossary}[1]{% please read documented code! \begingroup - \let\orgthe\the - \let\orgnumber\number - \let\orgarabic\@arabic - \let\orgromannumeral\romannumeral - \let\orgalph\@alph - \let\orgAlph\@Alph - \let\orgRoman\@Roman + \let\gls@orgthe\the + \let\gls@orgnumber\number + \let\gls@orgarabic\@arabic + \let\gls@orgromannumeral\romannumeral + \let\gls@orgalph\@alph + \let\gls@orgAlph\@Alph + \let\gls@orgRoman\@Roman \ifglswrallowprimitivemods - \def\the##1{% - \ifx##1\c@page \gls@numberpage\else\orgthe##1\fi}% - \def\number##1{% - \ifx##1\c@page \gls@numberpage\else\orgnumber##1\fi}% + \def\gls@the##1{% + \ifx##1\c@page \gls@numberpage\else\gls@orgthe##1\fi}% + \def\the{\expandafter\gls@the}% + \def\gls@number##1{% + \ifx##1\c@page \gls@numberpage\else\gls@orgnumber##1\fi}% + \def\number{\expandafter\gls@number}% \fi \def\@arabic##1{% - \ifx##1\c@page \gls@arabicpage\else\orgarabic##1\fi}% + \ifx##1\c@page \gls@arabicpage\else\gls@orgarabic##1\fi}% \def\romannumeral##1{% - \ifx##1\c@page \gls@romanpage\else\orgromannumeral##1\fi}% + \ifx##1\c@page \gls@romanpage\else\gls@orgromannumeral##1\fi}% \def\@Roman##1{% - \ifx##1\c@page \gls@Romanpage\else\orgRoman##1\fi}% + \ifx##1\c@page \gls@Romanpage\else\gls@orgRoman##1\fi}% \def\@alph##1{% - \ifx##1\c@page \gls@alphpage\else\orgalph##1\fi}% + \ifx##1\c@page \gls@alphpage\else\gls@orgalph##1\fi}% \def\@Alph##1{% - \ifx##1\c@page \gls@Alphpage\else\orgAlph##1\fi}% + \ifx##1\c@page \gls@Alphpage\else\gls@orgAlph##1\fi}% \@wrglossarynumberhook \gls@disablepagerefexpansion \protected@xdef\@glslocref{\theglsentrycounter}% @@ -5596,13 +5665,15 @@ you \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% \let\@org@glossaryentrynumbers\glossaryentrynumbers \bgroup - \@printgloss@setsort - \setkeys{printgloss}{#1}% - \ifx\glossarytitle\org@glossarytitle - \else - \expandafter\let\csname @glotype@\@glo@type @title\endcsname + \@printgloss@setsort + \setkeys{printgloss}{#1}% + \ifglossaryexists{\@glo@type}% + {% + \ifx\glossarytitle\org@glossarytitle + \else + \expandafter\let\csname @glotype@\@glo@type @title\endcsname \glossarytitle - \fi + \fi \let\currentglossary\@glo@type \let\org@glossaryentrynumbers\glossaryentrynumbers \let\glsnonextpages\@glsnonextpages @@ -5622,6 +5693,8 @@ you }% \@gls@preglossaryhook #2% + }% + {\GlossariesWarning{Glossary `\@glo@type' doesn't exist}}% \egroup \global\let\glossaryentrynumbers\@org@glossaryentrynumbers \global\let\warn@noprintglossary\relax |