I just tried to compile the following with XeLaTeX in TeXShop:

% !TEX TS-program = xelatexmk
% mwe.tex

but at the end I got the following error message:

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

and the PDF is empty. The same happens if I am running XeLaTeX in a terminal. I checked the net and found some hints from 2016 or 2019 but they are all not understandable to me.

If I do: latex mwe -> drips mwe I get a mwe.ps file. Now if in the finder I open this file, it will be converted into the mwe.pdf file with the expected diagram.

XeLaTeX at the prompt gives:

This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021) (preloaded format=xelatex)

OS X: 11.2.3 TeXShop: 4.64


  • Did you run xelatex with the --shell-escape switch?
    – Bernard
    May 11, 2021 at 14:46
  • But --shell-escape has to do with PdfLaTeX? I tried, but no other behavior, i.e. it seem the programm gs (Ghostscript) causes the failure.
    – Ulrich
    May 11, 2021 at 15:14
  • As Herb mentions below Ghostscript (which is needed here to process the generated ps data) has been updated and now requires extra options for transparency to work. As far as I know transparency is used a lot in pstricks. If I'm not mistaken there are other questions about this and it might come down to extra options for xdvipdfm
    – daleif
    May 11, 2021 at 16:08

4 Answers 4


Ghostscript 9.53.x needs a special couple of parameters to process that. What front end are you using? If a recent TeXShop (4.64 is the latest) go to ~/Library/TeXShop/Engines/Inactive/GhostscriptTransparencyEngines and read the example document there to install the latexTRmk and xelatexTRmk engines. Then use the xelatexTRmk engine instead of the xelatexmk engine and the file should compile fine. PS: You can use the TeXShop->Open ~/Library/TeXShop menu item to get started. PPS: you need to restart TeXShop for the newly activated engines to be seen by TeXShop.

  • 1. xelatexTR is working 2. latexTR is working 3. xelatexTRmk and latexTRmk and are not working: Message: xelatexTRmkrcl does not exist I have the version 4.64 and I am wondering, why natively the xelatex command is not working out of the box. From the READ-ME.tex: " .. Instructions about where to place the three files are enclosed.." but no further information about this.
    – Ulrich
    May 11, 2021 at 19:07
  • @Ulrich: There are two files in a sub-folder of GhostscriptTransparencyEngines that must be copied to ~/Library/TeXShop/bin/tslatexmk. Once those are copied latexTRmk and xelatexTRmk will work properly. May 11, 2021 at 19:08
  • Please tell me, which one? I am completely lost.
    – Ulrich
    May 11, 2021 at 19:36
  • OK OK , I got it. Question: Why is this not the default of TeXShop?
    – Ulrich
    May 11, 2021 at 19:41
  • Not everyone using TeXShop has a recent Ghostscript. That’s probably why it isn’t the default for xelatex itself. May 11, 2021 at 19:51

In the file /...tex-distro.../dvipdfmx/dvipdfmx-unsafe.cfg. you'll find only one important line and some documentation how to use this file with xe(La)tex. This important line starts with:


In the main config file dvipdfmx.cfg (in the same directory) you'll find a similar line which you should replace with the above one.

Ghostscript changed its behaviour and allows by default no transparency and no running external files. Both are the default for PSTricks files.


I was unsatisfied with the above solution to change dvipdfmx.cfg, as this file is supposed to be managed by the package manager. However, it turns out that you can get xelatex to use the packaged dvipdfmx-unsafe.cfg by using -output-driver:

xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" ...

This resolves issues with pstricks for me.


I have a similar issue. In the terminal, what Chris Down suggests does indeed work: I can compile and it produces the PDF I want. But it doesn't work through TeXShop: I edited the TeXShop preferences, checked the path and modified Engine>TeX+dvips+distiller, putting

xelatex -output-driver="xdvipdfmx -i dvipdfmx-unsafe.cfg -q -E" 

but when I compile through TeXShop, with the XeLaTeX composer, it seems to work fine at first (and it produces exactly the same .log and .aux), but it doesn't produce the right pdf, with the same error as Ulrich reports (/invalidfaccess in --run-- called by pstricks.pro).

I don't understand what to put in TeXShop preferences for it to actually do exactly the same thing as the terminal does, no more, no less...

Thanks, best regards, Christian (it's for a friend, I personally use emacs and the terminal on my mac).

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 22, 2021 at 11:46
  • Your question will mit be read by mañy people Here, pleased ASK a New one
    – Mensch
    Dec 22, 2021 at 12:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .