1

Since updating to MacTeX 2021 my pstricks files don't compile anymore. I've been searching for the solution but the ones suggested don't seem to work (e. g. using xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" in TeXShop).

For example, MWE from A ruler symbol in LaTeX

\documentclass[pstricks,margin=1mm]{standalone}

\begin{document} \begin{pspicture}(-.2,1.5)(10.2,3) \psframelinecolor=lightgray(10.2,3) \multips(0,3)(0.1,0){101}{\psline(0,-.1)} \multips(0,3)(0.5,0){21}{\psline(0,-.2)} \foreach \x in {0,...,10}{\rput(\x,3){\psline(0,-.3)}\uput{4mm}-90{\scriptsize$\x$}} \rputr{\scriptsize Made in Japan} \end{pspicture} \end{document}

gives the error

Dictionary stack: --dict:756/1123(ro)(G)-- --dict:0/20(G)--
--dict:75/200(L)-- Current allocation mode is local Last OS error: Permission denied Current file position is 69 GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1 Error: /invalidfileaccess in --run-- Operand stack:
(/usr/local/texlive/2021/texmf-dist/dvips/pstricks/pstricks.pro) (r) Execution stack: %interp_exit .runexec2 --nostringval-- run
--nostringval-- 2 %stopped_push --nostringval-- run run false 1 %stopped_push 1974 1 3 %oparray_pop 1973 1 3 %oparray_pop 1961 1 3 %oparray_pop 1817 1 3
%oparray_pop --nostringval-- %errorexec_pop .runexec2
--nostringval-- run --nostringval-- 2 %stopped_push --nostringval-- 1974 1 3 %oparray_pop run Dictionary stack: --dict:756/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: Permission denied Current file position is 69 GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1 Error: /invalidfileaccess in --run-- Operand stack: (/usr/local/texlive/2021/texmf-dist/dvips/pstricks/pstricks.pro) (r) Execution stack: %interp_exit .runexec2 --nostringval-- run
--nostringval-- 2 %stopped_push --nostringval-- run run false 1 %stopped_push 1974 1 3 %oparray_pop 1973 1 3 %oparray_pop 1961 1 3 %oparray_pop 1817 1 3
%oparray_pop --nostringval-- %errorexec_pop .runexec2
--nostringval-- run --nostringval-- 2 %stopped_push --nostringval-- 1974 1 3 %oparray_pop run Dictionary stack: --dict:756/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: Permission denied Current file position is 69 GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1 Error: /invalidfileaccess in --run-- Operand stack: (/usr/local/texlive/2021/texmf-dist/dvips/pstricks/pstricks.pro) (r) Execution stack: %interp_exit .runexec2 --nostringval-- run
--nostringval-- 2 %stopped_push --nostringval-- run run false 1 %stopped_push 1974 1 3 %oparray_pop 1973 1 3 %oparray_pop 1961 1 3 %oparray_pop 1817 1 3
%oparray_pop --nostringval-- %errorexec_pop .runexec2
--nostringval-- run --nostringval-- 2 %stopped_push --nostringval-- 1974 1 3 %oparray_pop run Dictionary stack: --dict:756/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: Permission denied Current file position is 69 GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1 ) Output written on testint2021.pdf (1 page). SyncTeX written on testint2021.synctex.gz. Transcript written on testint2021.log.

All packages are up to date.

Any help would be greatly appreciated.

Mensch
  • 65,388
  • Have you updated your MacTeX 2021 since then? – daleif Oct 11 '21 at 09:50
  • The issue started when I updated to MacTeX 2021. In 2020 they worked. – kariuolevi Oct 11 '21 at 12:38
  • That is not what I asked. MacTeX 2021 needs to be updated, have you updated it? – daleif Oct 11 '21 at 12:52
  • Yes, I have updated all packages with TeXLive. – kariuolevi Oct 11 '21 at 14:49
  • I just got advice to use xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" in command line. However, my problem is that I'm using pstricks for my book which I edit in TeXShop. I tried to add -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E” after the XeLaTeX command in the preferences but that did not seem to make any difference. Could somebody help me and suggest how to test the command in TeXShop? – kariuolevi Oct 11 '21 at 15:06
  • I think the case is now solved. I was able to the textindy.engine file at https://tex.stackexchange.com/questions/376649/adding-a-new-engine-in-texshop to the following: #! /bin/bash PATH=/Library/TeX/texbin:/usr/local/bin:${PATH} bfname=${1%.*} xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$bfname" and now everything seems to work perfectly. – kariuolevi Oct 12 '21 at 10:19
  • 1
    using lualatex instead of xelatex is much more easier – user187802 Oct 15 '21 at 11:46

1 Answers1

1

I think the problem is now solved. I was able to modify the textindy.engine part at Adding a new engine in TeXShop and do the following:

I saved the text below as ~/Library/TeXShop/Engines/XeLaTeXNew.engine on my Mac

#! /bin/bash PATH=/Library/TeX/texbin:/usr/local/bin:${PATH} bfname=${1%.*} xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" "$bfname"

Then, in the terminal, I run the command

sudo chmod +x ~/Library/TeXShop/Engines/XeLaTeXNew.engine

to set the executable bit on the file.

Finally, I restarted TexShop, and everything runs fine again.

I would like to thank everybody who helped to solve the problem, but especially Herbert Voss for giving the advice of using xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" to fix the original issue.

  • Welcome to TeX.SE! – Mensch Oct 12 '21 at 11:01
  • Hope you should say special thanks to Herbert Voss who is the main person of PsTricks – MadyYuvi Oct 12 '21 at 15:00
  • It is also possible to copy the file /.../texlive/2023/texmf-dist/dvipdfmx/dvipdfmx.cfg. into a local directory /.../texlive/texmf-local/dvipdfmx/ and then replace the only valid line from dvipdfmx-unsafe.cfg into the local dvipdfmx.cfg. Then you can use xetex as usual and no changes to the editor are needed. – user187802 Nov 02 '23 at 07:12