Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to get the exact page number (or several page numbers if it spreads so) in the generated PDF document for a particular LaTeX environment (say, \begin{figure} ...\end{figure}) after compilation? Editing the corresponding LaTeX source file (e.g. injecting some specific marks) is available for that purpose.

Update: Is pdfsync helpful for that?

share|improve this question
2  
I'm not sure what you want to achieve. You can have, when using TeXShop the option of jumping from the .pdf file to the corresponding position in the .tex file. Is this what you meant? –  Dror Jul 13 '11 at 10:39
    
Yes, it is. That's why now I see that pdfsync seems to be relevant. –  Nikita Zhiltsov Jul 13 '11 at 11:05
3  
pdfsync (the package) is obsolete. Recent TeX implementations use SyncTeX, how to benefit from it depends on your system configuration. –  egreg Jul 13 '11 at 11:45
1  
Welcome to TeX.sx! A tip: you can use backticks ` to mark your inline code as I did in my edit. –  Martin Scharrer Jul 13 '11 at 12:03
add comment

2 Answers

The zref package (oberdiek bundle) gives you several macros to label and reference basically anything in a document. This includes \zlabel and \zpageref. The zref-abspage and zref-abspos module gives you the exact position in the PDF. These values can be extracted in a plain form and are stored in the .aux file. I used it to jump from my document to specific pages with specific zoom levels in an external PDF which I couldn't influence myself.

Note that the normal \pageref will give you the logical page number, while you most likely need the absolute page number. Both will not be the same of you reset the page number counter, e.g. for roman numbering of the frontmatter.

share|improve this answer
add comment

By using labels, you can refer to a specific use of the environment by its page number.

See the use of the \pageref command in http://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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