How To Install Latex On Blogger/Blogspot
The mathtex server is down. Change mathtex2.js on the script into mathtex3.js.
Mathtex3.js using the mathtex server of John Forkosh.
There were some people who moved from Blogger to Wordpress because the later has a capability to render math formula/equation/symbols by using LaTeX syntax. I also observed that there are many math Blogger who faithfully stay with Blogger. I believe that given the some capability to write math formula as in Wordpress will give more power to the blogger to express their idea and also to make the reader easier to grasp the ide on their article. Besides that of course having latex on your blog make your blog more beautiful
. Ok without further ado here are the steps to enable latex on your blogger (thanks to John Forkosh for his mathtex public server and thanks to Randall Farmer for his replacemath javascript)
- Copy the following javascript code:
<script src="http://www.watchmath.com/cgi-bin/mathtex3.js" type="text/javascript"></script> <script type="text/javascript"> replaceMath( document.body );</script> <a href="http://www.watchmath.com"> <img src="http://www.watchmath.com/images/formula.png" alt="" width="100" /></a> <a href="http://watchmath.com/vlog/?p=438"> Math Formula?</a>
- Go to your Blogger dashboard and select layout

- Click Add a Gadget on your right sidebar (or left depending on your tempate) and add HTML/Javascript onto your sidebar

- Leave out the title and past the javascript that you copied in step 1 right into the content and then save

