> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/latex/zh-cn/yu-yan/11-japanese.md).

# 日文

有多种不同的软件包可用于支持各种 LaTeX 引擎的日文排版，不过并非所有软件包都能完全支持所有日文排版规范，例如纵排。本文将简要介绍如何使用 pdfLaTeX、XƎLaTeX、pTeX 和 LuaLaTeX 排版日文。

## 用于 pdfLaTeX 的 CJKutf8 宏包

该 `CJKutf8` 如果你希望使用 pdfLaTeX 编译，那么该宏包就足够了。

```latex
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}

\begin{CJK}{UTF8}{min}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる
\end{CJK}

\bigskip

在环境之外可以使用拉丁字符。

\begin{CJK*}{UTF8}{goth}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる
\end{CJK*}
\end{document}
```

[在 Overleaf 中打开这个 CJKutf8 示例。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=CJKutf8+package+with+pdfLaTeX\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BCJKutf8%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7BCJK%7D%7BUTF8%7D%7Bmin%7D%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%5Cend%7BCJK%7D%0A%0A%5Cbigskip%0A%0AOutside+the+environment+Latin+characters+may+be+used.%0A%0A%5Cbegin%7BCJK%2A%7D%7BUTF8%7D%7Bgoth%7D%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%5Cend%7BCJK%2A%7D%0A%5Cend%7Bdocument%7D)

此示例会生成如下输出，展示使用两种字体族排版的日文文本：

![使用 pdfLaTeX 和 CJKutf8 宏包的日文排版示例](/files/955d75c7919b0b6eaf897fb78d306fce1fc32563)

这一行 `\usepackage{CJKutf8}` 会导入 `CJKutf8` 它为中文、日文和韩文字符启用了 UTF8 编码。

在这种情况下，每一段日文文本都必须输入在一个 `\begin{CJK*}{UTF8}{min}` 环境中。在该环境中 `UTF8` 是编码，而 `min` （Mincho 字体族）是示例第 1 部分中要使用的字体。

如示例第 2 部分所示，你可以将 `min` 与 `goth` 替换为 Gothic 字体族；不过， `CJKutf8` 和 pdfLaTeX 并不容易使用其他字体。

## 配合 XeLaTeX 的 xeCJK 宏包

XeLaTeX 提供了使用 OpenType 和 TrueType 字体的可能性，而 `xeCJK` 宏包为中文、日文和韩文排版提供支持。

```latex
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{IPAMincho}
\setCJKsansfont{IPAGothic}
\setCJKmonofont{IPAGothic}
\begin{document}

\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる

\bigskip

你也可以在日文文档中使用拉丁字符。

\bigskip

\begin{verbatim}
このテキストは、別のフォントを持つことになります

这是一个使用等宽字体的逐字环境。
\end{verbatim}
\end{document}
```

