Aide:Syntaxe/LateX : Différence entre versions
(→Forcer la génération en PNG) |
(→Indices, exposants) |
||
(5 révisions intermédiaires par le même utilisateur non affichées) | |||
Ligne 28 : | Ligne 28 : | ||
===Taille=== | ===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> | ||
+ | |<math>a</math> | ||
+ | |<math>\textstyle a</math> | ||
+ | |<math>\scriptstyle a</math> | ||
+ | |<math>\scriptscriptstyle a</math> | ||
+ | |- | ||
+ | |<code>\frac ab</code> | ||
+ | |<math>\frac ab</math> | ||
+ | |<math>\textstyle\frac ab</math> | ||
+ | |<math>\scriptstyle\frac ab</math> | ||
+ | |<math>\scriptscriptstyle\frac ab</math> | ||
+ | |- | ||
+ | |<code>\tfrac ab</code> | ||
+ | |<math>\tfrac ab</math> | ||
+ | |<math>\textstyle\tfrac ab</math> | ||
+ | |<math>\scriptstyle\tfrac ab</math> | ||
+ | |<math>\scriptscriptstyle\tfrac ab</math> | ||
+ | |- | ||
+ | |<code>\dfrac ab</code> | ||
+ | |<math>\dfrac ab</math> | ||
+ | |<math>\textstyle\dfrac ab</math> | ||
+ | |<math>\scriptstyle\dfrac ab</math> | ||
+ | |<math>\scriptscriptstyle\dfrac ab</math> | ||
+ | |- | ||
+ | |<code>\sum_a^b</code> | ||
+ | |<math>\sum_a^b</math> | ||
+ | |<math>\textstyle\sum_a^b</math> | ||
+ | |<math>\scriptstyle\sum_a^b</math> | ||
+ | |<math>\scriptscriptstyle\sum_a^b</math> | ||
+ | |- | ||
+ | |<code>\frac{\sum_a^b}{\sum_a^b}</code> | ||
+ | |<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> | ||
+ | |- | ||
+ | |+ Quelques exemples | ||
+ | |} | ||
+ | |||
+ | ===Ponctuation=== | ||
+ | Selon le ''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. | ||
+ | |||
+ | == Catalogue == | ||
+ | {| class="wikitable" | ||
+ | ! Fonctionnalité !! Syntaxe !! À quoi ça ressemble | ||
+ | |----- | ||
+ | | Diacritiques | ||
+ | | \hat o \acute o \dot o \ddot o \vec o \check o \grave o \breve o \widehat {abc} \tilde o \bar o | ||
+ | | <math>\hat o \; \acute o \; \dot o \; \ddot o \; \vec o \; \check o \; \grave o \; \breve o \; \widehat {abc} \; \tilde o \; \bar o \; </math> | ||
+ | |----- | ||
+ | |rowspan="2"|Texte dans une formule | ||
+ | |\text{Texte sans accent} | ||
+ | |<math>\text{Texte sans accent}</math> | ||
+ | |----- | ||
+ | |\mathrm{Texte~accentu\acute e} | ||
+ | |<math>\mathrm{Texte~accentu\acute e}</math> | ||
+ | |----- | ||
+ | |Opérateurs binaires | ||
+ | |\star \times \circ \cdot \bullet \cap \cup \sqcup \vee \wedge<br />\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<br/>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus | ||
+ | |<math>\sum \prod \coprod \int \iint \iiint \iiiint \oint\quad</math> <math>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus</math> | ||
+ | |----- | ||
+ | |Ellipses | ||
+ | |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> | ||
+ | |----- | ||
+ | |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> | ||
+ | |----- | ||
+ | |Fonctions hyperboliques | ||
+ | |\sinh \cosh \tanh \coth | ||
+ | |<math>\sinh\ \cosh\ \tanh\ \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> | ||
+ | |----- | ||
+ | |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> | ||
+ | |----- | ||
+ | |rowspan="2" | Racines | ||
+ | |\sqrt 2\approx 1,4 | ||
+ | |<math>\sqrt 2\approx 1,4</math> | ||
+ | |----- | ||
+ | |\sqrt[n]{x} | ||
+ | |<math>\sqrt[n]{x}</math> | ||
+ | |----- | ||
+ | |Norme | ||
+ | |<nowiki>\| x \|</nowiki> | ||
+ | |<math>\|x\|</math> | ||
+ | |----- | ||
+ | |Logique | ||
+ | |\forall \exists \lnot \land \lor \to \leftrightarrow \Rightarrow \Leftarrow \Leftrightarrow \vdash \models | ||
+ | |<math>\forall\ \exists\ \lnot\ \land\ \lor\ \to\ \leftrightarrow\ \Rightarrow\ \Leftarrow\ \Leftrightarrow\ \vdash\ \models</math> | ||
+ | |----- | ||
+ | |Ensembles | ||
+ | |\empty \varnothing \cap \cup \setminus \smallsetminus | ||
+ | |<math>\empty\ \varnothing\ \cap\ \cup\ \setminus\ \smallsetminus</math> | ||
+ | |----- | ||
+ | |rowspan="2"|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> | ||
+ | |----- | ||
+ | |Correspondance et relation <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 | ||
+ | |<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 \lessapprox \approxeq \lessdot \lessgtr \lesseqgtr \lesseqqgtr \doteqdot \risingdotseq \doteq \fallingdotseq | ||
+ | |<math> \eqslantless \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 (<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. | ||
+ | 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]]. |
Version actuelle datée du 10 juillet 2010 à 11:29
Sommaire
Les balises <math>[modifier]
Les formules mathématiques peuvent être écrites avec LATEX. Cette syntaxe est beaucoup plus facile à écrire et à lire que du HTML. Les formules sont présentées en HTML si possible, autrement une image Portable Network Graphics est produite par le serveur. Ce comportement par défaut peut être configuré dans les préférences.
Syntaxe générale[modifier]
Les formules s'écrivent entre <math> … </math>
.
Commandes et environnements[modifier]
Les commandes commencent par une contre-oblique \
, suivie :
- soit d'un nom composé uniquement de lettres non diacritées. Un espace, un chiffre ou tout autre caractère clôturent le nom, ex :
x\mapsto2
<math>x\mapsto2</math> ; - soit d’un seul caractère spécial (non-lettre), ex :
\#
<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 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}
<math>\sqrt{xyz}</math>. Les commandes elles-mêmes sont aussi considérées comme des blocs : \sqrt\frac12
donne <math>\sqrt\frac 1 2</math> et pas <math>\sqrt\backslash frac12</math>.
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 : \sqrt2
est équivalent à \sqrt 2
ou \sqrt{2}
, mais \sqrtx
n'est pas valide et doit être écrit \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
<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
<math>\mathrm ABC~</math> ; les secondes s'appliquent à tout le texte jusqu'à la fin du groupe : \rm ABC
<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
<math>{\rm A}BC~</math>. Généralement, les commutateurs sont des versions obsolètes mais plus courtes des commandes locales.
Forcer la génération en PNG[modifier]
Pour forcer une formule à être générée en PNG, il suffit d'ajouter un tilde ~ en fin de formule :
a(1+e^2/2)
donne <math>a(1+e^2/2)</math>, mais
a(1+e^2/2)~
donne <math>a(1+e^2/2)~</math>.
Ceci ne doit être utilisé qu'exceptionnellement .
Taille[modifier]
Pour modifier la taille des formules, on peut utiliser les commutateurs \displaystyle
, \textstyle
, \scriptstyle
et \scriptscriptstyle
:
- La taille
displaystyle
est la taille par défaut, l'équation dépasse toujours de la hauteur de ligne.\frac12
ou\displaystyle\frac12
donne <math>\frac12</math>
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\frac12
donne <math>\textstyle\frac12</math> mais\textstyle a
est équivalent àa
et donne <math>\textstyle a</math>.
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\frac12
donne <math>\scriptstyle\frac12</math>.
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\frac12
donne <math>\scriptscriptstyle\frac12</math>.
Formule | displaystyle | textstyle | scriptstyle | scriptscriptstyle |
---|---|---|---|---|
a
|
<math>a</math> | <math>\textstyle a</math> | <math>\scriptstyle a</math> | <math>\scriptscriptstyle a</math> |
\frac ab
|
<math>\frac ab</math> | <math>\textstyle\frac ab</math> | <math>\scriptstyle\frac ab</math> | <math>\scriptscriptstyle\frac ab</math> |
\tfrac ab
|
<math>\tfrac ab</math> | <math>\textstyle\tfrac ab</math> | <math>\scriptstyle\tfrac ab</math> | <math>\scriptscriptstyle\tfrac ab</math> |
\dfrac ab
|
<math>\dfrac ab</math> | <math>\textstyle\dfrac ab</math> | <math>\scriptstyle\dfrac ab</math> | <math>\scriptscriptstyle\dfrac ab</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> |
Ponctuation[modifier]
Selon le 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.
Catalogue[modifier]
Fonctionnalité | Syntaxe | À quoi ça ressemble |
---|---|---|
Diacritiques | \hat o \acute o \dot o \ddot o \vec o \check o \grave o \breve o \widehat {abc} \tilde o \bar o | <math>\hat o \; \acute o \; \dot o \; \ddot o \; \vec o \; \check o \; \grave o \; \breve o \; \widehat {abc} \; \tilde o \; \bar o \; </math> |
Texte dans une formule | \text{Texte sans accent} | <math>\text{Texte sans accent}</math> |
\mathrm{Texte~accentu\acute e} | <math>\mathrm{Texte~accentu\acute e}</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 \bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus |
<math>\sum \prod \coprod \int \iint \iiint \iiiint \oint\quad</math> <math>\bigcup \bigcap \bigsqcup \bigvee \bigwedge \bigoplus \bigotimes \bigodot \biguplus</math> |
Ellipses | 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 | \| | \; \|</math> |
Fonctions std. (mal) | sin x | <math>sin x\,</math> |
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> |
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> |
Fonctions hyperboliques | \sinh \cosh \tanh \coth | <math>\sinh\ \cosh\ \tanh\ \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> |
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 \lnot \land \lor \to \leftrightarrow \Rightarrow \Leftarrow \Leftrightarrow \vdash \models | <math>\forall\ \exists\ \lnot\ \land\ \lor\ \to\ \leftrightarrow\ \Rightarrow\ \Leftarrow\ \Leftrightarrow\ \vdash\ \models</math> |
Ensembles | \empty \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> | |
Correspondance et relation (à 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 | \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[texte~facultatif]{texte} \xleftarrow[texte~facultatif]{texte} | <math>\xrightarrow[texte~facultatif]{texte}\ \xleftarrow[texte~ facultatif]{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 \lessapprox \approxeq \lessdot \lessgtr \lesseqgtr \lesseqqgtr \doteqdot \risingdotseq \doteq \fallingdotseq | <math> \eqslantless \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[modifier]
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.