This question led to a new feature in a package:
babel
By default, (La)TeX fails at hyphenating some words, e.g., the English word potable
(should be pot-able
) or the German word Mor-dop-fer
(murder victim, should be Mord-op-fer
). There are two strategies to achieve correct hyphenation:
-
adding a "hyphenation exception" list for the document's main language in the preamble with
\hyphenation{pot-able}
; -
using
pot\-able
at every instance in the document body. (This is also the only resort for words that already contain hyphens.)
But what to do in case of multi-lingual documents? As \hyphenation
only works for the main document language, must one fall back to manual hyphenation correction in the document body for other languages? Or is it possible to specify separate hyphenation exception lists for the respective languages?
\documentclass[draft]{article}
\usepackage[ngerman,english]{babel}
\begin{document}
The language is \languagename\ (correct hyphenation is \verb|pot-able|):
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX X potable
\selectlanguage{ngerman}
The language is \languagename\ (correct hyphenation is \verb|Mord-op-fer|):
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX Mordopfer
\end{document}
Best Answer
The
hyphenrules
environment just changes the language; moreover\hyphenation
commands are always global and refer to the current language, so this is the best strategyYou can also, for greater clarity, insert the first
\hyphenation
command in a properhyphenrules
environment.A useful addition to
babel
might be the followingso that the previous input could become