How can I cross out a mathematical expression with a horizontal line? Thanks.
-
$\begingroup$ See also: Striking out equations $\endgroup$– MartinCommented Mar 21, 2013 at 17:46
-
2$\begingroup$ 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...) $\endgroup$– user1729Commented Mar 27, 2013 at 9:40
-
$\begingroup$ @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!) $\endgroup$– user1729Commented Aug 21, 2019 at 9:00
-
1$\begingroup$ @user1729: I have cast the first stone... er, vote to close as duplicate! $\endgroup$– hardmathCommented Aug 22, 2019 at 4:31
1 Answer
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.
-
7$\begingroup$ 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. $\endgroup$– MartinCommented Mar 21, 2013 at 17:45 -
$\begingroup$ Great! Thanks @Martin. $\endgroup$– Alexander Gruber ModCommented Mar 21, 2013 at 17:49
-
$\begingroup$ See the MathJax doc on enclose. (= MathML <menclose>) $\endgroup$ Commented Mar 21, 2013 at 18:10
-
$\begingroup$ Thanks for sharing us the codes Alexander. :) $\endgroup$– MikasaCommented Jul 22, 2013 at 17:17
-
$\begingroup$ or raising or lowering overline or underline. $\endgroup$– user645636Commented Aug 21, 2019 at 23:43