Tue, 10th Aug 2010 (HowDidIDoThat :: LaTeX)
My Class File
I use a single class file for all my LaTeX documents. This class file sets up some options before calling a real class file, depending on which options it was passed. This allows me to do the following:
The file itself can be downloaded here.
It is extensively commented, but the comments really only pertain to how things were done so aren't useful for finding out how to use it. On the other hand, it's hard to imagine anyone wanting to use this as is, but rather that someone might want to steal bits of it for their own use. However, without knowing what it's for, it's hard to know which bits might be worth stealing. So what follows is intended more as a treasure map than a guidebook.
As said above, this class was designed to overcome the problem of maintaining similar versions of documents; either through swapping class files or options to a particular class file.
The main problems with swapping class files are:
The first is simply irritating. The second is actually a bit beyond irritating; many journals provide - in their class file - a set of useful macros. The problem is that I have my own set of useful macros and there are often conflicts. Sometimes there are conflicts with other packages, but the journal class file may not provide a complete replacement for the other package, or may not provide quite the same commands.
In this class file, I deal with the title page and with package conflicts; I leave the issue of replacements for the package which holds all my useful macros. The method I use for solving the title page is to provide new commands for entering this data which give me a way to package it appropriately to the class chosen. Thus the start of one of my articles will look like this:
Depending on the option passed to the class, the article details, the author details, and the rest, get passed to the real class in the appropriate way. Adding support for a new class file is reasonably straightforward, but obviously I only have done those class files that I've seriously thought about using. Currently supported options are: lms, compositio, amsart, amsproc, docmath, cmh, jdg, hha, article, arxiv.
Each option can also suggest a list of packages to load or not to load.
After the main class is loaded, this list is looked at and if a package is requested and not suppressed, it is loaded.
Thus, for example, by default I load the
My lectures are now done as beamer presentations.
To keep a uniform look, I have all the lectures in one document and use the