- Thats it! You are done. Now you can type your latex code between two dollar signs to get the inline style math symbols or write it as or
to get a display style math symbols (just play around to see their differences)
There are some notes regarding the above installation:
The javascript above will also produce on on your sidebar a logo an a link to this very post. The idea is that if a visitor of your blog also wants to install latex on her blog then she can follow the link to this post. The logo will look like this
If you don’t like it you can remove it by deleting this part:
<a href="http://www.watchmath.com"> <img src="http://www.watchmath.com/images/formula.png" alt="" width="100" /></a> <a href="http://watchmath.com/vlog/?p=438"> Math Formula?</a>
from the javascript code on step 1.
29 Responses to “How To Install Latex On Blogger/Blogspot”
-
[...] Want to post math equations on Blogger/Blogspot like you’ve seen on WordPress? WatchMath has a solution. [...]
-
[...] the instruction here, but in step one copy and use instead the following script. <script [...]
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=a2e12a8c-33ce-4537-a01b-f068b57a0816)
Cool, very cool. And the amount of LaTeX commands available exceeds that of Wordpress. Not enough though to have me undo my migration to Wordpress from Blogspot: the biggest problem with math in Blogspot is not rendering LaTeX (there already exist other options, although this one probably exceeds them in functionality), but fear that the public servers be shut down, and months or years of writing then need to be redone….
Well, actually in wordpress you also use latex public server which can be shut down too
(but maybe wordpress will still live for a good number of years). There is nothing really save here. Also even you use self hosted wordpress and cache every single latex image (as in this blog) will you pay the hosting forever?
I have a list of 10 maththex public server so that if one has a problem you can switch it to another one. Still not good enough?
Actually you can use wordpress.com latex server in this script too. But of course with less of flexibility compare to mathtex server.
How to input $ sign?
Use ${\latexcode}$ or \[{\latexcode}\] to display latex source code use $!$ to write one single $ notation
$ works fine. But I can not fully understand $\latexcode$ mean, does it simply mean input bracket {}?
I input $\sum_{i=1}^n x_i$ in my blog test, it still shows the picture of the equation not the code.
(http://reico-go.blogspot.com/2009/08/how-to-display-latex-code-in-blog-using.html)
Yes, you just simply put bracket around your latex expression like what you did here in the comment.
BTW, it seems the comment in your blog is not working. I can’t write comment on your blog.
Hello, you can also use my site to display math formulas :
http://www.openmaths.org/cgi-bin/mathtex.cgi?YOUR_MATH_FORMULA
for example
http://www.openmaths.org/cgi-bin/mathtex.cgi?(a+b)^2=a^2+2ab+b^2
All LaTeX commands are accepted.
In your xhtml pages, use the following tag:
You can use it everywhere, not only in Blogger or Wordpress : )
Bye (if you could register to the forum… ^^)
olomorph
This will be very useful indeed, but I can’t get inline maths to display correctly. In case it is relevant, I am using IE8.
In my test posting on http://constructionsitespl.blogspot.com/2009/08/test-replacemath.html the E = m c^2 equation appears on a separate line.
The source text I used was:
Here is an inline equation –
– which should be just what it says on the tin, i.e. inline, but seems not to be so.
… but my inline equation is displayed correctly inline in my comment on your blog …
Hi,
I couldn’t read your blog. It seems your blog is a private blog.
Sorry about that. I have now set http://constructionsitespl.blogspot.com/ to be public.
That is a css issue. Edit your html and locate the following:
img {
border:0 none;
display:block;
}
and then delete the “display:block;” part.
Hi! This is very useful, thanks.
But I’d like to have my equations a bit larger, without having to add \large every time. How could I do?
Cheers,
Maxime.
And more generally, where can I put my preamble commands etc?
Cheers!
Hi, see the new intallation procedure here: http://watchmath.com/vlog/?p=1244
Why I can’t install in my blog. I have done step by step as your guide
I made some modifications to your script and am using it on blogger. I adjusted the image margins so they fit better. I also made it so I can type LaTeX as \( latex stuff \) since using $ latex stuff $ is supposed to be deprecated.
http://www.justinjstark.com/mathtex/mathtex3.js
Hi, thanks for letting me know about your modification. Can you provide me with your blogger link so I can take a look how the modification works?
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.
Hi, that a nice code.
Unfortunately at least for me it will be to much work to write
every time we need to write math notation. Also I want the way we write latex on blog to be the same as the way we write latex in a notepad.By the way I didn’t see any example of latex in inline mode on your blog. Does it work for inline mode too?
Hi there!
First of all thanks for a superb script. But some formulas don’t parse right on my blog: http://physicsfromthebottomup.blogspot.com/
Do you have any idea why this is so?
Thanks again!
Hi, thank you for using the script.
I visited your blog but I am not sure which symbols/formulas that don’t parse correctly.
Hi again!
http://physicsfromthebottomup.blogspot.com/2010/01/some-solved-exercises.html
Was the post I was having problems with but they were partially solved when I changed from the old script to the new script.
What happened was that some formulas didn’t parse at all. They kept showing with the dollar signs. Now this doesn’t happen but I do have a formula that shows a symbol I didn’t input:
The second step in the train of equations that precede the following text. “Where the last equality follows from the previous result” has a  that comes from nowhere.
I also tried your script in my other blog: http://allthephysics.blogspot.com/ and in here we can see that sometimes some formulas aren’t parsed. I don’t understand why…
Once again thanks for your script.
The  bug is happened because of the white space. I have see this bug before, usually I just make sure that there are no necessary white space.
For the allthephysics blog I couldn’t access it because it is for invited readers only.
Ok I’ll check out the unnecessary white spaces then.
Sorry for the issue with my other blog. I had it as private blog because of this issue.
I have another blog at wordpress.com because initially that was the only blog that I knew allowed a direct input of LateX expressions into the posts. Then I found out about your script and wanted things to blogger because Your script allows a lot more LateX functionalities.
Another thing that I used is the script done by Luca Trevisan: http://lucatrevisan.wordpress.com/latex-to-wordpress/ that converts a text written in LateX to a friendly html.
This is also a very powerful script and permits the blog text to be very reader friendly and allows one to spare a lot of time in witting blog posts.
I had to change Luca’s script a little bit for it to be blogger compatible, but I still ended up with some issues as you can see here: http://physicsfromthebottomup.blogspot.com/2009/05/lucas-script-in-blogger.html (mainly because I never coded in Python before).
Hi there! I finally managed to figure out what was wrong in my blogger blog. For some some strange reason I have to give a space between one symbol formulas and the
a
a $ parses right.
Any I think I’ll move my blog from wordpress.com to blogger since you’re script allows more versatility from LateX (and this together with Luca’s script will make life a lot easier for me.)
One final question though and I understand perfectly if you don’t want to answer.
I had to change Luca’s script a little bit in order for it to work in blogger, but for some strange reason hyperlinks don’t work in blogger. If I send you the files do you think you can try to help me out a little bit in ironing out this last detail?