The LaTeX language consists of a "preamble" followed by "document text". This page describes, at a high level, what goes into these two sections.

… your preamble goes here …
… your document text goes here …

Document classes[edit | edit source]

Main article: LaTeX document class

Document classes include

Preamble[edit | edit source]

Main article: LaTeX preamble

[improvement needed: write section]

Environments[edit | edit source]

Main article: List of LaTeX 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.

Symbols[edit | edit source]

Main article: List of LaTeX 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.

Commands[edit | edit source]

Main article: List of LaTeX 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.

See also[edit | edit source]

External references[edit source]
