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


Thanks for the reply Tom,

I'm using DocBook 4.5 and have been using graphics for the equations.
This is quick and easy (usually), but doesn't scale real well. The
higher the resolution of the graphics, the bigger the file. Since I have
a great deal of these, I lower the resolution as far as I can get away
with. As a result, they are not really sharp and crisp like they are
when rendered with MathML in the Jeuclid FOP plugin.

I want the equations to show up in the "equations" TOC and be numbered
and be able to be referenced, but I also want to treat them differently
(use graphics) if the output is HTML. Yet I'm unsure of how to go about
that. 

I wonder if the ALT tag could be used to render Mathml?

Regards,

Dean Nelson   
Enterprise Electronics Corp


-----Original Message-----
From: tom_schr@web.de [mailto:tom_schr@web.de] 
Sent: Monday, October 22, 2007 4:25 PM
To: docbook-apps@lists.oasis-open.org
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

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



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