lfs-pagesetup.xsl 4.3 KB

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