# TeXShop and Mac preview crashing when opening latex/beamer built pdfs

After updating to Sierra 10.12.4 last week, TeXShop crashes:

1. when opening an existing .tex document that has a pdf associated to it
2. immediately after compiling a new document, i.e. as soon as a pdf is created.

Furthermore, preview crashes opening almost any pdf that has been created with TeXShop. There is virtually nothing on the internet about it, and the only solution seems to be a complete reinstall of MacOSX (so as to reinstall the supposedly broken preview), which I'd like to avoid if at all possible.

Someone else has described a similar issue, but has not received any responses (Texshop not compiling after Mac update to sierra 10.12.4).

I would be very grateful for some help, as I can neither produce work, nor look at any at the moment. Many thanks!

• You don't give any details about your TeX document. There was a communication from Dick Koch over the weekend: "It is a bug that using pstricks with pdflatex introduces hangs with PDFKit, and this has been reported to Apple. But no essential functionality is lost with this bug." That is all I've seen. – sgmoye Apr 4 '17 at 11:39
• There seems to be a bug in PDFKit in macOS 10.12.4 that is causing the crash. Apple knows about it and is working on a solution. As far as the TeX end of things the problem seems to be related to using the pstricks package but typesetting with pdflatex. – Herb Schulz Apr 4 '17 at 12:58

To solve, remove the PDF file from the source folder. Then open the source in TeXShop. Check the header. Did you \usepackage{pstricks}? Comment out this line and typeset again. (Or, leave the line and typeset with TeX + DVI.)

If this is your problem, then Apple knows about the bug. If this is NOT your problem, please write me (author of TeXShop) with details, including source and illustrations.

If you hold down the option key in TeXShop when opening a file, only the source will open. Use this trick to fix a project with this bug. Open the file with the option key, comment out the pstricks line and typeset again with pdflatex, or just typeset with TeX + DVI. Then the PDF will not be defective and TeXShop can open it the usual way.

• Unfortunately, this hasn't so far worked for me. I sent you an email, and hope this has reached you. Many thanks! D – DES Apr 5 '17 at 15:27
• After a private correspondence with Dick Koch, I succeeded with his advice: "If you are going to use pstricks, there is a simple [solution] for your files. Add '% !TEX TS-program = latex' [t]o the very top of your sources, and then they will ALWAYS be typeset with TeX + DVI." This worked for me and my pdfs are now readable with Preview. – DES Apr 5 '17 at 17:14
• @RichardKoch: has Apple fixed this bug yet? I don't want to upgrade to 10.12.4 until it has been. – user26732 Apr 17 '17 at 4:16

I just did the Sierra 10.12.4 update today, and immediately encountered the same problem with a LaTeX beamer file (no explicit inclusion of pstricks).

Compilation just hung at one point and I had to force-quit TeXShop. When I then tried to open the .tex file again by double-clicking on it, TeXShop showed itself as running in the dock, but no windows would actually open (either source or pdf) and I had to force quit again.

This happened several times, even after a reboot.

When I deleted the existing pdf file from the source directory and then double-clicked on my .tex file, things seemed to work normally (both source and pdf windows opened).

• I am suffering from the same issue, after updating to Sierra 10.12.5. – Stephen Nand-Lal May 22 '17 at 12:57

I was having this problem as well - after days of experimenting, and I found that typesetting with the lualatex command in TeXShop sort of fixed things.

The PDF preview in TeXShop looks nice and sharp, and the PDF in Preview doesn't crash, but it's slightly blurry.

• Welcome to TeX.SX! It would be great if you could add an explanation why it fixes it (and remove the "I had the problem too" part). Then it will be answer. – TeXnician Apr 8 '17 at 15:54
• While it's still bad practice to load pstricks and typeset with pdflatex there has been an update to pstricks that corrects the creation of a slightly malformed pdf file when typeset with pdflatex. – Herb Schulz Apr 8 '17 at 17:06