OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Weird appendix title indent in PDF


Well, my research located this document on the Antenna House website:

http://www.antennahouse.com/support/qa/QA/2005031801.html

that says that when start-indent and margin-left are specified on the same element, then start-indent is ignored. The logic is pretty convoluted as described in the XSL-FO spec. But it seems that AH and FOP 1 respect that rule, but XEP does not.

In this case, the fo:block for appendix title has both properties, but the start-indent is ignored in FOP because of the margin-left="0pt". Instead, it inherits the start-indent="4pc" from the fo:flow element, and then sets its zero margin relative to that indent.

So the solution is to remove the margin-left property from the attribute-set for article/appendix/title, which I will do in SVN for the next release. It isn't needed there because the default value is zero.

Unfortunately, this is more difficult in a customization. Once an attribute is in an attribute-set, its value can be changed but the attribute cannot be removed in a customization.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Bob Stayton" <bobs@sagehill.net>
Sent: Thursday, January 31, 2013 10:00 AM
To: "Ryan Nowakowski" <ryan.nowakowski@gmail.com>; <docbook-apps@lists.oasis-open.org>
Subject: Re: [docbook-apps] Weird appendix title indent in PDF

Hi Ryan,
This is a strange one, actually. When I examine the FO output, both the section title and the appendix title (and the TOC title for that matter) all have fo:block elements with start-indent="0pt" and margin-left="0pt", which should put the titles at the left margin. When I process the file with RenderX XEP, that is what I get.

So at first I thought it was a bug in FOP, but I also tried Antenna House XSL Formatter, and that showed the same behavior as FOP. So now it seems there are two ways of interpreting the same FO file.

The body indent comes from a start-indent="4pc" on the fo:flow element that contains the page content. An fo:flow does not generate any areas, so putting that start-indent property there just ensures it is inherited by all descendant fo:blocks, *except* those that set their own start-indent. Since both the section title and the appendix title set the same property, I don't understand why they format differently.

I'm going to investigate this one some more. As a workaround, you can use this:

<xsl:attribute-set name="article.appendix.title.properties">
 <xsl:attribute name="margin-left">-4pc</xsl:attribute>
</xsl:attribute-set>

(or if you set the $body.start.indent parameter, set it to the negative of that value).

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Ryan Nowakowski" <ryan.nowakowski@gmail.com>
Sent: Thursday, January 31, 2013 7:18 AM
To: <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] Weird appendix title indent in PDF

When I generate PDF from this document:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
]>

<article>
  <section>
<title>A Section</title>
<para>This is some section text.</para>
  </section>

  <appendix>
<title>An Appendix</title>
<para>This is some appendix text.</para>
  </appendix>
</article>

...the appendix title is indented to the right(see attached PDF).
I would expect it to line up with the section title.  The titles line
up in HTML just fine.

Here's my toolchain:
xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl test.dbk > test.fo
fop -fo test.fo -pdf test.pdf

Here are the versions of docbook and toolchain:
docbook-xml: 4.5
docbook-xsl: 1.76.1
xsltproc: 1.1.26
fop: 1.0

Is this a bug in the stylesheets or in fop maybe?

Thanks!

Ryan





---------------------------------------------------------------------
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





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]