[texhax] my own class/package

Fehd, Ronald J. (CDC/CCHIS/NCPHI) rjf2 at CDC.GOV
Thu Apr 12 16:33:31 CEST 2007


> From: Robin 

> Many thanks for the explanations

you're welcome; I am just one of your assets on texhax
 
> I am working in an information service company, and we are 
> using 3B2 which based on SGML/XML, but we want to develop 
> another typesetting system, the main ideas are:
> 
> 1. still based on SGML/XML
> 2. we have various journal which have various article type, 
> such as book review, normal article and editorial paper etc, 
> so I think I should write classes for all different article 
> types (also different journals)

you have some choices:
* different class for each article type
  e.g.:
%\documentclass{article}%standard LaTeX
%\documentclass{refrep}%%standard LaTeX

%\documentclass{CWbookreview}%%in-house 
%\documentclass{CWarticle}%%in-house 
%\documentclass{CWeditorial}%%in-house 

* one class with parameter of article type
%\documentclass{CWarticle}%%in-house 
%\documentclass[bookreview]{CWarticle}%%in-house 
%\documentclass[editorial]{CWarticle}%%in-house 

from my own perspective as a programmer
I would recommend that you review the standard LaTeX classes first
* make CWarticle first by copying e.g. article.cls
* make CWbookreview, etc. 

Next year, you can consolidate each of your classes
into your CW<Does-It-All> class with parameters

The reason I suggest the above process is:
* you have to learn to read TeX in order to write a class or package
  warning: learning curve ahead
           steepness associated 
                  or correlated with your programming expertise
* having to learn the boolean and testing features of TeX
  while you are writing, testing, and developing a class 
  makes the learning curve steeper

summary: KIS: Keep It Simple
* find something that works
* copy it: keep it working
loop:   modify it: keep it working
        when satisfied, goto done
repeat: go to loop
done  : "Hey boss, check this out!" 

The easiest way, of course, is not to write a class,
but a package:
just add, change or delete what the standard class does

%\documentclass{article}%
\usepackage{CWarticle}
%\usepackage{CWbookreview}

hth

Ron Fehd  the {SAS} macro maven  CDC Atlanta GA USA RJF2 at cdc dot gov



More information about the texhax mailing list