This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] help using DocBook stylesheets to produce pdf


On Wed, Aug 06, 2003 at 09:33:45AM +1000, Mark Hazell wrote:
> Hi, I'm hoping for any helpful advice about using DocBook stylesheets to
> produce pdf:
> 
> * I want to add "padding" to my images.  I tried specifying the viewport
> (i.e. depth="8cm" contentdepth="4cm") but was unsuccessful.  Is this because
> FOP 02.05 does not work? It is also not the most effective way considering
> my screenshots are of varying sizes.

The current FOP does not respond to the FO properties
content-width and content-height, which is what the viewport
attributes output in the FO file.  

If you are putting the images inside <figure> elements, you 
can adjust a named attribute-set that controls space above and
below figures.  You can do this in a customization layer.

<xsl:attribute-set name="figure.properties">
  <xsl:attribute name="space-before.minimum">1.5cm</xsl:attribute>
  <xsl:attribute name="space-before.optimum">2cm</xsl:attribute>
  <xsl:attribute name="space-before.maximum">3em</xsl:attribute>
  <xsl:attribute name="space-after.minimum">1.5cm</xsl:attribute>
  <xsl:attribute name="space-after.optimum">2cm</xsl:attribute>
  <xsl:attribute name="space-after.maximum">3cm</xsl:attribute>
</xsl:attribute-set>

If you aren't using figure (with titles), you could wrap
your mediaobject in <informalfigure> and customize its
template a bit:

Change:

<xsl:template match="informalfigure">
  <xsl:call-template name="informal.object"/>
</xsl:template>

To:

<xsl:template match="informalfigure">
    <fo:block>
       <xsl:attribute name="space-before.minimum">1.5cm</xsl:attribute>
       <xsl:attribute name="space-before.optimum">2cm</xsl:attribute>
       <xsl:attribute name="space-before.maximum">3em</xsl:attribute>
       <xsl:attribute name="space-after.minimum">1.5cm</xsl:attribute>
       <xsl:attribute name="space-after.optimum">2cm</xsl:attribute>
       <xsl:attribute name="space-after.maximum">3cm</xsl:attribute>

       <xsl:call-template name="informal.object"/>
   </fo:block>
</xsl:template>
> 
> * I was also hoping for some pointers to change section title font color 

Another attribute-set handles section title properties:

<xsl:attribute-set name="section.title.properties">
  <xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>

There are also attribute sets for each section title level.
See this reference for more on attribute-sets:
http://www.sagehill.net/docbookxsl/AttributeSets.html

> and a way to prevent section titles from appearing at the bottom of the page.

FOP doesn't handle keep-with-next properly, so there is no general
solution for this.  Some people have resorted to inserting manual
page break processing instructions before such sections
when the document is finished. See:

http://sources.redhat.com/ml/docbook-apps/2003-q2/msg00848.html

Such manual page breaks must be removed or shifted when
the document is edited.  It's a tedious process, because
each manual break will affect pagination downstream
from it.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]