> 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/toan-hoc/04-matrices.md).

# Ma trận

## các môi trường ma trận của amsmath

Tính năng `amsmath` gói cung cấp các lệnh để dàn trang ma trận với các dấu phân cách khác nhau. Sau khi bạn đã nạp `\usepackage{amsmath}` trong phần tiền đề, bạn có thể sử dụng các môi trường sau trong các môi trường toán của mình:

| Kiểu                                   | Mã đánh dấu LaTeX                                     | Hiển thị dưới dạng                                  |
| -------------------------------------- | ----------------------------------------------------- | --------------------------------------------------- |
| Thường                                 | `\begin{matrix} 1 & 2 & 3\\ a & b & c \end{matrix}`   | $$\begin{matrix}1 & 2 & 3\a & b & c\end{matrix}$$   |
| <p>Dấu ngoặc đơn;<br>ngoặc tròn</p>    | `\begin{pmatrix} 1 & 2 & 3\\ a & b & c \end{pmatrix}` | $$\begin{pmatrix}1 & 2 & 3\a & b & c\end{pmatrix}$$ |
| <p>Dấu ngoặc vuông;<br>ngoặc vuông</p> | `\begin{bmatrix} 1 & 2 & 3\\ a & b & c \end{bmatrix}` | $$\begin{bmatrix}1 & 2 & 3\a & b & c\end{bmatrix}$$ |
| <p>Dấu ngoặc nhọn;<br>ngoặc móc</p>    | `\begin{Bmatrix} 1 & 2 & 3\\ a & b & c \end{Bmatrix}` | $$\begin{Bmatrix}1 & 2 & 3\a & b & c\end{Bmatrix}$$ |
| Dấu gạch dọc                           | `\begin{vmatrix} 1 & 2 & 3\\ a & b & c \end{vmatrix}` | $$\begin{vmatrix}1 & 2 & 3\a & b & c\end{vmatrix}$$ |
| Hai dấu gạch dọc                       | `\begin{Vmatrix} 1 & 2 & 3\\ a & b & c \end{Vmatrix}` | $$\begin{Vmatrix}1 & 2 & 3\a & b & c\end{Vmatrix}$$ |

Nếu bạn cần tạo các ma trận với các [dấu phân tách](/latex/vi/toan-hoc/03-brackets-and-parentheses.md), bạn có thể thêm chúng thủ công vào một `matrix`. Ví dụ:

| Mã đánh dấu LaTeX                                                              | Hiển thị dưới dạng                                                         |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| `\left\lceil \begin{matrix} 1 & 2 & 3\\ a & b & c \end{matrix} \right\rceil`   | $$\left\lceil\begin{matrix}1 & 2 & 3\a & b & c\end{matrix}\right\rceil$$   |
| `\left\langle \begin{matrix} 1 & 2 & 3\\ a & b & c \end{matrix} \right\rvert`  | $$\left\langle\begin{matrix}1 & 2 & 3\a & b & c\end{matrix}\right\rvert$$  |
| `\left\langle \begin{matrix} 1 & 2 & 3\\ a & b & c \end{matrix} \right\rangle` | $$\left\langle\begin{matrix}1 & 2 & 3\a & b & c\end{matrix}\right\rangle$$ |

## Ma trận nội dòng

Khi dàn trang toán nội dòng, các `matrix` môi trường ở trên có thể trông quá lớn. Có lẽ tốt hơn là dùng `smallmatrix` trong những tình huống như vậy, mặc dù bạn sẽ cần tự cung cấp [dấu phân tách](/latex/vi/toan-hoc/03-brackets-and-parentheses.md).

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent Cố gắng dàn trang một ma trận nội dòng ở đây:
 $\begin{pmatrix}
  a & b\\
  c & d
\end{pmatrix}$,
nhưng nó trông quá lớn, vậy hãy thử
$\big(\begin{smallmatrix}
  a & b\\
  c & d
\end{smallmatrix}\big)$
thay vào đó.
\end{document}
```

[Mở `smallmatrix` ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=amsmath+matrix+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cnoindent+Trying+to+typeset+an+inline+matrix+here%3A%0A+%24%5Cbegin%7Bpmatrix%7D%0A++a+%26+b%5C%5C+%0A++c+%26+d%0A%5Cend%7Bpmatrix%7D%24%2C++%0Abut+it+looks+too+big%2C+so+let%27s+try+%0A%24%5Cbig%28%5Cbegin%7Bsmallmatrix%7D%0A++a+%26+b%5C%5C%0A++c+%26+d%0A%5Cend%7Bsmallmatrix%7D%5Cbig%29%24+%0Ainstead.%0A%5Cend%7Bdocument%7D)

Hình ảnh sau đây cho thấy kết quả do ví dụ trên tạo ra:

![Amsmatrix.png](/files/50ef0fc03fa605266d99b3a82629a01cb6ac944c)

Tính năng `mathtools` gói cung cấp `psmallmatrix`, `bsmallmatrix` các môi trường, v.v. để tiện dùng.

## Đọc thêm

* [Biểu thức toán học](/latex/vi/toan-hoc/01-mathematical-expressions.md)
* [Dấu ngoặc và ngoặc tròn](/latex/vi/toan-hoc/03-brackets-and-parentheses.md)
* [Căn chỉnh các phương trình bằng amsmath](/latex/vi/toan-hoc/06-aligning-equations-with-amsmath.md)
* [Kiểu hiển thị trong chế độ toán học](/latex/vi/toan-hoc/10-display-style-in-math-mode.md)
* [Phần giới thiệu về LaTeX2ε không quá ngắn](http://www.ctan.org/tex-archive/info/lshort/)
* [tài liệu gói amsmath](http://texdoc.net/pkg/amsmath)
* [tài liệu gói mathtools](http://texdoc.net/pkg/mathtools)


---

# 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/toan-hoc/04-matrices.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.
