LaTex: Difference between revisions

From Electrical Installation Guide
No edit summary
Line 1: Line 1:
{{raccourci|WP:TEX|WP:LATEX}}
<noinclude>{{LaTeX/Top}}</noinclude>
Depuis janvier 2003, les formules mathématiques sur Wikipédia peuvent être écrites avec {{LaTeX|lien}}.


Cette syntaxe est beaucoup plus facile à écrire et à lire que l'[[Hypertext markup language|HTML]]. Les formules sont présentées en HTML si possible, autrement une image [[Portable Network Graphics|PNG]] est produite par le serveur. Ce comportement par défaut peut être configuré dans les [[Special:Preferences|préférences]].
One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulas, whilst looking professional when printed. The fact that he succeeded was most probably why TeX (and later on, LaTeX) became so popular within the scientific community. Regardless of the history, typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation.


Pour des raisons d'[[Projet:Charte graphique/Accessibilité|accessibilité des pages aux mal-voyants]] et de lisibilité, il est recommandé d'utiliser, dans le texte, une syntaxe TeX qui ne génère pas d'image PNG, et de réserver la syntaxe plus élaborée aux formules hors-texte.
If you are writing a document that needs only a few simple mathematical formulas, then you can generally use plain LaTeX: it will give you most of the tools you need. However, if you are writing a scientific document that contains numerous complicated formulas, it is highly recommended that you use the <code>amsmath</code> package, which introduces several new commands that are more powerful and flexible than the ones provided by plain LaTeX. To use this, include:
{|
|<source lang="latex">
\usepackage{amsmath}
</source>
|}
in the preamble of the document.


== Syntaxe générale ==
== Mathematics environments ==


Les formules s'écrivent entre <code><nowiki><math> … </math></nowiki></code>.
LaTeX needs to know beforehand that the subsequent text does in fact contain mathematical elements. This is because LaTeX typesets maths notation differently than normal text. Therefore, special environments have been declared for this purpose. They can be distinguished into two categories depending on how they are presented:


=== Commandes et environnements ===
* ''text'' - text formulas are displayed in-line, that is, within the body of text where it is declared. e.g., I can say that ''a'' + ''a'' = 2''a'' within this sentence.
* ''displayed'' - displayed formulas are separate from the main text.
 
As maths require special environments, there are naturally the appropriate environment names you can use in the standard way. Unlike most other environments, however, there are some handy shorthands to declaring your formulas. The following table summarizes them:
 
{|{{prettytable}}
! Type
! Environment
! LaTeX shorthand
! TeX shorthand
|-
| Text
| <code>\begin{math}...\end{math}</code>
| <code>\(...\)</code>
| <code>$...$</code>
|-
| Displayed
| <code>\begin{displaymath}...\end{displaymath}</code> or
<code>\begin{equation*}...\end{equation*}</code><ref name="amsmath"/>
| <code>\[...\]</code>
| <code>$$...$$</code>
|}
'''Note:''' Using the <code>$$...$$</code> should be avoided, as it may cause problems, particularly with the AMS-LaTeX macros. Furthermore, should a problem occur, the error messages may not be helpful.


Les '''commandes''' commencent par une contre-oblique <code>\</code>, suivie :
Additionally, there is a second possible environment for the ''displayed'' type of formulas: <code>equation</code>. The difference between this and <code>displaymath</code> is that <code>equation</code> also adds sequential equation numbers by the side.
* soit d'un nom composé uniquement de lettres [[diacritique|non diacritées]]. Une [[espace (typographie)|espace]], un chiffre ou tout autre caractère clôturent le nom, ex : <code>x\mapsto2</code>&nbsp;<math>x\mapsto2</math> ;
* soit d’un seul caractère spécial (non-lettre), ex : <code>\#</code> <math>\#</math>


Les caractères <code>+ - = / ' | * < > ( )</code>, les [[chiffre arabe|chiffres arabes]] et les lettres de l'[[alphabet]] non diacritées peuvent être tapés directement. Les autres symboles doivent être créés avec les commandes appropriées : les caractères réservés <code># $ % ^ & _ { } ~ \</code> sont obtenus respectivement par <code>\# \$ \% \^ \& \_ \{ \} \~ \backslash</code>.
If you are typing text normally, you are said to be in ''text mode'', while you are typing within one of those mathematical environments, you are said to be in ''math mode'', that has some differences compared to the ''text mode'':
# Most spaces and line breaks do not have any significance, as all spaces are either derived logically from the mathematical expressions, or have to be specified with special commands such as <code>\quad</code>
# Empty lines are not allowed. Only one paragraph per formula.
# Each letter is considered to be the name of a variable and will be typeset as such. If you want to typeset normal text within a formula (normal upright font and normal spacing) then you have to enter the text using [[#Adding text to equations|dedicated commands.]]


Une commande peut accepter un ou plusieurs '''arguments'''. Les arguments obligatoires doivent former un bloc au sens de {{LaTeX|lien}} : s'ils ne font qu'un caractère de long, ils peuvent être écrits tels quels : <code>\sqrt x</code>&nbsp; donne <math>\sqrt x</math>  ; sinon, ils doivent être délimités par des accolades : <code>\sqrt{xyz}</code>&nbsp;<math>\sqrt{xyz}</math>. Les commandes elles-mêmes sont aussi considérées comme des blocs : <code>\sqrt\frac12</code> donne <math>\sqrt\frac 1 2</math> et pas <math>\sqrt\backslash frac12</math>.
== Symbols ==


Des premières règles ci-dessus, on déduit qu'on peut omettre l'espace entre la commande et son premier argument, si celui-ci n'est pas un caractère accepté dans un nom de commande : <code>\sqrt2</code> est équivalent à <code>\sqrt 2</code> ou <code>\sqrt{2}</code>, mais <code>\sqrtx</code> n'est pas valide et doit être écrit <code>\sqrt x</code>. À l'inverse, on peut écrire autant d'espaces et de sauts à la ligne que l'on désire.
Mathematics has lots and lots of symbols! If there is one aspect of maths that is difficult in LaTeX it is trying to remember how to produce them. There are of course a set of symbols that can be accessed directly from the keyboard:


Les arguments facultatifs sont entre crochets, avant les arguments obligatoires : <math>\sqrt{2}</math>
+ - = ! / ( ) [ ] < > | ' :


Les '''environnements''' sont des régions dans lesquelles sont appliquées certaines règles particulières ; ils forment un contexte spécifique. Ils commencent par <code>\begin{''nom de l'environnement''}</code> et se terminent par <code>\end{''nom de l'environnement''}</code>. Par exemple, <code>\begin{bmatrix}a & b \\ c & d\end{bmatrix}</code> donne :
Beyond those listed above, distinct commands must be issued in order to display the desired symbols. And there are ''a lot!'' Greek letters, set and relations symbols, arrows, binary operators, etc. Too many to remember, and in fact, they would overwhelm this tutorial if I tried to list them all. Therefore, for a complete reference document, see the external link at the bottom of the page.
:<math>\begin{bmatrix}a & b \\ c & d\end{bmatrix}</math>


On distingue les commandes « locales » ou « ponctuelles » des commandes « globales », appelées ''commutateurs''. Les premières ne s'appliquent qu'à leur argument : <code>\mathrm ABC</code>&nbsp;<math>\mathrm ABC~</math> ; les secondes s'appliquent à tout le texte jusqu'à la fin du groupe : <code>\rm ABC</code>&nbsp;<math>\rm ABC~</math>. Un groupe peut être un environnement entier, l'argument d'une commande ou être créé – délimité – à l'aide d'accolades : <code>{\rm A}BC</code>&nbsp;<math>{\rm A}BC~</math>. Généralement, les commutateurs sont des versions obsolètes mais plus courtes des commandes locales.
{|
|<source lang=latex>
\[
\forall x \in X, \quad \exists y \leq \epsilon
\]
</source>
|style="padding-left:20px"|<math>
\forall x \in X, \quad \exists y \leq \epsilon
\,</math>
|}


===Forcer la génération en PNG===
===Greek letters===
Pour forcer une formule à être générée en PNG, il suffit d'ajouter un [[tilde]] en fin de formule :
<code>a(1+e^2/2)</code> donne <math>a(1+e^2/2)</math>, mais
<code>a(1+e^2/2)~</code> donne <math>a(1+e^2/2)~</math>.


'''Ceci ne doit être utilisé qu'exceptionnellement .'''
Greek letters are commonly used in mathematics, and they are very easy to type in ''math mode''. You just have to type the name of the letter after a backslash: if the first letter is lowercase, you will get a lowercase Greek letter, if the first letter is uppercase (and only the first letter), then you will get an uppercase letter. Note that some uppercase Greek letters look like Latin ones, so they are not provided by LaTeX (e.g. uppercase ''Alpha'' and ''Beta'' are just "A" and "B" respectively).
Theta, Phi, and Sigma are provided in two different versions:


