Discussion:
theglossary undefined when using glossaries
(too old to reply)
EBo
2011-02-01 08:32:58 UTC
Permalink
I'm working on typesetting my thesis and was hoping to continue using
the glossaries package. Unfortunately the latest version of
glossaries (2010/07/10) finds the elements in my glossary, but when I
go to print it out (using \printglossaries) a "Environment description
undefined." for theglossary.

Interestingly, if I just carrage return through the error messages it
prints most of the entry information where I would expect.

Any suggestions? I've spent a couple of days on trying to figure this
out to no avail.

Thanks and best regards,

EBo --
Nicola Talbot
2011-02-01 08:40:46 UTC
Permalink
Post by EBo
I'm working on typesetting my thesis and was hoping to continue using
the glossaries package. Unfortunately the latest version of
glossaries (2010/07/10) finds the elements in my glossary, but when I
go to print it out (using \printglossaries) a "Environment description
undefined." for theglossary.
Can you provide a minimal example? The error message suggests it's the
description environment that's not defined (rather than theglossary).
The 'list' style glossaries use the description environment, so I assume
you're using one of those styles. What class file are you using?

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-01 08:58:19 UTC
Permalink
Post by Nicola Talbot
Can you provide a minimal example?
After posting the query I started stripping things down for a minimal
working example. I'm not quite there yet. It appears to be some
weird interaction with the thesis style (uconnthesis). Is it OK to
mail it in a tarball to you once stripped down more?
Post by Nicola Talbot
The error message suggests it's the
description environment that's not defined (rather than theglossary).
The full error message is below. I only get this error when I
\printglossaries. Error to follow:

