
Carbon Emacsでmuse-modeからpdfを作成するための方法です。
いろいろ試行錯誤しちゃったけど、やっとできたので、メモ。
(require 'muse-mode)
(require 'muse-latex)
(setq muse-latex-header
"%% -*- mode: japanese-Latex; coding: shift_jis -*-
\\documentclass{article}
\\usepackage[pdftex]{graphicx}
\\newcommand{\\comment}[1]{}
\\begin{document}
\\title{<lisp>(muse-publishing-directive \"title\")</lisp>}
\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
\\maketitle
<lisp>(and muse-publish-generate-contents
(not muse-latex-permit-contents-tag)
\"\\\\tableofcontents\n\\\\newpage\")</lisp>\n\n")
(defun muse-latex-pdf-generate2 (file output-path final-target)
(muse-publish-transform-output
file output-path final-target "PDF"
(function
(lambda (file output-path)
(let ((command (format "cd \"%s\"; platex \"%s\";"
(file-name-directory output-path) file))
(times 0)
result)
;; XEmacs can sometimes return a non-number result. We'll err
;; on the side of caution by continuing to attempt to generate
;; the PDF if this happens and treat the final result as
;; successful.
(while (and (< times 2)
(or (not (numberp result))
(not (eq result 0))
;; table of contents takes 2 passes
(file-readable-p
(muse-replace-regexp-in-string
"\\.tex\\'" ".toc" file t t))))
(setq result (shell-command command)
times (1+ times)))
(if (or (not (numberp result))
(eq result 0))
t
nil))
(let ((dvi (muse-replace-regexp-in-string
".tex" "" file t t)))
(shell-command (format "cd \"%s\"; dvipdfmx \"%s\";"
(file-name-directory output-path) dvi)))
))
".aux" ".toc" ".out" ".log" ".dvi"))
(muse-derive-style "pdf" "latex"
:final 'muse-latex-pdf-generate2
:browser 'muse-latex-pdf-browse-file
:link-suffix 'muse-latex-pdf-extension
:osuffix 'muse-latex-pdf-extension)
5. 完了。
これで、例えば tmp.muse
** おいおいこれでうまくいくかい?
*** いくっぽい
**** できてるっぽい
- これで
- うまく
- いくかい?
** できてるぜ!
なんてファイルを作成して、
C-c C-t pdf[RET]
すると、pdfが生成されます。
elispが全然分かんなくて、上記は適当なんで、間違えてたら指摘よろしくです。
もちろん、これらをやる場合は自己責任でよろしくです。
参考にさせて頂いたページです。
pTeX package for MacOSX
JIS X0212 for pTeX
emacs-muse のインストールと設定<BR> (Carbon Emacs & NTEmacs)
日本語 pLaTex のインストールと設定<BR> (MacOSX & Cygwin on Windows)
ITmedia エンタープライズ:文書作成に役立つEmacs Muse
Open Tech Press 文書作成に役立つEmacs Muse
The Emacs Muse (by John Wiegley)