Learn More

Saturday, June 29, 2013

Write Equation With MathJax In Web Or Blog Platform

Thanks to http://web.math.princeton.edu
Write equations in web or blog platform is not easy for several people. It is need advance in code for writing an equation with HTML. If you are a scientist, teacher of math or physics or chemistry, then this tutorial will help you to make equations become easy in web or blog platform. So, this tutorial is not only valid in Blogger, but also valid in Joomla, Drupal, Wordpress, etc. With mathjax and latex, now you can write equation on your web or blog.

A teacher of math or physics or chemistry, or scientist are can't separately by equations. When they report a progress of research or teach something, they often write equations to explain something. If they report it with microsoft word or similar, then writing equation is not difficult. However, when they report it with web or blog based on HTML format, then only several people can do that.

So, we think, this tutorial will help you how to make an equation(s) on web or blog. Now, go to the point.


1. Put MathJax Script On Your Web or Blog

The first time before you write equation on your blog or web, you must put the following code between <head> and </head>

<script
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
type="text/javascript">
</script>

If you are using Joomla, you can put the code above in index.php file inside template directory. If you are using blogger, then go to your Template tab, then click Edit HTML.

2. Use Latex, then put your latex code below

The next step is using Latex, actually there are another way to write equation instead using latex. You can read more information what type of platform that support with MathJax. However, we like to use latex. If you like the other, then use it... make it simple based on your ability.


\(\begin{equation}
your-latex-code-here;
\end{equation}\)

What you should to do is, put the code above between <body> and </body>. Then, change your-latex-code-here with your latex code.


Akhhhhhh... I don't know about Latex... Help...????

Don't worry... if you are not familiar with latex, you can use online latex generator. I recommend you to use hostmath online generator. Because this site give real time typing of math. As example, let say we want to make an equation like below
integral equation with latex preview

by using hostmath, you will get the following code

\int_{a}^{b} \frac{\cot\left(x\right)}{\sin\left(\tan\left(x\right)\right)}dx

change your-latex-code-here with the latex code above... so complete latex code is as follow

\(\begin{equation}
\int_{a}^{b} \frac{\cot\left(x\right)}{\sin\left(\tan\left(x\right)\right)}dx
\end{equation}\)

See the example demo below

\(\begin{equation}
\int_{a}^{b} \frac{\cot\left(x\right)}{\sin\left(\tan\left(x\right)\right)}dx
\end{equation}\)

Ok, done. Now, your equation is work on your web or blog.

Post a Comment