diff options
author | Karl Berry <karl@freefriends.org> | 2015-11-23 23:06:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-11-23 23:06:47 +0000 |
commit | 219a6681d9767fea37c5ac397e7a1d58d0367bbb (patch) | |
tree | dcbda55e12ff3617b765fbd284e111b0aa62dd3e /Master/texmf-dist/source/latex/glossaries/glossaries.dtx | |
parent | 10e6d3f05da678388e44f25765c633b29fe6e170 (diff) |
glossaries (22nov15)
git-svn-id: svn://tug.org/texlive/trunk@38933 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries/glossaries.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries/glossaries.dtx | 230 |
1 files changed, 152 insertions, 78 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index 69d45f0ea79..12b79cffba3 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -1,6 +1,18 @@ %\iffalse % glossaries.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: +% -codetitle "Main Package Code" +% -doc "glossaries-manual.tex" +% -comment ".*\.perl" +% -comment ".*\.tex" +% -comment ".*\.xdy" +% -author "Nicola Talbot" +% -setambles ".*\.perl=>\nopreamble\nopostamble" +% -setambles ".*\.tex=>\nopreamble\nopostamble" +% -setambles ".*\.xdy=>\nopreamble\nopostamble" +% -macrocode ".*\.perl" +% -macrocode ".*\.tex" +% -macrocode ".*\.xdy" % -src "glossaries.sty\Z=>glossaries.sty" % -src "glossaries-prefix.sty\Z=>glossaries-prefix.sty" % -src "(glossary-.+)\.(sty)\Z=>\1.\2" @@ -16,20 +28,8 @@ % -src "(samplexdy-mc.*\.xdy)\Z=>\1" % -src "(database.*\.tex)\Z=>\1" % -src "(.*\.perl)\Z=>\1" -% -author "Nicola Talbot" -% -comment ".*\.perl" -% -comment ".*\.tex" -% -comment ".*\.xdy" -% -codetitle "Main Package Code" -% -macrocode ".*\.perl" -% -macrocode ".*\.tex" -% -macrocode ".*\.xdy" -% -doc "glossaries-manual.tex" -% -setambles ".*\.perl=>\nopreamble\nopostamble" -% -setambles ".*\.tex=>\nopreamble\nopostamble" -% -setambles ".*\.xdy=>\nopreamble\nopostamble" % glossaries -% Created on 2015/9/9 16:00 +% Created on 2015/11/22 15:06 %\fi %\iffalse %<*package> @@ -139,7 +139,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{18081} +\CheckSum{18104} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -167,12 +167,12 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{Documented Code For glossaries v4.18} +% \title{Documented Code For glossaries v4.19} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2015-09-09} +% \date{2015-11-22} % \maketitle % %This is the documented code for the \styfmt{glossaries} package. @@ -188,7 +188,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.18: +%For the main user guide, read \qt{glossaries.sty v4.19: %\LaTeX2e\ Package to Assist Generating Glossaries}. % %\item[\url{mfirstuc-manual.pdf}] @@ -247,7 +247,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} %\changes{4.18}{2015-09-09}{split mfirstuc into separate bundle} % Required packages: @@ -2447,6 +2447,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand*{\@no@post@desc}{\nopostdesc} % \end{macrocode} %\end{macro} +% %\begin{macro}{\glspar} % Provide means of having a paragraph break in glossary entries % \begin{macrocode} @@ -3707,6 +3708,44 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsdoifexistsordo} +%\begin{definition} +%\cs{glsdoifexistsordo}\marg{label}\marg{code}\marg{undef code} +%\end{definition} +% Generate an error and do \meta{undef code} if entry specified by \meta{label} doesn't +% exists, otherwise do \meta{code}. +%\changes{4.19}{2015-11-22}{new} +% \begin{macrocode} +\newcommand{\glsdoifexistsordo}[3]{% + \ifglsentryexists{#1}{#2}{% + \PackageError{glossaries}{Glossary entry `\glsdetoklabel{#1}' + has not been defined}{You need to define a glossary entry before you + can use it.}% + #3% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\doifglossarynoexistsordo} +%\begin{definition} +%\cs{doifglossarynoexistsordo}\marg{label}\marg{code}\marg{else code} +%\end{definition} +%\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}. +% \begin{macrocode} +\newcommand{\doifglossarynoexistsordo}[3]{% + \ifglossaryexists{#1}% + {% + \PackageError{glossaries}{Glossary type `#1' already exists}{}% + #3% + }% + {#2}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\ifglshaschildren} % \cs{ifglshaschildren}\marg{label}\marg{true part}\marg{false part} %\changes{3.02}{2012/05/21}{new} @@ -3986,6 +4025,15 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\gls@gobbleopt} +% Discard optional argument. +%\changes{4.19}{2015-11-22}{new} +% \begin{macrocode} +\newcommand*{\gls@gobbleopt}{\new@ifnextchar[{\@gls@gobbleopt}{}} +\def\@gls@gobbleopt[#1]{} +% \end{macrocode} +%\end{macro} +% % A new glossary type is defined using \cs{newglossary}. % Syntax: %\begin{definition} @@ -4026,12 +4074,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Define the unstarred version. % \begin{macrocode} \newcommand*{\ns@newglossary}[5][glg]{% - \ifglossaryexists{#2}% - {% - \PackageError{glossaries}{Glossary type `#2' already exists}{% - You can't define a new glossary called `#2' because it already - exists}% - }% + \doifglossarynoexistsordo{#2}% {% % \end{macrocode} % Check if default has been set @@ -4101,7 +4144,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \ics{glscounter} if no optional argument is present.) % \begin{macrocode} \@ifnextchar[{\@gls@setcounter{#2}}% - {\@gls@setcounter{#2}[\glscounter]}}% + {\@gls@setcounter{#2}[\glscounter]}% + }% + {% + \gls@gobbleopt + }% } % \end{macrocode} %\end{macro} @@ -4706,7 +4753,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{macro} %\begin{macro}{\gls@assign@field} %\begin{definition} -%\cs{gls@assign@field}\marg{def value}\marg{glossary type}\marg{field}\marg{tmp +%\cs{gls@assign@field}\marg{def value}\marg{label}\marg{field}\marg{tmp %cs} %\end{definition} % Assigns an entry field. Expansion performed by default (except for @@ -7378,14 +7425,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \cs{gls} etc which also perform that check. % \begin{macrocode} \newcommand*{\@gls@@link}[3][]{% - \ifglsentryexists{#2}% + \glsdoifexistsordo{#2}% {% \let\do@gls@link@checkfirsthyper\relax \@gls@link[#1]{#2}{#3}% }{% - \PackageError{glossaries}{Glossary entry `#2' has not been - defined}{You need to define a glossary entry before you - can use it.}% % \end{macrocode} % Display the specified text. (The entry doesn't exist so % there's nothing to link it to.) @@ -7464,6 +7508,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\do@glsdisablehyperinlist} +% Disable hyperlink if in the ``nohyper'' list. +%\changes{4.19}{2015-11-22}{new} +% \begin{macrocode} +\newcommand*{\do@glsdisablehyperinlist}{% + \expandafter\DTLifinlist\expandafter{\glstype}{\@gls@nohyperlist}% + {\KV@glslink@hyperfalse}{}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@link} %\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} %\changes{1.15}{2008 August 15}{added \cs{glslabel}} @@ -7507,13 +7562,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Switch off hyper setting if the glossary type has been identified % in nohyperlist. % \begin{macrocode} - \expandafter\DTLifinlist\expandafter - {\glstype}{\@gls@nohyperlist}% - {% - \KV@glslink@hyperfalse - }% - {% - }% + \do@glsdisablehyperinlist % \end{macrocode} % Macros must set this before calling \cs{@gls@link}. The % commands that check the first use flag should set this to @@ -8757,6 +8806,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@link@nocheckfirsthyper} +%\changes{4.19}{2015-11-22}{new} +% Instead of just setting \cs{do@gls@link@checkfirsthyper} to +% \cs{relax} in \cs{@gls@field@link}, set it to +% \cs{@gls@link@nocheckfirsthyper} in case some other action needs +% to take place. +% \begin{macrocode} +\newcommand*{\@gls@link@nocheckfirsthyper}{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@field@link} %\changes{4.03}{2014-01-20}{new} %\changes{4.08}{2014-07-30}{added assignment of \cs{do@gls@link@checkfirsthyper}} @@ -8764,7 +8824,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \newcommand{\@gls@field@link}[3]{% \glsdoifexists{#2}% {% - \let\do@gls@link@checkfirsthyper\relax + \let\do@gls@link@checkfirsthyper\@gls@link@nocheckfirsthyper \@gls@link[#1]{#2}{#3}% }% % \end{macrocode} @@ -10539,16 +10599,21 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\end{definition} % \begin{macrocode} \newcommand*{\@Gls@entry@field}[2]{% - \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% - \ifdef\@glo@text + \glsdoifexistsordo{#1}% {% - \xmakefirstuc{\@glo@text}% + \letcs\@glo@text{glo@\glsdetoklabel{#1}@#2}% + \ifdef\@glo@text + {% + \xmakefirstuc{\@glo@text}% + }% + {% + ??\PackageError{glossaries}{The field `#2' doesn't exist for glossary + entry `\glsdetoklabel{#1}'}{Check you have correctly spelt the entry + label and the field name}% + }% }% {% - \PackageError{glossaries}{Either glossary entry - `\glsdetoklabel{#1}' doesn't exist or the field `#2' - doesn't exist}{Check you have correctly spelt the entry - label and the field name}% + ??% }% } % \end{macrocode} @@ -12100,15 +12165,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% \glsnoidxloclist{\@gls@loclist}% }% {% - \ifglsentryexists{##1}% + ??\glsdoifexists{##1}% {% \GlossariesWarning{Missing location list for `##1'. Either a rerun is required or you haven't referenced the entry.}% }% - {% - \PackageError{glossaries}{Glossary entry `##1' has not been - defined.}{}% - }% }% }% % \end{macrocode} @@ -12133,15 +12194,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% \@gls@noidxloclist@prev }% {% - ??\ifglsentryexists{##1}% + ??\glsdoifexists{##1}% {% \GlossariesWarning{Missing location list for `##1'. Either a rerun is required or you haven't referenced the entry.}% }% - {% - \PackageError{glossaries}{Glossary entry `##1' has not been - defined.}{}% - }% }% }% % \end{macrocode} @@ -12158,15 +12215,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% \forlistloop{\glsnoidxnumberlistloophandler}{\@gls@loclist}% }% {% - \ifglsentryexists{##1}% + ??\glsdoifexists{##1}% {% \GlossariesWarning{Missing location list for `##1'. Either a rerun is required or you haven't referenced the entry.}% }% - {% - \PackageError{glossaries}{Glossary entry `##1' has not been - defined.}{}% - }% }% \let\glsnoidxdisplayloc\@gls@org@glsnoidxdisplayloc \let\glsseeformat\@gls@org@glsseeformat @@ -12977,6 +13030,12 @@ you % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@preglossaryhook} +%\changes{4.19}{2015-11-22}{new} +% \begin{macrocode} +\newcommand*{\@gls@preglossaryhook}{} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\@printglossary} %\changes{4.04}{2014-03-06}{new} @@ -13071,6 +13130,10 @@ you \gls@org@glossarysubentryfield{##1}{##2}% }% % \end{macrocode} +%\changes{4.19}{2015-11-22}{added \cs{@gls@preglossaryhook}} +% \begin{macrocode} + \@gls@preglossaryhook +% \end{macrocode} % Now do the handler macro that deals with the actual glossary: % \begin{macrocode} #2% @@ -17760,7 +17823,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \cs{gls}\marg{label}'' on subsequent use. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-prefix}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries-prefix}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Pass all options to \sty{glossaries}: % \begin{macrocode} @@ -18175,7 +18238,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\label{sec:code:hypernav} % Package Definition: % \begin{macrocode} -\ProvidesPackage{glossary-hypernav}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-hypernav}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % % The commands defined in this package are provided to @@ -18343,7 +18406,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % This defines an in-line style where the entries are % comma-separated with just the name and description displayed. % \begin{macrocode} -\ProvidesPackage{glossary-inline}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-inline}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % %\begin{style}{inline} @@ -18534,11 +18597,11 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \ics{item} command, it will appear in a bold font by % default. % \begin{macrocode} -\ProvidesPackage{glossary-list}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-list}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} %\begin{macro}{\indexspace} %\changes{4.13}{2015-02-03}{new} -% The are a few classes that don't define \cs{indexspace}, so +% There are a few classes that don't define \cs{indexspace}, so % provide a definition if it hasn't been defined. % \begin{macrocode} \providecommand{\indexspace}{% @@ -18788,7 +18851,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The glossary styles defined in the \isty{glossary-long} package % used the \env{longtable} environment in the glossary. % \begin{macrocode} -\ProvidesPackage{glossary-long}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-long}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Requires the \isty{longtable} package: % \begin{macrocode} @@ -19263,7 +19326,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % used the \env{longtable} environment in the glossary and use % ragged right formatting for the multiline columns. % \begin{macrocode} -\ProvidesPackage{glossary-longragged}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-longragged}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Requires the \isty{array} package: % \begin{macrocode} @@ -19674,7 +19737,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %use the \sty{multicol} package. These use the tree-like glossary %styles in a multicol environment. % \begin{macrocode} -\ProvidesPackage{glossary-mcols}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-mcols}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -19981,7 +20044,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % The glossary styles defined in the \isty{glossary-super} package % use the \env{supertabular} environment. % \begin{macrocode} -\ProvidesPackage{glossary-super}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-super}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Requires the \isty{supertabular} package: % \begin{macrocode} @@ -20491,7 +20554,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % are like those provided by the \isty{glossary-super} package, % except that the multiline columns have ragged right justification. % \begin{macrocode} -\ProvidesPackage{glossary-superragged}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-superragged}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Requires the \isty{array} package: % \begin{macrocode} @@ -20907,7 +20970,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % that have a tree-like structure. These are designed for % hierarchical glossaries. % \begin{macrocode} -\ProvidesPackage{glossary-tree}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossary-tree}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % %\begin{macro}{\indexspace} @@ -21284,6 +21347,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\glstreenamebox} +% Used by the \glostyle{alttree} style to create the box for the +% name and associated information. +%\changes{4.19}{2015-10-31}{new} +% \begin{macrocode} +\newcommand*{\glstreenamebox}[2]{% + \makebox[#1][l]{#2}% +} +% \end{macrocode} +%\end{macro} +% %\begin{style}{alttree} % The \glostyle{alttree} glossary style % is similar in style to the \glostyle{tree} style, but @@ -21327,7 +21401,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Put the name to the left of the paragraph block. % \begin{macrocode} - \makebox[0pt][r]{\makebox[\glstreeindent][l]{% + \makebox[0pt][r]{\glstreenamebox{\glstreeindent}{% \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}}}% % \end{macrocode} % If the symbol is missing, ignore it, otherwise put it in @@ -21409,7 +21483,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} % Put the name to the left of the paragraph block % \begin{macrocode} - \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% % \end{macrocode} % If the symbol is missing, ignore it, otherwise put it in @@ -21506,7 +21580,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % hyperlinks may not work properly. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-207}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries-compatible-207}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} %\begin{macro}{\GlsAddXdyAttribute} % Adds an attribute in old format. @@ -21867,7 +21941,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % Compatibility macros. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-307}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries-compatible-307}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % % Compatibility macros for predefined glossary styles: @@ -22677,7 +22751,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % but will only be updated when \texttt{glossaries-accsupp.sty} is % modified. % \begin{macrocode} -\ProvidesPackage{glossaries-accsupp}[2015/09/09 v4.18 (NLCT) +\ProvidesPackage{glossaries-accsupp}[2015/11/22 v4.19 (NLCT) Experimental glossaries accessibility] % \end{macrocode} % Pass all options to \sty{glossaries}: @@ -25093,7 +25167,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % modules. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-babel}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries-babel}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Load \sty{tracklang} to obtain language settings. % \begin{macrocode} @@ -25137,7 +25211,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% % modules. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-polyglossia}[2015/09/09 v4.18 (NLCT)] +\ProvidesPackage{glossaries-polyglossia}[2015/11/22 v4.19 (NLCT)] % \end{macrocode} % Load \sty{tracklang} to obtain language settings. % \begin{macrocode} |