> 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/ja/yan-yu/12-korean.md).

# 韓国語

## はじめに

LaTeX は、特殊なパッケージを用いることで、世界中の多くの言語をサポートしています。本記事では、韓国語テキストを含む文書を組版するためのパッケージのインポートと使用方法を説明します。Overleaf で利用できる韓国語書体の一覧は [こちら](/latex/ja/to-2/85-which-otf-or-ttf-fonts-are-supported-via-fontspec.md#korean).

### Google Noto CJK フォントを使った例

私たちは `xeCJK` パッケージを使えます。これは XeLaTeX コンパイラを必要とし、 [Noto CJK フォント](https://www.google.com/get/noto/help/cjk/) を 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{紹介}
文書全体に関する基本情報を紹介する段落。

\begin{verbatim}
これは、そのままスペーシング方法を参照し、フォントをテストします
\end{verbatim}

ラテン文字も使用できます。
\end{document}
```

[この韓国語の例を 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)

この例では次の出力が生成されます:

![韓国語組版の基本例](/files/c63b1814ce2256ace404f27ae45408db72bb4805)

上の例では、4 種類の異なるフォントが宣言されています:

* `\setmainfont{Noto Serif}`: ラテン文字のテキストに Noto Serif フォントを使用します。
* `\setCJKmainfont{Noto Serif CJK KR}`: フォントを `Noto Serif CJK KR` を主フォントとして使用するよう設定します。
* `\setCJKsansfont{Noto Sans CJK KR}`: 前のコマンドと同様に、これは `Noto Sans CJK KR` を、文書要素をサンセリフ体で組版するために使用します。
* `\setCJKmonofont{Noto Sans Mono CJK KR}`:  `Noto Sans Mono CJK KR` フォントを、等幅フォントを必要とする文書要素に使用します。例えば、 `verbatim` 環境内で。

### Noto フォントと異なる字重を使った例

なぜなら `xeCJK` パッケージは `fontspec` を使用しているため、通常の LaTeX のフォントスタイル・ファミリ・字重の選択コマンド、たとえば `\ttfamily`, `\bfseries` と `\textsf` は、以下の例に示すように引き続き機能します:

```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{紹介}
文書全体に関する基本情報を紹介する段落。

\vspace{10pt}

\noindent 通常の字重の等幅フォント: {\ttfamily 文書全体に関する基本情報を紹介する段落。}

\vspace*{10pt}

\noindent 太字の等幅フォント: {\ttfamily\bfseries 文書全体に関する基本情報を紹介する段落。}

\vspace*{10pt}

\noindent サンセリフ体: \textsf{ 文書全体に関する基本情報を紹介する段落。}

\vspace*{10pt}

\noindent サンセリフ体の太字: \textsf{\bfseries 文書全体に関する基本情報を紹介する段落。}

\vspace*{10pt}

\noindent もちろん、ラテン文字は \textbf{太字} や \textit{イタリック} でも使用できます。
\end{document}
```

[この 2 つ目の韓国語の例を 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)

この例では次の出力が生成されます:

![さまざまなスタイルの韓国語テキスト](/files/57b0744bd9258bd14fa40044640979eb81c875dd)

## プロジェクトに読み込んだフォントを使った xeCJK の例

以下の例では、 `UnGungseo.ttf` と `gulim.ttf`を使用しています。これらは Overleaf プロジェクトにアップロードされています。

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

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

\begin{document}

\section{紹介}
文書全体に関する基本情報を紹介する段落。

\begin{verbatim}
これは、そのままスペーシング方法を参照し、フォントをテストします
\end{verbatim}

ラテン文字も使用できます。

\end{document}
```

[この XeLaTeX と xeCJK の例を 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=)

この例では次の出力が生成されます:

![pdfTeX を使って韓国語を組版する](/files/8202f6220b8c61361f3b0ba9c4d2026146e7b683)

## pdfLaTeX を使った韓国語文書の組版

もしあなたのワークフロー上であなたが *必要があるなら* pdfLaTeX を使う必要があり XeLaTeX を使えないなら、 `CJKutf8` パッケージを pdfLaTeX と一緒に使用できます。例を示します:

```latex
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{mj}
 文書全体に関する基本情報を紹介する段落。

 \begin{verbatim}
 これは、そのままスペーシング方法を参照し、フォントをテストします
 \end{verbatim}
\end{CJK}

ラテン文字も使用できます。
\end{document}
```

[この `CJKuft8` パッケージの例を 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)

この例では次の出力が生成されます:

![CJKuft8 を使った韓国語の組版](/files/42c5ee27b399f78909a16c1d7bc01e28327278cb)

韓国語テキストを入力するには、 `CJK` 環境を使用しなければならないことに注意してください:

`\begin{CJK}{UTF8}{mj}`は `CJK` 環境を開始します。環境宣言に渡される最初の引数は文字エンコーディングです。Overleaf 上では `UTF8` のみを使用してください。Overleaf 上のすべてのテキストファイルは UTF8 だからです。2 番目の引数は使用するフォントファミリで、韓国語には `mj` を使用します。

## さらに読む

詳細については

* [Overleaf で利用できる韓国語書体の一覧](/latex/ja/to-2/85-which-otf-or-ttf-fonts-are-supported-via-fontspec.md#korean)
* [XƎLaTeX による現代フォントのサポート](/latex/ja/fonto/03-xelatex.md)
* [引用と引用符の組版](/latex/ja/yan-yu/04-typesetting-quotations.md)
* [国際言語サポート](/latex/ja/yan-yu/03-international-language-support.md)
* [中国語](/latex/ja/yan-yu/06-chinese.md)
* [フランス語](/latex/ja/yan-yu/07-french.md)
* [ドイツ語](/latex/ja/yan-yu/08-german.md)
* [ギリシャ語](/latex/ja/yan-yu/09-greek.md)
* [イタリア語](/latex/ja/yan-yu/10-italian.md)
* [日本語](/latex/ja/yan-yu/11-japanese.md)
* [アラビア語](/latex/ja/yan-yu/05-arabic.md)
* [ポルトガル語](/latex/ja/yan-yu/13-portuguese.md)
* [ロシア語](/latex/ja/yan-yu/14-russian.md)
* [スペイン語](/latex/ja/yan-yu/15-spanish.md)
* [LaTeX2εへのそれほど短くない入門](http://www.ctan.org/tex-archive/info/lshort/)
* [WikiBooks の LaTeX/Internationalization](http://en.wikibooks.org/wiki/LaTeX/Internationalization)
* [WikiBooks の LaTeX/Special\_Characters](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/ja/yan-yu/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.
