Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Some of my glossarie entries have a rather long description. After a certain number of carracters they stop being displayed by the printglossaries command. Here is an exemple producing this problem :

\documentclass{article}
\usepackage[shortcuts]{glossaries}

\makeglossaries

\newglossaryentry{short}{name={short},
description={a short entry}}

\newglossaryentry{long}{name={long},
description={
a long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry
}}

\begin{document}
This one works : \gls{short}.
This one does not : \gls{long}

\printglossaries

\end{document}

How can I sidestep this issue?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

In the glossary log file you will see

!! Input index error (file = gl55.glo, line = 2):
   -- First argument too long (max 1024).

Fortunately TeX is a macro processor so it is easy to have short texts standing in for long ones:

enter image description here

\newglossaryentry{long}{name={long},
description={\longdesc}}

\def\longdesc{a long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry}
share|improve this answer

I would like to present more automatic solution to this problem:

\documentclass{article}
\usepackage[shortcuts]{glossaries}
\usepackage{etoolbox}
\makeatletter 
%define new glossary entry key, description with no size limit
\define@key{glossentry}{description}{\def\@glo@ldesc{#1}}

%overwrite standard description key with new long description
%it also makes description key not mandatory when long description is defined
\renewcommand{\@newglossaryentryprehook}{
\def\@glo@ldesc{}
\def\@glo@desc{\@glo@ldesc}
}
\renewcommand{\@newglossaryentryposthook}{
%save the content of new ldesc variable and prevent it from expanding. Its important if we want to use fancy latex commands description
\protected@csxdef{glo@\@glo@label @ldesc}{\expandonce{\@glo@ldesc}}
%overide description field for this glossary entry. By using csexpandonce and csuse we prevent expansion and take into account that \@glo@label may have white spacess in it.
\protected@csxdef{glo@\@glo@label @desc}{\csexpandonce{csuse{glo@\@glo@label @ldesc}}}
%because \@newglossaryentryprehook is invoked after \do@glo@storeentry in glossaries.sty we need to save it all again ;(
\do@glo@storeentry{\@glo@label}
}
\makeatother

\makeglossaries

\newglossaryentry{short}{name={short},
description={a short entry}}

\newglossaryentry{long}{name={long},
description={
a long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry a long entry a long entry a long entry a
long entry a long entry
}}

\begin{document}
This one works : \gls{short}.
This one does not : \gls{long}

\printglossaries

\end{document}
share|improve this answer
    
Welcome to TeX.sx! –  Andrew Swann May 7 '13 at 13:05
    
Thanks, hope my approach will be useful to somebody :) –  groundnuty May 7 '13 at 13:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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