// mathml1base.tdl --- Copyright (c) 1987-2010 by Design Science, Inc.

// Copyright (c) 2001-2003 by Design Science, Inc.
// License: You are allowed to create your own translators based on the contents of this file
// solely for use with MathType. It is recommended that you change the filename, title, and description
// in the first line of this file so as to reflect your modifications and the change of author and purpose.
// Design Science, Inc. is not responsible for any damages caused by the use of this file or derived works.

// $Header: /MathType/Translators/MathML1base.tdl 13    1/19/10 12:34p Jimm $

// This file contains a basic set of MathML translation rules 
// for MathML 1.0 (http://www.w3.org/TR/REC-mathml)


// =====================================================
// Top-level Equation Translation Rules   
// =====================================================

comment   = "<!-- # -->$n";     // HTML comment string for MTEF data
eqndatachars = "@+=";           // characters used to delimit and encode MTEF 
                                // in comments (must be 3 chars exactly)
                                // Irrelevant in this case since MTEF
                                // data is included with <semantics>
vardelims = "()";

// variables for top level translation
var/"BeginMathDisplay" = "<math display='block'>";
var/"BeginMathInline" = "<math>";
var/"TransAndData" = "<semantics>$+$n#$n<annotation encoding='MathType-MTEF'>(EqnData)</annotation>$-$n</semantics>";
var/"EndMath" = "</math>";

// default top-level display equation translation with MTEF data
eqn/eqndata	=	"(StdStartCmt)(BeginMathDisplay)$+$n(TransAndData)$-$n"
					"(EndMath)$n(StdEndCmt)";
// default top-level inline equation translation with MTEF data
eqn/eqndata/inline	=	"(StdStartCmt)(BeginMathInline)$+$n(TransAndData)$-$n"
					"(EndMath)$n(StdEndCmt)";
// default top-level display equation translation without MTEF data
eqn	= 			"(StdStartCmt)(BeginMathDisplay)$+$n#$-$n"
					"(EndMath)$n(StdEndCmt)";
// default top-level inline equation translation without MTEF data
eqn/inline	= 	"(StdStartCmt)(BeginMathInline)$+$n#$-$n"
					"(EndMath)$n(StdEndCmt)";

// =====================================================
// Basic Translation Strings and Default Definitions
// =====================================================

// sepchar = "#"                                  // separator character
// escchar = "$"                                  // escape character

indent    = "   ";                                // string to output for each indent level

// common multi-characters run definitions

styletype/user1   = textmode;                     // User1 style is treated as text
styletype/user2   = textmode;                     // User2 style is treated as text 

run/user1style   = "<mtext>#</mtext>";            // run of User1 style characters 
run/user2style   = "<mtext>#</mtext>";            // run of User2 style characters 

// run of Text style characters 
run/text/single  = "<mtext>#</mtext>";          

// run of Vector style characters 
run/vector  = "<mstyle fontweight='bold' fontstyle='normal'>#</mstyle>";       

number      = "<mn>#</mn>";                       // run of Number style characters


// =====================================================
// Slots in Various Locations
// =====================================================

//    No "lim" slot translation rules are given, since
//    they require no special handling in MathML, and can be allowed 
//    to default to these cases.

// default slot translation (empty, 1 char, and 1 char w/embell.)

slot          = "<mrow>$+$n#$-$n</mrow>";             // default
slot/0        = "<mrow></mrow>";                      // 0 characters
slot/1        = "#";                                  // 1 character
slot/1/e      = "#";                                  // 1 character with embellishment

// slots at the top level with a single character can be omited

slot/t/0      = "<mrow></mrow>";
slot/t/1      = "#";
slot/t/1/e    = "#";

// slots in piles will already be wrapped in <mtd>'s and
// thus require no explicit mrow

slot/p        = "#";                                  // default
slot/p/0      = "<mrow></mrow>";                      // 0 characters
slot/p/1      = "#";                                  // 1 character
slot/p/1/e    = "#";                                  // 1 character with embellishment


// =====================================================
// Matrices
// =====================================================

// matrix translation (left, center, right)
matrix/l    = "<mtable columnalign='left'>$+$n#$-$n</mtable>$n";
matrix      = "<mtable>$+$n#$-$n</mtable>$n";
matrix/r    = "<mtable columnalign='right'>$+$n#$-$n</mtable>$n";

// matrix line translation (left, center, right)
matrow/l   = "<mtr columnalign='left'>$+$n#$-$n</mtr>$n";
matrow     = "<mtr>$+$n#$-$n</mtr>$n";
matrow/r   = "<mtr columnalign='right'>$+$n#$-$n</mtr>$n";

// matrix element translation (except for last element) (left, center, right)
matelem/l   = "<mtd columnalign='left'>$+$n#$-$n</mtd>$n";
matelem     = "<mtd>$+$n#$-$n</mtd>$n";
matelem/r   = "<mtd columnalign='right'>$+$n#$-$n</mtd>$n";

// matrix element translation (last element only) (left, center, right)
matelem/last/l   = "<mtd columnalign='left'>$+$n#$-$n</mtd>";
matelem/last     = "<mtd>$+$n#$-$n</mtd>";
matelem/last/r   = "<mtd columnalign='right'>$+$n#$-$n</mtd>";

// ---------------- MathML Translation Warning -----------------------

//  Matrix partition lines are handled in a different way in MathML
//  so no direct translation from MathType to MathML is possible.

