Tuesday, December 26, 2006

Blogging from the road

I've always wanted to be able to say that (and I'm indeed at an airport, the third time in a row that Continental has a 2+ hr delay).

I thought I'd explain my solution to getting tex to appear on the web page. I know that many perfectly sound solutions exist -- just google latex2html -- but this old dog would rather stick to the tricks he knows (matlab and latex) rather than learn new ones. I wrote a matlab script, which takes a .tex file, turns commands of type \link{url}{description} into the href business and {\it bla} into bla (and so on). It also extracts every math formula in the file, creates a temporary .tex file containing just that formula and calls the perl script textogif. It outputs the html code with the links to the formula gifs.

Is this the prettiest or most efficient way of doing things? Hell, no. But a quirk in my character makes it much easier for me to invent a solution from scratch rather than use an existing one. It's been a boon and a curse in my research. Here's that matlab script in case anyone is curious; I'd be happy to hear comments, suggestions, etc.

No comments: