[Tex/LaTex] Prevent global hyphenation for a specific word

hyphenation

I know this is a common question.

I want to stop LaTeX splitting the word "Byte".

I already searched for the problem and found the solution with \hyphenation.

I thought \hyphenation{Byte} would solve my problem. But unfortunately it doesn't work. I think it has something to do that he probably just uses this for "byte" and not for words that contain it (German example: "Bytestrom", LaTeX splits it By-testrom).

The second solution which I found was using \mbox with \newcommand. I don't like this solution very much.

So my questions are:

  • Why does \hyphenation{byte} not work?
  • Is there another way to solve my problem?

Example added by Jake:

\documentclass[a5paper]{article}
\usepackage[german]{babel}
\begin{document}
Trying to determine how a special word is hyphenated: Bytestrom.
\end{document}

Best Answer

Quoting the TeXbook, p. 452:

\hyphenation{man-u-script man-u-scripts ap-pen-dix}

[...] tells TeX how to hypenate the words 'manuscript' , 'manuscripts', and 'appendix'. Notice that both singular and plural forms of 'manuscript' were entered, since the exception dictionary affects hyphenation only when a word agrees completely with an exceptional entry.

In other words, the answer to your question is to enter both Byte and Byte-strom into the exception list.

\documentclass[a5paper]{article}
\usepackage[german]{babel}
\hyphenation{Byte Byte-strom}
\begin{document}
Trying to determine how a special word is hyphenated: Bytestrom.
\end{document}

enter image description here

Related Question