Hi,
say I have a document I want to compile in three ways:
(1) as \documentclass[param1]{scrbook} with some parameters param1 and possibly some other settings (captions, fonts, etc).
(2) as \documentclass[param2]{scrbook} with some other parameters param2 and possibly some other settings (captions, fonts, etc).
(3) as \documentclass[param3]{scrartcl} with some other parameters param3 and possibly some other settings (captions, fonts, etc).
I could set this up by commenting out/uncommenting the respective commands. This is somewhat tedious and not very elegant. It seems I cannot use packages boolexpr or xifthen, for packages need to be loaded after the documentclass command.
If this were C world, I'd use (evil) macro statements. What's the "right" way to achieve my goal in LaTeX?
Thanks, Jo
General ⇒ Switch of documentclass/compiler macros
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Switch of documentclass/compiler macros
You can use both plain TeX (\newif) and LaTeX macros (\newboolean) before \documentclass.
Switch of documentclass/compiler macros
Another thing to consider would be to create three "wrapper" files which use \input for the same core document.
I.e., make one file like this:
and another like:
and another however, etc.
Then just have a script or batch file compile all of them.
I.e., make one file like this:
Code: Select all
\documentclass[param1]{scrbook}
\usepackage{font-package-for-this-version}
\newcommand{\something}{Command definition specific to this version.}
...
\input{core.tex}
Code: Select all
\documentclass[param2]{scrbook}
\usepackage{some-other-font-package}
\newcommand{\something}{Different definition of same command.}
...
\input{core.tex}
Then just have a script or batch file compile all of them.