===Taille===
{|
Pour modifier la taille des formules, on peut utiliser les commutateurs <code>\displaystyle</code>, <code>\textstyle</code>, <code>\scriptstyle</code> et <code>\scriptscriptstyle</code> :
#La taille <code>displaystyle</code> est la taille par défaut, l'équation dépasse toujours de la hauteur de ligne.
#:<code>\frac12</code> ou <code>\displaystyle\frac12</code> donne <math>\frac12</math>
#<code>textstyle</code> est la taille d'une équation composée d'une seule ligne et sans grand symbole, elle est équivalente à <code>displaystyle</code> dans ce cas-là, sinon elle est plus petite. Elle dépasse néanmoins toujours la hauteur de ligne.
#:<code>\textstyle\frac12</code> donne <math>\textstyle\frac12</math> mais <code>\textstyle a</code> est équivalent à <code>a</code> et donne <math>\textstyle a</math>.
#<code>scriptstyle</code> est la taille des [[#Indices, exposants|exposants et indices]]. Si elle est composée d'une seule ligne, elle est contenue dans la hauteur de ligne, sinon elle la dépasse très légèrement.
#:<code>\scriptstyle\frac12</code> donne <math>\scriptstyle\frac12</math>.
#<code>scriptscriptstyle</code> est la plus petite. C'est la seule qui permette de faire entrer une équation de plusieurs lignes à l'intérieur d'une hauteur de ligne.
#:<code>\scriptscriptstyle\frac12</code> donne <math>\scriptscriptstyle\frac12</math>.
{| class="wikitable"
! Formule !! displaystyle !! textstyle !! scriptstyle !! scriptscriptstyle
|-
|-
|<code>a</code>
|<source lang="latex">
|<math>a</math>
\[
|<math>\textstyle a</math>
\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \mu,
|<math>\scriptstyle a</math>
\theta, \vartheta, \phi, \varphi, \omega, \sigma, \varsigma,
|<math>\scriptscriptstyle a</math>
\Gamma, \Delta, \Theta, \Phi, \Omega
\]
</source>
|style="padding-left:20px"|<math>\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \mu, \theta,
\vartheta, \phi, \varphi, \omega, \sigma, \varsigma,
\Gamma, \Delta, \Theta, \Phi, \Omega</math>
|-
|-
|<code>\frac ab</code>
|}
|<math>\frac ab</math>
 
|<math>\textstyle\frac ab</math>
== Operators ==
|<math>\scriptstyle\frac ab</math>
An operator is a function that is written as a word: e.g. trigonometric functions (sin, cos, tan), logarithms and exponentials (log, exp). LaTeX has many of these defined as commands:
|<math>\scriptscriptstyle\frac ab</math>
{|
|<source lang=latex>
\[
\cos (2\theta) = \cos^2 \theta - \sin^2 \theta
\]
</source>
|style="padding-left:20px"|<math>\cos (2\theta) = \cos^2 \theta - \sin^2 \theta \,</math>
|}
 
For certain operators such as [[w:Limit (mathematics)|limits]], the subscript is placed underneath the operator:
{|
|<source lang=latex>
\[
\lim_{x \to \infty} \exp(-x) = 0
\]
</source>
|style="padding-left:20px"|<math>\lim_{x \to \infty} \exp(-x) = 0</math>
|}
 
For the [[w:Modular arithmetic|modular operator]] there are two commands: <code>\bmod</code> and <code>\pmod</code>:
{|
|<source lang=latex>
\[
a \bmod b
\]
</source>
|style="padding-left:20px"|<math>
a \, \bmod \, b
\,</math>
|-
|-
|<code>\tfrac ab</code>
|<source lang=latex>
|<math>\tfrac ab</math>
\[
|<math>\textstyle\tfrac ab</math>
x \equiv a \pmod b
|<math>\scriptstyle\tfrac ab</math>
\]
|<math>\scriptscriptstyle\tfrac ab</math>
</source>
|style="padding-left:20px"|<math>
x \equiv a \pmod b
\,</math>
|}
 
To use operators which are not pre-defined, such as [[w:argmax|argmax]], see [[../Advanced Mathematics#Custom operators|custom operators]]
 
== Powers and indices ==
Powers and indices are equivalent to superscripts and subscripts in normal text mode. The caret (<code>^</code>) character is used to raise something, and the underscore (<code>_</code>) is for lowering. If more than one expression is raised or lowered, they should be grouped using curly braces (<code>{</code> and <code>}</code>).
{|
|<source lang=latex>
\[
k_{n+1} = n^2 + k_n^2 - k_{n-1}
\]
</source>
|style="padding-left:20px"|<math>
k_{n+1} = n^2 + k_n^2 - k_{n-1}
\,</math>
|}
 
== Fractions and Binomials ==
A fraction is created using the <code>\frac{''numerator''}{''denominator''}</code> command. (For those who need their memories refreshed, that's the ''top'' and ''bottom'' respectively!). Likewise, the [[w:Binomial coefficient|binomial coefficient]] (aka the Choose function) may be written using the <code>\binom</code> command
{|
|<source lang=latex>
\[
\frac{n!}{k!(n-k)!} = \binom{n}{k}
\]
</source>
|style="padding-left:20px"|<math>
\frac{n!}{k!(n-k)!} = \binom{n}{k}
\,</math>
|}
 
You can also embed fractions within fractions:
{|
|<source lang=latex>
\[
\frac{\frac{1}{x}+\frac{1}{y}}{y-z}
\]
</source>
|style="padding-left:20px"|<math>
\frac{\frac{1}{x}+\frac{1}{y}}{y-z}
\,</math>
|}
Note that when appearing inside another fraction, or in inline text <math>\tfrac{a}{b}</math>, a fraction is noticeably smaller than in displayed mathematics. The <code>\tfrac</code> and <code>\dfrac</code> commands<ref name="amsmath"/> force the use of the respective styles (similarly the <code>\tbinom</code> and <code>\dbinom</code> commands do the same for the binomial coefficient).
 
For relatively simple fractions, it may be more aesthetically pleasing to use [[#Powers and indices|powers and indices]]:
{|
|<source lang=latex>
\[
^3/_7
\]
</source>
|style="padding-left:20px"|<math>
^3/_7
\,</math>
|}
 
== Roots ==
The <code>sqrt</code> command creates a square root surrounding an expression. It accepts an optional argument specified in square brackets (<code>[</code> and <code>]</code>) to change magnitude:
{|
|<source lang=latex>
\[
\sqrt{\frac{a}{b}}
\]
</source>
|style="padding-left:20px"|<math>
\sqrt{\frac{a}{b}}
\,</math>
|-
|<source lang=latex>
\[
\sqrt[n]{1+x+x^2+x^3+\ldots}
\]
</source>
|style="padding-left:20px"|<math>
\sqrt[n]{1+x+x^2+x^3+\ldots}
\,</math>
|}
 
 
Some people prefer writing the square root "closing" it over its content. This method arguably makes it more clear just what is in the scope of the root sign. This habit is not normally used while writing with the computer because the text is supposed to be clear anyway, but if you want to change the output of the square root anyway, LaTeX gives you this possibility. Just add the following code in the preamble of your document:
{|
|<source lang="latex">
% New definition of square root:
% it renames \sqrt as \oldsqrt
\let\oldsqrt\sqrt
% it defines the new \sqrt in terms of the old one
\def\sqrt{\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{%
\setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}
</source>
|[[Image:Latex_new_squareroot.png|thumb|right|250px|The new style is on left, the old one on right]]
|}
This TeX code first renames the <tt>\sqrt</tt> command as <tt>\oldsqrt</tt>, then redefines <tt>\sqrt</tt> in terms of the old one, adding something more. The new square root can be seen in the picture on the right, compared to the old one. Unfortunately this code won't work if you want to use multiple roots: if you try to write <math>\sqrt[b]{a}</math> as <tt>\sqrt[b]{a}</tt> after you used the code above, you'll just get a wrong output. In other words, you can redefine the square root this way only if you are not going to use multiple roots in the whole document.
 
== Sums and integrals ==
The <code>\sum</code> and <code>\int</code> commands insert the sum and integral symbols respectively, with limits specified using the caret (<code>^</code>) and underscore (<code>_</code>):
{|
|<source lang=latex>
\[
\sum_{i=1}^{10} t_i
\]
</source>
|style="padding-left:20px"|<math>
\sum_{i=1}^{10} t_i
\,</math>
|-
|-
|<code>\dfrac ab</code>
|<source lang=latex>
|<math>\dfrac ab</math>
\[
|<math>\textstyle\dfrac ab</math>
\int_0^\infty e^{-x} \, dx
|<math>\scriptstyle\dfrac ab</math>
\]
|<math>\scriptscriptstyle\dfrac ab</math>
</source>
|style="padding-left:20px"|<math>
\int_0^\infty e^{-x} \, dx
\,</math>
|}
 
There are many other "big" commands which operate in a similar manner:
{|
| <code>\sum</code> || <math>\sum \,</math>  
|style="padding-left:20px"|
| <code>\prod</code> || <math>\prod</math>  
|style="padding-left:20px"|
| <code>\coprod</code> || <math>\coprod</math>  
|-
|-
|<code>\sum_a^b</code>
| <code>\bigoplus</code> || <math>\bigoplus</math>  
|<math>\sum_a^b</math>
|style="padding-left:20px"|
|<math>\textstyle\sum_a^b</math>
| <code>\bigotimes</code> || <math>\bigotimes</math>  
|<math>\scriptstyle\sum_a^b</math>
|style="padding-left:20px"|
|<math>\scriptscriptstyle\sum_a^b</math>
| <code>\bigodot</code> || <math>\bigodot</math>  
|-
|-
|<code>\frac{\sum_a^b}{\sum_a^b}</code>
| <code>\bigcup</code> || <math>\bigcup</math>  
|<math>\frac{\sum_a^b}{\sum_a^b}</math>
|style="padding-left:20px"|
|<math>\textstyle\frac{\sum_a^b}{\sum_a^b}</math>
| <code>\bigcap</code> || <math>\bigcap</math>  
|<math>\scriptstyle\frac{\sum_a^b}{\sum_a^b}</math>
|style="padding-left:20px"|
|<math>\scriptscriptstyle\frac{\sum_a^b}{\sum_a^b}</math>
| <code>\biguplus</code> || <math>\biguplus</math>  
|-
|-
|+ Quelques exemples
| <code>\bigsqcup</code> || <math>\bigsqcup</math>
|style="padding-left:20px"|
| <code>\bigvee</code> || <math>\bigvee</math>
|style="padding-left:20px"|
| <code>\bigwedge</code> || <math>\bigwedge</math>
|-
| <code>\int</code> || <math>\int</math>
|style="padding-left:20px"|
| <code>\oint</code> || <math>\oint</math>
|style="padding-left:20px"|
| <code>\iint</code><ref name="amsmath"/> || <math>\iint</math>
|-
| <code>\iiint</code><ref name="amsmath"/> || <math>\iiint</math>
|style="padding-left:20px"|
| <code>\iiiint</code><ref name="amsmath"/> || <math>\iiiint</math>
|style="padding-left:20px"|
| <code>\idotsint</code><ref name="amsmath"/> || <math>\int \! \cdots \! \int</math>
|}
 
For more integral symbols, including those not included by default in the Computer Modern font, try the <tt>esint</tt> package. The <code>\substack</code> command<ref name="amsmath"/> allows the use of <code>\\</code> to write the limits over multiple lines:
{|
|<source lang=latex>
\[
\sum_{\substack{
  0<i<m \\
  0<j<n
  }}
P(i,j)
\]
</source>
|style="padding-left:20px"|<math>
\sum_{\overset{\scriptstyle 0<i<m} {\scriptstyle 0<j<n}} P(i,j)
\,</math>
|}
 
If you want the limits of an integral to be specified above and below the symbol (like the sum), use the <code>\limits</code> command:
{|
|<source lang=latex>
\[
\int\limits_a^b
\]
</source>
|style="padding-left:20px"|<math>
\int\limits_a^b
\,</math>
|}
However if you want this to apply to ALL integrals, it is preferable to specify the <code>intlimits</code> option when loading the <code>amsmath</code> package:
{|
|<source lang="latex">
\usepackage[intlimits]{amsmath}
</source>
|}
 
== Brackets, braces and delimiters ==
 
The use of delimiters such as brackets soon becomes important when dealing with anything but the most trivial equations. Without them, formulas can become ambiguous. Also, special types of mathematical structures, such as matrices, typically rely on delimiters to enclose them.
 
There are a variety of delimiters available for use in LaTeX:
{|
|<source lang=latex>
\[
() \, [] \, \{\} \, || \, \|\| \,
\langle\rangle \, \lfloor\rfloor \, \lceil\rceil
\]
</source>
|style="padding-left:20px"|<math>
() \, [] \, \{\} \, || \, \|\| \, \langle\rangle \, \lfloor\rfloor \, \lceil\rceil
\,</math>
|}
|}


===Ponctuation===
=== Automatic sizing ===
Selon le [[Référence:Lexique des règles typographiques en usage à l'Imprimerie nationale#2002|''Lexique des règles typographiques en usage à l'Imprimerie nationale'' éd. 2002]], p. 110, la ponctuation s'applique aux formules mathématiques, y compris celles qui sont centrées. Elles doivent donc notamment comporter un point si c'est la fin d'une phrase. Ce point pourra être en dehors de la formule elle-même (après la balise <code>&lt;/math&gt;</code>).
Very often mathematical features will differ in size, in which case the delimiters surrounding the expression should vary accordingly. This can be done automatically using the <code>left</code> and <code>right</code> commands. Any of the previous delimiters may be used in combination with these:
{|
|<source lang=latex>
\[
\left(\frac{x^2}{y^3}\right)
\]
</source>
|style="padding-left:20px"|<math>
\left(\frac{x^2}{y^3}\right)
\,</math>
|}
If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may be denoted using a period (<code>.</code>).


===Aide===
=== Manual sizing ===
Si vous éprouvez des difficultés, n'hésitez pas à demander de l'aide aux [[:Catégorie:Utilisateur TeXnicien|utilisateurs TeXniciens]] ou à vous rendre sur l'[[Wikipédia:atelier TeX|atelier {{TeX}}]].
In certain cases, the sizing produced by the <code>left</code> and <code>right</code> commands may not be desirable, or you may simply want finer control over the delimiter sizes. In this case, the <code>big</code>, <code>Big</code>, <code>bigg</code> and <code>Bigg</code> modifier commands may be used:
{|
|<source lang=latex>
\[
( \big( \Big( \bigg( \Bigg(
\]
</source>
|style="padding-left:20px"|<math>
( \big( \Big( \bigg( \Bigg(
\,</math>
|}


== Catalogue ==
== Matrices and arrays ==
{| class="wikitable"
A basic matrix may be created using the <code>matrix</code> environment<ref name="amsmath">requires the <code>amsmath</code> package</ref>: in common with other table-like structures, entries are specified by row, with columns separated using an ampersand (<code>&</code>) and a new rows separated with a double backslash (<code>\\</code>)
! Fonctionnalité !! Syntaxe !! À quoi ça ressemble
{|
|-----
|<source lang=latex>
| [[Diacritique]]s
\[
| \hat o \acute o \dot o \ddot o \vec o \check o \grave o \breve o \widehat {abc} \tilde o \bar o
\begin{matrix}
| <math>\hat o \; \acute o \; \dot o \; \ddot o \; \vec o \; \check o \; \grave o \; \breve o \; \widehat {abc} \; \tilde o \; \bar o \; </math>
  a & b & c \\
|-----
  d & e & f \\
|rowspan="2"|Texte dans une formule
  g & h & i
|\text{Texte sans accent}
\end{matrix}
|<math>\text{Texte sans accent}</math>
\]
|-----
</source>
|\mathrm{Texte~accentu\acute e}
|style="padding-left:20px"|<math>
|<math>\mathrm{Texte~accentu\acute e}</math>
\begin{matrix}
|-----
a & b & c \\
|Opérateurs binaires
d & e & f \\
|\star \times \circ \cdot \bullet \cap \cup \sqcup \vee \wedge<br />\odot \oslash \oplus \ominus \otimes \div \pm \mp \triangle \triangleleft \triangleright
g & h & i
|<math> \star\ \times\ \circ\ \cdot\ \bullet\ \cap\ \cup\ \sqcup\ \vee\ \wedge</math> <math>\odot\ \oslash\ \oplus\ \ominus\ \otimes\ \div\ \pm\ \mp\ \triangle\ \triangleleft\ \triangleright </math>
\end{matrix}
|-----
</math>
|Opérateurs n-aires
|}
|\sum \prod \coprod \int \iint \iiint \iiiint \oint<br/>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus
However matrices are usually enclosed in delimiters of some kind, and while it is possible to use the [[#Automatic sizing|<code>\left</code> and <code>\right</code> commands]], there are various other predefined environments which automatically include delimiters:
|<math>\sum \prod \coprod \int \iint \iiint \iiiint \oint\quad</math> <math>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus</math>
{|class="wikitable"
|-----
! Environment name
|[[Ellipse]]s
! Surrounding delimiter
|x + \cdots + y ''ou'' x + \ldots + y
|<math>x + \cdots + y</math> ''ou'' <math>x + \ldots + y\,</math>
|----
|Délimiteurs
|( ) [ ] \{ \} \lfloor \rfloor \lceil \rceil \langle \rangle / \backslash <nowiki>| \|</nowiki>
|<math>( \; ) \; [ \; ] \; \{ \; \} \; \lfloor \; \rfloor \; \lceil \; \rceil \; \langle \; \rangle \; / \; \backslash \; | \; \|</math>
|-----
|Fonctions std. (mal)
|sin x
|<math>sin x\,</math>
|-----
|rowspan="3"|Fonctions standard (bien)
|\sin x
|<math>\sin x\,</math>
|-----
|\sin(x)
|<math>\sin(x)\,</math>
|-----
|\sin{(x)}
|<math>\sin{(x)}\,</math>
|-----
|Fonctions non std.
|\operatorname{fonction}
|<math>\operatorname{fonction}\,</math>
|-----
|[[Fonction trigonométrique|Fonctions trigonométriques]]
|\sin \cos \tan \cot \sec \csc \operatorname{tg}
|<math>\sin\ \cos\ \tan\ \cot\ \sec\ \csc\,\operatorname{tg}</math>
|-----
|Fonctions trigonométriques réciproques
|\arcsin \arccos \arctan
|<math>\arcsin\ \arccos\ \arctan\,</math>
|-----
|[[Fonction hyperbolique|Fonctions hyperboliques]]
|\sinh \cosh \tanh \coth
|<math>\sinh\ \cosh\ \tanh\ \coth\,</math>
|-----
|Fonctions d'[[analyse (mathématiques)|analyse]]
|\lim \sup \inf \limsup \liminf \log \ln \lg \exp \arg \min \max
|<math>\lim \sup \inf \limsup \liminf \log \ln \lg \exp \arg \min \max\,</math>
|-----
|Fonctions d'[[algèbre]]
|\det \deg \dim \hom \ker
|<math>\det \deg \dim \hom \ker</math>
|-----
|[[Arithmétique modulaire]]
|a \equiv b \pmod c ''ou'' b \bmod c
|<math>a \equiv b \pmod c\,</math> ''ou'' <math>b\bmod c\,</math>
|-----
|[[Probabilités]]
|\Pr
|<math>\Pr</math>
|-----
|[[Dérivée]]s
|\nabla \partial x \mathrm{d}x \dot x \ddot x
|<math>\nabla\ \partial x\ \mathrm dx\ \dot x\ \ddot x</math>
|-----
|rowspan="2" | [[Racine (mathématiques)|Racine]]s
|\sqrt 2\approx 1,4
|<math>\sqrt 2\approx 1,4</math>
|-----
|\sqrt[n]{x}
|<math>\sqrt[n]{x}</math>
|-----
|[[Norme (mathématiques)|Norme]]
|<nowiki>\| x \|</nowiki>
|<math>\|x\|</math>
|-----
|[[Logique mathématique|Logique]]
|\forall \exists \lnot \land \lor \to \leftrightarrow \Rightarrow \Leftrightarrow \vdash \models
|<math>\forall\ \exists\ \lnot\ \land\ \lor\ \to\ \leftrightarrow\ \Rightarrow\ \Leftrightarrow\ \vdash\ \models</math>
|-----
|[[Ensemble]]s
|\empty \varnothing \cap \cup \setminus \smallsetminus
|<math>\empty\ \varnothing\ \cap\ \cup\ \setminus\ \smallsetminus</math>
|-----
|rowspan="2"|Relations d'[[ensemble]]s
|\subset \subseteq \supset \supseteq \in \ni \notin
|<math>\subset \; \subseteq \; \supset \; \supseteq \; \in \; \ni \; \notin </math>
|-----
|\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup
|<math>\sqsubset\ \sqsubseteq\ \sqsupset\ \sqsupseteq\ \sqcap\ \sqcup\ \bigsqcup</math>
|-----
|[[Correspondance et relation|Relations]] <small>(à nier par le préfixe \not)</small>
|\sim \simeq \cong < > \le \ge \leqslant \geqslant \ll \gg \lll \ggg \equiv \approx = \neq \propto
|<math> \sim \ \simeq \ \cong\ <\ >\ \le\ \ge\ \leqslant\ \geqslant\ \ll\ \gg\ \lll\ \ggg\ \equiv \ \approx\ =\ \neq\ \propto</math>
|-----
|[[Géométrie]]
|\Diamond \Box \square \triangle \angle \perp \mid \nmid \parallel 45^\circ
|<math> \Diamond \; \Box \;\square\; \triangle \; \angle \; \perp \; \mid \; \nmid \; \parallel \; 45^\circ</math>
|-----
| rowspan="4" | Flèches
|\leftarrow \rightarrow \to \leftrightarrow \longleftarrow \longrightarrow\ \longleftrightarrow \nearrow \searrow \swarrow \nwarrow \uparrow \downarrow \updownarrow<br />
\mapsto \longmapsto \hookleftarrow \hookrightarrow \rightharpoonup \leftharpoonup \rightharpoondown \leftharpoondown  \rightleftharpoons
|<math>\leftarrow\ \rightarrow\ \to\ \leftrightarrow\ \longleftarrow\ \longrightarrow\ \longleftrightarrow\ \nearrow\ \searrow\ \swarrow\ \nwarrow\ \uparrow\ \downarrow\ \updownarrow</math>
<math>\mapsto\ \longmapsto\ \hookleftarrow\ \hookrightarrow \rightharpoonup\ \leftharpoonup\ \rightharpoondown\ \leftharpoondown\  \rightleftharpoons</math>
|-----
|\leftrightharpoons \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \Rrightarrow \rightarrowtail \looparrowright \curvearrowright \circlearrowright \Rsh \downdownarrows \multimap \leftrightsquigarrow \rightsquigarrow \nLeftarrow \nleftrightarrow \nRightarrow \nLeftrightarrow
|<math>\leftrightharpoons \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \Rrightarrow \rightarrowtail \looparrowright</math><math>\curvearrowright \circlearrowright \Rsh \downdownarrows \multimap \leftrightsquigarrow \rightsquigarrow \nLeftarrow \nleftrightarrow \nRightarrow \nLeftrightarrow</math>
|-----
|\Leftarrow \Rightarrow \Leftrightarrow \Longleftarrow \Longrightarrow \Longleftrightarrow \iff \Uparrow \Downarrow \Updownarrow
|<math>\Leftarrow\ \Rightarrow\ \Leftrightarrow\ \Longleftarrow\ \Longrightarrow\ \Longleftrightarrow\ \iff\ \Uparrow\ \Downarrow\ \Updownarrow</math>
|-----
|\xrightarrow[texte~facultatif]{texte} \xleftarrow[texte~facultatif]{texte}
|<math>\xrightarrow[texte~facultatif]{texte}\ \xleftarrow[texte~ facultatif]{texte}</math>
|-----
|rowspan="19"|Symboles divers
|\hbar \wr \dagger \ddagger \infty \vdash \top \bot \models \vdots \ddots \cdots \ldots<br />\imath \jmath \ell \Re \Im \wp \mho \sharp \flat \natural \% \complement \And \Finv \Game \smile \frown \wr
|<math>\hbar \wr \dagger \ddagger \infty \ \vdash \ \top\ \bot\ \models\ \vdots\ \ddots\ \cdots\ \ldots</math> <math>\imath\ \jmath\ \ell\ \Re\ \Im\ \wp\ \mho\ \sharp\ \flat\ \natural\ \%\ \complement\ \And\ \Finv\ \Game\ \smile\ \frown\ \wr</math>
|-
|-
|\vartriangle \triangledown \lozenge \circledS \measuredangle \nexists \Bbbk \backprime \blacktriangle \blacktriangledown
| <code>pmatrix</code><ref name="amsmath"/>
|<math> \vartriangle \triangledown \lozenge \circledS \measuredangle \nexists \Bbbk \backprime \blacktriangle \blacktriangledown</math>
| <math>( \, ) </math>
|-
|-
|\blacksquare \blacklozenge \bigstar \sphericalangle \diagup \diagdown \dotplus \Cap \Cup \barwedge
| <code>bmatrix</code><ref name="amsmath"/>
|<math> \blacksquare \blacklozenge \bigstar \sphericalangle \diagup \diagdown \dotplus \Cap \Cup \barwedge</math>
| <math>[ \, ] </math>
|-
|-
|\veebar \doublebarwedge \boxminus \boxtimes \boxdot \boxplus \divideontimes \ltimes \rtimes \leftthreetimes
| <code>Bmatrix</code><ref name="amsmath"/>
|<math> \veebar \doublebarwedge \boxminus \boxtimes \boxdot \boxplus \divideontimes \ltimes \rtimes \leftthreetimes</math>
| <math>\{ \, \} </math>
|-
|-
|\rightthreetimes \curlywedge \curlyvee \circleddash \circledast \circledcirc \centerdot \intercal \leqq
| <code>vmatrix</code><ref name="amsmath"/>
|<math> \rightthreetimes \curlywedge \curlyvee \circleddash \circledast \circledcirc \centerdot \intercal \leqq</math>
| <math>| \, | </math>
|-
|-
|\eqslantless \lessapprox \approxeq \lessdot \lessgtr \lesseqgtr \lesseqqgtr \doteqdot \risingdotseq \doteq \fallingdotseq
| <code>Vmatrix</code><ref name="amsmath"/>
|<math> \eqslantless \lessapprox \approxeq \lessdot \lessgtr \lesseqgtr \lesseqqgtr \doteqdot \risingdotseq \doteq \fallingdotseq</math>
| <math>\| \, \| </math>
|}
When writing down arbitrary sized matrices, it is common to use horizontal, vertical and diagonal triplets of dots (known as [[w:ellipsis|ellipses]]) to fill in certain columns and rows. These can be specified using the <code>\cdots</code>, <code>\vdots</code> and <code>\ddots</code> respectively:
{|
|<source lang=latex>
\[
A_{m,n} =
\begin{pmatrix}
  a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
  a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{pmatrix}
\]
</source>
|style="padding-left:20px"|<math>
A_{m,n} =
\begin{pmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots  & \vdots  & \ddots & \vdots  \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{pmatrix}
</math>
|}
In some cases you may want to have finer control of the alignment within each column, or want to insert lines between columns or rows. This can be achieved using the <code>array</code> environment, which is essentially a math-mode version of the [[../Tables#The tabular environment|<code>tabular</code> environment]], which requires that the columns be pre-specified:
{|
|<source lang=latex>
\[
\begin{array}{c|c}
  1 & 2 \\
  \hline
  3 & 4
\end{array}
\]
</source>
|style="padding-left:20px"|<math>
\begin{array}{c|c}
1 & 2 \\
\hline
3 & 4
\end{array}
</math>
|}
 
== Adding text to equations ==
 
The math environment differs from the text environment in the representation of text.  Here is an example of trying to represent text within the math environment:
{|
|<source lang="latex">
\[
50 apples \times 100 apples = lots of apples^2
\]
</source>
| style="padding-left:20px" |
|<math>
50 apples \times 100 apples = lots of apples^2
\,</math>
|}
 
There are two noticeable problems: there are no spaces between words or numbers, and the letters are italicized and more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text).
 
There are a number of ways that text can be added properly. The typical way is to wrap the text with the <code>\text{...}</code> command <ref name="amsmath"/> (a similar command is <code>\mbox{...}</code>, though this causes problems with subscripts, and has a less descriptive name). Let's see what happens when the above equation code is adapted:
{|
|<source lang="latex">
\[
50 \text{apples} \times 100 \text{apples} = \text{lots of apples}^2
\]
</source>
| style="padding-left:20px" |
|<math>
  50 \text{apples} \times 100 \text{apples} = \text{lots of apples}^2
\,</math>
|}
 
The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you are required to explicitly add these. There are many ways to add spaces between maths elements, but for the sake of simplicity you may literally add the space character in the affected <code>\text</code>(s) itself (just before the text.)
{|
|<source lang="latex">
\[
50 \text{ apples} \times 100 \text{ apples} = \text{lots of apples}^2
\]
</source>
| style="padding-left:20px" |
|<math>
50 \text{ apples} \times 100 \text{ apples} = \text{lots of apples}^2
\,</math>
|}
 
=== Formatted text ===
Using the <code>\text</code> is fine and gets the basic result. Yet, there is an alternative that offers a little more flexibility. You may recall the introduction of [[LaTeX/Formatting#Font Styles and size|font formatting commands]], such as <code>\textrm</code>, <code>\textit</code>, <code>\textbf</code>, etc. These commands format the argument accordingly, e.g., <code>\textbf{bold text}</code> gives '''bold text'''. These commands are equally valid within a maths environment to include text. The added benefit here is that you can have better control over the font formatting, rather than the standard text achieved with <code>\text</code>.
 
{|
|<source lang="latex">
\[
50 \textrm{ apples} \times 100 \textbf{ apples} = \textit{lots of apples}^2
\]
</source>
| style="padding-left:20px" |
|<math>
50 \;\textrm{ apples} \times 100 \;\textbf{ apples} = \textit{lots of apples}^2
\,</math>
|}
 
== Formatting mathematics symbols ==
So we can format text, what about formatting mathematics? There are a set of formatting commands very similar to the font formatting ones just used, except they are aimed specifically for text in maths mode:
{|class="wikitable"
! LaTeX command
! Sample
! Description
! Common use
|-
|-
|\backsim \backsimeq \subseteqq \Subset \preccurlyeq \curlyeqprec \precsim \precapprox \vartriangleleft
| <code>\mathnormal{…}</code>
|<math> \backsim \backsimeq \subseteqq \Subset \preccurlyeq \curlyeqprec \precsim \precapprox \vartriangleleft</math>
| <math>ABCDEF abcdef 123456\,</math>
| the default math font
| most mathematical notation
|-
|-
|\Vvdash \bumpeq \Bumpeq \geqq \eqslantgtr \gtrsim \gtrapprox \eqsim \gtrdot
| <code>\mathrm{…}</code>
|<math> \Vvdash \bumpeq \Bumpeq \geqq \eqslantgtr \gtrsim \gtrapprox \eqsim \gtrdot</math>
| <math>\mathrm{ABCDEF abcdef 123456}\,</math>
| this is the default or normal font, unitalicised
| units of measurement, one word functions
|-
|-
|\gtrless \gtreqless \gtreqqless \eqcirc \circeq \triangleq \thicksim \thickapprox \supseteqq
| <code>\mathit{…}</code>
|<math>\gtrless \gtreqless \gtreqqless \eqcirc \circeq \triangleq \thicksim \thickapprox \supseteqq</math>
| <math>\mathit{ABCDEF abcdef 123456}\,</math>
| italicised font
|
|-
|-
|\Supset \succcurlyeq \curlyeqsucc \succsim \succapprox \vartriangleright \shortmid \shortparallel \between \pitchfork
| <code>\mathbf{…}</code>
|<math> \Supset \succcurlyeq \curlyeqsucc \succsim \succapprox \vartriangleright \shortmid \shortparallel \between \pitchfork</math>
| <math>\mathbf{ABCDEF abcdef 123456}\,</math>
| bold font
| vectors
|-
|-
|\propto \blacktriangleleft \therefore \backepsilon \blacktriangleright \because \nleqslant \nleqq \lneq \lneqq
| <code>\mathsf{…}</code>
|<math> \varpropto \blacktriangleleft \therefore \backepsilon \blacktriangleright \because \nleqslant \nleqq \lneq \lneqq</math>
| <math>\mathsf{ABCDEF abcdef 123456}\,</math>
| [[w:sans-serif|Sans-serif]]
|
|-
|-
|\lvertneqq \lnsim \lnapprox \nprec \npreceq \precneqq \precnsim \precnapprox \nsim \nshortmid
| <code>\mathtt{…}</code>
|<math> \lvertneqq \lnsim \lnapprox \nprec \npreceq \precneqq \precnsim \precnapprox \nsim \nshortmid</math>
| <font style="font-family: monospace;">ABCDEFabcdef123456</font>
| [[w:Monospace font|Monospace (fixed-width) font]]
|
|-
|-
|\nvdash \nVdash \ntriangleleft \ntrianglelefteq \nsubseteq \nsubseteqq \varsubsetneq \subsetneqq \varsubsetneqq \ngtr
| <code>\mathcal{…}</code>
|<math> \nvdash \nVdash \ntriangleleft \ntrianglelefteq \nsubseteq \nsubseteqq \varsubsetneq \subsetneqq \varsubsetneqq \ngtr</math>
| <math>\mathcal{ABCDEF abcdef 123456}\,</math>
| Calligraphy (uppercase only)
| often used for sheaves/schemes and categories
|-
|-
|\ngeqslant \ngeqq \gneq \gneqq \gvertneqq \gnsim \gnapprox \nsucc \nsucceq \succneqq
| <code>\mathfrak{…}</code><ref name="amsfonts">requires <tt>amsfonts</tt> or <tt>amssymb</tt> packages</ref>
|<math> \ngeqslant \ngeqq \gneq \gneqq \gvertneqq \gnsim \gnapprox \nsucc \nsucceq \succneqq</math>
| <math>\mathfrak{ABCDEF abcdef 123456}\,</math>
| [[w:Fraktur (script)|Fraktur]]
| Almost canonical font for Lie algebras
|-
|-
|\succnsim \succnapprox \ncong \nshortparallel \nparallel \nvDash \nVDash \ntriangleright \ntrianglerighteq \nsupseteq
| <code>\mathbb{…}</code><ref name="amsfonts"/>
|<math> \succnsim \succnapprox \ncong \nshortparallel \nparallel \nvDash \nVDash \ntriangleright \ntrianglerighteq \nsupseteq</math>
| <math>\mathbb{ABCDEF abcdef 123456}\,</math>
| [[w:Blackboard bold|Blackboard bold]]
| Used to denote special sets (e.g. real numbers)
|-
| <code>\mathscr{…}</code><ref>require <tt>mathrsfs</tt> package</ref>
|
| [[w:Script (typefaces)|Script]]
|
|}
The maths formatting commands can be wrapped around the entire equation, and not just on the textual elements: they only format letters, numbers, and uppercase Greek, and the rest of the maths syntax is ignored.
 
To bold lowercase Greek or other symbols use the <code>\boldsymbol</code> command<ref name="amsmath"/>; this will only work if there exists a bold version of the symbol in the current font. As a last resort there is the <code>\pmb</code> command<ref name="amsmath"/> (poor mans bold): this prints multiple versions of the character slightly offset against each other
{|
|<source lang="latex">
\[
\boldsymbol{\beta} = (\beta_1,\beta_2,\ldots,\beta_n)
\]
</source>
| style="padding-left:20px" |
|<math>
\boldsymbol{\beta} = (\beta_1,\beta_2,\ldots,\beta_n)
\,</math>
|}
To change the size of the fonts in math mode, see [[../Advanced Mathematics#Changing font size|Changing font size]].
 
=== Accents ===
So what to do when you run out of symbols and fonts? Well the next step is to use accents:
 
{|
| <code>a'</code> || <math>a'\,</math>
| style="padding-left:20px" |
| <code><nowiki>a''</nowiki></code> || <math>a''\,</math>
| style="padding-left:20px" |
| <code><nowiki>a'''</nowiki></code> || <math>a'''\,</math>
| style="padding-left:20px" |
| <code><nowiki>a''''</nowiki></code> || <math>a''''\,</math>
|-
|-
|\nsupseteqq \varsupsetneq \supsetneqq \varsupsetneqq
| <code>\hat{a}</code> || <math>\hat{a} \,</math>
|<math> \nsupseteqq \varsupsetneq \supsetneqq \varsupsetneqq</math>
| style="padding-left:20px" |
| <code>\bar{a}</code> || <math>\bar{a} \,</math>
| style="padding-left:20px" |
| <code>\check{a}</code> || <math>\check{a} \,</math>
| style="padding-left:20px" |
| <code>\tilde{a}</code> || <math>\tilde{a} \,</math>  
|-
|-
|\surd \uplus \bigtriangleup \bigtriangledown \ominus
| <code>\grave{a}</code> || <math>\grave{a} \,</math>
|<math>\surd \uplus \bigtriangleup \bigtriangledown \ominus\,\!</math>
| style="padding-left:20px" |
| <code>\acute{a}</code> || <math>\acute{a} \,</math>
| style="padding-left:20px" |
| <code>\breve{a}</code> || <math>\breve{a} \,</math>
| style="padding-left:20px" |
| <code>\vec{a}</code> || <math>\vec{a} \,</math>  
|-
|-
|\oslash \odot \bigcirc \amalg \prec \succ \preceq \succeq
| <code>\dot{a}</code> || <math>\dot{a} \,</math>
|<math>\oslash \odot \bigcirc \amalg \prec \succ \preceq \succeq\,\!</math>
| style="padding-left:20px" |
| <code>\ddot{a}</code> || <math>\ddot{a} \,</math>
| style="padding-left:20px" |
| <code>\dddot{a}</code><ref name="amsmath"/> ||
| style="padding-left:20px" |
| <code>\ddddot{a}</code><ref name="amsmath"/> ||
|-
|-
|\dashv \asymp
| <code>\not{a}</code> || <math>\not{a} \,</math>
|<math>\dashv \asymp\,\!</math>
| style="padding-left:20px" |
| <code>\mathring{a}</code> ||
| style="padding-left:20px" |
| <code>\widehat{AAA}</code> || <math>\widehat{AAA} \,</math>
| style="padding-left:20px" |
| <code>\widetilde{AAA}</code> ||
|}
|}


== Indices, exposants ==
==Plus and minus signs==
De manière générale, les indices sont introduits par un [[tiret bas]] (<code>_</code>) et les exposants par un [[accent circonflexe]] (<code>^</code>).


Leur placement avec des grands symboles dépend de ceux-ci : ils sont placés verticalement pour les symboles de ''classe somme'' et à droite pour les symboles de ''classe intégrale'', dont <code>\int<code> est ici le seul membre.
Latex deals with the + and − signs in two possible ways. The most common is as a binary operator. When two maths elements appear either side of the sign, it is assumed to be a binary operator, and as such, allocates some space either side of the sign. The alternative way is a sign designation. This is when you state whether a mathematical quantity is either positive or negative. This is common for the latter, as in maths, such elements are assumed to be positive unless a - is prefixed to it. In this instance, you want the sign to appear close to the appropriate element to show their association. If you put a + or a - with nothing before it but you want it to be handled like a binary operator you can add an ''invisible'' character before the operator using <code>{}</code>. This can be useful if you are writing multiple-line formulas, and a new line could start with a = or a +, for example, then you can fix some strange alignments adding the invisible character where necessary.
Il peut être court-circuité par les commandes suivantes : <code>\limits</code> place indice et exposant verticalement, et <code>\nolimits</code> les place à droite. Dans des matrices, fractions ou dans des tailles ''textstyle, scriptstyle'' ou ''scriptscriptstyle'', les symboles se placent par défaut à droite. Plus de détails sont disponibles [[#Taille|ci-dessus]].
 
{| class="wikitable"
== Controlling horizontal spacing ==
! Fonctionnalité !! Syntaxe !! colspan="2" | À quoi ça ressemble
 
|-----
Latex is obviously pretty good at typesetting maths—it was one of the chief aims of the core Tex system that Latex extends. However, it can't always be relied upon to accurately interpret formulas in the way you did. It has to make certain assumptions when there are ambiguous expressions. The result tends to be slightly incorrect horizontal spacing. In these events, the output is still satisfactory, yet, any perfectionists will no doubt wish to ''fine-tune'' their formulas to ensure spacing is correct. These are generally very subtle adjustments.
|colspan="2"|
 
|en '''HTML'''
There are other occasions where Latex has done its job correctly, but you just want to add some space, maybe to add a comment of some kind. For example, in the following equation, it is preferable to ensure there is a decent amount of space between the maths and the text.
|en '''PNG'''
 
|-----
{|
|Exposant
|<source lang="latex">
|a^2
\[
|<math>a^2</math>
f(n) = \left\{  
|<math>a^2 \,\!</math>
\begin{array}{l l}
|-----
  n/2 & \quad \text{if $n$ is even}\\
|Indice
  -(n+1)/2 & \quad \text{if $n$ is odd}\\
|a_2
\end{array} \right.
|<math> a_2 </math>
\]
|<math>a_2 \,\!</math>
</source>
|-----
| style="vertical-align: middle;" |
| rowspan="2" | Regroupement
<math>
|a^{2+2}
f(n) =
|<math>a^{2+2}</math>
\begin{cases}
|<math>a^{2+2} \,\!</math>
n/2 & \quad \text{if } n \text{ is even} \\
|-----
-(n+1)/2 & \quad \text{if } n \text{ is odd}\\  
|a_{i,j}
\end{cases}  
|<math>a_{i,j}</math>
</math>
|<math>a_{i,j} \,\!</math>
|-----
|Combiner indice et exposant
|x_2^3
|<math>x_2^3</math>
|<math>x_2^3 \,\!</math>
|-----
|rowspan="2"|Indice et exposant précédents
|{}_1^2\!X_3^4
| colspan="2" | <math>{}_1^2\!X_3^4</math>
|-----
|\sideset{_1^2}{_3^4}\prod<br />''(seulement pour grands symboles !)''
|<math>\sideset{_1^2}{_3^4}\prod</math>
|-----
|Dérivée (bon)
|x'
|<math>x'</math>
|<math>x' \,\!</math>
|-----
|Dérivée (mauvais en HTML)
|x^\prime
|<math>x^\prime</math>
|<math>x^\prime \,\!</math>
|-----
|Dérivée (mauvais en PNG)
|x\prime
|<math>x\prime</math>
|<math>x\prime \,\!</math>
|-----
|Soulignés et surlignés
|\hat a \bar b \vec c \overline {g h i} \underline {j k l}
| colspan="2" | <math>\hat a \ \bar b \ \vec c\ \overline {g h i} \ \underline {j k l}</math>
|-----
|[[Vecteur]]s et angles
|\vec U \overrightarrow{AB} \widehat {POQ}
| colspan="2" | <math>\vec U\ \ \overrightarrow{AB}\ \ \widehat {POQ} </math>
|-----
|[[Somme (arithmétique)|Somme]]
|\sum_{k=1}^n k^2
| colspan="2" | <math>\sum_{k=1}^n k^2</math>
|-----
|[[Produit (mathématiques)|Produit]]
|\prod_{i=1}^n x_i
| colspan="2" | <math>\prod_{i=1}^n x_i</math>
|-----
|rowspan="2"|[[Limite]]
|\lim_{n \to \infty} x_n
| colspan="2" | <math>\lim_{n \to \infty}x_n</math>
|-----
|\lim\limits_{n \to \infty} x_n
| colspan="2" | <math>\lim_{n \to \infty}x_n</math>
|-----
|[[Intégrale]]
|\int_{-n}^n e^x\, \mathrm dx
| colspan="2" | <math>\int_{-n}^n e^x\, \mathrm dx</math>
|-----
|rowspan="3"|Placement spécifique
|\int\limits_{-n}^n e^x\, \mathrm dx
| colspan="2" | <math>\int\limits_{-n}^n e^x\, \mathrm dx</math>
|-----
|\lim\nolimits_{n \to \infty} x_n
| colspan="2" | <math>\lim\nolimits_{n \to \infty}x_n</math>
|-----
|\lim_{x\to 0 \atop x\ge 0} f(x)
| colspan="2" | <math>\lim_{x\to0\atop x\ge0} f(x)</math>
|-----
|[[Intersection (mathématiques)|Intersection]]s, [[union (mathématiques)|union]]s
|\bigcap_1^n p, \bigcup_1^k p
| colspan="2" | <math>\bigcap_1^n p,\quad \bigcup_1^k p</math>
|}
|}


== Fractions, matrices, plusieurs lignes ==
Latex has defined two commands that can be used anywhere in documents (not just maths) to insert some horizontal space. They are <code>\quad</code> and <code>\qquad</code>
{| class="wikitable"
 
! Fonctionnalité !! Syntaxe !! colspan="2" | À quoi ça ressemble
A <code>\quad</code> is a space equal to the current font size. So, if you are using an 11pt font, then the space provided by <code>\quad</code> will also be 11pt (horizontally, of course.) The <code>\qquad</code> gives twice that amount. As you can see from the code from the above example, <code>\quad</code>s were used to add some separation between the maths and the text.
|-----
 
|rowspan="3"|[[Fraction]]s
OK, so back to the fine tuning as mentioned at the beginning of the document. A good example would be displaying the simple equation for the indefinite integral of ''y'' with respect to ''x'':
|\frac{a}{b} ''ou'' \dfrac{a}{b}
 
|<math>\frac a b</math>
<math>\int y\, \mathrm{d}x</math>
|-----
 
|\tfrac{a}{b}
If you were to try this, you may write:
|<math>\tfrac ab</math>
 
|-----
{|
|\frac{\frac ab}{\frac cd} ''contre'' \frac{\dfrac ab}{\dfrac cd}
|<source lang="latex">
|<math>\frac \frac ab \frac cd</math> ''contre'' <math>\frac \dfrac ab \dfrac cd</math>
\[ \int y \mathrm{d}x \]
|-----
</source>
|rowspan="2"|[[Fraction continue|Fractions continues]]
| style="vertical-align: middle;" |
|x = a_0 + \frac 1 {a_1 + \frac 1 {a_2 + \frac 1 {a_3+\cdots}}}
<math>\int y \mathrm{d}x</math>
|<math>x = a_0 + \frac 1 {a_1 + \frac 1 {a_2 + \frac 1 {a_3+\cdots}}}</math>
|-----
|x = a_0 + \cfrac 1 {a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3+\cdots}}}
|<math>x = a_0 + \cfrac 1 {a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3+\cdots}}}</math>
|-----
|rowspan="3"|[[Binôme]]s, [[coefficient binomial|coefficients binomiaux]], [[combinaison]]s
|\binom{n}{k} ''ou'' \dbinom{n}{k}
|<math>\binom nk</math>
|-----
|\tbinom{n}{k}
|<math>\tbinom{n}{k}</math>
|-----
|\frac\binom nk\binom{n'}{k'} ''contre'' \frac\dbinom nk\dbinom{n'}{k'}
|<math>\frac\binom nk\binom{n'}{k'}</math> ''contre'' <math>\frac\dbinom nk\dbinom{n'}{k'}</math>
|-----
| rowspan="7" | [[Matrice (mathématiques)|Matrice]]s
|\begin{matrix} a & \cdots & b \\ \vdots & \ddots & \vdots \\ c & \cdots & d \end{matrix}
|<math>\begin{matrix} a & \cdots & b \\ \vdots & \ddots & \vdots \\ c & \cdots & d \end{matrix}</math>
|-----
|\begin{pmatrix} a & b \\ c & d \end{pmatrix}
|<math>\begin{pmatrix} a & b \\ c & d \end{pmatrix}</math>
|-----
|\begin{bmatrix} a & b \\ c & d \end{bmatrix}
|<math>\begin{bmatrix} a & b \\ c & d \end{bmatrix}</math>
|-----
|\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
|<math>\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}</math>
|-----
|\begin{vmatrix} a & b \\ c & d \end{vmatrix}
|<math>\begin{vmatrix} a & b \\ c & d \end{vmatrix}</math>
|-----
|\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}
|<math>\begin{Vmatrix} a & b \\ c & d \end{Vmatrix}</math>
|-----
|\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}
|<math>\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}</math>
|-----
|Tableaux avec alignement
|\begin{array}{crl} \rm center & \rm right & \rm left \\ c & r & l \end{array}
|<math>\begin{array}{crl} \rm center & \rm right & \rm left \\ c & r & l \end{array}</math>
|-----
|Équations sur plusieurs lignes
|\begin{align}f(n+1)&= (n+1)^2 \\ \ & = n^2 + 2n + 1 \end{align}
|<math>\begin{align}f(n+1)&= (n+1)^2 \\ \ & = n^2 + 2n + 1 \end{align}</math>
|-----
|Distinctions de cas, [[système d'équations|systèmes d'équations]]
|f(n)=\begin{cases} \frac n2, & \text{si }n\text{ est pair} \\ 3n+1, & \text{si }n\text{ est impair} \end{cases}
|<math>f(n)=\begin{cases} \frac n2, & \text{si }n\text{ est pair} \\ 3n+1, & \text{si }n\text{ est impair} \end{cases}</math>
|-----
|rowspan="2"|Accolades
|\overbrace{ 1+2+\cdots+100 }^{5050}
|<math>\overbrace{ 1+2+\cdots+100 }^{5050}</math>
|-
|\underbrace{ a+b+\cdots+z }_{26}
|<math>\underbrace{a+b+\cdots+z}_{26}</math>
|-----
|rowspan="4"|Superposition
|x \stackrel{?}{=} y
|<math>x \stackrel{?}{=} y</math>
|-----
|x \overset{?}{=} y
|<math>x \overset{?}{=} y</math>
|-----
|x \underset{?}{=} y
|<math>x \underset{?}{=} y</math>
|-----
|x \xrightarrow{texte} y, x \xleftarrow{texte} y
|<math>x \xrightarrow{texte}y,\ x\xleftarrow{texte}y</math>
|}
|}


== Jeux de caractères ==
However, this doesn't give the correct result. Latex doesn't respect the white-space left in the code to signify that the ''y'' and the d''x'' are independent entities. Instead, it lumps them altogether. A <code>\quad</code> would clearly be overkill is this situation—what is needed are some small spaces to be utilized in this type of instance, and that's what Latex provides:
{| class="wikitable"
 
! Fonctionnalité !! Syntaxe !! À quoi ça ressemble
{|{{prettytable}}
|-----
! Command
|[[alphabet grec|Lettres grecques]] minuscules <small>(sans Omicron !)</small>
! Description
|\alpha \beta \gamma \digamma \delta \epsilon \varepsilon \zeta \eta \theta \vartheta \iota \kappa \varkappa \lambda \mu \nu \xi o \pi \varpi \rho \varrho \sigma \varsigma \tau \upsilon \phi \varphi \chi \psi \omega
! Size
|<math>\alpha\; \beta\; \gamma\; \digamma\; \delta\; \epsilon\; \varepsilon\; \zeta\; \eta\; \theta\; \vartheta\; \iota\; \kappa\; \varkappa\; \lambda\; \mu\; \nu\,</math><br\>
|-
<math>\xi\; o\; \pi\; \varpi\; \rho\; \varrho\; \sigma\; \varsigma\; \tau\; \upsilon\; \phi\; \varphi\; \chi\; \psi\; \omega \,</math>
| <tt>\,</tt>
|-----
| small space
| 3/18 of a quad
|-
| <tt>\:</tt>
| medium space
| 4/18 of a quad
|-
| <tt>\;</tt>
| large space
| 5/18 of a quad
|-
| <tt>\!</tt>
| negative space
| -3/18 of a quad
|}


|Lettres grecques majuscules <small>(sans Omicron !)</small>
NB you can use more than one command in a sequence to achieve a greater space if necessary.
|\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Iota \Kappa \Lambda \Mu \Nu \Xi O \Pi \Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega
|<math>\Alpha \; \Beta \; \Gamma \; \Delta \; \Epsilon \; \Zeta \; \Eta \; \Theta \; \Iota \; \Kappa \; \Lambda \; \Mu \,</math><br\>
<math>\Nu \; \Xi\; O\; \Pi\; \Rho\; \Sigma\; \Tau\; \Upsilon\; \Phi\; \Chi\; \Psi\; \Omega</math>
|-----


|rowspan="2"|[[:en:Blackboard|Blackboard]]
So, to rectify the current problem:
|\mathbb{A B C D E F G H I J K L M}<br/>
\mathbb{N O P Q R S T U V W X Y Z}<br/>
\mathbb{abcdefghijklm}<br/>
\mathbb{nopqrstuvwxyz}<br/>
\mathbb{1234567890}
|<math>\mathbb{A B C D E F G H I J K L M}</math><br/>
<math>\mathbb{N O P Q R S T U V W X Y Z}</math><br/>
<math>\mathbb{abcdefghijklm}</math><br/>
<math>\mathbb{nopqrstuvwxyz}</math><br/>
<math>\mathbb{1234567890}</math>
|-----
|\R \N \Complex \Z ''(raccourcis à utiliser de préférence)''
|<math>\R\ \N\ \Complex\ \Z</math>
|-----


|Fraktur
{|
|\mathfrak{a b c d e f g h i j k l m}<br/>
| <tt>\int y\, \mathrm{d}x</tt>
\mathfrak{n o p q r s t u v w x y z}<br/>\mathfrak{A B C D E F G H I J K L M N}<br/>
|
\mathfrak{O P Q R S T U V W X Y Z}
<math>\int y\, \mathrm{d}x</math>
|<math>\mathfrak{a b c d e f g h i j k l m}</math><br/>
|-
<math>\mathfrak{n o p q r s t u v w x y z}</math><br/>
| <tt>\int y\: \mathrm{d}x</tt>
<math>\mathfrak{A B C D E F G H I J K L M N}</math><br/>
|
<math>\mathfrak{O P Q R S T U V W X Y Z}</math>
<math>\int y\;\;\!\! \mathrm{d}x</math>
|-----
|-
|Gras
| <tt>\int y\; \mathrm{d}x</tt>
|\mathbf{ABCDEFGHIJKLM}<br/>
|
\mathbf{NOPQRSTUVWXYZ}
<math>\int y\; \mathrm{d}x</math>
|<math>\mathbf{ABCDEFGHIJKLM}\,</math><br/>
<math>\mathbf{NOPQRSTUVWXYZ}\,</math>
|-----
|Roman
|\mathrm{ABCDEFGHIJKLM}<br/>
\mathrm{NOPQRSTUVWXYZ}
|<math>\mathrm{ABCDEFGHIJKLM}\,</math><br/>
<math>\mathrm{NOPQRSTUVWXYZ}\,</math>
|-----
|Normal
|ABCDEFGHIJKLM<br/>
NOPQRSTUVWXYZ<br/>
|<math>ABCDEFGHIJKLM \,</math><br/>
<math>NOPQRSTUVWXYZ \,</math>
|-----
|Script
|\mathcal{ABCDEFGHIJKLM}<br/>
\mathcal{NOPQRSTUVWXYZ}<br/>
\mathcal{abcdefghijklm}<br/>
\mathcal{nopqrstuvwxyz}<br/>
\mathcal{1234567890}
|<math>\mathcal{ABCDEFGHIJKLM},</math><br/>
<math>\mathcal{NOPQRSTUVWXYZ}\,</math><br/>
<math>\mathcal{abcdefghijklm}</math><br/>
<math>\mathcal{nopqrstuvwxyz}</math><br/>
<math>\mathcal{1234567890}</math>
|-----
|[[Alphabet hébreu|Hébreu]]
|\aleph \beth \daleth \gimel
|<math>\aleph \; \beth \; \daleth \; \gimel</math>
|}
|}


== Délimiteurs dans les grandes équations ==
The negative space may seem like an odd thing to use, however, it wouldn't be there if it didn't have ''some'' use! Take the following example:
{| class="wikitable"
 
|bgcolor="#F77C7C"|Mauvais
{|
|bgcolor="#F77C7C"|( \frac{1}{2} )
|<source lang="latex">
|bgcolor="white"|<math>( \frac{1}{2} )</math>
\[\left(
|-----
  \begin{array}{c}
|bgcolor="#6EF7A7"|Mieux
    n \\
|bgcolor="#6EF7A7"|\left( \frac{1}{2} \right)
    r
|<math>\left( \frac{1}{2} \right)</math>
  \end{array}
  \right) = \frac{n!}{r!(n-r)!}
\]
</source>
| style="vertical-align: middle;" |
<math>\left(
  \begin{matrix}
    n \\
    r
  \end{matrix}
  \right) = \frac{n!}{r!(n-r)!}</math>
|}
|}


\left et \right peuvent être utilisés avec divers délimiteurs, par exemple :
{| class="wikitable"
! Fonctionnalité !! Syntaxe !! À quoi ça ressemble
|-----
|Parenthèses
|\left( \frac{a}{b}  \right)
|<math>\left( \frac{a}{b}  \right)</math>
|-----


|Crochets
The matrix-like expression for representing binomial coefficients is too padded. There is too much space between the brackets and the actual contents within. This can easily be corrected by adding a few negative spaces after the left bracket and before the right bracket.
|\left[ \frac{a}{b}  \right]
|<math>\left[ \frac{a}{b}  \right]</math>
|-----


|Accolades
{|
|\left\{ \frac{a}{b} \right\}
|<source lang="latex">
|<math>\left\{ \frac{a}{b} \right\}</math>
\[\left(\!
|-----
  \begin{array}{c}
    n \\
    r
  \end{array}
  \!\right) = \frac{n!}{r!(n-r)!}
\]
</source>
| style="vertical-align: middle;" |
<math>\left(\!
  \begin{matrix}
    n \\
    r
  \end{matrix}
  \!\right) = \frac{n!}{r!(n-r)!}</math>
|}


|Chevrons
In any case, adding some spaces manually should be avoided whenever possible: it makes the source code more complex and it's against the basic principles of a What You See is What You Mean approach. The best thing to do is to define some commands using all the spaces you want and then, when you use your command, you don't have to add any other space. Later, if you change your mind about the length of the horizontal space, you can easily change it modifying only the command you defined before. Let us use an example: you want the ''d'' of a ''dx'' in an integral to be in roman font and a small space away from the rest. If you want to type an integral like <code>\int x \; \mathrm{d} x</code>, you can define a command like this:
|\left\langle \frac{a}{b}  \right\rangle
<source lang="latex">
|<math>\left\langle \frac{a}{b}  \right\rangle</math>
\newcommand{\dd}{\; \mathrm{d}}
|-----
</source>
in the preamble of your document. We have chosen <code>\dd</code> just because it reminds the "d" it replaces and it is fast to type. Doing so, the code for your integral becomes <code>\int x \dd x</code>. Now, whenever you write an integral, you just have to use the <code>\dd</code> instead of the "d", and all your integrals will have the same style. If you change your mind, you just have to change the definition in the preamble, and all your integrals will be changed accordingly.


|Barres (de [[valeur absolue]], par exemple)
==Advanced Mathematics: AMS Math package==
|<nowiki>\left| \frac{a}{b}  \right|</nowiki>
|<math>\left| \frac{a}{b}  \right|</math>
|-----


|Flèches
The AMS ([[Wikipedia:American Mathematical Society|American Mathematical Society]]) mathematics package is a powerful package that creates an higher layer of abstraction over mathematical LaTeX language; if you use it it will make your life easier. Some commands amsmath introduces will make other plain LaTeX commands obsolete: in order to keep consistency in the final output you'd better use <code>amsmath</code> commands whenever possible. If you do so, you will get an elegant output without worrying about alignment and other details, keeping your source code readable. If you want to use it, you have to add this in the preamble:
|\left \Uparrow \frac{a}{b} \right \Downarrow
<source lang="latex">
|<math>\left \Uparrow \frac{a}{b} \right \Downarrow</math>
\usepackage{amsmath}
|-----
</source>
===Introducing text and dots in formulas===
Amsmath defines also the <code>\dots</code> command, that is a generalization of the existing <code>\ldots</code>. You can use <code>\dots</code> in both text and math mode and LaTeX will replace it with three dots "…" but it will decide according to the context whether to put it on the bottom (like <code>\ldots</code>) or centered (like <code>\cdots</code>).


|Utilisez \left. ou \right. pour ne faire apparaître qu'un seul des délimiteurs
===Dots===
|\left. {A \over B} \right\} \to X
|<math>\left. {A \over B} \right\} \to X</math>
|-----


|rowspan="2"|Taille des délimiteurs
LaTeX gives you several commands to insert dots in your formulas. This can be particularly useful if you have to type big matrices omitting elements. First of all, here are the main dots-related commands LaTeX provides:
|\big( \Big( \bigg( \Bigg(
 
|<math> \big( \Big( \bigg( \Bigg(</math>
{|{{prettytable}}
|-----
! Code !! Output !! Comment
|\bigl( \Bigl( \biggl( \Biggl( ... \Biggr) \biggr) \Bigr) \bigr)
|-
|<math>\bigl( \Bigl( \biggl( \Biggl( \dots \Biggr) \biggr) \Bigr) \bigr)</math>
| <tt>\dots</tt> || <math>\dots</math> || generic dots, to be used in text (outside formulas as well). It automatically manages whitespaces before and after itself according to the context, it's a higher level command.
|-
| <tt>\ldots</tt> || <math>\ldots</math> || the output is similar to the previous one, but there is no automatic whitespace management; it works at a lower level.
|-
| <tt>\cdots</tt> || <math>\cdots</math> || These dots are centered relative to the height of a letter. There is also the binary multiplication operator, <tt>\cdot</tt>, mentioned below.
|-
| <tt>\vdots</tt> || <math>\vdots</math> || vertical dots
|-
| <tt>\ddots</tt> || <math>\ddots</math> || diagonal dots
|-
| <tt>\hdotsfor{''n''}</tt> || <math>\ldots \ldots</math>|| to be used in matrices, it creates a row of dots spanning ''n'' columns.
|}
|}


== Espacement ==
TeX gère automatiquement la plupart des problèmes d'[[espace typographique|espacement]], mais vous pouvez souhaiter contrôler l'espacement manuellement dans certains cas.


{| class="wikitable"
! Fonctionnalité !! Syntaxe !! À quoi ça ressemble
|-----
|double cadratin
|a \qquad b
|<math>a \qquad b</math>
|-----


|cadratin
|a \quad b
|<math> a \quad b</math>
|-----


|grande espace
|a\ b ''ou'' a~b
|<math>a\ b</math>
|-----


|espace moyenne
==List of Mathematical Symbols==
|a\;b
All the pre-defined mathematical symbols from the \TeX\ package are listed below. More symbols are available from extra packages.
|<math>a\;b</math>
|-----


|espace fine
{| class="wikitable" valign="top"
|a\,b
|+Relation Symbols
|<math>a\,b</math>
! Symbol !! Script !! Symbol !! Script !! Symbol !! Script !! Symbol !! Script !! Symbol !! Script
|-----
|-
| <math>\leq</math>||<tt>\leq</tt>|| <math>\geq</math>||<tt>\geq</tt>|| <math>\equiv\,</math>||<tt>\equiv</tt>|| <math>\models</math>||<tt>\models</tt>|| <math>\prec</math>||<tt>\prec</tt>
|-
| <math>\succ</math>||<tt>\succ</tt>|| <math>\sim</math>||<tt>\sim</tt>|| <math>\perp</math>||<tt>\perp</tt>|| <math>\preceq</math>||<tt>\preceq</tt>|| <math>\succeq</math>||<tt>\succeq</tt>
|-
| <math>\simeq</math>||<tt>\simeq</tt>|| <math>\mid</math>||<tt>\mid</tt>|| <math>\ll</math>||<tt>\ll</tt>|| <math>\gg</math>||<tt>\gg</tt>|| <math>\asymp</math>||<tt>\asymp</tt>
|-
| <math>\parallel</math>||<tt>\parallel</tt>|| <math>\subset</math>||<tt>\subset</tt>|| <math>\supset</math>||<tt>\supset</tt>|| <math>\approx</math>||<tt>\approx</tt>|| <math>\bowtie</math>||<tt>\bowtie</tt>
|-
| <math>\subseteq</math>||<tt>\subseteq</tt>|| <math>\supseteq</math>||<tt>\supseteq</tt>|| <math>\cong</math>||<tt>\cong</tt>|| <math>\sqsubset</math>||<tt>\sqsubset</tt>|| <math>\sqsupset</math>||<tt>\sqsupset</tt>
|-
| <math>\neq\,</math>||<tt>\neq</tt>|| <math>\smile</math>||<tt>\smile</tt>|| <math>\sqsubseteq</math>||<tt>\sqsubseteq</tt>|| <math>\sqsupseteq</math>||<tt>\sqsupseteq</tt>|| <math>\doteq</math>||<tt>\doteq</tt>
|-
| <math>\frown</math>||<tt>\frown</tt>|| <math>\in</math>||<tt>\in</tt>|| <math>\ni</math>||<tt>\ni</tt>|| <math>\propto</math>||<tt>\propto</tt>|| <math>=\,</math>||<tt>=</tt>
|-
| <math>\vdash</math>||<tt>\vdash</tt>|| <math>\dashv</math>||<tt>\dashv</tt>|| <math><\,</math>||<tt><</tt>|| <math>>\,</math>||<tt>></tt>
|}
 
{| class="wikitable" align="left"
|+Greek Letters
! Symbol !! Script
|-
| <math>\Alpha\,</math> and <math>\alpha\,</math>|| <tt>\Alpha</tt> and <tt>\alpha</tt>
|-
| <math>\Beta\,</math> and <math>\beta\,</math>|| <tt>\Beta</tt> and <tt>\beta</tt>
|-
| <math>\Gamma\,</math> and <math>\gamma\,</math>|| <tt>\Gamma</tt> and <tt>\gamma</tt>
|-
| <math>\Delta\,</math> and <math>\delta\,</math>|| <tt>\Delta</tt> and <tt>\delta</tt>
|-
| <math>\Epsilon\,</math>, <math>\epsilon\,</math> and <math>\varepsilon</math>|| <tt>\Epsilon</tt>, <tt>\epsilon</tt> and <tt>\varepsilon</tt>
|-
| <math>\Zeta\,</math> and <math>\zeta\,</math>|| <tt>\Zeta</tt> and <tt>\zeta</tt>
|-
| <math>\Eta\,</math> and <math>\eta\,</math>|| <tt>\Eta</tt> and <tt>\eta</tt>
|-
| <math>\Theta\,</math>, <math>\theta\,</math> and <math>\vartheta</math>|| <tt>\Theta</tt>, <tt>\theta</tt> and <tt>\vartheta</tt>
|-
| <math>\Iota\,</math> and <math>\iota\,</math>|| <tt>\Iota</tt> and <tt>\iota</tt>
|-
| <math>\Kappa\,</math> and <math>\kappa\,</math>|| <tt>\Kappa</tt> and <tt>\kappa</tt>
|-
| <math>\Lambda\,</math> and <math>\lambda\,</math>|| <tt>\Lambda</tt> and <tt>\lambda</tt>
|-
| <math>\Mu\,</math> and <math>\mu\,</math>|| <tt>\Mu</tt> and <tt>\mu</tt>
|-
| <math>\Nu\,</math> and <math>\nu\,</math>|| <tt>\Nu</tt> and <tt>\nu</tt>
|-
| <math>\Xi\,</math> and <math>\xi\,</math>|| <tt>\Xi</tt> and <tt>\xi</tt>
|-
| <math>\Pi\,</math>, <math>\pi\,</math> and <math>\varpi</math>|| <tt>\Pi</tt>, <tt>\pi</tt> and <tt>\varpi</tt>
|-
| <math>\Rho\,</math>, <math>\rho\,</math> and <math>\varrho</math>|| <tt>\Rho</tt>, <tt>\rho</tt> and <tt>\varrho</tt>
|-
| <math>\Sigma\,</math>, <math>\sigma\,</math> and <math>\varsigma</math>|| <tt>\Sigma</tt>, <tt>\sigma</tt> and <tt>\varsigma</tt>
|-
| <math>\Tau\,</math> and <math>\tau\,</math>|| <tt>\Tau</tt> and <tt>\tau</tt>
|-
| <math>\Upsilon\,</math> and <math>\upsilon\,</math>|| <tt>\Upsilon</tt> and <tt>\upsilon</tt>
|-
| <math>\Phi\,</math>, <math>\phi\,</math>, and <math>\varphi</math>|| <tt>\Phi</tt>, <tt>\phi</tt> and <tt>\varphi</tt>
|-
| <math>\Chi\,</math> and <math>\chi\,</math>|| <tt>\Chi</tt> and <tt>\chi</tt>
|-
| <math>\Psi\,</math> and <math>\psi\,</math>|| <tt>\Psi</tt> and <tt>\psi</tt>
|-
| <math>\Omega\,</math> and <math>\omega\,</math>|| <tt>\Omega</tt> and <tt>\omega</tt>
|}


|pas d'espacement
{| class="wikitable" align="center"
|ab
|+Binary Operations
|<math>ab\,</math>
! Symbol !! Script !! Symbol !! Script !! Symbol !! Script !! Symbol !! Script
|-----
|-
| <math>\pm\,</math> || <tt>\pm</tt> || <math>\cap\,</math> || <tt>\cap</tt> || <math>\diamond</math> || <tt>\diamond</tt> || <math>\oplus</math> || <tt>\oplus</tt>  
|-
| <math>\mp</math> || <tt>\mp</tt> || <math>\cup</math> || <tt>\cup</tt> || <math>\bigtriangleup</math> || <tt>\bigtriangleup</tt> || <math>\ominus</math> || <tt>\ominus</tt>
|-
| <math>\times\,</math> || <tt>\times</tt> || <math>\uplus</math> || <tt>\uplus</tt> || <math>\bigtriangledown</math> || <tt>\bigtriangledown</tt> || <math>\otimes</math> || <tt>\otimes</tt>
|-
| <math>\div</math> || <tt>\div</tt> || <math>\sqcap</math> || <tt>\sqcap</tt> || <math>\triangleleft</math> || <tt>\triangleleft</tt> || <math>\oslash</math> || <tt>\oslash</tt>
|-
| <math>\ast</math> || <tt>\ast</tt> || <math>\sqcup</math> || <tt>\sqcup</tt> || <math>\triangleright</math> || <tt>\triangleright</tt> || <math>\odot</math> || <tt>\odot</tt>
|-
| <math>\star</math> || <tt>\star</tt> || <math>\vee</math> || <tt>\vee</tt> || <math>\bigcirc</math> || <tt>\bigcirc</tt> || <math>\circ</math> || <tt>\circ</tt>
|-
| <math>\wedge</math> || <tt>\wedge</tt> || <math>\dagger\,</math> || <tt>\dagger</tt> || <math>\bullet</math> || <tt>\bullet</tt> || <math>\setminus\,</math> || <tt>\setminus</tt>
|-
| <math>\ddagger\,</math> || <tt>\ddagger</tt> || <math>\cdot</math> || <tt>\cdot</tt> || <math>\wr</math> || <tt>\wr</tt> || <math>\amalg</math> || <tt>\amalg</tt>
|}


|espacement négatif
{| class="wikitable"
|a\!b
|+Set and/or Logic Notation
|<math>a\!b</math>
! Symbol !! Script
|-
| <math>\exists\,</math> || <tt>\exists</tt>
|-
| <math>\forall\,</math> || <tt>\forall</tt>
|-
| <math>\neg\,</math> || <tt>\neg</tt>
|-
| <math>\in\,</math> and <math>\notin\,</math> || <tt>\in</tt> and <tt>\notin</tt>
|-
| <math>\ni\,</math> || <tt>\ni</tt>
|-
| <math>\land\,</math> || <tt>\land</tt>
|-
| <math>\lor\,</math> || <tt>\lor</tt>
|-
| <math>\implies\,</math> || <tt>\implies</tt>
|-
| <math>\iff\,</math> || <tt>\iff</tt>
|-
| <math>\top\,</math> || <tt>\top</tt>
|-
| <math>\bot\,</math> || <tt>\bot</tt>
|-
| <math>\emptyset\,</math> || <tt>\emptyset</tt>
|}
|}


== Couleurs ==
Certaines parties peuvent être mises en couleur, à l'aide du [[#Commandes et environnements|commutateur]] <code>\color{''nom de la couleur''}</code> :
* <code>{\color{Blue}x^2}+{\color{Brown}2x}-{\color{OliveGreen}1}</code> donne
:<math>{\color{Blue}x^2}+{\color{Brown}2x}-{\color{OliveGreen}1}</math>
* <code>x=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}</code> donne
:<math>x=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}</math>


Voir [http://oregonstate.edu/%7Epeterseb/tex/samples/docs/color-package-demo.pdf ce document PDF] {{en}} pour les 68 couleurs disponibles.
<!-- Sections remaining: Table 3 onwards from symbols.pdf -->


;Attention:Afin de conserver un document lisible et agréable, les couleurs doivent être utilisées avec une grande parcimonie. Elle doivent de plus respecter les [[Wikipédia:conventions de style|conventions de style]] et être choisies de telle façon que les [[daltonisme|daltoniens]] puissent les distinguer.
{{clear}}
=== Summary ===


== Voir aussi ==
As you can begin to see, typesetting maths can be tricky at times. However, because Latex provides so much control, you can get professional quality mathematics typesetting for relatively little effort (once you've had a bit of practice, of course!). It would be possible to keep going and going with maths topics because it seems potentially limitless. However, with this tutorial, you should be able to get along sufficiently.
{{Wikibooks|Programmation LaTeX}}
=== Liens internes ===


* ''[[Wikipédia:Atelier TeX]]'', où vous posez directement des questions sur l’utilisation du TeX.
{{TODO|
* [[:Catégorie:Utilisateur TeXnicien]]
* introduce symbols from [http://www.andy-roberts.net/misc/latex/tutorial9/symbols.pdf]
* [[m:Aide:Formule|Aide plus complète sur MediaWiki]]
* add example for alignat [ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf]
* [[Aide:Caractères spéciaux]]
* Consider, instead of using the symbols from the above mentioned, using what has already been introduced in [http://en.wikipedia.org/wiki/Math_markup] instead of retyping the tables
* [[TeX]] et [[LaTeX]]
* How to box an equation within an align environment
* Color in equations
}}


=== Liens externes ===
== Notes ==
<references/>


* {{en}} {{pdf}} [ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf Guide de l'utilisateur de l'extension <tt>amsmath</tt>]
==Further reading==
* [[meta:Help:Displaying a formula]]: Wikimedia uses a subset of LaTeX commands.


{{Navigation aide}}
==External links==


[[Catégorie:Wikipédia:aide technique|Formules TeX]]
* [http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols LaTeX maths symbols]
[[Catégorie:TeX]]
* [http://detexify.kirelabs.org detexify]: applet for looking up LaTeX symbols by handwriting them
[[Catégorie:Aide aux contributeurs expérimentés|Formules TeX]]
* [ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf <tt>amsmath</tt> documentation]
* [http://www.thestudentroom.co.uk/wiki/LaTeX LaTeX - The Student Room]


[[be:Вікіпэдыя:TeX]]
<noinclude>
[[ca:Ajuda:Fórmula]]
{{LaTeX/Bottom|Page Layout|Advanced Mathematics}}
[[cs:Nápověda:Matematické vzorce]]
</noinclude>
[[de:Hilfe:TeX]]
[[en:Help:Displaying a formula]]
[[eo:Helpo:TEX en Vikipedio]]
[[es:Ayuda:Usando TeX]]
[[et:Vikipeedia:Matemaatiliste valemite kirjutamine]]
[[fi:Ohje:Kaavat]]
[[he:עזרה:נוסחאות]]
[[hu:Wikipédia:Formula leírónyelv]]
[[ia:Adjuta:Formulas TeX]]
[[it:Aiuto:Formule matematiche TeX]]
[[ja:Wikipedia:TeX markup]]
[[km:ជំនួយ:រូបមន្ត]]
[[nl:Help:TeX in Wikipedia]]
[[pl:Pomoc:Wzory]]
[[pt:Ajuda:Guia de edição/Fórmulas TeX]]
[[sk:Pomoc:Matematické vzorce]]
[[sq:Ndihmë:Formula]]
[[sv:Wikipedia:Användarhandledning för TeX]]
[[th:วิธีใช้:สูตรคณิตศาสตร์]]
[[tt:Ярдәм:Formul]]
[[uk:Довідка:Математичні формули та спецсимволи]]
[[zh:Help:数学公式]]

Revision as of 12:58, 22 December 2009

Template:LaTeX/Top

One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulas, whilst looking professional when printed. The fact that he succeeded was most probably why TeX (and later on, LaTeX) became so popular within the scientific community. Regardless of the history, typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation.

If you are writing a document that needs only a few simple mathematical formulas, then you can generally use plain LaTeX: it will give you most of the tools you need. However, if you are writing a scientific document that contains numerous complicated formulas, it is highly recommended that you use the amsmath package, which introduces several new commands that are more powerful and flexible than the ones provided by plain LaTeX. To use this, include:

\usepackage{amsmath}

in the preamble of the document.

Mathematics environments

LaTeX needs to know beforehand that the subsequent text does in fact contain mathematical elements. This is because LaTeX typesets maths notation differently than normal text. Therefore, special environments have been declared for this purpose. They can be distinguished into two categories depending on how they are presented:

  • text - text formulas are displayed in-line, that is, within the body of text where it is declared. e.g., I can say that a + a = 2a within this sentence.
  • displayed - displayed formulas are separate from the main text.

As maths require special environments, there are naturally the appropriate environment names you can use in the standard way. Unlike most other environments, however, there are some handy shorthands to declaring your formulas. The following table summarizes them:

Type Environment LaTeX shorthand TeX shorthand
Text \begin{math}...\end{math} \(...\) $...$
Displayed \begin{displaymath}...\end{displaymath} or

\begin{equation*}...\end{equation*}[1]

\[...\] $$...$$

Note: Using the $$...$$ should be avoided, as it may cause problems, particularly with the AMS-LaTeX macros. Furthermore, should a problem occur, the error messages may not be helpful.

Additionally, there is a second possible environment for the displayed type of formulas: equation. The difference between this and displaymath is that equation also adds sequential equation numbers by the side.

If you are typing text normally, you are said to be in text mode, while you are typing within one of those mathematical environments, you are said to be in math mode, that has some differences compared to the text mode:

  1. Most spaces and line breaks do not have any significance, as all spaces are either derived logically from the mathematical expressions, or have to be specified with special commands such as \quad
  2. Empty lines are not allowed. Only one paragraph per formula.
  3. Each letter is considered to be the name of a variable and will be typeset as such. If you want to typeset normal text within a formula (normal upright font and normal spacing) then you have to enter the text using dedicated commands.

Symbols

Mathematics has lots and lots of symbols! If there is one aspect of maths that is difficult in LaTeX it is trying to remember how to produce them. There are of course a set of symbols that can be accessed directly from the keyboard:

+ - = ! / ( ) [ ] < > | ' :

Beyond those listed above, distinct commands must be issued in order to display the desired symbols. And there are a lot! Greek letters, set and relations symbols, arrows, binary operators, etc. Too many to remember, and in fact, they would overwhelm this tutorial if I tried to list them all. Therefore, for a complete reference document, see the external link at the bottom of the page.

\[
 \forall x \in X, \quad \exists y \leq \epsilon
\]
[math]\displaystyle{ \forall x \in X, \quad \exists y \leq \epsilon \, }[/math]

Greek letters

Greek letters are commonly used in mathematics, and they are very easy to type in math mode. You just have to type the name of the letter after a backslash: if the first letter is lowercase, you will get a lowercase Greek letter, if the first letter is uppercase (and only the first letter), then you will get an uppercase letter. Note that some uppercase Greek letters look like Latin ones, so they are not provided by LaTeX (e.g. uppercase Alpha and Beta are just "A" and "B" respectively). Theta, Phi, and Sigma are provided in two different versions:

\[
 \alpha, \beta, \gamma, \delta, \epsilon, \zeta, \mu,
 \theta, \vartheta, \phi, \varphi, \omega, \sigma, \varsigma,
 \Gamma, \Delta, \Theta, \Phi, \Omega
\]
[math]\displaystyle{ \alpha, \beta, \gamma, \delta, \epsilon, \zeta, \mu, \theta, \vartheta, \phi, \varphi, \omega, \sigma, \varsigma, \Gamma, \Delta, \Theta, \Phi, \Omega }[/math]

Operators

An operator is a function that is written as a word: e.g. trigonometric functions (sin, cos, tan), logarithms and exponentials (log, exp). LaTeX has many of these defined as commands:

\[
 \cos (2\theta) = \cos^2 \theta - \sin^2 \theta
\]
[math]\displaystyle{ \cos (2\theta) = \cos^2 \theta - \sin^2 \theta \, }[/math]

For certain operators such as limits, the subscript is placed underneath the operator:

\[
 \lim_{x \to \infty} \exp(-x) = 0
\]
[math]\displaystyle{ \lim_{x \to \infty} \exp(-x) = 0 }[/math]

For the modular operator there are two commands: \bmod and \pmod:

\[
 a \bmod b
\]
[math]\displaystyle{ a \, \bmod \, b \, }[/math]
\[
 x \equiv a \pmod b
\]
[math]\displaystyle{ x \equiv a \pmod b \, }[/math]

To use operators which are not pre-defined, such as argmax, see [[../Advanced Mathematics#Custom operators|custom operators]]

Powers and indices

Powers and indices are equivalent to superscripts and subscripts in normal text mode. The caret (^) character is used to raise something, and the underscore (_) is for lowering. If more than one expression is raised or lowered, they should be grouped using curly braces ({ and }).

\[
k_{n+1} = n^2 + k_n^2 - k_{n-1}
\]
[math]\displaystyle{ k_{n+1} = n^2 + k_n^2 - k_{n-1} \, }[/math]

Fractions and Binomials

A fraction is created using the \frac{numerator}{denominator} command. (For those who need their memories refreshed, that's the top and bottom respectively!). Likewise, the binomial coefficient (aka the Choose function) may be written using the \binom command

\[
 \frac{n!}{k!(n-k)!} = \binom{n}{k}
\]
[math]\displaystyle{ \frac{n!}{k!(n-k)!} = \binom{n}{k} \, }[/math]

You can also embed fractions within fractions:

\[
 \frac{\frac{1}{x}+\frac{1}{y}}{y-z}
\]
[math]\displaystyle{ \frac{\frac{1}{x}+\frac{1}{y}}{y-z} \, }[/math]

Note that when appearing inside another fraction, or in inline text [math]\displaystyle{ \tfrac{a}{b} }[/math], a fraction is noticeably smaller than in displayed mathematics. The \tfrac and \dfrac commands[1] force the use of the respective styles (similarly the \tbinom and \dbinom commands do the same for the binomial coefficient).

For relatively simple fractions, it may be more aesthetically pleasing to use powers and indices:

\[
 ^3/_7
\]
[math]\displaystyle{ ^3/_7 \, }[/math]

Roots

The sqrt command creates a square root surrounding an expression. It accepts an optional argument specified in square brackets ([ and ]) to change magnitude:

\[
\sqrt{\frac{a}{b}}
\]
[math]\displaystyle{ \sqrt{\frac{a}{b}} \, }[/math]
\[
\sqrt[n]{1+x+x^2+x^3+\ldots}
\]
[math]\displaystyle{ \sqrt[n]{1+x+x^2+x^3+\ldots} \, }[/math]


Some people prefer writing the square root "closing" it over its content. This method arguably makes it more clear just what is in the scope of the root sign. This habit is not normally used while writing with the computer because the text is supposed to be clear anyway, but if you want to change the output of the square root anyway, LaTeX gives you this possibility. Just add the following code in the preamble of your document:

% New definition of square root:
% it renames \sqrt as \oldsqrt
\let\oldsqrt\sqrt
% it defines the new \sqrt in terms of the old one
\def\sqrt{\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{%
\setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.4pt\box2}}
File:Latex new squareroot.png
The new style is on left, the old one on right

This TeX code first renames the \sqrt command as \oldsqrt, then redefines \sqrt in terms of the old one, adding something more. The new square root can be seen in the picture on the right, compared to the old one. Unfortunately this code won't work if you want to use multiple roots: if you try to write [math]\displaystyle{ \sqrt[b]{a} }[/math] as \sqrt[b]{a} after you used the code above, you'll just get a wrong output. In other words, you can redefine the square root this way only if you are not going to use multiple roots in the whole document.

Sums and integrals

The \sum and \int commands insert the sum and integral symbols respectively, with limits specified using the caret (^) and underscore (_):

\[
 \sum_{i=1}^{10} t_i 
\]
[math]\displaystyle{ \sum_{i=1}^{10} t_i \, }[/math]
\[
 \int_0^\infty e^{-x} \, dx
\]
[math]\displaystyle{ \int_0^\infty e^{-x} \, dx \, }[/math]

There are many other "big" commands which operate in a similar manner:

\sum [math]\displaystyle{ \sum \, }[/math] \prod [math]\displaystyle{ \prod }[/math] \coprod [math]\displaystyle{ \coprod }[/math]
\bigoplus [math]\displaystyle{ \bigoplus }[/math] \bigotimes [math]\displaystyle{ \bigotimes }[/math] \bigodot [math]\displaystyle{ \bigodot }[/math]
\bigcup [math]\displaystyle{ \bigcup }[/math] \bigcap [math]\displaystyle{ \bigcap }[/math] \biguplus [math]\displaystyle{ \biguplus }[/math]
\bigsqcup [math]\displaystyle{ \bigsqcup }[/math] \bigvee [math]\displaystyle{ \bigvee }[/math] \bigwedge [math]\displaystyle{ \bigwedge }[/math]
\int [math]\displaystyle{ \int }[/math] \oint [math]\displaystyle{ \oint }[/math] \iint[1] [math]\displaystyle{ \iint }[/math]
\iiint[1] [math]\displaystyle{ \iiint }[/math] \iiiint[1] [math]\displaystyle{ \iiiint }[/math] \idotsint[1] [math]\displaystyle{ \int \! \cdots \! \int }[/math]

For more integral symbols, including those not included by default in the Computer Modern font, try the esint package. The \substack command[1] allows the use of \\ to write the limits over multiple lines:

\[
 \sum_{\substack{
   0<i<m \\
   0<j<n
  }} 
 P(i,j)
\]
[math]\displaystyle{ \sum_{\overset{\scriptstyle 0\lt i\lt m} {\scriptstyle 0\lt j\lt n}} P(i,j) \, }[/math]

If you want the limits of an integral to be specified above and below the symbol (like the sum), use the \limits command:

\[
 \int\limits_a^b
\]
[math]\displaystyle{ \int\limits_a^b \, }[/math]

However if you want this to apply to ALL integrals, it is preferable to specify the intlimits option when loading the amsmath package:

\usepackage[intlimits]{amsmath}

Brackets, braces and delimiters

The use of delimiters such as brackets soon becomes important when dealing with anything but the most trivial equations. Without them, formulas can become ambiguous. Also, special types of mathematical structures, such as matrices, typically rely on delimiters to enclose them.

There are a variety of delimiters available for use in LaTeX:

\[
() \, [] \, \{\} \, || \, \|\| \, 
\langle\rangle \, \lfloor\rfloor \, \lceil\rceil
\]
[math]\displaystyle{ () \, [] \, \{\} \, || \, \|\| \, \langle\rangle \, \lfloor\rfloor \, \lceil\rceil \, }[/math]

Automatic sizing

Very often mathematical features will differ in size, in which case the delimiters surrounding the expression should vary accordingly. This can be done automatically using the left and right commands. Any of the previous delimiters may be used in combination with these:

\[
\left(\frac{x^2}{y^3}\right)
\]
[math]\displaystyle{ \left(\frac{x^2}{y^3}\right) \, }[/math]

If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may be denoted using a period (.).

Manual sizing

In certain cases, the sizing produced by the left and right commands may not be desirable, or you may simply want finer control over the delimiter sizes. In this case, the big, Big, bigg and Bigg modifier commands may be used:

\[
( \big( \Big( \bigg( \Bigg( 
\]
[math]\displaystyle{ ( \big( \Big( \bigg( \Bigg( \, }[/math]

Matrices and arrays

A basic matrix may be created using the matrix environment[1]: in common with other table-like structures, entries are specified by row, with columns separated using an ampersand (&) and a new rows separated with a double backslash (\\)

\[
 \begin{matrix}
  a & b & c \\
  d & e & f \\
  g & h & i
 \end{matrix}
\]
[math]\displaystyle{ \begin{matrix} a & b & c \\ d & e & f \\ g & h & i \end{matrix} }[/math]

However matrices are usually enclosed in delimiters of some kind, and while it is possible to use the \left and \right commands, there are various other predefined environments which automatically include delimiters:

Environment name Surrounding delimiter
pmatrix[1] [math]\displaystyle{ ( \, ) }[/math]
bmatrix[1] [math]\displaystyle{ [ \, ] }[/math]
Bmatrix[1] [math]\displaystyle{ \{ \, \} }[/math]
vmatrix[1] [math]\displaystyle{ | \, | }[/math]
Vmatrix[1] [math]\displaystyle{ \| \, \| }[/math]

When writing down arbitrary sized matrices, it is common to use horizontal, vertical and diagonal triplets of dots (known as ellipses) to fill in certain columns and rows. These can be specified using the \cdots, \vdots and \ddots respectively:

\[
 A_{m,n} = 
 \begin{pmatrix}
  a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
  a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  a_{m,1} & a_{m,2} & \cdots & a_{m,n} 
 \end{pmatrix}
\]
[math]\displaystyle{ A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} }[/math]

In some cases you may want to have finer control of the alignment within each column, or want to insert lines between columns or rows. This can be achieved using the array environment, which is essentially a math-mode version of the [[../Tables#The tabular environment|tabular environment]], which requires that the columns be pre-specified:

\[
 \begin{array}{c|c}
  1 & 2 \\ 
  \hline
  3 & 4
 \end{array}
\]
[math]\displaystyle{ \begin{array}{c|c} 1 & 2 \\ \hline 3 & 4 \end{array} }[/math]

Adding text to equations

The math environment differs from the text environment in the representation of text. Here is an example of trying to represent text within the math environment:

\[
 50 apples \times 100 apples = lots of apples^2
\]
[math]\displaystyle{ 50 apples \times 100 apples = lots of apples^2 \, }[/math]

There are two noticeable problems: there are no spaces between words or numbers, and the letters are italicized and more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text).

There are a number of ways that text can be added properly. The typical way is to wrap the text with the \text{...} command [1] (a similar command is \mbox{...}, though this causes problems with subscripts, and has a less descriptive name). Let's see what happens when the above equation code is adapted:

\[
 50 \text{apples} \times 100 \text{apples} = \text{lots of apples}^2
\]
[math]\displaystyle{ 50 \text{apples} \times 100 \text{apples} = \text{lots of apples}^2 \, }[/math]

The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you are required to explicitly add these. There are many ways to add spaces between maths elements, but for the sake of simplicity you may literally add the space character in the affected \text(s) itself (just before the text.)

\[
 50 \text{ apples} \times 100 \text{ apples} = \text{lots of apples}^2
\]
[math]\displaystyle{ 50 \text{ apples} \times 100 \text{ apples} = \text{lots of apples}^2 \, }[/math]

Formatted text

Using the \text is fine and gets the basic result. Yet, there is an alternative that offers a little more flexibility. You may recall the introduction of font formatting commands, such as \textrm, \textit, \textbf, etc. These commands format the argument accordingly, e.g., \textbf{bold text} gives bold text. These commands are equally valid within a maths environment to include text. The added benefit here is that you can have better control over the font formatting, rather than the standard text achieved with \text.

\[
 50 \textrm{ apples} \times 100 \textbf{ apples} = \textit{lots of apples}^2
\]
[math]\displaystyle{ 50 \;\textrm{ apples} \times 100 \;\textbf{ apples} = \textit{lots of apples}^2 \, }[/math]

Formatting mathematics symbols

So we can format text, what about formatting mathematics? There are a set of formatting commands very similar to the font formatting ones just used, except they are aimed specifically for text in maths mode:

LaTeX command Sample Description Common use
\mathnormal{…} [math]\displaystyle{ ABCDEF abcdef 123456\, }[/math] the default math font most mathematical notation
\mathrm{…} [math]\displaystyle{ \mathrm{ABCDEF abcdef 123456}\, }[/math] this is the default or normal font, unitalicised units of measurement, one word functions
\mathit{…} [math]\displaystyle{ \mathit{ABCDEF abcdef 123456}\, }[/math] italicised font
\mathbf{…} [math]\displaystyle{ \mathbf{ABCDEF abcdef 123456}\, }[/math] bold font vectors
\mathsf{…} [math]\displaystyle{ \mathsf{ABCDEF abcdef 123456}\, }[/math] Sans-serif
\mathtt{…} ABCDEFabcdef123456 Monospace (fixed-width) font
\mathcal{…} [math]\displaystyle{ \mathcal{ABCDEF abcdef 123456}\, }[/math] Calligraphy (uppercase only) often used for sheaves/schemes and categories
\mathfrak{…}[2] [math]\displaystyle{ \mathfrak{ABCDEF abcdef 123456}\, }[/math] Fraktur Almost canonical font for Lie algebras
\mathbb{…}[2] [math]\displaystyle{ \mathbb{ABCDEF abcdef 123456}\, }[/math] Blackboard bold Used to denote special sets (e.g. real numbers)
\mathscr{…}[3] Script

The maths formatting commands can be wrapped around the entire equation, and not just on the textual elements: they only format letters, numbers, and uppercase Greek, and the rest of the maths syntax is ignored.

To bold lowercase Greek or other symbols use the \boldsymbol command[1]; this will only work if there exists a bold version of the symbol in the current font. As a last resort there is the \pmb command[1] (poor mans bold): this prints multiple versions of the character slightly offset against each other

\[
 \boldsymbol{\beta} = (\beta_1,\beta_2,\ldots,\beta_n)
\]
[math]\displaystyle{ \boldsymbol{\beta} = (\beta_1,\beta_2,\ldots,\beta_n) \, }[/math]

To change the size of the fonts in math mode, see [[../Advanced Mathematics#Changing font size|Changing font size]].

Accents

So what to do when you run out of symbols and fonts? Well the next step is to use accents:

a' [math]\displaystyle{ a'\, }[/math] a'' [math]\displaystyle{ a''\, }[/math] a''' [math]\displaystyle{ a'''\, }[/math] a'''' [math]\displaystyle{ a''''\, }[/math]
\hat{a} [math]\displaystyle{ \hat{a} \, }[/math] \bar{a} [math]\displaystyle{ \bar{a} \, }[/math] \check{a} [math]\displaystyle{ \check{a} \, }[/math] \tilde{a} [math]\displaystyle{ \tilde{a} \, }[/math]
\grave{a} [math]\displaystyle{ \grave{a} \, }[/math] \acute{a} [math]\displaystyle{ \acute{a} \, }[/math] \breve{a} [math]\displaystyle{ \breve{a} \, }[/math] \vec{a} [math]\displaystyle{ \vec{a} \, }[/math]
\dot{a} [math]\displaystyle{ \dot{a} \, }[/math] \ddot{a} [math]\displaystyle{ \ddot{a} \, }[/math] \dddot{a}[1] \ddddot{a}[1]
\not{a} [math]\displaystyle{ \not{a} \, }[/math] \mathring{a} \widehat{AAA} [math]\displaystyle{ \widehat{AAA} \, }[/math] \widetilde{AAA}

Plus and minus signs

Latex deals with the + and − signs in two possible ways. The most common is as a binary operator. When two maths elements appear either side of the sign, it is assumed to be a binary operator, and as such, allocates some space either side of the sign. The alternative way is a sign designation. This is when you state whether a mathematical quantity is either positive or negative. This is common for the latter, as in maths, such elements are assumed to be positive unless a - is prefixed to it. In this instance, you want the sign to appear close to the appropriate element to show their association. If you put a + or a - with nothing before it but you want it to be handled like a binary operator you can add an invisible character before the operator using {}. This can be useful if you are writing multiple-line formulas, and a new line could start with a = or a +, for example, then you can fix some strange alignments adding the invisible character where necessary.

Controlling horizontal spacing

Latex is obviously pretty good at typesetting maths—it was one of the chief aims of the core Tex system that Latex extends. However, it can't always be relied upon to accurately interpret formulas in the way you did. It has to make certain assumptions when there are ambiguous expressions. The result tends to be slightly incorrect horizontal spacing. In these events, the output is still satisfactory, yet, any perfectionists will no doubt wish to fine-tune their formulas to ensure spacing is correct. These are generally very subtle adjustments.

There are other occasions where Latex has done its job correctly, but you just want to add some space, maybe to add a comment of some kind. For example, in the following equation, it is preferable to ensure there is a decent amount of space between the maths and the text.

\[
f(n) = \left\{ 
\begin{array}{l l}
  n/2 & \quad \text{if $n$ is even}\\
  -(n+1)/2 & \quad \text{if $n$ is odd}\\
\end{array} \right.
\]

[math]\displaystyle{ f(n) = \begin{cases} n/2 & \quad \text{if } n \text{ is even} \\ -(n+1)/2 & \quad \text{if } n \text{ is odd}\\ \end{cases} }[/math]

Latex has defined two commands that can be used anywhere in documents (not just maths) to insert some horizontal space. They are \quad and \qquad

A \quad is a space equal to the current font size. So, if you are using an 11pt font, then the space provided by \quad will also be 11pt (horizontally, of course.) The \qquad gives twice that amount. As you can see from the code from the above example, \quads were used to add some separation between the maths and the text.

OK, so back to the fine tuning as mentioned at the beginning of the document. A good example would be displaying the simple equation for the indefinite integral of y with respect to x:

[math]\displaystyle{ \int y\, \mathrm{d}x }[/math]

If you were to try this, you may write:

\[ \int y \mathrm{d}x \]

[math]\displaystyle{ \int y \mathrm{d}x }[/math]

However, this doesn't give the correct result. Latex doesn't respect the white-space left in the code to signify that the y and the dx are independent entities. Instead, it lumps them altogether. A \quad would clearly be overkill is this situation—what is needed are some small spaces to be utilized in this type of instance, and that's what Latex provides:

Command Description Size
\, small space 3/18 of a quad
\: medium space 4/18 of a quad
\; large space 5/18 of a quad
\! negative space -3/18 of a quad

NB you can use more than one command in a sequence to achieve a greater space if necessary.

So, to rectify the current problem:

\int y\, \mathrm{d}x

[math]\displaystyle{ \int y\, \mathrm{d}x }[/math]

\int y\: \mathrm{d}x

[math]\displaystyle{ \int y\;\;\!\! \mathrm{d}x }[/math]

\int y\; \mathrm{d}x

[math]\displaystyle{ \int y\; \mathrm{d}x }[/math]

The negative space may seem like an odd thing to use, however, it wouldn't be there if it didn't have some use! Take the following example:

\[\left(
  \begin{array}{c}
    n \\
    r
  \end{array}
  \right) = \frac{n!}{r!(n-r)!}
\]

[math]\displaystyle{ \left( \begin{matrix} n \\ r \end{matrix} \right) = \frac{n!}{r!(n-r)!} }[/math]


The matrix-like expression for representing binomial coefficients is too padded. There is too much space between the brackets and the actual contents within. This can easily be corrected by adding a few negative spaces after the left bracket and before the right bracket.

\[\left(\!
  \begin{array}{c}
    n \\
    r
  \end{array}
  \!\right) = \frac{n!}{r!(n-r)!}
\]

[math]\displaystyle{ \left(\! \begin{matrix} n \\ r \end{matrix} \!\right) = \frac{n!}{r!(n-r)!} }[/math]

In any case, adding some spaces manually should be avoided whenever possible: it makes the source code more complex and it's against the basic principles of a What You See is What You Mean approach. The best thing to do is to define some commands using all the spaces you want and then, when you use your command, you don't have to add any other space. Later, if you change your mind about the length of the horizontal space, you can easily change it modifying only the command you defined before. Let us use an example: you want the d of a dx in an integral to be in roman font and a small space away from the rest. If you want to type an integral like \int x \; \mathrm{d} x, you can define a command like this:

\newcommand{\dd}{\; \mathrm{d}}

in the preamble of your document. We have chosen \dd just because it reminds the "d" it replaces and it is fast to type. Doing so, the code for your integral becomes \int x \dd x. Now, whenever you write an integral, you just have to use the \dd instead of the "d", and all your integrals will have the same style. If you change your mind, you just have to change the definition in the preamble, and all your integrals will be changed accordingly.

Advanced Mathematics: AMS Math package

The AMS (American Mathematical Society) mathematics package is a powerful package that creates an higher layer of abstraction over mathematical LaTeX language; if you use it it will make your life easier. Some commands amsmath introduces will make other plain LaTeX commands obsolete: in order to keep consistency in the final output you'd better use amsmath commands whenever possible. If you do so, you will get an elegant output without worrying about alignment and other details, keeping your source code readable. If you want to use it, you have to add this in the preamble:

\usepackage{amsmath}

Introducing text and dots in formulas

Amsmath defines also the \dots command, that is a generalization of the existing \ldots. You can use \dots in both text and math mode and LaTeX will replace it with three dots "…" but it will decide according to the context whether to put it on the bottom (like \ldots) or centered (like \cdots).

Dots

LaTeX gives you several commands to insert dots in your formulas. This can be particularly useful if you have to type big matrices omitting elements. First of all, here are the main dots-related commands LaTeX provides:

Code Output Comment
\dots [math]\displaystyle{ \dots }[/math] generic dots, to be used in text (outside formulas as well). It automatically manages whitespaces before and after itself according to the context, it's a higher level command.
\ldots [math]\displaystyle{ \ldots }[/math] the output is similar to the previous one, but there is no automatic whitespace management; it works at a lower level.
\cdots [math]\displaystyle{ \cdots }[/math] These dots are centered relative to the height of a letter. There is also the binary multiplication operator, \cdot, mentioned below.
\vdots [math]\displaystyle{ \vdots }[/math] vertical dots
\ddots [math]\displaystyle{ \ddots }[/math] diagonal dots
\hdotsfor{n} [math]\displaystyle{ \ldots \ldots }[/math] to be used in matrices, it creates a row of dots spanning n columns.



List of Mathematical Symbols

All the pre-defined mathematical symbols from the \TeX\ package are listed below. More symbols are available from extra packages.

Relation Symbols
Symbol Script Symbol Script Symbol Script Symbol Script Symbol Script
[math]\displaystyle{ \leq }[/math] \leq [math]\displaystyle{ \geq }[/math] \geq [math]\displaystyle{ \equiv\, }[/math] \equiv [math]\displaystyle{ \models }[/math] \models [math]\displaystyle{ \prec }[/math] \prec
[math]\displaystyle{ \succ }[/math] \succ [math]\displaystyle{ \sim }[/math] \sim [math]\displaystyle{ \perp }[/math] \perp [math]\displaystyle{ \preceq }[/math] \preceq [math]\displaystyle{ \succeq }[/math] \succeq
[math]\displaystyle{ \simeq }[/math] \simeq [math]\displaystyle{ \mid }[/math] \mid [math]\displaystyle{ \ll }[/math] \ll [math]\displaystyle{ \gg }[/math] \gg [math]\displaystyle{ \asymp }[/math] \asymp
[math]\displaystyle{ \parallel }[/math] \parallel [math]\displaystyle{ \subset }[/math] \subset [math]\displaystyle{ \supset }[/math] \supset [math]\displaystyle{ \approx }[/math] \approx [math]\displaystyle{ \bowtie }[/math] \bowtie
[math]\displaystyle{ \subseteq }[/math] \subseteq [math]\displaystyle{ \supseteq }[/math] \supseteq [math]\displaystyle{ \cong }[/math] \cong [math]\displaystyle{ \sqsubset }[/math] \sqsubset [math]\displaystyle{ \sqsupset }[/math] \sqsupset
[math]\displaystyle{ \neq\, }[/math] \neq [math]\displaystyle{ \smile }[/math] \smile [math]\displaystyle{ \sqsubseteq }[/math] \sqsubseteq [math]\displaystyle{ \sqsupseteq }[/math] \sqsupseteq [math]\displaystyle{ \doteq }[/math] \doteq
[math]\displaystyle{ \frown }[/math] \frown [math]\displaystyle{ \in }[/math] \in [math]\displaystyle{ \ni }[/math] \ni [math]\displaystyle{ \propto }[/math] \propto [math]\displaystyle{ =\, }[/math] =
[math]\displaystyle{ \vdash }[/math] \vdash [math]\displaystyle{ \dashv }[/math] \dashv [math]\displaystyle{ \lt \, }[/math] < [math]\displaystyle{ \gt \, }[/math] >
Greek Letters
Symbol Script
[math]\displaystyle{ \Alpha\, }[/math] and [math]\displaystyle{ \alpha\, }[/math] \Alpha and \alpha
[math]\displaystyle{ \Beta\, }[/math] and [math]\displaystyle{ \beta\, }[/math] \Beta and \beta
[math]\displaystyle{ \Gamma\, }[/math] and [math]\displaystyle{ \gamma\, }[/math] \Gamma and \gamma
[math]\displaystyle{ \Delta\, }[/math] and [math]\displaystyle{ \delta\, }[/math] \Delta and \delta
[math]\displaystyle{ \Epsilon\, }[/math], [math]\displaystyle{ \epsilon\, }[/math] and [math]\displaystyle{ \varepsilon }[/math] \Epsilon, \epsilon and \varepsilon
[math]\displaystyle{ \Zeta\, }[/math] and [math]\displaystyle{ \zeta\, }[/math] \Zeta and \zeta
[math]\displaystyle{ \Eta\, }[/math] and [math]\displaystyle{ \eta\, }[/math] \Eta and \eta
[math]\displaystyle{ \Theta\, }[/math], [math]\displaystyle{ \theta\, }[/math] and [math]\displaystyle{ \vartheta }[/math] \Theta, \theta and \vartheta
[math]\displaystyle{ \Iota\, }[/math] and [math]\displaystyle{ \iota\, }[/math] \Iota and \iota
[math]\displaystyle{ \Kappa\, }[/math] and [math]\displaystyle{ \kappa\, }[/math] \Kappa and \kappa
[math]\displaystyle{ \Lambda\, }[/math] and [math]\displaystyle{ \lambda\, }[/math] \Lambda and \lambda
[math]\displaystyle{ \Mu\, }[/math] and [math]\displaystyle{ \mu\, }[/math] \Mu and \mu
[math]\displaystyle{ \Nu\, }[/math] and [math]\displaystyle{ \nu\, }[/math] \Nu and \nu
[math]\displaystyle{ \Xi\, }[/math] and [math]\displaystyle{ \xi\, }[/math] \Xi and \xi
[math]\displaystyle{ \Pi\, }[/math], [math]\displaystyle{ \pi\, }[/math] and [math]\displaystyle{ \varpi }[/math] \Pi, \pi and \varpi
[math]\displaystyle{ \Rho\, }[/math], [math]\displaystyle{ \rho\, }[/math] and [math]\displaystyle{ \varrho }[/math] \Rho, \rho and \varrho
[math]\displaystyle{ \Sigma\, }[/math], [math]\displaystyle{ \sigma\, }[/math] and [math]\displaystyle{ \varsigma }[/math] \Sigma, \sigma and \varsigma
[math]\displaystyle{ \Tau\, }[/math] and [math]\displaystyle{ \tau\, }[/math] \Tau and \tau
[math]\displaystyle{ \Upsilon\, }[/math] and [math]\displaystyle{ \upsilon\, }[/math] \Upsilon and \upsilon
[math]\displaystyle{ \Phi\, }[/math], [math]\displaystyle{ \phi\, }[/math], and [math]\displaystyle{ \varphi }[/math] \Phi, \phi and \varphi
[math]\displaystyle{ \Chi\, }[/math] and [math]\displaystyle{ \chi\, }[/math] \Chi and \chi
[math]\displaystyle{ \Psi\, }[/math] and [math]\displaystyle{ \psi\, }[/math] \Psi and \psi
[math]\displaystyle{ \Omega\, }[/math] and [math]\displaystyle{ \omega\, }[/math] \Omega and \omega
Binary Operations
Symbol Script Symbol Script Symbol Script Symbol Script
[math]\displaystyle{ \pm\, }[/math] \pm [math]\displaystyle{ \cap\, }[/math] \cap [math]\displaystyle{ \diamond }[/math] \diamond [math]\displaystyle{ \oplus }[/math] \oplus
[math]\displaystyle{ \mp }[/math] \mp [math]\displaystyle{ \cup }[/math] \cup [math]\displaystyle{ \bigtriangleup }[/math] \bigtriangleup [math]\displaystyle{ \ominus }[/math] \ominus
[math]\displaystyle{ \times\, }[/math] \times [math]\displaystyle{ \uplus }[/math] \uplus [math]\displaystyle{ \bigtriangledown }[/math] \bigtriangledown [math]\displaystyle{ \otimes }[/math] \otimes
[math]\displaystyle{ \div }[/math] \div [math]\displaystyle{ \sqcap }[/math] \sqcap [math]\displaystyle{ \triangleleft }[/math] \triangleleft [math]\displaystyle{ \oslash }[/math] \oslash
[math]\displaystyle{ \ast }[/math] \ast [math]\displaystyle{ \sqcup }[/math] \sqcup [math]\displaystyle{ \triangleright }[/math] \triangleright [math]\displaystyle{ \odot }[/math] \odot
[math]\displaystyle{ \star }[/math] \star [math]\displaystyle{ \vee }[/math] \vee [math]\displaystyle{ \bigcirc }[/math] \bigcirc [math]\displaystyle{ \circ }[/math] \circ
[math]\displaystyle{ \wedge }[/math] \wedge [math]\displaystyle{ \dagger\, }[/math] \dagger [math]\displaystyle{ \bullet }[/math] \bullet [math]\displaystyle{ \setminus\, }[/math] \setminus
[math]\displaystyle{ \ddagger\, }[/math] \ddagger [math]\displaystyle{ \cdot }[/math] \cdot [math]\displaystyle{ \wr }[/math] \wr [math]\displaystyle{ \amalg }[/math] \amalg
Set and/or Logic Notation
Symbol Script
[math]\displaystyle{ \exists\, }[/math] \exists
[math]\displaystyle{ \forall\, }[/math] \forall
[math]\displaystyle{ \neg\, }[/math] \neg
[math]\displaystyle{ \in\, }[/math] and [math]\displaystyle{ \notin\, }[/math] \in and \notin
[math]\displaystyle{ \ni\, }[/math] \ni
[math]\displaystyle{ \land\, }[/math] \land
[math]\displaystyle{ \lor\, }[/math] \lor
[math]\displaystyle{ \implies\, }[/math] \implies
[math]\displaystyle{ \iff\, }[/math] \iff
[math]\displaystyle{ \top\, }[/math] \top
[math]\displaystyle{ \bot\, }[/math] \bot
[math]\displaystyle{ \emptyset\, }[/math] \emptyset


Template:Clear

Summary

As you can begin to see, typesetting maths can be tricky at times. However, because Latex provides so much control, you can get professional quality mathematics typesetting for relatively little effort (once you've had a bit of practice, of course!). It would be possible to keep going and going with maths topics because it seems potentially limitless. However, with this tutorial, you should be able to get along sufficiently.

Template:TODO

Notes

  1. ^ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 requires the amsmath package
  2. ^ 1 2 requires amsfonts or amssymb packages
  3. ^ require mathrsfs package

Further reading

External links


Template:LaTeX/Bottom

Share