فهرست منبع

Added keep-together PI support to screen blocks.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8042 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 سال پیش
والد
کامیت
2c2a41872c
1فایلهای تغییر یافته به همراه26 افزوده شده و 2 حذف شده
  1. 26 2
      pdf/lfs-mixed.xsl

+ 26 - 2
pdf/lfs-mixed.xsl

@@ -19,7 +19,6 @@
 
     <!-- Properties associated with verbatim text. -->
   <xsl:attribute-set name="verbatim.properties">
-    <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
     <xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
     <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
     <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
@@ -54,7 +53,7 @@
            Allow forced line breaks inside paragraphs emulating literallayout.
            Removed vertical space in variablelist. -->
     <!-- The original template is in {docbook-xsl}/fo/block.xsl -->
- <xsl:template match="para">
+  <xsl:template match="para">
     <xsl:choose>
       <xsl:when test="child::ulink[@url=' ']"/>
       <xsl:when test="./@remap='verbatim'">
@@ -81,6 +80,31 @@
     </xsl:choose>
   </xsl:template>
 
+    <!-- screen:
+          Self-made template that creates a fo:block wrapper with keep-together
+          processing instruction support around the output generated by
+          original screen templates. -->
+  <xsl:template match="screen">
+    <xsl:variable name="keep.together">
+      <xsl:call-template name="dbfo-attribute">
+        <xsl:with-param name="pis"
+                        select="processing-instruction('dbfo')"/>
+        <xsl:with-param name="attribute" select="'keep-together'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <fo:block>
+      <xsl:attribute name="keep-together.within-column">
+        <xsl:choose>
+          <xsl:when test="$keep.together != ''">
+            <xsl:value-of select="$keep.together"/>
+          </xsl:when>
+          <xsl:otherwise>always</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-imports/>
+    </fo:block>
+  </xsl:template>
+
     <!-- literal:
            Be sure that literal will use allways normal font weight. -->
     <!-- The original template is in {docbook-xsl}/fo/inline.xsl -->