[texhax] zref-savepos in landscape mode

Heiko Oberdiek heiko.oberdiek at googlemail.com
Thu Feb 13 14:54:35 CET 2014


On 12.02.2014 22:50, Bob Tennent wrote:
> 
> I'm getting inconsistent behaviour between latex and pdflatex for
> the following MWE:
> 
> 
> \documentclass[legalpaper,landscape]{article}
> \usepackage{geometry}
> \geometry{noheadfoot,margin=0.5in}
> \usepackage{zref-savepos}
> \usepackage{lipsum}
> \begin{document}
> 
> \lipsum[1]
> 
> \lipsum[2]\zsavepos{here}
> 
> \lipsum[3]
> 
> \zposy{here}
> 
> \end{document}
> 
> I believe pdflatex is producing the right output. Am I doing
> something wrong?

The orientation of the y-axis of \pdfsavepos follows the
convention of the output media (PDF, PostScript), lower values
are at the bottom. However TeX's origin starts from the top of the
page. Therefore the absolute y-values depends on the size of the
paper. If the document is compiled with pdfTeX in PDF mode, then
the media size is made known by setting \pdfpagewidth and
\pdfpageheight. However, the DVI format misses an essential
feature, the paper size, Thus TeX has no clue, how large the
page really is. Only the drivers can be informed via \special.

Therefore it is not safe to rely on absolute values that can
be obtained via \pdfsavepos. It is better to use a reference
point and to use relative positions.

Yours sincerely
  Heiko Oberdiek



More information about the texhax mailing list