Diferenças entre edições de "Ajuda:Como editar fórmulas"

Da Thinkfn
(Página substituída por 'Ilustre Rightsideclub Ilustre Simulador Humano Ilustre Rui Resende Ilustre RR economics Ilustre Market Maker Ilustre Orson Vaughn')
(Desfeita a edição 6901 de Mandonoke (Discussão))
Linha 1: Linha 1:
Ilustre Rightsideclub
+
O [[MediaWiki]] usa '''marcas [[TeX]]''' para representar fórmulas matemáticas. As fórmulas são geradas sob a forma de imagens [[PNG]]  ou [[MathML]], dependendo das opções do utilizador.
  
Ilustre Simulador Humano
+
As marcas TeX devem ser colocadas entre as marcas:  <nowiki><tex> ... </tex></nowiki>.
  
Ilustre Rui Resende
 
  
Ilustre RR economics
+
== Caracteres especiais ==
  
Ilustre Market Maker
+
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| funções padrão (correto)
 +
| \cos x + \ln y +\operatorname{sgn}\, z
 +
| <tex>\cos x + \ln y +\operatorname{sgn}\, z</tex>
 +
|-----
 +
| funções padrão (errado)
 +
| cos x + ln y + sgn z
 +
| <tex>cos x + ln y + sgn z\,</tex>
 +
|-----
 +
| Aritmética modular
 +
| s_k \equiv 0 \pmod{m}
 +
| <tex>s_k \equiv 0 \pmod{m}</tex>
 +
|-----
 +
| Derivação
 +
| \nabla \partial dx \dot x \ddot y
 +
| <tex>\nabla \partial dx \quad \dot x\ \ddot y</tex>
 +
|-----
 +
| Conjuntos
 +
| \forall x\not\in\empty\subseteq A\cap B\cup \exists \{x,y\} \times C
 +
| <tex>\forall x \not\in \empty \subseteq A\cap B\cup \exists \{x,y\} \times C</tex>
 +
|-----
 +
| Lógica
 +
| p \wedge \bar{q} \to p\vee \neg q
 +
| <tex>p \wedge \bar{q} \to p\vee \neg q</tex>
 +
|-----
 +
| rowspan="2" | Raízes
 +
| \sqrt{2}\approx 1{,}4
 +
| <tex>\sqrt{2}\approx 1{,}4</tex>
 +
|-----
 +
| \sqrt[n]{x}
 +
| <tex>\sqrt[n]{x}</tex>
 +
|-----
 +
| Separador decimal (correto)
 +
| 1/8 = 0{,}125
 +
| <tex>1/8 = 0{,}125</tex>
 +
|-----
 +
| Separador decimal (errado)
 +
| 1/8 = 0,125
 +
| <tex>1/8 = 0,125</tex>
 +
|-----
 +
| Operadores relacionais
 +
| \sim \simeq \cong \le \ge \equiv \not\equiv \approx \ne
 +
| <tex> \sim \ \simeq \ \cong \ \le \ \ge \ \equiv \ \not\equiv \ \approx \ \ne</tex>
 +
|-----
 +
| Geometria
 +
| \Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; <nowiki>\</nowiki> \; 45^\circ
 +
| <tex>\Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; \| \; 45^\circ</tex>
 +
|-
 +
| rowspan="2" | Setas
 +
|\leftarrow \rightarrow \leftrightarrow<br>
 +
\longleftarrow \longrightarrow<br>
 +
\mapsto \longmapsto<br>
 +
\nearrow \searrow \swarrow \nwarrow<br>
 +
\uparrow \downarrow \updownarrow<br>
 +
|<tex>\leftarrow\ \rightarrow\ \leftrightarrow</tex>&nbsp;<br>
 +
<tex>\longleftarrow\ \longrightarrow</tex>&nbsp;<br>
 +
<tex>\mapsto\ \longmapsto</tex>&nbsp;<br>
 +
<tex>\nearrow\ \searrow\ \swarrow\ \nwarrow</tex>&nbsp;<br>
 +
<tex>\uparrow\ \downarrow\ \updownarrow</tex>&nbsp;<br>
 +
|-----
 +
|
 +
\Leftarrow \Rightarrow \Leftrightarrow<br>
 +
\Longleftarrow \Longrightarrow \Longleftrightarrow<br>
 +
\Uparrow \Downarrow \Updownarrow
 +
|
 +
