docbook-apps

  • 1.  customising header/footer

    Posted 11-06-2016 09:04
    Hi all,

    I am trying to customise Docbook PDF output, and have a problem with
    headers/footers. I want the section title and page number in the outer
    part of the header (ie right on recto, left on verso) and footer empty.

    The problem is that I get this on all pages, including the first one,
    which I am trying explicitly to disallow.

    Am using the following templates:

    |<xsl:template name="header.content">
    | <xsl:param name="pageclass" select="''"/>
    | <xsl:param name="sequence" select="''"/>
    | <xsl:param name="position" select="''"/>
    | <xsl:message><xsl:value-of select="$sequence"/></xsl:message>
    | <fo:block>
    | <xsl:if test="$sequence != 'first'">
    | <xsl:message> yes</xsl:message>
    | <xsl:choose>
    | <xsl:when test="$sequence = 'even' and $position='left'">
    | <fo:page-number/>
    | <fo:leader leader-length="1em"/>
    | <fo:retrieve-marker retrieve-class-name="section.head.marker"
    |
    retrieve-position="first-including-carryover"/>
    | </xsl:when>
    | <xsl:when test="$sequence = 'odd' and $position='right'">
    | <fo:retrieve-marker retrieve-class-name="section.head.marker"
    |
    retrieve-position="first-including-carryover"/>
    | <fo:leader leader-length="1em"/>
    | <fo:page-number/>
    | </xsl:when>
    | </xsl:choose>
    | </xsl:if>
    | </fo:block>
    |</xsl:template>
    |
    |<xsl:template name="footer.content"/>

    and get this screen output from xsltproc:

    first
    first
    first
    odd
    yes
    odd
    yes
    odd
    yes
    even
    yes
    even
    yes
    even
    yes
    blank
    yes
    blank
    yes
    blank
    yes

    The document has four pages, with headers on all four. The messages
    clearly seem to suggest that the header is not created for the `first'
    page by this template, so where does it come from?

    Any help appreciated.

    /Tomas



  • 2.  Re: [docbook-apps] customising header/footer

    Posted 11-13-2016 22:34
    Hi Tomas,
    I'm not able to duplicate this problem. When I copied your
    header.content template into an otherwise empty customization layer and
    processed an article, the header on the first page is blank.

    The header.content template is called each time a page sequence is being
    set up, in the static content before the pages are generated. It won't
    generate any messages as the pages are generated. You might see your
    output if you are using a custom page-sequence-master that does not
    actually call the 'first' value for any page. Without seeing more of
    your customization, I can't say more.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 11/6/2016 1:04 AM, Tomas By wrote:
    > Hi all,
    >
    > I am trying to customise Docbook PDF output, and have a problem with
    > headers/footers. I want the section title and page number in the outer
    > part of the header (ie right on recto, left on verso) and footer empty.
    >
    > The problem is that I get this on all pages, including the first one,
    > which I am trying explicitly to disallow.
    >
    > Am using the following templates:
    >
    > |<xsl:template name="header.content">
    > | <xsl:param name="pageclass" select="''"/>
    > | <xsl:param name="sequence" select="''"/>
    > | <xsl:param name="position" select="''"/>
    > | <xsl:message><xsl:value-of select="$sequence"/></xsl:message>
    > | <fo:block>
    > | <xsl:if test="$sequence != 'first'">
    > | <xsl:message> yes</xsl:message>
    > | <xsl:choose>
    > | <xsl:when test="$sequence = 'even' and $position='left'">
    > | <fo:page-number/>
    > | <fo:leader leader-length="1em"/>
    > | <fo:retrieve-marker retrieve-class-name="section.head.marker"
    > |
    > retrieve-position="first-including-carryover"/>
    > | </xsl:when>
    > | <xsl:when test="$sequence = 'odd' and $position='right'">
    > | <fo:retrieve-marker retrieve-class-name="section.head.marker"
    > |
    > retrieve-position="first-including-carryover"/>
    > | <fo:leader leader-length="1em"/>
    > | <fo:page-number/>
    > | </xsl:when>
    > | </xsl:choose>
    > | </xsl:if>
    > | </fo:block>
    > |</xsl:template>
    > |
    > |<xsl:template name="footer.content"/>
    >
    > and get this screen output from xsltproc:
    >
    > first
    > first
    > first
    > odd
    > yes
    > odd
    > yes
    > odd
    > yes
    > even
    > yes
    > even
    > yes
    > even
    > yes
    > blank
    > yes
    > blank
    > yes
    > blank
    > yes
    >
    > The document has four pages, with headers on all four. The messages
    > clearly seem to suggest that the header is not created for the `first'
    > page by this template, so where does it come from?
    >
    > Any help appreciated.
    >
    > /Tomas
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >



  • 3.  Re: [docbook-apps] customising header/footer

    Posted 11-14-2016 06:08
    Hi Bob,

    Yes, there seem to be one of those custom page sequence thingies:

    |<xsl:variable name="master-reference">
    | <xsl:call-template name="select.pagemaster"/>
    | </xsl:variable>
    | <fo:page-sequence hyphenate="{$hyphenate}"
    | master-reference="{$master-reference}">

    This is from code I just copied (from this list) to remove all the page
    breaks everywhere.

    Any idea what I need to do to get the first page treated separately?

    /Tomas



    On 2016-11-13 23:33, Bob Stayton wrote:
    > Hi Tomas,
    > I'm not able to duplicate this problem. When I copied your
    > header.content template into an otherwise empty customization layer
    > and processed an article, the header on the first page is blank.
    >
    > The header.content template is called each time a page sequence is
    > being set up, in the static content before the pages are generated.
    > It won't generate any messages as the pages are generated. You might
    > see your output if you are using a custom page-sequence-master that
    > does not actually call the 'first' value for any page. Without seeing
    > more of your customization, I can't say more.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    > On 11/6/2016 1:04 AM, Tomas By wrote:
    >> Hi all,
    >>
    >> I am trying to customise Docbook PDF output, and have a problem with
    >> headers/footers. I want the section title and page number in the outer
    >> part of the header (ie right on recto, left on verso) and footer
    >> empty.
    >>
    >> The problem is that I get this on all pages, including the first one,
    >> which I am trying explicitly to disallow.
    >>
    >> Am using the following templates:
    >>
    >> |<xsl:template name="header.content">
    >> | <xsl:param name="pageclass" select="''"/>
    >> | <xsl:param name="sequence" select="''"/>
    >> | <xsl:param name="position" select="''"/>
    >> | <xsl:message><xsl:value-of select="$sequence"/></xsl:message>
    >> | <fo:block>
    >> | <xsl:if test="$sequence != 'first'">
    >> | <xsl:message> yes</xsl:message>
    >> | <xsl:choose>
    >> | <xsl:when test="$sequence = 'even' and $position='left'">
    >> | <fo:page-number/>
    >> | <fo:leader leader-length="1em"/>
    >> | <fo:retrieve-marker
    >> retrieve-class-name="section.head.marker"
    >> |
    >> retrieve-position="first-including-carryover"/>
    >> | </xsl:when>
    >> | <xsl:when test="$sequence = 'odd' and $position='right'">
    >> | <fo:retrieve-marker
    >> retrieve-class-name="section.head.marker"
    >> |
    >> retrieve-position="first-including-carryover"/>
    >> | <fo:leader leader-length="1em"/>
    >> | <fo:page-number/>
    >> | </xsl:when>
    >> | </xsl:choose>
    >> | </xsl:if>
    >> | </fo:block>
    >> |</xsl:template>
    >> |
    >> |<xsl:template name="footer.content"/>
    >>
    >> and get this screen output from xsltproc:
    >>
    >> first
    >> first
    >> first
    >> odd
    >> yes
    >> odd
    >> yes
    >> odd
    >> yes
    >> even
    >> yes
    >> even
    >> yes
    >> even
    >> yes
    >> blank
    >> yes
    >> blank
    >> yes
    >> blank
    >> yes
    >>
    >> The document has four pages, with headers on all four. The messages
    >> clearly seem to suggest that the header is not created for the `first'
    >> page by this template, so where does it come from?
    >>
    >> Any help appreciated.
    >>
    >> /Tomas
    >>
    >> ---------------------------------------------------------------------
    >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> For additional commands, e-mail:
    >> docbook-apps-help@lists.oasis-open.org
    >>
    >>
    >>
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org