Hi everyone,
I’m working on a project that lets me (and other teachers) write randomized questions to use with students for both practice and assessment. I’m using the simple:katex project from @sashko to use the Khan Academy KaTEX library to do the rendering of the math. The idea is that the questions are formatted in HTML, with tags around any text that should be formatted as math.
Part of making this useful is letting teachers preview what the questions will look like. This is always a trial and error process. Unfortunately, I’m having trouble making the KaTEX render reactively as the text in the question HTML changes.
I’ve put together a Meteorpad to show the problem I’m having here:
MeteorPad EquationsRender
I want to be able to change the text in the textarea, hit the ‘Show Rendered’ button, and have the new text between the tags be rendered using KaTEX. Right now, clicking the button changes the text in the rendered area, but the tags are not re-rendered.
I’m pretty sure this is a job for an Autorun function, but nothing I’ve tried thus far works. I realize that one solution is to just put {{#katex}} block helpers around the result helper, but I don’t want to render all of the text using the Katex rendering for aesthetic reasons.
Anyone up for giving a teacher a hand?