When I try to export an org
file to pdf
using C-c C-e l o
I get the following message:
Saving file /Users/user/tmp/test.tex...
Wrote /Users/user/tmp/test.tex
Processing LaTeX file ./test.tex...
/bin/bash: pdflatex: command not found [3 times]
org-latex-compile: PDF file ./test.pdf wasn't produced
This happens when I open emacs by clicking on the icon that can be found in /Applications
. However, if I open emacs from the command line:
/Applications/Emacs.app/Contents/MacOS/Emacs
I can export the org
file without any problem. It seems like in both cases the same init file is loaded and I fail to understand the problem. Any ideas?
NB: version
returns:
GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-21 on builder10-9.porkrind.org
and org-version
returns:
Org-mode version 8.2.10 (8.2.10-21-ga712ce-elpaplus @ /Users/drorata/.emacs.d/elpa/org-plus-contrib-20141201/)
Finally, I'm using OS X 10.10.
The $PATH
:
I tried to include either (add-to-list 'exec-path "/usr/texbin/pdflatex")
or (add-to-list 'exec-path "/usr/texbin")
in my .emacs
but this didn't help.
$PATH
. Usewhich pdflatex
from the terminal to find where the program is. As a work around, you can then add this directory to Emacs' path with(add-to-list 'exec-path "/path/to/file")
(setenv "PATH" (concat (getenv "PATH") ":/usr/texbin"))
M-! which pdflatex RET
echo?