[NTG-context] MathML <mover> element for accents?

Hans Hagen pragma at wxs.nl
Tue Nov 9 14:59:57 CET 2004


Duncan Hothersall wrote:
> Hello ConTeXters.
> 
> I am using the wonderful ability of ConTeXt to directly typeset MathML 
> equations, and have come across a problem with trying to put a line 
> above a character using the <mover> element. Here's what I try:
> 
> \setuppagenumbering[state=stop]
> \starttext
> \startXMLdata
> <math display="block">
>  <mover accent="true">
>   <mi>x</mi>
>   <mo>¯</mo>
>  </mover>
> </math>
> \stopXMLdata
> \stoptext
> 
> The output I get is as if the accent="true" attribute wasn't set - i.e. 
> the line is a long way above the x, not like an accent.
> 
> Is there another way to place math accents in presentational MathML?
> 
> My versions:
>         TeXVersion 0.1 / Taco Hoekwater 2004
>                texexec : TeXExec 4.4 - ConTeXt / PRAGMA ADE 1997-2004
>                texutil : TeXUtil 8.2 - ConTeXt / PRAGMA ADE 1992-2004
>                    tex : pdfeTeXk, 3.141592-1.11a-2.1 (Web2C 7.5.2)
>                context : ver: 2004.8.15
>                cont-en : ver: 2004.8.15  fmt: 2004.8.22  mes: english
> 
> (PS (Patrick) - I tried to get a minimal file working on 
> live.contextgarden but couldn't get any maths formatting to come out. 
> Perhaps MathML support is not enabled there?)

\starttext

\usemodule[mathml] \useXMLfilter[utf]

\unprotect

\remapXMLsequence [mover]      [CPA] \MMLpOVER
\remapXMLsequence [munder]     [CPA] \MMLpUNDER

\def\MMLpUNDER#1#2%
   {\getXMLarguments{munder}{accent="false" #1}%
    \withnexttwoXMLRelements\doMMLpUNDER#2}

\def\MMLpOVER#1#2%
   {\getXMLarguments{mover}{accent="false" #1}%
    \withnexttwoXMLRelements\doMMLpOVER #2}

\def\doMMLpUNDER
   {\doifelse{\XMLpar{munder}{accent}{}}{true}
      {\secondXMLRelement\firstXMLRelement}
      {\mathop{\vtop{\m at th\ialign{\hss##\hss\crcr
         \disabledelimiter\doMMLfiller\firstXMLRelement
         \crcr\noalign{\kern3\p@\nointerlineskip}%
         \disabledelimiter\doMMLfiller\secondXMLRelement
        \crcr\noalign{\kern3\p@}}}}\limits}}

\def\doMMLpOVER
   {\doifelse{\XMLpar{mover}{accent}{}}{true}
      {\secondXMLRelement\firstXMLRelement}
      {\mathop{\vbox{\m at th\ialign{\hss##\hss\crcr\noalign{\kern3\p@}%
         \disabledelimiter\doMMLfiller\secondXMLRelement
         \crcr\noalign{\kern3\p@\nointerlineskip}%
         \disabledelimiter\doMMLfiller\firstXMLRelement
         \crcr}}}\limits}}

\protect

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

Normal: \startXMLdata<math><mover 
 ><mi>a</mi><mo>¯</mo></mover></math>\stopXMLdata \par
Accent: \startXMLdata<math><mover 
accent="true"><mi>x</mi><mo>¯</mo></mover></math>\stopXMLdata \par

\stoptext


now, the problem is that this funny char between <mo></mo> has to become a math 
accent, so what is the code? (name) someplace we need to handle that kind of things

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-context mailing list