You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Peter B. West" <pb...@powerup.com.au> on 2003/06/05 07:03:56 UTC

Layout transactions

Fopdevs,

With reference to the discussion of footnotes in 
http://xml.apache.org/fop/design/alt.design/footnotes.html
I have been thinking about the notion of a layout transaction.  Inthe 
case of footnotes, a transaction is the addition of a line-area 
containing a footnote.  In the case of the first footnote on the page, 
the transaction incurs the Region b-p-d impact, as noted in Figure 2.

Such a transaction has a minimum and a maximum impact.  Assuming that we 
must place the first line of the footnote on the same page, the minimum 
impact would be the Main b-p-d impact + Footnote b-p-d impact of the 
first line of the footnote (which may include the footnote separator). 
The line-area generator would pass this information up for the decision 
to be made about committing the transaction to the page, requesting a 
transaction with a smaller impact, or declaring the page full, and 
passing the request for a new "canvas" area up the tree to the page 
factory.  In the latter case, the line-area generator would subsequently 
iniatiate a transaction involving only the remainder of the footnote.

This notion of the transaction and the tranaction impact can be extended 
directly to the layout of before-floats and keeps, and, possibly, 
indirectly to side-floats.

Before-floats are handled analogously to footnotes.  They have a 
before-float b-p-d impact (possibly incuding a separator), and a Main 
b-p-d impact.  In the case of before-floats, the float can be postponed 
to the next page, so the minimum impact would include only the 
triggering line-area.

Keeps (including widow and orphan control) can be expressed as a 
transaction involving a number of line areas.  The page and column 
contexts are available, and the appropriate context can be engaged in 
laying out the transaction.  I'll have to give some more thought to the 
way keep strength could be handled in such a scenario.

Peter
-- 
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Peter B. West wrote:
> That hadn't occurred to me.

For clarification: orphan/widow and keeps apply to the
content of footnotes the same way as to normal content. They
are not indented and cannot be used (to my knowledge) to
force footnotes itselef onot specific pages or to keep two
otherwise unrelated footnotes together or something like
this.

J.Pietschmann




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by "Peter B. West" <pb...@powerup.com.au>.
J.Pietschmann wrote:
> 
> Orphan/widow controls as well as keeps apply to footnotes
> too.

That hadn't occurred to me.

-- 
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Glen Mazza wrote:

> "Peter B. West" <pb...@powerup.com.au> wrote:
> 
>>it may be better 
>>if there is only room for a single line of a multi-
> 
> line footnote, to 
> 
>>throw the text line plaus the whole of the footnote
>>onto the next page.
> 
> 
> I think this is the main point of what you were
> writing--avoiding having just one line of a footnote
> with the remainder on the next page--sounds good. 

Orphan/widow controls as well as keeps apply to footnotes
too.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by Glen Mazza <gr...@yahoo.com>.
"Peter B. West" <pb...@powerup.com.au> wrote:
> it may be better 
> if there is only room for a single line of a multi-
line footnote, to 
>throw the text line plaus the whole of the footnote
>onto the next page.

I think this is the main point of what you were
writing--avoiding having just one line of a footnote
with the remainder on the next page--sounds good. 
Thanks for clearing that up.

Thanks,
Glen  

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by "Peter B. West" <pb...@powerup.com.au>.
Glen,

Comments below.

Glen Mazza wrote:
> --- "Peter B. West" <pb...@powerup.com.au> wrote:
> 
>>Such a transaction has a minimum and a maximum
>>impact.  Assuming that we 
>>must place the first line of the footnote on the
>>same page, 
> 
> 
>>The line-area generator would pass this information
>>up for the decision 
>>to be made about committing the transaction to the
>>page, requesting a 
>>transaction with a smaller impact, or declaring the
>>page full, and 
>>passing the request for a new "canvas" area up the
>>tree to the page 
>>factory.  In the latter case, the line-area
>>generator would subsequently 
>>iniatiate a transaction involving only the remainder
>>of the footnote.
>>
> 
> 
> Peter,
> 
> Both your writing here as well as the XSL spec
> indicate that footnotes can extend on to subsequent
> pages (as I guess they must be allowed to, should
> someone insist on a 47-paragraph footnote).  
> 
> But, "curiously" missing from the spec (AFAICT) is any
> indication that it would be preferable to avoid having
> that happen--and I wonder if, consequently, the
> algorithms you are thinking of are not capturing that
> concern.  
> 
> Thinking of the traditional way footnotes appear in
> books, ordinarily as the footnote grows the author
> will choose to shrink the main body of text on that
> page to accomodate the larger footnote.  I believe
> that this is almost invariably deemed preferable to
> avoid the eyesore (?) of having the footnote split
> onto the second page.  (Am I correct here?)  

