Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
MathML
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Embedding MathML in HTML/XHTML files == MathML, being XML, can be embedded inside other XML files such as [[XHTML]] files using XML namespaces. <syntaxhighlight lang="html"> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Example of MathML embedded in an XHTML file</title> <meta name="description" content="Example of MathML embedded in an XHTML file"/> </head> <body> <h1>Example of MathML embedded in an XHTML file</h1> <p> The area of a circle is <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>π<!-- Ο --></mi> <mo>⁢<!-- ⁢ --></mo> <msup> <mi>r</mi> <mn>2</mn> </msup> </math>. </p> </body> </html> </syntaxhighlight> [[File:MathMLxhtml.png|thumb|435px|A rendering of the formula for a circle in MathML+XHTML using Firefox 22 on Mac OS X]] Inline MathML is also supported in [[HTML5]] files. There is no need to specify namespaces as there was in [[XHTML]]. {{clear}} <syntaxhighlight lang="html"> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of MathML embedded in an HTML5 file</title> </head> <body> <h1>Example of MathML embedded in an HTML5 file</h1> <p> The area of a circle is <math> <mi>π</mi> <mo>⁢</mo> <msup> <mi>r</mi> <mn>2</mn> </msup> </math>. </p> </body> </html> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)