# MathML support for strikethrough

Some MathML / MathJax sites have support for strikethrough enabled:

     MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var TEX = MathJax.InputJax.TeX;
var MML = MathJax.ElementJax.mml;
TEX.Definitions.macros.cancel  =  ["myCancel",MML.NOTATION.UPDIAGONALSTRIKE];
TEX.Definitions.macros.bcancel =  ["myCancel",MML.NOTATION.DOWNDIAGONALSTRIKE];
TEX.Parse.Augment({
myCancel: function (name,notation) {
var mml = this.ParseArg(name);
this.Push(MML.menclose(mml).With({notation:notation}));
}
});
});


This code enables the use of \cancel and \bcancel respectively. These macros don't seem to work on our site:

$\cancel{(2 + 2)}$

Since some of our answers deal with derivations, having the ability to do a strikethrough may help with translating written derivations into electronic format.

There is a \not function, but it strikes through only a single character (not an expression).

• – endolith Jan 23 '13 at 19:29
• The code example I posted enables \cancel and \bcancel on the server-side. When I tried to use those tags on this SE site, they didn't work. (Question updated with these details) – Adam Lawrence Jan 23 '13 at 20:26

You no longer need to add \cancel anc \bcancel yourself, as they are now part of the cancel extension that was made available as part of MathJax v2.0. If you are running your own site, you can include this in your TeX extensions:

MathJax.Hub.Config({
TeX: {extensions: ["cancel.js"]}
});


Otherwise, if you are using an SE site with MathJax that doesn't load this for you, use

\require{cancel}


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

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