I do have a problem in producing a pdf (latex -> dvips -> ps2pdf) with an error saying

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1084/1123(ro)(G)--   --dict:0/20(G)--   --dict:69/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.57: Unrecoverable error, exit code 1
  • 1
    How filename.ps was generated? What is the complete error message of Ghostscript? Commented Jun 15, 2013 at 11:21
  • I can not reproduce > dvips -> ps2pdf).
    – David H
    Commented Jun 15, 2013 at 11:37
  • If already dvips fails to generate a PostScript file, then it is not a surprise that Ghostscript throws an error. But a minimal working example (MWE) would be helpful. Commented Jun 15, 2013 at 12:08
  • This latex package I used.I guess there is some hidden files are missing. I could reproduce ps2pdf A.ps----->open A.pdf documentclass[a4paper,twocolumn,floatfix,superscriptaddress,showpacs]{revtex4} \usepackage{amsmath,amssymb,amsfonts,bbm,graphicx,hyperref,times,psfrag} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{microtype} \usepackage{float} \usepackage{mathrsfs} \usepackage{placeins} \usepackage{bbm} \usepackage{booktabs} \usepackage{color}
    – David H
    Commented Jun 15, 2013 at 12:25
  • Please add the lines before Execution stack, there should be a line starting Error: ... and Operand stack:. Also you can edit your question to add the complete MWE and try to strip down the example file by removing stuff/packages that do not cause the problem. Commented Jun 15, 2013 at 12:35

2 Answers 2


Your dvips is configured to send the output to lpr (printing) instead of generating a PostScript file. From the output, given in your comment:

This is dvips(k) 5.95a [...] ' TeX output 2013.06.15:1522' -> |lpr [...]

The output PostScript file can be specified directly:

dvips -o A.ps A.dvi

generates a PostScript file A.ps that can then be processed by ps2pdf:

ps2pdf A.ps

dvips can be reconfigured via the configuration file config.ps. It can be found by kpsewhich:

kpsewhich config.ps

For example it returns .../texmf-dist/dvips/config/config.ps. Then locate the line:

o |lpr

that pipes the output to the printing system. Add a percent before to disable this setting:

%o |lpr

Then the default output is a PostScript file.

  • perfecly works!!! Thank you so much!!! But there's one concern regarding the style, my title appeared extremely top of the paper.
    – David H
    Commented Jun 15, 2013 at 13:36
  • @Herman This is a different question, an exercise to provide a minimal working example (MWE). :-) Commented Jun 15, 2013 at 13:43
  • I mean the texts starts from the top of the paper which is unusual.
    – David H
    Commented Jun 15, 2013 at 14:22
  • @ Heiko, it works fine with dvips -o A.ps A.dvi but the output pdf is not in standard format (the title appears at the top of the page). I usually use latex A.tex----dvips A.dvi----psp2pdf A.ps----open A.pdf but I guess I delete unaware of in the hidden files related to terminal
    – David H
    Commented Jun 17, 2013 at 11:14
  • @Herman: Use the right paper format for LaTeX (e.g. option for \documentclass) and the driver (e.g. \usepackage[pass]{geometry}). Commented Jun 17, 2013 at 12:28

This one works fine without sending to the printer

dvips -Ppdf A.dvi -o A.ps ---> ps2pdf A.ps A.pdf---->open A.pdf

You must log in to answer this question.

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