[2] [3] (./thesis.gls

! LaTeX Error: Environment description undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.2 \begin{theglossary}
\glossaryheader
Post by Nicola Talbot
The 'list' style glossaries use the description environment, so I assume
you're using one of those styles. What class file are you using?
It is uconnthesis available from the University of Connecticut's Math
department.

thanks and best regards,

EBo --
Nicola Talbot
2011-02-01 10:34:23 UTC
Permalink
Post by EBo
Post by Nicola Talbot
Can you provide a minimal example?
After posting the query I started stripping things down for a minimal
working example. I'm not quite there yet. It appears to be some
weird interaction with the thesis style (uconnthesis). Is it OK to
mail it in a tarball to you once stripped down more?
A minimal example shouldn't require a tarball. Try the following:

\documentclass{uconnthesis}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{sample}{name=sample,description=an example}

\begin{document}
\gls{sample}

\printglossaries
\end{document}
Post by EBo
Post by Nicola Talbot
The error message suggests it's the
description environment that's not defined (rather than theglossary).
The full error message is below. I only get this error when I
[2] [3] (./thesis.gls
! LaTeX Error: Environment description undefined.
^^^^^^^^^^^

This suggests that the class file you are using doesn't define the
description environment. Try the following:

\documentclass{uconnthesis}

\begin{document}
\begin{description}
\item[Sample] An example.
\end{description}
\end{document}

You could try using a different glossary style that doesn't use the
description environment, such as one of the "index" or "long" styles.

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-01 10:59:18 UTC
Permalink
Post by Nicola Talbot
\documentclass{uconnthesis}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{sample}{name=sample,description=an example}
\begin{document}
\gls{sample}
\printglossaries
\end{document}
The tarball would have included the two files that need uconnthesis,
but this is along the lines of the example I tore it down to.
Post by Nicola Talbot
Post by Nicola Talbot
The error message suggests it's the
description environment that's not defined (rather than theglossary).
The full error message is below.  I only get this error when I
[2] [3] (./thesis.gls
! LaTeX Error: Environment description undefined.
                              ^^^^^^^^^^^
This suggests that the class file you are using doesn't define the
I was working on this while you posted this response. It took me
awhile to get that detail
Post by Nicola Talbot
You could try using a different glossary style that doesn't use the
description environment, such as one of the "index" or "long" styles.
OK. I will look into these.

Thanks and best regards,

EBo --
EBo
2011-02-01 10:54:42 UTC
Permalink
Post by Nicola Talbot
Can you provide a minimal example? The error message suggests it's the
description environment that's not defined (rather than theglossary).
It took me awhile to wrap my head around this but I now see that
uconnthesis does not implement \newenvironment{description}.

I've poked around a little and have only found that
\newenvironment{description}. is only defined by revtex4.cls and
memoir.cls. Is there some way to include it from one of these or do I
have to hack it out and figure out how to deal with all the counters
and indecies? Note I banged my head on this a little hoping it would
be trivial to pull it out, but to no avail

I'll poke at it more later after the lightning storm passes...

Thanks and best regards,

EBo --
Lars Madsen
2011-02-01 10:57:44 UTC
Permalink
Post by EBo
Post by Nicola Talbot
Can you provide a minimal example? The error message suggests it's the
description environment that's not defined (rather than theglossary).
It took me awhile to wrap my head around this but I now see that
uconnthesis does not implement \newenvironment{description}.
I've poked around a little and have only found that
\newenvironment{description}. is only defined by revtex4.cls and
memoir.cls. Is there some way to include it from one of these or do I
have to hack it out and figure out how to deal with all the counters
and indecies? Note I banged my head on this a little hoping it would
be trivial to pull it out, but to no avail
I'll poke at it more later after the lightning storm passes...
Thanks and best regards,
EBo --
huh? most classes define description

here is the definition from the article class

\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries #1}
--
/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
EBo
2011-02-03 05:31:28 UTC
Permalink
Post by Lars Madsen
huh? most classes define description
here is the definition from the article class...
Lars,

The document class is a custom one developed by the Math department to
format thesis, so it doesn't come in the box. I found the definitions
of description in a number of places and tried adding it top the
thesis class. At the moment that is breaking LaTeX with the following
error.

...
Runaway argument?
{\hspace \labelsep \par \par \par \par \par \par \newenvironment {des
\ETC.
! File ended while scanning use of \@argdef.

I have just sat down to work on this again.
Post by Lars Madsen
You could try using a different glossary style that doesn't use the
description environment, such as one of the "index" or "long" styles.
Thank you for the suggestion. I'll try poking at adding descriptions
to the thesis style so I can use all the tools I am accustomed to, but
if that does not get working I'll switch glossary styles or try
hacking it in the Makefile to build glossary file separately and
include it in later.

Thanks and best regards,

EBo --

ps: Nicola, sorry for being so slow before, I'm a bit under the
weather both literally and figuratively.
EBo
2011-02-03 05:59:13 UTC
Permalink
Post by EBo
...
Runaway argument?
{\hspace \labelsep \par \par \par \par \par \par \newenvironment {des
\ETC.
Ugg... this was a simple missing "}"

Following Nicola's advice I got it to partially work with using
"\usepackage[xindy,style=long,toc]{glossaries}", but the glossary
starts printing about 3/4 of the way across the page and the the page
width appears to have been defined to be about 0.5" so any word more
than 4 characters are hyphenated, and the glossary title will not
print no matter what I do... Strange.

Any suggestions on where to go from there?
Nicola Talbot
2011-02-03 08:20:19 UTC
Permalink
Post by EBo
Following Nicola's advice I got it to partially work with using
"\usepackage[xindy,style=long,toc]{glossaries}", but the glossary
starts printing about 3/4 of the way across the page and the the page
width appears to have been defined to be about 0.5" so any word more
than 4 characters are hyphenated, and the glossary title will not
print no matter what I do... Strange.
Any suggestions on where to go from there?
The "long" style uses the longtable environment, which usually needs to
be latexed twice to get the layout correct. If it turns out that
longtable and your class file (or other packages you're using) are
incompatible, try the "super" style instead which uses supertabular.

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-03 12:00:50 UTC
Permalink
Post by Nicola Talbot
The "long" style uses the longtable environment, which usually needs to
be latexed twice to get the layout correct. If it turns out that
longtable and your class file (or other packages you're using) are
incompatible, try the "super" style instead which uses supertabular.
OK. I am much further along. The problem with the spacing is that
for some reason the variables \glsdescwidth and \glspagelistwidth were
either not set or set to something really weird. When I set them
again just before calling \printglossaries they appear to work as
expected, but I do not think they are handling boldfacing properly:

\setlength{\glsdescwidth}{0.6\hsize}
\setlength{\glspagelistwidth}{0.1\hsize}

When I do run \pritglossaries it now starts a starts a new page and
gives me a "Capter *" at the top. I see now that it an interaction
with how uconnthesis defines chapters, etc., and printglossary
defining \@@glossarysec in terms of chapters.

Is there some way to tell glossaries *not* to clearpage or print a
title without having to hack the style?

Thanks and best regards,

EBo --
Nicola Talbot
2011-02-03 14:07:05 UTC
Permalink
Post by EBo
Post by Nicola Talbot
The "long" style uses the longtable environment, which usually needs to
be latexed twice to get the layout correct. If it turns out that
longtable and your class file (or other packages you're using) are
incompatible, try the "super" style instead which uses supertabular.
OK. I am much further along. The problem with the spacing is that
for some reason the variables \glsdescwidth and \glspagelistwidth were
either not set or set to something really weird. When I set them
again just before calling \printglossaries they appear to work as
\setlength{\glsdescwidth}{0.6\hsize}
\setlength{\glspagelistwidth}{0.1\hsize}
When I do run \pritglossaries it now starts a starts a new page and
gives me a "Capter *" at the top. I see now that it an interaction
with how uconnthesis defines chapters, etc., and printglossary
Is there some way to tell glossaries *not* to clearpage or print a
title without having to hack the style?
You can redefine \glossarysection[toc title]{title}

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-03 16:20:53 UTC
Permalink
Post by Nicola Talbot
You can redefine \glossarysection[toc title]{title}
Thank you! With the addition of the redefinition of \glossarysection
it works.

Hopefully this will be my last question. Is there some way to insert
some space between the acronym and it's definition without hacking the
\glossaryentryfield also? At the moment it prints like this:

LIDARLight Detecting And Ranging...

and it should be something like:

LIDAR Light Detecting And Ranging...

I hacked it by simply adding a few ~'s between "{#2} & #3"

Thanks and best regards,

EBo --
Nicola Talbot
2011-02-03 18:55:23 UTC
Permalink
Post by EBo
Post by Nicola Talbot
You can redefine \glossarysection[toc title]{title}
Thank you! With the addition of the redefinition of \glossarysection
it works.
Hopefully this will be my last question. Is there some way to insert
some space between the acronym and it's definition without hacking the
LIDARLight Detecting And Ranging...
LIDAR Light Detecting And Ranging...
I hacked it by simply adding a few ~'s between "{#2}& #3"
Sounds like \tabcolsep has been set to 0pt. Try changing its value just
before you print the glossaries. e.g. \setlength{\tabcolsep}{6pt}

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-03 19:41:27 UTC
Permalink
Post by Nicola Talbot
Sounds like \tabcolsep has been set to 0pt. Try changing its value just
before you print the glossaries. e.g. \setlength{\tabcolsep}{6pt}
WOOHOOO, and we HAVE a winner! Thanks!!!

I poked around and cannot figure out how this is getting messed up, or
why I have to set the length on \glsdescwidth and \glspagelistwidth
also. If you have any insights let me know, otherwise I think I can
limp along.

Nicola, thanks again for all the help. I literally spend DAYS trying
to figure this one out.

EBo --
Nicola Talbot
2011-02-03 22:01:59 UTC
Permalink
Post by EBo
Post by Nicola Talbot
Sounds like \tabcolsep has been set to 0pt. Try changing its value just
before you print the glossaries. e.g. \setlength{\tabcolsep}{6pt}
WOOHOOO, and we HAVE a winner! Thanks!!!
I poked around and cannot figure out how this is getting messed up, or
why I have to set the length on \glsdescwidth and \glspagelistwidth
also. If you have any insights let me know, otherwise I think I can
limp along.
They should be set as follows:

\setlength{\glsdescwidth}{0.6\hsize}
\setlength{\glspagelistwidth}{0.1\hsize}

For some classes (e.g. minimal) the value of \hsize doesn't get set
until \begin{document}. Most classes (that I know of) set it when
they're loaded. If \hsize is 0pt, then \glsdescwidth and
\glspagelistwidth will be 0pt. You can test it using \showthe\hsize
which will interrupt the latex run and display the length. For example:

\documentclass{minimal}

\showthe\hsize
\begin{document}
\end{document}

will produce
Post by EBo
0.0pt.
l.3 \showthe\hsize

However, if you change the class to article, you get
Post by EBo
345.0pt.
l.3 \showthe\hsize

With regard to \tabcolsep, it may be that your class file defines the
length, but doesn't set it.
Post by EBo
Nicola, thanks again for all the help. I literally spend DAYS trying
to figure this one out.
Glad it's working now.

Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
EBo
2011-02-04 21:06:09 UTC
Permalink
Post by Nicola Talbot
For some classes (e.g. minimal) the value of \hsize doesn't get set
until \begin{document}. Most classes (that I know of) set it when
they're loaded. If \hsize is 0pt, then \glsdescwidth and
\glspagelistwidth will be 0pt. You can test it using \showthe\hsize
\documentclass{minimal}
\showthe\hsize
\begin{document}
\end{document}
will produce
 > 0.0pt.
l.3 \showthe\hsize
However, if you change the class to article, you get
 > 345.0pt.
l.3 \showthe\hsize
Yep. This was root of the problem. As soon as I set:

\hsize=\textwidth

everything worked correctly. Is this the best way to define the
default width?

Then as an experiment I copied and pasted the description environment
from the memoir class and the default glossaries ***just worked***

YipyKerPoodleAtious and HOW!
Post by Nicola Talbot
With regard to \tabcolsep, it may be that your class file defines the
length, but doesn't set it.
This too was no longer necessary once hsize was properly set.
Post by Nicola Talbot
Glad it's working now.
Thanks again. If I ever run into you some place I owe you a draft of
your favorite beverage...

EBo --

Loading...