At 12:45 PM 1/7/2003 +0100, you wrote:
Dear ConTeXt users,
I have some trouble with the document below. It uses framing for some text blocks to make them stand out. In some cases (as with this document) a float preceding the framed text will be framed too. I am using the stable version (2002/12/02), the current beta does not process the document at all (seems to be some problem with \startfiguretext, I think this was discussed earlier).
btw, i uploaded a new beta a few days ago
Does anybody know how to fix this strange behaviour?
You use two quit ecomplicated mechanisms: framed texts and floats. A framed text tries to handle spacing as best as possible even in tricky ircumstances. Such a framed text is something whole, unbreakable (for breakable framing and backgrounds, use \definetextbackground which is something new, experimental, but powerful). A float can migrate to a next page, and in the case of for instance side floats (which you use here) flush preceding floats in order to preserve order. So, what you do is flushing a float inside a box. You're using a main text flow mechanism mixe with a local boxed one, which is asking for problems.
---------- cut here ---------- \setupcolors[state=start] \defineframedtext[info] [frame=on, background=screen, width=\textwidth, framecolor=green]
This is ok.
\starttext
\title{Text}
\dorecurse{20}{A paragraph\par}
\startinfo \startfiguretext[left]{none}{\framed[width=0.8cm,height=0.8cm]{i}} Something important \stopfiguretext \stopinfo
float inside box, but because it's small ... you're lucky
\reservefigure[width=\textwidth,height=\textwidth,frame=on][here]{Caption}
the big pne
\startinfo \startfiguretext[left]{none}{\framed[width=0.8cm,height=0.8cm]{i}} This text should be framed \stopfiguretext \stopinfo
here the big one gets flushed inside the box
\stoptext
So, you need to use another mechanism. I played a bit with tabulate, but this is sub optimal. You could use the sidebyside mechanism, but this is not that flexible. So, back to tabulate. Some tracing: \showframe \showstruts A new macro: \def\toplinebox {\dowithnextbox {\ifdim\dp\nextbox>\strutdepth \scratchdimen\dp\nextbox \advance\scratchdimen-\strutdepth \getnoflines\scratchdimen \struttedbox{\box\nextbox}% \dorecurse\noflines{\vbox{\hsize\zeropoint\strut}}% \else \box\nextbox \fi}% \tbox} The graphic: \startbuffer \toplinebox{\framed[width=0.8cm,height=0.8cm]{i}} \stopbuffer Your challenge: \startinfo \starttabulate[|p|p|] \NC \getbuffer \NC This text should be framed \NC \NR \stoptabulate \stopinfo \startinfo \starttabulate[|p(1cm)|p|] \NC \getbuffer \NC This text should be framed \NC \NR \NC \getbuffer \NC This text should be framed \NC \NR \stoptabulate \stopinfo This works ok for your case, but when the tabulate is not boxed, and when some big graphic is used, one gets funny breaks. So, i patched tabulate to handle: p(fit) as well as something that prevents the funny breaks. Some day this will show up in a beta. Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------