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: Complex author layout for Sigplan


Hello all:

I've received a lot of help here in getting my Sigplan format working,
and a really appreciate it. I'm becoming more fluent in the way that
Docbook works, and I've been able to get almost everything working
now. I have posted about two of my outstanding issues, but I have one
more which seems like a job for someone who knows how XSLT works really
well.

I have the following set of authors as an example:

    <authorgroup>
      <author>
        <personname>Aaron W. Hsu</personname>
        <affiliation><orgname>Indiana University</orgname></affiliation>
        <email>awhsu@indiana.edu</email>
      </author>
      <author>
        <personname>Tim Zakian</personname>
        <affiliation><orgname>Indiana University</orgname></affiliation>
        <email>tzakian@indiana.edu</email>
      </author>
      <author>
        <personname>Edward Amsden</personname>
        <affiliation><orgname>Indiana University</orgname></affiliation>
        <email>eamsden@indiana.edu</email>
      </author>
    </authorgroup>

Notice that each of the affiliations is the same. According to Sigplan,
when this happens, the document should render these as follows:

Aaron W. Hsu<some space>Tim Zakian<some space>Edward Amsden
                  Indiana University
             {awhsu,tzakian,eamsden}@indiana.edu

Assuming that there are no affiliations among authors, the following
templates get it right:

  <xsl:template match="d:author" mode="titlepage.mode">
    <fo:table-cell>
      <xsl:choose>
        <xsl:when test="d:orgname">
          <fo:block>
            <xsl:apply-templates/>
          </fo:block>
        </xsl:when>
        <xsl:otherwise>
          <fo:block font-size="12pt" space-after="3pt">
            <xsl:call-template name="person.name"/>
          </fo:block>
          <xsl:if test="d:affiliation/d:orgname">
            <fo:block>
              <xsl:apply-templates select="d:affiliation/d:orgname" 
                                   mode="titlepage.mode"/>
            </fo:block>
          </xsl:if>
          <xsl:if test="d:email|d:affiliation/d:address/d:email">
            <fo:block space-before="2pt">
              <xsl:apply-templates 
               select="(d:email|d:affiliation/d:address/d:email)[1]"/>
            </fo:block>
          </xsl:if>
        </xsl:otherwise>
      </xsl:choose>
    </fo:table-cell>
  </xsl:template>

  <xsl:template match="d:authorgroup" mode="titlepage.mode">
    <fo:table table-layout="fixed" width="100%" space-before="2em"
              space-after="4em" space-after.conditionality="retain">
      <fo:table-body>
        <fo:table-row>
          <xsl:call-template name="anchor"/>
          <xsl:apply-templates mode="titlepage.mode"/>
        </fo:table-row>
      </fo:table-body>
    </fo:table>
  </xsl:template>

I copied these from the basic titlepage.xsl templates. I modified them
to lay things out in a table instead of as a single set of blocks, which
works well. However, it's not obvious to me how to merge multiple
authors of the same affiliation into a single block there. Moreover, The
authors should be evenly spaced to consume equal amounts of space in the
total amount of horizontal space allocated for a given affiliation. So,
in this example, the three names would appear equadistant to one another
across the entire page, centered in the middle of the page. If there
were two different affiliations but three authors, then the two authors
who shared an affiliation would consume half of the space, and the third
author affiliated with the second institution would consume the other
half. Both would be centered over the affiliation name. 

Also notice the way that the email addresses are written. These would
need to be merged so that the common domain is not repeated
unnecessarily. 

This seems like a somewhat complex layout task, and it's far beyond my
understanding of how these templates work. I would really appreciate any
help in getting this working.

-- 
Aaron W. Hsu | arcfide@sacrideo.us | http://www.sacrideo.us
לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃



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