1

I am working on a book and I want to include a glossary at the end of it. I face a couple of issues:

  1. It seems that the glossary has a left margin (see the distance compared to the "Glossary" title). I show the frame on the MWE.
  2. I would like to indent each description compared to their name (but keep the fact the my whole book has no indentation as shown on MWE)
  3. I don't think that the way the page are displayed after the description is clear. Can I add something like "..." before the number ? or put a row of dots and the page number on the right?

Does anyone know how solve any of these points?

enter image description here

MWE:

\documentclass{book}
\usepackage[showframe]{geometry}

\usepackage[xindy,toc,acronym,nopostdot]{glossaries} %TOC = in table of content, xindy = indexation tool, needs to be BEFORE HYPERLINK
\setglossarystyle{altlist}
\renewcommand{\glsgroupskip}{}
\makeglossaries

\usepackage{enumitem}
\setlist[enumerate]{topsep=3pt,itemsep=1pt,partopsep=0ex,parsep=0ex}
\setlist[itemize]{topsep=3pt,itemsep=1pt,partopsep=0ex,parsep=0ex}
\setlist[description]{topsep=3pt,itemsep=2pt,partopsep=0ex,parsep=0ex,leftmargin=15pt,labelindent=15pt}
\parindent 0in
\parskip 0.05in
\setlength{\textfloatsep}{0.8\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}

\newglossaryentry{Alpha}
{ name=Alpha,
  description={Smoothing factor applied to the demand level in the various exponential smoothing models. In theory: \ensuremath{ 0 < \alpha \leq 1}, in practice: \ensuremath{0 < \alpha \leq 0.6}}}
\newglossaryentry{Beta}
{ name=Beta,
  description={Smoothing factor applied to the trend in the various exponential smoothing models. In theory: \ensuremath{ 0 < \beta \leq 1}, in practice: \ensuremath{0 < \beta \leq 0.6}}}
\newglossaryentry{Gamma}
{ name=Gamma,
  description={Smoothing factor applied to the seasonality (either additive or multiplicative) in the triple exponential smoothing models. In theory: \ensuremath{ 0 < \gamma \leq 1}, in  practice: \ensuremath{0.05 < \gamma \leq 0.3}}}
\newglossaryentry{Phi}
{ name=Phi,
  description={Damping factor applied to the trend in the exponential smoothing models. This reduces the trend after each period. In theory: \ensuremath{ 0 < \phi \leq 1}, in practice: \ensuremath{0.7 \leq \phi \leq 1}}}
\begin{document}
\glsaddall
\printglossary
\end{document}
2

You can redefine theglossary to pass a optional argument to desciption:

\renewenvironment{theglossary}{%
  \begin{description}[style=standard,labelindent=0pt]%
}{\end{description}}

The command \glspostdescription controls what iis inserted between the description and the pagenumber, to fill with dots use

\renewcommand\glspostdescription{\dotfill}

This results in

\documentclass{book}
\usepackage[showframe]{geometry}

\usepackage[xindy,toc,acronym,nopostdot]{glossaries} %TOC = in table of content, xindy = indexation tool, needs to be BEFORE HYPERLINK
\setglossarystyle{altlist}%
\renewenvironment{theglossary}{%
  \begin{description}[style=standard,labelindent=0pt]%
}{\end{description}}
\renewcommand\glspostdescription{\dotfill}
\makeglossaries

\usepackage{enumitem}
\setlist[enumerate]{topsep=3pt,itemsep=1pt,partopsep=0ex,parsep=0ex}
\setlist[itemize]{topsep=3pt,itemsep=1pt,partopsep=0ex,parsep=0ex}
\setlist[description]{topsep=3pt,itemsep=2pt,partopsep=0ex,parsep=0ex,leftmargin=15pt,labelindent=15pt}
\parindent 0in
\parskip 0.05in
\setlength{\textfloatsep}{0.8\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}

\newglossaryentry{Alpha}
{ name=Alpha,
  description={Smoothing factor applied to the demand level in the various exponential smoothing models. In theory: \ensuremath{ 0 < \alpha \leq 1}, in practice: \ensuremath{0 < \alpha \leq 0.6}}}
\newglossaryentry{Beta}
{ name=Beta,
  description={Smoothing factor applied to the trend in the various exponential smoothing models. In theory: \ensuremath{ 0 < \beta \leq 1}, in practice: \ensuremath{0 < \beta \leq 0.6}}}
\newglossaryentry{Gamma}
{ name=Gamma,
  description={Smoothing factor applied to the seasonality (either additive or multiplicative) in the triple exponential smoothing models. In theory: \ensuremath{ 0 < \gamma \leq 1}, in  practice: \ensuremath{0.05 < \gamma \leq 0.3}}}
\newglossaryentry{Phi}
{ name=Phi,
  description={Damping factor applied to the trend in the exponential smoothing models. This reduces the trend after each period. In theory: \ensuremath{ 0 < \phi \leq 1}, in practice: \ensuremath{0.7 \leq \phi \leq 1}}}
\begin{document}
\glsaddall
\printglossary
\end{document}

enter image description here

  • Awesome, thank you! By any chance would you know how to increase the spacing between two entries of the glossary? – Nicolas Aug 3 '18 at 11:43
  • @Nicolas In the \begin{description} line, the optional argument accepts all the values documented in the enumitem documentation. So you can add e.g. ,itemsep=2pt there after labelindent=0pt to set the distance to 2pt. – Marcel Krüger Aug 3 '18 at 11:51
  • Awesome, i have done this \renewcommand\glspostdescription{\dotfill \textit{see page}}. but i have an issue as the ... fill only works well if the last sentence has enough space to properly show the page number as well as "see page", otherwise it push a part of this to the next line but without the dots. Is there any solution to this? Like booking a certain amount of space? – Nicolas Aug 3 '18 at 12:53
  • @Nicolas See tex.stackexchange.com/questions/86944/… – Marcel Krüger Aug 3 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.