GraemeMcRae (talk | contribs) |
No edit summary Tags: Visual edit apiedit |
||
(10 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | The LaTeX language consists of a "preamble" followed by "document text". |
+ | The LaTeX language consists of a "preamble" followed by "document text". This page describes, at a high level, what goes into these two sections. |
<div style="padding-left:1cm"> |
<div style="padding-left:1cm"> |
||
<code> |
<code> |
||
Line 5: | Line 5: | ||
… your preamble goes here …<br> |
… your preamble goes here …<br> |
||
\begin{document}<br> |
\begin{document}<br> |
||
− | … your text goes here …<br> |
+ | … your document text goes here …<br> |
\end{document}<br> |
\end{document}<br> |
||
</code> |
</code> |
||
Line 12: | Line 12: | ||
__TOC__ |
__TOC__ |
||
==Document classes== |
==Document classes== |
||
− | {{Main|LaTeX document |
+ | {{Main|LaTeX document class}} |
Document classes include |
Document classes include |
||
* {{Lcls|article}} |
* {{Lcls|article}} |
||
Line 25: | Line 25: | ||
==Environments== |
==Environments== |
||
⚫ | |||
The '''document text''' consists of nested [[environment]]s which are created by matching <code>{{Lcmd|begin}}</code> and <code>{{Lcmd|end}}</code> 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 '''document text''' consists of nested [[environment]]s which are created by matching <code>{{Lcmd|begin}}</code> and <code>{{Lcmd|end}}</code> 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). |
||
Line 33: | Line 34: | ||
* \\ ends a line |
* \\ ends a line |
||
* a completely blank line ends a paragraph (in paragraph mode) and is forbidden in math mode. |
* a completely blank line ends a paragraph (in paragraph mode) and is forbidden in math mode. |
||
− | |||
⚫ | |||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
==Symbols== |
==Symbols== |
||
+ | {{main|List of LaTeX symbols}} |
||
Symbols have the form |
Symbols have the form |
||
<code> |
<code> |
||
Line 57: | Line 48: | ||
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, 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]] |
+ | 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. |
+ | |||
⚫ | |||
+ | {{main|List of LaTeX commands}} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | |||
⚫ | |||
==See also== |
==See also== |
||
* [[Using LaTeX]] |
* [[Using LaTeX]] |
||
* [[List of LaTeX symbols]] |
* [[List of LaTeX symbols]] |
||
− | * [[List of LaTeX environments]] |
+ | * [[List of LaTeX environments]]<!-- |
− | |||
− | ==External references== |
+ | ==External references== page is transcluded from the following source: --> |
+ | {{LaTeX Wiki:External references}} |
||
− | * [http://www.math.brown.edu/~jhs/ReferenceCards/LaTeXRefCard.v2.0.pdf LaTeX reference card] |
||
− | [[Category: |
+ | [[Category:Language reference]] |
Revision as of 07:56, 13 May 2016
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 classes
- Main article: LaTeX document class
Document classes include
Preamble
- Main article: LaTeX preamble
[improvement needed: write section]
Environments
- 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
- 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
- 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.