> 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/mentenansu/extending-tex-live.md).

# TeX Live の拡張

新しい Dockerfile を使用して既存の TeX Live イメージを拡張し、アプリケーションを新しいイメージを使うように設定することができます。

ここでは新しいパッケージやフォントをインストールするためのいくつかのガイドラインを紹介しますが、カスタムイメージの設定は当社のサポート範囲外です。

TeX Live イメージの更新はまれです。Server Pro をアップグレードする際には、カスタムイメージを再ビルドすることをおすすめします。

{% hint style="danger" %}
以下のセクションは Server Pro に適用され、 [サンドボックス化されたコンパイル](broken://pages/1dd5f700e39f07902787d70f3e15c1c4535227fb) のみ。
{% endhint %}

### 新しいパッケージのインストールと更新

次のように `tlmgr` コマンド、たとえば `tlmgr install` および `tlmgr update` を使用して、次の例のように Tex Live パッケージを管理できます:

```dockerfile
FROM ghcr.io/ayaka-notes/texlive-full:2023.1

RUN tlmgr update --force ebproof
```

### 使用する `tlmgr` 古い TeX Live イメージ内で

デフォルトでは `tlmgr` 最新の TeX Live リリースからリソースをダウンロードします。古い TeX Live イメージにパッチを当てる場合、ダウンロード先をそれぞれのアーカイブに切り替える必要があります。アーカイブのミラーについては、 <https://www.tug.org/historic/> の一覧を参照してください。

```dockerfile
FROM ghcr.io/ayaka-notes/texlive-full:2022.1

RUN tlmgr option repository <MIRROR>/systems/texlive/<YEAR>/tlnet-final
# 例: RUN tlmgr option repository ftp://tug.org/historic/systems/texlive/2022/tlnet-final

RUN tlmgr update --force ebproof
```

### 新しいフォントのインストール

Tex Live ディストリビューションに新しいフォントをインストールする方法はいくつかあり、カスタムフォントのインストールには複数の手順が必要になる場合があります。まずは [TeX フォントのインストール手順](https://tug.org/fonts/fontinstall.html) を公式 Tex Live ドキュメントで確認するのがよい出発点でしょう。

以下の `Dockerfile` は、既存の Tex Live 2022 イメージの上に TrueType フォントをインストールする例を示しています:

```dockerfile
FROM ghcr.io/ayaka-notes/texlive-full:2022.1

COPY ./myfonts/*.ttf /usr/share/fonts/truetype/myfont/

# フォント情報キャッシュを再構築
RUN fc-cache
```

### 新しいイメージを使用するように Server Pro を設定する

名前 `ghcr.io/ayaka-notes/texlive-full` とカスタムタグを使用して新しいイメージをビルドします。例:

```bash
docker build -t ghcr.io/ayaka-notes/texlive-full:2023.1-custom
```

これで Server Pro を、新しい `2023.1-custom` イメージを使用するように設定できます。以下を更新します。 `TEX_LIVE_DOCKER_IMAGE` および `ALL_TEX_LIVE_DOCKER_IMAGES` 環境変数:

{% code overflow="wrap" %}

```
TEX_LIVE_DOCKER_IMAGE: "ghcr.io/ayaka-notes/texlive-full:2023.1-custom"
ALL_TEX_LIVE_DOCKER_IMAGES: "ghcr.io/ayaka-notes/texlive-full:2023.1,ghcr.io/ayaka-notes/texlive-full:2023.1-custom"
```

{% endcode %}

上の例では、新しいプロジェクトはデフォルトで新しい `2023.1-custom` イメージを使用するように設定され、 `2023.1` は必要なときに引き続き利用できます。


---

# 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/mentenansu/extending-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.
