# Prevent specific \documentclass options being sent to packages

Edit 2: I should have said, as @egreg says in the comments, that there is no good reason to do this, as

the purpose of the options to \documentclass is precisely of being dispatched to every package.

This is mostly for educational purposes about options.

Consider the following example

\documentclass[color=notexisting]{article}
\usepackage{todonotes}
\begin{document}
~\todo{write something}
\end{document}


Now, I don't think that color is an option to article, but that's not the point.

The question is: How can you make all subsequent packages ignore only certain options to the \documentclass, e.g. ignore color=notexisting, but not e.g draft.

Any help is appreciated. Thanks!

Edit: Just figured out that it seems redefining \@classoptionslist to nothing (\gdef\@classoptionslist{}) after \documentclass removes all options sent to \documentclass.

• The purpose of the options to \documentclass is precisely of being dispatched to every package. – egreg Sep 21 '18 at 8:54