Re: [NTG-context] xpos.sty

2006-09-01 Thread Paul Jones
Again, that is exactly what we needed. Thank you so much.paulOn 8/29/06, Hans Hagen [EMAIL PROTECTED] 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]{}}}
\stoptextin 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.nlhttp://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] xpos.sty

2006-08-29 Thread Paul Jones
Hello,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?
Thanks in advance for any advise,paul[EMAIL PROTECTED][EMAIL PROTECTED] \jobname.pos\relax}[EMAIL PROTECTED]@write#1#2#3{% \begingroup \let\thepage\relax
 #2% [EMAIL PROTECTED]@protect [EMAIL PROTECTED] [EMAIL PROTECTED] \endgroup [EMAIL PROTECTED]}\def\positionwrite{\ifx\protect\@
[EMAIL PROTECTED] \pdfsavepos \else [EMAIL PROTECTED] \fi [EMAIL PROTECTED]@[EMAIL PROTECTED]\def\thexposition{\ifx\thepage\relax \noexpand\thexposition \else [EMAIL PROTECTED] \dimexpr\pdflastxpos sp*\p@/\dimexpr 1bp\relax\relax \fi}
\def\theyposition{\ifx\thepage\relax \noexpand\theyposition \else [EMAIL PROTECTED] \dimexpr(\ifnum\pdfoutput\z@ \pdfpageheight\fi-\pdflastypos sp)% *\p@/\dimexpr 1bp\relax\relax \fi}\def\thexyposition{\thexposition\space\theyposition}
[EMAIL PROTECTED][EMAIL PROTECTED]@x\def\positionhwrite#1{% [EMAIL PROTECTED]@box#1}% \ifhmode [EMAIL PROTECTED] \fi}[EMAIL PROTECTED][EMAIL PROTECTED]
[EMAIL PROTECTED]@ne}[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED][EMAIL PROTECTED]\def\positiontop#1{\positionhwrite{\vadjust pre{\positionwrite{#1
\def\positionbottom#1{\positionhwrite{\vadjust{\positionwrite{#1\def\positionbaseline#1{\positionhwrite{\positionwrite{#1}}}\newcounter{positionpar}\relax\newenvironment{positionpar}[2]{% \par
 [EMAIL PROTECTED]@ [EMAIL PROTECTED] [EMAIL PROTECTED]@ne \ifhmode\expandafter\positiontop \else\expandafter\positionwrite\fi{#1}}%
 [EMAIL PROTECTED]@}% [EMAIL PROTECTED]@endhook}}

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


Re: [NTG-context] xpos.sty

2006-08-29 Thread Hans Hagen
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