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-table.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-table.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries-extra/glossary-table.sty | 925 |
1 files changed, 925 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries-extra/glossary-table.sty b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-table.sty new file mode 100644 index 00000000000..e2fec653505 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries-extra/glossary-table.sty @@ -0,0 +1,925 @@ +%% +%% This is file `glossary-table.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries-extra.dtx (with options: `glossary-table.sty,package') +%% +%% glossaries-extra.dtx +%% 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 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% 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-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 +%% Lower-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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossary-table}[2022/10/14 v1.49 (NLCT)] +\RequirePackage{glossary-longbooktabs} +\newcount\glstableblockperrowcount +\glstableblockperrowcount=2\relax +\define@key{printglosstable}{blocks}{\glstableblockperrowcount=#1\relax} +\newcount\glstablecurrentblockindex +\newcount\glstabletotalcols +\glstabletotalcols=4\relax +\newcommand{\glstablenameheader}{\entryname} +\newcommand{\glstabledescheader}{\descriptionname} +\newcommand{\glstableotherheader}{\MFUsentencecase{\glstableotherfield}} +\newcommand{\glstablesymbolheader}{\symbolname} +\define@boolkey{printglosstable}{header}[true]{} +\KV@printglosstable@headertrue +\define@boolkey{printglosstable}{rules}[true]{} +\KV@printglosstable@rulestrue +\define@key{printglosstable}{blocksep}{\renewcommand{\glstable@blockalignsep}{#1}} +\newcommand{\glstable@blockalignsep}{|} +\newenvironment{glstablesubentries}{\begin{tabular}[t]{l}}{\end{tabular}} +\newcommand{\glstablePreChildren}{\glstableifpar{\par}} +\newcommand{\glstableblocksubentrysep}{\\} +\define@choicekey{printglosstable}{par} +[\@glstable@par@val\@glstable@par@n] +{false,justified,ragged} +{% + \ifcase\@glstable@par@n + \renewcommand{\glstable@parcase}[3]{##1}% + \or + \renewcommand{\glstable@parcase}[3]{##2}% + \or + \renewcommand{\glstable@parcase}[3]{##3}% + \fi +} +\newcommand{\glstable@parcase}[3]{#1} +\newcommand{\glstableifpar}[1]{\glstable@parcase{}{#1}{#1}} +\newcommand{\glstableleftalign}[1]{% + \glstable@parcase{l}{p{#1}}{>{\protect\raggedright}p{#1}}% +} +\newcommand{\glstablerightalign}[1]{% + \glstable@parcase{r}{p{#1}}{>{\protect\raggedleft}p{#1}}% +} +\newcommand{\glstablecenteralign}[1]{% + \glstable@parcase{c}{p{#1}}{>{\protect\centering}p{#1}}% +} +\newcommand{\glstablenamecolalign}{\glstableleftalign{\glstablenamewidth}} +\newcommand{\glstabledesccolalign}{\glstableleftalign{\glstabledescwidth}} +\newcommand{\glstablesymbolcolalign}{\glstablecenteralign{\glstablesymbolwidth}} +\newcommand{\glstableNameTarget}[1]{% + \glstarget{#1}{\glstableNameFmt{#1}}% +} +\newcommand{\glstableNameFmt}[1]{\glsentryitem{#1}\glossentryname{#1}} +\newcommand{\glstableSubNameTarget}[1]{% + \glstarget{#1}{\glstableSubNameFmt{#1}}% +} +\newcommand{\glstableSubNameFmt}[1]{% + \glssubentryitem{#1}% +} +\newcommand{\glstableotherfield}{} +\define@key{printglosstable}{other}{\renewcommand{\glstableotherfield}{#1}} +\newcommand{\glstableOther}[1]{% + \glsxtrusefield{#1}{\glstableotherfield}} +\newcommand{\glstableNameSingleFmt}[1]{% + \glstableNameTarget{#1}% + \ifglshasdesc{#1}% + {% + \glstableNameSinglePostName + \glstableNameSingleSuppl + {% + \ifglshassymbol{#1}% + {\glstableSymbolFmt{#1}\glstableNameSingleSymSep}% + {}% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOther{#1}\glstableOtherSep}% + }% + \glstableDescFmt{#1}% + }% + }% + {% + \ifglshassymbol{#1}% + {% + \glstableNameSinglePostName + \glstableNameSingleSuppl{\glstableSymbolFmt{#1}}% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableNameSingleSymSep\glstableOther{#1}}% + }% + }% + {% + \ifdefempty\glstableotherfield{}% + {% + \glstableNameSinglePostName + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOther{#1}}% + }% + }% + }% +} +\newcommand{\glstableNameSingleSuppl}[1]{(#1)} +\newcommand{\glstableNameSinglePostName}{ } +\newcommand{\glstableNameSingleSymSep}{ } +\newcommand{\glstableOtherSep}{, } +\newcommand{\glstableSubNameSingleFmt}[1]{% + \glstableSubNameTarget{#1}% + \GlsXtrIfFieldUndef{desc}{#1}{}% + {% + \GlsXtrIfFieldUndef{symbol}{#1}{}{}% + {% + \glstableNameSinglePostSubName + \glstableNameSingleSubSuppl{\glstableSubSymbolFmt{#1}}% + }% + }% + {% + \glstableNameSinglePostSubName + \glstableNameSingleSubSuppl + {% + \GlsXtrIfFieldUndef{symbol}{#1}{}% + {\glstableSubSymbolFmt{#1}\glstableNameSingleSymSep}% + \glstableSubDescFmt{#1}% + }% + }% +} +\newcommand{\glstableNameSingleSubSuppl}[1]{#1} +\newcommand{\glstableNameSinglePostSubName}{ } +\newcommand{\glstableNameNoDesc}[1]{% + \glstableNameTarget{#1}% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOtherSep\glstableOther{#1}}% + }% +} +\newcommand{\glstableSubNameNoDesc}[1]{% + \glstableSubNameTarget{#1}% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOtherSep\glstableOther{#1}}% + }% +} +\newcommand{\glstableSymbolFmt}[1]{\glossentrysymbol{#1}} +\newcommand{\glstableSubSymbolFmt}[1]{\glstableSymbolFmt{#1}} +\newcommand{\glstableSymbolNameTarget}[1]{% + \glstarget{#1}{\glstableSymbolNameFmt{#1}}% +} +\newcommand{\glstableSymbolNameFmt}[1]{\glsentryitem{#1}\glossentrysymbol{#1}} +\newcommand{\glstableSubSymbolNameTarget}[1]{% + \glstarget{#1}{\glstableSubSymbolNameFmt{#1}}% +} +\newcommand{\glstableSubSymbolNameFmt}[1]{\glssubentryitem{#1}} +\newcommand{\glstableDesc}[1]{% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOther{#1}\ifglshasdesc{#1}{\glstableOtherSep}{}}% + }% + \glstableDescFmt{#1}% +} +\newcommand{\glstableDescFmt}[1]{\glossentrydesc{#1}\glspostdescription} +\newcommand{\glstableSubDesc}[1]{\glstableDesc{#1}} +\newcommand{\glstableSubDescFmt}[1]{\glstableDescFmt{#1}} +\newcommand{\glstableOtherNoDesc}[1]{% + \ifdefempty\glstableotherfield{}% + {% + \GlsXtrIfFieldUndef{\glstableotherfield}{#1}{}% + {\glstableOther{#1}}% + }% +} +\newcommand{\glstableSubOtherNoDesc}[1]{% + \glstableOtherNoDesc{#1}% +} +\newcommand{\glstableHeaderFmt}[1]{\textbf{#1}} +\define@key{printglosstable}{block-style} +{\glstablesetstyle{#1}} +\newcount\glstablecolsperblock +\glstablecolsperblock=2\relax +\newcommand{\glstableblockheader}{} +\newcommand{\glstableblockalign}{} +\newcommand{\glstableblockentry}[1]{} +\newcommand{\glstableblocksubentry}[1]{} +\newcommand{\glstableinitlengthupdates}{} +\newcommand{\glstablelengthupdate}[1]{} +\newcommand{\glstablefinishlengthupdates}{} +\newcommand{\glstablesetstyle}[1]{% + \ifcsdef{@glstable@style@#1}% + {\csuse{@glstable@style@#1}}% + {\PackageError{glossary-table}{Unknown style `#1'}{}}% +} +\newcommand{\glstablenewstyle}[2]{% + \ifcsdef{@glstable@style@#1}% + {\PackageError{glossary-table}{style `#1' already defined}{}}% + {\csdef{@glstable@style@#1}{#2}}% +} +\glstablenewstyle{name-desc}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameTarget{##1} & \glstableDesc{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameTarget{##1} & \glstableSubDesc{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader & + \glstableHeaderFmt\glstabledescheader}% + \renewcommand{\glstableblockalign}{\glstablenamecolalign\glstabledesccolalign}% +} +\glstablesetstyle{name-desc} +\glstablenewstyle{name}{% + \glstablecolsperblock=1\relax + \renewcommand{\glstableinitlengthupdates}{}% + \renewcommand{\glstablelengthupdate}[1]{}% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstablenamewidth}{\glstableblockwidth}% + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameSingleFmt{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameSingleFmt{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader}% + \renewcommand{\glstableblockalign}{\glstablenamecolalign}% +} +\glstablenewstyle{name-symbol}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstablenamewidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstablenamewidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth}% + \ifdim\glstablenamewidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstablesymbolwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameNoDesc{##1} & \glstableSymbolFmt{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameNoDesc{##1} & \glstableSubSymbolFmt{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader & + \glstableHeaderFmt\glstablesymbolheader}% + \renewcommand{\glstableblockalign}{\glstablenamecolalign\glstablesymbolcolalign}% +} +\glstablenewstyle{desc-name}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableDesc{##1} & + \glstableNameTarget{##1}% + }% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubDesc{##1} & + \glstableSubNameTarget{##1}% + }% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstabledescheader & + \glstableHeaderFmt\glstablenameheader + }% + \renewcommand{\glstableblockalign}{\glstabledesccolalign\glstablenamecolalign}% +} +\glstablenewstyle{symbol-name}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstablenamewidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstablenamewidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth}% + \ifdim\glstablenamewidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstablesymbolwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableSymbolFmt{##1} & + \glstableNameNoDesc{##1}% + }% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubSymbolFmt{##1} & + \glstableSubNameNoDesc{##1}% + }% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablesymbolheader & + \glstableHeaderFmt\glstablenameheader + }% + \renewcommand{\glstableblockalign}{\glstablesymbolcolalign\glstablenamecolalign}% +} +\glstablenewstyle{name-symbol-desc}{% + \glstablecolsperblock=3\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth + - 0.5\glstablesymbolwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameTarget{##1} & + \glstableSymbolFmt{##1} & + \glstableDesc{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameTarget{##1} & + \glstableSubSymbolFmt{##1} & + \glstableSubDesc{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader & + \glstableHeaderFmt\glstablesymbolheader & + \glstableHeaderFmt\glstabledescheader}% + \renewcommand{\glstableblockalign}{% + \glstablenamecolalign\glstablesymbolcolalign\glstabledesccolalign}% +} +\glstablenewstyle{name-desc-symbol}{% + \glstablecolsperblock=3\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth + - 0.5\glstablesymbolwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameTarget{##1} & + \glstableDesc{##1} & + \glstableSymbolFmt{##1}% + }% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameTarget{##1} & + \glstableSubDesc{##1} & + \glstableSubSymbolFmt{##1}% + }% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader & + \glstableHeaderFmt\glstabledescheader & + \glstableHeaderFmt\glstablesymbolheader + }% + \renewcommand{\glstableblockalign}{% + \glstablenamecolalign\glstabledesccolalign\glstablesymbolcolalign}% +} +\glstablenewstyle{name-other}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableNameTarget{##1} & \glstableOtherNoDesc{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubNameTarget{##1} & \glstableSubOtherNoDesc{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablenameheader & + \glstableHeaderFmt\glstableotherheader}% + \renewcommand{\glstableblockalign}{\glstablenamecolalign\glstabledesccolalign}% +} +\glstablenewstyle{other-name}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablenamewidth}% + {\glstableHeaderFmt\glstablenameheader}% + \else + \setlength{\glstablenamewidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablenamewidth}{\glstableNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablenamewidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablenamewidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablenamewidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableOtherNoDesc{##1} & + \glstableNameTarget{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubOtherNoDesc{##1} & + \glstableSubNameTarget{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstableotherheader & + \glstableHeaderFmt\glstablenameheader}% + \renewcommand{\glstableblockalign}{\glstabledesccolalign\glstablenamecolalign}% +} +\glstablenewstyle{symbol-other}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablesymbolwidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablesymbolwidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableSymbolNameTarget{##1} & \glstableOtherNoDesc{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubSymbolNameTarget{##1} & \glstableSubOtherNoDesc{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstablesymbolheader & + \glstableHeaderFmt\glstableotherheader}% + \renewcommand{\glstableblockalign}{\glstablesymbolcolalign\glstabledesccolalign}% +} +\glstablenewstyle{other-symbol}{% + \glstablecolsperblock=2\relax + \renewcommand{\glstableinitlengthupdates}{% + \ifKV@printglosstable@header + \settowidth{\glstablesymbolwidth}% + {\glstableHeaderFmt\glstablesymbolheader}% + \else + \setlength{\glstablesymbolwidth}{0pt}% + \fi + \setlength{\glstabledescwidth}{0pt}% + }% + \renewcommand{\glstablelengthupdate}[1]{% + \glstablemeasureandupdate{\glstablesymbolwidth}{\glstableSymbolNameFmt{##1}}% + }% + \renewcommand{\glstablefinishlengthupdates}{% + \setlength{\glstabledescwidth}{\dimexpr\glstableblockwidth + - \glstablesymbolwidth}% + \ifdim\glstabledescwidth<0pt\relax + \setlength{\glstablesymbolwidth}{\dimexpr0.5\glstableblockwidth}% + \setlength{\glstabledescwidth}{\glstablesymbolwidth}% + \fi + }% + \renewcommand{\glstableblockentry}[1]{% + \glstableOtherNoDesc{##1} & \glstableSymbolNameTarget{##1}}% + \renewcommand{\glstableblocksubentry}[1]{% + \glstableSubOtherNoDesc{##1} & + \glstableSubSymbolNameTarget{##1}}% + \renewcommand{\glstableblockheader}{% + \glstableHeaderFmt\glstableotherheader & + \glstableHeaderFmt\glstablesymbolheader}% + \renewcommand{\glstableblockalign}{\glstabledesccolalign\glstablesymbolcolalign}% +} +\newcommand{\glstablecaption}[3]{% + \caption[#1]{#3#2}% +} +\newcommand{\glstablepostnextcaption}{ Cont./} +\newcommand{\glstablenextcaption}[2]{% + \caption[]{#1\glstablepostnextcaption}% +} +\newcommand{\glstablefoot}[1]{} +\newcommand{\glstablelastfoot}[1]{\glstablerowspan{#1}} +\newcommand{\glstablehead}[1]{} +\newcommand{\glstablefirsthead}[1]{\glstablerowspan{#1}} +\newcommand{\glstablerowspan}[1]{% + \multicolumn{\glstabletotalcols}{c}{\parbox{\LTcapwidth}{#1}}% +} +\newcommand{\glstable@begin}{% + \PackageError{glossary-table}{table style can only be used with + \string\printunsrttable}{}% +} +\newcommand{\glstable@filter}[1]{% + \ifnum\glscurrententrylevel>0\relax + \printunsrtglossaryskipentry + \else + \glstableiffilter{#1}% + {\printunsrtglossaryskipentry}% + {% + \glstableifpar{\glstablelengthupdate{#1}}% + }% + \fi +} +\newcommand{\glstableiffilter}[3]{#3} +\newlength\glstablenamewidth +\newlength\glstableblockwidth +\newlength\glstabledescwidth +\newlength\glstablesymbolwidth +\newcommand{\glstableifmeasuring}[2]{#2} +\newcommand{\glstable@stepentry}[1]{% + \ifglsentrycounter + \stepcounter{glossaryentry}% + \fi +} +\newcommand{\glstable@stepsubentry}[1]{% + \ifglssubentrycounter + \stepcounter{glossarysubentry}% + \fi +} +\newcommand{\glstablemeasureandupdate}[2]{% + \let\glstableifmeasuring\@firstoftwo + \let\@glsunset\@glsxtrbuffer@unset + \let\@gls@org@noindex\ifKV@glslink@noindex + \KV@glslink@noindextrue + \let\@glstable@org@target\glstarget + \let\glstarget\@secondoftwo + \let\@glstable@org@link\@glslink + \let\@glslink\@secondoftwo + \let\glstable@org@stepentry\glsstepentry + \let\glsstepentry\glstable@stepentry + \let\glstable@org@stepsubentry\glsstepsubentry + \let\glsstepsubentry\glstable@stepsubentry + \settowidth{\dimen@}{#2}% + \ifdim\dimen@>#1\relax + \setlength{#1}{\dimen@}% + \fi + \let\ifKV@glslink@noindex\@gls@org@noindex + \let\@glsunset\@glsxtr@unset + \let\glstarget\@glstable@org@target + \let\@glslink\@glstable@org@link + \let\glsstepentry\glstable@org@stepentry + \let\glsstepsubentry\glstable@org@stepsubentry + \let\glstableifmeasuring\@secondoftwo +} +\newcommand{\glstable@ifhaspreamble}[2]{% + \ifdefempty\glossarypreamble + {#2}% + {% + \ifx\@glstable@defaultpreamble\glossarypreamble + \ifcsvoid{@glossarypreamble@\currentglossary}{#2}{#1}% + \else + #1% + \fi + }% +} +\define@key{printglosstable}{type}{\renewcommand{\@glo@type}{#1}} +\define@key{printglosstable}{preamble}{\renewcommand{\glossarypreamble}{#1}} +\define@key{printglosstable}{postamble}{\renewcommand{\glossarypostamble}{#1}} +\newcommand\glstable@init{} +\define@key{printglosstable}{init}{\renewcommand{\glstable@init}{#1}} +\define@choicekey{printglosstable}{groups} +[\@glstable@groups@val\@glstable@groups@n] +{false,true}[true]% +{% + \ifnum\@glstable@groups@n=0\relax + \let\glstable@groupheading\@gobble + \glsxtr@printgloss@groupsfalse + \else + \let\glstable@groupheading\glstablegroupheading + \glsxtr@printgloss@groupstrue + \fi +} +\newcommand{\glstable@groupheading}[1]{} +\newcommand{\glstablegroupheading}[1]{% + \glstablefinishrow + \multicolumn{\glstabletotalcols}{c}{% + \glsxtrgetgrouptitle{#1}{\glsxtrcurrentgrptitle}% + \glstableGroupHeaderFmt\glsxtrcurrentgrptitle + }% + \\*% +} +\let\@glstable@defaultpreamble\glossarypreamble +\newcommand{\glstableGroupHeaderFmt}{\glstableHeaderFmt} +\newrobustcmd*{\printunsrttable}[1][]{% + \bgroup + \def\@glo@type{\glsdefaulttype}% + \def\glossarytitle{% + \ifcsdef{@glotype@\@glo@type @title}% + {\csuse{@glotype@\@glo@type @title}}% + {\glossaryname}% + }% + \def\glossarytoctitle{\glossarytitle}% + \let\glossarypreamble\@glstable@defaultpreamble + \setkeys*{printglosstable}{#1}% + \let\currentglossary\@glo@type + \protected@edef\glstable@opts{type=\@glo@type,style=table}% + \ifdefempty\XKV@rm{}{\epreto\glstable@opts{\expandonce\XKV@rm,}}% + \glstabletotalcols=\numexpr\glstablecolsperblock*\glstableblockperrowcount\relax + \glstableifpar + {% + \glstableblockwidth=\dimexpr\linewidth/\glstableblockperrowcount + -\glstablecolsperblock\tabcolsep\relax + \glstableinitlengthupdates + }% + \ifdefempty\glstable@blockalignsep{\def\glstable@finishrow{}}{}% + \def\glstable@alignment{}% + \ifKV@printglosstable@rules + \def\glstable@header{\toprule}% + \else + \def\glstable@header{}% + \fi + \global\glstablecurrentblockindex=0\relax + \loop + \ifnum\glstablecurrentblockindex>0\relax + \protected@eappto\glstable@alignment{\glstable@blockalignsep}% + \fi + \protected@eappto\glstable@alignment{\glstableblockalign}% + \ifKV@printglosstable@header + \ifnum\glstablecurrentblockindex>0\relax + \appto\glstable@header{&}% + \fi + \eappto\glstable@header{\expandonce\glstableblockheader}% + \fi + \advance\glstablecurrentblockindex by 1\relax + \ifnum\glstablecurrentblockindex<\glstableblockperrowcount + \repeat + \ifKV@printglosstable@header + \appto\glstable@header{\tabularnewline}% + \ifKV@printglosstable@rules + \appto\glstable@header{\midrule}% + \fi + \fi + \protected@edef\glstable@begin{% + \noexpand\begin{longtable}{\expandonce\glstable@alignment}% + \noexpand\glstablecaption + {\noexpand\glossarytoctitle}{\noexpand\glossarytitle}% + {\noexpand\@@glossaryseclabel}% + \noexpand\tabularnewline + }% + \glstable@ifhaspreamble + {% + \eappto\glstable@begin{\noexpand\glstablefirsthead + {\expandonce\glossarypreamble}% + \noexpand\tabularnewline + \expandonce\glstable@header + \noexpand\endfirsthead + \noexpand\glstablenextcaption + {\noexpand\glossarytoctitle}{\noexpand\glossarytitle}% + {\expandonce\glossarypreamble}% + }% + }% + {% + \eappto\glstable@begin{% + \expandonce\glstable@header + \noexpand\endfirsthead + \noexpand\glstablenextcaption + {\noexpand\glossarytoctitle}{\noexpand\glossarytitle}% + }% + }% + \eappto\glstable@begin{% + \noexpand\tabularnewline + \expandonce\glstable@header + \noexpand\endhead + }% + \ifdefvoid\glossarypostamble + {% + \ifKV@printglosstable@rules + \appto\glstable@begin{\bottomrule\endfoot}% + \fi + } + {% + \ifKV@printglosstable@rules + \eappto\glstable@begin{% + \noexpand\bottomrule + \noexpand\glstablefoot{\expandonce\glossarypostamble}% + \noexpand\tabularnewline + \noexpand\endfoot + \noexpand\bottomrule + \noexpand\glstablelastfoot{\expandonce\glossarypostamble}% + \noexpand\tabularnewline + \noexpand\endlastfoot + }% + \else + \eappto\glstable@begin{% + \noexpand\glstablefoot{\expandonce\glossarypostamble}% + \noexpand\tabularnewline + \noexpand\endfoot + \noexpand\glstablelastfoot{\expandonce\glossarypostamble}% + \noexpand\tabularnewline + \noexpand\endlastfoot + }% + \fi + }% + \glstable@init + \let\printunsrtglossaryentryprocesshook\glstable@filter + \let\glossarypostamble\relax + \let\glossarypreamble\relax + \renewcommand{\glossarysection}[2][]{}% + \glsxtrifemptyglossary{\currentglossary} + {% + \GlossariesExtraWarning{Glossary `\currentglossary' is empty}% + \edef\@glsxtr@tmp{\noexpand\setkeys{printgloss}{\expandonce\glstable@opts}}% + \@glsxtr@tmp + \glstableifpar{\glstablefinishlengthupdates}% + \global\glstablecurrentblockindex=0\relax + \glstable@begin + \glstablefinishrow + \end{longtable}% + }% + {% + \expandafter\printunsrtglossary\expandafter[\glstable@opts]\relax + }% + \egroup +} +\newcommand{\glstable@child}[1]{% + \ifdefempty\glstable@dochildren{}% + {\appto\glstable@dochildren{\glstableblocksubentrysep}}% + \appto\glstable@dochildren{\glstableblocksubentry{#1}}% +} +\newcommand{\glstableChildEntries}[1]{% + \def\glstable@dochildren{}% + \GlsXtrIfHasNonZeroChildCount*{#1}% + {% + \glsxtrfieldforlistloop{#1}{childlist}{\glstable@child}% + \preto\glstable@dochildren{% + \glstablePreChildren + \begin{glstablesubentries}% + }% + \appto\glstable@dochildren{\end{glstablesubentries}}% + }% + {}% + \glstable@dochildren +} +\newcommand{\glstable@n@amps}[1]{% + \ifnum#1>0\relax + \count@=0\relax + \loop + \advance\count@ by 1\relax + \appto\glstable@endblock{&}% + \ifnum\count@<#1 + \repeat + \fi +} +\newcommand{\glstablefinishrow}{% + \glstable@finishrow + \tabularnewline +} +\newcommand{\glstable@finishrow}{% + \def\glstable@endblock{}% + \@glstable@finishrow + \glstable@endblock +} +\newcommand{\@glstable@finishrow}{% + \ifnum\glstablecurrentblockindex>0 + \ifnum\glstablecurrentblockindex<\glstableblockperrowcount + \expandafter\glstable@n@amps\expandafter{% + \numexpr + (\glstableblockperrowcount-\glstablecurrentblockindex) + * (\glstablecolsperblock -1) + }% + \fi + \global\glstablecurrentblockindex=0 + \fi +} +\newglossarystyle{table}% +{% + \renewenvironment{theglossary}% + {% + \glstableifpar{\glstablefinishlengthupdates}% + \global\glstablecurrentblockindex=0\relax + \glstable@begin + } + {% + \glstablefinishrow + \end{longtable}% + }% + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{\glstable@groupheading{##1}}% + \renewcommand*{\glssubgroupheading}[4]{}% + \renewcommand*{\glsgroupskip}{}% + \renewcommand{\glossentry}[2]{% + \global\advance\glstablecurrentblockindex by 1\relax + \ifnum\glstableblockperrowcount=\glstablecurrentblockindex + \gdef\glstable@endblock{% + \global\glstablecurrentblockindex=0\relax + \tabularnewline + }% + \else + \gdef\glstable@endblock{&}% + \fi + \glstableblockentry{##1}% + \glstableChildEntries{##1}% + \glstable@endblock + }% + \renewcommand{\subglossentry}[3]{}% +} +\endinput +%% +%% End of file `glossary-table.sty'. |