Next in thread → Next in month →

Re: [docbook-apps] Modifying line-height for table title

From
Bob Stayton <>
Date
2011-10-03T07:40:00+00:00
ID
095b01cc819f$920adb70$6400a8c0@pazu
Thread
Re: [docbook-apps] Modifying line-height for table title


Hi Dave,

I'm glad it worked for you, but that solution 
may have some unintended consequences.  As you can see from Table 30.2 in 
my book:

 

http://www.sagehill.net/docbookxsl/PrintTableStyles.html

 

the table.properties attribute set is added by the 
stylesheet to the outermost fo:block that contains the table title and the 
entire table.  So adding formal.title.properties to table.properties means 
any properties in formal.title.properties are applied to the entire table 
through inheritance, unless overridden by properties on specific elements.  
Didn't that turn your table into all bold, for example?  

 

Also, formal.title.properties is already applied to 
the title, so adding it to the outer wrapper should have no effect.  So I'm 
not clear why it worked for you.

 

I thought you were looking for something more 
specific--to apply line-height to just the table title.  Adding the 
line-height property to the formal.title.properties would accomplish that, 
without changing table.properties.

 

Bob Stayton
Sagehill Enterprises


 

 

  
----- Original Message ----- 

  
From: 
  redlettucemail 

  
To:  
  

  
Sent: Saturday, October 01, 2011 3:43 
  PM

  
Subject: Re: [docbook-apps] Modifying 
  line-height for table title

  

  
Bob,

  
Thanks - I added use-attribute sets to table.properties and that 
  worked:

  
  <xsl:attribute-set name="table.properties" 
  
    
  use-attribute-sets="formal.title.properties">
 
Dave 
  Gardiner

  -----Original 
    Message-----
From: "Bob Stayton" <>
To: 
    "redlettucemail" <>, 
    <>
Date: 
    Sat, 1 Oct 2011 11:34:53 -0700
Subject: Re: [docbook-apps] Modifying 
    line-height for table title

    
Hi Dave,

    
In order to make the titles of figures, tables, 
    examples consistent in format, there is a separate attribute-set for them 
    named 'formal.title.properties'.  See this reference for 
    details:

    
 

    
http://www.sagehill.net/docbookxsl/PrintTableStyles.html#TableTitle 
    

    
 

    
jThat att-set does not actually set the 
    line-height property, so I think the title is inheriting it from the 
    root.properties attribute set, which sets its value to 'normal'.  Most 
    FO processors interpret 'normal' as 1.2em.  

    
 

    
Bob Stayton
Sagehill Enterprises


    
 

    
 

    
      
----- Original Message ----- 

      
From: 
      redlettucemail 
      

      
To:  
      

      
Sent: Thursday, September 29, 2011 
      5:54 AM

      
Subject: [docbook-apps] Modifying 
      line-height for table title

      

      

      
I have set a parameter for line-height 
      (“graphiclineheight”= 1) that works for all text within formal objects - 
      figure, example and the body of tables (i.e. text within table.table). 
      This parameter though doesn’t modify the line-height for d:table/d:title. 
      I looked at the FO output and it seems that d:table/d:title is picking up 
      the line-height for body text, which is 1.2. I have experimented with 
      adding a specific smaller line-height (0.8) within table.properties then 
      the ‘graphiclineheight’ one within table.table.properties, but this only 
      modifies the line height of footnotes which I know is modified by 
      attributes within table.properties – but the table title inexplicably 
      remains unchanged.

      
I’ve tried to find some relevant fo:block code within 
      tables.xsl and formal.xsl, but I can’t see what else to modify.

      

      
Here are my customisations that incorporate 
      line-height for tables:

      
 

      
In “tables.xsl”:
  
      <xsl:param 
      name="tabletitlelineheight">0.8 
</xsl:param>

      
  
      <xsl:attribute-set 
      name="table.properties"> 
      
    <xsl:attribute 
      name="keep-together.within-column">auto </xsl:attribute> 
      <!-- allows tables 
      to 
      
      
      break ('auto') or not break ('always') across pages --> 
      
    
      <xsl:attribute 
      name="background-color"></xsl:attribute> <!-- specify 
      
      web colour (e.g. #e0e0e0) *****works 28/9/11 -->
    
      <xsl:attribute 
      name="hyphenate"> 
      false 
      </xsl:attribute> 
      <!--hyphenation of 
      text; 
      
      default: false (do not hyphenate). OPTIONS: false, 
      true-->
    
      <xsl:attribute 
      name="text-align"> 
      justify 
      </xsl:attribute> 
      <!--alignment of 
      table
      
      title. OPTIONS: left, justify *****works 28/9/11-->
    
      <xsl:attribute 
      name="margin-left"> 
      0pt 
      </xsl:attribute> 
      <!--indent from 
      left
      
      margin*****works 28/9/11--> 
      
    <xsl:attribute 
      name="margin-right"> 
      0pt 
      </xsl:attribute> 
      <!--indent from 
      right
      
      margin*****works 28/9/11--> 
      
    <xsl:attribute 
      name="margin-top"> 
      0pt 
      </xsl:attribute> 
      <!--top 
      margin*****--> 
      
    <xsl:attribute 
      name="margin-bottom"> 
      10pt 
      </xsl:attribute> 
      <!--add 
      leading
      
      after a table (including after footnotes), to adjust text 
      on
      
      page*****works 28/9/11--> 
      
    <!--padding inside table 
      region*****works 20/9/11-->
    
      <xsl:attribute 
      name="padding-left"> 
      0pt 
      </xsl:attribute>
    
      <xsl:attribute 
      name="padding-right"> 
      0pt 
      </xsl:attribute>
    
      <xsl:attribute 
      name="padding-top"> 
      0pt 
      </xsl:attribute>
    
      <xsl:attribute 
      name="padding-bottom"> 
      0pt 
      </xsl:attribute>
    
      <xsl:attribute 
      name="line-height"> 
      
      <xsl:value-of 
      select="$tabletitlelineheight"/>
    
      </xsl:attribute>
  
      </xsl:attribute-set>

      
<xsl:attribute-set name= "table.table.properties"> 
      
    <xsl:attribute 
      name="line-height"> 
      
      <xsl:value-of 
      select="$graphiclineheight"/>
    
      </xsl:attribute>
    
      <xsl:attribute 
      name="background-color"> 
      #e0e0e0 
      </xsl:attribute> 
      <!-- specify web 
      colour 
      
      (e.g. #e0e0e0) *****--> 
         
    <xsl:attribute 
      name="font-size"> 
      
      <xsl:choose> 
      
        <xsl:when 
      test="ancestor-or-self::d:informaltable" 
      >
          
      <xsl:value-of 
      select="$body.font.master 
      * 1"/> 
      <xsl:text> 
      pt 
      </xsl:text> 
      
          
      <!-- informal tables 
      have same font size as body text -->
        
      </xsl:when> 
      
        <xsl:otherwise> 
      
          
      <xsl:value-of 
      select="$body.font.master 
      * 0.8"/> 
      <xsl:text> 
      pt 
      </xsl:text> 
      <!-- small font for 
      all 
      
            
      formal tables --> 
        
        
      </xsl:otherwise>
      
      </xsl:choose> 
      
    </xsl:attribute>
    
      <xsl:attribute 
      name="text-align"> 
      left 
      </xsl:attribute>
    
      
    <xsl:attribute 
      name="border-after-width.conditionality" 
      >retain </xsl:attribute> 
      <!-- 
      displays
      
      bottom border for a table that breaks across to the next page; 
      options: discard [default], retain -->
    
      <xsl:attribute 
      name= 
      "border-before-width.conditionality">retain 
      </xsl:attribute> 
      <!-- 
      displays
      
      top border for a table that breaks across from the previous page; 
      options: discard [default], retain --> 
      
    <xsl:attribute 
      name="hyphenate"> 
      false 
      </xsl:attribute> 
      <!-- hyphenation 
      in
      
      tables; 'true' means turn on hyphenation -->
    
      <xsl:attribute 
      name="border-collapse"> 
      collapse 
      </xsl:attribute> 
      <!-- merge borders 
      
      
      together for adjacent cells --> 
      
  </xsl:attribute-set>

      
 

      

      
And in “graphics.xsl”:
  
      <xsl:param 
      name="graphiclineheight">
    
      <xsl:choose> 
      
      <xsl:when test = 
      "$graphicfontstyle='sans-serif'"> 
      
         
      <xsl:value-of 
      select="$line-height 
      * 1"/>
      
      </xsl:when> 
      
      <xsl:otherwise> 
      
        
      <xsl:value-of 
      select="$line-height"/>
      
      </xsl:otherwise>
    
      </xsl:choose> 
      
  </xsl:param>

      
 

      

      
See attached for sample FO output.

      
Thanks,
 

Dave Gardiner

      

      

      

---------------------------------------------------------------------
To 
      unsubscribe, e-mail: 
For 
      additional commands, e-mail: 
    
Next in thread → Next in month →