Wikipédia:Atelier TeX/Exemples
Voici quelques exemples de ce qui est possible avec LaTeX :
Divers
modifierTypographie
modifierPar défaut, l'écriture est en italique.
Normal | ABCDEFGHIJKLM NOPQRSTUVWXYZ |
|
Blackboard gras | \mathbb{A B C D E F G H I J K L M} \mathbb{N O P Q R S T U V W X Y Z} |
|
\N \Z \Q \R \C | ||
Fraktur | \mathfrak{a b c d e f g h i j k l m} \mathfrak{n o p q r s t u v w x y z} |
|
Gras | \mathbf{ABCDEFGHIJKLM} \mathbf{NOPQRSTUVWXYZ} |
|
Roman | \mathrm{ABCDEFGHIJKLM} \mathrm{NOPQRSTUVWXYZ} |
|
Script | \mathcal{ABCDEFGHIJKLM} \mathcal{NOPQRSTUVWXYZ} |
|
Caractères spéciaux
modifierLettres grecques minuscules (sans omicron !) | \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 |
|
Lettres grecques majuscules (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 |
|
Hébreu | \aleph \beth \daleth \gimel | |
Diacritiques et accents | ||
---|---|---|
\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a} \check{a} \bar{a} \ddot{a} \dot{a} |
Couleurs
modifier- Pour plus de détails, voir Atelier TeX/Exemples/Couleurs (liste des 68 couleurs disponibles).
Il peut être utile de mettre certaines parties en couleurs :
- x=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}
- Attention
- Les couleurs doivent être utilisées seulement en cas de nécessité. Elles doivent respecter les conventions de style et être choisies de telle façon que les daltoniens puissent les distinguer.
Mathématiques
modifier
<math>ax^2 + bx + c = 0</math>
<math>x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</math>
Délimiteurs : Parenthèses et autres
modifierParenthèses | \left( \frac{a}{b} \right) | Crochets | \left[ \frac{a}{b} \right] | ||
Accolades | \left\{ \frac{a}{b} \right\} | Chevrons | \left\langle \frac{a}{b} \right\rangle | ||
Barres (de valeur absolue, par exemple) |
\left| \frac{a}{b} \right| | Flèches | \left \Uparrow \frac{a}{b} \right \Downarrow | ||
Taille des délimiteurs | \big( \Big( \bigg( \Bigg( ... \Bigg] \bigg] \Big] \big] |
Attention à mettre \left( et pas juste (, idem pour \right) et ) | |||||
Mauvais | <math>( \frac{1}{2} )</math> | Mieux | <math>\left( \frac{1}{2} \right)</math> | ||
Utilisez un point . pour faire disparaître le délimiteur \left. fait disparaître le délimiteur gauche |
\left. {A \over B} \right\} \to X |
<math>S_\text{new} = S_\text{old} + \frac{ \left( 5-T \right) ^2} {2}</math>
<math>\int_a^x \int_a^s f(y)\,\mathrm dy\, \mathrm ds = \int_a^x f(y)(x-y)\,\mathrm dy</math>
Somme
modifier
<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)}</math>
<math>u'' + p(x)u' + q(x)u=f(x),\quad x>a</math>
<math>|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)\,</math>
<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)\,</math>
Équation intégrale
modifier
<math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\, \mathrm dR</math>
Chimie
modifier- Par défaut en TeX, le texte est en écriture italique : . En chimie, il faut donc toujours utiliser \mathrm{texte en romaine} ou simplement \rm pour avoir le texte en écriture romaine (ou écriture droite) : .
Formules simples
modifier- : <math> \mathrm{ZnO}\,</math>,
- : <math> \mathrm{CH_3OH}\,</math>
- Le tiret bas : _ permet d'écrire en indice.
- : <math> \mathrm{Fe_2(SO_4)_3}\,</math>
- : <math>\mathrm{F^-}\,</math>
- L'accent circonflexe ^ permet d'écrire une puissance.
- : <math>\mathrm{AlF_4^-}\,</math>
- : <math>\mathrm{Al^{3+}}\,</math>
- Si la chaine de caractères en puissance comporte plusieurs caractères, elle doit être mise entre des accolades {XXX}.
- : <math>{}^{14}_{\ 6}\mathrm C\,</math>
- On peut combiner indice et exposant ou placer un exposant ou un indice sur du vide à l'aide de {}.
Formule développée plane
modifierÀ l'aide d'un tableau (array), on peut dessiner certaines formules développées de molécule. Exemple de l'éthane :
<math> \begin{array}{lcl} &\rm H &\rm H\\ &| &|\\ \rm H-\!\!\!\! &\rm C-\!\!\!\! &\rm C - H\\ &| &|\\ &\rm H &\rm H\\ \end{array} </math> |
|
Réactions
modifierFlèches
modifier- Flèches simples :
- ajustage automatique au texte inscrit :
- : <math>\xrightarrow[exemple de texte long souscrit]{\rm exemple\ de\ texte\ suscrit}</math>
- la longueur peut être ajustée en utilisant un ou plusieurs \qquad :
- : <math>\begin{matrix} & \\\mathrm{\overrightarrow{\qquad}} \\\end{matrix}</math>
- : <math>\begin{matrix} & \\\mathrm{\overrightarrow{\qquad\qquad}} \\\end{matrix}</math>
- : <math>\begin{matrix} & \\\mathrm{\overrightarrow{\qquad\qquad\qquad}} \\\end{matrix}</math>
- Flèche double :
- : <math>\rightleftarrows</math>
Harpons
modifier- Harpons :
- : <math>\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown</math>
- Harpon double :
- : <math>\rightleftharpoons</math>
Exemples de réactions
modifier
- \mathrm{AgCl \qquad \overrightarrow{\leftarrow} \qquad Ag^+ + Cl^-}
- <math>\begin{matrix} & \\ \mathrm{2Al^0} & \overrightarrow{\qquad} & \mathrm{2Al^{3+} + 3e^-}\ \\\end{matrix}</math>
- <math>\begin{matrix} & {}_{\rm{T\ >\ 90\ ^\circ C }} & \\ \mathrm{ZnS + Fe_2(SO_4)_3} & \overrightarrow{\qquad\qquad\qquad} & \mathrm{ZnSO_4 + 2FeSO_4 + S\ (solide)}\ \\\end{matrix}</math>
- <math>\begin{matrix} & \\ \mathrm{ZnS + 3/2 O_2} & \overrightarrow{\qquad} & \mathrm{ZnO + SO_2} & {\rm \Delta\ H} = - 445\ {\rm kJ/mol\ de\ ZnS\ entre\ 800\ et\ 1\ 000\ ^\circ C} \\\end{matrix}</math>
- <math>\mathrm{X_{\alpha} Y_{\beta} (solide)} {\qquad}\overrightarrow{\rm{\leftarrow }}{\qquad} \alpha \mathrm{X^{\beta+} (aqueux)+\beta Y^{\alpha-} (aqueux)} </math>
- <math>\begin{matrix} & {\rm air\ (source\ de\ diazote)} + {\rm dihydrog\grave{e}ne} + {\rm eau} & \overrightarrow{\qquad\qquad} & {\rm ammoniac} + {\rm dioxyde\ de\ carbone} \end{matrix}</math>