I'm creating a document class for bachelors' and masters' theses at my faculty. It's almost ready and tuned to this year's official requirements. However, things may change in future: for example, the management may suddenly change the title page layout or do anything like this. So, I want to add version options to my class to be specified like in the following:
\documentclass[v2018]{physvsuThesis}
With the help of these options, I plan to retain backward compatibility while being able to incorporate new requirements on demand.
However, I don't know how to manage such conditionals in a convenient way. Using plain TeX's \newif
along does not seem like a viable option. The only solution I can think of is to roll out my custom commands to implement conditional logic, like this:
\DeclareOption{v2018}{\setVersion{2018}}
\DeclareOption{v2019}{\setVersion{2019}}
...
\ifVersion{2018, 2019} % logical OR
...
\fi
How can I implement the \ifVersion
command so it can check for multiple conditions and work even if nested?
etoolbox
can help. It reduced the code for my faculty letter class quite a lot. – daleif Jun 8 '18 at 13:48