ユーザ用ツール

サイト用ツール


サイドバー

yatex

YaTeX

sudo apt-get install yatex

.emacs.d/init.el等に以下の文を追加

;旧来のショートカットを利用(ubuntu only?)
(setq YaTeX-inhibit-prefix-letter nil)
 
;;*.texで自動的にYaTeXモード
(setq auto-mode-alist
      (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;;TeX typeset
(setq tex-command "platex")
;;dvi preview
(setq dvi2-command "evince")
;; 1 = Shift_JIS, 2 = ISO-2022-JP, 3 = EUC-JP, 4 = UTF-8
(setq YaTeX-kanji-code 4)
;;use LaTeX2e and AMS-LaTeX
(setq YaTeX-use-LaTeX2e t)
(setq YaTeX-use-AMS-LaTeX t)
;;font latex hook
(add-hook 'yatex-mode-hook
         '(lambda () (require 'font-latex)
            (font-latex-setup))) 
;;RefTeX mode
;(add-hook 'yatex-mode-hook '(lambda () (reftex-mode t)))
;;auto fill mode
;(add-hook 'yatex-mode-hook '(lambda () (auto-fill-mode t) (setq fill-column 70)))
;;color
;;(setq YaTeX-use-font-lock t)
;; section color
;;(setq YaTeX-hilit-sectioning-face '(light時のforecolor/backcolor dark時の forecolor/backcolor))
;;(setq YaTeX-hilit-sectioning-face '(white/snow3 snow1/snow3))
;(add-hook 'yatex-mode-hook
;'(lambda () (require 'font-latex)
;            (font-latex-setup)
;            (progn
;              (modify-syntax-entry ?% "<" (syntax-table))
;              (modify-syntax-entry 10 ">" (syntax-table))
;              (make-variable-buffer-local 'outline-level)
;              (setq outline-level 'latex-outline-level)
;              (make-variable-buffer-local 'outline-regexp)
;              (setq outline-regexp
;                    (concat "[  \t]*\\\\\\(documentstyle\\|documentclass\\|chapter\\|"
;                           "section\\|subsection\\|subsubsection\\|paragraph\\)"
;                            "\\*?[ \t]*[[{]")
;                    ))))
;;outline-minor-mode
;(add-hook 'yatex-mode-hook '(lambda () (outline-minor-mode t)))
;(setq-default outline-level 'outline-level)
;
;(defun latex-outline-level ()
;  (save-excursion
;    (looking-at outline-regexp)
;    (let ((title (buffer-substring (match-beginning 1) (match-end 1))))
;      (cond ((equal (substring title 0 4) "docu") 20)
;            ((equal (substring title 0 4) "para") 15)
;            ((equal (substring title 0 4) "chap") 0)
;            ((equal (substring title 0 4) "appe") 0)
;            (t (length title))))))
;
;;misc mode
;(add-hook 'yatex-mode-load-hook
;          (function
;           (lambda ()
;             (YaTeX-define-key "w" 'sdic-describe-word)
;             (YaTeX-define-key "\C-w" 'YaTeX-switch-mode-menu)))) 
;
;math-sign の追加
;
;(setq
; YaTeX-math-sign-alist-private
; '(
;   ("q"         "Q"          "(Q)")
;   ("z"         "Z"          "ZZ")
;   ("t""text""text")
;   ("qu"        "quad"         "__")
;   ("qq"        "qquad"         "____")
;   ("ls"        "varlimsup"     "___\nlim")
;   ("li"        "varliminf"     "lim\n---")
;   ("il"        "varinjlim"     "lim\n-->")
;   ("pl"        "varprojlim"    "lim\n<--")
;   ("st"        "text{ s.t. }" "s.t.")
;   ("bigop"     "bigoplus"      "_\n(+)~")
;   ("bigot"     "bigotimes"     "_\n(x)\n ~")
;   ))
;;dvipdfmxの追加
;; dviからpdfを作成する%sはファイル名
(setq dviprint-command-format "dvipdfmx %s")
;; latexmkを使う場合
; (setq tex-command "latexmk -dvi")
;;mendexの指定 †
;(setq makeindex-command "mendex")
;;テンプレート
;; ~/.LaTeX-templateは新規ファイル作成時に自動挿入するファイル名
;(setq YaTeX-template-file "~/.LaTeX-template")

これでemacs上でC-c tと打つとコンパイルやPDF化ができる.

yatex.txt · 最終更新: 2017/10/03 12:55 (外部編集)