I am a Newbee on Emacs and AucTex. I just get started several days ago and installed some packages as some tutorials go along.

I installed some packages: company, swiper, auctec, auto-complete-auctex, and counsel. In particular, auctex has version 12.2.0.

My Problem:

I installed it yesterday, and I could do C-c C-a to preview it entirely. However, I cannot do preview-latex (C-c C-p C-p). It gives me error with lots of "under construction triangles":

What I see

TeX Output exited as expected with code 1 at Thu Apr 23 00:21:29
Running `Preview-PDF2DSC' with ``pdf2dsc _region_.pdf _region_.prv/tmpQ3JlTM/preview.dsc''
/bin/sh: pdf2dsc: command not found

Preview-PDF2DSC exited abnormally with code 127 at Thu Apr 23 00:21:29
PDF2DSC sentinel: Opening input file: No such file or directory, /myworkingdirectory/_region_.prv/tmpQ3JlTM/preview.dsc

It generates several files in my working directory: My working directory

The directory it referring has no file in it. And this is the corresponding elisp code, and yes, I checked latex is in that folder path. My elisp code

Update 1:

I did not install ghostscript. After I installed, the problem is still exist.

Update 2:

I found this answer really helpful How to use Auctex in MacOS El Capitan? At least for Mac OS Catalina, one shall use

;; Auctex configurations
(setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)
(setq exec-path (append exec-path '("/Library/TeX/texbin")))

to set the environment path.

Shout out to @frougon for his patience on me! His code also works

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin:/Library/TeX/texbin"))
(setq exec-path (append exec-path '("/usr/local/bin" "/Library/TeX/texbin")))
  • 1
    Log says it can't find pdf2sc. Did you made TeX installation? If so, check, whether this pdf2sc binary is installed. Remember your TeX AucTeX doesn't ship with TeX, you need to install *TeX binaries on your own, using a TeX distro (texlive, mictex, protext… can't remember the name of the Mac devoted one).
    – sztruks
    Apr 23, 2020 at 7:48
  • 2
    But do you have pdf2dsc installed? Look in your distribution for this peculiar binary.
    – sztruks
    Apr 23, 2020 at 9:08
  • 1
    On my Debian system, pdf2dsc comes from the ghostscript package.
    – frougon
    Apr 23, 2020 at 10:25
  • 1
    1) I know it works in terminal. My question is, do you still have this error message when generating previews under AUCTeX, as your question shows? 2) M-: is Meta-:. If you don't know your Meta key (?!), try Alt, but you can also do Esc then :. I was just suggesting to add /usr/local/bin to the PATH setting from your question (although I find it strange that /usr/local/bin is not already in Emacs's PATH; maybe you should first print the PATH from within Emacs). In order not to have paths duplicated due to the concat, this would require an Emacs restart, to keep things simple.
    – frougon
    Apr 23, 2020 at 11:33
  • 1
    I was reading about exec-path. This seems helpful. According to your output, I would do: (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin:/Library/TeX/texbin")) and (setq exec-path (append exec-path '("/usr/local/bin" "/Library/TeX/texbin"))).
    – frougon
    Apr 23, 2020 at 12:09


You must log in to answer this question.

Browse other questions tagged .