Skip to content

Commit

Permalink
handle rSpRule for rowspacing
Browse files Browse the repository at this point in the history
  • Loading branch information
fr4nze committed Aug 23, 2023
1 parent 61d08cf commit fa7a31f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xsl/omml2mml/omml2mml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,8 @@
<mml:mtable>
<xsl:call-template name="CreateMathMLMatrixAttr">
<xsl:with-param name="mcJc" select="(m:mPr[last()]/m:mcs/m:mc/m:mcPr[last()]/m:mcJc/@m:val, 'center')[1]"/>
<xsl:with-param name="rSpRule" select="m:mPr/m:rSpRule/@m:val"/>
<xsl:with-param name="rSp" select="m:mPr/m:rSp/@m:val"/>
</xsl:call-template>
<xsl:for-each select="m:mr">
<mml:mtr>
Expand All @@ -1398,7 +1400,14 @@

<xsl:template name="CreateMathMLMatrixAttr">
<xsl:param name="mcJc" as="xs:string+"/>
<xsl:param name="rSpRule" as="xs:string?"/>
<xsl:param name="rSp" as="xs:string?"/>
<xsl:variable name="sLowerCaseMcjc" select="translate(string-join($mcJc, ' '), $alpha-uppercase, $alpha-lowercase)"/>
<xsl:variable name="rowSpacing" select="if ($rSpRule='3')
then concat(xs:integer($rSp) div 20, 'pt')
else if ($rSpRule='4')
then concat(xs:integer($rSp) div 2, 'em')
else concat($rSpRule,'em')"/>

<xsl:choose>
<xsl:when test="$sLowerCaseMcjc='left'">
Expand All @@ -1408,6 +1417,12 @@
<xsl:attribute name="columnalign">right</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:if test="$rSp!=''">
<xsl:attribute name="rowspacing">
<xsl:sequence select="string-join($rowSpacing ,' ')"/>
</xsl:attribute>
</xsl:if>

</xsl:template>

<xsl:template match="m:phant" mode="omml2mml">
Expand Down

0 comments on commit fa7a31f

Please sign in to comment.