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] format gene names in italics?


> -----Original Message-----
> From: Cheryl Chase 
> 
> I would like to format a handful of gene names in italics. Is there  
> an easy way to do this (better than relying on default formatting of  
> <emphasis> as bold?


The default formatting of <emphasis> in DocBook XSL is italics, not bold.

An alternative: use <phrase role="gene"> in your source and add this
template to your customization layer:

<xsl:template match="phrase[@role='gene']">
  <xsl:call-template name="inline.italicseq"/>
</xsl:template>


> Also, how to get italic formatting in an index entry? With XEP, the  
> following produces an index entry for SRY that is plain roman text  
> (not italic or bold).

> <indexterm>
>            <primary><emphasis>SRY</emphasis></primary>
>          </indexterm>


To get indexterms with emphasis as above formatted in italics, you can
customize a template in autoidx.xsl: 

<xsl:template match="indexterm" mode="index-div">
  <xsl:param name="scope" select="."/>
  <xsl:param name="role" select="''"/>
  <xsl:param name="type" select="''"/>

  <xsl:variable name="key"
                select="translate(substring(&primary;, 1,
1),&lowercase;,&uppercase;)"/>

  <xsl:if test="key('letter', $key)[&scope;]
                [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
    <fo:block>
      <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
        <xsl:call-template name="indexdiv.title">
          <xsl:with-param name="titlecontent">
            <xsl:value-of select="translate($key, &lowercase;,
&uppercase;)"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:if>
      <fo:block xsl:use-attribute-sets="index.entry.properties">

	<!-- Customization: italicized indexterms -->
      <xsl:if test="descendant::emphasis">
	  <xsl:attribute name="font-style">italic</xsl:attribute>
	</xsl:if>
      <!-- End of customization -->

        <xsl:apply-templates select="key('letter', $key)[&scope;]
                                     [count(.|key('primary',
&primary;)[&scope;][1])=1]"
                             mode="index-primary">
          <xsl:sort select="translate(&primary;, &lowercase;,
&uppercase;)"/>
          <xsl:with-param name="scope" select="$scope"/>
          <xsl:with-param name="role" select="$role"/>
          <xsl:with-param name="type" select="$type"/>
        </xsl:apply-templates>
      </fo:block>
    </fo:block>
  </xsl:if>
</xsl:template>


/MJ




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