Aide:Formules TeX

{{#ifeq:Aide||Un article de Ziki, l'encyclopédie libre.|Une page de Ziki, l'encyclopédie libre.}}
Révision datée du 2 septembre 2023 à 15:24 par >Patrick.Delbecq (Annulation de la modification de Challwa (d)Dans de nombreuses occasions elle l'est.)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Modèle:En-tête Aide

Syntaxe générale

La syntaxe suivante est à utiliser avec l'éditeur visuel ou le wikicode (avec le wikicode la formule TeX doit être insérée entre deux balises <math> et </math>).

Caractères

TeX n'accepte que les caractères latins non accentués, sauf dans le champ de la commande \text (Modèle:2e ligne du tableau « Catalogue »). Ailleurs les caractères grecs ont chacun leur code (par exemple \alpha pour <math>\alpha</math>, voir la section « Jeux de caractères »), et les caractères accentués sont représentés par le code de l'accent précédant le caractère non accentué (par exemple \acute e pour <math>\acute e</math>, voir la Modèle:1re ligne du tableau « Catalogue »).

Commandes et environnements

Les commandes commencent par une contre-oblique \, suivie :

  • soit d'un nom composé uniquement de lettres non diacritées. Une espace, un chiffre ou tout autre caractère closent le nom, par exemple : x\mapsto2 donne <math>x\mapsto2</math> ;
  • soit d’un seul caractère spécial (non-lettre), ex. : \# donne <math>\#</math>.

Les caractères + - = / ' | * < > ( ), les 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 # $ % ^ & _ { } ~ \ sont obtenus respectivement par \# \$ \% \^ \& \_ \{ \} \~ \backslash.

Une commande peut accepter un ou plusieurs arguments. Les arguments obligatoires doivent former un bloc au sens de Modèle:LaTeX : s'ils ne font qu'un caractère de long, ils peuvent être écrits tels quels : \sqrt x donne <math>\sqrt x</math> ; sinon, ils doivent être délimités par des accolades : \sqrt{xyz} donne <math>\sqrt{xyz}</math>. Les commandes elles-mêmes sont aussi considérées comme des blocs : \sqrt\frac12 donne <math>\sqrt\frac12</math> et pas <math>\sqrt\backslash frac12</math>. Il est néanmoins conseillé d'utiliser les accolades même quand elles ne sont pas indispensables : \sqrt{\frac{1}{2}}.

Des premières règles ci-avant, 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 : \sqrt2 est équivalent à \sqrt 2 ou \sqrt{2}, mais \sqrtx n'est pas valide et doit être écrit \sqrt{x} ou \sqrt x. À l'inverse, on peut écrire autant d'espaces et de sauts à la ligne que l'on désire.

Les arguments facultatifs sont entre crochets, avant les arguments obligatoires : \sqrt[n]{x} donne <math>\sqrt[n]{x}</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 \begin{nom de l'environnement} et se terminent par \end{nom de l'environnement}. Par exemple, \begin{bmatrix}a & b \\ c & d\end{bmatrix} donne :

<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 : \mathrm ABC donne <math>\mathrm ABC~</math> ; les secondes s'appliquent à tout le texte jusqu'à la fin du groupe : \rm ABC donne <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 : {\rm A}BC donne <math>{\rm A}BC~</math>. Généralement, les commutateurs sont des versions obsolètes mais plus courtes des commandes locales.

Taille

Pour modifier la taille des formules, on peut utiliser les commutateurs \displaystyle, \textstyle, \scriptstyle et \scriptscriptstyle :

  1. La taille displaystyle est la taille par défaut, l'équation dépasse toujours de la hauteur de ligne.
    \frac{1}{2} ou \displaystyle\frac{1}{2} donne <math>\frac{1}{2}</math>
  2. textstyle est la taille d'une équation composée d'une seule ligne et sans grand symbole, elle est équivalente à displaystyle dans ce cas-là, sinon elle est plus petite. Elle dépasse néanmoins toujours la hauteur de ligne.
    \textstyle\frac{1}{2} donne <math>\textstyle\frac{1}{2}</math> mais \textstyle a est équivalent à a et donne <math>\textstyle a</math>.
  3. scriptstyle est la taille des 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.
    \scriptstyle\frac{1}{2} donne <math>\scriptstyle\frac{1}{2}</math>.
  4. scriptscriptstyle 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.
    \scriptscriptstyle\frac{1}{2} donne <math>\scriptscriptstyle\frac{1}{2}</math>.
Quelques exemples
Formule displaystyle textstyle scriptstyle scriptscriptstyle
a <math>a</math> <math>\textstyle a</math> <math>\scriptstyle a</math> <math>\scriptscriptstyle a</math>
\frac{a}{b} <math>\frac{a}{b}</math> <math>\textstyle\frac{a}{b}</math> <math>\scriptstyle\frac{a}{b}</math> <math>\scriptscriptstyle\frac{a}{b}</math>
\tfrac{a}{b} <math>\tfrac{a}{b}</math> <math>\textstyle\tfrac{a}{b}</math> <math>\scriptstyle\tfrac{a}{b}</math> <math>\scriptscriptstyle\tfrac{a}{b}</math>
\dfrac{a}{b} <math>\dfrac{a}{b}</math> <math>\textstyle\dfrac{a}{b}</math> <math>\scriptstyle\dfrac{a}{b}</math> <math>\scriptscriptstyle\dfrac{a}{b}</math>
\int_a^b <math>\int_a^b</math> <math>\textstyle\int_a^b</math> <math>\scriptstyle\int_a^b</math> <math>\scriptscriptstyle\int_a^b</math>
\sum_a^b <math>\sum_a^b</math> <math>\textstyle\sum_a^b</math> <math>\scriptstyle\sum_a^b</math> <math>\scriptscriptstyle\sum_a^b</math>
\frac{\sum_a^b}{\sum_a^b} <math>\frac{\sum_a^b}{\sum_a^b}</math> <math>\textstyle\frac{\sum_a^b}{\sum_a^b}</math> <math>\scriptstyle\frac{\sum_a^b}{\sum_a^b}</math> <math>\scriptscriptstyle\frac{\sum_a^b}{\sum_a^b}</math>
\vec{M} <math>\vec{M}</math> <math>\textstyle\vec{M}</math> <math>\scriptstyle\vec{M}</math> <math>\scriptscriptstyle\vec{M}</math>
\overrightarrow{M} <math>\overrightarrow{M}</math> <math>\textstyle\overrightarrow{M}</math> <math>\scriptstyle\overrightarrow{M}</math> <math>\scriptscriptstyle\overrightarrow{M}</math>

Ponctuation

Selon le Lexique des règles typographiques en usage à l'Imprimerie nationale éd. 2002, Modèle: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.

Points de suspension

Pour obtenir des espacements corrects, les points de suspension doivent être réalisés avec les commandes \ldots et \cdots (cette dernière pour les centrer verticalement, notamment entre des opérateurs).

Illustration :

  • incorrect : <math>x_{1}, ..., x_{n}</math> et <math>x_{1}+...+x_{n}</math> (utilisation de ...)
  • correct : <math>x_{1}, \ldots, x_{n}</math> et <math>x_{1}+\cdots+x_{n}</math> (utilisation de \ldots et \cdots).

On peut également utiliser les commandes suivantes qui sont plus précises sur le contexte mathématique :

  • \dotsc entre virgules : x_{1}, \dotsc, x_{n} donne : <math>x_{1}, \dotsc, x_{n}</math>
  • \dotsb entre opérateurs binaires : x_{1}+\dotsb+x_{n} donne : <math>x_{1}+\dotsb+x_{n}</math>
  • \dotsm pour représenter un produit : x_{1}\dotsm x_{n} donne : <math>x_{1}\dotsm x_{n}</math>
  • \dotsi pour aligner avec une intégrale : \int\dotsi donne : <math>\int\dotsi</math>

Usage des accolades

Les accolades peuvent être utilisées même lorsqu'elles ne sont pas nécessaires. Leur usage rend le code source plus lisible et facilite les modifications ultérieures.

Par exemple, on préférera <syntaxhighlight lang="text" inline="">\frac{1}{2} ​</syntaxhighlight>à <syntaxhighlight lang="text" inline="">\frac 1 2​</syntaxhighlight> et surtout à <syntaxhighlight lang="text" inline="">\frac12​</syntaxhighlight>.

De même, \sum_{k=1}^{n}{k^{2}} est plus clair que \sum_{k=1}^nk^2. De plus, si l'on doit par exemple modifier la borne supérieure de la somme en n+1, il faudra de toutes façons placer ces accolades. On rencontre cette situation également avec les intégrales.

Virgule comme séparateur décimal

La virgule est une puce par défaut en LaTeX. Si une virgule doit être affectée comme séparateur décimal, on écrira la virgule entre accolades.

nombre avec virgule (correctement) 2{,}718 <math>2{,}718</math>
nombre avec virgule (incorrect) 2,718 <math>2,718</math>

Aide

Si vous éprouvez des difficultés, n'hésitez pas à demander de l'aide aux [[:Catégorie:Utilisateur TeXnicien|utilisateurs Modèle:TeXniciens]] ou à vous rendre sur l'[[Wikipédia:atelier TeX|atelier Modèle:TeX]].

Fonctions

Fonctionnalité Syntaxe Rendu
Fonctions standard \sin x <math>\sin x</math>
\sin(x) <math>\sin(x)</math>
Fonctions non standard \operatorname{fonction}<ref name="operator">Pour définir une nouvelle fonction il faut utiliser \operatorname et non une fonction de mise en forme de texte telle que \text, \rm ou \mathrm. En effet, \operatorname identifiera sémantiquement son argument comme une fonction, gérant de ce fait correctement les espacements sans intervention de l'auteur.</ref> <math>\operatorname{fonction}</math>
Fonctions trigonométriques \sin \cos \tan \cot \sec \csc \operatorname{tg}<ref name="operator"/> <math>\sin\ \cos\ \tan\ \cot\ \sec\ \csc \, \operatorname{tg}</math>
Fonctions trigonométriques réciproques \arcsin \arccos \arctan <math>\arcsin\ \arccos\ \arctan</math>
Fonctions hyperboliques \operatorname{sh}<ref name="operator"/> \operatorname{ch} \operatorname{th} \coth <math>\operatorname{sh}\ \operatorname{ch}\ \operatorname{th}\ \coth</math>
Fonctions d'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>

Catalogue

Fonctionnalité Syntaxe Rendu
Diacritiques \hat o \widehat {abc} \acute o \dot o \ddot o \vec o \check o \grave o \breve o \tilde o \widetilde {abc} \bar o <math>\hat o \; \widehat {abc} \; \acute o \; \dot o \; \ddot o \; \vec o \; \check o \; \grave o \; \breve o \; \tilde o \; \widetilde {abc} \; \bar o</math>
Texte dans une formule<ref>Pour des questions de lisibilité il est recommandé de ne mettre du texte dans des formules qu'en cas de nécessité.</ref> \text{Texte, même avec accents} <math>\text{Texte, même avec accents}</math>
Opérateurs binaires \star \times \circ \cdot \bullet \cap \cup \sqcup \vee \wedge

\odot \oslash \oplus \ominus \otimes \div \pm \mp \triangle \triangleleft \triangleright

<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>

Opérateurs n-aires \sum \prod \coprod \int \iint \iiint \iiiint \oint \oiintModèle:Etc.

\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus

<math>\sum \prod \coprod \int \iint \iiint \iiiint \oint \oiint</math>

<math>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus</math>

Ellipses x + \cdots + y <math>x + \cdots + y</math>
Délimiteurs ( ) [ ] [\![ ]\!] \{ \} \lfloor \rfloor \lceil \rceil \langle \rangle / \backslash | \| \; \|</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ées \nabla \partial x \mathrm{d}x \dot x \ddot x <math>\nabla\ \partial x\ \mathrm dx\ \dot x\ \ddot x</math>
Racines \sqrt 2\approx 1{,}4 <math>\sqrt 2\approx 1{,}4</math>
\sqrt[n]{x} <math>\sqrt[n]{x}</math>
Norme \| x \| x\|</math>
Logique \forall \exists \nexists \lnot \land \lor \to \leftrightarrow \Rightarrow \Leftarrow \Leftrightarrow \vdash \models <math>\forall\ \exists\ \nexists\ \lnot\ \land\ \lor\ \to\ \leftrightarrow\ \Rightarrow\ \Leftarrow\ \Leftrightarrow\ \vdash\ \models</math>
Ensembles \emptyset \varnothing \cap \cup \setminus \smallsetminus <math>\empty\ \varnothing\ \cap\ \cup\ \setminus\ \smallsetminus</math>
Relations d'ensembles \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>
Relations (à nier par le préfixe \not) \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>
Flèches (liste complète si caractère Unicode existant) \leftarrow \rightarrow \to \leftrightarrow \longleftarrow \longrightarrow \longleftrightarrow \nearrow \searrow \swarrow \nwarrow \uparrow \downarrow \updownarrow

\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[\text{texte facultatif}]{\text{texte}} \xleftarrow[\text{texte facultatif}]{\text{texte}} <math>\xrightarrow[\text{texte facultatif}]{\text{texte}}\ \xleftarrow[\text{texte facultatif}]{\text{texte}}</math>
Symboles divers \hbar \wr \dagger \ddagger \infty \vdash \top \bot \models \vdots \ddots \cdots \ldots
\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 <math>\vartriangle \triangledown \lozenge \circledS \measuredangle \nexists \Bbbk \backprime \blacktriangle \blacktriangledown</math>
\blacksquare \blacklozenge \bigstar \sphericalangle \diagup \diagdown \dotplus \Cap \Cup \barwedge <math>\blacksquare \blacklozenge \bigstar \sphericalangle \diagup \diagdown \dotplus \Cap \Cup \barwedge</math>
\veebar \doublebarwedge \boxminus \boxtimes \boxdot \boxplus \divideontimes \ltimes \rtimes \leftthreetimes <math>\veebar \doublebarwedge \boxminus \boxtimes \boxdot \boxplus \divideontimes \ltimes \rtimes \leftthreetimes</math>
\rightthreetimes \curlywedge \curlyvee \circleddash \circledast \circledcirc \centerdot \intercal \leqq <math>\rightthreetimes\ \curlywedge\ \curlyvee\ \circleddash\ \circledast\ \circledcirc\ \centerdot\ \intercal\ \leqq</math>
\eqslantless \lesssim \lessapprox \approxeq \lessdot \lessgtr \lesseqgtr \lesseqqgtr \doteqdot \risingdotseq \doteq \fallingdotseq <math>\eqslantless\ \lesssim\ \lessapprox\ \approxeq\ \lessdot\ \lessgtr\ \lesseqgtr\ \lesseqqgtr\ \doteqdot\ \risingdotseq\ \doteq\ \fallingdotseq</math>
\backsim \backsimeq \subseteqq \Subset \preccurlyeq \curlyeqprec \precsim \precapprox \vartriangleleft <math>\backsim\ \backsimeq\ \subseteqq\ \Subset\ \preccurlyeq\ \curlyeqprec\ \precsim\ \precapprox\ \vartriangleleft</math>
\Vvdash \bumpeq \Bumpeq \geqq \eqslantgtr \gtrsim \gtrapprox \eqsim \gtrdot <math>\Vvdash \bumpeq \Bumpeq \geqq \eqslantgtr \gtrsim \gtrapprox \eqsim \gtrdot</math>
\gtrless \gtreqless \gtreqqless \eqcirc \circeq \triangleq \thicksim \thickapprox \supseteqq <math>\gtrless\ \gtreqless\ \gtreqqless\ \eqcirc\ \circeq\ \triangleq\ \thicksim\ \thickapprox\ \supseteqq</math>
\Supset \succcurlyeq \curlyeqsucc \succsim \succapprox \vartriangleright \shortmid \shortparallel \between \pitchfork <math>\Supset\ \succcurlyeq\ \curlyeqsucc\ \succsim\ \succapprox\ \vartriangleright\ \shortmid\ \shortparallel\ \between\ \pitchfork</math>
\propto \blacktriangleleft \therefore \backepsilon \blacktriangleright \because \nleqslant \nleqq \lneq \lneqq <math>\varpropto \blacktriangleleft \therefore \backepsilon \blacktriangleright \because \nleqslant \nleqq \lneq \lneqq</math>
\lvertneqq \lnsim \lnapprox \nprec \npreceq \precneqq \precnsim \precnapprox \nsim \nshortmid <math>\lvertneqq \lnsim \lnapprox \nprec \npreceq \precneqq \precnsim \precnapprox \nsim \nshortmid</math>
\nvdash \nVdash \ntriangleleft \ntrianglelefteq \nsubseteq \nsubseteqq \varsubsetneq \subsetneqq \varsubsetneqq \ngtr <math>\nvdash \nVdash \ntriangleleft \ntrianglelefteq \nsubseteq \nsubseteqq \varsubsetneq \subsetneqq \varsubsetneqq \ngtr</math>
\ngeqslant \ngeqq \gneq \gneqq \gvertneqq \gnsim \gnapprox \nsucc \nsucceq \succneqq <math>\ngeqslant \ngeqq \gneq \gneqq \gvertneqq \gnsim \gnapprox \nsucc \nsucceq \succneqq</math>
\succnsim \succnapprox \ncong \nshortparallel \nparallel \nvDash \nVDash \ntriangleright \ntrianglerighteq \nsupseteq <math>\succnsim \succnapprox \ncong \nshortparallel \nparallel \nvDash \nVDash \ntriangleright \ntrianglerighteq \nsupseteq</math>
\nsupseteqq \varsupsetneq \supsetneqq \varsupsetneqq <math>\nsupseteqq \varsupsetneq \supsetneqq \varsupsetneqq</math>
\surd \uplus \bigtriangleup \bigtriangledown \ominus <math>\surd \uplus \bigtriangleup \bigtriangledown \ominus</math>
\oslash \odot \bigcirc \amalg \prec \succ \preceq \succeq <math>\oslash \odot \bigcirc \amalg \prec \succ \preceq \succeq</math>
\dashv \asymp <math>\dashv \asymp</math>

Indices, exposants

De manière générale, les indices sont introduits par un tiret bas (_) et les exposants par un accent circonflexe (^).

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 \int est ici le seul membre. Il peut être court-circuité par les commandes suivantes : \limits place indice et exposant verticalement, et \nolimits 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 ci-dessus.

Fonctionnalité Syntaxe Rendu
Exposant a^2 <math>a^2</math>
Indice a_2 <math>a_2</math>
Regroupement a^{2+2} <math>a^{2+2}</math>
a_{i,j} <math>a_{i,j}</math>
Combiner indice et exposant x_2^3 <math>x_2^3</math>
{x_2}^3 <math>{x_2}^3</math>
Indice et exposant précédents {}_1^2\!X_3^4 <math>{}_1^2\!X_3^4</math>
\sideset{_1^2}{_3^4}\prod_a^b
(seulement pour grands symboles !)
<math>\sideset{_1^2}{_3^4}\prod_a^b</math>
Dérivée x' ou x^\prime <math>x'</math> ou <math>x^\prime</math>
Soulignés et surlignés \hat{a} - \bar{b} - \vec{c} - \overline{g h i} - \underline{j k l} <math>\hat{a} - \bar{b} - \vec{c} - \overline{g h i} - \underline{j k l}</math>
Vecteurs et angles \vec U - \overrightarrow{AB} - \widehat{POQ} <math>\vec U - \overrightarrow{AB} - \widehat{POQ}</math>
Somme \sum_{k=1}^n k^2 ou \sum_\overset{k=0}{k \text{ pair}}^n <math>\sum_{k=1}^n k^2</math> ou <math>\sum_\overset{k=0}{k \text{ pair}}^n</math>
Produit \prod_{i=1}^n x_i <math>\prod_{i=1}^n x_i</math>
Limite \lim_{n \to \infty} x_n <math>\lim_{n \to \infty}x_n</math>
\lim\limits_{n \to \infty} x_n <math>\lim_{n \to \infty}x_n</math>
Intégrale \int_{-n}^n \mathrm{e}^x \, \mathrm{d}x <math>\int_{-n}^n \mathrm{e}^x \, \mathrm{d}x</math>
Double intégrale \iint\limits_D \, \mathrm{d}x \, \mathrm{d}y <math>\iint\limits_D \, \mathrm{d}x \, \mathrm{d}y</math>
Triple intégrale \iiint\limits_E \, \mathrm{d}x \, \mathrm{d}y \, \mathrm{d}z <math>\iiint\limits_E \, \mathrm{d}x \, \mathrm{d}y \, \mathrm{d}z</math>
Quadruple intégrale \iiiint\limits_F \, \mathrm{d}x \, \mathrm{d}y \, \mathrm{d}z \, \mathrm{d}t <math>\iiiint\limits_F \, \mathrm{d}x \, \mathrm{d}y \, \mathrm{d}z \, \mathrm{d}t</math>
Placement spécifique \int\limits_{-n}^n \mathrm{e}^x \, \mathrm{d}x <math>\int\limits_{-n}^n \mathrm{e}^x \, \mathrm{d}x</math>
\lim\nolimits_{n \to \infty} x_n <math>\lim\nolimits_{n \to \infty}x_n</math>
\lim_{x\to 0 \atop x\ge 0} f(x) <math>\lim_{x\to 0 \atop x\ge 0} f(x)</math>
Intersections, unions \bigcap_1^n p - \bigcup_1^k p <math>\bigcap_1^n p - \bigcup_1^k p</math>

Fractions, matrices, plusieurs lignes

Fonctionnalité Syntaxe Rendu
Fractions \frac{a}{b} ou \dfrac{a}{b} ou {a \over b} <math>\frac{a}{b}</math> ou <math>\dfrac{a}{b}</math> ou <math>{a \over b}</math>
\tfrac{a}{b} <math>\tfrac{a}{b}</math>
\frac{\frac{a}{b}}{\frac{c}{d}} contre \frac{\dfrac{a}{b}}{\dfrac{c}{d}} <math>\frac{\frac{a}{b}}{\frac{c}{d}}</math> contre <math>\frac{\dfrac{a}{b}}{\dfrac{c}{d}}</math>
Fractions continues x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3+\cdots}}} <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>
Binômes, coefficients binomiaux, combinaisons \binom{n}{k} ou \dbinom{n}{k} <math>\binom{n}{k}</math> ou <math>\dbinom{n}{k}</math>
\tbinom{n}{k} <math>\tbinom{n}{k}</math>
\frac{\binom{n}{k}}{\binom{n'}{k'}} contre \frac{\dbinom{n}{k}}{\dbinom{n'}{k'}} <math>\frac{\binom nk}{\binom{n'}{k'}}</math> contre <math>\frac{\dbinom{n}{k}}{\dbinom{n'}{k'}}</math>
Matrices \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 et bordures \begin{array}{c|r|l} \rm center & \rm right & \rm left \\ \hline c & r & l \end{array} r|l} \rm center & \rm right & \rm left \\ \hline 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èmes d'équations f(n)=\begin{cases} \frac{n}{2}, & \text{si }n\text{ est pair} \\ 3n+1, & \text{si }n\text{ est impair} \end{cases} <math>f(n)=\begin{cases} \frac{n}{2}, & \text{si }n\text{ est pair} \\ 3n+1, & \text{si }n\text{ est impair} \end{cases}</math>
Fonction, application \begin{matrix}f:&]1,+\infty[&\rightarrow&\R\\ & x&\mapsto&\dfrac{\sqrt{x-1}}{\sqrt{x-1}+1}\end{matrix} <math>\begin{matrix}f:&]1,+\infty[&\rightarrow&\R\\ & x&\mapsto&\dfrac{\sqrt{x-1}}{\sqrt{x-1}+1}\end{matrix}</math>
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>
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{\text{texte}} y, x \xleftarrow{\text{texte}} y <math>x \xrightarrow{\text{texte}}y,\ x\xleftarrow{\text{texte}}y</math>

Texte barré

Les commandes suivantes permettent de barrer des éléments de texte dans des formules mathématiques, par exemple lorsque certains éléments s'annulent.

Fonctionnalité Syntaxe Rendu
Barré à droite \cancel{5y} <math>\cancel{5y}</math>
Barré à gauche \bcancel{5y} <math>\bcancel{5y}</math>
Barré en croix \xcancel{5y} <math>\xcancel{5y}</math>
Barré avec valeur \cancelto{0}{5y} <math>\cancelto{0}{5y}</math>

Jeux de caractères

La constante de Néper <math>\mathrm{e}</math> doit être utilisée en romain, c'est-à-dire avec l'utilisation de \mathrm{e}. Ceci s'applique également pour l'unité imaginaire <math>\mathrm{i}</math> et le « d droit » <math>\mathrm{d}</math> des différentielles utilisé notamment dans les intégrales.

Ainsi, on écrira \mathrm{e}^{\mathrm{i}\theta} pour afficher <math>\mathrm{e}^{\mathrm{i}\theta}</math> et \int_a^b f(t) \, \mathrm{d}t pour afficher <math>\int_a^b f(t) \, \mathrm{d}t</math>.

Fonctionnalité Syntaxe Rendu
Lettres grecques (sans omicron !) \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Iota \Kappa \Lambda \Mu \Nu \Xi O \Pi \Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega

\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

<math>\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>

<math>\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</math>

Blackboard gras

\mathbb Ensembles de nombres

\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathbb{abcdefghijklmnopqrstuvwxyz}
\mathbb{1234567890}

<math>\mathbb{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}</math>

<math>\mathbb{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathbb{1234567890}</math>

\N \Z \Q \R (raccourcis à utiliser de préférence) \Complex \mathbb{H} (\C et \H sont proscrits) <math>\N \; \Z \; \Q \; \R \; \Complex \; \mathbb{H}</math>
Roman

\mathrm

\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathrm{abcdefghijklmnopqrstuvwxyz}
\mathrm{1234567890}

<math>\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>

<math>\mathrm{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathrm{1234567890}</math>

Gras

\mathbf

\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathbf{abcdefghijklmnopqrstuvwxyz}
\mathbf{1234567890}

<math>\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>

<math>\mathbf{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathbf{1234567890}</math>

Sans-serif

\mathsf

\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathsf{abcdefghijklmnopqrstuvwxyz}
\mathsf{1234567890}

<math>\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>

<math>\mathsf{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathsf{1234567890}</math>

Script

\mathcal

\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathcal{abcdefghijklmnopqrstuvwxyz}
\mathcal{1234567890}

<math>\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>

<math>\mathcal{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathcal{1234567890}</math>

Fraktur

\mathfrak

\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

\mathfrak{abcdefghijklmnopqrstuvwxyz}
\mathfrak{1234567890}

<math>\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>
<math>

\mathfrak{abcdefghijklmnopqrstuvwxyz}</math>
<math>\mathfrak{1234567890}</math>

Serif (par défaut) ABCDEFGHIJKLMNOPQRSTUVWXYZ

abcdefghijklmnopqrstuvwxyz
1234567890

<math>ABCDEFGHIJKLMNOPQRSTUVWXYZ</math>

<math>abcdefghijklmnopqrstuvwxyz</math>
<math>1234567890</math>

Hébreu \aleph \beth \gimel \daleth <math>\aleph \; \beth \; \gimel \; \daleth</math>

Délimiteurs dans les grandes équations

Déconseillé ( \frac{1}{2} ) <math>( \frac{1}{2} )</math>
Mieux \left( \frac{1}{2} \right) <math>\left( \frac{1}{2} \right)</math>

\left et \right peuvent être utilisés avec divers délimiteurs, par exemple :

Fonctionnalité Syntaxe Rendu
Parenthèses \left( \frac{a}{b} \right) <math>\left( \frac{a}{b} \right)</math>
Crochets \left[ \frac{a}{b} \right] <math>\left[ \frac{a}{b} \right]</math>
Accolades \left\{ \frac{a}{b} \right\} <math>\left\{ \frac{a}{b} \right\}</math>
Chevrons \left\langle \frac{a}{b} \right\rangle <math>\left\langle \frac{a}{b} \right\rangle</math>
Barres (de valeur absolue, par exemple) \left| \frac{a}{b} \right| \frac{a}{b} \right|</math>
Doubles barres (norme euclidienne, par exemple) \left\| \frac{\vec a}{b} \right\| \frac{\vec a}{b} \right\|</math>
Flèches \left \Uparrow \frac{a}{b} \right \Downarrow <math>\left \Uparrow \frac{a}{b} \right \Downarrow</math>
Utilisez \left. ou \right. pour ne faire apparaître qu'un seul des délimiteurs \left. \frac{A}{B} \right\} \to X <math>\left. \frac{A}{B} \right\} \to X</math>
Taille des délimiteurs (déconseillé<ref>À éviter : \left et \right, qui ajustent automatiquement à la bonne taille, sont à privilégier.</ref>) \big( \Big( \bigg( \Bigg(


\big[ \Big\{ \bigg\langle \Bigg\Uparrow

\big] \Big\} \bigg\rangle \Bigg\Downarrow

<math>\big( \Big( \bigg( \Bigg(</math>


<math>\big[ \Big\{ \bigg\langle \Bigg\Uparrow</math>
<math>\big] \Big\} \bigg\rangle \Bigg\Downarrow</math>

\bigl( \Bigl( \biggl( \Biggl( \dots \Biggr) \biggr) \Bigr) \bigr)


\bigl( \Bigl\Uparrow \biggl\Downarrow \Biggl| \dots \Biggr| \biggr\Downarrow \Bigr\Downarrow \bigr)
\bigl( \Bigl[ \biggl\{ \Biggl\langle \dots \Biggr\rangle \biggr\} \Bigr] \bigr.

<math>\bigl( \Bigl( \biggl( \Biggl( \dots \Biggr) \biggr) \Bigr) \bigr)</math>


<math>\bigl( \Bigl\Uparrow \biggl\Downarrow \Biggl| \dots \Biggr| \biggr\Downarrow \Bigr\Downarrow \bigr)</math>
<math>\bigl( \Bigl[ \biggl\{ \Biggl\langle \dots \Biggr\rangle \biggr\} \Bigr] \bigr.</math>

Espacement

TeX gère automatiquement la plupart des problèmes d'espacement, mais vous pouvez souhaiter contrôler l'espacement manuellement dans certains cas.

Il est fortement conseillé d'utiliser le moins possible ces constructions et, en tout état de cause, de ne jamais les utiliser lors de la première mise en forme.

Fonctionnalité Syntaxe Rendu
double cadratin a \qquad b <math>a \qquad b</math>
cadratin a \quad b <math>a \quad b</math>
espace large a \; b <math>a \; b</math>
espace normale a \ b ou a~b<ref>Il y a une différence importante : ~ est une espace insécable.</ref> <math>a \ b</math>
espace fine a \, b <math>a \, b</math>
pas d'espacement ab ou a b <math>a b</math>
espacement négatif a \! b <math>a \! b</math>

Couleurs

Certaines parties peuvent être mises en couleur, à l'aide du commutateur \color{nom de la couleur} :

  • {\color{Blue}x^2}+{\color{Brown}2x}-{\color{Green}1} donne
<math>{\color{Blue}x^2}+{\color{Brown}2x}-{\color{Green}1}</math>
  • x=\frac{-b\pm\sqrt{\color{Red}{b^2-4ac}}}{2a} donne
<math>x=\frac{-b\pm\sqrt{\color{Red}{b^2-4ac}}}{2a}</math>

Voir sur Wikipédia en anglais {{#invoke:Langue|indicationDeLangue}} pour les 68 couleurs disponibles.

{{#if: Afin de conserver un document lisible et agréable, les couleurs doivent être utilisées avec une grande parcimonie. Elles doivent de plus respecter les conventions de style et être choisies de telle façon que les daltoniens puissent les distinguer.

|

Afin de conserver un document lisible et agréable, les couleurs doivent être utilisées avec une grande parcimonie. Elles doivent de plus respecter les conventions de style et être choisies de telle façon que les daltoniens puissent les distinguer.
   | Modèle:Non videpx

}}

Notes et références

Modèle:Références

Voir aussi

Modèle:Autres projets

Liens internes

Liens externes

Modèle:Palette