General techniques for using MathType with other applications and websites

Working with Insert Object

Many Windows applications support Object Linking and Embedding (OLE). Most of them have an Insert Object command (or an Object… command on its Insert menu or elsewhere). If your application doesn't have such a command, look up Object Linking and Embedding or OLE in the index of its user documentation. The Insert Object command brings up a dialogue containing a list of all the kinds of objects that may be inserted. Choose "MathType 7.0 Equation", and MathType will open an equation editing window. Create your equation, close the window when you are done, and the new equation will appear in the document. Any time you want to edit the equation, just double-click it. If your favourite application does not support OLE, request it from the vendor. Most software vendors like to get feedback from their customers, just like we do.

Copy and paste (or drag and drop)

At its core, a MathType equation is a graphical image (but a WMF or PICT/PDF vector image, rather than a bitmap image, such as GIF). Suppose your application accepts graphics via the clipboard. In that case, you can run MathType 7 from the Windows Start menu or Mac Applications folder, create an equation, and paste it into your application. Your application may also support drag and drop, but that will generally give the same result. When using MathType this way, you don't have to restart it for each new equation. Just leave its editing window open for your entire session. When you need to create a new equation, bring the MathType window to the front, choose the Select All command on the Edit menu ( Ctrl+A / Command+A ), hit the Delete key to clear out the last equation, and create your new equation ready to paste. Later, if you need to edit an equation, you can usually use Cut or Copy, then Paste it back into a MathType editing window. After making your edits, just copy and paste it over the old one.

Cut and Copy Preferences dialogue

cut_copy_preferences_dialog.png

This dialogue allows you to specify what kind of information will be placed on the clipboard whenever you use the Cut or Copy commands on the Edit menu or when you drag & drop an equation from the MathType editing window. (For the remainder of this topic, when we use the terms cut, copy, and/or paste, the same behaviour applies to drag & drop, but we will not explicitly state such.) Usually, Cut or Copy will place a graphic image of the selected part of the equation onto the clipboard, ready to be pasted into a document. However, using the options in this dialogue, you can have the selected equation or fragment translated into text in one of the computer languages or for one of the applications or websites for which a translator is available.

Equation object (Windows OLE graphic)

Click this option to place an equation object on the clipboard. This is the default and is usually used to transfer equation material between one MathType window and another, or between a MathType window and another application, such as a word processor. When you paste an equation into another application's window, handling it depends on that application. If the application is OLE-compatible, it will be treated as a new OLE object. If the application is not OLE-compatible, it will be treated as a graphic image.

MathML or TeX

MathType is supplied with several translators that allow equations to be translated into other computer languages, TeX and MathML. Click this option to cause MathType to translate the selected equation whenever you use the Cut or Copy command.

Use this list box to choose from one of the translators currently available to MathType 7 The text of each list item describes the computer language (or variant) that the translator can translate equations into. In addition to the translators installed as part of MathType, other translators may be available from third-party sources. It is also possible to create your own translator or modify an existing one. See Working with MathML and Working with TeX for information on the installed translators with MathType 7.

Include translator name in translation

This option instructs the translator software to place the translator's name in the translation. This is used by MathType integration with Microsoft Word to allow its Convert Equations command to find the equations in the document. If you use MathType 7 with a TeX application instead of Word, you should leave this option unchecked. Some translators may ignore this option.

Include MathType data in translation

This option instructs the translator software to place MathType 7 equation representation in the translation. This allows the equation to be pasted back into MathType for later editing and should be checked. Some translators may ignore this option.

Note

Note: It is possible to paste raw TeX into MathType, and usually MathType 7 will understand it and produce the equation you want. Be aware that, if you clear this option, you might not be able to completely edit the resulting text equation in MathType or convert it back to a MathType 7 equation object using Convert Equations in Word. Therefore, you should use care when clearing this option.

Equation for application or website

Many applications and websites accept TeX or MathML but may mark it up in a special way or with special delimiters. For example, instead of $\frac{1}{2}$, some applications want [math]\frac{1}{2}[/math]. By selecting the appropriate application or website from this list and copying the equation from MathType, you don't have to worry about specific formats for your favourite applications & sites.

Working with MathML

