TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In LaTeX, we modify a predefined documentclass to fit our need. I wonder how we can edit the original documentclass (e.g. article) to have our customized properties? I mean which file is responsible for the article documentclass and should be edited to be customized?

I've seen some customized templates (.cls files), but they are indeed templates NOT class, as they somehow use the original class by \LoadClass.

NOTE: The tag documentclass-writing was very useful for finding interesting questions/answers, but the case is not what I meant to customize an original class of LaTeX.

share|improve this question
Would this answer your question? Style/class tutorials – ArTourter Apr 16 '12 at 9:02
@ArTourter the main answer is based on \LoadClass{article}. Am I wrong or missed something? – All Apr 16 '12 at 9:05
.cls files are indeed class files, i.e. article is provided by article.cls and \documentclass{foo} always loads foo.cls. Never ever edit existing class or package files. It is a mess and even against the license. Instead make a copy (e.g. myarticle.cls) and modify that one. – Martin Scharrer Apr 16 '12 at 9:06
There are no "templates" with LaTeX. A class can be based on another class (and modified classes should be most the time!) by loading the base class using \LoadClass. That's perfectly fine! – Martin Scharrer Apr 16 '12 at 9:07
also in that same page there is an answer linking to the cls guide that may be of some help. – ArTourter Apr 16 '12 at 9:11
up vote 8 down vote accepted

You seem to confuse some things and terms here.

You should never edit existing class or package files, at least not without changing the file name. This is a major point of the LPPL license. If you want to customize a class rename it and make your changes there. Even better would be to load the existing class using \LoadClass or \LoadClassWithOptions and then (re-)define all macros and settings the way you want it.

Every class files is located in <name>.cls file, if it is an "original" class or a derived class (i.e. based on another class). There are no "templates" in LaTeX. People keep using this expression and keep confusing it with class files.

share|improve this answer
Strictly speaking, the LPPL license doesn't prohibit changing a class/style keeping the same name. But this is discouraged by the community. – egreg Apr 16 '12 at 11:15
@egreg: Wasn't this part of the older versions but was changed to allow distributions like Debian to make minor changes to the code? I can remember that the Debian people didn't regarded the license as free enough because of that before. – Martin Scharrer Apr 16 '12 at 11:20
@MartinScharrer My question was if this is possible. Regarding the terminology, I meant creating an independent class which does not rely on an available class (with \LoadClass). You idea for copying the class to a new independent one is practical enough! – All Apr 16 '12 at 11:23
@MartinScharrer Yes, the "change the name if you modify" clause was weakened to get LPPL recognized as a free license. – egreg Apr 16 '12 at 12:34
@Ali -- the downside to copying, renaming and modifying an existing .cls file is that when/if bugs are corrected in that file, these corrections will not be reflected in the modified file -- a maintenance nightmare. using \LoadClass gives the advantage of someone else doing the maintenance, although of course it's necessary to understand the original .cls file in any event. – barbara beeton Apr 16 '12 at 14:36

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.