Until now, I have been collecting my "frequently used packages", custom macros, and configurations in a personal style file. However, some of those configurations depend on the use of one of the KOMA-Script
classes, and therefore (according to my own answer to Classes and packages – what's the difference?) good practice stipulates that I rewrite my personal file into a wrapper class.
According to section A.4.8 of the LaTeX Companion, a wrapper class file myclass.cls
that builds on article.cls
and passes class options specified by the user to the base class would look like, e.g.,
\ProvidesClass{myclass}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}
\RequirePackage{<package list>}
or, even easier,
\ProvidesClass{myclass}
\LoadClassWithOptions{article}
\RequirePackage{<package list>}
However, my base class may in fact be one of several document classes, namely scrartcl
, scrreprt
, orscrbook
. I want to define some wrapper class options (named, say, article
/report
/book
) that, by specifying one of them, load the corresponding KOMA-Script
class. (If I don't specify any of them, scrbook
shall be loaded by default.) How do I go on about this?
Best Answer
This scheme seems to work:
The default class is scrbook, but the options
scrartcl
orscrreprt
will change it.In my test I tried with the
abstract
option:gives
Unused global option(s): [abstract]
, whiledoesn't show the message.