On Tue, Oct 23, 2007 at 08:41:25PM -0400, Eitan Gurari wrote:

> > Tex4ht's MathML output doesn't come out right for me in either
> > iceweasel or konqueror

> Any concrete example of what is going wrong there, unless the problem
> is with the browsers.

(This is off-topic for a bug entitled `Should Recommends: dvipng';
we should consider creating a new bug to help other people looking for
information on the topic of MathML.)

It appears that konqueror doesn't support MathML, in which case nothing
in tex4ht's mathml output can help there.

If I copy just a <math> element from tex4ht's output into a separate
file and run mathmlsvg (from libgtkmathview-bin package) on that file,
then the output looks correct, whereas that same equation in iceweasel
isn't coming up for me.  So there's at least one piece of software that
can read the mathml element itself.

It looks as if iceweasel just isn't recognizing it as mathml for some
reason; or rather (a lesser claim) there's no evidence in the rendering
that it's even trying to render it as mathml.

The http://www.mozilla.org/projects/mathml/start.xhtml page comes up
very badly for me (lots of hex squares, black regions and wrong glyphs,
much of which is presumably just because I'm missing at least one font),
but it does at least look like it's trying to render as mathml.

So I suppose the trick is to look at differences between tex4ht's output
and that page, paying particular attention to doctype etc. bits and xmlns 
use and so on.

If I copy the same <math> element from tex4ht into the start.xhtml
document, then iceweasel displays it much like the rest of the page:
it's all in gobbledigook glyphs, but at least it's evidently recognizing
it as mathml.

OK, the following two changes are enough for iceweasel to render
tex4ht's output in the same gobbledigook as its start.xhtml page
[that may well appear correctly to someone with the right fonts]:

  - Change the file name from .html to .xhtml.  (Btw, I passed options
    xhtml,mathml as the second argument to htlatex.)

  - Fix tex4ht's invalid output for the \email command for the .tex file
    in question.  The \email command in question is:

      \email{\{Kim.Marriott, Peter.Moulder, [EMAIL PROTECTED]

    It's understandable for tex4ht not to produce a valid mailto URL
    from this brace notation, but it really is a bug that tex4ht's
    output for this isn't even valid html/xhtml:

      <a 
      href="mailto:\protect \T1\textbraceleft Kim.Marriott,"
      Peter.Moulder, Nathan.Hurst\protect \T1\textbraceright
      @infotech.monash.edu.au >

    Note that those last two lines are outside of the href attribute
    (see the ‘"’ at the end of line 2, where the first space in the
    \email argument appears).

    This bug makes me wonder how many other constructs can result in
    invalid html/xhtml.  A good way of avoiding this when writing a new
    application is for each command handler to produce not raw
    supposed-html but rather an intermediate format like a libxml tree.
    Whether it's worth applying this to an already-existing program
    instead of fixing bugs one by one as they're reported is another
    matter :) .

pjrm.


Reply via email to