LaTeX Wiki
No edit summary
Line 12: Line 12:
 
__TOC__
 
__TOC__
 
==Document classes==
 
==Document classes==
  +
{{Main:LaTeX document classes}}
 
Document classes include
 
Document classes include
 
* {{Lcls|article}}
 
* {{Lcls|article}}

Revision as of 06:47, 17 October 2010

The LaTeX language consists of a "preamble" followed by "document text".

\documentclass{class}
… your preamble goes here …
\begin{document}
… your text goes here …
\end{document}

Document classes

Template:Main:LaTeX document classes Document classes include

Preamble

[improvement needed: write section]

Environments

The document text consists of nested environments which are created by matching begin and end commands. Inside an environment the text itself, which is a series of commands (which control how text is formatted) and symbols (which provide the content).

The highest level environment is the document environment, within which all other environments are nested. Environments can be "paragraph mode", "math mode", or "LR mode". The mode controls which commands and sub-environments are allowed.

Within some environments, special characters or commands have specific meanings. Common examples of these are:

  • & ends a column in an array, matrix, or table.
  • \\ ends a line
  • a completely blank line ends a paragraph (in paragraph mode) and is forbidden in math mode.

See the List of LaTeX environments.

Commands

Commands have the form

\commandname[*]{required parameter(s)}[optional parameters]

The optional asterisk following some commands modifies the action of the command.

See the List of LaTeX commands.

Symbols

Symbols have the form

\symbolname[*]{body text} _{subscript} ^{superscript}

As with commands, the optional asterisk modifies the action of some symbols. The _subscript and ^superscript are optional. If the body, subscript or superscript is just one character, the braces can be omitted.

Symbols can be extensible, which means variable-sized, or not.

Some symbols, e.g. \lim and \sum can take limits, which means the subscript and superscript are rendered directly below and above the symbol, rather than to the right of the symbol.

Some symbols, such as parentheses, are paired; A right version of the symbol must be present if the left version is present, and the nesting must be correct for a mathematical formula.

See also


External references