Next in thread → Next in month →

Re: [docbook-apps] Font color

From
Richard Hamilton <>
Date
2012-02-10T02:16:00+00:00
ID
Thread
Re: [docbook-apps] Font color
Hi Benjamin,

It's actually not that hard, as long as you already have a customization for other things. If you have, then you could add the following to your customization. For example, if you want red text:

  <xsl:template match="d:phrase[@role='red']">
    <fo:inline color="red">
      <xsl:apply-templates/>
    </fo:inline>
  </xsl:template>

That will put text surrounded by <phrase role="red">here's some text you want in red</phrase> into red.

Notice that I used phrase instead of emphasis. Either would work, just change d:phrase to d:emphasis in the template, but phrase exists for this sort of thing, so I'd probably use it first.

If you have never done a customization, then it's a bit tougher. In that case, I'd suggest that you check out Bob Stayton's book, DocBook XSL: The Complete Guide, which is THE resource for customizers. You can find his book online at: sagehill.net/, but if you're going to do much with the DocBook styleguides, get the print version (available on Amazon) and read it from cover to cover.

Best Regards,
Dick Hamilton
-------
XML Press
XML for Technical Communicators
http://xmlpress.net




On Jan 31, 2012, at 5:03 AM, Benjamin DE DARDEL wrote:

> Hi all, 
> 
> I wonder if there is a way to set color easily for some part of my text ?
> 
> For exemple :
> <emphasis role="???">My Colored Text</emphasis>  
> 
> As I expect that it's not so easy, does some of you have ever customized pdf stylesheets to do that ?
> 
> Regards,
> Benjamin
Next in thread → Next in month →