ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Accents in MathML
@ 2005-05-25 11:20 Duncan Hothersall
  2005-05-25 12:43 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Duncan Hothersall @ 2005-05-25 11:20 UTC (permalink / raw)


Hello all.

I'm processing some Spanish from Unicode and some of it is in MathML,
for which I use ConTeXt's native processing. There seems to be a problem
with accents. When I run this on Live:

--
\mainlanguage[es]\enableregime[utf]\useencoding[uc]
\useXMLfilter[utf]\usemodule[mathml]
\starttext
Maths with accents:
\startXMLdata
<formula><math><mtext>interés</mtext></math></formula>\stopXMLdata
\stoptext
--

it fails because of the é (which is an e with an acute accent, in case
the mail system turns it into gobbledgook).

Can anyone help? Thanks.

Duncan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Accents in MathML
  2005-05-25 11:20 Accents in MathML Duncan Hothersall
@ 2005-05-25 12:43 ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2005-05-25 12:43 UTC (permalink / raw)


Duncan Hothersall wrote:
> Hello all.
> 
> I'm processing some Spanish from Unicode and some of it is in MathML,
> for which I use ConTeXt's native processing. There seems to be a problem
> with accents. When I run this on Live:
> 
> --
> \mainlanguage[es]\enableregime[utf]\useencoding[uc]
> \useXMLfilter[utf]\usemodule[mathml]
> \starttext
> Maths with accents:
> \startXMLdata
> <formula><math><mtext>interés</mtext></math></formula>\stopXMLdata
> \stoptext

are you sure that your e with accent is codes in utf?

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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Accents in MathML
       [not found] <20050526100002.E69D8127D0@ronja.ntg.nl>
@ 2005-05-26 15:06 ` Duncan Hothersall
  0 siblings, 0 replies; 4+ messages in thread
From: Duncan Hothersall @ 2005-05-26 15:06 UTC (permalink / raw)


I said:

> Interestingly, if I forget about unicode and use &eacute; instead of é,
> then no matter what I put in the preamble I get the e with a guillemot
> superimposed. So whatever is mapping é incorrectly seems also to be
> mapping &eacute; incorrectly.

Further testing suggests that my problem is this:

Between \startXMLdata and \stopXMLdata, where MathML is being parsed
directly by ConTeXt, I get the wrong results for accented characters
within <mtext> elements. For example, I get an e character with a
guillemot superimposed on top when I want an e with an acute accent. It
doesn't seem to matter whether the markup is unicode é, the entity
&eacute;, or the command \eacute.

Similar problems happen with other accents I have tried. In the case of
  ñ the accent is almost right but comes out too big (looks like the
maths version of the accent?).

The following is my local test file, using unicode and comparing running
text to <mtext> in MathML:

--
\mainlanguage[es]\enableregime[utf]\useencoding[uc]
\usemodule[mathml]\setupoutput[pdftex]
\starttext
Situación niños volúmenes sí interés:
\startXMLdata <formula><math><mfrac><mrow><mtext>Situación niños
volúmenes</mtext></mrow><mrow><mtext>sí
interés</mtext></mrow></mfrac></math></formula>\stopXMLdata
\stoptext
--

The following is a non-unicode test file that will process on Live and
exhibits the same errors in the MathML accent rendering. It uses entity
references instead of unicode in the MathML, but because they map to the
same thing the output is the same:

--
\mainlanguage[es]\enableregime[utf]\useencoding[uc]
\usemodule[mathml]\setupoutput[pdftex]
\starttext
\startXMLdata <formula><math><mfrac><mrow><mtext>Situaci&oacute;n
ni&ntilde;os vol&uacute;menes</mtext></mrow><mrow><mtext>s&iacute;
inter&eacute;s</mtext></mrow></mfrac></math></formula>\stopXMLdata
\stoptext
--

I have a feeling I have made this more complex than it needed to be, but
can anyone shed light on how to fix it?

Thanks,

Duncan

PS Apologies for the nonsense Spanish content - it's just random words
with accents.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Accents in MathML
       [not found] <20050525200648.85433127E2@ronja.ntg.nl>
@ 2005-05-26  9:58 ` Duncan Hothersall
  0 siblings, 0 replies; 4+ messages in thread
From: Duncan Hothersall @ 2005-05-26  9:58 UTC (permalink / raw)



>>I'm processing some Spanish from Unicode and some of it is in MathML,
>>for which I use ConTeXt's native processing. There seems to be a problem
>>with accents. When I run this on Live:
>>
>>--
>>\mainlanguage[es]\enableregime[utf]\useencoding[uc]
>>\useXMLfilter[utf]\usemodule[mathml]
>>\starttext
>>Maths with accents:
>>\startXMLdata
>><formula><math><mtext>interés</mtext></math></formula>\stopXMLdata
>>\stoptext
> 
> 
> are you sure that your e with accent is codes in utf?
> 
> Hans

Further testing locally (rather than via Live) produces different
problems, so maybe the unicode is perverted by submitting the data via
http to the Live server?

In any event, testing only locally I can now produce the following results:

As long as I have either '\enableregime[utf]' or '\useXMLfilter[utf]'
then the é produces an e with a guillemot superimposed on top (this is
wrong - I wanted an e with an acute accent).

If I don't have either of those commands in the preamble, then I get Ãl,
which looks like the literal unicode as two ASCII chars.

Interestingly, if I forget about unicode and use &eacute; instead of é,
then no matter what I put in the preamble I get the e with a guillemot
superimposed. So whatever is mapping é incorrectly seems also to be
mapping &eacute; incorrectly.

Unfortunately none of this is the behaviour I originally experienced in
my large project file, which was stalling the process with the following
error:

! Please use \mathaccent for accents in math mode.
<argument> \char
                 19
\dobuildtextaccent ...{\let \char \normalaccent #1
                                                  \let \char \normalchar #2}
<argument> Inter\dobuildtextaccent {\char 19 }{e}
                                                 s
\secondoftwoarguments #1#2->#2

\MMLpmath ...tyle}{#1}\setMMLpmathstyle {mstyle}#2
                                                  \endgroup
l.1 ...{}{Inter\dobuildtextaccent {\char 19 }{e}s}
                                                  \xmlr
{mi}{X}{}{cargo}\emp...
...
l.15628 ...cargo</mi></math></formula>\stopXMLdata


So I think I have two quite different errors, but it would be really
good to know what can make é come out right in the minimal file, while I
try to construct another minimal file which will give me the actual
error above!

Many thanks.

Duncan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-26 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-25 11:20 Accents in MathML Duncan Hothersall
2005-05-25 12:43 ` Hans Hagen
     [not found] <20050525200648.85433127E2@ronja.ntg.nl>
2005-05-26  9:58 ` Duncan Hothersall
     [not found] <20050526100002.E69D8127D0@ronja.ntg.nl>
2005-05-26 15:06 ` Duncan Hothersall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).