# How to cross out mathematical expressions? [duplicate]

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

## marked as duplicate by hardmath, José Carlos Santos, Ak19, Shailesh, nmasantaAug 22 at 17:28

• See also: Striking out equations – Martin Mar 21 '13 at 17:46
• 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...) – user1729 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!) – user1729 Aug 21 at 9:00
• @user1729: I have cast the first stone... er, vote to close as duplicate! – hardmath Aug 22 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. – Martin Mar 21 '13 at 17:45
• Great! Thanks @Martin. – Alexander Gruber Mar 21 '13 at 17:49
• See the MathJax doc on enclose. (= MathML <menclose>) – Math Gems Mar 21 '13 at 18:10
• Thanks for sharing us the codes Alexander. :) – mrs Jul 22 '13 at 17:17
• or raising or lowering overline or underline. – Roddy MacPhee Aug 21 at 23:43