% RCS: $Id: mathml.ltx,v 1.2 1999/08/12 11:59:08 rahtz Exp $
%% File: fotex.ltx Copyright 1999 Sebastian Rahtz
%%
%% This package may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
% MathML formatting objects
%
\let\mathfrak\undefined
\let\mathfrak\undefined
\let\vDash\undefined
\let\eth\undefined
\RequirePackage{amssymb}
\RequirePackage{amstext}
\def\w@t{}
\let\@@over\over
\newcount\@Pending
\newcount\@MoCount
\newcount\XML@subeqncnt
\XML@subeqncnt0
\@MoCount0
\@Pending1
\def\XML@PendingI{}
\def\XML@PendingII{}
\XMLdef<fotex:inlinemath>{$}
\XMLdef</fotex:inlinemath>{$}
\XMLdef<fotex:displaymath>{\begin{displaymath}}
\XMLdef</fotex:displaymath>{\end{displaymath}}
\XMLdef<fotex:eqnarray>{%
    \XMLattributes\XMLlabel{\XMLid}%
    \bgroup\global\XML@subeqncnt0\begin{eqnarray*}}
\XMLdef</fotex:eqnarray>{\end{eqnarray*}\egroup}
\XMLdef<fotex:equation>{%
  \XMLattributes\XMLlabel{\XMLid}%
  \begin{equation}}
\XMLdef</fotex:equation>{\end{equation}}
\XMLdef<fotex:subeqn>{%
   \XMLattributes\XMLlabel{\XMLid}%
   \global\advance\XML@subeqncnt by 1
   \ifnum\XML@subeqncnt=2\else\def\w@t{\\}%
   \fi
   \w@t
}
\XMLdef</fotex:subeqn>{}
\XMLdef<math>{}
\XMLdef</math>{}
\XMLdef<mtable>{\begin{array}{*{99}{c}}}
\XMLdef</mtable>{\end{array}}
\XMLdef<mfrac>{\bgroup\@Pending1\def\XML@PendingII{\@@over}}
\XMLdef</mfrac>{\egroup}
\XMLdef<mi>{\BGroup}
\XMLdef</mi>{\egroup}
\XMLdef<mn>{\BGroup}
\XMLdef</mn>{\egroup}
\XMLdef<mo>{\BGroup}
\XMLdef</mo>{\egroup}
\XMLdefempty<mrow/>{}
\XMLdef<mrow>{\BGroup}
\XMLdef</mrow>{\egroup}
\XMLdef<msub>{\bgroup\@Pending1\def\XML@PendingII{_}}
\XMLdef</msub>{\egroup}
\XMLdef<msubsup>{\bgroup\@Pending0\def\XML@PendingI{_}\def\XML@PendingII{^}}
\XMLdef</msubsup>{\egroup}
\XMLdef<msup>{\bgroup\@Pending1\def\XML@PendingII{^}}
\XMLdef</msup>{\egroup}
\XMLdef<mtd>{}
\XMLdef</mtd>{&}
\XMLdefempty<mtext/>{}
\XMLdef<mtext>{\hbox\bgroup}
\XMLdef</mtext>{\egroup}
\XMLdef<mtr>{}
\XMLdef</mtr>{\\}
\XMLdef<mover>{}
\XMLdef</mover>{}
\XMLdefempty<mspace/>{\XMLattributes\hspace{\XML@width}}
\XMLdef<msqrt>{\sqrt\bgroup}
\XMLdef</msqrt>{\egroup}
\XMLdef<munderover>{}
\XMLdef</munderover>{}
\XMLdef<mfenced>{\bgroup\XMLattributes\left\XML@fenceopen}
\XMLdef</mfenced>{\right\XML@fenceclose\egroup}
\catcode`\{=12\catcode`\}=12\catcode`x=1\catcode`y=2
\def\XML@lbracex{y
\def\XML@rbracex}y
\catcode`\{=1\catcode`\}=2\catcode`x=11\catcode`y=11
\define@key{XML}{open}{%
 \def\@tempa{#1}\ifx\@tempa\XML@lbrace\def\XML@fenceopen{\{}\else
 \def\XML@fenceopen{#1}\fi
}
\define@key{XML}{close}{%
  \def\@tempa{#1}\ifx\@tempa\XML@rbrace\def\XML@fenceclose{\}}\else
  \def\XML@fenceclose{#1}\fi
}
\define@key{XML}{width}{\def\XML@width{#1}}
\def\XML@fenceopen{.}
\def\XML@fenceclose{.}
\def\BGroup{%
 \def\w@t{}%
 \ifcase\@Pending% 0
    \@Pending1
 \or%1
    \let\w@t\XML@PendingI\def\XML@PendingI{}%
    \@Pending2
 \or%2
    \let\w@t\XML@PendingII\def\XML@PendingII{}%
    \@Pending1
 \fi
 \w@t
 \bgroup
 \def\XML@PendingII{}%
}
\let\XML@textgreater\textgreater
\def\textgreater{%
 \ifmmode>\else\XML@textgreater\fi
}
\let\XML@textless\textless
\def\textless{%
 \ifmmode<\else\XML@textless\fi
}
\endinput
