-- TexMathDefs.Mesa

-- definitions for math mode
-- last written by Doug Wyatt, October 18, 1979  5:29 PM

DIRECTORY
	TexDefs: FROM "TexDefs" USING [Char];

TexMathDefs: DEFINITIONS =
BEGIN OPEN TexDefs;

MFont: TYPE = {rm, it, sy, ex}; -- math font type
nMFonts: CARDINAL = 4; -- be sure this agrees with MFont

MChar: TYPE = RECORD[mfont: MFont, char: Char]; -- math font and character

MType: TYPE = {Ord,Op,Bin,Rel,Open,Close,Punct}; -- math char type
TMChar: TYPE = RECORD[type: MType, mchar: MChar]; -- MChar with type

StyleStyle: TYPE = {disp, text, script, scriptscript};
StyleVariant: TYPE = {norm, atop};
MathStyle: TYPE = RECORD[variant: StyleVariant, style: StyleStyle];

MathSize: TYPE = {text, scr, scrscr};
nMathSizes: CARDINAL = 3; -- be sure this agrees with MathSize

mftsize: CARDINAL = nMFonts*nMathSizes;
MathFontTableIndex: TYPE = [0..mftsize);

MFTIndex: PROCEDURE[mfont: MFont, msize: MathSize]
	RETURNS[MathFontTableIndex] = INLINE
	BEGIN
	RETURN[nMFonts*LOOPHOLE[msize,CARDINAL]+LOOPHOLE[mfont,CARDINAL]];
	END;

DelimChar: TYPE = RECORD[exists: BOOLEAN, mchar: MChar];
nullDelimChar: DelimChar = [exists: FALSE, mchar: [rm,0C]];
Delimiter: TYPE = RECORD[small, large: DelimChar];
nullDelimiter: Delimiter=[nullDelimChar,nullDelimChar];

MathSpace: TYPE = {nil, thin, thick, quad, negthin, negthick, negop,
	user, no, op, th, negth};

-- SType is style of a scripted noad
SType: TYPE = {none, vctr, op, sqrt, over, under, accent};
VctrType: TYPE = {vcenter, vtop};
DelimType: TYPE = {left, right};
AboveType: TYPE = {above, atop, over, comb};

END.