From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23768 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Two framed texts on the same line Date: Fri, 25 Nov 2005 15:32:02 +0100 Message-ID: <43872062.5060704@wxs.nl> References: <1191176180.20051125121527@iol.it> <43870BDE.1080601@wxs.nl> <1382468175.20051125152004@iol.it> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1132929183 2594 80.91.229.2 (25 Nov 2005 14:33:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2005 14:33:03 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 25 15:32:58 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EfecS-0001K9-UY for gctc-ntg-context-518@m.gmane.org; Fri, 25 Nov 2005 15:32:09 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 927F112887; Fri, 25 Nov 2005 15:32:08 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05434-01-2; Fri, 25 Nov 2005 15:32:05 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 03C8F1287C; Fri, 25 Nov 2005 15:32:05 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 35EC01287C for ; Fri, 25 Nov 2005 15:32:04 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05434-01 for ; Fri, 25 Nov 2005 15:32:02 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id B44CA12878 for ; Fri, 25 Nov 2005 15:32:02 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 4901 for ; Fri, 25 Nov 2005 15:36:34 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <1382468175.20051125152004@iol.it> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:23768 Archived-At: Giuseppe Bilotta wrote: >Friday, November 25, 2005 Hans Hagen wrote: > > > >>depends a bit on the usage; the following shows you a few tricks >> >> > > > >>\defineframedtext >> [gb] >> [align=raggedright, >> width=.5\textwidth, >> offset=0pt, >> frame=off, >> before=, >> after=] >> >> > > > >>\startbuffer[left] >>\startgb[none] >>\input tufte >>\stopgb >>\stopbuffer >> >> > > > >>\startbuffer[right] >>\startgb[none] >>\input zapf >>\stopgb >>\stopbuffer >> >> > > > >>\starttext >> >> > > > >>\input tufte >> >> > > > >>\definepairedbox[gb][location={right,top}] >> >> > > > >>\startbaselinecorrection >>\placepairedbox[gb] >> {\getbuffer[left]} >> {\getbuffer[right]} >>\stopbaselinecorrection >> >> > > > >>\input zapf >> >> > > > >>\stoptext >> >> > >Oh, interesting this pairedbox thing (it's undocumented, >though). I was hoping to be able to do it like this: > >\defineframedtext[lepi][align=raggedright,width=fit,offset=0pt,frame=off,location=left] >\defineframedtext[repi][align=raggedright,width=fit,offset=0pt,frame=off,location=right] >\definepairedbox[epi][location={right,top}] > >\placepairedbox[epi] >{\startlepi >{\bf Coordinatore}\par >prof. F.~Nicolosi >\stoplepi} >{\startrepi >{\bf Tutor}\par >prof. G.~Russo >\stoprepi} > >But it won't work because the second box (repi) gets placed >with its LEFT margin on the right margin of the page, >whereas I needed to be with its right margin at the right >margin of the page. I think the problem is that, from what I >get by reading the source, in paired boxes are not treated >equally. > > no, you need to bypass the location handling in framed texts so, replacing left and right by none should do the trick, however, i found out that this demands an extra line of code in core-rul.tex (see 'newer' below) \def\dodostopframedtext#1#2% % no \baselinecorrection, see faq docs {\endgraf \removelastskip \doifvalue{\??kd#1\c!depthcorrection}\v!on % local and global {\forgetall \vskip-\struttotal \verticalstrut \egroup \forgetall \vskip-\lineheight % will be an option, not default % \setbaselinecorrections % \donegbotbaselinecorrection \verticalstrut} \stopboxedcontent \stopcolor \egroup \doif{#2}\v!none\insidefloattrue % new \doif{\framedtextparameter{#1}\c!location}\v!none\insidefloattrue % newer \ifinsidefloat \box\framebox \else \doplacement[\??kd#1][\c!depthcorrection=\v!off]{\box\framebox}% \fi \egroup} >Basically, the rpbolem seems to be that the width of the >lepi framed text is not the 'natural width' of the text, >despite the width=fit command ... why is this so? > > > see \doplacement in the previous code, you need to have the then branch; placement is for placemen tin the running text (and looks at the text width) Hans