Diferencia entre revisiones de «Manual wiki/Edición/TeX»

Contenido eliminado Contenido añadido
Rutrus (discusión | contribs.)
Sin resumen de edición
 
Rutrus (discusión | contribs.)
Sin resumen de edición
Línea 1:
Debido a lo completo del artículo, se ha importado de [[w:Ayuda:Usando TeX|Ayuda:Usando TeX]]
== Enlaces interesantes ==
 
[[w:Ayuda:Usando TeX|Ayuda:Usando TeX]]
Desde enero de 2003, [[MediaWiki]] soporta '''[[TeX]] markup''' para escribir fórmulas matemáticas. A partir del código TeX se generan imágenes [[PNG]] o texto [[HTML]], dependiendo de las preferencias del usuario y la complejidad de la fórmula. En el futuro, cuando los [[navegador]]es sean más inteligentes, será posible generar HTML mejorado o incluso [[MathML]] en muchos casos. La generación de la notación matemática a partir del código TeX se realiza con la [[software libre|herramienta libre]] [[Texvc]].
 
Las expresiones matemáticas escritas en TeX deben encerrarse entre etiquetas <code><nowiki><math></nowiki></code> y <code><nowiki></math></nowiki></code>. Para ello puedes seleccionar el código TeX y pulsar el botón [[image:Math icon.png]] que aparece en la barra de botones que está encima de la caja de edición (es posible que no aparezca en tu navegador).
 
Las imágenes PNG son generadas en negro sobre fondo blanco no transparente. Estos colores, así como los tamaños y tipos de fuente, son independientes de la configuración del navegador y del [[CSS]] aplicado. Los tamaños y tipos de fuente diferirán a menudo de los usados por el navegador para mostrar el HTML. El selector CSS de las imágenes es <code>img.tex</code>.
 
En el caso de una página con otro color de fondo, el blanco de las fórmulas las resalta eficazmente, lo que puede ser una ventaja o una desventaja.
 
Puede que se desee evitar usar código TeX como parte de una línea de texto normal, pues las fórmulas no se alinean apropiadamente y el tamaño y tipo de fuente, como se ha dicho, normalmente no coincide.
 
El atributo <code>alt</code> de las imágenes TeX (el texto que se muestra en la caja de ayuda flotante al dejar el cursor sobre ella) es el texto wiki a partir de la que se generó, excluyendo las etiquetas <code><nowiki><math></nowiki></code> y <code><nowiki></math></nowiki></code>.
 
