gpt4 book ai didi

macos - Mac 上的 auctex 和 emacs

转载 作者:行者123 更新时间:2023-12-02 00:03:19 24 4
gpt4 key购买 nike

我想要的是能够成功地使用 emacs 和 auctex。

一些系统信息:

ProductName:    Mac OS X
ProductVersion: 10.8.5
BuildVersion: 12F45

Emacs
Version 24.3 (9.0)

AUCTeX-version is a variable defined in `tex-site.el'.
Its value is "11.87"

我尝试过两件事。首先,按照建议从 emacs 中以交互方式安装 auctex:

M-x package-list-packages RET

从表面上看,一切似乎都在按预期工作:

\documentclass{article}
\bein{document}
Hello world
\section{Here lies a section}
Hello people.
\end{doument}

您无法在代码中看到它,但在我的 emacs 屏幕上,语法高亮显示有效,并且可以看到 auctex 图标。环境完成命令也可以正常工作(比如填写\begin 和\figure 的东西)。现在发出编译命令:

C-c C-c

我收到以下消息:

LaTeX: problems after [0] pages

查看源代码有两个错误没有被拾取,而且即使没有错误,文档似乎也没有编译,没有创建 dvi 或 pdf 或 aux 文件。还测试查看功能,没有任何反应。所以似乎有些地方没有正确配置。

其次,在没有卸载或删除 auctex 的情况下(我怀疑这可能与某些事情有关,但我不确定,我们稍后会看到)我找到了网页:http://algorithmicallyrandom.blogspot.com/2012/08/getting-auctex-working-on-mac-os-x.html这建议从源代码构建:

*) ./configure --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --disable-preview --with-lispdir=/Applications/Emacs.app/Contents/Resources/site-lisp/
*) make
*) sudo make install

然后将这些行添加到您的 .emacs 文件

(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)

让我觉得这次安装成功的一点是我下载的源代码是 11.87 版本,这就是我当前运行的 auctex 版本。然而,相同的行为仍在继续,基本上没有任何编译或查看功能似乎在工作。

另一件事,从周围阅读看来,当将它包含在我的 .emacs 文件中时,您似乎还需要 preview-latex.el 包

(load "preview-latex.el" nil t t)

我得到一个错误,所以我很确定这个包没有正确安装。所以我的问题主要是,我在这里错过了什么?我怎样才能成功地一起运行 emacs 和 auctex(也许还有 preview-latex.el 包)?

也许这包括完全删除 auctex 并重新安装它。当我以交互方式安装 emacs 包时,如何删除它(尝试一个)?从源代码安装时如何删除 emacs 包(尝试两个)?

也可能是我没有安装 ghost 脚本,但我不确定如何检查。

伙计,我知道这很多,我正在尝试提供所需的任何信息。如果您已经解决了这个问题并且可以帮助我,我将不胜感激。

最佳答案

您可能需要配置 emacs 以识别 shell 路径。为此,只需安装 exec-path-from-shell 包。以下链接提供了一些帮助。 PATH and exec-path set, but emacs does not find executable

关于macos - Mac 上的 auctex 和 emacs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20015930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com