68

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.

lockstep
  • 250,273
Jeroen
  • 4,491
  • 9
    \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 01 '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 01 '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 01 '14 at 11:30
  • By the way, \- is a primitive command in TeX (LaTeX redefines it, but in a mostly equivalent form, when normal text is dealt with). – egreg Jun 01 '14 at 11:38
  • @egreg: Maybe you're right. In Dutch, words can be split at quite a lot of places. Do you think I should use the same approach when I'm writing in my mother tongue? – Jeroen Jun 01 '14 at 11:38
  • 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 01 '14 at 11:39
  • @egreg: Wauw, the microtype package is marvellous! It places everything at the perfect place. Maybe you can collect your comments in an answer, so that I can accept it. – Jeroen Jun 01 '14 at 12:24
  • 1
    See http://tex.stackexchange.com/a/586/4427 – egreg Jun 01 '14 at 12:30
  • Or you could use British English. If I use british, I get the result you want with SLx64's example without specifying the hyphenation explicitly ;). (British English uses different hyphenation rules from American English.) I tried this because splitting as ev-erywhere looked very wrong to me. Since TeX generally hyphenates very nicely, it seemed plausible to think the rule might be variant-specific. – cfr Jun 01 '14 at 12:51
  • Where exactly is the preamble? I tried putting \hyphenation{<hypthenated word>} before \begin{document} but that doesn't work. I can't find the context as to where EXACTLY to put the \hyphenation tag – BlkPengu Jun 25 '19 at 17:51

2 Answers2

62

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

egreg
  • 1,121,712
  • 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 01 '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 01 '14 at 15:18
36

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}

Tonechas
  • 976
SLx64
  • 2,823