//  Horizontal matrix partition lines (solid, dashed, dotted)
//  currently must be translated into MathML by hand, as attributes
//  of the enclosing mtable, e.g. <mtable rowlines='none solid none'>...

//hline                   = "";
//hline/dash              = "";
//hline/dot               = "";

//  Vertical matrix partition lines (solid, dashed, dotted)
//  currently must be translated into MathML by hand, as attributes
//  of the enclosing mtable, e.g. <mtable columnlines='none solid none'>...

//vline                   = "";
//vline/dash              = "";
//vline/dot               = "";

// =====================================================
// Pile translations (handled as tables in MathML)
// =====================================================

//    Only basic pile translation rules are specified, since
//    top-level, and reduce-sized pile need no special handling 
//    in MathML, and can be allowed to default to these cases.

//    embedded, without alignment marks (left, center, right)
pile        = "<mtable>$+$n<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n</mtr>$n"
              "<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n</mtr>$-$n</mtable>$n";
pile/l      = "<mtable columnalign='left'>$+$n<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n"
              "</mtr>$n<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n</mtr>$-$n</mtable>$n";
pile/r      = "<mtable columnalign='right'>$+$n<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n"
              "</mtr>$n<mtr>$+$n<mtd>$+$n#$-$n</mtd>$-$n</mtr>$-$n</mtable>$n";
pile/dec    = "<mtable groupalign='decimalpoint'>$+$n<mtr>$+$n<mtd>$+$n<maligngroup/>"
              "#$-$n</mtd>$-$n</mtr>$n<mtr>$+$n<mtd>$+$n<maligngroup/>"
              "#$-$n</mtd>$-$n</mtr>$-$n</mtable>$n";
pile/al     = "<mtable>$+$n<mtr>$+$n<mtd>$+$n<maligngroup/>"
              "#$-$n</mtd>$-$n</mtr>$n<mtr>$+$n<mtd>$+$n<maligngroup/>"
              "#$-$n</mtd>$-$n</mtr>$-$n</mtable>$n";

// ---------------- MathML Translation Warning -----------------------

// MathML requires placing a <malignmark/> element before each
// equal sign to be aligned.  There is no automated way of
// doing this in TDL.

// -------------------------------------------------------------------

//pile/eq      = "";


// =====================================================
// Fences, Intervals, etc.
// =====================================================

// In many cases, the fence related MathType templates
// could be better translated as an <mfenced> MathML
// contruction.  However, in general, the more basic
// <mrow>/<mo> construction is probably more robust.

// parentheses (both)
paren         = "<mrow><mo>(</mo>$+$n#1$-$n<mo>)</mo></mrow>$n";
// brackets (both)
brack         = "<mrow><mo>[</mo> #1 <mo>]</mo></mrow>";
// braces (both)
brace         = "<mrow><mo>{</mo> #1 <mo>}</mo></mrow>";       
// angle brackets 
abrack        = "<mrow><mo>&langle;</mo> #1 <mo>&rangle;</mo></mrow>";     
// bars (both)
bar           = "<mrow><mo>|</mo> #1 <mo>|</mo></mrow>";
// floor 
floor         = "<mrow><mo>&lfloor;</mo> #1 <mo>&rfloor;</mo></mrow>";  
// ceiling 
ceil          = "<mrow><mo>&lceil;</mo> #1 <mo>&rceil;</mo></mrow>";  
// left bracket, left bracket interval 
intval/lblb   = "<mrow> <mo>[</mo> #1 <mo>[</mo> </mrow>";    
// right bracket, right bracket interval 
intval/rbrb   = "<mrow><mo>]</mo> #1 <mo>]</mo></mrow>";    
// right bracket, left bracket interval 
intval/rblb   = "<mrow><mo>]</mo> #1 <mo>[</mo></mrow>";    
// left bracket, right paren interval 
intval/lbrp   = "<mrow><mo>[</mo> #1 <mo>)</mo></mrow>";
// left paren, right bracket interval 
intval/lprb   = "<mrow><mo>(</mo> #1 <mo>]</mo></mrow>";                
// parentheses (left)
paren/l       = "<mrow><mo>(</mo> #1</mrow>";                
// parentheses (right)
paren/r       = "<mrow> #1 <mo>)</mo></mrow>";                
// brackets (left)
brack/l       = "<mrow> <mo>[</mo> #1 </mrow>";                
// brackets (right)
brack/r       = "<mrow>#1 <mo>]</mo></mrow>";               
// braces (left) 
brace/l       = "<mrow><mo>{</mo> #1 </mrow>";
// braces (right)
brace/r       = "<mrow>#1 <mo>}</mo></mrow>";               
// angle brackets (left)
abrack/l      = "<mrow><mo>&langle;</mo>#1</mrow>";          
// angle brackets (right)
abrack/r      = "<mrow>#1<mo>&rangle;</mo></mrow>";         
// bars (left)
bar/l         = "<mrow><mo>|</mo>#1</mrow>";                
// bars (right)
bar/r         = "<mrow>#1<mo>|</mo></mrow>";                
// dirac (right)
braket/r      = "<mrow><mo>|</mo>#2<mo>&rangle;</mo></mrow>";         
// dirac (left)
braket/l      = "<mrow><mo>&langle;</mo>#1<mo>|</mo></mrow>";          
// braket
braket        = "<mrow><mo>&langle;</mo>#1<mo>|</mo>#2<mo>"
                "&rangle;</mo></mrow>";

// The following translation rules belong in this section, but are
// curretly defined in the specialized tdl files (which include 
// this file), since most involve a choice of entity synonyms

