From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30581 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: xpos.sty Date: Wed, 30 Aug 2006 01:32:35 +0200 Message-ID: <44F4CE93.8020001@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="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1156894474 26553 80.91.229.2 (29 Aug 2006 23:34:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Aug 2006 23:34:34 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 30 01:34:27 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1GID4m-0005eV-HQ for gctc-ntg-context-518@m.gmane.org; Wed, 30 Aug 2006 01:33:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E21121FE41; Wed, 30 Aug 2006 01:32:59 +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 18985-02-3; Wed, 30 Aug 2006 01:32:51 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BC1721FE35; Wed, 30 Aug 2006 01:32:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 548581FE35 for ; Wed, 30 Aug 2006 01:32:47 +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 18985-02-2 for ; Wed, 30 Aug 2006 01:32:38 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by ronja.ntg.nl (Postfix) with SMTP id 407D61FE27 for ; Wed, 30 Aug 2006 01:32:37 +0200 (CEST) Original-Received: from [10.100.1.103] (unverified [10.100.1.103]) by controller-1 (SurgeMail 3.7b8) with ESMTP id 3880 for ; Wed, 30 Aug 2006 01:32:36 +0200 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) Original-To: mailing list for ConTeXt users In-Reply-To: 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.7 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:30581 Archived-At: Paul Jones wrote: > > Thank you again for very timely and great answers to my question > yesterday. I am finding that implementing things in Context is > usually easier than I expect. This is very nice. Our company decided > to switch to context from latex recently. It seems to have been a > very good decision. Thanks for all the work you do to make context so > fun to use. > > We have one last thing to get translated from latex to context. David > Kastrup wrote a bit of latex for us (included below) that magically > writes out the absolute xy position of each paragraph and image to a > log file for us. We pass some extra information to the commands that > get put in the log file for us, but in the end we mainly need a way to > get the absolute xy coordinates of the bounding boxes for each > paragraph, each section title, each image and each image caption. Is > there a way to get this information with context already? Or do I need > to get a new module written? i dunno about that code but context has support for positions for years now, in your case you probably need something \starttext \let\CurrentPos\empty \def\StartPos#1% {\pushmacro\CurrentPos \edef\CurrentPos{mypos:#1}% \dontleavehmode\bpos\CurrentPos \ignorespaces} \def\StopPos {\removeunwantedspaces \epos\CurrentPos \popmacro\CurrentPos} \def\BoxPos#1% {\dowithnextbox{\hbox{\hpos{mypos:#1}{\box\nextbox}}}\vbox} \StartPos{x}\input tufte \StopPos \StartPos{y}\input zapf \StopPos \placefigure {} {\BoxPos{q}{\framed[width=3cm,height=4cm]{}}} \stoptext in the *.tui/tuo file you can grep for mypos ----------------------------------------------------------------- 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 -----------------------------------------------------------------