MathJax supports on Xenforo

Andy.N

Well-known member
I'm trying to get MathJax to work on XF
http://www.mathjax.org/docs/2.0/start.html

So, according to the doc, I'm adding this script to the page_container_js_head template
Code:
<script type="text/javascript"
  src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG">
</script>
I'm using TeX-AMS-MML_SVG because I want to use the SVG output engine so that the formula will scale.

Now, I'm not sure what to do next. Do I put the math equation between $$ .... $$ or \[ ... \]?
I tried that and nothing happens.

I currently have a bbcode [tex] that connect to a cgi script that produces png images for the formula. How can I modify this [tex] bbcode to use the new MathJax script.

Thank you.
 
Wohoo! It's working! :D

Thanks for your help Andy!

Do you find that when using the quick reply box and submitting a post you have to refresh the page for the math to render?
 
Wohoo! It's working! :D

Thanks for your help Andy!

Do you find that when using the quick reply box and submitting a post you have to refresh the page for the math to render?
I think this is getting to be a big downfall as it may take a second or two for the mathjax to fully load so I'm going to remove mathjax and fallback to the mathtex server that I run locally.
It will produce png images. Don't know if we can set it so that it can be optimized for retina screens.
 
You would have to edit the replacement for the BB code to include those $$ or \[ delimiters. If it's a media site then the replacement can be edited in your:

Admin CP -> Home -> BB Code Media Sites
Is it possible to make bbcode that will not include []. So instead of using [tex], I like to use less characters so that it's faster to type.

I'm thinking \( x \)
\[ x \]
$$ x $$
 
Wohoo! It's working! :D

Thanks for your help Andy!

Do you find that when using the quick reply box and submitting a post you have to refresh the page for the math to render?
No such option.
Jake,
It seems like Mathjax has a page with information on how to solve this problem, that is when someone inline-edits a post using ajax (such as Xenforo). I have no idea what I have to do to get quick reply, edit to load mathjax again. Can you please take a look and tell us the direction to go? Thanks a lot
http://www.mathjax.org/docs/1.1/typeset.html
 
Dunno. :(

Does that feature have support you can contact?
Jake,
Just found out about this one that add svg support :)
http://mathcache.appspot.com/static/docs.html

I don't think the script they use will work on Xenforo because it will need change document body?
Code:
<script type="text/javascript" src="http://mathcache.s3.amazonaws.com/replacemath.js"></script>
<script type="text/javascript">
replaceMath( document.body );
</script>
 
Dunno. :(

Does that feature have support you can contact?
Hmm..yeah it doesn't render in SVG for me on your site in Chrome of FF. It's not because it's an old thread and the code is slightly different perhaps?

It works for me on the mathjax link you posted. The SVG text looks like a bold version of the css version. I'm not sure if it's an illusion due to the bolding, but the css version looks way sharper to me on my 2560x1440px screen
Latest version 2.1 seems to make a huge difference.
SVG now works.
 
How did you guys get this working? Did you install MathJax on your server, and then add the BBcode as mentioned in post #17 of this thread, or did you use the CDN using the script in this first post and add it in the embed HTML section of the custom BBcode? Any further details would be appreciated. Thanks.
 
Back
Top Bottom