// double bars (both) dbar   
// double bars (right) dbar/r   
// double bars (left) dbar/l   
// open brackets (both) obrack
// open bracket (right) obrack/r
// open bracket (left) obrack/l
// horizontal brace (lower) hbrace
// horizontal brace (top) hbrace/t 
// horizontal bracket (lower) hbrack
// horizontal bracket (top) hbrack/t 


// =====================================================
// Fractions
// =====================================================

frac         = "<mfrac>$+$n#1$n#2$-$n</mfrac>$n";             // fraction 
frac/sm      = "<mstyle scriptlevel='1'>$+$n<mfrac>$+$n#1$n"
               "#2$-$n</mfrac>$-$n</mstyle>$n";               // small fraction 
frac/sl/base = "<mrow>#1<mo>/</mo>#2</mrow>$n";


// ---------------- MathML Translation Warning -----------------------

// MathML has no good way of doing diagonal fractions
// so the following translation rule keys are barely 
// tolerable fakes

// -------------------------------------------------------------------

// diagonal fraction (normal)
frac/sl    = "<mrow>$+$n<mover accent='true'>$+$n<mspace height='.6'/>$n#1$-$n"
             "</mover>$n<mi>&!;</mi><mo>/</mo><mi>&!;</mi>$n<munder accentunder='true'>"
             "$+$n<mspace depth='-.8'/>$n#2$-$n</munder>$-$n</mrow>$n";

// diagonal fraction (subscript-size)
frac/sl/sm = "<mstyle scriptlevel='1'><mrow>$+$n<mover accent='true'>$+$n"
             "<mspace height='.6'/>$n#1$-$n</mover>$n<mi>&!;</mi><mo>/</mo>"
             "<mi>&!;</mi>$n<munder accentunder='true'>$+$n<mspace depth='-.8'/>$n"
             "#2$-$n</munder>$-$n</mrow></mstyle>$n";


// =====================================================
// Roots and Long Division
// =====================================================

root       = "<msqrt>$+$n#1$-$n</msqrt>$n";             // square root 
root/nth   = "<mroot>$+$n#1$n#2$-$n</mroot>$n";         // higher root 


// ---------------- MathML Translation Warning -----------------------

// There is no MathMl layout schema corresponding directly to
// long division.  The following translation rules do a crude 
// job of approximating long division

// -------------------------------------------------------------------

// long division
ldiv       = "<mover accent='true'>$+$n"
             "<mrow>$+$n<mo>)</mo>$n<mover accent='true'>$+$n<mrow>$+$n"
	     "<mi>&thinsp;</mi>$n#1$-$n</mrow>$n<mo stretchy='true'>"
             "&bar;</mo>$-$n</mover>$-$n</mrow>$n"
             "#2$-$n</mover>$n";

// long division (without upper slot)
ldiv/nq    = "<mrow>$+$n<mo>)</mo>$n<mover accent='true'>$+$n<mrow>$+$n"
	     "<mi>&thinsp;</mi>$n#1$-$n</mrow>$n<mo stretchy='true'>"
             "&bar;</mo>$-$n</mover>$-$n</mrow>$n";



// =====================================================
// Subscripts & Superscripts - we need scanning versions for MathML
// =====================================================

// superscript (normal, trailing)
sup/scan         = "<msup>$+$n#1$n#3$-$n</msup>$n";

// subscript (normal, trailing)    
sub/scan         = "<msub>$+$n#1$n#2$-$n</msub>$n";    

// both super- and subscripts (normal, trailing)
subsup/scan      = "<msubsup>$+$n#1$n#2$n#3$-$n</msubsup>$n";      

// ============================================================
// prescripts
// ============================================================

// superscript (leading)
sup/scan/pre     = "<mmultiscripts>$+$n#1$n<mprescripts/>$n"
                   "<none/>$n#3$-$n</mmultiscripts>$n";   

// subscript (leading) 
sub/scan/pre     = "<mmultiscripts>$+$n#1$n<mprescripts/>$n"
                   "#2$n<none/>$-$n</mmultiscripts>$n";   

// both super- and subscripts (leading)
subsup/scan/pre  = "<mmultiscripts>$+$n#1$n<mprescripts/>$n"
                   "#2$n#3$-$n</mmultiscripts>$n"; 

// =====================================================
// Limit-Like Structures - also allow scanning, but not needed here
// =====================================================

lim/t       = "<mover>$+$n#1$n#3$-$n</mover>$n";             
lim         = "<munder>$+$n#1$n#2$-$n</munder>$n";           
lim/tb      = "<munderover>$+$n#1$n#2$n#3$-$n</munderover>$n";   


// =====================================================
// General Large Operators (like Integrals and Summations)
// =====================================================

// ---------------- MathML Translation Warning -----------------------

// In MathML, most operators for which it is appropriate should 
// automatically be set in a larger font, according to the renderers operator
// dictionary.  However, in many situations, the following translations
// will produce the desired results.

// -------------------------------------------------------------------

// big integral-style operator (upper limit)
intop/t   = "<msup>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#3$-$n</msup>$n";     

// big integral-style operator (lower limit)
intop/b   = "<msub>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#2$-$n</msub>$n"; 

// big integral-style operator (both limits)
intop     = "<msubsup>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#3$n#2$-$n</msubsup>$n";         

// big summation-style operator (upper limit)
sumop/t   = "<mover>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#3$-$n</mover>$n";                

// big summation-style operator (lower limit)
sumop/b   = "<munder>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#2$-$n</munder>$n";              

