> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/vi/bao-tri/extending-tex-live.md).

# Mở rộng TeX Live

Có thể mở rộng một image TeX Live hiện có bằng một Dockerfile mới và cấu hình ứng dụng để sử dụng image mới.

Ở đây chúng tôi cung cấp một số hướng dẫn để cài đặt các gói hoặc phông chữ mới, nhưng việc cấu hình một image tùy chỉnh không nằm trong phạm vi hỗ trợ của chúng tôi.

Các image TeX Live nhận được các bản cập nhật không thường xuyên. Chúng tôi khuyên nên xây dựng lại các image tùy chỉnh khi nâng cấp Server Pro.

{% hint style="danger" %}
Các phần sau áp dụng cho Server Pro và [Biên dịch trong môi trường sandbox](broken://pages/3957e59109fbce4b81a0898f76608b14dc1642c2) chỉ.
{% endhint %}

### Cài đặt và cập nhật các gói mới

Bạn có thể dùng `tlmgr` các lệnh như `tlmgr install` và `tlmgr update` để quản lý các gói TeX Live như trong ví dụ sau:

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

RUN tlmgr update --force ebproof
```

### Sử dụng `tlmgr` trong một image TeX Live cũ hơn

Theo mặc định `tlmgr` tải xuống tài nguyên từ bản phát hành TeX Live mới nhất. Khi vá một image TeX Live cũ hơn, các lượt tải xuống cần được chuyển sang kho lưu trữ tương ứng. Xem danh sách tại <https://www.tug.org/historic/> để xem các bản sao lưu của kho lưu trữ.

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

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

RUN tlmgr update --force ebproof
```

### Cài đặt phông chữ mới

Có nhiều quy trình khác nhau để cài đặt phông chữ mới trong một bản phân phối TeX Live, và việc cài một phông chữ tùy chỉnh có thể cần vài bước. Kiểm tra [hướng dẫn cài đặt phông TeX](https://tug.org/fonts/fontinstall.html) trong tài liệu chính thức của TeX Live có lẽ là một điểm khởi đầu tốt.

Sau đây `Dockerfile` cho thấy một ví dụ về việc cài đặt phông chữ TrueType lên một image TeX Live 2022 hiện có:

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

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

# xây dựng lại bộ đệm thông tin phông chữ
RUN fc-cache
```

### Cấu hình Server Pro để sử dụng các image mới

Dùng tên `ghcr.io/ayaka-notes/texlive-full` và một thẻ tùy chỉnh để xây dựng image mới, như sau:

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

Giờ đây chúng ta có thể cấu hình Server Pro để sử dụng image mới `2023.1-custom` bằng cách cập nhật `TEX_LIVE_DOCKER_IMAGE` và `ALL_TEX_LIVE_DOCKER_IMAGES` các biến môi trường:

{% 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 %}

Trong ví dụ trên, các dự án mới được mặc định đặt để sử dụng `2023.1-custom` image mới, trong khi `2023.1` vẫn sẵn dùng khi cần.


---

# 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://overleaf-pro.ayaka.space/on-premises/vi/bao-tri/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.
