[OS X TeX] Ghostscript/papersize configuration in the MacTeX installer

Joachim Kock jkock at start.no
Sat Jun 14 18:00:54 EDT 2008


in the thread 'problem with psnup' it has turned out that certain
ps files produced by psnup are not correctly distilled by ps2pdf.

Although the file has several indications that the page size is
a4, like for example

  %%BoundingBox: 0 0 595 842
  %%DocumentPaperSizes: a4

in the preamble, and

  %%BeginPaperSize: a4

in the trailer, ps2pdf has a problem and truncates the page to
letter format.  Unless it is given the -sPAPERSIZE=a4 option.

The reason this is necessary is that ghostscript defaults to
letter size.

I think it would be great if the MacTeX installer could configure
ghostscript according to a global choice of papersize.  For tex, as
far as I understand, the MacTeX installer makes this global choice
according to some some system setting.  I suggest that also 
ghostscript is configured accordingly.

As far as I understand from the ghostscript documentation, the
proper way of doing this is to modify


by uncommenting the line 


(assuming it is a4 we want).

I tried this and it has no effect on the ps file in question.
Some experiments with atime reveals that this file is not read
by ghostscript, the reason being that neither of the environment
variables GS_LIB or GS_LIB_DEFAULT is defined.

Pointing either of these to /usr/local/share/ghostscript/8.57/lib/
(after uncommenting the a4 line) makes everything work as expected,
i.e. ps2pdf can be invoked without the need of explicitly specifying

So altogether I would like to ask the experts about the possibility
that the MacTeX installer could:

  1: define the environment variable GS_LIB in a shell init file.

  2: in case the global choice for paper size is a4, modify gs_init.ps

(I am puzzled about the fact that gs_init.ps is not read.  A search
on the internet gives plenty of hits concerning errors caused by
this file not being found.  Is it possible that the installed version
of gs has these inits compiled into it?)

I am eager to hear qualified comments on this issue.

(I am quite ignorant about ghostscript myself, so bear over with
me if I got something wrong.)


More information about the MacOSX-TeX mailing list