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] font-size for simplelist ?


Hi Mathieu,

On Thu, 30 Aug 2012 15:47:22 +0200
Mathieu Malaterre <mathieu.malaterre@gmail.com> wrote:

> Hi there,
> 
>   Does anyone knows how to change the font size of all element in a
> simplelist ? I tried a naive approach:
> 
> <xsl:attribute-set name="simplelist.properties">
>   <xsl:attribute name="font-size">
>     <xsl:choose>
>       <xsl:when test="@role= 'small">10pt</xsl:when>
>       <xsl:otherwise>inherit</xsl:otherwise>
>     </xsl:choose>
> </xsl:attribute>
> </xsl:attribute-set>
> 
> with no luck.

A simplelist is not always that simple despite its name. It can be
formatted inline, horizontal, or vertical. See the type attribute in the
TDG[1]. By default, it's vertical.

A simplelist can hold only member elements. So I guess, the simplest
way would be to customize the member template. That way you avoid all
the complexities of the simplelist templates.

Here is the original member template:

 <xsl:template match="member">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
       <xsl:apply-templates/>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>

If you want to change its font size, introduce a fo:block and set the
font-size attribute:

 <xsl:template match="member">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
       <fo:block font-size="10pt">
         <xsl:apply-templates/>
       </fo:block>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>

Even better, define a parameter (let's say member.fontsize) and
use it in the fo:block as follows:

    <fo:block font-size="{$member.fontsize}">
      <xsl:apply-templates/>
    </fo:block>

Regardless of the above two methods, the font-size is inherited and
propagates to other block elements. However, if some other child sets
its own font size, that will overwrite the above value. As most (all?)
of the elements allowed in member are inline elements, this seems not
very likely. Of course, you should check that with your customization.

The above modification should apply for horizontal and vertical
simplelists, but not for inline. I haven't tested it, let's hope
it works as advertised. :) 

Hope that helps.


----------
[1] http://www.docbook.org/tdg/en/html/simplelist.html

-- 
Gruß/Regards,
    Thomas Schraitle


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]