<!--
Discussion, bug reports and feature requests should go to the [[Mailing_list#Wikitech|Wikitech-l mailing list]]. These can also be filed on [http://bugzilla.wikipedia.org Mediazilla] under ''MediaWiki extensions''.
-->
==General==
Los espacios y saltos de línea se aceptan, y no se muestran, siendo útiles para dejar el código TeX más ordenado (por ejemplo, un salto de línea después de cada término o de cada fila de una matriz). Excepto los nombres de funciones y los operadores, como es habitual en las matemáticas para las variables, las letras se muestran en cursiva y los dígitos no. Para evitar que un texto se muestre en cursivas como las variables, se debe usar <code>\mbox</code>: <code><nowiki><math>\mbox{abc}</math></nowiki></code> da <math>\mbox{abc}</math> en lugar de <math>abc</math>.
 
== Funciones, símbolos y caracteres especiales ==
Para generar caracteres especiales sin usar la etiqueta <code><nowiki><math></nowiki></code>, véase [[Wikipedia:Caracteres especiales Wiki|Caracteres especiales Wiki]].
 
Comparación:
*<code>&amp;alpha;</code> da &alpha;, <code><nowiki><math>\alpha</math></nowiki></code> da <math>\alpha \,\!</math> (adviértase el uso de «&amp;» y «;» frente a «\» junto a la palabra reservada, en este caso «alpha»)
*<code>&amp;radic;2</code> da &radic;2, <code><nowiki><math>\sqrt{2} \,\!</math></nowiki></code> da <math>\sqrt{2}</math> (igual que en el caso anterior, pero con palabras reservadas diferentes: «radic» frente a «sqrt» más las llaves TeX)
*<code>&amp;radic;(1-<nowiki>''e''</nowiki>&amp;sup2;)</code> da &radic;(1-''e''&sup2;), <code><nowiki><math>\sqrt{1-e^2}</math></nowiki></code> da <math>\sqrt{1-e^2} \,\!</math> (adviértase el uso de paréntesis frente a llaves, «<nowiki>''e''</nowiki>» frente a «e» y «&amp;sup2;» frente a «^2»)
 
{| border="1"
|-
! Característica
! Sintaxis
! Cómo se ve renderizado
|-
| Acentos y marcas diacríticas
| <code>\acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a}</code>
| <math>\acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a} \,\!</math>
|-
| rowspan="9" | Funciones estándar (bien)
| <code>\sin x + \ln y + \operatorname{sgn} z</code>
| <math>\sin x + \ln y + \operatorname{sgn} z \,\!</math>
|-
| <code>\sin a + \cos b + \tan c + \cot d + \sec e + \csc f</code>
| <math>\sin a + \cos b + \tan c + \cot d + \sec e + \csc f \,\!</math>
|-
| <code>\sinh g + \cosh h + \tanh i + \coth j</code>
| <math>\sinh g + \cosh h + \tanh i + \coth j \,\!</math>
|-
| <code>\arcsin k + \arccos l + \arctan m</code>
| <math>\arcsin k + \arccos l + \arctan m \,\!</math>
|-
| <code>\lim n + \limsup o + \liminf p</code>
| <math>\lim n + \limsup o + \liminf p \,\!</math>
|-
| <code>\min q + \max r + \inf s + \sup t</code>
| <math>\min q + \max r + \inf s + \sup t \,\!</math>
|-
| <code>\exp u + \lg v + \log w</code>
| <math>\exp u + \lg v + \log w \,\!</math>
|-
| <code>\ker x + \deg x + \gcd x + \Pr x</code>
| <math>\ker x + \deg x + \gcd x + \Pr x \,\!</math>
|-
| <code>\det x + \hom x + \arg x + \dim x</code>
| <math>\det x + \hom x + \arg x + \dim x \,\!</math>
|-
| Funciones estándar (mal)
| <code>sin x + ln y + sgn z</code>
| <math>sin x + ln y + sgn z \,\!</math>
|-
| Aritmética modular
| <code>s_k \equiv 0 \pmod{m} \quad a \bmod b</code>
| <math>s_k \equiv 0 \pmod{m} \quad a \bmod b \,\!</math>
|-
| Derivadas
| <code>\nabla \; \partial x \; dx \; \dot x \; \ddot y</code>
| <math>\nabla \; \partial x \; dx \; \dot x \; \ddot y \,\!</math>
|-
| rowspan="3" | Conjuntos
| <code>\forall \; \exists \; \empty \; \emptyset \; \varnothing \; \in \; \ni \; \not\in \; \notin</code>
| <math>\forall \; \exists \; \empty \; \emptyset \; \varnothing \; \in \; \ni \; \not\in \; \notin \,\!</math>
|-
| <code>\subset \; \subseteq \; \supset \; \supseteq \; \cap \; \bigcap \; \cup \; \bigcup \; \biguplus</code>
| <math>\subset \; \subseteq \; \supset \; \supseteq \; \cap \; \bigcap \; \cup \; \bigcup \; \biguplus \,\!</math>
|-
| <code>\sqsubset \; \sqsubseteq \; \sqsupset \; \sqsupseteq \; \sqcap \; \sqcup \; \bigsqcup</code>
| <math>\sqsubset \; \sqsubseteq \; \sqsupset \; \sqsupseteq \; \sqcap \; \sqcup \; \bigsqcup \,\!</math>
|-
| Lógica
| <code>p \land \wedge \; \bigwedge \; \bar{q} \to p\lor \vee \; \bigvee \; \lnot \; \neg q \; \setminus \; \smallsetminus</code>
| <math>p \land \wedge \; \bigwedge \; \bar{q} \to p\lor \vee \; \bigvee \; \lnot \; \neg q \; \setminus \; \smallsetminus \,\!</math>
|-
| rowspan="2" | Raíces
| <code>\sqrt{2}\approx 1.4</code>
| <math>\sqrt{2}\approx 1.4 \,\!</math>
|-
| <code>\sqrt[n]{x}</code>
| <math>\sqrt[n]{x} \,\!</math>
|-
| Relaciones
| <code>\sim \; \approx \; \simeq \; \cong \; \le \; \ge \; \equiv \; \not\equiv \; \ne \; \propto \; \pm \; \mp</code>
| <math>\sim \; \approx \; \simeq \; \cong \; \le \; \ge \; \equiv \; \not\equiv \; \ne \; \propto \; \pm \; \mp \,\!</math>
|-
| Geometría
| <code><nowiki>\Diamond \Box \triangle \angle \perp \mid \; \nmid \| \; 45^\circ</nowiki></code>
| <math>\Diamond \Box \triangle \angle \perp \mid \; \nmid \| \; 45^\circ \,\!</math>
|-
| rowspan="4" | Flechas
| <code>\leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow \quad \longleftarrow \; \longrightarrow \quad \mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow</code>
| <math>\leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow \quad \longleftarrow \; \longrightarrow \quad \mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow \,\!</math>
|-
| <code>\nearrow \; \searrow \; \swarrow \; \nwarrow \quad \uparrow \; \downarrow \; \updownarrow</code>
| <math>\nearrow \; \searrow \; \swarrow \; \nwarrow \quad \uparrow \; \downarrow \; \updownarrow \,\!</math>
|-
| <code>\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright</code>
| <math>\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright \,\!</math>
|-
| <code>\Leftarrow \; \Rightarrow \; \Leftrightarrow \; \Longleftarrow \; \Longrightarrow \; \Longleftrightarrow \; \iff \quad \Uparrow \; \Downarrow \; \Updownarrow</code>
| <math>\Leftarrow \; \Rightarrow \; \Leftrightarrow \; \Longleftarrow \; \Longrightarrow \; \Longleftrightarrow \; \iff \quad \Uparrow \; \Downarrow \; \Updownarrow \,\!</math>
|-
| rowspan="4" | Símbolos especiales
| <code>\eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots</code>
| <math>\eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots \,\!</math>
|-
| <code>\smile \; \frown \; \wr \; \oplus \; \bigoplus \; \otimes \; \bigotimes</code>
| <math>\smile \; \frown \; \wr \; \oplus \; \bigoplus \; \otimes \; \bigotimes \,\!</math>
|-
| <code>\times \; \cdot \; \circ \; \bullet \; \bigodot \; \triangleleft \; \triangleright \; \infty \; \bot \; \top \; \vdash \; \vDash \; \Vdash \; \models \; \lVert \; \rVert</code>
| <math>\times \; \cdot \; \circ \; \bullet \; \bigodot \; \triangleleft \; \triangleright \; \infty \; \bot \; \top \; \vdash \; \vDash \; \Vdash \; \models \; \lVert \; \rVert \,\!</math>
|-
| <code>\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp</code>
| <math>\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp \,\!</math>
|-
| <code>\mathcal</code> con minúscula produce algunos extras
| <code>\mathcal {45abcdenpqstuvwx}</code>
| <math>\mathcal {45abcdenpqstuvwx} \,\!</math>
|}
 