<tex>\Leftarrow\ \Rightarrow\ \Leftrightarrow</tex>&nbsp;<br>
 +
<tex>\Longleftarrow\ \Longrightarrow\ \Longleftrightarrow</tex>&nbsp;<br>
 +
<tex>\Uparrow\ \Downarrow\ \Updownarrow</tex>&nbsp;
 +
|-----
 +
| Especial
 +
| \oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ \cdot \times
 +
\bullet \infty
 +
| <tex>\oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ
 +
\cdot \times \bullet\ \infty</tex>
 +
|}
  
Ilustre Orson Vaughn
+
== Subscritos, superescritos ==
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| Superscrito || a^2 || <tex>a^2</tex>
 +
|-
 +
| Superscrito || a^2\quad || <tex>a^2\quad</tex>
 +
|-----
 +
| Subescrito || a_2 || <tex> a_2 </tex>
 +
|-----
 +
| rowspan="2" | Agrupando || a^{2+2} || <tex>a^{2+2}</tex>
 +
|-----
 +
| a_{i,j} || <tex>a_{i,j}</tex>
 +
|-----
 +
| Combinando super e subescrito || x_2^3
 +
| <tex>x_2^3</tex>
 +
|-----
 +
| Derivadas (certo) || x' || <tex>x'</tex>
 +
|-----
 +
| Derivadas (errado, em HTML) || x^\prime
 +
| <tex>x^\prime</tex>
 +
|-----
 +
| Derivadas (errado, em PNG) || x\prime
 +
| <tex>x\prime</tex>
 +
|-----
 +
| Sublinhados, sobrelinhas, vetores || \hat a \ \bar b \ \vec c  \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l}
 +
| <tex>\hat a \ \bar b \ \vec c  \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l}</tex>
 +
|-----
 +
| Overbraces || \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}
 +
| <tex>\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}</tex>
 +
|-----
 +
| Underbraces || \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}
 +
| <tex>\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}</tex>
 +
|-----
 +
| Somatório || \sum_{k=1}^{N} k^2 || <tex>\sum_{k=1}^{N} k^2</tex>
 +
|-----
 +
| Productório || \prod_{i=1}^{N} x_{i} || <tex>\prod_{i=1}^{N} x_{i} </tex>
 +
|-----
 +
| Limites || \lim_{n \to \infty}x_n || <tex>\lim_{n \to \infty}x_n</tex>
 +
|-----
 +
| Integrais || \int_{-N}^{N} e^x\, dx || <tex>\int_{-N}^{N} e^x\, dx</tex>
 +
|-----
 +
| Integrais lineares || \oint_{C} x^3\, dx + 4y^2\, dy
 +
| <tex>\oint_{C} x^3\, dx + 4y^2\, dy</tex>
 +
|}
 +
 
 +
 
 +
== Fracções, matrizes, chavetas==
 +
 
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| Frações
 +
| \frac{2}{4} or {2 \over 4}
 +
| <tex>\frac{2}{4}</tex>
 +
|-----
 +
| Coeficientes binomiais
 +
| {n \choose k}
 +
| <tex>{n \choose k}</tex>
 +
|-----
 +
| rowspan="6" | Matrizes
 +
| \begin{pmatrix} x & y \\ z & v \end{pmatrix}
 +
| <tex>\begin{pmatrix} x & y \\ z & v \end{pmatrix}</tex>
 +
|-----
 +
| \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}
 +
| <tex>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}</tex>
 +
|-----
 +
| \begin{Bmatrix} x & y \\ z & v \end{Bmatrix}
 +
| <tex>\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}</tex>
 +
|-----
 +
| \begin{vmatrix} x & y \\ z & v \end{vmatrix}
 +
| <tex>\begin{vmatrix} x & y \\ z & v \end{vmatrix}</tex>
 +
|-----
 +
| \begin{Vmatrix} x & y \\ z & v \end{Vmatrix}
 +
| <tex>\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}</tex>
 +
|-----
 +
| \begin{matrix} x & y \\ z & v \end{matrix}
 +
| <tex>\begin{matrix} x & y \\ z & v \end{matrix}</tex>
 +
|-----
 +
| Distinção maiúscula/minúscula
 +
|f(n) = \left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix} \right
 +
| <tex>f(n)=\left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix}\right. </tex>
 +
|-----
 +
| Equações em mais de uma linha
 +
| \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}
 +
| <tex>\begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}</tex>
 +
|}
 +
 
 +
