Skip to main content

MathType MTEF v.5 (MathType 4.0 and later)

Abstract

This document describes MTEF, the binary equation format used by MathType 4.0 and later (all platforms). MTEF is embedded in OLE equation objects produced by MathType as well as in all the file formats in which MathType can save equations. The methods used by MathType to embed this information in such files are described in a separate document. See How MTEF is Stored in Files and Objects.

Introduction

This document describes the binary equation format used by MathType 4.0 and later (all platforms). Although MTEF is not the most friendly medium for defining equations, there have been so many requests for this information, we decided to publish it anyway. We must warn the reader that it is not an easy format to understand and, more importantly, MathType is not at all forgiving in its processing of it. This means that if you send MathType MTEF with errors, it might crash. At a minimum, you will get an equation with formatting problems. Also, it is a binary format. This means that you can't use character strings to represent equations and it makes creating MTEF a little harder with programming languages like Visual Basic.

How MathType stores an equation description in an OLE equation object, a file, or on the clipboard is not described here. Please see the document on MathType MTEF Storage for more information on this subject.

This document sometimes refers to MathType internal names for values (e.g. parmLINESPACE). These are given for reference purposes and are handy for reducing errors when such values are communicated by humans.

Header

MTEF version history:

MTEF data exists in the following versions:

0

MathType for Mac 1.x (this format is not described here)

1

MathType for Mac 2.x and MathType for Windows 1.x

2

MathType 3.x and Equation Editor 1.x

3

Equation Editor 3.x (this format is not described here)

4

MathType 3.5

5

MathType 4.0 and later

Version 2 differs from version 1 only in the format of the header.

Header record:

The MTEF version 5 header contains:

length in bytes

description

value

1

MTEF version

5

1

generating platform

0 for Mac, 1 for Windows

1

generating product

0 for MathType, 1 for Equation Editor

1

product version

4 or later

1

product subversion

0 (or ???)

length of app key

application key

null-terminated string identifying the writing application (e.g. "DSMT4" for the Wiris version of MathType)

1

equation options

if bit 0 is set, equation is inline, else display equation other bits are unused and must be 0

MTEF Byte Stream

This section describes the actual MTEF data following the header.

Records:

MTEF data consists of a series of records. Each record starts with a record type byte and an options byte, then is followed by data specific to the record.

The overall structure of an MTEF stream is:

  • MTEF header

  • equation preferences (size, style, spacing), preceded by the definition records to which they refer

  • initial SIZE record

  • PILE or LINE record

  • contents of PILE or LINE

  • END record

Once the header has been read, reading of the MTEF stream should be driven by reading the next record type and then acting on it. If a given record depends on data that is not contained within the record itself, such data is defined by records that precede it.

Record types:

The following record types are used:

value

symbol

description

0

END

end of MTEF, pile, line, embellishment list, or template

1

LINE

line (slot)

2

CHAR

character

3

TMPL

template

4

PILE

pile (vertical stack of lines)

5

MATRIX

matrix

6

EMBELL

character embellishment (e.g. hat, prime)

7

RULER

ruler (tab-stop location)

8

FONT_STYLE_DEF

font/char style definition

9

SIZE

general size

10

FULL

full size

11

SUB

subscript size

12

SUB2

sub-subscript size

13

SYM

symbol size

14

SUBSYM

sub-symbol size

15

COLOR

color

16

COLOR_DEF

color definition

17

FONT_DEF

font definition

18

EQN_PREFS

equation preferences (sizes, styles, spacing)

19

ENCODING_DEF

encoding definition

≥ 100

FUTURE

for future expansion (see below)

