WeBWorK Main Forum

MathJax3 extensions

MathJax3 extensions

by Alex Jordan -
Number of replies: 3

I am working with the nascent 2.16 version of WeBWorK, which uses MathJax3. What is the "right" way (if one currently exists) to use MathJax extensions globally? For example, the "color" extension, or the "cancel" extension? (These are the two I would like to use.)

There is a list of extensions here: http://docs.mathjax.org/en/latest/input/tex/extensions/index.html

In reply to Alex Jordan

Re: MathJax3 extensions

by Alex Jordan -

I found it: htdocs/js/apps/MathJaxConfig

In reply to Alex Jordan

Re: MathJax3 extensions

by Robin Cruz -
I used "cancel" in writing a solution for simplifying a rational expression. It looks fine on the screen, but produced an error in the hardcopy of the problem set and did not showthe cancel symbols on the hardcopy. Is there a way to fix this? I've included a code snippit below.

Thanks--rac

DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl"
);
$a= non_zero_random(-4,4,1);
do {$b= non_zero_random(-5,5,1);} while ($a==$b);
$f = Formula("(x^2 + ($a + $b)x + $a*$b)/(x + $a)")->reduce->TeX;

BEGIN_PGML
In this problem
[```\require{cancel} \begin{align*} [$f] &= \frac{(x + [$a])(x + [$b])}{x+[$a]} \\ &= \frac{\cancel{(x + [$a])} (x + [$b]) }{\cancel{(x + [$a])}}\\ &= x + [$b] \end{align*} ```]
END_PGML
ENDDOCUMENT();
In reply to Robin Cruz

Re: MathJax3 extensions

by Danny Glin -

You can check the latex log files from your hardcopy generation, but most likely this is a result of the cancel package not being installed on the server.  If you have server access you should be able to add LaTeX packages, but be aware that this will mean that any problems that use these may have issues if run on a different WeBWorK server.