Wednesday, February 10, 2010

AstroBaki on MediaWiki

I just started up a new wiki called AstroBaki. The main reason I did this was that my MoinMoin AIPY wiki was clunky to use and was getting spammed lots. I switched to the MediaWiki engine, which has better automated control over these kinds of things. As an added bonus, MediaWiki has support for latex math. This got me thinking...

When I started grad school, I had a hard time transitioning from feeling like I was producing and contributing (I was working as a development engineer for SETI) to just absorbing knowledge. To make myself feel better and more invested in learning, I started doing something for which I became moderately famous around the department: latexing lecture notes on-the-fly. For full disclosure, I should mention that I copycatted the idea of latexing on-the-fly from my friend Phil.

The key to success is to use lots of "defs", and to recognize when you need to def a sequence of commands. When the same sequence of symbols started popping up, I would pretend that I had already def'd the command and start using it, and when there was a pause in the derivation, I would remember to scribble down what that command should mean. In my later years, I also started drawing figures in paint for inclusion in latex.

Anyway, I now have about 4 or 5 latex'd class notes that I have put on my website. From what I hear, they are still regularly used in UCB classes, and I occasionally get happy emails from grad students thanking me for the effort. Meanwhile, I've been reading a book about Nicolas Bourbaki, a famous pseudonym for a group of (mostly French) mathematicians who collaboratively re-wrote mathematics from 1935 to the 70s. Nicolas Bourbaki was a wiki, ahead of its time.

"Now wouldn't it be cool," I thought to myself, "if students using these lecture notes could fix them when they are wrong (after all, they were written on-the-fly), and re-organize them to make more sense?" Could these notes become a sort of open-source textbook for astronomy? So AstroBaki was born.

The difficulty, I am finding, is in translating latex (especially latex heavy in defs) into mediawiki. The best tool I've found so far has been pandoc, which didn't do the defs, but did everything else pretty well. I'm loath to do things by hand, so I'll see what can be automated, and I'll keep you posted.


  1. I built a collaboration wiki on mediawiki a couple of years ago with the goal of building papers collaboratively. The latex equation support works ~ok but it lacks the nice formatting that tex brings to the page as well as well as a decent editor. Maybe it has improved in the last year or so but both proved to be a real limitation when anything broached ~10 equations.

    The main issue is that the workflow and output are really only designed for a fairly low equation density as on a typical wikipedia page. The workflow issue would be ok if porting were easy. As you point out, its not. What one really wants is something that is built around the way one writes in latex. A text editor with highlighting, a latex activation thing, a pdf/dvi viewer and a basic wiki type db backend. And a nice frame to tie it all together. Are the tools (save latex) all there in the google api? I think they might be.

  2. I actually have had great luck now with plasTeX, a python tool for parsing and converting latex files. I'm now debating between converting documents to mediawiki formatting and collaboratively editing them in wiki format, or retaining them in original latex format and writing an extension for mediawiki that uses plasTeX to render the html from the latex source.