[NTG-pdftex] [ pdftex-Bugs-480 ] pdftex offset incorrect with \magnification. Patch included.

noreply at sarovar.org noreply at sarovar.org
Mon Oct 23 19:49:56 CEST 2006

Bugs item #480, was opened at 2006-02-12 17:12
You can respond by visiting: 

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ian Hutchinson (ihutch)
Assigned to: Nobody (None)
Summary: pdftex offset incorrect with \magnification. Patch included.

Initial Comment:
 Any plain tex file that uses
\magnification gives incorrect text placement in pdf.
This bug is present
in the latest pdftex version 1.21a. It apparently was
caused by the
introduction of the new variables \pdfvoffset and
\pdfhoffset. This bug
was not present in older pdftex, e.g. version
3.14159-1.10b, which was
part of tetex-2...

A simple illustration of the problem is with the
trivial file:

\magnification \magstep3
%The following parindent and offset changes are not the
cause of errors.
%They are merely to illustrate them clearly by writing
at top left.
%Anything other than \magstep0 gives a placement error
with pdftex 1.21a.
\parindent 0pt
\hoffset -1 truein
\voffset -1 truein
The top.

With tex and xdvi, the words "The top." are placed at
the immediate top
left. With pdftex 1.21a and xpdf (or acroread) they are
not. With earlier
pdftex 1.10b (e.g.) they are.

I had an extensive discussion on comp.text.tex with
Heiko Oberdiek, most
of which is at

The gist of it is that backward compatibility with
plain tex files is very
important. As far as possible, it should be preserved
Authors should not be required to hack their files in
order for them to
render the same in pdf as in dvi. Moreover there is a
simple way to
provide this compatibility.

A reasonable way to fix the bug is to change pdftex.ini
and hence
pdftex.fmt. (The corresponding pdfetex files ought also
to be fixed.)

A proposed patched pdftex.ini file is attached. It
consists simply of

% Thomas Esser, 1998, 2004. public domain.
    \input pdftexconfig

\input plain

\def\m at g{%
%These commands fix the pdf sizes to be in true units.
\mag at fix\pdfhorigin \mag at fix\pdfvorigin
\mag at fix\pdfpagewidth \mag at fix\pdfpageheight
\def\mag at fix#1{%
 #1=\expandafter\convert at truept\the#1\relax
\def\convert at truept#1PT{%


I don't know who takes responsibility for pdftex.ini.
But clearly this
ought to be fixed for all distributions. I care most
about tetex, because
it is what I use. Thanks,

        Ian Hutchinson


>Comment By: Ian Hutchinson (ihutch)
Date: 2006-10-23 17:49

Logged In: YES 

In response to hanthethanh, let me explain once again that
the point is that TeX ought always to work the same with
both dvi output and pdf output. The latest pdftex breaks
that for all documents, old or new, that use \magnification.
Of course there are many ways the authors can fix those
documents by adding new commands. BUT THEY SHOULD NOT HAVE
TO. TeX's archival integrity is far too valuable for us to
accept it being broken by this incompatibility. I've shown
how it can be transparently fixed. The correction just needs
to be incorporated into the distributions


Comment By: The Thanh Han (hanthethanh)
Date: 2006-10-23 10:37

Logged In: YES 

I propose that if someone changes magnification then he/she
is suppposed to say


or something similar.

An undocumented trick is that if \pdfhorigin or \pdfvorigin
is not set (or set to 0) when the first page is shipped out,
then they will get 1in as the default value. To get zero
origin(s), use 1sp instead of 0.


You can respond by visiting: 

More information about the ntg-pdftex mailing list