pagesetup.xsl 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314
  1. <?xml version="1.0"?>
  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. <!-- ********************************************************************
  6. $Id$
  7. ********************************************************************
  8. This file is part of the DocBook XSL Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/ for copyright
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <xsl:param name="body.fontset">
  14. <xsl:value-of select="$body.font.family"/>
  15. <xsl:if test="$body.font.family != ''
  16. and $symbol.font.family != ''">,</xsl:if>
  17. <xsl:value-of select="$symbol.font.family"/>
  18. </xsl:param>
  19. <xsl:param name="title.fontset">
  20. <xsl:value-of select="$title.font.family"/>
  21. <xsl:if test="$title.font.family != ''
  22. and $symbol.font.family != ''">,</xsl:if>
  23. <xsl:value-of select="$symbol.font.family"/>
  24. </xsl:param>
  25. <!-- PassiveTeX can't handle the math expression for
  26. title.margin.left being negative, so ignore it.
  27. margin-left="{$page.margin.outer} - {$title.margin.left}"
  28. -->
  29. <xsl:param name="margin.left.outer">
  30. <xsl:choose>
  31. <xsl:when test="$passivetex.extensions != 0">
  32. <xsl:value-of select="$page.margin.outer"/>
  33. </xsl:when>
  34. <xsl:otherwise>
  35. <xsl:value-of select="$page.margin.outer"/>
  36. <xsl:text> - </xsl:text>
  37. <xsl:value-of select="$title.margin.left"/>
  38. </xsl:otherwise>
  39. </xsl:choose>
  40. </xsl:param>
  41. <xsl:param name="margin.left.inner">
  42. <xsl:choose>
  43. <xsl:when test="$passivetex.extensions != 0">
  44. <xsl:value-of select="$page.margin.inner"/>
  45. </xsl:when>
  46. <xsl:otherwise>
  47. <xsl:value-of select="$page.margin.inner"/>
  48. <xsl:text> - </xsl:text>
  49. <xsl:value-of select="$title.margin.left"/>
  50. </xsl:otherwise>
  51. </xsl:choose>
  52. </xsl:param>
  53. <xsl:template name="setup.pagemasters">
  54. <fo:layout-master-set>
  55. <!-- blank pages -->
  56. <fo:simple-page-master master-name="blank"
  57. page-width="{$page.width}"
  58. page-height="{$page.height}"
  59. margin-top="{$page.margin.top}"
  60. margin-bottom="{$page.margin.bottom}"
  61. margin-left="{$margin.left.outer}"
  62. margin-right="{$page.margin.inner}">
  63. <xsl:if test="$axf.extensions != 0">
  64. <xsl:call-template name="axf-page-master-properties">
  65. <xsl:with-param name="page.master">blank</xsl:with-param>
  66. </xsl:call-template>
  67. </xsl:if>
  68. <fo:region-body display-align="center"
  69. margin-bottom="{$body.margin.bottom}"
  70. margin-top="{$body.margin.top}">
  71. <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
  72. <xsl:attribute name="region-name">blank-body</xsl:attribute>
  73. </xsl:if>
  74. </fo:region-body>
  75. <fo:region-before region-name="xsl-region-before-blank"
  76. extent="{$region.before.extent}"
  77. display-align="before"/>
  78. <fo:region-after region-name="xsl-region-after-blank"
  79. extent="{$region.after.extent}"
  80. display-align="after"/>
  81. </fo:simple-page-master>
  82. <!-- title pages -->
  83. <fo:simple-page-master master-name="titlepage-first"
  84. page-width="{$page.width}"
  85. page-height="{$page.height}"
  86. margin-top="{$page.margin.top}"
  87. margin-bottom="{$page.margin.bottom}"
  88. margin-left="{$margin.left.inner}"
  89. margin-right="{$page.margin.outer}">
  90. <xsl:if test="$axf.extensions != 0">
  91. <xsl:call-template name="axf-page-master-properties">
  92. <xsl:with-param name="page.master">titlepage-first</xsl:with-param>
  93. </xsl:call-template>
  94. </xsl:if>
  95. <fo:region-body margin-bottom="{$body.margin.bottom}"
  96. margin-top="{$body.margin.top}"
  97. column-gap="{$column.gap.titlepage}"
  98. column-count="{$column.count.titlepage}">
  99. </fo:region-body>
  100. <fo:region-before region-name="xsl-region-before-first"
  101. extent="{$region.before.extent}"
  102. display-align="before"/>
  103. <fo:region-after region-name="xsl-region-after-first"
  104. extent="{$region.after.extent}"
  105. display-align="after"/>
  106. </fo:simple-page-master>
  107. <fo:simple-page-master master-name="titlepage-odd"
  108. page-width="{$page.width}"
  109. page-height="{$page.height}"
  110. margin-top="{$page.margin.top}"
  111. margin-bottom="{$page.margin.bottom}"
  112. margin-left="{$margin.left.inner}"
  113. margin-right="{$page.margin.outer}">
  114. <xsl:if test="$axf.extensions != 0">
  115. <xsl:call-template name="axf-page-master-properties">
  116. <xsl:with-param name="page.master">titlepage-odd</xsl:with-param>
  117. </xsl:call-template>
  118. </xsl:if>
  119. <fo:region-body margin-bottom="{$body.margin.bottom}"
  120. margin-top="{$body.margin.top}"
  121. column-gap="{$column.gap.titlepage}"
  122. column-count="{$column.count.titlepage}">
  123. </fo:region-body>
  124. <fo:region-before region-name="xsl-region-before-odd"
  125. extent="{$region.before.extent}"
  126. display-align="before"/>
  127. <fo:region-after region-name="xsl-region-after-odd"
  128. extent="{$region.after.extent}"
  129. display-align="after"/>
  130. </fo:simple-page-master>
  131. <fo:simple-page-master master-name="titlepage-even"
  132. page-width="{$page.width}"
  133. page-height="{$page.height}"
  134. margin-top="{$page.margin.top}"
  135. margin-bottom="{$page.margin.bottom}"
  136. margin-left="{$margin.left.outer}"
  137. margin-right="{$page.margin.inner}">
  138. <xsl:if test="$axf.extensions != 0">
  139. <xsl:call-template name="axf-page-master-properties">
  140. <xsl:with-param name="page.master">titlepage-even</xsl:with-param>
  141. </xsl:call-template>
  142. </xsl:if>
  143. <fo:region-body margin-bottom="{$body.margin.bottom}"
  144. margin-top="{$body.margin.top}"
  145. column-gap="{$column.gap.titlepage}"
  146. column-count="{$column.count.titlepage}">
  147. </fo:region-body>
  148. <fo:region-before region-name="xsl-region-before-even"
  149. extent="{$region.before.extent}"
  150. display-align="before"/>
  151. <fo:region-after region-name="xsl-region-after-even"
  152. extent="{$region.after.extent}"
  153. display-align="after"/>
  154. </fo:simple-page-master>
  155. <!-- list-of-title pages -->
  156. <fo:simple-page-master master-name="lot-first"
  157. page-width="{$page.width}"
  158. page-height="{$page.height}"
  159. margin-top="{$page.margin.top}"
  160. margin-bottom="{$page.margin.bottom}"
  161. margin-left="{$margin.left.inner}"
  162. margin-right="{$page.margin.outer}">
  163. <xsl:if test="$axf.extensions != 0">
  164. <xsl:call-template name="axf-page-master-properties">
  165. <xsl:with-param name="page.master">lot-first</xsl:with-param>
  166. </xsl:call-template>
  167. </xsl:if>
  168. <fo:region-body margin-bottom="{$body.margin.bottom}"
  169. margin-top="{$body.margin.top}"
  170. column-gap="{$column.gap.lot}"
  171. column-count="{$column.count.lot}">
  172. </fo:region-body>
  173. <fo:region-before region-name="xsl-region-before-first"
  174. extent="{$region.before.extent}"
  175. display-align="before"/>
  176. <fo:region-after region-name="xsl-region-after-first"
  177. extent="{$region.after.extent}"
  178. display-align="after"/>
  179. </fo:simple-page-master>
  180. <fo:simple-page-master master-name="lot-odd"
  181. page-width="{$page.width}"
  182. page-height="{$page.height}"
  183. margin-top="{$page.margin.top}"
  184. margin-bottom="{$page.margin.bottom}"
  185. margin-left="{$margin.left.inner}"
  186. margin-right="{$page.margin.outer}">
  187. <xsl:if test="$axf.extensions != 0">
  188. <xsl:call-template name="axf-page-master-properties">
  189. <xsl:with-param name="page.master">lot-odd</xsl:with-param>
  190. </xsl:call-template>
  191. </xsl:if>
  192. <fo:region-body margin-bottom="{$body.margin.bottom}"
  193. margin-top="{$body.margin.top}"
  194. column-gap="{$column.gap.lot}"
  195. column-count="{$column.count.lot}">
  196. </fo:region-body>
  197. <fo:region-before region-name="xsl-region-before-odd"
  198. extent="{$region.before.extent}"
  199. display-align="before"/>
  200. <fo:region-after region-name="xsl-region-after-odd"
  201. extent="{$region.after.extent}"
  202. display-align="after"/>
  203. </fo:simple-page-master>
  204. <fo:simple-page-master master-name="lot-even"
  205. page-width="{$page.width}"
  206. page-height="{$page.height}"
  207. margin-top="{$page.margin.top}"
  208. margin-bottom="{$page.margin.bottom}"
  209. margin-left="{$margin.left.outer}"
  210. margin-right="{$page.margin.inner}">
  211. <xsl:if test="$axf.extensions != 0">
  212. <xsl:call-template name="axf-page-master-properties">
  213. <xsl:with-param name="page.master">lot-even</xsl:with-param>
  214. </xsl:call-template>
  215. </xsl:if>
  216. <fo:region-body margin-bottom="{$body.margin.bottom}"
  217. margin-top="{$body.margin.top}"
  218. column-gap="{$column.gap.lot}"
  219. column-count="{$column.count.lot}">
  220. </fo:region-body>
  221. <fo:region-before region-name="xsl-region-before-even"
  222. extent="{$region.before.extent}"
  223. display-align="before"/>
  224. <fo:region-after region-name="xsl-region-after-even"
  225. extent="{$region.after.extent}"
  226. display-align="after"/>
  227. </fo:simple-page-master>
  228. <!-- frontmatter pages -->
  229. <fo:simple-page-master master-name="front-first"
  230. page-width="{$page.width}"
  231. page-height="{$page.height}"
  232. margin-top="{$page.margin.top}"
  233. margin-bottom="{$page.margin.bottom}"
  234. margin-left="{$margin.left.inner}"
  235. margin-right="{$page.margin.outer}">
  236. <xsl:if test="$axf.extensions != 0">
  237. <xsl:call-template name="axf-page-master-properties">
  238. <xsl:with-param name="page.master">front-first</xsl:with-param>
  239. </xsl:call-template>
  240. </xsl:if>
  241. <fo:region-body margin-bottom="{$body.margin.bottom}"
  242. margin-top="{$body.margin.top}"
  243. column-gap="{$column.gap.front}"
  244. column-count="{$column.count.front}">
  245. </fo:region-body>
  246. <fo:region-before region-name="xsl-region-before-first"
  247. extent="{$region.before.extent}"
  248. display-align="before"/>
  249. <fo:region-after region-name="xsl-region-after-first"
  250. extent="{$region.after.extent}"
  251. display-align="after"/>
  252. </fo:simple-page-master>
  253. <fo:simple-page-master master-name="front-odd"
  254. page-width="{$page.width}"
  255. page-height="{$page.height}"
  256. margin-top="{$page.margin.top}"
  257. margin-bottom="{$page.margin.bottom}"
  258. margin-left="{$margin.left.inner}"
  259. margin-right="{$page.margin.outer}">
  260. <xsl:if test="$axf.extensions != 0">
  261. <xsl:call-template name="axf-page-master-properties">
  262. <xsl:with-param name="page.master">front-odd</xsl:with-param>
  263. </xsl:call-template>
  264. </xsl:if>
  265. <fo:region-body margin-bottom="{$body.margin.bottom}"
  266. margin-top="{$body.margin.top}"
  267. column-gap="{$column.gap.front}"
  268. column-count="{$column.count.front}">
  269. </fo:region-body>
  270. <fo:region-before region-name="xsl-region-before-odd"
  271. extent="{$region.before.extent}"
  272. display-align="before"/>
  273. <fo:region-after region-name="xsl-region-after-odd"
  274. extent="{$region.after.extent}"
  275. display-align="after"/>
  276. </fo:simple-page-master>
  277. <fo:simple-page-master master-name="front-even"
  278. page-width="{$page.width}"
  279. page-height="{$page.height}"
  280. margin-top="{$page.margin.top}"
  281. margin-bottom="{$page.margin.bottom}"
  282. margin-left="{$margin.left.outer}"
  283. margin-right="{$page.margin.inner}">
  284. <xsl:if test="$axf.extensions != 0">
  285. <xsl:call-template name="axf-page-master-properties">
  286. <xsl:with-param name="page.master">front-even</xsl:with-param>
  287. </xsl:call-template>
  288. </xsl:if>
  289. <fo:region-body margin-bottom="{$body.margin.bottom}"
  290. margin-top="{$body.margin.top}"
  291. column-gap="{$column.gap.front}"
  292. column-count="{$column.count.front}">
  293. </fo:region-body>
  294. <fo:region-before region-name="xsl-region-before-even"
  295. extent="{$region.before.extent}"
  296. display-align="before"/>
  297. <fo:region-after region-name="xsl-region-after-even"
  298. extent="{$region.after.extent}"
  299. display-align="after"/>
  300. </fo:simple-page-master>
  301. <!-- body pages -->
  302. <fo:simple-page-master master-name="body-first"
  303. page-width="{$page.width}"
  304. page-height="{$page.height}"
  305. margin-top="{$page.margin.top}"
  306. margin-bottom="{$page.margin.bottom}"
  307. margin-left="{$margin.left.inner}"
  308. margin-right="{$page.margin.outer}">
  309. <xsl:if test="$axf.extensions != 0">
  310. <xsl:call-template name="axf-page-master-properties">
  311. <xsl:with-param name="page.master">body-first</xsl:with-param>
  312. </xsl:call-template>
  313. </xsl:if>
  314. <fo:region-body margin-bottom="{$body.margin.bottom}"
  315. margin-top="{$body.margin.top}"
  316. column-gap="{$column.gap.body}"
  317. column-count="{$column.count.body}">
  318. </fo:region-body>
  319. <fo:region-before region-name="xsl-region-before-first"
  320. extent="{$region.before.extent}"
  321. display-align="before"/>
  322. <fo:region-after region-name="xsl-region-after-first"
  323. extent="{$region.after.extent}"
  324. display-align="after"/>
  325. </fo:simple-page-master>
  326. <fo:simple-page-master master-name="body-odd"
  327. page-width="{$page.width}"
  328. page-height="{$page.height}"
  329. margin-top="{$page.margin.top}"
  330. margin-bottom="{$page.margin.bottom}"
  331. margin-left="{$margin.left.inner}"
  332. margin-right="{$page.margin.outer}">
  333. <xsl:if test="$axf.extensions != 0">
  334. <xsl:call-template name="axf-page-master-properties">
  335. <xsl:with-param name="page.master">body-odd</xsl:with-param>
  336. </xsl:call-template>
  337. </xsl:if>
  338. <fo:region-body margin-bottom="{$body.margin.bottom}"
  339. margin-top="{$body.margin.top}"
  340. column-gap="{$column.gap.body}"
  341. column-count="{$column.count.body}">
  342. </fo:region-body>
  343. <fo:region-before region-name="xsl-region-before-odd"
  344. extent="{$region.before.extent}"
  345. display-align="before"/>
  346. <fo:region-after region-name="xsl-region-after-odd"
  347. extent="{$region.after.extent}"
  348. display-align="after"/>
  349. </fo:simple-page-master>
  350. <fo:simple-page-master master-name="body-even"
  351. page-width="{$page.width}"
  352. page-height="{$page.height}"
  353. margin-top="{$page.margin.top}"
  354. margin-bottom="{$page.margin.bottom}"
  355. margin-left="{$margin.left.outer}"
  356. margin-right="{$page.margin.inner}">
  357. <xsl:if test="$axf.extensions != 0">
  358. <xsl:call-template name="axf-page-master-properties">
  359. <xsl:with-param name="page.master">body-even</xsl:with-param>
  360. </xsl:call-template>
  361. </xsl:if>
  362. <fo:region-body margin-bottom="{$body.margin.bottom}"
  363. margin-top="{$body.margin.top}"
  364. column-gap="{$column.gap.body}"
  365. column-count="{$column.count.body}">
  366. </fo:region-body>
  367. <fo:region-before region-name="xsl-region-before-even"
  368. extent="{$region.before.extent}"
  369. display-align="before"/>
  370. <fo:region-after region-name="xsl-region-after-even"
  371. extent="{$region.after.extent}"
  372. display-align="after"/>
  373. </fo:simple-page-master>
  374. <!-- backmatter pages -->
  375. <fo:simple-page-master master-name="back-first"
  376. page-width="{$page.width}"
  377. page-height="{$page.height}"
  378. margin-top="{$page.margin.top}"
  379. margin-bottom="{$page.margin.bottom}"
  380. margin-left="{$margin.left.inner}"
  381. margin-right="{$page.margin.outer}">
  382. <xsl:if test="$axf.extensions != 0">
  383. <xsl:call-template name="axf-page-master-properties">
  384. <xsl:with-param name="page.master">back-first</xsl:with-param>
  385. </xsl:call-template>
  386. </xsl:if>
  387. <fo:region-body margin-bottom="{$body.margin.bottom}"
  388. margin-top="{$body.margin.top}"
  389. column-gap="{$column.gap.back}"
  390. column-count="{$column.count.back}">
  391. </fo:region-body>
  392. <fo:region-before region-name="xsl-region-before-first"
  393. extent="{$region.before.extent}"
  394. display-align="before"/>
  395. <fo:region-after region-name="xsl-region-after-first"
  396. extent="{$region.after.extent}"
  397. display-align="after"/>
  398. </fo:simple-page-master>
  399. <fo:simple-page-master master-name="back-odd"
  400. page-width="{$page.width}"
  401. page-height="{$page.height}"
  402. margin-top="{$page.margin.top}"
  403. margin-bottom="{$page.margin.bottom}"
  404. margin-left="{$margin.left.inner}"
  405. margin-right="{$page.margin.outer}">
  406. <xsl:if test="$axf.extensions != 0">
  407. <xsl:call-template name="axf-page-master-properties">
  408. <xsl:with-param name="page.master">back-odd</xsl:with-param>
  409. </xsl:call-template>
  410. </xsl:if>
  411. <fo:region-body margin-bottom="{$body.margin.bottom}"
  412. margin-top="{$body.margin.top}"
  413. column-gap="{$column.gap.back}"
  414. column-count="{$column.count.back}">
  415. </fo:region-body>
  416. <fo:region-before region-name="xsl-region-before-odd"
  417. extent="{$region.before.extent}"
  418. display-align="before"/>
  419. <fo:region-after region-name="xsl-region-after-odd"
  420. extent="{$region.after.extent}"
  421. display-align="after"/>
  422. </fo:simple-page-master>
  423. <fo:simple-page-master master-name="back-even"
  424. page-width="{$page.width}"
  425. page-height="{$page.height}"
  426. margin-top="{$page.margin.top}"
  427. margin-bottom="{$page.margin.bottom}"
  428. margin-left="{$margin.left.outer}"
  429. margin-right="{$page.margin.inner}">
  430. <xsl:if test="$axf.extensions != 0">
  431. <xsl:call-template name="axf-page-master-properties">
  432. <xsl:with-param name="page.master">back-even</xsl:with-param>
  433. </xsl:call-template>
  434. </xsl:if>
  435. <fo:region-body margin-bottom="{$body.margin.bottom}"
  436. margin-top="{$body.margin.top}"
  437. column-gap="{$column.gap.back}"
  438. column-count="{$column.count.back}">
  439. </fo:region-body>
  440. <fo:region-before region-name="xsl-region-before-even"
  441. extent="{$region.before.extent}"
  442. display-align="before"/>
  443. <fo:region-after region-name="xsl-region-after-even"
  444. extent="{$region.after.extent}"
  445. display-align="after"/>
  446. </fo:simple-page-master>
  447. <!-- index pages -->
  448. <fo:simple-page-master master-name="index-first"
  449. page-width="{$page.width}"
  450. page-height="{$page.height}"
  451. margin-top="{$page.margin.top}"
  452. margin-bottom="{$page.margin.bottom}"
  453. margin-left="{$page.margin.inner}"
  454. margin-right="{$page.margin.outer}">
  455. <xsl:if test="$axf.extensions != 0">
  456. <xsl:call-template name="axf-page-master-properties">
  457. <xsl:with-param name="page.master">index-first</xsl:with-param>
  458. </xsl:call-template>
  459. </xsl:if>
  460. <fo:region-body margin-bottom="{$body.margin.bottom}"
  461. margin-top="{$body.margin.top}"
  462. column-gap="{$column.gap.index}"
  463. column-count="{$column.count.index}">
  464. </fo:region-body>
  465. <fo:region-before region-name="xsl-region-before-first"
  466. extent="{$region.before.extent}"
  467. display-align="before"/>
  468. <fo:region-after region-name="xsl-region-after-first"
  469. extent="{$region.after.extent}"
  470. display-align="after"/>
  471. </fo:simple-page-master>
  472. <fo:simple-page-master master-name="index-odd"
  473. page-width="{$page.width}"
  474. page-height="{$page.height}"
  475. margin-top="{$page.margin.top}"
  476. margin-bottom="{$page.margin.bottom}"
  477. margin-left="{$page.margin.inner}"
  478. margin-right="{$page.margin.outer}">
  479. <xsl:if test="$axf.extensions != 0">
  480. <xsl:call-template name="axf-page-master-properties">
  481. <xsl:with-param name="page.master">index-odd</xsl:with-param>
  482. </xsl:call-template>
  483. </xsl:if>
  484. <fo:region-body margin-bottom="{$body.margin.bottom}"
  485. margin-top="{$body.margin.top}"
  486. column-gap="{$column.gap.index}"
  487. column-count="{$column.count.index}">
  488. </fo:region-body>
  489. <fo:region-before region-name="xsl-region-before-odd"
  490. extent="{$region.before.extent}"
  491. display-align="before"/>
  492. <fo:region-after region-name="xsl-region-after-odd"
  493. extent="{$region.after.extent}"
  494. display-align="after"/>
  495. </fo:simple-page-master>
  496. <fo:simple-page-master master-name="index-even"
  497. page-width="{$page.width}"
  498. page-height="{$page.height}"
  499. margin-top="{$page.margin.top}"
  500. margin-bottom="{$page.margin.bottom}"
  501. margin-left="{$page.margin.outer}"
  502. margin-right="{$page.margin.inner}">
  503. <xsl:if test="$axf.extensions != 0">
  504. <xsl:call-template name="axf-page-master-properties">
  505. <xsl:with-param name="page.master">index-even</xsl:with-param>
  506. </xsl:call-template>
  507. </xsl:if>
  508. <fo:region-body margin-bottom="{$body.margin.bottom}"
  509. margin-top="{$body.margin.top}"
  510. column-gap="{$column.gap.index}"
  511. column-count="{$column.count.index}">
  512. </fo:region-body>
  513. <fo:region-before region-name="xsl-region-before-even"
  514. extent="{$region.before.extent}"
  515. display-align="before"/>
  516. <fo:region-after region-name="xsl-region-after-even"
  517. extent="{$region.after.extent}"
  518. display-align="after"/>
  519. </fo:simple-page-master>
  520. <xsl:if test="$draft.mode != 'no'">
  521. <!-- draft blank pages -->
  522. <fo:simple-page-master master-name="blank-draft"
  523. page-width="{$page.width}"
  524. page-height="{$page.height}"
  525. margin-top="{$page.margin.top}"
  526. margin-bottom="{$page.margin.bottom}"
  527. margin-left="{$margin.left.outer}"
  528. margin-right="{$page.margin.inner}">
  529. <xsl:if test="$axf.extensions != 0">
  530. <xsl:call-template name="axf-page-master-properties">
  531. <xsl:with-param name="page.master">blank-draft</xsl:with-param>
  532. </xsl:call-template>
  533. </xsl:if>
  534. <fo:region-body margin-bottom="{$body.margin.bottom}"
  535. margin-top="{$body.margin.top}">
  536. <xsl:if test="$draft.watermark.image != ''">
  537. <xsl:attribute name="background-image">
  538. <xsl:call-template name="fo-external-image">
  539. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  540. </xsl:call-template>
  541. </xsl:attribute>
  542. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  543. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  544. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  545. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  546. </xsl:if>
  547. </fo:region-body>
  548. <fo:region-before region-name="xsl-region-before-blank"
  549. extent="{$region.before.extent}"
  550. display-align="before"/>
  551. <fo:region-after region-name="xsl-region-after-blank"
  552. extent="{$region.after.extent}"
  553. display-align="after"/>
  554. </fo:simple-page-master>
  555. <!-- draft title pages -->
  556. <fo:simple-page-master master-name="titlepage-first-draft"
  557. page-width="{$page.width}"
  558. page-height="{$page.height}"
  559. margin-top="{$page.margin.top}"
  560. margin-bottom="{$page.margin.bottom}"
  561. margin-left="{$margin.left.inner}"
  562. margin-right="{$page.margin.outer}">
  563. <xsl:if test="$axf.extensions != 0">
  564. <xsl:call-template name="axf-page-master-properties">
  565. <xsl:with-param name="page.master">titlepage-first-draft</xsl:with-param>
  566. </xsl:call-template>
  567. </xsl:if>
  568. <fo:region-body margin-bottom="{$body.margin.bottom}"
  569. margin-top="{$body.margin.top}"
  570. column-gap="{$column.gap.titlepage}"
  571. column-count="{$column.count.titlepage}">
  572. <xsl:if test="$draft.watermark.image != ''">
  573. <xsl:attribute name="background-image">
  574. <xsl:call-template name="fo-external-image">
  575. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  576. </xsl:call-template>
  577. </xsl:attribute>
  578. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  579. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  580. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  581. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  582. </xsl:if>
  583. </fo:region-body>
  584. <fo:region-before region-name="xsl-region-before-first"
  585. extent="{$region.before.extent}"
  586. display-align="before"/>
  587. <fo:region-after region-name="xsl-region-after-first"
  588. extent="{$region.after.extent}"
  589. display-align="after"/>
  590. </fo:simple-page-master>
  591. <fo:simple-page-master master-name="titlepage-odd-draft"
  592. page-width="{$page.width}"
  593. page-height="{$page.height}"
  594. margin-top="{$page.margin.top}"
  595. margin-bottom="{$page.margin.bottom}"
  596. margin-left="{$margin.left.inner}"
  597. margin-right="{$page.margin.outer}">
  598. <xsl:if test="$axf.extensions != 0">
  599. <xsl:call-template name="axf-page-master-properties">
  600. <xsl:with-param name="page.master">titlepage-odd-draft</xsl:with-param>
  601. </xsl:call-template>
  602. </xsl:if>
  603. <fo:region-body margin-bottom="{$body.margin.bottom}"
  604. margin-top="{$body.margin.top}"
  605. column-gap="{$column.gap.titlepage}"
  606. column-count="{$column.count.titlepage}">
  607. <xsl:if test="$draft.watermark.image != ''">
  608. <xsl:attribute name="background-image">
  609. <xsl:call-template name="fo-external-image">
  610. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  611. </xsl:call-template>
  612. </xsl:attribute>
  613. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  614. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  615. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  616. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  617. </xsl:if>
  618. </fo:region-body>
  619. <fo:region-before region-name="xsl-region-before-odd"
  620. extent="{$region.before.extent}"
  621. display-align="before"/>
  622. <fo:region-after region-name="xsl-region-after-odd"
  623. extent="{$region.after.extent}"
  624. display-align="after"/>
  625. </fo:simple-page-master>
  626. <fo:simple-page-master master-name="titlepage-even-draft"
  627. page-width="{$page.width}"
  628. page-height="{$page.height}"
  629. margin-top="{$page.margin.top}"
  630. margin-bottom="{$page.margin.bottom}"
  631. margin-left="{$margin.left.outer}"
  632. margin-right="{$page.margin.inner}">
  633. <xsl:if test="$axf.extensions != 0">
  634. <xsl:call-template name="axf-page-master-properties">
  635. <xsl:with-param name="page.master">titlepage-even-draft</xsl:with-param>
  636. </xsl:call-template>
  637. </xsl:if>
  638. <fo:region-body margin-bottom="{$body.margin.bottom}"
  639. margin-top="{$body.margin.top}"
  640. column-gap="{$column.gap.titlepage}"
  641. column-count="{$column.count.titlepage}">
  642. <xsl:if test="$draft.watermark.image != ''">
  643. <xsl:attribute name="background-image">
  644. <xsl:call-template name="fo-external-image">
  645. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  646. </xsl:call-template>
  647. </xsl:attribute>
  648. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  649. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  650. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  651. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  652. </xsl:if>
  653. </fo:region-body>
  654. <fo:region-before region-name="xsl-region-before-even"
  655. extent="{$region.before.extent}"
  656. display-align="before"/>
  657. <fo:region-after region-name="xsl-region-after-even"
  658. extent="{$region.after.extent}"
  659. display-align="after"/>
  660. </fo:simple-page-master>
  661. <!-- draft list-of-title pages -->
  662. <fo:simple-page-master master-name="lot-first-draft"
  663. page-width="{$page.width}"
  664. page-height="{$page.height}"
  665. margin-top="{$page.margin.top}"
  666. margin-bottom="{$page.margin.bottom}"
  667. margin-left="{$margin.left.inner}"
  668. margin-right="{$page.margin.outer}">
  669. <xsl:if test="$axf.extensions != 0">
  670. <xsl:call-template name="axf-page-master-properties">
  671. <xsl:with-param name="page.master">lot-first-draft</xsl:with-param>
  672. </xsl:call-template>
  673. </xsl:if>
  674. <fo:region-body margin-bottom="{$body.margin.bottom}"
  675. margin-top="{$body.margin.top}"
  676. column-gap="{$column.gap.lot}"
  677. column-count="{$column.count.lot}">
  678. <xsl:if test="$draft.watermark.image != ''">
  679. <xsl:attribute name="background-image">
  680. <xsl:call-template name="fo-external-image">
  681. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  682. </xsl:call-template>
  683. </xsl:attribute>
  684. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  685. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  686. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  687. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  688. </xsl:if>
  689. </fo:region-body>
  690. <fo:region-before region-name="xsl-region-before-first"
  691. extent="{$region.before.extent}"
  692. display-align="before"/>
  693. <fo:region-after region-name="xsl-region-after-first"
  694. extent="{$region.after.extent}"
  695. display-align="after"/>
  696. </fo:simple-page-master>
  697. <fo:simple-page-master master-name="lot-odd-draft"
  698. page-width="{$page.width}"
  699. page-height="{$page.height}"
  700. margin-top="{$page.margin.top}"
  701. margin-bottom="{$page.margin.bottom}"
  702. margin-left="{$margin.left.inner}"
  703. margin-right="{$page.margin.outer}">
  704. <xsl:if test="$axf.extensions != 0">
  705. <xsl:call-template name="axf-page-master-properties">
  706. <xsl:with-param name="page.master">lot-odd-draft</xsl:with-param>
  707. </xsl:call-template>
  708. </xsl:if>
  709. <fo:region-body margin-bottom="{$body.margin.bottom}"
  710. margin-top="{$body.margin.top}"
  711. column-gap="{$column.gap.lot}"
  712. column-count="{$column.count.lot}">
  713. <xsl:if test="$draft.watermark.image != ''">
  714. <xsl:attribute name="background-image">
  715. <xsl:call-template name="fo-external-image">
  716. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  717. </xsl:call-template>
  718. </xsl:attribute>
  719. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  720. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  721. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  722. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  723. </xsl:if>
  724. </fo:region-body>
  725. <fo:region-before region-name="xsl-region-before-odd"
  726. extent="{$region.before.extent}"
  727. display-align="before"/>
  728. <fo:region-after region-name="xsl-region-after-odd"
  729. extent="{$region.after.extent}"
  730. display-align="after"/>
  731. </fo:simple-page-master>
  732. <fo:simple-page-master master-name="lot-even-draft"
  733. page-width="{$page.width}"
  734. page-height="{$page.height}"
  735. margin-top="{$page.margin.top}"
  736. margin-bottom="{$page.margin.bottom}"
  737. margin-left="{$margin.left.outer}"
  738. margin-right="{$page.margin.inner}">
  739. <xsl:if test="$axf.extensions != 0">
  740. <xsl:call-template name="axf-page-master-properties">
  741. <xsl:with-param name="page.master">lot-even-draft</xsl:with-param>
  742. </xsl:call-template>
  743. </xsl:if>
  744. <fo:region-body margin-bottom="{$body.margin.bottom}"
  745. margin-top="{$body.margin.top}"
  746. column-gap="{$column.gap.lot}"
  747. column-count="{$column.count.lot}">
  748. <xsl:if test="$draft.watermark.image != ''">
  749. <xsl:attribute name="background-image">
  750. <xsl:call-template name="fo-external-image">
  751. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  752. </xsl:call-template>
  753. </xsl:attribute>
  754. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  755. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  756. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  757. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  758. </xsl:if>
  759. </fo:region-body>
  760. <fo:region-before region-name="xsl-region-before-even"
  761. extent="{$region.before.extent}"
  762. display-align="before"/>
  763. <fo:region-after region-name="xsl-region-after-even"
  764. extent="{$region.after.extent}"
  765. display-align="after"/>
  766. </fo:simple-page-master>
  767. <!-- draft frontmatter pages -->
  768. <fo:simple-page-master master-name="front-first-draft"
  769. page-width="{$page.width}"
  770. page-height="{$page.height}"
  771. margin-top="{$page.margin.top}"
  772. margin-bottom="{$page.margin.bottom}"
  773. margin-left="{$margin.left.inner}"
  774. margin-right="{$page.margin.outer}">
  775. <xsl:if test="$axf.extensions != 0">
  776. <xsl:call-template name="axf-page-master-properties">
  777. <xsl:with-param name="page.master">front-first-draft</xsl:with-param>
  778. </xsl:call-template>
  779. </xsl:if>
  780. <fo:region-body margin-bottom="{$body.margin.bottom}"
  781. margin-top="{$body.margin.top}"
  782. column-gap="{$column.gap.front}"
  783. column-count="{$column.count.front}">
  784. <xsl:if test="$draft.watermark.image != ''">
  785. <xsl:attribute name="background-image">
  786. <xsl:call-template name="fo-external-image">
  787. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  788. </xsl:call-template>
  789. </xsl:attribute>
  790. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  791. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  792. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  793. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  794. </xsl:if>
  795. </fo:region-body>
  796. <fo:region-before region-name="xsl-region-before-first"
  797. extent="{$region.before.extent}"
  798. display-align="before"/>
  799. <fo:region-after region-name="xsl-region-after-first"
  800. extent="{$region.after.extent}"
  801. display-align="after"/>
  802. </fo:simple-page-master>
  803. <fo:simple-page-master master-name="front-odd-draft"
  804. page-width="{$page.width}"
  805. page-height="{$page.height}"
  806. margin-top="{$page.margin.top}"
  807. margin-bottom="{$page.margin.bottom}"
  808. margin-left="{$margin.left.inner}"
  809. margin-right="{$page.margin.outer}">
  810. <xsl:if test="$axf.extensions != 0">
  811. <xsl:call-template name="axf-page-master-properties">
  812. <xsl:with-param name="page.master">front-odd-draft</xsl:with-param>
  813. </xsl:call-template>
  814. </xsl:if>
  815. <fo:region-body margin-bottom="{$body.margin.bottom}"
  816. margin-top="{$body.margin.top}"
  817. column-gap="{$column.gap.front}"
  818. column-count="{$column.count.front}">
  819. <xsl:if test="$draft.watermark.image != ''">
  820. <xsl:attribute name="background-image">
  821. <xsl:call-template name="fo-external-image">
  822. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  823. </xsl:call-template>
  824. </xsl:attribute>
  825. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  826. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  827. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  828. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  829. </xsl:if>
  830. </fo:region-body>
  831. <fo:region-before region-name="xsl-region-before-odd"
  832. extent="{$region.before.extent}"
  833. display-align="before"/>
  834. <fo:region-after region-name="xsl-region-after-odd"
  835. extent="{$region.after.extent}"
  836. display-align="after"/>
  837. </fo:simple-page-master>
  838. <fo:simple-page-master master-name="front-even-draft"
  839. page-width="{$page.width}"
  840. page-height="{$page.height}"
  841. margin-top="{$page.margin.top}"
  842. margin-bottom="{$page.margin.bottom}"
  843. margin-left="{$margin.left.outer}"
  844. margin-right="{$page.margin.inner}">
  845. <xsl:if test="$axf.extensions != 0">
  846. <xsl:call-template name="axf-page-master-properties">
  847. <xsl:with-param name="page.master">front-even-draft</xsl:with-param>
  848. </xsl:call-template>
  849. </xsl:if>
  850. <fo:region-body margin-bottom="{$body.margin.bottom}"
  851. margin-top="{$body.margin.top}"
  852. column-gap="{$column.gap.front}"
  853. column-count="{$column.count.front}">
  854. <xsl:if test="$draft.watermark.image != ''">
  855. <xsl:attribute name="background-image">
  856. <xsl:call-template name="fo-external-image">
  857. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  858. </xsl:call-template>
  859. </xsl:attribute>
  860. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  861. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  862. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  863. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  864. </xsl:if>
  865. </fo:region-body>
  866. <fo:region-before region-name="xsl-region-before-even"
  867. extent="{$region.before.extent}"
  868. display-align="before"/>
  869. <fo:region-after region-name="xsl-region-after-even"
  870. extent="{$region.after.extent}"
  871. display-align="after"/>
  872. </fo:simple-page-master>
  873. <!-- draft body pages -->
  874. <fo:simple-page-master master-name="body-first-draft"
  875. page-width="{$page.width}"
  876. page-height="{$page.height}"
  877. margin-top="{$page.margin.top}"
  878. margin-bottom="{$page.margin.bottom}"
  879. margin-left="{$margin.left.inner}"
  880. margin-right="{$page.margin.outer}">
  881. <xsl:if test="$axf.extensions != 0">
  882. <xsl:call-template name="axf-page-master-properties">
  883. <xsl:with-param name="page.master">body-first-draft</xsl:with-param>
  884. </xsl:call-template>
  885. </xsl:if>
  886. <fo:region-body margin-bottom="{$body.margin.bottom}"
  887. margin-top="{$body.margin.top}"
  888. column-gap="{$column.gap.body}"
  889. column-count="{$column.count.body}">
  890. <xsl:if test="$draft.watermark.image != ''">
  891. <xsl:attribute name="background-image">
  892. <xsl:call-template name="fo-external-image">
  893. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  894. </xsl:call-template>
  895. </xsl:attribute>
  896. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  897. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  898. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  899. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  900. </xsl:if>
  901. </fo:region-body>
  902. <fo:region-before region-name="xsl-region-before-first"
  903. extent="{$region.before.extent}"
  904. display-align="before"/>
  905. <fo:region-after region-name="xsl-region-after-first"
  906. extent="{$region.after.extent}"
  907. display-align="after"/>
  908. </fo:simple-page-master>
  909. <fo:simple-page-master master-name="body-odd-draft"
  910. page-width="{$page.width}"
  911. page-height="{$page.height}"
  912. margin-top="{$page.margin.top}"
  913. margin-bottom="{$page.margin.bottom}"
  914. margin-left="{$margin.left.inner}"
  915. margin-right="{$page.margin.outer}">
  916. <xsl:if test="$axf.extensions != 0">
  917. <xsl:call-template name="axf-page-master-properties">
  918. <xsl:with-param name="page.master">body-odd-draft</xsl:with-param>
  919. </xsl:call-template>
  920. </xsl:if>
  921. <fo:region-body margin-bottom="{$body.margin.bottom}"
  922. margin-top="{$body.margin.top}"
  923. column-gap="{$column.gap.body}"
  924. column-count="{$column.count.body}">
  925. <xsl:if test="$draft.watermark.image != ''">
  926. <xsl:attribute name="background-image">
  927. <xsl:call-template name="fo-external-image">
  928. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  929. </xsl:call-template>
  930. </xsl:attribute>
  931. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  932. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  933. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  934. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  935. </xsl:if>
  936. </fo:region-body>
  937. <fo:region-before region-name="xsl-region-before-odd"
  938. extent="{$region.before.extent}"
  939. display-align="before"/>
  940. <fo:region-after region-name="xsl-region-after-odd"
  941. extent="{$region.after.extent}"
  942. display-align="after"/>
  943. </fo:simple-page-master>
  944. <fo:simple-page-master master-name="body-even-draft"
  945. page-width="{$page.width}"
  946. page-height="{$page.height}"
  947. margin-top="{$page.margin.top}"
  948. margin-bottom="{$page.margin.bottom}"
  949. margin-left="{$margin.left.outer}"
  950. margin-right="{$page.margin.inner}">
  951. <xsl:if test="$axf.extensions != 0">
  952. <xsl:call-template name="axf-page-master-properties">
  953. <xsl:with-param name="page.master">body-even-draft</xsl:with-param>
  954. </xsl:call-template>
  955. </xsl:if>
  956. <fo:region-body margin-bottom="{$body.margin.bottom}"
  957. margin-top="{$body.margin.top}"
  958. column-gap="{$column.gap.body}"
  959. column-count="{$column.count.body}">
  960. <xsl:if test="$draft.watermark.image != ''">
  961. <xsl:attribute name="background-image">
  962. <xsl:call-template name="fo-external-image">
  963. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  964. </xsl:call-template>
  965. </xsl:attribute>
  966. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  967. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  968. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  969. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  970. </xsl:if>
  971. </fo:region-body>
  972. <fo:region-before region-name="xsl-region-before-even"
  973. extent="{$region.before.extent}"
  974. display-align="before"/>
  975. <fo:region-after region-name="xsl-region-after-even"
  976. extent="{$region.after.extent}"
  977. display-align="after"/>
  978. </fo:simple-page-master>
  979. <!-- draft backmatter pages -->
  980. <fo:simple-page-master master-name="back-first-draft"
  981. page-width="{$page.width}"
  982. page-height="{$page.height}"
  983. margin-top="{$page.margin.top}"
  984. margin-bottom="{$page.margin.bottom}"
  985. margin-left="{$margin.left.inner}"
  986. margin-right="{$page.margin.outer}">
  987. <xsl:if test="$axf.extensions != 0">
  988. <xsl:call-template name="axf-page-master-properties">
  989. <xsl:with-param name="page.master">back-first-draft</xsl:with-param>
  990. </xsl:call-template>
  991. </xsl:if>
  992. <fo:region-body margin-bottom="{$body.margin.bottom}"
  993. margin-top="{$body.margin.top}"
  994. column-gap="{$column.gap.back}"
  995. column-count="{$column.count.back}">
  996. <xsl:if test="$draft.watermark.image != ''">
  997. <xsl:attribute name="background-image">
  998. <xsl:call-template name="fo-external-image">
  999. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1000. </xsl:call-template>
  1001. </xsl:attribute>
  1002. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1003. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1004. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1005. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1006. </xsl:if>
  1007. </fo:region-body>
  1008. <fo:region-before region-name="xsl-region-before-first"
  1009. extent="{$region.before.extent}"
  1010. display-align="before"/>
  1011. <fo:region-after region-name="xsl-region-after-first"
  1012. extent="{$region.after.extent}"
  1013. display-align="after"/>
  1014. </fo:simple-page-master>
  1015. <fo:simple-page-master master-name="back-odd-draft"
  1016. page-width="{$page.width}"
  1017. page-height="{$page.height}"
  1018. margin-top="{$page.margin.top}"
  1019. margin-bottom="{$page.margin.bottom}"
  1020. margin-left="{$margin.left.inner}"
  1021. margin-right="{$page.margin.outer}">
  1022. <xsl:if test="$axf.extensions != 0">
  1023. <xsl:call-template name="axf-page-master-properties">
  1024. <xsl:with-param name="page.master">back-odd-draft</xsl:with-param>
  1025. </xsl:call-template>
  1026. </xsl:if>
  1027. <fo:region-body margin-bottom="{$body.margin.bottom}"
  1028. margin-top="{$body.margin.top}"
  1029. column-gap="{$column.gap.back}"
  1030. column-count="{$column.count.back}">
  1031. <xsl:if test="$draft.watermark.image != ''">
  1032. <xsl:attribute name="background-image">
  1033. <xsl:call-template name="fo-external-image">
  1034. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1035. </xsl:call-template>
  1036. </xsl:attribute>
  1037. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1038. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1039. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1040. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1041. </xsl:if>
  1042. </fo:region-body>
  1043. <fo:region-before region-name="xsl-region-before-odd"
  1044. extent="{$region.before.extent}"
  1045. display-align="before"/>
  1046. <fo:region-after region-name="xsl-region-after-odd"
  1047. extent="{$region.after.extent}"
  1048. display-align="after"/>
  1049. </fo:simple-page-master>
  1050. <fo:simple-page-master master-name="back-even-draft"
  1051. page-width="{$page.width}"
  1052. page-height="{$page.height}"
  1053. margin-top="{$page.margin.top}"
  1054. margin-bottom="{$page.margin.bottom}"
  1055. margin-left="{$margin.left.outer}"
  1056. margin-right="{$page.margin.inner}">
  1057. <xsl:if test="$axf.extensions != 0">
  1058. <xsl:call-template name="axf-page-master-properties">
  1059. <xsl:with-param name="page.master">back-even-draft</xsl:with-param>
  1060. </xsl:call-template>
  1061. </xsl:if>
  1062. <fo:region-body margin-bottom="{$body.margin.bottom}"
  1063. margin-top="{$body.margin.top}"
  1064. column-gap="{$column.gap.back}"
  1065. column-count="{$column.count.back}">
  1066. <xsl:if test="$draft.watermark.image != ''">
  1067. <xsl:attribute name="background-image">
  1068. <xsl:call-template name="fo-external-image">
  1069. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1070. </xsl:call-template>
  1071. </xsl:attribute>
  1072. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1073. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1074. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1075. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1076. </xsl:if>
  1077. </fo:region-body>
  1078. <fo:region-before region-name="xsl-region-before-even"
  1079. extent="{$region.before.extent}"
  1080. display-align="before"/>
  1081. <fo:region-after region-name="xsl-region-after-even"
  1082. extent="{$region.after.extent}"
  1083. display-align="after"/>
  1084. </fo:simple-page-master>
  1085. <!-- draft index pages -->
  1086. <fo:simple-page-master master-name="index-first-draft"
  1087. page-width="{$page.width}"
  1088. page-height="{$page.height}"
  1089. margin-top="{$page.margin.top}"
  1090. margin-bottom="{$page.margin.bottom}"
  1091. margin-left="{$page.margin.inner}"
  1092. margin-right="{$page.margin.outer}">
  1093. <xsl:if test="$axf.extensions != 0">
  1094. <xsl:call-template name="axf-page-master-properties">
  1095. <xsl:with-param name="page.master">index-first-draft</xsl:with-param>
  1096. </xsl:call-template>
  1097. </xsl:if>
  1098. <fo:region-body margin-bottom="{$body.margin.bottom}"
  1099. margin-top="{$body.margin.top}"
  1100. column-gap="{$column.gap.index}"
  1101. column-count="{$column.count.index}">
  1102. <xsl:if test="$draft.watermark.image != ''">
  1103. <xsl:attribute name="background-image">
  1104. <xsl:call-template name="fo-external-image">
  1105. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1106. </xsl:call-template>
  1107. </xsl:attribute>
  1108. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1109. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1110. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1111. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1112. </xsl:if>
  1113. </fo:region-body>
  1114. <fo:region-before region-name="xsl-region-before-first"
  1115. extent="{$region.before.extent}"
  1116. display-align="before"/>
  1117. <fo:region-after region-name="xsl-region-after-first"
  1118. extent="{$region.after.extent}"
  1119. display-align="after"/>
  1120. </fo:simple-page-master>
  1121. <fo:simple-page-master master-name="index-odd-draft"
  1122. page-width="{$page.width}"
  1123. page-height="{$page.height}"
  1124. margin-top="{$page.margin.top}"
  1125. margin-bottom="{$page.margin.bottom}"
  1126. margin-left="{$page.margin.inner}"
  1127. margin-right="{$page.margin.outer}">
  1128. <xsl:if test="$axf.extensions != 0">
  1129. <xsl:call-template name="axf-page-master-properties">
  1130. <xsl:with-param name="page.master">index-odd-draft</xsl:with-param>
  1131. </xsl:call-template>
  1132. </xsl:if>
  1133. <fo:region-body margin-bottom="{$body.margin.bottom}"
  1134. margin-top="{$body.margin.top}"
  1135. column-gap="{$column.gap.index}"
  1136. column-count="{$column.count.index}">
  1137. <xsl:if test="$draft.watermark.image != ''">
  1138. <xsl:attribute name="background-image">
  1139. <xsl:call-template name="fo-external-image">
  1140. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1141. </xsl:call-template>
  1142. </xsl:attribute>
  1143. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1144. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1145. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1146. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1147. </xsl:if>
  1148. </fo:region-body>
  1149. <fo:region-before region-name="xsl-region-before-odd"
  1150. extent="{$region.before.extent}"
  1151. display-align="before"/>
  1152. <fo:region-after region-name="xsl-region-after-odd"
  1153. extent="{$region.after.extent}"
  1154. display-align="after"/>
  1155. </fo:simple-page-master>
  1156. <fo:simple-page-master master-name="index-even-draft"
  1157. page-width="{$page.width}"
  1158. page-height="{$page.height}"
  1159. margin-top="{$page.margin.top}"
  1160. margin-bottom="{$page.margin.bottom}"
  1161. margin-right="{$page.margin.inner}"
  1162. margin-left="{$page.margin.outer}">
  1163. <xsl:if test="$axf.extensions != 0">
  1164. <xsl:call-template name="axf-page-master-properties">
  1165. <xsl:with-param name="page.master">index-even-draft</xsl:with-param>
  1166. </xsl:call-template>
  1167. </xsl:if>
  1168. <fo:region-body margin-bottom="{$body.margin.bottom}"
  1169. margin-top="{$body.margin.top}"
  1170. column-gap="{$column.gap.index}"
  1171. column-count="{$column.count.index}">
  1172. <xsl:if test="$draft.watermark.image != ''">
  1173. <xsl:attribute name="background-image">
  1174. <xsl:call-template name="fo-external-image">
  1175. <xsl:with-param name="filename" select="$draft.watermark.image"/>
  1176. </xsl:call-template>
  1177. </xsl:attribute>
  1178. <xsl:attribute name="background-attachment">fixed</xsl:attribute>
  1179. <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  1180. <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
  1181. <xsl:attribute name="background-position-vertical">center</xsl:attribute>
  1182. </xsl:if>
  1183. </fo:region-body>
  1184. <fo:region-before region-name="xsl-region-before-even"
  1185. extent="{$region.before.extent}"
  1186. display-align="before"/>
  1187. <fo:region-after region-name="xsl-region-after-even"
  1188. extent="{$region.after.extent}"
  1189. display-align="after"/>
  1190. </fo:simple-page-master>
  1191. </xsl:if>
  1192. <!-- setup for title page(s) -->
  1193. <fo:page-sequence-master master-name="titlepage">
  1194. <fo:repeatable-page-master-alternatives>
  1195. <fo:conditional-page-master-reference master-reference="blank"
  1196. blank-or-not-blank="blank"/>
  1197. <fo:conditional-page-master-reference master-reference="titlepage-first"
  1198. page-position="first"/>
  1199. <fo:conditional-page-master-reference master-reference="titlepage-odd"
  1200. odd-or-even="odd"/>
  1201. <fo:conditional-page-master-reference
  1202. odd-or-even="even">
  1203. <xsl:attribute name="master-reference">
  1204. <xsl:choose>
  1205. <xsl:when test="$double.sided != 0">titlepage-even</xsl:when>
  1206. <xsl:otherwise>titlepage-odd</xsl:otherwise>
  1207. </xsl:choose>
  1208. </xsl:attribute>
  1209. </fo:conditional-page-master-reference>
  1210. </fo:repeatable-page-master-alternatives>
  1211. </fo:page-sequence-master>
  1212. <!-- setup for lots -->
  1213. <fo:page-sequence-master master-name="lot">
  1214. <fo:repeatable-page-master-alternatives>
  1215. <fo:conditional-page-master-reference master-reference="blank"
  1216. blank-or-not-blank="blank"/>
  1217. <fo:conditional-page-master-reference master-reference="lot-first"
  1218. page-position="first"/>
  1219. <fo:conditional-page-master-reference master-reference="lot-odd"
  1220. odd-or-even="odd"/>
  1221. <fo:conditional-page-master-reference
  1222. odd-or-even="even">
  1223. <xsl:attribute name="master-reference">
  1224. <xsl:choose>
  1225. <xsl:when test="$double.sided != 0">lot-even</xsl:when>
  1226. <xsl:otherwise>lot-odd</xsl:otherwise>
  1227. </xsl:choose>
  1228. </xsl:attribute>
  1229. </fo:conditional-page-master-reference>
  1230. </fo:repeatable-page-master-alternatives>
  1231. </fo:page-sequence-master>
  1232. <!-- setup front matter -->
  1233. <fo:page-sequence-master master-name="front">
  1234. <fo:repeatable-page-master-alternatives>
  1235. <fo:conditional-page-master-reference master-reference="blank"
  1236. blank-or-not-blank="blank"/>
  1237. <fo:conditional-page-master-reference master-reference="front-first"
  1238. page-position="first"/>
  1239. <fo:conditional-page-master-reference master-reference="front-odd"
  1240. odd-or-even="odd"/>
  1241. <fo:conditional-page-master-reference
  1242. odd-or-even="even">
  1243. <xsl:attribute name="master-reference">
  1244. <xsl:choose>
  1245. <xsl:when test="$double.sided != 0">front-even</xsl:when>
  1246. <xsl:otherwise>front-odd</xsl:otherwise>
  1247. </xsl:choose>
  1248. </xsl:attribute>
  1249. </fo:conditional-page-master-reference>
  1250. </fo:repeatable-page-master-alternatives>
  1251. </fo:page-sequence-master>
  1252. <!-- setup for body pages -->
  1253. <fo:page-sequence-master master-name="body">
  1254. <fo:repeatable-page-master-alternatives>
  1255. <fo:conditional-page-master-reference master-reference="blank"
  1256. blank-or-not-blank="blank"/>
  1257. <fo:conditional-page-master-reference master-reference="body-first"
  1258. page-position="first"/>
  1259. <fo:conditional-page-master-reference master-reference="body-odd"
  1260. odd-or-even="odd"/>
  1261. <fo:conditional-page-master-reference
  1262. odd-or-even="even">
  1263. <xsl:attribute name="master-reference">
  1264. <xsl:choose>
  1265. <xsl:when test="$double.sided != 0">body-even</xsl:when>
  1266. <xsl:otherwise>body-odd</xsl:otherwise>
  1267. </xsl:choose>
  1268. </xsl:attribute>
  1269. </fo:conditional-page-master-reference>
  1270. </fo:repeatable-page-master-alternatives>
  1271. </fo:page-sequence-master>
  1272. <!-- setup back matter -->
  1273. <fo:page-sequence-master master-name="back">
  1274. <fo:repeatable-page-master-alternatives>
  1275. <fo:conditional-page-master-reference master-reference="blank"
  1276. blank-or-not-blank="blank"/>
  1277. <fo:conditional-page-master-reference master-reference="back-first"
  1278. page-position="first"/>
  1279. <fo:conditional-page-master-reference master-reference="back-odd"
  1280. odd-or-even="odd"/>
  1281. <fo:conditional-page-master-reference
  1282. odd-or-even="even">
  1283. <xsl:attribute name="master-reference">
  1284. <xsl:choose>
  1285. <xsl:when test="$double.sided != 0">back-even</xsl:when>
  1286. <xsl:otherwise>back-odd</xsl:otherwise>
  1287. </xsl:choose>
  1288. </xsl:attribute>
  1289. </fo:conditional-page-master-reference>
  1290. </fo:repeatable-page-master-alternatives>
  1291. </fo:page-sequence-master>
  1292. <!-- setup back matter -->
  1293. <fo:page-sequence-master master-name="index">
  1294. <fo:repeatable-page-master-alternatives>
  1295. <fo:conditional-page-master-reference master-reference="blank"
  1296. blank-or-not-blank="blank"/>
  1297. <fo:conditional-page-master-reference master-reference="index-first"
  1298. page-position="first"/>
  1299. <fo:conditional-page-master-reference master-reference="index-odd"
  1300. odd-or-even="odd"/>
  1301. <fo:conditional-page-master-reference
  1302. odd-or-even="even">
  1303. <xsl:attribute name="master-reference">
  1304. <xsl:choose>
  1305. <xsl:when test="$double.sided != 0">index-even</xsl:when>
  1306. <xsl:otherwise>index-odd</xsl:otherwise>
  1307. </xsl:choose>
  1308. </xsl:attribute>
  1309. </fo:conditional-page-master-reference>
  1310. </fo:repeatable-page-master-alternatives>
  1311. </fo:page-sequence-master>
  1312. <xsl:if test="$draft.mode != 'no'">
  1313. <!-- setup for draft title page(s) -->
  1314. <fo:page-sequence-master master-name="titlepage-draft">
  1315. <fo:repeatable-page-master-alternatives>
  1316. <fo:conditional-page-master-reference master-reference="blank-draft"
  1317. blank-or-not-blank="blank"/>
  1318. <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
  1319. page-position="first"/>
  1320. <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
  1321. odd-or-even="odd"/>
  1322. <fo:conditional-page-master-reference
  1323. odd-or-even="even">
  1324. <xsl:attribute name="master-reference">
  1325. <xsl:choose>
  1326. <xsl:when test="$double.sided != 0">titlepage-even-draft</xsl:when>
  1327. <xsl:otherwise>titlepage-odd-draft</xsl:otherwise>
  1328. </xsl:choose>
  1329. </xsl:attribute>
  1330. </fo:conditional-page-master-reference>
  1331. </fo:repeatable-page-master-alternatives>
  1332. </fo:page-sequence-master>
  1333. <!-- setup for draft lots -->
  1334. <fo:page-sequence-master master-name="lot-draft">
  1335. <fo:repeatable-page-master-alternatives>
  1336. <fo:conditional-page-master-reference master-reference="blank-draft"
  1337. blank-or-not-blank="blank"/>
  1338. <fo:conditional-page-master-reference master-reference="lot-first-draft"
  1339. page-position="first"/>
  1340. <fo:conditional-page-master-reference master-reference="lot-odd-draft"
  1341. odd-or-even="odd"/>
  1342. <fo:conditional-page-master-reference
  1343. odd-or-even="even">
  1344. <xsl:attribute name="master-reference">
  1345. <xsl:choose>
  1346. <xsl:when test="$double.sided != 0">lot-even-draft</xsl:when>
  1347. <xsl:otherwise>lot-odd-draft</xsl:otherwise>
  1348. </xsl:choose>
  1349. </xsl:attribute>
  1350. </fo:conditional-page-master-reference>
  1351. </fo:repeatable-page-master-alternatives>
  1352. </fo:page-sequence-master>
  1353. <!-- setup draft front matter -->
  1354. <fo:page-sequence-master master-name="front-draft">
  1355. <fo:repeatable-page-master-alternatives>
  1356. <fo:conditional-page-master-reference master-reference="blank-draft"
  1357. blank-or-not-blank="blank"/>
  1358. <fo:conditional-page-master-reference master-reference="front-first-draft"
  1359. page-position="first"/>
  1360. <fo:conditional-page-master-reference master-reference="front-odd-draft"
  1361. odd-or-even="odd"/>
  1362. <fo:conditional-page-master-reference
  1363. odd-or-even="even">
  1364. <xsl:attribute name="master-reference">
  1365. <xsl:choose>
  1366. <xsl:when test="$double.sided != 0">front-even-draft</xsl:when>
  1367. <xsl:otherwise>front-odd-draft</xsl:otherwise>
  1368. </xsl:choose>
  1369. </xsl:attribute>
  1370. </fo:conditional-page-master-reference>
  1371. </fo:repeatable-page-master-alternatives>
  1372. </fo:page-sequence-master>
  1373. <!-- setup for draft body pages -->
  1374. <fo:page-sequence-master master-name="body-draft">
  1375. <fo:repeatable-page-master-alternatives>
  1376. <fo:conditional-page-master-reference master-reference="blank-draft"
  1377. blank-or-not-blank="blank"/>
  1378. <fo:conditional-page-master-reference master-reference="body-first-draft"
  1379. page-position="first"/>
  1380. <fo:conditional-page-master-reference master-reference="body-odd-draft"
  1381. odd-or-even="odd"/>
  1382. <fo:conditional-page-master-reference
  1383. odd-or-even="even">
  1384. <xsl:attribute name="master-reference">
  1385. <xsl:choose>
  1386. <xsl:when test="$double.sided != 0">body-even-draft</xsl:when>
  1387. <xsl:otherwise>body-odd-draft</xsl:otherwise>
  1388. </xsl:choose>
  1389. </xsl:attribute>
  1390. </fo:conditional-page-master-reference>
  1391. </fo:repeatable-page-master-alternatives>
  1392. </fo:page-sequence-master>
  1393. <!-- setup draft back matter -->
  1394. <fo:page-sequence-master master-name="back-draft">
  1395. <fo:repeatable-page-master-alternatives>
  1396. <fo:conditional-page-master-reference master-reference="blank-draft"
  1397. blank-or-not-blank="blank"/>
  1398. <fo:conditional-page-master-reference master-reference="back-first-draft"
  1399. page-position="first"/>
  1400. <fo:conditional-page-master-reference master-reference="back-odd-draft"
  1401. odd-or-even="odd"/>
  1402. <fo:conditional-page-master-reference
  1403. odd-or-even="even">
  1404. <xsl:attribute name="master-reference">
  1405. <xsl:choose>
  1406. <xsl:when test="$double.sided != 0">back-even-draft</xsl:when>
  1407. <xsl:otherwise>back-odd-draft</xsl:otherwise>
  1408. </xsl:choose>
  1409. </xsl:attribute>
  1410. </fo:conditional-page-master-reference>
  1411. </fo:repeatable-page-master-alternatives>
  1412. </fo:page-sequence-master>
  1413. <!-- setup draft index pages -->
  1414. <fo:page-sequence-master master-name="index-draft">
  1415. <fo:repeatable-page-master-alternatives>
  1416. <fo:conditional-page-master-reference master-reference="blank-draft"
  1417. blank-or-not-blank="blank"/>
  1418. <fo:conditional-page-master-reference master-reference="index-first-draft"
  1419. page-position="first"/>
  1420. <fo:conditional-page-master-reference master-reference="index-odd-draft"
  1421. odd-or-even="odd"/>
  1422. <fo:conditional-page-master-reference
  1423. odd-or-even="even">
  1424. <xsl:attribute name="master-reference">
  1425. <xsl:choose>
  1426. <xsl:when test="$double.sided != 0">index-even-draft</xsl:when>
  1427. <xsl:otherwise>index-odd-draft</xsl:otherwise>
  1428. </xsl:choose>
  1429. </xsl:attribute>
  1430. </fo:conditional-page-master-reference>
  1431. </fo:repeatable-page-master-alternatives>
  1432. </fo:page-sequence-master>
  1433. </xsl:if>
  1434. <xsl:call-template name="user.pagemasters"/>
  1435. </fo:layout-master-set>
  1436. </xsl:template>
  1437. <!-- ==================================================================== -->
  1438. <xsl:template name="user.pagemasters"/> <!-- intentionally empty -->
  1439. <!-- ==================================================================== -->
  1440. <xsl:template name="select.pagemaster">
  1441. <xsl:param name="element" select="local-name(.)"/>
  1442. <xsl:param name="pageclass" select="''"/>
  1443. <xsl:variable name="pagemaster">
  1444. <xsl:choose>
  1445. <xsl:when test="$pageclass != ''">
  1446. <xsl:value-of select="$pageclass"/>
  1447. </xsl:when>
  1448. <xsl:when test="$pageclass = 'lot'">lot</xsl:when>
  1449. <xsl:when test="$element = 'dedication'">front</xsl:when>
  1450. <xsl:when test="$element = 'preface'">front</xsl:when>
  1451. <xsl:when test="$element = 'appendix'">back</xsl:when>
  1452. <xsl:when test="$element = 'glossary'">back</xsl:when>
  1453. <xsl:when test="$element = 'bibliography'">back</xsl:when>
  1454. <xsl:when test="$element = 'index'">index</xsl:when>
  1455. <xsl:when test="$element = 'colophon'">back</xsl:when>
  1456. <xsl:otherwise>body</xsl:otherwise>
  1457. </xsl:choose>
  1458. <xsl:choose>
  1459. <xsl:when test="$draft.mode = 'yes'">
  1460. <xsl:text>-draft</xsl:text>
  1461. </xsl:when>
  1462. <xsl:when test="$draft.mode = 'no'">
  1463. <!-- nop -->
  1464. </xsl:when>
  1465. <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
  1466. <xsl:text>-draft</xsl:text>
  1467. </xsl:when>
  1468. <xsl:otherwise>
  1469. <!-- nop -->
  1470. </xsl:otherwise>
  1471. </xsl:choose>
  1472. </xsl:variable>
  1473. <xsl:call-template name="select.user.pagemaster">
  1474. <xsl:with-param name="element" select="$element"/>
  1475. <xsl:with-param name="pageclass" select="$pageclass"/>
  1476. <xsl:with-param name="default-pagemaster" select="$pagemaster"/>
  1477. </xsl:call-template>
  1478. </xsl:template>
  1479. <xsl:template name="select.user.pagemaster">
  1480. <xsl:param name="element"/>
  1481. <xsl:param name="pageclass"/>
  1482. <xsl:param name="default-pagemaster"/>
  1483. <!-- by default, return the default. But if you've created your own
  1484. pagemasters in user.pagemasters, you might want to select one here. -->
  1485. <xsl:value-of select="$default-pagemaster"/>
  1486. </xsl:template>
  1487. <!-- ==================================================================== -->
  1488. <xsl:template name="head.sep.rule">
  1489. <xsl:param name="pageclass"/>
  1490. <xsl:param name="sequence"/>
  1491. <xsl:param name="gentext-key"/>
  1492. <xsl:if test="$header.rule != 0">
  1493. <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
  1494. <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
  1495. <xsl:attribute name="border-bottom-color">black</xsl:attribute>
  1496. </xsl:if>
  1497. </xsl:template>
  1498. <xsl:template name="foot.sep.rule">
  1499. <xsl:param name="pageclass"/>
  1500. <xsl:param name="sequence"/>
  1501. <xsl:param name="gentext-key"/>
  1502. <xsl:if test="$footer.rule != 0">
  1503. <xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
  1504. <xsl:attribute name="border-top-style">solid</xsl:attribute>
  1505. <xsl:attribute name="border-top-color">black</xsl:attribute>
  1506. </xsl:if>
  1507. </xsl:template>
  1508. <!-- ==================================================================== -->
  1509. <xsl:template match="*" mode="running.head.mode">
  1510. <xsl:param name="master-reference" select="'unknown'"/>
  1511. <xsl:param name="gentext-key" select="local-name(.)"/>
  1512. <!-- remove -draft from reference -->
  1513. <xsl:variable name="pageclass">
  1514. <xsl:choose>
  1515. <xsl:when test="contains($master-reference, '-draft')">
  1516. <xsl:value-of select="substring-before($master-reference, '-draft')"/>
  1517. </xsl:when>
  1518. <xsl:otherwise>
  1519. <xsl:value-of select="$master-reference"/>
  1520. </xsl:otherwise>
  1521. </xsl:choose>
  1522. </xsl:variable>
  1523. <fo:static-content flow-name="xsl-region-before-first">
  1524. <fo:block xsl:use-attribute-sets="header.content.properties">
  1525. <xsl:call-template name="header.table">
  1526. <xsl:with-param name="pageclass" select="$pageclass"/>
  1527. <xsl:with-param name="sequence" select="'first'"/>
  1528. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1529. </xsl:call-template>
  1530. </fo:block>
  1531. </fo:static-content>
  1532. <fo:static-content flow-name="xsl-region-before-odd">
  1533. <fo:block xsl:use-attribute-sets="header.content.properties">
  1534. <xsl:call-template name="header.table">
  1535. <xsl:with-param name="pageclass" select="$pageclass"/>
  1536. <xsl:with-param name="sequence" select="'odd'"/>
  1537. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1538. </xsl:call-template>
  1539. </fo:block>
  1540. </fo:static-content>
  1541. <fo:static-content flow-name="xsl-region-before-even">
  1542. <fo:block xsl:use-attribute-sets="header.content.properties">
  1543. <xsl:call-template name="header.table">
  1544. <xsl:with-param name="pageclass" select="$pageclass"/>
  1545. <xsl:with-param name="sequence" select="'even'"/>
  1546. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1547. </xsl:call-template>
  1548. </fo:block>
  1549. </fo:static-content>
  1550. <fo:static-content flow-name="xsl-region-before-blank">
  1551. <fo:block xsl:use-attribute-sets="header.content.properties">
  1552. <xsl:call-template name="header.table">
  1553. <xsl:with-param name="pageclass" select="$pageclass"/>
  1554. <xsl:with-param name="sequence" select="'blank'"/>
  1555. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1556. </xsl:call-template>
  1557. </fo:block>
  1558. </fo:static-content>
  1559. <xsl:call-template name="footnote-separator"/>
  1560. <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
  1561. <xsl:call-template name="blank.page.content"/>
  1562. </xsl:if>
  1563. </xsl:template>
  1564. <xsl:template name="footnote-separator">
  1565. <fo:static-content flow-name="xsl-footnote-separator">
  1566. <fo:block>
  1567. <fo:leader xsl:use-attribute-sets="footnote.sep.leader.properties"/>
  1568. </fo:block>
  1569. </fo:static-content>
  1570. </xsl:template>
  1571. <xsl:template name="blank.page.content">
  1572. <fo:static-content flow-name="blank-body">
  1573. <fo:block text-align="center"/>
  1574. </fo:static-content>
  1575. </xsl:template>
  1576. <xsl:template name="header.table">
  1577. <xsl:param name="pageclass" select="''"/>
  1578. <xsl:param name="sequence" select="''"/>
  1579. <xsl:param name="gentext-key" select="''"/>
  1580. <!-- default is a single table style for all headers -->
  1581. <!-- Customize it for different page classes or sequence location -->
  1582. <xsl:choose>
  1583. <xsl:when test="$pageclass = 'index'">
  1584. <xsl:attribute name="margin-left">0pt</xsl:attribute>
  1585. </xsl:when>
  1586. </xsl:choose>
  1587. <xsl:variable name="column1">
  1588. <xsl:choose>
  1589. <xsl:when test="$double.sided = 0">1</xsl:when>
  1590. <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
  1591. <xsl:otherwise>3</xsl:otherwise>
  1592. </xsl:choose>
  1593. </xsl:variable>
  1594. <xsl:variable name="column3">
  1595. <xsl:choose>
  1596. <xsl:when test="$double.sided = 0">3</xsl:when>
  1597. <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
  1598. <xsl:otherwise>1</xsl:otherwise>
  1599. </xsl:choose>
  1600. </xsl:variable>
  1601. <xsl:variable name="candidate">
  1602. <fo:table xsl:use-attribute-sets="header.table.properties">
  1603. <xsl:call-template name="head.sep.rule">
  1604. <xsl:with-param name="pageclass" select="$pageclass"/>
  1605. <xsl:with-param name="sequence" select="$sequence"/>
  1606. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1607. </xsl:call-template>
  1608. <fo:table-column column-number="1">
  1609. <xsl:attribute name="column-width">
  1610. <xsl:text>proportional-column-width(</xsl:text>
  1611. <xsl:call-template name="header.footer.width">
  1612. <xsl:with-param name="location">header</xsl:with-param>
  1613. <xsl:with-param name="position" select="$column1"/>
  1614. </xsl:call-template>
  1615. <xsl:text>)</xsl:text>
  1616. </xsl:attribute>
  1617. </fo:table-column>
  1618. <fo:table-column column-number="2">
  1619. <xsl:attribute name="column-width">
  1620. <xsl:text>proportional-column-width(</xsl:text>
  1621. <xsl:call-template name="header.footer.width">
  1622. <xsl:with-param name="location">header</xsl:with-param>
  1623. <xsl:with-param name="position" select="2"/>
  1624. </xsl:call-template>
  1625. <xsl:text>)</xsl:text>
  1626. </xsl:attribute>
  1627. </fo:table-column>
  1628. <fo:table-column column-number="3">
  1629. <xsl:attribute name="column-width">
  1630. <xsl:text>proportional-column-width(</xsl:text>
  1631. <xsl:call-template name="header.footer.width">
  1632. <xsl:with-param name="location">header</xsl:with-param>
  1633. <xsl:with-param name="position" select="$column3"/>
  1634. </xsl:call-template>
  1635. <xsl:text>)</xsl:text>
  1636. </xsl:attribute>
  1637. </fo:table-column>
  1638. <fo:table-body>
  1639. <fo:table-row>
  1640. <xsl:attribute name="block-progression-dimension.minimum">
  1641. <xsl:value-of select="$header.table.height"/>
  1642. </xsl:attribute>
  1643. <fo:table-cell text-align="left"
  1644. display-align="before">
  1645. <xsl:if test="$fop.extensions = 0">
  1646. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1647. </xsl:if>
  1648. <fo:block>
  1649. <xsl:call-template name="header.content">
  1650. <xsl:with-param name="pageclass" select="$pageclass"/>
  1651. <xsl:with-param name="sequence" select="$sequence"/>
  1652. <xsl:with-param name="position" select="'left'"/>
  1653. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1654. </xsl:call-template>
  1655. </fo:block>
  1656. </fo:table-cell>
  1657. <fo:table-cell text-align="center"
  1658. display-align="before">
  1659. <xsl:if test="$fop.extensions = 0">
  1660. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1661. </xsl:if>
  1662. <fo:block>
  1663. <xsl:call-template name="header.content">
  1664. <xsl:with-param name="pageclass" select="$pageclass"/>
  1665. <xsl:with-param name="sequence" select="$sequence"/>
  1666. <xsl:with-param name="position" select="'center'"/>
  1667. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1668. </xsl:call-template>
  1669. </fo:block>
  1670. </fo:table-cell>
  1671. <fo:table-cell text-align="right"
  1672. display-align="before">
  1673. <xsl:if test="$fop.extensions = 0">
  1674. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1675. </xsl:if>
  1676. <fo:block>
  1677. <xsl:call-template name="header.content">
  1678. <xsl:with-param name="pageclass" select="$pageclass"/>
  1679. <xsl:with-param name="sequence" select="$sequence"/>
  1680. <xsl:with-param name="position" select="'right'"/>
  1681. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1682. </xsl:call-template>
  1683. </fo:block>
  1684. </fo:table-cell>
  1685. </fo:table-row>
  1686. </fo:table-body>
  1687. </fo:table>
  1688. </xsl:variable>
  1689. <!-- Really output a header? -->
  1690. <xsl:choose>
  1691. <xsl:when test="$pageclass = 'titlepage' and $gentext-key = 'book'
  1692. and $sequence='first'">
  1693. <!-- no, book titlepages have no headers at all -->
  1694. </xsl:when>
  1695. <xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 0">
  1696. <!-- no output -->
  1697. </xsl:when>
  1698. <xsl:otherwise>
  1699. <xsl:copy-of select="$candidate"/>
  1700. </xsl:otherwise>
  1701. </xsl:choose>
  1702. </xsl:template>
  1703. <xsl:template name="header.content">
  1704. <xsl:param name="pageclass" select="''"/>
  1705. <xsl:param name="sequence" select="''"/>
  1706. <xsl:param name="position" select="''"/>
  1707. <xsl:param name="gentext-key" select="''"/>
  1708. <!--
  1709. <fo:block>
  1710. <xsl:value-of select="$pageclass"/>
  1711. <xsl:text>, </xsl:text>
  1712. <xsl:value-of select="$sequence"/>
  1713. <xsl:text>, </xsl:text>
  1714. <xsl:value-of select="$position"/>
  1715. <xsl:text>, </xsl:text>
  1716. <xsl:value-of select="$gentext-key"/>
  1717. </fo:block>
  1718. -->
  1719. <fo:block>
  1720. <!-- sequence can be odd, even, first, blank -->
  1721. <!-- position can be left, center, right -->
  1722. <xsl:choose>
  1723. <xsl:when test="$sequence = 'blank'">
  1724. <!-- nothing -->
  1725. </xsl:when>
  1726. <xsl:when test="$position='left'">
  1727. <!-- Same for odd, even, empty, and blank sequences -->
  1728. <xsl:call-template name="draft.text"/>
  1729. </xsl:when>
  1730. <xsl:when test="($sequence='odd' or $sequence='even') and $position='center'">
  1731. <xsl:if test="$pageclass != 'titlepage'">
  1732. <xsl:choose>
  1733. <xsl:when test="ancestor::book and ($double.sided != 0)">
  1734. <fo:retrieve-marker retrieve-class-name="section.head.marker"
  1735. retrieve-position="first-including-carryover"
  1736. retrieve-boundary="page-sequence"/>
  1737. </xsl:when>
  1738. <xsl:otherwise>
  1739. <xsl:apply-templates select="." mode="titleabbrev.markup"/>
  1740. </xsl:otherwise>
  1741. </xsl:choose>
  1742. </xsl:if>
  1743. </xsl:when>
  1744. <xsl:when test="$position='center'">
  1745. <!-- nothing for empty and blank sequences -->
  1746. </xsl:when>
  1747. <xsl:when test="$position='right'">
  1748. <!-- Same for odd, even, empty, and blank sequences -->
  1749. <xsl:call-template name="draft.text"/>
  1750. </xsl:when>
  1751. <xsl:when test="$sequence = 'first'">
  1752. <!-- nothing for first pages -->
  1753. </xsl:when>
  1754. <xsl:when test="$sequence = 'blank'">
  1755. <!-- nothing for blank pages -->
  1756. </xsl:when>
  1757. </xsl:choose>
  1758. </fo:block>
  1759. </xsl:template>
  1760. <xsl:template name="header.footer.width">
  1761. <xsl:param name="location" select="'header'"/>
  1762. <xsl:param name="position" select="1"/>
  1763. <xsl:variable name="width.set">
  1764. <xsl:choose>
  1765. <xsl:when test="$location = 'header'">
  1766. <xsl:value-of select="normalize-space($header.column.widths)"/>
  1767. </xsl:when>
  1768. <xsl:otherwise>
  1769. <xsl:value-of select="normalize-space($footer.column.widths)"/>
  1770. </xsl:otherwise>
  1771. </xsl:choose>
  1772. </xsl:variable>
  1773. <xsl:variable name="width">
  1774. <xsl:choose>
  1775. <xsl:when test="$position = 1">
  1776. <xsl:value-of select="substring-before($width.set, ' ')"/>
  1777. </xsl:when>
  1778. <xsl:when test="$position = 2">
  1779. <xsl:value-of select="substring-before(substring-after($width.set, ' '), ' ')"/>
  1780. </xsl:when>
  1781. <xsl:otherwise>
  1782. <xsl:value-of select="substring-after(substring-after($width.set, ' '), ' ')"/>
  1783. </xsl:otherwise>
  1784. </xsl:choose>
  1785. </xsl:variable>
  1786. <!-- Make sure it is a number -->
  1787. <xsl:choose>
  1788. <xsl:when test = "$width = number($width)">
  1789. <xsl:value-of select="$width"/>
  1790. </xsl:when>
  1791. <xsl:otherwise>
  1792. <xsl:message>Error: value in <xsl:value-of select="$location"/>.column.widths at position <xsl:value-of select="$position"/> is not a number.</xsl:message>
  1793. <xsl:text>1</xsl:text>
  1794. </xsl:otherwise>
  1795. </xsl:choose>
  1796. </xsl:template>
  1797. <xsl:template name="draft.text">
  1798. <xsl:choose>
  1799. <xsl:when test="$draft.mode = 'yes'">
  1800. <xsl:call-template name="gentext">
  1801. <xsl:with-param name="key" select="'Draft'"/>
  1802. </xsl:call-template>
  1803. </xsl:when>
  1804. <xsl:when test="$draft.mode = 'no'">
  1805. <!-- nop -->
  1806. </xsl:when>
  1807. <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
  1808. <xsl:call-template name="gentext">
  1809. <xsl:with-param name="key" select="'Draft'"/>
  1810. </xsl:call-template>
  1811. </xsl:when>
  1812. <xsl:otherwise>
  1813. <!-- nop -->
  1814. </xsl:otherwise>
  1815. </xsl:choose>
  1816. </xsl:template>
  1817. <!-- ==================================================================== -->
  1818. <xsl:template match="*" mode="running.foot.mode">
  1819. <xsl:param name="master-reference" select="'unknown'"/>
  1820. <xsl:param name="gentext-key" select="local-name(.)"/>
  1821. <!-- remove -draft from reference -->
  1822. <xsl:variable name="pageclass">
  1823. <xsl:choose>
  1824. <xsl:when test="contains($master-reference, '-draft')">
  1825. <xsl:value-of select="substring-before($master-reference, '-draft')"/>
  1826. </xsl:when>
  1827. <xsl:otherwise>
  1828. <xsl:value-of select="$master-reference"/>
  1829. </xsl:otherwise>
  1830. </xsl:choose>
  1831. </xsl:variable>
  1832. <fo:static-content flow-name="xsl-region-after-first">
  1833. <fo:block xsl:use-attribute-sets="footer.content.properties">
  1834. <xsl:call-template name="footer.table">
  1835. <xsl:with-param name="pageclass" select="$pageclass"/>
  1836. <xsl:with-param name="sequence" select="'first'"/>
  1837. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1838. </xsl:call-template>
  1839. </fo:block>
  1840. </fo:static-content>
  1841. <fo:static-content flow-name="xsl-region-after-odd">
  1842. <fo:block xsl:use-attribute-sets="footer.content.properties">
  1843. <xsl:call-template name="footer.table">
  1844. <xsl:with-param name="pageclass" select="$pageclass"/>
  1845. <xsl:with-param name="sequence" select="'odd'"/>
  1846. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1847. </xsl:call-template>
  1848. </fo:block>
  1849. </fo:static-content>
  1850. <fo:static-content flow-name="xsl-region-after-even">
  1851. <fo:block xsl:use-attribute-sets="footer.content.properties">
  1852. <xsl:call-template name="footer.table">
  1853. <xsl:with-param name="pageclass" select="$pageclass"/>
  1854. <xsl:with-param name="sequence" select="'even'"/>
  1855. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1856. </xsl:call-template>
  1857. </fo:block>
  1858. </fo:static-content>
  1859. <fo:static-content flow-name="xsl-region-after-blank">
  1860. <fo:block xsl:use-attribute-sets="footer.content.properties">
  1861. <xsl:call-template name="footer.table">
  1862. <xsl:with-param name="pageclass" select="$pageclass"/>
  1863. <xsl:with-param name="sequence" select="'blank'"/>
  1864. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1865. </xsl:call-template>
  1866. </fo:block>
  1867. </fo:static-content>
  1868. </xsl:template>
  1869. <xsl:template name="footer.table">
  1870. <xsl:param name="pageclass" select="''"/>
  1871. <xsl:param name="sequence" select="''"/>
  1872. <xsl:param name="gentext-key" select="''"/>
  1873. <!-- default is a single table style for all footers -->
  1874. <!-- Customize it for different page classes or sequence location -->
  1875. <xsl:choose>
  1876. <xsl:when test="$pageclass = 'index'">
  1877. <xsl:attribute name="margin-left">0pt</xsl:attribute>
  1878. </xsl:when>
  1879. </xsl:choose>
  1880. <xsl:variable name="column1">
  1881. <xsl:choose>
  1882. <xsl:when test="$double.sided = 0">1</xsl:when>
  1883. <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
  1884. <xsl:otherwise>3</xsl:otherwise>
  1885. </xsl:choose>
  1886. </xsl:variable>
  1887. <xsl:variable name="column3">
  1888. <xsl:choose>
  1889. <xsl:when test="$double.sided = 0">3</xsl:when>
  1890. <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
  1891. <xsl:otherwise>1</xsl:otherwise>
  1892. </xsl:choose>
  1893. </xsl:variable>
  1894. <xsl:variable name="candidate">
  1895. <fo:table xsl:use-attribute-sets="footer.table.properties">
  1896. <xsl:call-template name="foot.sep.rule">
  1897. <xsl:with-param name="pageclass" select="$pageclass"/>
  1898. <xsl:with-param name="sequence" select="$sequence"/>
  1899. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1900. </xsl:call-template>
  1901. <fo:table-column column-number="1">
  1902. <xsl:attribute name="column-width">
  1903. <xsl:text>proportional-column-width(</xsl:text>
  1904. <xsl:call-template name="header.footer.width">
  1905. <xsl:with-param name="location">footer</xsl:with-param>
  1906. <xsl:with-param name="position" select="$column1"/>
  1907. </xsl:call-template>
  1908. <xsl:text>)</xsl:text>
  1909. </xsl:attribute>
  1910. </fo:table-column>
  1911. <fo:table-column column-number="2">
  1912. <xsl:attribute name="column-width">
  1913. <xsl:text>proportional-column-width(</xsl:text>
  1914. <xsl:call-template name="header.footer.width">
  1915. <xsl:with-param name="location">footer</xsl:with-param>
  1916. <xsl:with-param name="position" select="2"/>
  1917. </xsl:call-template>
  1918. <xsl:text>)</xsl:text>
  1919. </xsl:attribute>
  1920. </fo:table-column>
  1921. <fo:table-column column-number="3">
  1922. <xsl:attribute name="column-width">
  1923. <xsl:text>proportional-column-width(</xsl:text>
  1924. <xsl:call-template name="header.footer.width">
  1925. <xsl:with-param name="location">footer</xsl:with-param>
  1926. <xsl:with-param name="position" select="$column3"/>
  1927. </xsl:call-template>
  1928. <xsl:text>)</xsl:text>
  1929. </xsl:attribute>
  1930. </fo:table-column>
  1931. <fo:table-body>
  1932. <fo:table-row>
  1933. <xsl:attribute name="block-progression-dimension.minimum">
  1934. <xsl:value-of select="$footer.table.height"/>
  1935. </xsl:attribute>
  1936. <fo:table-cell text-align="left"
  1937. display-align="after">
  1938. <xsl:if test="$fop.extensions = 0">
  1939. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1940. </xsl:if>
  1941. <fo:block>
  1942. <xsl:call-template name="footer.content">
  1943. <xsl:with-param name="pageclass" select="$pageclass"/>
  1944. <xsl:with-param name="sequence" select="$sequence"/>
  1945. <xsl:with-param name="position" select="'left'"/>
  1946. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1947. </xsl:call-template>
  1948. </fo:block>
  1949. </fo:table-cell>
  1950. <fo:table-cell text-align="center"
  1951. display-align="after">
  1952. <xsl:if test="$fop.extensions = 0">
  1953. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1954. </xsl:if>
  1955. <fo:block>
  1956. <xsl:call-template name="footer.content">
  1957. <xsl:with-param name="pageclass" select="$pageclass"/>
  1958. <xsl:with-param name="sequence" select="$sequence"/>
  1959. <xsl:with-param name="position" select="'center'"/>
  1960. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1961. </xsl:call-template>
  1962. </fo:block>
  1963. </fo:table-cell>
  1964. <fo:table-cell text-align="right"
  1965. display-align="after">
  1966. <xsl:if test="$fop.extensions = 0">
  1967. <xsl:attribute name="relative-align">baseline</xsl:attribute>
  1968. </xsl:if>
  1969. <fo:block>
  1970. <xsl:call-template name="footer.content">
  1971. <xsl:with-param name="pageclass" select="$pageclass"/>
  1972. <xsl:with-param name="sequence" select="$sequence"/>
  1973. <xsl:with-param name="position" select="'right'"/>
  1974. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  1975. </xsl:call-template>
  1976. </fo:block>
  1977. </fo:table-cell>
  1978. </fo:table-row>
  1979. </fo:table-body>
  1980. </fo:table>
  1981. </xsl:variable>
  1982. <!-- Really output a footer? -->
  1983. <xsl:choose>
  1984. <xsl:when test="$pageclass='titlepage' and $gentext-key='book'
  1985. and $sequence='first'">
  1986. <!-- no, book titlepages have no footers at all -->
  1987. </xsl:when>
  1988. <xsl:when test="$sequence = 'blank' and $footers.on.blank.pages = 0">
  1989. <!-- no output -->
  1990. </xsl:when>
  1991. <xsl:otherwise>
  1992. <xsl:copy-of select="$candidate"/>
  1993. </xsl:otherwise>
  1994. </xsl:choose>
  1995. </xsl:template>
  1996. <xsl:template name="footer.content">
  1997. <xsl:param name="pageclass" select="''"/>
  1998. <xsl:param name="sequence" select="''"/>
  1999. <xsl:param name="position" select="''"/>
  2000. <xsl:param name="gentext-key" select="''"/>
  2001. <!--
  2002. <fo:block>
  2003. <xsl:value-of select="$pageclass"/>
  2004. <xsl:text>, </xsl:text>
  2005. <xsl:value-of select="$sequence"/>
  2006. <xsl:text>, </xsl:text>
  2007. <xsl:value-of select="$position"/>
  2008. <xsl:text>, </xsl:text>
  2009. <xsl:value-of select="$gentext-key"/>
  2010. </fo:block>
  2011. -->
  2012. <fo:block>
  2013. <!-- pageclass can be front, body, back -->
  2014. <!-- sequence can be odd, even, first, blank -->
  2015. <!-- position can be left, center, right -->
  2016. <xsl:choose>
  2017. <xsl:when test="$pageclass = 'titlepage'">
  2018. <!-- nop; no footer on title pages -->
  2019. </xsl:when>
  2020. <xsl:when test="$double.sided != 0 and $sequence = 'even'
  2021. and $position='left'">
  2022. <fo:page-number/>
  2023. </xsl:when>
  2024. <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
  2025. and $position='right'">
  2026. <fo:page-number/>
  2027. </xsl:when>
  2028. <xsl:when test="$double.sided = 0 and $position='center'">
  2029. <fo:page-number/>
  2030. </xsl:when>
  2031. <xsl:when test="$sequence='blank'">
  2032. <xsl:choose>
  2033. <xsl:when test="$double.sided != 0 and $position = 'left'">
  2034. <fo:page-number/>
  2035. </xsl:when>
  2036. <xsl:when test="$double.sided = 0 and $position = 'center'">
  2037. <fo:page-number/>
  2038. </xsl:when>
  2039. <xsl:otherwise>
  2040. <!-- nop -->
  2041. </xsl:otherwise>
  2042. </xsl:choose>
  2043. </xsl:when>
  2044. <xsl:otherwise>
  2045. <!-- nop -->
  2046. </xsl:otherwise>
  2047. </xsl:choose>
  2048. </fo:block>
  2049. </xsl:template>
  2050. <!-- ==================================================================== -->
  2051. <xsl:template name="page.number.format">
  2052. <xsl:param name="element" select="local-name(.)"/>
  2053. <xsl:param name="master-reference" select="''"/>
  2054. <xsl:choose>
  2055. <xsl:when test="$element = 'toc' and self::book">i</xsl:when>
  2056. <xsl:when test="$element = 'preface'">i</xsl:when>
  2057. <xsl:when test="$element = 'dedication'">i</xsl:when>
  2058. <xsl:otherwise>1</xsl:otherwise>
  2059. </xsl:choose>
  2060. </xsl:template>
  2061. <xsl:template name="initial.page.number">
  2062. <xsl:param name="element" select="local-name(.)"/>
  2063. <xsl:param name="master-reference" select="''"/>
  2064. <!-- Select the first content that the stylesheet places
  2065. after the TOC -->
  2066. <xsl:variable name="first.book.content"
  2067. select="ancestor::book/*[
  2068. not(self::title or
  2069. self::subtitle or
  2070. self::titleabbrev or
  2071. self::bookinfo or
  2072. self::info or
  2073. self::dedication or
  2074. self::preface or
  2075. self::toc or
  2076. self::lot)][1]"/>
  2077. <xsl:choose>
  2078. <!-- double-sided output -->
  2079. <xsl:when test="$double.sided != 0">
  2080. <xsl:choose>
  2081. <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
  2082. <xsl:when test="$element = 'book'">1</xsl:when>
  2083. <!-- preface typically continues TOC roman numerals -->
  2084. <!-- Change page.number.format if not -->
  2085. <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
  2086. <xsl:when test="($element = 'dedication' or $element = 'article')
  2087. and not(preceding::chapter
  2088. or preceding::preface
  2089. or preceding::appendix
  2090. or preceding::article
  2091. or preceding::dedication
  2092. or parent::part
  2093. or parent::reference)">1</xsl:when>
  2094. <xsl:when test="generate-id($first.book.content) =
  2095. generate-id(.)">1</xsl:when>
  2096. <xsl:otherwise>auto-odd</xsl:otherwise>
  2097. </xsl:choose>
  2098. </xsl:when>
  2099. <!-- single-sided output -->
  2100. <xsl:otherwise>
  2101. <xsl:choose>
  2102. <xsl:when test="$element = 'toc'">auto</xsl:when>
  2103. <xsl:when test="$element = 'book'">1</xsl:when>
  2104. <xsl:when test="$element = 'preface'">auto</xsl:when>
  2105. <xsl:when test="($element = 'dedication' or $element = 'article') and
  2106. not(preceding::chapter
  2107. or preceding::preface
  2108. or preceding::appendix
  2109. or preceding::article
  2110. or preceding::dedication
  2111. or parent::part
  2112. or parent::reference)">1</xsl:when>
  2113. <xsl:when test="generate-id($first.book.content) =
  2114. generate-id(.)">1</xsl:when>
  2115. <xsl:otherwise>auto</xsl:otherwise>
  2116. </xsl:choose>
  2117. </xsl:otherwise>
  2118. </xsl:choose>
  2119. </xsl:template>
  2120. <xsl:template name="force.page.count">
  2121. <xsl:param name="element" select="local-name(.)"/>
  2122. <xsl:param name="master-reference" select="''"/>
  2123. <xsl:choose>
  2124. <!-- double-sided output -->
  2125. <xsl:when test="$double.sided != 0">end-on-even</xsl:when>
  2126. <!-- single-sided output -->
  2127. <xsl:otherwise>no-force</xsl:otherwise>
  2128. </xsl:choose>
  2129. </xsl:template>
  2130. <xsl:template name="set.flow.properties">
  2131. <xsl:param name="element" select="local-name(.)"/>
  2132. <xsl:param name="master-reference" select="''"/>
  2133. <!-- This template is called after each <fo:flow> starts. -->
  2134. <!-- Customize this template to set attributes on fo:flow -->
  2135. <!-- remove -draft from reference -->
  2136. <xsl:variable name="pageclass">
  2137. <xsl:choose>
  2138. <xsl:when test="contains($master-reference, '-draft')">
  2139. <xsl:value-of select="substring-before($master-reference, '-draft')"/>
  2140. </xsl:when>
  2141. <xsl:otherwise>
  2142. <xsl:value-of select="$master-reference"/>
  2143. </xsl:otherwise>
  2144. </xsl:choose>
  2145. </xsl:variable>
  2146. <xsl:choose>
  2147. <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
  2148. <!-- body.start.indent does not work well with these processors -->
  2149. </xsl:when>
  2150. <xsl:when test="starts-with($pageclass, 'body') or
  2151. starts-with($pageclass, 'lot') or
  2152. starts-with($pageclass, 'front') or
  2153. $element = 'preface' or
  2154. (starts-with($pageclass, 'back') and
  2155. $element = 'appendix')">
  2156. <xsl:attribute name="start-indent">
  2157. <xsl:value-of select="$body.start.indent"/>
  2158. </xsl:attribute>
  2159. <xsl:attribute name="end-indent">
  2160. <xsl:value-of select="$body.end.indent"/>
  2161. </xsl:attribute>
  2162. </xsl:when>
  2163. </xsl:choose>
  2164. </xsl:template>
  2165. <!-- ==================================================================== -->
  2166. </xsl:stylesheet>