           The lthyphen.dtx file^{∗}

for use with L^{A}TEX 2ε

Frank Mittelbach, Chris Rowley  Rainer Schöpf

March 27, 1996

This file contains the code for loading hyphenation patterns into L^{A}TEX. Most of this will end up in a file called hyphen.ltx. If you wish to customize your L^{A}TEX system in respect of hyphenation patterns, write a file hyphen.cfg. If this file exists, it will be loaded instead of hyphen.ltx. See the comments below for additional information.

To produce the printed version of this file the following code is used. It can be extracted with the docstrip program, or one can run this file directly through L^{A}TEX 2ε.

1 ⟨∗driver⟩

 2 \documentclass{ltxdoc}
 3 \begin{document}
 4 \DocInput{lthyphen.dtx}
 5 \end{document}

6 ⟨/driver⟩

The default file hyphen.ltx loads hyphenation patterns for US english. If you want to load additional or other hyphenation patterns, you should create a file hyphen.cfg. This is best done by starting from hyphen.ltx.

For backward compatibility, the default file, hyphen.ltx, first tries to load the file hyphen.tex. If this file exists, an information message is issued and the appropriate defaults for TEX’s internal parameters are set: \language is initialized to 0, and \lefthyphenmin and \righthyphenmin to 2 and 3, respectively, to disallow x- or -xx breaks.

7 ⟨∗default⟩

 8 \InputIfFileExists{hyphen.tex}%
 9 {\message{Loading hyphenation patterns for US english.}%
10  \language=0
11  \lefthyphenmin=2 \righthyphenmin=3 }%

Otherwise, since we cannot do anything without any hyphenation patterns, an error message is printed and the IniTEX run is terminated by invoking \@@end (which is the L^{A}TEX 2ε name for TEX’s \end primitive).

12 {\errhelp{The configuration for hyphenation is incorrectly

∗This file has version number v1.0h, dated 1994/12/04.

13  installed.^^J%
14  If you don't understand this error message you need
15  to seek^^Jexpert advice.}%
16  \errmessage{OOPS! I can't find any hyphenation patterns for
17  US english.^^J \space Think of getting some or the
18  latex2e setup will never succeed}\@@end}

19 ⟨/default⟩

The following example describes the possible contents of a file hyphen.cfg that will load both US English and German hyphenation patterns, making the former the default. It sets \language to 0 for the US patterns and to 1 for the German patterns. Then \language is set to 0 to make this the default and the default

values of \lefthyphenmin and \righthyphenmin are set.
\language=0
\input hyphen % (or \input ushyphen1 if the file has been renamed)
\language=1
\input ghyph31
\language=0
\lefthyphenmin=2
\righthyphenmin=3
\endinput

Another possibility is to use the package babel, by Johannes Braams. That package is distributed with a suitable hyphen.cfg file.