1

Call me crazy, but I write my own figures in postscript, and my figure files need to access the file system (because I have files full of routines that the figure files use).

Because postscript can be a security hazard, the default for ghostscript is to disallow access to the file system, so my files can't be processed in ghostscript (and thus in ps2pdf). No problem, there is a -dNOSAFER option for gs and p2spdf, so

ps2pdf -dNOSAFER figure.ps

works. I write .tex in TeXShop, which uses simpdftex to do latex, dvips, ps2pdf. So I need to figure out how to pass -dNOSAFER through simpdftex to ps2pdf. Simple things I have tried, like passing the option

--distiller "ps2pdf13 -dNOSAFER"

to simpdftex don't seem to work.

Thanks,

Nathan

P.S. To keep you from wasting your time on unhelpful answers, I know about the package epstopdf which can automatically run ps2pdf on each figure file when I run pdflatex, and that works nicely for almost all situations, but sometimes I really need to mess with .ps in a way that pdftex/epstopdf can't handle.

3

You should try arara instead of simpdftex. Here's an example (file reading.tex, where polarcircle.eps is an EPS file I have in my testing directory):

% !TEX TS-program = Arara
% arara: latex
% arara: dvips
% arara: ps2pdf: { options: '-dCompatibilityLevel=1.3 -dNOSAFER' }

\documentclass{article}

\usepackage{graphicx}

\begin{document}

Some text

\includegraphics[width=4cm]{polarcircle.eps}

\end{document}

There's an arara engine for TeXShop that you may have to enable, just like for any alternative engine. See How to use arara with TeXShop for enabling the engine. Once you have enabled it, just hit Command-T and arara will be run due to the !TEX TS-program line.

Hitting Command-T or running

arara -v reading 

from the terminal and pdfinfo reading.pdf shows the following information:

Title:          reading.dvi
Creator:        dvips(k) 5.995 Copyright 2015 Radical Eye Software
Producer:       GPL Ghostscript 9.16
CreationDate:   Fri Aug 21 22:40:31 2015
ModDate:        Fri Aug 21 22:40:31 2015
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      595 x 842 pts (A4)
Page rot:       0
File size:      8348 bytes
Optimized:      no
PDF version:    1.3

If called with arara --log -v reading, an arara.log file is created, which contains the following lines:

21 Aug 2015 22:40:31.189 TRACE CommandTrigger - Command: latex      "reading.tex"

21 Aug 2015 22:40:31.406 TRACE CommandTrigger - Command: dvips "reading.dvi" -o "reading.ps" 

21 Aug 2015 22:40:31.615 TRACE CommandTrigger - Command: ps2pdf -dCompatibilityLevel=1.3 -dNOSAFER "reading.ps" "reading.pdf"

showing that the system calls are exactly what you need.

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.