2
$\begingroup$

If you are writing your own question, and you select 'answer your own question' and add any additional characters to the question box, the mathjax stops rendering, this is even the case on meta. Can this bug be fixed?

I.e. I click ask question. I write my question, I click 'answer your own question', I make any change to the question, and the mathjax un-renders in the display box and doesn't render again. If I uncheck 'answer your own question' is still doesn't fix this until I discard the question.

$\endgroup$
1
  • $\begingroup$ Hmmm seems to be behaving slightly differently now. I now believe perhaps it periodically renders the question body in order to decrease lag on slower computers, and actively renders the 'answer your own question' box. $\endgroup$ Commented Oct 28, 2015 at 5:29

1 Answer 1

3
$\begingroup$

I can speculate a little, but I think it is at least "informed" speculation based on some experimentation with the live preview code here.

This seems to be an idiosyncrasy with how MathJax is implemented on this site (and probably the other SE sites that use MathJax too). Essentially, only the last editor+preview pair that is created on a page will render the TeX that is typed into it. (Mostly - see comment.)

  1. When composing a new question, the main editor (where you type the question) and its preview are active on the page first, and they will render any TeX input.
  2. When you click the "Answer your own question" checkbox another editor+preview pair is created below it and hooked into MathJax. The new preview will render any TeX typed in this new editor.
  3. The first preview on the page will no longer render the TeX from its editor if you go back and change something.

This behavior occurs on question pages too (like this page you're on now, for instance):

  1. Type some TeX into the "Your Answer" box at the bottom of a question page.
  2. Scroll up and click the "edit" link on an existing answer, so that a new editor+preview pair is created.
  3. Scroll down and type some more into the "Your Answer" box.

It seems to me that there is only one path through which an editor+preview pair can be hooked into MathJax, and when a new editor+preview pair uses the path the old pair is disconnected.

I've tested some ways to get multiple editor+preview pairs running at once using the tech available to Math SE. The result, using a minor modification of SE's mathjax-editing.js file, can be seen here: Pagedown + MathJax example.

$\endgroup$
1
  • 1
    $\begingroup$ To address the comment under the question: There does seem to be some kind of delayed backup rendering of the TeX in the "dead" previews. I haven't looked into what part of the code does this and would be interested to see an informed answer regarding it. $\endgroup$ Commented Oct 28, 2015 at 7:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .