0.追記 (201808)
TexLive 2018
インストール手順は変わらない。
platexもデフォルトでインストールされてそのまま使えることを確認しました。わざわざあとで追加インストールして、バク対策を取る手間がなくなりました。便利になりましたね。
TexLive 2016
手順は2015と同じ。
tlptexliveは使えなくなったようでpxdviのインストールにtltexjpを使います
sudo tlmgr repository add http://texlive.texjp.org/2016/tltexjp tltexjp sudo tlmgr pinning add tltexjp '*' sudo tlmgr install ptex pxdvi
1. ダウンロード
まずインストールするためのイメージファイルをダウンロードします。サイズは2.7GB位です。
下のどちらのリンクからもダウンロードできます。
Tex Live ISO image (Auto-detect nearby mirror)
TeX Live ISO Images – ftp.kddilabs.jp
2. インストール
ダウンロードしたISOイメージファイルをマウントします。GUIを使っているなら右クリックメニューからマウントできます。CUIからはroot権限で
mkdir /mnt/TexLive2015 mount -t iso9660 -o ro,loop,noauto /path/to/texlive2015.iso /mnt/TexLive2015 cd /mnt/TexLive2015
マウント作業が終わったら、root権限でインストーラーを実行します。
./install-tl
もし以下のエラーが出たら
Can't locate Digest/MD5.pm in @INC (...) at tlpkg/TeXLive/TLUtils.pm line 204. BEGIN failed--compilation aborted at tlpkg/TeXLive/TLUtils.pm line 204. Compilation failed in require at ./install-tl line 53. BEGIN failed--compilation aborted at ./install-tl line 53.
perl-Digest-MD5をインストールすれば問題を解消できるはず。
yum install perl-Digest-MD5
問題なくインストーラーが実行されたとき、下の画面が出ます。
Loading ./tlpkg/texlive.tlpdb Installing TeX Live 2015 from: . Platform: x86_64-linux => 'GNU/Linux on x86_64' Distribution: inst (compressed) Directory for temporary files: /tmp ======================> TeX Live installation procedure <===================== ======> Letters/digits in <angle brackets> indicate <======= ======> menu items for commands or options <======= Detected platform: GNU/Linux on x86_64 <B> binary platforms: 1 out of 14 <S> set installation scheme (scheme-full) <C> customizing installation collections 47 collections out of 48, disk space required: 4044 MB <D> directories: TEXDIR (the main TeX directory): /usr/local/texlive/2015 TEXMFLOCAL (directory for site-wide local files): /usr/local/texlive/texmf-local TEXMFSYSVAR (directory for variable and automatically generated data): /usr/local/texlive/2015/texmf-var TEXMFSYSCONFIG (directory for local config): /usr/local/texlive/2015/texmf-config TEXMFVAR (personal directory for variable and automatically generated data): ~/.texlive2015/texmf-var TEXMFCONFIG (personal directory for local config): ~/.texlive2015/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 [ ] create symlinks to standard directories [X] after install, use tlnet on CTAN for package updates <V> set up for portable installation Actions: <I> start installation to hard disk <H> help <Q> quit Enter command:
変更したいオプションの前にあるアルファベットを入力します。デフォルトでは/usr/localにインストールします。インストール先を/optに変えたいので、directoriesの設定に入り、TEXDIR (the main TeX directory)の/usr/local/texlive/2015を/opt/texlive/2015に書き換えました。
Enter command: D =============================================================================== Directories setup: <1> TEXDIR: /usr/local/texlive/2015 support tree: /usr/local/texlive/2015/texmf-dist <2> TEXMFLOCAL: /usr/local/texlive/texmf-local <3> TEXMFSYSVAR: /usr/local/texlive/2015/texmf-var <4> TEXMFSYSCONFIG: /usr/local/texlive/2015/texmf-config <5> TEXMFVAR: ~/.texlive2015/texmf-var <6> TEXMFCONFIG: ~/.texlive2015/texmf-config <7> TEXMFHOME: ~/texmf Note: ~ will expand to $HOME (or to %USERPROFILE% on Windows) Actions: <R> return to main menu <Q> quit Enter command: 1 New value for TEXDIR [/usr/local/texlive/2015]: /opt/texlive/2015 =============================================================================== Directories setup: <1> TEXDIR: /opt/texlive/2015 support tree: /opt/texlive/2015/texmf-dist <2> TEXMFLOCAL: /opt/texlive/texmf-local <3> TEXMFSYSVAR: /opt/texlive/2015/texmf-var <4> TEXMFSYSCONFIG: /opt/texlive/2015/texmf-config <5> TEXMFVAR: ~/.texlive2015/texmf-var <6> TEXMFCONFIG: ~/.texlive2015/texmf-config <7> TEXMFHOME: ~/texmf Note: ~ will expand to $HOME (or to %USERPROFILE% on Windows) Actions: <R> return to main menu <Q> quit Enter command: R
Rを入力して、メインメニューに戻る。
Iを入力して、インストールを始めます。Core i5、HDDのノートパソコンでのインストールは15分位かかりました。
インストールが完了したあと、PATHを通します。/etc/profile.d/に設定ファイルopt-path.shを追加します。
# texlive export PATH=$PATH:/opt/texlive/2015/bin/x86_64-linux export INFOPATH=$INFOPATH:/opt/texlive/2015/texmf-dist/doc/info export MANPATH=$MANPATH:/opt/texlive/2015/texmf-dist/doc/man
なお/etc/profile.d/ にある設定ファイルを読み込ませるにはターミナルを再起動するか,再サインインするか、sourceコマンド使うかどちらもできます.
tlmgrでアップデートを行います(時間かかります。アップデートする必要なければやらなくても良い)
# tlmgr update --self # tlmgr update --all
texコマンドを打って、以下のようなものが出れば無事インストールできたことになります。
$ tex --version TeX 3.14159265 (TeX Live 2015) kpathsea version 6.2.1 Copyright 2015 D.E. Knuth. There is NO warranty. Redistribution of this software is covered by the terms of both the TeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the TeX source. Primary author of TeX: D.E. Knuth.
3.platexのインストール
日本語を使えるようにするため、pxdviをインストールします。root権限で
# tlmgr repository add http://www.tug.org/~preining/tlptexlive/ tlptexlive # tlmgr pinning add tlptexlive '*' # tlmgr install ptex pxdvi
を実行します
インストールしただけではplatexは使えないはず。texファイルをコンパイルしようとしてもエラーが出てコンパイルできない
エラー対策に以下の作業が必要です
# cd /opt/texlive/2015/texmf-dist/web2c/ [web2c]# cp texmf.cnf ../../texmf.cnf [xdvi]# cd /opt/texlive/2015/texmf-dist/xdvi/ [xdvi]# cp XDvi XDvi.org [xdvi]# sed 's/\(^\*font:\)\(.*\)helvetica\(.*\)/\1\2\*\3-\*/' -i XDvi [xdvi]# sed 's/\(^\*statusline\.font:\)\(.*\)helvetica\(.*\)/\1\2\*\3-\*/' -i XDvi
これでplatexが使えるようになるはず。確認に簡単なtexファイルでテストします。
[kyang@l01 latex]$ platex test01.tex This is e-pTeX, Version 3.14159265-p3.6-141210-2.6 (utf8.euc) (TeX Live 2015) (preloaded format=platex) restricted \write18 enabled. entering extended mode (./test01.tex pLaTeX2e <2006/11/10> (based on LaTeX2e <2016/03/31> patch level 0) Babel <3.9q> and hyphenation patterns for 81 language(s) loaded. (/opt/texlive/2015/texmf-dist/tex/platex/base/jarticle.cls Document Class: jarticle 2006/06/27 v1.6 Standard pLaTeX class (/opt/texlive/2015/texmf-dist/tex/platex/base/jsize10.clo)) (./test01.aux) (/opt/texlive/2015/texmf-dist/tex/latex/base/omscmr.fd) [1] (./test01.aux) ) Output written on test01.dvi (1 page, 1276 bytes). Transcript written on test01.log. [kyang@l01 latex]$ dvipdfmx test01.dvi test01.dvi -> test01.pdf [1] 6727 bytes written [kyang@l01 latex]$
問題なくpdfファイルを生成できました。