首页 | 主题 | 图库 | 问答 | 文摘 | 原创 | 百科

历史 | 地理 | 人物 | 艺术 | 体育 | 科学 | 音乐 | 电影 | 信息技术 | 世界遗产

 开放、中立,源自维基百科

Personal tools

MathML

From Wikipedia, the free encyclopedia

Jump to: navigation, search
For help writing formulae in Wikipedia, please see Help:Formula.

Mathematical Markup Language (MathML) is an application of XML for describing mathematical notations and capturing both its structure and content. It aims at integrating mathematical formulae into World Wide Web documents. It is a recommendation of the W3C math working group.

Contents

History

The specification of version 1.01 of the format was released in July 1999 and version 2.0 appeared in February 2001. In October 2003, the second edition of MathML Version 2.0 was published as the final release by the W3C math working group. In June 2006 the W3C has rechartered the MathML Working Group to produce a MathML 3 Recommendation until February 2008.

MathML was originally designed before the finalization of XML namespaces. As such, MathML markup is often not namespaced, and applications that deal with MathML, such as the Mozilla browsers, do not require a namespace. For applications that wish to namespace MathML, the recommended namespace URI is http://www.w3.org/1998/Math/MathML.

Presentation and semantics

MathML deals not only with the presentation but also the meaning of formula components (the latter part of MathML is known as “Content MathML”). Because the meaning of the equation is preserved separate from the presentation, how the content is communicated can be left up to the user. For example, web pages with MathML embedded in them can be viewed as normal web pages with many browsers but visually impaired users can also have the same MathML read to them through the use of screen readers (e.g. using the MathPlayer plugin for Internet Explorer, Opera 9.50 build 9656+ or the Firevox extension for Firefox).

Example

The well-known quadratic formula:

Failed to parse (Missing texvc executable; please see math/README to configure.): x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}


would be marked up using LaTeX syntax like this:

<source lang="latex">x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}</source>

in troff/eqn like this:

x={-b +- sqrt{b sup 2 - 4ac}} over 2a

in OpenOffice.org Math like this (both are valid):

x={-b plusminus sqrt {b^2 - 4 ac}} over {2 a}
x={-b +- sqrt {b^2 - 4ac}} over 2a

The above equation could be represented in Presentation MathML as an expression tree made up from layout elements like mfrac or msqrt elements: <source lang="xml"> Failed to parse (Missing texvc executable; please see math/README to configure.): <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mrow> <mo>-</mo> <mi>b</mi> </mrow> <mo>&PlusMinus;</mo> <msqrt> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>-</mo> <mrow> <mn>4</mn> <mo>&InvisibleTimes;</mo> <mi>a</mi> <mo>&InvisibleTimes;</mo> <mi>c</mi> </mrow> </msqrt> </mrow> <mrow> <mn>2</mn> <mo>&InvisibleTimes;</mo> <mi>a</mi> </mrow> </mfrac>

</source> The <annotation> element can be used to embed a semantic annotation in non-XML format, for example to store the formula in the format used by an equation editor. Alternatively, the equation could be represented in Content MathML as an expression tree for the functional structure elements like apply (for function application) or eq (for the equality relation) elements: <source lang="xml"> Failed to parse (Missing texvc executable; please see math/README to configure.): <apply> <eq/> <ci>x</ci> <apply> <frac/> <apply> <csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus"> <mo>&PlusMinus;</mo> </csymbol> <apply> <minus/> <ci>b</ci> </apply> <apply> <power/> <apply> <minus/> <apply> <power/> <ci>b</ci> <cn>2</cn> </apply> <apply> <times/> <cn>4</cn> <ci>a</ci> <ci>c</ci> </apply> </apply> <cn>0.5</cn> </apply> </apply> <apply> <times/> <cn>2</cn> <ci>a</ci> </apply> </apply> </apply> <annotation encoding="TeX"> x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a} </annotation> <annotation encoding="StarMath 5.0"> x={-b plusminus sqrt {b^2 - 4 ac}} over {2 a} </annotation>

</source> In the expression tree above, elements like times are defined by the MathML specification and stand for mathematical functions that are applied to sibling expressions that are interpreted as arguments. The csymbol element is a generic extension element that means whatever is specified in the document referred to in the definitionURL attribute.

Although less compact than TeX, the XML structuring promises to make it widely usable and allows for instant display in applications such as Web browsers and facilitates a straightforward interpretation of its meaning in mathematical software products. MathML is not intended to be written or edited directly by humans.[1]

Software support

Editors

Some editors with native MathML support (including copy and paste of MathML) are Publicon from Wolfram Research and SciWriter from soft4science.

MathML is also supported by major office products such as OpenOffice.org, KOffice, and MS Office 2007, as well as by mathematical software products such as Mathematica and the Windows version of the Casio ClassPad 300. The W3C Browser/Editor Amaya can also be mentioned as a WYSIWYG MathML-as-is editor.

Conversion

Several utilities for converting mathematical expressions to MathML are available, including converters [1] between TeX and MathML. ConTeXt does the reverse and uses TeX for typesetting MathML (usually resulting in PDF documents). MathType from Design Science allows users to create equations in a WYSIWYG window and export them as MathML. Also, Wolfram Research provides a web page to convert typed mathematical expressions to MathML.

GNU TeXmacs is a what-you-see-is-what-you-get editor with extensive support for mathematics. Converters exist for presentation MathML in both directions. TeXmacs can be used to write mathematical articles which are exported to XHTML with embedded MathML. Another WYSIWYG MathML-as-is editor, Formulator MathML Weaver [2] provides a means for importing/exporting MathML with support for some abstract entities such as &ExponentialE; and &DifferentialD;.

Web browsers

Of the major web browsers, those that directly support the format are recent versions of Gecko browsers (e.g., Firefox and Camino)[3] For Gecko-based browsers, the user is currently required to download special fonts in order to display MathML correctly; this is likely to change soon with the release of the STIX fonts. Other browsers do not support the format, and require third-party plugins. For example, Opera currently supports MathML using a User JavaScript extension, though recent weekly builds have included MathML support without a plug-in. [4][5]

Web conversion

ASCIIMath [6] provides a JavaScript library to re-write a convenient Wiki-like text syntax used inline in web pages into MathML on the fly; it works in browsers with MathML support or plug-ins. LaTeXMathML [7] does the same for (a subset of) the standard LaTeX mathematical syntax.

Blahtex is a TeX-to-MathML converter intended for use with MediaWiki.

Equation Server for .NET from soft4science can be used on the server side (ASP.NET) for TeX-Math (Subset of LaTeX math syntax) to MathML conversion. It can also create bitmap images (Png, Jpg, Gif,...) from TeX-Math or MathML input.

Support of software developers

Support of MathML format accelerates software application development in such various topics, as computer-aided education (distance learning, electronic textbooks and other classroom materials); automated creation of attractive reports; computer algebra systems; authoring, training, publishing tools (both for web and desktop-oriented), and many other applications for mathematics, science, business, economics, etc. Several software vendors propose a component edition of their MathML editors, thus providing the easy way for software developers to insert mathematics rendering/editing/processing functionality in their applications. For example, Formulator ActiveX Control [8] from Hermitech Laboratory can be incorporated into an application as a MathML-as-is editor, Design Science propose a toolkit for building web pages that include interactive math (WebEQ™ Developers Suite, [9]).

Other standards

Another standard called OpenMath which has been designed (largely by the same people who devised Content MathML) more specifically for storing formulae semantically can also be used to complement MathML.

The OMDoc format has been created for markup of larger mathematical structures than formulae, from statements like definitions, theorems, proofs, or example, to theories and text books. Formulae in OMDoc documents can either be written in Content MathML or in OpenMath; for presentation, they are converted to Presentation MathML.

The Ecma Office Open XML (OOXML) standard defines an incompatible XML math syntax, derived from Microsoft Office products.

See also

References

  1. ^ Buswell, Steven; Devitt, Stan; Diaz, Angel; et al (7 July 1999). Mathematical Markup Language (MathML™) 1.01 Specification (Abstract). Retrieved on 26 September, 2006. “While MathML is human-readable it is anticipated that, in all but the simplest cases, authors will use equation editors, conversion programs, and other specialized software tools to generate MathML.”


External links

be-x-old:MathML

cs:Mathematical Markup Language de:Mathematical Markup Language es:MathML fr:MathML hr:MathML it:MathML hu:MathML nl:Mathematical Markup Language ja:Mathematical Markup Language pl:MathML pt:MathML ru:MathML fi:MathML sv:MathML th:MathML vi:MathML tr:MathML uk:MathML

Languages
AD Links