[OS X TeX] Page origin problem with TeXLive and dvips

Peter Dyballa Peter_Dyballa at Web.DE
Tue Jan 30 15:26:05 EST 2007


Am 30.01.2007 um 19:48 schrieb Richard Koch:

> 	sudo texconfig-sys paper a4
>
> to after
>
> 	sudo texconfig-sys dvips paper a4

I only have TeX Live 2005 available on DVD and I did not use  
texconfig-sys, "only" texconfig, which created the files

	~/Library/texmf/dvipdfm/config/dvipdfmx.cfg
	~/Library/texmf/dvips/config/config.ps
	~/Library/texmf/xdvi/XDvi

(Before I did 'touch now' and afterwards a 'find ~/Library/texmf - 
newer now' to find out.)

The difference between config.ps from run 1 and config.ps from run 2  
(with dvips as argument) is for me (diff -au):

	@@ -50,16 +50,16 @@
	% 0 0 595 842 is the right boundingtex	 box that most applications  
expect
	% for A4.  Since dvips always rounds up, choose something slightly  
smaller.
	-@ A4size 594.99bp 841.99bp
	- at + ! %%DocumentPaperSizes: a4
	- at + %%PaperSize: A4
	-
	@ a4 594.99bp 841.99bp
	@+ ! %%DocumentPaperSizes: a4
	@+ %%BeginPaperSize: a4
	@+ a4
	@+ %%EndPaperSize
	+@ A4size 594.99bp 841.99bp
	+ at + ! %%DocumentPaperSizes: a4
	+ at + %%PaperSize: A4
	+
	@ letterSize 8.5in 11in
	@+ ! %%DocumentPaperSizes: Letter

i.e., the first version has this empty code

	@ A4size 594.99bp 841.99bp
	@+ ! %%DocumentPaperSizes: a4
	@+ %%PaperSize: A4

before

	@ a4 594.99bp 841.99bp
	@+ ! %%DocumentPaperSizes: a4
	@+ %%BeginPaperSize: a4
	@+ a4
	@+ %%EndPaperSize

and the second version has them in the other sequence. This should  
not make any difference, because dvips usually picks (it should) the  
right block from config.ps and puts it into the PS output file.  
Creating from the same DVI file via 'dvips -Ppdf -o <file«n».ps>  
<file.dvi>' I get this difference in the PS output:

	%%EndProlog
	%%BeginSetup
	%%Feature: *Resolution 1200dpi
	TeXDict begin
	%%PaperSize: A4
	end
	%%EndSetup
	%%Page: 1 1

from 'texconfig paper a4' and this from 'texconfig dvips paper a4':

	%%EndProlog
	%%BeginSetup
	%%Feature: *Resolution 1200dpi
	TeXDict begin
	%%BeginPaperSize: a4
	a4				<<< here paper format is set via PS
	%%EndPaperSize
	end
	%%EndSetup
	%%Page: 1 1

As you can see, the latter does set a4 paper, the other code is just  
a waste! Now, in the first wasteful case it's capital "A4" paper,  
which comes from the block

	@ A4size 594.99bp 841.99bp
	@+ ! %%DocumentPaperSizes: a4
	@+ %%PaperSize: A4

that does not contain any PS code. Dvips obviously searches case- 
insensitively for some "a4" string and finds the empty code first and  
uses it at once.

To me it looks like a bug in dvips – and in texconfig! The texconfig  
script has this case statement:

       case $2 in
         a4)
           pDvips=A4size
           ;;
         letter)
           pDvips=letterSize
           pXdvi=us
           ;;
         "") echo "$help" >&2; rc=1; return;;
         *)
           echo "$progname: unknown PAPER \`$2' given as argument for  
\`$progname paper'" >&2
           echo "$progname: try \`$progname paper' for help" >&2
           rc=1
           return;;
       esac

I have no proof, because understanding this so-called script would  
take a few days, but it's obvious to me that texconfig introduces non- 
code ("introns") with "A4size" and "letterSize" into config.ps. When  
it's invoked as in 'texconfig <driver> paper <size format>' then it  
does not change the defaults in config.ps (because it first checks  
what's already in it?), when invoked as in 'texconfig paper <size  
format>' then it does!

So it seems to be necessary to run

	sudo texconfig-sys dvips paper $PAPER
	sudo texconfig-sys dvipdfm paper $PAPER
	sudo texconfig-sys pdftex paper $PAPER

and to report dvips' obviously faulty behaviour in parsing the paper  
sizes section of config.ps. Texconfig won't change, would it? Could  
it? Who could it?

--
Greetings

   Pete

War springs from unseen and generally insignificant causes.
                                        -- Anonymous



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