4

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}

?

  • Have you tried using \usepackage a second time with different parameters? – sfat Nov 01 '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 01 '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[...]{...}. – jub0bs Nov 01 '13 at 13:57

1 Answers1

2

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
  • ...
yo'
  • 51,322