] >
As explained in the section: An Introduction to Writing Websites, there is more than one way to write mathematics for the web.
Here, we will be writing Gloss to be converted into a language called Presentation MathML, shortened to pMathML. We could just as easily be writing to be converted into a different maths application, and for a comparison of the different methods and references to sites to learn more, please visit the section: Mathematics on the Web: A Comparison.
You must always enter math mode before trying to write maths. This is done by using the math tag, for example: math ...some maths...
.
By entering math mode, the glosser knows to convert the common maths symbols into the correct language for a pMathML interpreter to understand. I will not talk here about the object MathML code that is produced, instead I will explain how to write the correct code for your maths to be displayed on screen. This is because MathML is too complicated to be discussed here. Please see the section Mathematics on the Web: A Comparison for more information and links.
When in math mode the glosser expects you to write mathematics. An easy mistake to make is to write your maths in square brackets once in maths mode. This is incorrect because doing so would enter text mode within the math mode, and display your maths as text rather than pMathML.
When the glosser 'breaks' down your source code it knows to split up your document into 'tokens' by how the spaces split up your 'words'. Therefore it would not understand xy
as x times y, to do such an operation you would need to insert a space between the x and the y. It is good practice to insert spaces between all characters unless they are part of the same word, i.e. sin.
A list of common maths symbols is given in the section: List of Common Mathematics Symbols
I recommend playing with the following example and with the common symbols in order to get a grasp for writing pMathML with the Gloss language.
What follows is an example of using pMathML inside an XHTML document.
html { head { title [...] } body { ... math x + y math x - y math x y math mfrac x y ... } }
We have seen that pMathML is an XML application and must be used with XHTML. Some browsers will already know how to display pMathML, including Mozilla Firefox, but some do not. One that does not is Internet Explorer. A program called MathPlayer is needed to view pMathML in IE, and a little bit of code is added to your XHTML object code that tells IE where to find it. The code is as follows, but you do not need to explicitly write it, the glosser will add it for you.
<OBJECT ID="mathplayer" CLASSID="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"> <!--comment required to prevent this becoming an empty tag--></OBJECT>
This page is copyright. Web page design and creation by GLOSS.