3091
Comment:
|
9110
|
Deletions are marked like this. | Additions are marked like this. |
Line 14: | Line 14: |
= CentOS 8 に Tex Live 2021 をインストール = 1. [[https://web.archive.org/web/20181005082653/http://be.nucl.ap.titech.ac.jp/~koba/cgi-bin/moin.cgi/TeX%20Live%202013%20on%20Scientific%20Linux%206.4|このアーカイブ]]を参考にCentOS 8 にTex Live 2021 をインストールする。 2. まず ISO イメージを保存するディレクトリ (どこでも良い) に移動し、wget コマンドで TeX Live 2021 の ISO イメージを近くのミラーサーバからダウンロードする。 |
= Tex Live 2021 on CentOS 8 = [[https://web.archive.org/web/20181005082653/http://be.nucl.ap.titech.ac.jp/~koba/cgi-bin/moin.cgi/TeX%20Live%202013%20on%20Scientific%20Linux%206.4|このアーカイブ]]を参考にCentOS 8 にTex Live 2021 (日本語対応)をインストールする。CentOS 7 / Scientific Linux (SL) 7でも同様。 == 使用可能なコマンド == 以下のコマンドが使える。 ||<-5> '''日本語と英語に対応しているコマンド'''|| ||コマンド ||動作 ||使い方 ||入力ファイル||出力ファイル|| ||platex ||TeX ファイルのコンパイル ||$ platex test.tex ||test.tex || test.dvi || ||dvipdfmx||DVI から PDF ファイルを直接作成 || $ dvipdfmx test.dvi ||test.dvi || test.pdf || ##||dvipdf ||DVI から PDF ファイルを直接作成 || $ dvipdf test.dvi ||test.dvi || test.pdf || ||dvips ||DVI から PS ファイルを作成 || $ pdvips test.dvi ||test.dvi ||test.ps || ||ps2pdf ||PS から PDF ファイルを作成 || $ ps2pdf test.ps || test.ps ||test.pdf || ||pdf2ps ||PDF から PS ファイルを作成 || $ pdf2ps test.pdf || test.pdf ||test.ps || ||pxdvi ||DVI ファイルビューワ || $ pxdvi test.dvi || test.dvi ||-|| ||evince ||PS/PDF ファイルビューワ || $ evince test.ps <<BR>> $ evince test.pdf || test.ps<<BR>>test.pdf ||- || ||gv ||PS/PDF ファイルビューワ || $ gv test.ps <<BR>> gv test.pdf || test.ps <<BR>>test.pdf || - || ## ||acroread || Adobe Reader <<BR>> (PS/PDF インタプリタ) || $ acroread test.pdf || test.pdf||-|| ||gs ||Ghostscript インタプリタ<<BR>>(PS/PDF インタプリタ) || $ gs test.ps <<BR>>$ gs test.pdf || test.ps<<BR>>test.pdf ||misc. || <<BR>> ||<-5> '''英語のみに対応しているコマンド'''|| ||コマンド ||動作 ||使い方 ||入力ファイル||出力ファイル|| ||latex ||TeX ファイルのコンパイル ||$ latex test.tex ||test.tex || test.dvi || ||xdvi ||DVI ファイルビューワ || $ xdvi test.dvi || test.dvi ||-|| ここで、test.ps は !PostScript (PS) ファイル、test.pdf は PDF (Portable Document Format) ファイル、 test.dvi は DVI(!DeVice-Independent file format) ファイルを表す。 == TeX Live 2021 のインストール == 1. まず ISO イメージを保存するディレクトリ (どこでも良い) に移動し、wget コマンドで TeX Live 2021 の ISO イメージを近くのミラーサーバからダウンロードする。 |
Line 25: | Line 58: |
3. 同じディレクトリに、ISO イメージをマウントするディレクトリを作る。 | 2. 同じディレクトリに、ISO イメージをマウントするディレクトリを作る。 |
Line 32: | Line 65: |
4. ISO イメージのマウントとインストーラの実行には管理者権限が必要なので、su コマンドで root ユーザになる。 5. ISO イメージとマウントディレクトリがあるかを確認したら、ISO イメージをマウント。 |
3. ISO イメージのマウントとインストーラの実行には管理者権限が必要なので、su コマンドで root ユーザになる。 4. ISO イメージとマウントディレクトリがあるかを確認したら、ISO イメージをマウント。 |
Line 43: | Line 76: |
6.マウントディレクトリ内の install-tl を実行。Enter command: に対して I を入力するとインストールがスタートする。速いPCだと 10分くらいでインストールできる。 | 5.マウントディレクトリ内の install-tl を実行。Enter command: に対して I を入力するとインストールがスタートする。速いPCだと 10分くらいでインストールできる。 |
Line 50: | Line 83: |
7.インストール終了後、インストーラが出力したメッセージの最後を見ると、以下のように表示されている。このメッセージに従い PATH の設定をする。 | 6.インストール終了後、インストーラが出力したメッセージの最後を見ると、以下のように表示されている。このメッセージに従い PATH の設定をする。 |
Line 58: | Line 91: |
8.最後に platex がインストールされているか確認。試しに platex のバージョンを確認してみる。 | 7. platex がインストールされているか確認。試しに platex のバージョンを確認してみる。 |
Line 67: | Line 100: |
9.一応アップデートを実行しておく。少し時間がかかる。 | 8.アップデートを実行しておく。少し時間がかかる。 |
Line 73: | Line 106: |
10. pxdvi のインストール 11. gv のインんストール |
9. pxdvi のインストール [[https://www.sym.me/archives/310|ここ]]を参考に pxdviをインストールする。 (2021.5.24時点で current(2021)版のpxdvi はまだないので2020 版をインストール) {{{ # wget https://texlive.texjp.org/tltexjp-key.asc # tlmgr key add tltexjp-key.asc # tlmgr repository add http://texlive.texjp.org/2020/tltexjp tltexjp # tlmgr pinning add tltexjp '*' # tlmgr install pxdvi # tlmgr path add # cd /usr/local/texlive/2021 # ln -s texmf-dist texmf }}} 10. gv のインストール {{{ # dnf -y install epel-release # dnf -y install gv }}} ## 12. [[https://moji.or.jp/ipafont/|IPAexフォントおよびIPAフォント]]をインストール。 ## {{{ ## # mkdir /usr/share/fonts/japanese ## # mkdir /usr/share/fonts/japanese/TrueType ## ## # wget https://moji.or.jp/wp-content/ipafont/IPAfont/IPAfont00303.zip ## # wget https://moji.or.jp/wp-content/ipafont/IPAexfont/IPAexfont00401.zip ## # unzip IPAfont00303.zip ## # unzip IPAexfont00401.zip ## ## # mv IPAfont00303/*.ttf /usr/share/fonts/japanese/TrueType/ ## # mv IPAexfont00401/*.ttf /usr/share/fonts/japanese/TrueType/ ## # chmod 644 /usr/share/fonts/japanese/TrueType/* ## # fc-cache -fv ##}}} 11. Ghostscript の最新版への更新と日本語対応 Tex Live 2020 から、dvipdfmx / dvips での日本語フォント埋込の既定値が「IPAex フォント」から[[https://github.com/trueroad/HaranoAjiFonts|「原ノ味フォント」]]に変更された。 Ghostscriptもこのため最新版に更新し、cjk-gs-integrate スクリプトを実行する必要がある。 まず [[https://www.ghostscript.com/|Ghostscript(gs)]] を最新版 (9.54.0 以降) にupdate する。 [[https://www.ghostscript.com/download/gsdnld.html|https://www.ghostscript.com/download/gsdnld.html]] から、最新版のGhostscript の Source for all platforms を Download、展開し、configure, make, make install する。(Default の /usr/local/bin/ にインストールする) {{{ # wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9540/ghostscript-9.54.0.tar.gz # tar xf ghostscript-9.54.0.tar.gz # cd ghostscript-9.54.0 # ./configure : # make : # make install : }}} これで最新版の gs が /usr/local/bin にインストールされた。念のため aliase も定義しておく {{{ # ln -s /usr/local/bin/gs /usr/local/bin/ghostscript }}} 確認のため {{{ $ gs -help }}} を実行すると {{{ GPL Ghostscript 9.54.0 (2021-03-30) Copyright (C) 2021 Artifex Software, Inc. All rights reserved. Search path: %rom%Resource/Init/ : %rom%lib/ : /usr/local/share/ghostscript/9.54.0/Resource/Init : /usr/local/share/ghostscript/9.54.0/lib : /usr/local/share/ghostscript/9.54.0/Resource/Font : /usr/local/share/ghostscript/fonts : /usr/local/share/fonts/default/ghostscript : /usr/local/share/fonts/default/Type1 : /usr/local/share/fonts/default/TrueType : /usr/lib/DPS/outline/base : }}} とかと出力される。 次に以下を実行する {{{ # cjk-gs-integrate --link-texmf --cleanup --force cjk-gs-integrate: reading font database ... cjk-gs-integrate: searching for Ghostscript resource cjk-gs-integrate: going to clean up /usr/local/share/ghostscript/9.54.0/Resource cjk-gs-integrate: cleaning up all links, snippets and cidfmap.local ... cjk-gs-integrate: removing cidfmap.local from cidfmap file ... cjk-gs-integrate: removing snippets and cidfmap.aliases for font aliases ... cjk-gs-integrate: removing cidfmap.aliases from cidfmap file ... cjk-gs-integrate: running mktexlsr ... mktexlsr: Updating /usr/local/texlive/2021/texmf-config/ls-R... mktexlsr: Updating /usr/local/texlive/2021/texmf-dist/ls-R... mktexlsr: Updating /usr/local/texlive/2021/texmf-var/ls-R... mktexlsr: Updating /usr/local/texlive/texmf-local/ls-R... mktexlsr: Done. cjk-gs-integrate: finished # }}} これで Ghostscript(gs) が、Tex Live 2021 で日本語に対応するようになった。 |
Tex Live 2021 on CentOS 8
このアーカイブを参考にCentOS 8 にTex Live 2021 (日本語対応)をインストールする。CentOS 7 / Scientific Linux (SL) 7でも同様。
使用可能なコマンド
以下のコマンドが使える。
日本語と英語に対応しているコマンド |
||||
コマンド |
動作 |
使い方 |
入力ファイル |
出力ファイル |
platex |
TeX ファイルのコンパイル |
$ platex test.tex |
test.tex |
test.dvi |
dvipdfmx |
DVI から PDF ファイルを直接作成 |
$ dvipdfmx test.dvi |
test.dvi |
test.pdf |
dvips |
DVI から PS ファイルを作成 |
$ pdvips test.dvi |
test.dvi |
test.ps |
ps2pdf |
PS から PDF ファイルを作成 |
$ ps2pdf test.ps |
test.ps |
test.pdf |
pdf2ps |
PDF から PS ファイルを作成 |
$ pdf2ps test.pdf |
test.pdf |
test.ps |
pxdvi |
DVI ファイルビューワ |
$ pxdvi test.dvi |
test.dvi |
- |
evince |
PS/PDF ファイルビューワ |
$ evince test.ps |
test.ps |
- |
gv |
PS/PDF ファイルビューワ |
$ gv test.ps |
test.ps |
- |
gs |
Ghostscript インタプリタ |
$ gs test.ps |
test.ps |
misc. |
英語のみに対応しているコマンド |
||||
コマンド |
動作 |
使い方 |
入力ファイル |
出力ファイル |
latex |
TeX ファイルのコンパイル |
$ latex test.tex |
test.tex |
test.dvi |
xdvi |
DVI ファイルビューワ |
$ xdvi test.dvi |
test.dvi |
- |
ここで、test.ps は PostScript (PS) ファイル、test.pdf は PDF (Portable Document Format) ファイル、 test.dvi は DVI(DeVice-Independent file format) ファイルを表す。
TeX Live 2021 のインストール
1. まず ISO イメージを保存するディレクトリ (どこでも良い) に移動し、wget コマンドで TeX Live 2021 の ISO イメージを近くのミラーサーバからダウンロードする。
$ cd "ISO イメージを保存するディレクトリ" $ wget http://ftp.riken.jp/tex-archive/systems/texlive/Images/texlive2021-20210325.iso
2. 同じディレクトリに、ISO イメージをマウントするディレクトリを作る。
$ mkdir tex2021
3. ISO イメージのマウントとインストーラの実行には管理者権限が必要なので、su コマンドで root ユーザになる。
4. ISO イメージとマウントディレクトリがあるかを確認したら、ISO イメージをマウント。
# ls texlive2021 texlive2021-20210325.iso # # mount -o loop -t iso9660 texlive2021-20210325.iso texlive2021
5.マウントディレクトリ内の install-tl を実行。Enter command: に対して I を入力するとインストールがスタートする。速いPCだと 10分くらいでインストールできる。
# ./texlive2021/install-tl ... Enter command: I ...
6.インストール終了後、インストーラが出力したメッセージの最後を見ると、以下のように表示されている。このメッセージに従い PATH の設定をする。
Add /usr/local/texlive/2021/texmf-dist/doc/man to MANPATH. Add /usr/local/texlive/2021/texmf-dist/doc/info to INFOPATH. Most importantly, add /usr/local/texlive/2021/bin/x86_64-linux to your PATH for current and future sessions.
7. platex がインストールされているか確認。試しに platex のバージョンを確認してみる。
$ platex -v e-pTeX 3.141592653-p3.9.0-210218-2.6 (utf8.euc) (TeX Live 2021) kpathsea version 6.3.3 ptexenc version 1.3.9
8.アップデートを実行しておく。少し時間がかかる。
# tlmgr update --self # tlmgr update --all
9. pxdvi のインストール
ここを参考に pxdviをインストールする。 (2021.5.24時点で current(2021)版のpxdvi はまだないので2020 版をインストール)
# wget https://texlive.texjp.org/tltexjp-key.asc # tlmgr key add tltexjp-key.asc # tlmgr repository add http://texlive.texjp.org/2020/tltexjp tltexjp # tlmgr pinning add tltexjp '*' # tlmgr install pxdvi # tlmgr path add # cd /usr/local/texlive/2021 # ln -s texmf-dist texmf
10. gv のインストール
# dnf -y install epel-release # dnf -y install gv
11. Ghostscript の最新版への更新と日本語対応
Tex Live 2020 から、dvipdfmx / dvips での日本語フォント埋込の既定値が「IPAex フォント」から「原ノ味フォント」に変更された。 Ghostscriptもこのため最新版に更新し、cjk-gs-integrate スクリプトを実行する必要がある。
まず Ghostscript(gs) を最新版 (9.54.0 以降) にupdate する。 https://www.ghostscript.com/download/gsdnld.html から、最新版のGhostscript の Source for all platforms を Download、展開し、configure, make, make install する。(Default の /usr/local/bin/ にインストールする)
# wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9540/ghostscript-9.54.0.tar.gz # tar xf ghostscript-9.54.0.tar.gz # cd ghostscript-9.54.0 # ./configure : # make : # make install :
これで最新版の gs が /usr/local/bin にインストールされた。念のため aliase も定義しておく
# ln -s /usr/local/bin/gs /usr/local/bin/ghostscript
確認のため
$ gs -help
を実行すると
GPL Ghostscript 9.54.0 (2021-03-30) Copyright (C) 2021 Artifex Software, Inc. All rights reserved. Search path: %rom%Resource/Init/ : %rom%lib/ : /usr/local/share/ghostscript/9.54.0/Resource/Init : /usr/local/share/ghostscript/9.54.0/lib : /usr/local/share/ghostscript/9.54.0/Resource/Font : /usr/local/share/ghostscript/fonts : /usr/local/share/fonts/default/ghostscript : /usr/local/share/fonts/default/Type1 : /usr/local/share/fonts/default/TrueType : /usr/lib/DPS/outline/base :
とかと出力される。 次に以下を実行する
# cjk-gs-integrate --link-texmf --cleanup --force cjk-gs-integrate: reading font database ... cjk-gs-integrate: searching for Ghostscript resource cjk-gs-integrate: going to clean up /usr/local/share/ghostscript/9.54.0/Resource cjk-gs-integrate: cleaning up all links, snippets and cidfmap.local ... cjk-gs-integrate: removing cidfmap.local from cidfmap file ... cjk-gs-integrate: removing snippets and cidfmap.aliases for font aliases ... cjk-gs-integrate: removing cidfmap.aliases from cidfmap file ... cjk-gs-integrate: running mktexlsr ... mktexlsr: Updating /usr/local/texlive/2021/texmf-config/ls-R... mktexlsr: Updating /usr/local/texlive/2021/texmf-dist/ls-R... mktexlsr: Updating /usr/local/texlive/2021/texmf-var/ls-R... mktexlsr: Updating /usr/local/texlive/texmf-local/ls-R... mktexlsr: Done. cjk-gs-integrate: finished #
これで Ghostscript(gs) が、Tex Live 2021 で日本語に対応するようになった。