9

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?

  • I think you're looking for the option a5paper and not paper=a5. – Werner Aug 31 '11 at 17:50
  • 1
    no, paper=a5 is correct – user2478 Aug 31 '11 at 17:56
11

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.

0

Your class should be something like this:

\ProvidesClass{myclass}[2011/08/31]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\LoadClass[paper=a5]{scrartcl}
\RequirePackage{...}
...
  • I've tested your solution. The warning is still there. – mhp Sep 1 '11 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.