2008年8月14日星期四

metapost with emacs

写个脚本:
#!/bin/sh

mpost $1
tex mproof *.[0-9]
dvips mproof.dvi
evince mproof.ps
exit 0

在.emacs中加入:
;;;;;metapost
(defun mpost-compile () (interactive)
(save-buffer)
(shell-command (format mpost-compile-command buffer-file-name))
)
(defvar mpost-compile-command "/home/qingant/MP/metap.sh %s >/dev/null 2>&1")
(add-hook 'metapost-mode-hook
'(lambda nil
(define-key meta-mode-map "\C-c\C-c" 'mpost-compile)
)
)

没有评论: