Difference between revisions of "LaTeX:Layout"

(Document Class)
(Including Packages You'll Need)
Line 19: Line 19:
  
 
==Including Packages You'll Need==
 
==Including Packages You'll Need==
 +
Immediately following the \documentclass statement we usually include all the packages we'll need using \usepackage. The two most common packages to include are the amsmath package, which defines many new mathematical symbols, and the graphicx package, which allows you to include images in your document. So, for instance, many of your documents may begin:
 +
 
==Layout of the Page==
 
==Layout of the Page==
 
==Starting Your Document==
 
==Starting Your Document==

Revision as of 19:37, 10 July 2007

LaTeX
About - Getting Started - Diagrams - Symbols - Downloads - Basics - Math - Examples - Pictures - Layout - Commands - Packages - Help

This article outlines some of the basics of layout in LaTeX.

Note: Rather than typing up all the examples, you can copy-paste the examples into your TeXnicCenter files. We highly recommend opening up your TeXnicCenter and trying out each of the examples as you go. It takes almost no time at all to just copy-paste, compile, and view the results.

Source File Format

The source file of a LaTeX broadly consists of two parts, the preamble and the document itself. The preamble consists of everything before the \begin{document} command. Things like margin settings, document style definitions, paragraph spacing settings, custom function definition and page numeration style are items that are set in the preamble. Often, much of the preamble is placed in a separate file and included using the \usepackage statement. This allows you to use the same code in many source files by just including a single line in each source file.

Our next three sections deal primarily with preamble items, while the rest cover tools you might use within your document.

Document Class

The first line of your source code sets the document class with the cleverly named command \documentclass. While LaTeX supports several classes, such as book, report, and letter, we will be focusing on the document class article in these webpages. Using \documentclass, we can also set the general font size for the document (which we can reset for parts of the document as required). Thus, the first line of your source code will almost always look like this:

\documentclass[11pt]{article}

If you want a slightly larger font, try 12pt. If smaller, go for 10pt.

Should you decide to use one of the other classes, for example if you chose to write a book with LaTeX, we suggest getting a book on LaTeX.

Including Packages You'll Need

Immediately following the \documentclass statement we usually include all the packages we'll need using \usepackage. The two most common packages to include are the amsmath package, which defines many new mathematical symbols, and the graphicx package, which allows you to include images in your document. So, for instance, many of your documents may begin:

Layout of the Page

Starting Your Document

Document Formatting

Paragraphs

Sections

Font Sizes and Styles

Spacing

Justification (Centering, etc).

Tables

Boxes

Lists

Referencing

Comments

See Also