Skip to main content

Create a MathFlow XMAX HTML application

Prerequisites

You must have the following software components installed on your system:

  • XMetaL Author

  • XMetaL XMAX 6.0 or later

  • XMetaL Developer 6.0 or later (requires Microsoft Visual Studio)

  • MathFlow 2.0 for XMetaL 6.0 or later

Part 1: Create an XMetaL Application Customization (XAC) file

Initial steps

Create a Customization Solution (for journalist_math.dtd)

Using the XMetaL Developer Customization Guide, the first step is to create a customization solution that includes and supports MathML. The end result will be an XMetaL Application Customization (XAC) file.

In this example, we will use the journalist_math doctype that is copied into the XMetaL Author folder when MathFlow for XMetaL is installed. This DTD file (along with related MathML files) is copied to the C:\Program Files (x86)\XMetaL [version]\Author\Rules directory during MathFlow for XMetaL installation or (C:\Program Files\XMetaL [version]\Author\Rules directory for 32-bit Windows.)

The journalist_math doctype is simply the journalist doctype that comes with XMetaL, modified to allow MathML elements. The changes that were made to it are minimal:

  • Added MathML entities:

<!-- ============================================================= --> <!-- MATHML --> <!-- ============================================================= --> <!-- ======= UNCOMMENT THE FOLLOWING TWO LINES TO USE NAMESPACE PREFIXES ============= --> <!ENTITY % MATHML.prefixed "INCLUDE"> <!ENTITY % MATHML.prefix "mml"> <!ENTITY % mathml-dtd PUBLIC "-%%//%%W3C%%//%%DTD MathML 3.0%%//%%EN" "mathml3.dtd"> %mathml-dtd;

  • Updated the Phrase Level Elements to allow MathML:

<!-- PHRASE-LEVEL ELEMENTS --> <!-- Elements allowed at the same level as text --> <!ENTITY % PhraseLevel "Citation | Emphasis | Strong | TT | Underscore | InlineGraphic | Link | Subscript | Superscript | ULink | %MATHML.prefix;:math" >

Create the Journalist_Math customization solution in Visual Studio

  1. In Visual Studio, select Create a New Project, then select XMetaL Projects. Select Document Customization and name it Journalist Math. Click OK.

  2. This will open the XMetaL Developer Project Setup Wizard.

  3. Click Next. In the Choose DTD/Schema/Rules dialog, browse to and select C:\Program Files (x86)\XMetaL [version]\Author\Rules\journalist_math.dtd for DTD/Schema/Rules File (for 32-bit Windows, the path is C:\Program Files\XMetaL [version]\Author\Rules\journalist_math.dtd):

  1. When you click Next, the Choose Additional Files to Include dialog will open. It should list journalist_math.ctm and journalist_math.tbr. To add the journalist_math.css and journalist_math_structure.css files under C:\Program Files (x86)\XMetaL [version]\Author\Display, click Next, then click Finish to complete creating the project.

Add the MathFlow macros (mathflow.mcr) to the customization solution

The next step is to add the MathFlow XMetaL macros to the customization solution in order to enable MathFlow to work with this doctype.

  1. In Visual Studio's Solution Explorer window, right click on Macros and select Add > Existing Item.

  1. Navigate to C:\Program Files (x86)\XMetaL 7.0\Author\Startup and select mathflow.mcr. For 32-bit Windows, the path is C:\Program Files\XMetaL 7.0\Author\Startup.

  2. On the Select Macros to Import dialog, add the following macros from the mathflow.mcr file:

    • aboutMathFlow

    • mathflowHelp

    • mathflowInsertEquation

    • On_Application_Open

    • On_Macro_File_Load

  3. Click OK. When prompted whether to replace existing files, click Yes.