> 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-truc-tai-lieu/01-sections-and-chapters.md).

# Các phần và chương

## Giới thiệu

Tài liệu thường có một dạng “cấu trúc logic”: chia thành các chương, mục, tiểu mục, v.v. để tổ chức nội dung. LaTeX hỗ trợ tạo cấu trúc tài liệu và cũng cho phép tùy biến cách phân chia mục và đánh số. Các lệnh có sẵn để tổ chức một tài liệu phụ thuộc vào lớp tài liệu đang được dùng, mặc dù hình thức tổ chức đơn giản nhất, tức là phân chia mục, có sẵn trong tất cả các định dạng.

## Ví dụ cơ bản

Hãy bắt đầu với một ví dụ cơ bản để minh họa `\section{*section title*}` lệnh, lệnh này đánh dấu sự bắt đầu của một mục mới có tên `*section title*`. Việc đánh số mục là tự động và có thể tùy chỉnh hoặc tắt đi.

```latex
\documentclass{article}
\usepackage{blindtext}

\title{Sections and Chapters}
\author{Overleaf}
\date{\today}

\begin{document}
\maketitle
\section{Giới thiệu}

Đây là mục đầu tiên.

\blindtext

\section{Second Section}
Đây là mục thứ hai

\blindtext
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Basic+document+structure+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7B%5Ctoday%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Csection%7BIntroduction%7D%0A%0AThis+is+the+first+section.%0A%0A%5Cblindtext%0A%0A%5Csection%7BSecond+Section%7D%0AThis+is+the+second+section%0A%0A%5Cblindtext%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Ví dụ về mục và chương](/files/cd92d9c5983d9a9dcaf46a4439190c38cd7a6307)

## Phân chia tài liệu

LaTeX có thể tổ chức, đánh số và lập chỉ mục các chương và mục của tài liệu. Có tối đa 7 cấp độ để định nghĩa các mục tùy theo lớp tài liệu:

|    |                                 |
| -- | ------------------------------- |
| -1 | `\part{part}`                   |
| 0  | `\chapter{chapter}`             |
| 1  | `\section{section}`             |
| 2  | `\subsection{subsection}`       |
| 3  | `\subsubsection{subsubsection}` |
| 4  | `\paragraph{paragraph}`         |
| 5  | `\subparagraph{subparagraph}`   |

Thông thường, `\section` là lệnh cấp cao nhất của tài liệu trong hầu hết các tài liệu. Tuy nhiên, trong báo cáo hoặc sách, và các tài liệu dài tương tự, thì sẽ là `\chapter` hoặc `\part`.

## Các mục có số và không số

Để có một chương, mục, tiểu mục, v.v. không đánh số, hãy thêm dấu sao (`*`) ở cuối lệnh, trước dấu ngoặc nhọn mở. Những mục này sẽ không được đưa vào mục lục. Đây là ví dụ đầu tiên của chúng ta (ở trên) nhưng lần này sử dụng `\section*` thay vì `\section`:

```latex
\documentclass{article}
\usepackage{blindtext}

\title{Sections and Chapters}
\author{Overleaf}
\date{\today}

\begin{document}
\maketitle
\section*{Introduction}

Đây là mục đầu tiên.

\blindtext

\section*{Second Section}
Đây là mục thứ hai

\blindtext
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+with+unnumbered+sections\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7B%5Ctoday%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Csection%2A%7BIntroduction%7D%0A%0AThis+is+the+first+section.%0A%0A%5Cblindtext%0A%0A%5Csection%2A%7BSecond+Section%7D%0AThis+is+the+second+section%0A%0A%5Cblindtext%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Ví dụ về các mục không đánh số](/files/61d574049cafadc1bbf8bc38b8adf8c8174a4e3b)

### Các mục không đánh số trong mục lục

Để thêm một mục không đánh số vào mục lục, hãy dùng `\addcontentsline` lệnh như sau:

```latex
\addcontentsline{toc}{section}{Title of the section}
```