== Subíndices, superíndices e integrales ==
{| border="1"
|-
! Característica
! Sintaxis
! colspan="2" | Cómo se ve renderizado
|-
| Superíndice
| <code>a^2</code>
| <math>a^2</math>
| <math>a^2 \,\!</math>
|-
| Subíndice
| <code>a_2</code>
| <math>a_2</math>
| <math>a_2 \,\!</math>
|-
| rowspan="2" | Agrupación
| <code>a^{2+2}</code>
| <math>a^{2+2}</math>
| <math>a^{2+2} \,\!</math>
|-
| <code>a_{i,j}</code>
| <math>a_{i,j}</math>
| <math>a_{i,j} \,\!</math>
|-
| Combinando sub y súper
| <code>x_2^3</code>
| colspan="2" | <math>x_2^3 \,\!</math>
|-
| Precediendo de sub y súper
| <code>{}_1^2\!X_3^4</code>
| colspan="2" | <math>{}_1^2\!X_3^4 \,\!</math>
|-
| Derivadas (bien)
| <code><nowiki>x', y''</nowiki></code>
| <math>x', y''</math>
| <math>x', y'' \,\!</math>
|-
| Derivadas (mal en HTML)
| <code>x^\prime, y^{\prime\prime}</code>
| <math>x^\prime, y^{\prime\prime}</math>
| <math>x^\prime, y^{\prime\prime} \,\!</math>
|-
| Derivadas (mal en PNG)
| <code>x\prime, y\prime\prime</code>
| <math>x\prime, y\prime\prime</math>
| <math>x\prime, y\prime\prime \,\!</math>
|-
| Puntos de derivada
| <code>\dot{x} \; \ddot{x}</code>
| colspan="2" | <math>\dot{x} \; \ddot{x} \,\!</math>
|-
| Subrayado, sobrerrayado, vectores
| <code>\hat a \; \bar b \; \vec c \; \overrightarrow{a b} \; \overleftarrow{c d} \; \widehat{d e f} \; \overline{g h i} \; \underline{j k l}</code>
| colspan="2" | <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>
|-
| Llaves superiores
| <code>\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end{matrix} \,\!</math>
|-
| Llaves inferiores
| <code>\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \underbrace{ a+b+\cdots+z } \\ 26 \end{matrix} \,\!</math>
|-
| Sumatorios
| <code>\sum_{k=1}^N k^2</code>
| colspan="2" | <math>\sum_{k=1}^N k^2 \,\!</math>
|-
| Productorios
| <code>\prod_{i=1}^N x_i</code>
| colspan="2" | <math>\prod_{i=1}^N x_i \,\!</math>
|-
| Coproductos
| <code>\coprod_{i=1}^N x_i</code>
| colspan="2" | <math>\coprod_{i=1}^N x_i \,\!</math>
|-
| Límites
| <code>\lim_{n \to \infty}x_n</code>
| colspan="2" | <math>\lim_{n \to \infty}x_n \,\!</math>
|-
| Integrales
| <code>\int_{-N}^{N} e^x\, dx</code>
| colspan="2" | <math>\int_{-N}^{N} e^x\, dx \,\!</math>
|-
| Integrales dobles
| <code>\iint_{D}^{W} \, dx\,dy</code>
| colspan="2" | <math>\iint_{D}^{W} \, dx\,dy \,\!</math>
|-
| Integrales triples
| <code>\iiint_{E}^{V} \, dx\,dy\,dz</code>
| colspan="2" | <math>\iiint_{E}^{V} \, dx\,dy\,dz \,\!</math>
|-
| Integrales cuádruples
| <code>\iiiint_{F}^{U} \, dx\,dy\,dz\,dt</code>
| colspan="2" | <math>\iiiint_{F}^{U} \, dx\,dy\,dz\,dt \,\!</math>
|-
| Integrales cerradas
| <code>\oint_{C} x^3\, dx + 4y^2\, dy</code>
| colspan="2" | <math>\oint_{C} x^3\, dx + 4y^2\, dy \,\!</math>
|-
| Intersecciones
| <code>\bigcap_1^{n} p</code>
| colspan="2" | <math>\bigcap_1^{n} p \,\!</math>
|-
| Uniones
| <code>\bigcup_1^{k} p</code>
| colspan="2" | <math>\bigcup_1^{k} p \,\!</math>
|}
 
