[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: Attributes for figures
On Tue, Dec 03, 2002 at 07:35:58PM +0100, Alain NAKACHE wrote: > It is a good approach of boxed figures but the box is as large as the whole > fo:block and not only the bitmap. > > Is it what you expected first ? Well, yes, the block is by default the width of the page, so the border is the whole width. It does look funny on a graphic. > I know that the difficulty is to guess the bounds of the picture (whatever > the format is) to define closely the block. > > Is it possible to obtain this result ? The figure element can contain any number of things besides graphics, so perhaps you should be concentrating on graphics within figure rather than on figure. If the generated <fo:external-graphic> object has the border properties, they should fit tightly to the graphic. This works in RenderX's XEP, but the border doesn't show at all in FOP when I do that. If you are using FOP, I think the imagemagik solution is probably the best. 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 > > At 10:10 03/12/02 -0800, Bob Stayton wrote: > >On Tue, Dec 03, 2002 at 04:15:17PM +0200, Togan Muftuoglu wrote: > > > * Togan Muftuoglu; <toganm@users.sourceforge.net> on 03 Dec, 2002 wrote: > > > >* Alain NAKACHE; <alain@cal.fr> on 03 Dec, 2002 wrote: > > > >>At 14:49 03/12/02 +0200, Togan Muftuoglu wrote: > > > >>>Hi, > > > >>figure bitmap. > > > >> > > > >>Bob Stayton pointed to me the following advice : > > > >>"You would need to customize the template named > > > >>'formal.object' in the stylesheet file fo/formal.xsl. > > > >>But you would need to learn XSL-FO in order to put > > > >>the border attributes in the right place. Then you > > > >>have to hope that FOP can output it correctly." > > > >>but my result was to enclose the whole Block and not only the figure. > > > > > > > >Strange I had the exact same result :-) Also fighting with FOP is > > > >another major issue > > > > > > Ok I have progressed a bit further I am able to make a frame all around > > > the figure and only figure. > > > > > > <xsl:attribute-set name="figure.properties" > > > use-attribute-sets="formal.object.properties"> > > > <xsl:attribute name="border-color">black</xsl:attribute> > > > <xsl:attribute name="border-style">solid</xsl:attribute> > > > </xsl:attribute-set> > > > > > > <xsl:template match="figure"> > > > <fo:block xsl:use-attribute-sets="figure.properties"> > > > <xsl:apply-templates/> > > > </fo:block> > > > </xsl:template> > > > > > > > > > The only thing missing is the Figure title ie "Figure 1.1 Bla Bla" > > > > > >The problem is that your new match="figure" template > >overwrites the original, which called the "formal.object" > >template which produced the title. > >That's why I suggested customizing formal.object instead: > > > ><xsl:template name="formal.object"> > > <xsl:param name="placement" select="'before'"/> > > > > <xsl:variable name="id"> > > <xsl:call-template name="object.id"/> > > </xsl:variable> > > > > <fo:block id="{$id}" > > xsl:use-attribute-sets="formal.object.properties"> > > <xsl:if test="$placement = 'before'"> > > <xsl:call-template name="formal.object.heading"/> > > </xsl:if> > > <xsl:if test="local-name(.) = 'figure'"> <!-- new --> > > <fo:block xsl:use-attribute-sets="figure.properties"> <!-- new --> > > <xsl:apply-templates/> <!-- new --> > > </fo:block> <!-- new --> > > </xsl:if> <!-- new --> > > <xsl:if test="$placement != 'before'"> > > <xsl:call-template name="formal.object.heading"/> > > </xsl:if> > > </fo:block> > ></xsl:template> > > > >You need to test for 'figure' since formal.object is > >used for example and table too. > >Combined with your 'figure.properties' attribute-set, > >this should work. > > > >-- > > > >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 >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC