I have the following .tex file:

\psfrag{Final Epidemic Size}[][][]{Final Epidemic Size}

I'm running this on a mac, with latex and then dvips. When I try to open the .ps file with preview I get the message:

"The PostScript file “fig1_5.ps” could not be converted to a PDF file."

I don't get that message when I modify other text in the image. Here are the (possibly) relevant lines in the .eps file I'm modifying:

/Helvetica 30 F
[1 0 0 1 0 0] CT
-132 24 moveto 
1 -1 scale
(Final Epidemic Size) t 

The only thing I see fundamentally different compared to other strings I have successfully modified is there are spaces in the string. Could this be the cause or is there something else?

  • How do you compile the document? – pluton Apr 24 '16 at 5:26
  • @pluton With a terminal I type latex filename then dvips filename. I'm not sure exactly when I installed these. This is in Mac OS X. – Joel Apr 24 '16 at 5:58
  • The spaces shouldn't be a problem. Though I've never seen psfrac being used like that. Btw have you tested with article instead of standalone (just to rule that out) and having the eps in the same folder as the tex file (to rule that out). Also can it be handled without psfrac (btw preview might not be the best program to use the preview a ps file, I'm not a mac user, but we have had our share of problems with the program) – daleif Apr 24 '16 at 6:16
  • Using a command with empty optional arguments looks very strange to me. Are you sure, that this is the correct use? – MaestroGlanz Apr 24 '16 at 6:58
  • @MaestroGlanz I think you found it. I was using an automated process to generate this (I'm doing it in many cases). It looks like this was the one case where all of the optional arguments were empty, and it broke. In most of them 2 of the optional arguments were empty. Can you make that an answer? – Joel Apr 24 '16 at 7:03

You use \psfrag wrong. If you write

\psfrag{Final Epidemic Size}[][][]{Final Epidemic Size}

the optional arguments are assumed to be given. Empty arguments might be allowed in some of them, but as you wrote, not in all of them. Therefore, either fill them with content or delete them, so the (sensible) standard value will be applied to them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.