Okay, so I ended up making a custom binding for knockout. I'm using jquery here, too:
ko.bindingHandlers.mathjax = {
update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
// This will be called once when the binding is first applied to an element,
// and again whenever the associated observable changes value.
// Update the DOM element based on the supplied values here.
var value = valueAccessor(), allBindings = allBindingsAccessor();
var valueUnwrapped = ko.unwrap(value);
// the replace is an artefact of my encoding. Maybe I will use markdown instead.
$(element).html(valueUnwrapped.replace(/\n/g, '<br>'));
MathJax.Hub.Queue(["Typeset",MathJax.Hub,element]);
}
};
The ViewModel remains the same, and the html template is:
<div data-bind="mathjax: content.back"></div>
Hopefully this will help somebody else!