Authoring Pages
Umm will convert pages which have been authored according to the XHTML+ MathML schema. Use the W3C validator to see if your page meets this schema. If it does not, Umm will not be able to convert your page properly.
^ TOPRunning Umm
If you have a well-formed XHTML+MathML page, it will begin with something similar to the following:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Midterm Exam Solutions</title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset = UTF-8" /> </head> ...
To invoke Umm, delete the XML declaration at the beginning of your document:
<?xml version="1.0" encoding="UTF-8" ?>
And replace it with the following PHP code:
<?php include("/path/to/umm/Browser_Compatibility.php"); ?>
Umm will now convert your document according to the default options that were set in localconfig.php.
^ TOPThe Format Selection Menu
Since Umm determines the MathML capabilities of a visitor's browser with browser-sniffing, we strongly recommend that you allow a visitor to manually choose a MathML format. Umm can automatically provide a menu which allows the user to do this. In order to do this, you need to call the function InsertSelectionMenu using PHP code at the appropriate point in your document.
<?php include("/path/to/umm/Browser_Compatibility.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... <center> <p><?php InsertSelectionMenu(); ?></p> <center> ...
This will display a menu much like the following:
Next | |
Charged Manifolds in n-Space | |
Honors Physics II | |
Problems with equation display?
Try auto-fix Guide me |
This menu provides two options. The first, "Try auto-fix," will switch the display format to HTML+Images, since this is the most reliable options. If the user is already viewing HTML+Images, or has set a persistent preference for their MathML format, this option will not appear. The second option, "Guide me," creates a window which provides information on MathML and Umm, and a menu for the user to manually select a format.
^ TOPSetting Transformation Options
Umm is designed with the goal of giving you the ability to easily customize how it transforms your document. It provides a set of options which can be turned on or off to change the behavior of Umm. Depending on the settings in your localconfig.php file, you may be able to change some of these options on a per-page basis. To do this, you simply need to set the value of the appropriate configuration variable before including Browser_Compatibility.php, as in:
<?php $cache_page = false; include("/path/to/umm/Browser_Compatibility.php"); ?>
^ TOP
Checking Output
If there are errors in Umm or your page which cause undesired output, you may be able to see the source of the error by turning on the $show_log option. This will output any errors or events which occurred during the output of the page, along with the settings used to output the page. This can frequently be useful if Umm cannot understand the CSS in your document, as most user agents do not report errors or warning while processing malformed CSS. Below is an example of the log which would be at the end of a page output by Umm while $show_log was on.
Log:
- Created document cache table, at 2006-02-26 10:29:48 while processing "/development/Short_Test.php" for user agent "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1"
- CSS Error - Malformed declaration "font-size large" ignored, at 2006-02-26 10:29:49 while processing "/development/Short_Test.php" for user agent "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1"
Settings:
Document Caching: False Document from Cache: False Image Caching: True Database Images: True DOM Available: True Check CSS: True Check Style Attributes: True Direct to UA: False Document Buffered: True Document from File: True
Performance Issues
Rendering images from MathML requires substantial system resources. This can even cause a page to fail to load, depending on settings for PHP or your webserver. Fortunately, Umm is reasonably fast once the images have been rendered and placed in the cache. Thus, for documents with lots of equations, you may need to refresh a page a few times when it is first served in the HTML+Images format before it will even load.
Also, in PHP 4, the DOM XML extension can be a strain on system memory when processing large documents. This can also cause a page to fail to load, if the necessary memory exceeds PHP's memory cap. The solution in this case is to turn off the Use PHP DOM option for pages which are too long.