> 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/texlive/de/fahigkeiten/latex-abhangigkeiten-hinzufugen.md).

# LaTeX-Abhängigkeiten hinzufügen

Wenn Sie `.cls`, `.sty`, `.bst` Dateien in Ihrem Projekt haben, kann der Kompilierungsprozess von Overleaf diese Dateien nicht finden, es sei denn, sie befinden sich auf der obersten Ebene.

Um Ihr Projekt zu organisieren, möchten Sie diese Dateien möglicherweise in Ordner legen, damit Sie sie leichter finden und die oberste Ebene Ihres Projekts nicht überladen ist.

Die gute Nachricht ist, dass wir benutzerdefinierte `TEXINPUTS` Verzeichnisse mithilfe der `latexmkrc` Datei angeben können, damit Overleaf weiß, dass es in diesem Verzeichnis nach den Paketdateien suchen muss.

Nehmen wir dazu an, Sie haben diese Paketdateien in einen Ordner namens `tex/`; und die Bibliografie-Stildateien entsprechend in einem Ordner namens `bst/`:

1. Klicken Sie oben in der Projekt-Seitenleiste auf „Datei hinzufügen“.
2. Wählen Sie „Leere Datei“ und speichern Sie die Datei unter dem Namen `latexmkrc` (falls es noch nicht vorhanden ist).
3. Fügen Sie die folgende Zeile in `latexmkrc`:

   ```perl
   $ENV{'TEXINPUTS'}='./tex//:' . $ENV{'TEXINPUTS'}; 
   $ENV{'BSTINPUTS'}='./bst//:' . $ENV{'BSTINPUTS'};
   ```

   (oder passen Sie die entsprechenden Ordnernamen in Ihrem Projekt an)

Overleaf durchsucht nun zunächst den `tex/` Ordner, bevor das System durchsucht wird, `TEXINPUTS` um Paketdateien zu finden, und `bst/` Ordner, bevor das System durchsucht wird, `BSTINPUTS` um Bibliografie-Stildateien zu finden.

(Quelle: <https://tex.stackexchange.com/a/50847>)

{% hint style="info" %}
Ihre Hauptdokumentdatei und Ihre `latexmkrc` Datei müssen auf der obersten Ebene Ihres Projekts bleiben, nicht in einem Ordner.
{% 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://overleaf-pro.ayaka.space/texlive/de/fahigkeiten/latex-abhangigkeiten-hinzufugen.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.
