Take the 2-minute tour ×
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.

Possible Duplicate:
Defining a wrapper class for a set of document classes

When writing a new class (say, journal), how can I base it on an existing class (say, scrbook)?

share|improve this question

marked as duplicate by Martin Schröder, diabonas, cgnieder, Marco Daniel, egreg Sep 15 '12 at 22:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
Related: tex.stackexchange.com/questions/36274/… –  lockstep Sep 13 '12 at 6:45
    
Thanks @lockstep, this is pretty much what I would like to achieve indeed, but this question didn't show up when searching. –  ℝaphink Sep 13 '12 at 6:48

2 Answers 2

up vote 11 down vote accepted

The LaTeX Companion does explain this in more detail, but here is what you basically have to do in your journal.cls:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{journal}[2012/09/13]

\LoadClass{scrbook}

...

You need to be careful when dealing with class options. I discussed this issue when using the kvoptions key-value package in http://tex.stackexchange.com/a/68475/15616. But there are also native LaTeX commands \DeclareOption, \DeclareOption* and \ProcessOptions*.

share|improve this answer

Besides the command \LoadClass there's a command \PassOptionsToClass{<options-list>}{<class-name>} that can be used before \LoadClass{<class-name>}. This is a simple beginning of your class:

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{myclass}[2012/09/13 v0.1 My Class]

\PassOptionsToPackage{patch}{kvoptions}
\RequirePackage{kvoptions}

\DeclareBoolOption{draft}
\ProcessKeyvalOptions*

\ifmyclass@draft
  \LoadClass[draft]{article}
\else
  \LoadClass{article}
\fi

If you want all options user gives to myclass to be passed to article, you can used \LoadClassWithOptions{article}. However, this can have some drawbacks and I'm not sure it is always a good idea.

share|improve this answer
    
Please see the answer I linked to, for the correct way of passing options on in this case (with kvoptions). –  canaaerus Sep 13 '12 at 6:56

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