lfs-pagesetup.xsl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. version="1.0">
  5. <!-- Force section1's onto a new page -->
  6. <xsl:attribute-set name="section.level1.properties">
  7. <xsl:attribute name="break-after">
  8. <xsl:choose>
  9. <xsl:when test="not(position()=last())">
  10. <xsl:text>page</xsl:text>
  11. </xsl:when>
  12. <xsl:otherwise>
  13. <xsl:text>auto</xsl:text>
  14. </xsl:otherwise>
  15. </xsl:choose>
  16. </xsl:attribute>
  17. </xsl:attribute-set>
  18. <!-- Header -->
  19. <xsl:attribute-set name="header.content.properties">
  20. <xsl:attribute name="font-family">
  21. <xsl:value-of select="$body.fontset"/>
  22. </xsl:attribute>
  23. <xsl:attribute name="text-align">right</xsl:attribute>
  24. </xsl:attribute-set>
  25. <xsl:template name="header.content">
  26. <xsl:value-of select="/book/bookinfo/title"/>
  27. <xsl:text> - </xsl:text>
  28. <xsl:value-of select="/book/bookinfo/subtitle"/>
  29. </xsl:template>
  30. <xsl:template name="header.table">
  31. <xsl:param name="gentext-key" select="''"/>
  32. <xsl:choose>
  33. <xsl:when test="$gentext-key = 'book'"/>
  34. <xsl:otherwise>
  35. <xsl:call-template name="header.content"/>
  36. </xsl:otherwise>
  37. </xsl:choose>
  38. </xsl:template>
  39. <!-- Centered titles for book and part -->
  40. <xsl:template name="book.titlepage">
  41. <fo:block space-before="2in">
  42. <fo:block>
  43. <xsl:call-template name="book.titlepage.before.recto"/>
  44. <xsl:call-template name="book.titlepage.recto"/>
  45. </fo:block>
  46. <fo:block>
  47. <xsl:call-template name="book.titlepage.before.verso"/>
  48. <xsl:call-template name="book.titlepage.verso"/>
  49. </fo:block>
  50. <xsl:call-template name="book.titlepage.separator"/>
  51. </fo:block>
  52. </xsl:template>
  53. <xsl:template name="part.titlepage">
  54. <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
  55. <fo:block space-before="2.5in">
  56. <xsl:call-template name="part.titlepage.before.recto"/>
  57. <xsl:call-template name="part.titlepage.recto"/>
  58. </fo:block>
  59. <fo:block>
  60. <xsl:call-template name="part.titlepage.before.verso"/>
  61. <xsl:call-template name="part.titlepage.verso"/>
  62. </fo:block>
  63. <xsl:call-template name="part.titlepage.separator"/>
  64. </fo:block>
  65. </xsl:template>
  66. <!-- Margins -->
  67. <xsl:param name="page.margin.inner">0.75in</xsl:param>
  68. <xsl:param name="page.margin.outer">0.75in</xsl:param>
  69. <xsl:param name="title.margin.left">-1pc</xsl:param>
  70. <xsl:attribute-set name="normal.para.spacing">
  71. <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
  72. <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
  73. <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
  74. </xsl:attribute-set>
  75. <xsl:attribute-set name="list.block.spacing">
  76. <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
  77. <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
  78. <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
  79. <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
  80. <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
  81. <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
  82. </xsl:attribute-set>
  83. <xsl:attribute-set name="list.item.spacing">
  84. <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
  85. <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
  86. <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
  87. </xsl:attribute-set>
  88. <xsl:attribute-set name="verbatim.properties">
  89. <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
  90. <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
  91. <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
  92. <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
  93. <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
  94. <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
  95. </xsl:attribute-set>
  96. <!-- Others-->
  97. <xsl:param name="header.rule" select="0"></xsl:param>
  98. <xsl:param name="footer.rule" select="0"></xsl:param>
  99. <xsl:param name="marker.section.level" select="-1"></xsl:param>
  100. <!-- Dropping a blank page -->
  101. <xsl:template name="book.titlepage.separator"/>
  102. <!-- How render a variablelist -->
  103. <xsl:param name="variablelist.as.blocks" select="1"/>
  104. </xsl:stylesheet>