This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] term in <variablelist> is rendered incorrectly in PDF


On Fri, Sep 05, 2003 at 01:35:14PM -0400, Jeff Beal wrote:
> I knew I should have double-checked the latest stylesheets!  Anyway, I'm
> surprised that 0.60 even gives good enough results, but I suppose it depends
> a little bit on the nature of the <term/>s.  In our case, most of our terms
> are all uppercase, so I used a factor of 0.80, and even that ended up being
> too short for terms with less than eight characters, so my longest.term
> template takes this into account:
> 
> <xsl:template name="longest.term">
>   <xsl:param name="longest" select="0"/>
>   <xsl:param name="terms" select="."/>
>   <xsl:param name="maxlength" select="-1"/>
> 
>   <xsl:choose>
>     <xsl:when test="(0.8 * $longest) &gt; $maxlength and $maxlength &gt; 0">
>       <xsl:value-of select="$maxlength"/>
>     </xsl:when>
>     <xsl:when test="not($terms) and ($longest &gt; 8)">
>       <xsl:value-of select="0.8 * $longest"/>
>     </xsl:when>
>     <xsl:when test="not($terms)">
>       <xsl:value-of select="$longest"/>
>     </xsl:when>
>     <xsl:when test="string-length($terms[1]) &gt; $longest">
>       <xsl:call-template name="longest.term">
>         <xsl:with-param name="longest" select="string-length($terms[1])"/>
>         <xsl:with-param name="maxlength" select="$maxlength"/>
>         <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
>       </xsl:call-template>
>     </xsl:when>
>     <xsl:otherwise>
>       <xsl:call-template name="longest.term">
>         <xsl:with-param name="longest" select="$longest"/>
>         <xsl:with-param name="maxlength" select="$maxlength"/>
>         <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
>       </xsl:call-template>
>     </xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
> 
> I also used a provisional-label-separation of 9pt instead of 0.25in, and
> that seemed to work a little better.

What I *really* would like to be able to do is measure the
formatted width of the terms.  But I don't think there
is a way to do that with the separation of stylesheet
and FO processing.  Only the FO processor knows how wide
the formatted terms are, and it cannot set the
list-block property values.

Maybe we should just make the em ratio into another
parameter, 'term.relative.width' or something.
Then you could adjust it on the command line per
document.


Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]