11

I want to invoke my document class as follows:

\documentclass[cymk,dvips,dvipsnames]{mybook}

Internally mybook.cls includes my own packages such as mytables.sty, mypstricks.sty, etc.

What is the minimal code to create this document class?

yo'
  • 51,322
Display Name
  • 46,933

1 Answers1

14
\ProvidesClass{mybook}[2011/01/20 v 0.01 my own class (hv)]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}% or whatever
\ProcessOptions\relax
%
\LoadClass[% the default options
]{book}
\RequirePackage{xcolors}
\RequirePackage{...}
...
\endinput

And, of course, a comment statement of the license (LPPL) at the beginning, and preferrably some basic info about the file if you plan to ever publish it anywhere.

yo'
  • 51,322
  • I was under the impression that classes need to have: \NeedsTeXFormat{LaTeX2e}[] as the first statement. Did you leave it out? Or am I in error? Thanks. – bev Mar 09 '11 at 00:45
  • @bev: that is done by the loaded class and already nowadays no more a problem. –  Mar 09 '11 at 06:32