[Tex/LaTex] Why does \usepackage[british]{babel} hyphenate the word “alternate” incorrectly

babelhyphenation

Now I know there are hyphenation differences between British and American English but in no dictionary, British or American, could I find the word "alternate" to be broken down to al·tern·ate instead of al·ter·nate (for example). And yet:

\documentclass[a5paper]{article}
\usepackage[british]{babel}
\begin{document}
alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate alternate
\end{document}

alternate altern-

If you remove the babel line or change it to american, the hyphenation will be correct:

many alternates, all correct

So how does the British hyphenation work? Is it a complete reimplementation that can be buggy? Or is it just a list of exceptions where British syllabification differs from American? If it is the latter, why would a wrong hyphenation of "alternate" be made part of that word list?

Best Answer

According to the Oxford dictionary the correct hyphenation in British English is

al-ter-nate

The pattern for British English were prepared in 1996 by Dominik Wujastik using a list of hyphenated words made available by Oxford University Press and is present on CTAN as ukhyph.tex. In 2008, the team in charge of maintaining hyphenation patterns for TeX Live made a reorganization of the material; here's the start of hyph-en-gb.tex:

% This file has been renamed from ukhyphen.tex to hyph-en-gb.tex in June 2008
% for consistency with other files with hyphenation patterns in hyph-utf8 package.
% No other changes made. See http://www.tug.org/tex-hyphen for more details.

% File: ukhyphen.tex
% TeX hyphenation patterns for UK English

Some lines later we can read

%       $Log: ukhyph.tex $
%       Revision 2.0  1996/09/10 15:04:04  ucgadkw
%       o  added list of hyphenation exceptions at the end of this file.
%
%
% Version 1.0a.  Released 18th October 2005/PT.
%
% Created by Dominik Wujastyk and Graham Toal using Frank Liang's PATGEN 1.0.
% Like the US patterns, these UK patterns correctly hyphenate about 90% of
% the words in the input list, and produce no hyphens not in the list
% (see TeXbook pp. 451--2).
%
% These patterns are based on a file of 114925 British-hyphenated words
% generously made available to Dominik Wujastyk by Oxford University Press.
% This list of words is copyright to the OUP and may not be redistributed.
% The hyphenation break points in the words in the abovementioned file is
% also copyright to the OUP.

so I argue that the hyphenation patterns have never changed from 1996, except for the addition of a hyphenation exception list that reads, in the original file,

\hyphenation{ % Do NOT make any alterations to this list! --- DW
uni-ver-sity
uni-ver-sit-ies
how-ever
ma-nu-script
ma-nu-scripts
re-ci-pro-city
through-out
some-thing}

and is exactly the same in the reorganized files.

It is true that alternate hyphenates as

al-tern-ate

as the following file to be run with pdflatex shows:

\makeatletter\language\l@british\showhyphens{alternate}\stop

that prints

Underfull \hbox (badness 10000) detected at line 0
[] \OT1/cmr/m/n/10 al-tern-ate

on the terminal.

Hyphenation in TeX doesn't examine a long list of words, but rather uses a method based on patterns, described in Appendix H of the TeXbook. The patgen program distills a set of patterns based on a list of hyphenated words, but some compromise has to be made for efficiency of the algorithm, so it's surely possible that some word slips off and turns out to be hyphenated incorrectly.

That's what the hyphenation exception list is for. You can, until the problem is fixed by adding some suitable patterns or the word in the exception list, add it manually:

\documentclass[a5paper]{article}
\usepackage[british]{babel}

\babelhyphenation[british]{al-ter-nate}

\begin{document}
alternate alternate alternate alternate alternate alternate alternate 
alternate alternate alternate alternate alternate alternate alternate 
alternate alternate alternate alternate
\end{document}

enter image description here

The command \babelhyphenation requires babel version 3.9; for an earlier version one can use

\begin{hyphenrules}{british}
\hyphenation{al-ter-nate}
\end{hyphenrules}

which has the same effect.

Related Question