== Fontes ==
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| Alfabeto grego minúsculo
 +
| \alpha \beta \chi \delta \epsilon \varepsilon \phi \varphi \gamma \eta \iota \kappa \lambda \mu \nu o \pi \varpi \theta \vartheta \rho \varrho \sigma \varsigma \tau \upsilon \omega \xi \psi \zeta
 +
| <tex>\alpha \beta \chi \delta \epsilon \varepsilon \phi \varphi \gamma \eta \iota \kappa \lambda \mu \nu \!\, </tex>
 +
<tex> o \pi \varpi \theta \vartheta \rho \varrho \sigma \varsigma \tau \upsilon \omega \xi \psi \zeta \!\, </tex>
 +
|-----
 +
| Alfabeto grego maiúsculo
 +
| A B X \Delta E \Phi \Gamma H I K \Lambda M N O \Pi \Theta P \Sigma T \Upsilon \Omega \Xi \Psi Z
 +
| <tex>A B X \Delta E \Phi \Gamma H I K \Lambda M \!\, </tex>
 +
<tex>N O \Pi \Theta P \Sigma T \Upsilon \Omega \Xi \Psi Z \!\,</tex>
 +
|-----
 +
| Negrito forte || x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\sub\mathbb{C}
 +
| <tex>x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\subset\mathbb{C}</tex>
 +
|-----
 +
| Negrito (vectores) || \mathbf{x} \cdot \mathbf{y} = 0
 +
| <tex>\mathbf{x} \cdot \mathbf{y} = 0 </tex>
 +
|-----
 +
| Negrito (grego)
 +
| \boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma}
 +
| <tex>\boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma}</tex>
 +
|-----
 +
| Fonte Fraktur || \mathfrak{a} \mathfrak{B}
 +
| <tex>\mathfrak{a} \mathfrak{B}</tex>
 +
|-----
 +
| Script || \mathcal{ABC} || <tex>\mathcal{ABC}</tex>
 +
|-----
 +
| Hebraico || \aleph \beth \gimel \daleth
 +
| <tex>\aleph\ \beth\ \gimel\ \daleth</tex>
 +
|-----
 +
| letras não-inclinadas || \mbox{abc} || <tex>\mbox{abc}</tex>
 +
|}
 +
 
 +
== Parênteses ==
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como fica parecendo
 +
|-----
 +
| Erros || ( \frac{1}{2} ) || <tex>( \frac{1}{2} )</tex>
 +
|-----
 +
| Melhor assim || \left ( \frac{1}{2} \right )
 +
| <tex>\left ( \frac{1}{2} \right )</tex>
 +
|}
 +
Você pode usar diversos delimitadores em conjunto com \left e \right:
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| Parênteses || \left ( A \right ) || <tex>\left ( A \right )</tex>
 +
|-----
 +
| Colchetes || \left [ A \right ] || <tex>\left [ A \right ]</tex>
 +
|-----
 +
| Chaves || \left \{ A \right \} || <tex>\left \{ A \right \}</tex>
 +
|-----
 +
| ''boca de jacaré'' || \left \langle A \right \rangle
 +
| <tex>\left \langle A \right \rangle</tex>
 +
|-----
 +
| Barras e barras duplas
 +
| \left | A \right | and \left \| B \right \|
 +
| <tex>\left | A \right | and \left \| B \right \|</tex>
 +
|-----
 +
| Os delimitadores podem ser misturados, contanto que \left e \right estejam equilibrados.
 +
|
 +
\left [ 0,1 \right )<br>\left \langle \psi \right |
 +
| <tex>\left [ 0,1 \right )</tex><br><tex>\left \langle \psi \right |</tex>
 +
|-----
 +
| Use \left. e \right. se você deseja esconder um delimitador:
 +
| \left . \frac{A}{B} \right \} \to X
 +
| <tex>\left . \frac{A}{B} \right \} \to X</tex>
 +
|}
 +
 
 +
 
 +
== Espaços ==
 +
 
 +
