[OS X TeX] Re: Pdftex versus TeX&Ghostscript

Bruno Voisin bvoisin at mac.com
Sun May 22 14:08:07 EDT 2005


Le 22 mai 05 à 19:39, Gerben Wierda a écrit :

> this is a known issue with a recent (post fall 2004) TeX. TeX has  
> changed its behaviour, especially because there now only is one  
> main engine which is used for both pdfTeX and (almost) all other  
> TeXs: pdfetex
>
> I am unable to give generic TeX support to all users out there.  
> Please go to the Mac OS X TeX mailing list and look at the archives.
>
> On 22 May 2005, at 18:45, Hanspeter Kraft wrote:
>
>> Since quite a while I'm using TeXshop together with the  
>> installation of teTex/TeXLive via i_Installer on MacOSX (presently  
>> 10.3.9). I recently reinstalled teTex/TeXLive using the  
>> i_Installer (always newest versions) and now I have the following  
>> strange problem:
>>
>> Using Plain TeX in TeXshop, magnification behaves very strangely  
>> if | use "Pdftex", but perfectly if I use "TeX and Ghostscript".  
>> The printout is completely different from what one sees in the  
>> previewer. This was definitely not so before reinstalling the  
>> newest versions of teTeX/TeXLife.
>>
>> Thanks for your help         Hanspeter Kraft
>>
>> ********************************************************************* 
>> *
>>
>> Here are the results using the attached plain tex file Test with  
>> \magnification=\magstep3:

I'm reposting here a reply to a similar question from a couple of  
days ago. In short: replace \magnification=\magstep3 by

     \mag=\magstep3
     \input pdftexconfig
     \hsize=210truemm \advance\hsize by-2truein
     \vsize=297truemm \advance\vsize by-2.1truein

The \hsize and \vsize here are for A4 paper, assuming 1-inch wide  
margins (with additional 0.1 inch for the footer) which is plain  
TeX's default.

The idea is that, after setting a magnification using TeX's primitive  
\mag, you need to reset not only \hsize and \vsize in true units, as  
does plain TeX's \magnification macro, but also the pdfTeX-specific  
parameters \pdfpageheight and \pdfpagewidth which define the mediabox  
(the size of the sheet of paper) and possibly also \pdfhorigin and  
\pdfvorigin. The file pdftexconfig.tex (actually /Library/teTeX/share/ 
texmf.gwtex/tex/generic/config/pdftexconfig.tex) does this, and  
contains values defined when installing gwTeX (when you chose the  
paper size).

Bruno Voisin


