diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries-extra')
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx | 693 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins | 6 |
2 files changed, 619 insertions, 80 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx index 75959b49edb..ecfd2657d1b 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx @@ -1,14 +1,17 @@ %\iffalse % glossaries-extra.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: -% -doc "glossaries-extra-codedoc.tex" -% -section "chapter" % -src "glossaries-extra.sty\Z=>glossaries-extra.sty" % -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" +% -src "(example-glossaries-.+\.tex)\Z=>\1" % -author "Nicola Talbot" +% -macrocode ".*\.tex" +% -comment ".*\.tex" +% -section "chapter" % -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" +% -doc "glossaries-extra-codedoc.tex" % glossaries-extra -% Created on 2017/5/10 9:00 +% Created on 2017/6/15 12:28 %\fi %\iffalse %<*package> @@ -118,7 +121,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{11749} +\CheckSum{11999} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -154,13 +157,13 @@ styles (glossaries):>#1={\protect\ttfamily#1}|main}} \raggedright } -\title{glossaries-extra.sty v1.15: +\title{glossaries-extra.sty v1.16: documented code} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} -\date{2017-05-10} +\date{2017-06-15} \begin{document} \DocInput{glossaries-extra.dtx} @@ -205,7 +208,7 @@ Dickimaw Books\\ %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2017/05/10 v1.15 (NLCT)] +\ProvidesPackage{glossaries-extra}[2017/06/15 v1.16 (NLCT)] % \end{macrocode} % Requires \sty{xkeyval} to define package options. % \begin{macrocode} @@ -412,21 +415,29 @@ Dickimaw Books\\ \glswriteentry{#2}% {% % \end{macrocode} -%Save the entry counter. +%Check if \gloskey[glsadd]{thevalue} has been set. % \begin{macrocode} \ifdefempty{\@glsxtr@thevalue}% {% +% \end{macrocode} +%Save the entry counter. +% \begin{macrocode} \glsxtr@saveentrycounter +% \end{macrocode} +%Temporarily redefine \cs{@@do@@wrglossary} so we can use +%\cs{glsxtr@@do@wrglossary}. +% \begin{macrocode} + \let\@@do@@wrglossary\@glsxtr@dorecord }% {% +% \end{macrocode} +%\gloskey[glsadd]{thevalue} has been set, so there's no need to +%defer writing the location value. +% \begin{macrocode} \let\theglsentrycounter\@glsxtr@thevalue \def\theHglsentrycounter{\@glsxtr@theHvalue}% + \let\@@do@@wrglossary\@glsxtr@dorecordnodefer }% -% \end{macrocode} -%Temporarily redefine \cs{@@do@@wrglossary} so we can use -%\cs{glsxtr@@do@wrglossary}. -% \begin{macrocode} - \let\@@do@@wrglossary\@glsxtr@dorecord \glsxtr@@do@wrglossary{#2}% }% \fi @@ -448,6 +459,19 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@dorecordnodefer} +%\changes{1.16}{2017-06-15}{new} +%As above, but don't defer expansion of location. +% \begin{macrocode} +\newcommand*\@glsxtr@dorecordnodefer{% + \protected@write\@auxout{}{\string\glsxtr@record + {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}% + {\@glslocref}}% + \@glsxtr@counterrecordhook +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@@glsxtr@recordcounter} %\changes{1.12}{2017-02-03}{new} % \begin{macrocode} @@ -581,7 +605,6 @@ Dickimaw Books\\ %Don't record. % \begin{macrocode} \def\glsxtr@setup@record{% - \let\@glo@autosee\@glsxtr@org@gloautosee \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% \renewcommand*{\@glsxtr@record}[3]{}% \let\@@do@wrglossary\glsxtr@@do@wrglossary @@ -597,7 +620,7 @@ Dickimaw Books\\ %Only record (don't index). % \begin{macrocode} \def\glsxtr@setup@record{% - \ifdef\@glo@autosee{\let\@glo@autosee\relax}{}% + \@glsxtr@autoseeindexfalse \let\@do@seeglossary\@glsxtr@recordsee \let\@glsxtr@record\@@glsxtr@record \let\@@do@wrglossary\@gobble @@ -613,13 +636,20 @@ Dickimaw Books\\ %(bib2gls will deal with them.) % \begin{macrocode} \def\glsxtrsetaliasnoindex{}% +% \end{macrocode} +% \cs{@gls@setupsort@none} was only introduced to +% \sty{glossaries} v4.30, so it may not be available. If it's +% defined, use it to remove the unnecessary overhead of escaping and +% sanitizing the sort value. +%\changes{1.16}{2017-06-15}{added check for \cs{@gls@setupsort@none}} +% \begin{macrocode} + \ifdef\@gls@setupsort@none{\@gls@setupsort@none}{}% }% \or % \end{macrocode} %Record and index. % \begin{macrocode} \def\glsxtr@setup@record{% - \let\@glo@autosee\@glsxtr@org@gloautosee \renewcommand*{\@do@seeglossary}{\@glsxtr@org@doseeglossary}% \let\@glsxtr@record\@@glsxtr@record \let\@@do@wrglossary\glsxtr@@do@wrglossary @@ -723,6 +753,18 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{option}{autoseeindex} +%Provide a boolean option to allow the user to prevent the +%automatic indexing of the cross-referencing keys \gloskey{see}, +%\gloskey{seealso} and \gloskey{alias}. +%\changes{1.16}{2017-06-15}{new} +% \begin{macrocode} +\define@boolkey{glossaries-extra.sty}[@glsxtr@]{autoseeindex}[true]{% +} +\@glsxtr@autoseeindextrue +% \end{macrocode} +%\end{option} +% %\begin{macro}{\GlossariesExtraWarning} %Allow users to suppress warnings. % \begin{macrocode} @@ -1083,6 +1125,45 @@ Dickimaw Books\\ \let\@glsxtr@org@gloautosee\@glo@autosee % \end{macrocode} %\end{macro} +%Check if user tried \pkgopt[false]{autoseeindex} when it can't be +%supported. +% \begin{macrocode} +\if@glsxtr@autoseeindex +\else + \ifdef\@glsxtr@org@gloautosee + {}% + {\PackageError{glossaries-extra}{`autoseeindex=false' package + option requires at least v4.30 of glossaries.sty}% + {You need to update the glossaries.sty package}% + } +\fi +% \end{macrocode} +% +%\begin{macro}{\@glo@autosee} +%\changes{1.16}{2017-06-15}{added redefinition} +%If \cs{@glo@autosee} has been defined (\sty{glossaries} v4.30 +%onwards), redefine it to test the \pkgopt{autoseeindex} option. +% \begin{macrocode} +\ifdef\@glo@autosee +{% + \renewcommand*{\@glo@autosee}{% + \if@glsxtr@autoseeindex\@glsxtr@org@gloautosee\fi}% +}% +{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@checkseeallowed} +%\changes{1.16}{2017-06-15}{added redefinition} +%Don't prohibit the use of the \gloskey{see} key before the indexing +%files have been opened if the automatic see indexing has been +%disabled, since it's no longer an issue. +% \begin{macrocode} +\renewcommand*{\gls@checkseeallowed}{% + \if@glsxtr@autoseeindex\@gls@see@noindex\fi +} +% \end{macrocode} +%\end{macro} % % % Define abbreviations glossaries if required. @@ -1606,36 +1687,6 @@ Dickimaw Books\\ %\section{Modifications to Commands Provided by \styfmt{glossaries}} % Some of the commands provided by \styfmt{glossaries} are modified % to take into account new options or to change default behaviour. -%\begin{macro}{\glsxtralias} -%\changes{1.12}{2017-02-03}{new} -%Provide a key to allow aliases to be defined. The key should -%be set to the label of the synonymous entry. -% \begin{macrocode} -\glsaddstoragekey*{alias}{}{\glsxtralias} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@newglossaryentryposthook} -%\changes{1.12}{2017-02-03}{added check for alias key} -%Append to the hook to check for the \gloskey{alias} key. -% \begin{macrocode} -\appto\@newglossaryentryposthook{% - \ifcsvoid{glo@\@glo@label @alias}{}% - {% -% \end{macrocode} -%Add cross-reference if see key hasn't been used. -% \begin{macrocode} - \ifdefvoid\@glo@see - {% - \edef\@do@glssee{\noexpand\glssee - {\@glo@label}{\csuse{glo@\@glo@label @alias}}}% - \@do@glssee - }% - {}% - }% -} -% \end{macrocode} -%\end{macro} % %Provide a starred version of \cs{longnewglossaryentry} that doesn't %automatically insert \verb|\leavevmode\unskip\nopostdesc| at the @@ -2003,6 +2054,12 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%There are now three types of cross-references: the \gloskey{see} key (as +%original), the \gloskey{alias} key (from \styfmt{glossaries-extra} v1.12) +% and the \gloskey{seealso} key (from \styfmt{glossaries-extra} v1.16). +% The original \gloskey{see} key needs to have a corresponding field +% (which it doesn't with the base \sty{glossaries} package). +% %\begin{macro}{\@newglossaryentryposthook} % Hook into end of \cs{newglossaryentry} to add \qt{see} value as a % field. @@ -2014,7 +2071,9 @@ Dickimaw Books\\ {\csxdef{glo@\@glo@label @see}{}}% {% \csxdef{glo@\@glo@label @see}{\@glo@see}% - \@glsxtr@autoindexcrossrefs + \if@glsxtr@autoseeindex + \@glsxtr@autoindexcrossrefs + \fi }% } \appto\@gls@keymap{,{see}{see}} @@ -2069,6 +2128,254 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtruseseealso} +%\changes{1.16}{2017-06-15}{new} +%Apply \cs{glsseeformat} to the \gloskey{seealso} key if not empty. +%There's no optional tag to worry about here. +% \begin{macrocode} +\newcommand*{\glsxtruseseealso}[1]{% + \glsdoifexists{#1}% + {% + \letcs{\@glo@see}{glo@\glsdetoklabel{#1}@seealso}% + \ifdefempty\@glo@see + {}% + {% + \expandafter\glsxtruseseealsoformat\expandafter{\@glo@see}% + }% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtruseseealsoformat} +%\changes{1.16}{2017-06-15}{new} +%The format used by \cs{glsxtruseseealso}. The argument is the comma-separated +%list of cross-referenced labels. +% \begin{macrocode} +\newcommand*{\glsxtruseseealsoformat}[1]{% + \glsseeformat[\seealsoname]{#1}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrseelist} +%\changes{1.16}{2017-06-15}{new} +%Fully expands argument before passing to \cs{glsseelist}. +%(The argument to \cs{glsseelist} must be a comma-separated list of +%entry labels.) +% \begin{macrocode} +\newrobustcmd{\glsxtrseelist}[1]{% + \edef\@glo@tmp{\noexpand\glsseelist{#1}}\@glo@tmp +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\seealsoname} +%\changes{1.16}{2017-06-15}{new} +%In case this command hasn't been defined. (Should be provided by +%language packages.) +% \begin{macrocode} +\providecommand{\seealsoname}{see also} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrindexseealso} +%\changes{1.16}{2017-06-15}{new} +%If \cs{@xdycrossrefhook} is defined, provide a +%\texttt{seealso} crossref class. Otherwise this just does +%\cs{glssee} with \cs{seealsoname} as the tag. The hook is only +%defined if both \pkgopt{xindy} and \sty{glossaries} v4.30+ are +%being used. +% \begin{macrocode} +\ifdef\@xdycrossrefhook +{ +% \end{macrocode} +%Add the cross-reference class definition to the hook. +% \begin{macrocode} + \appto\@xdycrossrefhook{% + \write\glswrite{(define-crossref-class \string"seealso\string" + :unverified )}% + \write\glswrite{(markup-crossref-list + :class \string"seealso\string"^^J\space\space\space + :open \string"\string\glsxtruseseealsoformat\glsopenbrace\string" + :close \string"\glsclosebrace\string")}% + } +% \end{macrocode} +%Append to class list. +% \begin{macrocode} + \appto\@xdylocationclassorder{\space\string"seealso\string"} +% \end{macrocode} +%This essentially works like \cs{@do@seeglossary} but uses the +%\texttt{seealso} class. +% \begin{macrocode} + \newrobustcmd*{\glsxtrindexseealso}[2]{% + \def\@gls@xref{#2}% + \@onelevel@sanitize\@gls@xref + \@gls@checkmkidxchars\@gls@xref + \gls@glossary{\csname glo@#1@type\endcsname}{% + (indexentry + :tkey (\csname glo@#1@index\endcsname) + :xref (\string"\@gls@xref\string") + :attr \string"seealso\string" + ) + }% + } +} +{ +% \end{macrocode} +% \pkgopt{xindy} not in use or \sty{glossaries} version too old to support this. +% \begin{macrocode} + \newrobustcmd*{\glsxtrindexseealso}{\glssee[\seealsoname]} +} +% \end{macrocode} +%\end{macro} +% +%The \gloskey{alias} key should be set to the label of the synonymous entry. +%The \gloskey{seealso} key essentially behaves like +%\texttt{see=[\cs{seealsoname}]\marg{xr-list}}. Neither of these new keys +%has the optional tag part allowed with \gloskey{see}. +% +% If \cs{gls@set@xr@key} has been defined (\sty{glossaries} v4.30), +% use that, otherwise just use \cs{glsaddstoragekey}. +% +% \begin{macrocode} +\ifdef\gls@set@xr@key +{ +% \end{macrocode} +% We have at least \sty{glossaries} v4.30. This means the new keys +% can be governed by the same settings as the see key. +% \begin{macrocode} + \define@key{glossentry}{alias}{% + \gls@set@xr@key{alias}{\@glo@alias}{#1}% + } + \define@key{glossentry}{seealso}{% + \gls@set@xr@key{seealso}{\@glo@seealso}{#1}% + } +% \end{macrocode} +% Add to the key mappings. +% \begin{macrocode} + \appto\@gls@keymap{,{alias}{alias},{seealso}{seealso}} +% \end{macrocode} +% Set the default value. +% \begin{macrocode} + \appto\@newglossaryentryprehook{\def\@glo@alias{}\def\@glo@seealso{}}% +% \end{macrocode} +% Assign the field values. +% \begin{macrocode} + \appto\@newglossaryentryposthook{% + \ifdefvoid\@glo@seealso + {\csxdef{glo@\@glo@label @seealso}{}}% + {% + \csxdef{glo@\@glo@label @seealso}{\@glo@seealso}% + \if@glsxtr@autoseeindex + \@glsxtr@autoindexcrossrefs + \fi + }% +% \end{macrocode} +% The \gloskey{alias} field doesn't trigger the automatic +% cross-reference indexing performed at the end of the document. +% \begin{macrocode} + \ifdefvoid\@glo@alias + {\csxdef{glo@\@glo@label @alias}{}}% + {% + \csxdef{glo@\@glo@label @alias}{\@glo@alias}% + }% + } +% \end{macrocode} +% Provide user-level commands to access the values. +%\begin{macro}{\glsxtralias} +% \begin{macrocode} + \newcommand*{\glsxtralias}[1]{\@gls@entry@field{#1}{alias}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrseealsolabels} +% \begin{macrocode} + \newcommand*{\glsxtrseealsolabels}[1]{\@gls@entry@field{#1}{seealso}} +% \end{macrocode} +%\end{macro} +%Add to the \cs{@glo@autosee} hook. +% \begin{macrocode} + \appto\@glo@autoseehook{% + \ifdefvoid\@glo@alias + {% + \ifdefvoid\@glo@seealso + {}% + {% + \edef\@do@glssee{\noexpand\glsxtrindexseealso + {\@glo@label}{\@glo@seealso}}% + \@do@glssee + }% + }% + {% +% \end{macrocode} +%Add cross-reference if see key hasn't been used. +% \begin{macrocode} + \ifdefvoid\@glo@see + {% + \edef\@do@glssee{\noexpand\glssee{\@glo@label}{\@glo@alias}}% + \@do@glssee + }% + {}% + }% + }% +} +{ +% \end{macrocode} +% We have an older version of \sty{glossaries}, so just use +% \cs{glsaddstoragekey}. +%\begin{macro}{\glsxtralias} +%\changes{1.12}{2017-02-03}{new} +% \begin{macrocode} + \glsaddstoragekey*{alias}{}{\glsxtralias} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsxtrseealsolabels} +%\changes{1.16}{2017-06-15}{new} +% \begin{macrocode} + \glsaddstoragekey*{seealso}{}{\glsxtrseealsolabels} +% \end{macrocode} +%\end{macro} +% +%If \cs{gls@set@xr@key} isn't defined, then \cs{@glo@autosee} won't +%be either, so use the post entry definition hook. +% +%\begin{macro}{\@newglossaryentryposthook} +%\changes{1.12}{2017-02-03}{added check for alias key} +%Append to the hook to check for the \gloskey{alias} and +%\gloskey{seealso} keys. +% \begin{macrocode} + \appto\@newglossaryentryposthook{% + \ifcsvoid{glo@\@glo@label @alias}% + {% + \ifcsvoid{glo@\@glo@label @seealso}% + {}% + {% + \edef\@do@glssee{\noexpand\glsxtrindexseealso + {\@glo@label}{\csuse{glo@\@glo@label @seealso}}}% + \@do@glssee + }% + }% + {% +% \end{macrocode} +%Add cross-reference if see key hasn't been used. +% \begin{macrocode} + \ifdefvoid\@glo@see + {% + \edef\@do@glssee{\noexpand\glssee + {\@glo@label}{\csuse{glo@\@glo@label @alias}}}% + \@do@glssee + }% + {}% + }% + } +% \end{macrocode} +%\end{macro} +% +% \begin{macrocode} +} +% \end{macrocode} +% +% % Add all unused cross-references at the end of the document. % \begin{macrocode} \AtEndDocument{\if@glsxtrindexcrossrefs\glsxtraddallcrossrefs\fi} @@ -2083,7 +2390,8 @@ Dickimaw Books\\ {% \forglsentries[\@glo@type]{\@glo@label}% {% - \ifglsused{\@glo@label}{\@glsxtr@addunusedxrefs{\@glo@label}}{}% + \ifglsused{\@glo@label}% + {\expandafter\@glsxtr@addunusedxrefs\expandafter{\@glo@label}}{}% }% }% } @@ -2091,8 +2399,9 @@ Dickimaw Books\\ %\end{macro} % %\begin{macro}{\@glsxtr@addunusedxrefs} -% If the given entry has a see field add all unused -% cross-references. +% If the given entry has a \gloskey{see} or \gloskey{seealso} field add all unused +% cross-references. (The \gloskey{alias} field isn't checked.) +%\changes{1.16}{2017-06-15}{added check for \gloskey{seealso} field} % \begin{macrocode} \newcommand*{\@glsxtr@addunusedxrefs}[1]{% \letcs{\@glo@see}{glo@\glsdetoklabel{#1}@see}% @@ -2101,11 +2410,17 @@ Dickimaw Books\\ {% \expandafter\glsxtr@addunused\@glo@see\@end@glsxtr@addunused }% + \letcs{\@glo@see}{glo@\glsdetoklabel{#1}@seealso}% + \ifdefvoid\@glo@see + {}% + {% + \expandafter\glsxtr@addunused\@glo@see\@end@glsxtr@addunused + }% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsxtr@addunused} +%\begin{macro}{\glsxtr@addunused} % Adds all the entries if they haven't been used. % \begin{macrocode} \newcommand*{\glsxtr@addunused}[1][]{% @@ -2124,7 +2439,7 @@ Dickimaw Books\\ {% \glsadd[format=glsxtrunusedformat]{\@glsxtr@label}% \glsunset{\@glsxtr@label}% - \@glsxtr@addunusedxrefs{\@glsxtr@label}% + \expandafter\@glsxtr@addunusedxrefs\expandafter{\@glsxtr@label}% }% }% } @@ -6344,13 +6659,17 @@ Dickimaw Books\\ % \end{macrocode} % Check \pkgopt{automake} setting: % \begin{macrocode} - \ifglsautomake - \renewcommand*{\@gls@doautomake}{% - \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% - \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% - }% + \ifglsautomake + \renewcommand*{\@gls@doautomake}{% + \@for\@gls@type:=\@glsxtr@reg@glosslist\do{% + \ifdefempty{\@gls@type}{}{\@gls@automake{\@gls@type}}% }% - \fi + }% + \fi +% \end{macrocode} +% Check the sort setting (\sty{glossaries} v4.30 onwards): +% \begin{macrocode} + \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% }% } % \end{macrocode} @@ -6580,12 +6899,17 @@ Dickimaw Books\\ % %\begin{macro}{\@gls@noidx@getgrouptitle} %\changes{1.14}{2017-04-18}{new} +%\changes{1.16}{2017-06-15}{fixed bug} %Patch. % \begin{macrocode} \renewcommand*{\@gls@noidx@getgrouptitle}[2]{% - \protected@edef\@glsxtr@titlelabel{glsxtr@grouptitle@#1}% - \@onelevel@sanitize\@glsxtr@titlelabel - \ifcsundef{\@glsxtr@titlelabel}% + \protected@edef\@glsxtr@titlelabel{#1}% + \ifdefvoid\@glsxtr@titlelabel + {}% + {% + \protected@edef\@glsxtr@titlelabel{\csuse{glsxtr@grouptitle@#1}}% + }% + \ifdefvoid{\@glsxtr@titlelabel}% {% \DTLifint{#1}% {% @@ -6602,7 +6926,7 @@ Dickimaw Books\\ }% }% {% - \letcs#2{\@glsxtr@titlelabel}% + \let#2\@glsxtr@titlelabel }% } % \end{macrocode} @@ -7139,8 +7463,8 @@ Dickimaw Books\\ %enforces a .glstex extension to avoid conflict. % \begin{macrocode} \newcommand*{\glsxtrresourcefile}[2][]{% - \protected@write\@auxout{}{\string\glsxtr@resource{#1}{#2}}% \glsxtr@writefields + \protected@write\@auxout{}{\string\glsxtr@resource{#1}{#2}}% \let\@glsxtr@org@see@noindex\@gls@see@noindex \let\@gls@see@noindex\relax \IfFileExists{#2.glstex}% @@ -7242,6 +7566,19 @@ Dickimaw Books\\ %it's been used. % \begin{macrocode} \newcommand*{\glsxtr@writefields}{% +% \end{macrocode} +%\changes{1.16}{2017-06-15}{added \cs{providecommand} lines} +% \begin{macrocode} + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@fields}[1]{}}% + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@resource}[2]{}}% + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@pluralsuffixes}[4]{}}% + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@shortcutsval}[1]{}}% + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@linkprefix}[1]{}}% \protected@write\@auxout{}{\string\glsxtr@fields{\@gls@keymap}}% % \end{macrocode} %If any languages have been loaded, the language tag will be @@ -7426,26 +7763,47 @@ Dickimaw Books\\ \GlossariesExtraWarning{No entries defined in glossary `\@glo@type'}% }% {% +% \end{macrocode} +%\changes{1.16}{2017-06-15}{corrected misspelt command} +% \begin{macrocode} \key@ifundefined{glossentry}{group}% - {\let\@gls@getgrouptitle\@glsxtr@noidx@getgrouptitle}% + {\let\@gls@getgrouptitle\@gls@noidx@getgrouptitle}% {\let\@gls@getgrouptitle\@glsxtr@unsrt@getgrouptitle}% - \begin{theglossary}% - \glossaryheader - \glsresetentrylist \def\@gls@currentlettergroup{}% +% \end{macrocode} +%A loop within the tabular-like styles can cause problems, so +%move the loop outside. +% \begin{macrocode} + \def\@glsxtr@doglossary{% + \begin{theglossary}% + \glossaryheader + \glsresetentrylist + }% \expandafter\@for\expandafter\glscurrententrylabel\expandafter :\expandafter=\csname glolist@\@glo@type\endcsname\do{% \ifdefempty{\glscurrententrylabel} {}% - {\printunsrtglossaryhandler\glscurrententrylabel}% + {\eappto\@glsxtr@doglossary{% + \noexpand\@printunsrt@glossary@handler{\glscurrententrylabel}}}% }% - \end{theglossary}% + \appto\@glsxtr@doglossary{\end{theglossary}}% + \@glsxtr@doglossary }% \glossarypostamble } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@printunsrt@glossary@handler} +%\changes{1.16}{2017-06-15}{new} +% \begin{macrocode} +\newcommand{\@printunsrt@glossary@handler}[1]{% + \xdef\glscurrententrylabel{#1}% + \printunsrtglossaryhandler\glscurrententrylabel +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\printunsrtglossaryhandler} %\changes{1.12}{2017-02-03}{new} % \begin{macrocode} @@ -7549,23 +7907,26 @@ Dickimaw Books\\ }% }% {% - \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% \key@ifundefined{glossentry}{group}% {% + \letcs{\@gls@sort}{glo@\glsdetoklabel{#1}@sort}% \expandafter\glo@grabfirst\@gls@sort{}{}\@nil }% {% +% \end{macrocode} +%\changes{1.16}{2017-06-15}{use \cs{csuse} instead of \cs{csname}} +% \begin{macrocode} \protected@xdef\@glo@thislettergrp{% - \csname glo@\glsdetoklabel{#1}@group\endcsname}% + \csuse{glo@\glsdetoklabel{#1}@group}}% }% \ifdefequal{\@glo@thislettergrp}{\@gls@currentlettergroup}% {}% {% \ifdefempty{\@gls@currentlettergroup}{}{\glsgroupskip}% \expandafter\glsgroupheading\expandafter - {\csname glo@\glsdetoklabel{#1}@group\endcsname}% + {\@glo@thislettergrp}% }% - \let\@gls@currentlettergroup\@glo@thislettergrp + \global\let\@gls@currentlettergroup\@glo@thislettergrp \ifdefvoid{\@gls@location}% {% \ifdefvoid{\@gls@loclist} @@ -9220,7 +9581,7 @@ Dickimaw Books\\ % Allow categories to hook in here. %\changes{1.04}{2016-05-02}{added category check} % \begin{macrocode} - \csuse{glsxtrpostname\glscategory{\glscurrententrylabel}}% + \csuse{glsxtrpostname\glscategory{#1}}% } % \end{macrocode} %\end{macro} @@ -9291,20 +9652,27 @@ Dickimaw Books\\ \ifdefstring{\@glsxtr@attrval}{true}% {}% {\eappto\@glo@name{\@glsxtr@autoindex@encap\@glsxtr@attrval}}% - \expandafter\index\expandafter{\@glo@name}% + \expandafter\glsxtrautoindex\expandafter{\@glo@name}% }% {}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrautoindex} +%\changes{1.16}{2017-06-15}{new} +% \begin{macrocode} +\newcommand*{\glsxtrautoindex}{\index} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@autoindex@setname} %\changes{0.5.3}{2015-12-09}{new} % Assign \cs{@glo@name} for use with \catattr{indexname} attribute. % \begin{macrocode} \newcommand*{\@glsxtr@autoindex@setname}[1]{% - \def\@glo@name{\string\glsentryname{#1}}% - \glsletentryfield{\@glo@sort}{#1}{sort}% + \protected@edef\@glo@name{\glsxtrautoindexentry{#1}}% + \glsxtrautoindexassignsort{\@glo@sort}{#1}% \@gls@checkmkidxchars\@glo@sort \@glsxtr@autoindex@doextra@esc\@glo@sort \epreto\@glo@name{\@glo@sort\@glsxtr@autoindex@at}% @@ -9312,6 +9680,24 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrautoindexentry} +%\changes{1.16}{2017-06-15}{new} +%Command used for the actual part when auto-indexing. +% \begin{macrocode} +\newcommand*{\glsxtrautoindexentry}[1]{\string\glsentryname{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrautoindexsort} +%\changes{1.16}{2017-06-15}{new} +%Used to assign the sort value when auto-indexing. +% \begin{macrocode} +\newcommand*{\glsxtrautoindexassignsort}[2]{% + \glsletentryfield{#1}{#2}{sort}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@autoindex@doextra@esc} % \begin{macrocode} \newcommand*{\@glsxtr@autoindex@doextra@esc}[1]{% @@ -14986,7 +15372,7 @@ Dickimaw Books\\ % First identify package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2017/05/10 v1.15 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2017/06/15 v1.16 (NLCT)] % \end{macrocode} % Provide package options to automatically load required predefined % styles. The simplest method is to just test for the existence of @@ -15996,5 +16382,156 @@ Dickimaw Books\\ %</glossaries-extra-stylemods.sty> % \end{macrocode} %\fi +%\iffalse +% \begin{macrocode} +%<*example-glossaries-xr.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<<COMMENT +% This file is part of the glossaries-extra bundle +% These are dummy glossary entries with cross-references for use in +% test documents. +%COMMENT +\newglossaryentry{lorem}{name={lorem},description={ipsum}} + +\newglossaryentry{alias-lorem}{name={alias-lorem},description={ipsum}, + alias={lorem}} + +\newglossaryentry{dolor}{name={dolor},description={sit}} + +\newglossaryentry{amet}{name={amet},description={consectetuer}, + see={dolor}} + +\newglossaryentry{adipiscing}{name={adipiscing},description={elit}} + +\newglossaryentry{ut}{name={ut},description={purus}} + +\newglossaryentry{elit}{name={elit},description={vestibulum}, + seealso={adipiscing,ut}} + +\newglossaryentry{placerat}{name={placerat},description={ac}} + +\newglossaryentry{vitae}{name={vitae},description={felis}} + +\newglossaryentry{curabitur}{name={curabitur},description={gravida}} + +\newglossaryentry{mauris}{name={mauris},description={nam}} + +\newglossaryentry{arcu}{name={arcu},description={libero}, + seealso={placerat,vitae,curabitur}} + +\newglossaryentry{nonummy}{name={nonummy},description={eget}, + seealso={mauris}} + +\newglossaryentry{consectetuer}{name={consectetuer},description={id}, + parent={nonummy}} + +\newglossaryentry{vulputate}{name={vulputate},description={a magna}, + parent={nonummy}} + +\newglossaryentry{donec}{name={donec},description={vehicula}} + +\newglossaryentry{augue}{name={augue},description={eu neque}} + +\newglossaryentry{pellentesque}{name={pellentesque},description={habitant}, + see={augue}} + +\newglossaryentry{morbi}{name={morbi},description={tristique}} + +\newglossaryentry{senectus}{name={senectus},description={et netus}} + +\newglossaryentry{et}{name={et},description={malesuada}, + see={vulputate}} + +\newglossaryentry{fames}{name={fames},description={ac}} + +\newglossaryentry{turpis}{name={turpis},description={egestas}, + seealso={consectetuer}} + +\newglossaryentry{leo}{name={leo},description={cras}} + +\newglossaryentry{viverra}{name={viverra},description={metus}} + +\newglossaryentry{rhoncus}{name={rhoncus},description={sem}} + +\newglossaryentry{nulla}{name={nulla},description={et}} + +\newglossaryentry{lectus}{name={lectus},description={vestibulum}} + +\newglossaryentry{urna}{name={urna},description={fringilla}, + parent={lectus},see={nulla}} + +\newglossaryentry{ultrices}{name={ultrices},description={phasellus}, + parent={lectus}} + +\newglossaryentry{eu}{name={eu},description={tellus}, + parent={lectus}} + +\newglossaryentry{alias-eu}{name={alias-eu},description={tellus}, + alias={eu}} + +\newglossaryentry{sit}{name={sit},description={amet}} + +\newglossaryentry{tortor}{name={tortor},description={gravida}} + +\newglossaryentry{integer}{name={integer},description={sapien}} + +\newglossaryentry{est}{name={est},description={iaculis}} + +\newglossaryentry{in}{name={in},description={pretium}, + seealso={sit,tortor,est}} + +\newglossaryentry{quis}{name={quis},description={viverra}} + +\newglossaryentry{ac}{name={ac},description={nunc}} + +\newglossaryentry{praesent}{name={praesent},description={eget \gls{ac}}} + +\newglossaryentry{sem}{name={sem},description={vel leo +\glshyperlink{quis}}} + +\newglossaryentry{bibendum}{name={bibendum},description={ultrices}} + +\newglossaryentry{aenean}{name={aenean},description={faucibus}} + +\newglossaryentry{malesuada}{name={malesuada},description={eu}, + parent={aenean}} + +\newglossaryentry{pulvinar}{name={pulvinar},description={at}, + parent={aenean}} + +\newglossaryentry{mollis}{name={mollis},description={ac nulla}, + parent={aenean}} + +\newglossaryentry{auctor}{name={auctor},description={semper}, + parent={aenean}} + +\newglossaryentry{varius}{name={varius},description={orci}, + parent={aenean}} + +\newglossaryentry{eget}{name={eget},description={risus}} + +\newglossaryentry{duis}{name={duis},description={nibh}} + +\newglossaryentry{mi}{name={mi},description={congue}} + +\newglossaryentry{accumsan}{name={accumsan},description={eleifend}} + +\newglossaryentry{sagittis}{name={sagittis},description={quis}, + see={eget}} + +\newglossaryentry{diam}{name={diam},description={duis}} + +\newglossaryentry{orci}{name={orci},description={dignissim}, + seealso={diam}} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%</example-glossaries-xr.tex> +% \end{macrocode} +%\fi %\Finale \endinput diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins index 4635f120b1b..818c0c8bb9c 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins @@ -1,4 +1,4 @@ -% glossaries-extra.ins generated using makedtx version 1.1 2017/5/10 9:00 +% glossaries-extra.ins generated using makedtx version 1.1 2017/6/15 12:28 \input docstrip \preamble @@ -18,7 +18,7 @@ The Current Maintainer of this work is Nicola Talbot. - This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.sty. + This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-stylemods.sty, example-glossaries-xr.tex. \endpreamble @@ -28,6 +28,8 @@ \usepostamble\defaultpostamble\from{glossaries-extra.dtx}{glossaries-extra.sty,package}} \file{glossaries-extra-stylemods.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries-extra.dtx}{glossaries-extra-stylemods.sty,package}} +\file{example-glossaries-xr.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries-extra.dtx}{example-glossaries-xr.tex,package}} } \endbatchfile |