> 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/vi/cau-hoi-and-tra-loi/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).

# Tôi có rất nhiều tệp .cls, .sty, .bst và tôi muốn đặt chúng vào một thư mục để dự án của mình gọn gàng hơn. Nhưng dự án của tôi không tìm thấy chúng để biên dịch đúng cách

Tin tốt là chúng ta có thể chỉ định tùy chỉnh `TEXINPUTS` các thư mục bằng cách sử dụng `latexmkrc` tệp, để Overleaf biết rằng nó cần tìm các tệp gói trong thư mục đó.

Để làm điều này, giả sử bạn đã đặt các tệp gói này trong một thư mục có tên là `tex/`; và tương ứng các tệp kiểu trích dẫn trong một thư mục có tên là `bst/`:

1. Nhấp vào “Add file” ở phía trên thanh bên Project.
2. Chọn “Blank file”, và lưu tệp với tên `latexmkrc` (nếu nó chưa có ở đó).
3. Đặt dòng sau vào `latexmkrc`:

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

   (hoặc thay đổi thành tên các thư mục tương ứng trong dự án của bạn)

Overleaf bây giờ sẽ tìm trong `tex/` thư mục trước khi tìm trong hệ thống `TEXINPUTS` để xác định vị trí các tệp gói, và `bst/` thư mục trước khi tìm trong hệ thống `biến cấu hình BSTINPUTS` để xác định vị trí các tệp kiểu trích dẫn.

(Nguồn: <http://tex.stackexchange.com/a/50847/226>)

**Lưu ý**: Tệp tài liệu chính của bạn và `latexmkrc` tệp của bạn phải ở cấp cao nhất của dự án, không nằm trong một thư mục.


---

# 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/vi/cau-hoi-and-tra-loi/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.