Yes, it is preferable, but splitting is preferable to leaving a chunk of 
whitespace between the end of the text and the footnote separator.  The 
algorithm I am proposing will accommodate all of the footnote text on 
the page unless the line impact + the footnote impact exceeds available 
space.  It is then up to the page layout process to decide what to do 
with the line+footnote.  Because we are only ever talking about one line 
of main text (not taking account of keeps, widows, etc) it may be better 
  if there is only room for a single line of a multi-line footnote, to 
throw the text line plaus the whole of the footnote onto the next page.

> Perhaps adding to the fun here, this shrinking of the
> main body of text can also result in subsequent
> footnote citations on the page ending up on the next
> page, meaning that the size calculations for its
> footnote would also need to move.  Will the algorithms
> that you are thinking of take care of that?  (I hope
> so--it will be a *long* time before I will understand
> enough about this in order to help out!)

The main text never needs to shrink.  The text and its associated 
footnotes have already been accommodated on the page, and the columns 
re-balanced. This happens after every line of main text is added.  (The 
column "re-balancing" is a trivial operation, the point of which is to 
determine the whether and to what extent the new main text line impacts 
on the size of the main-reference-area.)

So, when a new text line + footnote is added, all that is required is to 
decide wheter, and to what extent, the fit onto the line.  If they do, 
the region BPDim is reduced by main b-p-d impact + footnote b-p-d 
impact.  Unless some condition triggers a multi-page backup and 
re-layout, this need never change, no matter what is subsequently added 
to the page.

If this does not make sense, please let me know, and I will rewrite the 
footnotes section until it becomes clear.

Peter
-- 
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Layout transactions

Posted by Glen Mazza <gl...@yahoo.com>.
--- "Peter B. West" <pb...@powerup.com.au> wrote:
> Such a transaction has a minimum and a maximum
> impact.  Assuming that we 
> must place the first line of the footnote on the
> same page, 

> The line-area generator would pass this information
> up for the decision 
> to be made about committing the transaction to the
> page, requesting a 
> transaction with a smaller impact, or declaring the
> page full, and 
> passing the request for a new "canvas" area up the
> tree to the page 
> factory.  In the latter case, the line-area
> generator would subsequently 
> iniatiate a transaction involving only the remainder
> of the footnote.
> 

Peter,

Both your writing here as well as the XSL spec
indicate that footnotes can extend on to subsequent
pages (as I guess they must be allowed to, should
someone insist on a 47-paragraph footnote).  

But, "curiously" missing from the spec (AFAICT) is any
indication that it would be preferable to avoid having
that happen--and I wonder if, consequently, the
algorithms you are thinking of are not capturing that
concern.  

Thinking of the traditional way footnotes appear in
books, ordinarily as the footnote grows the author
will choose to shrink the main body of text on that
page to accomodate the larger footnote.  I believe
that this is almost invariably deemed preferable to
avoid the eyesore (?) of having the footnote split
onto the second page.  (Am I correct here?)  

Perhaps adding to the fun here, this shrinking of the
main body of text can also result in subsequent
footnote citations on the page ending up on the next
page, meaning that the size calculations for its
footnote would also need to move.  Will the algorithms
that you are thinking of take care of that?  (I hope
so--it will be a *long* time before I will understand
enough about this in order to help out!)

Thanks,
Glen


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org