<< Chapter < Page Chapter >> Page >
A comprehensive explanation of the most commonly-used Content MathML tags. Provides an basic, step-by-step explanation as to how Content MathML expressions are built using these tags.

Let's take a close look at 2 2 4 expressed in Content MathML. From it, we can identify the most common tags used in C-MML expressions.

Writing 2 2 4 In content mathml


There are a few things you should note immediately about the code above. Every tag (or element , as they are formally known) is contained in brackets and begins with a "m:" to signify that it is a MathML tag. We say that this "m:" defines the namespace of the element. Namespaces are used in web markup languages to keep track of which language (such as XHTML or QML) is being "spoken." Also notice that the equation begins with the math element, which denotes the beginning of every MathML expression.

Like other web-based markup languages, MathML tags have corresponding end tags which mark the end of a section-- in this case, the end of an operation or modifier. Every end tag is essentially the same as it's start tag, but with a forward slash ("/") character in front of the name.

There are over a hundred different Content MathML tags, but only a few that are used in the majority of expressions. Remember, you can always refer to the W3C's Content MathML page to look up a tag if you can't remember it.

Tokens: cn, ci, and csymbol

Each number, variable, and symbol has to be explicitly marked up in a given MathML expression. There are three different elements used to mark up these operands.

  • cn
  • ci
  • csymbol


The cn element is used to denote an explicit number, as opposed to a variable or symbolic representation of a number. Values such as 1 , 5000 , and 3.14159 are all marked up with cn tags.

In our simple example, 2 2 4 , there are three numbers marked up with cn tags.

<m:math><m:apply><m:eq/><m:apply><m:plus/> <m:cn>2</m:cn><m:cn>2</m:cn> </m:apply> <m:cn>4</m:cn> </m:apply></m:math>


The ci element is used to markup variables. Any non-explicit representation of a number, such as X , F , or P 2 , is contained in a ci element.

If we wished to change our example expression into an algebraic relation, say x 2 4 , then we would only need to make one small change to the Content MathML markup.

<m:math><m:apply><m:eq/><m:apply><m:plus/> <m:ci>x</m:ci> <m:cn>2</m:cn></m:apply><m:cn>4</m:cn></m:apply></m:math>

While the csymbol is a valid Content MathML construct, its use is fairly uncommon and therefor it will not be discussed in this module.


Now that we understand how to markup operands, we need to know how to relate and operate upon them to form an expression. The most fundamental tag for writing Content MathML is the apply tag, which governs the way operations and modifiers are placed in the expression. Take another look at the example above , and you might notice that there are two apply tags. The apply tag is MathML's way of indicating that an operation or relation should be introduced.

The first child of an apply tag is the operation or relation we wish to implement. Colloquially, a child is any element directly within (or "under") an element.

<m:math><m:apply><m:eq/> <m:apply> <m:plus/> <m:cn>2</m:cn><m:cn>2</m:cn> </m:apply><m:cn>4</m:cn></m:apply></m:math>

In the code block above, the apply tag is highlighted in bold and the apply tag's first child element is italicized. The apply tag will always understand its first child to be the operation or relation. The operation in this case is plus (addition).

The second child of the apply tag is always the first element being acted upon. There may be even more children depending on what kind of operation is being applied. It wouldn't make any sense to apply sine to two numbers but it does make sense of apply addition to two numbers. For our example, there are two child elements after the plus tag, both of which are cn elements containing "2". So the instruction reads "apply addition to two and two," or 2 2

It can be difficult to understand the way that apply tags work since MathML doesn't "read" like a typical mathematical expression. Again, remember that Content MathML is focused on applying operations in order to convey semantics. If we were to simply transcribe our Content MathML example onto paper as operations and numbers, it would look something like this:

= ( + 2 2 ) ( 4 )

Equations written in this way are said to be in prefix notation (or Polish notation ). It's may seem very counter-intuitive, but computers handle this notation a lot faster than "normal" (or infix ) notation.

To expand our understanding of the apply tag in Content MathML, let's look at the topmost apply tag and its children.

<m:math> <m:apply> <m:eq/> <m:apply> <m:plus/><m:cn>2</m:cn><m:cn>2</m:cn></m:apply> <m:cn>4</m:cn> </m:apply></m:math>

The first child of apply is the eq element, which corresponds to equality ("="). The second child, however, is another apply tag. This means that everything inside this second apply tag is the first argument . The third direct child of the first apply tag is a cn containing the number 4. This means that "whatever is in the second apply tag is equal to four."

Relations and operators

Mathematical expressions usually involve at least one relation , such as equality ("=") or one number being greater than the other ("<" or ">"). Content MathML offers an extensive library of relational elements. The <eq/> relation is highlighted in our example expression below.

<m:math><m:apply> <m:eq/> <m:apply><m:plus/><m:cn>2</m:cn><m:cn>2</m:cn></m:apply><m:cn>4</m:cn></m:apply></m:math>

Notice that the <eq/> element does not have an end tag. This is because relations and operations are generally declared using an empty tag . It doesn't "contain" anything, so it simply terminates itself with a forward slash at the end of the element.

There are several commonly-used Content MathML relation elements. These include:

  • eq ( a b )
  • neq ( a b )
  • gt ( a b )
  • lt ( a b )
  • geq ( a b )
  • leq ( a b )

Similarly, we usually have at least one operator in a given mathematical expression. Some of the most common operators used in Content MathML include:

  • plus ( a b c )
  • minus ( a b c )
  • divide ( a b c )
  • times ( a b c )
  • power ( a b c )
  • root ( a b c )

Questions & Answers

anyone know any internet site where one can find nanotechnology papers?
Damian Reply
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
many many of nanotubes
what is the k.e before it land
what is the function of carbon nanotubes?
I'm interested in nanotube
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Connexions guide to mathml. OpenStax CNX. Aug 24, 2009 Download for free at http://cnx.org/content/col10963/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Connexions guide to mathml' conversation and receive update notifications?