diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-10 21:45:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-10 21:45:31 +0000 |
commit | 9bb046ed6f507a2cfcfe59984674922afe5d2ed9 (patch) | |
tree | c1ed0d3ba58acdf5fc6a9e3356645aa51528a157 /Master/texmf-dist/source/latex/glossaries-extra | |
parent | 0ac6fd79d838a5f0181ad5378bc0721ea37cd58a (diff) |
glossaries-extra (10jun16)
git-svn-id: svn://tug.org/texlive/trunk@41342 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 | 715 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins | 2 |
2 files changed, 698 insertions, 19 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 78529390d7a..e7e4ba96a2a 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx @@ -1,14 +1,14 @@ %\iffalse % glossaries-extra.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: -% -src "glossaries-extra.sty\Z=>glossaries-extra.sty" -% -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" % -author "Nicola Talbot" % -section "chapter" -% -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" % -doc "glossaries-extra-codedoc.tex" +% -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" +% -src "glossaries-extra.sty\Z=>glossaries-extra.sty" +% -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" % glossaries-extra -% Created on 2016/5/2 18:05 +% Created on 2016/6/10 17:48 %\fi %\iffalse %<*package> @@ -53,7 +53,7 @@ glossaries-extra.dtx pdftitle={glossaries-extra.sty: an extension to the glossaries package}, pdfkeywords={LaTeX,package,glossary,abbreviations}]{hyperref} -\usepackage{glossaries-extra} +\usepackage[nonumberlist,nopostdot=false]{glossaries-extra} \RecordChanges @@ -90,6 +90,7 @@ package}, of the document or after a reset) with one of the following commands: \ics{gls}, \ics{Gls}, \ics{GLS}, \ics{glspl}, \ics{Glspl}, \ics{GLSpl} or \ics{glsdisp}. + \glsadd{firstuseflag}\glsadd{firstusetext}% \glsseeformat{firstuseflag,firstusetext}{}\nopostdesc}% } @@ -117,7 +118,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{8698} +\CheckSum{9358} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -153,13 +154,13 @@ styles (glossaries):>#1={\protect\ttfamily#1}|main}} \raggedright } -\title{glossaries-extra.sty v1.04: +\title{glossaries-extra.sty v1.05: documented code} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} -\date{2016-05-02} +\date{2016-06-10} \begin{document} \DocInput{glossaries-extra.dtx} @@ -204,7 +205,7 @@ Dickimaw Books\\ %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2016/05/02 v1.04 (NLCT)] +\ProvidesPackage{glossaries-extra}[2016/06/10 v1.05 (NLCT)] % \end{macrocode} % Requires \sty{xkeyval} to define package options. % \begin{macrocode} @@ -8630,6 +8631,23 @@ want % \end{macrocode} %\end{abbrvstyle} % +%\begin{macro}{\glsfirstlongfootnotefont} +%\changes{1.05}{2016-06-10}{new} +%Only used by the \qt{footnote} styles. +% \begin{macrocode} +\newcommand*{\glsfirstlongfootnotefont}[1]{\glslongfootnotefont{#1}}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glslongfootnotefont} +%\changes{1.05}{2016-06-10}{new} +%Only used by the \qt{footnote} styles. +% \begin{macrocode} +\newcommand*{\glslongfootnotefont}[1]{\glslongdefaultfont{#1}}% +% \end{macrocode} +%\end{macro} +% +% %\begin{abbrvstyle}{footnote} % Short form followed by long form in footnote on first use. % Take care about using \cs{glsfirst} as this won't suppress the @@ -8669,8 +8687,8 @@ want \renewcommand*{\abbrvpluralsuffix}{\glspluralsuffix}% \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} % The full format displays the short form followed by the long form % as a footnote. @@ -8756,8 +8774,12 @@ want \csdef{glsxtrpostlink\glscategorylabel}{% \glsxtrifwasfirstuse {% +% \end{macrocode} +% Needs the specific font command here as the style may have been +% lost by the time the footnote occurs. +% \begin{macrocode} \glsxtrdopostpunc{\protect\footnote - {\glsfirstlongfont{\glsentrylong{\glslabel}}}}% + {\glsfirstlongfootnotefont{\glsentrylong{\glslabel}}}}% }% {}% }% @@ -8784,8 +8806,8 @@ want \renewcommand*{\abbrvpluralsuffix}{\glspluralsuffix}% \renewcommand*\glsabbrvfont[1]{\glsabbrvdefaultfont{##1}}% \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvdefaultfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongdefaultfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongdefaultfont{##1}}% + \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongfootnotefont{##1}}% + \renewcommand*{\glslongfont}[1]{\glslongfootnotefont{##1}}% % \end{macrocode} % The full format displays the short form. The long form is % deferred. @@ -9818,12 +9840,11 @@ want {% % \end{macrocode} % Mostly as short-long style: +%\changes{1.05}{2016-06-10}{fixed incorrect font used by long form} % \begin{macrocode} \GlsXtrUseAbbrStyleFmts{short-long}% \renewcommand*\glsabbrvfont[1]{\glsabbrvemfont{##1}}% \renewcommand*\glsfirstabbrvfont[1]{\glsfirstabbrvemfont{##1}}% - \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}% - \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}% } % \end{macrocode} %\end{abbrvstyle} @@ -11595,13 +11616,14 @@ want %\fi %\chapter{Style Adjustments (\styfmt{glossaries-extra-stylemods.sty})} % This package adjusts the predefined styles so that they include the post -% description hook. +% description hook. Also, some other minor adjustments may be made +% to make existing styles more flexible. % %\section{Package Initialisation} % First identify package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2016/05/02 v1.04 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2016/06/10 v1.05 (NLCT)] % \end{macrocode} % Provide package options to automatically load required predefined % styles. The simplest method is to just test for the existence of @@ -11942,6 +11964,663 @@ want {} % \end{macrocode} % +%\section{Tree Styles} +% The \glostyle{alttree} style is redefined to make it easier to +% made minor adjustments. +% \begin{macrocode} +\ifdef{\@glsstyle@alttree} +{% +% \end{macrocode} +% Only redefine this style if it's already been defined. +% +%\begin{macro}{\glsxtralttreeSymbolDescLocation} +%\changes{1.05}{??}{new} +%\begin{definition} +%\cs{glsxtralttreeSymbolDescLocation}\marg{label}\marg{location +%list} +%\end{definition} +%Layout the symbol, description and location for top-level entries. +% \begin{macrocode} + \newcommand{\glsxtralttreeSymbolDescLocation}[2]{% + {% + \let\par\glsxtrAltTreePar + \ifglshassymbol{#1}{(\glossentrysymbol{#1})\space}{}% + \glossentrydesc{#1}\glspostdescription \space #2\par + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrAltTreeIndent} +%\changes{1.05}{??}{new} +% Paragraph indent for subsequent paragraphs in multi-paragraph +% descriptions. +% \begin{macrocode} +\newlength\glsxtrAltTreeIndent +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrAltTreePar} +%\changes{1.05}{??}{new} +%Multi-paragraph descriptions need to keep the hanging indent. +% \begin{macrocode} + \newcommand{\glsxtrAltTreePar}{% + \@@par + \glsxtrAltTreeSetHangIndent + \setlength{\parindent}{\dimexpr\hangindent+\glsxtrAltTreeIndent}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtralttreeSubSymbolDescLocation} +%\changes{1.05}{??}{new} +%\begin{definition} +%\cs{glsxtralttreeSubSymbolDescLocation}\marg{level}\marg{label}\marg{location +%list} +%\end{definition} +%Layout the symbol, description and location for sub-entries. +% Defaults to the same as the top-level. +% \begin{macrocode} + \newcommand{\glsxtralttreeSubSymbolDescLocation}[3]{% + \glsxtralttreeSymbolDescLocation{#2}{#3}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrtreetopindent} +%\changes{1.05}{??}{new} +% The original style has to keep computing the width of the name at +% each entry. This register allows the style to compute it once for +% the top-level at the start of the glossary. +% \begin{macrocode} + \newlength\glsxtrtreetopindent +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtralttreeInit} +%\changes{1.05}{??}{new} +% User-level initialisation for the \glostyle{alttree} style. +% \begin{macrocode} + \newcommand*{\glsxtralttreeInit}{% + \settowidth{\glsxtrtreetopindent}{\glstreenamefmt{\glsgetwidestname\space}}% + \glsxtrAltTreeIndent=\parindent + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\eglssetwidest} +%\changes{1.05}{??}{new} +% The original \cs{glssetwidest} only uses \cs{def}. This uses +% \cs{protected@csedef}. +% \begin{macrocode} + \newcommand*{\eglssetwidest}[2][0]{% + \protected@csedef{@glswidestname\romannumeral#1}{#2}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\xglssetwidest} +%\changes{1.05}{??}{new} +%Like the above but uses \cs{protected@csxdef}. +% \begin{macrocode} + \newcommand*{\xglssetwidest}[2][0]{% + \protected@csxdef{@glswidestname\romannumeral#1}{#2}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsgetwidestname} +%\changes{1.05}{??}{new} +% Provide a user-level macro to obtain the widest top-level name. +% \begin{macrocode} + \newcommand*{\glsgetwidestname}{\@glswidestname} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsgetwidestsubname} +%\changes{1.05}{??}{new} +% Provide a user-level macro to obtain the widest sub-entry name. +% \begin{macrocode} + \newcommand*{\glsgetwidestsubname}[1]{% + \ifcsundef{@glswidestname\romannumeral#1}% + {\@glswidestname}% + {\csuse{@glswidestname\romannumeral#1}}% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestTopLevelName} +%CamelCase is easier for long command names. Provide a CamelCase +%synonym of \ics{glsfindwidesttoplevelname}. +% \begin{macrocode} + \let\glsFindWidestTopLevelName\glsfindwidesttoplevelname +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedTopLevelName} +%\changes{1.05}{??}{new} +% Like \cs{glsfindwidesttoplevelname} but has an additional check +% that the entry has been used. Only useful if the glossaries occur +% at the end of the document, in which case this command should go +% at the start of the glossary. Alternatively, place at the end of +% the document and save for the next run. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedTopLevelName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedAnyName} +%\changes{1.05}{??}{new} +% Like the above but doesn't check the parent key. Useful if all +% levels should have the same width for the name. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedAnyName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestAnyName} +%\changes{1.05}{??}{new} +% Like the above but doesn't check is the entry has been used. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestAnyName}[1][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedLevelTwo} +%\changes{1.05}{??}{new} +% This is like \cs{glsFindWidestUsedTopLevelName} but also sets the +% first two sub-levels as well. Any entry that has a +% great-grandparent is ignored. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedLevelTwo}[1][\@glo@types]{% + \dimen@=0pt\relax + \dimen@i=0pt\relax + \dimen@ii=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% + \ifglshasparent{\@glo@parent}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% + \ifglshasparent{\@glo@parent}% + {}% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ii + \dimen@ii=\gls@tmplen + \eglssetwidest[2]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@i + \dimen@i=\gls@tmplen + \eglssetwidest[1]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ + \dimen@=\gls@tmplen + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestLevelTwo} +%\changes{1.05}{??}{new} +% This is like \cs{glsFindWidestUsedLevelTwo} but doesn't check if the +% entry has been used. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestLevelTwo}[1][\@glo@types]{% + \dimen@=0pt\relax + \dimen@i=0pt\relax + \dimen@ii=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglshasparent{\@glo@label}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@label}@parent}}% + \ifglshasparent{\@glo@parent}% + {% + \edef\@glo@parent{\csuse{glo@\glsdetoklabel{\@glo@parent}@parent}}% + \ifglshasparent{\@glo@parent}% + {}% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ii + \dimen@ii=\gls@tmplen + \eglssetwidest[2]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@i + \dimen@i=\gls@tmplen + \eglssetwidest[1]{\glsentryname{\@glo@label}}% + \fi + }% + }% + {% + \settowidth{\gls@tmplen}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\gls@tmplen>\dimen@ + \dimen@=\gls@tmplen + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + }% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedAnyNameSymbol} +%\changes{1.05}{??}{new} +% Like the \cs{glsFindWidestUsedAnyName} but also measures the +% symbol. The length of the widest symbol is stored in the second argument +% should be a length register. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedAnyNameSymbol}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestAnyNameSymbol} +%\changes{1.05}{??}{new} +% Like the above but doesn't check if the entry has been used. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestAnyNameSymbol}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedAnyNameSymbolLocation} +%\changes{1.05}{??}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbol} but also measures the +% location list. This requires \ics{glsentrynumberlist}. +% The length of the widest symbol is stored in the second argument +% should be a length register. The length of the widest location +% list is stored in the third argument, which should also be a +% length register. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedAnyNameSymbolLocation}[3][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + #3=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#3\relax + #3=\dimen@ + \fi + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestAnyNameSymbolLocation} +%\changes{1.05}{??}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbol} but doesn't check if +% the entry has been used. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestAnyNameSymbolLocation}[3][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + #3=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\glsentrysymbol{\@glo@label}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#3\relax + #3=\dimen@ + \fi + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestUsedAnyNameLocation} +%\changes{1.05}{??}{new} +% Like the \cs{glsFindWidestUsedAnyNameSymbolLocation} but doesn't +% measure the symbol. The length of the widest location +% list is stored in the second argument, which should be a +% length register. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestUsedAnyNameLocation}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \ifglsused{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + {}% + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsFindWidestAnyNameLocation} +%\changes{1.05}{??}{new} +% Like the \cs{glsFindWidestAnyNameLocation} but doesn't +% check the \gls{firstuse} flag. +% \begin{macrocode} + \newrobustcmd*{\glsFindWidestAnyNameLocation}[2][\@glo@types]{% + \dimen@=0pt\relax + \gls@tmplen=0pt\relax + #2=0pt\relax + \forallglossaries[#1]{\@gls@type}% + {% + \forglsentries[\@gls@type]{\@glo@label}% + {% + \settowidth{\dimen@}% + {\glstreenamefmt{\glsentryname{\@glo@label}}}% + \ifdim\dimen@>\gls@tmplen + \gls@tmplen=\dimen@ + \eglssetwidest{\glsentryname{\@glo@label}}% + \fi + \settowidth{\dimen@}% + {\GlsXtrFormatLocationList{\glsentrynumberlist{\@glo@label}}}% + \ifdim\dimen@>#2\relax + #2=\dimen@ + \fi + }% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrComputeTreeIndent} +%\changes{1.05}{??}{new} +% Compute the value of \cs{glstreeindent}. Argument is the entry label. +% (Ignored in default definition, but this command may be redefined +% to take the particular entry into account.) Note that the +% sub-levels modify \cs{glstreeindent}. +% \begin{macrocode} + \newcommand*{\glsxtrComputeTreeIndent}[1]{% + \glstreeindent=\glsxtrtreetopindent\relax + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrComputeTreeSubIndent} +%\changes{1.05}{??}{new} +%\begin{macrocode} +%\cs{\glsxtrComputeTreeSubIndent}\marg{level}\marg{label}\marg{register} +%\end{macrocode} +% Compute the indent for the sub-entries. The first argument is the +% level, the second argument is the entry label and the third +% argument is the length register used to store the computed indent. +% \begin{macrocode} + \newcommand*{\glsxtrComputeTreeSubIndent}[3]{% + \ifcsundef{@glswidestname\romannumeral#1}% + {% + \settowidth{#3}{\glstreenamefmt{\@glswidestname\space}}% + }% + {% + \settowidth{#3}{\glstreenamefmt{% + \csname @glswidestname\romannumeral#1\endcsname\space}}% + }% + } +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrAltTreeSetHangIndent} +%\changes{1.05}{??}{new} +% Set \cs{hangindent} for top-level entries: +% \begin{macrocode} +\newcommand*{\glsxtrAltTreeSetHangIndent}{\hangindent\glstreeindent} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsxtrAltTreeSetSubHangIndent} +%\changes{1.05}{??}{new} +% Set \cs{hangindent} for sub-entries: +% \begin{macrocode} +\newcommand*{\glsxtrAltTreeSetSubHangIndent}[1]{\hangindent\glstreeindent} +% \end{macrocode} +%\end{macro} +% +% Redefine \glostyle{alttree}: +% \begin{macrocode} + \renewglossarystyle{alttree}{% + \renewenvironment{theglossary}% + {% + \glsxtralttreeInit + \def\@gls@prevlevel{-1}% + \mbox{}\par}% + {\par}% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand{\glossentry}[2]{% + \ifnum\@gls@prevlevel=0\relax + \else + \glsxtrComputeTreeIndent{##1}% + \fi + \parindent\glstreeindent + \glsxtrAltTreeSetHangIndent + \makebox[0pt][r]% + {% + \glstreenamebox{\glstreeindent}% + {% + \glsentryitem{##1}% + \glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}% + }% + }% + \glsxtralttreeSymbolDescLocation{##1}{##2}% + \def\@gls@prevlevel{0}% + } + \renewcommand{\subglossentry}[3]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \ifnum\@gls@prevlevel=##1\relax + \else + \glsxtrComputeTreeSubIndent{##1}{##2}{\gls@tmplen}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \ifnum\@gls@prevlevel=0\relax + \glsxtrComputeTreeIndent{##2}% + \else + \glsxtrComputeTreeSubIndent{\@gls@prevlevel}{##2}{\glstreeindent}% + \fi + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi + \glsxtrAltTreeSetSubHangIndent{##1}% + \makebox[0pt][r]{\glstreenamebox{\gls@tmplen}{% + \glstreenamefmt{\glstarget{##2}{\glossentryname{##2}}}}}% + \glsxtralttreeSubSymbolDescLocation{##1}{##2}{##3}% + \def\@gls@prevlevel{##1}% + }% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + } +}% +{% +% \end{macrocode} +% Assume the style isn't required if it hasn't already been defined. +% \begin{macrocode} +} +% \end{macrocode} +% % Reset the default style % \begin{macrocode} \ifx\@glossary@default@style\relax 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 c1a3bd89823..24b9ba0af4c 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins @@ -1,4 +1,4 @@ -% glossaries-extra.ins generated using makedtx version 1.1 2016/5/2 18:05 +% glossaries-extra.ins generated using makedtx version 1.1 2016/6/10 17:48 \input docstrip \preamble |