OSX 安装MacTex Emacs+Auctex

37 篇文章 3 订阅
9 篇文章 0 订阅

从stackoverflow上找到的,已经安装成功,借此留存下

Here's how I got Auctex to work with pure Emacs:

  1. Install the MacTeX distribution package
  2. Download OS X emacs, place in /Applications
  3. Download the Auctex tarball
  4. Go to the Auctex directory, configure with the command:

    ./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
    
  5. Execute:

    make; sudo make install
    

    to install the elisp files inside the Emacs.app, the info files to /usr/local/share/info, etc.

  6. Edit your ~/.emacs file to load Auctex/preview-latex, and point Emacs to your Latex executables:

    (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)
    
  7. Auctex and preview-latex should work now. One thing to keep in mind: with older versions of Auctex, the ps pathway seems to work better than pdf; if preview-latex images aren't appearing with the error "/typecheck in --setfileposition--", try disabling "Generate PDF" via "Menu Bar -> Command -> TeXing option".


Update: Steps (2--5) can be replaced with the Homebrew package manager:

brew install emacs --cocoa
brew install auctex

The other steps are still correct. The Emacs "Generate PDF" option now works for me

注意,其中在安装Auctex前,要先准备好环境变量,不然没法编译AucTex:




2016-04-22更新:

auctex的configure配置如下:

./configure --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --with-lispdir=/Users/kirchhoff/.emacs.d/lisp  --with-texmf-dir=/usr/local/texlive/texmf-local

可以安装到.emacs.d目录里


此外还有$HOME下的.zshenv 配置如下:

PATH=/usr/local/texlive/2015/bin/x86_64-darwin:$PATH;export PATH
MANPATH=/usr/local/texlive/2015/texmf-dist/doc/man:$MANPATH;export MANPATH
INFOPATH=/usr/local/texlive/2015/texmf-dist/doc/info:$INFOPATH;export INFOPATH

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值