From 6813a65f77dac6a12c0545b6ccd2bc53d8c33cbb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 19 Mar 2020 21:56:15 +0000 Subject: glossaries (19mar20) git-svn-id: svn://tug.org/texlive/trunk@54402 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/glossaries/glossaries.dtx | 156 +++++++++++++++------ .../source/latex/glossaries/glossaries.ins | 2 +- 2 files changed, 116 insertions(+), 42 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index bd6811d3207..b0d0914db28 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -1,12 +1,15 @@ %\iffalse % glossaries.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: +% -setambles ".*\.perl=>\nopreamble\nopostamble" +% -setambles ".*\.tex=>\nopreamble\nopostamble" % -section "chapter" -% -macrocode ".*\.perl" -% -macrocode ".*\.tex" % -doc "glossaries-manual.tex" % -codetitle "Main Package Code" -% -author "Nicola Talbot" +% -comment ".*\.perl" +% -comment ".*\.tex" +% -macrocode ".*\.perl" +% -macrocode ".*\.tex" % -src "glossaries\.sty\Z=>glossaries.sty" % -src "glossaries-prefix.sty\Z=>glossaries-prefix.sty" % -src "(glossary-.+)\.(sty)\Z=>\1.\2" @@ -17,12 +20,9 @@ % -src "(glossaries-polyglossia)\.(sty)\Z=>\1.\2" % -src "(example-glossaries-.*\.tex)\Z=>\1" % -src "(.*\.perl)\Z=>\1" -% -comment ".*\.perl" -% -comment ".*\.tex" -% -setambles ".*\.perl=>\nopreamble\nopostamble" -% -setambles ".*\.tex=>\nopreamble\nopostamble" +% -author "Nicola Talbot" % glossaries -% Created on 2020/2/14 0:32 +% Created on 2020/3/19 17:03 %\fi %\iffalse %<*package> @@ -136,7 +136,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{20333} +\CheckSum{20358} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -163,12 +163,12 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %\fi %\MakeShortVerb{"} % -% \title{Documented Code For glossaries v4.45} +% \title{Documented Code For glossaries v4.46} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2020-02-13} +% \date{2020-03-19} % \maketitle % %This is the documented code for the \styfmt{glossaries} package. @@ -184,7 +184,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %glossaries package}. % %\item[\url{glossaries-user.pdf}] -%For the main user guide, read \qt{glossaries.sty v4.45: +%For the main user guide, read \qt{glossaries.sty v4.46: %\LaTeX2e\ Package to Assist Generating Glossaries}. % %\item[\url{mfirstuc-manual.pdf}] @@ -239,7 +239,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} %\changes{4.18}{2015-09-09}{split mfirstuc into separate bundle} % Required packages: @@ -3367,15 +3367,12 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{definition} % Code provided by Michael Pock. %\changes{3.07}{2013-07-05}{new} +%\changes{4.46}{2020-03-19}{switched to starred form of \cs{ifglossaryexists}} % \begin{macrocode} \newcommand{\setglossarypreamble}[2][\glsdefaulttype]{% - \ifglossaryexists{#1}{% - \csgdef{@glossarypreamble@#1}{#2}% - }{% - \GlossariesWarning{% - Glossary `#1' is not defined% - }% - }% + \ifglossaryexists*{#1}% + {\csgdef{@glossarypreamble@#1}{#2}}% + {\GlossariesWarning{Glossary `#1' is not defined}}% } % \end{macrocode} %\end{macro} @@ -4159,6 +4156,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Define a command that allows the user to set the language % for a given glossary type. The first argument indicates the % glossary type. If omitted the main glossary is assumed. +% This uses the unstarred form of \cs{ifglossaryexists} because +% ignored glossaries can't be used with xindy. % \begin{macrocode} \ifglsxindy \newcommand*\GlsSetXdyLanguage[2][\glsdefaulttype]{% @@ -4315,13 +4314,37 @@ false,nolabel,autolabel,nameref}[nolabel]{% %where \meta{type} is the glossary's label. %\changes{3.0}{2011-04-02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} +%\changes{4.46}{2020-03-19}{added starred form} +%The unstarred form will do \meta{false-text} for ignored +%glossaries. The starred form will do \meta{true-text} for ignored +%glossaries. +% \begin{macrocode} +\newcommand{\ifglossaryexists}{% + \@ifstar\s@ifglossaryexists\@ifglossaryexists +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@ifglossaryexists} +%\changes{4.46}{2020-03-19}{new} +% Unstarred form only tests the existence of non-ignored glossaries. % \begin{macrocode} -\newcommand{\ifglossaryexists}[3]{% +\newcommand{\@ifglossaryexists}[3]{% \ifcsundef{@glotype@#1@out}{#3}{#2}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\s@ifglossaryexists} +%\changes{4.46}{2020-03-19}{new} +% Starred form includes ignored glossaries. +% \begin{macrocode} +\newcommand{\s@ifglossaryexists}[3]{% + \ifcsundef{glolist@#1}{#3}{#2}% +} +% \end{macrocode} +%\end{macro} +% % Since the label is used to form the name of control sequences, by % default UTF8 etc characters can't be used in the label. A possible % workaround is to use \ics{scantokens}, but commands such as @@ -4455,9 +4478,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{4.19}{2015-11-22}{new} %If glossary given by \meta{label} doesn't exist do \meta{code} %otherwise generate an error and do \meta{else code}. +%\changes{4.46}{2020-03-19}{switched to starred form of \cs{ifglossaryexists}} % \begin{macrocode} \newcommand{\doifglossarynoexistsordo}[3]{% - \ifglossaryexists{#1}% + \ifglossaryexists*{#1}% {% \PackageError{glossaries}{Glossary type `#1' already exists}{}% #3% @@ -13100,6 +13124,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % file). The relevant glossary must be defined prior to using \cs{@makeglossary}. % \sty{glossaries-extra} allows for a hybrid approach. %\begin{macro}{\@makeglossary} +%Unstarred form of \cs{ifglossaryexists} is used as +%\cs{@makeglossary} can't be used with an ignored glossary. % \begin{macrocode} \newcommand*{\@makeglossary}[1]{% \ifglossaryexists{#1}% @@ -13149,6 +13175,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@automake} %\changes{4.08}{2014-07-30}{new} +%Unstarred form of \cs{ifglossaryexists} is used as +%\cs{@gls@automake} can't be used with an ignored glossary. % \begin{macrocode} \ifglsxindy \newcommand*{\@gls@automake}[1]{% @@ -13203,6 +13231,8 @@ false,nolabel,autolabel,nameref}[nolabel]{% % %\begin{macro}{\@gls@automake@immediate} %\changes{4.42}{2019-01-06}{new} +%Unstarred form of \cs{ifglossaryexists} is used as +%\cs{@gls@automake@immediate} can't be used with an ignored glossary. % \begin{macrocode} \ifglsxindy \newcommand*{\@gls@automake@immediate}[1]{% @@ -14557,11 +14587,51 @@ you \undef\printglossary } % \end{macrocode} +% Neither \cs{printglossary} nor \cs{printnoidxglossary} can work +% with an ignored glossary (since ignored glossaries normally +% suppress indexing and there's no associated file for +% \gls{makeindex}/\gls{xindy} to process). However \cs{printunsrtglossary} can be used +% with an ignored glossary, so provide a command to warn if the +% glossary doesn't exist or is an ignored glossary. +%\begin{macro}{\@printgloss@checkexists@noignored} +%\changes{4.46}{2020-03-19}{new} +% \begin{macrocode} +\newcommand*{\@printgloss@checkexists@noignored}[2]{% + \@ifglossaryexists{#1}% + {#2}% + {% + \ifignoredglossary{#1}% + {\GlossariesWarning{Glossary `#1' is an ignored glossary}}% + {\GlossariesWarning{Glossary `#1' doesn't exist}}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@printgloss@checkexists@allowignored} +%\changes{4.46}{2020-03-19}{new} +%For use with \cs{printunsrtglossary}. +% \begin{macrocode} +\newcommand*{\@printgloss@checkexists@allowignored}[2]{% + \s@ifglossaryexists{#1}% + {#2}% + {\GlossariesWarning{Glossary `#1' doesn't exist}}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@printgloss@checkexists} +%\changes{4.46}{2020-03-19}{new} +% \begin{macrocode} +\let\@printgloss@checkexists\@printgloss@checkexists@noignored +% \end{macrocode} +%\end{macro} +% +% % \cs{printglossary} has an optional argument. The default % value is to set the glossary type to the main glossary. %\changes{4.04}{2014-03-06}{changed to use new \cs{@printglossary}} % \begin{macrocode} \newcommand*{\printglossary}[1][type=\glsdefaulttype]{% + \let\@printgloss@checkexists\@printgloss@checkexists@noignored \@printglossary{#1}{\@print@glossary}% } % \end{macrocode} @@ -14593,6 +14663,7 @@ you % location list will be empty. % \begin{macrocode} \newcommand*{\printnoidxglossary}[1][type=\glsdefaulttype]{% + \let\@printgloss@checkexists\@printgloss@checkexists@noignored \@printglossary{#1}{\@print@noidx@glossary}% } % \end{macrocode} @@ -14629,7 +14700,9 @@ you % Sets up the glossary for either \cs{printglossary} or % \cs{printnoidxglossary}. The first argument is the options list, % the second argument is the handler macro that -% deals with the actual glossary. +% deals with the actual glossary. This is also used by +% \sty{glossaries-extra}'s \ics{printunsrtglossary} which may be +% used with an ignored glossary. % \begin{macrocode} \newcommand{\@printglossary}[2]{% % \end{macrocode} @@ -14675,8 +14748,10 @@ you \setkeys{printgloss}{#1}% % \end{macrocode} % Does the glossary exist? +%\changes{4.46}{2020-03-19}{replaced \cs{ifglossaryexists} with +%\cs{@printgloss@checkexists}} % \begin{macrocode} - \ifglossaryexists{\@glo@type}% + \@printgloss@checkexists{\@glo@type}% {% % \end{macrocode} % If title has been set, but toctitle hasn't, make toctitle the same @@ -14742,7 +14817,6 @@ you % \begin{macrocode} #2% }% - {\GlossariesWarning{Glossary `\@glo@type' doesn't exist}}% % \end{macrocode} % End the current scope % \begin{macrocode} @@ -19414,7 +19488,7 @@ you % \cs{gls}\marg{label}} on subsequent use. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-prefix}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries-prefix}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Pass all options to \sty{glossaries}: % \begin{macrocode} @@ -19879,7 +19953,7 @@ you %\label{sec:code:hypernav} % Package Definition: % \begin{macrocode} -\ProvidesPackage{glossary-hypernav}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-hypernav}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % % The commands defined in this package are provided to @@ -20075,7 +20149,7 @@ you % This defines an in-line style where the entries are % comma-separated with just the name and description displayed. % \begin{macrocode} -\ProvidesPackage{glossary-inline}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-inline}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % %\begin{style}{inline} @@ -20266,7 +20340,7 @@ you % \ics{item} command, it will appear in a bold font by % default. % \begin{macrocode} -\ProvidesPackage{glossary-list}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-list}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} %\begin{macro}{\indexspace} %\changes{4.13}{2015-02-03}{new} @@ -20548,7 +20622,7 @@ you % The glossary styles defined in the \isty{glossary-long} package % used the \env{longtable} environment in the glossary. % \begin{macrocode} -\ProvidesPackage{glossary-long}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-long}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Requires the \isty{longtable} package: % \begin{macrocode} @@ -21045,7 +21119,7 @@ you % \url{http://tex.stackexchange.com/a/56890} % % \begin{macrocode} -\ProvidesPackage{glossary-longbooktabs}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-longbooktabs}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Requires \sty{booktabs} package: % \begin{macrocode} @@ -21386,7 +21460,7 @@ you % used the \env{longtable} environment in the glossary and use % ragged right formatting for the multiline columns. % \begin{macrocode} -\ProvidesPackage{glossary-longragged}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-longragged}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Requires the \isty{array} package: % \begin{macrocode} @@ -21819,7 +21893,7 @@ you %use the \sty{multicol} package. These use the tree-like glossary %styles in a multicol environment. % \begin{macrocode} -\ProvidesPackage{glossary-mcols}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-mcols}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -22256,7 +22330,7 @@ you % The glossary styles defined in the \isty{glossary-super} package % use the \env{supertabular} environment. % \begin{macrocode} -\ProvidesPackage{glossary-super}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-super}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Requires the \isty{supertabular} package: % \begin{macrocode} @@ -22788,7 +22862,7 @@ you % are like those provided by the \isty{glossary-super} package, % except that the multiline columns have ragged right justification. % \begin{macrocode} -\ProvidesPackage{glossary-superragged}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-superragged}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Requires the \isty{array} package: % \begin{macrocode} @@ -23228,7 +23302,7 @@ you % that have a tree-like structure. These are designed for % hierarchical glossaries. % \begin{macrocode} -\ProvidesPackage{glossary-tree}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossary-tree}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % %\begin{macro}{\indexspace} @@ -23949,7 +24023,7 @@ you % hyperlinks may not work properly. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-207}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries-compatible-207}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} %\begin{macro}{\GlsAddXdyAttribute} % Adds an attribute in old format. @@ -24310,7 +24384,7 @@ you %\section{glossaries-compatible-307} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-307}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries-compatible-307}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % % Compatibility macros for predefined glossary styles: @@ -25118,7 +25192,7 @@ you % \end{macrocode} % Package version number now in line with main glossaries package number. % \begin{macrocode} -\ProvidesPackage{glossaries-accsupp}[2020/02/13 v4.45 (NLCT) +\ProvidesPackage{glossaries-accsupp}[2020/03/19 v4.46 (NLCT) Experimental glossaries accessibility] % \end{macrocode} % Pass all options to \sty{glossaries}: @@ -28424,7 +28498,7 @@ you % modules. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-babel}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries-babel}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Load \sty{tracklang} to obtain language settings. % \begin{macrocode} @@ -28468,7 +28542,7 @@ you % modules. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-polyglossia}[2020/02/13 v4.45 (NLCT)] +\ProvidesPackage{glossaries-polyglossia}[2020/03/19 v4.46 (NLCT)] % \end{macrocode} % Load \sty{tracklang} to obtain language settings. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index ced7110daa1..30d939a39ec 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.ins +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.ins @@ -1,4 +1,4 @@ -% glossaries.ins generated using makedtx version 1.2 2020/2/14 0:32 +% glossaries.ins generated using makedtx version 1.2 2020/3/19 17:03 \input docstrip \preamble -- cgit v1.2.3