How can I strike through an expression (e.g. "2x") obliquely, e.g. from bottom left to top right, so as to indicate cancellation? With the \sout command from the ulem package, I can only strike horizontally.
Asked
Active
Viewed 7.7k times
93
doncherry
- 54,637
Harry Macpherson
- 3,075
-
1near duplicate to [http://tex.stackexchange.com/questions/4465/put-a-slash-through-a-word](putting a slash through a word), although that doesn't have such nice example images. – barbara beeton Jan 06 '12 at 14:18
1 Answers
112
The cancel package seems to do exactly what you want:
\documentclass{article}
\usepackage{cancel}
\begin{document}
\( \cancel{2x} \)
\( \cancel{1234567890} \)
\end{document}

If you're not satisfied with how the cancellation starts below the 1 and ends above the 0, have a look at Diagonal strikeout starting too low and ending too high.