This scheme seems to work:
\ProvidesClass{lockstep}
\DeclareOption{scrartcl}{\def\lock@class{scrartcl}}
\DeclareOption{scrreprt}{\def\lock@class{scrreprt}}
\DeclareOption{scrbook}{\def\lock@class{scrbook}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\lock@class}}
\ExecuteOptions{scrbook}
\ProcessOptions\relax
\LoadClass{\lock@class}
The default class is scrbook, but the options scrartcl
or scrreprt
will change it.
In my test I tried with the abstract
option:
\documentclass[abstract]{lockstep}
gives Unused global option(s): [abstract]
, while
\documentclass[scrartcl,abstract]{lockstep}
doesn't show the message.
Based on my comments, here is an answer. To write a document class, all you need (really) is to create a file, say, myclass.cls
, and put it in the same place as your document; then it can be loaded with \documentclass{myclass}
and any macros defined in it will be available to the document. The document clsguide.pdf
that Higgs Boson linked describes all the various structured commands you ought to put in your class in order to give it a standardized appearance. For example, you can declare its version and the version of LaTeX you need it to use, load other packages or classes in it, and accept options in the form \documentclass[option,option2]{myclass}
.
As far as creating a class, no special software is needed. A .cls
file is exactly the same as any .tex
file and you can write it in whatever text editor you normally write LaTeX documents in (perhaps you are using WinEdt, for example?). There are a few questions around this site about what editors are recommended; this one is a pretty big list.
If you are a beginner, you can look at existing classes for inspiration. For example, since you are building an exam class, you might look at exam.cls, which (though quite complex) is well-written and well-commented, so you might learn something about what a document class typically does. Also see their documentation.
I should say that if you are really a beginner, you should not be writing a class at all, and this example of a real documentclass will probably make no sense to you. Start out by defining some new commands and environments in the default article
class. You can spin them off into an independent package later.
Best Answer
I've done some technical reports with LaTeX and learnt something about it. There are some useful packages and classes in CTAN that I've tried.
The first one is
refman
, without recents upgrades but very powerful. Look at this sample and its code.Another try was using KOMA-Script with some customization. Look at a sample and its code. I'm really proud of the results.
Finally, I recently found the
hitec
package that I'm yet trying, sorry for not offering any sample.I hope this could help you.