How to create web pages using mathematical expressions – introduction to MathML Radoslaw Jedynak, PhD Poland, Technical University of Radom Faculty of Teacher Training Department of Mathematics jedynakr@pr.radom.pl
Basic Methods of Displaying Mathematics on the Web 1. Images - typically graphic formats are GIF or JPEG We can insert an image in HTML document writing command: <img src= ”file.ext”> This solution has some limitations: poor quality of the images (resolution 72 or 96 dpi) equations displayed as images cannot be fully integrated with the surrounding text - web page has long download times
Basic Methods of Displaying Mathematics on the Web 2. PDF Files We can insert a PDF file in HTML document writing command <a href=”file.pdf”>. These files have high quality for viewing and printing. The solution has some limitations: - the display of PDF files requires a special viewer application like Acrobat Reader - PDF files cannot be well integrated with the Web environment
Basic Methods of Displaying Mathematics on the Web 3. Other simple solutions of displaying mathematical content on the Web HTML commands <sup> - superscripts and <sub> subscripts such as x<sup>3</sup>+ y<sub>i</sub>+ z<sup>j</sup> for x3 + yi+zj. 1 ASCII charts, such as --------------- 1 + x + y
Basic Methods of Displaying Mathematics on the Web 4 MathML Mathematical Markup Language (MathML) is an XML application for describing mathematical formulas on the Web. The first specification of the standard MathML was published by W3C in 1998 . MathML 2.0 was published in October 2003. Math Working Group works over recommendation MathML 3.0 at present.
Introduction to MathML language It is possible to encode mathematical expressions in MathML language with two kinds of markups: - Presentation Markup Content Markup Presentation MathML focuses on the display of an equation but the content MathML focuses on the semantic meaning of the expression.
Presentation Markup MathML Presentation Markup has about 30 elements and 50 attributes. All elements begin with letter m.Example of Presentation Markup encodes x + y : <math> - element is required for any piece of MathML <mrow> - expression is displayed in a horizontal row <mi>x</mi> - identifier (variable) <mo>+</mo> - operator <mi>y</mi> </mrow> </math> http://www.w3.org/TR/MathML/chapter3.html
Content Markup MathML Content Markup consists of about 150 elements and 12 attributes. Example of Content Markup encodes x + y : <math> <apply> - element is used to apply operators or functions to expressions <plus/> - operator <ci>x</ci> - identifier (variable) <ci>y</ci> </apply> </math> http://www.w3.org/TR/MathML/chapter4.html
Comparison Content Markup and Presentation Markup MathML Presentation Markup MathML Content Markup
Presentation Markup - examples Fraction Square Root Superscript
Presentation Markup - example
Presentation Markup - example A <mfrac> element may only have exactly two child element A <mrow> element has to be used as a wrapper element
Native MathML Support: MathML on the Web Browser Statistics: Native MathML Support: Mozilla 1.0 ~10 % Mozilla MathML Plugin: Internet Explorer MathPlayer ( IE 5.5) Integre techexplorer ~ 85 %
Universal MathML Stylesheet MathML on the Web XHTML 1.1 + MathML 2.0 www.w3.org/Math Universal MathML Stylesheet (XSLT Stylesheet) Plugin Code Required MIME Type: HTML Only Presentation Markup MIME Type: XML IE + MathPlayer IE + techexplorer Mozilla
MathML on the Web ( XHTML +MathML ) XML Declaration
MathML on the Web ( XHTML +MathML ) Universal MathML Stylesheet
MathML on the Web ( XHTML +MathML ) Document Type Declaration
MathML on the Web ( XHTML +MathML ) XHTML Namespace MathML Namespace
Interpretation of example of MathML Presentation Markup by a) Mozilla Firefox, b) Amaya
Tips for Internet Explorer If we want to display correctly this example in Internet Explorer we have to download the following files: mathml.xsl - from http://www.w3.org/Math/XSL/mathml.xsl ctop.xsl - from http://www.w3.org/Math/XSL/ctop.xsl pmathml.xsl - from http://www.w3.org/Math/XSL/pmathml.xsl pmathmlcss.xsl – from http://www.w3.org/Math/XSL/pmathmlcss.xsl xhtml-math11-f.dtd – from http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd and save for example in the folder which includes the files with MathML code.
Authoring and Editing MathML We can find the list of recommended software tools supporting MathML on the Web of W3C Math Consortium. http://www.w3.org/Math/Software/.
DragMath editor DragMath is an open-source equation editor written in Java. This editor can be simply run within a web browser as a Java applet. We can build up mathematical expressions in a traditional two dimensional way because DragMath is "drag and drop" editor . http://www.dragmath.bham.ac.uk/demo.html
WIRIS editor WIRIS Editor is WYSIWYG editor for maths expressions. The editor is based on Java technology which allows it to be supported by any Web browser and any Operating System. We can also create mathematical expression on the producer Web http://www.wiris.com/demo/mmleditor/
Thank you for your attention