Hi Jeremias

I thought I understood the .fo example you attached, but when I pass your
file to fop here the annotations appear on their own line at the left margin
and not to the right of the text flow.
 
I have tried a different approach which is OK for certain content types, but
which is not working for bulleted or numbered lists. If you process the
attached .fo file you will note that the gap between the bullet point and
the content is much greater if there is a version on the item. I have tried
tinkering with start indents and widths but nothing I do produces a
consistent indentation. Can you see what I am doing wrong?

Cheers
Trevor

-----Original Message-----
From: Jeremias Maerki [mailto:[email protected]] 
Sent: Thursday, 3 March 2011 9:58 p.m.
To: [email protected]
Subject: Re: right-aligned box insertion in text flow

The attachment should give you an idea.

The principle:

        <fo:block-container>
          <fo:block-container right="-1.2cm"
inline-progression-dimension="1cm" absolute-position="absolute">
            <fo:block>123</fo:block>
          </fo:block-container>
        </fo:block-container>

The first block-container is a normal one. It has zero effective height and
is used to create a new reference area to which the child block-container
can be relatively positioned (although you actually have to use absolute
positioning in FO terminology).
absolute-position="absolute" positions relative to the ancestor reference
area.

HTH

On 03.03.2011 09:30:19 Trevor Nicholls wrote:
> Thank you Jeremias
> 
> The marginalia examples I have found typically use a block-container 
> within an fo:float. I haven't found an example which avoids the float 
> :-( Are you aware of any?
> 
> Cheers
> Trevor
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:[email protected]]
> Sent: Thursday, 3 March 2011 8:36 p.m.
> To: [email protected]
> Subject: Re: right-aligned box insertion in text flow
> 
> Trevor,
> what you're looking for is fo:float, but as you can see here:
> http://xmlgraphics.apache.org/fop/compliance.html#fo-object-float
> this object is not implemented, yet.
> 
> As an alternative, you can investigate using fo:block-containers if 
> you are happy enough to have the version numbers placed on the right 
> side of the normal text flow.
> 
> On 01.03.2011 14:36:27 Trevor Nicholls wrote:
> > I wonder if the following is do-able; perhaps somebody has been 
> > there
> before
> > me?
> > 
> > I have a document schema which includes paragraphs, tables, code
> fragments,
> > notes, various levels of nested sections, etc. Every "block" element
> carries
> > an optional "version" attribute, and this version needs to be 
> > presented in the right margin of the main document flow.
> > 
> > When my XML is converted to  HTML this is achieved with a CSS float, 
> > like
> > so:
> > 
> > (XML)
> >  <para version="123">Para text...</para>
> > 
> > 
> > (XSL)
> >  <xsl:template match="para">
> >    <xsl:call-template name="testversion" />
> >    <p><xsl:apply-templates /></p>
> >  </xsl:template>
> > 
> >  <xsl:template name="testversion">
> >    <xsl:if test="@version != ''">
> >      <div class="version-float">
> >        <xsl:value-of select="@version" />
> >      </div>
> >    </xsl:if>
> >  </xsl:template>
> > 
> > 
> > (CSS)
> >  .version-float {
> >   float: right;
> >   font-size: 10pt;
> >   font-weight: normal;
> >   color: #666;
> >   background-color: #ffd;
> >   margin: 0;
> >   padding: 0 0.2em;
> >   border-top: 1px solid #ccc;
> >   border-left: 1px solid #ccc;
> >   border-right: 1px solid #888;
> >   border-bottom: 1px solid #888;
> >  }
> > 
> > 
> > This appears in the browser like so:
> > 
> >  Para text para text para text para |  123  |  text para text para 
> > text para text  -------  para text para text para text para text 
> > para  text para text para text para text para text.
> > 
> > 
> > I would like to achieve a similar effect in the PDF output which is 
> > generated by FOP but I am not sure how to achieve it. Can anyone 
> > assist please?
> > 
> > We are using FOP 0.95.
> > 
> > Cheers
> > Trevor
> > 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]




