Working with .cls file in LaTeX

Normally, LaTeX provide predefined class to work like article, report, Book, elsarticle etc. But sometimes we need special features in our document, I can say when we need sudo power on document then we can create our own .cls file. .cls file provide code reusability. It means that whenever  you need similar feature in future projects. Then you just need to put name of your .cls that you have created earlier. Just do following to create and use own .cls file.

Firstly create .cls file and save it with any name for example: Dhiman_article.cls


\ProvidesClass{Dhiman_article}[2016/05/3 Dhiman custom class]

%put your code and formatting that you want to reuse.

Note : Must ensure that if you are creating your own .cls file then you don’t have a need to include article or any \documentclass explicitly in .tex file. You just load required main class in your custom .cls file.

Now use your custom .cls in your .tex file


%%%%%% Content here%%%%%



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s