Skip to main content

Using Wave to collaborate on Latex documents

This blog post is a copy of a much nicer PDF version.

I found that Wave could be used as collaborative editor on Latex documents by using a modified export bot and a simple shell script. The exporty2 bot (living at exporty2@appspot.com) allows you to access a wave using access tokens instead of cookie based logins making it easier to fetch those waves using curl. Also the exporty2 bot allows you to export only the text of a Wave using the ``raw'' template.

The raw URL given by the exporty2 bot is pasted into the shell script below. It serves as master wave as it is the document that is latex-ed. Additionally it also lists other resources using the special %FETCHURL tag. These resources are pairs of local name and URL. Curl fetchs these resources and stores it under their local name before the shell scripts runs the usual combination of latex/bibtex/latex. I usually put those %FETCHURL tags below \documentclass.

#!/bin/sh

TITLE="wave-collaboration"
TOKEN=c64e13d340009da7
WAVEID="googlewave.com!w%252BlRomqcgHA"
URL="http://exporty2.appspot.com/export?waveId=$WAVEID&accesstoken=$TOKEN&template=raw"
curl -o $TITLE.tex $URL

DELIMITER="DELIMITER"
FETCHURL=$(grep %FETCHURL $TITLE.tex | sed -e "s/ /$DELIMITER/g")
for i in $FETCHURL
do
  URL=$(echo $i | awk -F$DELIMITER '{ print $3 }')
  FILENAME=$(echo $i | awk -F$DELIMITER '{ print $2 }')
  curl -z $FILENAME -o $FILENAME $URL
done
latex $TITLE.tex
bibtex $TITLE
latex $TITLE.tex
dvipdf $TITLE.dvi
The nice thing about the exporty bot is that it ignores any blips except the root blip. Thereby you could add replies to the latex document and have inline discussions that are automatically filtered from the export. Also the exporty bot ignores the first line of the wave, so you can name the Wave properly.

The PDF version of this blog post contains examples how to use external graphics and bibliography waves. You can also get the latex source of the PDF.

Comments

vlk said…
Sometimes, for some odd reason, exporty2 stops picking up changes to the wave. Any idea why this happens? I've cleared cache, even restarted the browser and everything, but no go.
It's most likely an issue with appengine or the Wave gateway losing some request. I have seen that before but it usually goes away on its own (not 100% stable technology)

Try to resubmit the blip - just add some space and remove them again and hit Ctrl-Enter in Wave. Then wait 5 seconds and the changes should be in exporty.
vlk said…
I tried all that, but to no avail. Strangely, if I add exporty2 to a newly created wave, it no longer creates the extra blip with the link to the raw text, so I suspect that something is wrong with the exporty server.
You are right. I just found on my private waves that exporty2 stopped working. Also the original exporty bot, it is derived from, stopped working (exporty@appspot.com).

Google announced robot API changes.
http://code.google.com/apis/wave/extensions/robots/events.html
Not sure whether this is related. Let's see if I can port exporty2 to the new robot API.
exporty2 works again. It seems like Google fixed their wave gateway problems.

Popular posts from this blog

Liskell standalone

Some time has passed since I last blogged about Liskell. It is not dead nor have I changed my mind that Haskell needs a proper meta-programming facility not to mention a better syntax.Liskell was a branch of GHC once. Now it sits on top of the GHC API, or I should rather say sneaks behind its back as it creates its own API as the original one is not suitable for the stunts I'm interested in. If Liskell sticks with GHC as its soil, I will definitely send patches upstream to refine the GHC API in the areas where it needs more flexibility for Liskell. However for the moment, my main target was to get something out that compiles with a stable version of GHC.You can grab it with the usual: darcs get http://code.haskell.org/liskell/ This version has been tested with ghc 6.10.1 and should install like: ./Setup.lhs configure ./Setup.lhs build ./Setup.lhs install cd LskPrelude make install-inplace Optionally you can run make tests in the testsuite subdirectory. Thanks to community.haskell…

XMonad GridSelect

Personally, I not just need a window manager, I need a focus manager. I tend to think of windows as TODO items, and as there are many TODOs in life there are many windows on my workspaces. Usually a fraction of that can't be closed or worked on immediately, so they linger around on my desktop, cluttering my workspace.I used to use the Tabbed layout. But Tabbed isn't the answer when you are a guy who reports bugs such as "XMonad 0.6 with Tabbed dies when firefox-session-restore slams 40 windows at once on the desktop". In other words, I use a lot of windows. The workspaces concept isn't particularly useful to me either. My mind just doesn't work with mental boxes. So the result is, that I have too few workspaces with too much windows on them, so that Tabbed has trouble displaying useful window titles, and navigating through them is slow and cumbersome (mostly because tab switching generates a lot of useless X Expose events).GridSelect is my answer to that. It…

Removing CHS based access from windows boot loaders

Recently, I had troubles to migrate my Windows installation from VMWare to VirtualBox. When booting the vmware created partition in virtualbox, I got "NTLDR not found". So I sharpened the knives and got down to business with vmware's gdb interface and virtualbox's internal debugger. Tracing the execution showed that the BIOSes of the two products reported different geometries on the INT 13h interface. The generic method contained in the boot loader to read a sector from disk is "clever" as it checks whether the sector is below the maximum sector index that is reachable with the CHS geometry reported by the BIOS. If not, it uses the LBA interface of the BIOS. If yes, the cleverness of the boot loader suddenly vanishes. Instead of using the BIOS reported geometry to break the absolute sector down into its CHS components, the boot loader uses a geometry stored in the so called BIOS parameter block. That's a section of the first sector embedded into the boo…