> De : Bruno Voisin
> Date : 18 mai 2005 17:37:51 HAEC
> À : TeX on Mac OS X Mailing List
> Objet : Rép : [OS X TeX] strange pdflatex behaviour
>
> Le 18 mai 05 à 17:20, Alessandro Languasco a écrit :
>
>
>> Typesetting using pdflatex an easy file like this
>>
>> \magnification=2000
>>
>> this is a trial file
>>
>> \end
>>
>> instead of obtaining a magnification of the fonts,
>> I had a shrinking of the page in the upper left corner.
>> It was as the \magnification command was used as a magnification
>> factor of the page instead of the fonts.
>>
>
> I don't think that's connected with Tiger. It arises because of a  
> change in the design of TeXLive 2004: pdfTeX takes additional  
> parameters in addition to the \hsize and \vsize of TeX, namely  
> \pdfpageheight and \pdfpagewidth defining the MediaBox of the PDF  
> document, and the ways these are affected by \mag and  
> \magnification have changed with TL2004.
>
> There's been a thread "Réexp : [tex-live] [Fwd: [OS X TeX] Bug in  
> latest pdfTeX (and/or teTeX) with respect to \magnification?]"  
> about these issues on 21-22 December 2004, to which one of the  
> developers of pdfTeX (Hartmut Henkel) contributed.
>
> After re-reading very rapidly some of the messages in this thread,  
> I think what should be done is replacing
>
>     \magnification=2000
>
> by
>
>     \mag=2000
>     \input pdftexconfig
>
> Also, it's not advised to use \mag or \magnification with LaTeX.  
> It's supposed to be a plain-TeX-specific thing, told incompatible  
> with LaTeX in the LaTeX manual.
>
> Following is one message from the original thread (with email  
> addresses removed).
>
> HTH,
>
> Bruno Voisin
>
>
>
>> From: Hartmut Henkel
>> Date: 21 December 2004 01:16:00 GMT+01:00
>> To: Gerben Wierda
>> Subject: Re: [tex-live] [Fwd: [OS X TeX] Bug in latest pdfTeX (and/ 
>> or teTeX) with respect to \magnification?]
>>
>> On Mon, 20 Dec 2004, Gerben Wierda wrote:
>>
>>
>>
>>> I saw this message on the TeX on Mac OS X list. Not being a pdfTeX
>>> expert (I just redistribute) I wondered what is going on. Can  
>>> someone
>>> educate me?
>>>
>>>
>>
>> will try... :-)
>>
>>
>>
>>> G
>>>
>>> ---------------------------- Original Message  
>>> ----------------------------
>>> Subject: [OS X TeX] Bug in latest pdfTeX (and/or teTeX) with  
>>> respect to
>>> \magnification? From:    "Bruno Voisin"
>>> Date:    Mon, December 20, 2004 10:26
>>> To:      "TeX on Mac OS X Mailing List"
>>> -------------------------------------------------------------------- 
>>> ------
>>>
>>> Hello,
>>>
>>> I've just noticed something odd, when typesetting a letter in plain
>>> TeX for a change:
>>>
>>> - The setup is TL2004, installed via i-Installer with A4 selected as
>>> the default paper size.
>>>
>>> - When \magnification is not altered, in pdfTeX the paper size is A4
>>> as it should.
>>>
>>> - When \magnification is changed (for example
>>> \magnification=\magstep1), the page size (ie the width and height of
>>> text) remains A4 but the paper size (ie the size of the physcal  
>>> sheet
>>> of paper) is affected by the magnification.
>>>
>>>
>>
>> The \magnification macro (not a primitive!) does not only set the
>> magnification factor, it also sets the \hsize and \vsize to true
>> dimensions with letter default, see plain.tex. So in the general
>> non-letter case one should say \mag=\magstep1 instead of using
>> \magnification.
>>
>>
>>
>>> It seems that in TL2004 the file pdftex.cfg has vanished and is
>>> replaced by
>>> /usr/local/teTeX/share/texmf.local/tex/generic/config/ 
>>> pdftexconfig.tex,
>>> which contains all the proper settings:
>>>
>>>     \pdfpagewidth=594.99 true bp
>>>     \pdfpageheight=841.99 true bp
>>>     \pdfhorigin=1 true in
>>>     \pdfvorigin=1 true in
>>>
>>> - When this file is not read, the above result is obtained.
>>>
>>> - When this file is explicitly read (by \input pdftexconfig) after
>>> setting the magnification, namely:
>>>
>>>     \magnification=\magstep1
>>>     \input pdftexconfig
>>>
>>> then the paper size is brought back to A4 as it should.
>>>
>>> - When this file is read before setting the magnification, namely:
>>>
>>>     \input pdftexconfig
>>>     \magnification=\magstep1
>>>
>>> then an error is produced:
>>>
>>>     (/usr/local/teTeX/share/texmf.local/tex/generic/config/
>>> pdftexconfig.tex)
>>>     ! Incompatible magnification (1200);
>>>      the previous value will be retained (1000).
>>>     \m at g ->\mag \count@ \hsize 6.5true
>>>                                       in\vsize 8.9truein\dimen  
>>> \footins
>>> 8truein
>>>     <to be read again>
>>>                        \relax
>>>     l.3 \magnification=\magstep1
>>>
>>>
>>
>> The \hsize stuff in the error message is from the \m at g macro of
>> plain.tex. The error is caused by a TeX feature: After a \dimen  
>> has been
>> set to a "true" dimension in a certain \mag environment, the \mag is
>> frozen and can't be changed any more. Now, when the file
>> pdftexconfig.tex is read, some \dimen are set to true dimensions,  
>> like
>> \pdfpagewidth, so \mag=1000 is frozen. Then comes a new \mag  
>> (1200), and
>> then \hsize6.5truein from the \magnification helper macro \m at g  
>> triggers
>> the error message. Other examples:
>>
>> \vsize=297truemm \mag=\magstep1 \hsize=210truemm \bye
>>
>> gives a similar error message in TeX. It's nothing special with  
>> pdftex.
>> And
>>
>> \vsize=297truemm \mag=\magstep1 \hsize=210mm \bye
>>
>> is ok, as is this:
>>
>> \vsize=297mm \mag=\magstep1 \hsize=210truemm \bye
>>
>> A try on a few hints to avoid this true dimensions weirdness:
>>
>> * Set \mag early.
>>
>> * If you set anything to true dimensions _before_ setting \mag, you
>> can't do _after_ setting \mag. Vice versa.
>>
>> * Set all necessary \dimen to true dimensions after \mag, even  
>> when they
>> already have had non-true values before \mag -- just to be sure, that
>> everything comes out right. For pdftex don't forget to set
>> \pdfpagewidth/height, \pdfhorigin, and \pdfvorigin to the wished true
>> dimensions.
>>
>> * Or, prescale the \dimen to a non-true dimension so that it comes  
>> out
>> right after the \mag has been set to a new value.
>>
>>
>>
>>> Is there something obvious I've done wrong? Or is this a bug in  
>>> pdfTeX?
>>>
>>>
>>
>> It should be inline with how TeX's \mag is supposed to work.
>>
>>
>>
>>> I've verified the same occurs with
>>> /usr/local/teTeX/share/texmf.tetex/tex/plain/base/story.tex, thus it
>>> doesn't seem specific to my TeX input file.
>>>
>>> Bruno Voisin
>>>
>>>
>>
>> Regards, Hartmut
--------------------- 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