I want to add grouping headers to the super
glossary style of the latex package glossaries
, i.e. something analogous to the listgroup
style but with the formatting of super
. The problem with listgroup
is that it adds too much vertical spacing and the descriptions are not aligned. I've also tried alttreegroup
but again I'm not entirely happy with the vertical spacing and I don't like the fact that I have to manually change the horizontal spacing with glssetwidest
. I'm aware of the post Customising glossary group titles, but unfortunately the newglossarystyle
defined there is not quite what I'm looking for. So, how can I get a "supergroup
" glossary style? Here is a MWE to work with:
\documentclass{report}
\usepackage{setspace}
\usepackage[nopostdot,nonumberlist,acronyms,section]{glossaries}
\setglossarystyle{super}
%\setglossarystyle{listgroup}
%\setglossarystyle{alttreegroup}
%\glssetwidest{00000}
\newglossary[slg]{symbol}{sot}{stn}{Symbols}
\makeglossaries
\newglossaryentry{area}{
type=symbol,
name={\ensuremath{S}},
description={reference area},
sort={aS}
}
\newglossaryentry{span}{
type=symbol,
name={\ensuremath{b}},
description={wing span},
sort={ab}
}
\newglossaryentry{dynp}{
type=symbol,
name={\ensuremath{q_\infty}},
description={dynamic pressure},
sort={aq}
}
\newglossaryentry{aoa}{
type=symbol,
name={\ensuremath{\alpha}},
description={angle of attack},
sort={ga}
}
\newacronym
[sort={a}]
{bcr}{BCR}{Block Compressed Row}
\newacronym
[sort={a}]
{cad}{CAD}{Computer-Aided Design}
\newcommand*{\Agroupname}{Alphanumeric}
\newcommand*{\Ggroupname}{Greek letters}
\begin{document}
\onehalfspacing
\section*{List of Symbols and Acronyms}
\glsaddall
\printglossary[type=symbol]
\renewcommand*{\glsgroupheading}[1]{}%
\printglossary[type=acronym]
\end{document}
By the way, is there a better way to rename groups than redefining \Agroupname
and \Ggroupname}
?
Best Answer
I think for this sort of thing, you might be better off using sub-entries, like this:
This produces:
Edit:
The justification of the parent entry can be changed by modifying the column alignment in the
\multicolumn
command. For example, replacewith
The vertical spacing above and below the parent entry is a bit more problematic. This spacing is introduced by the first and last
\tabularnewline
in the definition of\glossentry
:Unfortunately, you can't simply remove the first
\tabularnewline
or you'll get a! Misplaced \omit
error. Something is being inserted at the start of the row that interferes with\multicolumn
. The simplest solution that I can think of is to insert an extra unused column like this:The symbol list now looks like: