Skip to content

Rhaptos Software Development

Personal tools
You are here: Home » Documentation » Architecture » Component Design » MathML » AllisonsNotes
Views

AllisonsNotes

Document Actions
last edited 1 year ago by jenn

Old content from Allison. May be out of date.

Rules for Content MathML

There are a few simple rules that you should follow when using Content MathML. They will make your life easier (I promise):

  1. The spec is your friend. The Content MathML spec is a great resource. There are many examples on there that demonstrate good MathML. Since it is large, a great way to look through it is to use the browser's find in page function. Also, section 4.4 of the spec has a list of ALL of the content MathML tags. 2. Test your code. Don't just assume that MathML will print if it displays correctly online. Maybe after you've done a few modules go back and check and make sure that they print correctly. If they don't it's most likely some incorrect MathML. 3. ASK! If you are unsure about how to markup some math, go ahead and ask. It's better to get it correct the first time then just put something together that will cause problems later. The online display is much more lenient in the MathML it will take. The printing will take ONLY absolutely 100% correct MathML.

Best Practices for Content MathML There are many common errors made when using Content MathML. Read this so that you don't make them! Subscripts - Write a subscripted symbol as:

X 0

  • This will display as: X 0
    • Common errors for subscriptsforgetting to wrap the entire thing in a * incorrectly using * using content elements inside the , only use mi for symbols and mn for numbers inside of a

Constants Content MathML has several tags for mathematical constants such as:

  • for (or j) * for * for

Use them. Entities Use the entity descriptive names rather than the Unicode numbers. Such as Σ rather than σ Here is a list of the descriptive names. Don't use MathML to get a single Greek letter, unless you really want it to be displayed as a mathematical value. Just use Unicode instead. Operators that don't exist in Content MathML There are several inline operators that do not have a MathML content tag. Much greater than and plus-minus are two examples. To use these in Content MathML use the following:

x 0

Note that the presentation tag is used to indicate that this is an operatore. This will display as: ยป x 0 Functions Don't use . Instead put the attribute type="fn" on your ci. For the function f x 3 x :

< !-- expression one --> f x < -- expression two --> 3 x

Miscellaneous

  • Everything in Content MathML, except individual digits in a number, should have a tag around it. Do NOT just wrap some expression in a . For example if you have xyz, this is x times y times z, where x, y and z are . NOT xyz * Don't use around a single content item