Hi,
I'm not quite clear on this problem. You said:
- My book has parts and my first part falls on an odd page (left).
In my experience, odd pages are right-hand pages, so I don't understand what you mean
here.
I think you mean that your first part falls on a left-hand page, and you want it to be
numbered with "1", with the first right-hand page after that numbered as "2", and so
forth. Is that right?
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "Ivan Ristic" <[email protected]>
To: "Bob Stayton" <[email protected]>
Cc: <[email protected]>
Sent: Monday, March 01, 2010 3:56 AM
Subject: Re: [docbook-apps] Footer odd/even page problem when chapters do not begin on
an odd page
On Sat, Feb 27, 2010 at 12:29 AM, Bob Stayton <[email protected]> wrote:
Hi,
Hi Bob,
Many thanks for your help.
Did you customize the page-sequence-masters as well?
No, I did not -- my knowledge of the stylesheets is limited and I
didn't know what to try next.
With the customisation, per your advice, I managed to have chapters on
auto and the footers rendered correctly.
When I attempted to do the same for all book parts, however, I
encountered another problem:
- My book has parts and my first part falls on an odd page (left).
- The first part is just a single page, and the second page in the
book is the first page of the first chapter. It falls on an even page
(right).
- The initial.page.number template will return 1 for the first page of
the first part because it's the first page of the book (the front
matter uses roman numerals)
- The footer of the second page (even) will be rendered using the odd
layout. (And, from then on, all the pages will have the footer layouts
reversed.)
I hope that was clear, but I'll be happy to send you the PDF extract
or generate a standalone example that replicated the problem.
I've found that if I override the initial.page.number template to
return 'auto' for parts, the footers get rendered correctly (but the
numbering is not reset, of course).
It looks as if the assumption somewhere is that the first book page
will always be on an odd page. Is that correct?
The default in
fo/pagesetup.xsl for body page sequences uses:
<fo:page-sequence-master master-name="body">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="blank"
blank-or-not-blank="blank"/>
<fo:conditional-page-master-reference master-reference="body-first"
page-position="first"/>
<fo:conditional-page-master-reference master-reference="body-odd"
odd-or-even="odd"/>
<fo:conditional-page-master-reference
odd-or-even="even">
<xsl:attribute name="master-reference">
<xsl:choose>
<xsl:when test="$double.sided != 0">body-even</xsl:when>
<xsl:otherwise>body-odd</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</fo:conditional-page-master-reference>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
You should customize it to remove the reference to "body-first" when
page-position="first", because it will be applied to any first page,
regardless of page number.
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message ----- From: "Ivan Ristic" <[email protected]>
To: <[email protected]>
Sent: Wednesday, February 24, 2010 3:23 PM
Subject: [docbook-apps] Footer odd/even page problem when chapters do not
begin on an odd page
Hi everyone,
I have written a customisation layer for a book written in DocBook 5
and I've encountered one problem that I can't solve. I think the issue
is with the stylesheets. I am converting the book into PDF. I am using
the 1.74.0 ns stylesheets, but I've verified that the same problem
occurs with the latest version.
In my book I don't want the chapters to begin on odd pages, so I've
added the appropriate styling to avoid blank pages (as well as the
styling to fix the page numbering).
My book is double sided with asymmetric footers. On an odd page, the
page number is on the right. On an even page, the page number is on
the left.
However, when a chapter begins on an even page, the footer is
rendered as if it were on an odd page. After looking at the stylesheet
code, it seems to me that the problem is with the the "sequence"
parameter (to footer.content), which can contain "odd", "even" or
"first". The default stylesheet seems to assume an odd page when the
value is "first". Hence the problem.
Is there some other way to find out if a page number is odd?
Thanks.
--
Ivan Ristic
ModSecurity Handbook [https://www.feistyduck.com]
SSL Labs [https://www.ssllabs.com/ssldb/]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Ivan Ristic
ModSecurity Handbook [http://www.modsecurityhandbook.com]
SSL Labs [https://www.ssllabs.com/ssldb/]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]