Skip to main content

MathPage MathML Targets

Introduction

The Export to MathPage feature has the following pre-defined MathML targets:

  1. HTML5+MathML

  2. HTML+MathJax

  3. XHTML+MathJax

  4. XHTML+MathML

  5. MathPlayer (IE behavior) [Windows only]

  6. UMSS (Universal MathML Style Sheet)

On Windows, these targets are defined in the registry under the following keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets HKEY_LOCAL_MATHINE\SOFTWARE\WOW6432Node\Wiris\MathMLTargets

The latter location is not present in 32-bit versions of Windows.

On the Mac, the targets are stored in the file MathPageTargets.ini in the MathPage folder under the MathType folder.

Predefined Targets

Windows

If using 64-bit Windows, create identical keys in

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Wiris\DSMT6\MathMLTargets\

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target0]
@="HTML5+MathML"
"Desc"="HTML5 document with embedded MathML (must have a MathML-capable browser)."
"Translator"="MathML2 (namespace attr).tdl"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="all"
"XHTML"="1"
"MinWordVer"="12"
"TranslOptions"="2"
"ValidExtensions"=".htm;.html"
"RemoveIEComments"="1"
"XMLHeader"="<!DOCTYPE html>
n"
"HTMLHeadStart"="
n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\" />"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target1]
@="HTML+MathJax"
"Desc"="HTML document with embedded MathML to be rendered by MathJax (works in all browsers)."
"Translator"="MathML2 (namespace attr).tdl"
"XMLHeader"="<!DOCTYPE html>
n"
"HTMLAttrs"="
nxmlns:m=\"http://www.w3.org/1998/Math/MathML\""
"HTMLHeadStart"="
n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->
n"
"HEADCode"="
n<style>
nannotation { display:none }
n</style>
n<script type=\"text/javascript\"
n   src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_HTMLorMML\">
n</script>
n"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="all"
"XHTML"="0"
"MinWordVer"="12"
"TranslOptions"="2"
"ValidExtensions"=".htm;.html"
"RemoveIEComments"="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target2]
@="XHTML+MathJax"
"Desc"="XHTML document with embedded MathML to be rendered by MathJax (works in all browsers)."
"Translator"="MathML2 (m namespace).tdl"
"XMLHeader"="<?xml version=\"1.0\" ?>
n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\" [<!ENTITY mathml \"http://www.w3.org/1998/Math/MathML\">]>
n"
"HTMLAttrs"="
nxmlns:m=\"http://www.w3.org/1998/Math/MathML\""
"HTMLHeadStart"="
n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->
n"
"HEADCode"="
n<style>
nannotation { display:none }
n</style>
n<script type=\"text/javascript\"
n   src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_HTMLorMML\">
n</script>
n"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="all"
"XHTML"="1"
"MinWordVer"="12"
"TranslOptions"="2"
"ValidExtensions"=".xht;.xhtml;"
"RemoveIEComments"="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target3]
@="XHTML+MathML"
"Desc"="XHTML document with embedded MathML for MathML-enabled browsers."
"Translator"="MathML2 (m namespace).tdl"
"XMLHeader"="<?xml version=\"1.0\" ?>
n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\" [<!ENTITY mathml \"http://www.w3.org/1998/Math/MathML\">]>
n"
"HTMLAttrs"="
nxmlns:m=\"http://www.w3.org/1998/Math/MathML\""
"HTMLHeadStart"="
n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\" />
n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->
n"
"HEADCode"="
n<style>
nannotation { display:none }
n</style>
n"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="all"
"XHTML"="1"
"MinWordVer"="12"
"TranslOptions"="2"
"ValidExtensions"=".xht;.xhtml;.xml"
"RemoveIEComments"="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target4]
@="MathPlayer (IE behavior)"
"Desc"="Uses MathPlayer as an IE behavior on Windows IE only."
"Translator"="MathML2 (m namespace).tdl"
"HTMLAttrs"="
nxmlns:m=\"http://www.w3.org/1998/Math/MathML\""
"HTMLHeadStart"="
n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\" />
n<meta http-equiv=\"X-UA-Compatible\" content=\"requiresActiveX=true\" />
n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->
n"
"HEADCode"="
n<object id=\"MathPlayer\" classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>
n<?import namespace=\"m\" implementation=\"#MathPlayer\" ?>
n<script language=\"javascript\">
n<!--
nfunction IsMPInstalled()
n{
n  try {
n    var oMP = new ActiveXObject(\"MathPlayer.Factory.1\");
n    return true;
n  }
n  catch(e) {
n    return false;
n  }
n}
nfunction IsIE6LaterWindows()
n{
n  var pos=navigator.appVersion.indexOf(\"MSIE \")+5;
n  return( navigator.appName==\"Microsoft Internet Explorer\" && navigator.platform==\"Win32\" && parseFloat(navigator.appVersion.substr(pos))>=\"6.0\");
n}
nif( IsIE6LaterWindows() ) {
n  if( ! IsMPInstalled() ) {
n    if( confirm(\"This page requires Wiris's MathPlayer to display equations and symbols.

nMathPlayer is not currently installed, so equations and symbols will not display properly.

n

nWould you like to download and install MathPlayer now?\") )
n      window.open(\"http://www.dessci.com/webmath/mathplayer\", \"MPDownload\");
n  }
n}
nelse {
n  alert(\"This page uses Wiris's MathPlayer to display equations and symbols,

nand requires Microsoft Internet Explorer 6.0 or later on Windows.

n

nAs you are using a different browser, equations and symbols will not display properly.\");
n}
n-->
n</script>
n"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="winie"
"TranslOptions"="2"
"ValidExtensions"=".htm;.html;.shtm;.shtml;.stm"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets\Target5]
@="Multi-browser (UMSS)"
"Desc"="XHTML document with embedded MathML for all browsers using the Universal MathML Style Sheet (UMSS)."
"Translator"="MathML2 (m namespace).tdl"
"XMLHeader"="<?xml-stylesheet type=\"text/xsl\" href=\"pmathml.xsl\"?>
n"
"SupportingFiles"="[DOCDIR]pmathml.xsl;[DOCDIR]pmathmlcss.xsl"
"HTMLAttrs"="
nxmlns:m=\"http://www.w3.org/1998/Math/MathML\""
"HTMLHeadStart"="
n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\" />
n<meta http-equiv=\"X-UA-Compatible\" content=\"requiresActiveX=true\" />
n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->
n"
"MathAttrs"="style='background-color:#[BGCOLOR]'"
"MathMLSymbols"="1"
"TargetBrowser"="all"
"XHTML"="1"
"MinWordVer"="12"
"ValidExtensions"=".xht;.xhtml;.xml"
"ConvertNamedEntities"="1"
"ConvertPlane1Entities"="1"
"RemoveIEComments"="1"
"TranslOptions"="2"

Mac

!DSREG 1.0 {
    Targets {
        Target0 {
            Name=HTML5+MathML
            Desc=HTML5 document with embedded MathML (must have a MathML-capable browser).
            Translator=MathML2 (namespace attr).tdl
            XMLHeader=<!DOCTYPE html>\n
            HEADCode=\n<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
            MathAttrs=style='background-color:#[BGCOLOR]'
            MathMLSymbols=1
            TargetBrowser=all
            XHTML=1
            MinWordVer=12
            TranslOptions=2
            ValidExtensions=.htm;.html
            RemoveIEComments=1
        }
        Target1 {
            Name=HTML+MathJax
            Desc=HTML document with embedded MathML to be rendered by MathJax (works in all browsers).
            Translator=MathML2 (namespace attr).tdl
            XMLHeader=<!DOCTYPE html>\n
            HTMLAttrs=\nxmlns:m="http://www.w3.org/1998/Math/MathML"
            HTMLHeadStart=\n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->\n
            HEADCode=\n<style>\nannotation { display:none }\n</style>\n<script type="text/javascript"\n   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_HTMLorMML">\n</script>\n
            MathAttrs=style='background-color:#[BGCOLOR]'
            MathMLSymbols=1
            TargetBrowser=all
            XHTML=0
            MinWordVer=12
            TranslOptions=2
            ValidExtensions=.htm;.html
            RemoveIEComments=1
        }
        Target2 {
            Name=XHTML+MathJax
            Desc=XHTML document with embedded MathML to be rendered by MathJax (works in all browsers).
            Translator=MathML2 (namespace attr).tdl
            XMLHeader=<?xml version="1.0" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">]>\n
            HTMLAttrs=\nxmlns:m="http://www.w3.org/1998/Math/MathML"
            HTMLHeadStart=\n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->\n
            HEADCode=\n<style>\nannotation { display:none }\n</style>\n<script type="text/javascript"\n   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_HTMLorMML">\n</script>\n
            MathAttrs=style='background-color:#[BGCOLOR]'
            MathMLSymbols=1
            TargetBrowser=all
            XHTML=0
            MinWordVer=12
            TranslOptions=2
            ValidExtensions=.xht;.xhtml
            RemoveIEComments=1
        }
        Target3 {
            Name=XHTML+MathML
            Desc=XHTML document with embedded MathML for MathML-enabled browsers.
            Translator=MathML2 (m namespace).tdl
            XMLHeader=<?xml version="1.0" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">]>\n
            HTMLAttrs=\nxmlns:m="http://www.w3.org/1998/Math/MathML"
            HTMLHeadStart=\n<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >\n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->\n
            HEADCode=\n<style>\nannotation { display:none }\n</style>\n
            MathAttrs=style='background-color:#[BGCOLOR]'
            MathMLSymbols=1
            TargetBrowser=all
            XHTML=1
            MinWordVer=12
            TranslOptions=2
            ValidExtensions=.xht;.xml;.xhtml
            RemoveIEComments=1
        }
        Target4 {
            Name=Multi-browser (UMSS)
            Desc=XHTML document with embedded MathML for all browsers using the Universal MathML Style Sheet (UMSS).
            Translator=MathML2 (m namespace).tdl
            XMLHeader=<?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>\n
            SupportingFiles=[DOCDIR]pmathml.xsl;[DOCDIR]pmathmlcss.xsl
            HTMLAttrs=\nxmlns:m="http://www.w3.org/1998/Math/MathML"
            HTMLHeadStart=\n<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >\n<!-- saved from url=(0014)about:internet --><!-- MSIE Mark of the Web -->\n
            MathAttrs=style='background-color:#[BGCOLOR]'
            MathMLSymbols=1
            TargetBrowser=all
            XHTML=1
            MinWordVer=12
            ValidExtensions=.xht;.xml;.xhtml
            ConvertNamedEntities=1
            ConvertPlane1Entities=1
            RemoveIEComments=1
            TranslOptions=2
        }
    }
}

Defining a New MathML Target

Windows

  1. Run REGEDIT

  2. Open the key My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wiris\DSMT6\MathMLTargets

  3. Note the next available target. MathPage is delivered with Target0 thru Target4 predefined, so the next available target will usually be Target5.

  4. Select Edit->New->Key and type in the name of the target, e.g. Target5.

  5. Double-click on the (Default) string value and enter a description for your MathML target, e.g. "My MathML Target". This description will display in the drop-down menu in MathPage.

  6. Add additional string values as needed from the target attributes listed below.

Mac

  1. Open the file MathPageUserSettings.ini which is located in the MathPage folder under the MathType folder.

  2. Remove the semicolons from the beginning of the lines between "Targets {" and its matching closing brace.

  3. Add target attributes using the information below. Your target (e.g. Target2) should look similar to the default targets shown above from MathPageTargets.ini

Target Attributes

Required Values

Each target must always contain the following attributes:

  • Desc - a description of your MathML target that will display in the Export To MathPage dialog.

  • Translator - the MathML translator file that you wish to use, e.g. MathML2 (m namespace).tdl.

Optional Values

The following attributes are optional depending on the needs of your target:

  • HTMLAttrs - any extra attributes required by the MathML renderer to be placed on the <HTML> tag are defined here, e.g. the definition of the "m:" namespace.

  • MathAttrs - any addition attributes required by the MathML renderer to be placed on each <math> tag is defined here, e.g. display='block'.

  • HEADCode - any extra HTML required by the MathML renderer to be placed in the <HEAD> of the document is defined here, e.g. an <OBJECT> tag or a <SCRIPT> block.

  • HTMLHeadStart - any HTML code that needs to go at the start of the HTML <head> tag

  • MathMLWrapper - any extra HTML required by the MathML renderer to be placed around each <math> snippet generated by the translator is defined here, e.g. an <APPLET> or <OBJECT> tag. Any of the following strings appearing in MathMLWrapper will be replaced with values calculated for each equation:

    • [WIDTH] an estimated width in pixels of the equation at 96dpi.

    • [HEIGHT] an estimated height in pixels of the equation at 96dpi.

    • [MATHML] the MathML generated by the translator.

    • [MATHML_JS_STRING] the MathML generated by the translator in the form of a legal JavaScript string, e.g. newlines are escaped.

    • [MML_DIMS] the estimated dimensions of the equation in the form of a JavaScript array containing the width, height, baseline, left side bearing, and right side bearing.

    • [FONTSIZE] the font size that the renderer should use when displaying the MathML.

    • [BGCOLOR] the background color to display behind the equation.

    • [ID] a unique ID generated for each equation, e.g. eq0001.

  • WidthPct - the percentage of adjustment to make to the estimated [WIDTH] value calculated for each equation and substituted in MathMLWrapper.

  • HeightPct - the percentage of adjustment to make to the estimated [HEIGHT] value calculated for each equation and substituted in MathMLWrapper.

  • TargetBrowser - set to 'winie' or 'all' to restrict the MathPage dialog to a specific setting; leave this string value undefined to allow the user to select the target browser.

    • "winie" generates HTML specifically targeting Windows IE5 or later only.

    • "all" generates HTML compatible with all browsers.

  • MathMLSymbols - handles symbol characters that would normally be turned into GIFs. This applies mainly to pages generated for all browsers, since IE5 mode does not require GIFs for most symbols.

    • "1" symbol characters that would normally convert to GIFS are converted to MathML via the translator.

    • "0" symbol characters are handled in the normal fashion, i.e. in HTML or as GIFs. (default)

  • MinWordVer - the minimum Word version required to use this translator. For example, Word97 does not support generation of XHTML documents, so MinWordVer would be set to "9" i.e. Word 2000.

  • XHTML - controls generation of HTML or XHTML document

    • "1" generates an XHTML document

    • "0" generates an HTML document (default)

  • XMLHeader - specify content to be written at the top of the document (when XHTML=1)

For example, an xml or xml-stylesheet tag can be written, as in the Universal Style Sheet target.

  • SupportingFiles - semicolon-delimited list of supporting files to be copied from the MathPage directory in the MathType folder.

You can specify either [DOCDIR] to copy to the document directory or [SUPPDIR] to copy to the supporting files folder. For example, "[DOCDIR]mathpage.js;[SUPPDIR]empty.gif" copies mathpage.js to the same directory as the document, and copies empty.gif to the supporting files folder (e.g. myDocument_files)

  • ValidExtensions - semicolon-delimited list of file extensions that are allowed for the generated document

The first item in the list is the default used in the MathPage dialog, e.g. ".xml;.xhtml" will default to .xml but will also permit .xhtml.

  • ConvertNamedEntities - converts named entities to numeric. This option helps to eliminate the need for a DTD to be specified in the document.

    • "1" converts all named entities in the document to their numerical equivalent, e.g. is converted to  

    • "0" does not convert named entities (default)

  • ConvertPlane1Entities - converts plane1 entities to plane0 equivalents. This option helps to deal with plane1 entities until wider browser support is available.

    • "1" converts all plane1 entities to plane0, e.g. &afr converts to <mi mathvariant="fraktur">a</mi>

    • "0" does not convert plane1 values (default)

  • RemoveIEComments - removes all "uplevel" and "downlevel" IE5-style comments from the document

Word generates many comments that only Windows IE5 or later understand, such as the so-called "uplevel" comments (e.g. "<![if vml]>...<![endif]>") and "downlevel" comments (e.g. "<!--[if vml]>...<![endif]-->". This option allows such comments to be removed, which is necessary to generate proper XML documents.

  * "1" all IE5-style comments from the document
  * "0" IE5-style comments are left as-is (default)

 

<a><button>Back to MathType SDK intro page</button></a>