Context:
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":
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:
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.
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")))
pdf2dsc
comes from theghostscript
package. – frougon Apr 23 '20 at 10:25M-:
isMeta-:
. 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 theconcat
, this would require an Emacs restart, to keep things simple. – frougon Apr 23 '20 at 11:33exec-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 '20 at 12:09