You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sl...@apache.org on 2003/06/10 23:51:57 UTC

cvs commit: httpd-2.0/docs/manual/style/latex html.xsl

slive       2003/06/10 14:51:57

  Modified:    docs/manual/style/latex html.xsl
  Log:
  Latex: Improve the table generation code a little and
  make another try at getting the # to work in urls.
  
  Revision  Changes    Path
  1.4       +31 -12    httpd-2.0/docs/manual/style/latex/html.xsl
  
  Index: html.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/latex/html.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -b -u -r1.3 -r1.4
  --- html.xsl	10 Jun 2003 20:17:51 -0000	1.3
  +++ html.xsl	10 Jun 2003 21:51:57 -0000	1.4
  @@ -115,18 +115,28 @@
   </xsl:text>
   </xsl:template>
   
  +<!-- XXX: We need to deal with table headers -->
  +
   <xsl:template match="table">
   <xsl:text>\begin{tabular}{</xsl:text>
  -<xsl:for-each select="columnspec/column">
  +<xsl:choose>
  +<xsl:when test="columnspec">
  +  <xsl:for-each select="columnspec/column">
     <xsl:text>l</xsl:text>
  -</xsl:for-each>
  +  </xsl:for-each>
  +</xsl:when>
  +<xsl:otherwise>
  +  <xsl:for-each select="tr[1]/*">
  +    <xsl:text>l</xsl:text>
  +  </xsl:for-each>
  +</xsl:otherwise>
  +</xsl:choose>
   <xsl:text>}</xsl:text>
   <xsl:apply-templates select="tr"/>
   <xsl:text>\end{tabular}
   </xsl:text>
   </xsl:template>
   
  -
   <xsl:template match="tr">
     <xsl:apply-templates select="td"/>
     <xsl:text>\\
  @@ -135,8 +145,15 @@
   
   <xsl:template match="td">
       <xsl:variable name="pos" select="position()"/>
  -    <xsl:text>\begin{minipage}{</xsl:text>
  +    <xsl:text>\begin{minipage}[t]{</xsl:text>
  +    <xsl:choose>
  +    <xsl:when test="../../columnspec">
       <xsl:value-of select="../../columnspec/column[$pos]/@width"/>
  +    </xsl:when>
  +    <xsl:otherwise>
  +      <xsl:value-of select="1 div last()"/>
  +    </xsl:otherwise>
  +    </xsl:choose>
       <xsl:text>\linewidth}</xsl:text>
       <xsl:apply-templates/>
       <xsl:text>\end{minipage}</xsl:text>
  @@ -179,12 +196,14 @@
     </xsl:choose>
   </xsl:variable>
   <xsl:choose>
  -<xsl:when test="starts-with(@href, 'http:')">
  +
  +<xsl:when test="starts-with(@href, 'http:') or starts-with(@href, 'news:') or starts-with(@href, 'mailto:')">
     <xsl:if test="not(.=@href)">
  -    <xsl:text>\footnote{\href{</xsl:text>
  +    <xsl:text>\footnote{</xsl:text>
  +      <xsl:text>\href{</xsl:text>
         <xsl:value-of select="@href"/>
       <xsl:text>}{</xsl:text>
  -      <xsl:call-template name="ltescape">
  +    <xsl:call-template name="htescape">
           <xsl:with-param name="string" select="@href"/>
         </xsl:call-template>
       <xsl:text>}}</xsl:text>