source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/fo/plain.xsl@ ac340c2

ml-11.0 multilib xry111/multilib
Last change on this file since ac340c2 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 18.9 KB
Line 
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 xmlns:db="http://docbook.org/ns/docbook"
5 xmlns:dbs="http://docbook.org/ns/docbook-slides"
6 xmlns:exsl="http://exslt.org/common"
7 exclude-result-prefixes="dbs db"
8 extension-element-prefixes="exsl"
9 version="1.0">
10
11<xsl:import href="../../fo/docbook.xsl"/>
12<xsl:import href="../common/common.xsl"/>
13<xsl:include href="plain-titlepage.xsl"/>
14<xsl:include href="param.xsl"/>
15
16<xsl:output indent="yes"/>
17
18<xsl:param name="local.l10n.xml" select="document('')"/>
19<i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
20 <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
21 <l:gentext key="Continued" text="(Continued)"/>
22 <l:gentext key="Speakernotes" text="Speaker Notes"/>
23 <l:gentext key="Handoutnotes" text="Handout Notes"/>
24 <l:context name="title">
25 <l:template name="slides" text="%t"/>
26 <l:template name="foilgroup" text="%t"/>
27 <l:template name="foil" text="%t"/>
28 </l:context>
29 </l:l10n>
30</i18n>
31
32<!-- Start of overrides -->
33
34<xsl:param name="page.margin.top" select="'0.25in'"/>
35<xsl:param name="page.margin.bottom" select="'0.25in'"/>
36<xsl:param name="page.margin.inner" select="'0.25in'"/>
37<xsl:param name="page.margin.outer" select="'0.25in'"/>
38<xsl:param name="body.margin.top" select="'1in'"/>
39<xsl:param name="body.margin.bottom" select="'0.5in'"/>
40<xsl:param name="region.before.extent" select="'0.75in'"/>
41<xsl:param name="region.after.extent" select="'0.5in'"/>
42<xsl:param name="column.count.body" select="1"/>
43<xsl:param name="body.font.size">20</xsl:param>
44
45<xsl:param name="callout.icon.size" select="'40pt'"/>
46<xsl:param name="alignment" select="'start'"/>
47<xsl:param name="preferred.mediaobject.role" select="'print'"/>
48<xsl:param name="page.orientation" select="'landscape'"/>
49
50<xsl:variable name="root.elements" select="' slides '"/>
51
52<xsl:attribute-set name="formal.title.properties"
53 use-attribute-sets="normal.para.spacing">
54 <xsl:attribute name="font-weight">bold</xsl:attribute>
55 <xsl:attribute name="font-size">
56 <xsl:value-of select="$body.font.master * 1.2"/>
57 <xsl:text>pt</xsl:text>
58 </xsl:attribute>
59 <xsl:attribute name="hyphenate">false</xsl:attribute>
60 <xsl:attribute name="space-after.minimum">8pt</xsl:attribute>
61 <xsl:attribute name="space-after.optimum">6pt</xsl:attribute>
62 <xsl:attribute name="space-after.maximum">10pt</xsl:attribute>
63</xsl:attribute-set>
64
65<xsl:attribute-set name="list.block.spacing">
66 <xsl:attribute name="space-before.optimum">12pt</xsl:attribute>
67 <xsl:attribute name="space-before.minimum">8pt</xsl:attribute>
68 <xsl:attribute name="space-before.maximum">14pt</xsl:attribute>
69 <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
70 <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
71 <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
72</xsl:attribute-set>
73
74<xsl:attribute-set name="list.item.spacing">
75 <xsl:attribute name="space-before.optimum">6pt</xsl:attribute>
76 <xsl:attribute name="space-before.minimum">4pt</xsl:attribute>
77 <xsl:attribute name="space-before.maximum">8pt</xsl:attribute>
78</xsl:attribute-set>
79
80<xsl:attribute-set name="normal.para.spacing">
81 <xsl:attribute name="space-before.optimum">8pt</xsl:attribute>
82 <xsl:attribute name="space-before.minimum">6pt</xsl:attribute>
83 <xsl:attribute name="space-before.maximum">10pt</xsl:attribute>
84</xsl:attribute-set>
85
86<xsl:attribute-set name="orderedlist.properties">
87 <xsl:attribute name="font-size">
88 <xsl:value-of select="$body.font.size"/>
89 </xsl:attribute>
90</xsl:attribute-set>
91
92<xsl:attribute-set name="footnote.properties">
93 <xsl:attribute name="font-size">
94 <xsl:value-of select="$body.font.size * 0.8"/>
95 </xsl:attribute>
96</xsl:attribute-set>
97
98<xsl:attribute-set name="slides.titlepage.recto.style">
99 <xsl:attribute name="font-family">
100 <xsl:value-of select="$slide.font.family"/>
101 </xsl:attribute>
102</xsl:attribute-set>
103
104<xsl:attribute-set name="slides.titlepage.verso.style">
105 <xsl:attribute name="font-family">
106 <xsl:value-of select="$slide.font.family"/>
107 </xsl:attribute>
108</xsl:attribute-set>
109
110<xsl:template name="bibliography.titlepage"/>
111
112<!-- Do not add db namespace to dbs elements -->
113<xsl:template match="*[namespace-uri() = 'http://docbook.org/ns/docbook-slides']" mode="addNS">
114 <xsl:copy-of select="."/>
115</xsl:template>
116
117<!-- End of overrides -->
118
119<xsl:template name="user.pagemasters">
120 <fo:simple-page-master master-name="slides-titlepage-master"
121 xsl:use-attribute-sets="slides.titlepage.master.properties">
122 <fo:region-body xsl:use-attribute-sets="slides.titlepage.region-body.properties"/>
123 </fo:simple-page-master>
124
125 <fo:simple-page-master master-name="slides-foil-master"
126 xsl:use-attribute-sets="foil.master.properties">
127 <fo:region-body xsl:use-attribute-sets="foil.region-body.properties"/>
128 <fo:region-before region-name="xsl-region-before-foil" xsl:use-attribute-sets="foil.region-before.properties"/>
129 <fo:region-after region-name="xsl-region-after-foil" xsl:use-attribute-sets="foil.region-after.properties"/>
130 </fo:simple-page-master>
131
132 <fo:simple-page-master master-name="slides-foil-continued-master"
133 xsl:use-attribute-sets="foil.master.properties">
134 <fo:region-body xsl:use-attribute-sets="foil.region-body.properties"/>
135 <fo:region-before region-name="xsl-region-before-foil-continued" xsl:use-attribute-sets="foil.region-before.properties"/>
136 <fo:region-after region-name="xsl-region-after-foil-continued" xsl:use-attribute-sets="foil.region-after.properties"/>
137 </fo:simple-page-master>
138
139 <fo:page-sequence-master master-name="slides-titlepage">
140 <fo:repeatable-page-master-alternatives>
141 <fo:conditional-page-master-reference master-reference="slides-titlepage-master"/>
142 </fo:repeatable-page-master-alternatives>
143 </fo:page-sequence-master>
144
145 <fo:page-sequence-master master-name="slides-foil">
146 <fo:repeatable-page-master-alternatives>
147 <fo:conditional-page-master-reference master-reference="slides-foil-master"
148 page-position="first"/>
149 <fo:conditional-page-master-reference master-reference="slides-foil-continued-master"/>
150 </fo:repeatable-page-master-alternatives>
151 </fo:page-sequence-master>
152</xsl:template>
153
154<xsl:template name="presentation.title">
155 <xsl:call-template name="get.title">
156 <xsl:with-param name="ctx" select="/dbs:slides"/>
157 </xsl:call-template>
158</xsl:template>
159
160<xsl:template name="slides.bookmarks">
161 <fo:bookmark-tree>
162 <xsl:apply-templates select="/dbs:slides/dbs:foil|/dbs:slides/dbs:foilgroup" mode="bookmark.mode"/>
163 </fo:bookmark-tree>
164</xsl:template>
165
166<xsl:template match="dbs:foil|dbs:foilgroup" mode="bookmark.mode">
167 <fo:bookmark>
168 <xsl:attribute name="internal-destination">
169 <xsl:call-template name="object.id"/>
170 </xsl:attribute>
171
172 <fo:bookmark-title>
173 <xsl:call-template name="get.title"/>
174 </fo:bookmark-title>
175
176 <xsl:if test="self::dbs:foilgroup">
177 <xsl:apply-templates select="dbs:foil" mode="bookmark.mode"/>
178 </xsl:if>
179 </fo:bookmark>
180</xsl:template>
181
182<xsl:template match="db:author" mode="titlepage.mode">
183 <fo:block>
184 <xsl:apply-templates select="db:personname" mode="titlepage.mode"/>
185 </fo:block>
186
187 <fo:block>
188 <xsl:apply-templates select="db:affiliation" mode="titlepage.mode"/>
189 </fo:block>
190
191 <fo:block>
192 <xsl:apply-templates select="db:email" mode="titlepage.mode"/>
193 </fo:block>
194</xsl:template>
195
196<xsl:template match="/">
197 <fo:root xsl:use-attribute-sets="slides.properties">
198 <fo:layout-master-set>
199 <xsl:call-template name="user.pagemasters"/>
200 </fo:layout-master-set>
201
202 <xsl:call-template name="slides.bookmarks"/>
203
204 <xsl:if test="$generate.titlepage != 0">
205 <fo:page-sequence hyphenate="{$hyphenate}"
206 master-reference="slides-titlepage">
207 <xsl:attribute name="language">
208 <xsl:call-template name="l10n.language"/>
209 </xsl:attribute>
210
211 <fo:flow flow-name="xsl-region-body">
212 <fo:block>
213 <xsl:apply-templates select="/dbs:slides" mode="titlepage"/>
214 </fo:block>
215 </fo:flow>
216 </fo:page-sequence>
217 </xsl:if>
218
219 <xsl:apply-templates select="/dbs:slides/dbs:foil|/dbs:slides/dbs:foilgroup"/>
220 </fo:root>
221</xsl:template>
222
223<xsl:template match="dbs:slides" mode="titlepage">
224 <xsl:call-template name="slides.titlepage"/>
225</xsl:template>
226
227<xsl:template name="page.template">
228 <xsl:param name="mode" select="'normal'"/>
229
230 <xsl:param name="title">
231 <xsl:call-template name="get.title"/>
232 </xsl:param>
233
234 <xsl:param name="subtitle">
235 <xsl:call-template name="get.subtitle"/>
236 </xsl:param>
237
238 <fo:page-sequence master-reference="slides-foil" xsl:use-attribute-sets="foil.page-sequence.properties">
239 <xsl:attribute name="language">
240 <xsl:call-template name="l10n.language"/>
241 </xsl:attribute>
242
243 <xsl:attribute name="id">
244 <xsl:call-template name="object.id"/>
245 </xsl:attribute>
246
247 <fo:static-content flow-name="xsl-region-before-foil">
248 <fo:block xsl:use-attribute-sets="foil.header.properties">
249 <fo:block xsl:use-attribute-sets="foil.title.properties">
250 <xsl:value-of select="$title"/>
251 </fo:block>
252
253 <fo:block xsl:use-attribute-sets="foil.subtitle.properties">
254 <xsl:value-of select="$subtitle"/>
255 </fo:block>
256 </fo:block>
257 </fo:static-content>
258
259 <fo:static-content flow-name="xsl-region-before-foil-continued">
260 <fo:block xsl:use-attribute-sets="foil.header.properties">
261 <fo:block xsl:use-attribute-sets="foil.title.properties">
262 <xsl:value-of select="$title"/>
263 <xsl:text> </xsl:text>
264 <xsl:call-template name="gentext">
265 <xsl:with-param name="key" select="'Continued'"/>
266 </xsl:call-template>
267 </fo:block>
268 </fo:block>
269 </fo:static-content>
270
271 <fo:static-content flow-name="xsl-region-after-foil">
272 <xsl:call-template name="generate.footer"/>
273 </fo:static-content>
274
275 <fo:static-content flow-name="xsl-region-after-foil-continued">
276 <xsl:call-template name="generate.footer"/>
277 </fo:static-content>
278
279 <fo:flow flow-name="xsl-region-body">
280 <fo:block xsl:use-attribute-sets="foil.properties">
281 <xsl:choose>
282 <xsl:when test="$mode = 'normal'">
283 <xsl:apply-templates select="*[not(self::dbs:foil)][not(self::db:info)][not(self::db:title)][not(self::db:titleabbrev)][not(self::db:subtitle)][not(self::dbs:speakernotes)][not(self::dbs:handoutnotes)]"/>
284
285 <xsl:if test="self::dbs:foilgroup and ($generate.foilgroup.toc != 0)">
286 <xsl:call-template name="foilgroup.generate.toc"/>
287 </xsl:if>
288 </xsl:when>
289
290 <xsl:when test="$mode = 'speakernotes'">
291 <xsl:apply-templates select="dbs:speakernotes"/>
292 </xsl:when>
293
294 <xsl:when test="$mode = 'handoutnotes'">
295 <xsl:apply-templates select="dbs:handoutnotes"/>
296 </xsl:when>
297 </xsl:choose>
298 </fo:block>
299 </fo:flow>
300 </fo:page-sequence>
301</xsl:template>
302
303<xsl:template match="dbs:foil|dbs:foilgroup">
304 <xsl:call-template name="page.template"/>
305
306 <xsl:call-template name="generate.slide.notes"/>
307
308 <xsl:if test="self::dbs:foilgroup">
309 <xsl:apply-templates select="dbs:foil"/>
310 </xsl:if>
311</xsl:template>
312
313<xsl:template name="generate.slide.notes">
314 <xsl:variable name="subtitle.handoutnotes">
315 <xsl:call-template name="gentext">
316 <xsl:with-param name="key" select="'Handoutnotes'"/>
317 </xsl:call-template>
318 </xsl:variable>
319
320 <xsl:variable name="subtitle.speakernotes">
321 <xsl:call-template name="gentext">
322 <xsl:with-param name="key" select="'Speakernotes'"/>
323 </xsl:call-template>
324 </xsl:variable>
325
326 <xsl:if test="($generate.handoutnotes != 0) and ./dbs:handoutnotes">
327 <xsl:call-template name="page.template">
328 <xsl:with-param name="mode" select="'handoutnotes'"/>
329 <xsl:with-param name="subtitle" select="$subtitle.handoutnotes"/>
330 </xsl:call-template>
331 </xsl:if>
332
333 <xsl:if test="($generate.speakernotes != 0) and ./dbs:speakernotes">
334 <xsl:call-template name="page.template">
335 <xsl:with-param name="mode" select="'speakernotes'"/>
336 <xsl:with-param name="subtitle" select="$subtitle.speakernotes"/>
337 </xsl:call-template>
338 </xsl:if>
339</xsl:template>
340
341<xsl:template match="dbs:handoutnotes">
342 <fo:block xsl:use-attribute-sets="handoutnotes.properties">
343 <xsl:apply-templates/>
344 </fo:block>
345</xsl:template>
346
347<xsl:template match="dbs:speakernotes">
348 <fo:block xsl:use-attribute-sets="speakernotes.properties">
349 <xsl:apply-templates/>
350 </fo:block>
351</xsl:template>
352
353<xsl:template match="dbs:block">
354 <xsl:apply-templates/>
355</xsl:template>
356
357<xsl:template name="generate.footer">
358<fo:block xsl:use-attribute-sets="foil.footer.properties">
359 <fo:table>
360 <fo:table-column column-number="1" column-width="33%"/>
361 <fo:table-column column-number="2" column-width="34%"/>
362 <fo:table-column column-number="3" column-width="33%"/>
363
364 <fo:table-body>
365 <fo:table-row height="14pt">
366 <fo:table-cell text-align="left">
367 <xsl:call-template name="footer.left"/>
368 </fo:table-cell>
369
370 <fo:table-cell text-align="center">
371 <xsl:call-template name="footer.center"/>
372 </fo:table-cell>
373
374 <fo:table-cell text-align="right">
375 <xsl:call-template name="footer.right"/>
376 </fo:table-cell>
377 </fo:table-row>
378 </fo:table-body>
379 </fo:table>
380</fo:block>
381</xsl:template>
382
383<xsl:template name="footer.left">
384 <fo:block/>
385</xsl:template>
386
387<xsl:template name="footer.center">
388 <xsl:if test="($generate.copyright != 0) and /dbs:slides/db:info/db:copyright">
389 <fo:block>
390 <xsl:call-template name="gentext">
391 <xsl:with-param name="key" select="'Copyright'"/>
392 </xsl:call-template>
393 <xsl:call-template name="gentext.space"/>
394 <xsl:text>&#xa9;</xsl:text>
395 <xsl:call-template name="gentext.space"/>
396 <xsl:value-of select="/dbs:slides/db:info/db:copyright/db:year"/>
397 <xsl:call-template name="gentext.space"/>
398 <xsl:value-of select="/dbs:slides/db:info/db:copyright/db:holder"/>
399 </fo:block>
400 </xsl:if>
401
402 <xsl:if test="($generate.pubdate != 0) and /dbs:slides/db:info/db:pubdate">
403 <xsl:call-template name="slide.pubdate"/>
404 </xsl:if>
405</xsl:template>
406
407<xsl:template name="footer.right">
408 <fo:block>
409 <xsl:if test="$generate.page.number != 'no'">
410 <fo:page-number/>
411 </xsl:if>
412
413 <xsl:if test="$generate.page.number = 'full'">
414 <xsl:text>&#160;/&#160;</xsl:text>
415 <fo:page-number-citation>
416 <xsl:attribute name="ref-id">
417 <xsl:call-template name="object.id">
418 <xsl:with-param name="object" select="(//dbs:foilgroup|//dbs:foil)[last()]"/>
419 </xsl:call-template>
420 </xsl:attribute>
421 </fo:page-number-citation>
422 </xsl:if>
423 </fo:block>
424</xsl:template>
425
426<xsl:template name="slide.pubdate">
427 <fo:block>
428 <xsl:call-template name="gentext">
429 <xsl:with-param name="key" select="'Published'"/>
430 </xsl:call-template>
431 <xsl:text>: </xsl:text>
432 <xsl:value-of select="/dbs:slides/db:info/db:pubdate"/>
433 </fo:block>
434</xsl:template>
435
436<xsl:template name="foilgroup.generate.toc">
437 <xsl:choose>
438 <xsl:when test="$generate.foilgroup.numbered.toc != 0">
439 <fo:list-block xsl:use-attribute-sets="list.block.spacing orderedlist.properties">
440 <xsl:for-each select="./dbs:foil">
441 <fo:list-item xsl:use-attribute-sets="list.item.spacing">
442 <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="orderedlist.label.properties">
443 <fo:block>
444 <xsl:value-of select="position()"/>
445 </fo:block>
446 </fo:list-item-label>
447
448 <fo:list-item-body start-indent="body-start()">
449 <fo:block>
450 <xsl:call-template name="get.title"/>
451 </fo:block>
452 </fo:list-item-body>
453 </fo:list-item>
454 </xsl:for-each>
455 </fo:list-block>
456 </xsl:when>
457
458 <xsl:otherwise>
459 <fo:list-block xsl:use-attribute-sets="list.block.spacing itemizedlist.properties">
460 <xsl:for-each select="./dbs:foil">
461 <fo:list-item xsl:use-attribute-sets="list.item.spacing">
462 <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="itemizedlist.label.properties">
463 <fo:block>
464 <xsl:call-template name="itemizedlist.label.markup">
465 <xsl:with-param name="itemsymbol">
466 <xsl:call-template name="list.itemsymbol"/>
467 </xsl:with-param>
468 </xsl:call-template>
469 </fo:block>
470 </fo:list-item-label>
471
472 <fo:list-item-body start-indent="body-start()">
473 <fo:block>
474 <xsl:call-template name="get.title"/>
475 </fo:block>
476 </fo:list-item-body>
477 </fo:list-item>
478 </xsl:for-each>
479 </fo:list-block>
480 </xsl:otherwise>
481 </xsl:choose>
482</xsl:template>
483
484<xsl:template match="*[namespace-uri() = 'http://www.w3.org/2000/svg']">
485 <xsl:call-template name="handle.embedded">
486 <xsl:with-param name="modeParam" select="$svg.embedding.mode"/>
487 <xsl:with-param name="fileExt" select="'.svg'"/>
488 </xsl:call-template>
489</xsl:template>
490
491<xsl:template match="*[namespace-uri() = 'http://www.w3.org/1998/Math/MathML']">
492 <xsl:call-template name="handle.embedded">
493 <xsl:with-param name="modeParam" select="$mml.embedding.mode"/>
494 <xsl:with-param name="fileExt" select="'.mml'"/>
495 </xsl:call-template>
496</xsl:template>
497
498<xsl:template name="handle.embedded">
499 <xsl:param name="modeParam">inline</xsl:param>
500 <xsl:param name="fileExt"/>
501
502 <xsl:choose>
503 <xsl:when test="$modeParam = 'inline'">
504 <xsl:copy-of select="."/>
505 </xsl:when>
506
507 <xsl:when test="$modeParam = 'instream-foreign-object'">
508 <fo:instream-foreign-object>
509 <xsl:copy-of select="."/>
510 </fo:instream-foreign-object>
511 </xsl:when>
512
513 <xsl:otherwise>
514 <xsl:variable name="id">
515 <xsl:call-template name="object.id"/>
516 </xsl:variable>
517 <xsl:variable name="fname">
518 <xsl:value-of select="concat($id, $fileExt)"/>
519 </xsl:variable>
520 <xsl:variable name="prefix">url('</xsl:variable>
521 <xsl:variable name="suffix">')</xsl:variable>
522 <xsl:variable name="file.uri">
523 <xsl:value-of select="concat($prefix, $fname, $suffix)"/>
524 </xsl:variable>
525
526 <exsl:document href="{$fname}">
527 <xsl:copy-of select="."/>
528
529 <xsl:fallback>
530 <xsl:message terminate="yes">
531 Your XSLT processor does not support exsl:document.
532 You can only use inline SVG images.
533 </xsl:message>
534 </xsl:fallback>
535 </exsl:document>
536
537 <xsl:choose>
538 <xsl:when test="$modeParam = 'external-graphic'">
539 <fo:external-graphic src="{$file.uri}"/>
540 </xsl:when>
541
542 <xsl:otherwise>
543 <xsl:message terminate="yes">
544 Unknown processing mode <xsl:value-of select="$modeParam"/>.
545 </xsl:message>
546 </xsl:otherwise>
547 </xsl:choose>
548 </xsl:otherwise>
549 </xsl:choose>
550</xsl:template>
551
552<xsl:template match="dbs:foil|dbs:foilgroup" mode="xref-to">
553 <xsl:param name="referrer"/>
554 <xsl:param name="xrefstyle"/>
555
556 <xsl:apply-templates select="." mode="object.xref.markup">
557 <xsl:with-param name="purpose" select="'xref'"/>
558 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
559 <xsl:with-param name="referrer" select="$referrer"/>
560 </xsl:apply-templates>
561</xsl:template>
562
563</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.