我对 Emacs 终端模式有一些问题。我是 mac 用户,我使用从 emacsformacosx.com 下载的 Emacs;我还安装了 ESS 和 AucTex。
我使用 R、LaTex、Sweve 以及使用 Emacs 进行管理。当我想编译 Sweave 文件时,我打开终端并使用“ R CMD Sweave myfile.Rnw ”命令生成一个 myfile.tex 文件。在此之后,我使用“ pdflatex myfile.tex ”命令来编译 LaTex 文件。
如果在 osx 的终端应用程序中使用,所有这些命令都可以正常工作,但是如果我使用 Emacs 终端模式,pdflatex 命令将不起作用:
bash:pdflatex:找不到命令
你有什么建议吗?
编辑 感谢您的建议,我解决了添加到我的 .emacs 的问题:
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(replace-regexp-in-string "[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when (equal system-type 'darwin) (set-exec-path-from-shell-PATH))
我在链接文本中找到它
最好的里卡多