// big summation-style operator (both limits)
sumop     = "<munderover>$+$n<mstyle fontsize='140%' displaystyle='true'>"
            "#4</mstyle>$n#2$n#3$-$n</munderover>$n";  

// =====================================================
// Summations
// =====================================================


// sum, no limits 
sum/nol     = "<mo>&sum;</mo> #1";                                   

// sum, lower limit only 
sum/b       = "<munder>$+$n<mo>&sum;</mo>$n#2$-$n</munder>$n#1$n";             

// sum, both limits 
sum         = "<munderover>$+$n<mo>&sum;</mo>$n#2$n#3$-$n</munderover>"
              "$n#1$n";  

// sum, lower limit only (integral-style)
sum/int/b   = "<msub>$+$n<mo>&sum;</mo>$n#2$-$n</msub>$n#1$n";                 

// sum, both limits (integral-style)
sum/int     = "<msubsup>$+$n<mo>&sum;</mo>$n#2$n#3$-$n</msubsup>$n#1$n";     

// =====================================================
// Integrals 
// =====================================================


// single integral, no limits 
int/nol      = "<mrow><mo>&int;</mo>$+$n#1$-$n</mrow>$n";

// single stretchy integral, no limits 
int/ex/nol      = "<mrow><mo stretchy='true'>&int;</mo>$+$n#1$-$n</mrow>$n";

// single summation-style integral, both limits 
int/sum      = "<mrow><munderover>$+$n<mo>&int;</mo>$n#2$n#3$-$n"
               "</munderover>$n#1$-$n</mrow>$n";       

// single stretchy summation-style integral, both limits 
int/ex/sum   = "<mrow>$+$n<munderover>$+$n<mo stretchy='true'>&int;</mo>$n#2$n#3$-$n"
               "</munderover>$n#1$-$n</mrow>$n";       

// single integral, both limits 
int          = "<mrow>$+$n<msubsup>$+$n<mo>&int;</mo>$n#2$n#3$-$n"
               "</msubsup>$n#1$-$n</mrow>$n";      

// single stretchy integral, both limits 
int/ex       = "<mrow>$+$n<msubsup>$+$n<mo stretchy='true'>&int;</mo>$n#2$n#3$-$n"
               "</msubsup>$n#1$-$n</mrow>$n";   

// single summation-style integral, lower limit 
int/sum/b    = "<mrow>$+$n<munder>$+$n<mo>&int;</mo>$n#2$-$n</munder>$n#1"
	       "$-$n</mrow>$n";   

// single stretchy summation-style integral, lower limit 
int/ex/sum/b = "<mrow>$+$n<munder>$+$n<mo stretchy='true'>&int;</mo>$n#2$-$n</munder>"
	       "$n#1$-$n</mrow>$n";   

// single integral, lower limit 
int/b        = "<mrow>$+$n<msub>$+$n<mo>&int;</mo>$n#2$-$n</msub>$n#1$-$n</mrow>$n";   

// single stretchy integral, lower limit 
int/ex/b     = "<mrow>$+$n<msub>$+$n<mo stretchy='true'>&int;</mo>$n#2$-$n</msub>"
               "$n#1$-$n</mrow>$n";   

// The following translation rules belong in this section, but are
// currently defined in the specialized tdl files (which include 
// this file), since most involve a choice of entity synonyms

// double integral, no limits -- int/2/nol  
// double summation-style integral, lower limit -- int/2/sum
// double integral, lower limit -- int/2  
// triple integral, no limits -- int/3/nol
// triple summation-style integral, lower limit -- int/3/sum
// triple integral, lower limit -- int/3 
// contour integral, no limits -- int/c/nol
// contour summation-style integral, lower limit -- int/c/sum
// contour integral, lower limit -- int/c 
// area integral, no limits -- int/2/c/nol
// area summation-style integral, lower limit -- int/2/c/sum
// area integral, lower limit -- int/2/c
// volume integral, no limits -- int/3/c/nol
// volume summation-style integral, lower limit -- int/3/c/sum
// volume integral, lower limit -- int/3/c 
// counterclockwise contour integral -- int/ccw/nol
// counterclockwise contour integral, lower limit -- int/ccw/sum
// counterclockwise contour integral, subscript limit -- int/ccw 
// clockwise contour integral -- int/cw/nol
// clockwise contour integral, lower limit -- int/cw/sum
// clockwise contour integral, subscript limit -- int/cw 


// ===========================================================
// Bars Hats, Tildes, etc (wide ones, over several characters)
// ===========================================================

// Tilde -- note, there is a STIX character &wdtilde; that could be used here
tilde    =  "<mover accent='true'>$+$n#1$n<mo stretchy='true'>&tilde;</mo>$-$n</mover>$n";

// The following translation rules belong in this section, but are
// currently defined in the specialized tdl files (which include 
// this file), since most involve a choice of entity synonyms

// arc -- arc
// hat -- hat
// overbar -- obar
// double overbar -- obar/2
// underbar -- ubar  
// double underbar ubar/2  
// right arrow, box on top -- vec
// left arrow, box on top -- vec/l       
// both arrow, box on top -- vec/lr      
// harpoon right, box on top -- vec/h    
// right arrow, box on bottom-- vec/u       
// left arrow, box on bottom-- vec/u/l     
// both arrow, box on bottom -- vec/u/lr    
// harpoon right, box on bottom-- vec/u/h  

// ---------------- MathML Translation Warning -----------------------

// There is currently no MathML entity corresponding directly to
// the join status symbol.  Therefore the following translation rule
// is allowed to default to the "defchar" error handling rules above.

