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


FO listitems consist of a "label" part and a "body" part.  These correspond
directly to the <term/> and the <listitem/> in a DocBook <variablelist/>.
FO processors determine the width of the "label" part from the
provisional-distance-between-starts (PDBS) and provisional-label-separation
(PLS) attributes on the <fo:list-block/> object.

The PDBS specifies the distance from the start-edge (left for English) of
the label to the start-edge of the body.  The PLS specifies the distance
between the end-edge of the label and the start-edge of the body.  Thus, the
width for the label part becomes PDBS - PLS.

The DocBook stylesheets calculate the PDBS by determining the number of
characters in the longest term in the stylesheets and specifying that many
'em' units.  That is, if the longest term in your variablelist has 9
characters, the PDBS will be '9em'.  However, the PLS is hard-coded to
0.25in, so you only have 9em - .25in space for the term's content.  Also,
there is another hard-coded value for the maximum PDBS (12em), so if you
have a 15-character term, the PDBS will be 12em.

I found that the best way to deal with this was to experiment.  Copy the
template that matches variablelist in the 'vl.as.list' mode from lists.xsl
into your customization layer and change the maxlength parameter that is
passed to the 'longest.term' template and the PLS value until you get
something that looks more like what you want.

There is also the termlength attribute and a processing instruction (<?dbfo
term-width="13em"?>) you can use to hard-code the term width into each of
your variablelists.  This may be the better approach if you only have one or
two problematic variablelists:

Jeff Beal



> -----Original Message-----
> From: Robert P. J. Day [mailto:rpjday@mindspring.com]
> Sent: Friday, September 05, 2003 8:25 AM
> To: docbook apps list
> Subject: [docbook-apps] term in <variablelist> is rendered incorrectly
> in PDF
> 
> 
> 
>   (my, but it's been a busy docbook morning).
> 
>   before the 1.62 stylesheets for FO, i reported having a problem
> with variablelist terms being broken over a page.  since upgrading
> to 1.62, *that* problem has gone away, but a new one has arisen.
> 
>   it seems to have something to do with hyphenation.  if i create
> a variablelist term that has no obvious hyphenation, like "XXXXXX",
> then the PDF output looks like
> 
>    XXXXX    whatever
>    X
> 
> in other words, the processing seems to simply break the term near
> the end and continue on the next line.  if i try an even longer
> garbage term like "XXXXXXXXXX", i get
> 
>    XXXXXXXX   whatever
>    XX
> 
> if i try something for which hyphenation is at least feasible,
> like "abcdefghijklmno", i get
> 
>    abcde-       whatever
>    fghijklmno
> 
> which seems reasonable (given a very flexible definition of 
> "reasonable" :-).
> 
>   so the problem *seems* related to hyphenation, or the lack of
> ability to do so.
> 
>   thoughts?  can anyone else reproduce this?  i'm pretty sure
> i haven't added any customization related to variablelists
> anywhere.
> 
> rday
> 
> 
> To unsubscribe from this list, send a post to 
> docbook-apps-unsubscribe@lists.oasis-open.org.
> 
> 
> 

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]