7
$\begingroup$

If I click the "show N more comments" link (in any question or answer with more than 5 (?) comments), my Firefox displays the comments without MathJax rendering.

I can easily guess why this happens, but has anyone found a way to show all comments with properly rendered Latex math?

| |
$\endgroup$
  • 4
    $\begingroup$ This would be fixed if we could get a little button that reads "(Re)process math with jsMath" like on MO. Does anyone know how they got that? $\endgroup$ – Robin Kothari Sep 12 '10 at 15:37
  • $\begingroup$ Well, I don't really want to reprocess the document with jsMath; instead, I'd like to force MathJax to reprocess the document. $\endgroup$ – Jukka Suomela Sep 12 '10 at 17:52
  • $\begingroup$ Sorry, I just meant a button that read "Reprocess math." The idea is that one could click on it if math is not processed correctly for some reason. $\endgroup$ – Robin Kothari Sep 13 '10 at 0:03
  • $\begingroup$ Should be easy to implement (using the piece of javascript below) if we can add new links to the navigation bar. $\endgroup$ – Jukka Suomela Sep 13 '10 at 8:36
  • $\begingroup$ What has been provided so far is workarounds, not solutions. That math mode is lost is probably (certainly, imho) a bug. Also, it should be no problem to reprocess the math for one comment thread when it is expanded; the expanding is done with JavaScript, anyway. Add one statement there, done. Who is responsible for the technical aspects here? $\endgroup$ – Raphael Nov 10 '10 at 14:50
3
$\begingroup$

We have wired up the comment system to the MathJax rendering pipeline.

| |
$\endgroup$
8
$\begingroup$

After some random browsing, online chatting, and trial-and-error (thanks to all for help!), I came up with the following trick that seems to work with Firefox (warning: I don't really know anything about JavaScript or MathJax or Firefox):

  • Create a bookmark with the following URL:

    javascript:MathJax.Hub.Queue(["Typeset",MathJax.Hub]);undefined
    

(You might want to add it to your bookmark toolbar or assign a keyword for easier access.)

Now open an article, click "show N more comments", and then activate the above bookmark. MathJax re-processes all math in the comments.

Edit: Fixed; now it should work by design, not by accident. I hope. I'll CW this so that people who actually understand these things can provide a real solution.

$\endgroup$
  • $\begingroup$ Works like a charm, with Firefox 3.6. Thanks! $\endgroup$ – Tsuyoshi Ito Sep 12 '10 at 20:42
  • 2
    $\begingroup$ Looks like a decent solution to me. For those who care, the first part instructs mathJax to typeset the page, but it queues the action, so it'll take place as soon as MathJax is not busy. (To force MathJax to typeset NOW, use "javascript:MathJax.Hub.Typeset();undefined"). The undefined at the end is a technical thing. Statements in the address bar should evaluate to undefined to stay on the same page. "void 0" also works. $\endgroup$ – Robin Kothari Sep 12 '10 at 23:53
2
$\begingroup$

(Part of this answer had been previously posted as a comment, but I decided to move it to an answer with additional information about user scripts.)

The same issue has been raised also on meta.math.stackexchange.com: TeX formatting in other comments in the same post is lost when the comment list is updated.

On that page, KennyTM posted a user script as a workaround (great!). I posted there a modified version of it which should be safer in principle in case *.stackexchange.com be cracked. To use a user script with Firefox, you need the add-on Greasemonkey.

| |
$\endgroup$

You must log in to answer this question.

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