The ulem package

Underlines and strikes out text in several styles that break across lines: \uline, \uuline, \uwave, \sout, \xout, \dashuline and \dotuline.

Loading the package

\usepackage[normalem]{ulem}

\underline cannot break across lines and has only one style. The commands of ulem break between words and offer a double, wavy, dashed and dotted line, and two ways of striking text out.

Loaded without options, the package redefines \emph to underline instead of italic. The option normalem keeps \emph as it is, which is what most documents want.

Main commands

\uline{text}Single underline.
\uuline{text}Double underline.
\uwave{text}Wavy underline.
\sout{text}Strikes the text out with a horizontal line.
\xout{text}Crosses the text out with slashes.
\dashuline{text}, \dotuline{text}Dashed and dotted underline.
\normalem, \ULforemSwitch \emph between italic and underlining inside the document.

Complete example

\documentclass{article}
\usepackage[normalem]{ulem}
\begin{document}
\uline{Single}, \uuline{double} and \uwave{wavy} underline.

\dashuline{Dashed} and \dotuline{dotted} underline.

\sout{Struck out} and \xout{crossed out}.

\emph{Emphasis stays italic because of the option normalem.}
\end{document}
Result
The compiled example

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023.

Pitfalls

Related pages