简体   繁体   中英

Problems with pdflatex in emacs org-export-as-pdf

I have some problems with the emacs org-mode. When I use the command org-export-as-pdf in org-mode, I got the error:

/bin/bash: pdflatex: command not found [3 times]

I am a Mac OS X(10.7) user and the version of emacs is 24.2. I downloaded the Tex Live from the official website and it was installed at /usr/local/texlive . I knew the env variables of emacs shell is different from user's terminal, so I tried this command:

M-! $PATH 

it printed:

/bin/bash: /usr/bin:/bin:/usr/sbin:/sbin: No such file or directory

then I typed some commands below:

$which pdflatex
/usr/texbin

$ln -s /usr/texbin/pdflatex /usr/bin

and then I turned back to emacs, and tried org-export-as-pdf again, the same problem still existed.
I am confused and I need your help ;-)

Add the pdflatex directory to the Emacs PATH environment variable, instead of the symbolic link, eg add this to ~/.emacs :

(setenv "PATH" (concat (getenv "PATH") ":/usr/texbin"))

and source it again with Mx load-file and type ~/.emacs . And now Cc Ce lp in Org-mode works:

PDF file produced.

(Cross-posted on Unix.StackExchange .)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM