Weird godown, dorecurse, colors and page-fitting interaction
Hi all, What's happening here? \setupcolors[state=start] \starttext \startTEXpage \dorecurse{2}{abc\godown[0pt]} \stopTEXpage \startTEXpage \startcolor[yellow] \dorecurse{2}{abc\godown[0pt]} \stopcolor \stopTEXpage \stoptext -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adam Lindsay wrote:
Hi all,
What's happening here?
\setupcolors[state=start] \starttext \startTEXpage \dorecurse{2}{abc\godown[0pt]} \stopTEXpage \startTEXpage \startcolor[yellow] \dorecurse{2}{abc\godown[0pt]} \stopcolor \stopTEXpage \stoptext
a long story ... to which ttp wizzard taco might want to add comment ok, a fix first (missing \fi) \def\godown[#1]% {\relax \ifhmode\endgraf\fi \ifvmode\nointerlineskip\vskip#1\relax\fi} what you observe is some interference; the fitting page macros use framed and when you set width and height to fit, it will use the reshaperr to determine the width; this mechanism fails as soon as nodes show up that cannot be \un-whatevered or \last-whatevered; also, some mechanisms have as side effect that they force the box to have a width of \hsize question for taco: how difficult would it be to have something: \squeezebox\scratchbox where the result is a box with a width equal to the max(natural width of lines) (that way we could replace the reshaper and get around those interfering and blocking nodes) you may see some of the side effects when you play with: \starttext \setupcolors[state=start] \startTEXpage \dorecurse{2}{abc\godown[0pt]} \stopTEXpage \startTEXpage[foregroundcolor=yellow] \dorecurse{2}{abc\godown[0pt]} \stopTEXpage \startTEXpage \startcolor[red]\dorecurse{2}{abc\godown[0pt]}\stopcolor \stopTEXpage \startTEXpage[width=fixed] \startcolor[green]\dorecurse{2}{abc\godown[0pt]}\stopcolor \stopTEXpage \startTEXpage[width=fixed] \dorecurse{2}{\startcolor[cyan]abc\stopcolor\godown[0pt]} \stopTEXpage \startTEXpage \dorecurse{2}{\startcolor[magenta]abc\stopcolor\godown[0pt]} \stopTEXpage \startTEXpage \vbox{\startcolor[blue]\dorecurse{2}{abc\godown[0pt]}\stopcolor} \stopTEXpage \stoptext so, there is no real solution unless you use the foreground color or box things yourself Hans
Hans Hagen wrote:
question for taco: how difficult would it be to have something:
\squeezebox\scratchbox
Will think about it. should be doable enough, after all you can do this by hand as well (using \lastbox etc.). Taco
Hans Hagen wrote:
a long story ... to which ttp wizzard taco might want to add comment
ok, a fix first (missing \fi)
\def\godown[#1]% {\relax \ifhmode\endgraf\fi \ifvmode\nointerlineskip\vskip#1\relax\fi}
okay. Those missing \fi's were troubling.
what you observe is some interference; the fitting page macros use framed and when you set width and height to fit, it will use the reshaperr to determine the width; this mechanism fails as soon as nodes show up that cannot be \un-whatevered or \last-whatevered; also, some mechanisms have as side effect that they force the box to have a width of \hsize
Okay, I thought it might be something like that.
you may see some of the side effects when you play with: ... so, there is no real solution unless you use the foreground color or box things yourself
Hmm. Forgroundcolor is not a solution for me, as I'm trying to mix colors (e.g., black + a spot). However, if I go ahead and \hbox each line and \vbox the set, it looks like I have something workable! Thanks, adam -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
participants (3)
-
Adam Lindsay
-
Hans Hagen
-
Taco Hoekwater