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: Re: [docbook-apps] formatting level 2 headings as a custom side float


[Re-sending to the list so that everyone interested can follow the
discussion.]

Hi,
Sorry for the delay.

Jeff Powanda a écrit :
> Thanks. I've had no luck getting side float to work with FOP 0.93. I've tried using it with FOP 0.93 and I get a "No LayoutManager maker for class class org.apache.fop.fo.flow.Float" exception.
> 
> Your idea of using lists instead of side floats is a last resort. Have you actually used that before?

See the attached fo file to get the idea. Basically you will have to put
the section title in the fo:list-item-label element, and the section
content in the fo:list-item-body.

It seems to me that using lists is more robust because the result is
less likely to be messed up by other side floats. Side floats aren't
guaranteed to be at the same level as their anchor point. As their names
indicate they may flow down because of earlier side floats. The title
will end up below the beginning of the section!
Note that a two-column table should do the trick as well, but a list
sounds more natural here.

HTH,
Vincent


> -----Original Message-----
> From: Vincent Hennebert [mailto:vincent.hennebert@anyware-tech.com] 
> Sent: Tuesday, March 20, 2007 12:59 AM
> To: docbook-apps@lists.oasis-open.org
> Subject: Re: [docbook-apps] formatting level 2 headings as a custom side float
> 
> Hi Jeff,
> 
> Jeff Powanda a écrit :
>> I'm working with a DocBook customization that currently formats level 2
>> headings side-by-side with body text by placing the content in a
>> two-column table. The code worked fine when using FOP 0.20.5 to output
>> to PDF, but it's not working so well with FOP 0.93.
> 
> The customization layer probably needs to be adapted, but there's no
> reason why that wouldn't work with FOP 0.93. Can you post a snippet of
> the resulting FO and explain what's not working and what you're
> expecting instead?
> 
> 
>> I wondered if there's a better, simpler approach I can take to fix. For
>> example, can I format level 2 headings as a custom side float? Keep in
>> mind that I want the heading to be outdented from the body text and
>> right-aligned within the left margin. How would I do that?
> 
> Side-floats might do the trick, but I think using lists with negative
> margin-left would be more robust. You would put the title in an
> fo:list-item-label and the rest in an fo:list-item-body. Not tested, but
> that should work.

<?xml version="1.0" standalone="no"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="page"
      page-height="29.7cm" page-width="21cm"
      margin-top="2cm" margin-bottom="2cm" margin-left="6cm" margin-right="3cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="page"
    font-family="serif" font-size="14pt">
    <fo:flow flow-name="xsl-region-body" text-align="justify">
      <fo:block>Before the section. Before the section. Before the section. Before the section.
        Before the section. Before the section. Before the section. Before the section. Before the
        section.</fo:block>
      <fo:list-block provisional-distance-between-starts="4cm" provisional-label-separation="5mm"
        start-indent="-4cm" space-before="12pt">
        <fo:list-item>
          <fo:list-item-label end-indent="label-end()" text-align="start">
            <fo:block font-weight="bold">1. Title of the Next Section</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>Section content. Section content. Section content. Section content. Section
              content. Section content. Section content. Section content. Section content. Section
              content. Section content. Section content. Section content. Section content.
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>
      </fo:list-block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>


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