17
MathML can be created and edited directly in the IGP:Writer interface. Tthere are multiple options for various format generation to compensate for the limitations of various reading systems. Modified: 14 December 2013
IGP:Writer has specific Content Blocks for MathML to allow it to be imported, inserted, edited and managed as both HTML5 Inline and Block MathML.
This assists the long-term management of Scientific, Technical, Mathematics and Education content that depend on MathML.
MathML blocks can be inserted as MathML inline or MathML in blocks. For example the MathML block can be inserted inside an equation-rw block.
MathML blocks are independent and present primarily as a processing target for ID generation, classification, image generation, extraction and reuse.
The MathML Editor allows ASCIIMath and MathML to be directly keyed or pasted into the interface. LaTeX is being evaluated for the near future.
If you have your MathML XML ready before creating a MathML block it must be available from a text file encoded as UTF-8.
IGP:Writer is an HTML5 framework. You do not need to enter namespace declarations in your MathML. This will be inserted by Formats On Demand packaging as and when required by various formats.
If you have MathML in your manuscript this can be imported depending on how it was produced.
There are two main tools used to produce MathML in MS Word documents: MathType and MathMagic. Libre Office equations can also be imported.
It is important that your MathML has the display property set correctly (IE. <math display="block"> or <math display="inline">.
If the imported MathML has no display property it will be treated as a block by default. This means any inline equations will appear in the wrong position and may have to be repositions and have the block-type changed. This can be done using the MathML Editor and manually inserting the display="inline property.
We do not currently have a process for importing MathML from a Wordprocessor file created with MathMagic.
If your manuscript has MathML created using the standard Libre Office equation editor they can be exported to XHTML and imported directly into Writer with the MathML included.
The Maths editor in Libre Office also does not have the option to set the MathML display property to inline or block. Therefore the importer is guessing on the correct display value based on parent elements. There is a possibility of errors depending on the complexity of your MathML layout.
Because the Libre Office generated MathML inserts blocks into a paragraph the processor interpretes a single MathML block in a <p> with no other blocks or styles as a block equation.
Many browsers and reading systems do not support MathML either at all or well. In these cases you may need to convert MathML to images for the final format.
The MathML to image processor available that will convert all MathML to SVG, PNG and JPG images at internet resolution, and PNG at print resolution.
When you select your format packaging options the image substitution model can be selected.
Because MathML documents can contain very large numbers of equations and it takes significant time to generate the images from the MathML this is a stand-alone interface and should be done once before format generation. The format packagers expect images to be available.
To generate MathML images from MathML.
You can control the size of the images generated by the image processor.
In the Print and Reader CSS F01 Galley the following processing instruction block is available.
The SVG is generated at the galley font-size applied in the document.
By default the print images are generated as PNGs with background transparency and 300dpi resolution. If you want to increase the size of the images change the default size to your target size.
/* DOCUMENT CALCULATION OF MathML starts */ #mathml-image-inline { font-size: 12pt; } #mathml-image-block { font-size: 12pt; } /* DOCUMENT CALCULATION OF MathML ends */
/* DOCUMENT CALCULATION OF MathML starts */ #mathml-image-inline { font-size: 1em; } #mathml-image-block { font-size: 1em; } /* DOCUMENT CALCULATION OF MathML ends */
There is some advantage creating MathML images that are 2X larger than the default font size so in reading systems where the user can enlarge the font the presentation quality is maintained. In this case change the 1em statements to 2em and the image generator will create the images accordingly.
If you have a book or document containing a lot of MathML you can use the Statistics Report to generate counts of inline and bock equations.
Statistics Reports can be generated from the Book Toolbar in the Management Interface (click the Stats option), or from the document toolbar in IGP:Writer.
The HTML5 specification has made MathML a first level element group without the requirement for namespaces. This is carried forward in IGP:FoundationXHTML.
The preferred method for inserting MathML into IGP:FoundationXHTML is as a simple element with no name-space declarations in a defined mathml-rw element.
<span class="mathml-rw" ><math display="inline"> .... </math></span>
<div class="mathml-rw" ><math display="block"> .... </math></div>
See the IGP:FoundationXHTML specification for more information on the purpose of these tagging patterns.
If delivery formats require namespaces (such as XHTML5 for ePub3) the Formats On Demand processor will insert the required statements to ensure the final package is valid for any specific format.
For more background information and tutorials on the MathML production issues see these links.