I want to use \cancel{·} in mathjax. with a crossed line of different color, explained here.
I use
\[
enter code here
\require{xcolor}
\require{cancel}
\renewcommand\CancelColor{\color{red}}
\cancel{x^2}
\]
But is not working. Any ideas?
I want to use \cancel{·} in mathjax. with a crossed line of different color, explained here.
I use
\[
enter code here
\require{xcolor}
\require{cancel}
\renewcommand\CancelColor{\color{red}}
\cancel{x^2}
\]
But is not working. Any ideas?
You could use
\newcommand\ccancel[2][black]{\color{#1}{\cancel{\color{black}{#2}}}}
so that
\ccancel[red]{x}
would use a red slash through a black x.
\color as a substitute for \textcolor. It should be changed. Maybe too late, but if you want to imagine interchangeable code for MathJax and LaTeX, this is a stopping.
– egreg
Mar 01 '18 at 14:24
\textcolor, but the interchangeability is not important this time. Brilliant
– manolius
Mar 01 '18 at 15:42
color extension gets you a more LaTeX-compatible version of \color that includes \textcolor and several other macros, and makes \color act like a switch rather than taking an argument for what to color. You can include it in a MathJax configuration if you are managing your own page, or use \require{color} to load it if not. There is unfortunate history (and ignorance on my part) behind this use of \color.
– Davide Cervone
Mar 01 '18 at 18:15