From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/10287 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Weird frame with framedtext Date: Sun, 12 Jan 2003 21:11:44 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <5.1.0.14.1.20030112205906.02e9beb0@remote-1> References: <26905.1041939904@www58.gmx.net> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1042446669 21978 80.91.224.249 (13 Jan 2003 08:31:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 13 Jan 2003 08:31:09 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Xzzv-0005iM-00 for ; Mon, 13 Jan 2003 09:31:07 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 9547810B20; Mon, 13 Jan 2003 09:32:19 +0100 (MET) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id EEA5E10B12 for ; Mon, 13 Jan 2003 09:28:17 +0100 (MET) Original-Received: from server-1.pragma-ade.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.5/pre1.0-MySQL/8.12.5) with ESMTP id h0D8S4E8021099 for ; Mon, 13 Jan 2003 09:28:05 +0100 Original-Received: from LAPTOP-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-ade.nl (8.12.2/8.12.2) with ESMTP id h0D8S3gw003955 for ; Mon, 13 Jan 2003 09:28:05 +0100 X-Sender: hagen-mail@server-1 (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1 Original-To: ntg-context@ntg.nl In-Reply-To: <26905.1041939904@www58.gmx.net> X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:10287 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:10287 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 -------------------------------------------------------------------------