[OS X TeX] Just went to Leopard and ...

win at ucla.edu win at ucla.edu
Wed Nov 7 14:38:39 EST 2007


My thanks to Bruno Voisin, especially, as well as to Aaron Jackson for  
their timely response.  I had already used Terminal to try to (re)set  
everything to US letter preferences, but it was Bruno's recommendation  
that I employ in plain TeX the lines

\pdfpageheight=11.0 truein
\pdfpagewidth=8.5 truein
\pdfhorigin=1.0truein
\pdfvorigin=1.0truein

at the beginning of the document or after any \magnification statement  
that worked.  Thank you all!  William
-------------------------------------------------------------------------
Professor William I. Newman                  Phone (310) 825-3912  Office
Departments of Earth and Space Sciences,           (310) 825-3880  ESS
Physics and Astronomy, and Mathematics       FAX   (310) 825-2779
4640 Geology Building, P. O. Box 951567      Email win at ucla.edu
University of California
Los Angeles, CA 90095-1567


On Nov 6, 2007, at 4:37 PM, Bruno Voisin wrote:

Le 7 nov. 07 à 00:20, win at ucla.edu a écrit :

[...] I still want/need to use plain TeX but in the context of  
TeXshop, possibly returning to the new OS X compatible Textures once  
the development bugs have been removed.  However,  whenever I typeset  
an existing TeX (i.e., Textures) document---and my installation of  
TeXshop may have inadvertently imposed A4 page standards, my margins  
are horribly messed up.  (They are messed up even in the context of  
using A4 paper.)  Is there a simple way to accomplish this?  As a  
workaround, I have found that the following 4 lines introduced near  
the beginning (i.e., in the preamble region) of a TeX document will do  
the job (to the nearest millimeter or so):

\hsize=6.5truein
\vsize=9.0truein
\hoffset=0.68truein
\voffset=0.9truein

(Note that I use "truein" in place of "in" as a dimension to  
accommodate the use of "\magnification=" statements.)  Is there a  
simpler or more elegant way to adjust the margins appropriately to  
conform with US letter paper?  I appreciate any advice that you might  
have to offer.

Two things:

- Regarding A4 vs US Letter, MacTeX tries to guess at install time  
which default size you're using (as defined in System Prefs > Printers  
& Fax) and adjusts its default settings accordingly. In case this  
guess is wrong, you'll get a bit of handwork to perform (in Terminal).  
 From MacTeX's ReadMe.txt:

Some programs in TeX need to know whether you are using letter-size  
paper or A4-size paper. The installer tries to guess the answer from  
your printer's default paper setting. This will work in almost all  
cases. If you run into problems, open Apple's Terminal program in  
Applications/Utilities and type one of the following pairs of  
commands, giving your administrator password when asked:

     sudo texconfig-sys paper letter
     sudo texconfig-sys dvips paper letter

     sudo texconfig-sys paper a4
     sudo texconfig-sys dvips paper a4

- Regarding paper size and \magnification in plain TeX: TeXShop uses  
pdfTeX by default, not traditional TeX like Textures. As a  
consequence, there are two additional dimensions to consider,  
\pdfpageheight and \pdfpagewidth. These define if I'm not mistaken the  
media size, namely the size of the support TeX is shipping out to  
(paper size for printed output, screen size for screen output). More  
precisely:

* In Textures the media size corresponds I think to the paper size  
specified in File > Page Setup.

* In standard TeX, namely for dvips, the media size corresponds to the  
paper size coming first in the list of paper sizes in  
/Library/TeX/Root/texmf-config/dvips/config/config.ps, and may be  
modified via the papersize \special in any given document as specified  
in section 4.1 of /Library/TeX/Documentation/texmf-doc/dvips/dvips.pdf.

* In pdfTeX, the media size is defined via the above dimensions  
\pdfpageheight and \pdfpagewidth in the file  
/Library/TeX/Root/texmf-config/tex/generic/config/pdftexconfig.tex,  
and may be modified by redefining these dimensions in any given  
document.

The config files config.ps and pdftexconfig.tex are the files set by  
MacTeX at install time, and later by the user should texconfig-sys be  
used.

But now, just to make things challenging, comes the effect of  
\magnification: though with pdfTeX the parameters \pdfpageheight and  
\pdfpagewidth are set in true units in pdftexconfig.tex, then owing to  
some devious reasoning I never quite understood the true units there  
are not really true and are affected by any subsequent \mag or  
\magnification.

Thus, as a take-home message: four parameters \pdfpageweight,  
\pdfpagewidth, \pdfhorigin and \pdfvorigin must be reset in true units  
after any \mag or \magnification, in the same way as does Knuth by  
resetting \hsize and \vsize after modifying \mag in the definition of  
\magnification.

For example, a plain TeX document of mine, intended for A4 paper (210  
mm x 297 mm) and typeset indifferently with pdfTeX or TeX + dvips +  
distiller, contains:

\magnification=\magstep1
\input ifpdf
\ifpdf
   \pdfpagewidth=210truemm \pdfhorigin=1truein
   \pdfpageheight=297truemm \pdfvorigin=1truein
\else
   \special{papersize=210mm,297mm}
\fi
\hsize=210truemm \advance\hsize by-2truein
\vsize=297truemm \advance\vsize by-2.1truein

Adaptation to US Letter should yield something like:

\magnification=\magstep1
\input ifpdf
\ifpdf
   \pdfpagewidth=8.5truein \pdfhorigin=1truein
   \pdfpageheight=11truein \pdfvorigin=1truein
\else
   \special{papersize=8.5in,11in}
\fi

Hope this helps,

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/




------------------------- 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