[texhax] can't control page size - why? (the real problem)

Reinhard Kotucha reinhard.kotucha at web.de
Tue Apr 25 20:39:30 CEST 2006

>>>>> "Tom" == Tom Schneider <toms at ncifcrf.gov> writes:

  > Lars (Daleif?):
  >> try adding 'dvips' to the geometry options, otherwise dvips just
  >> falls back to its default papersize.

  > Thanks.  I tried these usepackage calls and got the following
  > BoundingBoxes:

  > \usepackage[total={16cm,16cm},margin=0cm]{geometry} %%BoundingBox:
  > 0 0 595 842

  > \usepackage[dvips,total={16cm,16cm},margin=0cm]{geometry}
  > %%BoundingBox: 0 0 612 792

  > \usepackage[dvips,total={16cm,20cm},margin=0cm]{geometry}
  > %%BoundingBox: 0 0 612 792

  > Switching to dvips did change the BoundingBox, but I still have no
  > control over it!

You have to tell the geometry package which paper size you want to
use.  Try:

      texdoc geometry/manual

  > By the way, I've confirmed that I can control the BoundingBox in
  > ghostscript and Mac OS X Previewer, the sizes actually change in
  > one example.  However, if I alter the bounding box in the page
  > generated by LaTeX/dvips, the size is not changed, so there must
  > be something overriding the BoundingBox!  I deleted some lines
  > that said it was a4 paper and that made no difference.

A percent sign starts a comment in the PostScript language.  Lines
beginning with %% are so-called Document Structured Comments (DSCs).
These lines are not evaluated by PostScript itself but can be used by
previewers and other programs which do not understand PostScript to
determine page size, begin and end of a particular page, etc.

Previewers like ghostview or gv read the comments and then send parts
of the file to ghostscript.

If these comments are missing, the whole file is sent to ghostscript
which creates a bitmap of the first page and stops.  If you press the
Page-Down key, it will render the next page and so on.  gv will not
display page numbers at the left and you cannot go back to a previous
page.  Note that a PostScript file is a program which is read from top
to bottom.

If DSCs are present, gv will first read all of them and display page
numbers at the left.  Then it will concatenate the preamble
(everything up to %%EndSetup) and everything between %%Page: 1 1 and
the next %%Page comment and sends it to ghostscript in order to get a
bitmap of the first page.  If you skip to page 123, gv will send
everything between %%Page: 123 123 and the next %%Page comment to
ghostscript which returns a bitmap of page 123 and so on.

I suppose that you can see the difference if you remove everything
after %! from the first line of the .ps file.

The %%BoundingBox comment is useful if a program which doesn't
understand PostScript (like TeX) wants to include a PS graphic file.

TeX just looks for the %%BoundingBox comment in order to determine the
size of the graphic.  Nothing else is read by TeX.  The file name is
passed to the driver, usually dvips, which will include the file.


Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the texhax mailing list