Đây là một ví dụ sử dụng `\addcontentsline` nhưng hãy xem bài viết [Mục lục](/latex/vi/cau-truc-tai-lieu/02-table-of-contents.md) để biết thêm thông tin và ví dụ.

```latex
\documentclass{article}
\title{Sections and Chapters}
\author{Overleaf}
\date{\today}

\begin{document}
\maketitle
\tableofcontents

\newcommand\shortlorem{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.}

\section{Giới thiệu}
Đây là mục đầu tiên (có đánh số).

\shortlorem
\addcontentsline{toc}{section}{Unnumbered Section}
\section*{Unnumbered Section}
Một mục không đánh số

\shortlorem

\section{Phần thứ hai}
Mục có đánh số thứ hai.

\shortlorem
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+unnumbered+sections+in+the+TOC\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7B%5Ctoday%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Ctableofcontents%0A%0A%5Cnewcommand%5Cshortlorem%7BLorem+ipsum+dolor+sit+amet%2C+consectetur+adipiscing+elit%2C+sed+do+eiusmod+tempor+incididunt+ut+labore+et+dolore+magna+aliqua.+Ut+enim+ad+minim+veniam%2C+quis+nostrud+exercitation+ullamco+laboris+nisi+ut+aliquip+ex+ea+commodo+consequat.%7D%0A%0A%5Csection%7BIntroduction%7D%0AThis+is+the+first+section+%28numbered%29.%0A%0A%5Cshortlorem%0A%5Caddcontentsline%7Btoc%7D%7Bsection%7D%7BUnnumbered+Section%7D%0A%5Csection%2A%7BUnnumbered+Section%7D%0AAn+unnumbered+section%0A%0A%5Cshortlorem%0A%0A%5Csection%7BSecond+section%7D%0AThe+second+numbered+section.%0A%0A%5Cshortlorem%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Các mục không đánh số trong Mục lục](/files/481102a1b8e464c8ff395007d7b895e406ea0812)

## Các chương và mục của tài liệu trong sách/báo cáo

Như đã đề cập trước đó, `\chapter` có thể được dùng trong sách và báo cáo.

### Lớp báo cáo

Bên dưới bạn có thể thấy một ví dụ `báo cáo` sử dụng đoạn văn lấy từ bài viết trên Overleaf [Giới thiệu về LuaTeX (Phần 1): Nó là gì — và điều gì khiến nó khác biệt đến vậy?](/latex/vi/bai-viet-chuyen-sau/07-an-introduction-to-luatex-part-1-what-is-it-and-what-makes-it-so-different.md)

```latex
\documentclass{report}
\title{Sections and Chapters}
\author{Overleaf}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\chapter{An Introduction to Lua\TeX}

\section{What is it—and what makes it so different?}
Lua\TeX{} là một \textit{bộ công cụ}—nó chứa các công cụ và thành phần phần mềm tinh vi, nhờ đó bạn có thể dựng (dàn trang) rất nhiều loại tài liệu. Tiêu đề phụ của bài viết này cũng đặt ra hai câu hỏi về Lua\TeX: Nó là gì—và điều gì khiến nó khác biệt đến vậy? Câu trả lời cho “Nó là gì?” có vẻ hiển nhiên: “Đó là một bộ máy dàn trang \TeX{}!” Quả đúng như vậy, nhưng một cách nhìn rộng hơn, và cũng là quan điểm của tác giả này, là Lua\TeX{} là một hệ thống xây dựng và kỹ thuật tài liệu dựa trên \TeX{} cực kỳ linh hoạt.

\subsection{Explaining Lua\TeX: Where to start?}
Mục tiêu của bài viết đầu tiên này về Lua\TeX{} là đưa ra bối cảnh để hiểu bộ máy TeX này cung cấp những gì và vì sao/cách thức thiết kế của nó cho phép người dùng xây dựng/thiết kế/tạo ra một loạt giải pháp cho các vấn đề dàn trang và thiết kế phức tạp—có lẽ cũng mang lại một mức độ “bảo đảm cho tương lai” nào đó

\chapter{Lua\TeX: Background and history}
\section{Giới thiệu}
Lua\TeX{} là, theo cách nói của \TeX{}, “người mới trong khu phố” dù đã được phát triển tích cực hơn 10 năm.

