TRANSLATION Math;
LINELENGTH 78; 
BUFFERS
	Buf1;
	Buf2;
	Buf3;
	Buf4;
	Buf5;
	Buf6;
	Buf7;
	Buf8;
	Buf9;
	Buf10;
	
CONST
	XX = 'Bidon';
	
RULES
Math :
	BEGIN
	if within Simple_paragraphe(Paragraphe)
	   BEGIN
	   Create '$' Before;
	   Create '$' After;
	   END;
	if not within Paragraphe(Paragraphe)
	   BEGIN
	   Create '\begin{displaymath}\12' Before;
	   Create '\end{displaymath}\12' After;
	   END;
	END;

Fraction :
	Create '\frac' Before;

Numera_r :
	BEGIN
	Create '{' Before;
	Create '} ' After;
	END;

Denomi_r :
	BEGIN
	Create '{' Before;
	Create '} ' After;
	END;

Subscr :
	BEGIN
	Create '_{' Before;
	Create '} ' After;
	END;

Supscr :
	BEGIN
	Create '^{' Before;
	Create '} ' After;
	END;

Root_cst :
	Create '\sqrt' Before;

Root_ord :
	BEGIN
	Create '[' Before;
	Create '] ' After;
	END;

Root_obj :
	BEGIN
	Create '{' Before;
	Create '} ' After;
	END;

Lower_bd :
	BEGIN
	Create '_{' Before;
	Create '} ' After;
	END;

Upper_bd :
	BEGIN
	Create '^{' Before;
	Create '} ' After;
	END;

Lower_ex :
	BEGIN
	Create '_{' Before;
	Create '} ' After;
	END;

Upper_ex :
	BEGIN
	Create '^{' Before;
	Create '} ' After;
	END;

Stackrel :
	Create '\stackrel ' Before;

Lower_a :
	BEGIN
	Create '{' Before;
	Create '} ' After;
	END;

Upper_a :
	BEGIN
	Create '{' Before;
	Create '} ' After;
	END;

Superline :
	Create '} ' After;

Thin_space :
	Create '\, ' Before;

Medium_space :
	Create '\: ' Before;

Thick_space :
	Create '\; ' Before;

Cdots :
	Create '\cdots ' Before;

Ldots :
	Create '\ldots ' Before;

Vdots :
	Create '\vdots ' Before;

Ddots :
	Create '\ddots ' Before;

{
Intsym :
	Remove;
}

Array :
	BEGIN
	Create '\begin{array} ' Before;
	Create '\end{array}\12' After;
	END;

Array_head :
	BEGIN
	Create '{' Before;
	Create '}\12' After;
	END;

Column_head :
	Remove;

Array_row :
	BEGIN
	IF NOT Last
		Create ' \\\\\12' After;
{
	IF Last
		Create '\12' After;
}
	END;

Array_cell :
	BEGIN
	IF NOT Last
		Create ' & ' After;
	END;

{Emb_tex : Create \ Before;}

Function_name : Create '\\' Before;

Invoc_Fct : Create '}\12' After;

Parameter : Create ' {' Before;

B_Modulo : Create '\bmod' ;

ModuloConstant : Remove;

P_Modulo :
	BEGIN
	Create '\pmod {' Before;
	Create '} ' After;
	END;

Left_del :
	BEGIN
	Create '\left ' Before;
	END;

Right_del :
	BEGIN
	Create '\right ' Before;
	END;

Range :
	BEGIN
	Create '_{' Before;
	Create '} ' After;
	END;

ATTRIBUTES

INTTYPE (Intsym) = Single :
	Create '\int' Before;
INTTYPE (Intsym) = Double :
	Create '\int\int' Before;
INTTYPE (Intsym) = Contour :
	Create '\oint' Before;

LINE_TYPE (Superline) = OverBar :
	Create '\overline{' Before;
LINE_TYPE (Superline) = OverBrace :
	Create '\overbrace{' Before;
LINE_TYPE (Superline) = UnderBrace :
	Create '\underbrace{' Before;
LINE_TYPE (Superline) = UnderBar :
	Create '\underline{' Before;
LINE_TYPE (Superline) = WideHat :
	Create '\widehat{' Before;
LINE_TYPE (Superline) = WideTilde :
	Create '\widetilde{' Before;

ROW_VALIGN (Array) = Row_top :
	Create '[t] ';
ROW_VALIGN (Array) = Row_bottom :
	Create '[b] ';

ROW_ALIGN (Column_head) = Row_left :
	Create 'l';
ROW_ALIGN (Column_head) = Row_center :
	Create 'c';
ROW_ALIGN (Column_head) = Row_right :
	Create 'r';

ACCENT (Textual) = Hat :
	BEGIN
	Create '\hat{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Acute :
	BEGIN
	Create '\acute{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Tilde :
	BEGIN
	Create '\tilde{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Bar :
	BEGIN
	Create '\bar{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Vec :
	BEGIN
	Create '\vec{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Dot :
	BEGIN
	Create '\dot{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Ddot :
	BEGIN
	Create '\ddot{' Before;
	Create '} ' After;
	END;
ACCENT (Textual) = Sprime :
	BEGIN
	Create '\prime ' After;
	END;
ACCENT (Textual) = Dprime :
	BEGIN
	Create '\prime ' After;
	END;
ACCENT (Textual) = Grave :
	BEGIN
	Create '\grave{' Before;
	Create '} ' After;
	END;

LIMITOP (L_part_c) = Inf :
	BEGIN
	Create '\inf ' Before;
	END;
LIMITOP (L_part_c) = Limm :
	BEGIN
	Create '\lim ' Before;
	END;
LIMITOP (L_part_c) = Liminf :
	BEGIN
	Create '\liminf ' Before;
	END;
LIMITOP (L_part_c) = Limsup :
	BEGIN
	Create '\limsup ' Before;
	END;
LIMITOP (L_part_c) = Maxx :
	BEGIN
	Create '\max ' Before;
	END;
LIMITOP (L_part_c) = Minn :
	BEGIN
	Create '\min ' Before;
	END;
LIMITOP (L_part_c) = Sup :
	BEGIN
	Create '\sup ' Before;
	END;

INLSTYLE (Math) :
	BEGIN
	Create '\begin{math}\12' Before;
	Create '\end{math}\12' After;
	END;

COLUMN_WIDTH (Column_head) :
	Remove ;
{
REF_COLUMN (Array_cell) :
	Remove ;
}

TEXTTRANSLATE Latin
	BEGIN
{	'\134'	-> '\setminus';}
	END;

TEXTTRANSLATE Greek
	BEGIN
	'\141'	-> '\alpha ';
	'\142'	-> '\beta ';
	'\147'	-> '\gamma ';
	'\144'	-> '\delta ';
	'\316'	-> '\epsilon ';
	'\145'	-> '\varepsilon ';
	'\172'	-> '\zeta ';
	'\150'	-> '\eta ';
	'\161'	-> '\theta ';
	'\112'	-> '\vartheta ';
	'\151'	-> '\iota ';
	'\153'	-> '\kappa ';
	'\154'	-> '\lambda ';
	'\155'	-> '\mu ';
	'\156'	-> '\nu ';
	'\170'	-> '\xi ';
	'\157'	-> '\o ';
	'\160'	-> '\pi ';
	'\166'	-> '\varpi ';
	'\162'	-> '\rho ';
	'\163'	-> '\sigma ';
	'\126'	-> '\varsigma ';
	'\164'	-> '\tau ';
	'\165'	-> '\upsilon ';
	'\146'	-> '\phi ';
	'\152'	-> '\varphi ';
	'\143'	-> '\chi ';
	'\171'	-> '\psi ';
	'\167'	-> '\omega ';
	'\101'	-> '\Alpha ';
	'\102'	-> '\Beta ';
	'\107'	-> '\Gamma ';
	'\104'	-> '\Delta ';
	'\105'	-> '\Epsilon ';
	'\132'	-> '\Zeta ';
	'\110'	-> '\Eta ';
	'\121'	-> '\Theta ';
	'\111'	-> '\Iota ';
	'\113'	-> '\Kappa ';
	'\114'	-> '\Lambda ';
	'\115'	-> '\Mu ';
	'\116'	-> '\Nu ';
	'\130'	-> '\Xi ';
	'\117'	-> '\O ';
	'\120'	-> '\Pi ';
	'\122'	-> '\Rho ';
	'\123'	-> '\Sigma ';
	'\124'	-> '\Tau ';
	'\241'	-> '\Upsilon ';
	'\106'	-> '\Phi ';
	'\103'	-> '\Chi ';
	'\131'	-> '\Psi ';
	'\127'	-> '\Omega ';
	'\254'	-> '\leftarrow ';
	'\334'	-> '\Leftarrow ';
	'\256'	-> '\rightarrow ';
	'\336'	-> '\Rightarrow ';
	'\253'	-> '\leftrightarrow ';
	'\333'	-> '\Leftrightarrow ';
	'\277'	-> '\hookleftarrow ';
	'\255'	-> '\uparrow ';
	'\335'	-> '\Uparrow ';
	'\257'	-> '\downarrow ';
	'\337'	-> '\Downarrow ';
	'\300'	-> '\aleph ';
	'\303'	-> '\wp ';
	'\302'	-> '\Re ';
	'\301'	-> '\Im ';
	'\242'	-> '\prime ';
	'\306'	-> '\emptyset ';
	'\321'	-> '\nabla ';
	'\326'	-> '\surd ';
	'\136'	-> '\bot ';
	'\320'	-> '\angle ';
	'\42'	-> '\forall ';
	'\44'	-> '\exists ';
	'\330'	-> '\neg ';
	'\266'	-> '\partial ';
	'\245'	-> '\infty ';
	'\247'	-> '\clubsuit ';
	'\340'	-> '\diamondsuit ';
	'\251'	-> '\heartsuit ';
	'\252'	-> '\spadesuit ';
	'\343'	-> '\copyright ';
	'\261'	-> '\pm ';
	'\264'	-> '\times ';
	'\270'	-> '\div ';
	'\52'	-> '\ast ';
	'\260'	-> '\star ';
	'\267'	-> '\bullet ';
	'\327'	-> '\cdot ';
	'\307'	-> '\cap ';
	'\310'	-> '\cup ';
	'\332'	-> '\vee ';
	'\331'	-> '\wedge ';
	'\250'	-> '\diamond ';
	'\305'	-> '\oplus ';
	'\304'	-> '\otimes ';
	'\243'	-> '\leq ';
	'\263'	-> '\geq ';
	'\314'	-> '\subset ';
	'\315'	-> '\subseteq ';
	'\311'	-> '\supset ';
	'\312'	-> '\supseteq ';
	'\272'	-> '\equiv ';
	'\176'	-> '\sim ';
	'\273'	-> '\approx ';
	'\271'	-> '\neq ';
	'\265'	-> '\propto ';
	'\357'	-> '\mid ';
	END;

SYMBTRANSLATE
	BEGIN
	'S'	-> '\sum ';
	'P'	-> '\prod ';
	'U'	-> '\bigcup ';
	'I'	-> '\bigcap';
	'{'	-> '\{';
	'}'	-> '\}';
	END;

END
