[Tex/LaTex] Hyphenation of words containing slash

hyphenation

How can I tell LaTeX to automatically split up the german word

Kontrast/Rausch-Verhältnis 

into

Kontrast/Rausch-|Ver|hält|nis

LaTeX complains that "/" is not a letter.

Best Answer

A hyphen allowing hyphenation in the following word is obtained in babel-german with "=; if you want also to allow breaking at /, use \slash for it:

Kontrast/Rausch"=Verhältnis}

with no break at /, or

Kontrast\slash Rausch"=Verhältnis

if breaking at / is allowed.

Here's a document showing the various possibilities; the narrow \parbox is just to force TeX into hyphenating as much as possible.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\begin{document}
\parbox{24pt}{\hspace{0pt}Kontrast/Rausch-Verhältnis}

\bigskip

\parbox{24pt}{\hspace{0pt}Kontrast/Rausch"=Verhältnis}

\bigskip

\parbox{24pt}{\hspace{0pt}Kontrast\slash Rausch"=Verhältnis}
\end{document}

enter image description here

Related Question