# Customising glossary group titles

I'm using the glossaries package to produce multiple glossaries in the same document and have found it convenient to define my own glossary style.

When makeindex is used the glossary is sub-divided into a maximum of 28 logical blocks that are determined by the first character of the sort key set with \newglossaryentry. The sub-divisions are: ASCII, numbers, and A,...,Z. I need to have three separate glossary groups, and for that I prepend the sort key of glossary entries with the following letters:

• a for a group of numbers and letters
• g for a group of Greek letters
• s for a group of subscripts

Here's a MWE (just run (pdf)latex twice on it with --shell-escape):

\documentclass{article}
\usepackage[nomain,makeindex]{glossaries}

%% new glossary style
\newglossarystyle{onecol}{%
%
\renewenvironment{theglossary}%
{\begin{description}}{\end{description}}%
%
%
% indicate what to do at the start of each logical group
\item[{\glsgetgrouptitle{##1}}]}
%
\renewcommand*{\glsgroupskip}{\indexspace}%
%
\renewcommand*{\glossaryentryfield}[5]{%
\item[\glstarget{##1}{##2}] ##3%
}%
}

%% glossary
\newglossary{model}{model.sys}{model.syo}{Nomenclature}

%% glossary entries
\newglossaryentry{L}{sort={aL},name={\ensuremath{\mathcal{L}}},type={model},
description={lift function}}
\newglossaryentry{CL}{sort={aCL},name={\ensuremath{C_L}},type={model},
description={lift coefficient}}
%
\newglossaryentry{alpha}{sort={galpha},name={\ensuremath{\alpha}},type={model},
description={angle of attack}}
\newglossaryentry{beta}{sort={gbeta},name={\ensuremath{\beta}},type={model},
description={sideslip angle}}
%
\newglossaryentry{fs}{sort={sfs},name={\ensuremath{\infty}},type={model},
description={free-stream condition}}

\immediate\write18{makeglossaries \jobname}
\makeglossaries

\begin{document}
\printglossary[type={model},style={onecol}]
\end{document}


The way theglossary environment is redefined above is somewhat redundant, but I only wish to provide a working example for now.

## Question

Is it possible to remove the title of the first group, and change the titles of the second and third groups to Greek letters, and Subscripts, respectively?

If yes, do I need to call xindy using my own style file or does a change in the way I define the glossary style onecol suffice?

-
 I suspect the solution could be in \glsgetgrouptitle and/or \...groupname, but so far I've failed to find a workround. – nnunes Feb 20 at 20:39

You are on the right track, but we can use the existing \glsgetgrouptitle. Note, however, that with this solution all your glossary entries should have an a, g, or s prefix in the sort key. Put

\newcommand*{\Agroupname}{}
\newcommand*{\Ggroupname}{Greek letters}
\newcommand*{\Sgroupname}{Subscripts}


If desired, you may also redefine \glsgroupheading inside the \newglossarystyle declaration as follows (requires the etoolbox package):

\renewcommand*{\glsgroupheading}[1]{%
\ifstrequal{A}{##1}{\relax}%
{\item[{\glsgetgrouptitle{##1}}]}%
}
%
\newcommand*{\Ggroupname}{Greek letters}
\newcommand*{\Sgroupname}{Subscripts}


This way \glsgroupheading does nothing at the start of the first glossary group:

-
 I had tried to define the commands \ggroupname, and \sgroupname, but that didn't work. So in my ignorance I assumed \Ggroupname and \Sgroupname wouldn't work either. Can I please buy you a beer? :-) – nnunes Feb 21 at 3:13 @NunoNunes I read the source of glossary.sty. And YES! ;-) – mafp Feb 21 at 8:38