Ayuda:TeX Math

De Inciclopedia


Ayuda de Inciclopedia

Ayuda

Cómo ser divertido y no estúpido
Manual de estilo
Guía de edición de páginas
Cómo colocar imágenes
Guía sobre las plantillas
Página de pruebas
Userboxes (ayuda)
Paleta de colores
Ayuda con el código TeX
Variables
FAQ avanzadas
Tutores para novatos
Glosario de Términos
Páginas de Usuario

Mírate esto, anda, delincuente...

Preguntas más frecuentes

El código TeX, es aquel que se utiliza para escribir entre <math>Escribe aquí una fórmula</math>, todas aquellas fórmulas, o lo que demonios queramos.

[editar] Acentos, aritmética...

Característica Sintaxis Cómo se ve renderizado
Acentos y marcas diacríticas \acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a} math
Funciones estándar (bien) \sin x + \ln y + \operatorname{sgn} z math
\sin a + \cos b + \tan c + \cot d + \sec e + \csc f math
\sinh g + \cosh h + \tanh i + \coth j math
\arcsin k + \arccos l + \arctan m math
\lim n + \limsup o + \liminf p math
\min q + \max r + \inf s + \sup t math
\exp u + \lg v + \log w math
\ker x + \deg x + \gcd x + \Pr x math
\det x + \hom x + \arg x + \dim x math
Funciones estándar (mal) sin x + ln y + sgn z math
Aritmética modular s_k \equiv 0 \pmod{m} \quad a \bmod b math
Derivadas \nabla \; \partial x \; dx \; \dot x \; \ddot y math
Conjuntos \forall \; \exists \; \empty \; \emptyset \; \varnothing \; \in \; \ni \; \not\in \; \notin math
\subset \; \subseteq \; \supset \; \supseteq \; \cap \; \bigcap \; \cup \; \bigcup \; \biguplus math
\sqsubset \; \sqsubseteq \; \sqsupset \; \sqsupseteq \; \sqcap \; \sqcup \; \bigsqcup math
Lógica p \land \wedge \; \bigwedge \; \bar{q} \to p\lor \vee \; \bigvee \; \lnot \; \neg q \; \setminus \; \smallsetminus math
Raíces \sqrt{2}\approx 1.4 math
\sqrt[n]{x} math
Relaciones \sim \; \approx \; \simeq \; \cong \; \le \; \ge \; \equiv \; \not\equiv \; \ne \; \propto \; \pm \; \mp math
Geometría \Diamond \Box \triangle \angle \perp \mid \; \nmid \| \; 45^\circ math
Flechas \leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow \quad \longleftarrow \; \longrightarrow \quad \mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow math
\nearrow \; \searrow \; \swarrow \; \nwarrow \quad \uparrow \; \downarrow \; \updownarrow math
\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright math
\Leftarrow \; \Rightarrow \; \Leftrightarrow \; \Longleftarrow \; \Longrightarrow \; \Longleftrightarrow \; \iff \quad \Uparrow \; \Downarrow \; \Updownarrow math
Símbolos especiales \eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots math
\smile \; \frown \; \wr \; \oplus \; \bigoplus \; \otimes \; \bigotimes math
\times \; \cdot \; \circ \; \bullet \; \bigodot \; \triangleleft \; \triangleright \; \infty \; \bot \; \top \; \vdash \; \vDash \; \Vdash \; \models \; \lVert \; \rVert math
\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp math
\mathcal con minúscula produce algunos extras \mathcal {45abcdenpqstuvwx} math

[editar] Subíndices, superíndices e integrales

Característica Sintaxis Cómo se ve renderizado
Superíndice a^2 math math
Subíndice a_2 math math
Agrupación a^{2+2} math math
a_{i,j} math math
Combinando sub y súper x_2^3 math
Precediendo de sub y súper {}_1^2\!X_3^4 math
Derivadas (bien) x', y'' math math
Derivadas (mal en HTML) x^\prime, y^{\prime\prime} math math
Derivadas (mal en PNG) x\prime, y\prime\prime math math
Puntos de derivada \dot{x} \; \ddot{x} math
Subrayado, sobrerrayado, vectores \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
Llaves superiores \begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} math
Llaves inferiores \begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} math
Sumatorios \sum_{k=1}^N k^2 math
Productorios \prod_{i=1}^N x_i math
Coproductos \coprod_{i=1}^N x_i math
Límites \lim_{n \to \infty}x_n math
Integrales \int_{-N}^{N} e^x\, dx math
Integrales dobles \iint_{D}^{W} \, dx\,dy math
Integrales triples \iiint_{E}^{V} \, dx\,dy\,dz math
Integrales cuádruples \iiiint_{F}^{U} \, dx\,dy\,dz\,dt math
Integrales cerradas \oint_{C} x^3\, dx + 4y^2\, dy math
Intersecciones \bigcap_1^{n} p math
Uniones \bigcup_1^{k} p math

