8

I want to create a document class based on a KOMA-Script class. If myclass.cls contains the following

\ProvidesClass{myclass}[2011/08/31]
\LoadClass[paper=a5]{scrartcl}

then compiling a document whose first line is \documentclass{myclass} generates the warning

LaTeX Warning: Unused global option(s):
    [paper=a5].

The same problem occurs with scrbook and scrreprt. What am I doing wrong?

Schweinebacke
  • 26,336
Ian Thompson
  • 43,767

2 Answers2

10

The option paper is actually not a class option, but an option of the typearea package which is implicitly used by all KOMA-Script classes. Hence, what you need is the following:

\ProvidesClass{myclass}[2011/08/31]
\PassOptionsToPackage{paper=a5}{typearea}
\LoadClass{scrartcl}

The paper option isn't automatically passed to the typearea package by the KOMA-Script classes. On the other hand, this is the case for the old-style a4paper, a5paper etc. options. Thus, an alternative solution to your problem is:

\ProvidesClass{myclass}[2011/08/31]
\LoadClass[a5paper]{scrartcl}

I don't recommend the latter solution, though, since old-style options are more and more deprecated by the KOMA-Script classes.

mhp
  • 8,692
0

Your class should be something like this:

\ProvidesClass{myclass}[2011/08/31]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\LoadClass[paper=a5]{scrartcl}
\RequirePackage{...}
...