2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FreeBSD 11.1にTeX Live 2017をインストールする.

Last updated at Posted at 2017-12-14

はじめに

ここしばらくFreeBSDのTeX Live ports(pkg)が2015からバージョンアップされていない状態が続いています.普段使いでは特に困ることもなかったので,そのまま使い続けていたのですが,最近になってkanji-config-updmapでIPA(ex)フォントの埋め込みを設定すると,dvipdfmxでPDFファイルの作成に失敗するようになりました.そんな折に, http://anthesphoria.net/FreeBSD/TeXLive-2017/ を読んでTeX Live 2017を手動でもインストールできそうだとわかったので,挑戦してみることにしました.

準備

今回は一般ユーザーのホームディレクトリにTeX Live 2017をインストールすることにします.システムはFreeBSD 11.1-RELEASEです.

必要なパッケージ

  • x11-toolkits/p5-Tk
  • devel/gmake
  • x11/libX11
  • x11-toolkits/libXmu
  • x11-toolkits/libXaw
  • x11-fonts/fontconfig

あらかじめpkg installでインストールしておきましょう.print/texlive-fullがインストールされていれば依存関係でインストールされているような気がします.

インストーラ

http://tug.org/texlive/acquire.html からインストール形態にあわせてダウンロードしましょう.今回はインターネット経由でインストールするということで, http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz をダウンロードして適当なディレクトリ(~/tmpとか)に保存し,tarballを解凍しておきます.

cd ~/tmp
tar xvzf install-tl-unx.tar.gz

インストール

インストーラを実行します.

cd install-tl-unx/
./install-tl

次のようなインストールメニューが出てきます.GUI?なんですかそれ?

======================> TeX Live installation procedure <=====================

======>   Letters/digits in <angle brackets> indicate   <=======
======>   menu items for actions or customizations      <=======

 Detected platform: FreeBSD on x86_64

 <B> set binary platforms: 1 out of 19

 <S> set installation scheme: scheme-custom

 <C> set installation collections:
     40 collections out of 41, disk space required: 5183 MB

 <D> set directories:
   TEXDIR (the main TeX directory):
     /usr/local/texlive/2017
   TEXMFLOCAL (directory for site-wide local files):
     /usr/local/texlive/texmf-local
   TEXMFSYSVAR (directory for variable and automatically generated data):
     /usr/local/texlive/2017/texmf-var
   TEXMFSYSCONFIG (directory for local config):
     /usr/local/texlive/2017/texmf-config
   TEXMFVAR (personal directory for variable and automatically generated data):
     ~/.texlive2017/texmf-var
   TEXMFCONFIG (personal directory for local config):
     ~/.texlive2017/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

 <V> set up for portable installation

Actions:
 <I> start installation to hard disk
 <P> save installation profile to 'texlive.profile' and exit
 <H> help
 <Q> quit

Enter command:

dを押してインストール先を変更するためのメニューを呼出します.

===============================================================================
Directories customization:

 <1> TEXDIR:       /usr/local/texlive/2017
     support tree: /usr/local/texlive/2017/texmf-dist

 <2> TEXMFLOCAL:     /usr/local/texlive/texmf-local
 <3> TEXMFSYSVAR:    /usr/local/texlive/2017/texmf-var
 <4> TEXMFSYSCONFIG: /usr/local/texlive/2017/texmf-config

 <5> TEXMFVAR:       ~/.texlive2017/texmf-var
 <6> TEXMFCONFIG:    ~/.texlive2017/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:と聞かれたら~/texlive/2017と入力し,rでメインメニューへ戻ってiでインストールを開始します.

30分くらい放置していたらインストールが終わってるんじゃないですかね.

インストール後の設定

インストール終了時に表示されるメッセージにしたがってMANPATHINFOPATHを設定します.個人的に環境変数は~/.envrcに設定して.cshrcからsource ~/.envrcしているので,以下の設定を~/.envrcに追加します.当然ながら(t)cshを使っていることが前提です.

~/.envrc
setenv MANPATH "~/texlive/2017/texmf-dist/doc/man"
setenv INFOPATH "~/texlive/2017/texmf-dist/doc/info"

Ports(pkg)でインストールしたTeX Liveよりも先に実行されるように,/usr/local/binよりも~/texlive/2017/bin/amd64-freebsdが先に来るようにPATHを設定します.

~/.cshrc
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin $HOME/texlive/2017/bin/amd64-freebsd /usr/local/bin /usr/X11R6/bin /usr/compat/linux/usr/bin $HOME/bin)

変更した設定を反映させておきます

source ~/.cshrc

テスト

IPAexフォントを埋め込む設定にします.

kanji-config-updmap ipaex

実際にPDFを作ってテストしましょう.

test.tex
\documentclass[a4paper,11pt,uplatex]{jsarticle}
\begin{document}
\maketitle

これはテストです.
これは\textbf{テスト}です.

\end{document}
uplatex test.tex
dvipdfmx test.dvi

IPAex明朝とIPAexゴシック両方が埋め込まれていれば成功です.良かったですね.

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?