# MathJax supports on Xenforo

Discussion in 'XenForo Questions and Support' started by Andy.N, Jun 29, 2012.

1. ### Andy.NWell-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.

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 Andy.N likes this. 3. ### Andy.NWell-Known Member It works !!! I use \[ and$ and begin and end replacement.
Thanks Jake.

Somehow the SVG output does not work. If you go here, you will see the page loads the MathJax JS but it does not render SVG images. If you right click on the output under the formula on the first post and select Math Setting ->Math renderer to HTML-CSS, it will appear fine.

I thought SVG is supported by most browser. Our site logo is SVG and it displays fine. Is there anything we need to do on the bbcode [latex] to use for SVG?

Thanks again.

4. ### Jake BunceXenForo ModeratorStaff Member

Dunno.

Does that feature have support you can contact?

5. ### RobinHoodWell-Known Member

Did you get this sorted Andy?

6. ### Andy.NWell-Known Member

Yes I did get it to work using renderer HTML-CSS. The SVG renderer does not seem to work. Tested with Chrome.
I don't know why.
I can send you the link to test.

7. ### RobinHoodWell-Known Member

Ahh yeah, I just had a look, the svg option doesn't seem to work for me, it only partially displays. Looks good in HTML-CSS though, is there really an advantage of using the SVG renderer as isn't the HTML-CSS output still vector ?

10. ### RobinHoodWell-Known Member

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

11. ### Andy.NWell-Known Member

On my retina screens, SVG looks much sharper but on regular screens, CSS is fine.

12. ### RobinHoodWell-Known Member

Soo...just looking at their site. You can use the mathjax CDN to run this on a site without having to install in directly on your serve? Is that what you've done? I'd quite like to get this setup myself.

13. ### Andy.NWell-Known Member

There is nothing to install on your site. Put their CDN javascript on the js_head template, make a bbcode (I use [tex]) and use it.
Btw, what type of site you run? Why you need it?

14. ### RobinHoodWell-Known Member

Ahh brilliant, I'll give that a shot tomorrow. Do you provide your users with some sort of guide on how to create equations easily with it?

I'm working on launching a local education site shortly and some of the users will be mathematics and engineering students, so this could potentially be very useful to them.

15. ### Andy.NWell-Known Member

Jake Bunce and RobinHood like this.
16. ### RobinHoodWell-Known Member

Hi Andy, in your BB code media site what do you have in Match URLs and Embed HTML?

17. ### Andy.NWell-Known Member

It's a BBcode, not BB media site. You have to install custom BBCode manager. Here is my setting.

Dwi Guna and Jake Bunce like this.
18. ### RobinHoodWell-Known Member

Ahh right, I can only see BB Code Media Sites in my ACP - does your site this add on?

19. ### Andy.NWell-Known Member

yes

RobinHood likes this.
20. ### RobinHoodWell-Known Member

Did you check all of these boxes? I imagine the smilie one in particular could potentially cause issues?