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.

Are there general rules for when to create a document class vs. creating a package to customize LaTeX? Does one have benefits over the other?

My specific need is to create a customized page layout, but I'm interested in the general response to this question as well.

I did quite a bit of poking around for an answer to this, but surprisingly couldn't find much information.

share|improve this question
4  
Maybe Advantages of a custom class over a package and environment helps. It's actually very simple: packages are supposed to be used with any class. If this is not the case and your style settings are class specific than make an own class which loads the original used class. –  Martin Scharrer Apr 26 '12 at 5:30
    
Highly related IMHO: Style/class tutorials –  tohecz Feb 20 '13 at 14:01

3 Answers 3

up vote 20 down vote accepted

Maybe one could say a package is for extending possibilities, a class is for restricting possibilities.

If you want to add new features which can help users create specific effects in a lot of different document types, a package is for you.

If you want to set sensible defaults and create an optimal environment for efficiently creating documents of a specific type without having to do a lot of customisation, make a class.

There are a lot of fringe cases, of course ;-)

share|improve this answer

In most cases a package is to be preferred. A package allows other people to use your package in combination with different classes. For example the geometry package assists many users across many different classes to change the page geometry of a document.

In your case if all you interested is to change a page layout, you probably better off with a package.

However, a class can be considered if for example you are developing a layout to be used over and over in as for example, Department reports or theses. In this case you do not want your users to have to remember loading the package, but rather load a specific class.

share|improve this answer

Like Stephan writes

Maybe one could say a package is for extending possibilities, a class is for restricting possibilities.

But now you need to make a point : I you need a lot of extending possibilities and to add a restricting possibilities of the class perhaps you need to create a class.

I think if you need specific document like 'homework notebook' or Cookie Recipes . It's perhaps interesting to create a class. The class in this case is to use only for a specific format (layout) and you dont need all the tools like a classic class gives.

Now there is two cases. You can create a class based on another class (a lot of people do this) or you can create a new class from nothing. I do this to create exams and courses because I needed to modify a lot of things ( every things )

Final remark : If you create a class, this document must be very simple. The only purpose is to give a special layout. It's not necessary to do every thing with this document.

share|improve this answer

Your Answer

 
discard

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.