\documentclass{article} \usepackage{imakeidx} \usepackage{enumitem} \usepackage[automake]{glossaries} \makeindex \makeatletter \def\ifentry#1#2#3{% \edef\tmp{#1}% \ifx\tmp\@empty% #3% \else% #2% \fi% } \makeatother \newglossarystyle{descriptiontest}{% \setglossarystyle{indexgroup} \renewcommand{\glossentry}[2]{ \item \textbf{{\glossentryname{##1}}} \edef\tmp{\glsentrydesc{##1}} \ifentry\tmp{Description: '\tmp'}{No description} } } \newglossaryentry{ham}{name={ham}, description={goes with eggs\index{ham}}} \newglossaryentry{eggs}{name={eggs}, description=} \makeglossaries \begin{document} \glsaddall \printglossary[style=descriptiontest] \end{document}
LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Combining glossaries and index?
Combining glossaries and index?
I am working on a document where glossary entries are referred to from the index. This works, until I add conditional text, indicating whether a description was added or not. It looks like TeX falls into an unbounded recursion, but I cannot seem to wrap my head around this. Without adding an index entry, this works. Any help is appreciated.
Sorted out by Nicola Talbot on usenet group comp.text.tex:
The glossaries package comes with conditional commands for testing if a
key has been set. \ifglshasdesc not only tests for an empty description
but also tests if the description has simply been set to \nopostdesc:
Return to “MakeIndex, Nomenclature, Glossaries and Acronyms”
Who is online
Users browsing this forum: No registered users and 3 guests