aboutsummaryrefslogtreecommitdiffstats
path: root/stylesheets
diff options
context:
space:
mode:
authorManuel Canales Esparcia <manuel@linuxfromscratch.org>2006-08-03 19:29:29 +0000
committerManuel Canales Esparcia <manuel@linuxfromscratch.org>2006-08-03 19:29:29 +0000
commitc226182dc5ff37f733c895ab16483ebd37c02bcc (patch)
tree82a9abff83df5aa35fec4fd1539091cfb7920ef2 /stylesheets
parenta15464dfe656aec48ced77b2ded760f0cc639ad7 (diff)
Ported updates from 6.2 branch.
Small tags fixes. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7758 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'stylesheets')
-rw-r--r--stylesheets/pdf/lfs-mixed.xsl54
-rw-r--r--stylesheets/pdf/lfs-pagesetup.xsl5
2 files changed, 59 insertions, 0 deletions
diff --git a/stylesheets/pdf/lfs-mixed.xsl b/stylesheets/pdf/lfs-mixed.xsl
index ac096e5c9..da3665909 100644
--- a/stylesheets/pdf/lfs-mixed.xsl
+++ b/stylesheets/pdf/lfs-mixed.xsl
@@ -16,6 +16,7 @@
and to remove vertical space in pachages and patches pages. -->
<xsl:template match="para">
<xsl:choose>
+ <xsl:when test="child::ulink[@url=' ']"/>
<xsl:when test="./@remap='verbatim'">
<fo:block wrap-option="no-wrap"
white-space-collapse="false"
@@ -254,4 +255,57 @@
</xsl:choose>
</xsl:template>
+ <!-- Total packages size calculation -->
+ <xsl:template match="returnvalue">
+ <xsl:call-template name="calculation">
+ <xsl:with-param name="scope" select="../../variablelist"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="calculation">
+ <xsl:param name="scope"/>
+ <xsl:param name="total">0</xsl:param>
+ <xsl:param name="position">1</xsl:param>
+ <xsl:variable name="tokens" select="count($scope/varlistentry)"/>
+ <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/>
+ <xsl:variable name="size" select="substring-before($token,' KB')"/>
+ <xsl:variable name="rawsize">
+ <xsl:choose>
+ <xsl:when test="contains($size,',')">
+ <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$size"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$position &lt;= $tokens">
+ <xsl:call-template name="calculation">
+ <xsl:with-param name="scope" select="$scope"/>
+ <xsl:with-param name="position" select="$position +1"/>
+ <xsl:with-param name="total" select="$total + $rawsize"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$total &lt; '1000'">
+ <xsl:value-of select="$total"/>
+ <xsl:text> KB</xsl:text>
+ </xsl:when>
+ <xsl:when test="$total &gt; '1000' and $total &lt; '5000'">
+ <xsl:value-of select="substring($total,1,1)"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="substring($total,2)"/>
+ <xsl:text> KB</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round($total div 1024)"/>
+ <xsl:text> MB</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
</xsl:stylesheet>
diff --git a/stylesheets/pdf/lfs-pagesetup.xsl b/stylesheets/pdf/lfs-pagesetup.xsl
index 7e19099ce..7194c3e6d 100644
--- a/stylesheets/pdf/lfs-pagesetup.xsl
+++ b/stylesheets/pdf/lfs-pagesetup.xsl
@@ -109,6 +109,11 @@
<xsl:param name="header.rule" select="0"></xsl:param>
<xsl:param name="footer.rule" select="0"></xsl:param>
<xsl:param name="marker.section.level" select="-1"></xsl:param>
+ <xsl:attribute-set name="compact.list.item.spacing">
+ <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
+ </xsl:attribute-set>
<!-- Dropping a blank page -->
<xsl:template name="book.titlepage.separator"/>