MacOSXでYaTeX環境を整える

用意するもの

あらかじめ導入されているのが前提で話を進めますので、導入方法とかは各自で適当にググるなりしてください。

YaTeXの下準備

Mac環境をUTF-8で統一したかったので、YaTeX自体に少しだけ手を加えます。yatexlib.elの49行目(バージョンによって違うと思いますが)のリストに'(4 . *utf-8*)を追加してください。

TeXShopの下準備

同じくUTF-8のための準備です。

$cd ~/Library/TeXShop/bin/
$cp platex2pdf-euc platex2pdf-utf8
$cp ptex2pdf-euc ptex2pdf-utf8

YaTeXの設定

環境に合わせて.emacs.elあたりに記述してください。殆ど拾い物です。

;; YaTeX-mode init
(setq auto-mode-alist
      (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)

(setq tex-command "~/Library/TeXShop/bin/platex2pdf-utf8"
      dvi2-command "open -a Preview"
      YaTeX-kanji-code 4
      section-name "documentclass"
      makeindex-command "mendex"
      YaTeX-use-AMS-LaTeX t
      YaTeX-use-LaTeX2e t
      YaTeX-use-font-lock t
      )

使い方

  • *.texファイルを開くとHookしてYaTeX-modeに入る
  • C-c sでsection補完、C-c bでbegin補完
  • C-c tでコンパイルとかのサブメニュー