# LaTeX & BibTeX

## Classes in LaTeX

The first line of code in any LaTeX document is the document class declaration command. It is here that we declare the class of which we’d like to build our document around.

`\documentclass{`class_name`}`

So a document starting `\documentclass{article}` may be called “an article document”

A wide variety of classes have been implemented and are available online. A small list of some of the major ones are as follows:

• article - for articles in scientific journals, presentations, short reports, program documentation, etc...
• IEEEtran - for articles with the IEEE Transactions format.
• report - for longer reports containing several chapters, small books, thesis, etc...
• book - for real books
• slides - for slides.
• letter - for writing letters.

In addition to the predefined formatting within a class, the user has the ability to define certain options specific to their document. Class option are to be inserted in between square brackets, [], before the curly braces, {}, that define the class to be used. Multiple options are to be separated by a comma.

\documentclass[option1,option2]`{article}`

Options available to the user are as follows:

10pt, 11pt, 12pt - Sets the size of the main font in the document. If no option is specified, 10pt is assumed.

a4paper, letterpaper, etc... - Defines the paper size. The default size is letterpaper; However, many European distributions of TeX now come pre-set for A4, not Letter, and this is also true of all distributions of pdfLaTeX. Besides that, a5paper, b5paper, executivepaper, and legalpaper can be specified.

fleqn - Typesets displayed formulas left-aligned instead of centered.

leqno - Places the numbering of formulas on the left hand side instead of the right.

titlepage, notitlepage - Specifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do.

onecolumn, twocolumn - Instructs LaTeX to typeset the document in one column or two columns.

twoside, oneside - Specifies whether double or single sided output should be generated. The classes’ article and report are single sided and the book class is double sided by default. Note that this option concerns the style of the document only. The option two side does not tell the printer you use that it should actually make a two-sided printout.

landscape - Changes the layout of the document to print in landscape mode.

openright, openany - Makes chapters begin either only on right hand pages or on the next page available. This does not work with the article class, as it does not know about chapters. The report class by default starts chapters on the next page available and the book class starts them on right hand pages.

draft - makes LaTeX indicate hyphenation and justification problems with a small square in the right-hand margin of the problem line so they can be located quickly by a human. It also suppresses the inclusion of images and shows only a frame where they would normally occur.

As an example, let’s write the document class declaration command for an article with 12pt font and two columns on letter size paper.

\documentclass[12pt,twocolumn,letterpaper]{article}