%D \module
%D   [       file=m-mathml,
%D        version=1999.12.20,
%D          title=\CONTEXT\ XML Modules,
%D       subtitle=Loading \MATHML\ Filters, 
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 
%C details. 

%D We have to make sure that some basic entities are 
%D loaded:

\useXMLfilter[ent] 

%D Then we load the math: 

\useXMLfilter[mml,mmp,mmc] 

%D And we also load the whole bunch of entities: 

% \useXMLfilter[mea,meb,mec,meh,men,meo,mer]
% \useXMLfilter[mxa,mxb,mxc,mxh,mxn,mxo,mxr]

%D For simple inline math, we first provide: 

\newcount\xmlmathlevel % todo : nesting ! ! ! ! 

\defineXMLenvironment [m] \startXMLinlinemath \stopXMLinlinemath 

\def\startXMLinlinemath 
  {\ifmmode
     \advance\xmlmathlevel1\relax 
   \else
     \xmlmathlevel1$%
   \fi} 

\def\stopXMLinlinemath 
  {\ifcase\xmlmathlevel\or
     $\xmlmathlevel0\relax
   \else
     \advance\xmlmathlevel-1\relax
   \fi}

\endinput 
