pTeX family

The pTeX family is a lineage of TeX engines built for Japanese typesetting. It begins with ASCII Corporation’s pTeX, continues through the Unicode-aware upTeX, the e-TeX-merged e-pTeX / e-upTeX, and the modernizing pTeX-ng. This line has carried the work that European-oriented pdfTeX cannot do: vertical writing, kinsoku line-breaking, and Japanese font metrics.

The big picture in one line: the standard modern Japanese pipeline is **uplatex (the e-upTeX engine inside) → dvipdfmx → PDF, and the pTeX family’s output is DVI**, not PDF — the decisive difference from pdfTeX and LuaTeX, which emit PDF directly. The four engines follow below in turn.

pTeX (ASCII pTeX)

pTeX (publishing TeX, also “ASCII pTeX”) is the engine that ASCII Corporation built to make a Japanese TeX fit for commercial publishing. Plain TeX was designed to set European glyphs one byte at a time and lacks the rules of Japanese typesetting entirely. pTeX wove the low-level machinery needed to set Japanese directly into TeX’s internals.

Central to it is the notion of writing direction. pTeX handles **vertical writing (\tate) and horizontal writing (\yoko)** at the engine level, so the same body text can be set either way. This was indispensable for Japanese publishing — novels, newspapers, textbooks — where vertical setting is the norm.

Underpinning Japanese spacing and line composition is JFM (Japanese Font Metric). Separate from the European TFM, it records the width, height, and depth of Japanese glyphs and the space (glue/kern) that belongs between characters. With it, pTeX automatically distinguishes full-width and half-width forms, inserts the right gaps around punctuation, and supplies the space between Japanese and Western text (the quarter-em gap) where the two scripts meet.

pTeX also performs Japanese kinsoku (line-breaking prohibition) inside the engine: characters that may not begin a line (、。」 …) or end one (「( …) are pushed forward or pulled back by fine adjustments to the spacing. Ruby (reading glosses) itself is the job of macros and packages, but the precise character placement it rests on is provided by pTeX. None of these rules exist in European pdfTeX, which is exactly why a dedicated engine is needed.

pTeX’s weak point was character encoding. Its internal code was EUC-JP or Shift_JIS (chosen via -kanji-internal), and input assumed legacy encodings — JIS, Shift_JIS, EUC. The kanji it could handle were essentially bound to the JIS range, so characters outside JIS and multilingual CJK were awkward. The format that puts LaTeX on top of the pTeX engine is **platex** (pLaTeX), long the standard for Japanese papers.

upTeX (Unicode pTeX)

upTeX (Unicode pTeX) is the engine Takuji Tanaka has developed since 2007, recasting pTeX around Unicode internally. Its input, output, and internal processing are built on UTF-8 / Unicode, freeing it from the encoding limits that were pTeX’s greatest headache.

As a result it handles a far wider range of kanji than the JIS box, and can set multiple CJK scripts at once — not only Japanese but Chinese (simplified and traditional) and Korean (Hangul). upTeX classifies characters by kind (kanji, kana, Hangul, CJK symbols, …) through \kcatcode, giving fine control over what range is treated as Japanese text.

In practice, this freedom from encoding hassle was decisive. The format that puts LaTeX on upTeX is **uplatex** (upLaTeX), and much modern Japanese work has moved to it from pLaTeX. Compatibility with pTeX is high, so most pLaTeX-era assets carry over nearly unchanged.

e-pTeX / e-upTeX

e-pTeX is pTeX merged with the e-TeX extensions; e-upTeX is upTeX merged with them. e-TeX is an extended TeX implementation that adds arithmetic such as \numexpr, \protected, the groundwork for bidirectional typesetting, and a larger pool of registers. Many modern LaTeX packages assume these e-TeX features, so the extension is indispensable in Japanese setups too.

This is the most important practical point. **Today platex actually runs on e-pTeX, and uplatex runs on e-upTeX. So when you say pLaTeX or upLaTeX, what runs underneath is not pure pTeX/upTeX but the e-TeX-extended build. This is the de facto default configuration for Japanese in TeX Live** (2026 is current).

Maintenance today is carried by the Japanese TeX Development Community (texjporg), which keeps the pTeX-family engines, formats, and JFMs in continuous repair.

A minimal upLaTeX example

Here is a minimal Japanese document for upLaTeX. \documentclass{ujarticle} is upLaTeX’s horizontal-writing class (use utarticle for vertical; the jlreq class is a strong modern choice). Save the source as UTF-8.

document.tex
\documentclass{ujarticle}
\begin{document}
こんにちは、\LaTeX。日本語が美しく組めます。
数式も書けます: \[ E = mc^2 \]
\end{document}

Compilation takes two stages. First uplatex processes the .tex into a DVI; then dvipdfmx converts the DVI into a PDF. The pTeX family does not emit PDF directly, so this dvipdfmx step is always required (and uplatex is typically run twice so cross-references and the table of contents resolve).

console
$ uplatex document.tex
$ dvipdfmx document.dvi
# => document.pdf

pTeX-ng (new generation / Asiatic pTeX)

pTeX-ng (“ng” = new generation) is a relatively recent reimplementation effort by Clerk Ma, also known by its command name ApTeX (Asiatic pTeX). It aims to modernize the pTeX lineage, supporting all e-TeX, pTeX, and upTeX primitives to stay highly compatible with e-upTeX while extending its internals to Unicode (up to 0x10FFFF).

What stands out technically is direct PDF output. pTeX-ng embeds libdpx — a library form of dvipdfmx — as its output backend, performing page breaks and character output through direct calls to libdpx’s C functions, so it can produce PDF without running dvipdfmx separately. That said, pTeX-ng is more experimental and less widely deployed than e-upTeX. For everyday Japanese typesetting, the default remains e-upTeX (uplatex).

The engines compared

Lining the four engines up by internal encoding, whether they include the e-TeX extensions, and the format that runs on each:

EngineInternal encodinge-TeXDefault format
pTeXEUC / Shift_JISNopLaTeX (legacy)
upTeXUnicode (UTF-8)NoupLaTeX (legacy)
e-pTeXEUC / Shift_JISYespLaTeX (current)
e-upTeXUnicode (UTF-8)YesupLaTeX (current)
pTeX-ng / ApTeXUnicode (to 0x10FFFF)Yese-upTeX compatible

Where it sits among the Japanese routes

There are three broad routes for Japanese today: the pTeX family (uplatexdvipdfmx, this page); the LuaTeX route (LuaTeX with LuaTeX-ja — direct PDF, system fonts, Lua extensibility); and the XeTeX route (XeTeX with xeCJK — direct PDF, system fonts).

  • Output. The pTeX family emits DVI (needs dvipdfmx to become PDF). pdfTeX, LuaTeX, and XeTeX emit PDF directly.
  • Fonts. The pTeX family is traditionally JFM-based; LuaTeX-ja and XeTeX let you name the system’s OpenType fonts directly.
  • Speed and track record. The pTeX family (e-upTeX) is fast, mature, and has a long record of Japanese typesetting quality.
  • Starting fresh. If you value Unicode, system fonts, and future-proofing, LuaLaTeX (LuaTeX-ja) is a strong alternative.

In sum: **for proven, stable Japanese papers, e-upTeX (uplatex) → dvipdfmx; for system fonts and modern machinery, LuaLaTeX** — that is the current settling point. Which engine to choose is covered in detail on the “Choosing an engine” page.