[geeks] Geeking out with LaTeX

Jonathan C. Patschke jp at celestrion.net
Mon May 6 23:44:55 CDT 2002


So, I'm supposed to be probating my grandmother's will.  It's not just one
form.  It consists of lots of forms--lots of forms with repetitive
information.  Hmm... what does this suggest to you?

I've got the templates (in dead-tree format) for all the forms here, and I
need to typeset them because there are lots of places where certain
paragraphs need to be included (and renumbered), certain paragraphs need
to be omitted, and lots of other nasty trickery.

All the other times I've "played lawyer"[1] (all for the family: divorces,
land changing hands, that sort of stuff) I've used MS Word.  Word happens
to not run very well on an SGI Octane, and using Word for hours on end
through VNC doesn't sound like much fun.  Plus, all this dynamic document
reconfiguration and renumbering would make Word toss up its hands and hide
in the corner unless I wanted to get into Deep Magic, and it's been years 
since I've done that.

Enter LaTeX.  LaTeX, meet GNU Make.  GNU Make, LaTeX.  Friends now?  Good.

What originally started out as a directory containing a single LaTeX
source file for each form now contains:
  1) A master Makefile which iterates over the build process for any
     number of legal forms.
  2) An "each" Makefile which builds preprocesses single arbitrary legal
     form and then runs the resulting LaTeX output through TeTeX and
     GhostScript to produce a DVI, PostScript, and/or PDF document.
  3) A "forms.list" file controlling which forms get built if I don't
     specify any on the command line.
  4) A src/ directory containing templates for building the LaTeX source
     of the legal forms.
  5) A tmp/ directory for building everything.
  6) An output/ directory for holding the resulting PostScript and PDF
     files.
  7) A "blank.tex" file containing nothing.

I can now do "gmake FORM=oath DATA=blank oath.pdf" to create a pdf with no
blanks filled-in of the form that basically says "I will honestly execute
the Will of $person".

But that's nothing.  Anyone can automate building N documents.  That's
sorta why make exists in the first place.

If I omit "DATA=blank", it reads "data.tex" in the root of the hive and
prepends it to each template.  "data.tex" is presumed to contain lots of
\renewcommand{} statements which fill in the blanks across all the forms.

So, just typing "gmake" iterates over forms.list, pulls in data from
data.tex, and builds a PostScript and PDF file of each form, containing
whatever data I have available.  Omitted data is represented by blanks of
predefined space for penning-in whatever needs to go there.

Hopefully, the end result will be something that's generically useful for
other people who find themselves with this particular pile of legal cruft
to sift through.  If not, it'll lessen the chance of an error introduced
by inconsistency.

I suppose the ultimate in utility would come from putting together a
unified front-end (either web- or email-driven) to collect all the data
and return an archive containing all the pdf files.  Hmm... this sounds
like a dot-bomb idea!  www.legalforms-while-u-wait.com!

Oh, and if that wasn't geeky enough, just now, as I was talking to my
fiancee on a MUSE, I called[2] the Italian restaurant across from her dorm
in Cambridge, MA and paid them to deliver a calzone to her, as she's up
late doing an end-of-term paper.  Thank goodness they don't subscribe to
caller-ID, or they'd never have believed it. :)

--Jonathan
[1] Which is altogether not as much fun as "playing doctor".
[2] Using Yahoo to look up the number, of course.



More information about the geeks mailing list