Sonntag, 1. Juni 2014

Define a new latex class

In order to define a new latex class you have to create a new file including the following statements as a header:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{CLASSNAME}[CLASSCOMMENT]
\LoadClass{CLASS_TO_LOAD}

using this header a new class with name CLASSNAME is created (you can also define a comment CLASSCOMMENT) and by using \LoadClass all options of CLASS_TO_LOAD are loaded as predefined. Here as an example a dissertation class, based on the book class is defined:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{dissertation}[class to write a perfect dissertation]
\LoadClass{book}

to load packages (e.g. graphicx) you need to use the following command:
\RequirePackage{graphixc}

in the follwing you can utilize
\newcommand{}{}
\renewcommand{}{}
 to define or change commands.

And use
\AtBeginDocument{}
\AtEndDocument{}
to execute commands at the beginning or end of the document.

Keine Kommentare:

Kommentar veröffentlichen