OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] MathML and graphic images in single source


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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]