Browse Source

Ported from testing the last changes in PDF stylesheets

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4042 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 21 năm trước cách đây
mục cha
commit
de749cf1cf
3 tập tin đã thay đổi với 63 bổ sung19 xóa
  1. 2 2
      stylesheets/lfs-pdf.xsl
  2. 45 1
      stylesheets/pdf/lfs-mixed.xsl
  3. 16 16
      stylesheets/pdf/lfs-pagesetup.xsl

+ 2 - 2
stylesheets/lfs-pdf.xsl

@@ -25,8 +25,8 @@
   <xsl:param name="alignment">justify</xsl:param>
 
     <!-- Font size -->
-  <xsl:param name="body.font.master">6</xsl:param>
-  <xsl:param name="body.font.size">8pt</xsl:param>
+  <xsl:param name="body.font.master">10</xsl:param>
+  <xsl:param name="body.font.size">12pt</xsl:param>
 
     <!-- TOC stuff -->
   <xsl:param name="generate.toc">

+ 45 - 1
stylesheets/pdf/lfs-mixed.xsl

@@ -4,6 +4,50 @@
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
                 version="1.0">
 
+    <!-- Split URLs -->
+  <xsl:template name="hyphenate-url">
+    <xsl:param name="url" select="''"/>
+    <xsl:choose>
+      <xsl:when test="ancestor::varlistentry">
+        <xsl:choose>
+          <xsl:when test="string-length($url) > 88">
+            <xsl:value-of select="substring($url, 1, 50)"/>
+            <xsl:param name="rest" select="substring($url, 51)"/>
+            <xsl:value-of select="substring-before($rest, '/')"/>
+            <xsl:text> /</xsl:text>
+            <xsl:value-of select="substring-after($rest, '/')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$url"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring-before($url, '//')"/>
+        <xsl:text>// </xsl:text>
+        <xsl:call-template name="split-url">
+          <xsl:with-param name="url2" select="substring-after($url, '//')"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="split-url">
+    <xsl:choose>
+      <xsl:when test="contains($url2, '/')">
+      <xsl:param name="url2" select="''"/>
+      <xsl:value-of select="substring-before($url2, '/')"/>
+      <xsl:text> /</xsl:text>
+      <xsl:call-template name="split-url">
+        <xsl:with-param name="url2" select="substring-after($url2, '/')"/>
+      </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$url2"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
     <!-- Shade screen -->
   <xsl:param name="shade.verbatim" select="1"/>
 
@@ -45,7 +89,7 @@
   
     <!-- Admonitions text properties -->
   <xsl:attribute-set name="admonition.properties">
-    <xsl:attribute name="margin-right">12pt</xsl:attribute>
+    <xsl:attribute name="margin-right">6pt</xsl:attribute>
   </xsl:attribute-set>
 
     <!-- Adding left space to the graphics and color to the titles -->

+ 16 - 16
stylesheets/pdf/lfs-pagesetup.xsl

@@ -65,19 +65,19 @@
     <!-- Margins -->
   <xsl:param name="page.margin.inner">0.5in</xsl:param>
   <xsl:param name="page.margin.outer">0.375in</xsl:param>
-  <xsl:param name="title.margin.left">-1pc</xsl:param>
+  <xsl:param name="title.margin.left">-0.7pc</xsl:param>
   <xsl:attribute-set name="normal.para.spacing">
-    <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
-    <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
-    <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
+    <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>
   <xsl:attribute-set name="list.block.spacing">
-    <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
-    <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
-    <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
-    <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
-    <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
-    <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
+    <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 name="space-after.optimum">0.6em</xsl:attribute>
+    <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+    <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
   </xsl:attribute-set>
   <xsl:attribute-set name="list.item.spacing">
     <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
@@ -85,12 +85,12 @@
     <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
   </xsl:attribute-set>
   <xsl:attribute-set name="verbatim.properties">
-    <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
-    <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
-    <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
-    <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
-    <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
-    <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
+    <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 name="space-after.optimum">0.6em</xsl:attribute>
+    <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+    <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
   </xsl:attribute-set>
 
     <!-- Others-->