MathMl binding in epub v.3 is not a typical element:
If you use this equation as such in your ebook than epub v3 allow you to use the capability of mathml in your source code with some recommendations:
Recommendations:
First you have to write the mathml code for this equation, for this Open Office Math editor is a good choice. Open it and write the code it is as easy as writing the sentence. Save this code as .mml, now it looks like as:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>
<mrow>
<mi>x</mi>
<mo stretchy="false">=</mo>
<mrow>
<mfrac>
<mn>6</mn>
<mi>y</mi>
</mfrac>
<mo stretchy="false">−</mo>
<mfrac>
<mn>5</mn>
<msup>
<mi>y</mi>
<mn>2</mn>
</msup>
</mfrac>
</mrow>
</mrow>
</mrow>
<annotation encoding="application/xhtml+xml">x = 6 over y - 5 over y^2</annotation>
</semantics>
</math>
Use this code in your file and create the epub.
As Reading System support for MathML rendering is inconsistent, Authors are encouraged to provide a fallback image using the altimg
attribute on the math
element. It is recommended that the dimension and alignment attributes (altimg-width
, altimg-height
and altimg-valign
) be used in conjunction with the altimg
attribute.
Although MathML is a core content type, it is required that you declare which XHTML pages have MathML in the OPF file, as shown below:
Declaring MathML content in the OPF file
< manifest > < item href = "mathml-style.css" id = "css1" media-type = "text/css" /> < item href = "mathml.xhtml" properties = "mathml" id = "page1" media-type = "application/xhtml+xml" /> < item href = "toc.ncx" id = "ncx" media-type = "application/x-dtbncx+xml" /> < item id = "toc" properties = "nav" href = "toc.xhtml" media-type = "application/xhtml+xml" /> </ manifest > |
http://www.w3.org/1998/Math/MathML
.
<?
xml
version
=
"1.0"
?>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
xmlns:epub
=
"http://www.idpf.org/2007/ops"
xmlns:m
=
"http://www.w3.org/1998/Math/MathML"
>
<
head
>
<
title
>Example of MathML in EPUB 3</
title
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"mathml-style.css"
/>
</
head
>
<
body
>
<
m:math
display
=
"block"
>
<
m:mrow
>
<
m:mi
>x</
m:mi
>
<
m:mo
>=</
m:mo
>
<
m:mfrac
>
<
m:mrow
>
<
m:mo
form
=
"prefix"
>-</
m:mo
>
<
m:mi
>b</
m:mi
>
<
m:mo
>±</
m:mo
>
<
m:msqrt
>
<
m:msup
>
<
m:mi
>b</
m:mi
>
<
m:mn
>2</
m:mn
>
</
m:msup
>
<
m:mo
>-</
m:mo
>
<
m:mn
>4</
m:mn
>
<
m:mo
></
m:mo
>
<
m:mi
>a</
m:mi
>
<
m:mo
></
m:mo
>
<
m:mi
>c</
m:mi
>
</
m:msqrt
>
</
m:mrow
>
<
m:mrow
>
<
m:mn
>2</
m:mn
>
<
m:mo
></
m:mo
>
<
m:mi
>a</
m:mi
>
</
m:mrow
>
</
m:mfrac
>
</
m:mrow
>
</
m:math
>
</
body
>
</
html
>
Comments
Post a Comment