> 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/latex/ja/to-2/59-i-have-a-lot-of-.cls-.sty-.bst-files-and-i-want-to-put-them-in-a-folder-to-keep-my-project-unclut.md).

# .cls、.sty、.bstファイルがたくさんあるので、プロジェクトをすっきり保つためにフォルダに入れたいです。でも、正しくコンパイルするためにプロジェクトがそれらを見つけられません

朗報です。カスタム `TEXINPUTS` ディレクトリを次のものを使って指定できます `latexmkrc` ファイル。これにより、Overleaf はそのディレクトリ内でパッケージファイルを検索する必要があることを認識します。

そのためには、これらのパッケージファイルを次の名前のフォルダに置いたとしましょう `tex/`。そして、それぞれの参考文献スタイルファイルを次の名前のフォルダに置きます `bst/`:

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

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

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

これで Overleaf はまず `tex/` フォルダを検索してから、システム `TEXINPUTS` を検索してパッケージファイルを見つけます。また、 `bst/` フォルダを検索してから、システム `BSTINPUTS` を検索して参考文献スタイルファイルを見つけます。

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

**注意**：メインの文書ファイルと `latexmkrc` ファイルは、フォルダの中ではなく、プロジェクトの最上位に置いたままにしてください。


---

# 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/latex/ja/to-2/59-i-have-a-lot-of-.cls-.sty-.bst-files-and-i-want-to-put-them-in-a-folder-to-keep-my-project-unclut.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.
