Meet the MathML language

Η MathML is a markup language that can be used to display math performances on your web pages. It is especially useful when you want to show more than a simple mathematical symbolism on your web pages, and is very easy to use because of its simplicity and similarity to HTML.

mathml logo

Η MathML has two kinds of signage, presentation (for layout) and content (meaningful). Since of the browsers are only supported by the presentation, this is the only kind of markup that can be used with HTML. You can also use MathML in CSS and JavaScript just like you would in HTML.

Understanding MathML

There is a list of them commands of MathML on the Mozilla Developer website. You will find a list of commands at the end of this article.

The basic command with which your browser understands that MathML programming begins is . So when writing MathML code in HTML, remember to put it inside labels.

The basic commands are , , , and represent an identifier, operator, number and string respectively. Note that all MathML statements below start with the letter "m".

Let's look at some simple examples.

Exponential Number (or number in N force)

The corresponding command for the display of the exponent is . H is the equivalent for an index.

n 7

It will give us the form:

1

Show fractions

7 26

It will give us the form:

ex2

Show integer root

Here's another simple example for displaying mathematical functions.

- 678 5

It will give us the shape

: ex3

For square root only there is the ready command .

How to display Matrix

Now let's move on to more complex representations, let's show a matrix.
To build a table, we need to have a table structure for rows and columns. For this purpose, we use the commands , and .

Apart from that, we will also use the tag to add the symbols [and] around the matrix, and finally we put them all in the command .

Here is the final result:

[ 0 4 10 5 2 X 9 11 1 ]

Also see that we played a bit with CSS so we can make red "X" to stand out in the womb.

mi {color: red; }

In the end you will get the shape

: ex4

How to display equations

We think we can go one step further, to more advanced examples, so let's make a complex equation. In our example we will make an integral (those who do not know what an integral is wait until the 3rd Lyceum). The corresponding command here is <mmultiscripts>
ex5

As with HTML, MathML also has special characters and symbols, one of which is used in the example to show the Greek symbol φ. Here is the code to display the above integral:

f ( x ) = ∫ a b K ( x , t ) Phi ( t ) d t

 

For a list of symbols and special characters of MathML you can find it in W3C website.

MathML Features

In addition to features that are the same as HTML (like id), MathML also has a number of its own features. OR Mozilla Developer Website has a collection of MathML features. For extra knowledge, you can use the JavaScript library  MathJax. If you need more tools, check this link too here.

All of the above examples can be seen again below. Try the HTML, CSS, and Result Switches:

 

iGuRu.gr The Best Technology Site in Greecegns

every publication, directly to your inbox

Join the 2.110 registrants.

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).