[xep-support] Marginalia as a DocBook customisation
Paul A. Hoadley
paulh at logicsquad.net
Thu May 6 02:39:56 PDT 2004
On Thu, May 06, 2004 at 05:18:17PM +0930, Paul A. Hoadley wrote:
> On Wed, May 05, 2004 at 11:50:57PM -0700, Bob Stayton wrote:
>
> > The DocBook XSL page masters are not set up to provide extra
> > margin space on the "outside". The current design of indented body
> > text is strictly space-on-the-left only. So rewriting the page
> > masters would be the first step to enabling outside floats, so
> > that you have somewhere to put the float.
>
> Thanks Bob. I'll give it a shot.
(I'm happy to move this to docbook-apps if readers would prefer, but
this is using several XEP extensions.)
Here's my first shot. This is in the 'user.pagemasters' template (I'm
pasting in more than I need for this problem, as it's already
customised to put some static content in region-start and region-end,
so some of the changes from the stock stylesheets are due to that):
---
<fo:simple-page-master master-name="body-first-cms"
page-width="{$page.width}"
page-height="{$page.height}"
margin-top="{$page.margin.top}"
margin-bottom="{$page.margin.bottom}"
margin-left="0pt"
margin-right="0pt">
<fo:region-body margin-bottom="{$body.margin.bottom}"
margin-top="{$body.margin.top}"
column-gap="{$column.gap.body}"
column-count="{$column.count.body}"
padding-left="{$page.margin.inner}"
margin-right="{$page.margin.outer}">
</fo:region-body>
<fo:region-before region-name="xsl-region-before-first"
extent="{$region.before.extent}"
display-align="before"
padding-left="{$page.margin.inner}"/>
<fo:region-after region-name="xsl-region-after-first"
extent="{$region.after.extent}"
display-align="after"
padding-left="{$page.margin.inner}"/>
<fo:region-start region-name="xsl-region-start-first"
extent="0pt"/>
<fo:region-end region-name="xsl-region-end-first"
extent="{$page.margin.outer}"/>
</fo:simple-page-master>
---
I want the notes to float on the inside, so I've made margin-left on
body-first-cms 0pt. (Once I've got body-first going, the other page
types should follow easily.) margin-right is 0pt because of my custom
region-end. I've then added the padding-left in region-body (and
region-before and region-after) to allow for the zero margin. These
changes don't seem to have introduced any problems. Running some
DocBook source through this produces a PDF indistinguishable (AFAICS)
from the normal stylesheets.
My note template is not quite right:
---
<xsl:template match="note[@role='marginalia']">
<fo:float float="inside"
clear="both">
<fo:block-container width="20mm" start-indent="-25mm">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:block-container>
</fo:float>
</xsl:template>
---
I will admit that I have reached the current limit of my FO
expertise---I was really just cutting, pasting and guessing with the
start-indent there. That certainly gets a note in the inner margin of
the first page, but the left margin is way off the left edge of the
page. I can't specify the margin-left, because this block will be on
a different side depending on the page number. (Maybe I _should_ move
this to docbook-apps, as it's probably difficult to help me without
knowing the DocBook stylesheets.)
--
Paul.
mailto:paulh at logicsquad.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20040506/5be00ee6/attachment.bin>
More information about the Xep-support
mailing list