Jan. 16th, 2006
TeX troubles
Jan. 16th, 2006 09:29 pmAfter deciding that the time had come to knock the rust off my sadly neglected TeX skills, I sat myself down and started to write a new document class to format one of my routine tasks. Everything went well until I decided to add an optional argument and some condition code to change the line spacing rules:
\newif\if@doublespace
\@doublespacefalse
% Declare and process the class options
\DeclareOption{double}{\@doublespacetrue}
\if@doublespace
\renewcommand{\baselinestretch}{2}
\fi
LaTeX seemed to like the class well enough to run through it without objecting, but not well enough to actually change it's behaviour when I specified "\documentclass[double]{myclass}". After running a bunch of tests which involved hardwiring the conditional and setting the option with \ExecuteOptions I eventually realised that my code was working fine but I'd simply forgotten to include a \ProcessOptions call to actually pick the options up...
The moral of the story: it's always the simplest thing that comes back to bite you.