Consider the following example class file
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}
\RequirePackage{kvoptions}
\DeclareBoolOption{foo}
\ProcessKeyvalOptions*
\ifmyclass@foo
\def\@title{foo}
\else
\def\@title{bar}
\fi
\ProcessOptions\relax
\LoadClass{article}
And the document
\documentclass[foo]{myclass}
\begin{document}
\maketitle
\end{document}
It correctly produces a document with title "foo", so the class is actually using the option I gave. However, LaTeX says:
LaTeX Warning: Unused global option(s):
[foo].
Apparently processing a given option is not enough. How can I mark an option as "used" in order to avoid that warning?
\DeclareOption*{}
before\ProcessOptions\relax
. This will silence LaTeX about any unused or unknown key ....latex.ltx
)