[OS X TeX] Page origin problem with TeXLive and dvips
Bruno Voisin
bvoisin at mac.com
Tue Jan 30 04:22:38 EST 2007
Does anybody experience different page origin positioning using
pdfTeX on one hand, TeX + dvips + ps2pdf on the other hand, with TeX
Live 2007 (as installed by MacTeX).
Take the following LaTeX input, on a system configured for A4 paper:
\documentclass[a4paper]{article}
% Set text width
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}
% Set text height
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-2in}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\topskip}
\addtolength{\textheight}{-\footskip}
\divide\textheight by\baselineskip
\newcounter{tempcounter}
\setcounter{tempcounter}{\textheight}
\setlength{\textheight}{\value{tempcounter}\baselineskip}
\addtolength{\textheight}{\topskip}
% Let the fun begin
\begin{document}
Sample text.
\end{document}
It's supposed to produce a page with one-inch margins on all sides,
and no headers. Hence the text "Sample text" is supposed to start at
exactly one inch from the top and left side of the page.
If I typeset the above on gwTeX, I get the expected result with
TeXShop in both pdfTeX and "TeX and GhostScript" modes.
If I use TeXLive-2007 instead, I get the expected result with pdfTeX.
But with "TeX and GhostScript", the text starts closer to the top of
the page, by 2/3 of an inch, say.
Can somebody reproduce this? Or does somebody know which config file
is responsible for this "feature" or "bug"? I looked at /usr/local/
texlive/2007/texmf-config/dvips/config/config.ps, but I cannot make
sense of it. TeX I can speak, but not PostScript!
The problem is not specific to LaTeX, by the way. In plain TeX I get
exactly the same behaviour with:
\input ifpdf.sty
\ifpdf
\pdfpagewidth=210mm \pdfhorigin=1in
\pdfpageheight=297mm \pdfvorigin=1in
\fi
\hsize=210mm \advance\hsize by-2in
\vsize=297mm \advance\vsize by-2in \advance\vsize by-24pt
Sample text.
\bye
(the code within the \ifpdf conditional is redundant with the
specification of A4 paper when installing TeX Live, I include it only
to be on the safe side).
The problem does not occur with XeTeX, using either xdv2pdf or
xdvipdfmx. It really seems specific to dvips.
Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the MacOSX-TeX
mailing list