I asked this question from Davide P. Cervone(developer of mathjax)
"i need to use \cancelto command on my page with mathjax. how can i get this facility in my site like this page http://anrg.usc.edu/~joonahn/www/index.php/Canceling_Terms_in_LaTeX_Math?"
His answer was this:
" You can get a diagonal strikethrough (i.e., \cancel) via a technique that I outline in


but there is no easy way to get a diagonal arrow for \cancelto. If a diagonal line that is not an arrow is OK, then you you could probably use superscripts with the \cancel macro from the link above to get your result. Something like

TeX: {Macros: {
cancelto: ["\\cancel{#2}^{\\raise.1em{#1}}",2]

should do it.
I don't know which file , i should apply this css , Davide P. Cervone guide me as following help:
I should have been clearer about where it goes. You should include it in the file that loads MathJax.js (the change to make the CSS into one file also makes the javascript into one file, so I can't tell you which one that is now, but it is the one that includes the definition for


It has a MathJax.Hub.Config call, and you should add the TeX section to that (making sure to have the proper commas between sections, and no extra one at the end). You should not, in general, modify the MathJax files themselves.
please guide me which file is correct position in drupal?
Thanks alot

#1 mathjax.cancel.js.zip1.49 KBjulou


julou’s picture

new1.49 KB

I managed to implement \cancel, but not to define custom macros…
I will spend more time on this soon (and on mathjax 1.1 upgrade) but have limited time right now.

This is not defined in css, but rather in init javascript files. You can replace mathjax.js by the attached file (unziped and renamed to mathjax.js).
If you want to use \cancelto, you can still add $\newcommand{\cancelto}[2]{\cancel{#2}^{\raise.1em{#1}}}$ at the beginning of the page. This is a dirty workaround as long as macro definition does not work.

In the future, it would be good to have a settings page allowing to override javascript configuration. This is a matter of time; vkareh said he was interested in implementing it…

julou’s picture

Status:Active» Fixed
m2jalali’s picture

Thank you julou,
Your solution cannot solve my problem.
I do this work "replace mathjax.js by the attached file (unziped and renamed to mathjax.js)."
does not show correct and does not work correct mathjax.
a link to a page that exhibits the problem

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

julou’s picture

Sorry for not answering… Apparently you switched to another latex module in the meantime…