General ⇒ Switch of documentclass/compiler macros
Switch of documentclass/compiler macros
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Switch of documentclass/compiler macros
Switch of documentclass/compiler macros
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.