r4114 - branches/testing/BOOK/stylesheets/pdf

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Sep 4 04:39:52 PDT 2004


Author: manuel
Date: 2004-09-04 05:39:50 -0600 (Sat, 04 Sep 2004)
New Revision: 4114

Modified:
   branches/testing/BOOK/stylesheets/pdf/lfs-mixed.xsl
Log:
External links in italic font for PDF output.

Modified: branches/testing/BOOK/stylesheets/pdf/lfs-mixed.xsl
===================================================================
--- branches/testing/BOOK/stylesheets/pdf/lfs-mixed.xsl	2004-09-03 22:16:48 UTC (rev 4113)
+++ branches/testing/BOOK/stylesheets/pdf/lfs-mixed.xsl	2004-09-04 11:39:50 UTC (rev 4114)
@@ -12,6 +12,61 @@
     <fo:block break-after="page"/>
   </xsl:template>
 
+    <!-- Show URLs in italic font -->
+  <xsl:template match="ulink" name="ulink">
+    <fo:inline font-style="italic">
+      <fo:basic-link xsl:use-attribute-sets="xref.properties">
+        <xsl:attribute name="external-destination">
+          <xsl:call-template name="fo-external-image">
+            <xsl:with-param name="filename" select="@url"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <xsl:choose>
+          <xsl:when test="count(child::node())=0">
+            <xsl:call-template name="hyphenate-url">
+              <xsl:with-param name="url" select="@url"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:basic-link>
+    </fo:inline>
+    <xsl:if test="count(child::node()) != 0
+                  and string(.) != @url
+                  and $ulink.show != 0">
+      <!-- yes, show the URI -->
+      <xsl:choose>
+        <xsl:when test="$ulink.footnotes != 0 and not(ancestor::footnote)">
+          <xsl:text>&#xA0;</xsl:text>
+          <fo:footnote>
+            <xsl:call-template name="ulink.footnote.number"/>
+            <fo:footnote-body font-family="{$body.fontset}"
+                              font-size="{$footnote.font.size}">
+              <fo:block>
+                <xsl:call-template name="ulink.footnote.number"/>
+                <xsl:text> </xsl:text>
+                <fo:inline>
+                  <xsl:value-of select="@url"/>
+                </fo:inline>
+              </fo:block>
+            </fo:footnote-body>
+          </fo:footnote>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:inline hyphenate="false">
+            <xsl:text> [</xsl:text>
+            <xsl:call-template name="hyphenate-url">
+              <xsl:with-param name="url" select="@url"/>
+            </xsl:call-template>
+            <xsl:text>]</xsl:text>
+          </fo:inline>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
     <!-- Split URLs -->
   <xsl:template name="hyphenate-url">
     <xsl:param name="url" select="''"/>




More information about the lfs-book mailing list