Hi Dick,
I have run across this problem too, and so I finally looked it up. It seems this is a
feature of the XSL-FO specification. In section 5.3.2 "Margin, Space, and Indent
Properties" in the chapter titled "Property Refinement / Resolution", I find this
statement:
If the corresponding absolute margin property is not explicitly specified, or if the
corresponding relative
property is specified on the formatting object and the absolute property only
specified by the expansion
of a shorthand, the corresponding absolute margin property is calculated according to
the following
formulae:
margin-corresponding = start-indent - inherited_value_of(start-indent)
- padding-corresponding - border-corresponding-width
In other words, if you do not specify a margin property for a block with padding, it
assumes you want the text aligned with the text above it and so reduces that margin to
provide space for the border and padding so the text still lines up. Adding the
margin property is the right solution when you want the box to line up and the text to
be padded inside the box.
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net----- Original Message -----
From: "Richard Hamilton" <
hamilton@xmlpress.net>
To: "docbook-apps mailing list" <
docbook-apps@lists.oasis-open.org>
Sent: Thursday, May 10, 2012 6:23 PM
Subject: [docbook-apps] Padding on admonitions (fo stylesheets)
I just ran into something curious with the 1.76.1 ns stylesheets (also using RenderX).
I'm trying to create an admonition style that has a shaded background with the text
inside surrounded by 8pts of padding.
To do that, I did nothing to any of the xsl, I just set padding="8pts" and
background-color="#E0E0E0" in the admonition.properties attribute set.
That works, but the outside bounds of the admonition now extend 8pts beyond the
outside margin. If I set the padding to 0pts, the text stays the same, but the
background shrinks to the size of the text.
I thought padding was defined as it is for table cells, that is the space between the
boundary of the box and the contents. I would expect, of course, that this would
potentially cause the box to expand vertically (at least in western text), but not
horizontally, and not outside the text margin.
Am I misinterpreting the meaning of padding, or is there a potential bug here?
BTW, I "fixed" the problem by setting margin="0pts" but that seems to be somehow
wrong:-).
Can anyone shed any light on this?
Thanks,
Dick Hamilton
-------
XML Press
XML for Technical Communicators
http://xmlpress.nethamilton@xmlpress.net---------------------------------------------------------------------
To unsubscribe, e-mail:
docbook-apps-unsubscribe@lists.oasis-open.orgFor additional commands, e-mail:
docbook-apps-help@lists.oasis-open.org