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] Equation alignment

Thanks for the template. But I am a bit confused about how to apply the implementation.

The code in my doc is like this:

<equation><title>Z-R Relation</title>
      <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; href="e5-math-zr-basic.xml"/>

and the included file is:

<?xml version="1.0" encoding="utf-16"?>
  File: e5-math-zr-basic.xml
  Date : Sept 15, 2007

     <!DOCTYPE mml:math PUBLIC "-//W3C//DTD MathML 2.0//EN"
        "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"; [
        <!ENTITY % MATHML.prefixed "INCLUDE">
        <!ENTITY % MATHML.prefix "mml">
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"; id="mymath"> 


However, the formula shows up left aligned and I need it centered. So how do I specify the "alignment" when using your template?

I am using SAXON and FOP 0.94.


-----Original Message-----
From: Mauritz Jeanson [mailto:mj@johanneberg.com]
Sent: Wed 10/24/2007 12:12 PM
To: Nelson, Dean; docbook-apps@lists.oasis-open.org
Subject: RE: [docbook-apps] Equation alignment 
> -----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"
    <!-- * If user is using passivetex, we don't wrap the output in -->
    <!-- * fo:instream-foreign-object (which passivetex doesn't support).
    <xsl:when test="not($passivetex.extensions = 0)">
        <xsl:copy-of select="@*"/>

	<!-- Support for two imagedata attributes -->
	<xsl:if test="../@align">
	  <xsl:attribute name="text-align">
	    <xsl:value-of select="../@align"/>
	<xsl:if test="../@valign">
	  <xsl:attribute name="display-align">
	      <xsl:when test="../@valign = 'top'">before</xsl:when>
	      <xsl:when test="../@valign = 'middle'">center</xsl:when>
	      <xsl:when test="../@valign = 'bottom'">after</xsl:when>
     <!-- End of customization -->
          <xsl:copy-of select="@*"/>

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).


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