Categories
code programming python school tips

GDoc/LaTeX compilation GUI with Tkinter/Python [w/ code]

A small GUI to download and compile a PDF from a LaTeX document in Google Docs.

¡Hola mis amigos!
I’m learning spanish, but I’m also annoyed with collaborating on LaTeX papers. That’s why I’ve created the GDoc-LaTeXifier so the syntax will be clear when I collaborate on a paper with a remote friend.
But now we both want to compile a PDF on our machines. So I’ve created the tiny shell script that downloads the paper and runs PDFLaTeX.
The problem is that this opens a new terminal window and runs the script. I’ve been able to sort it out so that it closes the terminal window when it’s done, by on my friend’s mac it doesn’t, so he ends up with a ton of open windows.
Enter – the GDoc/LaTeX compiler GUI.

Compiling latex is mostly just running a command line, that’s what TeXWorks and other apps do, so why not write a small python script to do the whole thing: Download from GDoc, compile to PDF.
Well with Tkinter it’s super easy:

This creates a very small and simple GUI window with just one button:
Screen Shot 2014-03-20 at 2.47.45 PM
Once you click “Compile” it’ll start the process.
You will be, again, needing Rob Miller’s gdoc2latex.py: https://github.com/uid/gdoc-downloader
¡Adiós!
Roy

Leave a Reply

Your email address will not be published. Required fields are marked *