Tuesday, January 25, 2011

Mobile Scholar: Part 3

I've thus far written two posts on how to turn my iPad into a computer. I am doing this both because I am too stingy to buy a MacBook Air and too stubborn* to give up.

My number one "killer app" has been the ability to work on papers from anywhere using LaTeX. I am now able to fully do this (provided the iPad has an internet connection). Here are step-by-step instructions for anyone interested in trying:

Step 1: Get Dropbox

This first step is very easy. Dropbox is cloud-based storage that works on every device under the sun, and is really, really fantastic. It's free up to 2 gigabytes, and you get 500 mb for every friend you invite. Unless your papers tend to have gigantic graphs and images, it's likely you'll never come close to that 2GB limit.

Step 2: Start your LaTeX paper on your computer

If you're familiar with LaTeX, this is also straightforward. If you are new to LaTeX, there is a bit of a learning curve but a lot of help out there. In particular, I highly recommend Lyx, which is a cross-platform WYSIWYG editor.

Get everything set up - your bibliography file, tex file, etc. Save it all to your Dropbox folder.

Step 3: Get latexmk going

Latexmk is, by far, the most brilliant piece of software ever written, ever.  If I could write a love letter to its author, John Collins, I would.

What this program does is sit happily in a directory watching for changes to any changes to your tex files... or any associated files (e.g., .bib files)... OR, any other tex files that your main paper references (e.g., chapter1.tex, chapter2.tex).

What does this mean? This means you can have something watching your dropbox folder all day and all night and automatically recompiles your pdf on the fly. Now we're gettin' somewhere.

I believe latexmk is now bundled with all the major TeX distributions. To run it, the magic command you want is:
    % latexmk -pdf -pvc mypaper.tex

Step 4: Get Tex Touch

Tex Touch is a program that lets you edit LaTeX files on your iPad.

I have to tell you, I am not deeply in love with this program because it is extremely clunky for a $9.99 app. (No multitasking support, sometimes crashes, has no syntax highlighting). BUT, it does the one thing no other piece of iOS software does - it understands the LaTeX workflow and syncs to Dropbox. It also sports an easily accessible and well-designed symbol editor so you don't have to go through 18 soft-keyboard screens to find an α.

Step 5 (Maybe?): Get Mendeley

I have Mendeley Lite on my iPad, and while it is also pretty clunky at least it's functional. While writing I can search my bibliography, export a citation in bibtex format (using the web view), plunk it into my .bib file in Tex Touch, and voila. A Mendeley -> DropBox .bib connection would be really nice, and if Mendeley opens up their API maybe I'll write one. In any case, I have high hopes for the Pro version of their iPad software.

That's it! I still would like offline compilation of LaTeX source on the iPad, but I figure by the time someone writes that I'll have bought a MacBook Air. :-)

Happy writing. If you end up trying any of this (or have any suggestions/questions), please drop a comment - I would love to hear how things have worked for you.

----
(*) Something that occurred to me recently - possibly one of the best skills you can have as a computer scientist is stubbornness. If you are tenacious and keep trying lots of different things and talking to lots of people until you can get something to work, you will do well in this field. Even if you can't get something to work in the end, just going through the process of trying is a great learning exercise.

No comments:

Post a Comment