Logo address

TeX for OSX

2003/07
このページは単なる僕のメモです

目標

UNICODE を使える TeX
  1. Omega
  2. CJK/UTF8

Documents for TeX

どの TeX パッケージを使うか

他のパッケージもあるが省略

筆者のハートディスクには様々な TeX のパッケージが含まれている。例えば、

teTeX-1.0

teTeX-2.0
TeX Live 7

パッケージによるファイル構成の違い

teTeX-1.0
teTeX/README.texmf.macosx には
1. /usr/local/teTeX/share/texmf is the default teTeX texmf tree, this is
maintained by the TeX community.

2. /usr/local/teTeX/share/texmf.macosx is the Mac OS X tree, this is
maintained and distributed by me. TeX finds this tree as
/usr/local/teTeX/share/texmf.os which is a symbolic link.

3. /usr/local/teTeX/share/texmf.local is the local texmf tree, this is
maintained by the local TeX administrator. It is also the VARTEXMF tree that
is handled in a special way by texconfig, e.g. formats and changes are stored
here.
と書かれている。

TeX で使用されるファイル

texmf.cnf

texmf.cnf は TeX の実行プログラムがどのファイルを使用するかを決めている
それでは、実行プログラムはどのように texmf.cnf を探すか?
環境変数 TEXMF を設定してもよいが...
texmf
ls-R
texmf.cnf

UNIX は実行プログラムが起動された時に、それが置かれているディレクトリを知る仕組みを持っている。Omega が起動された時に参照される texmf.cnf は実行プログラムが置かれているディレクトリからの相対パスで与えられる。teTeX-1.0 の場合には筆者はいつのまにか複数の texmf.cnf を持っていた。

/.../bin/.../latex
/.../texmf.cnf
/.../share/texmf/web2c/texmf.cnf
/.../texmf/web2c/texmf.cnf
ここに最初の /.../ は共通である。(例えば /usr/local/teTeX/ を表している。)
この場合にはどれが使用されるか? 実際には /.../texmf.cnf が使われた。このことは
bash$ kpsewhich texmf.cnf
/usr/local/teTeX/texmf.cnf
bash$
で分かる。(環境変数は /usr/local/teTeX/bin/powerpc-apple-darwin5.4:/bin:... としている。)
探索のルールは?
kpsewhich は探索ルールを表示するオプションを持つ。
bash$ kpsewhich --show-path texmf.cnf
/usr/local/teTeX/bin/powerpc-apple-darwin5.4:/usr/local/teTeX/bin:...
...
bash$

texmf.cnf は TeX の実行に置いて基本的である。確実に texmf.cnf を認識させるには置き場所を

/.../texmf.cnf
にするのがよい。

texmf.cnf に関する詳しい解説が

にある。

環境変数 PATH

筆者の場合、環境変数 PATH は
bash$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/Users/arisawa/bin:/usr/local/bin:/usr/X11R6/bin
なので、シェルから TeX 関係のコマンドを打ち込んだ場合には /usr/local/bin のプログラム、すなわち teTeX-2.0 が使用される事になる。
この事は (シェルとして bash を使った場合)
bash$ which tex
/usr/local/bin/tex
bash$
でも確認できる。

kpsewhich

kpsewhich は TeX が使用しているツールで、利用するファイルを決定する。これは診断にも利用できる。
/usr/local/bin/kpsewhich が起動された場合には
bash$ kpsewhich texmf.cnf
/usr/local/share/texmf/web2c/texmf.cnf
bash$ kpsewhich ls-R
/usr/local/share/texmf/ls-R

/usr/local/teTeX/bin/powerpc-apple-darwin5.4/kpsewhich が起動された場合には

bash$ kpsewhich texmf.cnf
/usr/local/teTeX/texmf.cnf
bash$ kpsewhich ls-R
/usr/local/teTeX/share/texmf.local/ls-R
/usr/TeX/bin/powerpc-darwin5.3/kpsewhich が起動された場合には
bash$ kpsewhich texmf.cnf
/usr/TeX/texmf/web2c/texmf.cnf
bash$ kpsewhich ls-R
/usr/TeX/texmf-var/ls-R
どの kpsewhich が使用されるかは(シェルとして bash を使った場合)
bash$ which kpsewhich
/usr/local/bin/kpsewhich
bash$
で確認できる。

kpathsea と ls-R

kpathsea は TeX で使用されるツールで、TeX 関係のファイル(主にフォントファイル)を効率良く探すために使用されている。
kpathseals-R を基にファイルを探す。ls-R の置き場所は kpsewhich で知る事ができる。ls-R
bash$ mktexlsr
mktexlsr: Updating /usr/local/share/texmf/ls-R...
mktexlsr: Updating /var/tmp/texfonts/ls-R...
mktexlsr: Done.
bash$
で作成される。作成されるファイルは内容的には ls-R が置かれる場所で
bash$ ls -R > ls-R
bash$
を行うのと同じである。但し mktexlsr はどこで実行してもよいし、また適切なパーミッションを設定してくれる。
ls-R の置かれているディレクトリ以下のファイルの構成を変更した場合には ls-R を更新する必要がある。
http://www.tug.org/kpathsea/

フォントファイル

参考