== Fracciones, matrices y multilíneas ==
{| border="1"
|-
! Característica
! Sintaxis
! Cómo se ve renderizado
|-
| Fracciones
| <code>\frac{2}{4}</code> o <code>{2 \over 4}</code>
| <math>\frac{2}{4} \,\!</math>
|-
| Coeficientes binomiales
| <code>{n \choose k}</code>
| <math>{n \choose k}</math>
|-
| Fracciones pequeñas
| <code>\begin{matrix} \frac{2}{4} \end{matrix}</code>
| <math>\begin{matrix} \frac{2}{4} \end{matrix}</math>
|-
| rowspan="6" | Matrices
| <code>\begin{matrix} x & y \\ z & v \end{matrix}</code>
| <math>\begin{matrix} x & y \\ z & v \end{matrix}</math>
|-
| <code>\begin{vmatrix} x & y \\ z & v \end{vmatrix}</code>
| <math>\begin{vmatrix} x & y \\ z & v \end{vmatrix}</math>
|-
| <code>\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}</code>
| <math>\begin{Vmatrix} x & y \\ z & v \end{Vmatrix}</math>
|-
| <code>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}</code>
| <math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix}</math>
|-
| <code>\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}</code>
| <math>\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}</math>
|-
| <code>\begin{pmatrix} x & y \\ z & v \end{pmatrix}</code>
| <math>\begin{pmatrix} x & y \\ z & v \end{pmatrix}</math>
|-
| Definiciones por tramos
| <code>f(n) = \begin{cases} n/2, & \mbox{si }n\mbox{ es par} \\ 3n+1, & \mbox{si }n\mbox{ es impar} \end{cases}</code>
| <math>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
| <code>\begin{matrix}f(n+1) & = & (n+1)^2 \\ \ & = & n^2 + 2n + 1 \end{matrix}</code>
| <math>\begin{matrix}f(n+1) & = & (n+1)^2 \\ \ & = & n^2 + 2n + 1 \end{matrix}</math>
|-
| Método alternativo usando tablas
| <pre><nowiki>
{|
|-
|&lt;math&gt;f(n+1)&lt;/math&gt;
|&lt;math&gt;=(n+1)^2&lt;/math&gt;
|-
|
|&lt;math&gt;=n^2 + 2n + 1&lt;/math&gt;
|}
</nowiki></pre>
|
{|
|-
|<math>f(n+1) \,\!</math>
|<math>=(n+1)^2 \,\!</math>
|-
|
|<math>=n^2 + 2n + 1 \,\!</math>
|}
|-
| Sistemas de ecuaciones '''mal'''
| <code>\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 \}</code>
| <math>\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)
|<code>\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 \}</code>
|<math>\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>
|}
 