Some applications support a standard for using MathML as an exchange format for Copy and Paste (or drag and drop). The type of MathML used is controlled by choosing one of the MathML translators from the Cut and Copy Preferences dialogue. There may already exist in MathType 7 list of translators one specifically tailored to your intended target. If not, by experimenting, you may obtain better results with Copy and Paste.

MathML translators

MathType provides output translators for MathML, a recommendation from the World Wide Web Consortium for encoding mathematics for the Web. MathML is a worldwide standard, but its implementation is not standard, so there are differences in the support for MathML in other software. Therefore, MathType includes translators to generate MathML 2.0. These translators are packaged in slightly different ways for the various browsers, browser plug-ins, and software applications that support MathML.

The MathML translators provided with MathType are:

  • MathML 2.0 (m namespace): All MathML tags are prefixed with an m: namespace.

  • MathML 2.0 (namespace attr): This translator generates MathML 2.0 using a namespace attribute on each <math> tag. If you're not sure which of the 3 MathML 2.0 translators to use, this is the one most likely to work if the others do not.

  • MathML 2.0 (no namespace): As the name suggests, this is for pure MathML, no namespace.

  • MathML 3.0 translators. MathType 7.4.2 and later include 3 MathML 3.0 translators, but there are many MathML 3.0 properties these translators do not support yet. If there is a particular property of MathML 3.0 you need, please let us know.

This translator generates plain MathML tags with no namespace information.

Number separators and multiple-letter variables or names

These are special considerations that need additional care. Consider these examples:

number_separators.png
multiple-letter_variable_names.png

In the first case, MathType will convert the number one thousand into three elements: <mn>1</mn><mo>,</mo><mn>000</mn>

This is almost certainly what you don't want. Still, MathType translating process isn't sophisticated enough to scan the expressions on both sides of the comma (or whatever separator your region uses). As another example, MathType won't be able to discern whether 10,205 is the number ten thousand, two hundred and five or the ordered pair representing x/y coordinates of 10 on the x-axis and 205 on the y-axis.

What MathType does with miles is the same way it handles the quantities in the second example, so let's deal with them both by considering a more general example.

When MathType sees abc, should it interpret that as the 3-letter variable abc, or is it implied multiplication: a times b times c? MathType doesn't know and isn't equipped to decide, so the resulting MathML is this: <mi>a</mi><mi>b</mi><mi>c</mi>

