list environment on glossary definition doesn’t work

by fauve   Last Updated July 11, 2019 21:23 PM

I try to put an inparaenum environment on a glossary definition like this :

\newglossaryentry{polymo}%
{%
  name={Lorem},
    description={Lorem ipsum dolor
    \begin{inparaenum}[i)]
      \item sit amet
      \item et adiqui
    \end{inparaenum}
},
plural={polymorphisms}
}

But it give me this output:

this
(source: toile-libre.org)

So, this is my AWE:

\documentclass[a4paper,12pt,oneside,french]{article}
\usepackage{xltxtra}
\usepackage{ucs}
\usepackage{fontenc}
\usepackage[frenchb,french,francais]{babel}
\usepackage[nonumberlist,nopostdot,toc]{glossaries}
\makeglossaries

\longnewglossaryentry{lorem}%
{%
  name={Lorem}
}%
{%
consectetur adipiscing elit. Sed non risus. Suspendisse%
    \begin{itemize}%
      \item lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum u
      \item Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius.
    \end{itemize}%
}

\author{Me}
\title{Lorem ipsum dolor}
\date{This day}

\begin{document}
  \maketitle

  Ut velit mauris, egestas sed, gravida nec, ornare ut, mi.
  \begin{itemize}
    \item Aenean ut orci vel massa suscipit pulvinar.
    \item Nulla sollicitudin.
    \item Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh
  \end{itemize}


  \glsaddall
  \glossarystyle{index}
  \printglossary[title=Glossaire,toctitle=Glossaire]

\end{document}

I compile it with xelatex main.tex; makeglossaries main ; xelatex main.tex and I get the following result:

IMG

As you see, I you itemize environment out of glossary definition and it work correctly.

There is a way to force a correct output of inparaenum in glossary?

Edit: I find it isn’t only the case with inparaenum but the glossary definition general not work with list environment.



Answers 1


You didn't mention getting an error message, but for completeness after the glossary is created there's an error:

! LaTeX Error: Something's wrong--perhaps a missing \item.

The problem is that the index style isn't compatible with entries that contain list-based environments. The index style is analogous to the style typically used to display an index (via commands such as makeidx's \printindex) which does \let\item\@idxitem at the beginning of the scope. You need to switch to a style that's compatible with list-based environments. For example, changing the style from index to list produces:

Image of resulting list glossary

or using the tree style produces:

Image of resulting tree glossary

Nicola Talbot
Nicola Talbot
September 03, 2014 18:39 PM

Related Questions


Updated June 28, 2017 20:23 PM

Updated February 12, 2018 12:23 PM

Updated September 16, 2019 12:23 PM

Updated August 09, 2015 18:10 PM

Updated October 02, 2018 19:23 PM