> 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/co-so-tri-thuc/006-can-i-choose-which-file-is-the-main-tex-file-in-a-project-on-overleaf.md).

# Tôi có thể chọn tệp nào là tệp tex chính trong một dự án trên Overleaf không?

Có, bằng cách làm theo các bước sau:

1. Nhấp vào biểu tượng menu Overleaf (![OLmenu.png](/files/a193ce015cd2a52cacedab9717af4cb2114fac49)), nằm phía trên danh sách tệp.
2. Trong menu, tìm **Tài liệu chính** tùy chọn và đặt nó thành `.tex` tệp:

   ![SettingMainTeX.png](/files/df6344aab5ed23286c939fca0af11cac76ff33ae)
3. Điều này sẽ đặt tệp được biên dịch và xem trước mỗi khi bạn quay lại dự án của mình.

**Ghi chú**:

* Để đảm bảo các tính năng của Overleaf hoạt động đúng, chúng tôi khuyên bạn nên đặt tệp `.tex` chính của dự án trong thư mục cấp cao nhất của dự án. Ví dụ, các tính năng bị ảnh hưởng bao gồm [nhảy đến vị trí](/latex/vi/co-so-tri-thuc/022-can-t-find-jump-to-location-arrows.md), [đếm từ](/latex/vi/co-so-tri-thuc/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) và các script như [makeglossaries](/latex/vi/cau-truc-tai-lieu/05-glossaries.md) v.v.,
* Bất kỳ tệp dự án nào chứa một `\documentclass` lệnh có thể được biên dịch khi mở trong trình soạn thảo bằng cách chọn **Biên dịch lại** nút này. Điều này cho phép bạn biên dịch nhiều tài liệu trong cùng một dự án Overleaf mà không cần thay đổi cài đặt tệp chính của dự án.


---

# 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/co-so-tri-thuc/006-can-i-choose-which-file-is-the-main-tex-file-in-a-project-on-overleaf.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.
