diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.tex | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.tex new file mode 100644 index 00000000000..d25dedab101 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-alttree-sym.tex @@ -0,0 +1,63 @@ +% arara: pdflatex +% arara: makeglossaries if found("aux", "@istfilename") +% arara: pdflatex +\documentclass{book} + +\usepackage[stylemods=tree,style=alttree,savenumberlist]{glossaries-extra} + +\makeglossaries + +\loadglsentries{example-glossaries-symbols} + +\newlength\maxsymbolwidth +\newlength\maxlocwidth +\newlength\fieldsep +\setlength{\fieldsep}{10pt} +\newlength\midfield +\newlength\rightfield + +\renewcommand*{\glsxtralttreeInit}{% +% for debugging purposes, draw a line to check against +% the available linewidth + \par\noindent\hrulefill\par +% setup lengths + \glsFindWidestAnyNameSymbolLocation[\currentglossary]% + {\maxsymbolwidth}{\maxlocwidth}% + \settowidth + {\glsxtrtreetopindent}% + {\glstreenamefmt{\glsgetwidestname}}% + \addtolength{\glsxtrtreetopindent}{\fieldsep}% + \ifdim\maxsymbolwidth>\maxlocwidth + \setlength{\rightfield}{\maxsymbolwidth}% + \else + \setlength{\rightfield}{\maxlocwidth}% + \fi + \addtolength{\rightfield}{\fieldsep}% + \setlength + {\midfield}% + {\dimexpr\linewidth-\glsxtrtreetopindent-\rightfield}% +} + +\renewcommand{\glsxtralttreeSymbolDescLocation}[2]{% + \parbox[t]{\midfield}{\raggedright + \glossentrydesc{#1}\glspostdescription\strut\par}% + \parbox[t]{\rightfield}{\raggedleft + \glossentrysymbol{#1}\par + \sffamily#2\strut\par + }% + \par +} + +\begin{document} + +\frontmatter +\setcounter{page}{37}% test wide page number +Test document. +\newpage +Indexing all entries here. +\glsaddall + +\mainmatter +\printglossaries + +\end{document} |