\subsection{Lua\TeX: Opening up \TeX’s “black box”}
Chương trình \TeX{} nguyên bản của Knuth là tổ tiên chung của tất cả các bộ máy \TeX{} hiện đại đang được sử dụng ngày nay và Lua\TeX{} thực chất là bước tiến hóa mới nhất: được phát triển từ chương trình pdf\TeX{} nhưng bổ sung thêm một số thành phần phần mềm mạnh mẽ, mang lại rất nhiều chức năng bổ sung.
\end{document}
```

[Mở ví dụ này trong Overleaf (sử dụng `lualatex`)](<https://www.overleaf.com/docs?engine=lualatex\&snip_name=Example+of+a+LaTeX+report\&snip=\documentclass{report}&#xA;\title{Sections+and+Chapters}&#xA;\author{Overleaf}&#xA;\date{\today}&#xA;\begin{document}&#xA;\maketitle&#xA;\tableofcontents&#xA;\chapter{An+Introduction+to+Lua\TeX}&#xA;&#xA;\section{What+is+it—and+what+makes+it+so+different?}&#xA;Lua\TeX{}+is+a+\textit{toolkit}—it+contains+sophisticated+software+tools+and+components+with+which+you+can+construct+(typeset)+a+wide+range+of+documents.+The+sub-title+of+this+article+also+poses+two+questions+about+Lua\TeX:+What+is+it—and+what+makes+it+so+different?+The+answer+to+“What+is+it?”+may+seem+obvious:+“It’s+a+\TeX{}+typesetting+engine!”+Indeed+it+is,+but+a+broader+view,+and+one+to+which+this+author+subscribes,+is+that+Lua\TeX{}+is+an+extremely+versatile+\TeX-based+document+construction+and+engineering+system.&#xA;&#xA;\subsection{Explaining+Lua\TeX:+Where+to+start?}&#xA;The+goal+of+this+first+article+on+Lua\TeX{}+is+to+offer+a+context+for+understanding+what+this+TeX+engine+provides+and+why/how+its+design+enables+users+to+build/design/create+a+wide+range+of+solutions+to+complex+typesetting+and+design+problems—perhaps+also+offering+some+degree+of+“future+proofing”+&#xA;&#xA;\chapter{Lua\TeX:+Background+and+history}&#xA;\section{Introduction}&#xA;Lua\TeX{}+is,+in+\TeX{}+terms,+“the+new+kid+on+the+block”+despite+having+been+in+active+development+for+over+10+years.&#xA;&#xA;\subsection{Lua\TeX:+Opening+up+\TeX’s+“black+box”}&#xA;Knuth’s+original+\TeX{}+program+is+the+common+ancestor+of+all+modern+\TeX{}+engines+in+use+today+and+Lua\TeX{}+is,+in+effect,+the+latest+evolutionary+step:+derived+from+the+pdf\TeX{}+program+but+with+the+addition+of+some+powerful+software+components+which+bring+a+great+deal+of+extra+functionality.&#xA;\end{document}>)

Ví dụ này tạo ra đầu ra sau đây—ở đây chúng tôi hiển thị các trang 2–4, trong đó hình ảnh các trang được chồng lên nhau để dễ trình bày:

![Một báo cáo LaTeX điển hình](/files/e4ff8c3b773f0dd44b23a1f481979427bf697db6)

### Lớp book

Ví dụ sau tái tạo văn bản từ `báo cáo` ví dụ nhưng với `\documentclass{book}`, chứa các phần, chương, mục, tiểu mục và tiểu mục con cấp ba. Nếu bạn mở ví dụ trong Overleaf, bạn sẽ thấy rằng các tiểu mục con cấp ba được tạo bởi `\subsubsection` đang *không* được đánh số. Đó là do thiết kế của lớp `book` lớp: nếu bạn muốn thay đổi hành vi này, hãy thêm lệnh sau vào phần tiền đề của tài liệu:

```latex
\setcounter{secnumdepth}{3}
```

```latex
\documentclass{book}
\title{Sections and Chapters}
\author{Overleaf}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\part{History of Lua\TeX}

