diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-01 22:48:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-01 22:48:17 +0000 |
commit | b4449269786ca00b3c302d244f99e83d31a6b0d6 (patch) | |
tree | 4ed4229a57dec9589dde0d209eb61c3985a6d5b8 /Master/texmf-dist/source/latex/glossaries-extra | |
parent | d2e8f53cdae6de5f7ae5dca67ef39847fd96d88d (diff) |
glossaries-extra (1dec18)
git-svn-id: svn://tug.org/texlive/trunk@49297 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries-extra')
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx | 2754 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins | 6 |
2 files changed, 2663 insertions, 97 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 8a9e2fa5658..755decd8922 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx @@ -1,23 +1,24 @@ %\iffalse % glossaries-extra.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: +% -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" % -doc "glossaries-extra-codedoc.tex" +% -section "chapter" +% -author "Nicola Talbot" % -src "glossaries-extra.sty\Z=>glossaries-extra.sty" % -src "glossaries-extra-bib2gls.sty\Z=>glossaries-extra-bib2gls.sty" % -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" % -src "glossary-bookindex.sty\Z=>glossary-bookindex.sty" +% -src "glossary-longextra.sty\Z=>glossary-longextra.sty" % -src "(example-glossaries-.+\.tex)\Z=>\1" % -src "(example-glossaries-.+\.bib)\Z=>\1" -% -author "Nicola Talbot" +% -comment ".*\.tex" +% -comment ".*\.bib" % -macrocode ".*\.tex" % -macrocode ".*\.bib" % -setambles ".*\.bib=>\nopreamble\nopostamble" -% -comment ".*\.tex" -% -comment ".*\.bib" -% -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" -% -section "chapter" % glossaries-extra -% Created on 2018/8/18 20:14 +% Created on 2018/11/30 18:41 %\fi %\iffalse %<*package> @@ -87,6 +88,18 @@ package}, description={An indexing application}, } +\newglossaryentry{bib2gls}{% +name={\appfmt{bib2gls}\index{bib2gls=\appfmt{bib2gls}|htextbf}},% +sort={bib2gls},% +text={\appfmt{bib2gls}\iapp{bib2gls}},% +description={A command line Java application that selects +entries from a .bib file and converts them to glossary +definitions (like \appfmt{bibtex} but also performs hierarchical +sorting and collation, thus omitting the need for \gls{xindy} or +\gls{makeindex}). Further details at: +\url{http://www.dickimaw-books.com/software/bib2gls/}.}% +} + \let\glsd\glsuseri \let\glsation\glsuserii @@ -167,13 +180,13 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \raggedright } -\title{glossaries-extra.sty v1.36: +\title{glossaries-extra.sty v1.37: documented code} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} -\date{2018-08-18} +\date{2018-11-30} \begin{document} \DocInput{glossaries-extra.dtx} @@ -218,7 +231,7 @@ Dickimaw Books\\ %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2018/08/18 v1.36 (NLCT)] +\ProvidesPackage{glossaries-extra}[2018/11/30 1.37 (NLCT)] % \end{macrocode} % Requires \sty{xkeyval} to define package options. % \begin{macrocode} @@ -484,7 +497,7 @@ Dickimaw Books\\ %\begin{macro}{\@@glsxtr@record} %\changes{1.08}{2016-12-13}{new} %The \pkgopt[only]{record} option sets \cs{@glsxtr@record} to this. -%This performs the recording if the entry doesn't exist and is done +%This performs the recording if the entry \emph{doesn't exist} and is done %at the start of \cs{@gls@field@link} and commands like \cs{@gls@} %(before the existence test). This means that it disregards the %\gloskey[glslink]{wrgloss} key. @@ -515,6 +528,13 @@ Dickimaw Books\\ % \begin{macrocode} \let\@gls@counter\glscounter % \end{macrocode} +%Unless the \pkgopt{equations} option is on and this is inside a +%numbered maths environment. +% \begin{macrocode} + \if@glsxtr@equations + \@glsxtr@use@equation@counter + \fi +% \end{macrocode} %Check for default options (which may switch off indexing). %\changes{1.21}{2017-11-03}{added check for default options} % \begin{macrocode} @@ -529,14 +549,19 @@ Dickimaw Books\\ % \begin{macrocode} \setkeys{#3}{#1}% % \end{macrocode} -%Implement any post-key settings. +%Implement any post-key settings. Is the auto-add on? +%\changes{1.37}{2018-11-30}{added check for auto-add} +% \begin{macrocode} + \glsxtr@do@autoadd{#3}% +% \end{macrocode} +% Check post-key hook. %\changes{1.30}{2018-04-25}{added check for post-key hook} % \begin{macrocode} \csuse{@glsxtr@#3@postkeys}% % \end{macrocode} %Increment associated counter. % \begin{macrocode} - \glsxtr@inc@wrglossaryctr{#2}% + \glsxtr@inc@wrglossaryctr{#2}% % \end{macrocode} %Check if \gloskey[glslink]{noindex} option has been used. % \begin{macrocode} @@ -622,7 +647,6 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % -% %\begin{macro}{\@glsxtr@dorecord} %\changes{1.08}{2016-12-13}{new} %\changes{1.15}{2017-05-10}{corrected premature expansion of \cs{@glslocref}} @@ -649,10 +673,17 @@ Dickimaw Books\\ %If the counter isn't \counter{page} then it needs expanding. If the %location includes \cs{thepage} then \cs{protected@write} will %automatically deal with it. +%\changes{1.37}{2018-11-30}{added check for record=nameref} % \begin{macrocode} - \protected@write\@auxout{}{\string\glsxtr@record + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \@glsxtr@do@nameref@record {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}% - {\@glsrecordlocref}}% + {\@glsrecordlocref}% + \else + \protected@write\@auxout{}{\string\glsxtr@record + {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}% + {\@glsrecordlocref}}% + \fi \@glsxtr@counterrecordhook \let\@glo@counterprefix\@glsxtr@orgprefix } @@ -670,23 +701,87 @@ Dickimaw Books\\ % \begin{macrocode} \newcommand*\@glsxtr@dorecordnodefer{% \ifx\theglsentrycounter\theHglsentrycounter - \protected@write\@auxout{}{\string\glsxtr@record - {\@gls@label}{}{\@gls@counter}{\@glsnumberformat}% - {\theglsentrycounter}}% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \@glsxtr@do@nameref@record + {\@gls@label}{}{\@gls@counter}{\@glsnumberformat}% + {\theglsentrycounter}% + \else + \protected@write\@auxout{}{\string\glsxtr@record + {\@gls@label}{}{\@gls@counter}{\@glsnumberformat}% + {\theglsentrycounter}}% + \fi \else - \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix - {\theglsentrycounter}{\theHglsentrycounter}% - }% - \@do@gls@getcounterprefix - \protected@write\@auxout{}{\string\glsxtr@record - {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}% - {\theglsentrycounter}}% + \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\theglsentrycounter}{\theHglsentrycounter}% + }% + \@do@gls@getcounterprefix + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \@glsxtr@do@nameref@record + {\@gls@label}{\@glo@counterprefix}{\@gls@counter}% + {\@glsnumberformat}{\theglsentrycounter}% + \else + \protected@write\@auxout{}{\string\glsxtr@record + {\@gls@label}{\@glo@counterprefix}{\@gls@counter}{\@glsnumberformat}% + {\theglsentrycounter}}% + \fi \fi \@glsxtr@counterrecordhook } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@ifnum@mmode} +%\changes{1.37}{2018-11-30}{new} +%Check if in a numbered maths environment. +%The \sty{amsmath} package is automatically loaded by +%\sty{datatool-base}, which is required by \sty{glossaries}, so \cs{ifst@rred} +%and \cs{if@display} should both be defined. +% \begin{macrocode} +\newcommand{\@glsxtr@ifnum@mmode}[2]{% + \ifmmode + \ifst@rred + #2% + \else +% \end{macrocode} +% Non-\sty{amsmath} environments and regular inline math mode isn't +% flagged as starred by \sty{amsmath}, but we can't use \cs{mathchoice} +% in this case as it's not the current style that's relevant. +% Instead we can use \sty{amsmath}'s \cs{if@display}. This may not +% work for environments that aren't provided by \sty{amsmath}. +% \begin{macrocode} + \if@display #1\else #2\fi + \fi + \else + #2% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@do@nameref@record} +%\changes{1.37}{2018-11-30}{new} +%With \pkgopt[nameref]{record}, the current label information is included +%in the record, but this may not have been defined, so \cs{csuse} will +%prevent an undefined control sequence error and just leave the last +%two arguments blank if there's no information. In the event that a record is in +%\sty{amsmath}'s \env{align} environment \cs{@currentHref} will be out. +%There may be other instances where \cs{@currentHref} is out, so +%this also saves \cs{theHglsentrycounter}, which is +%useful if it can't be obtained by prefixing +%\cs{theglsentrycounter}. +% \begin{macrocode} +\newcommand*{\@glsxtr@do@nameref@record}[5]{% + \gls@ifnotmeasuring + {% + \protected@write\@auxout{}{\string\glsxtr@record@nameref + {#1}{#2}{#3}{#4}{#5}% + {\csuse{@currentlabelname}}{\csuse{@currentHref}}% + {\theHglsentrycounter}}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@@glsxtr@recordcounter} %\changes{1.12}{2017-02-03}{new} % \begin{macrocode} @@ -832,6 +927,30 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@record@setting@nameref} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@record@setting@nameref}{nameref} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@if@record@only} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@if@record@only}[2]{% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@only + #1% + \else + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + #1% + \else + #2% + \fi + \fi +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@record@setting@off} %\changes{1.21}{2017-11-03}{new} % \begin{macrocode} @@ -839,13 +958,56 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@record@only@setup} +%\changes{1.37}{2018-11-30}{new} +%Initialisation code for record=only and record=nameref +% \begin{macrocode} +\newcommand*{\@glsxtr@record@only@setup}{% + \def\glsxtr@setup@record{% + \@glsxtr@autoseeindexfalse + \let\@do@seeglossary\@glsxtr@recordsee + \let\@glsxtr@record\@@glsxtr@record + \let\@@do@wrglossary\@glsxtr@do@record@wrglossary + \let\@gls@saveentrycounter\relax + \let\glsxtrundefaction\@glsxtr@warn@undefaction + \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo + \glsxtr@addloclistfield + \renewcommand*{\@glsxtr@autoindexcrossrefs}{}% + \let\@@glsxtr@recordcounter\@glsxtr@op@recordcounter + \def\printunsrtglossaryunit{\print@op@unsrtglossaryunit}% +% \end{macrocode} +%Switch off the index suppression for aliased entries. +%(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}{}% +% \end{macrocode} +% Warn about using \cs{printglossary}: +% \begin{macrocode} + \def\glsxtrNoGlossaryWarning{\@glsxtr@record@noglossarywarning}% +% \end{macrocode} +%Load \sty{glossaries-extra-bib2gls}: +% \begin{macrocode} + \RequirePackage{glossaries-extra-bib2gls}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{option}{record} %Now define the \pkgopt{record} package option. %\changes{1.08}{2016-12-13}{added \pkgopt{record} package option} % \begin{macrocode} \define@choicekey{glossaries-extra.sty}{record} [\@glsxtr@record@setting\glsxtr@record@nr]% - {off,only,alsoindex}% + {off,only,alsoindex,nameref}% [only]% {% \ifcase\glsxtr@record@nr\relax @@ -867,40 +1029,7 @@ Dickimaw Books\\ % \end{macrocode} %Only record (don't index). % \begin{macrocode} - \def\glsxtr@setup@record{% - \@glsxtr@autoseeindexfalse - \let\@do@seeglossary\@glsxtr@recordsee - \let\@glsxtr@record\@@glsxtr@record - \let\@@do@wrglossary\@glsxtr@do@record@wrglossary - \let\@gls@saveentrycounter\relax - \let\glsxtrundefaction\@glsxtr@warn@undefaction - \let\glsxtr@warnonexistsordo\@glsxtr@warn@onexistsordo - \glsxtr@addloclistfield - \renewcommand*{\@glsxtr@autoindexcrossrefs}{}% - \let\@@glsxtr@recordcounter\@glsxtr@op@recordcounter - \def\printunsrtglossaryunit{\print@op@unsrtglossaryunit}% -% \end{macrocode} -%Switch off the index suppression for aliased entries. -%(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}{}% -% \end{macrocode} -% Warn about using \cs{printglossary}: -% \begin{macrocode} - \def\glsxtrNoGlossaryWarning{\@glsxtr@record@noglossarywarning}% -% \end{macrocode} -%Load \sty{glossaries-extra-bib2gls}: -% \begin{macrocode} - \RequirePackage{glossaries-extra-bib2gls}% - }% + \@glsxtr@record@only@setup \or % \end{macrocode} %Record and index. This option doesn't load @@ -919,6 +1048,15 @@ Dickimaw Books\\ \def\printunsrtglossaryunit{\print@op@unsrtglossaryunit}% \undef\glsxtrsetaliasnoindex }% + \or +% \end{macrocode} +%Only record (don't index) but also include nameref information. +% \begin{macrocode} + \@glsxtr@record@only@setup + \ifundef\hyperlink + {\GlossariesExtraWarning{You have requested record=nameref but + the document doesn't support hyperlinks}}% + {}% \fi } % \end{macrocode} @@ -1030,6 +1168,49 @@ Dickimaw Books\\ % \end{macrocode} %\end{option} % +%\begin{option}{equations} +%Provide a boolean option to automatically switch to the +%\ctr{equation} counter when in a numbered maths environment. +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\define@boolkey{glossaries-extra.sty}[@glsxtr@]{equations}[true]{% +} +\@glsxtr@equationsfalse +% \end{macrocode} +%\end{option} +% +%\begin{macro}{\glsxtr@float} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\let\glsxtr@float\@float +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@dblfloat} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\let\glsxtr@dblfloat\@dblfloat +% \end{macrocode} +%\end{macro} +% +%\begin{option}{floats} +%Provide a boolean option to automatically switch to the +%the corresponding counter when in a float. +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\define@boolkey{glossaries-extra.sty}[@glsxtr@]{floats}[true]{% + \if@glsxtr@floats + \renewcommand*{\@float}[1]{\renewcommand{\glscounter}{##1}\glsxtr@float{##1}}% + \renewcommand*{\@dblfloat}[1]{\renewcommand{\glscounter}{##1}\glsxtr@dblfloat{##1}}% + \else + \let\@float\glsxtr@float + \let\@dblfloat\glsxtr@dblfloat + \fi +} +\@glsxtr@floatsfalse +% \end{macrocode} +%\end{option} +% %\begin{macro}{\GlossariesExtraWarning} %Allow users to suppress warnings. % \begin{macrocode} @@ -1840,6 +2021,52 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@getcounterprefix} +%\changes{1.37}{2018-11-30}{new} +%This command is provided by the base \sty{glossaries} package, but +%is redefined here. +%The standard indexing methods don't directly store the hypertarget +%but instead need to split it into the counter, prefix and location +%parts, which can be reconstituted in the location list. +%Unfortunately, not all targets are in this form, so the links fail. +%With \pkgopt[nameref]{record}, the complete target name can be +%saved, so this modification adjusts the warning. +% \begin{macrocode} +\renewcommand*\@gls@getcounterprefix[2]{% + \protected@edef\@gls@thisloc{#1}\protected@edef\@gls@thisHloc{#2}% + \ifx\@gls@thisloc\@gls@thisHloc + \def\@glo@counterprefix{}% + \else + \def\@gls@get@counterprefix##1.#1##2\end@getprefix{% + \def\@glo@tmp{##2}% + \ifx\@glo@tmp\@empty + \def\@glo@counterprefix{}% + \else + \def\@glo@counterprefix{##1}% + \fi + }% + \@gls@get@counterprefix#2.#1\end@getprefix +% \end{macrocode} +% Warn if no prefix can be formed, unless \pkgopt[nameref]{record}. +% \begin{macrocode} + \ifx\@glo@counterprefix\@empty + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \else + \GlossariesExtraWarning{Hyper target `#2' can't be formed by + prefixing^^Jlocation `#1'. You need to modify the + definition of \string\theH\@gls@counter^^Jotherwise you + will get the warning: "`name{\@gls@counter.#1}' has been^^J + referenced but does not exist"% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@only + . You may want to consider using record=nameref instead% + \fi}% + \fi + \fi + \fi +} +% \end{macrocode} +%\end{macro} +% %Provide script dialect hook (does nothing unless %redefined by \sty{glossaries-extra-bib2gls}). %\begin{macro}{\@glsxtrdialecthook} @@ -2339,10 +2566,42 @@ Dickimaw Books\\ % %\begin{macro}{\Glsxtrusefield} %\changes{1.12}{2017-02-03}{new} +%\changes{1.37}{2018-11-30}{fixed internal command and added check for +%\cs{texorpdfstring}} %Provide a user-level alternative to \cs{@Gls@entry@field}. % \begin{macrocode} -\newcommand*{\Glsxtrusefield}[2]{% - \@gls@entry@field{#1}{#2}% +\ifdef\texorpdfstring +{ + \newcommand*{\Glsxtrusefield}[2]{% + \texorpdfstring + {\@Gls@entry@field{#1}{#2}} + {\@gls@entry@field{#1}{#2}}% + } +} +{ + \newcommand*{\Glsxtrusefield}[2]{% + \@Gls@entry@field{#1}{#2}% + } +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GLSxtrusefield} +%\changes{1.37}{2018-11-30}{new} +%As above but convert to all caps. +% \begin{macrocode} +\ifdef\texorpdfstring +{ + \newcommand*{\GLSxtrusefield}[2]{% + \texorpdfstring + {\glsdoifexists{#1}{\mfirstucMakeUppercase{\@gls@entry@field{#1}{#2}}}}% + {\@gls@entry@field{#1}{#2}}% + } +} +{ + \newcommand*{\GLSxtrusefield}[2]{% + \glsdoifexists{#1}{\mfirstucMakeUppercase{\@gls@entry@field{#1}{#2}}}% + } } % \end{macrocode} %\end{macro} @@ -3165,6 +3424,7 @@ Dickimaw Books\\ %\begin{macro}{\glsseeitemformat} %\changes{1.21}{2017-11-03}{new} %\changes{1.22}{2017-11-08}{switched check from regular to short} +%\changes{1.37}{2018-11-30}{removed reference to \cs{glslabel}} %\styfmt{glossaries} originally defined \cs{glsseeitemformat} %to use \cs{glsentryname} but in v3.0 this was switched to %use \cs{glsentrytext} due to problems occurring with the @@ -3175,11 +3435,120 @@ Dickimaw Books\\ %for abbreviations. % \begin{macrocode} \renewcommand*{\glsseeitemformat}[1]{% - \ifglshasshort{\glslabel}{\glsaccesstext{#1}}{\glsaccessname{#1}}% + \ifglshasshort{#1}{\glsaccesstext{#1}}{\glsaccessname{#1}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrhiername} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrhiername}\marg{label} +%\end{definition} +%Displays the hierarchical name for the given entry. The +%cross-reference format \cs{glsseeitemformat} may be redefined to +%use this command to show the hierarchy, if required. +% \begin{macrocode} +\newcommand*{\glsxtrhiername}[1]{% + \glsdoifexists{#1}% + {% + \glsxtrifhasfield{parent}{#1}% + {\glsxtrhiername{\glscurrentfieldvalue}\glsxtrhiernamesep}% + {}% + \ifglshasshort{#1}{\glsaccessshort{#1}}{\glsaccessname{#1}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Glsxtrhiername} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{Glsxtrhiername}\marg{label} +%\end{definition} +%As above but displays the top-level name with an initial capital. +% \begin{macrocode} +\newcommand*{\Glsxtrhiername}[1]{% + \glsdoifexists{#1}% + {% + \glsxtrifhasfield{parent}{#1}% + {% + \Glsxtrhiername{\glscurrentfieldvalue}\glsxtrhiernamesep + \ifglshasshort{#1}{\glsaccessshort{#1}}{\glsaccessname{#1}}% + }% + {\ifglshasshort{#1}{\Glsaccessshort{#1}}{\Glsaccessname{#1}}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrhiername} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{GlsXtrhiername}\marg{label} +%\end{definition} +%As above but converts the first letter of each name to a capital. +% \begin{macrocode} +\newcommand*{\GlsXtrhiername}[1]{% + \glsdoifexists{#1}% + {% + \glsxtrifhasfield{parent}{#1}% + {\GlsXtrhiername{\glscurrentfieldvalue}\glsxtrhiernamesep}% + {}% + \ifglshasshort{#1}{\Glsaccessshort{#1}}{\Glsaccessname{#1}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GLSxtrhiername} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{GLSxtrhiername}\marg{label} +%\end{definition} +%As above but displays the top-level name in all-caps. +% \begin{macrocode} +\newcommand*{\GLSxtrhiername}[1]{% + \glsdoifexists{#1}% + {% + \glsxtrifhasfield{parent}{#1}% + {% + \GLSxtrhiername{\glscurrentfieldvalue}\glsxtrhiernamesep + \ifglshasshort{#1}{\glsaccessshort{#1}}{\glsaccessname{#1}}% + }% + {\ifglshasshort{#1}{\GLSaccessshort{#1}}{\GLSaccessname{#1}}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GLSXTRhiername} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{GLSXTRhiername}\marg{label} +%\end{definition} +%As above but displays all names in all-caps. +% \begin{macrocode} +\newcommand*{\GLSXTRhiername}[1]{% + \glsdoifexists{#1}% + {% + \glsxtrifhasfield{parent}{#1}% + {\GLSXTRhiername{\glscurrentfieldvalue}\glsxtrhiernamesep}% + {} + \ifglshasshort{#1}{\GLSaccessshort{#1}}{\GLSaccessname{#1}}% + }% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrhiernamesep} +%\changes{1.37}{2018-11-30}{new} +%Separator used in \cs{glsxtrhiername} and variants. +% \begin{macrocode} +\newcommand*{\glsxtrhiernamesep}{\,{\small$\triangleright$}\,} +% \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. @@ -4518,6 +4887,56 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@use@equation@counter@or} +%\changes{1.37}{2018-11-30}{new} +%If in a numbered equation, change the counter to \ctr{equation}. +%This can be overridden by explicitly setting the counter in the +%optional argument of commands like \cs{gls} and \cs{glslink}. +% \begin{macrocode} +\newcommand*{\@glsxtr@use@equation@counter}{% + \@glsxtr@ifnum@mmode{\def\@gls@counter{equation}}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@do@autoadd} +%\changes{1.37}{2018-11-30}{new} +%If \cs{GlsXtrAutoAddOnFormat} is used, this will automatically use +%\cs{glsadd}. It's therefore only used with \cs{@gls@link} not with +%\cs{glsadd} otherwise it could trigger an infinite loop. The +%argument indicates the key family (glslink or glossadd). +% \begin{macrocode} +\newcommand*{\glsxtr@do@autoadd}[1]{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrAutoAddOnFormat} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{GlsXtrAutoAddOnFormat}\oarg{label}\marg{format list}\marg{glsadd options} +%\end{definition} +%If an entry is indexed with the format set to one identified in the +%comma-separated list, then automatically index it using \cs{glsadd} +%with the given options, which may override the current options. +%Scoping is needed to prevent leakage. +% \begin{macrocode} +\newcommand*{\GlsXtrAutoAddOnFormat}[3][\glslabel]{% + \renewcommand*{\glsxtr@do@autoadd}[1]{% + \begingroup + \protected@edef\@glsxtr@do@autoadd{% + \noexpand\ifstrequal{##1}{glslink}% + {% + \noexpand\DTLifinlist{\@glsnumberformat}{#2}{\noexpand\glsadd[format={\@glsnumberformat},#3]{#1}}{}% + }% + {}% + }% + \@glsxtr@do@autoadd + \endgroup + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@gls@link} %\changes{1.14}{2017-04-18}{added redefinition} %Redefine to allow the indexing to be placed after the link text. By @@ -4565,7 +4984,13 @@ Dickimaw Books\\ % \end{macrocode} %Increment link counter if enabled (new to v1.26). % \begin{macrocode} - \glsxtr@inc@linkcount + \glsxtr@inc@linkcount +% \end{macrocode} +% Check if the \pkgopt{equations} option has been set (new to v1.37). +% \begin{macrocode} + \if@glsxtr@equations + \@glsxtr@use@equation@counter + \fi % \end{macrocode} % As the original definition. % \begin{macrocode} @@ -4580,6 +5005,10 @@ Dickimaw Books\\ % \begin{macrocode} \setkeys{glslink}{#1}% % \end{macrocode} +%Perform auto add if set (new to v1.37) +% \begin{macrocode} + \glsxtr@do@autoadd{glslink}% +% \end{macrocode} %User hook after options are set: % \begin{macrocode} \glslinkpostsetkeys @@ -4690,6 +5119,7 @@ Dickimaw Books\\ % %\begin{macro}{\glsadd} %\changes{1.08}{2016-12-13}{added \cs{@glsxtr@record}} +%\changes{1.37}{2018-11-30}{added grouping} %Redefine to include \cs{@glsxtr@record} and suppress in headings % \begin{macrocode} \renewrobustcmd*{\glsadd}[2][]{% @@ -4697,39 +5127,50 @@ Dickimaw Books\\ {}% {% \@gls@adjustmode - \@glsxtr@record{#1}{#2}{glossadd}% - \glsdoifexists{#2}% - {% - \let\@glsnumberformat\@glsxtr@defaultnumberformat - \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% - \def\@glsxtr@thevalue{}% - \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% + \begingroup + \@glsxtr@record{#1}{#2}{glossadd}% + \glsdoifexists{#2}% + {% + \let\@glsnumberformat\@glsxtr@defaultnumberformat + \edef\@gls@counter{\csname glo@\glsdetoklabel{#2}@counter\endcsname}% + \def\@glsxtr@thevalue{}% + \def\@glsxtr@theHvalue{\@glsxtr@thevalue}% % \end{macrocode} %Implement any default settings (before options are set) %\changes{1.30}{2018-04-25}{added \cs{glsaddpresetkeys}} % \begin{macrocode} - \glsaddpresetkeys - \setkeys{glossadd}{#1}% + \glsaddpresetkeys + \setkeys{glossadd}{#1}% % \end{macrocode} %Implement any default settings (after options are set) %\changes{1.30}{2018-04-25}{added \cs{glsaddpostsetkeys}} % \begin{macrocode} - \glsaddpostsetkeys - \ifdefempty{\@glsxtr@thevalue}% - {% - \@gls@saveentrycounter - }% - {% - \let\theglsentrycounter\@glsxtr@thevalue - \def\theHglsentrycounter{\@glsxtr@theHvalue}% - }% + \glsaddpostsetkeys + \ifdefempty{\@glsxtr@thevalue}% + {% + \@gls@saveentrycounter + }% + {% + \let\theglsentrycounter\@glsxtr@thevalue + \def\theHglsentrycounter{\@glsxtr@theHvalue}% + }% % \end{macrocode} % Define sort key if necessary (in case of \pkgopt[use]{sort}): %\changes{1.24}{2017-11-14}{added \cs{@gls@setsort}} % \begin{macrocode} - \@gls@setsort{#2}% - \@@do@wrglossary{#2}% - }% + \@gls@setsort{#2}% +% \end{macrocode} +%Ensure that indexing occurs (since that's the point of +%\cs{glsadd}). If indexing has been switched off by default, don't +%want the setting to affect \cs{glsadd}. The ignored format +%\cs{glsignore} can be used for selection without location, but the +%indexing still needs to be performed. +%\changes{1.37}{2018-11-30}{ensure that \cs{glsadd} performs indexing} +% \begin{macrocode} + \KV@glslink@noindexfalse + \@@do@wrglossary{#2}% + }% + \endgroup }% } % \end{macrocode} @@ -6094,6 +6535,16 @@ Dickimaw Books\\ \let\@gls@hyp@opt\@gls@alt@hyp@opt \def\@gls@alt@hyp@opt@char{#1}% \def\@gls@alt@hyp@opt@keys{#2}% + \ifdefequal\@glsxtr@record@setting\@glsxtr@record@setting@off + {}% + {% +% \end{macrocode} +%Let \gls{bib2gls} know the modifier. +%\changes{1.37}{2018-11-30}{write modifier to aux} +% \begin{macrocode} + \protected@write\@auxout{}{\string\providecommand{\string\@glsxtr@altmodifier}[1]{}}% + \protected@write\@auxout{}{\string\@glsxtr@altmodifier{#1}}% + }% } % \end{macrocode} %\end{macro} @@ -8114,12 +8565,15 @@ Dickimaw Books\\ %\changes{1.0}{2016-01-24}{new} % \begin{macrocode} \renewcommand*{\makeglossaries}[1][]{% - \ifx\@glsxtr@record@setting\@glsxtr@record@setting@only + \@glsxtr@if@record@only + {% \PackageError{glossaries-extra}{\string\makeglossaries\space - not permitted\MessageBreak with record=only package option}% + not permitted\MessageBreak with record=\@glsxtr@record@setting\space + package option}% {You may only use \string\makeglossaries\space with record=off or record=alsoindex options}% - \else + }% + {% \ifblank{#1}% {\@glsxtr@org@makeglossaries}% {% @@ -8310,7 +8764,7 @@ Dickimaw Books\\ \ifdef\@glo@check@sortallowed{\@glo@check@sortallowed\makeglossaries}{}% \fi }% - \fi + }% } % \end{macrocode} %\end{macro} @@ -8968,6 +9422,9 @@ Dickimaw Books\\ % %\begin{macro}{\glsxtrlocationhyperlink} %\changes{1.14}{2017-04-18}{new} +%\begin{definition} +%\cs{glsxtrlocationhyperlink}\marg{counter}\marg{prefix}\marg{location} +%\end{definition} % \begin{macrocode} \newcommand*{\glsxtrlocationhyperlink}[3]{% \ifdefvoid\glsxtrsupplocationurl @@ -9328,6 +9785,11 @@ Dickimaw Books\\ \makeatletter \@input{#2.glstex}% \@bibgls@restoreat +% \end{macrocode} +% If the \pkgopt[nameref]{record} option has been set, check if this +% is supported by the installed version of \app{bib2gls}. +% \begin{macrocode} + \@glsxtr@check@bibgls@nameref }% {% \GlossariesExtraWarning{No file `#2.glstex'}% @@ -9338,6 +9800,25 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\@glsxtr@check@bibgls@nameref} +%\changes{1.37}{2018-11-30}{new} +%This will only warn after \app{bib2gls} has created the .glstex +%file, but there's way to check before. +% \begin{macrocode} +\newcommand{\@glsxtr@check@bibgls@nameref}{% + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \ifdef\bibglshrefchar + {}% + {% + \GlossariesExtraWarning{record=nameref requires at least + version 1.8 of bib2gls}% + }% + \fi + \let\@glsxtr@check@bibgls@nameref\relax +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtrresourceinit} %\changes{1.21}{2017-11-03}{new} %Code used during the protected write operation. @@ -9444,6 +9925,13 @@ Dickimaw Books\\ \protected@write\@auxout{}% {\string\providecommand*{\string\glsxtr@record}[5]{}}% % \end{macrocode} +%\changes{1.37}{2018-11-30}{provide \cs{glsxtr@record@nameref} in aux file} +% \begin{macrocode} + \ifx\@glsxtr@record@setting\@glsxtr@record@setting@nameref + \protected@write\@auxout{}% + {\string\providecommand*{\string\glsxtr@record@nameref}[8]{}}% + \fi +% \end{macrocode} %If any languages have been loaded, the language tag will be %available in \cs{CurrentTrackedLanguageTag} (provided by %\sty{tracklang}). For multilingual @@ -9529,6 +10017,15 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtr@record@nameref} +%\changes{1.37}{2018-11-30}{new} +%Used with \pkgopt[nameref]{record} to include current label +%information. +% \begin{macrocode} +\newcommand*{\glsxtr@record@nameref}[8]{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtr@counterrecord} %\changes{1.12}{2017-02-03}{new} %Aux file command. @@ -9605,7 +10102,7 @@ Dickimaw Books\\ \ifglshasparent{#1}% {\GlsXtrStandaloneSubEntryItem{#1}}% {\glsentryitem{#1}}% - \glstarget{#1}{\glossentryname{#1}}% + \GlsXtrStandaloneEntryName{#1}% \endgroup }% }% @@ -9615,6 +10112,15 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\GlsXtrStandaloneEntryName} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\GlsXtrStandaloneEntryName}[1]{% + \glstarget{#1}{\glossentryname{#1}}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\GlsXtrStandaloneGlossaryType} %\changes{1.31}{2018-05-09}{new} %To make it easier to adjust the definition of \cs{currentglossary} @@ -9686,7 +10192,7 @@ Dickimaw Books\\ \ifglshasparent{#1}% {\GlsXtrStandaloneSubEntryItem{#1}}% {\glsentryitem{#1}}% - \glstarget{#1}{\glossentrynameother{#1}{#2}}% + \GlsXtrStandaloneEntryOther{#1}% \endgroup }% }% @@ -9696,6 +10202,15 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\GlsXtrStandaloneEntryOther} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\GlsXtrStandaloneEntryOther}[2]{% + \glstarget{#1}{\glossentrynameother{#1}{#2}}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\printunsrtglossary} %\changes{1.08}{2016-12-13}{new} %\changes{1.12}{2017-02-03}{added starred form} @@ -10003,6 +10518,14 @@ can only be used within \string\printunsrtglossaryentryprocesshook}{}% % \end{macrocode} %\end{macro} % +%\begin{macro}{\GlsXtrLocationField} +%\changes{1.37}{2018-11-30}{new} +%Stores the internal name of the location field. +% \begin{macrocode} +\newcommand*{\GlsXtrLocationField}{location} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtr@noidx@do} %\changes{1.11}{2017-01-19}{new} %Minor modification of \cs{@gls@noidx@do} to check for location @@ -10013,7 +10536,7 @@ can only be used within \string\printunsrtglossaryentryprocesshook}{}% \ifglsentryexists{#1}% {% \global\letcs{\@gls@loclist}{glo@\glsdetoklabel{#1}@loclist}% - \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@location}% + \global\letcs{\@gls@location}{glo@\glsdetoklabel{#1}@\GlsXtrLocationField}% \ifglshasparent{#1}% {% \gls@level=\csuse{glo@\glsdetoklabel{#1}@level}\relax @@ -10081,6 +10604,32 @@ can only be used within \string\printunsrtglossaryentryprocesshook}{}% %help make it unique, but it might feasibly contain %\gloskey[glslink]{thevalue} where the value might contain commands.) % +%\begin{macro}{\@glsxtr@providenewgls} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@glsxtr@providenewgls}{% + \protected@write\@auxout{}{\string\providecommand{\string\@glsxtr@newglslike}[2]{}}% + \let\@glsxtr@providenewgls\relax +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtridentifyglslike} +%\changes{1.37}{2018-11-30}{new} +%Identify the command given in the second argument for the benefit +%of \gls{bib2gls}. +% \begin{macrocode} +\newcommand{\glsxtridentifyglslike}[2]{% + \ifdefequal\@glsxtr@record@setting\@glsxtr@record@setting@off + {}% + {% + \@glsxtr@providenewgls + \protected@write\@auxout{}{\string\@glsxtr@newglslike{#1}{\string#2}}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsxtrnewgls} %\changes{1.21}{2017-11-03}{new} %\begin{definition} @@ -10096,6 +10645,10 @@ can only be used within \string\printunsrtglossaryentryprocesshook}{}% defined}{}% }% {% +% \end{macrocode} +%Write information to the aux file for bib2gls. +% \begin{macrocode} + \glsxtridentifyglslike{#2}{#3}% \ifcsdef{@#4like@#2}% {% \advance\@glsxtrnewgls@inner by \@ne @@ -22405,7 +22958,7 @@ defined}{}% %automatically loaded by the record option. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-bib2gls}[2018/08/18 v1.36 (NLCT)] +\ProvidesPackage{glossaries-extra-bib2gls}[2018/11/30 1.37 (NLCT)] % \end{macrocode} % %These are some convenient macros for use with custom rules. @@ -22443,6 +22996,32 @@ defined}{}% % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsrenewcommand} +%\changes{1.37}{2018-11-30}{new} +%Like \cs{renewcommand} but only generates a warning rather than an +%error if the command isn't defined. +% \begin{macrocode} +\newcommand*{\glsrenewcommand}{\@star@or@long\glsxtr@renewcommand} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtr@renewcommand} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\glsxtr@renewcommand}[1]{% + \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup + \expandafter\@ifundefined\@gtempa + {% + \GlossariesExtraWarning{can't redefine \noexpand#1(not already defined)}% + }% + \relax + \relax + \let\@ifdefinable\@rc@ifdefinable + \new@command#1% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtr@wrglossarylocation} %\changes{1.29}{2018-04-09}{new} %For use with \pkgopt{indexcounter} and \app{bib2gls}. @@ -22587,6 +23166,561 @@ defined}{}% % \end{macrocode} %\end{macro} % +%\begin{macro}{\glsxtrdisplaylocnameref} +%\changes{1.37}{2018-11-30}{new} +%\cs{glsxtrdisplaylocnameref}\marg{prefix}\marg{counter}\marg{format}\marg{location}\marg{name}\marg{href}\marg{hcounter}\marg{external +%file} +%Used with the \sty[nameref]{record} package option. The \meta{href} +%argument was obtained from \cs{@currentHref} and the +%\meta{hcounter} argument was obtained from \cs{theHentrycounter}, +%which is more reliable. +%If \sty{hyperref} hasn't been loaded, this just behaves like \cs{glsnoidxdisplayloc}. +% \begin{macrocode} +\ifundef\hyperlink +{ + \newcommand*{\glsxtrdisplaylocnameref}[8]{% + \glsnoidxdisplayloc{#1}{#2}{#3}{#4}% + } +} +{ +% \end{macrocode} +% Default action uses \meta{hcounter}. Equations and pages typically don't +% have a title, so check the counter name. +% \begin{macrocode} + \newcommand*{\glsxtrdisplaylocnameref}[8]{% + \ifstrequal{#2}{equation}% + {\glsxtrnamereflink{#3}{(#4)}{#2.#7}{#8}}% + {% + \ifstrempty{#5}% + {% +% \end{macrocode} +%No title, so just use the location as the link text. +% \begin{macrocode} + \glsxtrnamereflink{#3}{#4}{#2.#7}{#8}% + }% + {% + \ifstrequal{#2}{page}% + {\glsxtrnamereflink{#3}{#4}{#2.#7}{#8}}% + {\glsxtrnamereflink{#3}{#5}{#2.#7}{#8}}% + }% + }% + } +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrnamereflink} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrfmtnamereflink}\marg{format}\marg{title}\marg{href}\marg{external +%file} +%\end{definition} +% \begin{macrocode} +\newcommand*{\glsxtrnamereflink}[4]{% +% \end{macrocode} +%Locally change \cs{glshypernumber} to \cs{@firstofone} to +%remove the normal location hyperlink. +% \begin{macrocode} + \begingroup + \let\glshypernumber\@firstofone +% \end{macrocode} +%If the \meta{external file} argument is empty, an internal link is used, +%otherwise an external one is needed. +% \begin{macrocode} + \ifstrempty{#4}% + {\glsxtrfmtinternalnameref{#3}{#1}{#2}}% + {\glsxtrfmtexternalnameref{#3}{#1}{#2}{#4}}% + \endgroup +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrnameloclink} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrnamerefloclink}\marg{prefix}\marg{counter}\marg{format}\marg{location}\marg{text}\marg{external +%file} +%\end{definition} +%Like \cs{@gls@numberlink}, this creates a hyperlink to the +%target obtained from the prefix, counter and location but uses +%\meta{text} as the hyperlink text. As with regular indexing, this +%will fail if the target name can't be formed by prefixing the +%location value. +% \begin{macrocode} +\newcommand{\glsxtrnameloclink}[6]{% + \begingroup + \setentrycounter[#1]{#2}% + \def\glsxtr@locationhypertext{#5}% + \let\glshypernumber\@firstofone + \def\@glsnumberformat{#3}% + \def\glsxtrsupplocationurl{#6}% + \toks@={}% + \@glsxtr@bibgls@removespaces#4 \@nil + \endgroup +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@bibgls@removespaces} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\def\@glsxtr@bibgls@removespaces#1 #2\@nil{% + \toks@=\expandafter{\the\toks@#1}% + \ifx\\#2\\% + \edef\x{\the\toks@}% + \ifx\x\empty + \else + \protected@edef\x{\glsentrycounter\@glo@counterprefix\the\toks@}% + \ifdefvoid\glsxtrsupplocationurl + {% + \expandafter\glsxtrfmtinternalnameref\expandafter{\x}% + {\@glsnumberformat}{\glsxtr@locationhypertext}% + }% + {% + \expandafter\glsxtrfmtexternalnameref\expandafter{\x}% + {\@glsnumberformat}{\glsxtr@locationhypertext}{\glsxtrsupplocationurl}% + }% + \fi + \else + \@gls@ReturnAfterFi{% + \@glsxtr@bibgls@removespaces#2\@nil + }% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrfmtinternalnameref} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrfmtinternalnameloc}\marg{target}\marg{format}\marg{title} +%\end{definition} +% \begin{macrocode} +\newcommand*{\glsxtrfmtinternalnameref}[3]{% + \csuse{#2}{\glsdohyperlink{#1}{#3}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrfmtexternalnameref} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrfmtexternalnameloc}\marg{target}\marg{format}\marg{title}\marg{file} +%\end{definition} +% \begin{macrocode} +\newcommand*{\glsxtrfmtexternalnameref}[4]{% + \csuse{#2}{\hyperref{#4}{}{#1}{#3}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrSetWidest} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrSetWidest}\marg{type}\marg{level}\marg{text} +%\end{definition} +%As from \gls{bib2gls} v1.8, this is used by the \code{set-widest} +%resource option for the \glostyle{alttree} and the styles +%provided by the \sty{glossary-longextra} package. +% \begin{macrocode} +\newcommand*{\glsxtrSetWidest}[3]{% +% \end{macrocode} +%Check which style options have been provided. (The style packages +%may not have been loaded.) +% \begin{macrocode} + \ifdef\glsupdatewidest + {% + \ifdef\glslongextraUpdateWidest + {% +% \end{macrocode} +%Relevant style packages all loaded. +%If the \meta{type} has been given, append to glossary preamble. +% \begin{macrocode} + \ifstrempty{#1} + {% + \glsupdatewidest[#2]{#3}% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \apptoglossarypreamble[#1]{\glsupdatewidest[#2]{#3}}% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% + {% +% \end{macrocode} +%Only \glostyle{alttree}. +% \begin{macrocode} + \ifstrempty{#1} + {% + \glsupdatewidest[#2]{#3}% + }% + {% + \apptoglossarypreamble[#1]{\glsupdatewidest[#2]{#3}}% + }% + }% + }% + {% +% \end{macrocode} +%\cs{glsupdatewidest} hasn't been defined. This could just mean +%that the \sty{glossaries-extra-stylemods} package hasn't been +%loaded. +% \begin{macrocode} + \ifdef\glssetwidest + {% + \ifdef\glslongextraUpdateWidest + {% +% \end{macrocode} +%Relevant \sty{glossary-tree} and \sty{glossary-longextra} have been loaded. +%If the \meta{type} has been given, append to glossary preamble. +% \begin{macrocode} + \ifstrempty{#1} + {% + \glssetwidest[#2]{#3}% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \apptoglossarypreamble[#1]{\glssetwidest[#2]{#3}}% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% + {% +% \end{macrocode} +%Only \glostyle{alttree}. +% \begin{macrocode} + \ifstrempty{#1} + {% + \glssetwidest[#2]{#3}% + }% + {% + \apptoglossarypreamble[#1]{\glssetwidest[#2]{#3}}% + }% + }% + }% + {% + \ifdef\glslongextraUpdateWidest + {% +% \end{macrocode} +%\sty{glossary-longextra} has been loaded. +% \begin{macrocode} + \ifstrempty{#1} + {% + \ifnum#2=0\relax + \glslongextraUpdateWidest{#3}% + \else + \glslongextraUpdateWidestChild{#2}{#3}% + \fi + }% + {% + \ifnum#2=0\relax + \apptoglossarypreamble[#1]{\glslongextraUpdateWidest{#3}}% + \else + \apptoglossarypreamble[#1]{\glslongextraUpdateWidestChild{#2}{#3}}% + \fi + }% + }% +% \end{macrocode} +%Neither \sty{glossary-tree} nor \sty{glossary-longextra} have been +%loaded. Do nothing. +% \begin{macrocode} + {}% + }% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrSetWidestFallback} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrSetWidestFallback}\marg{max depth}\marg{list} +%\end{definition} +%Used when \gls{bib2gls} can't determine the widest name. +%The \meta{list} argument is a comma-separated list of glossary +%labels. The \meta{max depth} refers to the maximum hierarchical +%depth. This will either be 0 (only top-level entries) or 2 +%(up to two child-levels). +% \begin{macrocode} +\newcommand*{\glsxtrSetWidestFallback}[2]{% + \ifnum#1=0\relax + \ifdef\glsFindWidestTopLevelName + {% + \glsFindWidestTopLevelName[#2]% + }% + {% + \GlossariesExtraWarning{You need stylemods={tree} to + provide a fallback for set-widest}% + }% + \else + \ifdef\glsFindWidestLevelTwo + {% + \glsFindWidestLevelTwo[#2]% + \ifdef\glslongextraUpdateWidestChild + {% + \glslongextraUpdateWidestChild{#1}{\csuse{@glswidestnamei}}% + \glslongextraUpdateWidestChild{#1}{\csuse{@glswidestnameii}}% + }% + {}% + }% + {% + \GlossariesExtraWarning{You need stylemods={tree} to + provide a fallback for set-widest}% + }% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@labelprefixes} +%\changes{1.37}{2018-11-30}{new} +%List of label prefixes. +% \begin{macrocode} +\newcommand*{\@glsxtr@labelprefixes}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrclearlabelprefixes} +%\changes{1.37}{2018-11-30}{new} +%List of label prefixes. +% \begin{macrocode} +\newcommand*{\glsxtrclearlabelprefixes}{% + \renewcommand*{\@glsxtr@labelprefixes}{}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtraddlabelprefix} +%\changes{1.37}{2018-11-30}{new} +%Add prefix to the list. +%These should be added in the order of precedence with the last one +%as a fallback. This doesn't check against +%duplicates as it may be useful to replicate a prefix at the end as +%the fallback. +% \begin{macrocode} +\newcommand*{\glsxtraddlabelprefix}[1]{% + \ifstrempty{#1}% + {\glsxtraddlabelprefix{\empty}}% + {% + \ifdefempty\@glsxtr@labelprefixes + {\def\@glsxtr@labelprefixes{#1}}% + {\appto\@glsxtr@labelprefixes{,#1}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrprependlabelprefix} +%\changes{1.37}{2018-11-30}{new} +%Inserts at the start of the list. +% \begin{macrocode} +\newcommand*{\glsxtrprependlabelprefix}[1]{% + \ifstrempty{#1}% + {\glsxtrprependlabelprefix{\empty}}% + {% + \ifdefempty\@glsxtr@labelprefixes + {\def\@glsxtr@labelprefixes{#1}}% + {\preto\@glsxtr@labelprefixes{#1,}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrifinlabelprefixlist} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glsxtrifinlabelprefixlist}\marg{prefix}\marg{true}\marg{false} +%\end{definition} +%Test if the given prefix is in the list. +% \begin{macrocode} +\newcommand*{\glsxtrifinlabelprefixlist}[3]{% + \ifstrempty{#1}% + {\glsxtrifinlabelprefixlist{\empty}{#2}{#3}}% + {% + \DTLifinlist{#1}{\@glsxtr@labelprefixes}{#2}{#3}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@prefixlabellist} +%\changes{1.37}{2018-11-30}{new} +%This is provided for the benefit of \gls{bib2gls}. It's possible +%that the user may add more prefixes after the start of the +%document, but that can lead to inconsistencies. The final element +%of the list (the fallback) is the only prefix of interest for \gls{bib2gls}. +% \begin{macrocode} +\AtBeginDocument{% + \protected@write\@auxout{}{\string\providecommand{\string\@glsxtr@prefixlabellist}[1]{}}% + \protected@write\@auxout{}{\string\@glsxtr@prefixlabellist{\@glsxtr@labelprefixes}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsxtr@get@prefixedlabel} +%\changes{1.37}{2018-11-30}{new} +%Iterate through all the prefixes and find the first +%prefix and label combination that exists. If none found, this could +%mean that it's the first \LaTeX\ run, so the last prefix in the +%list needs to be the fallback one. Grouping is used in case +%of a nested for loop. +% \begin{macrocode} +\newcommand*{\@glsxtr@get@prefixedlabel}[1]{% + \begingroup +% \end{macrocode} +%Initialise to the unprefixed label in the event that the list is +%empty. +% \begin{macrocode} + \edef\@gls@thislabel{#1}% + \@for\@glsxtr@prefix:=\@glsxtr@labelprefixes\do + {% + \edef\@gls@thislabel{\@glsxtr@prefix#1}% + \ifglsentryexists{\@gls@thislabel}{\@endfortrue}{}% + }% + \edef\x{\endgroup\noexpand\def\noexpand\@gls@thislabel{\@gls@thislabel}}\x +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dgls} +%\changes{1.37}{2018-11-30}{new} +%Like \cs{gls} but tries the prefixes. (Can't use \cs{pgls} as +%that's provided by \sty{glossaries-prefix}.) Since this command +%is designed for \app{bib2gls}'s dual entry system, the \qt{d} +%stands for \qt{dual}. +% \begin{macrocode} +\newrobustcmd*{\dgls}{\@gls@hyp@opt\@dgls} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dgls} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dgls}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@gls@{#1}{\@gls@thislabel}}{\@gls@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dglspl} +% \begin{macrocode} +\newrobustcmd*{\dglspl}{\@gls@hyp@opt\@dglspl} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dglspl} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dglspl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@glspl@{#1}{\@gls@thislabel}}{\@glspl@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dGls} +% \begin{macrocode} +\newrobustcmd*{\dGls}{\@gls@hyp@opt\@dGls} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dGls} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dGls}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@Gls@{#1}{\@gls@thislabel}}{\@Gls@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dGlspl} +% \begin{macrocode} +\newrobustcmd*{\dGlspl}{\@gls@hyp@opt\@dGlspl} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dGlspl} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dGlspl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@Glspl@{#1}{\@gls@thislabel}}{\@Glspl@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dGLS} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newrobustcmd*{\dGLS}{\@gls@hyp@opt\@dGLS} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dGLS} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dGLS}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@GLS@{#1}{\@gls@thislabel}}{\@GLS@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dGLSpl} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newrobustcmd*{\dGLSpl}{\@gls@hyp@opt\@dGLSpl} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dGLSpl} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\@dGLSpl}[2][]{% + \@glsxtr@get@prefixedlabel{#2}% + \new@ifnextchar[{\@GLSpl@{#1}{\@gls@thislabel}}{\@GLSpl@{#1}{\@gls@thislabel}[]}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dglslink} +%\changes{1.37}{2018-11-30}{new} +%Like \cs{glslink} but tries the prefixes. +% \begin{macrocode} +\newrobustcmd*{\dglslink}[3][]{% + \@glsxtr@get@prefixedlabel{#2}% + \glslink[#1]{\@gls@thislabel}{#3}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\dglsdisp} +%\changes{1.37}{2018-11-30}{new} +%Like \cs{glsdisp} but tries the prefixes. +% \begin{macrocode} +\newrobustcmd*{\dglsdisp}[3][]{% + \@glsxtr@get@prefixedlabel{#2}% + \glsdisp[#1]{\@gls@thislabel}{#3}% +} +% \end{macrocode} +%\end{macro} +% %Provide missing Greek letters for use in maths mode. %These commands are recognised by \app{bib2gls} and will be mapped to the %Mathematical Greek Italic letters. This ensures that the Greek @@ -24817,7 +25951,7 @@ defined}{}% % First identify package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2018/08/13 v1.35 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2018/11/30 v1.37 (NLCT)] % \end{macrocode} % Provide package options to automatically load required predefined % styles. The simplest method is to just test for the existence of @@ -24846,6 +25980,7 @@ defined}{}% \RequirePackage{glossary-super}% \RequirePackage{glossary-superragged}% \RequirePackage{glossary-bookindex}% + \RequirePackage{glossary-longextra}% } } % \end{macrocode} @@ -25674,6 +26809,7 @@ defined}{}% % \begin{macrocode} \ifdef{\@glsstyle@tree} {% +% \end{macrocode} %Provide a command for use with the \glostyle{tree} styles that displays %the pre-description separator, the %description and post-description hook. @@ -25788,6 +26924,7 @@ defined}{}% % \begin{macrocode} \ifdef{\@glsstyle@treenoname} {% +% \end{macrocode} %Provide a command for use with the \glostyle{treenoname} styles that displays %the pre-description separator, the %description and post-description hook. @@ -26992,7 +28129,7 @@ defined}{}% %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossary-bookindex}[2018/08/18 v1.36 (NLCT)] +\ProvidesPackage{glossary-bookindex}[2018/11/30 1.37 (NLCT)] % \end{macrocode} %Load required packages. % \begin{macrocode} @@ -27428,6 +28565,1433 @@ defined}{}% %\fi %\iffalse % \begin{macrocode} +%<*glossary-longextra.sty> +% \end{macrocode} +%\fi +%\chapter{longextra styles (\styfmt{glossary-longextra.sty})} +%\changes{1.37}{2018-11-30}{new} +%\section{Package Initialisation and Options} +%Provides additional long styles. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossary-longextra}[2018/11/30 1.37 (NLCT)] +% \end{macrocode} +%Load required packages. +% \begin{macrocode} +\RequirePackage{glossary-longbooktabs} +% \end{macrocode} +% +%\begin{macro}{\glslongextraNameFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraNameFmt}\marg{label} +%\end{definition} +%Governs the way the name is displayed. +% \begin{macrocode} +\newcommand{\glslongextraNameFmt}[1]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{#1}}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraDescFmt}\marg{label} +%\end{definition} +%Governs the way the description is displayed. +% \begin{macrocode} +\newcommand{\glslongextraDescFmt}[1]{% + \glossentrydesc{#1}\glspostdescription +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymbolFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraSymbolFmt}\marg{label} +%\end{definition} +%Governs the way the symbol is displayed. +% \begin{macrocode} +\newcommand{\glslongextraSymbolFmt}[1]{\glossentrysymbol{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraLocationFmt}\marg{label}\marg{location list} +%\end{definition} +%Governs the way the location is displayed. +% \begin{macrocode} +\newcommand{\glslongextraLocationFmt}[2]{#2} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSubNameFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraSubNameFmt}\marg{level}\marg{label} +%\end{definition} +%Governs the way the child name is displayed. Just does the +%sub-entry counter, if enabled, and the target. +% \begin{macrocode} +\newcommand{\glslongextraSubNameFmt}[2]{% + \glssubentryitem{#2}\glstarget{#2}{\strut}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSubDescFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraSubDescFmt}\marg{level}\marg{label} +%\end{definition} +%Governs the way the child description is displayed. +% \begin{macrocode} +\newcommand{\glslongextraSubDescFmt}[2]{% + \glslongextraDescFmt{#2}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSubSymbolFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraSubSymbolFmt}\marg{level}\marg{label} +%\end{definition} +%Governs the way the child symbol is displayed. +% \begin{macrocode} +\newcommand{\glslongextraSubSymbolFmt}[2]{% + \glslongextraSymbolFmt{#2}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSubLocationFmt} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraSubLocationFmt}\marg{level}\marg{label}\marg{location list} +%\end{definition} +%Governs the way the child location list is displayed. +% \begin{macrocode} +\newcommand{\glslongextraSubLocationFmt}[3]{#3} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameAlign} +%\changes{1.37}{2018-11-30}{new} +%Alignment for the name column. +% \begin{macrocode} +\newcommand{\glslongextraNameAlign}{l} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescAlign} +%\changes{1.37}{2018-11-30}{new} +%Alignment for the description column. +% \begin{macrocode} +\newcommand{\glslongextraDescAlign}{>{\raggedright}p{\glsdescwidth}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymbolAlign} +%\changes{1.37}{2018-11-30}{new} +%Alignment for the symbol column. +% \begin{macrocode} +\newcommand{\glslongextraSymbolAlign}{c} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationAlign} +%\changes{1.37}{2018-11-30}{new} +%Alignment for the location column. +% \begin{macrocode} +\newcommand{\glslongextraLocationAlign}{>{\raggedright}p{\glspagelistwidth}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraGroupHeading} +%\changes{1.37}{2018-11-30}{new} +%Used to format the letter group headings. The first argument is the +%number of columns in the table. The second is the group +%\emph{label} (not the title). +% \begin{macrocode} +\newcommand{\glslongextraGroupHeading}[2]{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraHeaderFormat} +%\changes{1.37}{2018-11-30}{new} +%Format for the column headers. +% \begin{macrocode} +\newcommand{\glslongextraHeaderFmt}[1]{\textbf{#1}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescHeader}{% + \glslongextraNameDescTabularHeader\endhead + \glslongextraNameDescTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\descriptionname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%Unlike the \glostyle{alttree} style, there aren't different widths +%for the hierarchical levels. +%\begin{macro}{\glslongextraSetWidest} +%\changes{1.37}{2018-11-30}{new} +%Provide in case the tree styles haven't been loaded. +% \begin{macrocode} +\newcommand*{\glslongextraSetWidest}[1]{% + \def\@glslongextrawidestname{#1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glslongextrawidestname} +%\changes{1.37}{2018-11-30}{new} +%Pick up the widest name from the \glostyle{alttree} style if it has +%been set. (Will expand to nothing otherwise.) +% \begin{macrocode} +\newcommand*{\@glslongextrawidestname}{\csuse{@glswidestname}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraUpdateWidest} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand*{\glslongextraUpdateWidest}[1]{% + \ifundef\@glslongextrawidestname + {\def\@glslongextrawidestname{#1}}% + {% + \settowidth{\dimen@}{\@glslongextrawidestname}% + \settowidth{\dimen@ii}{#1}% + \ifdim\dimen@ii>\dimen@ + \def\@glslongextrawidestname{#1}% + \fi + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraUpdateWidestChild} +%\changes{1.37}{2018-11-30}{new} +%\begin{definition} +%\cs{glslongextraUpdateWidestChild}\marg{level}\marg{text} +%\end{definition} +%Used by \cs{glsxtrSetWidest} in \sty{glossaries-extra-bib2gls}. +%Does nothing by default, since the default action in these styles +%is to omit the child name. If the child name should be displayed, +%then this needs to be redefined to use +%\cs{glslongextraUpdateWidest}. +% \begin{macrocode} +\newcommand*{\glslongextraUpdateWidestChild}[2]{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSetDescWidth} +%\changes{1.37}{2018-11-30}{new} +% Computes the value of \cs{glsdescwidth} for the styles that only +% have name and description columns. +% \begin{macrocode} +\newcommand{\glslongextraSetDescWidth}{% + \settowidth{\gls@tmplen}{\glslongextraHeaderFmt\entryname}% +% \end{macrocode} +% Has the widest name been set. +% \begin{macrocode} + \settowidth{\dimen@}{\glsnamefont{\@glslongextrawidestname}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \fi +% \end{macrocode} +% Description width is \cs{linewidth} less 4\cs{tabcolsep} less the +% width of the name column. +% \begin{macrocode} + \setlength{\glsdescwidth}{\dimexpr\linewidth-4\tabcolsep-\gls@tmplen}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymSetDescWidth} +%\changes{1.37}{2018-11-30}{new} +% Computes the value of \cs{glsdescwidth} for the styles that only +% have name, symbol and description columns. +% \begin{macrocode} +\newcommand{\glslongextraSymSetDescWidth}{% +% \end{macrocode} +% Work out the size for just the name and description style. +% \begin{macrocode} + \glslongextraSetDescWidth +% \end{macrocode} +% Now work out the symbol column width. This is assuming that the +% column title will be the widest text in the column. +% \begin{macrocode} + \settowidth{\gls@tmplen}{\glslongextraHeaderFmt\symbolname}% +% \end{macrocode} +% Subtract 2\cs{tabcolsep} and the symbol header width. +% \begin{macrocode} + \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\gls@tmplen}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocSetDescWidth} +%\changes{1.37}{2018-11-30}{new} +% Computes the value of \cs{glsdescwidth} for the styles that only +% have name, location and description columns. +% \begin{macrocode} +\newcommand{\glslongextraLocSetDescWidth}{% +% \end{macrocode} +% Work out the size for just the name and description style. +% \begin{macrocode} + \glslongextraSetDescWidth +% \end{macrocode} +% Subtract 2\cs{tabcolsep} and the location list column width. +% \begin{macrocode} + \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\glspagelistwidth}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymLocSetDescWidth} +%\changes{1.37}{2018-11-30}{new} +% Computes the value of \cs{glsdescwidth} for the styles that +% have name, symbol, location and description columns. +% \begin{macrocode} +\newcommand{\glslongextraSymLocSetDescWidth}{% +% \end{macrocode} +% Work out the size for just the name, symbol and description style. +% \begin{macrocode} + \glslongextraSymSetDescWidth +% \end{macrocode} +% Subtract 2\cs{tabcolsep} and the location list column width. +% \begin{macrocode} + \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\glspagelistwidth}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ifGlsLongExtraUseTabular} +%\changes{1.37}{2018-11-30}{new} +%If true use \env{tabular} instead of \env{longtable}. Obviously +%only intended for short glossaries that can fit into a single page. +% \begin{macrocode} +\newif\ifGlsLongExtraUseTabular +\GlsLongExtraUseTabularfalse +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraTabularVAlign} +%\changes{1.37}{2018-11-30}{new} +%Only used with the \env{tabular} setting. +% \begin{macrocode} +\newcommand*{\glslongextraTabularVAlign}{c} +% \end{macrocode} +%\end{macro} +%\begin{abbrvstyle}{long-name-desc} +%\changes{1.37}{2018-11-30}{new} +%Two column style with multi-lined descriptions and header. +%This is similar to the \glostyle{longragged-booktabs} style. +% \begin{macrocode} +\newglossarystyle{long-name-desc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign}}% + \@glslongextra@begintab + }% + {% + \glslongextraNameDescTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameDescTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign}}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameDescHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{2}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraDescFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2} + & + \glslongextraSubDescFmt{##1}{##2}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraNameDescLocationHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescLocationHeader}{% + \glslongextraNameDescLocationTabularHeader\endhead + \glslongextraNameDescLocationTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescLocationTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescLocationTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\pagelistname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescLocationTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescLocationTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-name-desc-loc} +%\changes{1.37}{2018-11-30}{new} +%Three columns: name, description and location list. +% \begin{macrocode} +\newglossarystyle{long-name-desc-loc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraNameDescLocationTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameDescLocationTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameDescLocationHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraLocationFmt{##1}{##2}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2}& + \glslongextraSubDescFmt{##1}{##2}& + \glslongextraSubLocationFmt{##1}{##2}{##3}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraDescNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescNameHeader}{% + \glslongextraDescNameTabularHeader\endhead + \glslongextraDescNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\descriptionname& + \glslongextraHeaderFmt\entryname \tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-desc-name} +%\changes{1.37}{2018-11-30}{new} +%Like \glostyle{name-desc} but swaps the columns. +% \begin{macrocode} +\newglossarystyle{long-desc-name}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign}}% + \@glslongextra@begintab + }% + {% + \glslongextraDescNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraDescNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign}}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraDescNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{2}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraDescFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraLocationDescNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescNameHeader}{% + \glslongextraLocationDescNameTabularHeader\endhead + \glslongextraLocationDescNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationDescNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\pagelistname& + \glslongextraHeaderFmt\descriptionname& + \glslongextraHeaderFmt\entryname \tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationDescNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-loc-desc-name} +%\changes{1.37}{2018-11-30}{new} +%Three columns: location, description and name. +% \begin{macrocode} +\newglossarystyle{long-loc-desc-name}% +{% + \ifGlsLongExtraUseTabular + {% + \glslongextraLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign}}% + \@glslongextra@begintab + }% + {% + \glslongextraLocationDescNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraLocationDescNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign}}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraLocationDescNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraLocationFmt{##1}{##2} & + \glslongextraDescFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubLocationFmt{##1}{##2}{##3} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraNameDescSymHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymHeader}{% + \glslongextraNameDescSymTabularHeader\endhead + \glslongextraNameDescSymTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescSymTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\symbolname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescSymTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-name-desc-sym} +%\changes{1.37}{2018-11-30}{new} +%Three column style with symbol in the third column. +% \begin{macrocode} +\newglossarystyle{long-name-desc-sym}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraNameDescSymTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameDescSymTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameDescSymHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraSymbolFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraNameDescSymLocationHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymLocationHeader}{% + \glslongextraNameDescSymLocationTabularHeader\endhead + \glslongextraNameDescSymLocationTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescSymLocationTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymLocationTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\pagelistname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameDescSymLocationTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameDescSymLocationTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-name-desc-sym-loc} +%\changes{1.37}{2018-11-30}{new} +%Four columns: name, description and location +% \begin{macrocode} +\newglossarystyle{long-name-desc-sym-loc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraNameDescSymLocationTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameDescSymLocationTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameDescSymLocationHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraSymbolFmt{##1}& + \glslongextraLocationFmt{##1}{##2}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2}& + \glslongextraSubLocationFmt{##1}{##2}{##3}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraNameSymDescHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescHeader}{% + \glslongextraNameSymDescTabularHeader\endhead + \glslongextraNameSymDescTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameSymDescTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\descriptionname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameSymDescTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-name-sym-desc} +%\changes{1.37}{2018-11-30}{new} +%Three column style with symbol in the second column. +% \begin{macrocode} +\newglossarystyle{long-name-sym-desc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraNameSymDescTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameSymDescTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameSymDescHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraSymbolFmt{##1} & + \glslongextraDescFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraNameSymDescLocationHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescLocationHeader}{% + \glslongextraNameSymDescLocationTabularHeader\endhead + \glslongextraNameSymDescLocationTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameSymDescLocationTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescLocationTabularHeader}{% + \toprule + \glslongextraHeaderFmt\entryname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\pagelistname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraNameSymDescLocationTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraNameSymDescLocationTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-name-sym-desc-loc} +%\changes{1.37}{2018-11-30}{new} +%Four column style with symbol in the second column. +% \begin{macrocode} +\newglossarystyle{long-name-sym-desc-loc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraNameSymDescLocationTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraNameSymDescLocationTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraLocationAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraNameSymDescLocationHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraNameFmt{##1} & + \glslongextraSymbolFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraLocationFmt{##1}{##2}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubNameFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubLocationFmt{##1}{##2}{##3}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraSymDescNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraSymDescNameHeader}{% + \glslongextraSymDescNameTabularHeader\endhead + \glslongextraSymDescNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymDescNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraSymDescNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\entryname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraSymDescNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraSymDescNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-sym-desc-name} +%\changes{1.37}{2018-11-30}{new} +%Three column style with symbol in the first column, description in +%the second and name in the third. +% \begin{macrocode} +\newglossarystyle{long-sym-desc-name}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraSymDescNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraSymDescNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraSymDescNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraSymbolFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraLocationSymDescNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationSymDescNameHeader}{% + \glslongextraLocationSymDescNameTabularHeader\endhead + \glslongextraLocationSymDescNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationSymDescNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationSymDescNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\pagelistname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\entryname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationSymDescNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationSymDescNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-loc-sym-desc-name} +%\changes{1.37}{2018-11-30}{new} +%Four column style with location list, symbol, description and name. +% \begin{macrocode} +\newglossarystyle{long-loc-sym-desc-name}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraLocationSymDescNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraLocationSymDescNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraLocationSymDescNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraLocationFmt{##1}{##2} & + \glslongextraSymbolFmt{##1} & + \glslongextraDescFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubLocationFmt{##1}{##2}{##3} & + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraDescSymNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescSymNameHeader}{% + \glslongextraDescSymNameTabularHeader\endhead + \glslongextraDescSymNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescSymNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescSymNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\entryname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraDescSymNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraDescSymNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-desc-sym-name} +%\changes{1.37}{2018-11-30}{new} +%Three column style with description in the first column, symbol in +%the second and name in the third. +% \begin{macrocode} +\newglossarystyle{long-desc-sym-name}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraDescSymNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraDescSymNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraDescSymNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraDescFmt{##1} & + \glslongextraSymbolFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\begin{macro}{\glslongextraLocationDescSymNameHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescSymNameHeader}{% + \glslongextraLocationDescSymNameTabularHeader\endhead + \glslongextraLocationDescSymNameTabularFooter\endfoot +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationDescSymNameTabularHeader} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescSymNameTabularHeader}{% + \toprule + \glslongextraHeaderFmt\pagelistname & + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\entryname\tabularnewline + \midrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongextraLocationDescSymNameTabularFooter} +%\changes{1.37}{2018-11-30}{new} +% \begin{macrocode} +\newcommand{\glslongextraLocationDescSymNameTabularFooter}{% + \bottomrule +} +% \end{macrocode} +%\end{macro} +% +%\begin{abbrvstyle}{long-loc-desc-sym-name} +%\changes{1.37}{2018-11-30}{new} +%Four column style with location list, description, symbol and name. +% \begin{macrocode} +\newglossarystyle{long-loc-desc-sym-name}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraLocationDescSymNameTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraLocationDescSymNameTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymLocSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraLocationAlign + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraLocationDescSymNameHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand{\glossentry}[2]{% + \glslongextraLocationFmt{##1}{##2} & + \glslongextraDescFmt{##1} & + \glslongextraSymbolFmt{##1} & + \glslongextraNameFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubLocationFmt{##1}{##2}{##3} & + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubSymbolFmt{##1}{##2} & + \glslongextraSubNameFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +% \end{macrocode} +%\end{abbrvstyle} +% +%\iffalse +% \begin{macrocode} +%</glossary-longextra.sty> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*example-glossaries-xr.tex> % \end{macrocode} %\fi 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 b5956567208..ad19aa47335 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.2 2018/8/18 20:14 +% glossaries-extra.ins generated using makedtx version 1.2 2018/11/30 18:41 \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-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. + This work consists of the files glossaries-extra.dtx and glossaries-extra.ins and the derived files glossaries-extra.sty, glossaries-extra-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, glossary-longextra.sty, example-glossaries-xr.tex, example-glossaries-acronym-desc.bib, example-glossaries-acronym.bib, example-glossaries-acronyms-lang.bib, example-glossaries-brief.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib. \endpreamble @@ -32,6 +32,8 @@ \usepostamble\defaultpostamble\from{glossaries-extra.dtx}{glossaries-extra-stylemods.sty,package}} \file{glossary-bookindex.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries-extra.dtx}{glossary-bookindex.sty,package}} +\file{glossary-longextra.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries-extra.dtx}{glossary-longextra.sty,package}} \file{example-glossaries-xr.tex}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries-extra.dtx}{example-glossaries-xr.tex,package}} \file{example-glossaries-acronym-desc.bib}{\nopreamble\nopostamble\from{glossaries-extra.dtx}{example-glossaries-acronym-desc.bib}} |