module Mathtype5

COLOR records (15): Consists of: record type (15)

color_def_index

index of corresponding COLOR_DEF record (unsigned integer)

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 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.

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)

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.

record type (18)

options

none defined in this version of MTEF

sizes

dimension array for typesize definitions

spaces

dimension array for spacing definitions (see below)

styles

array of style definitions (see below)

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.

FONT_DEF records (17): Consists of: record type (17)

enc_def_index

index of corresponding ENCODING_DEF record (unsigned integer)

name

null-terminated font name

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

FONT_STYLE_DEF record (8): Consists of: record type (8)

font_def_index

index of mtefFONT_DEF record (unsigned integer)

char_style

character style bits

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

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).

LINE record (1): Consists of: record type (1) options

nudge

if mtefOPT_NUDGE is set

line spacing

if mtefOPT_LINE_LSPACE is set (16-bit integer)

RULER record

if mtefOPT_LP_RULER is set

object list of line (single pile, characters and templates, or nothing) The line spacing value, if present, is the distance between the baseline of this line and the line above it.

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.

record type (4) options

nudge

if mtefOPT_NUDGE is set

halign

horizontal alignment

valign

vertical alignment

[RULER record]

if mtefOPT_LP_RULER is set

object list

list of lines contained by the pile

if lsize < 0 (explicit point size): record type (9) 101 -point size (16 bit integer) else if -128 < dsize < +128: record type (9) lsize (typesize) dsize + 128 else: (large delta) record type (9) 100 lsize (typesize) dsize (16 bit integer) 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.

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 0x0001 tvFENCE_L left fence is present 0x0002 tvFENCE_R right fence is present Intervals: selector symbol description class 9 tmINTERVAL unmatched brackets and parentheses ParBoxClass variations variation bits symbol description 0x0000 tvINTV_LEFT_LP left fence is left parenthesis 0x0001 tvINTV_LEFT_RP left fence is right parenthesis 0x0002 tvINTV_LEFT_LB left fence is left bracket 0x0003 tvINTV_LEFT_RB left fence is right bracket 0x0000 tvINTV_RIGHT_LP right fence is left parenthesis 0x0010 tvINTV_RIGHT_RP right fence is right parenthesis 0x0020 tvINTV_RIGHT_LB right fence is left bracket 0x0030 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: selector symbol description class 11 tmFRACT fractions FracBoxClass variations variation bits symbol description 0x0001 tvFR_SMALL subscript-size slots (piece fraction) 0x0002 tvFR_SLASH fraction bar is a slash 0x0004 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 0x0001 tvBAR_DOUBLE bar is doubled, else single Arrows: selector symbol description class 14 tmARROW arrow ArroBoxClass variations variation symbol description 0x0000 tvAR_SINGLE single arrow 0x0001 tvAR_DOUBLE double arrow 0x0002 tvAR_HARPOON harpoon 0x0004 tvAR_TOP top slot is present 0x0008 tvAR_BOTTOM bottom slot is present 0x0010 tvAR_LEFT if single, arrow points left 0x0020 tvAR_RIGHT if single, arrow points right 0x0010 tvAR_LOS if double or harpoon, large over small 0x0020 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 0x0001 tvINT_1 single integral sign 0x0002 tvINT_2 double integral sign 0x0003 tvINT_3 triple integral sign 0x0004 tvINT_LOOP has loop w/o arrows 0x0008 tvINT_CW_LOOP has clockwise loop 0x000C tvINT_CCW_LOOP has counter-clockwise loop 0x0100 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

variation symbol  description

0x0001 tvHB_TOP slot is on the top, else on the bottom Long division: selector symbol description class 26 tmLDIV long division LDivBoxClass

variation symbol  description

0x0001 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

variation symbol  description

0x0001 tvSU_PRECEDES script precedes scripted item, else follows Dirac bra-ket notation: selector symbol description class 30 tmDIRAC bra-ket notation DiracBoxClass

variation symbol  description

0x0001 tvDI_LEFT left part is present 0x0002 tvDI_RIGHT right part is present Vectors: selector symbol description class 31 tmVEC vector HatBoxClass

variation symbol  description

0x0001 tvVE_LEFT arrow points left 0x0002 tvVE_RIGHT arrow points right 0x0004 tvVE_UNDER arrow under slot, else over slot 0x0008 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

variation symbol  description

0x0001 tvST_HORIZ line is horizontal, else slashes 0x0002 tvST_UP if slashes, slash from lower-left to upper-right is present 0x0004 tvST_DOWN if slashes, slash from upper-left to lower-right is present Boxes: selector symbol description class 37 tmBOX box TBoxBoxClass

variation symbol  description

0x0001 tvBX_ROUND corners are round, else square 0x0002 tvBX_LEFT left side is present 0x0004 tvBX_RIGHT right side is present 0x0008 tvBX_TOP top side is present 0x0010 tvBX_BOTTOM bottom side is present

Constants

HALIGN
OPTIONS
RECORD_NAMES
VALIGN