Download The LuaTeX-ja package
Transcript
Table 4. \kcatcode in upTEX \kcatcode meaning control word 15 16 17 18 19 non-cjk kanji kana other hangul Y Y N Y widow penalty∗ (treated as usual LATEX) Y Y N Y linebreak ignored ignored ignored space Part II Reference 5 \catcode in LuaTEX-ja 5.1 Preliminaries: \kcatcode in pTEX and upTEX In pTEX and upTEX, the value of \kcatcode determines whether a Japanese character can be used in a control word. For the detail, see Table 4. \kcatcode can be set by a row of JIS X 0208 in pTEX, and generally by a Unicode block3 in upTEX. So characters which can be used in a control word slightly differ between pTEX and upTEX. 5.2 Case of LuaTEX-ja The role of \kcatcode in pTEX and upTEX caan be divided into the following four kinds, and LuaTEX-ja can control these four kinds separately: • Distinction between JAchar or ALchar is controlled by using the character range, see Subsection 4.1. • Whether the character can be used in a control word is controlled by setting \catcode to 11 (enabled) or 12 (disabled), as usual. • Whether jcharwidowpenalty can be inserted before the character is controlled by the lowermost bit of the kcatcode parameter. • Ignoring linebreak after a JAchar is always ignored. Default setting of \catcode of LuaTEX can be found in luatex-unicode-letters.tex, which is based on unicode-letters.tex (for XETEX). However, the default setting of \catcode differs between XETEX and LuaTEX, by the following reasons: • luatex-unicode-letters.tex is based on old unicode-letters.tex. • The latter half of unicode-letters.tex sets \catcode of Kanji and kana characters to 11, via setting \XeTeXcharclass. However, this latter half is simply omitted in luatex-unicode-letters.tex, hence \catcode of Kanji and kana characters remains 12 in LuaTEX. In other words, Kanji nor kana characters cannot be used in a control word, in the default setting of LuaTEX. This would be inconvenient for pTEX users to shifting to LuaTEX-ja, since several control words containing Kanji, such as \西暦, are used in pTEX. Hence, LuaTEX-ja have a counterpart of unicode-letters.tex for LuaTEX, to match the \catcode setting with that of X TEX. E 3 upTEX divides U+FF00–U+FFEF (Halfwidth and Fullwidth Forms) into three subblocks, and \kcatcode can be set by a subblock. 15