If the record type is 100 or greater, it represents a record that will be defined in a future version of MTEF. For now, readers can assume that an unsigned integer follows the record type and is the number of bytes following it in the record (i.e. it doesn't include the record type and length). This makes it easy for software that reads MTEF to skip these records. Although it might be handy if all records had such a length value, it will only be present on future expansion records (i.e. those with record types ≥ 100).

Object lists:

LINE, CHAR, TMPL, PILE, MATRIX, and RULER records are followed by object lists that define contents of each equation structure. Each object list contains a sequence of records of any type and terminated by an END record. In a special case for LINE records, if there are no objects in the list, the line record will have the mtefOPT_LINE_NULL option set, in which case the object list is omitted entirely (i.e. no END record). Although there are no restrictions made by the MTEF format on what record types may occur in any particular list, the user interface prevents certain things from happening. For example, the object list defining the contents of a pile contains only LINE records.

Definition records:

Some of MTEF's records (FONT_STYLE_DEF, FONT_DEF, COLOR_DEF, and ENCODING_DEF) do not represent equation structure themselves but are referred to by equation structure records. The definition records in an MTEF stream are assigned indices, starting at 1 (except for ENCODING_DEFs, which start at 5), in the order they appear in the stream. Records which refer to these definitions do so using the index value of the definition. Definition records always appear in the stream before their first reference.

Option values:

Each MTEF 5 record starts with a type byte followed by an option byte. This is different from earlier versions of MTEF where the option flags were stored in the upper 4 bits of the type byte.

The option flag values are record-dependent:

value

symbol

description

Option flag values for all equation structure records:

0×08

mtefOPT_NUDGE

nudge values follow tag

Option flag values for CHAR records:

0×01

mtefOPT_CHAR_EMBELL

character is followed by an embellishment list

0×02

mtefOPT_CHAR_FUNC_START

character starts a function (sin, cos, etc.)

0×04

mtefOPT_CHAR_ENC_CHAR_8

character is written with an 8-bit encoded value

0×10

mtefOPT_CHAR_ENC_CHAR_16

character is written with an 16-bit encoded value

0×20

mtefOPT_CHAR_ENC_NO_MTCODE

character is written without an 16-bit MTCode value

Option flag values for LINE records:

0×01

mtefOPT_LINE_NULL

line is a placeholder only (i.e. not displayed)

0×04

mtefOPT_LINE_LSPACE

line spacing value follows tag

Option flag values for LINE and PILE records:

0×02

mtefOPT_LP_RULER

RULER record follows LINE or PILE record

Option flag values for COLOR_DEF records:

0×01

mtefCOLOR_CMYK

color model is CMYK, else RGB

0×02

mtefCOLOR_SPOT

color is a spot color, else a process color

0×04

mtefCOLOR_NAME

color has a name, else no name

Dimensional units:

All dimensional values are expressed in MathType internal units, 32nds of a printer's point (a point is 1/72 inch).

Signed integer values:

Signed values are written as follows:

range of value

algorithm

-128 ≤ value < 127

value = value + 128 written as a single byte

value < -128 or value ≥ 127

value = value + 32768 written as 3 bytes: byte 1: 255 byte 2: low byte of value byte 3: high byte of value

Unsigned integer values:

Unsigned values are written as follows:

range of value

algorithm

value < 255

written as a single byte

value ≥ 255

written as 3 bytes: byte 1: 255 byte 2: low byte of value byte 3: high byte of value

Simple 16-bit integer values:

Some values are written as 16-bits even if the value would fit in a byte. In this case, the value is written low byte followed by high byte.

Nudge values:

LINE, CHAR, TMPL, PILE, MATRIX, and EMBELL records may store the result of nudging (small offsets applied by the user). A nudged record has the mtefOPT_NUDGE option (0×8) and the option byte is followed immediately by the nudge offset. The nudge offset consists of either two bytes or six, depending on the amount of offset. If -128 ≤ dx < +128 and -128 ≤ dy < +128, then the offsets are stored as two bytes, dx followed by dy, where each value has 128 added to it before it is written. Otherwise, two bytes of 128 are stored, followed by the offsets, dx and dy, stored as 16-bit values, low byte followed by high byte.

Typeface values:

CHAR records contain a typeface value (biased by 128), written as a signed integer. If the value is positive, it represents one of MathType styles:

value

symbol

1

fnTEXT

2

fnFUNCTION

3

fnVARIABLE

4

fnLCGREEK

5

fnUCGREEK

6

fnSYMBOL

7

fnVECTOR

8

fnNUMBER

9

fnUSER1

10

fnUSER2

11

fnMTEXTRA

12

fnTEXT_FE

22

fnEXPAND

23

fnMARKER

24

fnSPACE

If the value is negative, it represents an explicit font as specified by a FONT record.

Typesize values:

Typesize values (sometimes referred to as lsizes) are used in several MTEF records. Not all values may be valid in a particular record. Their meaning is as follows:

value

symbol

description

0

szFULL full

1

szSUB subscript

2

szSUB2 sub-subscript

3

szSYM symbol

4

szSUBSYM sub-symbol

5

szUSER1 user 1

6

szUSER2 user 2

7

szDELTA delta increment

Character style values:

Character styles are represented by a single byte, bit 0 indicates bold and bit 1 indicates italic. In other words:

0

plain

1

bold

2

italic

3

bold and italic

Horizontal alignment values:

Horizontal alignment values are used in several MTEF records. Not all values may be valid in a particular record. Their meaning is as follows:

1

left justification

2

centered

3

right justification

4

relational operator alignment

5

decimal point alignment

Vertical alignment values:

Vertical alignment values are used in several MTEF records. Not all values may be valid in a particular record. Their meaning is as follows:

0

alignment with baseline of top line

1

alignment with baseline of center line

2

alignment with baseline of bottom line

3

vertical centering 4 alignment with the math axis (center of +,-, brace points, etc.)

Dimension arrays:

In the EQN_PREFS record, sizes and spacing values are both written as dimension arrays. These arrays are used to record the particular settings from the Define Sizes and Define Spacing dialogs used to define the equation. Instead of recording each value as a number, the dimension array captures each value as a character string. This ensures the user always sees the value just as entered, rather than possibly modified by rounding and/or truncation in conversion (e.g. so "2.0 inches" doesn't turn into "1.999 inches").

Each array is written as a single byte count of dimensions in the array, followed by a "nibble stream" containing the dimensions. Each nibble is a 4-bit value, packed 2 per byte. The upper 4 bits of each byte precedes the lower 4 bits. If the array contains an odd number of nibbles, an additional 0 nibble is written to round out the stream to whole bytes.

Each dimension in the array consists of a units nibble (see first table below), followed by a nibble for each character in the value string (see second table below), terminated by a 0×F nibble. The following table shows how each units nibble is interpreted:

0

inches

1

centimeters

2

points

3

picas

4

percentage

The following table shows how each nibble in a value string is interpreted:

0×0-0×9

decimal digit

0×A

decimal point

0×B

minus sign

0×F

end of value string

Record Details

The following details the individual records in MTEF. All values are single bytes unless indicated otherwise.

END record (0):

Consists of:

There is no option byte.

LINE record (1):

Consists of:

The line spacing value, if present, is the distance between the baseline of this line and the line above it.

CHAR record (2):

Consists of:

The character value itself is represented by one or more values. The presence or absence of these value is indicated by options and appear in this order:

16-bit integer MTCode value

present unless the mtefOPT_CHAR_ENC_NO_MTCODE option is set

8-bit font position

present if the mtefOPT_CHAR_ENC_CHAR_8 option is set

16-bit integer font position

present if the mtefOPT_CHAR_ENC_CHAR_16 option is set

The MTCode value defines the character independent of its font. MTCode is a superset of Unicode and is described in MTCode Encoding Tables. The 8-bit and 16-bit font positions are mutually exclusive but may both be absent. This is the position of the character within its font. Some of the common font encodings are given in Font Encoding Tables.

TMPL record (3):

Consists of:

  • record type (3)

  • options

  • [nudge] if mtefOPT_NUDGE is set

  • [selector] template selector code

  • [variation] template variation code (1 or 2 bytes; see below)

  • [options] template-specific options

  • [subobject list] either a single character (e.g. sigma in a summation) and/or lines

The template selector and variation codes determine the class of the template and various properties of the template, such as which subobjects can be deleted by the user (see Templates). The class of a template determines the order and meaning of each of its subobjects (see Template subobject order).

The variation code may be 1 or 2 bytes long. If the first byte value has the high bit set (0×80), the next byte is read and combined with the first according to this formula:

    variation code = (byte1 & 0×7F)  |  (byte2 << 8)

The template-specific options field is only used for integrals and fence templates:

Fence template option field values (fence alignment):

0

center fence on math axis, place math axis of contents on math axis of containing line (default);

1

center fence on contents, place math axis of contents on math axis of containing line;

2

center fence on contents, center contents on math axis of containing line.

Warning: the expanding integral property is duplicated in the integral templates variation codes (see Limit variations). On reading, MathType only looks at the variation code.

Integral template option field values:

0

fixed-size integral;

1

the integral expands vertically to fit its contents.

PILE record (4):

Consists of:

MATRIX record (5):

Consists of:

  • record type (5)

  • options

  • [nudge] if mtefOPT_NUDGE is set

  • [valign] vertical alignment of matrix within container

  • [h_just] horizontal alignment within columns

  • [v_just] vertical alignment within columns

  • [rows] number of rows

  • [cols] number of columns

  • [row_parts] row partition line types (see below)

  • [col_parts] column partition line types (see below)

  • [object list] list of lines, one for each element of the matrix, in order from left-to-right and top-to-bottom

The values for valign, h_just, and v_just are described in PILE above.

The row partition line type list consists of two-bit values for each possible partition line (one more than the number of rows), rounded out to the nearest byte. Each value determines the line style of the corresponding partition line (0 for none, 1 for solid, 2 for dashed, or 3 for dotted). Similarly for the column partition lines.

EMBELL record (6):

Consists of:

The embellishment types are:

value

symbol

description

2

emb1DOT

over single dot

3

emb2DOT

over double dot

4

emb3DOT

over triple dot

5

emb1PRIME

single prime

6

emb2PRIME

double prime

7

embBPRIME

backwards prime (left of character)

8

embTILDE

tilde

9

embHAT

hat (circumflex)

10

embNOT

diagonal slash through character

11

embRARROW

over right arrow

12

embLARROW

over left arrow

13

embBARROW

over both arrow (left and right)

14

embR1ARROW

over right single-barbed arrow

15

embL1ARROW

over left single-barbed arrow

16

embMBAR

mid-height horizontal bar

17

embOBAR

over-bar

18

emb3PRIME

triple prime

19

embFROWN

over-arc, concave downward

20

embSMILE

over-arc, concave upward

21

embX_BARS

double diagonal bars

22

embUP_BAR

bottom-left to top-right diagonal bar

23

embDOWN_BAR

top-left to bottom-right diagonal bar

24

emb4DOT

over quad dot

25

embU_1DOT

under single dot

26

embU_2DOT

under double dot

27

embU_3DOT

under triple dot

28

embU_4DOT

under quad dot

29

embU_BAR

under bar

30

embU_TILDE

under tilde (~)

31

embU_FROWN

under arc (ends point down)

32

embU_SMILE

under arc (ends point up)

33

embU_RARROW

under right arrow

34

embU_LARROW

under left arrow

35

embU_BARROW

under both arrow (left and right)

36

embU_R1ARROW

under right arrow (1 barb)

37

embU_L1ARROW

under left arrow (1 barb)

RULER record (7):

Consists of:

  • record type (7)

  • [n_stops] number of tab-stops

  • [tab-stop list] tab-stops in order from left-to-right

Each tab stop is described by a tab-stop type (0 for left, 1 for center, 2 for right, 3 for equal, 4 for decimal), followed by a 16-bit integer offset from the left end of the slot or pile with which it is associated.

FONT_STYLE_DEF record (8):

Consists of:

This record associates a character style with a font. See Definition records.

SIZE record (9):

Consists of one of the following cases:

if lsize < 0 (explicit point size):

else if -128 < dsize < +128:

else: (large delta)

Sizes in MathType are represented as a pair of values, lsize and dsize. Lsize stands for "logical size", dsize for "delta size". If it is negative, it is an explicit point size (in 32nds of a point) negated and dsize is ignored. Otherwise, lsize is a typesize value and dsize is a delta from that size:

Simple typesizes, without a delta value, are written using the records described in the next section.

Typesize records (10-14):

Consists of:

These records are just short ways of specifying a simple typesize where dsize is zero. The tag value represents an lsize + 10. So if the tag value is 10, it means equation content following it will be Full size (szFULL), tag value 11 means szSUB, and so on. See typesize.

COLOR records (15):

Consists of:

The appearance of this record in the stream indicates that all following equation records (until the next COLOR record) have the color defined by the indicated COLOR_DEF record.

COLOR_DEF records (16):

Consists of:

  • record type (16)

  • [options] model is RGB unless mtefCOLOR_CMYK bit is set; type is process unless mtefCOLOR_SPOT bit is set; color is unnamed unless mtefCOLOR_NAME bit is set

  • [color values] if RGB, 3 values (red, green, blue); if CMYK, 4 values (cyan, magenta, yellow, black); see below for details

  • [name] null-terminated color name; appears only if mtefCOLOR_NAME option is set

This record defines a color (see Definition records). Each color value is written as a 16-bit integer that ranges between 0 and 1000 where 0 is the absence of the color and 1000 is a fully saturated color. So, an RGB color definition for black has all three components at 0.

FONT_DEF records (17):

Consists of:

This record associates an font encoding with a font name. See Definition records.

EQN_PREFS records (18):

Consists of:

When reading arrays, the number of values may be less than or greater than expected. MTEF readers should be driven by the array count. If the array is shorter than expected, assume defaults for the missing values. If the array is longer than expected, the extra values must be skipped to stay in sync with the MTEF stream.

Spacing values are written in the following order:

0

parmLINESPACE

Line spacing

1

parmMATRIXROW

Matrix row spacing

2

parmMATRIXCOL

Matrix column spacing

3

parmSUPHEIGHT

Superscript height

4

parmSUBDEPTH

Subscript depth

5

parmSUBSUPGAP

Sub/superscript gap

6

parmLIMHEIGHT

Limit height

7

parmLIMDEPTH

Limit depth

8

parmLIMSPACE

Limit line spacing

9

parmFRACTHEIGHT

Numerator height

10

parmFRACTDEPTH

Denominator depth

11

parmFRACTOVER

Fraction bar overhang

12

parmFRACTTHICK

Fraction bar thickness

13

parmFRACTTHICK2

Sub-fraction bar thickness

14

parmFRACTGAP

Slash/diagonal fraction gap

15

parmFENCEOVER

Fence overhang

16

parmOPERSPACING

Operator spacing (% of normal)

17

parmNONOPERSPACING

Non-operator spacing (% of normal)

18

parmCHARWIDTH

Character width adjustment

19

parmMINGAP

Minimum gap

20

parmVRADGAP

Radical gap (vertical)

21

parmHRADGAP

Radical gap (horizontal)

22

parmRADWIDTH

Radical width (% of normal)

23

parmEMBELLGAP

Embellishment gap

24

parmPRIMEHEIGHT

Prime Height

25

parmBOX_STROKE_THICK

Box stroke thickness

26

parmSTRIKE_THRU_THICK

Strike-through thickness

27

parmMATRIX_PART_THICK

Matrix partition line thickness

28

parmRAD_THICK

Radical stroke thickness

29

parmHORIZ_FENCE_GAP

Horizontal fence gap

The style definition array is written as a single byte count followed by that number of style definitions. The order is defined by Typeface values, however only fnTEXT through fnTEXT_FE are written. Each style definition is written as an unsigned integer that is 0 if the style is unused in the equation or is the index of the corresponding FONT_DEF record. If the style is used (not 0), it is followed by a single byte character style.

ENCODING_DEF records (19):

Consists of:

This record defines (see Definition records) a font encoding and is referred to by a FONT_DEF record. In order to reduce the size of the MTEF stream, the following 4 encodings are predefined:

ENCODING_DEF index

encoding name

1

MTCode

2

Unknown

3

Symbol

4

MTExtra

This means that the first ENCODING_DEF record in the MTEF stream is considered to have an index of 5. See Extending MathType's font and character information and MathType's character encodings for more information on font encodings.

Templates

This section shows the selector and variation codes for all the templates. The class names can be used to determine the order of subobjects in the list following the template tag (see Template subobject order).

Limit variations:

The following variation codes apply to all templates whose class is BigOpBoxClass or LimBoxClass:

variation bits

symbol

description

0×0001

tvBO_LOWER

lower limit is present

0×0002

tvBO_UPPER

upper limit is present

0×0040

tvBO_SUM

summation-style limit positions, else integral-style

Template selectors and variations:

Fences (parentheses, etc.):

selector

symbol

description

class

0

tmANGLE

angle brackets

ParBoxClass

1

tmPAREN

parentheses

ParBoxClass

2

tmBRACE

braces (curly brackets)

ParBoxClass

3

tmBRACK

square brackets

ParBoxClass

4

tmBAR

vertical bars

ParBoxClass

5

tmDBAR

double vertical bars

ParBoxClass

6

tmFLOOR

floor brackets

ParBoxClass

7

tmCEILING

ceiling brackets

ParBoxClass

8

tmOBRACK

open (white) brackets

ParBoxClass

variations

variation bits

symbol

description

:::

0×0001

tvFENCE_L

left fence is present

:::

0×0002

tvFENCE_R

right fence is present

Intervals:</wrap>

selector

symbol

description

class

9

tmINTERVAL

unmatched brackets and parentheses

ParBoxClass

variations

variation bits

symbol

description

:::

0×0000

tvINTV_LEFT_LP

left fence is left parenthesis

:::

0×0001

tvINTV_LEFT_RP

left fence is right parenthesis

:::

0×0002

tvINTV_LEFT_LB

left fence is left bracket

:::

0×0003

tvINTV_LEFT_RB

left fence is right bracket

:::

0×0000

tvINTV_RIGHT_LP

right fence is left parenthesis

:::

0×0010

tvINTV_RIGHT_RP

right fence is right parenthesis

:::

0×0020

tvINTV_RIGHT_LB

right fence is left bracket

:::

0×0030

tvINTV_RIGHT_RB

right fence is right bracket

Radicals (square and nth roots):

selector

symbol

description

class

10

tmROOT

radical

RootBoxClass

variations

variation

symbol

description

:::

0

tvROOT_SQ

square root

:::

1

tvROOT_NTH

nth root

Fractions:</wrap>

selector

symbol

description

class

11

tmFRACT

fractions

FracBoxClass

variations

variation bits

symbol

description

:::

0×0001

tvFR_SMALL

subscript-size slots (piece fraction)

:::

0×0002

tvFR_SLASH

fraction bar is a slash

:::

0×0004

tvFR_BASE

num. and denom. are baseline aligned

Over and Underbars:

selector

symbol

description

class

12

tmUBAR

underbar

BarBoxClass

13

tmOBAR

overbar

BarBoxClass

variations

variation bits

symbol

description

:::

0×0001

tvBAR_DOUBLE

bar is doubled, else single

Arrows:</wrap>

selector

symbol

description

class

14

tmARROW

arrow

ArroBoxClass

variations

variation

symbol

description

:::

0×0000

tvAR_SINGLE

single arrow

:::

0×0001

tvAR_DOUBLE

double arrow

:::

0×0002

tvAR_HARPOON

harpoon

:::

0×0004

tvAR_TOP

top slot is present

:::

0×0008

tvAR_BOTTOM

bottom slot is present

:::

0×0010

tvAR_LEFT

if single, arrow points left

:::

0×0020

tvAR_RIGHT

if single, arrow points right

:::

0×0010

tvAR_LOS

if double or harpoon, large over small

:::

0×0020

tvAR_SOL

if double or harpoon, small over large

Integrals (see Limit Variations):

selector

symbol

description

class

15

tmINTEG

integral

BigOpBoxClass

variations

variation

symbol

description

:::

0×0001

tvINT_1

single integral sign

:::

0×0002

tvINT_2

double integral sign

:::

0×0003

tvINT_3

triple integral sign

:::

0×0004

tvINT_LOOP

has loop w/o arrows

:::

0×0008

tvINT_CW_LOOP

has clockwise loop

:::

0×000C

tvINT_CCW_LOOP

has counter-clockwise loop

:::

0×0100

tvINT_EXPAND

integral signs expand

Sums, products, coproducts, unions, intersections, etc. (see Limit Variations):

selector

symbol

description

class

16

tmSUM

sum

BigOpBoxClass

17

tmPROD

product

BigOpBoxClass

18

tmCOPROD

coproduct

BigOpBoxClass

19

tmUNION

union

BigOpBoxClass

20

tmINTER

intersection

BigOpBoxClass

21

tmINTOP

integral-style big operator

BigOpBoxClass

22

tmSUMOP

summation-style big operator

BigOpBoxClass

Limits (see Limit Variations):

selector

symbol

description

class

23

tmLIM

limits

LimBoxClass

variations

variation

symbol

description

:::

0

tvSUBAR

single underbar

:::

1

tvDUBAR

double underbar

Horizontal braces and brackets:

selector

symbol

description

class

24

tmHBRACE

horizontal brace

HFenceBoxClass

25

tmHBRACK

horizontal bracket

HFenceBoxClass

variations

variation

symbol

description

:::

0×0001

tvHB_TOP

slot is on the top, else on the bottom

Long division:

selector

symbol

description

class

26

tmLDIV

long division

LDivBoxClass

variations

variation

symbol

description

:::

0×0001

tvLD_UPPER

upper slot is present

Subscripts and superscripts:

selector

symbol

description

class

27

tmSUB

subscript

ScrBoxClass

28

tmSUP

superscript

ScrBoxClass

29

tmSUBSUP

subscript and superscript

ScrBoxClass

variations

variation

symbol

description

:::

0×0001

tvSU_PRECEDES

script precedes scripted item, else follows

Dirac bra-ket notation:

selector

symbol

description

class

30

tmDIRAC

bra-ket notation

DiracBoxClass

variations

variation

symbol

description

:::

0×0001

tvDI_LEFT

left part is present

:::

0×0002

tvDI_RIGHT

right part is present

Vectors:</wrap>

selector

symbol

description

class

31

tmVEC

vector

HatBoxClass

variations

variation

symbol

description

:::

0×0001

tvVE_LEFT

arrow points left

:::

0×0002

tvVE_RIGHT

arrow points right

:::

0×0004

tvVE_UNDER

arrow under slot, else over slot

:::

0×0008

tvVE_HARPOON

harpoon

Hats, arcs, tilde, joint status:

selector

symbol

description

class

32

tmTILDE

tilde over characters

HatBoxClass

33

tmHAT

hat over characters

HatBoxClass

34

tmARC

arc over characters

HatBoxClass

35

tmJSTATUS

joint status construct

HatBoxClass

Overstrikes (cross-outs):

selector

symbol

description

class

36

tmSTRIKE

overstrike (cross-out)

StrikeBoxClass

variations

variation

symbol

description

:::

0×0001

tvST_HORIZ

line is horizontal, else slashes

:::

0×0002

tvST_UP

if slashes, slash from lower-left to upper-right is present

:::

0×0004

tvST_DOWN

if slashes, slash from upper-left to lower-right is present

Boxes:</wrap>

selector

symbol

description

class

37

tmBOX

box

TBoxBoxClass

variations

variation

symbol

description

:::

0×0001

tvBX_ROUND

corners are round, else square

:::

0×0002

tvBX_LEFT

left side is present

:::

0×0004

tvBX_RIGHT

right side is present

:::

0×0008

tvBX_TOP

top side is present

:::

0×0010

tvBX_BOTTOM

bottom side is present

Template subobject order:

Template subobjects appear in object lists in the order that matches the movement of the insertion point within a template in the MathType user interface. For template classes that have more than one slot, the following list shows the order of subobjects for all templates with that class:

ArroBoxClass: expanding arrows

  • main slot

  • arrow character

BigOpBoxClass: integrals, summations, products, etc.

  • main slot (summand, integrand)

  • upper slot

  • lower slot

  • large operator character

DiracBoxClass: three-part bracket structure

  • left slot

  • right slot

  • left angle bracket (optional)

  • vertical bar

  • right angle bracket (optional)

FracBoxClass: fractions with a horizontal bar

  • numerator slot

  • denominator slot

HFenceBoxClass horizontal expanding braces

  • main slot

  • small slot

  • brace character

LDivBoxClass long division

  • dividend slot

  • quotient slot

LimBoxClass limits

  • main slot

  • lower slot

  • upper slot

ParBoxClass parenthesized or bracketed slots

  • main slot

  • left fence character (optional)

  • right fence character (optional)

RootBoxClass radical sign

  • main slot

  • radicand slot

ScrBoxClass subscripts and superscripts

  • subscript slot

  • superscript slot

SlashBoxClass fractions with a diagonal bar

  • numerator slot

  • denominator slot

Example

In order to illustrate MTEF with a concrete example, in this section will examine the MTEF byte stream in detail for the quadratic formula:

quadratic2.gif

For this equation, MathType 7.0 for Windows generates the following MTEF:

byte position

byte value

meaning

record

0

0×0000

5, 0×05

MTEF version

header

1

0×0001

1, 0×01

Windows

:::

2

0×0002

0, 0×00

MathType

:::

3

0×0003

7, 0×07

MT major version

:::

4

0×0004

0, 0×00

MT minor version

:::

5

0×0005

68, 0×44, 'D'

application key

:::

6

0×0006

83, 0×53, 'S'

:::

:::

7

0×0007

77, 0×4D, 'M'

:::

:::

8

0×0008

84, 0×54, 'T'

:::

:::

9

0×0009

55, 0×37, '7'

:::

:::

10

0×000A

0, 0×00

:::

:::

11

0×000B

0, 0×00

equation options

:::

12

0×000C

19, 0×13

record type

ENCODING_DEF encoding #5

13

0×000D

87, 0×57, 'W'

encoding name "WinAllBasicCodePages"

:::

14

0×000E

105, 0×69, 'i'

:::

:::

15

0×000F

110, 0×6E, 'n'

:::

:::

16

0×0010

65, 0×41, 'A'

:::

:::

17

0×0011

108, 0×6C, 'l'

:::

:::

18

0×0012

108, 0×6C, 'l'

:::

:::

19

0×0013

66, 0×42, 'B'

:::

:::

20

0×0014

97, 0×61, 'a'

:::

:::

21

0×0015

115, 0×73, 's'

:::

:::

22

0×0016

105, 0×69, 'i'

:::

:::

23

0×0017

99, 0×63, 'c'

:::

:::

24

0×0018

67, 0×43, 'C'

:::

:::

25

0×0019

111, 0×6F, 'o'

:::

:::

26

0×001A

100, 0×64, 'd'

:::

:::

27

0×001B

101, 0×65, 'e'

:::

:::

28

0×001C

80, 0×50, 'P'

:::

:::

29

0×001D

97, 0×61, 'a'

:::

:::

30

0×001E

103, 0×67, 'g'

:::

:::

31

0×001F

101, 0×65, 'e'

:::

:::

32

0×0020

115, 0×73, 's'

:::

:::

33

0×0021

0, 0×00

:::

:::

34

0×0022

17, 0×11

record type

FONT_DEF font def #1

35

0×0023

5, 0×05

index of encoding WinAllBasicCodePages

:::

36

0×0024

84, 0×54, 'T'

font name "Times New Roman"

:::

37

0×0025

105, 0×69, 'i'

:::

:::

38

0×0026

109, 0×6D, 'm'

:::

:::

39

0×0027

101, 0×65, 'e'

:::

:::

40

0×0028

115, 0×73, 's'

:::

:::

41

0×0029

32, 0×20, ' '

:::

:::

42

0×002A

78, 0×4E, 'N'

:::

:::

43

0×002B

101, 0×65, 'e'

:::

:::

44

0×002C

119, 0×77, 'w'

:::

:::

45

0×002D

32, 0×20, ' '

:::

:::

46

0×002E

82, 0×52, 'R'

:::

:::

47

0×002F

111, 0×6F, 'o'

:::

:::

48

0×0030

109, 0×6D, 'm'

:::

:::

49

0×0031

97, 0×61, 'a'

:::

:::

50

0×0032

110, 0×6E, 'n'

:::

:::

51

0×0033

0, 0×00

:::

:::

52

0×0034

17, 0×11

record type

FONT_DEF font def #2

53

0×0035

3, 0×03

index of encoding Symbol

:::

54

0×0036

83, 0×53, 'S'

font name "Symbol"

:::

55

0×0037

121, 0×79, 'y'

:::

:::

56

0×0038

109, 0×6D, 'm'

:::

:::

57

0×0039

98, 0×62, 'b'

:::

:::

58

0×003A

111, 0×6F, 'o'

:::

:::

59

0×003B

108, 0×6C, 'l'

:::

:::

60

0×003C

0, 0×00

:::

:::

61

0×003D

17, 0×11

record type

FONT_DEF font def #3

62

0×003E

5, 0×05

index of encoding WinAllBasicCodePages

:::

63

0×003F

67, 0×43, 'C'

font name "Courier New"

:::

64

0×0040

111, 0×6F, 'o'

:::

:::

65

0×0041

117, 0×75, 'u'

:::

:::

66

0×0042

114, 0×72, 'r'

:::

:::

67

0×0043

105, 0×69, 'i'

:::

:::

68

0×0044

101, 0×65, 'e'

:::

:::

69

0×0045

114, 0×72, 'r'

:::

:::

70

0×0046

32, 0×20, ' '

:::

:::

71

0×0047

78, 0×4E, 'N'

:::

:::

72

0×0048

101, 0×65, 'e'

:::

:::

73

0×0049

119, 0×77, 'w'

:::

:::

74

0×004A

0, 0×00

:::

:::

75

0×004B

17, 0×11

record type

FONT_DEF font def #4

76

0×004C

4, 0×04

index of encoding MTExtra

:::

77

0×004D

77, 0×4D, 'M'

font name "MT Extra"

:::

78

0×004E

84, 0×54, 'T'

:::

:::

79

0×004F

32, 0×20, ' '

:::

:::

80

0×0050

69, 0×45, 'E'

:::

:::

81

0×0051

120, 0×78, 'x'

:::

:::

82

0×0052

116, 0×74, 't'

:::

:::

83

0×0053

114, 0×72, 'r'

:::

:::

84

0×0054

97, 0×61, 'a'

:::

:::

85

0×0055

0, 0×00

:::

:::

86

0×0056

18, 0×12

record type

EQN_PREFS

87

0×0057

0, 0×00

options

:::

88

0×0058

8, 0×08

size array count

:::

89

0×0059

33, 0×21, '!'

nibble array containing: size #1: "12 points" size #2: "58 %" size #3: "42 %" size #4: "150 %" size #5: "100 %" size #6: "75 %" size #7: "150 %" size #8: "1 point"

:::

90

0×005A

47, 0×2F, '/'

:::

:::

91

0×005B

69, 0×45, 'E'

:::

:::

92

0×005C

143, 0×8F

:::

:::

93

0×005D

68, 0×44, 'D'

:::

:::

94

0×005E

47, 0×2F, '/'

:::

:::

95

0×005F

65, 0×41, 'A'

:::

:::

96

0×0060

80, 0×50, 'P'

:::

:::

97

0×0061

244, 0×F4

:::

:::

98

0×0062

16, 0×10

:::

:::

99

0×0063

15, 0×0F

:::

:::

100

0×0064

71, 0×47, 'G'

:::

:::

101

0×0065

95, 0×5F, '_'

:::

:::

102

0×0066

65, 0×41, 'A'

:::

:::

103

0×0067

80, 0×50, 'P'

:::

:::

104

0×0068

242, 0×F2

:::

:::

105

0×0069

31, 0×1F

:::

:::

106

0×006A

30, 0×1E

spacing array count

:::

107

0×006B

65, 0×41, 'A'

nibble array containing 30 values

:::

108

0×006C

80, 0×50, 'P'

:::

:::

109

0×006D

244, 0×F4

:::

:::

110

0×006E

21, 0×15

:::

:::

111

0×006F

15, 0×0F

:::

:::

112

0×0070

65, 0×41, 'A'

:::

:::

113

0×0071

0, 0×00

:::

:::

114

0×0072

244, 0×F4

:::

:::

115

0×0073

69, 0×45, 'E'

:::

:::

116

0×0074

244, 0×F4

:::

:::

117

0×0075

37, 0×25, '%'

:::

:::

118

0×0076

244, 0×F4

:::

:::

119

0×0077

143, 0×8F

:::

:::

120

0×0078

66, 0×42, 'B'

:::

:::

121

0×0079

95, 0×5F, '_'

:::

:::

122

0×007A

65, 0×41, 'A'

:::

:::

123

0×007B

0, 0×00

:::

:::

124

0×007C

244, 0×F4

:::

:::

125

0×007D

16, 0×10

:::

:::

126

0×007E

15, 0×0F

:::

:::

127

0×007F

67, 0×43, 'C'

:::

:::

128

0×0080

95, 0×5F, '_'

:::

:::

129

0×0081

65, 0×41, 'A'

:::

:::

130

0×0082

0, 0×00

:::

:::

131

0×0083

242, 0×F2

:::

:::

132

0×0084

31, 0×1F

:::

:::

133

0×0085

This error message can appear when you open Word or you click in the remnant 'MathType' tab in Word:

:::

:::

134

0×0086

165, 0×A5

:::

:::

135

0×0087

242, 0×F2

:::

:::

136

0×0088

10, 0×0A

:::

:::

137

0×0089

37, 0×25

:::

:::

138

0×008A

244, 0×F4

:::

:::

139

0×008B

143, 0×8F

:::

:::

140

0×008C

65, 0×41, '!'

:::

:::

141

0×008D

244, 0×F4

:::

:::

142

0×008E

16, 0×10

:::

:::

143

0×008F

15, 0×0F

:::

:::

144

0×0090

64, 0×41, 'A'

:::

:::

145

0×0091

0, 0×00

:::

:::

146

0×0092

244, 0×F4

:::

:::

147

0×0093

15, 0×0F

:::

:::

148

0×0094

72, 0×48, 'H'

:::

:::

149

0×0095

244, 0×F4

:::

:::

150

0×0096

23, 0×17

:::

:::

151

0×0097

244, 0×F4

:::

:::

152

0×0098

143, 0×8F

:::

:::

153

0×0099

64, 0×41, 'A'

:::

:::

154

0×009A

0, 0×00

:::

:::

155

0×009B

242, 0×F2

:::

:::

156

0×009C

26, 0×1A

:::

:::

157

0×009D

95, 0×5F, '_'

:::

:::

158

0×009E

68, 0×44, 'D'

:::

:::

159

0×009F

95, 0×5F, '_'

:::

:::

160

0×00A0

69, 0×45, 'E'

:::

:::

161

0×00A1

244, 0×F4

:::

:::

162

0×00A2

95, 0×5F, '_'

:::

:::

163

0×00A3

69, 0×45, 'E'

:::

:::

164

0×00A4

244, 0×F4

:::

:::

165

0×00A5

95, 0×5F, '_'

:::

:::

166

0×00A6

65, 0×41, 'A'

:::

:::

167

0×00A7

15, 0×0F

:::

:::

168

0×00A8

12, 0×0C

style array count

:::

169

0×00A9

1, 0×01

style #1: font def #1, plain

:::

170

0×00AA

0, 0×00

:::

:::

171

0×00AB

1, 0×01

style #2: font def #1, plain

:::

172

0×00AC

0, 0×00

:::

:::

173

0×00AD

1, 0×01

style #3: font def #1, italic

:::

174

0×00AE

2, 0×02

:::

:::

175

0×00AF

2, 0×02

style #4: font def #2, italic

:::

176

0×00B0

2, 0×02

:::

:::

177

0×00B1

2, 0×02

style #5: font def #2, plain

:::

178

0×00B2

0, 0×00

:::

:::

179

0×00B3

2, 0×02

style #6: font def #2, plain

:::

180

0×00B4

0, 0×00

:::

:::

181

0×00B5

1, 0×01

style #7: font def #1, bold

:::

182

0×00B6

1, 0×01

:::

:::

183

0×00B7

1, 0×01

style #8: font def #1, plain

:::

184

0×00B8

0, 0×00

:::

:::

185

0×00B9

3, 0×03

style #9: font def #3, plain

:::

186

0×00BA

0, 0×00

:::

:::

187

0×00BB

1, 0×01

style #10: font def #1, plain

:::

188

0×00BC

0, 0×00

:::

:::

189

0×00BD

4, 0×04

style #11: font def #4, plain

:::

190

0×00BE

0, 0×00

:::

:::

191

0×00BF

0, 0×00

style #12: (not used)

:::

192

0×00C0

10, 0×0A

record type

SIZE_FULL

193

0×00C1

1, 0×01

record type

LINE

194

0×00C2

0, 0×00

options

:::

195

0×00C3

3, 0×03

record type

TMPL fraction

196

0×00C4

0, 0×00

options

:::

197

0×00C5

11, 0×0B

selector: tmFRACT

:::

198

0×00C6

0, 0×00

variation: none

:::

199

0×00C7

0, 0×00

template-specific options

:::

200

0×00C8

1, 0×01

record type

LINE numerator

201

0×00C9

0, 0×00

options

:::

202

0×00CA

2, 0×02

record type

CHAR – (minus sign)

203

0×00CB

4, 0×04

options: mtefOPT_CHAR_ENC_CHAR_8

:::

204

0×00CC

134, 0×86

typeface: 134 - 128 = 6 (Symbol style)

:::

205

0×00CD

18, 0×12

MTCode value: 0×2212 (minus sign)

:::

206

0×00CE

34, 0×22, '""""'

:::

:::

207

0×00CF

45, 0×2D, '-'

font-encoded value: 0×2D (minus sign)

:::

208

0×00D0

2, 0×02

record type

CHAR b

209

0×00D1

0, 0×00

options

:::

210

0×00D2

131, 0×83

typeface: 131 - 128 = 3 (Variable style)

:::

211

0×00D3

98, 0×62, 'b'

MTCode value: 0×0062 ('b')

:::

212

0×00D4

0, 0×00

:::

:::

213

0×00D5

2, 0×02

record type

CHAR plus-minus sign: ±

214

0×00D6

4, 0×04

options: mtefOPT_CHAR_ENC_CHAR_8

:::

215

0×00D7

134, 0×86

typeface: 134 - 128 = 6 (Symbol style)

:::

216

0×00D8

177, 0×B1

MTCode value: 0×00B1 (plus-minus sign)

:::

217

0×00D9

0, 0×00

:::

:::

218

0×00DA

177, 0×B1

font-encoded value: 0×B1 (plus-minus sign)

:::

219

0×00DB

3, 0×03

record type

TMPL square root

220

0×00DC

0, 0×00

options

:::

221

0×00DD

10, 0×0A

selector: tmROOT

:::

222

0×00DE

0, 0×00

variations: tvROOT_SQ (square root)

:::

223

0×00DF

0, 0×00

template-specific options

:::

224

0×00E0

1, 0×01

record type

LINE radicand

225

0×00E1

0, 0×00

options

:::

226

0×00E2

2, 0×02

record type

CHAR b

227

0×00E3

0, 0×00

options

:::

228

0×00E4

131, 0×83

typeface: 131 - 128 = 3 (Variable style)

:::

229

0×00E5

98, 0×62, 'b'

MTCode value: 0×0062 ('b')

:::

230

0×00E6

0, 0×00

:::

:::

231

0×00E7

3, 0×03

record type

TMPL superscript

232

0×00E8

0, 0×00

options

:::

233

0×00E9

28, 0×1C

selector: tmSUP

:::

234

0×00EA

0, 0×00

variations: none

:::

235

0×00EB

0, 0×00

template-specific options

:::

236

0×00EC

11, 0×0B

record type

SIZE_SUB

237

0×00ED

1, 0×01

record type

LINE missing superscript

238

0×00EE

1, 0×01

options: mtefOPT_LINE_NULL

:::

239

0×00EF

1, 0×01

record type

LINE subscript

240

0×00F0

0, 0×00

options

:::

241

0×00F1

2, 0×02

record type

CHAR 2

242

0×00F2

0, 0×00

options

:::

243

0×00F3

136, 0×88

typeface: 136 - 128 = 8 (Number style)

:::

244

0×00F4

50, 0×32, '2'

MTCode value: 0×0032 ('2')

:::

245

0×00F5

0, 0×00

:::

:::

246

0×00F6

0, 0×00

record type

END of subscript line

247

0×00F7

0, 0×00

record type

END of subscript template

248

0×00F8

10, 0×0A

record type

SIZE_FULL

249

0×00F9

2, 0×02

record type

CHAR – (minus sign)

250

0×00FA

4, 0×04

options: mtefOPT_CHAR_ENC_CHAR_8

:::

251

0×00FB

134, 0×86

typeface: 134 - 128 = 6 (Symbol style)

:::

252

0×00FC

18, 0×12

MTCode value: 0×2212 (minus sign)

:::

253

0×00FD

34, 0×22, '""""'

:::

:::

254

0×00FE

45, 0×2D, '-'

font-encoded value: 0×2D (minus sign)

:::

255

0×00FF

38, 0×26

:::

:::

256

0×0100

2, 0×02

record type

CHAR 4

257

0×0101

0, 0×00

options

:::

258

0×0102

136, 0×88

typeface: 136 - 128 = 8 (Number style)

:::

259

0×0103

52, 0×34, '4'

MTCode value: 0×0034 ('4')

:::

260

0×0104

0, 0×00

:::

:::

261

0×0105

2, 0×02

record type

CHAR a

262

0×0106

0, 0×00

options

:::

263

0×0107

131, 0×83

typeface: 131 - 128 = 3 (Variable style)

:::

264

0×0108

97, 0×61, 'a'

MTCode value: 0×0061 ('a')

:::

265

0×0109

0, 0×00

:::

:::

266

0×010A

2, 0×02

record type

CHAR c

267

0×010B

0, 0×00

options

:::

268

0×010C

131, 0×83

typeface: 131 - 128 = 3 (Variable style)

:::

269

0×010D

99, 0×63, 'c'

MTCode value: 0×0063 ('c')

:::

270

0×010E

0, 0×00

:::

:::

271

0×010F

0, 0×00

record type

END of radicand line

272

0×0110

11, 0×0B

record type

SIZE_SUB

273

0×0111

1, 0×01

record type

LINE missing radicand

274

0×0112

1, 0×01

options: mtefOPT_LINE_NULL

:::

275

0×0113

0, 0×00

record type

END of radical template

276

0×0114

0, 0×00

record type

END of numerator line

277

0×0115

10, 0×0A

record type

SIZE_FULL

278

0×0116

1, 0×01

record type

LINE denominator

279

0×0117

0, 0×00

options

:::

280

0×0118

2, 0×02

record type

CHAR 2

281

0×0119

0, 0×00

options

:::

282

0×011A

136, 0×88

typeface: 136 - 128 = 8 (Number style)

:::

283

0×011B

50, 0×32, '2'

MTCode value: 0×0032 ('2')

:::

284

0×011C

0, 0×00

:::

:::

285

0×011D

2, 0×02

record type

CHAR a

286

0×011E

0, 0×00

options

:::

287

0×011F

131, 0×83

typeface: 131 - 128 = 3 (Variable style)

:::

288

0×0120

97, 0×61, 'a'

MTCode value: 0×0061 ('a')

:::

289

0×0121

0, 0×00

:::

:::

290

0×0122

0, 0×00

record type

END of denominator line

291

0×0123

0, 0×00

record type

END of fraction template

292

0×0124

0, 0×00

record type

END of equation line

293

0×0125

0, 0×00

record type

END of equation

<a><button>Back to MathType SDK intro page</button></a>