cancel
is intended for indicating mathematic cancellation, and consequently only works in math mode; it also strikes out diagnoally.
soul
and ulem
seem pretty similar. One basic semantic difference between them is that ulem
per default changes the definition of \emph{...}
to underline its argument instead of putting it in italics. This seems to aim at the reproduction of typewriter typesetting, when underlining often was the only means of indicating emphasis. Since using underlining for emphasis is mostly deprecated nowadays, I've always used soul
when I did need to underline something.
The one big reason in favor of soul
, however, is that it's able to deal with line breaks and hyphenation:
\documentclass{article}
\textwidth=1cm % just to force hyphenation to happen
\usepackage[T1]{fontenc}
\usepackage{cancel,soul,ulem}
\begin{document}
\[
\frac{\cancel{5}*17}{\cancel{5}*23}
\]
X \sout{supercalifragilisticexpialidocious}
X \st{supercalifragilisticexpialidocious}
X \emph{supercalifragilisticexpialidocious}
X \ul{supercalifragilisticexpialidocious}
\end{document}
(The X
are necessary because LaTeX won't hyphenate the first word in a paragraph.)
ulem
feels like a tool for underlining etc. whereas theSOUL
package feels more like a general toolkit for creating text decoration macros that comes with a few pre-defined commands that show you how to use it.soul
works as far as I can see requires the overlay to be "horizontally uniform", so for wavy lines such as tex.stackexchange.com/questions/67064/a-thicker-wave-underline, you have to stick toulem
(as mentioned below does not allow automatic hyphenation) orsoulpos
(needs two compilation passes).