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] orphans and widows


Jacques,
You could use processing instructions in your customization layer and to
put blocks around the paras you want to control:

In this example, the whole para is kept together:

<para><?bjfo keep-together?>Blah
<informalfigure><!-- stuff --></informalfigure>
</para>

Or 

<para><?bjfo keep-with-next?>Blah</para>
<informalfigure><!-- stuff --></informalfigure>


Put something like this in your customization layer (your custom
stylesheet that imports the stock docbook stylesheets)
<http://www.sagehill.net/docbookxsl/CustomMethods.html>. Each of these
templates matches any element containing the processing instruction
specified. It then wraps that element in a fo:block and applies the
imported templates to the element. If you don't like pis, you could
match based on some attribute value instead. This technique means you
don't have to touch the stock docbook stylesheets at all.

  <xsl:template match="*[processing-instruction('bjfo') =
'keep-together']">
	<fo:block keep-together.within-column="always">
	  <xsl:apply-imports/>
	</fo:block>
  </xsl:template>

  <xsl:template	match="*[./processing-instruction('bjfo') =
'keep-with-next']">
	<fo:block keep-with-next.within-column="always">
	  <xsl:apply-imports/>
	</fo:block>
  </xsl:template>

  <xsl:template	match="*[./processing-instruction('bjfo') =
'keep-with-previous']">
	<fo:block keep-with-previous.within-column="always">
	  <xsl:apply-imports/>
	</fo:block>
  </xsl:template>

If you do it this way, you have to be careful not to do something like:
<listitem><?bjfo keep-with-next?>... because that would result in
invalid fo (if you're not lazy like me, you could improve your templates
to deal with that situation). If you are lazy like me, do
<listitem><para><?bjfo keep-with-next?> in your docbook and the above
templates will work.

Hope that helps,
David

> -----Original Message-----
> From: Alexander Peshkov [mailto:peshkov@renderx.com]
> Sent: Wednesday, October 26, 2005 3:27 AM
> To: Jacques Foucry
> Cc: docbook-apps
> Subject: Re: [docbook-apps] orphans and widows
> 
> Hello Jacques,
> 
> From XSL-FO point of view what you need is keep-with-next.within-
> page="always"
> property specified on the paragraph (fo:block) that holds "next
> picture" description - this will glue the paragraphs' tail to the
> picture, though the paragraph will remain breakable and could be
> divided by a page break with respect to orphans/widows properties. If
> you want such paragraph to became unbreakable you should add another
> keep property to this paragraph: keep-together.within-page="always" -
> being specified together these 'keep' properties will attach picture
> description text to the respective picture and make sure that it will
> be transferred to the next page as a whole.
> 
> I hope that someone on this list who is more of a Docbook expert will
> suggest you the best way to make appropriate customizations in the
> stylesheests.
> 
> Best regards,
> Alexander Peshkov
mailto:peshkov@renderx.com
> RenderX
> 
> 
> JF> Hello.
> 
> JF> In my document, I have a lot of screenshot pictures (It's a
manual).
> 
> JF> Sometime (really often in fact) I have as PDF result something
like
> JF> that :
> 
> JF> --------------------------------------------
> JF> some interesting text...
> 
> JF> Picture
> 
> JF> Some other test which explain the next picture
> JF> <big space but to small to put the next picture>
> JF> <generated page break>
> JF> Picture
> 
> JF> other text
> 
> JF> -----------------------------------------
> 
> JF> And I would like to have
> 
> JF> --------------------------------------------
> JF> some interesting text...
> 
> JF> Picture
> 
> 
> JF> <big space>
> JF> <generated page break>
> JF> Some other test which explain the next picture
> JF> Picture
> 
> JF> other text
> 
> JF> -----------------------------------------
> 
> JF> I've put in my custom stylesheet an orphan and widows
attribute-set :
> 
> JF>      <xsl:attribute-set name="root.properties">
> JF>          <xsl:attribute name="widows">4</xsl:attribute>
> JF>          <xsl:attribute name="orphans">4</xsl:attribute>
> JF>      </xsl:attribute-set>
> 
> JF> But with no result. I kown that FOP doesn't implement this
feature,
> JF> but I use XEP (who does).
> 
> JF> So the question is : how can I have the good result ?
> 
> JF> Thanks in advance.
> JF> Jacques
> 
> JF>
---------------------------------------------------------------------
> JF> To unsubscribe, e-mail:
docbook-apps-unsubscribe@lists.oasis-open.org
> JF> 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]