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] Tighten up : Title page <author> layout


On Thu, Apr 07, 2005 at 01:58:19AM -0400, Fiedler, Tristan wrote:

> <author>
>   <firstname>Joe</firstname>
>   <surname>Smith
>     <remark>
>        <footnote><para>Footnote1.</para></footnote>
>        <footnote><para>Footnote2.</para></footnote>
>     </remark>
>    </surname>
> 			
>   <affiliation>
>     <orgname>University of Maryland</orgname>
>     <address>Baltimore, MD 21250 USA</address>
>   </affiliation>
>   <email>Smith@umbc.edu</email>
> </author>
> 
> HTML output looks like :
> 
> <div>
>  <div class="author">
>   <h3 class="author"><span class="firstname"> Joe </span> 
>                      <span class="surname">Smith<em><span class="remark">
>                      <sup .footnotelink1.. </sup> 
>                      <sup .footnotelink2.. </sup>
>                      </span></em></span>
>   </h3>
>   <div class="affiliation"><span class="orgname">University of Maryland<br></span>
>   <div class="address"><p>Baltimore,&nbsp;MD&nbsp;21250&nbsp;USA</p>
>   </div>
>   </div>
>   <code class="email">&lt;<a href="mailto:smith@umbc.edu";>smith@umbc.edu</a>&gt;</code>
>  </div>
> </div>
>       
> While this HTML looks fine, I want to re-style the author section in
> the HTML output to have much less whitespace, ie. remove the <br>
> and <p></p> perhaps and replace with comma's to put all the
> information on a single line with the author is slightly larger
> font.

You could do it by overriding a few templates in html/titlepage.xsl.
Start with:

<xsl:template match="author" mode="titlepage.mode">
  <div class="{name(.)}">
    <span class="{name(.)}"><xsl:call-template name="person.name"/></span>
    <xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
    <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
    <xsl:apply-templates mode="titlepage.mode" select="./email"/>
  </div>
</xsl:template>

Here, I've put 'author' inside a 'span' instead of a 'h3'.  This will
prevent the first line break.  You could then use CSS to increase the
font size of span.firstname and span.lastname, or all of
span.author---whatever suits.  You're not using 'contrib', so I'll
ignore that.  Then adjust the templates for 'affiliation', 'orgname'
and 'address' to remove the 'div', 'br' and 'p' elements:

<xsl:template match="affiliation" mode="titlepage.mode">
  <span class="{name(.)}">
    <xsl:apply-templates mode="titlepage.mode"/>
  </span>
</xsl:template>

<xsl:template match="orgname" mode="titlepage.mode">
  <span class="{name(.)}">
    <xsl:apply-templates mode="titlepage.mode"/>
  </span>
  <xsl:text>, </xsl:text>
</xsl:template>

<xsl:template match="address" mode="titlepage.mode">
  <span class="{name(.)}">
    <xsl:apply-templates mode="titlepage.mode"/>
  </span>
  <xsl:text>, </xsl:text>
</xsl:template>

I've removed some functionality from the address template, but it
should supply the output you're after.  The placement of the commas is
somewhat brittle, and you would need to do something more
sophisticated if your input was different.

I have not tested any of this code, but it should be close.  :-)


-- 
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/

PGP signature



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