# 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.

#### Jake Bunce

Staff member
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 ##### Well-known member 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 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.

#### Jake Bunce

##### XenForo moderator
Staff member
Is there anything we need to do on the bbcode [latex] to use for SVG?
Dunno.

Does that feature have support you can contact?

#### RobinHood

##### Well-known member
Did you get this sorted Andy?

#### Andy.N

##### Well-known member
Did you get this sorted Andy?
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.

#### RobinHood

##### Well-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 ?

#### RobinHood

##### Well-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

#### Andy.N

##### Well-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
On my retina screens, SVG looks much sharper but on regular screens, CSS is fine.

#### RobinHood

##### Well-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.

#### Andy.N

##### Well-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?

#### RobinHood

##### Well-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.

#### RobinHood

##### Well-known member
Hi Andy, in your BB code media site what do you have in Match URLs and Embed HTML?

#### RobinHood

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

#### RobinHood

##### Well-known member
Did you check all of these boxes? I imagine the smilie one in particular could potentially cause issues?