7

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
4
  • 2
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem and helps others to test. Commented Aug 29, 2012 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
    Commented Aug 31, 2012 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
    Commented Sep 4, 2012 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
    Commented Sep 4, 2012 at 7:32

2 Answers 2

7

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.

4

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.

3
  • See my answer ;-) Commented Aug 31, 2012 at 15:21
  • i'm surprised that you don't know that tex will not hyphenate the first word in a paragraph or table cell. Commented Mar 30, 2018 at 21:06
  • @barbarabeeton The first word of the acronym at the point of use is definitely not the first word in a paragraph.
    – egreg
    Commented Mar 30, 2018 at 21:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .