Cómo mostrar matemáticas en el Lector inmersivo
El Lector inmersivo puede mostrar matemáticas cuando se proporcionan en forma de lenguaje de marcado matemático (MathML). El tipo MIME se puede establecer a través del fragmento del Lector inmersivo. Para obtener más información, consulte los tipos MIME admitidos.
Envío de matemáticas al Lector inmersivo
Para enviar matemáticas al Lector inmersivo, proporcione un fragmento que contenga MathML, y establezca el tipo MIME en application/mathml+xml.
Por ejemplo, si el contenido fuera el siguiente:
<div id='ir-content'>
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mfrac>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mn>3</mn>
<mi>x</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
<mrow>
<mi>x</mi>
<mo>−</mo>
<mn>3</mn>
</mrow>
</mfrac>
<mo>=</mo>
<mn>4</mn>
</math>
</div>
Podría mostrar el contenido mediante el siguiente código JavaScript.
const data = {
title: 'My Math',
chunks: [{
content: document.getElementById('ir-content').innerHTML.trim(),
mimeType: 'application/mathml+xml'
}]
};
ImmersiveReader.launchAsync(YOUR_TOKEN, YOUR_SUBDOMAIN, data, YOUR_OPTIONS);
Al iniciar el Lector inmersivo, debería ver:

Pasos siguientes
- Explorar el SDK del Lector inmersivo y agregar la Referencia del SDK del Lector inmersivo