Skip to main content

Rendering LaTeX in Blogger.

Rendering LaTeX in Blogger is pretty easy thanks to the JavaScript LaTeX equation render engine from http://www.yourequations.com.
To enable LaTeX rendering go to the Blogger Dashboard --> Layout --> Edit HTML . Then add the line
<script> type="text/javascript" src="http://tex.yourequations.com/"></script>
<script type="text/javascript" src="http://tex.yourequations.com/"></script>
just before <body/>
. Half the job is now done.
Then, for example to render:
\int_{0}^{\pi}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx =\frac{22}{7}-\pi
Use the code:
<pre lang="eq.latex">
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx
=\frac{22}{7}-\pi
</pre>

The LaTeX code will now be displayed as:
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx=\frac{22}{7}-\pi

Ofcourse Javascript needs to be enabled in the Browser for the renderer to work.

Comments

Daniel Hawkins said…
Perfect! Other solutions made conversions to MathML, which is just ugly. Thanks for the great info.
HieuDC said…
Thank you so much for your tip. However, your code has a typo (I could not post the whole code as it is not allow to have tag inside comment), therefore the equation could not come out as expected.

The code in http://www.yourequations.com/ is correct. Could you correct it for the other?
Anonymous said…
Thank you HieuDC for pointing out the typo. I apologize for the mistake, I have corrected it now.
ardyanovich said…
Thanks, dude! Do you know of any other websites that do this kind of stuff, you know, in case yourequations.com shuts down?
Anonymous said…
Hi, I have another solution to write latex on Blogger. It is based on mathtex.
It can write latex symbol by just putting latex code inside two dollar signs.
Check out my article here: http://watchmath.com/vlog/?p=438
Andreas Grech said…
I have recently developed a jQuery plugin that allows you to easily add LaTeX to your website easily, given an equation.

It’s called jsLaTeX and you can download it from here: http://knowledge-aholic.blogspot.com/2009/12/jslatex-jquery-plugin-to-directly-embed.html

The plugin also allows you to change the default engine it uses to render the equation.
Swagat said…
Thank you for the tip. This worked for me.
Anonymous said…
It's not getting rendered (at least not in chrome 6.0.472.62 and firefox 4.0. Is the script still there at http://tex.yourequations.com?

Popular posts from this blog

Force an application to use VPN, using iptables in Linux

Enforcing an application, for example a torrent client like Transmission , to always use the VPN interface or any particular network interface for that matter, is trivially simple using iptables on Debian, Ubuntu or any other GNU/Linux distro. Personally, I am running Debian Sid on the Raspberry Pi . Occasionally I use it for downloading files ( legal stuff, seriously, believe me :D  ) using Transmission Bittorrent client over a VPN connection. Sometimes it happens that the VPN connection fails and doesn't reconnect for whatever reason and Transmission continues pulling stuff directly over my internet connection, which I would like to avoid. Fortunately it is very straightforward to enforce rules based on application owner UID. Transmission runs under the owner debian-transmission in Debian (use htop to check this) and the following two lines of iptables ensures that any process with owner having UID, debian-transmission , will not use any other network interface apart from the...

Changing the favicon for your blog

People who are not happy with the Orange and White Blogger favicon, can use their own instead. First create a 48 X 48 px image using Gimp or whatever software you prefer. Save the image as a .ico file, say myicon.ico . Upload the image to some webhost like Google Pages or Geocities (Picasa WebAlbum doesn't accept .ico files). Next go to your Blogger DashBoard --> Layout --> Edit HTML. Locate the line <head> After the line insert the code- <link href="http://imagelocation/myicon.ico" rel="icon"> . Replace http://imagelocation with your webhost's address. Save the template. The job is done. Refresh your Blog page, your own icon will appear instead of Blogger's.