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.

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

\printglossaries
\makeglossaries

the glossary is waaaaaay too wide:

ttp://i.stack.imgur.com/9Rgdw.png

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?

share|improve this question
1  
Please provide a full minimal example. –  Marco Daniel Aug 10 '11 at 10:36
2  
We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  lockstep Nov 10 '11 at 0:45
    
Sorry, my bad. Thanks for moving ;-) –  hrehfeld Jan 10 '12 at 12:48
add comment

2 Answers

up vote 1 down vote accepted

[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}:
\renewcommand*{\glossaryheader}{}%
% have nothing between glossary groups:
\renewcommand*{\glsgroupheading}[1]{}%
\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.

share|improve this answer
add comment

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.

share|improve this answer
    
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
add comment

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.