15
$\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$
  • 1
    $\begingroup$ Related: tex.stackexchange.com/questions/23711/strikethrough-text $\endgroup$ – Asaf Karagila Jun 19 '12 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$ – Henning Makholm Jun 20 '12 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 Jun 20 '12 at 0:45
  • $\begingroup$ Chrome 20.0.1132.27 beta on OSX 10.6.8 produces the same result as your screenshot. $\endgroup$ – Isaac Jun 20 '12 at 1:50
  • $\begingroup$ as a work around, since you are striking it out, perhaps you can just remove the dollar signs? $\endgroup$ – Willie Wong Jun 20 '12 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$ – Martin Sleziak Jun 20 '12 at 12:16
  • $\begingroup$ I will add that the MathJax tutorial on this meta has a separate entry called Crossing out things. $\endgroup$ – Martin Sleziak Mar 20 at 3:16
9
$\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$
5
$\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$
2
$\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$
  • $\begingroup$ Thanks. I never thought it would be an issue with the OS/browser. I have added my screenshot in the question. $\endgroup$ – user17762 Jun 20 '12 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$ – Henning Makholm Jun 20 '12 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$ – Henning Makholm Jun 20 '12 at 0:55
  • $\begingroup$ And Firefox 13.0.1 on Windows also fails to strike out the equation. $\endgroup$ – Arturo Magidin Jun 20 '12 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$ – Jyrki Lahtonen Jun 20 '12 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$ – Willie Wong Jun 20 '12 at 7:42

You must log in to answer this question.