Glossaries – how to change the left indent of child entry names

glossariesindentation

I'm trying to build a hierarchical glossary with relatively long, multi-paragraph descriptions. I'd like the descriptions to start on the line following the name of both, the parent and child entries (altlist style).

I imagine it like this:

Index style with adjustment to look like altlist-style

In order to achieve multi-paragraph descriptions with indentation, I tried to do it with the indexhypergroup style and the needed adjustments for the multi-paragrpahs that I found in the Dickimaw Books – Gallery > glossary-tree > index.

However, the adjustments do not work for the indentation of the child entry names. (They appear way too far right from the left margin.) I guess the indentation of the child entry names needs an additional command, or am I using the wrong style?

Does anyone know how to do this? I'd be very grateful for any help.

MWE

\documentclass[ngerman,]{scrbook}
\usepackage[inner=2.5cm,outer=2.5cm,tmargin=3cm,bmargin=4cm]{geometry}
\usepackage{hyperref} 
\hypersetup{colorlinks,citecolor=cyan,linkcolor=black}
\usepackage[toc,acronym,xindy,nopostdot,style=indexhypergroup,title=Begriffserklärungen]{glossaries}

\longnewglossaryentry{Nervoussystem}{
name={Nervous system},
text={nervous system},
description={no description needed for parent entry}
}

\longnewglossaryentry{central}{
parent={Nervoussystem},
name={central (CNS)},
text={central nervous system (CNS)},
description={Multi-paragraph explanation of central nervous system, with small indentation between paragraphs. Multi-paragraph explanation of central nervous system.

Multi-paragraph explanation of central nervous system, with small indentation between paragraphs. Multi-paragraph explanation of central nervous system.}
}

\longnewglossaryentry{peripheral}{
parent={Nervoussystem},
name={peripheral (PNS)},
text={peripheral nervous system (PNS)},
description={Multi-paragraph explanation of peripheral nervous system, with small indentation between paragraphs. Multi-paragraph explanation of peripheral nervous system.

Multi-paragraph explanation of peripheral nervous system, with small indentation between paragraphs. Multi-paragraph explanation of peripheral nervous system.}
}

% to increase space btw glossary entry using index style: 
\renewcommand*{\glspostdescription}{\medskip}

% adjustments from Dickimaw Books:
\renewcommand{\glstreeitem}{%
    \parindent0pt\par\hangindent30pt
    \everypar{\parindent50pt\hangindent30pt}}
\renewcommand{\glstreepredesc}{\par
    \glstreeitem\parindent\hangindent}
\makeglossaries
\begin{document}
I'd like to define both \gls{Nervoussystem} parts, the \gls{central} and the \gls{peripheral} in the main glossary. 

\printglossary

\end{document}

Best Answer

Actually, this issue is very well documented in the glossaries user manual under 13.1.7 Tree-Like Styles (p.218).

So in order to change the indents of the 1st and 2nd child entries (subitem and subsubitem, respectively), the following commands were needed in the preamble:

\renewcommand{\glstreesubitem}{% for 1st child entry
    \parindent25pt% left margin to child name
    \par% newline
    \hangindent45pt% left margin to paragraph margin
    \everypar{\parindent55pt\hangindent45pt}}

\renewcommand{\glstreesubsubitem}{% for 2nd child entry
    \parindent50pt\par\hangindent70pt
    \everypar{\parindent60pt\hangindent70pt}} 

Related Question