[texhax] current position in output

Uwe Lück uwe.lueck at web.de
Sun Dec 28 02:59:48 CET 2008


At 16:53 27.12.08, Cihan . wrote:
>
>Is there any command or way to get the current output position (xy 
>coordinate) of things. I need a comand that can capture the position like
>
>\xyposition{words or things in there}
>\currentpagenumber
>
>so i can use them in a if command and create the output as I want. Or, is 
>there a way to writing these information to .aux file and using them by 
>reruning LaTeX. Although LaTeX is doing the page layout, I need more 
>control on position of things in output.

... a very inspiring and/or hard question.

One thing: what /units/ do you want to should the coordinates measured by?

Y. One possibility for y: unit /line number/.
With the lineno package, you can mark a position by, e.g., 
\linelabel{whoohoo!}.
At the second LaTeX run after doing this, \pageref {whoohoo!} will obtain
the page number of that position, and \ref{whoohoo!} will obtain its line 
number
on the same page. (On special occasions only, \thepage my work like 
\pageref{whoohoo!}.)

Y-. What is a `line'? (a) LaTeX offers in-line tables, such a table 
occupies a single `line'
(numbering lines will ignore such tables). (b) Alternatively, you may want 
to consider each row of a table a `line', this may change counting `lines' 
-- (c) or even: cells of tables may have more lines than one, and you may 
want to count them too -- oh, please, no!

Y+. One might think of a /geometrical/ unit like: "how many pt below the
top of the page is ...'' ... very hard ... my advice: forget it!
[or ask Donald Arseneau and/or David Kastrup]

X. As for the `x' coordinate, the previous approach may provoke questions
"How far is it from here to the left margin, or to the right margin?"
A question like this once was discussed here ... I gave an idea,
but how much money will you give for ...!??

Z. As for coordinates in terms of pt, TeX will be little helpful,
but perhaps PDFTeX can help you!?

... ahm,

     Uwe.



More information about the texhax mailing list