17
$\begingroup$

I wanted to strike out a part of an answer which I wrote earlier here. I tried using <s> </s>. This helps in striking out the text but the last two equations are not struck out. For example,

<s> Striking out text </s> produces " Striking out text "

However, it fails to strike out in the math mode. For instance,

<s>Square of sum of two numbers is given by $(a+b)^2 = a^2 + 2ab + b^2$. Here is some text following the math mode.</s>

produces

Square of sum of two numbers is given by $(a+b)^2 = a^2 + 2ab + b^2$. Here is some text following the math mode.

How to strike out equations and other written stuff in math mode?

This occurs for both chrome (Version 19.0.1084.56) and firefox (Version 13.0 Mozilla Firefox for Ubuntu canonical - 1.0) on Ubuntu 12.04.

This also occurs for both chrome (Version 19.0.1084.56) and Safari (Version 5.1.7 (7534.57.2)) on Mac OSX 10.7.4.

Below is a picture of this question to indicate where it fails to strike the equation.

enter image description here

$\endgroup$
7
  • 1
    $\begingroup$ Related: tex.stackexchange.com/questions/23711/strikethrough-text $\endgroup$
    – Asaf Karagila Mod
    Commented Jun 19, 2012 at 22:53
  • $\begingroup$ What you did in this question works fine for me (Firefox 3.6.15 on Windows 7). Or did you want the superscripts to be stricken out individually? $\endgroup$ Commented Jun 20, 2012 at 0:41
  • $\begingroup$ @HenningMakholm Is the equation i.e. $(a+b)^2 = a^2 + 2ab + b^2$ struck off as well? If so, can you take a screenshort and post it as an answer? It is interesting that this works fine on windows. $\endgroup$
    – user17762
    Commented Jun 20, 2012 at 0:45
  • $\begingroup$ Chrome 20.0.1132.27 beta on OSX 10.6.8 produces the same result as your screenshot. $\endgroup$
    – Isaac
    Commented Jun 20, 2012 at 1:50
  • $\begingroup$ as a work around, since you are striking it out, perhaps you can just remove the dollar signs? $\endgroup$ Commented Jun 20, 2012 at 7:43
  • $\begingroup$ I've noticed something similar with tags, see here. But I don't consider it to be a real problem. $\endgroup$ Commented Jun 20, 2012 at 12:16
  • $\begingroup$ I will add that the MathJax tutorial on this meta has a separate entry called Crossing out things. $\endgroup$ Commented Mar 20, 2019 at 3:16

3 Answers 3

11
$\begingroup$

This is not a perfect solution, but it should act reasonably well as a work-around:

<s>Square of sum of two numbers is given by
</s>$\require{enclose}
     \enclose{horizontalstrike}{(a+b)^2 = a^2 + 2ab + b^2}$<s>.
Here is some text following the math mode.</s>

Square of sum of two numbers is given by $\require{enclose}\enclose{horizontalstrike}{(a+b)^2 = a^2 + 2ab + b^2}$. Here is some text following the math mode.

The \require{enclose} need only be done the first time (but it is not an error to include it multiple times).

$\endgroup$
6
$\begingroup$

At https://math.meta.stackexchange.com/a/8847/53259, Alexander Gruber helpfully offers some alternatives. For some reason, they work for me here at MSE Meta but NOT on MSE. On MSE, I've discovered that the following work, where I just use "\require{cancel}" instead of \require{...cancel}

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

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

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

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

$\endgroup$
3
$\begingroup$

It seems to work exactly as it should for me. Here's a screenshot:

Image of the above question with stricken equation

Firefox 3.6.15 on Windows 7.

$\endgroup$
6
  • $\begingroup$ Thanks. I never thought it would be an issue with the OS/browser. I have added my screenshot in the question. $\endgroup$
    – user17762
    Commented Jun 20, 2012 at 0:52
  • $\begingroup$ On the other hand, Chrome 19.0.1084.56 m (also Windows 7) does fail to strike the equation, with results comparable to the Ubunto screenshot in the question. $\endgroup$ Commented Jun 20, 2012 at 0:52
  • $\begingroup$ @Marvis: Rendering problems on the web are "almost always" (or at least more often than not) browser-specific. Sometimes also OS specific, primarily when the availability of system fonts plays a role. $\endgroup$ Commented Jun 20, 2012 at 0:55
  • $\begingroup$ And Firefox 13.0.1 on Windows also fails to strike out the equation. $\endgroup$ Commented Jun 20, 2012 at 4:23
  • $\begingroup$ This has never worked for me. I have gone through several upgrades of Firefox (currently at ver 12.0), and given up hope. Running on Win XP. $\endgroup$ Commented Jun 20, 2012 at 6:52
  • $\begingroup$ Firefox versions (roughly) 10 through 13 (on various OS) all fail to strike out the equation. I think it has more to do with the browser than with the OS. $\endgroup$ Commented Jun 20, 2012 at 7:42