6

I'm using the glossaries package in a document and use the index style with it (because I need optional symbols to be displayed in the glossary).

The weird thing is that the last displayed item's hanging indentation gets lost.

Here's a minimal example with only two items. What do I miss?

\documentclass{article}

\usepackage{glossaries}

\makeglossary

\newglossaryentry{GLO1}{name={GLO1},text={Glossary Entry 1},description={Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. }}

\newglossaryentry{GLO2}{name={GLO2},text={Glossary Entry 2},description={Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text }}

\begin{document}

\gls{GLO1}
\gls{GLO2}

\printglossary[style=index]

\end{document}

enter image description here

I'm using a quite recently installed (stable) texlive 2013 and compile with pdflatex and makeglossaries.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Aug 22 '13 at 13:32
4

It is seems to be a bug in the definition of the index style. The style defines theglossary environment to end with no special commands, what is needed is a \par. You can fix this by renewing the index style in your document. Below I have just copied the definition from glossary-tree.sty where it resides, replaced \newglossary with \renewglossary and fixed the ending command.

Sample output

\documentclass{article}

\usepackage{glossaries}

\makeatletter
\renewglossarystyle{index}{%
  \renewenvironment{theglossary}%
    {\setlength{\parindent}{0pt}%
     \setlength{\parskip}{0pt plus 0.3pt}%
     \let\item\@idxitem}%
    {\par}%            %%%%%% Addition here
  \renewcommand*{\glossaryheader}{}%
  \renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
  \ifx\relax##4\relax
  \else
    \space(##4)%
  \fi
  \space ##3\glspostdescription \space ##5}%
  \renewcommand*{\glossarysubentryfield}[6]{%
    \ifcase##1\relax
      % level 0
      \item
    \or
      % level 1
      \subitem
      \glssubentryitem{##2}%
    \else
      % all other levels
      \subsubitem
    \fi
    \textbf{\glstarget{##2}{##3}}%
    \ifx\relax##5\relax
    \else
      \space(##5)%
    \fi
    \space##4\glspostdescription\space ##6}%
  \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}}
\makeatother

\makeglossary

\newglossaryentry{GLO1}{name={GLO1},text={Glossary Entry 1},description={Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. }}

\newglossaryentry{GLO2}{name={GLO2},text={Glossary Entry 2},description={Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text }}

\newglossaryentry{GLO3}{name={GLO3},text={Glossary Entry 3},description={Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text }}

\begin{document}

\gls{GLO1}
\gls{GLO2}
\gls{GLO3}

\printglossary[style=index]

\end{document}

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.