Sent: Friday, March 02, 2012 1:16
AM
Subject: Re: [docbook-apps] adding a
footer only to last page
Hi Bob,
I can't get this working and have no idea what I'm doing wrong.
My customization layer contains the following:
<xsl:param name="footer.rule"
select="0"></xsl:param>
<xsl:attribute-set name="footer.content.properties">
<xsl:attribute
name="background-color">red</xsl:attribute>
</xsl:attribute-set>
<xsl:template name="footer.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<fo:block>
<xsl:choose>
<xsl:when test="$double.sided = 0 and
$position='left' and self::d:article and $sequence = 'last'">
</xsl:when>
<xsl:otherwise>
<!-- nop -->
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
When I apply this do a book with several articles, i.e.:
version="5.0">
<info>
<title>Media Access Proxy™</title>
</info>
<article xml:id="a1">
...
</article>
<article xml:id="a2">
...
</article>
</book>
I would like to see (in a PDF file) the '
www.foo.com' text at the left bottom of the page on the
red background twice (i.e. at the end of each article). But I see a box
with the red background on all pages and the text never appears.
Thanks for your help.
Robert
On Thu, Mar 1, 2012 at 6:57 PM, Bob Stayton
<bobs@sagehill.net> wrote:
Hi Robert,
The general instructions for customizing
headers and footers can be found here:
The footer.content template is a big xsl:choose
statement that sets conditions for which pages have which output.
In your case, each article generates a page-sequence, so that is the
context when the template is called. The xsl:when statement might look
something like this:
<xsl:when test="self::d:article and ($sequence
= 'last' or $sequence = 'blank')">
You would need the 'blank' condition if you are
doing double-sided output that may generate a blank page as the
last page at the end of an article.
----- Original Message -----
Sent: Thursday, March 01, 2012
3:21 AM
Subject: Re: [docbook-apps]
adding a footer only to last page
To simplify the problem. Let's only consider the case
when there is a book with a number of articles, and the footer must
only be added to the last page of each article.
On Thu, Mar 1, 2012 at 10:57 AM, robert
<rp.info@gmail.com> wrote:
Hi All,
I have two
somehow similar problems. Both relate to printed
output.
1. I have a book with a number of
articles and want to have a footer
only on the last
page of each article and the last page of the
whole
book.
2. Similarly, I have a
set of books, and want to have a footer only on
the
last page of each book.
Have can I do
it?
Thanks,
Robert