40

In my article, words are sometimes split a bit weird. For example: although ev-erywhere isn't wrong, it doesn't read very easily, so I'd like to split it as every-where.

How can I do that? I tried typing every\-where (provided by the babel package), but that doesn't work.

  • 3
    \hyphenation{every-where} in the preamble should do, if you don't use language switching in the document. If you do, please add a MWE. – egreg Jun 1 '14 at 11:13
  • @egreg: That works perfectly, indeed. I wonder whether I have to do this for every single word with this problem. Suppose that I have an article of let's say 500 pages. That'll be a long list of hyphenations in the preamble... – Jeroen Jun 1 '14 at 11:20
  • Maybe you're too influenced by the hyphenation rules in your mother language. American English hyphenation doesn't generally require splitting at word component boundaries, as far as I know. – egreg Jun 1 '14 at 11:30
  • 3
    Just don't worry. If the line width is generous, TeX will hyphenate quite sparsely; if you load microtype, hyphenation frequency will even decrease. – egreg Jun 1 '14 at 11:39
  • 1
    See tex.stackexchange.com/a/586/4427 – egreg Jun 1 '14 at 12:30
33

The American English hyphenation patterns loaded by TeX/LaTeX (those by Liang and Knuth) allow hyphenating ev-ery-where. The British ones (by Wujastyk and Toal), only allow every-where. Curiously enough, the online Oxford dictionary for American English says eve-ry-where. Also, if we instead of the traditional patterns for AmEn we use the “US English max” patterns by Kuiken, the only allowed hyphenation is every-where.

Let's look for a confirmation with a test:

\documentclass{article}

\newcommand\test[1]{%
  \language\csname l@#1\endcsname
  \parbox[t]{0pt}{\hspace{0pt}everywhere}%
}

\begin{document}

\begin{tabular}{lll}
American English  & American English    & British English     \\
(Liang-Knuth)     & (Kuiken)            & (Wujastik and Toal) \\
\test{english}    & \test{usenglishmax} & \test{british}
\end{tabular}

\end{document}

enter image description here

If you feel that ev-ery-where is ambiguous, you can add

\hyphenation{every-where}

to your preamble. If you do language shifting with babel, it's best to use its own method for defining hyphenation exceptions:

\babelhyphenation[english]{every-where}

(you need babel version 3.9). Changing the hyphenation patterns to use usenglishmax is possible with H. Oberdiek's package hyphsubst, typing

\usepackage[english=usenglishmax]{hyphsubst}

as soon as possible in the preamble.

However, TeX is usually quite frugal with hyphenation, provided the line length is generous. By loading microtype you can even decrease the hyphenation frequency.

\documentclass{article}
\usepackage{microtype}
\usepackage{kantlipsum}

\begin{document}

\microtypesetup{activate=false}
\kant[1]

\microtypesetup{activate=true}
\kant[1]

\end{document}

enter image description here

  • The following is not a critique of your first MWE but just an observation: your first MWE compiles as expected -- i.e., with hyphenations taking place -- under both pdfLaTeX and XeLaTeX but not under LuaLaTeX. (I've tested it with both MacTeX2013 and TeXLive2014/pre.) Specifically, with LuaLaTeX the hyphenation points are found in the first column but not in the second and third. Very odd (and disturbing, really). – Mico Jun 1 '14 at 15:08
  • @Mico The explanation is easy: LuaTeX loads the hyphenation patterns on demand; babel deals with this, but otherwise one has to do it manually. I find it much worse the fact that hyphsubst doesn't really work with LuaLaTeX. – egreg Jun 1 '14 at 15:18
22

You can use \hyphenation{every-where} to manually set the hyphenation.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\hyphenation{every-where}

\begin{document}
everywhere everywhere everywhere everywhere everywhere everywhere everywhere 
everywhere everywhere everywhere everywhere everywhere everywhere everywhere
everywhere everywhere everywhere everywhere everywhere everywhere 
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.