2010年10月28日木曜日

【Eclipse】【TeX】EclipseにTeX環境設定

インストール


まずは,Eclipseを導入.
Eclipseのサイトから,Java版でもなんでもいいからダウンロードし,インストールする.


Help > Install New Software に行き,以下のサイトを導入する.


サイト名:TeXlipse Update Site
ロケーション:http://texlipse.sourceforge.net


導入後,TeXlipseというパッケージが表示されるのでインストール.


以上




設定


以下,Macの設定.MacPortsにて,ptexのパッケージをインストールしてあるものとする.
Eclipse > 環境設定 に入り,以下を設定していく.


General > Contents Type
右側の Contents Types: 以下の Text  > LaTeX File を選択し,下部に表示される Default encoding: に utf-8 と入力し,update をクリックする.
utf-8を使わない場合は,sjis, euc-jpなり設定し,以下のutf-8の部分もそれらに置換して設定する.


Texlipse > Builder Settings
右側の Latex program を選択し,Editをクリック.表示されるダイアログに
Program file:  /opt/local/bin/platex-utf8
Arguments:  %input
と入力し,OKをクリック.
同様に Bibtex program を選択し,Editをクリック.

Program file:  /opt/local/bin/jbibtex
Arguments:  --kanji=utf-8 %input
Dvipdf progmraを選択し,Edit.
Program file:  /opt/local/bin/dvipdfmx
Arguments:  %input
と設定する.

Texlipse > Viewer Setting
右側の itexmac を選択し,editをクリック.表示されるダイアログに


Viewer name:  itexmac
Viewer command:  /usr/bin/open
Viewer arguments:  %file
Viewer input file format:  pdf
と設定する.




使用方法


Project Explorer 内に新しいプロジェクトを開き,Texlipseプロジェクトを作成する.
この際,表示されるダイアログにプロジェクト名を入力し,
Output Format:  pdf
Build commands:  latex+dvipdf
とする.


表示されるtexファイルを作成していき,セーブすると自動的にビルドする.エラーが無い状態で command+4 または latex > Preview Document を行うと,プレビューにより表示される.




細かくは続報していく予定.