> 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/tep-lop/01-understanding-packages-and-class-files.md).

# Hiểu về các gói và tệp lớp

Định dạng mặc định trong các tài liệu LaTeX được xác định bởi **lớp** được tài liệu đó sử dụng. Giao diện mặc định này có thể được thay đổi và có thể thêm nhiều chức năng hơn bằng cách dùng một **gói**. Tên tệp lớp có **.cls** phần mở rộng, tên tệp gói có **.sty** phần mở rộng.

## Sự khác biệt giữa lớp và gói

Đôi khi rất khó để đưa ra quyết định khi phải chọn giữa việc viết một gói hay một lớp. Quy tắc cơ bản là nếu tệp của bạn chứa các lệnh điều khiển giao diện của cấu trúc logic của một loại tài liệu đặc biệt, thì đó là một lớp. Ngược lại, nếu tệp của bạn bổ sung các tính năng không phụ thuộc vào loại tài liệu, tức là có thể được dùng trong sách, báo cáo, bài viết, v.v.; thì đó là một gói.

Ví dụ, nếu một công ty cần các báo cáo có thương hiệu, sử dụng một phông chữ đặc biệt và có logo của công ty ở chân trang; bạn cần một lớp mới.

Nếu công ty cần một lệnh mới giúp làm nổi bật các câu quan trọng trong một tài liệu, một gói mới sẽ phù hợp trong trường hợp này.

## Đọc thêm

Để biết thêm thông tin, xem

* [Viết gói của riêng bạn](/latex/vi/tep-lop/03-writing-your-own-package.md)
* [Viết lớp của riêng bạn](/latex/vi/tep-lop/04-writing-your-own-class.md)
* [LaTeX2ε dành cho người viết lớp và gói](http://www.latex-project.org/guides/clsguide.pdf)


---

# 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/tep-lop/01-understanding-packages-and-class-files.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.
