# [Babel/Polyglossia]: wrong hyphenation?

Consider the following MWE; say you save it in foo.tex.

\documentclass{article}

\setcounter{secnumdepth}{0}

\usepackage{polyglossia}
\setmainlanguage{english}
\setkeys{english}{variant=british}

% \usepackage[UKenglish]{babel}

\begin{document}

\section{Report of the PRESIDENTIAL COMMISSION on the Space Shuttle
Challenger
Accident}

\subsection{Volume 2: Appendix F - Personal Observations on Reliability
of
Shuttle}

by R. P. Feynman

For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
\end{document}


Compile it with \$ xelatex foo.tex. In the resulting pdf the word "Reliability" is incorrectly split as Reliab-ility. According to the Oxford Advanced Dictionary (dead-tree version), the correct hyphenation is re-li-abil-ity. Commenting the line \usepackage{polyglossia}, and the two lines after that, and uncommenting the babel line gives the same result.

Now comment the the \setkeys line (i.e. use "normal" english). The word is now split correctly as Relia-bility. Using babel with non-UK english also results in correct spliting.

Is this a typo in both polyglossia and babel, or in some file relied on by both packages (perhaps the file for UK-lang specific settings)? Help in debuging this is appreciated.

while i agree that the hyphenation is unfortunate and wrong, i happen to have in my possession a printed copy of the dictionary from which the british hyphenation patterns were generated. (The Oxford Minidictionary of Spelling and Word Division, the clarendon press, 1986) it contains the word, divided as reported.

here is the relevant page.

two levels are indicated for the desirability of hyphenation:

• primary/preferred -- solid bars
• secondary -- broken bars

i'm thinking that perhaps some "known errors" were inserted by the publisher to trap an unscrupulous individual who would plagiarize the content, and publish an identical word list, and some tex users have just happened to hit some of the "bad examples". (inclusion of dummy entries is common practice in commercial mailing lists, for example.) i'm going to try to investigate this possibility.

• What's the difference between solid and broken bars? – egreg Sep 16 '15 at 22:24
• I was going to ask the same question about the vertical bars (the original was posted late at night; only now have I seen the replies). In my dictionary (Oxford Advanced Learner's of Current English, 6th Edition, 2000) the hyphenation uses central dots, e.g. re·li·abil·ity. But this answers my question: it's not a bug, it's an... (outdated) feature! :-) – wmnorth Sep 17 '15 at 6:36

Indeed, an interactive session with LaTeX

> latex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=latex)
restricted \write18 enabled.
**\relax
entering extended mode
LaTeX2e <2015/01/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.

*\makeatletter\language=\l@british

*\showhyphens{reliability}

Underfull \hbox (badness 10000) detected at line 0
[] \OT1/cmr/m/n/10 re-li-ab-il-ity


reveals that the hyphenation patterns for British English provide one more hyphenation point than what you find in the dictionary. This doesn't mean “wrong”, per se. You can raise the question on the appropriate mailing list; but it's something neither polyglossia nor babel have any control on.

If you feel that a hyphenation is wrong, you can fix it:

\documentclass{article}

\setcounter{secnumdepth}{0}

\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}

% see http://tex.stackexchange.com/questions/229915/polyglossia-ignores-my-custom-hyphenation
\newcommand{\sethyphenation}[2]{%
\AtBeginDocument{%
\begin{otherlanguage*}{#1}\hyphenation{#2}\end{otherlanguage*}%
}%
}

\sethyphenation{english}{re-li-abil-ity}

\begin{document}

\section{Report of the PRESIDENTIAL COMMISSION on the Space Shuttle
Challenger
Accident}

\subsection{Volume 2: Appendix F - Personal Observations on Reliability
of
Shuttle}

by R. P. Feynman

For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
\end{document}


You can specify as many words as you want in a \sethyphen command, for a specific language.

• I am not really knowledgeable in the hyphenation mechanism to know what a hyphenation pattern is; I'll look into it, and it is justified, complain in the venue you mention. Although I've marked Barbara's answer as the correct one, yours has also been very helpful, thanks for writing it. – wmnorth Sep 17 '15 at 6:42
• @wmnorth Hyphenation in TeX is based on a set of patterns that are preloaded and cannot be changed at runtime (LuaTeX removes this limitation), so this is the reason babel and polyglossia can do nothing about it. Think to the patterns as “hyphenation rules” (although it's improper); there is a team for the maintenance of these “rules” and fixing a bad hyphenation is their task. – egreg Sep 17 '15 at 8:02