0

The title says it all. I've got \cancel working fine in my org-mode Latex export, but org-mode HTML export doesn't know about, render \cancel. Basically I need to strike through something in a math formula, like I'm "canceling out" a factor. Someone suggested MathJax is the problem, i.e., MathJax doesn't know about \cancel.

#+LATEX_HEADER: \usepackage[makeroom]{cancel}
...
\[
\frac{1}{(2^3)(5)} + \frac{1}{3^4} + \frac{1}{\cancel{(2^2)}(23)}
\]

What can a poor org-mode beginner do?

closed as off-topic by ChrisS, Svend Tveskæg, moewe, user13907, egreg Oct 9 '15 at 10:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – ChrisS, Svend Tveskæg, moewe, Community, egreg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    mathjax is off-topic here – user31729 Oct 8 '15 at 13:15
2

Off-topic or no, this is what I finally found, i.e., put this code somewhere at the top of your org-mode file:

#+begin_html
<script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: {extensions: ["cancel.js"]},
        tex2jax: {
          inlineMath: [ ['$','$'], ['\\(','\\)'] ],
          processEscapes: true
        }
      });
    </script>
#+end_html

...and \cancel can be used just fine in an HTML export. Also, this

(setq org-html-mathjax-template (concat org-html-mathjax-template "
<script type=\"text/x-mathjax-config\">
MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () {
  MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
    cancel: [\"Extension\",\"cancel\"],
    bcancel: [\"Extension\",\"cancel\"],
    xcancel: [\"Extension\",\"cancel\"],
    cancelto: [\"Extension\",\"cancel\"]
  });
});
</script>
"))

can be added to your Emacs init to get the same effect.

Not the answer you're looking for? Browse other questions tagged or ask your own question.