1

I've seen the pages Unused global option(s): [language=english] and Unused global options in custom class but I'm still getting an unused global options error and I'm not fully understanding why. (I didn't see any other ones so sorry if this is a duplicate). Here's a MWE (additional info after the MWE):

File: mypkg.cls

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mypkg}
\RequirePackage{xkeyval}

% setup class \def\tcg@cls@name{notes} \def\tcg@cls@document{article} \DeclareOption{article}{ \def\tcg@cls@name{article} \def\tcg@cls@document{amsart} }

\DeclareOptionX{classname}[notes]{% \def\tcg@cls@name{#1} }

% Pass extra options \DeclareOptionX{ \PassOptionsToClass{\CurrentOption}{\tcg@cls@document} } \DeclareOption{ \PassOptionsToClass{\CurrentOption}{\tcg@cls@document} } \ProcessOptions\relax \ProcessOptionsX\relax \LoadClass{\tcg@cls@document}

File: article.tex

\documentclass[article]{mypkg}
\begin{document}                                                     
Nothing
\end{document}

The error I'm getting is:

LaTeX Warning: Unused global option(s): [article].

Additional info: Basically what I'm trying to do is create a package that has multiple potential options. (In the MWE I have just two option, but in my file I have at least 20 different options. Technically the MWE is not a MWE as I get the same error if I remove the X option, but I wanted to point out that I do need X options.) The issue is that I want all options to also be passed to the class that I am loading. The reason for this is because I want the user to be able to use any "standard" class options as well automatically, but I don't want to declare an option for each one and pass it manually.

In essence, I need some way to pass only some of the options to the loaded class where by "some" I mean either:

  1. An option I haven't handled yet.
  2. An option which I did handle, but I'd like to pass along anyway.

The 2nd option above, I'm not to fussed about as I know I can just use \PassOptionsToClass for those individually, but the 1st case above I don't know how to do because it seems like \DeclareOption* and its X version pass all options instead of the options which haven't been handled. Is there a way to do that?

Alternatively, I'm ok with just supressing the error message, but I'm not sure how to do that. Any time I've tried to supress the message, nothing has changed.

0 Answers0