I am creating differential equation questions for uploading in Canvas via zip QTI. As you may think I write something like
\[ y'' + y = x+1 \]
in the body of the question. I tested the question in a HTML display and it was ok, BUT when I build a QTI file for Canvas and upload it, the formula was not correctly displayed.
A workaround is to replace y'' with \frac{d^2y}{dx^2} which displays correctly but simply y' would be preferred.
Interestingly, the issue only occurs when using Rnw exercises but not with Rmd exercises and when using the
pandoc-mathmlconverter (whilepandoc-mathjaxwould work correctly, for example). It can also be replicated usingexams2html()when using the following options that correspond to the setup used in Canvas:Luckily there is a simple workaround, namely in Rnw exercises use
y^{''}instead of they''that you would use in Rmd exercises. And then make sure you useconverter = "pandoc-mathml". See below for simple worked examples for the exercise files.R/LaTeX version:
diffeq.Rnw.R/Markdown version:
diffeq.Rmd.