// -------------------------------------------------------------------

// Joint status 
//jstat = "?"                  

// =====================================================
// Strike Outs
// =====================================================

// ---------------- MathML Translation Warning -----------------------
// Stikeout constructs are deprecated in MathML, and
// probably won't work in most renderers.  The following translation
// rules can be found in the more specific tdl files which include this
// one since they typically have to be faked.

// -------------------------------------------------------------------

// Mid-line strike-through --  strike/m
// Strike-through -- strike
// Strike-through (bottom-left to upper-right) -- strike/up
// Strike-through (top-left to bottom-right) -- strike/dn 

// =====================================================
// Arrows with Slots Attached
// =====================================================

// The following translation rules belong in this section, but are
// currently defined in the specialized tdl files (hich include 
// this file), since most involve a choice of entity synonyms

// Right arrow with upper & lower text slots -- arrow/tb      
// Left arrow with upper & lower text slots -- arrow/l/tb    
// Double-headed arrow arrow with upper & lower text slots -- arrow/lr/tb   
// Double arrow with upper & lower text slots -- arrow/2/tb    
// Large over small arrow with upper & lower text slots -- arrow/2/los/tb 
// Small over large arrow with upper & lower text slots -- arrow/2/sol/tb 
// Harpoons with upper & lower text slots -- arrow/2/h/tb  
// Large over small harpoon with upper & lower text slots -- arrow/2/h/los/tb 
// Small over large harpoon with upper & lower text slots -- arrow/2/h/sol/tb 
// Right arrow with upper text slots -- arrow 
// Left arrow with upper text slots -- arrow/l       
// Double-headed arrow arrow with upper text slots -- arrow/lr      
// Double arrow with upper text slot -- arrow/2       
// Large over small arrow with upper text slot -- arrow/2/los   
// Small over large arrow with upper text slot -- arrow/2/sol   
// Harpoons with upper text slot -- arrow/2/h     
// Small over large harpoon with upper text slot -- arrow/2/h/sol 
// Large over small harpoon with upper text slot -- arrow/2/h/los 
// Right arrow with lower text slots -- arrow/b       
// Left arrow with lower text slots -- arrow/l/b     
// Double-headed arrow arrow with lower text slots -- arrow/lr/b    
// Double arrow with lower text slot -- arrow/2/b     
// Large over small arrow with lower text slot -- arrow/2/los/b 
// Small over large arrow with lower text slot -- arrow/2/sol/b 
// Harpoons with lower text slot -- arrow/2/h/b   
// Large over small harpoon with lower text slot -- arrow/2/h/los/b 
// Small over large harpoon with lower text slot -- arrow/2/h/sol/b 

// =====================================================
// Products and Coproducts
// =====================================================

prod/nol     = "<mo>&prod;</mo> #1";                                   

// product, lower limit only 
prod/b       = "<munder>$+$n<mo>&prod;</mo>$n#2$-$n</munder>$n#1";             

// product, both limits 
prod         = "<munderover>$+$n<mo>&prod;</mo>$n#2$n#3$-$n</munderover>$n#1";  

// product (integral-style), lower limit only
prod/int/b   = "<msub>$-$n<mo>&prod;</mo>$n#2$-$n</msub>$n#1";                 

// product (integral-style), both limits 
prod/int     = "<msubsup>$-$n<mo>&prod;</mo>$n#2$n#3$-$n</msubsup>$n#1";         

// coproduct, no limits 
coprod/nol   = "<mo>&coprod;</mo> #1";                                   

// coproduct, lower limit only 
coprod/b     = "<munder>$+$n<mo>&coprod;</mo>$n#2$-$n</munder>$n#1";             

// coproduct, both limits 
coprod       = "<munderover>$+$n<mo>&coprod;</mo>$n#2$n#3$-$n</munderover>$n#1";  

// coproduct (integral-style), lower limit only
coprod/int/b = "<msub>$+$n<mo>&coprod;</mo>$n#2$-$n</msub>$n#1";                 

// coproduct (integral-style), both limits 
coprod/int   = "<msubsup>$+$n<mo>&coprod;</mo>$n#2$n#3$-$n</msubsup>$n#1";         

// =====================================================
// Unions and Intersections
// =====================================================

// intersection, no limits 
inter/nol   = "<mo>&cap;</mo> #1";

// intersection, lower limit only 
inter/b     = "<munder>$+$n<mo>&cap;</mo>$n#2$-$n</munder>$n#1";

// intersection, both limits 
inter       = "<munderover>$+$n<mo>&cap;</mo>$n#2$n#3$-$n</munderover>$n#1";

// intersection (integral-style), lower limit only 
inter/int/b = "<msub>$+$n<mo>&cap;</mo>$n#2$-$n</msub>$n#1";

// intersection (integral-style), both limits 
inter/int   = "<msubsup>$+$n<mo>&cap;</mo>$n#2$n#3$-$n</msubsup>$n#1";

// union, no limits 
union/nol   = "<mo>&cup;</mo> #1";

// union, lower limit only 
union/b     = "<munder>$+$n<mo>&cup;</mo>$n#2$-$n</munder>$n#1";

// union, both limits 
union       = "<munderover>$+$n<mo>&cup;</mo>$n#2$n#3$-$n</munderover>$n#1";

// union (integral-style), lower limit only 
union/int/b = "<msub>$+$n<mo>&cup;</mo>$n#2$-$n</msub>$n#1";

