ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Weird godown, dorecurse, colors and page-fitting interaction
@ 2005-12-05 18:58 Adam Lindsay
  2005-12-06 10:00 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Lindsay @ 2005-12-05 18:58 UTC (permalink / raw)


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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird godown, dorecurse, colors and page-fitting interaction
  2005-12-05 18:58 Weird godown, dorecurse, colors and page-fitting interaction Adam Lindsay
@ 2005-12-06 10:00 ` Hans Hagen
  2005-12-06 10:06   ` Taco Hoekwater
  2005-12-06 12:53   ` Adam Lindsay
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Hagen @ 2005-12-06 10:00 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird godown, dorecurse, colors and page-fitting interaction
  2005-12-06 10:00 ` Hans Hagen
@ 2005-12-06 10:06   ` Taco Hoekwater
  2005-12-06 12:53   ` Adam Lindsay
  1 sibling, 0 replies; 4+ messages in thread
From: Taco Hoekwater @ 2005-12-06 10:06 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Weird godown, dorecurse, colors and page-fitting interaction
  2005-12-06 10:00 ` Hans Hagen
  2005-12-06 10:06   ` Taco Hoekwater
@ 2005-12-06 12:53   ` Adam Lindsay
  1 sibling, 0 replies; 4+ messages in thread
From: Adam Lindsay @ 2005-12-06 12:53 UTC (permalink / raw)


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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-06 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-05 18:58 Weird godown, dorecurse, colors and page-fitting interaction Adam Lindsay
2005-12-06 10:00 ` Hans Hagen
2005-12-06 10:06   ` Taco Hoekwater
2005-12-06 12:53   ` Adam Lindsay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).