2009-09-06

More LaTeX document classes: resume and cover-letter

I was making a resume and cover letter to apply to some internships recently, and I was trying to use res.cls and letter.cls to make them. But whenever I wanted to tweak something, the complexity and TeX-ness (as opposed to LaTeX-ness) of these standard document classes made things more difficult than I liked.

So, since what I wanted was fairly simple, I decided to reinvent the wheel with the resume and cover-letter classes. Here's the source, screenshot and usage for each.

resume.cls

Usage:
\documentclass{resume}

\name{Ankur Dave}
\addressone{1234 Abc Road}
\addresstwo{San Jose, CA 95101}
\phonemobile{555-555-1212}
\phonehome{123-456-7890}
\email{ankurdave@gmail.com}
\website{http://ankurdave.com}

\begin{document}

\maketitle
\thispagestyle{empty}

\section{Experience}

\employer{Berkman Center for Internet and Society at Harvard University}
\location{Cambridge, MA}
\jobtitle{Summer Intern}
\dates{July---August 2009}
\begin{position}
Position description.
\end{position}

\section{Education}

\schoolname{Interlake High School}
\dates{September 2006---June 2010}
\begin{school}
Description.
\end{school}

\end{document}


cover-letter.cls

Usage:
\documentclass[12pt]{cover-letter}

\address{
Your address and contact info
}

\recipientaddress{
Recipient's address
}

\date{\today}

\begin{document}

\maketitle
\thispagestyle{empty}

Cover letter body

\end{document}

2009-07-15

Getting started at the Berkman Center

It's been a week since I arrived in Cambridge for my internship with Harvard's Berkman Center for Internet and Society. It's been fun and interesting living on my own and working at the Berkman Center.

I'm working in the HerdictWeb team, which runs the Herdict web site. HerdictWeb's goal is to detect Internet censorship around the world through large volumes of reports by a community of volunteers in different countries. It's an effort to use the power of the crowd (also known as "crowdsourcing") to create transparency in governments around the world. The Herdict project is run by Prof. Jonathan Zittrain.

My first task in HerdictWeb is to create an alert system similar to Google Alerts that allows users to sign up for email alerts based on changes in Herdict censorship report data. The alerts would have three parameters:
  • Content (a country or a site) -- a reporter might want updates on reports in Iran, and a site owner might want updates on reports regarding their site.
  • Threshold (a number of reports or a percentage change) -- the level of the reports before the alert is triggered. For example, an alert should only happen when 20 reports in Iran happen in a day, or when the number of reports in any country increases by 20% over the previous day.
  • Frequency (a time period) -- a cap that prevents alerts from being sent more frequently than specified. For example, an alert may be triggered at maximum once per day.


Normally, the alert project is at most a week-long project, but it's complicated by the fact that I'm not yet entirely familiar with the HerdictWeb codebase, and in fact neither is anyone else on the team (two others) -- they're new to the project as well. In addition, the previous developers of the project seem not to have checked in a full build configuration to revision control, so even after I was able to get the project to build, a lot of the output was missing. As a result, I've spent the past week setting up the build environment and reading different parts of the project's code.


More generally, life so far in Cambridge has been pleasant. I'm living in an apartment that I'm renting from my cousin, and my two roommates are nice (if a little messy). I've been cooking my own meals based on instructions my mom wrote for me, which has turned out to be surprisingly easy and tasty. There's a Whole Foods two blocks away and a Trader Joe's not much further, so buying groceries is very easy.

My uncle, who lives in Syracuse, NY, lent me his bike while I'm here, and that's been really helpful. Even though everything I need to do day-to-day is within a two-mile radius of my apartment, having a bike makes it possible to go back and forth between the Berkman Center's two offices without thinking twice. There are plenty of bike lanes around Cambridge, but most streets are one-way, complicating my routes a little.

So overall, Cambridge is better than I expected, and independence is a nice feeling!

2009-04-06

Creating your own LaTeX document class

I've been using LaTeX for a few years, and every time I make a new document, I always start by copying a similar document I've made in the past. So over time, the preamble to each document—the header, where formatting and package includes go—has kept getting bigger. And since I frequently create new commands to simplify things while I'm writing a document, those document-specific commands end up in unrelated documents.

For example, I wrote my IB Extended Essay last year, and the formatting I used (1-inch margins, ruled headers and footers with my IB candidate number, 3-point paragraph skips, etc.) became my standard formatting for all IB documents. So whenever I was starting a new IB assignment, I copied my Extended Essay, often neglecting to delete the unnecessary document-specific commands like the following:
\newcommand{\class}[1]{\texttt{#1}}
\newcommand{\method}[2]{\texttt{#1.#2}}
\newcommand{\note}[1]{\textit{#1}}
\newcommand{\coderef}[2]{\ref{#1}, page \pageref{#1:#2}, line \ref{#1:#2}}
So I finally decided to package the common document types I use into custom LaTeX classes, just like the built-in article.cls class. So far, I have two classes, interlake-assignment.cls and ib-assignment.cls. Both of those let you define several fields like candidatenum and wordcount that then get printed out into an appropriately formatted title section.

That makes it possible for me to start a fully-formatted new assignment with just a few lines:
\documentclass{ib-assignment}
\title{Modeling the Course of a Viral Illness and Its Treatment}
\subtitle{IB Math HL Type II Portfolio}
\author{Ankur Dave}
\candidatenum{0844-028}
\updateheaders % a bit of a kludge to get the title working properly

... % document-specific packages and macros

\begin{document}
\maketitle

... % document body

\end{document}
Here's the source for the two classes, as well as a screenshot of each one being used:
ib-assignment.cls
interlake-assignment.cls
(Update 2009-04-20: I fixed the links; thanks to Lincoln Berkley from New Zealand for pointing out that they were broken.)