CJK (pdfLaTeX / XeLaTeX)

The pTeX-based route (pLaTeX/upLaTeX) and LuaLaTeX-ja are not the only ways to set Japanese. When you must use pdfLaTeX or XeLaTeX — a class that requires them, or a multilingual CJK document — there are dedicated packages: the venerable CJK package (for pdfLaTeX) and xeCJK (for XeLaTeX). This page covers how to use them and when they make sense.

CJK on pdfLaTeX — the CJK package

The CJK package (Werner Lemberg, since around 1989) lets pdfLaTeX set Chinese/Japanese/Korean text. You wrap text in a CJK/CJK* environment with an encoding and font family: \begin{CJK}{UTF8}{min} … \end{CJK} (for UTF-8, loading CJKutf8 is easiest), and switch families with \CJKfamily{...}. The package is in maintenance mode and largely past its prime, though — modern LuaTeX/XeTeX/upTeX handle Unicode and CJK natively and better. For more natural Japanese on pdfLaTeX, BXcjkjatype (by ZR), built on top of CJK, improves whole-document handling and spacing.

latex
% pdfLaTeX + CJK パッケージ
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{min}
日本語のテキスト。
\end{CJK}
\end{document}

CJK on XeLaTeX — xeCJK / ZXjatype

XeLaTeX can use the system’s OpenType/TrueType fonts directly, and xeCJK adds CJK typesetting. Set Japanese fonts with \setCJKmainfont{...}, \setCJKsansfont{...}, and \setCJKmonofont{...} (IPAex Mincho, Noto CJK, …). On top of that, ZXjatype (by ZR) configures xeCJK for Japanese, offering \setjamainfont / \setjasansfont with Japanese-specific scaling. It is the practical route when you want XeLaTeX with system fonts.

latex
% XeLaTeX + ZXjatype(xeCJK の上に)
\usepackage{zxjatype}
\setjamainfont{IPAexMincho}
\begin{document}
日本語のテキスト。
\end{document}

Should you even use these

For serious Japanese typesetting, upLaTeX or LuaLaTeX-ja are generally the better choice, given their mature kinsoku and JFM handling. Reach for CJK/xeCJK only when you are tied to pdfLaTeX/XeLaTeX (a required class or template) or working with multilingual CJK.

  • Serious JapaneseupLaTeX or LuaLaTeX-ja (see “Japanese typesetting methods”).
  • Stuck with pdfLaTeX → the CJK package (or BXcjkjatype); somewhat legacy.
  • XeLaTeX with system fontsxeCJK + ZXjatype.