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

# Extender o TeX Live

É possível estender uma imagem TeX Live existente usando um novo Dockerfile e configurar a aplicação para usar a nova imagem.

Aqui oferecemos algumas orientações para instalar novos pacotes ou tipos de letra, mas a configuração de uma imagem personalizada não está abrangida pelos nossos termos de suporte.

As imagens TeX Live recebem atualizações pouco frequentes. Sugerimos reconstruir as imagens personalizadas ao atualizar o Server Pro.

{% hint style="danger" %}
As secções seguintes aplicam-se ao Server Pro e [Compilações em ambiente sandbox](broken://pages/138a0102db4225d7cc5647c97b88312152073ca0) apenas.
{% endhint %}

### Instalar e atualizar novos pacotes

Pode usar `tlmgr` comandos como `tlmgr install` e `tlmgr update` para gerir pacotes do TeX Live, como no exemplo seguinte:

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

RUN tlmgr update --force ebproof
```

### Usar `tlmgr` numa imagem TeX Live mais antiga

Por predefinição `tlmgr` descarrega recursos da versão mais recente do TeX Live. Ao aplicar patches a uma imagem TeX Live mais antiga, as transferências têm de ser mudadas para o respetivo arquivo. Veja a lista em <https://www.tug.org/historic/> para espelhos de arquivos.

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

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

RUN tlmgr update --force ebproof
```

### Instalar novos tipos de letra

Existem diferentes procedimentos para instalar novos tipos de letra numa distribuição TeX Live, e instalar um tipo de letra personalizado pode exigir vários passos. Consultar as [instruções para instalar tipos de letra TeX](https://tug.org/fonts/fontinstall.html) na documentação oficial do TeX Live é provavelmente um bom ponto de partida.

O seguinte `Dockerfile` mostra um exemplo de instalação de um tipo de letra TrueType sobre uma imagem TeX Live 2022 existente:

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

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

# reconstruir a cache de informações dos tipos de letra
RUN fc-cache
```

### Configurar o Server Pro para usar as novas imagens

Use o nome `ghcr.io/ayaka-notes/texlive-full` e uma etiqueta personalizada para construir a nova imagem, como em:

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

Podemos agora configurar o Server Pro para usar a nova `2023.1-custom` imagem atualizando as `TEX_LIVE_DOCKER_IMAGE` e `ALL_TEX_LIVE_DOCKER_IMAGES` variáveis de ambiente:

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

No exemplo acima, os novos projetos são definidos por predefinição para usar a nova `2023.1-custom` imagem, enquanto `2023.1` continua disponível para quando for necessário.


---

# 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/pt/manutencao/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.
