5
\$\begingroup\$

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).

Thoughts / comments?

| |
\$\endgroup\$
3
\$\begingroup\$

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}

within your mathematics and that will load it for you. E.g.

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

gives

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

| |
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .