diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-20 20:37:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-20 20:37:01 +0000 |
commit | dfd3a224de343462796bcded2036ad4d70799aad (patch) | |
tree | 7ed53dc32bf67b1268c944d446e9b513943ac8dd /Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty | |
parent | 1bea5105918383ace6baf917095f5127b4b52025 (diff) |
glossaries-extra (20oct22)
git-svn-id: svn://tug.org/texlive/trunk@64764 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty | 331 |
1 files changed, 328 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty index a69976433a3..364aa72fe05 100644 --- a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-longextra.sty @@ -7,7 +7,7 @@ %% glossaries-extra.dtx (with options: `glossary-longextra.sty,package') %% %% glossaries-extra.dtx -%% Copyright 2021 Nicola Talbot +%% Copyright 2022 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,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, glossary-longextra.sty, glossary-topic.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-childmultipar.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-longchild.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbolnames.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-abbrstyles.def, glossaries-extra-bib2gls.sty, glossaries-extra-stylemods.sty, glossary-bookindex.sty, glossary-longextra.sty, glossary-topic.sty, glossary-table.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-childmultipar.bib, example-glossaries-childnoname.bib, example-glossaries-cite.bib, example-glossaries-images.bib, example-glossaries-long.bib, example-glossaries-longchild.bib, example-glossaries-multipar.bib, example-glossaries-parent.bib, example-glossaries-symbolnames.bib, example-glossaries-symbols.bib, example-glossaries-url.bib, example-glossaries-xr.bib, glossaries-extra-2021-11-22.sty, glossaries-extra-bib2gls-2021-11-22.sty, glossaries-extra-stylemods-2021-11-22.sty, glossary-bookindex-2021-11-22.sty, glossary-longextra-2021-11-22.sty, glossary-topic-2021-11-22.sty. %% %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -39,7 +39,9 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossary-longextra}[2021/11/22 v1.48 (NLCT)] +\DeclareRelease{v1.48}{2021-11-22}{glossary-longextra-2021-11-22.sty} +\DeclareCurrentRelease{v1.49}{2022-10-14} +\ProvidesPackage{glossary-longextra}[2022/10/14 v1.49 (NLCT)] \RequirePackage{glossary-longbooktabs} \newcommand{\glslongextraNameFmt}[1]{% \glsentryitem{#1}\glstarget{#1}{\glossentryname{#1}}% @@ -48,7 +50,21 @@ \glossentrydesc{#1}\glspostdescription } \newcommand{\glslongextraSymbolFmt}[1]{\glossentrysymbol{#1}} +\newcommand{\glslongextraSymbolTargetFmt}[1]{% + \glsentryitem{#1}\glstarget{#1}{\glslongextraSymbolFmt{#1}}} +\newcommand{\glslongextraSymbolOrName}[1]{% + \ifglshassymbol{#1}% + {\glslongextraSymbolTargetFmt{#1}}% + {\glslongextraNameFmt{#1}}% +} \newcommand{\glslongextraLocationFmt}[2]{#2} +\newcommand{\glslongextraShortTargetFmt}[1]{% + \glsentryitem{#1}\glstarget{#1}{{\glsxtrshort[noindex,hyper=false]{#1}}}% + \glsxtrpostnamehook{#1}% +} +\newcommand{\glslongextraLongFmt}[1]{% + {\glsxtrlong[noindex,hyper=false]{#1}}\glspostdescription +} \newcommand{\glslongextraSubNameFmt}[2]{% \glssubentryitem{#2}\glstarget{#2}{\strut}% } @@ -58,12 +74,27 @@ \newcommand{\glslongextraSubSymbolFmt}[2]{% \glslongextraSymbolFmt{#2}% } +\newcommand{\glslongextraSubSymbolTargetFmt}[2]{% + \glssubentryitem{#2}\glstarget{#2}{\glslongextraSymbolFmt{#2}}% +} +\newcommand{\glslongextraSubSymbolOrName}[2]{% + \ifglshassymbol{#2}% + {\glslongextraSubSymbolTargetFmt{#1}{#2}}% + {\glslongextraSubNameFmt{#1}{#2}}% +} +\newcommand{\glslongextraSubShortTargetFmt}[2]{% + \glssubentryitem{#2}\glstarget{#2}{{\glsxtrshort[noindex,hyper=false]{#2}}}% + \glsxtrpostnamehook{#2}% +} +\newcommand{\glslongextraSubLongFmt}[2]{\glslongextraLongFmt{#2}} \newcommand{\glslongextraSubLocationFmt}[3]{#3} \newcommand{\glslongextraNameAlign}{l} \newcommand{\glslongextraDescAlign}{>{\raggedright}p{\glsdescwidth}} \newcommand{\glslongextraSymbolAlign}{c} +\newcommand{\glslongextraSymbolNameAlign}{l} \newcommand{\glslongextraLocationAlign}{>{\raggedright}p{\glspagelistwidth}} \newcommand{\glslongextraGroupHeading}[2]{} +\newcommand*{\glslongextraSubGroupHeading}[5]{} \newcommand{\glslongextraHeaderFmt}[1]{\textbf{#1}} \newcommand{\glslongextraNameDescHeader}{% \glslongextraNameDescTabularHeader\endhead @@ -107,6 +138,10 @@ \settowidth{\gls@tmplen}{\glslongextraHeaderFmt\symbolname}% \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\gls@tmplen}% } +\newcommand{\glslongextraSymNoNameSetDescWidth}{% + \settowidth{\gls@tmplen}{\glslongextraHeaderFmt\symbolname}% + \setlength{\glsdescwidth}{\dimexpr\linewidth-4\tabcolsep-\gls@tmplen}% +} \newcommand{\glslongextraLocSetDescWidth}{% \glslongextraSetDescWidth \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\glspagelistwidth}% @@ -115,6 +150,10 @@ \glslongextraSymSetDescWidth \setlength{\glsdescwidth}{\dimexpr\glsdescwidth-2\tabcolsep-\glspagelistwidth}% } +\newcommand{\glslongextraShortNoNameSetDescWidth}{% + \settowidth{\gls@tmplen}{\glslongextraHeaderFmt\glslongextraShortHeader}% + \setlength{\glsdescwidth}{\dimexpr\linewidth-4\tabcolsep-\gls@tmplen}% +} \newif\ifGlsLongExtraUseTabular \GlsLongExtraUseTabularfalse \newcommand*{\glslongextraTabularVAlign}{c} @@ -150,6 +189,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameDescHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{2}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{2}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraDescFmt{##1}\tabularnewline @@ -216,6 +256,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameDescLocationHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraDescFmt{##1} & @@ -278,6 +319,7 @@ \renewcommand*{\glossaryheader}{\glslongextraDescNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{2}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{2}}% \renewcommand{\glossentry}[2]{% \glslongextraDescFmt{##1} & \glslongextraNameFmt{##1}\tabularnewline @@ -339,6 +381,7 @@ \renewcommand*{\glossaryheader}{\glslongextraLocationDescNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraLocationFmt{##1}{##2} & \glslongextraDescFmt{##1} & @@ -405,6 +448,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameDescSymHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraDescFmt{##1} & @@ -475,6 +519,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameDescSymLocationHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{4}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraDescFmt{##1} & @@ -544,6 +589,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameSymDescHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraSymbolFmt{##1} & @@ -613,6 +659,7 @@ \renewcommand*{\glossaryheader}{\glslongextraNameSymDescLocationHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{4}}% \renewcommand{\glossentry}[2]{% \glslongextraNameFmt{##1} & \glslongextraSymbolFmt{##1} & @@ -681,6 +728,7 @@ \renewcommand*{\glossaryheader}{\glslongextraSymDescNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraSymbolFmt{##1} & \glslongextraDescFmt{##1} & @@ -750,6 +798,7 @@ \renewcommand*{\glossaryheader}{\glslongextraLocationSymDescNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{4}}% \renewcommand{\glossentry}[2]{% \glslongextraLocationFmt{##1}{##2} & \glslongextraSymbolFmt{##1} & @@ -818,6 +867,7 @@ \renewcommand*{\glossaryheader}{\glslongextraDescSymNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% \renewcommand{\glossentry}[2]{% \glslongextraDescFmt{##1} & \glslongextraSymbolFmt{##1} & @@ -887,6 +937,7 @@ \renewcommand*{\glossaryheader}{\glslongextraLocationDescSymNameHeader}% \fi \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{4}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{4}}% \renewcommand{\glossentry}[2]{% \glslongextraLocationFmt{##1}{##2} & \glslongextraDescFmt{##1} & @@ -905,6 +956,280 @@ \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% \fi } +\newglossarystyle{long-sym-desc}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraSymbolNameAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraSymDescTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraSymDescTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraSymbolNameAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraSymDescHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% + \renewcommand{\glossentry}[2]{% + \glslongextraSymbolOrName{##1} & + \glslongextraDescFmt{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubSymbolOrName{##1}{##2} & + \glslongextraSubDescFmt{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newcommand{\glslongextraSymDescHeader}{% + \glslongextraSymDescTabularHeader\endhead + \glslongextraSymDescTabularFooter\endfoot +} +\newcommand{\glslongextraSymDescTabularHeader}{% + \toprule + \glslongextraHeaderFmt\symbolname & + \glslongextraHeaderFmt\descriptionname\tabularnewline + \midrule +} +\newcommand{\glslongextraSymDescTabularFooter}{% + \bottomrule +} +\newglossarystyle{long-desc-sym}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraSymNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraDescSymTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraDescSymTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraSymNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraSymbolNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraDescSymHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% + \renewcommand{\glossentry}[2]{% + \glslongextraDescFmt{##1} & + \glslongextraSymbolOrName{##1}\tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \glslongextraSubDescFmt{##1}{##2} & + \glslongextraSubSymbolOrName{##1}{##2}\tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newcommand{\glslongextraDescSymHeader}{% + \glslongextraDescSymTabularHeader\endhead + \glslongextraDescSymTabularFooter\endfoot +} +\newcommand{\glslongextraDescSymTabularHeader}{% + \toprule + \glslongextraHeaderFmt\descriptionname & + \glslongextraHeaderFmt\symbolname\tabularnewline + \midrule +} +\newcommand{\glslongextraDescSymTabularFooter}{% + \bottomrule +} +\newglossarystyle{abbr-short-long}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraShortNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraShortLongTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraShortLongTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraShortNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraNameAlign + \expandonce\glslongextraDescAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraShortLongHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% + \renewcommand{\glossentry}[2]{% + \ifglshasshort{##1}% + {\glslongextraShortTargetFmt{##1}}% + {\glslongextraNameFmt{##1}}% + & + \ifglshaslong{##1}% + {\glslongextraLongFmt{##1}}% + {\glslongextraDescFmt{##1}}% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \ifglshasshort{##2}% + {\glslongextraSubShortTargetFmt{##1}{##2}}% + {\glslongextraSubNameFmt{##1}{##2}}% + & + \ifglshaslong{##2}% + {\glslongextraSubLongFmt{##1}{##2}}% + {\glslongextraSubDescFmt{##1}{##2}}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newcommand{\glslongextraShortLongHeader}{% + \glslongextraShortLongTabularHeader\endhead + \glslongextraShortLongTabularFooter\endfoot +} +\newcommand{\glslongextraShortHeader}{\entryname} +\newcommand{\glslongextraLongHeader}{\descriptionname} +\newcommand{\glslongextraShortLongTabularHeader}{% + \toprule + \glslongextraHeaderFmt\glslongextraShortHeader & + \glslongextraHeaderFmt\glslongextraLongHeader\tabularnewline + \midrule +} +\newcommand{\glslongextraShortLongTabularFooter}{% + \bottomrule +} +\newglossarystyle{abbr-long-short}% +{% + \ifGlsLongExtraUseTabular + \renewenvironment{theglossary}% + {% + \glslongextraShortNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{tabular}[\glslongextraTabularVAlign]{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {% + \glslongextraLongShortTabularFooter + \end{tabular}% + }% + \renewcommand*{\glossaryheader}{\glslongextraLongShortTabularHeader}% + \else + \renewenvironment{theglossary}% + {% + \glspatchLToutput + \glslongextraShortNoNameSetDescWidth + \edef\@glslongextra@begintab{% + \noexpand\begin{longtable}{% + \expandonce\glslongextraDescAlign + \expandonce\glslongextraNameAlign + }}% + \@glslongextra@begintab + }% + {\end{longtable}}% + \renewcommand*{\glossaryheader}{\glslongextraLongShortHeader}% + \fi + \renewcommand*{\glsgroupheading}[1]{\glslongextraGroupHeading{3}{##1}}% + \renewcommand*{\glssubgroupheading}{\glslongextraSubGroupHeading{3}}% + \renewcommand{\glossentry}[2]{% + \ifglshaslong{##1}% + {\glslongextraLongFmt{##1}}% + {\glslongextraDescFmt{##1}}% + & + \ifglshasshort{##1}% + {\glslongextraShortTargetFmt{##1}}% + {\glslongextraNameFmt{##1}}% + \tabularnewline + }% + \renewcommand{\subglossentry}[3]{% + \ifglshaslong{##2}% + {\glslongextraSubLongFmt{##1}{##2}}% + {\glslongextraSubDescFmt{##1}{##2}}% + & + \ifglshasshort{##2}% + {\glslongextraSubShortTargetFmt{##1}{##2}}% + {\glslongextraSubNameFmt{##1}{##2}}% + \tabularnewline + }% + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{\glspenaltygroupskip}% + \fi +} +\newcommand{\glslongextraLongShortHeader}{% + \glslongextraLongShortTabularHeader\endhead + \glslongextraLongShortTabularFooter\endfoot +} +\newcommand{\glslongextraLongShortTabularHeader}{% + \toprule + \glslongextraHeaderFmt\glslongextraLongHeader & + \glslongextraHeaderFmt\glslongextraShortHeader\tabularnewline + \midrule +} +\newcommand{\glslongextraLongShortTabularFooter}{% + \bottomrule +} \endinput %% %% End of file `glossary-longextra.sty'. |