<< Chapter < Page Chapter >> Page >

2: Use the name reference known as “entity reference”. Encode the entity reference preceded by "&" and ending with semicolon “;”. For example, we would encode entity reference “beta” as "&beta;" to represent “β”.

3: Use the corresponding Unicode numeric hexadecimal reference. For example, beta is encoded with its hexadecimal numeric reference "U003B2" as "&x003B2;" to represent “β”.

It is evident that keyboard typing is the easiest option. The difficulty is that keyboard supports only a limited numbers of characters. We can type ASCII characters holding “Alt” key and typing numbers from the numeric key pad on the right side of the keyboard. However, this approach is not very helpful as we have no clue of the visual form of the character corresponding to a number.

The best approach for encoding Unicode characters is to create a XML file with extension "xml" in the desktop Word program as instructed earlier in the course. Then, select top level “Insert” menu of the MS Word program and choose “Symbol”.

Inserting symbols

A “symbol” dialog box appears as shown below. It is important that we select the option “normal text” from the “Font” drop down list. Keep selecting and inserting the characters not available on the keyboard, but useful for our application as we forsee. Save the "xml" file under some meaningful name like "unicide characters" and reference the special characters as when required from the file.

Inserting symbols

This technique serves a great part of requirement, but for the characters which do not have visual forms like “ThickSpace”, “ApplyFunction”, “nbsp” etc., which are called ”invisible” characters. But these invisible characters are few in numbers. As such,we can store their entity reference names for easy reference as and when required.

The second approach of using entity reference like "&beta;" is the second best approach as the names suggest the visual forms for many important characters. The third alternative to use Unicode numeric reference in the form "&x003B2;" is not desirable for those who intend to code MathML. Ofcourse, this could be the best approach for software developers – probably a numeric representation would be easier to handle in the programming algorithm.

A list of entity reference along with its display form is presented in the Appendix. The listing is divided in three modules (A to H) , (I to Q) and (R to Z) to accommodate about 900 Unicode characters. You may choose to visit these pages to have a first hand experience of what these characters look like and how they are named.

The example given here demonstrates character rendering, using each of the encoding techniques discussed above.

Display using unicode hexadecimal number

<m:math display="block"> <m:mtext>Alpha is displayed as : </m:mtext> <m:mi> α</m:mi> <m:mi> &alpha; </m:mi> <m:mi> &#x003B1;</m:mi> </m:math>

Save the file after editing as “test.xml”. The display looks like :

Alpha is displayed as : α α α

Some characters falling under “operator” category, beside dpsce rendering characters, do not have visual display. They are called non-marking characters and are used with “mo” element. These characters are important for the quality of print or alternative rendering like audio rendering. They provide specific and consistent spacing on the operand on which they act, thus distinguishing the mathematical operation from normal character rendering. The non-marking operator are :

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A primer in mathml. OpenStax CNX. Apr 19, 2006 Download for free at http://cnx.org/content/col10345/1.16
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A primer in mathml' conversation and receive update notifications?

Ask