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 luatex 0.70.1 together with acro 1.2 and I have the following MWE.

\documentclass{minimal}
\usepackage[ngerman]{babel}
\usepackage{acro}

\DeclareAcronym{DNA}{
    short=DNA,
    long=Desoxyribonukleinsäure
}

\begin{document}
Das ist ein sehr langer Satz und er wird an seinem Ende leider nicht richtig umgebrochen: DNA-Sequenzierung

Das ist ein sehr langer Satz und er wird an seinem Ende leider nicht richtig umgebrochen: \acs{DNA}-Sequenzierung
\end{document}

Document looks normal with pdftex (both lines wrapped after dash), but when using luatex the 2nd line continues into the margin. I would have posted images, but due to the fact that this is my first post the systems doesn't allow it.

share|improve this question
1  
Welcome to TeX.SE! The following is not a full solution, for sure, but more of a short-term fix: you can (re)enable hyphenation after DNA- by writing \acs{DNA}-\hspace{0pt}Sequenzierung. If this sequence (pun intended) occurs frequently in your document, you may want to consider creating a little macro, such as \newcommand{\DNAS}{\acs{DNA}-\hspace{0pt}Sequenzierung}. –  Mico Mar 21 '13 at 5:26
    
Perhaps the lualatex format does not contains the same hyphenation patterns than the pdflatex format –  JLDiaz Mar 21 '13 at 7:05

1 Answer 1

up vote 7 down vote accepted

This has to do with the different hyphenation algorithm used by LuaTeX. I don't really know the details, but here's what's shown when I put DNA-Sequenzierung and \acs{DNA}-Sequenzierung in a box and make LuaTeX show it.

\sbox0{DNA-Sequenzierung}

\hbox(6.8872+1.94397)x88.4784, direction TLT
.\T1/cmr/m/n/10 D
.\T1/cmr/m/n/10 N
.\T1/cmr/m/n/10 A
.\T1/cmr/m/n/10 -
.\discretionary
.\T1/cmr/m/n/10 S
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 q
.\T1/cmr/m/n/10 u
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 n
.\T1/cmr/m/n/10 z
.\T1/cmr/m/n/10 i
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 r
.\T1/cmr/m/n/10 u
.\T1/cmr/m/n/10 n
.\T1/cmr/m/n/10 g

\sbox0{\acs{DNA}-Sequenzierung}

\hbox(6.8872+1.94397)x88.4784, direction TLT
.\hbox(6.8872+0.0)x22.63336, direction TLT
..\hbox(6.8872+0.0)x22.63336, direction TLT
..\hbox(6.8872+0.0)x0.0, glue set - 22.63336fil, direction TLT
...\glue 0.0 plus 1.0fil minus 1.0fil
...\T1/cmr/m/n/10 D
...\T1/cmr/m/n/10 N
...\T1/cmr/m/n/10 A
.\T1/cmr/m/n/10 -
.\T1/cmr/m/n/10 S
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 q
.\T1/cmr/m/n/10 u
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 n
.\T1/cmr/m/n/10 z
.\T1/cmr/m/n/10 i
.\T1/cmr/m/n/10 e
.\T1/cmr/m/n/10 r
.\T1/cmr/m/n/10 u
.\T1/cmr/m/n/10 n
.\T1/cmr/m/n/10 g

In the first case LuaTeX puts a \discretionary item after the hyphen, while it doesn't in the second case, probably because it thinks that the hyphen is at the start of a word (it comes after a box which is not part of the word).

This does not happen with pdfLaTeX, because the \discretionary item is inserted at a later stage.

It's probably better, in any case, using the babel shortcuts:

Das ist ein sehr langer Satz und er wird an seinem Ende leider 
nicht richtig umgebrochen: DNA"=Sequenzierung

Das ist ein sehr langer Satz und er wird an seinem Ende leider 
nicht richtig umgebrochen: \acs{DNA}"=Sequenzierung

which gives

enter image description here

share|improve this answer
    
OK, tested that myself using the \showhyphens{} command and it looks indeed as if the hyphenated word is "-Sequenzierung". I thought the acronym replacement would happen first and hyphenation later after eventually having the word replaced. Unfortunately shorthands don't work within an acronym definition. –  Quincy Mar 25 '13 at 20:58

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.