docbook-apps

Re: [docbook-apps] Conceptual problem formatting

  • 1.  Re: [docbook-apps] Conceptual problem formatting

    Posted 11-01-2010 19:18

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Chris Ridd" <chrisridd@mac.com>
    To: "Bob Stayton" <bobs@sagehill.net>
    Cc: <docbook-apps@lists.oasis-open.org>
    Sent: Monday, November 01, 2010 10:41 AM
    Subject: Re: [docbook-apps] Conceptual problem formatting <preface> material


    >
    > On 1 Nov 2010, at 16:49, Bob Stayton wrote:
    >
    >> Hi Chris,
    >> I've done similar books like this using preface elements with role attributes, and
    >> then customizing the book template to output them in the order you want. The
    >> titlepage template system is not really appropriate for that kind of extended
    >> information.
    >
    > Right, thanks for helping me avoid that particular blind alley :-)
    >
    >> For each special preface, I add a template with match="preface[@role =
    >> 'something']" to handle its formatting, and then add the following to the book
    >> template to apply it:
    >>
    >> <xsl:apply-templates select="preface[@role = 'something']"/>
    >>
    >> That way if a book instance does not have such a preface, this step is just
    >> skipped.
    >>
    >> You'll also want to add an empty template in normal mode to prevent the preface
    >> element from being processed again in book order:
    >>
    >> <xsl:template match="preface[@role = 'something']"/>
    >
    > I'm confused now. Firstly I've got one <preface> with several sections, not multiple
    > <preface>s. (Though we're amenable to creating multiple <preface>s if it makes
    > things easier. It isn't /quite/ separating content from presentation though :-)
    >
    > But I'm mostly confused about your contradictory suggestions in the 1st and last
    > lines! ie
    >
    > add a template with match="preface[@role='something']" to format it
    > add an empty template with match="preface[@role='something']"
    >
    > Ah - there's a mode parameter?
    >
    >> You'll need to decide which of these have their own fo:page-sequence, and call the
    >> template name 'page.sequence' with that as content.
    >>
    >> And you'll need to customize the templates named 'page.number.format' and
    >> 'initial.page.number' to get the right page numbering scheme.
    >>
    >> The trickiest part in this design is getting the copyright and "Contacting"
    >> information on the same page. The copyright info is normally processed in the
    >> titlepage page-sequence. For that case, I would customize the template named
    >> 'book.titlepage.verso' to apply templates to that preface element, and leave that
    >> one out of the book template.
    >
    > I'm away from my stylesheets ATM, but will look at that tomorrow. I've already
    > managed to remove the copyright stuff from my titlepage, and I *think* I've removed
    > the preface from my book template, so I'm part the way there. The dratted preface
    > still appears in my TOC, so some butchery is still needed...
    >
    > Cheers,
    >
    > Chris
    >
    >