Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to invoke my document class as follows:


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

What is the minimal code to create this document class?

share|improve this question

1 Answer 1

up vote 13 down vote accepted
\ProvidesClass{mybook}[2011/01/20 v 0.01 my own class (hv)]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}% or whatever
\LoadClass[% the default options

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.

share|improve this answer
thanks for this solution. I am trying to use it now. –  xport Jan 20 '11 at 9:14
I was under the impression that classes need to have: \NeedsTeXFormat{LaTeX2e}[<date of some version>] as the first statement. Did you leave it out? Or am I in error? Thanks. –  bev Mar 9 '11 at 0:45
@bev: that is done by the loaded class and already nowadays no more a problem. –  Herbert Mar 9 '11 at 6:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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