julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) (05/15/91)
Can anyone explain to me why TeX sets \pagegoal to the g present at the end of the page breaking algorithm rather than the g for the best break? Here's an example: %% goal height=1288.40509, max depth=4.0 % t=22.0 g=1288.40509 b=10000 p=100 c=100000# % t=34.0 g=1288.40509 b=10000 p=0 c=100000# . . . % t=1042.0 plus 17.0 minus 12.0 g=1063.1112 b=190 p=150 c=440# % t=1054.0 plus 17.0 minus 12.0 g=1063.1112 b=15 p=0 c=115# % t=1066.0 plus 17.0 minus 12.0 g=1063.1112 b=1 p=100 c=201 % split254 to -16.83324,12.0 p=-10000 % t=1078.0 plus 17.0 minus 12.0 g=1051.1112 b=* p=0 c=* > 1051.1112pt. \doublecolumnoutput ...f D\dlr \showthe \pagegoal \global \prevpagegoal =\pa... <output> {\doublecolumnoutput } l.35 I would have expected \pagegoal to equal 1063.1112, and I can think of no use for the value that is heeded. This really messes up an output routine I'm working on! Julian Cowley / U. of Hawaii at Manoa | "God is love." -- John, c. 60 A. D. julian@uhunix.uhcc.hawaii.edu | "All you need is love." -- John, 1967
eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (05/16/91)
julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >Can anyone explain to me why TeX sets \pagegoal to the g present >at the end of the page breaking algorithm rather than the g for >the best break? The \pagegoal is set to the \vsize when the first nondiscardable item is added to the current page. After that it doesn't change, except when an insertion occurs: rather than adding insertions to the \pagetotal they are subtracted from the \pagegoal, which makes sense, because the text of the page has to fit in \vsize so why not decrease that? > Here's an example: >%% goal height=1288.40509, max depth=4.0 >% t=22.0 g=1288.40509 b=10000 p=100 c=100000# >% t=34.0 g=1288.40509 b=10000 p=0 c=100000# ^^^^ > . > . > . >% t=1042.0 plus 17.0 minus 12.0 g=1063.1112 b=190 p=150 c=440# ^^^^ You must have had an insertion between these two lines. >% t=1054.0 plus 17.0 minus 12.0 g=1063.1112 b=15 p=0 c=115# >% t=1066.0 plus 17.0 minus 12.0 g=1063.1112 b=1 p=100 c=201 ^^^^ >% split254 to -16.83324,12.0 p=-10000 ^^^^ >% t=1078.0 plus 17.0 minus 12.0 g=1051.1112 b=* p=0 c=* ^^^^ And this looks like a split insertion, leaving 12pt (that is, one line) to be placed on the current page. Beats me how you can force to split to a negative value, but hey, they're your macros. Anyhow, the \pagegoal is again diminished by 12pt. >I would have expected \pagegoal to equal 1063.1112, and I can If anything you would have had to have expected 1288.40509, is what I think... >This really messes >up an output routine I'm working on! Yes, I know the feeling. >Julian Cowley / U. of Hawaii at Manoa | "God is love." -- John, c. 60 A. D. >julian@uhunix.uhcc.hawaii.edu | "All you need is love." -- John, 1967 Victor Eijkhout.
julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) (05/16/91)
Victor Eijkhout <eijkhout@s41.csrd.uiuc.edu> writes: >julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >>Can anyone explain to me why TeX sets \pagegoal to the g present >>at the end of the page breaking algorithm rather than the g for >>the best break? >The \pagegoal is set to the \vsize when the first nondiscardable item is >added to the current page. After that it doesn't change, except when an >insertion occurs: rather than adding insertions to the \pagetotal they >are subtracted from the \pagegoal, which makes sense, because the text of >the page has to fit in \vsize so why not decrease that? That does make sense, but really what I was after is the height of all insertions present when the \output routine is called. >>% t=1066.0 plus 17.0 minus 12.0 g=1063.1112 b=1 p=100 c=201 > ^^^^ >>% split254 to -16.83324,12.0 p=-10000 > ^^^^ >>% t=1078.0 plus 17.0 minus 12.0 g=1051.1112 b=* p=0 c=* > ^^^^ >And this looks like a split insertion, leaving 12pt (that is, one line) to >be placed on the current page. Beats me how you can force to split to a >negative value, but hey, they're your macros. >Anyhow, the \pagegoal is again diminished by 12pt. And that's the problem. To get the height of all insertions, I expected to use \vsize - \pagegoal, but since \pagegoal is set to something different, I got the wrong answer. However, I've since discovered that I can use the height of \box255, since that's what TeX uses as the final page height sans insertions. In my subject line I contemplated it being a bug, but now I'm not so sure of myself since TeX has been working that way for quite some time without much outcry from users. But, it's something that I wish Knuth had taken into consideration when he decided to make all the \page* primitives available. Julian Cowley / U. of Hawaii at Manoa | "God is love." -- John, c. 60 A. D. julian@uhunix.uhcc.hawaii.edu | "All you need is love." -- John, 1967
eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (05/16/91)
julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >Victor Eijkhout <eijkhout@s41.csrd.uiuc.edu> writes: >>julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >>>Can anyone explain to me why TeX sets \pagegoal to the g present [...] >>The \pagegoal is set to the \vsize when the first nondiscardable item is >>added to the current page. After that it doesn't change, except when an [...] >That does make sense, but really what I was after is the height >of all insertions present when the \output routine is called. You can measure that by just asking for the heights of the insertion boxes. Victor.
julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) (05/21/91)
Victor Eijkhout <eijkhout@s41.csrd.uiuc.edu> writes: >julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >>Victor Eijkhout <eijkhout@s41.csrd.uiuc.edu> writes: >>>julian@uhunix2.uhcc.Hawaii.Edu (Julian Cowley) writes: >>>>Can anyone explain to me why TeX sets \pagegoal to the g present > [...] >>>The \pagegoal is set to the \vsize when the first nondiscardable item is >>>added to the current page. After that it doesn't change, except when an > [...] >>That does make sense, but really what I was after is the height >>of all insertions present when the \output routine is called. >You can measure that by just asking for the heights of >the insertion boxes. Unfortunately, not while \holdinginserts=1, since TeX doesn't put anything in the insertion boxes. What I'm trying to do is design a two-column mode which allows insertions spanning both columns at the top of the page. My thought was that I could find the height of the double insertions without removing any of the other insertions from the vertical list (such as footnotes) by using two passes through the vertical list, one with \count\doubletopins=1000 and a second with \count\doubletopins=0, and using the difference of the page goals. This too has problems, since on the second pass TeX thinks that it can move such an insertion onto the page with no cost to the \pagegoal. If TeX had an easy way to specify which insertions to hold back, or even a way to get the heights of specific insertions while \holdinginserts=1, my problems would be over. I'm now of the conviction that TeX really is inequipped to deal with double columns, at least with regards to inserts. It may be possible to get good results using TeX for general two-column documents, but I think that insertions spanning more than one column add a complexity to the page breaking algorithm that TeX can't handle well. Julian Cowley / U. of Hawaii at Manoa | "God is love." -- John, c. 60 A. D. julian@uhunix.uhcc.hawaii.edu | "All you need is love." -- John, 1967