Perceba que o TeX lida com a maioria dos espaços de forma automática, mas algumas vezes você pode querer controlar manualmente os espaços.
 +
{| {{prettytable}}
 +
|-----
 +
! Grupo
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| espaço duplo de um quadrado || a \qquad b
 +
| <tex>a \qquad b</tex>
 +
|-----
 +
| espaço simples de um quadrado || a \quad b
 +
| <tex> a \quad b</tex>
 +
|-----
 +
| espaço de texto || a\ b || <tex>a\ b</tex>
 +
|-----
 +
| espaço largo || a\;b || <tex>a\;b</tex>
 +
|-----
 +
| espaço médio || a\&gt;b || [não suportado]
 +
|-----
 +
| espaço pequeno || a\,b || <tex>a\,b</tex>
 +
|-----
 +
| evitar espaço || ab || <tex>ab\,</tex>
 +
|-----
 +
| espaço "negativo" || a\!b || <tex>a\!b</tex>
 +
|}
 +
 
 +
== Alinhamento ==
 +
Se você precisar desesperadamente inserir uma equação como <div style="vertical-align:-100%;display:inline;"><tex>\int_{-N}^{N} e^x\, dx</tex></div>&nbsp; no fluxo normal de texto, você pode usar um alinhamento vertical com a marcação HTML <tt>&lt;div&gt;</tt>:
 +
 
 +
* <nowiki><div style="vertical-align:-100%;display:inline;"><tex>...</tex></div></nowiki>''
 +
 
 +
 
 +
== Forçando a exibição como PNG ==
 +
 
 +
Se você precisar, é possível fazer com que uma fórmula seja exibida com o formato PNG, sem afetar a própria fórmula; basta adicionar \,\! (espaço pequeno e espaço negativo, que se cancelam) em algum lugar da marcação matemática (provavelmente no final).
 +
 
 +
Isso pode ser útil para manter a exibição de fórmulas num formato consistente e padronizado, por exemplo, para ajustar fórmulas que são exibidas incorrectamente em HTML (a^{2+2}), ou para demonstrar como algo fica na imagem quando normalmente deveria ser exibido em HTML. Por exemplo:
 +
{| {{prettytable}}
 +
|-----
 +
! Sintaxe
 +
! Como é exibido
 +
|-----
 +
| a^{2+2} || <tex>a^{2+2}</tex>
 +
|-----
 +
| a^{2+2} \,\! || <tex>a^{2+2} \,\!</tex>
 +
|-----
 +
| \int_{-N}^{N} e^x\, dx
 +
| <tex> \int_{-N}^{N} e^x\, dx </tex>
 +
|-----
 +
| \int_{-N}^{N} e^x\, dx \,\!
 +
| <tex> \int_{-N}^{N} e^x\, dx \,\! </tex>
 +
|}
 +
 
 +
 
 +
Esse teste foi feito com a maioria das fórmulas desta página, e parece funcionar correctamente.
 +
 
 +
Você pode incluir um comentário HTML para avisar pessoas para não removerem a fórmula:
 +
 
 +
:''<nowiki><!-- O \,\! deve ser mantido na fórmula para que ela seja exibida como imagem PNG ao invés de HTML, por favor não o retire! --></nowiki>''
 +
 
 +
 
 +
 
 +
==Links relevantes==
 +
 
 +
