From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/es/web/mathml/attribute/index.html | 485 +++++++++++++++++++++ files/es/web/mathml/authoring/index.html | 377 ++++++++++++++++ files/es/web/mathml/elemento/index.html | 97 +++++ files/es/web/mathml/elemento/math/index.html | 162 +++++++ files/es/web/mathml/examples/index.html | 24 + .../examples/mathml_pythagorean_theorem/index.html | 9 + files/es/web/mathml/index.html | 75 ++++ 7 files changed, 1229 insertions(+) create mode 100644 files/es/web/mathml/attribute/index.html create mode 100644 files/es/web/mathml/authoring/index.html create mode 100644 files/es/web/mathml/elemento/index.html create mode 100644 files/es/web/mathml/elemento/math/index.html create mode 100644 files/es/web/mathml/examples/index.html create mode 100644 files/es/web/mathml/examples/mathml_pythagorean_theorem/index.html create mode 100644 files/es/web/mathml/index.html (limited to 'files/es/web/mathml') diff --git a/files/es/web/mathml/attribute/index.html b/files/es/web/mathml/attribute/index.html new file mode 100644 index 0000000000..671bb7ddf7 --- /dev/null +++ b/files/es/web/mathml/attribute/index.html @@ -0,0 +1,485 @@ +--- +title: MathML attribute reference +slug: Web/MathML/Attribute +translation_of: Web/MathML/Attribute +--- +

Esta  es una lista alfabetica de atributos de MathML. Más detalles de cada atributo está disponible en cada página de los elementos.

+

Notas:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NombreAtributos aceptadosDescripción
accent{{ MathMLElement("mo") }}, {{ MathMLElement("mover") }}, {{ MathMLElement("munderover") }}Un valor booleano que especifíca si el operador debe ser tratado como un acento.
accentunder{{ MathMLElement("munder") }}, {{ MathMLElement("munderover") }}Un valor booleano que especifíca si el operador debe ser tratado como un acento.
actiontype{{ MathMLElement("maction") }}Un valor de cadena que especifica la acción pasada al elemento.
align{{ MathMLElement("mtable") }}
+ {{ MathMLElement("munder") }}, {{ MathMLElement("mover") }}, {{ MathMLElement("munderover") }}
+ {{ MathMLElement("mstack") }}
Especifica diferentes alineaciones de varios elementos (consulte la página de elementos para más detalles)
{{ unimplemented_inline() }} alignmentscope{{ MathMLElement("mtable") }}Un valor booleano que especifica si las columnas de la tabla deben actuar como ámbitos de alineación o no.
{{ unimplemented_inline() }}
+ altimg
+ altimg-width
+ altimg-height
+ altimg-valign
+ alttext
{{ MathMLElement("math") }}Opciones visuales y textuales de repliegue
bevelled{{ MathMLElement("mfrac") }}Especifica el estilo de como se debe mostrar la fracción.
{{ unimplemented_inline() }} charalign{{ MathMLElement("mstack") }}Especifica la alineación horizontal de los dígitos.
close{{ MathMLElement("mfenced") }}Una cadena para el delimitador de cierre.
columnalign{{ MathMLElement("mtable") }}, {{ MathMLElement("mtd") }}, {{ MathMLElement("mtr") }}, {{ MathMLElement("mlabeledtr") }}Especifica la alineación horizontal de las celdas de la tabla.
columnlines{{ MathMLElement("mtable") }}Especifica los bordes de la columna de la tabla.
{{ unimplemented_inline() }} columnspacing{{ MathMLElement("mtable") }}Especifica el espacio entre las columnas de la tabla.
columnspan{{ MathMLElement("mtd") }}Un valor entero no negativo que indica a cuantas columnas se extiende las celdas de la tabla.
{{ unimplemented_inline() }} columnwidth{{ MathMLElement("mtable") }}Especifica el ancho de las columnas de la tabla.
{{ unimplemented_inline() }} crossout{{ MathMLElement("mscarry") }}Especifica el tipo de linea que se dibuja para tachar.
{{ unimplemented_inline() }} decimalpoint{{ MathMLElement("mstyle") }}Si el valor de decimalpoint es usado para especificar la alineación, este atributo especifica el caracter del punto de alineación dentro de las columnas de {{ MathMLElement("mstack") }} y {{ MathMLElement("mtable") }} .
denomalign{{ MathMLElement("mfrac") }}La alineación del denominador bajo la fracción.
depth{{ MathMLElement("mpadded") }}Establece o incrementa la profundidad. Ver longitud.
dir{{ MathMLElement("math") }}, {{ MathMLElement("mi") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("mrow") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}La dirección del texto. Posibles valores son ltr (izquierda a derecha) o rtl (derecha a izquierda).
display{{ MathMLElement("math") }}Especifica el modo de renderizado. Los valores block e inline son permitidos.
displaystyle{{ MathMLElement("mstyle") }}, {{ MathMLElement("mtable") }} +

Un valor booleano que especifica si un espacio más vertical es usado para las ecuaciones mostradas o, si se establece como false, un diseño más compacto se utiliza para mostrar las formulas.

+
{{ unimplemented_inline() }} edge{{ MathMLElement("malignmark") }} 
{{ unimplemented_inline() }} equalcolumns{{ MathMLElement("mtable") }} +

Un valor booleano que indica si se debe obligar a las columnas a tener la misma altura total.

+
{{ unimplemented_inline() }} equalrows{{ MathMLElement("mtable") }}Un valor booleano que indica si se debe obligar a las filas a tener la misma altura total.
fence{{ MathMLElement("mo") }} +

Un valor booleano que indica si el operador está cercado (como parentesis). No hay efecto visual de este atributo.

+
{{ unimplemented_inline() }} form{{ MathMLElement("mo") }} +

Especifica el rol del operador en una expresión cerrada.

+
frame{{ MathMLElement("mtable") }} +

Especifica bordes de toda una {{ MathMLElement("mtable") }}. Posibles valores son: none (default), solid y dashed.

+
{{ unimplemented_inline() }} framespacing{{ MathMLElement("mtable") }}Especifica espacio adicional agregado entre la tabla y el frame.
{{ unimplemented_inline() }} groupalign{{ MathMLElement("maligngroup") }}, {{ MathMLElement("mtable") }}, {{ MathMLElement("mtd") }}, {{ MathMLElement("mtr") }} 
height{{ MathMLElement("mglyph") }}, {{ MathMLElement("mpadded") }}, {{ MathMLElement("mspace") }}Especifica la altura deseada. Ver longitudes para los posibles valores.
hrefAllUsado para estableces un hyperlink para determinada URL.
idAllEstablece un unico identificador asociado con el elemento.
{{ unimplemented_inline() }} indentalign{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indentalignfirst{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indentalignlast{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indentshift{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indentshiftfirst{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indentshiftlast{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} indenttarget{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} infixlinebreakstyle{{ MathMLElement("mstyle") }}Especifica el valor por defecto de linebreakstyle a usar para los operadores infijos.
largeop{{ MathMLElement("mo") }}Especifica si el operador debe dibujarse más grande de lo normal.
length{{ MathMLElement("msline") }} 
{{ unimplemented_inline() }} linebreak{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} linebreakmultchar{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} linebreakstyle{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
{{ unimplemented_inline() }} lineleading{{ MathMLElement("mo") }}, {{ MathMLElement("mspace") }} 
linethickness{{ MathMLElement("mfrac") }}El grosor de la linea de fracción horizontal.
{{ unimplemented_inline() }} location{{ MathMLElement("mscarries") }} 
{{ unimplemented_inline() }} longdivstyle{{ MathMLElement("mlongdiv") }}Controla el estilo del diseño de la división larga.
lspace{{ MathMLElement("mo") }}, {{ MathMLElement("mpadded") }}La cantidad de espacio antes del operador(ver length para valores y unidades).
lquote{{ MathMLElement("ms") }}El carácter de apertura de citas que encierra el contenido. El valor predeterminado es """.
mathbackgroundAllEl colo de fondo. Puedes usar #rgb, #rrggbb y nombres de color HTML.
mathcolorAllEl color de texto. Puedes usar  #rgb, #rrggbb y nombres de color HTML.
mathsize{{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}El tamaño del contenido. Comenzando con Gecko 20.0 {{geckoRelease("20")}} valores sin unidades están permitidos y se interpretan como N veces el tamaño predeterminado.
mathvariant{{ MathMLElement("mi") }}, {{ MathMLElement("mn") }}, {{ MathMLElement("mo") }}, {{ MathMLElement("ms") }}, {{ MathMLElement("mtext") }}La clase logica del identificador, la cual varia en tipografia.
maxsize{{ MathMLElement("mo") }}El tamaño máximo del operador.
{{ unimplemented_inline() }} minlabelspacing{{ MathMLElement("mtable") }}Un valor de longitud espcificando el minimo espacio entre una etiqueta y la celda adjacente en la fila.
minsize{{ MathMLElement("mo") }}El tamaño mínimo del operador.
movablelimits{{ MathMLElement("mo") }}Especifica si los guiones bajos y altos se mueven a las posiciones de sub-índice o super-índice.
notation{{ MathMLElement("menclose") }}Una lista de anotaciones, separado por espacios en blanco, para aplicar a los elementos secundarios.
numalign{{ MathMLElement("mfrac") }}La alineación del numerador en la fracción.
open{{ MathMLElement("mfenced") }}Una cadena para el delimitador de apertura.
{{ unimplemented_inline() }} overflow{{ MathMLElement("math") }} +

Si una expresión es demasiado larga para encajar en el ancho definido, este atributo establece el tratamiendo preferido.

+
{{ unimplemented_inline() }} position{{ MathMLElement("msgroup") }}, {{ MathMLElement("msrow") }}, {{ MathMLElement("mscarries") }}, {{ MathMLElement("msline") }} 
rowalign{{ MathMLElement("mtable") }}, {{ MathMLElement("mtd") }}, {{ MathMLElement("mtr") }}Especifica la alineación vertical de las celdas de la tabla.
rowlines{{ MathMLElement("mtable") }}Especifica los bordes de las filas de la tabla.
rowspacing{{ MathMLElement("mtable") }}Especifica el espacio entre las filas de la tabla.
rowspan{{ MathMLElement("mtd") }}Un valor entero no negativo que indica el númerp de filas que se extiende las celdas.
rspace{{ MathMLElement("mo") }}La cantidad de espacios luego del operador.
rquote{{ MathMLElement("ms") }}La marca de cierre de cita que encierra el contenido. El valor predeterminado es """.
scriptlevel{{ MathMLElement("mstyle") }}Controles sobre el tamaño de la fuente. Cuando mayor sea el nivel del script, menor el tamaño de la fuente.
scriptminsize{{ MathMLElement("mstyle") }}Especifica el minimo tamaño de fuente permitidos debido a cambios en scriptlevel.
+ Comenzando con Gecko 20.0 {{geckoRelease("20")}} valores sin unidades y porcentajes son permitidos y se interpretan como multiplos de "8pt".
scriptsizemultiplier{{ MathMLElement("mstyle") }}Especifica el multiplicador a ser utilizado para ajustar el tamaño de fuente debidp a cambios en scriptlevel.
selection{{ MathMLElement("maction") }}El elemento secundario al cual se dirige la acción.
separator{{ MathMLElement("mo") }}No existe efecto visual para este elemento, pero especifica si el operador es un separador (como las comas).
separators{{ MathMLElement("mfenced") }}Una secuencia de ceros o más caracteres a ser usados por diferentes separadores.
{{ unimplemented_inline() }} shift{{ MathMLElement("msgroup") }} 
{{ unimplemented_inline() }} side{{ MathMLElement("mtable") }}Especifica la posición donde los elementos{{ MathMLElement("mlabeledtr") }} deberían ser posicionados.
{{ unimplemented_inline() }} src{{ MathMLElement("mglyph") }}La ubicación de la imagen.
{{ unimplemented_inline() }} stackalign{{ MathMLElement("mstack") }} 
stretchy{{ MathMLElement("mo") }}Especifica si el operador se extiende hasta el tamaño del elemento adyacente.
subscriptshift{{ MathMLElement("mmultiscripts") }}, {{ MathMLElement("msub") }}, {{ MathMLElement("msubsup") }}El espacio mínimo por el que se desplace el subíndice por debajo de la línea de base de la expresión.
supscriptshift{{ MathMLElement("mmultiscripts") }}, {{ MathMLElement("msup") }}, {{ MathMLElement("msubsup") }}El espacio mínimo por el que se desplace el superíndice por encima de la línea de base de la expresión.
symmetric{{ MathMLElement("mo") }} +

Si stretchy es true, este  atributo especifica si el operador debe estar simetrico verticalmente al eje imaginario de matemáticas (linea centrada de fracción).

+
voffset{{ MathMLElement("mpadded") }}Ajusta la posición vertical del contenido secundario.
width{{ MathMLElement("mglyph") }}, {{ MathMLElement("mpadded") }}, {{ MathMLElement("mspace") }}, {{ MathMLElement("mtable") }}Especifica el ancho deseado. Ver longitudes para posibles valores.
xmlns{{ MathMLElement("math") }}Especifica la URL para el espacio de nombres MathML (http://www.w3.org/1998/Math/MathML)
+

 

diff --git a/files/es/web/mathml/authoring/index.html b/files/es/web/mathml/authoring/index.html new file mode 100644 index 0000000000..774c910cea --- /dev/null +++ b/files/es/web/mathml/authoring/index.html @@ -0,0 +1,377 @@ +--- +title: Redacción de MathML +slug: Web/MathML/Authoring +translation_of: Web/MathML/Authoring +--- +

Este artículo explica como redactar funciones matemáticas utilizando el lenguaje MathML. Al igual que HTML, MathML puede describirse con etiquetas y atributos. HTML puede volverse interminable cuando tu documento contiene estructuras avanzadas como listas o tablas pero afortunadamente existen varios generadores, desde simple notaciones, editores WYSIWYG y otros Sistemas de Administración de Contenido (CMS) utilizados para la creación de páginas web.

+ +

Las notaciones Matemáticas son aún más complejas con estructuras que contienen fracciones, raíces cuadradas o matrices que seguramente requerirán sus propias etiquetas. Como consecuencia, las buenas herramientas de redacción de MathML son importantes y más adelante describimos algunas opciones. En particular, el équipo MathML de Mozilla ha creado TeXZilla, un convertor de LaTeX a MathML compatible con Unicode, para ser utilizado en muchos scenari descrito ahí. Desde luego, la lista no es de ninguna manera definitiva y estás invitado a revisar la Lista de Software MathML de W3C donde puedes encontrar diferentes herramientas.

+ +

Hay que señalar que por diseño, MathML está bien integrado en HTML5 y particularmente puedes utilizar las características Web comunes como CSS, DOM, Javascript o SVG. Esto está fuera del ámbito de este artículo pero cualquiera con conocimientos básicos de lenguajes Web será capaz de combinar fácilmente estas características con MathML. Revisa nuestros demos y referencias de MathML para más detalles.

+ +

Fundamentos

+ +

Utilizar MathML en páginas HTML

+ +

Puedes utilizar MathML dentro de un documento HTML5:

+ +
<!DOCTYPE html>
+<html>
+<head>
+ <title>MathML in HTML5</title>
+</head>
+<body>
+
+  <h1>MathML in HTML5</h1>
+
+  <p>
+    Square root of two:
+    <math>
+      <msqrt>
+        <mn>2</mn>
+      </msqrt>
+    </math>
+  </p>
+
+</body>
+</html> 
+ +

Content MathML no esta soportado por el navegador. Es recomendable convertir tu content MathML markup en Presentation MathML  antes de publicarlo, por ejemplo con la ayuda de la hoja de calculo  ctop.xsl  . Las herramientas mencionadas en esta pagina generan Presentation MathML.

+ +

 

+ +

Para navegadores sin soporte a MathML

+ +

Desafortunadamente, algunos navegadores no son capaces  de  renderizar ecuaciones MathML o tienen un soporte limitado. Por lo tanto necesitará  usar  MathML polyfill para proveer el renderizado. Si necesita solo construcciones matematicas básicas tales como las utilizadas  en esta wiki de MDN entonces una pequeña hoja de cálculo mathml.css  podria  ser suficiente. Para usarlo, solo inserta una linea en el header de tu documento:

+ +
<script src="http://fred-wang.github.io/mathml.css/mspace.js"></script>
+ +

If you need more complex constructions, you might instead consider using the heavier MathJax library as a MathML polyfill:

+ +
<script src="http://fred-wang.github.io/mathjax.js/mpadded.js"></script>
+ +

Note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). If you don't want to use this link to GitHub but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of MathML support. For example the following function verifies the MathML support by testing the mspace element (you may replace mspace with mpadded):

+ +
 function hasMathMLSupport() {
+  var div = document.createElement("div"), box;
+  div.innerHTML = "<math><mspace height='23px' width='77px'/></math>";
+  document.body.appendChild(div);
+  box = div.firstChild.firstChild.getBoundingClientRect();
+  document.body.removeChild(div);
+  return Math.abs(box.height - 23) <= 1  && Math.abs(box.width - 77) <= 1;
+}
+ +

Alternatively, the following UA string sniffing will allow to detect the rendering engines with native MathML support (Gecko and WebKit). Note that UA string sniffing is not the most reliable method and might break from version to version:

+ +
var ua = navigator.userAgent;
+var isGecko = ua.indexOf("Gecko") > -1 && ua.indexOf("KHTML") === -1 && ua.indexOf('Trident') === -1;
+var isWebKit = ua.indexOf('AppleWebKit') > -1 && ua.indexOf('Chrome') === -1;
+ +

 

+ +

Mathematical fonts

+ +

Note: browsers can only use a limited set of mathematical fonts to draw stretchy MathML operators. However, implementation of the OpenType MATH table is in progress in Gecko & WebKit. This will provide a generic support for mathematical fonts and simplify the settings described in this section.

+ +

To get a good mathematical rendering in browsers, some MathML fonts are required. It's a good idea to provide to your visitors a link to the MDN page that explains how to install MathML fonts. Alternatively, you can just make them available as Web fonts. You can get these fonts from the MathML-fonts add-on ; the xpi is just a zip archive that you can fetch and extract for example with the following command:

+ +
wget https://addons.mozilla.org/firefox/downloads/latest/367848/addon-367848-latest.xpi -O mathml-fonts.zip; \
+unzip mathml-fonts.zip -d mathml-fonts
+ +

Then copy the mathml-fonts/resource/ directory somewhere on your Web site and ensure that the woff files are served with the correct MIME type. Finally, include the mathml-fonts/resource/mathml.css style sheet in your Web pages, for example by adding the following rule to the default style sheet of your Web site:

+ +
@import url('/path/to/resource/mathml.css');
+ +

You then need to modify the font-family on the <math> elements and, for Gecko, the on ::-moz-math-stretchy pseudo element too. For example to use STIX fonts:

+ +
math {
+  font-family: STIXGeneral;
+}
+
+::-moz-math-stretchy {
+  font-family: STIXNonUnicode, STIXSizeOneSym, STIXSize1, STIXGeneral;
+}
+
+ +

Try the MathML torture test to compare the rendering of various fonts and the CSS rules to select them.

+ +

Utilizar MathML en documentos XML (XHTML, EPUB, etc.)

+ +

Si por alguna razón necesitas utilizar MathML en documentos XML, asegúrate de cumplir con los requisitos habituales: documentos bien realizados, el uso correcto de la especificación MIME, el prefijo MathML "http://www.w3.org/1998/Math/MathML" en la raíz <math>. Por ejemplo, la versión XHTML del ejemplo anterior luce de esta manera:
+  

+ +
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
+  "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>XHTML+MathML Example</title>
+</head>
+<body>
+
+<h1>XHTML+MathML Example</h1>
+
+  <p>
+    Square root of two:
+    <math xmlns="http://www.w3.org/1998/Math/MathML">
+      <msqrt>
+        <mn>2</mn>
+      </msqrt>
+    </math>
+  </p>
+
+</body>
+</html> 
+ +

Note that if you use MathML as a standalone .mml or .svg documents or inside an EPUB book, it may not always be possible to use MathJax as a polyfill for rendering engines without MathML support. Hence whether MathML can be handled will vary according to the tools used to read these documents.

+ +

Utilizar MathML en correos electrónicos

+ +

Los clientes de correos modernos pueden enviar y recibir correos electrónicos en el formato HTML5 y por lo tanto pueden manejar expresiones de tipo MathML. Asegúrate de tener las opciones de "Enviar como HTML" y "Ver como HTML" habilitadas. En Thunderbird, puedes utilizar el comando "Insertar HTML" para pegar tu código HTML+MathML. MathBird es un complemento conveniente de Thunderbird para insertar este tipo de expresiones MathML utilizando la sintaxis AsciiMath.
+
+ De nuevo, la forma en como MathML es manejada y la calidad de cómo se muestran estas expresiones depende del cliente de correo electrónico. Aún si tu navegador es compatible con MathML, tu servicio de correo electrónico puede evitar que envíes o recibas correos con expresiones MathML.

+ +

Conversion from a Simple Syntax

+ +

There are many simple notations (e.g. wiki or markdown syntaxes) to generate HTML pages. The same is true for MathML: for example ASCII syntaxes as used in calculators or the more powerful LaTeX language, very popular among the scientific community. In this section, we present some of these tools to convert from a simple syntax to MathML.

+ + + +

Client-side Conversion

+ +

In a Web environment, the most obvious method to convert a simple syntax into a DOM tree is to use Javascript and of course many libraries have been developed to perform that task.

+ + + +

TeXZilla has an <x-tex> custom element, that can be used to write things like

+ +
<x-tex>\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1</x-tex>
+ +

and get it automatically converted into MathML. This is still a work-in-progress, but could be improved in the future thanks to Web Components and shadow DOM. Alternatively, you can use the more traditional Javascript parsing of expressions at load time as all the other tools in this section do.

+ +

One simple client-side conversion tools is ASCIIMathML. Just download the ASCIIMathML.js script and copy it to your Web site. Then on your Web pages, add a <script> tag to load ASCIIMathML and the mathematical expressions delimited by ` (grave accent) will be automatically parsed and converted to MathML:

+ +
<html>
+<head>
+...
+<script type="text/javascript" src="ASCIIMathML.js"></script>
+...
+</head>
+<body>
+...
+<p>blah blah `x^2 + y^2 = r^2` blah ...
+...
+ +

LaTeXMathML is a similar script that allows to parse more LaTeX commands. The installation is similar: copy LaTeXMathML.js and LaTeXMathML.standardarticle.css, add links in the header of your document and the LaTeX content of your Web page marked by the "LaTeX" class will be automatically parsed and converted to HTML+MathML:

+ +
<head>
+...
+<script type="text/javascript" src="LaTeXMathML.js"></script>
+<link rel="stylesheet" type="text/css" href="LaTeXMathML.standardarticle.css" />
+...
+</head>
+
+<body>
+...
+
+<div class="LaTeX">
+\documentclass[12pt]{article}
+
+\begin{document}
+
+\title{LaTeXML Example}
+\maketitle
+
+\begin{abstract}
+This is a sample LaTeXML document.
+\end{abstract}
+
+\section{First Section}
+
+  $$ \sum_{n=1}^{+\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$
+
+\end{document}
+</div>
+...
+ +

jqMath is another script to parse a simple LaTeX-like syntax but which also accepts non-ASCII characters like  √{∑↙{n=1}↖{+∞} 6/n^2} = π  to write n = 1 + 6 n 2 = π . The installation is similar: download and copy the relevant Javascript and CSS files on your Web site and reference them in your page header (see the COPY-ME.html file from the zip archive for an example). One of the advantage of jqMath over the previous scripts is that it will automatically add some simple CSS rules to do the mathematical layout and make the formulas readable on browsers with limited MathML support.

+ +

Another way to work around the lack of MathML support in some browsers is to use MathJax. However, note that you may find conflicts and synchronization issues between MathJax and the Javascript libraries previously mentioned. So if you really want to use MathJax as a MathML polyfill, you'd better use its own LaTeX/ASCIIMath parsers too. Note that on the one hand MathJax has better parsing and rendering support but on the other hand it is much bigger, more complex and slower than the previous Javascript libraries. Fortunately, you can use MathJax's CDN so that you don't need to install it on your Web server. Also, the slowest part of MathJax is currently its HTML-CSS / SVG output modes so we recommend to use the Native MathML output for Gecko-based browsers. Hence a typical configuration to use the AMS-LaTeX input is:

+ +
...
+    <script type="text/x-mathjax-config">
+      MathJax.Hub.Config({
+        MMLorHTML: { prefer: { Firefox: "MML" } }
+      });
+    </script>
+    <script type="text/javascript"
+            src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
+   </script>
+  </head>
+  <body>
+   \[ \tau = \frac{x}{y} + \sqrt{3} \]
+...
+ +

Note that the dollar delimiters are not used by default. To use the ASCIIMathML input instead, just replace TeX-AMS-MML_HTMLorMML by AM-MML_HTMLorMML.  MathJax has many other features, see the MathJax documentation for further details.

+ +

Command-line Programs

+ +

An alternative way is to parse the simple syntax before publishing your web pages. That is, you use command-line programs to generate them and publish these static pages on your server.

+ + + +

TeXZilla can be used from the command line and will essentially have the same support as itex2MML described below. However, the stream filter behavior is not implemented yet.

+ +

If you only want to parse simple LaTeX mathematical expressions, you might want to try tools like itex2MML or Blahtex. The latter is often available on Linux distributions. Let's consider the former, which was originally written by Paul Gartside at the beginning of the Mozilla MathML project and has been maintained by Jacques Distler since then. It's a small stream filter written in C/C++ and generated with flex and bison ; in particular it is very fast. Install flex/bison as well as the classical compiler and make tools. On Unix, you can then download itex2MML, build and install it:

+ +
wget http://golem.ph.utexas.edu/~distler/blog/files/itexToMML.tar.gz; \
+tar -xzf itexToMML.tar.gz; \
+cd itex2MML/itex-src;
+make
+sudo make install
+ +

Now suppose that you have a HTML page with TeX fragments delimited by dollars:

+ +
input.html
+
+...
+</head>
+<body>
+  <p>$\sqrt{a^2-3c}$</p>
+  <p>$$ {\sum_{i=1}^N i} = \frac{N(N+1)}{2} $$</p>
+</body>
+</html>
+ +

Then to generate the HTML page input.html with TeX expressions replaced by MathML expressions, just do

+ +
cat input.html | itex2MML > output.html
+ +

There are even more sophisticated tools to convert arbitrary LaTeX documents into HTML+MathML. For example TeX4ht is often included in TeX distributions and has an option to use MathML instead of PNG images. This command will generate an XHTML+MathML document foo.xml from a foo.tex LaTeX source:

+ +
   mk4ht mzlatex foo.tex # Linux/Mac platforms
+   mzlatex foo.tex       # Windows platform
+
+ +

LaTeXML is another tool that is still actively developed but the release version is rather old, so you'd better install the development version. In particular, this version can generate HTML5 and EPUB documents. Here is the command to execute in order to create a foo.html Web page from the foo.tex LaTeX source:

+ +
  latexml --dest foo.xml foo.tex
+  latexmlpost --dest foo.html --format=html5 foo.xml
+
+ +

If you want to have a MathJax fallback for non-Gecko browsers, copy the Javascript lines given above into a mathjax.js file and use the --javascript parameter to tell LaTeXML to include that file:

+ +
  latexmlpost --dest foo.html --format=html5 --javascript=mathjax.js foo.xml
+
+ +

If your LaTeX document is big, you might want to split it into several small pages rather putting everything in a single page. This is especially true if you use the MathJax fallback above, since in that case MathJax will take a lot of time to render the equations in non-Gecko browsers. Use the --splitat parameter for that purpose. For example, this will split the pages at the \section level:

+ +
  latexmlpost --dest foo.html --format=html5 --splitat=section foo.xml
+
+ +

Finally, to generate an EPUB document, you can do

+ +
  latexmlc --dest foo.epub --splitat=section foo.xml
+
+ +

Server-side Conversion

+ + + +

TeXZilla can be used as a Web server in order to perform server-side LaTeX-to-MathML conversion. LaTeXML can also be used as a deamon to run server-side. Mathoid is another tool based on MathJax that is also able to perform additional MathML-to-SVG conversion.

+ +

Instiki is a Wiki that integrates itex2MML to do server-side conversion. In future versions, MediaWiki will support server-side conversion too.

+ +

Graphical Interface

+ +

Input Box

+ +

TeXZilla has several interfaces, including a CKEditor plugin used on MDN, an online demo, a Firefox add-on or a FirefoxOS Webapp. Abiword contains a small equation editor, based on itex2MML. Bluegriffon is a mozilla-based Wysiwyg HTML editor and has an add-on to insert MathML formulas in your document, using ASCII/LaTeX-like syntax.

+ +

BlueGriffon

+ +

WYSIYWG Editors

+ +

Firemath is an extension for Firefox that provides a WYSIWYG MathML editor. A preview of the formula is displayed using the rendering engine of Mozilla. The generated MathML code is available at the bottom. Use the text field for token elements and buttons to build advanced constructions. Once you are done, you can save your document as a XHTML page.

+ +

OpenOffice and LibreOffice have an equation editor (File → New → Formula). It is semi-WYSIWYG: you enter the source of the formula using the equation panel/keyboard and a preview of the formula is regularly refreshed. The editor uses its own syntax "StarMath" for the source but MathML is also generated when the document is saved. To get the MathML code, save the document as mml and open it with any text editor. Alternatively, you can extract the odf file (which is actually a zip archive) and open an xml file called content.xml.

+ +

Open Office Math

+ +

Amaya is the W3C's web editor, which is able to handle MathML inside XHTML documents. Use the Elements and the Special Chars panels to create various advanced mathematical constructs. Simple text such as a+2 is automatically parsed and the appropriate MathML markup is generated. Once you are done, you can directly save your XHTML page and open it in Mozilla.

+ +

Optical Character & Handwriting Recognition

+ +

Inftyreader is able to perform some Optical Character Recognition, including translation of mathematical equations into MathML. Other tools can do handwriting recognition such as the Windows Math Input Panel

+ +

Windows Math Input Panel

+ +

or the online converter Web Equation.

+ +

Original Document Information

+ +
+ +
+ +

 

diff --git a/files/es/web/mathml/elemento/index.html b/files/es/web/mathml/elemento/index.html new file mode 100644 index 0000000000..aa75307fa3 --- /dev/null +++ b/files/es/web/mathml/elemento/index.html @@ -0,0 +1,97 @@ +--- +title: Referencia de elementos de MathML +slug: Web/MathML/Elemento +translation_of: Web/MathML/Element +--- +

A continuación se muestra una lista alfabética de elementos de presentación en MathML.
+ La etiqueta de presentación es usada para describir la estructura y el diseño de la notación matemática mientras que la etiqueta de contenido proporciona el significado matemático subyacente y se supone que no se renderiza a través del parseador de MathML (ver {{ bug(276028) }}). Si quieres aprender más sobre la etiqueta de contenido deberías echar un vistazo al Capítulo 4 en la especificación de MathML 3.

+

math

+ +

A

+ +

E

+ +

F

+ +

G

+ +

I

+ +

L

+ +

M

+ +

N

+ +

O

+ +

P

+ +

R

+ +

S

+ +

T

+ +

U

+ +

Other elements

+ diff --git a/files/es/web/mathml/elemento/math/index.html b/files/es/web/mathml/elemento/math/index.html new file mode 100644 index 0000000000..c7ecf0f0ab --- /dev/null +++ b/files/es/web/mathml/elemento/math/index.html @@ -0,0 +1,162 @@ +--- +title: +slug: Web/MathML/Elemento/math +translation_of: Web/MathML/Element/math +--- +
{{MathMLRef}}
+ +

<math> es el elemento superior en MathML. Cada instancia válida de MathML debe estar rodeada de etiquetas <math>. Además, no debes anidar un segundo elemento <math> dentro de un primero, pero puedes tener un número arbitrario de otros elementos hijos en él.

+ +

Atributos

+ +

Además de los siguientes atributos, el elemento <math> acepta cualquier atributo del elemento {{ MathMLElement("mstyle") }}.

+ +
+
class, id, style
+
Disponibles para el uso con hojas de estilo.
+
dir
+
La dirección general de las fórmulas. Sus valores posibles son ltr (izquierda a derecha) o bien rtl (derecha a izquierda).
+
href
+
Usado para definir un hipervínculo a un URI (Identificador de Recurso Unificado) especificado.
+
mathbackground
+
El color de fondo. Puedes usar #rgb, #rrggbb y palabras clave de colores.
+
mathcolor
+
El color de texto. Puedes usar #rgb, #rrggbb y palabras clave de colores.
+
display
+
Este atributo enumerado especifica de qué manera el marcado MathML debería ser renderizado. Puede tomar uno de los siguientes valores: +
    +
  • block, el cual indica que este elemento será incluido fuera del fragmento de texto actual , en forma de bloque individual que puede ser posicionado en cualquier sitio sin cambiar el significado del texto;
  • +
  • inline, el cual indica que este elemento será incluido en el fragmento de texto actual, y no puede ser sacado del mismo sin cambiar el significado del texto.
  • +
+ +

De no estar presente, toma inline por defecto.

+
+
mode {{deprecated_inline}}
+
Deprecado a favor del atributo display.
+ Sus valores posibles son: display (que tiene el mismo efecto que display="block") e inline.
+
overflow
+
Especifica el comportamiento de una expresión si es demasiado larga para caber en el ancho asignado.
+ Sus valores posibles son: linebreak (por defecto), scroll, elide, truncate, scale.
+
+ +

Ejemplos

+ +

Theorem of Pythagoras

+ +

Notación HTML5

+ +
<!DOCTYPE html>
+<html>
+  <head>
+    <title>MathML en HTML5</title>
+  </head>
+  <body>
+
+  <math>
+    <mrow>
+      <mrow>
+        <msup>
+          <mi>a</mi>
+          <mn>2</mn>
+        </msup>
+        <mo>+</mo>
+        <msup>
+          <mi>b</mi>
+          <mn>2</mn>
+        </msup>
+      </mrow>
+      <mo>=</mo>
+      <msup>
+        <mi>c</mi>
+        <mn>2</mn>
+      </msup>
+    </mrow>
+  </math>
+
+  </body>
+</html>
+
+ +

Notación XHTML

+ +
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>MathML en XHTML</title>
+</head>
+<body>
+
+  <math xmlns="http://www.w3.org/1998/Math/MathML">
+    <mrow>
+      <mrow>
+        <msup>
+          <mi>a</mi>
+          <mn>2</mn>
+        </msup>
+        <mo>+</mo>
+        <msup>
+          <mi>b</mi>
+          <mn>2</mn>
+        </msup>
+      </mrow>
+      <mo>=</mo>
+      <msup>
+        <mi>c</mi>
+        <mn>2</mn>
+      </msup>
+    </mrow>
+  </math>
+
+</body>
+</html>
+ +

Notas: Los documentos XHTML con MathML deben servirse como application/xhtml+xml. Puedes lograrlo facilmente añadiendo la extensión .xhtml a tus archivos locales. Para servidores Apache puedes configurar tu archivo .htaccess para direccionar extensiones al tipo Mime correcto. Ya que estás escribiendo tu MathML en un archivo XML, asegurate también de escribir un documento XML bien formado.

+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{ SpecName('MathML3', 'chapter2.html#interf.toplevel', 'The Top-Level math Element') }}{{ Spec2('MathML3') }}Especificación actual
{{ SpecName('MathML2', 'chapter7.html#interf.toplevel', 'The Top-Level math Element') }}{{ Spec2('MathML2') }}Especificación inicial
+ +

Compatibilidad de navegadores

+ +

 

+ + + +

{{Compat("mathml.elements.math")}}

+ +

 

+ +

Notas específicas a Firefox

+ +

Firefox 7 introdujo soporte para aceptar todos los atributos MathML en el elemento superior math (por ejemplo, el mismo comportamiento que el elemento {{ MathMLElement("mstyle") }}). Sin embargo, el atributo displaystyle no fue tomado en cuenta y ha sido añadido en Firefox 8.

+ +

Texto de respaldo (alttext) o referir a una imagen alternativa usando los atributos altimg, altimg-width, altimg-height o altimg-valign no se encuentra actualmente implementado en Firefox.

+ +

Véase también

+ + diff --git a/files/es/web/mathml/examples/index.html b/files/es/web/mathml/examples/index.html new file mode 100644 index 0000000000..0bbd27bf96 --- /dev/null +++ b/files/es/web/mathml/examples/index.html @@ -0,0 +1,24 @@ +--- +title: Examples +slug: Web/MathML/Examples +tags: + - MathML + - NeedsTranslation + - TopicStub +translation_of: Web/MathML/Examples +--- +

Below you'll find some examples you can look at to help you to understand how to use MathML to display increasingly complex mathematical concepts in Web content.

+
+
+ Pythagorean Theorem
+
+ Small example showing a proof of the Pythagorean Theorem.
+
+ Deriving the Quadratic Formula
+
+ Outlines the derivation of the Quadratic Formula.
+
+ MathML Torture Test
+
+ Large set of test markup.
+
diff --git a/files/es/web/mathml/examples/mathml_pythagorean_theorem/index.html b/files/es/web/mathml/examples/mathml_pythagorean_theorem/index.html new file mode 100644 index 0000000000..46ec3444f8 --- /dev/null +++ b/files/es/web/mathml/examples/mathml_pythagorean_theorem/index.html @@ -0,0 +1,9 @@ +--- +title: MathML Pythagorean Theorem +slug: Web/MathML/Examples/MathML_Pythagorean_Theorem +translation_of: Web/MathML/Examples/MathML_Pythagorean_Theorem +--- +

<math 1ex"="" height="0.5ex" side="left" style="font-size: 16pt; font-family: arial; mspace depth=" width="2.5ex"> a2 + b 2 = c 2 Podemos demostrar el teorema algebraicamente mostrando que el area del cuadrado grande
+ es igual al area del cuadrado interno (hipotenusa al cuadrado) mas el area de los cuatro triangulos:

+
+ (a + b)2 = c2 + 4(1 2)a b a2 + 2ab + b2 = c2 + 2ab a2 + b2 = c2

diff --git a/files/es/web/mathml/index.html b/files/es/web/mathml/index.html new file mode 100644 index 0000000000..811aa9b05e --- /dev/null +++ b/files/es/web/mathml/index.html @@ -0,0 +1,75 @@ +--- +title: MathML +slug: Web/MathML +tags: + - Landing + - MathML + - NeedsTranslation + - Reference + - Référence(2) + - TopicStub +translation_of: Web/MathML +--- +

Lenguaje de Marcado Matemático (MathML) es un lenguaje de marcado XML para describir expresiones matemáticas capturando tanto su contenido como su estructura.

+ +

Aquí encontrarás enlaces a documentación, ejemplos y herramientas que te ayudarán a trabajar con esta tecnología poderosa. Para un resumen, vea la presentación que se preparó para Mozilla Summit .

+ +
+
+

Referencia de MathML

+ +
+
Referencia de elementos de MathML
+
Detalles sobre cada elemento de MathML e información sobre compatibilidad con navegadores móviles y de escritorio.
+
Referencia de atributos de MathML
+
Información sobre los atributos que modifican el aspecto y comportamiento de los elementos.
+
Ejemplos de MathML
+
Muestras y ejemplos en MathML para ayudarte a comprender cómo funciona.
+
Creando MathML
+
Sugerencias y consejos al momento de escribir MathML, incluyendo editores de MathML sugeridos y cómo integrar sus productos a contenido Web.
+
+ +

Ver todo lo etiquetado con MathML en español...

+
+ +
+

Obteniendo ayuda de la comunidad

+ + + +

Herramientas

+ + + +

Temas relacionados

+ + +
+
+ +

Compatibilidad de navegadores

+ + + +

{{Compat("mathml.elements.math", 0)}}

+ +

{{ HTML5ArticleTOC() }}

-- cgit v1.2.3-54-g00ecf