2

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
David H
  • 133
  • 1
    How filename.ps was generated? What is the complete error message of Ghostscript? – Heiko Oberdiek Jun 15 '13 at 11:21
  • I can not reproduce > dvips -> ps2pdf). – David H Jun 15 '13 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. – Heiko Oberdiek Jun 15 '13 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 Jun 15 '13 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. – Heiko Oberdiek Jun 15 '13 at 12:35
  • 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 hermans-macbook-herman~/Documents/AA$ps2pdf A.ps Error: /undefinedfilename in (A.ps) – David H Jun 15 '13 at 12:43
  • Error: /undefinedfilename in (A.ps): that means, A.ps was not generated and does not exist. Thus the previous step (dvips) already failed. – Heiko Oberdiek Jun 15 '13 at 13:16
  • Transcript written on A.log. herman~/Documents/AA$dvips A.dvi This is dvips(k) 5.95a Copyright 2005 Radical Eye Software (www.radicaleye.com) ' TeX output 2013.06.15:1522' -> |lpr <tex.pro><psfrag.pro><8r.enc><texps.pro><special.pro><color.pro>. <cmbx9.pfb> <cmsy5.pfb><cmr5.pfb><cmmi5.pfb><cmex10.pfb><cmr6.pfb><cmmi6.pfb><cmsy9.pfb> <cmr9.pfb><cmmi9.pfb><cmr7.pfb><cmsy10.pfb><cmmi7.pfb><cmmi10.pfb><cmr10.pfb> <cmsy6.pfb><cmsy7.pfb>[1] [2<A.eps>] [3] [4] [5] [6<Fig1.eps><Fig2.eps>] [7 <Fig3.eps><Fig4.eps><Fig5.eps>] [8<Fig6.eps>] [9] – David H Jun 15 '13 at 13:23
  • the A.dvi works fine but ps2pdf failed – David H Jun 15 '13 at 13:24

2 Answers2

5

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.

Heiko Oberdiek
  • 271,626
  • perfecly works!!! Thank you so much!!! But there's one concern regarding the style, my title appeared extremely top of the paper. – David H Jun 15 '13 at 13:36
  • @Herman This is a different question, an exercise to provide a minimal working example (MWE). :-) – Heiko Oberdiek Jun 15 '13 at 13:43
  • I mean the texts starts from the top of the paper which is unusual. – David H Jun 15 '13 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 Jun 17 '13 at 11:14
  • @Herman: Use the right paper format for LaTeX (e.g. option for \documentclass) and the driver (e.g. \usepackage[pass]{geometry}). – Heiko Oberdiek Jun 17 '13 at 12:28
  • where i can put the %o |lpr as the output goes to the printing system every time I run dvips filename.dvi. would it be possible to reinstall again? – David H Jun 24 '13 at 11:03
  • @Herman: The configuration file for dvips is config.ps, see the answer. – Heiko Oberdiek Jun 24 '13 at 11:15
0

This one works fine without sending to the printer

dvips -Ppdf A.dvi -o A.ps ---> ps2pdf A.ps A.pdf---->open A.pdf
David H
  • 133