[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Modifying Chapter Title Format
You should take a look at the template named 'component.title' in fo/component.xsl. The titlepage.templates.xml specification file specifies that this template should be used to process chapter and other component titles. I would suggest you change titlepage.templates.xml to call a new template such as 'chapter.title' instead of component.title, and add the 'chapter.title' named template to your customization layer. It needs to generate three fo:blocks stacked one after another for 'Chapter', '5', and the title, and with the text-align="right" property set. You can add any other attributes you feel necessary to format the title as well. Inside each fo:block template, you call templates to generate the text for that block. To generate the word 'Chapter', you want to call the template named 'gentext' with a parameter named 'key' whose value is the string 'chapter'. That will look up the generated text label in the right language. <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'chapter'"/> </xsl:call-template> To generate the chapter number, use apply-templates with mode="label.mode" <xsl:apply-templates select="." mode="label.markup"/> To generate the chapter title, use: <xsl:apply-templates select="." mode="title.markup"/> Hope this helps. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Ben Rockwood" <benr@cuddletech.com> To: <docbook@lists.oasis-open.org> Sent: Tuesday, February 24, 2004 3:03 AM Subject: [docbook] Modifying Chapter Title Format > Hello. > > I'm sorry if this question has come up before, but I don't see any > mention of it and guides like the DB.org Wiki, Documentation, various > faq's, and even Bob's excellent XSL book haven't helped me get my fingers > around this completely yet. > > I'd like to figure out how to completely restructure chapter title > layout. More so than just removing the "Chapter 5:" the default "Chapter > 5: My Chapter" as is stated in most guides. I'd like to get really nice > pretty chapter titles like you'd see in an O'Reilly book, ie: > ---------------- > | Chapter | > | 5 | > | My Title | > | -------- | > ~~~~~~~~~~~~~~~~ > > It seems however that I need to modify the FO layout directly which I > think Bob's book eludes to being a table. I've poked around in the > XSL distribution but I'm lost and guessing. Is there anything out > there that addresses this problem for FO directly? Several tutorials > address things like this but do so using HTML XSL; the FO combined > with the XSL/XSLT/XML/Xinclude/Xconfusing is making my head spin. > > Thank You. > > benr. > > To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/. > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]