* [http://meta.wikimedia.org/wiki/Help:Formula Página de ajuda no MetaWiki]
 +
* Uma introdução em [[Portable Document Format]] ao TeX -- veja a partir da página 39 para uma boa introdução sobre a matemática envolvida: [[http://www.ctan.org/tex-archive/info/gentle/gentle.pdf]]
 +
 
 +
 
 +
[[Categoria:!Ajuda]]

Revisão das 11h16min de 31 de dezembro de 2007

O MediaWiki usa marcas TeX para representar fórmulas matemáticas. As fórmulas são geradas sob a forma de imagens PNG ou MathML, dependendo das opções do utilizador.

As marcas TeX devem ser colocadas entre as marcas: <tex> ... </tex>.


Caracteres especiais

Grupo Sintaxe Como é exibido
funções padrão (correto) \cos x + \ln y +\operatorname{sgn}\, z \cos x + \ln y +\operatorname{sgn}\, z
funções padrão (errado) cos x + ln y + sgn z cos x + ln y + sgn z\,
Aritmética modular s_k \equiv 0 \pmod{m} s_k \equiv 0 \pmod{m}
Derivação \nabla \partial dx \dot x \ddot y \nabla \partial dx \quad \dot x\ \ddot y
Conjuntos \forall x\not\in\empty\subseteq A\cap B\cup \exists \{x,y\} \times C \forall x \not\in \empty \subseteq A\cap B\cup \exists \{x,y\} \times C
Lógica p \wedge \bar{q} \to p\vee \neg q p \wedge \bar{q} \to p\vee \neg q
Raízes \sqrt{2}\approx 1{,}4 \sqrt{2}\approx 1{,}4
\sqrt[n]{x} \sqrt[n]{x}
Separador decimal (correto) 1/8 = 0{,}125 1/8 = 0{,}125
Separador decimal (errado) 1/8 = 0,125 1/8 = 0,125
Operadores relacionais \sim \simeq \cong \le \ge \equiv \not\equiv \approx \ne  \sim \ \simeq \ \cong \ \le \ \ge \ \equiv \ \not\equiv \ \approx \ \ne
Geometria \Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; \ \; 45^\circ \Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; \| \; 45^\circ
Setas \leftarrow \rightarrow \leftrightarrow

\longleftarrow \longrightarrow
\mapsto \longmapsto
\nearrow \searrow \swarrow \nwarrow
\uparrow \downarrow \updownarrow

\leftarrow\ \rightarrow\ \leftrightarrow 

\longleftarrow\ \longrightarrow 
\mapsto\ \longmapsto 
\nearrow\ \searrow\ \swarrow\ \nwarrow 
\uparrow\ \downarrow\ \updownarrow 

\Leftarrow \Rightarrow \Leftrightarrow
\Longleftarrow \Longrightarrow \Longleftrightarrow
\Uparrow \Downarrow \Updownarrow

\Leftarrow\ \Rightarrow\ \Leftrightarrow 
\Longleftarrow\ \Longrightarrow\ \Longleftrightarrow 
\Uparrow\ \Downarrow\ \Updownarrow 

Especial \oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ \cdot \times

\bullet \infty

\oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ
\cdot \times \bullet\ \infty

Subscritos, superescritos

Grupo Sintaxe Como é exibido
Superscrito a^2 a^2
Superscrito a^2\quad a^2\quad
Subescrito a_2  a_2
Agrupando a^{2+2} a^{2+2}
a_{i,j} a_{i,j}
Combinando super e subescrito x_2^3 x_2^3
Derivadas (certo) x' x'
Derivadas (errado, em HTML) x^\prime x^\prime
Derivadas (errado, em PNG) x\prime x\prime
Sublinhados, sobrelinhas, vetores \hat a \ \bar b \ \vec c \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l} \hat a \ \bar b \ \vec c  \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l}
Overbraces \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}
Underbraces \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}
Somatório \sum_{k=1}^{N} k^2 \sum_{k=1}^{N} k^2
Productório \prod_{i=1}^{N} x_{i} \prod_{i=1}^{N} x_{i}
Limites \lim_{n \to \infty}x_n \lim_{n \to \infty}x_n
Integrais \int_{-N}^{N} e^x\, dx \int_{-N}^{N} e^x\, dx
Integrais lineares \oint_{C} x^3\, dx + 4y^2\, dy \oint_{C} x^3\, dx + 4y^2\, dy


Fracções, matrizes, chavetas

Grupo Sintaxe Como é exibido
Frações \frac{2}{4} or {2 \over 4} \frac{2}{4}
Coeficientes binomiais {n \choose k} {n \choose k}
Matrizes \begin{pmatrix} x & y \\ z & v \end{pmatrix} \begin{pmatrix} x & y \\ z & v \end{pmatrix}
\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}
\begin{Bmatrix} x & y \\ z & v \end{Bmatrix} \begin{Bmatrix} x & y \\ z & v \end{Bmatrix}
\begin{vmatrix} x & y \\ z & v \end{vmatrix} \begin{vmatrix} x & y \\ z & v \end{vmatrix}
\begin{Vmatrix} x & y \\ z & v \end{Vmatrix} \begin{Vmatrix} x & y \\ z & v \end{Vmatrix}
\begin{matrix} x & y \\ z & v \end{matrix} \begin{matrix} x & y \\ z & v \end{matrix}
Distinção maiúscula/minúscula f(n) = \left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix} \right f(n)=\left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix}\right.
Equações em mais de uma linha \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix} \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}

Fontes

Grupo Sintaxe Como é exibido
Alfabeto grego minúsculo \alpha \beta \chi \delta \epsilon \varepsilon \phi \varphi \gamma \eta \iota \kappa \lambda \mu \nu o \pi \varpi \theta \vartheta \rho \varrho \sigma \varsigma \tau \upsilon \omega \xi \psi \zeta \alpha \beta \chi \delta \epsilon \varepsilon \phi \varphi \gamma \eta \iota \kappa \lambda \mu \nu \!\,

 o \pi \varpi \theta \vartheta \rho \varrho \sigma \varsigma \tau \upsilon \omega \xi \psi \zeta \!\,

