> 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/texlive/ja/sukiru/latexnowosuru.md).

# LaTeXの依存関係を追加する

もしあなたが持っている場合、 `.cls`, `.sty`, `.bst` プロジェクト内のファイルは、トップレベルに配置されていない限り、Overleafのコンパイルプロセスはこれらのファイルを見つけることができません。

しかし、プロジェクトを整理するために、これらのファイルをフォルダに入れておくと見つけやすくなり、プロジェクトのトップレベルが散らからなくなります。

良いニュースは、カスタムの指定ができることです `TEXINPUTS` ディレクトリを使って、 `latexmkrc` ファイルを使えば、Overleafがそのディレクトリ内でパッケージファイルを検索する必要があることを認識させられます。

これを行うには、これらのパッケージファイルを次のようなフォルダに入れたとしましょう、 `tex/`; そしてそれぞれの文献スタイルファイルを次のようなフォルダに入れます、 `bst/`:

1. プロジェクトサイドバーの上部にある「Add file」をクリックしてください。
2. 「Blank file」を選択し、ファイル名を次のように保存します、 `latexmkrc` （まだ存在しない場合）。
3. 次の行をに入れてください、 `latexmkrc`:

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

   （またはプロジェクト内の該当するフォルダ名に変更してください）

Overleafは今、まず `tex/` フォルダをシステムの検索より先に検索して、 `TEXINPUTS` パッケージファイルを見つけ、そして `bst/` フォルダをシステムの検索より先に検索して、 `BSTINPUTS` 文献スタイルファイルを見つけます。

（出典： <https://tex.stackexchange.com/a/50847>)

{% hint style="info" %}
メインのドキュメントファイルとあなたの `latexmkrc` ファイルは、フォルダ内ではなくプロジェクトのトップレベルに残しておく必要があります。
{% 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/texlive/ja/sukiru/latexnowosuru.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.
