docbook-apps

  • 1.  Equation alignment

    Posted 10-23-2007 16:04
    Hello,
    Does anyone know how to align a MathML equation on the page? I am using
    the equation tag, but there is no horizontal alignment feature. In the
    past, I used graphics via the mediaobject and they are aligned in the
    imagedata. But when using MathML there is no such feature.

    Any ideas?


    Dean Nelson
    Sr. Software Engineer
    Enterprise Electronics Corp
    http://www.EECradar.com <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.






  • 2.  RE: [docbook-apps] Equation alignment

    Posted 10-24-2007 17:12
    > -----Original Message-----
    > From: Nelson, Dean
    >
    > Does anyone know how to align a MathML equation on the page?
    > I am using the equation tag, but there is no horizontal
    > alignment feature. In the past, I used graphics via the
    > mediaobject and they are aligned in the imagedata. But when
    > using MathML there is no such feature.
    >
    > Any ideas?


    The current stylesheets are not very sophisticated. The MathML markup gets
    through to the output, but that's about it.

    The following customization adds support for @align and @valign on imagedata
    (the original template is in math.xsl):

    <xsl:template match="mml:math"
    xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <xsl:choose>


    <xsl:when test="not($passivetex.extensions = 0)">
    <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:when>
    <xsl:otherwise>
    <fo:instream-foreign-object>


    <xsl:if test="../@align">
    <xsl:attribute name="text-align">
    <xsl:value-of select="../@align"/>
    </xsl:attribute>
    </xsl:if>

    <xsl:if test="../@valign">
    <xsl:attribute name="display-align">
    <xsl:choose>
    <xsl:when test="../@valign = 'top'">before</xsl:when>
    <xsl:when test="../@valign = 'middle'">center</xsl:when>
    <xsl:when test="../@valign = 'bottom'">after</xsl:when>
    <xsl:otherwise>auto</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    </xsl:if>


    <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    </xsl:copy>
    </fo:instream-foreign-object>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    I'm not sure if this is the way to go in the long run. I guess that it would
    be better if the process.image template in graphics.xsl could be reworked so
    that it also supports imagedata attributes for MathML (and SVG).

    /Mauritz