◉ TeX Live のインストール
このページでは TeX Live 2011 を OS X Lion(10.7)にインストールする手順をまとめてあります。2011 年 12 月現在の情報です。
TeX Live のインストール方法は一応複数ありますが、専用の「ネット・インストーラ」を使い、必要なファイルを逐一ダウンロードしながらインストールする方法が推奨されています。ネットワーク回線や利用するミラー・サーバーの込み具合によってはとてつもなく時間がかかる場合がありますので、じっくり取り組めるときに実行してください。
心構えが出来たところで、早速、「ネット・インストーラ」をダウンロードしましょう。ターミナルを立ち上げて、次のコマンドを実行してください。
[~]> sudo mkdir -p /usr/local/texlive
[~]> sudo chmod a+wr /usr/local/texlive
[~]> curl -O http://ftp.jaist.ac.jp/pub/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
[~]> tar xvf install-tl-unx.tar.gz
まず、(デフォルトの)インストールフォルダを作成し[1 行目]、誰でも読み書きできるようにパーミッションを変更します[2 行目]。続いて、インストーラをダウンロードし[3 行目]、展開(解凍)します[4 行目]。パーミッションを変更する代わりに、次のコマンドにより、所有者を変更する方がセキュリティ上は望ましいかもしれません。
[~]> sudo chown $USER:wheel /usr/local/texlive
事前にパーミッションもしくは所有者を変更しておかないと、インストールや更新の際に管理者権限(sudo)が必要になり、大変危険です(その昔、某有名ソフトに「インストールするとハードディスクの中身がきれいさっぱり削除されてしまう」バグが入っていたことがあります)。
なお、上記の例ではインストーラの入手先として北陸先端科学技術大学院大学を選択していますが、この他、山形大学や会津大学などたくさんのミラーサイトからも入手できます。
  • http://ftp.yz.yamagata-u.ac.jp/pub/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
  • ftp://ftp.u-aizu.ac.jp/pub/tex/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
続いて、インストーラーを実行します。
[~]> cd install-tl-20111219
[~]> ./install-tl
フォルダ名の日付(20111219)は適宜読み替えてください(「cd install-tl-2」まで入力した後に、タブキーを押すと補完できます)。インストーラを起動すると、メニュー画面が現れて入力待ちの状態(Enter command:)になります。
======================> TeX Live installation procedure <=====================

=======> Note: Letters/digits in <angle brackets> indicate menu items <=======
=======>       for commands or configurable options                   <=======

 Detected platform: universal binaries for MacOSX/Darwin
 
 <B> platforms: 1 out of 19

 <S> installation scheme (scheme-full)
     84 collections out of 85, disk space required: 3039 MB

 Customizing installation scheme:
   <C> standard collections
   <L> language collections

 <D> directories:
   TEXDIR (the main TeX directory):
     /usr/local/texlive/2011
   TEXMFLOCAL (directory for site-wide local files):
     /usr/local/texlive/texmf-local
   TEXMFSYSVAR (directory for variable and automatically generated data):
     /usr/local/texlive/2011/texmf-var
   TEXMFSYSCONFIG (directory for local config):
     /usr/local/texlive/2011/texmf-config
   TEXMFVAR (personal directory for variable and automatically generated data):
     ~/.texlive2011/texmf-var
   TEXMFCONFIG (personal directory for local config):
     ~/.texlive2011/texmf-config
   TEXMFHOME (directory for user-specific files):
     ~/texmf

 <O> options:
   [ ] use letter size instead of A4 by default
   [X] allow execution of restricted list of programs via \write18
   [X] create all format files
   [X] install macro/font doc tree
   [X] install macro/font source tree

 <V> set up for portable installation

Actions:
 <I> start installation to hard disk
 <H> help
 <Q> quit

Enter command: 
(標準設定のターミナル画面には収まりきらない行数ですが、OS X Lion の新機能である「全画面表示」を利用して、一通り目を通しておきましょう。)
初期設定のままインストールを続行(i)しても大丈夫ですが、少しだけ変更してみます。変更するのは次の 2 点です。
  1. 64 ビットバイナリをインストール(デフォルトでは 32 ビットバイナリしかインストールされません。また、本校執筆時点では残念ながら 64 ビットバイナリのみのインストールは出来ません。)
  2. 各国のドキュメント(Language-specific documentation)をインストールせずに、(少しだけ)ディスクスペースを節約する
