Unlike in English, in German there are quite a few words that contain a hyphen, e.g., "Arbeiter-Unfallversicherung" (workers' accident insurance). By default, (La)TeX will only break such words after the existing hyphen and disregard all other breakpoints. This behaviour will often result in overfull hboxes for German texts.

There are at least three ways to achieve proper hyphenation, two of which use shorthands of the babel package and none of which I consider to be really satisfactory:

1. The "= shorthand: Arbeiter"=Unfallversicherung. This allows every (otherwise legal) breakpoint and therefore may produce correct but unfavourable hyphenation (e.g. Arbeiter-Un-fallversicherung). This seems to be a method of last resort, suited for documents to be created with (almost) no manual intervention.

2. The \- command: Ar\-beiter-Unfall\-ver\-si\-che\-rung. By manually setting allowed breakpoints, one can avoid unfavourable ones shortly before or after a present hyphen (I use a minimum of four characters as a rule of thumb). As a downside, one has to look up the correct breakpoints of the respective words. Also, the body of a LaTeX document may become quite cluttered.

3. The "- shorthand: Ar"-beiter-Unfall"-versicherung. This method (the one I'm currently using) also avoids unfavourable breakpoints and allows for a tidier document body. But one still has to look up the correct breakpoints.

To cut a long story short: Is there a way to automatically allow hyphenation of words already containing a hyphen, while disregarding breakpoints less than, say, four characters before or after the existing hyphen?

• Just a side note (I have no solution for the real problem): I would find “Arbeiterunfallversicherung” more natural looking in German. Duden even has the entry “Arbeiterunfallsversicherungsgesetz”, though in the section on adding hyphens it does concede that one could add a hyphen there. (The ÖWB doesn’t have a corresponding entry.) – Caramdir Sep 4 '10 at 7:48
• Sometimes the hyphen in German words is sort of optional, sometimes it's mandatory, e.g. in "öffentlich-rechtlich" (public-law). – lockstep Sep 4 '10 at 13:01

No. You could possibly use an external parsing script to apply one of those options to a text, but writing that would still be a lot of work, so manually adding commands is probably less work in practice.

Future update: LuaTeX has rudimentary support for some special hyphenation cases, and in a future version (spring 2014, most likely) there will be core support for weighted hyphenation and multiple hyphenation passes.

• Are there now some news about the special hyphenation in LuaTex? – Tobias Diez Jun 1 '14 at 22:22
• What is the situation in 2018? Any news? – Jonas Stein Jan 24 '18 at 9:50
• I'm just a beginner in using LuaTeX, but here's an example of allowing hyphenation within words already containing a hyphen. One could extend that with a pre- or post- pass that does more tweaking, e.g. not allow hyphenation “near” the hyphen, etc. – ShreevatsaR Mar 2 '18 at 6:33

This seems to be what the hyphenat package is for. From the manual:

TeX does not want to hyphenate a word that appears in the source already hyphenated, such as electromagnetic-endioscopy.
The \hyp command is like the other \...hyp commands, only it typesets a hyphen and allows full automatic hyphenation of the other words forming the compound word. It is used like electromagnetic\hyp{}endioscopy.

I'm not sure about your last criterion, though it seems that if TeX applies its normal hyphenating rules then this would be unlikely to happen anyway since (I think) that what happens is that the word after the \hyp{} is treated (as far as hyphenation is concerned) as a new word and I guess that not many words get hyphenated in the first (or last) few characters.

• It sounds like this does the same as babel's "= shorthand? – Taco Hoekwater Sep 3 '10 at 18:58
• The effect of the \hyp{} command seems to be similar to that of the "= babel shorthand. As far as I understand, the text before and the one after these commands are treated as separate words. Unfortunately (regarding to my question), words that may be hyphenated with only two characters separated from the rest are quite common in German. – lockstep Sep 3 '10 at 19:08
• @lockstep: I wondered about that, but figured that if you knew about hyphenat then you'd've explained why it didn't work so thought it worth at least mentioning. – Loop Space Sep 3 '10 at 19:21
• Only electromagnetic\BreakableHyphen{}endioscopy works for me (KOMA-script book, babel frenchle, LyX). Of course, as I am under LyX, \BreakableHyphen{} is in a TeX box. – lalebarde May 8 '14 at 11:09
• @TacoHoekwater The solution of \hyp{} is much more broad, for example it works with Polyglossia under XeLaTeX while the "= shorthand does not! – Paulo Ney Apr 2 '16 at 21:46

With LuaTeX, a simple solution is to enter explicit hyphens in the \hyphenation command as =.

\hyphenation{Ar-beiter=Unfall-ver-si-che-rung}
\showhyphens{Arbeiter-Unfallversicherung}
\bye


After compiling this document with LuaTeX, the .log file shows that hyphenation is possible

[][] \tenrm Ar-beiter-Unfall-ver-si-che-rung


with hyphenations Arbei-ter... and ...Un-fallversicherung omitted as requested by the \hyphenation command.

That way, no further mark-up is required in the document source for LuaTeX to handle (a selection of) words automatically. It's not a fully automatic solution, though, since an explicit list of words needs to be maintained. And all hyphens are hard-coded, i.e., changing inner word hyphen minima is tedious. Still room for improvements ...

The LuaTeX manual has some more information on hyphenation related differences to Knuth's TeX in section “Languages and characters, fonts and glyphs”.

You can set \lefthyphenmin=4 to ensure at least 4 characters after the explicit "= hyphen before any hyphens inserted by tex. (It really sets that there should be 4 characters after the beginning of any word, not only compound words with a "=.)

It's possible to make the change to \lefthyphenmin locally, but it is awkward. Tex only looks at the value of \lefthyphenmin at the beginning of paragraphs and at language changes, so you have to write something like: {\lefthyphenmin4\setlanguage\language ...}\setlanguage\language

Indeed, if you try the following example, you'll see that TeX hyphenates the compound word:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\begin{document}
\hyphenchar\font=\string"7F


• Sorry, but using -- does prevent hyphenation in the joined words. – egreg Nov 16 '15 at 13:47