Time for action – directly using special characters
In a TeX document, we would like to use the German name of a street. It contains diacritics, so called umlauts. Let's check out how to make it work right.
Start a new document. Within a small parbox, write the text:
\documentclass{article} \begin{document} \parbox{3cm}{Meeting point: K\"onigsstra\ss e (King's Street)} \end{document}
Typeset and have a first look:
Try babel instead! It provides shortcuts for German umlauts, if you state the
ngerman
option. Use "u for ü, a for ä, and s for ß":\usepackage[ngerman]{babel} … \parbox{3cm}{Meeting point: K"onigsstra"se (King'sStreet)}
The output would be the same. Still the hyphenation remains as a problem: TeX cannot use hyphenation rules if macros are inside the words.
As
babel
is required for good hyphenation, we keep that. But we use Unicode encoding and another called T1 font encoding :\documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin...