jlreq

jlreq is a Japanese document class by Noriyuki Abe. Its name comes from its goal: to typeset according to the W3C technical note “Requirements for Japanese Text Layout” (JLReq / 日本語組版処理の要件). Its defining strength is that you can design the *hanmen* — the text block where the body is set — precisely, in numbers. It runs identically on pLaTeX, upLaTeX, or LuaLaTeX. This page covers what jlreq is for, how its options design the text block, and when to choose it over the js-based classes.

What jlreq is

jlreq is a class that lets you begin serious Japanese typesetting from a single line, \documentclass{jlreq}. The standard it is named after — JLReq, “Requirements for Japanese Text Layout” — is a W3C technical note describing what is needed to set Japanese correctly in technologies like CSS and e-books. Built mainly on the Japanese Industrial Standard JIS X 4051 (formatting rules for Japanese documents), it goes as far as hanmen (text-block) design guidance — how to handle headings, figures and tables, notes, and reference marks. The jlreq class is an effort to realize those requirements in LaTeX.

Its other pillar is being engine-agnostic. jlreq runs both on the traditional pLaTeX / upLaTeX (the route that makes a DVI and converts it to PDF with dvipdfmx) and on the modern LuaLaTeX (LuaTeX-ja) (which outputs PDF directly). The class auto-detects which engine is processing it, so you can switch processors without touching the manuscript. To force a choice, pass platex, uplatex, or lualatex as a class option (XeLaTeX is not supported).

Why jlreq (vs the js-classes)

Haruhiko Okumura’s jsclasses (jsarticle and friends) are designed around a well-tuned default look that you take as given, and they set type beautifully out of the box in most situations. jlreq takes the opposite stance: its focus is on letting you design the text block itself. “Body text at so many points, so many characters per line, so many lines per page, this much line spacing, these top/bottom/spine margins” — you specify each of these page-design dimensions yourself, grounded in the standard.

So jlreq shines when you must meet a prescribed trim size, line length, and line count exactly — typesetting a book or a self-published work, a vertically set piece, or a submission with mandated text-block dimensions. Conversely, if you simply want a paper finished quickly in a tidy default style, the jsclasses (or their LuaLaTeX edition, ltjsclasses) are often enough. jlreq ships as standard with current TeX Live, so no separate installation is needed.

Basic options and font size

You switch the kind of document with bracketed options. The default behaves like article; pass report for a report with chapters (\chapter), or book for a book-like document. (Note that, unlike the jsclasses, the class name is not split per type — you **switch a single jlreq via options**.) Add tate for vertical writing. Set the paper with paper=: paper=a4, paper=b5 (ISO B; for JIS B use forms like b5j), or an explicit size such as paper={148mm,210mm}.

Think of the Latin and Japanese sizes separately. fontsize= is the base Latin size (default 10pt) and jafontsize= is the Japanese size. There is also jafontscale=, which gives the ratio between them directly and defaults to 1 (Japanese and Latin at the same size). jlreq also accepts the publishing units Q and H (*kyū* and *ha*), so you can write, for example, fontsize=13Q (1 Q = 1 H = 0.25 mm).

OptionMeaningDefault
article / report / bookSwitch document type (chapters, layout)article-like
tateVertical writingHorizontal
platex / uplatex / lualatexForce the engine (normally auto-detected)Auto-detected
paper=Paper size: a4, b5, {w,h}, etc.
fontsize=Base Latin font size (Q/H allowed)10pt
jafontsize= / jafontscale=Japanese size / Japanese-to-Latin ratioratio 1

Designing the text block

The heart of jlreq is text-block design. You fix the rectangular region where the body is set (the *hanmen*) by one of two approaches. One works from the inside out: give the font size and line spacing, the line length, and the number of lines per page, and the margins fall out as a result — using line_length= (length of a line), number_of_lines= (lines per page), and baselineskip= (line spacing). The other works from the outside in: give the top (head_space=), bottom (foot_space=), spine (gutter=), and fore-edge (fore-edge=) margins, and those fix the text block.

Dedicated units help here. **zw is the width of one full-width character (zen-width) and zh** is its height (zen-height), so you can state line length and spacing naturally as “so many characters.” For instance line_length=40zw is 40 characters per line, and baselineskip=1.75zw is line spacing of 1.75 full-width characters. By default line_length is 0.75× the paper’s extent in the character direction, number_of_lines is the count that fits within 0.75× the paper’s extent in the line direction, and baselineskip is 1.7× the Japanese font size. Omit head_space and foot_space and the block is centred vertically. In two-column mode, set the gap between columns with column_gap=.

OptionMeaningDefault
line_length=Length of a line0.75× paper width
number_of_lines=Lines per pagefits 0.75× the height
baselineskip=Line spacing (pitch)1.7× Japanese size
gutter= / fore-edge=Spine (binding) / fore-edge margin
head_space= / foot_space=Top / bottom margincentred if omitted
column_gap=Gap between columns (two-column)

A vertical-writing example

Here is an A5, vertically set document whose text block is designed from the inside out. tate makes it vertical, paper=a5 sets the trim size, and the rest specifies the block in numbers: Japanese at 13 Q, 40 characters per line, 17 lines per page, and line spacing of 1.75 full-width characters. Without adding anything to the body, this one line fixes a book-like layout.

document.tex
\documentclass[
  tate,                 % 縦組み
  paper=a5,             % A5 判
  fontsize=13Q,         % 級で指定(1 級 = 0.25mm)
  line_length=40zw,     % 1 行 40 字
  number_of_lines=17,   % 1 ページ 17 行
  baselineskip=1.75zw,  % 行送り
]{jlreq}
\begin{document}
\title{雪国}
\author{川端康成}
\maketitle
国境の長いトンネルを抜けると雪国であった。
\end{document}

Process it with LuaLaTeX and you get a PDF directly, using the system fonts; process it with upLaTeX and you get a PDF via DVI. The \documentclass line is the same in either case. To make it horizontal, simply drop tate.

\jlreqsetup and finer adjustments

The text-block dimensions are set via class options, but the finer styling — notes, quotations, lists, headings — is tuned in the preamble by listing key=value pairs in **\jlreqsetup{...}**. There you can set how footnotes, side notes (\sidenote), inline interlinear notes (\warichu), and endnotes (\endnote) are rendered, the indent of quotations (quote_indent=), the line allotment of headings, and more. Commands like \NewBlockHeading and \ModifyHeading let you redesign headings themselves, and Japanese-specific commands such as \tatechuyoko (vertical-in-horizontal) and \jidori (fixed character allotment) are available too.

You need not learn all of this at once. The practical path is to fix the trim size, line length, and line count in the \documentclass options first, then add to \jlreqsetup only as needs arise. For the full list, the bundled manual (the Japanese documentation by Noriyuki Abe), opened with texdoc jlreq, is the most authoritative reference.