Skip to content

Commit

Permalink
xslt update based on metanorma/mn-native-pdf@05f5289
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 authored Jun 24, 2024
1 parent df64f59 commit a3c6986
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/isodoc/ieee/ieee.amendment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10598,6 +10598,8 @@
</xsl:choose>
</xsl:variable>

<xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::*[local-name() = 'figure']/preceding-sibling::*[1][local-name() = 'title'] and 1 = 1)"/>

<xsl:choose>
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
<fo:block>
Expand Down Expand Up @@ -10744,7 +10746,14 @@
<xsl:variable name="scale_y">
<xsl:choose>
<xsl:when test="$svg_height * $scale_x &gt; $height_effective_px">
<xsl:value-of select="$height_effective_px div ($svg_height * $scale_x)"/>
<xsl:variable name="height_effective_px_">
<xsl:choose>
<!-- title is 'keep-with-next' with following figure -->
<xsl:when test="$isPrecedingTitle = 'true'"><xsl:value-of select="$height_effective_px - 80"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$height_effective_px"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$height_effective_px_ div ($svg_height * $scale_x)"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
Expand Down
11 changes: 10 additions & 1 deletion lib/isodoc/ieee/ieee.standard.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10598,6 +10598,8 @@
</xsl:choose>
</xsl:variable>

<xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::*[local-name() = 'figure']/preceding-sibling::*[1][local-name() = 'title'] and 1 = 1)"/>

<xsl:choose>
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
<fo:block>
Expand Down Expand Up @@ -10744,7 +10746,14 @@
<xsl:variable name="scale_y">
<xsl:choose>
<xsl:when test="$svg_height * $scale_x &gt; $height_effective_px">
<xsl:value-of select="$height_effective_px div ($svg_height * $scale_x)"/>
<xsl:variable name="height_effective_px_">
<xsl:choose>
<!-- title is 'keep-with-next' with following figure -->
<xsl:when test="$isPrecedingTitle = 'true'"><xsl:value-of select="$height_effective_px - 80"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$height_effective_px"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$height_effective_px_ div ($svg_height * $scale_x)"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
Expand Down

0 comments on commit a3c6986

Please sign in to comment.