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] Formatting different items


Hi Pontus,

I think I can answer at least three of your questions:

> 2. I would like increased space before and after a titled figure or
> any other formal object. I have tried all sorts of xsl stuff in my
> customizationfile without success.

There's an attribute set named formal.object.properties [1]. Just define the space before and the space after like this:

<xsl:attribute-set name="formal.object.properties">
 <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
 <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
 <xsl:attribute name="space-before.maximum">2em</xsl:attribute>
 <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
 <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
 <xsl:attribute name="space-after.maximum">2em</xsl:attribute>
</xsl:attribute-set>


3. I would like figure titles to be non-bolded.


This can be done by using the formal.title.properties attribute set [2]. Here's a snippet from my customisation layer which


  - sets a special font for formal titles (ScalaSans-Bold)
  - defines font size
  - switches off hyphenation
  - defines space before and after the formal title

<xsl:attribute-set name="formal.title.properties"
                   use-attribute-sets="normal.para.spacing">
  <xsl:attribute name="font-family">ScalaSans-Bold</xsl:attribute>
  <xsl:attribute name="font-size">9pt</xsl:attribute>
  <xsl:attribute name="hyphenate">false</xsl:attribute>
  <xsl:attribute name="space-before.minimum">0pt</xsl:attribute>
  <xsl:attribute name="space-before.optimum">0pt</xsl:attribute>
  <xsl:attribute name="space-before.maximum">0pt</xsl:attribute>
  <xsl:attribute name="space-after.minimum">8.5pt</xsl:attribute>
  <xsl:attribute name="space-after.optimum">9pt</xsl:attribute>
  <xsl:attribute name="space-after.maximum">9.5pt</xsl:attribute>
</xsl:attribute-set>

Simply change "ScalSans-Bold" to the name of the font you want to use.

Another way of achieving this is to set

<xsl:attribute name="font-weight">normal</xsl:attribute>

in the above attribute set. It depends on the font(s) you use.



4. I would like the crossreferences to be written as "Chapter: Foo" instead
of "Chapter, Foo".


This can be done by changeing the generated text for this purpose [3]. Here's another snippet from my customisation layer which may get you started:


<l:context name="xref-number-and-title">
 <l:template name="sect1" style="long" text="Chapter %n %t on page %p"/>
 <l:template name="sect2" style="long" text="Chapter %n %t on page %p"/>
 <l:template name="sect3" style="long" text="Chapter %n %t on page %p"/>

 <l:template name="sect1" style="short" text="Chapter %n"/>
 <l:template name="sect2" style="short" text="Chapter %n"/>
 <l:template name="sect3" style="short" text="Chapter %n"/>
</l:context>

As you can see there are two different styles defined. Using "<xref linkend="some_target" xrefstyle="imperia"> results in "Chapter 1.2.3 <chapter title here> on page 123" in my document. Using "<xref linkend="some_target" xrefstyle="short"> gives me "Chapter 1.2.3".without title or page number. You can define as many styles as you like. You can name these styles (style="your-name") whatever you like, of course.


HTH Thomas Gier Technical Writer

Aachen / Germany

[1]
http://docbook.sourceforge.net/release/xsl/current/doc/fo/formal.object.properties.html

[2] http://docbook.sourceforge.net/release/xsl/current/doc/fo/formal.title.properties.html

[3]
http://www.sagehill.net/docbookxsl/CustomXrefs.html

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


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