blog/content/post/2009-01-10-00001110.md

279 lines
25 KiB
Markdown

---
title: '[emacs][muse] Carbon EmacsでMuseのPDFを生成する'
author: kazu634
date: 2009-01-09
url: /2009/01/10/_1191/
wordtwit_post_info:
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:4481;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
categories:
- つれづれ
---
<div class="section">
<p>
<a href="http://f.hatena.ne.jp/sirocco634/20090110073921" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://f.hatena.ne.jp/sirocco634/20090110073921', '');" class="hatena-fotolife" target="_blank"><img src="http://cdn-ak.f.st-hatena.com/images/fotolife/s/sirocco634/20090110/20090110073921.png" alt="f:id:sirocco634:20090110073921p:image" title="f:id:sirocco634:20090110073921p:image" class="hatena-fotolife" /></a>
</p>
<h4>
対象とする人
</h4>
<ul>
<li>
小川版のpLatexを導入している人で、Emacs MuseでPDFを生成したい人
</li>
<li>
Emacsのデフォルト文字コードがshift-jisではない人
</li>
</ul>
<h4>
基本的な設定
</h4>
<p>
Carbon Emacsでの設定例は以下のサイトが参考になります。
</p>
<ul>
<li>
<a href="http://homepage.mac.com/matsuan_tamachan/software/EmacsMuse.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://homepage.mac.com/matsuan_tamachan/software/EmacsMuse.html', 'emacs-muse のインストールと設定&#060;BR&#062; (Carbon Emacs &#038; NTEmacs)');" target="_blank">emacs-muse のインストールと設定<BR> (Carbon Emacs & NTEmacs)</a>
</li>
<li>
<a href="http://hawaii.naist.jp/~kohei-h/my/emacs-muse.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://hawaii.naist.jp/~kohei-h/my/emacs-muse.html', '機械学習序曲(仮) &#062; Emacs Museを用いたスマートな文書作成法');" target="_blank">機械学習序曲(仮) > Emacs Museを用いたスマートな文書作成法</a>
</li>
<li>
<a href="http://sourceforge.jp/magazine/07/04/11/0221217" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://sourceforge.jp/magazine/07/04/11/0221217', '文書作成に役立つEmacs Muse &#8211; SourceForge.JP Magazine');" target="_blank">文書作成に役立つEmacs Muse &#8211; SourceForge.JP Magazine</a>
</li>
<li>
<a href="http://hiro2.jp/2007-06-18-1.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://hiro2.jp/2007-06-18-1.html', '&#091;hiro&#093; muse-modeでpdf作成');" target="_blank">&#91;hiro&#93; muse-modeでpdf作成</a>
</li>
</ul>
<p>
を参考にするといいです。特に「<a href="http://hiro2.jp/2007-06-18-1.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://hiro2.jp/2007-06-18-1.html', '&#091;hiro&#093; muse-modeでpdf作成');" target="_blank">&#91;hiro&#93; muse-modeでpdf作成</a>」では小川版のplatexを用いた関数が定義されているようなので、これを用います。
</p>
<h4>
問題発生!
</h4>
<p>
小川版のpLatexは文字コードとしてshift-jisしかダメなようです。でもそれだと、文字コードの違うtexソースは文字化けして、platexを通りません。結果的に、dviファイルが作成されずエラーが出てPDFが作れなくなります。
</p>
<p>
<a href="http://hiro2.jp/2007-06-18-1.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://hiro2.jp/2007-06-18-1.html', '&#091;hiro&#093; muse-modeでpdf作成');" target="_blank">&#91;hiro&#93; muse-modeでpdf作成</a>」ではPDF作成用の関数を自前で定義しているようです:
</p>
<pre class="syntax-highlight">
<span class="synSpecial">(</span><span class="synStatement">defun</span> muse-latex-pdf-generate2 <span class="synSpecial">(</span>file output-path final-target<span class="synSpecial">)</span>
<span class="synSpecial">(</span>muse-publish-transform-output
file output-path final-target <span class="synConstant">&#34;PDF&#34;</span>
<span class="synSpecial">(</span><span class="synStatement">function</span>
<span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>file output-path<span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">let</span> <span class="synSpecial">((</span>command <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cd \&#34;%s\&#34;; platex \&#34;%s\&#34;;&#34;</span>
<span class="synSpecial">(</span>file-name-directory output-path<span class="synSpecial">)</span> file<span class="synSpecial">))</span>
<span class="synSpecial">(</span>times <span class="synConstant"></span><span class="synSpecial">)</span>
result<span class="synSpecial">)</span>
<span class="synComment">;; XEmacs can sometimes return a non-number result. We'll err</span>
<span class="synComment">;; on the side of caution by continuing to attempt to generate</span>
<span class="synComment">;; the PDF if this happens and treat the final result as</span>
<span class="synComment">;; successful.</span>
<span class="synSpecial">(</span>while <span class="synSpecial">(</span><span class="synStatement">and</span> <span class="synSpecial">(</span><span class="synStatement">&#60;</span> times <span class="synConstant">2</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">or</span> <span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">numberp</span> result<span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">eq</span> result <span class="synConstant"></span><span class="synSpecial">))</span>
<span class="synComment">;; table of contents takes 2 passes</span>
<span class="synSpecial">(</span>file-readable-p
<span class="synSpecial">(</span>muse-replace-regexp-in-string
<span class="synConstant">&#34;\\.tex\\'&#34;</span> <span class="synConstant">&#34;.toc&#34;</span> file <span class="synStatement">t</span> <span class="synStatement">t</span><span class="synSpecial">))))</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> result <span class="synSpecial">(</span>shell-command command<span class="synSpecial">)</span>
times <span class="synSpecial">(</span><span class="synStatement">1+</span> times<span class="synSpecial">)))</span>
<span class="synSpecial">(</span><span class="synStatement">if</span> <span class="synSpecial">(</span><span class="synStatement">or</span> <span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">numberp</span> result<span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">eq</span> result <span class="synConstant"></span><span class="synSpecial">))</span>
<span class="synStatement">t</span>
<span class="synStatement">nil</span><span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">let</span> <span class="synSpecial">((</span>dvi <span class="synSpecial">(</span>muse-replace-regexp-in-string
<span class="synConstant">&#34;.tex&#34;</span> <span class="synConstant">&#34;&#34;</span> file <span class="synStatement">t</span> <span class="synStatement">t</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>shell-command <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cd \&#34;%s\&#34;; dvipdfmx \&#34;%s\&#34;;&#34;</span>
<span class="synSpecial">(</span>file-name-directory output-path<span class="synSpecial">)</span> dvi<span class="synSpecial">)))</span>
<span class="synSpecial">))</span>
<span class="synConstant">&#34;.aux&#34;</span> <span class="synConstant">&#34;.toc&#34;</span> <span class="synConstant">&#34;.out&#34;</span> <span class="synConstant">&#34;.log&#34;</span> <span class="synConstant">&#34;.dvi&#34;</span><span class="synSpecial">))</span>
</pre>
<p>
単純にplatexを適切な回数分実行し、生成されたdviファイルをdvipdfmxに渡しているようです。
</p>
<p>
問題なのは生成されるtexファイルの文字コードがshift-jisではないことなので、以下の関数を定義してみました:
</p>
<pre class="syntax-highlight">
<span class="synComment">;; This function receives an argument and</span>
<span class="synComment">;; it converts that file into shift-jis.</span>
<span class="synSpecial">(</span><span class="synStatement">defun</span> generate_shiftjis <span class="synSpecial">(</span>file<span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">let*</span> <span class="synSpecial">((</span>tempfile <span class="synSpecial">(</span>expand-file-name <span class="synSpecial">(</span>make-temp-file <span class="synConstant">&#34;tmp&#34;</span> <span class="synStatement">nil</span> <span class="synConstant">&#34;.tex&#34;</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>cmd1 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cp %s %s&#34;</span> file tempfile<span class="synSpecial">))</span>
<span class="synSpecial">(</span>cmd2 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;nkf -s %s &#62; %s&#34;</span> tempfile file<span class="synSpecial">))</span>
<span class="synSpecial">(</span>cmd3 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;rm %s&#34;</span> tempfile<span class="synSpecial">))</span>
result<span class="synSpecial">)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd1<span class="synSpecial">)</span> <span class="synComment">; (shell-command cmd1)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd2<span class="synSpecial">)</span> <span class="synComment">; (shell-command cmd2)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd3<span class="synSpecial">)))</span> <span class="synComment">; (shell-command cmd3)</span>
</pre>
<p>
やっているのは
</p>
<ol>
<li>
既存のtexファイル(文字コードがshit-jisではない)を一時ファイルに待避
</li>
<li>
nkfで待避ファイルをshift-jisに変換し、その結果を既存のtexファイルにリダイレクト
</li>
<li>
待避ファイルの削除
</li>
</ol>
<p>
です。これをplatex実行前に行うようにしてみました。
</p>
<h4>
実際の設定
</h4>
<p>
このようになりました:
</p>
<pre class="syntax-highlight">
<span class="synComment">;; ============</span>
<span class="synComment">;; === muse ===</span>
<span class="synComment">;; ============</span>
<span class="synComment">;; load authoring mode</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-mode</span><span class="synSpecial">)</span>
<span class="synComment">;; load publishing styles I use</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-html</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-latex</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-texinfo</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-docbook</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-wiki</span><span class="synSpecial">)</span>
<span class="synComment">;; (setq muse-html-encoding-default 'utf-8)</span>
<span class="synComment">;; (setq muse-html-meta-content-encoding (quote utf-8))</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> muse-latexcjk-encoding-default
<span class="synSpecial">(</span><span class="synStatement">cdr</span> <span class="synSpecial">(</span><span class="synStatement">assoc</span> <span class="synSpecial">'</span><span class="synIdentifier">utf-8</span> muse-latexcjk-encoding-map<span class="synSpecial">)))</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span>
muse-mode-hook
<span class="synSpecial">'(</span><span class="synStatement">lambda</span> <span class="synSpecial">()</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> outline-regexp <span class="synConstant">&#34;*+&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> outline-minor-mode <span class="synStatement">t</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> coding-system-for-write 'utf-8<span class="synSpecial">)))</span>
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">muse-project</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>add-to-list <span class="synSpecial">'</span><span class="synIdentifier">muse-project-alist</span>
<span class="synSpecial">'(</span><span class="synConstant">&#34;Default&#34;</span>
<span class="synSpecial">(</span><span class="synConstant">&#34;~/working/muse/default&#34;</span> :default <span class="synConstant">&#34;index&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>:base <span class="synConstant">&#34;html&#34;</span> :path <span class="synConstant">&#34;~/publish/html&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>:base <span class="synConstant">&#34;latex&#34;</span> :path <span class="synConstant">&#34;~/publish/pdf&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>:base <span class="synConstant">&#34;pdf&#34;</span> :path <span class="synConstant">&#34;~/publish/pdf&#34;</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> muse-latex-header
<span class="synSpecial">(</span>concat
<span class="synConstant">&#34;\\documentclass{jsarticle}\n&#34;</span>
<span class="synConstant">&#34;\\usepackage[expert,deluxe,multi]{otf}\n&#34;</span>
<span class="synConstant">&#34;\\usepackage[dvipdfm]{graphicx}\n&#34;</span>
<span class="synConstant">&#34;\\usepackage{tabularx}\n&#34;</span>
<span class="synConstant">&#34;\\renewcommand{\\figurename}{Fig.}\n\n&#34;</span>
<span class="synConstant">&#34;\\usepackage{float}\n\n&#34;</span>
<span class="synConstant">&#34;\\usepackage{fancyhdr}\n&#34;</span>
<span class="synConstant">&#34;\\pagestyle{fancy}\n&#34;</span>
<span class="synConstant">&#34;\\lhead{&#60;lisp&#62;(muse-publishing-directive \&#34;title\&#34;)&#60;/lisp&#62;}\n&#34;</span>
<span class="synConstant">&#34;\\chead{}\n&#34;</span>
<span class="synConstant">&#34;\\rhead{&#60;lisp&#62;(muse-publishing-directive \&#34;date\&#34;)&#60;/lisp&#62;}\n&#34;</span>
<span class="synConstant">&#34;\\cfoot{\\thepage}\n&#34;</span>
<span class="synConstant">&#34;\\setlength{\\headheight}{16pt}\n&#34;</span>
<span class="synConstant">&#34;\\begin{document}\n\n&#34;</span>
<span class="synConstant">&#34;% フォントの選択\n&#34;</span>
<span class="synConstant">&#34;% \\usekanji{JY1}{mc}{m}{n} % 明朝\n&#34;</span>
<span class="synConstant">&#34;% \\usekanji{JY1}{mc}{bx}{n} % ゴシック\n&#34;</span>
<span class="synConstant">&#34;% \\usekanji{JY1}{gt}{m}{n} % ゴシック\n&#34;</span>
<span class="synConstant">&#34;% \\gtfamily % ヒラギノ角ゴシック\n&#34;</span>
<span class="synConstant">&#34;% \\bfseries % ヒラギノ明朝ボールド\n&#34;</span>
<span class="synConstant">&#34;% \\gtfamily\\bfseries % ヒラギノゴシックボールド\n&#34;</span>
<span class="synConstant">&#34;\\mgfamily % ヒラギノ丸ゴシック\n\n&#34;</span>
<span class="synConstant">&#34;%% 表紙作製\n&#34;</span>
<span class="synConstant">&#34;\\title{&#60;lisp&#62;(muse-publishing-directive \&#34;title\&#34;)&#60;/lisp&#62;}\n&#34;</span>
<span class="synConstant">&#34;\\author{&#60;lisp&#62;(muse-publishing-directive \&#34;author\&#34;)&#60;/lisp&#62;}\n&#34;</span>
<span class="synConstant">&#34;\\date{&#60;lisp&#62;(muse-publishing-directive \&#34;date\&#34;)&#60;/lisp&#62;}\n\n&#34;</span>
<span class="synConstant">&#34;\\maketitle\n&#34;</span>
<span class="synConstant">&#34;\\pagebreak\n\n&#34;</span>
<span class="synConstant">&#34;%% 目次ページ作製\n&#34;</span>
<span class="synConstant">&#34;% \\Large\n&#34;</span>
<span class="synConstant">&#34;% \\hypertarget{mokuji}{}\n&#34;</span>
<span class="synConstant">&#34;% \\begin{center}\\LARGE\\bf\n&#34;</span>
<span class="synConstant">&#34;% 目次のタイトル\n&#34;</span>
<span class="synConstant">&#34;% \\end{center}\n&#34;</span>
<span class="synConstant">&#34;% \\tableofcontents\n&#34;</span>
<span class="synConstant">&#34;% \\pagebreak\n\n&#34;</span>
<span class="synConstant">&#34;&#60;lisp&#62;(and muse-publish-generate-contents\n \&#34;\\\\tableofcontents\n\\\\newpage\&#34;)&#60;/lisp&#62;\n&#34;</span><span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">defun</span> muse-latex-pdf-generate2 <span class="synSpecial">(</span>file output-path final-target<span class="synSpecial">)</span>
<span class="synSpecial">(</span>muse-publish-transform-output
file output-path final-target <span class="synConstant">&#34;PDF&#34;</span>
<span class="synSpecial">(</span><span class="synStatement">function</span>
<span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>file output-path<span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">let</span> <span class="synSpecial">((</span>command <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cd \&#34;%s\&#34;; platex \&#34;%s\&#34;;&#34;</span>
<span class="synSpecial">(</span>file-name-directory output-path<span class="synSpecial">)</span> file<span class="synSpecial">))</span>
<span class="synSpecial">(</span>times <span class="synConstant"></span><span class="synSpecial">)</span>
result<span class="synSpecial">)</span>
<span class="synComment">;; Convert the character code into shift-jis</span>
<span class="synSpecial">(</span>generate_shiftjis file<span class="synSpecial">)</span>
<span class="synComment">;; XEmacs can sometimes return a non-number result. We'll err</span>
<span class="synComment">;; on the side of caution by continuing to attempt to generate</span>
<span class="synComment">;; the PDF if this happens and treat the final result as</span>
<span class="synComment">;; successful.</span>
<span class="synSpecial">(</span>while <span class="synSpecial">(</span><span class="synStatement">and</span> <span class="synSpecial">(</span><span class="synStatement">&#60;</span> times <span class="synConstant">2</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">or</span> <span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">numberp</span> result<span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">eq</span> result <span class="synConstant"></span><span class="synSpecial">))</span>
<span class="synComment">;; table of contents takes 2 passes</span>
<span class="synSpecial">(</span>file-readable-p
<span class="synSpecial">(</span>muse-replace-regexp-in-string
<span class="synConstant">&#34;\\.tex\\'&#34;</span> <span class="synConstant">&#34;.toc&#34;</span> file <span class="synStatement">t</span> <span class="synStatement">t</span><span class="synSpecial">))))</span>
<span class="synSpecial">(</span><span class="synStatement">setq</span> result <span class="synSpecial">(</span>shell-command command<span class="synSpecial">)</span>
times <span class="synSpecial">(</span><span class="synStatement">1+</span> times<span class="synSpecial">)))</span>
<span class="synSpecial">(</span><span class="synStatement">if</span> <span class="synSpecial">(</span><span class="synStatement">or</span> <span class="synSpecial">(</span><span class="synStatement">not</span> <span class="synSpecial">(</span><span class="synStatement">numberp</span> result<span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">eq</span> result <span class="synConstant"></span><span class="synSpecial">))</span>
<span class="synStatement">t</span>
<span class="synStatement">nil</span><span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">let</span> <span class="synSpecial">((</span>dvi <span class="synSpecial">(</span>muse-replace-regexp-in-string
<span class="synConstant">&#34;.tex&#34;</span> <span class="synConstant">&#34;&#34;</span> file <span class="synStatement">t</span> <span class="synStatement">t</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>shell-command <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cd \&#34;%s\&#34;; dvipdfmx \&#34;%s\&#34;;&#34;</span>
<span class="synSpecial">(</span>file-name-directory output-path<span class="synSpecial">)</span> dvi<span class="synSpecial">)))</span>
<span class="synSpecial">))</span>
<span class="synConstant">&#34;.aux&#34;</span> <span class="synConstant">&#34;.toc&#34;</span> <span class="synConstant">&#34;.out&#34;</span> <span class="synConstant">&#34;.log&#34;</span> <span class="synConstant">&#34;.dvi&#34;</span><span class="synSpecial">))</span>
<span class="synComment">;; This function receives an argument and</span>
<span class="synComment">;; it converts that file into shift-jis.</span>
<span class="synSpecial">(</span><span class="synStatement">defun</span> generate_shiftjis <span class="synSpecial">(</span>file<span class="synSpecial">)</span>
<span class="synSpecial">(</span><span class="synStatement">let*</span> <span class="synSpecial">((</span>tempfile <span class="synSpecial">(</span>expand-file-name <span class="synSpecial">(</span>make-temp-file <span class="synConstant">&#34;tmp&#34;</span> <span class="synStatement">nil</span> <span class="synConstant">&#34;.tex&#34;</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>cmd1 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;cp %s %s&#34;</span> file tempfile<span class="synSpecial">))</span>
<span class="synSpecial">(</span>cmd2 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;nkf -s %s &#62; %s&#34;</span> tempfile file<span class="synSpecial">))</span>
<span class="synSpecial">(</span>cmd3 <span class="synSpecial">(</span><span class="synStatement">format</span> <span class="synConstant">&#34;rm %s&#34;</span> tempfile<span class="synSpecial">))</span>
result<span class="synSpecial">)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd1<span class="synSpecial">)</span> <span class="synComment">; (shell-command cmd1)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd2<span class="synSpecial">)</span> <span class="synComment">; (shell-command cmd2)</span>
<span class="synSpecial">(</span>call-process shell-file-name <span class="synStatement">nil</span> <span class="synStatement">nil</span> <span class="synStatement">t</span>
shell-command-switch cmd3<span class="synSpecial">)))</span> <span class="synComment">; (shell-command cmd3)</span>
<span class="synSpecial">(</span>muse-derive-style <span class="synConstant">&#34;pdf&#34;</span> <span class="synConstant">&#34;latex&#34;</span>
:final <span class="synSpecial">'</span><span class="synIdentifier">muse-latex-pdf-generate2</span>
:browser <span class="synSpecial">'</span><span class="synIdentifier">muse-latex-pdf-browse-file</span>
:link-suffix <span class="synSpecial">'</span><span class="synIdentifier">muse-latex-pdf-extension</span>
:osuffix <span class="synSpecial">'</span><span class="synIdentifier">muse-latex-pdf-extension</span><span class="synSpecial">)</span>
</pre>
</div>