[Tex/LaTex] How to customize a document class

document-classesdocumentclass-writing

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.

Best Answer

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.