// union (integral-style), both limits 
union/int   = "<msubsup>$+$n<mo>&cup;</mo>$n#2$n#3$-$n</msubsup>$n#1";


// =====================================================
// Boxes
// =====================================================

// Box 
box = "<mtable frame='solid'>#1</mtable>$n";    

// ---------------- MathML Translation Warning -----------------------

// There is currently no good way of placing partial boxes around layout
// schemata in MathML.  Therefore the following translation rules
// are allowed to default to the "defun" error handling rules above.

// ----------------------------------------------------------------------

// box/tl = "?"      // Box (top & left sides)
// box/tr = "?"      // Box (top & right sides)
// box/bl = "?"      // Box (bottom & left sides)
// box/br = "?"      // Box (bottom & right sides)

// =====================================================
// Embellishment Translations
// =====================================================

// The following translation rules belong in this section, but are
// currently defined in the specialized tdl files (which include 
// this file), since most involve a choice of entity synonyms

//edot        		enot        
//edot/2      		estrike     
//edot/3      		estrike/up  	     		eubar       
//edot/4      		estrike/dn  	  		earc        
//edot/u      		estrike/m   	  		earc/s      
//edot/u/2    		evec        	   		earc/u      
//edot/u/3    		evec/l              		earc/u/s    
//edot/u/4    		evec/lr     
//eprime      		evec/h      
//eprime/2    		evec/h/l    
//eprime/3    		evec/u      
//eprime/b    		evec/u/l    
//etilde      		evec/u/lr   
//etilde/u    		evec/u/h    
//ehat        		evec/u/h/l  
//enot        		eobar       


// =====================================================
// Function Translations
// =====================================================

// all of them can be handled via the default function translation 
deffunc   = "<mo>#</mo>";

// ======================================================================
// character translations (basic)
// ======================================================================

// Note that roman letters and numerals have several specialized
// character translations, so that within <mtext> and <mn> tags,
// individual characters and numerals are not further wrapped in
// token tags.  Depending on your taste, you may wish to add "textmode"
// translations for some of the punctuation and basic symbol characters 
// as well.

