How can one determine the position of a symbol on the typeset page? Possible uses:

  • One page contains a fill-in-the-blanks text, and the opposite page contains only the solution words, each starting at the same position on the page where the blank started. The blanks on the first page should all be of equal length in order to not reveal any information. It can be assumed that the solution expressions don't overlap (and if they do, one can still manually adjust).
  • relative anchoring: One has typeset a complex diagram or equation, and one then creates a series of transformations. For example, diagram 2 is like diagram 1, but with the complex middle portion simplified so that one can focus on other parts; the relative positioning of certain outer elements of diagram 1 should be the same in diagram 2 to help the reader understand which diagram elements correspond. For this one would need to be able to obtain the coordinates of certain outer elements so that one can subtract them.

Very much related:


The zref package's savepos module uses \pdfsavepos that can save the (x,y) coordinate of a "label" in scaled points (sp). You can then use this to position things on another page, possibly using tikz.

Here's a small example to showcase the savepos module (take from Where is the left-hand margin? and modified slightly):

enter image description here

\usepackage[user,pagelayout,savepos]{zref}% http://ctan.org/pkg/zref

During page shipout, \verb|\oddsidemargin| is
\zref[oddsidemargin]{thepage}sp. (You won't be fooled)



FOO begins at (\zposx{leftanchor}sp, \zposy{leftanchor}sp)
and ends at (\zposx{rightanchor}sp, \zposy{rightanchor}sp).

From the zref documentation:

Horizontal positions by \zposx increase from left to right. Vertical positions by zposy from bottom to top.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.