List Info

Thread: MathML and graphic images in single source




MathML and graphic images in single source
user name
2007-10-22 15:27:26
Hello,
I would like to have my MathML equations show up in the PDF and the graphic images of the equations show up in the HTML renderings. Would ; I use the mediaobject or equation or something else?
 
Right now I am using just the equation tag and then xinclude the MathML source. This works well for the PDF but it doesn't seem to validate under Oxygen 8.3 - any clues on that?
 
I want to expand the equations to add support for an HTML viewer that does not support the MathML, hence the graphics.Any help/thoughts would be appreciated.
 
Thanks!

Dean Nelson   
Sr. Software Engineer
Enterprise Electronics Corp
http://www.EECradar.com  

"Too much of the world is run on the theory that you don't need road manners if you drive a five-ton truck" - Cleon Lyles


This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed.  If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited.  If you have received this e-mail in error, please notify the sender by replying to this  message and delete this e-mail immediately.

 
Re: MathML and graphic images in single source
user name
2007-10-22 16:24:47
Hi Dean,

On Montag, 22. Oktober 2007, Nelson, Dean wrote:
> I would like to have my MathML equations show up in the
PDF and the
> graphic images of the equations show up in the HTML
renderings. Would 
> I use the mediaobject or equation or something else?

I am not sure, but if I remember correctly, the stylesheets
copies the 
MathML markup directly into the HTML code. However, for the
HTML 
stylesheets, there is no automatism that converts MathML
into, say, PNG. 
The browser has to support MathML markup.

Back to your question: Both elements should work, actually
it depends on 
the title. Generally, an equation has a title that is
numbered. It appear 
also in the list of equations (usually at the beginning of a
book). 
Normally, equations are just a wrapper for mediaobject(s).

The element mediaobject holds just the skeleton of the
references to your 
equations, be it for PDF or HTML. Actually it can hold an
arbitrary 
number of imageobjects that points to a image source (see
below). It can 
contain a caption but that is not numbered and doesn't
appear in the list 
of equations. Just to clarify equation and mediaobject.


> Right now I am using just the equation tag and then
xinclude the MathML
> source. This works well for the PDF but it doesn't seem
to validate
> under Oxygen 8.3 - any clues on that?

Do you use DocBook 4.x or DocBook 5? Either way, if you
xinclude your 
MathML source, these elements are unknown in DocBook. You
have to 
customize the DTD or the RELAX NG to allow MathML markup
inside equation. 
See http://www.docbook.org/docs/howto/#faq-customization-
mathml for 
DocBook5. I have no link ATM for customization for
DocBook4.


> I want to expand the equations to add support for an
HTML viewer that
> does not support the MathML, hence the graphics. Any
help/thoughts would
> be appreciated.

There is also another possibility. You could just omit the
MathML markup 
and reference to the rendered graphic(s):

 <mediabobject>
   <imageobject role="fo">
     <!-- For high quality, use a supported 
          vector format like PDF, EPS, ...
     -->
     <imagedata fileref="equation.pdf"/>
   </imageobject>
   <imageobject role="html">
     <!-- Any pixel format like JPEG, PNG, GIF, ...
should 
          work for a browser
      -->
     <imagedata fileref="equation.png"/>
   </imageobject>
 </mediaobject>

You have to render your formula with a respective tool
first, that could 
be OpenOffice.org or LaTeX. The advantage is you can use the
official 
DocBook schema without any customization. The drawback is
it's not 
a "direkt" way, you need an additional step. 


Hope that helps,
Tom

-- 
Thomas Schraitle

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )