ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Paul Jones" <shagreel@gmail.com>
Subject: Re: xpos.sty
Date: Fri, 1 Sep 2006 20:44:29 -0600	[thread overview]
Message-ID: <f35545860609011944h5ddbc0fet9afb926945cd827c@mail.gmail.com> (raw)
In-Reply-To: <44F4CE93.8020001@wxs.nl>


[-- Attachment #1.1: Type: text/plain, Size: 2387 bytes --]

Again, that is exactly what we needed.  Thank you so much.

paul

On 8/29/06, Hans Hagen <pragma@wxs.nl> wrote:
>
> 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
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

[-- Attachment #1.2: Type: text/html, Size: 3681 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

      reply	other threads:[~2006-09-02  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 15:23 xpos.sty Paul Jones
2006-08-29 23:32 ` xpos.sty Hans Hagen
2006-09-02  2:44   ` Paul Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f35545860609011944h5ddbc0fet9afb926945cd827c@mail.gmail.com \
    --to=shagreel@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).