TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to apply some options to a package which is loaded in the cls file I am using? For instance, suppose that the cls file loads graphicx, and I want to apply the option demo to it from my tex file.

share|improve this question
up vote 19 down vote accepted

If a package is loaded, the option setting code in the package is already processed and gone. Thus in general you cannot change package options later.


But you can specify options earlier, before loading the package. Apart from a global option (with side effects for other packages) \PassOptionsToPackage can be even used before \documentclass, e.g.:



Package interface for loading options

Sometimes a package or class allows the setting of a subset of options later. For example, package hyperref provides \hypersetup. Also some options of package graphicx (or rather for \includegraphics) can be set via:


However, the option demo is not supported this way.

share|improve this answer



before the line with \documentclass

share|improve this answer

Your Answer


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.