Jan. 16th, 2006

sawyl: (Default)
The office is like totally deserted this morning — it was in absolute darkness when I got in half an hour ago. I'm beginning to wonder whether I've got my days mixed up and it's actually Sunday or whether I've accidentally come in on a public holiday or something dumb like that.
sawyl: (Default)
After 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.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 11th, 2026 09:14 pm
Powered by Dreamwidth Studios