3

I have some PS and PSG graphics files that I need to include in a document, graphics file types that I have no experience with. Similar questions have been asked on this site before, but, regrettably, I have not been able to use these tips to solve my problem. So please accept my apology for posting a similar question. My naive approach has been

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=4in]{image1.ps}
\includegraphics[width=125mm]{image2.psg}
\end{document} 

This results in the error "unknown graphics extension". Using a suggestion from the post LaTeX Error: Unknown graphics extension: .ps I have then tried adding the line

\usepackage{auto-pst-pdf}

This returns the error "shell escape' (or write 18) is not enabled". From the same post a suggestion for this problem is to set the " --enable-write18" option. It is not clear to me where/how I should set this option. I am using WinEdt 9 and would appreciate any help.

  • The .ps one will probably work if you rename it to .eps but I have no idea what a .psg file is so I can not suggest anything there, try to convert it to (say) pdf (google for anything that can do that) – David Carlisle Jul 17 '16 at 09:42
  • After changing the file extension to EPS and adding \usepackage{epstopdf} the file now compiles. Hey, I have no idea what a PSG file is either, but I also changed the extension to EPS and this works also. Thanks for your help... – Freakalien Jul 17 '16 at 10:00
  • To enable write18 on WinEdt please see the description under Update in the answer to How can I enable write 18 on a MikTeX installation – alwaysask Jul 17 '16 at 10:00
  • Are you sure it's not a PSDfile? This would be Adobe Photoshop format. – Bernard Jul 17 '16 at 10:22
  • @Bernard, I can't me sure but I don't think so. Most likely misnamed PS files. They seemed to survive the change of file type to EPS though. – Freakalien Jul 17 '16 at 10:28
  • The main difference between .eps and .ps is a bounding box. – Bernard Jul 17 '16 at 10:33
  • Did you look inside the ‘PSG’ file with your text editor? You'll probably see what it's supposed to be. – Bernard Jul 17 '16 at 10:35
  • @Bernard, I just did so and it means little to me. Here is a sample: L3155 2013 L3156 2060 L3157 – Freakalien Jul 17 '16 at 10:40
  • @alwaysask, I followed the steps in the post you sent, but I still get the shell escape error when i try to include PS files. When I change the file extension to ESP, no problems.

    Sorry, my problem. When I compile with PDFLaTeX the error disappears, except I now need to find a style file luatex85.sty.

    – Freakalien Jul 17 '16 at 10:49
  • This does not look like the code of a .ps or .eps type. Compare with the .ps file you have. Ps is a programming language. – Bernard Jul 17 '16 at 10:51
  • @Bernard, a PS file does look different. – Freakalien Jul 17 '16 at 10:54
  • You need to add --enable-write18 for all the engines (executables) you want to use, not just PDFLatex . Select them one by one and add the option to each of them (LuaLATex or whatever you want to use). – alwaysask Jul 17 '16 at 11:00
  • And you obtain a result with epstopdf? – Bernard Jul 17 '16 at 11:00
  • If there's no secret, upload a PSG file somewhere so we can have a look at it (https://www.wetransfer.com/ for example). – alwaysask Jul 17 '16 at 11:02
  • @Bernard, changing PS and PSG file to extensions to ESP and using \usepackage{epstopdf} did the trick. – Freakalien Jul 17 '16 at 12:07
  • @Freakalien: Strange… – Bernard Jul 17 '16 at 12:09
  • It is supposed to be a Page Segment File related to Advanced Function Presentation. However, based on this description, that seems rather unlikely. @Bernard – cfr Jul 18 '16 at 01:20

1 Answers1

3

The .ps one will probably work if you rename it to .eps, and apparently in comments the .psg one is also PostScript and can be made to work as eps.

Strictly speaking EPS is a restricted, structured, form of PostScript, but often (or at least, sometimes) you do not need all the restrictions of EPS and just a standard PostScript file works if you say it is EPS.

David Carlisle
  • 757,742