# glossaries: \printglossaries prints too wide

I'm using the glossaries package, and when I issue \printglossaries:

\printglossaries
\makeglossaries


the glossary is waaaaaay too wide:

My package options are

\usepackage[acronym,sort=def,
style=long,
nolist
]{glossaries}


Setting

\setlength{\textwidth}{4.65in}


right before the \printglossaries is promptly ignored, and I couldn't find any option in the glossaries documentation to influence the width.

When I use twoside as a scrreprt option, the effect is much more pronounced.

Any ideas why this might happen or how I would fix it?

-
Please provide a full minimal example. – Marco Daniel Aug 10 '11 at 10:36
Sorry, my bad. Thanks for moving ;-) – hrehfeld Jan 10 '12 at 12:48

[OPs answer moved from the question]

Just adjusting \glsdescwidth doesn't help, because you will have to readjust when your longest entry changes. So use a custom glossaries style instead:

\newlength{\glstargetwidth}%
\newlength{\glshspace}%

\newglossarystyle{mylong}{%
% put the glossary in the longtable environment:
\renewenvironment{theglossary}{%
\setlength{\glstargetwidth}{0.29\textwidth}%
\setlength{\glshspace}{0.02\textwidth}%
\setlength{\glsdescwidth}{0.69\textwidth}%
\setlength{\tabcolsep}{0pt}%
\setlength{\extrarowheight}{12pt}%
\begin{longtable}%
{p{\glstargetwidth} @{\hspace{\glshspace}}  p{\glsdescwidth}}}%
{\end{longtable}}%
% have nothing after \begin{theglossary}:
% have nothing between glossary groups:
\renewcommand*{\glsgroupskip}{}%
% set how each entry should appear:
\renewcommand*{\glossaryentryfield}[5]{%
\raggedright\strong{\glstarget{##1}{##2}}% the entry name
##4% the symbol
&##3,% the description
\space ##5% the number list
\\
}%
% set how sub-entries appear:
\renewcommand*{\glossarysubentryfield}[6]{%
\glossaryentryfield{##2}{##3}{##4}{##5}{##6}}%
}
\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}

\glossarystyle{mylong}


This will fix the width of your entry column, breaking the entry names when necesary.

-

From the glossaries user guide (texdoc glossaries-user.pdf), p82:

The tabular-like styles that allow multi-line descriptions and page lists use the length \glsdescwidth to set the width of the description column and the length \glspagelistwidth to set the width of the page list column. These will need to be changed using \setlength if the glossary is too wide.

-
Thanks a bunch! I was looking at that section specifically, but never saw that... PDF documentation for programming sucks. – hrehfeld Aug 11 '11 at 11:07