Ajuda:Fórmulas TeX
From ASM Wiki
O MediaWiki usa marcas TeX para representar fórmulas matemáticas. As fórmulas são geradas sob a forma de imagens PNG ou HTML, dependendo das opções do utilizador.
As marcas TeX devem ser colocadas entre as marcas: <math> ... </math>.
Conteúdo |
Caracteres especiais
| Grupo | Sintaxe | Como é exibido |
|---|---|---|
| funções padrão (correto) | \cos x + \ln y +\operatorname{sgn} z | <math>\cos x + \ln y +\operatorname{sgn} z</math> |
| funções padrão (errado) | cos x + ln y + sgn z | <math>cos x + ln y + sgn z\,</math> |
| Aritmética modular | s_k \equiv 0 \pmod{m} | <math>s_k \equiv 0 \pmod{m}</math> |
| Derivação | \nabla \partial dx \dot x \ddot y | <math>\nabla \partial dx \quad \dot x\ \ddot y</math> |
| Conjuntos | \forall x\not\in\varnothing\subseteq A\cap B\cup \exists \{x,y\}
\times C | <math>\forall x \not\in \varnothing \subseteq A\cap B\cup \exists
\{x,y\} \times C</math> |
| Lógica | p \land \bar{q} \to p\lor \lnot q | <math>p \land \bar{q} \to p\lor \lnot q</math> |
| Raízes | \sqrt{2}\approx 1.4 | <math>\sqrt{2}\approx 1.4</math> |
| \sqrt[n]{x} | <math>\sqrt[n]{x}</math> | |
| Operadores relacionais | \sim \simeq \cong \le \ge \equiv \not\equiv \approx \ne | <math> \sim \ \simeq \ \cong \ \le \ \ge \ \equiv \ \not\equiv \ \approx \ \ne</math> |
| Geometria | \Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; \ \; 45^\circ | \; 45^\circ</math> |
| Setas |
\leftarrow \rightarrow \leftrightarrow |
<math>\leftarrow\ \rightarrow\ \leftrightarrow</math> |
|
\Leftarrow \Rightarrow \Leftrightarrow |
<math>\Leftarrow\ \Rightarrow\ \Leftrightarrow</math> | |
| Especial | \oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ \cdot \times
\bullet \infty | <math>\oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ
\cdot \times \bullet\ \infty</math> |
Subscritos, superescritos
| Grupo | Sintaxe | Como é exibido |
|---|---|---|
| Superscrito | a^2 | <math>a^2</math> |
| Subescrito | a_2 | <math> a_2 </math> |
| Agrupando | a^{2+2} | <math>a^{2+2}</math> |
| a_{i,j} | <math>a_{i,j}</math> | |
| Combinando super e subescrito | x_2^3 | <math>x_2^3</math> |
| Derivadas (certo) | x' | <math>x'</math> |
| Derivadas (errado, em HTML) | x^\prime | <math>x^\prime</math> |
| Derivadas (errado, em PNG) | x\prime | <math>x\prime</math> |
| 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} | <math>\hat a \ \bar b \ \vec c \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l}</math> |
| Overbraces | \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} | <math>\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}</math> |
| Underbraces | \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} | <math>\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}</math> |
| Somatório | \sum_{k=1}^{N} k^2 | <math>\sum_{k=1}^{N} k^2</math> |
| Productório | \prod_{i=1}^{N} x_{i} | <math>\prod_{i=1}^{N} x_{i} </math> |
| Limites | \lim_{n \to \infty}x_n | <math>\lim_{n \to \infty}x_n</math> |
| Integrais | \int_{-N}^{N} e^x\, dx | <math>\int_{-N}^{N} e^x\, dx</math> |
| Integrais lineares | \oint_{C} x^3\, dx + 4y^2\, dy | <math>\oint_{C} x^3\, dx + 4y^2\, dy</math> |
Frações, matrizes, chavetas
| Grupo | Sintaxe | Como é exibido |
|---|---|---|
| Frações | \frac{2}{4} or {2 \over 4} | <math>\frac{2}{4}</math> |
| Coeficientes binomiais | {n \choose k} | <math>{n \choose k}</math> |
| Matrizes | \begin{pmatrix} x & y \\ z & v \end{pmatrix} | <math>\begin{pmatrix} x & y \\ z & v
\end{pmatrix}</math> |
| \begin{bmatrix} 0 & \cdots & 0 \\ \vdots &
\ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} | <math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots
& \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} </math> | |
| \begin{Bmatrix} x & y \\ z & v \end{Bmatrix} | <math>\begin{Bmatrix} x & y \\ z & v
\end{Bmatrix}</math> | |
| \begin{vmatrix} x & y \\ z & v \end{vmatrix} | <math>\begin{vmatrix} x & y \\ z & v
\end{vmatrix}</math> | |
| \begin{Vmatrix} x & y \\ z & v \end{Vmatrix} | <math>\begin{Vmatrix} x & y \\ z & v
\end{Vmatrix}</math> | |
| \begin{matrix} x & y \\ z & v \end{matrix} | <math>\begin{matrix} x & y \\ z & v
\end{matrix}</math> | |
| 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 | <math>f(n)=\left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix}\right. </math> |
| Equações em mais de uma linha | \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ &
=& n^2 + 2n + 1\end{matrix} | <math>\begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}</math> |
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 | <math>\alpha \beta \chi \delta \epsilon \varepsilon \phi \varphi \gamma \eta \iota \kappa \lambda \mu \nu \!\, </math>
<math> o \pi \varpi \theta \vartheta \rho \varrho \sigma \varsigma \tau \upsilon \omega \xi \psi \zeta \!\, </math> |
| 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 | <math>A B X \Delta E \Phi \Gamma H I K \Lambda M \!\, </math>
<math>N O \Pi \Theta P \Sigma T \Upsilon \Omega \Xi \Psi Z \!\,</math> |
| Negrito forte | x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\sub\mathbb{C} | <math>x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\subset\mathbb{C}</math> |
| Negrito (vectores) | \mathbf{x} \cdot \mathbf{y} = 0 | <math>\mathbf{x} \cdot \mathbf{y} = 0 </math> |
| Negrito (grego) | \boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma} | <math>\boldsymbol{\alpha}+\boldsymbol{\beta}+\boldsymbol{\gamma}</math> |
| Fonte Fraktur | \mathfrak{a} \mathfrak{B} | <math>\mathfrak{a} \mathfrak{B}</math> |
| Script | \mathcal{ABC} | <math>\mathcal{ABC}</math> |
| Hebraico | \aleph \beth \gimel \daleth | <math>\aleph\ \beth\ \gimel\ \daleth</math> |
| letras não-inclinadas | \mbox{abc} | <math>\mbox{abc}</math> |
Parênteses
| Grupo | Sintaxe | Como fica parecendo |
|---|---|---|
| Erros | ( \frac{1}{2} ) | <math>( \frac{1}{2} )</math> |
| Melhor assim | \left ( \frac{1}{2} \right ) | <math>\left ( \frac{1}{2} \right )</math> |
Você pode usar diversos delimitadores em conjunto com \left e \right:
| Grupo | Sintaxe | Como é exibido |
|---|---|---|
| Parênteses | \left ( A \right ) | <math>\left ( A \right )</math> |
| Colchetes | \left [ A \right ] | <math>\left [ A \right ]</math> |
| Chaves | \left \{ A \right \} | <math>\left \{ A \right \}</math> |
| boca de jacaré | \left \langle A \right \rangle | <math>\left \langle A \right \rangle</math> |
| Barras e barras duplas | A \right | and \left \| B \right \| | A \right | and \left \| B \right \|</math> |
| Os delimitadores podem ser misturados, contanto que \left e \right estejam equilibrados. |
\left [ 0,1 \right ) | </math> |
| Use \left. e \right. se você deseja esconder um delimitador: | \left . \frac{A}{B} \right \} \to X | <math>\left . \frac{A}{B} \right \} \to X</math> |
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 | <math>a \qquad b</math> |
| espaço simples de um quadrado | a \quad b | <math> a \quad b</math> |
| espaço de texto | a\ b | <math>a\ b</math> |
| espaço largo | a\;b | <math>a\;b</math> |
| espaço médio | a\>b | [não suportado] |
| espaço pequeno | a\,b | <math>a\,b</math> |
| evitar espaço | ab | <math>ab\,</math> |
| espaço "negativo" | a\!b | <math>a\!b</math> |
Alinhamento
Se você precisar desesperadamente inserir uma equação como- <div style="vertical-align:-100%;display:inline;"><math>...</math></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} | <math>a^{2+2}</math> |
| a^{2+2} \,\! | <math>a^{2+2} \,\!</math> |
| \int_{-N}^{N} e^x\, dx | <math> \int_{-N}^{N} e^x\, dx </math> |
| \int_{-N}^{N} e^x\, dx \,\! | <math> \int_{-N}^{N} e^x\, dx \,\! </math> |
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! -->
Ligações externas
- Uma introdução em PDF ao TeX -- veja a partir da página 39 para uma boa introdução sobre a matemática envolvida: [1]

