]> granicus.if.org Git - docbook-dsssl/commitdiff
Improved formatting
authorNorman Walsh <ndw@nwalsh.com>
Fri, 9 Nov 2001 13:54:05 +0000 (13:54 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 9 Nov 2001 13:54:05 +0000 (13:54 +0000)
slides/xsl/fo-plain.xsl
slides/xsl/titlepage-fo-plain.xml

index 068cd846871903ed4ebdae9202258783e78fcfd9..dbc89abdf4d1802783ba3d2f9ebbc5c75b78a7d7 100644 (file)
@@ -6,11 +6,23 @@
 <xsl:import href="/sourceforge/docbook/xsl/fo/docbook.xsl"/>
 <xsl:include href="titlepage-fo-plain.xsl"/>
 
+<xsl:param name="local.l10n.xml" select="document('')"/>
+<i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
+  <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
+    <l:context name="title">
+      <l:template name="slides" text="%t"/>
+    </l:context>
+  </l:l10n>
+</i18n>
+
 <xsl:param name="page.orientation" select="'landscape'"/>
+<xsl:param name="double.sided" select="1"/>
 
 <xsl:param name="slide.title.font.family" select="'Helvetica'"/>
 <xsl:param name="slide.font.family" select="'Helvetica'"/>
 
+<xsl:param name="body.font.master" select="18"/>
+
 <xsl:attribute-set name="slides.properties">
   <xsl:attribute name="font-family">
     <xsl:value-of select="$slide.font.family"/>
 
 <!-- ============================================================ -->
 
+<xsl:template name="user.pagemasters">
+  <fo:page-sequence-master master-name="twoside1-with-titlepage">
+    <fo:repeatable-page-master-alternatives>
+      <fo:conditional-page-master-reference master-name="first1"
+                                            page-position="first"/>
+      <fo:conditional-page-master-reference master-name="blank"
+                                            blank-or-not-blank="blank"/>
+      <fo:conditional-page-master-reference master-name="right1"
+                                            odd-or-even="odd"/>
+      <fo:conditional-page-master-reference master-name="left1"
+                                            odd-or-even="even"/>
+    </fo:repeatable-page-master-alternatives>
+  </fo:page-sequence-master>
+
+  <fo:page-sequence-master master-name="oneside1-with-titlepage">
+    <fo:repeatable-page-master-alternatives>
+      <fo:conditional-page-master-reference master-name="first1"
+                                            page-position="first"/>
+      <fo:conditional-page-master-reference master-name="simple1"/>
+    </fo:repeatable-page-master-alternatives>
+  </fo:page-sequence-master>
+</xsl:template>
+
+<xsl:template match="*" mode="running.foot.mode">
+  <xsl:param name="master-name" select="'unknown'"/>
+  <xsl:variable name="foot">
+    <fo:page-number/>
+  </xsl:variable>
+  <!-- by default, the page number -->
+  <xsl:choose>
+    <xsl:when test="$master-name='titlepage1'"></xsl:when>
+    <xsl:when test="$master-name='oneside1-with-titlepage'">
+      <fo:static-content flow-name="xsl-region-after">
+        <fo:block text-align="center" font-size="10pt">
+          <xsl:copy-of select="$foot"/>
+        </fo:block>
+      </fo:static-content>
+    </xsl:when>
+    <xsl:when test="$master-name='twoside1-with-titlepage'">
+      <fo:static-content flow-name="xsl-region-after-left">
+        <fo:block text-align="left" font-size="10pt">
+          <xsl:copy-of select="$foot"/>
+        </fo:block>
+      </fo:static-content>
+      <fo:static-content flow-name="xsl-region-after-right">
+        <fo:block text-align="right" font-size="10pt">
+          <xsl:copy-of select="$foot"/>
+        </fo:block>
+      </fo:static-content>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Unexpected master-name (</xsl:text>
+        <xsl:value-of select="$master-name"/>
+        <xsl:text>) in running.foot.mode for </xsl:text>
+        <xsl:value-of select="name(.)"/>
+        <xsl:text>. No footer generated.</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="select.doublesided.pagemaster">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:choose>
+    <xsl:when test="$element='slides'">
+      <xsl:text>titlepage1</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>twoside1-with-titlepage</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="select.singlesided.pagemaster">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:choose>
+    <xsl:when test="$element='slides'">
+      <xsl:text>titlepage1</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>oneside1-with-titlepage</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="slides">
   <xsl:variable name="master-name">
     <xsl:call-template name="select.pagemaster"/>
              xsl:use-attribute-sets="slides.properties">
       <xsl:call-template name="slides.titlepage"/>
       <xsl:apply-templates select="speakernotes"/>
-      <xsl:apply-templates select="section|foil"/>
+      <xsl:apply-templates select="foil"/>
     </fo:flow>
   </fo:page-sequence>
+  <xsl:apply-templates select="section"/>
 </xsl:template>
 
 <xsl:template match="slidesinfo"/>
 <!-- ============================================================ -->
 
 <xsl:template match="section">
-  <fo:block break-before="page"
-            xsl:use-attribute-sets="section.properties">
-    <xsl:call-template name="section.titlepage"/>
-    <xsl:apply-templates/>
-  </fo:block>
+  <xsl:variable name="master-name">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <fo:page-sequence hyphenate="{$hyphenate}"
+                    master-name="{$master-name}">
+    <xsl:attribute name="language">
+      <xsl:call-template name="l10n.language"/>
+    </xsl:attribute>
+    <xsl:if test="$double.sided != 0">
+      <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
+    </xsl:if>
+
+    <xsl:apply-templates select="." mode="running.head.mode">
+      <xsl:with-param name="master-name" select="$master-name"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="." mode="running.foot.mode">
+      <xsl:with-param name="master-name" select="$master-name"/>
+    </xsl:apply-templates>
+    <fo:flow flow-name="xsl-region-body"
+             xsl:use-attribute-sets="slides.properties">
+      <xsl:call-template name="section.titlepage"/>
+      <xsl:apply-templates select="speakernotes"/>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="slides/section/title" mode="titlepage.mode">
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="title" mode="section.titlepage.recto.mode">
   <fo:block>
-    <xsl:text>.</xsl:text>
+    <fo:inline color="white">.</fo:inline>
     <fo:block space-before="2in">
       <xsl:apply-templates select="." mode="titlepage.mode"/>
     </fo:block>
             xsl:use-attribute-sets="section.properties">
     <xsl:call-template name="foil.titlepage"/>
 
-    <fo:block text-align="center">
-      <fo:leader leader-length="2in"
-                 alignment-baseline="middle" 
-                 rule-thickness="0.5pt" color="black"/>
-      <fo:inline font="16pt ZapfDingbats"
-                 color="#E00000">&#x274B;</fo:inline> 
-      <fo:leader leader-length="2in"
-                 alignment-baseline="middle"
-                 rule-thickness="0.5pt" color="black"/>
-    </fo:block>
-
     <fo:block xsl:use-attribute-sets="foil.properties">
       <xsl:apply-templates/>
     </fo:block>
index d7df863d91a58f56ce9f42c553d609f7cc124eb4..230737b6a464136c8ae791dbb756ff9bc4ae7de4 100644 (file)
@@ -27,7 +27,7 @@
             fo:text-align="center"
             fo:space-after="1em"
             fo:keep-with-next="always"
-            fo:font-size="&hsize5;"
+            fo:font-size="24pt"
             fo:font-weight="bold"
             fo:font-family="{$slide.title.font.family}"/>
 
@@ -79,7 +79,7 @@
 <t:titlepage element="section" wrapper="fo:block">
   <t:titlepage-content side="recto">
     <title predicate="[1]"
-          fo:font-size="&hsize5;"
+          fo:font-size="24pt"
           fo:text-align="center"
           fo:font-weight="bold"
           fo:font-family="{$slide.title.font.family}"/>
 <t:titlepage element="foil" wrapper="fo:block">
   <t:titlepage-content side="recto">
     <title predicate="[1]"
-          fo:font-size="&hsize4;"
+          fo:font-size="22pt"
           fo:font-weight="bold"
           fo:text-align="center"
           fo:font-family="{$slide.title.font.family}"/>