Diferenças entre edições de "Ajuda:Como editar fórmulas"
m (Ajuda:Guia de edição/Fórmulas TeX foi movido para Twiki:Como editar fórmulas) |
|||
(23 edições intermédias não estão a ser mostradas.) | |||
Linha 1: | Linha 1: | ||
− | O | + | O Software MediaWiki usado pelo '''Think Finance''' 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: <nowiki><tex> ... </tex></nowiki>. | As marcas TeX devem ser colocadas entre as marcas: <nowiki><tex> ... </tex></nowiki>. | ||
Linha 16: | Linha 16: | ||
| <tex>\cos x + \ln y +\operatorname{sgn}\, z</tex> | | <tex>\cos x + \ln y +\operatorname{sgn}\, z</tex> | ||
|----- | |----- | ||
− | | funções padrão (errado) | + | | funções padrão (errado) |
+ | | cos x + ln y + sgn z | ||
| <tex>cos x + ln y + sgn z\,</tex> | | <tex>cos x + ln y + sgn z\,</tex> | ||
|----- | |----- | ||
− | | Aritmética modular | + | | Aritmética modular |
+ | | s_k \equiv 0 \pmod{m} | ||
| <tex>s_k \equiv 0 \pmod{m}</tex> | | <tex>s_k \equiv 0 \pmod{m}</tex> | ||
|----- | |----- | ||
− | | Derivação | + | | Derivação |
+ | | \nabla \partial dx \dot x \ddot y | ||
| <tex>\nabla \partial dx \quad \dot x\ \ddot y</tex> | | <tex>\nabla \partial dx \quad \dot x\ \ddot y</tex> | ||
|----- | |----- | ||
| Conjuntos | | Conjuntos | ||
− | | \forall x\not\in\ | + | | \forall x\not\in\empty\subseteq A\cap B\cup \exists \{x,y\} \times C |
− | \times C | + | | <tex>\forall x \not\in \empty \subseteq A\cap B\cup \exists \{x,y\} \times C</tex> |
− | | <tex>\forall x \not\in \ | + | |
− | \{x,y\} \times C</tex> | + | |
|----- | |----- | ||
− | | Lógica | + | | Lógica |
− | | <tex>p \ | + | | p \wedge \bar{q} \to p\vee \neg q |
+ | | <tex>p \wedge \bar{q} \to p\vee \neg q</tex> | ||
|----- | |----- | ||
− | | rowspan="2" | Raízes | + | | rowspan="2" | Raízes |
+ | | \sqrt{2}\approx 1{,}4 | ||
| <tex>\sqrt{2}\approx 1{,}4</tex> | | <tex>\sqrt{2}\approx 1{,}4</tex> | ||
|----- | |----- | ||
− | | \sqrt[n]{x} | + | | \sqrt[n]{x} |
+ | | <tex>\sqrt[n]{x}</tex> | ||
|----- | |----- | ||
− | | Separador decimal (correto) | + | | Separador decimal (correto) |
+ | | 1/8 = 0{,}125 | ||
| <tex>1/8 = 0{,}125</tex> | | <tex>1/8 = 0{,}125</tex> | ||
|----- | |----- | ||
− | | Separador decimal (errado) | + | | Separador decimal (errado) |
+ | | 1/8 = 0,125 | ||
| <tex>1/8 = 0,125</tex> | | <tex>1/8 = 0,125</tex> | ||
|----- | |----- | ||
| Operadores relacionais | | Operadores relacionais | ||
− | | \sim \simeq | + | | \sim \simeq \le \ge \equiv \not\equiv \approx \ne |
− | | <tex> \sim \ \simeq | + | | <tex> \sim \ \simeq \ \le \ \ge \ \equiv \ \not\equiv \ \approx \ \ne</tex> |
|----- | |----- | ||
| Geometria | | Geometria | ||
− | | \Diamond | + | | \Diamond \; \triangle \; \angle \; \perp \; \mid \; <nowiki>\</nowiki> \; 45^\circ |
− | | <tex>\Diamond | + | | <tex>\Diamond \; \triangle \; \angle \; \perp \; \mid \; \| \; 45^\circ</tex> |
|- | |- | ||
− | | rowspan="2" | Setas | | + | | rowspan="2" | Setas |
− | \leftarrow \rightarrow \leftrightarrow<br> | + | |\leftarrow \rightarrow \leftrightarrow<br> |
\longleftarrow \longrightarrow<br> | \longleftarrow \longrightarrow<br> | ||
− | \mapsto | + | \mapsto <br> |
\nearrow \searrow \swarrow \nwarrow<br> | \nearrow \searrow \swarrow \nwarrow<br> | ||
\uparrow \downarrow \updownarrow<br> | \uparrow \downarrow \updownarrow<br> | ||
− | | | + | |<tex>\leftarrow\ \rightarrow\ \leftrightarrow</tex> <br> |
− | <tex>\leftarrow\ \rightarrow\ \leftrightarrow</tex> <br> | + | |
<tex>\longleftarrow\ \longrightarrow</tex> <br> | <tex>\longleftarrow\ \longrightarrow</tex> <br> | ||
− | <tex>\mapsto\ | + | <tex>\mapsto\</tex> <br> |
<tex>\nearrow\ \searrow\ \swarrow\ \nwarrow</tex> <br> | <tex>\nearrow\ \searrow\ \swarrow\ \nwarrow</tex> <br> | ||
<tex>\uparrow\ \downarrow\ \updownarrow</tex> <br> | <tex>\uparrow\ \downarrow\ \updownarrow</tex> <br> | ||
Linha 110: | Linha 115: | ||
| <tex>x\prime</tex> | | <tex>x\prime</tex> | ||
|----- | |----- | ||
− | | Sublinhados, sobrelinhas, vetores || \hat a \ \bar b \ \vec c \ \ | + | | Sublinhados, sobrelinhas, vetores || \hat a \ \bar b \ \vec c \ \widevec{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l} |
− | | <tex>\hat a \ \bar b \ \vec c \ \ | + | | <tex>\hat a \ \bar b \ \vec c \ \widevec{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} | | Overbraces || \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} | ||
Linha 130: | Linha 135: | ||
| <tex>\oint_{C} x^3\, dx + 4y^2\, dy</tex> | | <tex>\oint_{C} x^3\, dx + 4y^2\, dy</tex> | ||
|} | |} | ||
− | |||
== Fracções, matrizes, chavetas== | == Fracções, matrizes, chavetas== | ||
Linha 140: | Linha 144: | ||
! Como é exibido | ! Como é exibido | ||
|----- | |----- | ||
− | | Frações | + | | Frações |
+ | | \frac{2}{4} or {2 \over 4} | ||
| <tex>\frac{2}{4}</tex> | | <tex>\frac{2}{4}</tex> | ||
|----- | |----- | ||
− | | Coeficientes binomiais | + | | Coeficientes binomiais |
+ | | {n \choose k} | ||
| <tex>{n \choose k}</tex> | | <tex>{n \choose k}</tex> | ||
|----- | |----- | ||
| rowspan="6" | Matrizes | | rowspan="6" | Matrizes | ||
| \begin{pmatrix} x & y \\ z & v \end{pmatrix} | | \begin{pmatrix} x & y \\ z & v \end{pmatrix} | ||
− | | <tex>\begin{pmatrix} x & y \\ z & v | + | | <tex>\begin{pmatrix} x & y \\ z & v \end{pmatrix}</tex> |
− | \end{pmatrix}</tex> | + | |
|----- | |----- | ||
− | | \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & | + | | \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} |
− | \ddots & \vdots \\ 0 & \cdots & | + | | <tex>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}</tex> |
− | 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} | | \begin{Bmatrix} x & y \\ z & v \end{Bmatrix} | ||
− | | <tex>\begin{Bmatrix} x & y \\ z & v | + | | <tex>\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}</tex> |
− | \end{Bmatrix}</tex> | + | |
|----- | |----- | ||
| \begin{vmatrix} x & y \\ z & v \end{vmatrix} | | \begin{vmatrix} x & y \\ z & v \end{vmatrix} | ||
− | | <tex>\begin{vmatrix} x & y \\ z & v | + | | <tex>\begin{vmatrix} x & y \\ z & v \end{vmatrix}</tex> |
− | \end{vmatrix}</tex> | + | |
|----- | |----- | ||
| \begin{Vmatrix} x & y \\ z & v \end{Vmatrix} | | \begin{Vmatrix} x & y \\ z & v \end{Vmatrix} | ||
− | | <tex>\begin{Vmatrix} x & y \\ z & v | + | | <tex>\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}</tex> |
− | \end{Vmatrix}</tex> | + | |
|----- | |----- | ||
| \begin{matrix} x & y \\ z & v \end{matrix} | | \begin{matrix} x & y \\ z & v \end{matrix} | ||
− | | <tex>\begin{matrix} x & y \\ z & v | + | | <tex>\begin{matrix} x & y \\ z & v \end{matrix}</tex> |
− | \end{matrix}</tex> | + | |
|----- | |----- | ||
| Distinção maiúscula/minúscula | | Distinção maiúscula/minúscula | ||
Linha 179: | Linha 176: | ||
|----- | |----- | ||
| Equações em mais de uma linha | | Equações em mais de uma linha | ||
− | | \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & | + | | \begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix} |
− | =& n^2 + 2n + 1\end{matrix} | + | |
| <tex>\begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}</tex> | | <tex>\begin{matrix}f(n+1)&=& (n+1)^2 \\ \ & =& n^2 + 2n + 1\end{matrix}</tex> | ||
|} | |} | ||
Linha 206: | Linha 202: | ||
| Negrito (vectores) || \mathbf{x} \cdot \mathbf{y} = 0 | | Negrito (vectores) || \mathbf{x} \cdot \mathbf{y} = 0 | ||
| <tex>\mathbf{x} \cdot \mathbf{y} = 0 </tex> | | <tex>\mathbf{x} \cdot \mathbf{y} = 0 </tex> | ||
− | |||
− | |||
− | |||
− | |||
|----- | |----- | ||
| Fonte Fraktur || \mathfrak{a} \mathfrak{B} | | Fonte Fraktur || \mathfrak{a} \mathfrak{B} | ||
Linha 216: | Linha 208: | ||
| Script || \mathcal{ABC} || <tex>\mathcal{ABC}</tex> | | Script || \mathcal{ABC} || <tex>\mathcal{ABC}</tex> | ||
|----- | |----- | ||
− | | Hebraico || \aleph | + | | Hebraico || \aleph |
− | | <tex>\aleph\ | + | | <tex>\aleph\</tex> |
|----- | |----- | ||
| letras não-inclinadas || \mbox{abc} || <tex>\mbox{abc}</tex> | | letras não-inclinadas || \mbox{abc} || <tex>\mbox{abc}</tex> | ||
Linha 283: | Linha 275: | ||
|----- | |----- | ||
| espaço largo || a\;b || <tex>a\;b</tex> | | espaço largo || a\;b || <tex>a\;b</tex> | ||
− | |||
− | |||
|----- | |----- | ||
| espaço pequeno || a\,b || <tex>a\,b</tex> | | espaço pequeno || a\,b || <tex>a\,b</tex> | ||
Linha 327: | Linha 317: | ||
:''<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>'' | :''<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== | ==Links relevantes== | ||
− | |||
* [http://meta.wikimedia.org/wiki/Help:Formula Página de ajuda no MetaWiki] | * [http://meta.wikimedia.org/wiki/Help:Formula Página de ajuda no MetaWiki] | ||
− | * | + | * [http://www.ctan.org/tex-archive/info/gentle/gentle.pdf Uma introdução em PDF ao TeX -- veja a partir da página 39 para uma boa introdução sobre a matemática envolvida] |
− | [[Categoria:!Ajuda]] | + | [[Categoria:!Ajuda|Formulas, Como editar]] |
Edição atual desde as 06h24min de 3 de novembro de 2008
O Software MediaWiki usado pelo Think Finance 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>.
Índice
Caracteres especiais
Grupo | Sintaxe | Como é exibido |
---|---|---|
funções padrão (correto) | \cos x + \ln y +\operatorname{sgn}\, z | |
funções padrão (errado) | cos x + ln y + sgn z | |
Aritmética modular | s_k \equiv 0 \pmod{m} | |
Derivação | \nabla \partial dx \dot x \ddot y | |
Conjuntos | \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 | |
Raízes | \sqrt{2}\approx 1{,}4 | |
\sqrt[n]{x} | ||
Separador decimal (correto) | 1/8 = 0{,}125 | |
Separador decimal (errado) | 1/8 = 0,125 | |
Operadores relacionais | \sim \simeq \le \ge \equiv \not\equiv \approx \ne | |
Geometria | \Diamond \; \triangle \; \angle \; \perp \; \mid \; \ \; 45^\circ | |
Setas | \leftarrow \rightarrow \leftrightarrow \longleftarrow \longrightarrow |
|
\Leftarrow \Rightarrow \Leftrightarrow |
| |
Especial | \oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ \cdot \times
\bullet \infty |
Subscritos, superescritos
Grupo | Sintaxe | Como é exibido |
---|---|---|
Superscrito | a^2 | |
Superscrito | a^2\quad | |
Subescrito | a_2 | |
Agrupando | a^{2+2} | |
a_{i,j} | ||
Combinando super e subescrito | x_2^3 | |
Derivadas (certo) | x' | |
Derivadas (errado, em HTML) | x^\prime | |
Derivadas (errado, em PNG) | x\prime | |
Sublinhados, sobrelinhas, vetores | \hat a \ \bar b \ \vec c \ \widevec{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} | |
Underbraces | \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} | |
Somatório | \sum_{k=1}^{N} k^2 | |
Productório | \prod_{i=1}^{N} x_{i} | |
Limites | \lim_{n \to \infty}x_n | |
Integrais | \int_{-N}^{N} e^x\, dx | |
Integrais lineares | \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} | |
Coeficientes binomiais | {n \choose k} | |
Matrizes | \begin{pmatrix} x & y \\ z & v \end{pmatrix} | |
\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\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{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 | |
Equações em mais de uma linha | \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 |
|
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 |
|
Negrito forte | x\in\mathbb{N}\subset\mathbb{Z}\subset\mathbb{R}\sub\mathbb{C} | |
Negrito (vectores) | \mathbf{x} \cdot \mathbf{y} = 0 | |
Fonte Fraktur | \mathfrak{a} \mathfrak{B} | |
Script | \mathcal{ABC} | |
Hebraico | \aleph | |
letras não-inclinadas | \mbox{abc} |
Parênteses
Grupo | Sintaxe | Como fica parecendo |
---|---|---|
Erros | ( \frac{1}{2} ) | |
Melhor assim | \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 ) | |
Colchetes | \left [ A \right ] | |
Chaves | \left \{ A \right \} | |
boca de jacaré | \left \langle A \right \rangle | |
Barras e barras duplas | A \right | and \left \| B \right \| | |
Os delimitadores podem ser misturados, contanto que \left e \right estejam equilibrados. |
\left [ 0,1 \right ) |
|
Use \left. e \right. se você deseja esconder um delimitador: | \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 | |
espaço simples de um quadrado | a \quad b | |
espaço de texto | a\ b | |
espaço largo | a\;b | |
espaço pequeno | a\,b | |
evitar espaço | ab | |
espaço "negativo" | a\!b |
Alinhamento
Se você precisar desesperadamente inserir uma equação como 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} \,\! | |
\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! -->