> 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/ngon-ngu/12-korean.md).

# Tiếng Hàn

## Giới thiệu

LaTeX hỗ trợ nhiều ngôn ngữ trên toàn thế giới thông qua các gói đặc biệt. Bài viết này giải thích cách nhập và sử dụng các gói để dàn trang tài liệu chứa văn bản tiếng Hàn. Danh sách các kiểu chữ Hàn có sẵn trên Overleaf có thể được tìm thấy [tại đây](/latex/vi/cau-hoi-and-tra-loi/85-which-otf-or-ttf-fonts-are-supported-via-fontspec.md#korean).

### Ví dụ sử dụng phông Google Noto CJK

Chúng ta có thể dùng `xeCJK` gói, vốn yêu cầu trình biên dịch XeLaTeX, để dàn trang một số văn bản tiếng Hàn bằng các [phông Noto CJK](https://www.google.com/get/noto/help/cjk/) được cài đặt trên Overleaf:

```latex
\documentclass{article}
\usepackage{xeCJK}
\setmainfont{Noto Serif}
\setCJKmainfont{Noto Serif CJK KR}
\setCJKsansfont{Noto Sans CJK KR}
\setCJKmonofont{Noto Sans Mono CJK KR}
\begin{document}
\section{Giới thiệu}
Đoạn giới thiệu thông tin cơ bản về toàn bộ tài liệu.

\begin{verbatim}
Nó kiểm tra phông chữ nguyên trạng, tham chiếu đến phương pháp giãn cách.
\end{verbatim}

Cũng cho phép các ký tự Latin.
\end{document}
```

[Mở ví dụ tiếng Hàn này trong Overleaf](https://www.overleaf.com/docs?engine=xelatex\&snip_name=Korean+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BxeCJK%7D%0A%5Csetmainfont%7BNoto+Serif%7D%0A%5CsetCJKmainfont%7BNoto+Serif+CJK+KR%7D%0A%5CsetCJKsansfont%7BNoto+Sans+CJK+KR%7D%0A%5CsetCJKmonofont%7BNoto+Sans+Mono+CJK+KR%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7B%EC%86%8C%EA%B0%9C%7D%0A%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%0A%0A%5Cbegin%7Bverbatim%7D%0A%EA%B7%B8%EA%B2%83%EC%9D%80+%EA%B0%84%EA%B2%A9+%EB%B0%A9%EB%B2%95%EC%9D%84+%EC%B0%B8%EC%A1%B0+%EA%B7%B8%EB%8C%80%EB%A1%9C+%EA%B8%80%EA%BC%B4%EC%9D%84+%ED%85%8C%EC%8A%A4%ED%8A%B8%0A%5Cend%7Bverbatim%7D%0A%0ALatin+characters+are+also+allowed.%0A%5Cend%7Bdocument%7D)

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

![Ví dụ cơ bản về dàn trang tiếng Hàn](/files/e06e1283610dd37845526792bf4e53dcac1126fc)

Trong ví dụ trên, bốn phông khác nhau được khai báo:

* `\setmainfont{Noto Serif}`: Sử dụng phông Noto Serif cho văn bản có ký tự Latin.
* `\setCJKmainfont{Noto Serif CJK KR}`: Đặt phông `Noto Serif CJK KR` để được dùng làm phông chính.
* `\setCJKsansfont{Noto Sans CJK KR}`: Tương tự như lệnh trước, lệnh này dùng `Noto Sans CJK KR` cho các phần tử tài liệu được dàn trang bằng phông sans serif.
* `\setCJKmonofont{Noto Sans Mono CJK KR}`: Sử dụng `Noto Sans Mono CJK KR` phông Noto Sans Mono CJK KR cho các phần tử tài liệu cần phông đơn cách; ví dụ, trong `verbatim` môi trường.

### Ví dụ sử dụng phông Noto và các độ đậm khác nhau

Vì `xeCJK` gói sử dụng `fontspec` các lệnh chọn kiểu, họ và độ đậm phông chữ thông thường của LaTeX, như `\ttfamily`, `\bfseries` và `\textsf` vẫn tiếp tục hoạt động, như minh họa trong ví dụ sau:

```latex
\documentclass{article}
\usepackage{xeCJK}
\setmainfont{Noto Serif}
\setCJKmainfont{Noto Serif CJK KR}
\setCJKsansfont{Noto Sans CJK KR}
\setCJKmonofont{Noto Sans Mono CJK KR}
\begin{document}
\section{Giới thiệu}
Đoạn giới thiệu thông tin cơ bản về toàn bộ tài liệu.

\vspace{10pt}

\noindent Đơn cách độ đậm thường: {\ttfamily 전체 문서에 대한 기본 정보를 소개 단락.}

\vspace*{10pt}

\noindent Đơn cách đậm: {\ttfamily\bfseries 전체 문서에 대한 기본 정보를 소개 단락.}

\vspace*{10pt}

\noindent Sans serif: \textsf{ 전체 문서에 대한 기본 정보를 소개 단락.}

\vspace*{10pt}

\noindent Sans serif đậm: \textsf{\bfseries 전체 문서에 대한 기본 정보를 소개 단락.}

\vspace*{10pt}

\noindent Và dĩ nhiên, các ký tự Latin cũng được phép dùng trong \textbf{đậm} hoặc \textit{nghiêng}.
\end{document}
```

[Mở ví dụ tiếng Hàn thứ hai này trong Overleaf](https://www.overleaf.com/docs?engine=xelatex\&snip_name=Korean+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BxeCJK%7D%0A%5Csetmainfont%7BNoto+Serif%7D%0A%5CsetCJKmainfont%7BNoto+Serif+CJK+KR%7D%0A%5CsetCJKsansfont%7BNoto+Sans+CJK+KR%7D%0A%5CsetCJKmonofont%7BNoto+Sans+Mono+CJK+KR%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7B%EC%86%8C%EA%B0%9C%7D%0A%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%0A%0A%5Cvspace%7B10pt%7D%0A%0A%5Cnoindent+Regular+weight+monospace%3A+%7B%5Cttfamily+%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%7D%0A%0A%5Cvspace%2A%7B10pt%7D%0A%0A%5Cnoindent+Bold+weight+monospace%3A+%7B%5Cttfamily%5Cbfseries+%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%7D+%0A%0A%5Cvspace%2A%7B10pt%7D%0A%0A%5Cnoindent+Sans+serif%3A+%5Ctextsf%7B+%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%7D%0A%0A%5Cvspace%2A%7B10pt%7D%0A%0A%5Cnoindent+Sans+serif+bold%3A+%5Ctextsf%7B%5Cbfseries+%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%7D%0A%0A%5Cvspace%2A%7B10pt%7D%0A%0A%5Cnoindent+And+of+course%2C+Latin+characters+are+also+allowed+in+%5Ctextbf%7Bbold%7D+or+%5Ctextit%7Bitalics%7D.%0A%5Cend%7Bdocument%7D)

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

![Văn bản tiếng Hàn với các kiểu khác nhau](/files/859cdd35e4d81fcb37833c739c711fa09aed772a)

## Ví dụ sử dụng xeCJK với phông đã được nạp vào dự án của bạn

Ví dụ sau sử dụng các phông, `UnGungseo.ttf` và `gulim.ttf`, được tải lên dự án Overleaf.

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

\setmainfont{Noto Serif}
\setCJKmainfont{UnGungseo.ttf}
\setCJKsansfont{UnGungseo.ttf}
\setCJKmonofont{gulim.ttf}

\begin{document}

\section{Giới thiệu}
Đoạn giới thiệu thông tin cơ bản về toàn bộ tài liệu.

\begin{verbatim}
Nó kiểm tra phông chữ nguyên trạng, tham chiếu đến phương pháp giãn cách.
\end{verbatim}

Cũng cho phép các ký tự Latin.

\end{document}
```

[Mở ví dụ XeLaTeX và xeCJK này trong Overleaf](https://www.overleaf.com/project/new/template/21134?id=72864508\&templateName=Typesetting+Korean+with+uploaded+fonts\&latexEngine=xelatex\&texImage=texlive-full%3A2020.1\&mainFile=)

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

![Dàn trang tiếng Hàn bằng pdfTeX](/files/bf9d4f96f61c662beae4e7704a7e8cd13d33724b)

## Dàn trang tài liệu tiếng Hàn bằng pdfLaTeX

Nếu quy trình làm việc của bạn có nghĩa là bạn *phải* phải dùng pdfLaTeX và không thể dùng XeLaTeX, bạn có thể dùng `CJKutf8` gói này với pdfLaTeX. Đây là một ví dụ:

```latex
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{mj}
 Đoạn giới thiệu thông tin cơ bản về toàn bộ tài liệu.

 \begin{verbatim}
 Nó kiểm tra phông chữ nguyên trạng, tham chiếu đến phương pháp giãn cách.
 \end{verbatim}
\end{CJK}

Cũng cho phép các ký tự Latin.
\end{document}
```

[Mở `CJKuft8` ví dụ gói này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Typesetting+Korean+with+pdfTeX\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BCJKutf8%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7BCJK%7D%7BUTF8%7D%7Bmj%7D%0A+%EC%A0%84%EC%B2%B4+%EB%AC%B8%EC%84%9C%EC%97%90+%EB%8C%80%ED%95%9C+%EA%B8%B0%EB%B3%B8+%EC%A0%95%EB%B3%B4%EB%A5%BC+%EC%86%8C%EA%B0%9C+%EB%8B%A8%EB%9D%BD.%0A%0A+%5Cbegin%7Bverbatim%7D%0A+%EA%B7%B8%EA%B2%83%EC%9D%80+%EA%B0%84%EA%B2%A9+%EB%B0%A9%EB%B2%95%EC%9D%84+%EC%B0%B8%EC%A1%B0+%EA%B7%B8%EB%8C%80%EB%A1%9C+%EA%B8%80%EA%BC%B4%EC%9D%84+%ED%85%8C%EC%8A%A4%ED%8A%B8%0A+%5Cend%7Bverbatim%7D%0A%5Cend%7BCJK%7D%0A%0ALatin+characters+are+also+allowed.%0A%5Cend%7Bdocument%7D)

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

![Dàn trang tiếng Hàn bằng CJKuft8](/files/b1d56807890e66eaa85fea6c78e870a932ce359e)

Lưu ý rằng để gõ văn bản tiếng Hàn bạn phải dùng `CJK` môi trường:

`\begin{CJK}{UTF8}{mj}`sẽ bắt đầu một `CJK` môi trường, tham số đầu tiên truyền cho khai báo môi trường là mã hóa văn bản. Chỉ sử dụng `UTF8` trên Overleaf, vì tất cả tệp văn bản trên Overleaf đều là UTF8. Tham số thứ hai là họ phông sẽ dùng: dùng `mj` cho tiếng Hàn.

## Đọc thêm

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

* [Danh sách các kiểu chữ Hàn có sẵn trên Overleaf](/latex/vi/cau-hoi-and-tra-loi/85-which-otf-or-ttf-fonts-are-supported-via-fontspec.md#korean)
* [Hỗ trợ phông hiện đại với XƎLaTeX](/latex/vi/phong-chu/03-xelatex.md)
* [Dàn trang dấu trích dẫn và dấu ngoặc kép](/latex/vi/ngon-ngu/04-typesetting-quotations.md)
* [Hỗ trợ ngôn ngữ quốc tế](/latex/vi/ngon-ngu/03-international-language-support.md)
* [Tiếng Trung](/latex/vi/ngon-ngu/06-chinese.md)
* [Tiếng Pháp](/latex/vi/ngon-ngu/07-french.md)
* [Tiếng Đức](/latex/vi/ngon-ngu/08-german.md)
* [Tiếng Hy Lạp](/latex/vi/ngon-ngu/09-greek.md)
* [Tiếng Ý](/latex/vi/ngon-ngu/10-italian.md)
* [Tiếng Nhật](/latex/vi/ngon-ngu/11-japanese.md)
* [Tiếng Ả Rập](/latex/vi/ngon-ngu/05-arabic.md)
* [Tiếng Bồ Đào Nha](/latex/vi/ngon-ngu/13-portuguese.md)
* [Tiếng Nga](/latex/vi/ngon-ngu/14-russian.md)
* [Tiếng Tây Ban Nha](/latex/vi/ngon-ngu/15-spanish.md)
* [Phần giới thiệu về LaTeX2ε không quá ngắn](http://www.ctan.org/tex-archive/info/lshort/)
* [LaTeX/Quốc tế hóa trên WikiBooks](http://en.wikibooks.org/wiki/LaTeX/Internationalization)
* [LaTeX/Ký\_tự\_đặc\_biệt trên WikiBooks](http://en.wikibooks.org/wiki/LaTeX/Special_Characters)


---

# 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/ngon-ngu/12-korean.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.
