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] reducing font sizes for a chapter in a book

I use a simpler method that just uses a font-size attribute. A bit more crude, but it works for me. You could expand this to cover paras in chapters with that attribute. That would make sure that the titles for the chapter still looked like the same as others.
The downside of this code is that you have to do it for each para.
<!-- Change the font size of the block or para -->
<xsl:template match="para[@font-size]">
    <fo:block font-size="{@font-size}">
Dean Nelson
In a message dated 6/1/2012 9:39:48 P.M. Pacific Daylight Time, jpowanda@vocera.com writes:

I’ve got a book that I need to output to 2 different page formats, a larger size (7.5x9) for online viewing and a smaller size (4.125x6) for print, so I’ve got a separate stylesheet for each book even though both books contain the same XML content.


For the printed book, I’d like to keep the page count under 300 pages. Consequently, I’ve decided to reduce the fonts of two chapters of the book (which contain specifications, regulatory info, etc.). I did this by adding a custom attribute called “reducefont” to many elements, and then I process those elements whose reducefont attribute is set to “yes”, thus reducing the font size by 60%:


<xsl:template match="d:para">

  <fo:block xsl:use-attribute-sets="normal.para.spacing">

    <xsl:if test="@reducefont and (@reducefont = 'yes')">

      <xsl:attribute name="font-size">

        <xsl:value-of select="$body.font.master * .6"/>




    <xsl:call-template name="anchor"/>





This works, but it seems like a hack. Is there a simpler way to resize the fonts in these two chapters?



Jeff Powanda

Vocera Communications, Inc.

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