Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible add at the loaded class some options? look at the example below:

\documentclass{scrbook}

\AddOptionsToClass{headinclude,footinclude}% something like this command

\begin{document}

test

\end{document}
share|improve this question
    
I would do a \def\MyClassOptions{} before \documentclass, and use \documentclass[MyClassOptions]{scrbook}. This could also allow (with some additional logic) for a way to specify the class options on the command line, if so desired. –  Peter Grill Oct 1 '12 at 21:06
add comment

2 Answers 2

up vote 12 down vote accepted

If a class or package is loaded, LaTeX does not load them again (the exception is package fontenc). It only checks the options, if there are new ones and then LaTeX throws an error because of the option clash. That also means, you can't give options later to the class or package. But it is possible to do it before:

\PassOptionsToClass{headinclude,footinclude}{scrbook}
\documentclass{scrbook}

Some classes and packages provide setup commands that allow to change the behaviour of the class or package at a later time, e.g.:

\documentclass{scrbook}
\KOMAoptions{headinclude,footinclude}
\recalctypearea
share|improve this answer
add comment

The solution I have been using is:

\ifdefined\ClassOptions
\else
    \def\ClassOptions{draft}
\fi

\documentclass[\ClassOptions]{article}

This allows you to change the options via the command line if so desired.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.