Alfabeto grego maiúsculo A B X \Delta E \Phi \Gamma H I K \Lambda M N O \Pi \Theta P \Sigma T \Upsilon \Omega \Xi \Psi Z A B X \Delta E \Phi \Gamma H I K \Lambda M \!\,

N O \Pi \Theta P \Sigma T \Upsilon \Omega \Xi \Psi Z \!\,

Negrito forte x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\sub\mathbb{C} x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\subset\mathbb{C}
Negrito (vectores) \mathbf{x} \cdot \mathbf{y} = 0 \mathbf{x} \cdot \mathbf{y} = 0
Negrito (grego) \boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma} \boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma}
Fonte Fraktur \mathfrak{a} \mathfrak{B} \mathfrak{a} \mathfrak{B}
Script \mathcal{ABC} \mathcal{ABC}
Hebraico \aleph \beth \gimel \daleth \aleph\ \beth\ \gimel\ \daleth
letras não-inclinadas \mbox{abc} \mbox{abc}

Parênteses

Grupo Sintaxe Como fica parecendo
Erros ( \frac{1}{2} ) ( \frac{1}{2} )
Melhor assim \left ( \frac{1}{2} \right ) \left ( \frac{1}{2} \right )

Você pode usar diversos delimitadores em conjunto com \left e \right:

Grupo Sintaxe Como é exibido
Parênteses \left ( A \right ) \left ( A \right )
Colchetes \left [ A \right ] \left [ A \right ]
Chaves \left \{ A \right \} \left \{ A \right \}
boca de jacaré \left \langle A \right \rangle \left \langle A \right \rangle
Barras e barras duplas A \right | and \left \| B \right \| \left | A \right | and \left \| B \right \|
Os delimitadores podem ser misturados, contanto que \left e \right estejam equilibrados.

\left [ 0,1 \right )
\left \langle \psi \right |

\left [ 0,1 \right )
\left \langle \psi \right |
Use \left. e \right. se você deseja esconder um delimitador: \left . \frac{A}{B} \right \} \to X \left . \frac{A}{B} \right \} \to X


Espaços

Perceba que o TeX lida com a maioria dos espaços de forma automática, mas algumas vezes você pode querer controlar manualmente os espaços.

Grupo Sintaxe Como é exibido
espaço duplo de um quadrado a \qquad b a \qquad b
espaço simples de um quadrado a \quad b  a \quad b
espaço de texto a\ b a\ b
espaço largo a\;b a\;b
espaço médio a\>b [não suportado]
espaço pequeno a\,b a\,b
evitar espaço ab ab\,
espaço "negativo" a\!b a\!b

Alinhamento

Se você precisar desesperadamente inserir uma equação como
\int_{-N}^{N} e^x\, dx
  no fluxo normal de texto, você pode usar um alinhamento vertical com a marcação HTML <div>:
  • <div style="vertical-align:-100%;display:inline;"><tex>...</tex></div>


Forçando a exibição como PNG

Se você precisar, é possível fazer com que uma fórmula seja exibida com o formato PNG, sem afetar a própria fórmula; basta adicionar \,\! (espaço pequeno e espaço negativo, que se cancelam) em algum lugar da marcação matemática (provavelmente no final).

Isso pode ser útil para manter a exibição de fórmulas num formato consistente e padronizado, por exemplo, para ajustar fórmulas que são exibidas incorrectamente em HTML (a^{2+2}), ou para demonstrar como algo fica na imagem quando normalmente deveria ser exibido em HTML. Por exemplo:

Sintaxe Como é exibido
a^{2+2} a^{2+2}
a^{2+2} \,\! a^{2+2} \,\!
\int_{-N}^{N} e^x\, dx  \int_{-N}^{N} e^x\, dx
\int_{-N}^{N} e^x\, dx \,\!  \int_{-N}^{N} e^x\, dx \,\!


Esse teste foi feito com a maioria das fórmulas desta página, e parece funcionar correctamente.

Você pode incluir um comentário HTML para avisar pessoas para não removerem a fórmula:

<!-- O \,\! deve ser mantido na fórmula para que ela seja exibida como imagem PNG ao invés de HTML, por favor não o retire! -->


Links relevantes