From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21655 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Position margin text block near previous paragraph Date: Wed, 27 Jul 2005 09:50:07 +0200 Message-ID: <42E73CAF.1000701@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1122450626 30442 80.91.229.2 (27 Jul 2005 07:50:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2005 07:50:26 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 27 09:50:25 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 1Dxgfb-00032N-2m for gctc-ntg-context-518@m.gmane.org; Wed, 27 Jul 2005 09:49:39 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 88B391281D; Wed, 27 Jul 2005 09:49:38 +0200 (CEST) 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 30546-05; Wed, 27 Jul 2005 09:49:34 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E748312819; Wed, 27 Jul 2005 09:49:33 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4876F12819 for ; Wed, 27 Jul 2005 09:49:33 +0200 (CEST) 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 30493-06 for ; Wed, 27 Jul 2005 09:49:32 +0200 (CEST) Original-Received: from mailrelay02.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 48104127DA for ; Wed, 27 Jul 2005 09:49:31 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j6R7nSgm015278; Wed, 27 Jul 2005 09:49:28 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id E554624C5B; Wed, 27 Jul 2005 09:04:40 +0200 (CEST) Original-Received: from [10.100.1.52] (unknown [10.100.1.52]) by server-1.pragma-net.nl (Postfix) with ESMTP id 9A06A1B332; Wed, 27 Jul 2005 07:04:39 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: Eugene Toporov , mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: ClamAV 0.86.1/993/Tue Jul 26 09:28:36 2005 on mailrelay02 X-Virus-Status: Clean 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21655 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21655 Eugene Toporov wrote: > Hello! > > This time I have a task like this: > > I have margin text blocks (like Note, Tip) that follow some paragraph > in my document flow. > In the produced document I get them in margin, but vertically they are > just below the paragraph (as in text flow) > I really need then to start exactly where the previous paragraph > starts (vertically). I.e. I need to move them several (unknown number) > lines higher. > > My realization: > > \setupinmargin[style=\sl\tx\setupinterlinespace,location=left,align=right] > \def\Note#1{ > \strut > \inmargin{ > \em{#1} > } > \strut} > \starttext > > This is the para with unknown length that can be any number of lines > high. And I have a note below it that should be located to the left of > this paragraph and not just below it. That's the case. \par > > \Note{ And here is the note that should be in margin.} > > \stoptext > > The easiest would to put it above the target paragraph, but that's not > the solution for me as the same text is rendered to HTML where no > margins exist. > > Can I do it plainly in tex code? well, you need to know a bit of tex an dcontext internals -) it takes some 10 lines of code to hack a solution that moves the margin note to the beginning of a paragraph (ok, page crossing are a problem, so there it stays in place) however, the note should be attached to the par! so: text text\inmargin{...} (i suppose that for html you can insert a break before the note) as usual the problem is, how to integrate this (btw, context does have mechanisms for auto-stacking marginal notes that clash, which is why this not too complex to implement; we needed that functionality a few years ago for a huge xml->pdf project) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------