Showing posts with label blogspot. Show all posts
Showing posts with label blogspot. Show all posts

Friday, April 6, 2012

Switching to using MathJax for LaTex support

I reset my LaTex support in blogspot to use MathJax. Looks like it is rendering, $$A = B^T$$

Setting up LaTex support using MathJax is straightforward. Just put the following script before the </head> element in your blogger template.
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
MathJax.Hub.Config({
extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>

Friday, March 23, 2012

SyntaxHighlighter

I wanted to add syntax highlighting to my blog, and decided to try out Alex Gorbatchev's SyntaxHighlighter. Looks pretty good to me! Here is a link on a quick setup for blogger.

alert('Looks like this works!');

Tuesday, August 11, 2009

Using Latex on Blogspot

I have been looking for a way to incorporate Latex code on Blogspot to write math, and here is a great way of doing it.
It looks quite nice too, $\sum_{i=1}^n 2^i$

By default, the math, as a rendered image, is displayed within a border. The border can be easily removed by modifying the html content under layout -> edit html

.post img{
border:1px .......
......
}

Simply set the border attribute to 0px. I think this also means your uploaded images will no longer have a border, but you can probably give that up for the sake of Latex.

[Update on August 17, 2009] I don't like the size of the rendered image displaying the math, it creates white space between consecutive lines if the math is put in as inline, making a large blog entry with lots of inline math equations look ridiculous. Wordpress does a much better job in handling latex code. Blogspot should incorporate latex handling if it wants to be popular among bloggers who like to use math in their blogs.