まずは、プラットフォーム選択画面を呼び出します。
Enter command: b
===============================================================================
Available platforms:

   a [ ] alpha-linux      DEC Alpha with GNU/Linux
   b [ ] amd64-freebsd    x86_64 with FreeBSD
   c [ ] amd64-kfreebsd   x86_64 with GNU/FreeBSD
   d [ ] i386-cygwin      Intel x86 with Cygwin
   e [ ] i386-freebsd     Intel x86 with FreeBSD
   f [ ] i386-kfreebsd    Intel x86 with GNU/FreeBSD
   g [ ] i386-linux       Intel x86 with GNU/Linux
   h [ ] i386-netbsd      Intel x86 with NetBSD
   i [ ] i386-solaris     Intel x86 with Solaris
   j [ ] mips-irix        SGI IRIX
   k [ ] powerpc-aix      PowerPC with AIX
   l [ ] powerpc-linux    PowerPC with GNU/Linux
   m [ ] sparc-linux      Sparc with GNU/Linux
   o [ ] sparc-solaris    Sparc with Solaris
   p [X] universal-darwin universal binaries for MacOSX/Darwin
   s [ ] win32            Windows
   t [ ] x86_64-darwin    x86_64 with MacOSX/Darwin
   u [ ] x86_64-linux     x86_64 with GNU/Linux
   v [ ] x86_64-solaris   x86_64 with Solaris

Actions: (disk space required: 3042 MB)
 <-> deselect all
 <+> select all
 <R> return to main menu
 <Q> quit

Enter letter(s) to select platforms: 
デフォルトでは「universal-darwin(p)」が選択されていますが、これを除外し(本校執筆時点ではは除外できませんが)、64 ビットバイナリ(t)を選択します。
Enter letter(s) to select platforms: -t
===============================================================================
Available platforms:

   a [ ] alpha-linux      DEC Alpha with GNU/Linux
   b [ ] amd64-freebsd    x86_64 with FreeBSD
   c [ ] amd64-kfreebsd   x86_64 with GNU/FreeBSD
   d [ ] i386-cygwin      Intel x86 with Cygwin
   e [ ] i386-freebsd     Intel x86 with FreeBSD
   f [ ] i386-kfreebsd    Intel x86 with GNU/FreeBSD
   g [ ] i386-linux       Intel x86 with GNU/Linux
   h [ ] i386-netbsd      Intel x86 with NetBSD
   i [ ] i386-solaris     Intel x86 with Solaris
   j [ ] mips-irix        SGI IRIX
   k [ ] powerpc-aix      PowerPC with AIX
   l [ ] powerpc-linux    PowerPC with GNU/Linux
   m [ ] sparc-linux      Sparc with GNU/Linux
   o [ ] sparc-solaris    Sparc with Solaris
   p [ ] universal-darwin universal binaries for MacOSX/Darwin
   s [ ] win32            Windows
   t [X] x86_64-darwin    x86_64 with MacOSX/Darwin
   u [ ] x86_64-linux     x86_64 with GNU/Linux
   v [ ] x86_64-solaris   x86_64 with Solaris

Actions: (disk space required: 2975 MB)
 <-> deselect all
 <+> select all
 <R> return to main menu
 <Q> quit

Enter letter(s) to select platforms: 
入力はトグルになっていますので、入力を間違えても慌てずに修正しましょう。ただ、残念ながら「デフォルトに戻す」アクションは用意されていないようですので、何をどう変更したのかわからなくなってしまったら、Q キーをタイプして、一旦インストーラを終了しましょう。適切に変更できたら、R キーをタイプしてメインメニューに戻ります。
Enter letter(s) to select platforms: r
======================> TeX Live installation procedure <=====================

=======> Note: Letters/digits in <angle brackets> indicate menu items <=======
=======>       for commands or configurable options                   <=======

 Detected platform: universal binaries for MacOSX/Darwin
 
 <B> platforms: 2 out of 19

 <S> installation scheme (scheme-full)
     84 collections out of 85, disk space required: 3130 MB

 Customizing installation scheme:
   <C> standard collections
   <L> language collections

 <D> directories:
   TEXDIR (the main TeX directory):
     /usr/local/texlive/2011
   TEXMFLOCAL (directory for site-wide local files):
     /usr/local/texlive/texmf-local
   TEXMFSYSVAR (directory for variable and automatically generated data):
     /usr/local/texlive/2011/texmf-var
   TEXMFSYSCONFIG (directory for local config):
     /usr/local/texlive/2011/texmf-config
   TEXMFVAR (personal directory for variable and automatically generated data):
     ~/.texlive2011/texmf-var
   TEXMFCONFIG (personal directory for local config):
     ~/.texlive2011/texmf-config
   TEXMFHOME (directory for user-specific files):
     ~/texmf

 <O> options:
   [ ] use letter size instead of A4 by default
   [X] allow execution of restricted list of programs via \write18
   [X] create all format files
   [X] install macro/font doc tree
   [X] install macro/font source tree

 <V> set up for portable installation

