Hyphenation

TeX was created to typeset mathematical books and its default hyphenation dictionary is for American English.

With today’s Unicode enabled TeX engines you could use TeX to typeset books in Russian or Classical Greek or any language. So you need hyphenation patterns for a lot of languages, converted to UTF-8. The file hyphenation.pdf () lists all hyphenation patterns for TeX, which have been collected in a single package hyph-utf8, which can be used in pdfTeX, XeTeX, or LuaTeX.

An example of their use is given in the following files: hyph.tex, hyph.pdf

These files use the commands \uselanguage{ukenglish}, \uselanguage{ngerman}, etc to switch between hyphenation patterns. If you find those commands a bit long, you can create an alias like this: \def\de{\uselanguage{ngerman}}; now \de will apply German hypenation.

There is another method which allows more control over the hyphenation:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for hyphenation profiles and European languages
{\catcode`@=11
\gdef\eplainsetlanguage#1#2#3{%
% do not set the language if the name is undefined in the current TeX.
\expandafter\ifx\csname lang@#1\endcsname \relax
\message{no patterns for #1}%
\else
\global\language = \csname lang@#1\endcsname
\fi

% but there is no harm in adjusting the hyphenmin values regardless.
\global\lefthyphenmin = #2\relax
\global\righthyphenmin = #3\relax
}}%

\def\ukenglish{\eplainsetlanguage{ukenglish}{2}{3}}
\def\ngerman{\eplainsetlanguage{ngerman}{2}{3}}
\def\russian{\eplainsetlanguage{russian}{2}{2}}
\def\latin{\eplainsetlanguage{latin}{2}{2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

These macros written by Karl Berry allow you to change the values of \lefthyphenmin and \righthyphenmin. \lefthyphenmin sets the minimum number of characters before a hyphenation, \righthyphenmin the minimum number of characters after a hyphenation. \lefthyphenmin is normally set to 2 and \righthyphenmin to 3, so the word ‘advocate’ could be broken ad- vocate or advoc- ate but advoca- te would not be permissable. The 2, 3 settings seem to be used in English, French and German. But other languages may have different settings.

Also in \def\ukenglish{\eplainsetlanguage{ukenglish}{2}{3}} the \ukenglish can be changed to something different if you prefer, e.g.

\def\english{\eplainsetlanguage{ukenglish}{2}{3}}
\def\deutsch{\eplainsetlanguage{ngerman}{2}{3}}
\def\rus{\eplainsetlanguage{russian}{2}{2}}
\def\francais{\eplainsetlanguage{french}{2}{3}}
\def\gaeilge{\eplainsetlanguage{irish}{2}{2}}


Here is the example file above but using the Eplain hyphenation macros. I’ve also tested the hyphenation a bit more by setting the type in two columns using Eplain’s \doublecolumns macro: hyph2.tex, hyph2.pdf

Of the two methods the first is easier to use. It also works better when used within macros.