I'm trying to render mathematics in a dynamically-created bootstrap popover using Mathjax. I have created a jsfiddle at http://jsfiddle.net/8JcpW/6/
If you click the "Click to run Mathjax", the static div renders correctly, however if you click the "click to create popover, the popover is created and opened with the math written as latex. I would assume that clicking the Mathjax button again should rerender all mathematics on the page, in that the code:
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
should do this. (See MathJax Docs for this.)
I've seen some other people have trouble with this, but it appears mainly because they try to render the math before showing the popover.
The problem is that the backslashes are all doubled. Note that your popover shows \\[\\frac{3}{4}\\]
rather than \[\frac{3}{4}\]
. You do not need to double the backslashes in the data-content
attribute, since that is not a JavaScript string. You will also want to do the MathJax.Hub.Queue(["Typeset",MathJax.Hub])
command after creating the popover, since the data for it is not in the page until the popover is created.