[在 Overleaf 中打开这个 xeCJK 示例。](https://www.overleaf.com/docs?engine=xelatex\&snip_name=xeCJK+package+with+XeLaTeX\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BxeCJK%7D%0A%5CsetCJKmainfont%7BIPAMincho%7D%0A%5CsetCJKsansfont%7BIPAGothic%7D%0A%5CsetCJKmonofont%7BIPAGothic%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%0A%5Cbigskip%0A%0AAnd+you+can+also+use+Latin+characters+within+your+Japanese+document.%0A%0A%5Cbigskip%0A%0A%5Cbegin%7Bverbatim%7D%0A%E3%81%93%E3%81%AE%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%AF%E3%80%81%E5%88%A5%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%92%E6%8C%81%E3%81%A4%E3%81%93%E3%81%A8%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%0A%0AThis+is+a+verbatim+environment+using+a+monospaced+font.%0A%5Cend%7Bverbatim%7D%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![使用 xeCJK 宏包和 XeLaTeX 的日文排版示例](/files/33265f94f4f7853b9ccf10acc9fa73e5884032ed)

下面是每条命令的说明：

* `\usepackage{xeCJK}`：这包括宏包 `xeCJK` ，它允许在使用 XeLaTeX 编译的文档中使用中文、日文和韩文字体。参见 [这篇文章](/latex/zh-cn/geng-duo-zhu-ti/08-choosing-a-latex-compiler.md) 以获取设置 Overleaf 项目编译器的帮助。
* `\setCJKmainfont{IPAMincho}`：设置此文档所使用的主字体。
* `\setCJKsansfont{IPAGothic}`：设置需要无衬线字体的元素所使用的字体。
* `\setCJKmonofont{IPAGothic}`：设置需要等宽字体的元素所使用的字体。在示例中， `verbatim` 环境中的日文文本使用了这个字体。

### 使用 Google Noto 字体

由于适用于 CJK 排版的 Google Noto 字体存放在 Overleaf 的服务器上，我们可以用它们来复现前面的示例。

```latex
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Noto Serif CJK JP}
\setCJKsansfont{Noto Sans CJK JP}
\setCJKmonofont{Noto Sans Mono CJK JP}
\begin{document}

\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる

\bigskip

你也可以在日文文档中使用拉丁字符。

\bigskip

\begin{verbatim}
このテキストは、別のフォントを持つことになります

这是一个使用等宽字体的逐字环境。
\end{verbatim}
\end{document}
```

[在 Overleaf 中打开这个 xeCJK 示例。](https://www.overleaf.com/docs?engine=xelatex\&snip_name=xeCJK+package+with+XeLaTeX+and+Google+Noto+fonts\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7BxeCJK%7D%0A%5CsetCJKmainfont%7BNoto+Serif+CJK+JP%7D%0A%5CsetCJKsansfont%7BNoto+Sans+CJK+JP%7D%0A%5CsetCJKmonofont%7BNoto+Sans+Mono+CJK+JP%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%0A%5Cbigskip%0A%0AAnd+you+can+also+use+Latin+characters+within+your+Japanese+document.%0A%0A%5Cbigskip%0A%0A%5Cbegin%7Bverbatim%7D%0A%E3%81%93%E3%81%AE%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%AF%E3%80%81%E5%88%A5%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%92%E6%8C%81%E3%81%A4%E3%81%93%E3%81%A8%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%0A%0AThis+is+a+verbatim+environment+using+a+monospaced+font.%0A%5Cend%7Bverbatim%7D%0A%5Cend%7Bdocument)

此示例生成如下输出：

![在 Overleaf 上使用 Google Noto 字体排版日文文本](/files/7fd6bb0f6738eba0be28f566e77baa638b79b6dc)

## pTeX 引擎

日本许多期刊和会议论文集使用一种特定的日文 LaTeX 发行版，称为 [pLaTeX](https://ctan.org/pkg/platex?lang=en)，它基于 [`jsarticle` 或 `jsbook` 文档类](https://ctan.org/pkg/jsclasses)。pLaTeX 支持许多日文排版规范，包括纵排。

### 在 Overleaf 中使用 pLaTeX

尽管 pLaTeX 没有被列为 Overleaf 中可由用户选择的编译器， **编译器** 下拉菜单：

![Overleaf 支持的编译器列表](/files/689c296f23bbd8e77a775427f5608bf96bf626ff)

但可以通过向你的项目添加一个小的配置文件来将 Overleaf 设置为使用 pLaTeX：该文件名为 [`latexmkrc`](/latex/zh-cn/shen-du-wen-zhang/28-how-to-use-latexmkrc-with-overleaf.md)。步骤如下：

1. [将项目的编译器设置为](/latex/zh-cn/zhi-shi-ku/026-changing-compiler.md) 更改为 **LaTeX**
2. 添加一个新的空文件，名为 `latexmkrc` （无文件扩展名）到你的项目中
3. 将以下行添加到 `latexmkrc`:

```perl
$latex = 'platex';
$bibtex = 'pbibtex';
$dvipdf = 'dvipdfmx %O -o %D %S';
$makeindex = 'mendex %O -o %D %S';
```

如果你使用的是为 `uplatex` 设计的模板，那么请将 `platex` 更改为 `uplatex`，以及 `pbibtex` 更改为 `upbibtex`.

下面的清单展示了一个基本的 pLaTeX 文档以及用于在 Overleaf 上编译它的一个 `latexmkrc` 文件。使用清单下方的链接可在 Overleaf 中打开这些文件。

**`pLaTeX-example.tex`**

```latex
\documentclass{jsarticle}
\bibliographystyle{jplain}
\title{A pLaTeX example}
\begin{document}

本稿では、文書組版システムp\LaTeX{}の使い方を解説します。p\LaTeX{}を利用するときには、
あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots

\section{導入}
こんにちは世界！
\end{document}
```

**`latexmkrc`**

```latex
$latex = 'platex';
$bibtex = 'pbibtex';
$dvipdf = 'dvipdfmx %O -o %D %S';
$makeindex = 'mendex %O -o %D %S';
```

[在 Overleaf 中打开这个 pLaTeX 项目。](https://www.overleaf.com/docs?engine=latex_dvipdf\&snip_name\[]=pLaTeX-example.tex\&snip\[]=%5Cdocumentclass%7Bjsarticle%7D%0A%5Cbibliographystyle%7Bjplain%7D%0A%5Ctitle%7BA+pLaTeX+example%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%E6%9C%AC%E7%A8%BF%E3%81%A7%E3%81%AF%E3%80%81%E6%96%87%E6%9B%B8%E7%B5%84%E7%89%88%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0p%5CLaTeX%7B%7D%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9%E3%82%92%E8%A7%A3%E8%AA%AC%E3%81%97%E3%81%BE%E3%81%99%E3%80%82p%5CLaTeX%7B%7D%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%81%8D%E3%81%AB%E3%81%AF%E3%80%81%0A%E3%81%82%E3%82%89%E3%81%8B%E3%81%98%E3%82%81%E6%96%87%E7%AB%A0%E4%B8%AD%E3%81%AB%5CTeX%7B%7D%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A8%E5%91%BC%E3%81%B0%E3%82%8C%E3%82%8B%E7%B5%84%E7%89%88%E7%94%A8%E3%81%AE%E6%8C%87%E7%A4%BA%E3%82%92%E6%B7%B7%E5%9C%A8%E3%81%95%E3%81%9B%5Cldots%0A%0A%5Csection%7B%E5%B0%8E%E5%85%A5%7D%0A%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%EF%BC%81%0A%5Cend%7Bdocument%7D\&snip_name\[]=latexmkrc\&snip\[]=%24latex+%3D+%27platex%27%3B%0A%24bibtex+%3D+%27pbibtex%27%3B%0A%24dvipdf+%3D+%27dvipdfmx+%25O+-o+%25D+%25S%27%3B%0A%24makeindex+%3D+%27mendex+%25O+-o+%25D+%25S%27%3B\&main_document=pLaTeX-example.tex)

此示例生成如下输出：

![在 Overleaf 中使用 pLaTeX 排版日文的示例](/files/bbced633c9ade7a7fc6bbe7e1df14892c5653bbf)

## 与 LuaLaTeX 配合使用的 luatex-ja 宏包集合

该 [luatex-ja](https://www.ctan.org/pkg/luatexja) 宏包集合是一项相对较新的工作，旨在将 pTeX 的排版能力移植到 LuaLaTeX，以充分利用 LuaLaTeX 的脚本引擎和 OTF/TTF 支持。（记得将 [将项目的编译器设置为 LuaLaTeX](/latex/zh-cn/geng-duo-zhu-ti/08-choosing-a-latex-compiler.md)。）最简单的使用方法是加载 `ltjbook`, `ltjarticle` 或 `文档类：` \documentclass{ltjarticle}

```latex
以及在 Overleaf 上的 LuaLaTeX 示例。
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる
\end{document}
```

[打开此 `ltjarticle` 以及在 Overleaf 上的 LuaLaTeX 示例。](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Using+ltjarticle+and+LuaLaTeX\&snip=%5Cdocumentclass%7Bltjarticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 Overleaf 中使用 LuaLaTeX 和 ltjarticle 文档类排版日文](/files/113a95f20d57a4d78ce25bd0fb2e85e03d075a5c)

或者，如果你想使用不同的文档类，则可以改用加载 `luatex-ja` 宏包，如下所示：

```latex
\documentclass{scrartcl}
\usepackage{luatexja}
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる
\end{document}
```

[打开此 `luatex-ja` 以及在 Overleaf 上的 LuaLaTeX 示例。](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Using+luatex-ja+and+LuaLaTeX\&snip=%5Cdocumentclass%7Bscrartcl%7D%0A%5Cusepackage%7Bluatexja%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![在 Overleaf 中使用 LuaLaTeX 和 luatex-ja 排版日文](/files/8ff2f02dd384a1e85c26b8b6d785f71a1b3204ef)

若要为日文文本加载你自己偏好的字体，你还需要 `luatexja-fontspec` 宏包的示例代码：

```latex
\usepackage[match]{luatexja-fontspec}
\setmainjfont{TakaoMincho}
\setsansjfont{TakaoGothic}
\setmonojfont{Komatuna}
```

请参见 [luatex-ja 宏包文档](http://texdoc.net/pkg/luatexja) 以了解其其他（非常丰富的）日文排版功能和自定义选项。

## jlreq 类

该 `[jlreq](https://www.ctan.org/pkg/jlfeq)` 类是用于排版日文文档的较新选择。你只需将 `jlreq` 设为文档类，但它要求使用 [LuaLaTeX](/latex/zh-cn/geng-duo-zhu-ti/08-choosing-a-latex-compiler.md), [pLaTeX 或 upLaTeX](#the-ptex-engine) 作为编译器。

```latex
\documentclass{jlreq}
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。

フォントはまた、数学的な形態および他の環境で使用することができる
\end{document}
```

[打开此 `jlreq` 以及在 Overleaf 上的 LuaLaTeX 示例。](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Using+jlreq+and+LuaLaTeX\&snip=%5Cdocumentclass%7Bjlreq%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7B%E3%81%93%E3%82%8C%E3%81%AF%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E3%81%82%E3%82%8B%7D%0A%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%A7+%5CLaTeX+%E3%81%AE%E7%B5%84%E7%89%88%E3%82%92%E5%AE%9F%E8%A8%BC%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AE%E5%B0%8E%E5%85%A5%E9%83%A8%E5%88%86%E3%80%82%0A%0A%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%81%AF%E3%81%BE%E3%81%9F%E3%80%81%E6%95%B0%E5%AD%A6%E7%9A%84%E3%81%AA%E5%BD%A2%E6%85%8B%E3%81%8A%E3%82%88%E3%81%B3%E4%BB%96%E3%81%AE%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%0A%5Cend%7Bdocument%7D)

此示例生成如下输出：

![使用 jlreq 文档类在 Overleaf 上排版的日文文本](/files/bfea571d0b79015bc452595ea5d2cc45f98eb811)

Overleaf Gallery 中包含一个演示 `jlreq` 和 LuaLaTeX 的模板，你可以 [在此打开](https://www.overleaf.com/latex/templates/ri-ben-yu-japanese-jlreq/jjkkyvjjvvgk)。 `jlreq` 宏包文档包含有关 [日文排版功能](http://mirrors.ctan.org/macros/jptex/latex/jlreq/jlreq-ja.pdf) 以及所提供自定义选项的详细信息。

## 进一步阅读

更多信息请参见

* [在 XƎLaTeX 中支持现代字体](/latex/zh-cn/zi-ti/03-xelatex.md)
* [Latex-questions/Overleaf 是否支持 pTeX？](/latex/zh-cn/wen-da/09-does-overleaf-support-ptex.md)
* [引号和引号符号的排版](/latex/zh-cn/yu-yan/04-typesetting-quotations.md)
* [国际语言支持](/latex/zh-cn/yu-yan/03-international-language-support.md)
* [中文](/latex/zh-cn/yu-yan/06-chinese.md)
* [法语](/latex/zh-cn/yu-yan/07-french.md)
* [德语](/latex/zh-cn/yu-yan/08-german.md)
* [希腊语](/latex/zh-cn/yu-yan/09-greek.md)
* [意大利语](/latex/zh-cn/yu-yan/10-italian.md)
* [阿拉伯语](/latex/zh-cn/yu-yan/05-arabic.md)
* [韩语](/latex/zh-cn/yu-yan/12-korean.md)
* [葡萄牙语](/latex/zh-cn/yu-yan/13-portuguese.md)
* [俄语](/latex/zh-cn/yu-yan/14-russian.md)
* [西班牙语](/latex/zh-cn/yu-yan/15-spanish.md)
* [LaTeX2ε 的不算太短的介绍](http://www.ctan.org/tex-archive/info/lshort/)
* [WikiBooks 上的 LaTeX/国际化](http://en.wikibooks.org/wiki/LaTeX/Internationalization)
* [WikiBooks 上的 LaTeX/特殊字符](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://ayakaleaf-pro.ayaka.space/latex/zh-cn/yu-yan/11-japanese.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.
