Today I found a second way to achieve a strikethrough in LaTeX (what is done by »line-through« in css: strike out text). If you want to put a line across text, your choices are »ulem« and »cancel«:

Strikethough in LaTeX using »ulem«

\usepackage{ulem} in the preamble gives you two ways to strike out text (and a couple more for underlining):

  1. \sout{text to be striked out} for a horizontal line through text to be striked out (exactly like »line through«).
  2. \xout{text to be crossed out} for many short diagonal lines crossing out the letters of the text to be crossed out

The problem that ulem affects some bibliography styles where otherwise italicised text is then underlined can be remedied through the »normalem«-option in the preamble: \usepackage[normalem]{ulem} (Thanks Fredrik!).

Ulem is part of MiKTeX and TeX Live but also available at ctan.

Strikethrough in LaTeX using »cancel«

\usepackage{cancel} in the preamble gives you four different modes of striking through

  1. \cancel{text to cancel} draws a diagonal line (slash) through its argument
  2. \bcancel{text to cancel} uses the negative slope (a backslash)
  3. \xcancel{text to cancel} draws an X (actually \cancel plus \bcancel)
  4. \cancelto{〈value〉}{〈expression〉} draws a diagonal arrow through the 〈expression〉pointing to the 〈value〉 (math-mode only)

You can get cancel at ctan.

Results

LaTeX strikethrough examples (ulem + cancel)

Click on the image for pdf or download the source file – which looks like this:


\documentclass[a4paper,11pt]{article}

\usepackage[utf8]{inputenc}

\usepackage{setspace}

\usepackage{ulem}

\usepackage{cancel}

\begin{document}

\sffamily

\doublespace

\textbf{Ulem:}

\verb+\sout{striked out text}+ renders \sout{striked out text}

\verb+\xout{crossed out text}+ renders \xout{crossed out text}

\textbf{Cancel:}

\verb+\cancel{canceled text}+ renders \cancel{canceled text}

\verb+\bcancel{b-canceled text}+ renders \bcancel{b-canceled text}

\verb+\xcancel{x-canceled text}+ renders \xcancel{x-canceled text}

\verb+\cancelto{<value>}{<expression>}+ renders $\cancelto{value}{expression} $

Cancelto also works with more complicated expressions:

\verb+\cancelto{\frac{num2}{den2}}{\frac{num1}{den1}}+ renders $\cancelto{\frac{num2}{den2}}{\frac{num1}{den1}} $

\end{document}