最近のLaTeXのdistributionの中では、LiveTeXが一番よく使われているらしい。そのMac版のツールその他を一括でダウンロードできるMacTeXをインストールする。このバージョンではpTeXも一緒に入っているので、日本語も扱えるはずである。
しかし、TeXShop側でインストール場所等の設定が多かったのでここでメモしておく。
/usr/local/texlive/2011/bin/universal-darwin
を入れる。
simpdftex platex –mode dvipdfmx –maxpfb –extratexopts “-file-line-error”
を入れる。
これで日本語は通るが、図がなぜか表示されない。以下の操作を実行する。(http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?PDFの作り方#rdc781c9)より。
科研費LaTeXでは、図にepsファイルを作る必要があるが、これはかなり面倒くさい。まず、以下のようなコードを書いてAppleScript editorでアプリにする。
set tgt_file to "ssw" & (getTimeStamp() as string) & ".jpg"
set eps_file to "ssw" & (getTimeStamp() as string) & ".eps"
-- 出力するファイル名を「sswyyyymmddhhmmss.jpg」に。
do shell script "screencapture -i ~/Desktop/" & tgt_file
do shell script "/opt/local/bin/convert ~/Desktop/" & tgt_file & " ~/Desktop/" & eps_file
do shell script "rm ~/Desktop/" & tgt_file
-- ウィンドウを選択してチャプチャーし、上記のファイル名で出力。
on getTimeStamp()
set localdate to (current date)
set y to year of localdate as number
set m to month of localdate as number
set d to day of localdate as number
set h to hours of localdate as number
set mi to minutes of localdate as number
set ss to seconds of localdate as number
set msg to y & m & d & h & mi & ss
end getTimeStamp
-- Snow Leopard, Mac OS X 10.6