FANDOM


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

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

Document classesEdit

Main article: LaTeX document class

Document classes include

PreambleEdit

Main article: LaTeX preamble

[improvement needed: write section]

EnvironmentsEdit

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.

SymbolsEdit

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.

CommandsEdit

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 alsoEdit

External referencesEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.