~ubuntu-branches/ubuntu/jaunty/ubuntu-docs/jaunty-updates

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Customization layer for PDF output 
     CREATION INFO:
        Author: Jeff Schering
        Date: April 23, 2005
        Version: 0.1
     REVISION INFO:
        Author: Jeff Schering 
        Date: January 3, 2006 
        Version: 0.2
        Description: added draft mode parameters
     REVISION INFO:
        Author: 
        Date: 
        Version: 0.3
        
     License: CC-BY-SA. see http://creativecommons.org/licenses/by-sa/2.0/
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<!-- Import the standard xsl -->
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl"/>

<!-- PARAMETERS SECTION -->

<!-- select draft mode, either yes or no -->
<xsl:param name="draft.mode" select="'no'"/>

<!-- if draft mode is on, then use ubuntu draft image. -->
<xsl:param name="draft.watermark.image" select="'https://wiki.ubuntu.com/htdocs/ubuntu/img/u-draft.png'"/>

<!-- Give each section a number -->
<xsl:param name="section.autolabel" select="0"></xsl:param>

<!-- Turn on left justify. The default is full justify  -->
<xsl:param name="alignment">left</xsl:param>

<!-- Create bookmarks in the PDF file 
     NOTE: this is only applicable if Apache fop is used -->
<xsl:param name="fop.extensions" select="1"/>

<!-- Put a rule above each footer and a rule below each header  -->
<xsl:param name="footer.rule" select="1"/>
<xsl:param name="header.rule" select="1"/>

<!-- Use a sans-serif font -->
<xsl:param name="body.font.family" select="'sans-serif'"/>

<!-- Don't split words across lines (no end-of-line word breaks) -->
<xsl:param name="hyphenate">false</xsl:param>

<!-- Don't make a table of contents -->
<xsl:param name="generate.toc">article nop</xsl:param>

<!-- '1 3 1' means the center header has three times the width of the left and 
     right headers. This is needed because the doc title is in the center header -->
<xsl:param name="header.column.widths" select="'1 3 1'"/>

<!-- TEMPLATE OVERRIDES SECTION -->

<!-- modify footer.content template from fo/pagesetup.xsl to change page number
     location from center to right -->
<xsl:template name="footer.content">
  <xsl:param name="pageclass" select="''"/>
  <xsl:param name="sequence" select="''"/>
  <xsl:param name="position" select="''"/>
  <xsl:param name="gentext-key" select="''"/>

  <fo:block>
    <!-- pageclass can be front, body, back -->
    <!-- sequence can be odd, even, first, blank -->
    <!-- position can be left, center, right -->
    <xsl:choose>
      <xsl:when test="$pageclass = 'titlepage'">
        <!-- nop; no footer on title pages -->
      </xsl:when>

      <xsl:when test="$double.sided != 0 and $sequence = 'even'
                      and $position='left'">
        <fo:page-number/>
      </xsl:when>

      <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
                      and $position='right'">
        <fo:page-number/>
      </xsl:when>

<!-- This is the original
      <xsl:when test="$double.sided = 0 and $position='center'">
        <fo:page-number/>
      </xsl:when>
-->
     <!-- change from center to right -->
      <xsl:when test="$double.sided = 0 and $position='right'">
        <fo:page-number/>
      </xsl:when>


      <xsl:when test="$sequence='blank'">
        <xsl:choose>
          <xsl:when test="$double.sided != 0 and $position = 'left'">
            <fo:page-number/>
          </xsl:when>
          <xsl:when test="$double.sided = 0 and $position = 'center'">
            <fo:page-number/>
          </xsl:when>
          <xsl:otherwise>
            <!-- nop -->
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>


      <xsl:otherwise>
        <!-- nop -->
      </xsl:otherwise>
    </xsl:choose>
  </fo:block>
</xsl:template>


</xsl:stylesheet>