Jeremias Maerki
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <fo:layout-master-set>
    <fo:simple-page-master page-height="27.94cm" page-width="21.59cm" margin-top="1.91cm" margin-bottom="1.27cm" margin-left="4.04cm" margin-right="2.54cm" master-name="Std-page">
      <fo:region-body margin-top="1.91cm" margin-bottom="1.91cm"/>
      <fo:region-before extent="1cm"/>
      <fo:region-after extent="1cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence color="black" font-family="Times,serif" font-size="11pt" font-style="normal" font-weight="normal" master-reference="Std-page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block id="Definition_lists" start-indent="-1.5cm" keep-with-next.within-page="always" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.4em" space-after.optimum="0.5em" space-after.maximum="0.6em">
        <fo:block font-family="Arial,sans-serif" font-size="165%" font-weight="bold">Definition lists</fo:block>
      </fo:block>
      <fo:block space-before.minimum="0.4em" space-before.optimum="0.5em" space-before.maximum="0.6em" space-after.minimum="0.4em" space-after.optimum="0.5em" space-after.maximum="0.6em">There are three specialist definition elements provided by our document schema. We have:</fo:block>
      <fo:list-block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" space-after.minimum="0.8em" space-after.optimum="1em" space-after.maximum="1.2em" provisional-label-separation="0.85mm" provisional-distance-between-starts="6.35mm">
        <fo:list-item space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" relative-align="baseline">
          <fo:list-item-label end-indent="label-end()">
            <fo:block text-indent="2.1mm">•</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block space-before="0em" space-after="0em">
              <fo:table table-layout="fixed" width="100%">
                <fo:table-body>
                  <fo:table-row>
                    <fo:table-cell>
                      <fo:block>
                        <fo:block space-before.minimum="0.4em" space-before.optimum="0.5em" space-before.maximum="0.6em" space-after.minimum="0.4em" space-after.optimum="0.5em" space-after.maximum="0.6em"><fo:inline font-weight="bold">variabledefs</fo:inline> for environment variables, local variables, global variables, and the like;</fo:block>
                      </fo:block>
                    </fo:table-cell>
                    <fo:table-cell width="0.9cm">
                      <fo:block start-indent="0" font-family="Arial,sans-serif" color="#666" background-color="#ffd" padding="0.2em" border-top-color="#ccc" border-left-color="#ccc" border-right-color="#888" border-bottom-color="#888" border-style="solid" border-width="1px" text-align="center" font-style="normal" font-variant="normal" font-size="11pt" font-weight="normal">7.30</fo:block>
                    </fo:table-cell>
                  </fo:table-row>
                </fo:table-body>
              </fo:table>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>
        <fo:list-item space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" relative-align="baseline">
          <fo:list-item-label end-indent="label-end()">
            <fo:block text-indent="2.1mm">•</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block space-before="0em" space-after="0em">
              <fo:block space-before.minimum="0.4em" space-before.optimum="0.5em" space-before.maximum="0.6em" space-after.minimum="0.4em" space-after.optimum="0.5em" space-after.maximum="0.6em"><fo:inline font-weight="bold">switchdefs</fo:inline> for commandline switches, command switches, field switches, sort switches, and so on;</fo:block>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>
        <fo:list-item space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" relative-align="baseline">
          <fo:list-item-label end-indent="label-end()">
            <fo:block text-indent="2.1mm">•</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block space-before="0em" space-after="0em">
              <fo:table table-layout="fixed" width="100%">
                <fo:table-body>
                  <fo:table-row>
                    <fo:table-cell>
                      <fo:block>
                        <fo:block space-before.minimum="0.4em" space-before.optimum="0.5em" space-before.maximum="0.6em" space-after.minimum="0.4em" space-after.optimum="0.5em" space-after.maximum="0.6em"><fo:inline font-weight="bold">functiondefs</fo:inline> for functions and procedures.</fo:block>
                      </fo:block>
                    </fo:table-cell>
                    <fo:table-cell width="1.6cm">
                      <fo:block start-indent="0" font-family="Arial,sans-serif" color="#666" background-color="#ffd" padding="0.2em" border-top-color="#ccc" border-left-color="#ccc" border-right-color="#888" border-bottom-color="#888" border-style="solid" border-width="1px" text-align="center" font-style="normal" font-variant="normal" font-size="11pt" font-weight="normal">7.30-03a</fo:block>
                    </fo:table-cell>
                  </fo:table-row>
                </fo:table-body>
              </fo:table>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>
      </fo:list-block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to