Math-Linux.com

Knowledge base dedicated to Linux and applied mathematics.

Home > Latex > FAQ > Latex - FAQ > Strikethrough - strike out text or formula in LaTeX

Strikethrough - strike out text or formula in LaTeX

All the versions of this article: <English> <français>

How to cross out / strikethrough text or equations in Latex?
There are two main ways to do this with the cancel and ulem packages. It also depends on your needs: is it in mathematical mode or in text mode?

Strikethrough in LaTeX using cancel packages

I personally prefer this package because it works equally well on Latex text or on Latex equations
You must use cancel packages as follows:

\cancel draws a diagonal line (slash) through its argument.
\bcancel uses the negative slope (a backslash).
\xcancel draws an X (actually \cancel plus \bcancel).
\cancelto〈value〉〈expression〉 draws a diagonal arrow through the 〈expression〉,
pointing to the 〈value〉

Here is an example I built to illustrate this package


\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{cancel}
\usepackage{amsmath}
\begin{document}

I want to strike out symbols in math mode $\cancel{\alpha + 2}=8$

I want to strikethrough this \cancel{text} in text mode.

I want to strikethrough an equation

\begin{equation*} 
\cancel{f(x)=(x+a)(x+b)}
\end{equation*}

\begin{equation}
\begin{aligned}
B'&=-\nabla \times E,\\
E'&=\cancel{\nabla \times B - 2\pi j},\\
E'&=\nabla \times B - 4\pi j
\end{aligned}
\end{equation}

I prefer backslash ! Please bcancel 

\begin{equation}
\begin{aligned}
B'&=-\nabla \times E,\\
E'&=\bcancel{\nabla \times B - 2\pi j},\\
E'&=\nabla \times B - 4\pi j
\end{aligned}
\end{equation}

What about a cross ?
\begin{equation}
\begin{aligned}
B'&=-\nabla \times E,\\
E'&=\xcancel{\nabla \times B - 2\pi j},\\
E'&=\nabla \times B - 4\pi j
\end{aligned}
\end{equation}

What about cross and replace ?

\begin{equation}
\begin{aligned}
B'&=-\nabla \times E,\\
E'&=\cancelto{\nabla \times B - 2\pi j}{\nabla \times B - 4\pi j}
\end{aligned}
\end{equation}

\end{document}

Documentation in https://ctan.org/pkg/cancel

Strikethrough text in LaTeX using ulem packages

ulem is only for text. You can use sout or xout functions as follows.

\sout line struck through word

\xout marked over


\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\begin{document}

I want to strike out symbols in math mode $\sout{\alpha + 2}=8$

Hum hum not possible ...

I want to strikethrough this \sout{text} in text mode.

Yes we can !

I want to strikethrough this \xout{text} in text mode.

Yes we can and it is very cool xout !!!

I want to strikethrough an equation

\begin{equation*} 
\sout{f(x)=(x+a)(x+b)}
\end{equation*}

Hum hum not possible ...

\end{document}


Also in this section

  1. How to get dots in Latex \ldots,\cdots,\vdots and \ddots
  2. $L^1$, $L^2$, $L^p$ and $L^\infty$ spaces in Latex
  3. Horizontal and vertical curly Latex braces: \left\{,\right\},\underbrace{} and \overbrace{}
  4. How to display formulas inside a box or frame in Latex ? \boxed
  5. How to write a vector in Latex ? \vec,\overrightarrow
  6. How to write algorithm and pseudocode in Latex ?\usepackage{algorithm},\usepackage{algorithmic}
  7. How to write angle in latex langle, rangle, wedge, angle, measuredangle, sphericalangle
  8. How to write matrices in Latex ? matrix, pmatrix, bmatrix, vmatrix, Vmatrix
  9. How to write number sets N Z D Q R C with Latex: \mathbb, amsfonts and \mathbf
  10. How to write table in Latex ? begin{tabular}...end{tabular}
  11. Latex absolute value
  12. Latex arrows
  13. Latex backslash symbol
  14. Latex binomial coefficient
  15. Latex bra ket notation
  16. Latex ceiling function
  17. Latex complex numbers
  18. Latex congruent symbol
  19. Latex convolution symbol
  20. Latex copyright, trademark, registered symbols
  21. Latex degree symbol
  22. LateX Derivatives, Limits, Sums, Products and Integrals
  23. Latex empty set
  24. Latex euro symbol
  25. Latex expected value symbol - expectation
  26. Latex floor function
  27. Latex gradient symbol
  28. Latex hat symbol - wide hat symbol
  29. Latex horizontal space: qquad,hspace, thinspace,enspace
  30. Latex how to hide page number
  31. Latex how to insert a blank or empty page with or without numbering \thispagestyle,\newpage,\usepackage{afterpage}
  32. Latex how to write a fraction
  33. Latex how to write bar
  34. Latex how to write percent
  35. Latex how to write text in math mode
  36. Latex how to write underscore
  37. Latex imaginary part symbol
  38. Latex indicator function
  39. Latex infinity symbol
  40. Latex jacobian symbol
  41. Latex natural numbers
  42. Latex normal distribution symbol
  43. Latex not parallel symbol
  44. Latex not subset symbol
  45. Latex numbering equations
  46. Latex orthogonal symbol - Latex perpendicular symbol
  47. Latex overset and underset
  48. Latex parallel symbol
  49. Latex piecewise function
  50. Latex plus or minus symbol
  51. Latex product symbol
  52. Latex quaternion numbers
  53. Latex rational numbers
  54. Latex real numbers
  55. Latex real part symbol
  56. Latex square root symbol
  57. Latex subset symbol
  58. Latex symbol average
  59. Latex symbol belongs to
  60. Latex symbol checkmark
  61. Latex symbol different
  62. Latex symbol exists
  63. Latex symbol for all x
  64. Latex symbol if and only if / equivalence
  65. Latex symbol multiply
  66. Latex symbol norm for vector and sum
  67. Latex symbol not equal
  68. Latex symbol not exists
  69. Latex symbol not in
  70. LaTex symbol partial derivative
  71. Latex symbol Planck constant h
  72. Latex symbol there exists one and only one
  73. Latex tensor product
  74. Latex yen symbol
  75. Strikethrough - strike out text or formula in LaTeX