ASCIIMathML.js: Extending the symbol table

The standard symbol table of ASCIIMathML.js does not contain many symbols. It can be extended by adding additional symbols on any webpage that requires them. This is done by adding a few lines of JavaScript code.

For example, suppose we want to add symbols for "not less or equal" and "not greater or equal".

We first have to find the four-digit hexadecimal Unicode value for these symbols by looking them up at, say, http://www.w3.org/TR/MathML2/chapter6.html#chars.entity.tables

Next we have to decide what input strings we want to associate with these symbols, say "!<=" and "!>=".

Finally we add the following lines to the head or body of our HTML file:

<script type="text/javascript">
define("!<=","\u2270")
define("!>=","\u2271")
</script>

Here we test the modified symbol table: \`a !<= b !>= c\` produces `a !<= b !>= c`

To add a symbol to the LaTeX commands, use the same syntax (but with commands that start with a \):

<script type="text/javascript">
define("\\nle","\u2270")
define("\\nge","\u2271")
</script>

Now \$a \nle b \nge c\$ produces $a \nle b \nge c$.


If you know the numeric entity reference of the symbol you want to use on an ASCIIMathML webpage, you can also refer to the symbol directly by using that reference. E.g \`&#x2270;\` produces `≰`. If a symbol is only used occasionally, this is certainly the simplest way to include it.