[editar] Fracciones, matrices y multilíneas

Característica Sintaxis Cómo se ve renderizado
Fracciones \frac{2}{4} o {2 \over 4} math
Coeficientes binomiales {n \choose k} math
Fracciones pequeñas \begin{matrix} \frac{2}{4} \end{matrix} math
Matrices \begin{matrix} x & y \\ z & v \end{matrix} math
\begin{vmatrix} x & y \\ z & v \end{vmatrix} math
\begin{Vmatrix} x & y \\ z & v \end{Vmatrix} 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{pmatrix} x & y \\ z & v \end{pmatrix} math
Definiciones por tramos f(n) = \begin{cases} n/2, & \mbox{si }n\mbox{ es par} \\ 3n+1, & \mbox{si }n\mbox{ es impar} \end{cases} math
Ecuaciones multilínea \begin{matrix}f(n+1) & = & (n+1)^2 \\ \ & = & n^2 + 2n + 1 \end{matrix} math
Método alternativo usando tablas
{|
|-
|<math>f(n+1)</math>
|<math>=(n+1)^2</math>
|-
|
|<math>=n^2 + 2n + 1</math>
|}
math math
math
Sistemas de ecuaciones mal \left . \begin{matrix} 4 \cdot \frac{2x^3+7}{5x^2+2y+5}=2 \\ \frac{2x^y+8xy}{5x^2+2yz^2+17z}=43\end{matrix} \right \} math
Sistemas de ecuaciones bien (usando \cfrac) \left . \begin{matrix} 4 \cdot \cfrac{2x^3+7}{5x^2+2y+5}=2 \\ \cfrac{2x^y+8xy}{5x^2+2yz^2+17z}=43\end{matrix} \right \} math

[editar] Fuentes

Característica Sintaxis Cómo se ve renderizado
Alfabeto griego (adviértase la ausencia de ómicron, y también que algunas mayúsculas griegas se representan iguales a sus equivalentes latinas) \Alpha\ \Beta\ \Gamma\ \Delta\ \Epsilon\ \Zeta\ \Eta\ \Theta\ \Iota\ \Kappa\ \Lambda\ \Mu\ \Nu\ \Xi\ \Pi\ \Rho\ \Sigma\ \Tau\ \Upsilon\ \Phi\ \Chi\ \Psi\ \Omega Dan un error por causas desconocidas...
\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi\ \pi\ \rho\ \sigma\ \tau\ \phi\ \chi\ \psi\ \omega math
\varepsilon\ \digamma\ \vartheta\ \varkappa\ \varpi\ \varrho\ \varsigma\ \varphi math
«Blackboard bold» x\in\mathbb{R}\sub\mathbb{C} math
Negrita (vectores) \mathbf{x}\cdot\mathbf{y} = 0 math
Negrita (griego) \boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} math
Cursivas (itálica) \mathit{ABCDE abcde 1234} math
Fuente romana \mathrm{ABCDE abcde 1234} math
Fuente Fraktur \mathfrak{ABCDE abcde 1234} math
Caligrafía \mathcal{ABCDE abcde 1234} math
Alfabeto hebreo \aleph \beth \gimel \daleth math
Caracteres no cursivos \mbox{abc} math math
Mezclar cursivas (mal) \mbox{si} n \mbox{es par} math math
Mezclar cursivas (bien) \mbox{si } n \mbox{ es par} math math

[editar] Poniendo expresiones grandes entre paréntesis, corchetes, etcétera

Característica Sintaxis Cómo se ve renderizado
Mal ( \frac{1}{2} ) math
Bien \left ( \frac{1}{2} \right ) math

Pueden usarse varios delimitadores con \left y \right:

Característica Sintaxis Cómo se ve renderizado
Paréntesis \left ( \frac{a}{b} \right ) math
Corchetes \left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack math
Llaves \left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace math
Ángulos (<, >) \left \langle \frac{a}{b} \right \rangle math
Barras simples y dobles \left | \frac{a}{b} \right \vert \left \Vert \frac{c}{d} \right \| math
Redondeo inferior y superior \left \lfloor \frac{a}{b} \right \rfloor \left \lceil \frac{c}{d} \right \rceil math
Barras inclinadas e invertidas \left / \frac{a}{b} \right \backslash math
Flechas simples y dobles \left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow math
Los delimitadores puede mezclarse, siempre que cada \left vaya cerrado por un \right \left [ 0,1 \right ) \quad \left \langle \psi \right | math
math
Usa \left . y \right . si no quieres que se muestre un delimitador \left . \frac{A}{B} \right \} \to X math
Tamaño de los delimitadores \big( \Big( \bigg( \Bigg( ... \Bigg] \bigg] \Big] \big] math
\big\{ \Big\{ \bigg\{ \Bigg\{ ... \Bigg\rangle \bigg\rangle \Big\rangle \big\rangle math
\big\| \Big\| \bigg\| \Bigg\| ... \Bigg| \bigg| \Big| \big| math
\big\lfloor \Big\lfloor \bigg\lfloor \Bigg\lfloor ... \Bigg\rceil \bigg\rceil \Big\rceil \big\rceil math
\big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow ... \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow math

[editar] Espaciado

Adviértase que TeX ajusta casi todo el espaciado automáticamente, pero a veces se necesita un control manual.

Característica Sintaxis Cómo se ve renderizado
Espacio óctuple a \qquad b math
Espacio cuádruple a \quad b math
Espacio de texto a\ b math
Espacio de texto sin conversión PNG a \mbox{ } b math
Espacio grande a\;b math
Espacio medio a\>b (no soportado)
Espacio pequeño a\,b math
Sin espacio ab math
Espacio negativo a\!b math

[editar] Alineación con el flujo del texto normal

Debido al estilo CSS por defecto

img.tex { vertical-align: middle; }

una expresión en línea como math debería quedar bien.

Si se necesita alinearla de otra forma, usa <span style="vertical-align:-100%;"><math>...</math></span> y juega con el parámetro de vertical-align hasta que obtengas el resultado deseado. Sin embargo, el resulto final puede depender de la configuración del navegador.

[editar] Forzar la generación de imágenes PNG

Para forzar que la fórmula se muestre como una imagen PNG, añade \, (espacio pequeño) al final de la fórmula (donde no será representado). Esto forzará la generación del PNG si el usuario está en el modo «HTML si es muy simple, si no PNG», pero no si está en «HTML si es posible, si no PNG» (sección «Cómo se muestran las fórmulas» de las preferencias de usuario).

También puedes usar \,\! (espacio pequeño y espacio negativo, que se cancelan) en cualquier lugar dentro de las etiquetas <math>...</math>. Esto fuerza la generación del PNG incluso si el usuario está en el modo «HTML si es posible, si no PNG», a diferencia de \,.

Esto puede ser de utilidad para obligar la generación de fórmulas en una demostración consitente, por ejemplo, o para corregir fórmulas que se muestran incorrectamente en HTML (en un momento dado, a^{2+2} se generaba con un subrayado sobrante), o para demostrar cómo algo se ve en PNG cuando normalmente se mostraría como HTML (como en los ejemplos anteriores).

Por ejemplo:

Sintaxis Cómo se ve renderizado
a^{c+2} math
a^{c+2} \, math
a^{\,\!c+2} math
a^{b^{c+2}} mathMal con la opción «HTML si es posible, si no PNG»!)
a^{b^{c+2}} \, mathMal con la opción «HTML si es posible, si no PNG»!)
a^{b^{c+2}} \,\! mathBien en todos los casos»!)
a^{b^{c+2}}\approx 5 math (debido a \approx, no se necesita \,\!)
a^{b^{\,\!c+2}} math
\int_{-N}^{N} e^x\, dx math
\int_{-N}^{N} e^x\, dx \, math
\int_{-N}^{N} e^x\, dx \,\! math

Esto ha sido probado con la mayoría de las fórmulas de esta página, y parece funcionar perfectamente.

Puede que quieras incluir un comentario en el código HTML para que otros usuarios no «corrijan» la fórmula quitándolo:

<!-- \,\! es para obligar a que la fórmula se muestre como PNG en vez de como HTML. Por favor no lo borres. -->

[editar] Ejemplos

  • math
  • math
  • math
  • math
  • math
  • math
  • math
  • math