LoginSignup
4
1

More than 1 year has passed since last update.

Ubuntu20.04でTeX環境構築

Last updated at Posted at 2022-06-27

はじめに

Ubuntu20.04においてTeXの環境構築を行う記事です.躓いている方の手助けになれば幸いです.

TeXLiveのインストール

aptパッケージでもインストールは可能ですが,古いバージョンの可能性があります.そのため直接インストーラをダウンロードしそれを実行する形でインストールすることを推奨します.

インストーラのダウンロード

$ wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz

インストーラの解凍

$ tar xvf install-tl-unx.tar.gz

インストーラの実行

$ cd install-tl-20220626
$ sudo ./install-tl -no-gui

ディレクトリ名はダウンロードした日付によって変わるので適宜読み替えてください.
install-tlをroot権限で実行することでインストーラが起動します.

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

======>   Letters/digits in <angle brackets> indicate   <=======
======>   menu items for actions or customizations      <=======
= help>   https://tug.org/texlive/doc/install-tl.html   <=======

...略...

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

Enter command:

Iを入力しインストールを開始します.ファイルサイズが膨大なためダウンロードには時間がかかります.気長に待ちましょう.
デフォルトで/usr/local/texliveに諸々のファイルがコピーされます.

パスの追加

今回は最新版の2022が入ったようですので2022の中のbinにパスを通します.
~/.bashrcに以下を追記します.

export PATH="$PATH:/usr/local/texlive/2022/bin/x86_64-linux"

TeXworksのインストール

TeXの便利な開発環境TeXworksをインストールします.
こちらについてはTeXLiveと違いaptパッケージでインストールしていただいて結構です.

$ sudo apt install texworks

テスト

きちんと動作するか確認しましょう.まずはTeXworksを実行します.

$ texworks

エディターで以下を打ち込みます.

\documentclass[a4paper]{jarticle}

\begin{document}

Hello \TeX world! 

\end{document}

緑の矢印ボタンを押してPDFを生成してみましょう.もしボタンの右側でpLaTeX(ptex2pdf)が選択されていなければ選択しましょう.
別ウインドウが開きPDFが表示されたら成功です.お疲れ様でした.

4
1
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
4
1