List Info

Thread: Header out of alignment - space before graphic




Header out of alignment - space before graphic
user name
2007-04-02 05:19:59
I've implemented a three-celled header as described at
http://www.sagehill.net/docbookxsl/PrintHe
aders.html#PrintHeadersText; the
left cell contains a graphic, while the right one contains
the name of the
current chapter. 

All is well except there's unexplained space above the
graphic, which means
it's not level with the chapter name (see
h
ttp://img47.imageshack.us/img47/1728/headered8.png)

The graphic has the following settings:

          <fo:external-graphic height="1.42cm"
padding-before="0cm"
padding-after="0cm" padding-start="0cm"
padding-top="0cm"
padding-bottom="0cm" padding-end="0cm" 
content-height="1.42cm"
display-align="bottom">
 etc...

I also set the region.before.extent value to 1.5cm. However,
the space
before the graphic pushs it down over the body text, meaning
that (as a
workaround) I had to set page.margin.top to 0cm (that is,
the very top of
the page). 

The section of my custom layer dealing with headers is at:

http://www.pasteserver
.net/824

An extract from the resulting FO file showing a typical
header table is at:

http://www.pasteserver
.net/825

Regards,

P.
-- 
View this message in context: http://www.nabble.co
m/Header-out-of-alignment---space-before-graphic-tf3504806.h
tml#a9788090
Sent from the docbook apps mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-04 03:31:05
Hi Paul,
There are some property problems in the table content:

display-align="bottom"
text-align="bottom"

but I don't think those are the problem.  You might try
adding a background 
color to the table cell, and add borders around the cell,
block, and 
external-graphic to see what is contributing the space.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobssagehill.net


----- Original Message ----- 
From: "Paul Moloney" <paul_moloneyhotmail.com>
To: <docbook-appslists.oasis-open.org>
Sent: Monday, April 02, 2007 2:19 AM
Subject: [docbook-apps] Header out of alignment - space
before graphic


>
> I've implemented a three-celled header as described at
> http://www.sagehill.net/docbookxsl/PrintHe
aders.html#PrintHeadersText; 
> the
> left cell contains a graphic, while the right one
contains the name of 
> the
> current chapter.
>
> All is well except there's unexplained space above the
graphic, which 
> means
> it's not level with the chapter name (see
> h
ttp://img47.imageshack.us/img47/1728/headered8.png)
>
> The graphic has the following settings:
>
>          <fo:external-graphic
height="1.42cm" padding-before="0cm"
> padding-after="0cm"
padding-start="0cm" padding-top="0cm"
> padding-bottom="0cm"
padding-end="0cm" 
content-height="1.42cm"
> display-align="bottom">
> etc...
>
> I also set the region.before.extent value to 1.5cm.
However, the space
> before the graphic pushs it down over the body text,
meaning that (as a
> workaround) I had to set page.margin.top to 0cm (that
is, the very top of
> the page).
>
> The section of my custom layer dealing with headers is
at:
>
> http://www.pasteserver
.net/824
>
> An extract from the resulting FO file showing a typical
header table is 
> at:
>
> http://www.pasteserver
.net/825
>
> Regards,
>
> P.
> -- 
> View this message in context: 
> http://www.nabble.co
m/Header-out-of-alignment---space-before-graphic-tf3504806.h
tml#a9788090
> Sent from the docbook apps mailing list archive at
Nabble.com.
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org
>
>
> 



------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-12 11:01:45
Re: Header out of alignment - space before graphic
user name
2007-04-12 11:01:45

Bob Stayton wrote:
> 
> but I don't think those are the problem.  You might try
adding a
> background 
> color to the table cell, and add borders around the
cell, block, and 
> external-graphic to see what is contributing the
space.

Hi Bob,

