Members Only

InReview: MathML Kit

This article appears in Issue 121 of InDesign Magazine.

InDesign Magazine Issue 121: Big DesignThis article appeared in Issue 121 of InDesign Magazine.

Rudi Warttmann reviews a plug-in for adding math equations to your InDesign layout a minimum of hassle.

It may be a stereotype, but designers are not usually known for their love of math. Indeed, setting professional quality math equations in InDesign layouts is a tricky task, often left to specialists. But math can crop up anywhere. Textbooks, journal articles, technical papers, even newsletters and magazine articles occasionally include bits of complex math that need to be displayed with as much care as the rest of the typography. You could painstakingly arrange every number and symbol by hand, but there’s a much better solution: MathML. If you have access to MathML as part of the manuscript for a project, then adding equations to your InDesign layout will be far less of a hassle, with the help of a tool called MathML Kit from Scand, Ltd.

What is MathML?

First, let’s back up a little bit and go over what MathML is and why it exists in the first place.

Whenever computers have to exchange any information, there’s a need to ensure that they “understand” each other—meaning that the information sent from one machine will arrive and be interpreted as exactly the same information on the other machine. This is easy enough with plain text, and is a little harder with text that has special non-English characters, but it reaches a whole new level of complexity for mathematical equations, where the size and position of numbers and symbols can radically change their meaning. That’s why a standardized notation was elaborated in XML format and eventually published as

a W3C recommendation called MathML. Version 3 of MathML has become an ISO/IEC International Standard. If you’re new to MathML, you can find a good introduction to the topic here.

In MathML, “ML” stands for “markup language.” The actual math content is enriched by markups containing structural information. These markups are written in angle brackets, such as <math>. If you’re familiar with HTML or XML, you’ll instantly recognize this kind of notation, and in fact, MathML is similar to HTML; it just uses different tags.

MathML comes in two different flavors: the so-called “content markup” and “presentation markup.” Content markup is very formal and is basically tailored to preserve the underlying mathematical meaning of an equation. It is primarily used for information exchange between machines, for example from or to a computer algebra system such as Mathematica (www.wolfram.com) or Gauss (www.aptech.com). Presentation markup’s focus is the actual depiction on a device, and explicitly doesn’t care (at least not primarily) about the mathematical meaning.

These two representations can be illustrated in a simple example. Consider the equation “x squared plus 4 times x plus 4 equals zero.” Figure 1 shows what it looks like in presentation markup. And Figure 2 shows the same equation in content markup.

Figure 1. Presentation markup describes how an equation should appear.

Figure 2. Content markup describes precisely what an equation means.

Both a web browser such as Firefox and layout software like InDesign need to read this code and translate it into something that can be read on a screen or on paper. Firefox has a built-in engine for rendering presentation markup, but InDesign doesn’t. This is where MathML Kit comes in: it reads the MathML code in presentation markup, constructs a vector-based image from this code, and lets you embed the resulting image into your InDesign text. Since the image consists of vectors, it will come out with best the possible resolution on paper.

Installation

You can grab a free download version of MathML Kit here. It’s fully functional but time- limited. As mentioned above, there is only a version for Windows at this time, so you’ll get an “.exe” installer file. If you have administrator rights, you can double-click on the installer to run it. It will find all the versions of InDesign you have on your machine, and you can choose the one(s) where you’d like to install MathML Kit (Figure 3).

Figure 3. If you have more than one version of InDesign, the installer lets you choose where to install the MathML Kit components. And yes, I really have all these versions on my computer.

After the installation is done, you can relaunch InDesign. At first, you won’t notice that anything has changed. MathML Kit mainly works behind the scenes and adds just one inconspicuous but essential menu item, as we’ll see in a moment.

Using MathML Kit

The process of bringing equations into your layout couldn’t be much simpler. Just place the cursor at the intended position, and then choose File > Place. Then take a close look at the drop-down list, and you’ll notice that MathML is one of the choices (Figure 4).

Figure 4. The Place dialog box offers the only hint that MathML Kit is present: you can see that MathML has been added to the list of importable files.

Go ahead and choose MathML, navigate to an appropriate file, and click Open. MathML Kit converts the MathML code into a vector image and places it as an anchored graphic at your cursor position. Be warned: when viewed in Typical Display Performance, the graphic will look very pixelated (Figure 5).

Figure 5. An equation viewed with Typical Display Performance appears low-res.

Fortunately, it’s simple to fix this problem. Just take the Selection tool, right-click on the graphic, and choose Display Performance > High Quality Display (Figure 6). The image will then be presented at its best possible quality on the screen, which might take a few seconds, especially if you have lots of vector graphics in the visible area.

Figure 6. Switch to High Quality Display for a better look at your math equations.

Figure 7 shows a typical mathematical equation consisting of overbraces and an underbrace.

Figure 7. Imagine trying to create a page full of these expressions manually!

In terms of requirements, MathML Kit just needs the source file to be a valid XML file, with a special header entry declaring the so-called DOCTYPE (Figure 8).

Figure 8. A typical MathML file, with the necessary declarations in the first two lines.

Summing Up

MathML Kit is not as robust as math equation plug-ins such as MathTools from movemen, which lets you copy and paste MathML equations directly into InDesign as live text, or even create simple or complex equations from scratch. (See review of MathTools in issue 74.)

Nevertheless, a simple tool such as MathML Kit does have some unique advantages. First is simplicity: installation and use couldn’t be easier, and you don’t need to use another application to process the MathML code before bringing it into InDesign. The second advantage is cost: at just $15 for a single commercial license, MathML kit won’t put a dent in your budget. So, if you’re a Windows user who needs to occasionally place math content into your InDesign layouts from MathML files, it’s worth giving MathML Kit a look.

  • Developer: Scand Ltd., Minsk (Belarus)
  • Cost: $15
  • Platform: Windows only
  • CS6+
  • Rating: 3 Stars

Bookmark
Please login to bookmark Close

Not a member yet?

Get unlimited access to articles and member-only resources with a CreativePro membership.

Become a Member

Comments are temporarily disabled for maintenance.

Comments (4)

Loading comments...

Comments are closed.