Wednesday, July 17, 2013

LaTeX Python Scripts

Here are the supporting materials from my final talk at AAPT's Summer Meeting 2013 in Portland, on LaTeX and Python in assessment creation.

There are two Python scripts and some LaTeX examples in the package. The scripts are:

  • Assessment Maker Lite: takes problems from the problem database (well, really a folder of individual problem LaTeX files) and assembles a properly numbered and pretty assessment PDF
  • Problemdb Lite: manages the problem database: it counts the problems, identifies the tags on each, and renders a PDF based on search criteria ("Vectors Drag" would search for problems containing both tags and "Vectors OR Drag" would get vector problems and drag problems) or gives a PDF of the whole set. Vertical space is removed, so the set will be compressed and will fit in a smaller number of pages, but it may cause awkward display at times.
There are some auxiliary documents, including a LaTeX example document and an Excel sheet to store assessment names and problem numbers for future reference (and easier entry into the Assessment Maker). 

You'll have to set some paths if you move things around, and definitely to reflect the location of your LaTeX engine and PDF viewer. There are comments in the code showing you where you might need to do that.

Any Python install should be fine: I'm using Python 2.7, if you're curious. You'll need a LaTeX install and the only custom style package needed is floatflt (available at CTAN and by Googling).

These can be expanded a great deal, including adding a GUI (I use Tkinter), polling Google docs (using GoogleCL) to create customized reassessments based on student signups, etc. These require more dependencies and directory-setting, so I didn't include them in the Lite versions.

I'm not a software engineer, so there's surely improvement to be made, features to be added, and errors to be checked (it'll just crash out if there's a compile issue, for example), but it should be fine for workaday use - it is for me! :)


  1. ExamView sells for $70/copy. This sounds better, but I'm not interested in doing a great deal of tinkering (hence why I'm not a Linux user, for example)...

    1. Yeah, it's always a cost/benefit analysis. For me, especially when I add in Google doc integration, it's totally worth the initial investment of time to set up the system. For somebody else, maybe not. As in many things, xkcd calculates it best: