[Tex/LaTex] Glossaries package and hyphenated (dashed) acronym fail to break across lines

glossarieshyphenationline-breaking

With respect to using the glossaries package, if I have an acronym with a long hyphenated word, it often result in sentences that runs into margins. For example:

\newacronym[sort=WH]{WH}{Wh}{Wiener-Hammerstein}

results in:

Line-breakring does not occur at dashes

I have also tried

\newacronym[sort=WH]{WH}{Wh}{Wiener\-Hammerstein}

But that fails as well, it just produces WienerHammerstein.

How do I get round this problem and allow the hyphenated ord to break across the hyphen, but always write the hyphen in normal situations?

Best Answer

The issue is not related to glossaries. As soon as a word has an explicit hyphen TeX assumes it is only allowed to break there. A quick solution would be

\newacronym[sort=WH]{WH}{Wh}{Wiener-Hammer\-stein}

that is, adding allowed break points manually.

Another solution would be to use babel shorthands.

Related Question