char/0x0009 = "        ";                       // HORIZONTAL TAB
char/0x0020/textmode = "&nbsp;";                     // SPACE
char/0x0020 = "<mi>&nbsp;</mi>";              // SPACE
char/0x0021 = "<mo>!</mo>";                     // EXCLAMATION MARK
char/0x0022 = "<mo>&quot;</mo>";                // QUOTATION MARK
char/0x0023 = "<mo>$#</mo>";                    // NUMBER SIGN
char/0x0024 = "<mo>$$</mo>";                    // DOLLAR SIGN
char/0x0025 = "<mo>%</mo>";                     // PERCENT SIGN
char/0x0026 = "<mo>&amp;</mo>";                 // AMPERSAND
char/0x0027 = "<mo>'</mo>";                     // APOSTROPHE
char/0x0028/mathmode = "<mo stretchy='false'>(</mo>";    // LEFT PARENTHESIS
char/0x0028/textmode = "(";                     // LEFT PARENTHESIS
char/0x0029/mathmode = "<mo stretchy='false'>)</mo>";    // RIGHT PARENTHESIS
char/0x0029/textmode = ")";                     // RIGHT PARENTHESIS
char/0x002A = "<mo>*</mo>";                     // ASTERISK
char/0x002B = "<mo>+</mo>";                     // PLUS SIGN
char/0x002C = "<mo>,</mo>";                     // COMMA
char/0x002D = "<mo>-</mo>";                     // HYPHEN-MINUS
char/0x002E = "<mo>.</mo>";                     // FULL STOP
char/0x002E/"number" = ".";                     // FULL STOP
char/0x002E/textmode = ".";                     // FULL STOP
char/0x002F = "<mo>/</mo>";                     // SOLIDUS
char/0x0030 = "<mn>0</mn>";                     // DIGIT ZERO
char/0x0030/textmode = "0";                     // DIGIT ZERO
char/0x0030/"number" = "0";                     // DIGIT ZERO
char/0x0031 = "<mn>1</mn>";                     // DIGIT ONE
char/0x0031/"number" = "1";                     // DIGIT ONE
char/0x0031/textmode = "1";                     // DIGIT ONE
char/0x0032 = "<mn>2</mn>";                     // DIGIT TWO
char/0x0032/"number" = "2";                     // DIGIT TWO
char/0x0032/textmode = "2";                     // DIGIT TWO
char/0x0033 = "<mn>3</mn>";                     // DIGIT THREE
char/0x0033/"number" = "3";                     // DIGIT THREE
char/0x0033/textmode = "3";                     // DIGIT THREE
char/0x0034 = "<mn>4</mn>";                     // DIGIT FOUR
char/0x0034/"number" = "4";                     // DIGIT FOUR
char/0x0034/textmode = "4";                     // DIGIT FOUR
char/0x0035 = "<mn>5</mn>";                     // DIGIT FIVE
char/0x0035/"number" = "5";                     // DIGIT FIVE
char/0x0035/textmode = "5";                     // DIGIT FIVE
char/0x0036 = "<mn>6</mn>";                     // DIGIT SIX
char/0x0036/"number" = "6";                     // DIGIT SIX
char/0x0036/textmode = "6";                     // DIGIT SIX
char/0x0037 = "<mn>7</mn>";                     // DIGIT SEVEN
char/0x0037/"number" = "7";                     // DIGIT SEVEN
char/0x0037/textmode = "7";                     // DIGIT SEVEN
char/0x0038 = "<mn>8</mn>";                     // DIGIT EIGHT
char/0x0038/"number" = "8";                     // DIGIT EIGHT
char/0x0038/textmode = "8";                     // DIGIT EIGHT
char/0x0039 = "<mn>9</mn>";                     // DIGIT NINE
char/0x0039/"number" = "9";                     // DIGIT NINE
char/0x0039/textmode = "9";                     // DIGIT NINE
char/0x003A = "<mo>:</mo>";                     // COLON
char/0x003B = "<mo>;</mo>";                     // SEMICOLON
char/0x003C = "<mo>&lt;</mo>";              // LESS-THAN SIGN
char/0x003D = "<mo>=</mo>";                     // EQUALS SIGN
char/0x003E = "<mo>&gt;</mo>";                  // GREATER-THAN SIGN
char/0x003F = "<mo>?</mo>";                     // QUESTION MARK
char/0x0040 = "<mo>@</mo>";                     // COMMERCIAL AT
char/0x0041 = "<mi>A</mi>";                     // LATIN CAPITAL LETTER A
char/0x0041/textmode = "A";                     // LATIN CAPITAL LETTER A
char/0x0042 = "<mi>B</mi>";                     // LATIN CAPITAL LETTER B
char/0x0042/textmode = "B";                     // LATIN CAPITAL LETTER B
char/0x0043 = "<mi>C</mi>";                     // LATIN CAPITAL LETTER C
char/0x0043/textmode = "C";                     // LATIN CAPITAL LETTER C
char/0x0044 = "<mi>D</mi>";                     // LATIN CAPITAL LETTER D
char/0x0044/textmode = "D";                     // LATIN CAPITAL LETTER D
char/0x0045 = "<mi>E</mi>";                     // LATIN CAPITAL LETTER E
char/0x0045/textmode = "E";                     // LATIN CAPITAL LETTER E
char/0x0046 = "<mi>F</mi>";                     // LATIN CAPITAL LETTER F
char/0x0046/textmode = "F";                     // LATIN CAPITAL LETTER F
char/0x0047 = "<mi>G</mi>";                     // LATIN CAPITAL LETTER G
char/0x0047/textmode = "G";                     // LATIN CAPITAL LETTER G
char/0x0048 = "<mi>H</mi>";                     // LATIN CAPITAL LETTER H
char/0x0048/textmode = "H";                     // LATIN CAPITAL LETTER H
char/0x0049 = "<mi>I</mi>";                     // LATIN CAPITAL LETTER I
char/0x0049/textmode = "I";                     // LATIN CAPITAL LETTER I
char/0x004A = "<mi>J</mi>";                     // LATIN CAPITAL LETTER J
char/0x004A/textmode = "J";                     // LATIN CAPITAL LETTER J
char/0x004B = "<mi>K</mi>";                     // LATIN CAPITAL LETTER K
char/0x004B/textmode = "K";                     // LATIN CAPITAL LETTER K
char/0x004C = "<mi>L</mi>";                     // LATIN CAPITAL LETTER L
char/0x004C/textmode = "L";                     // LATIN CAPITAL LETTER L
char/0x004D = "<mi>M</mi>";                     // LATIN CAPITAL LETTER M
char/0x004D/textmode = "M";                     // LATIN CAPITAL LETTER M
char/0x004E = "<mi>N</mi>";                     // LATIN CAPITAL LETTER N
char/0x004E/textmode = "N";                     // LATIN CAPITAL LETTER N
char/0x004F = "<mi>O</mi>";                     // LATIN CAPITAL LETTER O
char/0x004F/textmode = "O";                     // LATIN CAPITAL LETTER O
char/0x0050 = "<mi>P</mi>";                     // LATIN CAPITAL LETTER P
char/0x0050/textmode = "P";                     // LATIN CAPITAL LETTER P
char/0x0051 = "<mi>Q</mi>";                     // LATIN CAPITAL LETTER Q
char/0x0051/textmode = "Q";                     // LATIN CAPITAL LETTER Q
char/0x0052 = "<mi>R</mi>";                     // LATIN CAPITAL LETTER R
char/0x0052/textmode = "R";                     // LATIN CAPITAL LETTER R
char/0x0053 = "<mi>S</mi>";                     // LATIN CAPITAL LETTER S
char/0x0053/textmode = "S";                     // LATIN CAPITAL LETTER S
char/0x0054 = "<mi>T</mi>";                     // LATIN CAPITAL LETTER T
char/0x0054/textmode = "T";                     // LATIN CAPITAL LETTER T
char/0x0055 = "<mi>U</mi>";                     // LATIN CAPITAL LETTER U
char/0x0055/textmode = "U";                     // LATIN CAPITAL LETTER U
char/0x0056 = "<mi>V</mi>";                     // LATIN CAPITAL LETTER V
char/0x0056/textmode = "V";                     // LATIN CAPITAL LETTER V
char/0x0057 = "<mi>W</mi>";                     // LATIN CAPITAL LETTER W
char/0x0057/textmode = "W";                     // LATIN CAPITAL LETTER W
char/0x0058 = "<mi>X</mi>";                     // LATIN CAPITAL LETTER X
char/0x0058/textmode = "X";                     // LATIN CAPITAL LETTER X
char/0x0059 = "<mi>Y</mi>";                     // LATIN CAPITAL LETTER Y
char/0x0059/textmode = "Y";                     // LATIN CAPITAL LETTER Y
char/0x005A = "<mi>Z</mi>";                     // LATIN CAPITAL LETTER Z
char/0x005A/textmode = "Z";                     // LATIN CAPITAL LETTER Z
char/0x005B = "<mo stretchy='false'>[</mo>";    // LEFT SQUARE BRACKET
char/0x005C = "<mo>\</mo>";                     // REVERSE SOLIDUS
char/0x005D = "<mo stretchy='false'>]</mo>";    // RIGHT SQUARE BRACKET
char/0x005E = "<mo>^</mo>";                     // CIRCUMFLEX ACCENT
char/0x005F = "<mo>_</mo>";                     // LOW LINE
char/0x0060 = "<mo>`</mo>";                     // GRAVE ACCENT
char/0x0061 = "<mi>a</mi>";                     // LATIN SMALL LETTER A
char/0x0061/textmode = "a";                     // LATIN SMALL LETTER A
char/0x0062 = "<mi>b</mi>";                     // LATIN SMALL LETTER B
char/0x0062/textmode = "b";                     // LATIN SMALL LETTER B
char/0x0063 = "<mi>c</mi>";                     // LATIN SMALL LETTER C
char/0x0063/textmode = "c";                     // LATIN SMALL LETTER C
char/0x0064 = "<mi>d</mi>";                     // LATIN SMALL LETTER D
char/0x0064/textmode = "d";                     // LATIN SMALL LETTER D
char/0x0065 = "<mi>e</mi>";                     // LATIN SMALL LETTER E
char/0x0065/textmode = "e";                     // LATIN SMALL LETTER E
char/0x0066 = "<mi>f</mi>";                     // LATIN SMALL LETTER F
char/0x0066/textmode = "f";                     // LATIN SMALL LETTER F
char/0x0067 = "<mi>g</mi>";                     // LATIN SMALL LETTER G
char/0x0067/textmode = "g";                     // LATIN SMALL LETTER G
char/0x0068 = "<mi>h</mi>";                     // LATIN SMALL LETTER H
char/0x0068/textmode = "h";                     // LATIN SMALL LETTER H
char/0x0069 = "<mi>i</mi>";                     // LATIN SMALL LETTER I
char/0x0069/textmode = "i";                     // LATIN SMALL LETTER I
char/0x006A = "<mi>j</mi>";                     // LATIN SMALL LETTER J
char/0x006A/textmode = "j";                     // LATIN SMALL LETTER J
char/0x006B = "<mi>k</mi>";                     // LATIN SMALL LETTER K
char/0x006B/textmode = "k";                     // LATIN SMALL LETTER K
char/0x006C = "<mi>l</mi>";                     // LATIN SMALL LETTER L
char/0x006C/textmode = "l";                     // LATIN SMALL LETTER L
char/0x006D = "<mi>m</mi>";                     // LATIN SMALL LETTER M
char/0x006D/textmode = "m";                     // LATIN SMALL LETTER M
char/0x006E = "<mi>n</mi>";                     // LATIN SMALL LETTER N
char/0x006E/textmode = "n";                     // LATIN SMALL LETTER N
char/0x006F = "<mi>o</mi>";                     // LATIN SMALL LETTER O
char/0x006F/textmode = "o";                     // LATIN SMALL LETTER O
char/0x0070 = "<mi>p</mi>";                     // LATIN SMALL LETTER P
char/0x0070/textmode = "p";                     // LATIN SMALL LETTER P
char/0x0071 = "<mi>q</mi>";                     // LATIN SMALL LETTER Q
char/0x0071/textmode = "q";                     // LATIN SMALL LETTER Q
char/0x0072 = "<mi>r</mi>";                     // LATIN SMALL LETTER R
char/0x0072/textmode = "r";                     // LATIN SMALL LETTER R
char/0x0073 = "<mi>s</mi>";                     // LATIN SMALL LETTER S
char/0x0073/textmode = "s";                     // LATIN SMALL LETTER S
char/0x0074 = "<mi>t</mi>";                     // LATIN SMALL LETTER T
char/0x0074/textmode = "t";                     // LATIN SMALL LETTER T
char/0x0075 = "<mi>u</mi>";                     // LATIN SMALL LETTER U
char/0x0075/textmode = "u";                     // LATIN SMALL LETTER U
char/0x0076 = "<mi>v</mi>";                     // LATIN SMALL LETTER V
char/0x0076/textmode = "v";                     // LATIN SMALL LETTER V
char/0x0077 = "<mi>w</mi>";                     // LATIN SMALL LETTER W
char/0x0077/textmode = "w";                     // LATIN SMALL LETTER W
char/0x0078 = "<mi>x</mi>";                     // LATIN SMALL LETTER X
char/0x0078/textmode = "x";                     // LATIN SMALL LETTER X
char/0x0079 = "<mi>y</mi>";                     // LATIN SMALL LETTER Y
char/0x0079/textmode = "y";                     // LATIN SMALL LETTER Y
char/0x007A = "<mi>z</mi>";                     // LATIN SMALL LETTER Z
char/0x007A/textmode = "z";                     // LATIN SMALL LETTER Z
char/0x007B = "<mo>{</mo>";                     // LEFT CURLY BRACKET
char/0x007C = "<mo>|</mo>";                     // VERTICAL LINE
char/0x007D = "<mo>}</mo>";                     // RIGHT CURLY BRACKET
char/0x007E = "<mo>~</mo>";                     // TILDE

// Many, many more character translations rules belong in this section.
// However, most characters translations are currently defined in the 
// specialized tdl files for particular renderers (which include this file), 
// since they obvious involve a choice of entity synonyms and depend on
// font availability
