The Joy of TeX

Michael Stone, January 22, 2009, , (src)

Contents

The Joy of TeX

“To my mind, Donald Knuth really made something special when he created TeX…”

“How so,” you ask?

“In that he made it possible for generations of mathematician/artists to indulge their fancy (read “OCD compulsions”) for both mathematically precise typesetting and graphically pleasing layout simultaneously,” I reply.

Take, for example, the “job description lines” in my résumé. How did I tell TeX to both left-align the role and to right-align the dates?

Glue and Tables

As it happens, I was in the mood for tables, so I made use of TeX’s

  1. \halign,
  2. \hsize,
  3. \hfil, and
  4. \tabskip

commands like this:

\halign to \hsize{#\hfil&, #\hfil\tabskip=0pt plus 1fil&\tabskip=0pt\hfil#\cr#2&#3&#1\cr}

to tell TeX how to build exactly the line that I wanted; namely,

  1. a table (\halign) whose width is equal to the current page width, \hsize,
  2. which consists of two left-justified columns (#\hfil) and a right-justified column (\hfil#),
  3. separated by a single piece of infinitely stretchable “glue” (\tabskip=0pt plus 1fil&\tabskip=0pt).

Then I pasted my table-generator into my “\job” macro definition and chose some cell-specific fonts:

\def\job#1#2#3{\smallskip \goodbreak {\parindent=0pt 
\halign to \hsize{\jtf##\hfil&, \jpf##\hfil
\tabskip=0pt plus 1 fil&\tabskip=0pt\hfil\jdf##\cr#2&#3&#1\cr}}\par}

and peppered the résumé source code with eye-pleasing lines like

\job{March 2008-October 2009}{Release Manager}{One Laptop per Child}

as needed. Neat, huh?

Appendix

(P.S. - Better solutions are welcome as well; I’m sure there are many.)

(P.P.S. - Credit where credit’s due: I reversed many pretty design ideas from your résumé, Scott, which is beautiful.)