docbook-apps

  • 1.  conditional processing with mathml and equations as images

    Posted 12-04-2012 15:08
    hi, I need to process my DocBook 5 xml to html for two different types of
    html: one uses mathml and the other type uses images for math content.

    Is the following pseudo-markup the appropriate structure? Here I use the
    informalequation element, but for a real document I would also include
    inlineequation with the same content structure.

    informalequation
    --mediaobject
    ----alt (contains escaped latex equation markup)
    ----imageobject condition=plain
    ------imagedata fileref=
    ----imageobject condition=fancy
    ------imagedata
    --------mml:content

    So I could process the xml with for condition=fancy to get the mathml
    rendered in the html and condition=plain to get img tags in the html.

    Is this the right way to do this?
    thanks,
    --Tim



  • 2.  Re: [docbook-apps] conditional processing with mathml and equations as images

    Posted 12-05-2012 17:54
    Hi Tim,
    That method would work, but the stylesheets already provide a mechanism for selecting different imageobjects for different outputs, without needing to use profiling. You can use the role attribute, and then select which role value you want to use at runtime. See this reference for more information:

    http://www.sagehill.net/docbookxsl/GraphicSelection.html

    If you use custom role values, you will need to set the 'preferred.mediaobject.role' parameter at runtime.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    From: Tim Arnold
    Sent: Tuesday, December 04, 2012 7:07 AM
    To: DocBook Apps
    Subject: [docbook-apps] conditional processing with mathml and equations as images


    hi, I need to process my DocBook 5 xml to html for two different types of html: one uses mathml and the other type uses images for math content.


    Is the following pseudo-markup the appropriate structure? Here I use the informalequation element, but for a real document I would also include inlineequation with the same content structure.


    informalequation
    --mediaobject
    ----alt (contains escaped latex equation markup)
    ----imageobject condition=plain
    ------imagedata fileref=
    ----imageobject condition=fancy
    ------imagedata
    --------mml:content


    So I could process the xml with for condition=fancy to get the mathml rendered in the html and condition=plain to get img tags in the html.


    Is this the right way to do this?
    thanks,
    --Tim