# Correct use of sub-entries with glossaries package

I am writing my thesis and I am including a glossary. I am trying to nest some definitions under a "parent" definition. For example, I first define a mass and then define categorical mass whose parent is mass.

I have two problems with the output. First, it glues the definition of categorical mass to that of mass without leaving a space (See the red circle in the image)... Second, there is no explicit mention of categorical mass in the definition.

How can I solve this two problems?

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[acronym,toc]{glossaries}
\makeglossaries

\newglossaryentry{mass}
{
name={mass function},
description={A basic belief assingnment (BBA)},
}
\newglossaryentry{categorical}
{
name={categorical mass function},
description={A mass function with only one focal set},
parent=mass
}

\begin{document}

\chapter{something}
we use a \gls{categorical} which is a special case of \gls{mass}

\printglossary[type=main]

\end{document}


-

The problem is that the default glossary style does not support sub-entries.

You could, for example, use the index style. This solves both your problems.

The manual explains:

index The index style is similar to the way indices are usually formatted in that it has a hierarchical structure up to three levels (the main level plus two sub-levels). The name is typeset in bold, and if the symbol is present it is set in parentheses after the name and before the description. Sub-entries are indented and also include the name, the symbol in brackets (if present) and the description. Groups are separated using \indexspace.

And here is the code. (I changed the documentclass to scrartcle so you can see all glossaries on one page.)

\documentclass[a4paper,12pt]{scrartcl}
\usepackage[acronym,toc]{glossaries}
\makeglossaries

\newglossaryentry{mass}
{
name={mass function},
description={A basic belief assingnment (BBA)},
}
\newglossaryentry{categorical}
{
name={categorical mass function},
description={A mass function with only one focal set},
parent=mass
}

\begin{document}

we use a \gls{categorical} which is a special case of \gls{mass}

\printglossary[type=main]

\glossarystyle{index}  % chose style here
\printglossary[type=main]

\end{document}


For more details consult the manual glossaries-user.pdf, which explains the options for glossary styles in detail in Chapter 15.

-
Thank you very much, it worked perfectly. However, that made me discover a glitch in the glossaries package... He doesn't like when I include a "=" sign in the Symbol field. I posted a question here where I explain the details and cry for help! Take a look if you have some time. Thanks again! –  Felipe Aguirre Aug 19 '12 at 12:56