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 am using the latest version of acronym (acronym 2010/09/08 v1.36) with Lualatex (Version beta-0.70.2-2012060719) and have a long acronym consisting of six words which is not hyphenated correctly. The package showhyphens shows that the first of the words in the text has no hyphenation options although it is hyphenated correctly in the list of abbreviations.

LaTeX-Community.org: acronym package and hyphenation shows a solution and GoLaTeX: hyphenation mit Package acronym (German) another but, unfortunately, both of them do not work for me.

Is there any other solution or has anyone encountered (and solved) a similar problem?

Edit: I have prepared a MWE. It is, however, a rather elusive bug. I have therefore stripped down the text to a point where I could not remove any more packages/text because the overfull hbox would not show. I hope it helps clarifying my problem, though.

\documentclass[DIV=calc,fontsize=12pt,titlepage=false]{scrartcl}

\usepackage{showhyphens}
\usepackage{fontspec}
\usepackage{microtype}
\newfontfeature{Microtype}{protrusion=default;expansion=false}
\setmainfont[Microtype]{Linux Libertine O}
\usepackage[ngerman,british]{babel}

\usepackage[smaller,printonlyused,withpage]{acronym}
\usepackage{bookmark}
\usepackage{booktabs}

\begin{document}
\hyphenation{Mi-ni-a-tur-netz-wer-ke}
Invertebrate neurons are larger than their vertebrate counterparts, which makes it easier to handle them.
This text is part of an interdisciplinary project: \ac{MIMU}.
\section*{List of abbreviations}
\begin{acronym}[MIMU]
\acro{MIMU}{Miniaturnetzwerke aus Insektenneuronen in multilateralen Umgebungen}
\end{acronym}
\end{document}

The MWE gives me the following output for text and abbreviation list:

  • 1: Overfull hbox in the text
  • 2: The very same word (Miniaturnetzwerke) is correctly hyphenated enter image description here enter image description here
share|improve this question
2  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem and helps others to test. –  Stephan Lehmke Aug 29 '12 at 11:14
2  
The method proposed on GoLaTeX works, provided you have the German shorthands of babel activated (which you haven't right now since your active language is British). –  cgnieder Aug 31 '12 at 12:27
    
@cgnieder: Would that be something like \addto\extrasbritish{\languageshorthands{ngerman}} \useshorthands{"} Without Stephan Lehmke's patch it does not work for me. –  mrub Sep 4 '12 at 7:24
    
This looks like a way. But there's nothing wrong with Stephan's patch. Doesn't egreg's answer work? Because it is exactly what I meant. –  cgnieder Sep 4 '12 at 7:32

2 Answers 2

up vote 6 down vote accepted

It seems that the acronym package is putting stuff in front of the first mention of an acronym (some code writing to file to make a label; I didn't analyse it further) which in effect inhibits hyphenation of the first word of the acronym text.

The following change of the preamble will patch the faulty command so that hyphenation is re-established. Sorry for the strange patching pattern, but \patchcmd seems to always replace only the first occurrence (but there are two for \AC@acl).

\usepackage{etoolbox}

\makeatletter
\patchcmd\@acf{\AC@acl}{\AC@foo}{}{}
\patchcmd\@acf{\AC@acl}{\AC@foo}{}{}
\patchcmd\@acf{\AC@foo}{\hskip\z@\AC@acl}{}{}
\patchcmd\@acf{\AC@foo}{\hskip\z@\AC@acl}{}{}
\makeatother

\begin{document}

example output

Please also consider egregs advice: You'll get better hyphenation of german text if you properly mark it as german.

share|improve this answer

You should state that the acronym is in the German language:

\documentclass[DIV=calc,fontsize=12pt,titlepage=false]{scrartcl}

\usepackage{showhyphens}
\usepackage[ngerman,british]{babel}

\usepackage[smaller,printonlyused,withpage]{acronym}
\usepackage{hyperref,bookmark}

\begin{document}

Invertebrate neurons are larger than their vertebrate counterparts, which makes it easier to handle them.
This text is part of an interdisciplinary project: \ac{MIMU}.
\section*{List of abbreviations}
\begin{acronym}[MIMU]
\acro{MIMU}{\foreignlanguage{ngerman}{Mi"-niaturnetzwerke aus Insektenneuronen in multilateralen Umgebungen}}
\end{acronym}
\end{document}

I don't know precisely why the first word can't be hyphenated; however, adding a suitable hyphenation point seems to be a workaround.

share|improve this answer
    
See my answer ;-) –  Stephan Lehmke Aug 31 '12 at 15:21

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.