== Fuentes ==
{| border="1"
|-
! Característica
! Sintaxis
! colspan="2" | Cómo se ve renderizado
|-
| rowspan="3" | [[Alfabeto griego]] (adviértase la ausencia de ómicron, y también que algunas mayúsculas griegas se representan iguales a sus equivalentes latinas)
| <code>\Alpha\ \Beta\ \Gamma\ \Delta\ \Epsilon\ \Zeta\ \Eta\ \Theta\ \Iota\ \Kappa\ \Lambda\ \Mu\ \Nu\ \Xi\ \Pi\ \Rho\ \Sigma\ \Tau\ \Phi\ \Chi\ \Psi\ \Omega</code>
| colspan="2" | <math>\Alpha\ \Beta\ \Gamma\ \Delta\ \Epsilon\ \Zeta\ \Eta\ \Theta\ \Iota\ \Kappa\ \Lambda\ \Mu\ \Nu\ \Xi\ \Pi\ \Rho\ \Sigma\ \Tau\ \Phi\ \Chi\ \Psi\ \Omega \,\!</math>
|-
| <code>\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi\ \pi\ \rho\ \sigma\ \tau\ \phi\ \chi\ \psi\ \omega</code>
| colspan="2" | <math>\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi\ \pi\ \rho\ \sigma\ \tau\ \phi\ \chi\ \psi\ \omega \,\!</math>
|-
| <code>\varepsilon\ \digamma\ \vartheta\ \varkappa\ \varpi\ \varrho\ \varsigma\ \varphi</code>
| colspan="2" | <math>\varepsilon\ \digamma\ \vartheta\ \varkappa\ \varpi\ \varrho\ \varsigma\ \varphi \,\!</math>
|-
| «''Blackboard bold''»
| <code>x\in\mathbb{R}\sub\mathbb{C}</code>
| colspan="2" | <math>x\in\mathbb{R}\subset\mathbb{C} \,\!</math>
|-
| Negrita (vectores)
| <code>\mathbf{x}\cdot\mathbf{y} = 0</code>
| colspan="2" | <math>\mathbf{x}\cdot\mathbf{y} = 0 \,\!</math>
|-
| Negrita (griego)
| <code>\boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma}</code>
| colspan="2" | <math>\boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} \,\!</math>
|-
| Cursivas (itálica)
| <code>\mathit{ABCDE abcde 1234}</code>
| colspan="2" | <math>\mathit{ABCDE abcde 1234} \,\!</math>
|-
| Fuente romana
| <code>\mathrm{ABCDE abcde 1234}</code>
| colspan="2" | <math>\mathrm{ABCDE abcde 1234} \,\!</math>
|-
| Fuente Fraktur
| <code>\mathfrak{ABCDE abcde 1234}</code>
| colspan="2" | <math>\mathfrak{ABCDE abcde 1234} \,\!</math>
|-
| Caligrafía
| <code>\mathcal{ABCDE abcde 1234}</code>
| colspan="2" | <math>\mathcal{ABCDE abcde 1234} \,\!</math>
|-
| [[Alfabeto hebreo]]
| <code>\aleph \beth \gimel \daleth</code>
| colspan="2" | <math>\aleph\ \beth\ \gimel\ \daleth \,\!</math>
|-
| Caracteres no cursivos
| <code>\mbox{abc}</code>
| <math>\mbox{abc}</math>
| <math>\mbox{abc} \,\!</math>
|-
| Mezclar cursivas (mal)
| <code>\mbox{si} n \mbox{es par}</code>
| <math>\mbox{si} n \mbox{es par}</math>
| <math>\mbox{si} n \mbox{es par} \,\!</math>
|-
| Mezclar cursivas (bien)
| <code>\mbox{si } n \mbox{ es par}</code>
| <math>\mbox{si } n \mbox{ es par}</math>
| <math>\mbox{si } n \mbox{ es par} \,\!</math>
|}
 
