[OS X TeX] TeXLive 2004, PDFTeX magnification problem.
Bruno Voisin
bvoisin at mac.com
Wed Dec 29 04:21:01 EST 2004
Le 29 déc. 04, à 03:47, Edward Thome a écrit :
> Since TeXLive 2004 became available via i-installer, I've installed
> and kept it updated. With every update, I've had the same problem:
>
> Using pdfTeX on a document with magnification other than 1000 results
> in incorrect margins in the printed document. Curiously enough, the
> pdf file, as viewed through TeXShop, iTeXMac, xpdf, or Preview, looks
> fine.
>
> For exams and the like, I commonly use
> \magnification = 1095
> or
> \magnification = 1200
>
> If I use TeX->dvips->ps2pdf, then everything works as expected with
> 1-inch margins (printed on us letter paper), but if I use pdfTeX on
> the same document I have little or no margins on the printed page.
> This is true whether I use pdfTeX from cli, TeXShop, or iTeXMac, or if
> I print via lpr or TeXShop, If I print from Preview, it warns me that
> the document is too big to print on letter paper and asks me to scale
> or crop.
>
> Interesting points to make:
> 1. Reverting back to TeXLive 2003 solves this issue. Uninstalling
> everything and reinstalling TeXLive 2004 brings it back.
> 2. This happens on both my eMac at the office and my iMac at home.
> 3. My drive failed on my iMac, so I got a chance [ :-) ] to reinstall
> everything from scratch. I still have the problem.
> 4. pdfLaTeX works as it should
> 5. As noted above, TeX->dvips->ps2pdf works as it should.
>
> Has anyone else seen this and/or know of a solution?
>
> Thank you in advance.
> Ed
This is because, in the new version of pdfTeX, the media box (the size
of the logical sheet of "paper" on which pdfTeX is composing the page)
is now affected by the \magnification. There's been a short thread last
week "Rép : [tex-live] [Fwd: [OS X TeX] Bug in latest pdfTeX (and/or
teTeX) with respect to \magnification?]" in which Hartmut Henkel, one
of the developers of pdfTeX, took part.
The way the media box is set for pdfTeX has changed:
- Previously it was defined in either of two ways: via the config file
pdftex.cfg with parameters page_width and page_height, read when
creating the formats pdftex.fmt and pdflatex.fmt, or in the .tex input
file via primitives \pdfpageheight and \pdfpagewidth.
- Now it is defined only via the primitives \pdfpageheight and
\pdfpagewidth, initialized by the config file pdftexconfig.tex read
when creating the formats pdftex.fmt and pdflatex.fmt.
But that, of course, would be too simple: although the initialization
values in pdftexconfig.tex are given in true units, the "true" there is
not taken into account, because _true units in TeX are only considered
after the primitive \mag (invoked by \magnification) has been set to a
value different from 1000_; and INITEX, the variant of TeX used when
creating the formats, initializes \mag to precisely 1000. This was
revealed by Hartmut, who says it's in the TeXbook; I couldn't find any
explicit mention of it anywhere, but I imagine that's what must be
inferred from the sentence, at the bottom of p. 270:
"When `true' is present, the factor is multiplied by 1000 and divided
by the \mag parameter."
Hence for `true' to really work as true, \mag must have been set
beforehand to something different from 1000, which is not the case when
pdftexconfig.tex is read.
For example, looking at the letter example in Appendix E of the TeXbook
(p. 404), you'll see that Knuth sets the \magnification _before_
reading letterformat.tex which defines \hsize in true units.
Back to planet Earth: it seems the way to stay away from trouble with
the plain TeX format in pdfTeX is, after setting \mag or
\magnification, to always reset manually, not only \hsize, \vsize,
\hoffset and \voffset as with standard TeX, but also the
pdfTeX-specific primitives \pdfpagewidth, \pdfpageheight, \pdfhorigin
and \pdfvorigin.
I see two solutions to your problem:
- In your .tex input file, after setting \magnification, write:
\pdfpagewidth=210truemm % for A4; for US Letter, possibly 8.5truein
\pdfpageheight=297truemm % for A4; for US Letter, possible 11truein
\pdfhorigin=1truein
\pdfvorigin=1truein
- Probably better: redefine \magnification such that it does the above
automatically. Namely, overcome the default from plain.tex
\def\magnification{\afterassignment\m at g\count@}
\def\m at g{\mag\count@
\hsize6.5truein\vsize8.9truein\dimen\footins8truein}
by writing in your .tex input file
\catcode`@=11
\def\m at g{\mag\count@
\hsize6.5truein\vsize8.9truein\dimen\footins8truein
\pdfpagewidth8.5truein\pdfpageheight11truein\pdfhorigin1truein\pdfvorigi
n1truein}
\catcode`@=12
Hope this helps,
Bruno Voisin
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
More information about the MacOSX-TeX
mailing list