\chapter{An Introduction to Lua\TeX}

\section{What is it—and what makes it so different?}
Lua\TeX{} là một \textit{bộ công cụ}—nó chứa các công cụ và thành phần phần mềm tinh vi, nhờ đó bạn có thể dựng (dàn trang) rất nhiều loại tài liệu. Tiêu đề phụ của bài viết này cũng đặt ra hai câu hỏi về Lua\TeX: Nó là gì—và điều gì khiến nó khác biệt đến vậy? Câu trả lời cho “Nó là gì?” có vẻ hiển nhiên: “Đó là một bộ máy dàn trang \TeX{}!” Quả đúng như vậy, nhưng một cách nhìn rộng hơn, và cũng là quan điểm của tác giả này, là Lua\TeX{} là một hệ thống xây dựng và kỹ thuật tài liệu dựa trên \TeX{} cực kỳ linh hoạt.

\subsection{Explaining Lua\TeX: Where to start?}
Mục tiêu của bài viết đầu tiên này về Lua\TeX{} là đưa ra bối cảnh để hiểu bộ máy TeX này cung cấp những gì và vì sao/cách thức thiết kế của nó cho phép người dùng xây dựng/thiết kế/tạo ra một loạt giải pháp cho các vấn đề dàn trang và thiết kế phức tạp—có lẽ cũng mang lại một mức độ “bảo đảm cho tương lai” nào đó

\chapter{Lua\TeX: Background and history}
\section{Giới thiệu}
Lua\TeX{} là, theo cách nói của \TeX{}, “người mới trong khu phố” dù đã được phát triển tích cực hơn 10 năm.

\subsection{Lua\TeX: Opening up \TeX’s “black box”}
Chương trình \TeX{} nguyên bản của Knuth là tổ tiên chung của tất cả các bộ máy \TeX{} hiện đại đang được sử dụng ngày nay và Lua\TeX{} thực chất là bước tiến hóa mới nhất: được phát triển từ chương trình pdf\TeX{} nhưng bổ sung thêm một số thành phần phần mềm mạnh mẽ, mang lại rất nhiều chức năng bổ sung.

