Showing first {{hits.length}} results of {{hits_total}} for {{searchQueryText}}{{hits.length}} results for {{searchQueryText}}

Ingen Søge Resultater

Different packages exist to support Japanese typesetting for various LaTeX engines, though not all packages fully support all Japanese typesetting conventions e.g. vertical typesetting. This help article briefly outlines how to typeset Japanese with pdfLaTeX, XƎLaTeX, pTeX and LuaLaTeX.


Contents

[edit] CJKutf8 package with pdfLaTeX

The CJKutf8 package is sufficient if you would like to compile with pdfLaTeX.

\documentclass{article}
 
\usepackage{CJKutf8}
 
\begin{document}
 
\begin{CJK}{UTF8}{min}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
 
フォントはまた、数学的な形態および他の環境で使用することができる
\end{CJK}
 
\bigskip
 
Outside the environment Latin characters may be used.
 
\end{document}

JapaneseEx2.png

The line \usepackage{CJKutf8} imports CJKutf8 which enables utf8 encoding for Chinese, Japanese and Korean characters.

In this case every block of Japanese text must be typed inside a \begin{CJK*}{UTF8}{min} environment. In this environment UTF8 is the encoding and min (Mincho family) is the font to be used. You can replace "min" with "goth" to use the Gothic family; however CJKutf8 and pdfLaTeX are not capable of easily using other fonts.

  Open an example in Overleaf


[edit] xeCJK package with XeLaTeX

XƎLaTeX offers the possibility of using OpenType and TrueType fonts, and the xeCJK package provides support for Chinese, Japanese and Korean typesetting.

\documentclass{article}
 
\usepackage{xeCJK}
\setCJKmainfont{IPAMincho}
\setCJKsansfont{IPAGothic}
\setCJKmonofont{IPAGothic}
 
 
\begin{document}
 
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
 
フォントはまた、数学的な形態および他の環境で使用することができる
 
\bigskip
 
And you can also use Latin characters within your Japanese document.
 
\bigskip
 
\begin{verbatim}
このテキストは、別のフォントを持つことになります
 
This is a verbatim environment with mono-space font
\end{verbatim}
 
\end{document}

JapaneseEx3.png

Below is a description of each command:

\usepackage{xeCJK}
This includes the package xeCJK which allows to use Chinese, Japanese and Korean fonts in a document to be compiled with XƎLaTeX. (See this article for help on setting your Overleaf project's compiler.)
\setCJKmainfont{IPAMincho}
The main font of this document. You can either download a font and put it in your current working directory or use one of the fonts already installed in your system.
\setCJKsansfont{IPAGothic}
Font to be used in elements that require the sans family font.
\setCJKmonofont{IPAGothic}
Font to be used in elements that require the monospace family font. In the example the text inside the verbatim environment uses this font.

  Open an example in Overleaf

[edit] The pTeX engine

Many journals and conference proceedings published in Japan use a specific Japanese LaTeX distribution pLatex, based on the jsarticle or jsbook document classes. pLaTeX supports many Japanese typesetting conventions, including vertical typesetting. A typical document might look like this:

\documentclass{jsarticle}
\bibliographystyle{jplain}
 
\begin{document}
 
本稿では、文書組版システムp\LaTeX{}の使い方を解説します。p\LaTeX{}を利用するときには、
あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots
 
\section{導入}
こんにちは世界!
\end{document}

To compile pLaTeX documents on Overleaf, you'll need to set your project's compiler setting to "LaTeX", and then add a file named latemkrc (no file extensions) to your project, containing the following lines:

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


[edit] luatex-ja package bundle with LuaLaTeX

The luatex-ja package bundle is a relatively new effort to port pTeX's typesetting capabilities to LuaLaTeX, to leverage LuaLaTeX's scripting engine and OTF/TTF support. (Remember to set your project's compiler to LuaLaTeX.) The easiest way to use it is by loading the ltjbook, ltjarticle or ltjreport document class:

\documentclass{ltjarticle}
 
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
 
フォントはまた、数学的な形態および他の環境で使用することができる
\end{document}

Or if you would like to use a different document class, then you can load the luatex-ja package instead, like this:

\documentclass{scrartcl}
\usepackage{luatexja}
 
\begin{document}
\section{これは最初のセクションである}
日本語で \LaTeX の組版を実証するための導入部分。
 
フォントはまた、数学的な形態および他の環境で使用することができる
\end{document}

To load your own preferred fonts for the Japanese text, you'll also need the luatexja-fontspec package:

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

See the luatex-ja package documentation for its other (very extensive) Japanese typesetting features and customisations.


[edit] Further reading

For more information see

[edit] Overleaf guides

[edit] LaTeX Basics

[edit] Mathematics

[edit] Figures and tables

[edit] References and Citations

[edit] Languages

[edit] Document structure

[edit] Formatting

[edit] Fonts

[edit] Presentations

[edit] Commands

[edit] Field specific

[edit] Class files

[edit] Advanced TeX/LaTeX