2

I'm having some trouble with paper sizes when I use the sequence

Latex->dvips->ps2pdf

to compile my .tex file. I have figured out that the problem is with the dvips bit. I want a letter size document and it keeps turning it into an A4.

I'm using the MiKTeX 2.9 distribution on Windows 7 and the Texmaker editor. How do I change the dvips driver configuration and set the default paper size as letter? I have changed the config.ps file into a .txt file so I could look to what's inside of it and change what was necessary but at the beginning of the document there's a warning saying I cannot change that file... that I have to create a new file that will override the config.ps.

What should I do? What's the code to set the letter size as default and where should I put it?

Thank you very much.

The .tex I'm having problems with

\documentclass[letterpaper]{article}

\usepackage{pst-all}

\usepackage{amsmath}

\usepackage[]{geometry}

\pagestyle{empty}

\begin{document}

\psset{arrowscale=3.5}

\pspicture(30.9,23.3)(3.4,16)

\psgrid[griddots=10,gridlabels=10pt, subgriddiv=0, gridcolor=black](1,3)(0,2)(19.5,26.5)

\endpspicture

\end{document}

3 Answers 3

1

Dvips takes into account what is declared by you file or the class you use. This hasn't to be set in config.ps. Maybe try MiKTeX Package Manager, and change the paper size:

enter image description here

3
  • I did it. Did not work.
    – Gabu
    Aug 26, 2015 at 20:25
  • Could you post a minimal (non-)working example?
    – Bernard
    Aug 26, 2015 at 20:28
  • I have just put my .tex example on the question above. I have tried the options for the geometry package but it did not work as well. I was told this has nothing to do with the .tex file because the dvips gets its input from the .dvi file which has no paper size specification.
    – Gabu
    Aug 26, 2015 at 20:29
0
  1. The LaTeX file has correctly declared letterpaper (it's also the default for class article. This can be checked by \showthe\paperwidth and \showthe\paperheight, the result is:

    > 614.295pt.
    l.9 \showthe\paperwidth
    
    > 794.96999pt.
    l.10 \showthe\paperheight
    

    1in is 72.27pt or 72bp.

  2. Package geometry informs the driver via \special of the paper size. Running latex test should produce the .dvi file. The papersize setting can be checked by dvitype test.dvi |grep xxx. If you do not have grep, search for the string xxx or papersize in the output of dvitype. Then you should find one line:

    326: xxx 'papersize=614.295pt,794.96999pt'
    
  3. Now dvips generates the PostScript file (dvips test). Open the PostScript file with a text viewer or editor. Near at the top, the paper size can be found:

    %%BoundingBox: 0 0 612 792
    %%DocumentPaperSizes: Letter
    

    The unit in PostScript and PDF is bp, not pt.

    The paper size setting in the DVI file can be overwritten by option -t ... of dvips.

  4. ps2pdf test.ps generates the PDF file. There the paper size can be extracted via pdfinfo test.pdf:

    Page size:      612 x 792 pts (letter)
    

    Again the unit is bp.

    Also Acrobat Reader shows the page size, when moving the mouse to the lower left corner.

    The paper size setting in the PostScript file can be overwritten by option -sPAPERSIZE=... for ps2pdf.

This should work as outlined. There is no need to meddle with configuration files.

5
  • I wrote a simple "Hello World" .tex file and then produced a .dvi file using Latex. I then used dvips to produce a .ps file which I opened with my Texmaker to found everything you said I would, that is the %%BoundingBox: 0 0 612 792 %%DocumentPaperSizes: Letter bit. You said the "The paper size setting in the DVI file can be overwritten by option -t ... of dvips." I did not understand this part. In which file should I write the -t piece of code?
    – Gabu
    Aug 27, 2015 at 4:25
  • @Gabu Why do you want to overwrite the paper size in dvips, if the PostScript file already has the correct paper size? Aug 27, 2015 at 7:08
  • The pdf generated at the end of the sequence Latex -> dvips -> ps2pdf is always an A4 size. I don't know what is happening.
    – Gabu
    Aug 28, 2015 at 12:41
  • @Gabu If the PostScript file is correct and pdfinfo does not report letter but A4, then the problem is the conversion to PDF. Is it a standard Ghostscript installation? Which version? Does ps2pdf -sPAPERSIZE=letter help? Aug 28, 2015 at 12:47
  • It is the Ghostscript 9.16. Where do I put this command line ps2pdf -sPAPERSIZE=letter? (I'm sorry. I'm not a computer sciences student. I'm just trying to get my reports and papers right.)
    – Gabu
    Aug 28, 2015 at 19:22
0

put a copy of config.ps in the same location (dvips/config) in some local texmf-tree. Open this copy in some editor and then move

@ letter 8.5in 11in
@+ ! %%DocumentPaperSizes: Letter
@+ %%BeginPaperSize: Letter
@+ letter
@+ %%EndPaperSize

before

@ letterSize 8.5in 11in
@+ ! %%DocumentPaperSizes: Letter

Save the file (make sure that is still named config.ps), update the FNDB and try again.

(untested, also it is long ago that I had to adapt config.ps, so it could be that I didn't remember correctly that this is the source of the problem).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .