There are, as far as I know, at least two different ways of using
within blogger. In both cases the idea is the same, and it's similar as in some forums or in the TeXIM plugin for AMSN: somewhere there is a third part server which uses a LaTeX distribution to generate a dvi file, together with some other tools to convert this file into an image, which can be included in the html code of your blog.
Well, the problem with such solutions is that they parasite a server developed for this purpose, but this server has few (or not at all) options. In particular, the image you get is only useful with light backgrounds, so you lose freedom for choosing the design of your blog. Just to put an example, this is what I get:
\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx
=\frac{22}{7}-\piLame.
I have to say, first of all, that I have not found the perfect solution to this problem. Instead of that, my aproach consists in adding the image by hand, using Picasa. Yeah, I know, I know,... it isn't very satisfactory, but if you don't need thousands of equations, it could be good enought. Again, just for example, this is my result:

Is not bad, isn't it? But the main problem remains unsolved: how to get the image with the equation. Well, here is my solution, a bash script:
#!/bin/bash
COLOR="0.8,0.8,0.8"
DENSITY=150
cat > equation.tex << PART1
\documentclass[12pt]{article}
\usepackage{amsfonts}
\usepackage[usenames]{color}
\definecolor{my_color}{rgb}{$COLOR}
\begin{document}
\pagestyle{empty}
%\pagecolor{black}
{\color{my_color}
\begin{eqnarray}
PART1
cat equation.asc >> equation.tex
cat >> equation.tex << PART2
\end{eqnarray}
}
\end{document}
PART2
latex equation.tex
dvips -f -E -o equation.ps equation.dvi
convert -density $DENSITY equation.ps equation.png
rm equation.log equation.aux equation.tex equation.dvi equation.ps
The idea is pretty simple. To use it, you have to type your formula in the file equation.asc, in standard latex (rebembering that you are inside a eqnarray environment). Then, by running the script in your computer you get a png file with the equation, which you can upload by hand. The good thing of this aproach is that you can choose the colour of the equation playing around the variable COLOR (setting the colour you want in rbg), as well as with the size of the image changing DENSITY.
A last thing is that in order to run successfully the script, a
distribution and Imagemagick have to be installed and working in the system you want to run the script.
0 Comments:
Post a Comment