# nomenclature hyphenation

I'm using \makenomenclature and \printnomenclature.. I have searched since yesterday for solution with nomenclature, but found nothing. Do anybody have a solution? I don't want do it with glossary, because the documentclasse is book and I have a lot of tex files. When I use glossary, I have to search every word in nomenclatur in many tex files.

I have a problem. My nomenclature shows like this for example

   AAAA      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBB      BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
number angelsperunitz The number of angels per unit are


This is the nomenclaturecode..

   \nomenclature{number angelsperunitz }{The number of angels per unit area}


I want it shows like this, because the acronym is too long and I want this in the next line. How can I do this? I use hyphenation without success.

    AAAA         AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBB         BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
number angelsp-
erunitz The number of angels per unit are


Here is the code..

\documentclass{book}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{nomencl}
\makenomenclature
\begin{document}

\nomenclature{AAAA}{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}%
\nomenclature{BBBB}{BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB}%
\nomenclature{number angelsperunitz}{The number of angels per unit are}%

\backmatter
\printnomenclature[2.8 cm]

\end{document}

• Can you add a minimal working example (MWE) to play with? – egreg Oct 24 '13 at 9:52
• @egreg I put the code. I do something different, like this \printnomenclature[4.2 cm]. This is not was I want but it looks better as before. – blue Oct 24 '13 at 10:21

Redefine \nomlabel to use a \parbox[b] and reset \nomlabelwidth:

\documentclass{book}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{nomencl}
\usepackage{ragged2e}

\renewcommand{\nomlabel}[1]{%
\parbox[b]{\nomlabelwidth}{\RaggedRight\hspace{0pt}#1}%
}
\setlength{\nomlabelwidth}{2.5cm}

\makenomenclature
\begin{document}

\nomenclature{AAAA}{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}%
\nomenclature{BBBB}{BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB}%
\nomenclature{number angelsperunitz}{The number of angels per unit are}%

Do something!

\backmatter
\printnomenclature

\end{document}


• Unfortunately I have math expressions like $f(a,b,c,d,...)$ which cannot be wrapped... – Robinaut Jul 29 '14 at 10:17
• @Robinaut TeX will never wrap formulas after a comma, which in case of $f(a,b,c,d)$ would make no sense. – egreg Jul 29 '14 at 10:19
• So what can I do if the symbol cannot be line-wrapped in parbox{}? – Robinaut Jul 29 '14 at 10:24
• @Robinaut Use a width sufficient to contain the symbols. – egreg Jul 29 '14 at 10:27

I had a similiar problem, but I was using the glossaries package. This thread in comp.text.tex gave me a working solution:

\documentclass[b5paper]{scrreprt}

\usepackage{calc}
\usepackage[acronym,nonumberlist,]{glossaries} % make a separate list of
acronyms
\usepackage{glossary-tree}

\setlength{\glslistdottedwidth}{4cm}

\newglossarystyle{altlistdotted}%
{%
\glossarystyle{tree}%
\renewcommand{\glossaryentryfield}[5]{%
\hangindent0pt\relax
\parindent0pt\relax
\makebox[\glslistdottedwidth][l]%
{%
\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
}%
\parbox[t]{\linewidth-\glslistdottedwidth}{##3}\par}%
}

\glossarystyle{altlistdotted}

\makeglossaries
\newacronym{Acronym}{Acronym}{Explanation of an acronym}
\newacronym{short}{short}{This is only short}
\newacronym{long}{long}{This explanation is longer, so you get a line break here}
\newacronym{superlong}{superlong}{This explanation is so long, that it is even long than the long example}
`