Actions:
 <I> start installation to hard disk
 <H> help
 <Q> quit

Enter command: 
続いて、各国語の選択画面を呼び出します。
Enter command: l
===============================================================================
Language support:

 a [X] African scripts                   s [X] Indic scripts                   
 b [X] Arabic                            t [X] Italian                         
 c [X] Armenian                          u [X] Latin                           
 d [X] Chinese, Japanese, Korean         v [X] Latvian                         
 e [X] Croatian                          w [X] Lithuanian                      
 f [X] Cyrillic                          x [X] Mongolian                       
 g [X] Czech/Slovak                      y [X] Norwegian                       
 h [X] Danish                            z [X] Other hyphenation patterns      
 i [X] Dutch                             0 [X] Polish                          
 j [X] US and UK English                 1 [X] Portuguese                      
 k [X] Finnish                           2 [X] Spanish                         
 l [X] French                            3 [X] Swedish                         
 m [X] German                            4 [X] Tibetan                         
 n [X] Greek                             5 [X] Turkmen                         
 o [X] Hebrew                            6 [X] Vietnamese                      
 p [X] Hungarian                        

Language-specific documentation:

 A [X] Arabic documentation              M [X] Mongolian documentation         
 B [X] Bulgarian documentation           N [X] Polish documentation            
 C [X] Chinese documentation             O [X] Portuguese documentation        
 D [X] Czech/Slovak documentation        P [X] Russian documentation           
 E [X] Dutch documentation               S [X] Serbian documentation           
 F [X] English documentation             T [X] Slovenian documentation         
 G [X] Finnish documentation             U [X] Spanish documentation           
 H [X] French documentation              V [X] Thai documentation              
 I [X] German documentation              W [X] Turkish documentation           
 J [X] Italian documentation             X [X] Ukrainian documentation         
 K [X] Japanese documentation            Y [X] Vietnamese documentation        
 L [X] Korean documentation             

Actions: (disk space required: 3130 MB)
 <+> select all
 <-> deselect all
 <R> return to main menu
 <Q> quit

Enter letter(s) to select language(s): 
上記のうち、「Language-specific documentation」をインストールしないようにします。200 MB ほどディスクを節約できるようです(「Japanese documentation」くらいはインストールしておいてもよいのかもしれません)。
Enter letter(s) to select language(s): ABCDEFGHIJKLMNOPSTUVWXY
===============================================================================
Language support:

 a [X] African scripts                   s [X] Indic scripts                   
 b [X] Arabic                            t [X] Italian                         
 c [X] Armenian                          u [X] Latin                           
 d [X] Chinese, Japanese, Korean         v [X] Latvian                         
 e [X] Croatian                          w [X] Lithuanian                      
 f [X] Cyrillic                          x [X] Mongolian                       
 g [X] Czech/Slovak                      y [X] Norwegian                       
 h [X] Danish                            z [X] Other hyphenation patterns      
 i [X] Dutch                             0 [X] Polish                          
 j [X] US and UK English                 1 [X] Portuguese                      
 k [X] Finnish                           2 [X] Spanish                         
 l [X] French                            3 [X] Swedish                         
 m [X] German                            4 [X] Tibetan                         
 n [X] Greek                             5 [X] Turkmen                         
 o [X] Hebrew                            6 [X] Vietnamese                      
 p [X] Hungarian                        

Language-specific documentation:

 A [ ] Arabic documentation              M [ ] Mongolian documentation         
 B [ ] Bulgarian documentation           N [ ] Polish documentation            
 C [ ] Chinese documentation             O [ ] Portuguese documentation        
 D [ ] Czech/Slovak documentation        P [ ] Russian documentation           
 E [ ] Dutch documentation               S [ ] Serbian documentation           
 F [ ] English documentation             T [ ] Slovenian documentation         
 G [ ] Finnish documentation             U [ ] Spanish documentation           
 H [ ] French documentation              V [ ] Thai documentation              
 I [ ] German documentation              W [ ] Turkish documentation           
 J [ ] Italian documentation             X [ ] Ukrainian documentation         
 K [ ] Japanese documentation            Y [ ] Vietnamese documentation        
 L [ ] Korean documentation             

Actions: (disk space required: 2914 MB)
 <+> select all
 <-> deselect all
 <R> return to main menu
 <Q> quit

Enter letter(s) to select language(s): 
メインメニューに戻って、インストール作業を続行します。
Enter letter(s) to select language(s): r
Enter command: i
後はただひたすらインストールが完了するのを待つだけです。
◉ 環境変数の設定
ターミナルから TeX を利用するために、環境変数 PATH に「/usr/local/texlive/2011/bin/x86_64-darwin」を追加しておきましょう。設定は通常次にいずれかのファイルに書き込みます。
  • ~/.bash_profile
  • ~/.bash_login
  • ~/.profile
いずれの場合も同様ですので、ここでは「~/.bash_profile」に書き込む方法を例示しておきます。
[~]> touch ~/.bash_profile
[~]> open -e ~/.bash_profile
テキストエディットが起動しますので、次の点線内の一行をファイルの末尾に追記すれば完了です。新規にターミナルを起動すれば platex 等のコマンドが使えるようになっているはずです。
export PATH=/usr/local/texlive/2011/bin/x86_64-darwin:$PATH
◉ ヒラギノフォントを使うための設定
ヒラギノフォントを利用するためには、TeX が探せる場所にフォントのシンボリック・リンクをはることと、フォント・マップファイルの設定を変更する作業が必要です。
まず、シンボリック・リンクをはります。合計 14 個の命令を実行しなければなりません。
[~]> mkdir -p /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino/
[~]> cd /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino/
[~]> ln -s "/Library/Fonts/ヒラギノ明朝 Pro W3.otf" HiraMinPro-W3.otf
[~]> ln -s "/Library/Fonts/ヒラギノ明朝 Pro W6.otf" HiraMinPro-W6.otf
[~]> ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" HiraKakuPro-W3.otf
[~]> ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" HiraKakuPro-W6.otf
[~]> ln -s "/Library/Fonts/ヒラギノ角ゴ Std W8.otf" HiraKakuStd-W8.otf
[~]> ln -s "/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" HiraMaruPro-W4.otf
[~]> ln -s "/System/Library/Fonts/ヒラギノ明朝 ProN W3.otf" HiraMinProN-W3.otf
[~]> ln -s "/System/Library/Fonts/ヒラギノ明朝 ProN W6.otf" HiraMinProN-W6.otf
[~]> ln -s "/System/Library/Fonts/ヒラギノ角ゴ ProN W3.otf" HiraKakuProN-W3.otf
[~]> ln -s "/System/Library/Fonts/ヒラギノ角ゴ ProN W6.otf" HiraKakuProN-W6.otf
[~]> ln -s "/Library/Fonts/ヒラギノ角ゴ StdN W8.otf" HiraKakuStdN-W8.otf
[~]> ln -s "/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf" HiraMaruProN-W4.otf
面倒なので、代わりに(同じことですが)以下の点線枠内の文字列コピーして、ターミナルに貼付ける方法をお勧めします。
mkdir -p /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino/
cd /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino/
ln -s "/Library/Fonts/ヒラギノ明朝 Pro W3.otf" HiraMinPro-W3.otf
ln -s "/Library/Fonts/ヒラギノ明朝 Pro W6.otf" HiraMinPro-W6.otf
ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" HiraKakuPro-W3.otf
ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" HiraKakuPro-W6.otf
ln -s "/Library/Fonts/ヒラギノ角ゴ Std W8.otf" HiraKakuStd-W8.otf
ln -s "/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" HiraMaruPro-W4.otf
ln -s "/System/Library/Fonts/ヒラギノ明朝 ProN W3.otf" HiraMinProN-W3.otf
ln -s "/System/Library/Fonts/ヒラギノ明朝 ProN W6.otf" HiraMinProN-W6.otf
ln -s "/System/Library/Fonts/ヒラギノ角ゴ ProN W3.otf" HiraKakuProN-W3.otf
ln -s "/System/Library/Fonts/ヒラギノ角ゴ ProN W6.otf" HiraKakuProN-W6.otf
ln -s "/Library/Fonts/ヒラギノ角ゴ StdN W8.otf" HiraKakuStdN-W8.otf
ln -s "/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf" HiraMaruProN-W4.otf
最後の一行(「ヒラギノ丸ゴ ProN W4.otf」へのリンク)だけ、手動で「enter/return」キーを押さなければならないかもしれません。
最後にフォント・マップファイルを更新(書き換え)して完了です。
updmap-sys --setoption kanjiEmbed hiragino