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] Figure floats in fo


> The '+ +' is the syntax error.  I don't know what should have been in
the middle.

The width should have been between the + signs, but <figure/> does not pass it along, so it remains blank. <sidebar/> uses a <?dbfo sidebar-width="xxx"?> directive, but afaikt there is no equivalent for <figure/>. And there's no place to specify width in <figure/>, anyway. That information is in its grandchild, <imagedata/>.

My customization was surprisingly compact. This is placed at the top of the choose stack in my custom floater template:

<xsl:template name="floater">
  <xsl:param name="position" select="'none'"/>
  <xsl:param name="clear" select="'both'"/>
  <xsl:param name="width"/>
  <xsl:param name="content"/>
  <xsl:param name="start.indent">0pt</xsl:param>
  <xsl:param name="end.indent">0pt</xsl:param>
  <xsl:choose>
    <!-- start customization -->
   <xsl:when test="$axf.extensions != 0 and contains($position, ' ')">
      <!-- use antenna house float extensions -->
      <fo:float axf:float="{$position}"
        clear="{$clear}">
        <xsl:copy-of select="$content"/>
      </fo:float>
    </xsl:when>
    <!-- end customization -->
...

This activates for any object whose floatstyle attribute contains a space. I can choose to use the stock float mechanism, for example, with floatstyle="begin" or the extension using floatstyle=" begin" (includes a space). And the extended floatstyles can be compound, for example, floatstyle="bottom right page". 

Docbook <imagedata/> has width, contentwidth, depth, and contentdepth. AH Formatter is able to determine the space needed for a side float from width and depth. The actual image size is controlled by contentwidth and contentdepth. And you can control placement of the image within the float space with align and valign. Thus all the parameters needed for a float are taken from the imagedata and do not need to be specified separately.


From: Tony Graham <tgraham@antenna.co.jp>
Sent: Saturday, February 5, 2022 2:08 PM
To: docbook-apps@lists.oasis-open.org <docbook-apps@lists.oasis-open.org>
Subject: Re: [docbook-apps] Figure floats in fo
 
On 05/02/2022 16:59, Kevin Dunn wrote:
> I can get formal and informal figures to float to the top of the page
>  using the methods described in DbXsl TCG p. 296 and Antenna House
> Formatter.  And I can get them to float right and left by wrapping
> them in a sidebar, as on page 232. But when I try to float them left
> or right on their own, I get an error message, "AHFCmd :WARNING:
> Invalid property value: end-indent="0pt +  + 0pt". Apparently, the
> width does not reach the floater template, and there does not seem to
> be a dbfo for figure-width, as there is for sidebars.

The '+ +' is the syntax error.  I don't know what should have been in
the middle.

> Is it expected that right and left floats should always be wrapped in
> a sidebar or margin note, or should it be possible to float objects
> independently of a sidebar? Using the Custom Side Float example on p.
>  236, I think I could add that functionality to formal objects, but I
>  don't want to reinvent the wheel.
>
> I see that AHF has extensions that allow, for example, floats to the
>  bottom of the page using axf:float="after", and I can get that to
> work by manually editing the fo. For axf:float="left", it even
> computes the width from the enclosed imagedata width. I might
> undertake adding that

It's likely that the XSLT is generating a 'width' property or similar.
AH Formatter can get the intrinsic width from the image file, but it
won't work out the width specified in your DocBook XML by itself.

> to my stylesheet customization as an alternative by customizing the
> floater template to recognize additional floatstyles, like axf-after,
>  for example.

AH Formatter has extensive control over how to float things, including
whether the float has to stay on the same page as its anchor and what to
do when something has to move for them to do so.  See
https://www.antenna.co.jp/AHF/help/en/ahf-float.html

My inclination, unsurprisingly, would be to try to use the AH Formatter
features rather than trying to bend sidebars into doing what you want.

Regards,


Tony Graham.
--
Senior Architect
XML Division
Antenna House, Inc.
----
Skerries, Ireland
tgraham@antenna.co.jp

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



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