pdf-manual.xsl.in 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  5. version="1.0">
  6. <!-- path to original XSL used to do transforms -->
  7. <xsl:import href="@DOCBOOK_FO_XSL@"/>
  8. <!-- DIRECTIVES FOR CUSTOMIZATION -->
  9. <xsl:param name="fop1.extensions" select="1"></xsl:param>
  10. <!-- Hyphenation -->
  11. <xsl:template name="set.flow.properties">
  12. <xsl:param name="element" select="local-name(.)"/>
  13. <xsl:param name="master-reference" select="''"/>
  14. <xsl:choose>
  15. <xsl:when test="starts-with($master-reference, 'index') or
  16. starts-with($master-reference, 'titlepage') or
  17. starts-with($master-reference, 'lot') or
  18. starts-with($master-reference, 'front')">
  19. <xsl:attribute name="hyphenate">false</xsl:attribute>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <xsl:attribute name="hyphenate">
  23. <xsl:value-of select="$hyphenate"/>
  24. </xsl:attribute>
  25. </xsl:otherwise>
  26. </xsl:choose>
  27. </xsl:template>
  28. <!-- pages always start on odd -->
  29. <xsl:template match="chapter">
  30. <xsl:variable name="id">
  31. <xsl:call-template name="object.id"/>
  32. </xsl:variable>
  33. <xsl:variable name="master-reference">
  34. <xsl:call-template name="select.pagemaster"/>
  35. </xsl:variable>
  36. <fo:page-sequence hyphenate="{$hyphenate}"
  37. master-reference="{$master-reference}"
  38. force-page-count="end-on-even">
  39. <xsl:attribute name="language">
  40. <xsl:call-template name="l10n.language"/>
  41. </xsl:attribute>
  42. <xsl:attribute name="format">
  43. <xsl:call-template name="page.number.format">
  44. <xsl:with-param name="master-reference" select="$master-reference"/>
  45. </xsl:call-template>
  46. </xsl:attribute>
  47. <xsl:attribute name="initial-page-number">
  48. <xsl:call-template name="initial.page.number">
  49. <xsl:with-param name="master-reference" select="$master-reference"/>
  50. </xsl:call-template>
  51. </xsl:attribute>
  52. <!--
  53. <xsl:attribute name="force-page-count">
  54. <xsl:call-template name="force.page.count">
  55. <xsl:with-param name="master-reference" select="$master-reference"/>
  56. </xsl:call-template>
  57. </xsl:attribute>
  58. -->
  59. <xsl:attribute name="hyphenation-character">
  60. <xsl:call-template name="gentext">
  61. <xsl:with-param name="key" select="'hyphenation-character'"/>
  62. </xsl:call-template>
  63. </xsl:attribute>
  64. <xsl:attribute name="hyphenation-push-character-count">
  65. <xsl:call-template name="gentext">
  66. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  67. </xsl:call-template>
  68. </xsl:attribute>
  69. <xsl:attribute name="hyphenation-remain-character-count">
  70. <xsl:call-template name="gentext">
  71. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  72. </xsl:call-template>
  73. </xsl:attribute>
  74. <xsl:apply-templates select="." mode="running.head.mode">
  75. <xsl:with-param name="master-reference" select="$master-reference"/>
  76. </xsl:apply-templates>
  77. <xsl:apply-templates select="." mode="running.foot.mode">
  78. <xsl:with-param name="master-reference" select="$master-reference"/>
  79. </xsl:apply-templates>
  80. <fo:flow flow-name="xsl-region-body">
  81. <xsl:call-template name="set.flow.properties">
  82. <xsl:with-param name="element" select="local-name(.)"/>
  83. <xsl:with-param name="master-reference" select="$master-reference"/>
  84. </xsl:call-template>
  85. <fo:block id="{$id}"
  86. xsl:use-attribute-sets="component.titlepage.properties">
  87. <xsl:call-template name="chapter.titlepage"/>
  88. </fo:block>
  89. <xsl:variable name="toc.params">
  90. <xsl:call-template name="find.path.params">
  91. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  92. </xsl:call-template>
  93. </xsl:variable>
  94. <xsl:if test="contains($toc.params, 'toc')">
  95. <xsl:call-template name="component.toc">
  96. <xsl:with-param name="toc.title.p"
  97. select="contains($toc.params, 'title')"/>
  98. </xsl:call-template>
  99. <xsl:call-template name="component.toc.separator"/>
  100. </xsl:if>
  101. <xsl:apply-templates/>
  102. </fo:flow>
  103. </fo:page-sequence>
  104. </xsl:template>
  105. </xsl:stylesheet>