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 changes in <author> and <affiliation>


Title: Re: [docbook-apps] Font size changes in <author> and <affi
Found a way around this duplication: output the firstname, othername and surname separately, but is this the best way?  Still two minor problems:
1.  need to center the author with 3 non-breaking spaces at end of surname. Messy!  There must be  better way.
2.  The spaces between the parts of the name are too big - haven't found a way around this yet.

</xsl:template>
<xsl:template match="authorgroup" mode="book.titlepage.recto.mode">
 
<fo:wrapper>
   
<xsl:if test="@id">
     
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
   
</xsl:if>
   
<xsl:apply-templates mode="book.titlepage.recto.mode"/>
 
</fo:wrapper>
</xsl:template>
<xsl:template match="author" mode="book.titlepage.recto.mode">
 
<fo:block font-size="20.736pt"
            color="blue"
            space-before="8pt"
            keep-with-next.within-column="always">
 ??
<xsl:apply-templates select="firstname" mode="titlepage.mode"/>
 ??
<xsl:apply-templates select="othername" mode="titlepage.mode"/>
 ??
<xsl:apply-templates select="surname" mode="titlepage.mode"/>
<!-- ?? <xsl:apply-templates select="." mode="titlepage.mode"/> -->
 
</fo:block>
 
<fo:block font-size="14.4pt"
            color="green"
            space-before="8pt" >
 ??
<xsl:apply-templates select="affiliation" mode="titlepage.mode"/>
 
</fo:block>
</xsl:template>
<xsl:template match="author" mode="titlepage.mode">
 
<fo:block>
   
<xsl:call-template name="anchor"/>
   
<xsl:call-template name="person.name"/>
   
<xsl:if test="affiliation/orgname">
     
<xsl:text> </xsl:text>
     
<xsl:apply-templates select="affiliation/orgname" mode="titlepage.mode"/>
   
</xsl:if>
   
<xsl:if test="email|affiliation/address/email">
     
<xsl:text> </xsl:text>
     
<xsl:apply-templates select="(email|affiliation/address/email)[1]"/>
   
</xsl:if>
 
</fo:block>
</xsl:template>

<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" space-before="1.8in">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</fo:block>
</xsl:template>

</xsl:stylesheet>


Thanks Bob, now it uses my customization, BUT the affiliation appears twice, the first time large large and blue, the second small and green.  It seems that

    <xsl:apply-templates select="." mode="titlepage.mode"/>

outputs both the author and the affiliation. I think I need to say select="author and not author/affiliation" somehow.

Ron

<?xsl version="1.0" ?>
<xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
      xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<xsl:import href="/Applications/Utilities/oxygen/8.1/oxygen/frameworks/docbook/xsl/fo/docbook.xsl" />
<xsl:param name="xep.extensions" select ="1" />
<xsl:template match="processing-instruction('lb')">
<fo:block/>
</xsl:template>
<xsl:template match="authorgroup" mode="book.titlepage.recto.mode">
 
<fo:wrapper>
   
<xsl:if test="@id">
     
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
   
</xsl:if>
   
<xsl:apply-templates mode="book.titlepage.recto.mode"/>
 
</fo:wrapper>
</xsl:template>
<xsl:template match="author" mode="book.titlepage.recto.mode">
 
<fo:block font-size="23pt"
            color="blue"
            space-before="20pt"
            keep-with-next.within-column="always">
    <xsl:apply-templates select="." mode="titlepage.mode"/>
  </fo:block>
 
<fo:block font-size="12pt"
            color="green"
            space-before="18pt" >
    <xsl:apply-templates select="affiliation" mode="titlepage.mode"/>
  </fo:block>
</xsl:template>
</xsl:stylesheet>


Ah, that's because you don't have a customization of authorgroup at the same level also.  By default, authorgroup is handled by the template with match="authorgroup" mode="titlepage.mode" in titlepage.xsl, and it processes its children in mode="titlepage.mode", so your custom templates are bypassed.
 
If you add a template like this it should work:
 
<xsl:template match="authorgroup" mode="book.titlepage.recto.mode">
  <fo:wrapper>
    <xsl:if test="@id">
      <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
    </xsl:if>
    <xsl:apply-templates mode="book.titlepage.recto.mode"/>
  </fo:wrapper>
</xsl:template>
 
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
 

--
Ron Catterall, Phd, DSc                         email: ron@catterall.net
Prolongacion de Hidalgo 140                             http://catterall.net/
San Felipe del Agua                                        tel: +52 951 520 1821
Oaxaca      68020  Mexico                          fax: +1 530 348 8309
--------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


-- 
Ron Catterall, Phd, DSc                         email: ron@catterall.net
Prolongacion de Hidalgo 140                             http://catterall.net/
San Felipe del Agua                                        tel: +52 951 520 1821
Oaxaca      68020  Mexico                          fax: +1 530 348 8309


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