<< Chapter < Page Chapter >> Page >

The ci elements have a type attribute which can be used to provide more information about the content ofthe element. For example, you can declare the contents of a ci tag to be a function ( type='fn' ), or a vector ( type='vector' ), or a complex number ( type='complex' ), as well as any number of other things. Using the type attribute helps encode themeaning of the math that you are writing.

Functions and operators

In order to apply a function to a variable, make the function the first argument of an apply. The secondargument will be the variable. For example, you would use the following code to encode the meaning, "the function f of x ". (Note that you have to include the attribute type='fn' on the ci tag denoting f .) <m:math> <m:apply> <m:ci type='fn'>f</m:ci> <m:ci>x</m:ci> </m:apply> </m:math> This will display as f x .

There are also pre-defined functions and operators in Content MathML. For example, sine and cosine arepredefined. These predefined functions and operators are all empty tags and they directly follow the apply tag. "The sine of x " is similar to the example above. <m:math> <m:apply> <m:sin/> <m:ci>x</m:ci> </m:apply> </m:math> This will display as x .

You can find a more thorough description of the different predefined functions in Chapter 4 of the MathML specification.

In addition to the predefined functions, there are also many predefined operators. A few of these are plus (for addition), minus (for subtraction), times (for multiplication), divide (for division), power (for taking the n th-power of something), and root (for taking the n th-root of something).

Most operators expect a specific number of child tags. For example, the power operator expects two children. The firstchild is the base and the second is the value in the exponent. However, there are other tags which can take manychildren. For example, the plus operator merely expects one or more children. It will add together all of its childrenwhether there are two or five. This is referred to as an n-ary operator .

Representing "the negative of a variable" and explicitly representing "the positive of a variable or number" hasslightly unusual syntax. In this case you apply the plus or minus operator to the variable or number, etc., in question.The following is the code for "negative x ." <m:math> <m:apply> <m:minus/> <m:ci>x</m:ci> </m:apply> </m:math> This will display as x .

In contrast to representing the negative of a variable, the negative of a number may be coded as follows: <m:math><m:cn>-1</m:cn></m:math> This will display as -1 .

To create more complicated expressions, you can nest these bits of apply code within each other. You can createarbitrarily complex expressions this way. " a times the quantity b plus c " would be written as follows. <m:math> <m:apply> <m:times/> <m:ci>a</m:ci> <m:apply> <m:plus/> <m:ci>b</m:ci> <m:ci>c</m:ci> </m:apply> </m:apply> </m:math> This will display as a b c .

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Cnxml tutorial. OpenStax CNX. Jul 08, 2009 Download for free at http://cnx.org/content/col10121/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Cnxml tutorial' conversation and receive update notifications?

Ask