4

Could you tell me how to get the grouping? The center bold words, meaning, Number of Arrays, sets etc:

enter image description here

mwe:

\documentclass{report}

\usepackage[colorlinks]{hyperref} \usepackage[symbols,nogroupskip,sort=none]{glossaries-extra}

\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}} \glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}} \glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}} \glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}} \glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}

\begin{document} \tableofcontents \printunsrtglossary[type=symbols,style=long]

\chapter{Sample} Reference symbols: $\gls{x}$, $\gls{v}$, $\gls{a}$, $\gls{t}$, $\gls{F}$.

\end{document}

NaveganTeX
  • 2,630

1 Answers1

3

The following should get you started:

enter image description here

\documentclass{report}

\usepackage[colorlinks]{hyperref} \usepackage[record,style=alttreegroup,nomain,symbols]{glossaries-extra}

\glsxtrnewsymbol[description={position}, group={first}]{x}{\ensuremath{x}} \glsxtrnewsymbol[description={velocity}, group={first}]{v}{\ensuremath{v}} \glsxtrnewsymbol[description={acceleration}, group={second}]{a}{\ensuremath{a}} \glsxtrnewsymbol[description={time}, group={second}]{t}{\ensuremath{t}} \glsxtrnewsymbol[description={force}, group={second}]{F}{\ensuremath{F}}

\renewcommand\glstreegroupheaderfmt[1]{\begingroup\centering \textbf{#1}\par\endgroup} \glsfindwidesttoplevelname \glsxtrsetgrouptitle{first}{Numbers and Arrays} \glsxtrsetgrouptitle{second}{Sets} \begin{document} \tableofcontents

\printunsrtglossaries

\chapter{Sample} Reference symbols: $\gls{x}$, $\gls{v}$, $\gls{a}$, $\gls{t}$, $\gls{F}$.

\end{document}

leandriis
  • 62,593
  • It compiles with no errors but the group title does not appear. I have this \usepackage[symbols,nogroupskip,sort=none]{glossaries-extra} – NaveganTeX Nov 14 '20 at 10:34
  • @NaveganTeX: In my answer, I also changed the style and added style=alttreegroup to the options of the glossaries-extra package. If you use this style (or the exact same example code as in my answer), you should get the grouping. – leandriis Nov 14 '20 at 11:28
  • My bad. I forgot to put group={first}...! – NaveganTeX Nov 15 '20 at 10:28
  • This is what I was looking for, but I'm wondering if it would be possible to get the symbols within a group automatically sorted in alphabetical order. – Ninoett Aug 15 '22 at 06:59