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 to change the options a package was invoked with after the fact? That is, could one define \OopsIWishIHadWrittenDraftWhenIncludingGraphicx so that

\documentclass{article}
\usepackage[final]{graphicx}
\OopsIWishIHadWrittenDraftWhenIncludingGraphicx
\begin{document}
...
\end{document}

would produce the same result as

\documentclass{article}
\usepackage[draft]{graphicx}
\begin{document}
...
\end{document}

?

share|improve this question
    
Have you tried using \usepackage a second time with different parameters? –  sfat Nov 1 '13 at 12:56
4  
Depends on the option. In your example you only need to use \makeatletter\Gin@drafttrue\makeatother. But not every option is so simple. –  Ulrike Fischer Nov 1 '13 at 12:58
    
In general, the answer is "no". The problem is that an entirely different branch of the package code may execute, depending on which options are passed to \usepackage[...]{...}. –  Jubobs Nov 1 '13 at 13:57
add comment

1 Answer

up vote 1 down vote accepted

In general, it cannot. However, with some packages, providing a package option is equivalent to calling a command in the preamble after the package has been loaded. These include for example:

  • hyperref
  • geometry
  • enumitem
  • ...
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.