Re: [xep-support] Marginalia as a DocBook customisation

From: Paul A. Hoadley (paulh@logicsquad.net)
Date: Thu May 06 2004 - 02:39:56 PDT

  • Next message: Chen, Cindy (C)(STP): "RE: [xep-support] Another image scaling question"

    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@logicsquad.net
    
    

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html




    This archive was generated by hypermail 2.1.5 : Thu May 06 2004 - 02:52:04 PDT