> 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/theo-linh-vuc/06-knitting-patterns.md).

# Mẫu đan len

## Giới thiệu

LaTeX cung cấp một lớp tài liệu đặc biệt để giúp dàn trang các tài liệu có mẫu đan và hình ảnh dễ dàng hơn. Bài viết này giải thích cách sử dụng gói [`knittingpattern`](https://ctan.org/pkg/knittingpattern?lang=en).

Việc sử dụng các mẫu đan rất đơn giản. Bạn chỉ cần khai báo đúng lớp tài liệu

```latex
\documentclass{knittingpattern}

\begin{document}

\title{Mẫu đan}
\author{Đội ngũ Overleaf}
\date{\today}
\maketitle

\cpyrght{Đội ngũ Overleaf}

\intro{
    Văn bản giới thiệu ở đây. Sẽ trông đẹp hơn nếu nó có
    chiều cao bằng với hình ảnh bên cạnh.
    Văn bản giới thiệu ở đây. Sẽ trông đẹp hơn nếu nó có
    chiều cao bằng với hình ảnh bên cạnh...
}{lion-logo}
```

![KnittingPatternsEx1OverleafV2.png](/files/1f2c1ea19136bb88be9b74cd22b3fcc0a0ff8e06)

Lệnh ở đầu tài liệu

```latex
\documentclass{knittingpattern}
```

cho phép một số lệnh giúp dễ dàng thay đổi bố cục của một số phần tử bằng cách dùng một vài lệnh. Chẳng hạn

* `\cpyrght{...}` Xóa số trang và thêm chú thích chân trang. Dành cho ghi chú bản quyền.
* `\intro{}{}` Nhận hai tham số bên trong dấu ngoặc nhọn. Tham số thứ nhất là một đoạn văn bản (giới thiệu), tham số thứ hai là một hình ảnh. Văn bản được in ở bên trái và hình ảnh ở bên cạnh nó.

[Mở một ví dụ về `knitpattern` gói trong Overleaf](https://www.overleaf.com/project/new/template/19507?id=65965453\&templateName=Knitting+Patterns+Demo\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Sơ đồ

Để thêm một hình ảnh có chứa sơ đồ **knittingpattern** cung cấp một lệnh đặc biệt

```latex
\diagram{overleaf-logo}
```

![KnittingPatternsEx2OverleafV2.png](/files/d380c01fff1b74191602a4a4629f8af6ae5a5466)

Lệnh `\diagram` in ra một hình ảnh căn giữa, có khung viền, với chiều rộng bằng một nửa trang.

[Mở một ví dụ về `knitpattern` gói trong Overleaf](https://www.overleaf.com/project/new/template/19507?id=65965453\&templateName=Knitting+Patterns+Demo\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Ghi chú và nhận xét

Nếu bạn cần làm nổi bật một khối văn bản đặc biệt trong tài liệu, có hai lệnh để thêm ghi chú và nhận xét có khung vào tài liệu.

```latex
\definecolor{colour0}{HTML}{000000}
\definecolor{colour2}{HTML}{97DE76}
\definecolor{colour4}{HTML}{EDB668}

\begin{document}

\note{colour0}{colour2}{Vật liệu}{
    Len, một ít len, và bạn cũng có thể cần len cho các
    phần bằng len.
}

Cũng có lệnh đặc biệt này

\important{colour0}{colour4}{Ghi chú này rất quan trọng.
Đó là lý do nó được tô sáng}
\end{document}
```

![KnittingPatternsEx3.png](/files/42c12af4bbfcfa03d84d90e22d71121b997e0afc)

Lệnh `\note{}{}{}{}` nhận 4 tham số:

* màu của đường viền,
* màu nền,
* một tiêu đề và
* văn bản sẽ được in bên trong hộp.

Các màu sử dụng **xcolor** cú pháp HTML. Xem [Sử dụng màu trong LaTeX](/latex/vi/dinh-dang/13-using-colors-in-latex.md) để biết thêm thông tin.

Lệnh thứ hai, `\important`, về cơ bản có cùng cú pháp với `\note`, nhưng tiêu đề bị lược bỏ.

[Mở một ví dụ về `knitpattern` gói trong Overleaf](https://www.overleaf.com/project/new/template/19507?id=65965453\&templateName=Knitting+Patterns+Demo\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Thêm hướng dẫn đan

Mục đích chính của một tài liệu về đan là thực sự cung cấp hướng dẫn cho một mẫu đan. Gói **knittingpatern** cung cấp một môi trường in ra một bảng hướng dẫn.

```latex
\documentclass{knittingpatern}
\definecolor{colour3}{HTML}{99CCFF}
\definecolor{colour5}{HTML}{CCFFCC}

\begin{document}
\begin{pattern}{colour3}{colour5}
Lên mũi & (st)\\
Hướng dẫn 1 & (st)\\
Hướng dẫn 2 & (st)\\
Hướng dẫn 3 & (st)\\
Hướng dẫn 4 & (st)\\
Hướng dẫn 5 & (st)\\
Hướng dẫn 6 & (st)\\
Hướng dẫn 7 & (st)\\
Hướng dẫn 8 & (st)\\
Hướng dẫn 9 & (st)\\
Hướng dẫn 10 & (st)\\
\quad\vdots & \quad\vdots\\
\end{pattern}
\end{document}
```

![KnittingPatternsEx4.png](/files/54c6265510933da7359bff809f4ed75e780fbbd6)

Môi trường này nhận hai tham số xác định các màu xen kẽ được dùng trong bảng để cải thiện khả năng đọc. Xem [Sử dụng màu trong LaTeX](/latex/vi/dinh-dang/13-using-colors-in-latex.md) để biết thêm thông tin về thao tác màu trong LaTeX.

[Mở một ví dụ về `knitpattern` gói trong Overleaf](https://www.overleaf.com/project/new/template/19507?id=65965453\&templateName=Knitting+Patterns+Demo\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

## Đọc thêm

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

* [Tạo tài liệu LaTeX đầu tiên của bạn](/latex/vi/kien-thuc-co-ban-ve-latex/01-learn-latex-in-30-minutes.md)
* [In đậm, in nghiêng và gạch chân](/latex/vi/kien-thuc-co-ban-ve-latex/03-bold-italics-and-underlining.md)
* [Chèn hình ảnh](/latex/vi/chu-de-khac/27-inserting-images.md)
* [Định vị hình ảnh và bảng](/latex/vi/hinh-va-bang/02-positioning-images-and-tables.md)
* [Định dạng đoạn văn](/latex/vi/dinh-dang/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Sử dụng màu trong LaTeX](/latex/vi/dinh-dang/13-using-colors-in-latex.md)
* [Kích thước phông chữ, họ phông và kiểu chữ](/latex/vi/phong-chu/01-font-sizes-families-and-styles.md)
* [Kiểu chữ](/latex/vi/phong-chu/02-font-typefaces.md)
* [Tính năng `knittingpattern` tài liệu gói](https://ctan.org/pkg/knittingpattern?lang=en)


---

# 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/theo-linh-vuc/06-knitting-patterns.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.