== Poniendo expresiones grandes entre paréntesis, corchetes, etcétera ==
{| border="1"
|-
! Característica
! Sintaxis
! Cómo se ve renderizado
|-
| Mal
| <code>( \frac{1}{2} )</code>
| <math>( \frac{1}{2} ) \,\!</math>
|-
| Bien
| <code>\left ( \frac{1}{2} \right )</code>
| <math>\left ( \frac{1}{2} \right ) \,\!</math>
|}
 
Pueden usarse varios delimitadores con <code>\left</code> y <code>\right</code>:
{| border="1"
|-
! Característica
! Sintaxis
! Cómo se ve renderizado
|-
| Paréntesis
| <code>\left ( \frac{a}{b} \right )</code>
| <math>\left ( \frac{a}{b} \right ) \,\!</math>
|-
| Corchetes
| <code>\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack</code>
| <math>\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack \,\!</math>
|-
| Llaves
| <code>\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace</code>
| <math>\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace \,\!</math>
|-
| Ángulos (&lt;, &gt;)
| <code>\left \langle \frac{a}{b} \right \rangle</code>
| <math>\left \langle \frac{a}{b} \right \rangle \,\!</math>
|-
| Barras simples y dobles
| <code><nowiki>\left | \frac{a}{b} \right \vert \left \Vert \frac{c}{d} \right \|</nowiki></code>
| <math>\left | \frac{a}{b} \right \vert \left \Vert \frac{c}{d} \right \| \,\!</math>
|-
| Redondeo inferior y superior
| <code>\left \lfloor \frac{a}{b} \right \rfloor \left \lceil \frac{c}{d} \right \rceil</code>
| <math>\left \lfloor \frac{a}{b} \right \rfloor \left \lceil \frac{c}{d} \right \rceil \,\!</math>
|-
| Barras inclinadas e invertidas
| <code>\left / \frac{a}{b} \right \backslash</code>
| <math>\left / \frac{a}{b} \right \backslash \,\!</math>
|-
| Flechas simples y dobles
| <code>\left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow</code>
| <math>\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 <code>\left</code> vaya cerrado por un <code>\right</code>
| <code><nowiki>\left [ 0,1 \right ) \quad \left \langle \psi \right |</nowiki></code>
| <math>\left [ 0,1 \right )</math><br/><math>\left \langle \psi \right | \,\!</math>
|-
| Usa <code>\left .</code> y <code>\right .</code> si no quieres que se muestre un delimitador
| <code>\left . \frac{A}{B} \right \} \to X</code>
| <math>\left . \frac{A}{B} \right \} \to X \,\!</math>
|-
| rowspan="5" | Tamaño de los delimitadores
| <code>\big( \Big( \bigg( \Bigg( ... \Bigg] \bigg] \Big] \big]</code>
| <math>\big( \Big( \bigg( \Bigg( ... \Bigg] \bigg] \Big] \big] \,\!</math>
|-
| <code>\big\{ \Big\{ \bigg\{ \Bigg\{ ... \Bigg\rangle \bigg\rangle \Big\rangle \big\rangle</code>
| <math>\big\{ \Big\{ \bigg\{ \Bigg\{ ... \Bigg\rangle \bigg\rangle \Big\rangle \big\rangle \,\!</math>
|-
| <code><nowiki>\big\| \Big\| \bigg\| \Bigg\| ... \Bigg| \bigg| \Big| \big|</nowiki></code>
| <math>\big\| \Big\| \bigg\| \Bigg\| ... \Bigg| \bigg| \Big| \big| \,\!</math>
|-
| <code>\big\lfloor \Big\lfloor \bigg\lfloor \Bigg\lfloor ... \Bigg\rceil \bigg\rceil \Big\rceil \big\rceil</code>
| <math>\big\lfloor \Big\lfloor \bigg\lfloor \Bigg\lfloor ... \Bigg\rceil \bigg\rceil \Big\rceil \big\rceil \,\!</math>
|-
| <code>\big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow ... \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow</code>
| <math>\big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow ... \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \,\!</math>
|}
 
== Espaciado ==
Adviértase que TeX ajusta casi todo el espaciado automáticamente, pero a veces se necesita un control manual.
{| border="1"
|-
! Característica
! Sintaxis
! Cómo se ve renderizado
|-
| Espacio óctuple
| <code>a \qquad b</code>
| <math>a \qquad b</math>
|-
| Espacio cuádruple
| <code>a \quad b</code>
| <math>a \quad b</math>
|-
| Espacio de texto
| <code>a\ b</code>
| <math>a\ b</math>
|-
| Espacio de texto sin conversión PNG
| <code>a \mbox{ } b</code>
| <math>a \mbox{ } b</math>
|-
| Espacio grande
| <code>a\;b</code>
| <math>a\;b</math>
|-
| Espacio medio
| <code>a\&gt;b</code>
| (no soportado)
|-
| Espacio pequeño
| <code>a\,b</code>
| <math>a\,b</math>
|-
| Sin espacio
| <code>ab</code>
| <math>ab\,</math>
|-
| Espacio negativo
| <code>a\!b</code>
| <math>a\!b</math>
|}
 
== Alineación con el flujo del texto normal ==
Debido al estilo CSS por defecto
 
:<code>img.tex { vertical-align: middle; }</code>
 
una expresión en línea como <math>\int_{-N}^{N} e^x\, dx \,\!</math> debería quedar bien.
 
Si se necesita alinearla de otra forma, usa <tt>&lt;span style="vertical-align:-100%;">&lt;math>...&lt;/math>&lt;/span></tt> y juega con el parámetro de <tt>vertical-align</tt> hasta que obtengas el resultado deseado. Sin embargo, el resulto final puede depender de la configuración del navegador.
 
== Forzar la generación de imágenes PNG ==
Para forzar que la fórmula se muestre como una imagen PNG, añade <code>\,</code> (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 <code>\,\!</code> (espacio pequeño y espacio negativo, que se cancelan) en cualquier lugar dentro de las etiquetas <code><nowiki><math>...</math></nowiki></code>. Esto '''sí''' fuerza la generación del PNG incluso si el usuario está en el modo «HTML si es posible, si no PNG», a diferencia de <code>\,</code>.
 
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, <code>a^{2+2}</code> 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:
{| border="1"
|-
! Sintaxis
! Cómo se ve renderizado
|-
| <code>a^{c+2}</code>
| <math>a^{c+2}</math>
|-
| <code>a^{c+2} \,</code>
| <math>a^{c+2} \,</math>
|-
| <code>a^{\,\!c+2}</code>
| <math>a^{\,\!c+2}</math>
|-
| <code>a^{b^{c+2}}</code>
| <math>a^{b^{c+2}}</math> (¡'''Mal''' con la opción «HTML si es posible, si no PNG»!)
|-
| <code>a^{b^{c+2}} \,</code>
| <math>a^{b^{c+2}} \,</math> (¡'''Mal''' con la opción «HTML si es posible, si no PNG»!)
|-
| <code>a^{b^{c+2}} \,\!</code>
| <math>a^{b^{c+2}} \,\!</math> (¡'''Bien''' en todos los casos»!)
|-
| <code>a^{b^{c+2}}\approx 5</code>
| <math>a^{b^{c+2}}\approx 5</math> (debido a <code>\approx</code>, no se necesita <code>\,\!</code>)
|-
| <code>a^{b^{\,\!c+2}}</code>
| <math>a^{b^{\,\!c+2}}</math>
|-
| <code>\int_{-N}^{N} e^x\, dx</code>
| <math>\int_{-N}^{N} e^x\, dx</math>
|-
| <code>\int_{-N}^{N} e^x\, dx \,</code>
| <math>\int_{-N}^{N} e^x\, dx \,</math>
|-
| <code>\int_{-N}^{N} e^x\, dx \,\!</code>
| <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:
 
:<code><nowiki><!-- \,\! es para obligar a que la fórmula se muestre como PNG en vez de como HTML. Por favor no lo borres. --></nowiki></code>
 
== Ejemplos ==
*<math>\frac{2}{3-x} = \frac{3}{2-x} \!</math>
*<math>\left(3-x\right) \times \left( \frac{2}{3-x} \right) = \left(3-x\right) \times \left( \frac{3}{2-x} \right) \!</math>
*<math>2 = \left(3-x\right) \times \left( \frac{3}{2-x} \right) \!</math>
*<math>2 = \left( \frac{\left(3-x\right) \times 3}{2-x} \right) \!</math>
*<math>2 = \left( \frac{9-3x}{2-x} \right) \!</math>
*<math>2 \times \left(2-x\right) = \left(2-x\right) \times \left( \frac{9-3x}{2-x} \right) \!</math>
*<math>2 \times \left(2-x\right) = \frac{\left(2-x\right) \times \left(9-3x\right)}{2-x} \!</math>
*<math>2 \times \left(2-x\right) = 9-3x \!</math>
*<math>4-2x = 9-3x \!</math>
*<math>-2x+3x = 9-4 \!</math>
*<math>x = 5 \!</math>
 
<!--==See also==
* Proposed [[GNU LilyPond support]]-->
 
==Enlaces externos (en español)==
* [http://filemon.mecanica.upm.es/CervanTeX/ CervanTeX, grupo de usuarios de TeX hispanohablantes]
* [http://mailweb.udlap.mx/~aleph/alephzero8/latex.html LaTeX para inexpertos]
* [http://usuarios.lycos.es/bausela/miktex.html Explicación sencilla para instalar LaTeX]
* [http://recetariolatex.cjb.net/ Recetario de LaTeX]
 
==Enlaces externos (en inglés)==
* [http://www.ctan.org/tex-archive/info/gentle/gentle.pdf?action=/starter/ Documento PDF sobre TeX]
* [http://www.nwalsh.com/tex/texhelp/Plain.html Lista de entidades de TeX]
* [http://www.ams.org/tex/amslatex.html AMS-LaTeX]
 
==Enlaces externos (en japonés)==
* [http://oku.edu.mie-u.ac.jp/~okumura/tex/ Permite compilar en línea un documento en TeX]