# How to cross out mathematical expressions? [duplicate]

How can I cross out a mathematical expression with a horizontal line? Thanks.

• I am slightly confused as to why this was closed as "off topic", and I am listed as one of the closers. I voted to close it because it is a duplicate! (And if this is off topic then so is the original, so I think we are having double-standards...) Mar 27 '13 at 9:40
• @hardmath I have already voted to close it, so cannot vote again. (But I agree, as that was what my original vote was trying to do!) Aug 21 '19 at 9:00
• @user1729: I have cast the first stone... er, vote to close as duplicate! Aug 22 '19 at 4:31

In text environment you can use <strike> </strike>, for example: strike.

In math environment, you can cross out expressions using cancel bcancel xcancel or cancelto as long as you require them first.

$\require{cancel} \cancel{2-2}$ $\require{cancel} \cancel{2-2}$

$\require{bcancel} \bcancel{2-2}$ $\require{bcancel} \bcancel{2-2}$

$\require{xcancel} \xcancel{2-2}$ $\require{xcancel} \xcancel{2-2}$

$\require{cancelto} \cancelto{0}{2-2}$ $\require{cancelto} \cancelto{0}{2-2}$

As far as I know there is no perfect execution of horizontal strike-through in math environment. You can try to do it using css, with \style{text-decoration:line-through}{...}. This works fine sometimes $$\style{text-decoration:line-through}{abcd\sum\prod\bigotimes}$$ but it messes up with subscripts and superscripts and fractions $$\style{text-decoration:line-through}{\sum_{i=0}^n\left(x_iy^i\frac{z}{u}\right)}$$ I hope someone knows of a more reliable way to do horizontal strike-through in math environment, but I think this may be it.

• In a similar question Davide Cervone suggests using $\require{enclose} \enclose{horizontalstrike}{(a+b)^2 = a^2 + 2ab + b^2}$ which produces horizontal strike-throughs. Mar 21 '13 at 17:45
• Great! Thanks @Martin.
– Alexander Gruber Mod
Mar 21 '13 at 17:49
• See the MathJax doc on enclose. (= MathML <menclose>) Mar 21 '13 at 18:10
• Thanks for sharing us the codes Alexander. :) Jul 22 '13 at 17:17
• or raising or lowering overline or underline.
– user645636
Aug 21 '19 at 23:43