\subsubsection{How Lua\TeX{} processes \texttt{\string\directlua}: A first look}
⟨code⟩ được cung cấp cho \verb|\directlua{<code>}| trước tiên được chuyển thành các token bằng các quá trình và phép tính đã thảo luận ở trên; chuỗi token đó được lưu trong một danh sách token.
\end{document}
```

[Để xem đầu ra, **hãy mở ví dụ này trong Overleaf** (nó sử dụng `**lualatex**`)](<https://www.overleaf.com/docs?engine=lualatex\&snip_name=Example+of+a+LaTeX+book\&snip=\documentclass{book}&#xA;\title{Sections+and+Chapters}&#xA;\author{Overleaf}&#xA;\date{\today}&#xA;\begin{document}&#xA;\maketitle&#xA;\tableofcontents&#xA;\part{History+of+Lua\TeX}&#xA;&#xA;\chapter{An+Introduction+to+Lua\TeX}&#xA;&#xA;\section{What+is+it—and+what+makes+it+so+different?}&#xA;Lua\TeX{}+is+a+\textit{toolkit}—it+contains+sophisticated+software+tools+and+components+with+which+you+can+construct+(typeset)+a+wide+range+of+documents.+The+sub-title+of+this+article+also+poses+two+questions+about+Lua\TeX:+What+is+it—and+what+makes+it+so+different?+The+answer+to+“What+is+it?”+may+seem+obvious:+“It’s+a+\TeX{}+typesetting+engine!”+Indeed+it+is,+but+a+broader+view,+and+one+to+which+this+author+subscribes,+is+that+Lua\TeX{}+is+an+extremely+versatile+\TeX-based+document+construction+and+engineering+system.&#xA;&#xA;\subsection{Explaining+Lua\TeX:+Where+to+start?}&#xA;The+goal+of+this+first+article+on+Lua\TeX{}+is+to+offer+a+context+for+understanding+what+this+TeX+engine+provides+and+why/how+its+design+enables+users+to+build/design/create+a+wide+range+of+solutions+to+complex+typesetting+and+design+problems—perhaps+also+offering+some+degree+of+“future+proofing”+&#xA;&#xA;\chapter{Lua\TeX:+Background+and+history}&#xA;\section{Introduction}&#xA;Lua\TeX{}+is,+in+\TeX{}+terms,+“the+new+kid+on+the+block”+despite+having+been+in+active+development+for+over+10+years.&#xA;&#xA;\subsection{Lua\TeX:+Opening+up+\TeX’s+“black+box”}&#xA;Knuth’s+original+\TeX{}+program+is+the+common+ancestor+of+all+modern+\TeX{}+engines+in+use+today+and+Lua\TeX{}+is,+in+effect,+the+latest+evolutionary+step:+derived+from+the+pdf\TeX{}+program+but+with+the+addition+of+some+powerful+software+components+which+bring+a+great+deal+of+extra+functionality.&#xA;&#xA;\subsubsection{How+Lua\TeX{}+processes+\texttt{\string\directlua}:+A+first+look}&#xA;The+⟨code⟩+provided+to+\verb|\directlua{\<code\>}|+is+first+converted+to+tokens+using+the+processes+and+calculations+discussed+above;+that+sequence+of+tokens+is+stored+in+a+token+list.&#xA;\end{document}>)

## Tùy chỉnh chương và mục

Bạn có thể sử dụng [`titlesec`](https://ctan.org/pkg/titlesec?lang=en) gói để tùy chỉnh kiểu của chương, mục và tiểu mục một cách dễ dàng.

```latex
\documentclass[a4paper,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage{titlesec}

\titleformat
{\chapter} % lệnh
[display] % hình dạng
{\bfseries\Large\itshape} % định dạng
{Câu chuyện số. \ \thechapter} % nhãn
{0.5ex} % khoảng cách
{
    \rule{\textwidth}{1pt}
    \vspace{1ex}
    \centering
} % mã trước
[
\vspace{-0.5ex}%
\rule{\textwidth}{0.3pt}
] % mã sau

\titleformat{\section}[wrap]
{\normalfont\bfseries}
{\thesection.}{0.5em}{}

\titlespacing{\section}{12pc}{1.5ex plus .1ex minus .2ex}{1pc}

\begin{document}
\chapter{Hãy bắt đầu}
\section{Lần thử đầu tiên}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris...

\section{Lần thử thứ hai}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris...

\end{document}
```

[Mở `titlesec` ví dụ trên Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=titlesec+example\&snip=%5Cdocumentclass%5Ba4paper%2C12pt%5D%7Bbook%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Btitlesec%7D%0A%0A%5Ctitleformat%0A%7B%5Cchapter%7D+%25+command%0A%5Bdisplay%5D+%25+shape%0A%7B%5Cbfseries%5CLarge%5Citshape%7D+%25+format%0A%7BStory+No.+%5C+%5Cthechapter%7D+%25+label%0A%7B0.5ex%7D+%25+sep%0A%7B%0A++++%5Crule%7B%5Ctextwidth%7D%7B1pt%7D%0A++++%5Cvspace%7B1ex%7D%0A++++%5Ccentering%0A%7D+%25+before-code%0A%5B%0A%5Cvspace%7B-0.5ex%7D%25%0A%5Crule%7B%5Ctextwidth%7D%7B0.3pt%7D%0A%5D+%25+after-code%0A%0A%0A%5Ctitleformat%7B%5Csection%7D%5Bwrap%5D%0A%7B%5Cnormalfont%5Cbfseries%7D%0A%7B%5Cthesection.%7D%7B0.5em%7D%7B%7D%0A%0A%5Ctitlespacing%7B%5Csection%7D%7B12pc%7D%7B1.5ex+plus+.1ex+minus+.2ex%7D%7B1pc%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cchapter%7BLet%27s+begin%7D%0A%5Csection%7BFirst+Attempt%7D%0A%0ALorem+ipsum+dolor+sit+amet%2C+consectetur+adipiscing+elit%2C+sed+do+%0Aeiusmod+tempor+incididunt+ut+labore+et+dolore+magna+aliqua.+Ut+%0Aenim+ad+minim+veniam%2C+quis+nostrud+exercitation+ullamco+laboris...%0A%0A%5Csection%7BSecond+attempt%7D%0A%0ALorem+ipsum+dolor+sit+amet%2C+consectetur+adipiscing+elit%2C+sed+do+%0Aeiusmod+tempor+incididunt+ut+labore+et+dolore+magna+aliqua.+Ut+%0Aenim+ad+minim+veniam%2C+quis+nostrud+exercitation+ullamco+laboris...%0A%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Titlesecolv2.png](/files/74666099e895131c443e3f06d9fe70f705463ea9)

### Các lệnh titlesec

Có hai lệnh chung:

```latex
 \titleformat{<lệnh>}[<hình dạng>]{<định dạng>}{<nhãn>}{<khoảng cách>}{<mã trước>}[<mã sau>]
```

trong đó `[<hình dạng>]` và `[<mã sau>]` là các tham số tùy chọn, và:

* `<lệnh>` là lệnh phân chia sẽ được định nghĩa lại: `\part`, `\chapter`, `\section`, `\subsection`, `\subsubsection`, `\paragraph` hoặc `\subparagraph`.
* `<hình dạng>` là hình dạng của đoạn phân chia; các giá trị có thể là: `hang`, `block`, `hiển thị`, `runin`, `leftmargin`, `rightmargin`, `drop`, `wrap` và `frame`.
* `<định dạng>` là định dạng được áp dụng cho tiêu đề, nhãn và văn bản; ví dụ `\normalfont\Large\bfseries`
* `<nhãn>` chỉ định nhãn phân chia.
* `<khoảng cách>` là khoảng cách ngang giữa nhãn và phần thân tiêu đề và nó phải là một độ dài, không được để trống.
* `<mã trước>` là mã đứng trước phần thân tiêu đề.
* `<mã sau>` là mã đứng sau phần thân tiêu đề.

và

```latex
 \titlespacing{<lệnh>}{<lề trái>}{<khoảng trước>}{<khoảng sau>}
```

trong đó:

* `<lề trái>` tăng lề trái.
* `<khoảng trước>` là khoảng trắng theo chiều dọc trước tiêu đề.
* `<khoảng sau>` là khoảng cách giữa tiêu đề và văn bản không thuộc mục.

Phiên bản có dấu sao của lệnh này (`\titlespacing*`) sẽ loại bỏ thụt đầu dòng của đoạn văn sau tiêu đề.

## Đọc thêm

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

* [Tạo một tài liệu trong LaTeX](/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)
* [Mục lục](/latex/vi/cau-truc-tai-lieu/02-table-of-contents.md)
* [Liên kết chéo các phần và phương trình](/latex/vi/cau-truc-tai-lieu/03-cross-referencing-sections-equations-and-floats.md)
* [Quản lý trong một dự án lớn](/latex/vi/cau-truc-tai-lieu/07-management-in-a-large-project.md)
* [Các dự án LaTeX nhiều tệp](/latex/vi/cau-truc-tai-lieu/08-multi-file-latex-projects.md)
* [Siêu liên kết](/latex/vi/cau-truc-tai-lieu/09-hyperlinks.md)
* [Đánh số trang](/latex/vi/dinh-dang/03-page-numbering.md)
* [Tài liệu một mặt và hai mặt](/latex/vi/dinh-dang/08-single-sided-and-double-sided-documents.md)
* [Nhiều cột](/latex/vi/dinh-dang/09-multiple-columns.md)
* [Bộ đếm](/latex/vi/dinh-dang/10-counters.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)
* [`titlesec` tài liệu hướng dẫn gói](http://mirrors.ctan.org/macros/latex/contrib/titlesec/titlesec.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/cau-truc-tai-lieu/01-sections-and-chapters.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.