Only got back to this problem now.... I tried your
suggestion, and the
result is at
http://img175.imageshack.us/my.php?image=headerw
ithcolorle3.png. It just
seems that something is forcing space before (and indeed, a
small amount of
space after) the left-hand graphic. (The yellow and blue
colors indicate the
left-most and right-most cells in the header table,
respectively, while the
left-hand pink indicates the background of the graphic).
Nothing in the .fo
file seemed to indicates where this space is from.

Then I remembered an answer you gave to a previous question
I had about
unwanted space before graphics
(http://www.nabble.com/forum/ViewPost.jtp?post=
9620007&framed=y)  so I
edited the .fo and, for the header cell containing the
graphic, set both
line-height and font-size to zero. That works! Result is
here:
http://img239.imageshack.us/img239/365/headerw
ithcolorafterxo6.png

Unfortunately, I have _no_ idea how to do this in my custom
layer.  The
instructions at
http://www.sagehill.net/docbookxsl/PrintHea
ders.html#PrintHeadersText don't
seem to indicate that such a problem might happen, and only
describes how to
specify the content of the cells, and not the attributes of
the cells
themselves. Any ideas? Is there perhaps a setting in my
custom layer which
is causing this problem?

Thanks,

P.
-- 
View this message in context: http://www.nabble.co
m/Header-out-of-alignment---space-before-graphic-tf3504806.h
tml#a9962233
Sent from the docbook apps mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-12 11:59:16
Ah, I forgot that there's another fo:block above what you put in header.content:

&nbsp; &nbsp; &nbsp; &nbsp;   ;  <fo:block>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  <xsl:call-template name=";header.content"&gt;
 &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   <xsl:with-param name=";pageclass&quot; select=&quot;$pageclass"/&gt;
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  <xsl:with-param name=";sequence&quot; select=&quot;$sequence"/>;
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; <xsl:with-param name=";position&quot; select=&quot;'left'";/>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  <xsl:with-param name=";gentext-key" select=&quot;$gentext-key"/>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  </xsl:call-template>
 ; &nbsp; &nbsp; &nbsp; &nbsp;   </fo:block>

You can disregard my previous reply, then. ; Bob's solution is better

Colin

On 4/12/07, Bob Stayton < bobssagehill.net">bobssagehill.net> wrote:
Hi Paul,
Actually, it is the fo:block inside the cell that is applying the inherited
font-size and line-height, probably from the header.content.properties
attribute-set, which is applied to the fo:block that contains the header
table.

In header.content, you should be able to use <xsl:attribute> elements as
the first thing in each <xsl:when> clause to apply attributes to the
fo:block containing that content.&nbsp; Any xsl:attribute elements must come
first when a block is started, before any content.

  ;<xsl:when test=";$position ..."&gt;
 &nbsp;  <xsl:attribute name=";line-height">0pt</xsl:attribute&gt;
 &nbsp;  <xsl:attribute name=";font-size&quot;>0pt</xsl:attribute>;
 &nbsp;  <fo:external-graphic ...


Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobssagehill.net">bobssagehill.net


----- Original Message -----
From: "Paul Moloney&quot; < paul_moloneyhotmail.com">paul_moloneyhotmail.com>
To: < docbook-appslists.oasis-open.org">docbook-appslists.oasis-open.org>
Sent: Thursday, April 12, 2007 8:01 AM
Subject: Re: [docbook-apps] Header out of alignment - space before graphic


>
>
&gt; Bob Stayton wrote:
>;>
>&gt; but I don't think those are the problem.&nbsp; You might try adding a
>&gt; background
>> color to the table cell, and add borders around the cell, block, and
>&gt; external-graphic to see what is contributing the space.
>;
> Hi Bob,
>
> Only got back to this problem now.... I tried your suggestion, and the
> result is at
> http://img175.imageshack.us/my.php?image=headerwithcolorle3.png. It just
> seems that something is forcing space before (and indeed, a small amount
&gt; of
> space after) the left-hand graphic. (The yellow and blue colors indicate
&gt; the
> left-most and right-most cells in the header table, respectively, while
> the
> left-hand pink indicates the background of the graphic). Nothing in the
> .fo
> file seemed to indicates where this space is from.
>
> Then I remembered an answer you gave to a previous question I had about
> unwanted space before graphics
&gt; ( http://www.nabble.com/forum/ViewPost.jtp?post=9620007&framed=y so I
> edited the .fo and, for the header cell containing the graphic, set both
> line-height and font-size to zero. That works! Result is here:
&gt; http://img239.imageshack.us/img239/365/headerwithcolorafterxo6.png
>
>; Unfortunately, I have _no_ idea how to do this in my custom layer.&nbsp; The
> instructions at
> http://www.sagehill.net/docbookxsl/PrintHeaders.html#PrintHeadersText
> don't
> seem to indicate that such a problem might happen, and only describes how
> to
> specify the content of the cells, and not the attributes of the cells
> themselves. Any ideas? Is there perhaps a setting in my custom layer
> which
> is causing this problem?
&gt;
> Thanks,
&gt;
> P.
> --
> View this message in context:
&gt; http://www.nabble.com/Header-out-of-alignment---space-before-graphic-tf3504806.html#a9962233
&gt; Sent from the docbook apps mailing list archive at Nabble.com.
>
>;
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org">docbook-apps-helplists.oasis-open.org
>
>;
>



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org">docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-12 12:50:00
Hi Paul,
Actually, it is the fo:block inside the cell that is
applying the inherited 
font-size and line-height, probably from the
header.content.properties 
attribute-set, which is applied to the fo:block that
contains the header 
table.

In header.content, you should be able to use
<xsl:attribute> elements as 
the first thing in each <xsl:when> clause to apply
attributes to the 
fo:block containing that content.  Any xsl:attribute
elements must come 
first when a block is started, before any content.

  <xsl:when test="$position ...">
    <xsl:attribute
name="line-height">0pt</xsl:attribute>
    <xsl:attribute
name="font-size">0pt</xsl:attribute>
    <fo:external-graphic ...


Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobssagehill.net


----- Original Message ----- 
From: "Paul Moloney" <paul_moloneyhotmail.com>
To: <docbook-appslists.oasis-open.org>
Sent: Thursday, April 12, 2007 8:01 AM
Subject: Re: [docbook-apps] Header out of alignment - space
before graphic


>
>
> Bob Stayton wrote:
>>
>> but I don't think those are the problem.  You might
try adding a
>> background
>> color to the table cell, and add borders around the
cell, block, and
>> external-graphic to see what is contributing the
space.
>
> Hi Bob,
>
> Only got back to this problem now.... I tried your
suggestion, and the
> result is at
> http://img175.imageshack.us/my.php?image=headerw
ithcolorle3.png. It just
> seems that something is forcing space before (and
indeed, a small amount 
> of
> space after) the left-hand graphic. (The yellow and
blue colors indicate 
> the
> left-most and right-most cells in the header table,
respectively, while 
> the
> left-hand pink indicates the background of the
graphic). Nothing in the 
> .fo
> file seemed to indicates where this space is from.
>
> Then I remembered an answer you gave to a previous
question I had about
> unwanted space before graphics
> (http://www.nabble.com/forum/ViewPost.jtp?post=
9620007&framed=y)  so I
> edited the .fo and, for the header cell containing the
graphic, set both
> line-height and font-size to zero. That works! Result
is here:
> http://img239.imageshack.us/img239/365/headerw
ithcolorafterxo6.png
>
> Unfortunately, I have _no_ idea how to do this in my
custom layer.  The
> instructions at
> http://www.sagehill.net/docbookxsl/PrintHea
ders.html#PrintHeadersText 
> don't
> seem to indicate that such a problem might happen, and
only describes how 
> to
> specify the content of the cells, and not the
attributes of the cells
> themselves. Any ideas? Is there perhaps a setting in my
custom layer 
> which
> is causing this problem?
>
> Thanks,
>
> P.
> -- 
> View this message in context: 
> http://www.nabble.co
m/Header-out-of-alignment---space-before-graphic-tf3504806.h
tml#a9962233
> Sent from the docbook apps mailing list archive at
Nabble.com.
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org
>
>
> 



------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-12 11:56:11
Hi Paul,

I have had this problem before, where I had to set the font-size to 0pt to prevent unwanted space before and after images.

All that it requires is an fo:block with this property:

<fo:block font-size="0pt&quot;/>

If you're customizing the header.content template, simply surround the desired content with one of these fo:blocks; i.e:

<xsl:template name=";header.content"&gt;
  ...
  <xsl:when test=";$sequence = 'first'">
&nbsp; &nbsp; <fo:block font-size="0pt&quot;>
&nbsp; &nbsp;   ...content...
 &nbsp;  </fo:block>
&nbsp; </xsl:when>
&nbsp; ...
</xsl:template>

I think that will be all that is necessary... by specifying font-size="0pt&quot; on a block within a header table cell, I don't think you will actually need to do anything to the table-cell itself.&nbsp; If you find that this doesn't work, however, and you'd like to try customizing the table-cell itself, then search pagesetup.xsl for the template called header.table.  Copy it to your customization layer, and work with it as necessary.

I hope that helps.

Colin

On 4/12/07, Paul Moloney < paul_moloneyhotmail.com">paul_moloneyhotmail.com> wrote:


Bob Stayton wrote:
>;
> but I don't think those are the problem.&nbsp; You might try adding a
> background
> color to the table cell, and add borders around the cell, block, and
> external-graphic to see what is contributing the space.

Hi Bob,

Only got back to this problem now.... I tried your suggestion, and the
result is at
http://img175.imageshack.us/my.php?image=headerwithcolorle3.png . It just
seems that something is forcing space before (and indeed, a small amount of
space after) the left-hand graphic. (The yellow and blue colors indicate the
left-most and right-most cells in the header table, respectively, while the
left-hand pink indicates the background of the graphic). Nothing in the .fo
file seemed to indicates where this space is from.

Then I remembered an answer you gave to a previous question I had about
unwanted space before graphics
(http://www.nabble.com/forum/ViewPost.jtp?post=9620007&amp;framed=y) &nbsp;so I
edited the .fo and, for the header cell containing the graphic, set both
line-height and font-size to zero. That works! Result is here:
http://img239.imageshack.us/img239/365/headerwithcolorafterxo6.png

Unfortunately, I have _no_ idea how to do this in my custom layer.&nbsp; The
instructions at
http://www.sagehill.net/docbookxsl/PrintHeaders.html#PrintHeadersText don't
seem to indicate that such a problem might happen, and only describes how to
specify the content of the cells, and not the attributes of the cells
themselves. Any ideas? Is there perhaps a setting in my custom layer which
is causing this problem?

Thanks,

P.
--
View this message in context: http://www.nabble.com/Header-out-of-alignment---space-before-graphic-tf3504806.html#a9962233
Sent from the docbook apps mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org"> docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org">docbook-apps-helplists.oasis-open.org


Re: Header out of alignment - space before graphic
user name
2007-04-12 13:41:16
Hi Colin,
Actually, I think either method should work. As long as the outer blocks don't have any content of their own, their font properties should not affect the spacing.
 
Bob Stayton
Sagehill Enterprises
DocBook Consulting
sagehill.net">bobssagehill.net
&nbsp;
 ;
----- Original Message -----
Sent: Thursday, April 12, 2007 8:59 AM
Subject: Re: [docbook-apps] Header out of alignment - space before graphic

Ah, I forgot that there's another fo:block above what you put in header.content:

&nbsp; &nbsp; &nbsp; &nbsp;   ;  <fo:block>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  <xsl:call-template name="header.content">
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  <xsl:with-param name="pageclass" select="$pageclass"/&gt;
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; <xsl:with-param name="sequence" select="$sequence"/&gt;
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <xsl:with-param name="position" select="'left'"/>
  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; <xsl:with-param name="gentext-key" select="$gentext-key"/>
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; </xsl:call-template>
 ; &nbsp; &nbsp; &nbsp; &nbsp;   </fo:block>

You can disregard my previous reply, then. ; Bob's solution is better

Colin

On 4/12/07, Bob Stayton < bobssagehill.net">bobssagehill.net> wrote:
Hi Paul,
Actually, it is the fo:block inside the cell that is applying the inherited
font-size and line-height, probably from the header.content.properties
attribute-set, which is applied to the fo:block that contains the header
table.

In header.content, you should be able to use <xsl:attribute> elements as
the first thing in each <xsl:when> clause to apply attributes to the
fo:block containing that content.&nbsp; Any xsl:attribute elements must come
first when a block is started, before any content.

  ;<xsl:when test="$position ...">
&nbsp;   ;<xsl:attribute name="line-height">;0pt</xsl:attribute>
   ; <xsl:attribute name="font-size">0pt</xsl:attribute&gt;
 &nbsp; &nbsp;<fo:external-graphic ...


Bob Stayton
Sagehill Enterprises
DocBook Consulting
sagehill.net">bobssagehill.net


----- Original Message -----
From: "Paul Moloney" < hotmail.com">paul_moloneyhotmail.com>
To: <lists.oasis-open.org">docbook-appslists.oasis-open.org>
Sent: Thursday, April 12, 2007 8:01 AM
Subject: Re: [docbook-apps] Header out of alignment - space before graphic


>
>
&gt; Bob Stayton wrote:
>;>
>&gt; but I don't think those are the problem.&nbsp; You might try adding a
>> background
>> color to the table cell, and add borders around the cell, block, and
>&gt; external-graphic to see what is contributing the space.
>;
> Hi Bob,
>
> Only got back to this problem now.... I tried your suggestion, and the
> result is at
> http://img175.imageshack.us/my.php?image=headerwithcolorle3.png. It just
> seems that something is forcing space before (and indeed, a small amount
> of
> space after) the left-hand graphic. (The yellow and blue colors indicate
&gt; the
> left-most and right-most cells in the header table, respectively, while
> the
> left-hand pink indicates the background of the graphic). Nothing in the
> .fo
> file seemed to indicates where this space is from.
>
> Then I remembered an answer you gave to a previous question I had about
> unwanted space before graphics
&gt; ( http://www.nabble.com/forum/ViewPost.jtp?post=9620007&amp;framed=y) &nbsp;so I
> edited the .fo and, for the header cell containing the graphic, set both
> line-height and font-size to zero. That works! Result is here:
> http://img239.imageshack.us/img239/365/headerwithcolorafterxo6.png
>
>; Unfortunately, I have _no_ idea how to do this in my custom layer.&nbsp; The
> instructions at
> http://www.sagehill.net/docbookxsl/PrintHeaders.html#PrintHeadersText
> don't
> seem to indicate that such a problem might happen, and only describes how
> to
> specify the content of the cells, and not the attributes of the cells
> themselves. Any ideas? Is there perhaps a setting in my custom layer
> which
> is causing this problem?
&gt;
> Thanks,
&gt;
> P.
> --
> View this message in context:
&gt; http://www.nabble.com/Header-out-of-alignment---space-before-graphic-tf3504806.html#a9962233
> Sent from the docbook apps mailing list archive at Nabble.com.
>
>;
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: lists.oasis-open.org">docbook-apps-helplists.oasis-open.org
>
>;
>



---------------------------------------------------------------------
To unsubscribe, e-mail: lists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: lists.oasis-open.org">docbook-apps-helplists.oasis-open.org


[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )