Umlauts and accents in LaTeX (ä, ö, ü, ß, é)

Type umlauts and accented letters directly: a current LaTeX reads UTF-8 without any package. Add \usepackage[T1]{fontenc} so words with these letters are hyphenated correctly. On a keyboard without the characters, accent commands such as \"a print them.

Type the characters directly

LaTeX has read source files as UTF-8 by default since 2018. \usepackage[utf8]{inputenc} is only needed for older installations and does no harm in new ones. The file has to be saved as UTF-8.

Complete document:

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
Größe, Übung, Äpfel, café, señor, garçon, Ångström
\end{document}
Result
The compiled example

Open in the editor

Accent commands

An accent command is a backslash, a symbol for the accent and the letter: a straight quote for the umlaut, an apostrophe for the acute, a backtick for the grave, ^ for the circumflex and ~ for the tilde. \c{c} prints a cedilla, \ss the sharp s, and \aa, \o and \ae the Scandinavian letters.

Gr\"o\ss{}e, \"Ubung, caf\'e, tr\`es, h\^otel, se\~nor, gar\c{c}on, \aa{}, \o{}, \ae{}
Result
The compiled example

Open in the editor

Short form with babel

With babel and the option ngerman, a straight quote in front of a vowel prints the umlaut and "s the sharp s. Many older German documents are written this way.

Complete document:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\begin{document}
Gr"o"se, "Ubung, "Apfel
\end{document}
Result
The compiled example

Open in the editor

Accents in formulas

Math mode has its own accent commands: \hat, \bar, \tilde, \dot, \ddot, \vec, \acute, \grave, \check and \breve.

$\hat{a}$, $\bar{x}$, $\tilde{n}$, $\dot{x}$, $\ddot{x}$, $\vec{v}$
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages