> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/insutru/upgrading-tex-live.md).

# TeX Live のアップグレード

{% hint style="danger" %}
以下の手順は **のみ** に適用されます **Community Edition** のインストールに適用されます。Ayakaleaf Pro のユーザーには、 [サンドボックス化されたコンパイル](/on-premises/ja/she-ding/overleaf-toolkit/sandboxed-compiles.md) を有効にすることを強く推奨します。これにより、ユーザーは [overleaf.com](/on-premises/ja/she-ding/overleaf-toolkit.md) で使用されているものとほぼ同じ TeX Live イメージにアクセスでき、さらにプロジェクトのコンパイル間に分離が提供されて、セキュリティが向上します。
{% endhint %}

帯域幅を節約するため、Overleaf Community Edition と Ayakaleaf Pro の両方のイメージには、 [TeX Live](https://www.tug.org/texlive/)の最小構成のみが含まれています。より多くのパッケージをインストールするか、 [tlmgr](https://www.tug.org/texlive/tlmgr.html) コマンドを `sharelatex` コンテナ内で使用して、完全な TeX Live インストールにアップグレードできます。

#### sharelatex コンテナに入る

内でシェルを起動するには、 `sharelatex` コンテナで、

```bash
bin/shell
```

次のようなプロンプトが表示されます:

```bash
root@309b192d4030:/#
```

以下の手順では、コンテナ内にいるものとします。

#### 現在の TeX Live のバージョンを確認する

TeX Live は毎年 4 月頃にリリースされます。 `tlmgr` を使用する手順は、現在のリリースを使っているか古いリリースを使っているかによって異なります。実行中の TeX Live のバージョンは、 `tlmgr --version`で確認できます。たとえば、このインストールでは TeX Live 2021 が実行されています:

```bash
# tlmgr --version
tlmgr revision 59291 (2021-05-21 05:14:40 +0200)
tlmgr using installation: /usr/local/texlive/2021
TeX Live (https://tug.org/texlive) version 2021
```

{% hint style="info" %}
TeX Live の現在のリリースは [TeX Live のホームページ](https://www.tug.org/texlive/).
{% endhint %}

で確認できます。古い TeX Live バージョンを実行している場合は、2 つの選択肢があります。新しい Overleaf Docker イメージのバージョンは通常、TeX Live のリリース直後に公開されます。公開を待ってから `bin/upgrade` スクリプトを使ってデプロイをアップグレードするか、古い TeX Live リリースを使い続けたい場合は、まず `tlmgr` に履歴リポジトリを使用するよう指示する必要があります。その手順は [こちら](https://www.tug.org/texlive/acquire.html#past).

#### パッケージのインストール

完全な TeX Live インストールを行うには、 `sharelatex` コンテナ内でこのコマンドを実行します:

```
tlmgr install scheme-full
```

個別のパッケージを手動でインストールすることもできます:

```bash
tlmgr install tikzlings tikzmarmots tikzducks
```

{% hint style="warning" %}
以降の `3.3.0` リリースでは、 `tlmgr path add` が **必要です** 。これは、 `tlmgr install`を使用するたびに、すべてのバイナリを正しくシステムパスへシンボリックリンクするために必要です。
{% endhint %}

さらに多くのコマンドが利用できます。詳しくは次を参照してください:

```
tlmgr help
```

終わったら、 `exit` と入力するか、Control-D を押してシェルを終了します。

#### 変更を保存する

先ほど加えた変更により、 `sharelatex` コンテナは変更されましたが、これらは一時的なものです。Docker Compose がコンテナを再作成すると、たとえば設定更新の一部として、失われます。

変更を永続化するには、 `docker commit` を使って変更を新しい docker イメージに保存します:

```bash
cat config/version #5.2.1
docker commit sharelatex sharelatex/sharelatex:5.2.1-with-texlive-full
echo 5.2.1-with-texlive-full > config/version
```

変更をコミットした後、 `config/version` をそれに合わせて更新します。その後、 `bin/up`を実行して、 `sharelatex` コンテナ内で使用して、完全な TeX Live インストールにアップグレードできます。

{% hint style="danger" %}
毎回これらの手順を繰り返す必要があります。 [アップグレード](https://github.com/overleaf/toolkit/blob/master/doc/upgrading.md) して新しい Overleaf バージョンにするたびに。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/ja/insutru/upgrading-tex-live.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
