sawyl: (Default)
[personal profile] sawyl
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 Feb. 5th, 2026 07:09 am
Powered by Dreamwidth Studios