Unfortunately, these are cases where you'll need to manually edit the MathML for it to be correct if you choose to do so. In many cases, the result will look the same either way, so if correct visual appearance is the overriding concern (and if it is, it's neither right nor wrong; it's just what your situation dictates), then there's no need to correct the MathML. (Probably a better way to create these expressions in MathType is to type miles, Pressure, and Volume in MathType Text style rather than Math style, but you may be converting to MathML some equations someone else wrote. If hundreds of them are in the document, it may not be worth "correcting" them.

Working with TeX

Many web applications that use math represent equations using the TeX typesetting language because it is easy to type in web forms. However, since there are many dialects and variations of TeX, you will need to choose a compatible MathType 7 translator to use when pasting into such a web application. There may already exist in MathType 7 list of translators one specifically tailored to your intended target. If not, by experimenting with different TeX translators from the Cut and Copy Preferences dialogue, you may be able to improve the results of Copy and Paste. Because they only use an essential subset of TeX, the Texvc translators are often good choices.

TeX translators

TeX is a typesetting language invented in the late 1970s by Donald Knuth, a Stanford computer science professor. Although it is a powerful document processor, especially for documents containing equations, it also has a steep learning curve. You can think of TeX as a sort of programming language for documents. If you don't get the syntax right, you get "syntax error" instead of a document.

Here is an example of the TeX language for the quotient rule of differentiation:

\frac{d\left(\frac fg\right)}{dx}(x)=\frac{g(x)\frac{df}{dx}(x)-f(x)\frac{dg}{dx}(x)}{g^2(x)}

Here is how the same equation would appear in MathType

tex-1.gif

If you work with TeX, MathType 7 TeX translators can help you. There are several 'flavours' of TeX, LaTeX being one of the most well-known. MathType includes translators for several of these different versions. Check the Cut and Copy Preferences dialogue for the complete list.

Translating display and inline equations

When an equation appears in a document, it can be displayed in line with surrounding text, or it may be centred in a paragraph by itself. Users of MathType in Microsoft Word will already be familiar with this concept since MathType 7 commands for Word use different commands to insert inline and display equations.

TeX also has a notation for inline and display equations, but it works differently. Since TeX is a programming language, the positioning of the equation in the document must be specified in the TeX code for the equation. TeX uses special delimiter characters at the beginning and end of an equation to indicate whether it should be an inline or display equation. Different TeX uses different delimiter characters, but the most common are $...$ for an inline equation and \[...\] for a display equation.

You can control which kind of TeX delimiter to translate a MathType 7 equation. Checking the "Inline Equation" property from MathType Format menu will cause inline delimiters to be used for translation. Otherwise, display delimiters will be used.

When using MathType with Microsoft Word, the Inline Equation property is automatically set when inserting equations via MathType 7 commands for Word. However, suppose you later move an equation within your document. In that case, you may need to update the Inline Equation property for TeX export manually or for MathType 7 Toggle TeX feature in Word.

Importing TeX equations

While MathType TeX translators provide an easy way to export an equation as TeX code, MathType 7 also offers several ways to import a TeX equation.

MathType imports Texvc, a subset of TeX supported by Wikipedia. See the MediaWiki handbook for an explanation of this language.

  • You can type Texvc directly into MathType. See Using TeX language input for details.

  • If you use Microsoft Word, you can type Texvc directly into the Word editing area and toggle back and forth between the Texvc view and the MathType 7 view of the equation. See Toggle TeX for more details.

You can import and export Texvc from Wikipedia and other websites using copy and paste.

Working with equation image files

MathType can also save equations in several graphics formats. Encapsulated PostScript format (EPS) is handy for working with desktop publishing applications. The GIF format is best for putting equations on web pages or working with web-based applications. Check with your application's documentation on how to work with graphics files. Sometimes we're asked why MathType doesn't support the JPG format, but the truth is JPG is just not a very good format to use for equation images.

To save a MathType 7 equation as an image file, choose Save As from the File menu, and choose the image format from the Save As Type pulldown list. When editing an equation, use the MathType Open command on the File menu to open the file. Once you have made your edits, close the window and save changes when asked.

Working with web pages

If you're reading web pages with equations, it's good to know there are various techniques for adding math to web pages. Some web authors prefer MathML, and some prefer MathJax. Others prefer images. So how can you tell which method is being used?

Identifying math display

The best way to tell how the website displays its math is to point to the math expression and click the right mouse button. On a Mac, you may have to ctrl+click.

MathML

Most of the web pages using MathML are read either with Firefox or with MathJax. When you click the right mouse button, look for an option to view or copy the MathML. If it's not there, you may have to consider the page source. If so, look for something beginning with <math…:

mathml_in_firefox.gif
mathml_in_safari.png

Firefox for Windows

Safari for Mac

If you're using Firefox, choose the View MathML Source command, copy the code & paste the MathML into MathType If you're using another browser that supports MathML. There's no View MathML or Copy MathML command; go to the source and copy everything between <math> and </math>. There is likely to be more than one such block, though, so be sure to get only one block of MathML.

MathJax

All browsers have a common contextual (right-click/ctrl+click) menu for MathJax equations:

mathjax.gif

MathJax equations may be in LaTeX format, or they may be in MathML format. Either way, by clicking Show Math As, you can copy the code and paste it into MathType to use the equation in your work. Choose the Original MathML option for MathML, not the MathML Code one.

Images

If you are using Chrome or Safari browsers, the contextual menu will be similar to Firefox's.

images_firefox.gif
images_ie.gif

Firefox for Windows

Internet Explorer

To use equations from the web, there are a couple of techniques to try:

  • The image may have "alt text" that MathType 7 can use. Most of the usable equation images on the web fall into this category. To use these equations, click and drag it over to MathType or select it and copy it, then paste it into MathType (It's better to use the Ctrl+C / Command+C shortcut to copy, rather than to use the right-click menu at this point.)

  • If that doesn't work and you're using Internet Explorer, right-click the equation and choose Copy from the menu. If you're using any other browser, select Copy Image Location, Copy image URL, Copy Image Address, or a similar command. Paste into MathType

If these techniques don't work, the equation isn't usable by MathType 7 If this capability is essential, it may be worthwhile to contact the editor of the website and mention how important it is to you that the equations be in one of the formats mentioned above.