Skip to main content

MathFlow Composer

Overview - MathFlow Composer

MathFlow Composer works together with Arbortext Composer to generate output documents in HTML, XHTML, and PDF formats.

The following composition options are included in the MathFlow Composer license:

  • Draft PDF Composition: generates a PNG image for each equation, to be included in the PDF file.

  • High Quality PDF Composition: generates postscript code for each equation (this feature is available only on Windows).

  • HTML Composition: saves an HTML or XHTML version of the document you can view with a web browser. There are different types of output to choose from, according to the browsers targeted.

If you are using concurrent licensing for MathFlow Composer while creating HTML, XHTML, or PDF documents, a license is checked out to perform the conversion. For more information on concurrent licensing, see MathFlow Licensing.

MathFlow PDF Composition

If you have Arbortext Composer and MathFlow Composer licensed, then you can generate PDF versions of your MathML enabled documents. You do this in the same way as for any other doctype, using the Publish | PDF File… option from the Arbortext Editor File menu. When you choose it the following dialog will appear.


Distiller settings

  • If you are using Adobe Acrobat Distiller for Arbortext (Epic) Editor 5.0 and higher, you may have to enter the following at the Arbortext command line to enable the File | Compose | PDF File option: set usedistiller=on

  • To have this preference set every time you use Arbortext Editor with MathFlow enter the line:

$mathml::prefer_distiller = 1; in the mathml_user.acl file described in Customizing Editing.

For more information about the settings required for using Adobe Acrobat Distiller or Arbortext's Direct PDF, see the Configuring MathFlow Composer section of the installation guide.


Note you will have to modify the stylesheet you use so it recognizes MathML. See Setting up a Custom Doctype for some hints on how to do this.

Image quality

If you are running Arbortext Editor in a non-Windows system, then the rendering of the equations in the PDF file is done via high-resolution PNG images. This means the quality of the rendering is limited, and there will be a noticeable deterioration when zooming in by large percentages. If the images are being displayed at much larger sizes, then set the environment variable APTPNGUSERES to "yes".

If you are running under Windows, then the quality of the equation rendering will be the same as the surrounding text. If you having problems with missing characters in MathFlow images, see MathFlow Composer (EPS) for information on how to configure font information.

MathFlow HTML composition

Save as HTML

If you have licensed HTML Composition, you have two choices for creating an HTML version of a MathML aware doctype from the Arbortext Editor - Save as HTML or Compose HTML file, both found on the Arbortext Editor File menu.

The Save as HTML menu command creates an HTML version of the document using the default stylesheet and encoding. Note if you choose to generate UMSS output (see below) you cannot use a Styler stylesheet. UMSS output should be an XML file, and a Styler stylesheet will always generate an HTML file when the Save as HTML command is selected. Therefore, a different XSL stylesheet should be associated with the document for HTML output, or chosen in the Publish HTML file dialog (used instead of Save as HTML).

When you choose the Save as HTML menu command, the following dialog will appear.


Document panel

Here you can choose the name of the HTML file generated and its location by either typing the path and file name in the Save as: field, or clicking the Browse… button and using the file chooser.

If you check the Display in default browser checkbox, Arbortext will attempt to show you the final result once it is done generating it.

Equations panel

This panel lets you choose the kind of HTML file to generate. Which one to use is mostly a matter of what platforms you are targeting and ease of maintenance.

There are 3 different types of output to choose from:

Use images — This generates a page with JavaScript code and PNG images for displaying the equations. It uses higher resolution images for printing, and, if the MathZoom checkbox is checked, will pop up a larger image when you click on an equation image. This output is the most compatible, working basically in all the recent versions of the common browsers, without special plug-ins. On the other hand, it generates 7 images per equation, and uses an external mathpage.js file that needs to be in place for the page to be displayed correctly. Also, no MathML is actually written to the HTML file, so that information is lost.

MathML using — This writes MathML in the actual HTML file, and gives two further options:

  • MathPlayer (IE6.0) writes a page configured to use our free MathPlayer plug-in for Microsoft's Internet Explorer browser. No extra files are needed. This works only on IE 6.0 or later, with the MathPlayer plug-in installed. Because this option is an outdated option, we recommend the next option…

  • Multi-browser (UMSS) uses the Universal MathML Stylesheet so the page can be viewed in either IE (with MathPlayer plug-in) or Firefox (recent versions). Note in this case the file extension should be .xml, not .html, which may conflict with the original source file name. Requires the extra pmath.xsl stylesheet, IE 6.0 or later with MathPlayer plug-in, or Firefox.

Publish HTML file

In this case, you get the same dialog as with Save as HTML, but with an extra Stylesheet panel. Using this setting, you can choose which stylesheet and encoding to use for generating the HTML.


Note if you choose to generate UMSS output, you cannot use a Styler stylesheet. UMSS output should be an XML file, and a Styler stylesheet will always generate an HTML file when the Publish HTML file command is selected. Instead, use an XSL stylesheet for XML output, like the demo axdocbook_math-ev.xsl stylesheet.

Auxiliary files locations

Depending on the type of HTML output you choose, there may be extra files generated for the web page to display correctly.

  • Images — all equation images are stored in a directory named <output-filename>_files (together with any other regular image the web page may have). It also requires the JavaScript file mathpage.js, in the same directory as the output file.

  • MathML (MathPlayer) - no extra files are needed.

  • MathML (Multi-browser) - the extra file pmath.xsl is needed and should be placed in the same directory as the output file.

Arbortext Publishing Engine

Arbortext Publishing Engine (formerly Enterprise E-Content Engine (E3)) is a publishing server that automatically converts XML to multiple types of media—Web, print, PDF, HTML Help, wireless and more. MathFlow is seamlessly integrated with most of Publishing Engine's uses. However, since no interactive dialogs can be used from Publishing Engine, and since the output often involves many files, there are some special steps to take for using MathFlow with Publishing Engine's default 'convert' function when generating HTML.

Rendering variables

The first issue is MathFlow allows for three different kinds of rendering for mathematical formulas when generating HTML:

  • Images

  • MathPlayer (our MathML plug-in)

  • Universal Math StyleSheet (umss)

To indicate which kind of output you want from Arbortext Publishing Engine, you have to assign the corresponding value to the variable $mathml::e3HTMLOutput in the <custom-path>/scripts/mathml_user.acl file, for example:

$mathml::e3HTMLOutput = "umss";

Valid values are images (default), mathplayer, or umss. You'll need to create the mathml_user.acl file if it does not yet exist.

Format options

In addition, the request URL should pass some specific options, depending on the desired rendering format of images, mathplayer, or umss:

  1. images — Since this output contains several files, you should pass a zip-output=yes pair to the request URL. Also, the files will get copied to a directory (inside the zip file) called according to the value given to zip-graph-dir (for example, zip-graph-dir=external_files). Note this directory name should not include a dot (it throws off the javascript). In particular, the default scheme (filename.files) does not work, so this option is also required.

Example (will vary depending on user/system configuration):http://localhost:8080/e3/servlet/e3?file=$aptpath/custom/doctypes/ axdocbook_math/demo.xml&type=html&zip-output=yes&zip-graph-dir=external_files&f=convert

  1. mathplayer — This is the simplest of the three cases; no special considerations are required. But remember, the output file only works for IE6+MathPlayer.

Example:http://localhost:8080/e3/servlet/e3?file=$aptpath/custom/doctypes/ axdocbook_math/demo.xml&type=html&f=convert

  1. umss — In addition to the considerations for images, if one wants to use umss output, it is important to also add to the request zip-root=<fname>.xml. The output should actually be an xml file (not html), so the name of the file could be anything, but the extension should be .xml.

Example:http://localhost:8080/e3/servlet/e3?file=$aptpath/custom/doctypes/ axdocbook_math/demo.xml&type=html&zip-output=yes&zip-graph-dir= external_files&zip-root=e3out.xml&f=convert