[DVIPDFMx] Re: Strange behavior of zposy

Jin-Hwan Cho jinhwan.cho at gmail.com
Thu Jul 23 19:58:12 KST 2009


Hi, Heiko.

As you pointed out, my example had a mistake. The first line must be

\documentclass[a4paper]{article}

and the example worked fine.

Moreover, I do not think it's a good idea to fix your package.

Thank you very much, ChoF.

On Jul 22, 2009, at 11:46 PM, Heiko Oberdiek wrote:

> Hello,
>
> On Wed, Jul 22, 2009 at 08:42:07PM -0500, Jin-Hwan Cho wrote:
>
>> While I was using pdfcomment.sty written by Josef Kleber, I found a
>> mysterious behavior
>> of the \zposy command in your zref-savepos.sty.
>>
>> The test file was simple as follows:
>>
>> \documentclass{article}
>> \usepackage{zref-savepos}
>> \begin{document}
>> \zsavepos{here}\zposx{here} \zposy{here}
>> \end{document}
>>
>> The result of pdftex (as shown below) was the same in both pdf and  
>> dvi
>> mode.
>>
>> 8799518 47171296
>>
>> However, if I add \usepackage{hyperref} after \usepackage{zref- 
>> savepos},
>> the value of \zposy{here} was changed from 47171296 to 43889459 in  
>> the
>> pdf mode (but not changed in the dvi mode.)
>>
>> The difference is 3281837sp = 50pt. Do you know why this does happen?
>
> Yes. The class article uses paper size letter as default, however
> the usual default of pdfTeX is  a4 for \pdfpageheight and  
> \pdfpagewidth.
> Using hyperref (or geometry) \pdfpageheight and \pdfpagewidth are
> corrected to letter.
>
> 50pt is the difference of 11in (letter) and 297mm (a4paper):
>  3281837sp = 50.07686pt
>
> Thus your example shows that it makes sense to set \pdfpagewidth
> and \pdfpageheight also in DVI mode. (In opposite to PDF, the
> format DVI does not know about paper sizes.)
>  AFAIK all packages currently ignore \pdfpageheight and \pdfpagewidth,
> if pdfTeX is in DVI mode. I will try to fix it for my packages,
> however I don't know a good way yet.
>
> Back to the positioning feature: relative distances between two
> positions are easy to obtain. If you want to use absolute values,
> then you have to look at many parameters: \pdfpagewidth,  
> \pdfpageheight
> in both modes, \pdfhorigin, \pdfvorigin in PDF mode,
> LaTeX registers (\hoffset, \voffset, \topmargin, \oddsidemargin,
> \evensidemargin, ...)
>
> Yours sincerely
>  Heiko <oberdiek at uni-freiburg.de>



More information about the dvipdfmx mailing list