This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
more customizing of the fo xsl stylesheets
- From: Tobias Grimm <Tobias dot Grimm at cas-soft dot de>
- To: docbook at lists dot oasis-open dot org
- Date: Mon, 02 Dec 2002 02:34:21 +0100
- Subject: DOCBOOK: more customizing of the fo xsl stylesheets
- Organization: CAS Computer Abrechnungs Systeme GmbH
- Reply-to: "Tobias Grimm (CAS)" <Tobias dot Grimm at cas-soft dot de>
Hi!
Thanks to Bob and Stephan, separating sections and chapter
summarizations from the chapters title-page works quit good
(except of some bugs in FOP). Who ever wants to try this, I've
put a little example together. You will find it at the end of this
mail.
Now I want to do a little bit more customization, but don't have a
clue how to do it or if it is possible at all:
1. I want to have a big margin on the left (or better the outer) side
of the page separated by a vertical line from the text.
2. Adminition-graphics should be placed outside of the text in this
big margin.
3. Each chapter title page should have a big grey vertical rectangle
spanning the whole page height. (To make it easier finding chapters,
when printed out.)
I couldn't find any examples, doing such things. So I would appreciate
any suggestions or hints.
Tobias
Here's the complete example on how to get a toc on each chapters title
page and have a chapter summarization or the first section
starting on the next odd page:
docbook:
<book lang="en">
<bookinfo>
<title>Book Title</title>
</bookinfo>
<chapter>
<title>First Chapter</title>
<para role="summarization"> This is the chapter summarization.</para>
<sect1>
<title>Section A</title>
<para>This is a lot of text text text text text text</para>
</sect1>
</chapter>
<chapter>
<title>Second Chapter</title>
<para role="summarization"> This is the chapter summarization.</para>
<sect1>
<title>Section B</title>
<para>This is a lot of text text text text text text</para>
</sect1>
</chapter>
</book>
xsl customization:
<!-- forces page break before first child of chapter
first child should be <title>, otherwise it won't
work. i don't know why, but maybe someone can
explain? -->
<xsl:template match="chapter/*[1]">
<fo:block break-before="odd-page"/>
<xsl:apply-imports/>
</xsl:template>
<!-- generate toc for book and chapter -->
<xsl:param name="generate.toc">
book toc,title
book/chapter toc,title
</xsl:param>
<!-- chapter summarization in bigger italic font -->
<xsl:template match="para[@role='summarization']">
<fo:block font-size="14pt" font-style="italic">
<xsl:apply-templates/>
</fo:block>
</xsl:template>