[NTG-pdftex] Possible bug in pdfetexk (re \hoffset)?

Heiko Oberdiek oberdiek at uni-freiburg.de
Sat Jan 28 22:40:41 CET 2006


On Fri, Jan 27, 2006 at 08:09:34PM +0100, Heiko Oberdiek wrote:

> On Fri, Jan 27, 2006 at 06:17:16PM +0000, Philip TAYLOR wrote:
> 
> > Dear all -- The following preamble produces a correctly
> > centered letter using TeX, but PdfTeX appears to offset
> > everything by about 1,5 em (see commented-out \advance
> > at-end).  A sample document follows.

> % pdfTeX also knows \pdfhorigin and \pdfvorigin
> % In my teTeX installation the values are set during generating
> % the format files in pdftexconfig.tex:
> % \pdfhorigin=1 true in
> % \pdfvorigin=1 true in
> % \showthe\pdfhorigin = 72.26999pt
> 
> > \magnification \magstep 1
> 
> % Now the values of \pdfhorigin, pdfvorigin need to be
> % reassigned, see below

> \pdfhorigin = 1 true in
> \pdfvorigin = 1 true in

See also the discussion in the newsgroup comp.text.tex
(pdftex broken in tetex-3: offsets incorrect).

Here I posted some code that can be put into the plain format
for pdfTeX in PDF mode that adds the \pdf{h,v}origin fixing
into the macros of \magnification:

  \expandafter\def\expandafter\m at g\expandafter{%
    \m at g
    \pdfhorigin 1 true in%
    \pdfvorigin 1 true in%
    % Also correction of \pdfpagewidth and \pdfpageheight
    % is a good idea.
  }%

With converting of \pdfpage{width,height} to truept:

  \expandafter\def\expandafter\m at g\expandafter{%
    \m at g
    \pdfhorigin 1truein%
    \pdfvorigin 1truein%
    \mag at fix\pdfpagewidth
    \mag at fix\pdfpageheight
  }
  \def\mag at fix#1{%
    #1=\expandafter\convert at truept\the#1\relax
  }
  \begingroup
    \catcode`P=12
    \catcode`T=12
  \lowercase{%
    \endgroup
    \def\convert at truept#1PT{%
      #1truept%
    }%
  }

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the ntg-pdftex mailing list