在 OS X 中通过 Emacs.app 安装 AucTeX 1.86

Ric*_*rdo 9 emacs osx-snow-leopard auctex installation

我正在尝试通过来自 emacsformacosx.com 的 Emacs 二进制文件(版本 24.0.50)安装 AucTeX 1.86。第一次尝试./configure输出:

configure: error: Cannot find the texmf directory!
Please use --with-texmf-dir=dir to specify where the preview tex files go configure: error: ./configure failed for preview

我补充说--with-texmf-dir=/usr/local/texlive/texmf-local,我./configure高兴地回复了几句祝贺。我编译makesudo make install无故障。

我在 Emacs 上打开了一个 .tex 文件,但 AucTeX 没有加载。我(load auctex.el nil t t)在 *scratch* 缓冲区和 Emacs 输出中发出Cj:

Debugger entered--Lisp error:(file-error "Cannot open load file" "auctex.el")

有事了。我想 Emacs 找不到该文件,所以它一定没有安装在它应该安装的地方。我将大部分 AucTeX 文件追踪到/usr/share/emacs/site-lispEmacs 22.1 所在的 。

我在这里有两个选择: 1. 告诉 Emacs 在哪里可以找到 AucTeX(我不知道该怎么做);2. 使用更多配置选项重新编译 AucTeX(看起来更直接)。

我选择重新编译,删除之前安装的所有 AucTeX 文件后。这次我配置了源,告诉它它应该使用的 Emacs 在哪里,使用:

./configure -with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --with-lisp-dir=/Applications/Emacs.app/Contents/Resources/site-lisp --with-texmf-dir=/usr/local/texlive/texmf-local

这次它抱怨:

`configure: error: Cannot locate lisp directory,`
`use  --with-lispdir, --datadir, or possibly --prefix to rectify this`
Run Code Online (Sandbox Code Playgroud)

即使我包含了该--with-lisp-dir=dir选项。如果我把它拿出来,它仍然抱怨找不到 lisp 目录。AucTeX 似乎不喜欢 Applications 文件夹中的 Emacs.app。

我的问题是,我如何让它发挥作用?

Kip*_*ros 11

下面是我如何让 Auctex 与纯 Emacs 一起工作:

  1. 安装MacTeX 分发包
  2. 下载 OS X emacs,放在/Applications
  3. 下载 Auctex tarball
  4. 进入 Auctex 目录,使用以下命令进行配置:

    ./configure --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --with-lispdir=/Applications/Emacs.app/Contents/Resources/site-lisp --with-texmf-dir=/usr/local/texlive/texmf-local
    
    Run Code Online (Sandbox Code Playgroud)
  5. 执行:

    make; sudo make install
    
    Run Code Online (Sandbox Code Playgroud)

    将 中的elisp文件Emacs.app、信息文件安装到/usr/local/share/info等。

  6. 编辑您的~/.emacs文件以加载 Auctex/preview-latex,并将 Emacs 指向您的 Latex 可执行文件:

    (setenv "PATH" (concat "/usr/texbin:/usr/local/bin:" (getenv "PATH")))
    (setq exec-path (append '("/usr/texbin" "/usr/local/bin") exec-path))
    (load "auctex.el" nil t t)
    (load "preview-latex.el" nil t t)
    
    Run Code Online (Sandbox Code Playgroud)
  7. Auctex 和 preview-latex 现在应该可以工作了。要记住的一件事:使用旧版本的 Auctex,该ps途径似乎比pdf; 如果预览乳胶图像没有出现错误“/typecheck in --setfileposition--”,请尝试通过“菜单栏 -> 命令 -> TeXing 选项”禁用“生成 PDF”。


更新:步骤 (2--5) 可以替换为 Homebrew 包管理器:

brew install emacs --cocoa
brew install auctex
Run Code Online (Sandbox Code Playgroud)

其他步骤还是正确的。Emacs“生成 PDF”选项现在对我有用。


Ric*_*rdo 5

在 Mac/GNUstep 手册中,从 Finder 启动的 Emacs 实例不继承环境变量,因此需要对其进行设置。/etc/path并将/etc/path.d/在系统范围内设置环境变量,但必须让它们可用于 GUI(Finder 启动的实例),它们需要在~/.MacOSX/environment.plist文件中设置。

目录和文件必须由用户创建。完成后,将以下内容(根据需要修改)粘贴到您的environment.plist文件中。我从位于http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2009-12/msg00199.html的邮件列表中的一条消息中得到这个消息。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/texlive/2009basic/bin/universal-darwin</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

AUCTeX 现在应该表现良好。