xeCJK 宏包

Similar documents
xeCJK 宏包

xpinyin 宏包

xeCJK 宏包

xeCJK 宏包

xeCJK 宏包

Visualize CMap


第 3 章 数 据 在 计 算 机 中 的 表 示 43 在 进 位 计 数 制 中 有 数 码 数 位 ( 位 置 ) 基 数 和 位 权 等 用 语 数 码 是 在 一 个 计 数 制 中 用 来 表 示 数 值 的 符 号 ; 数 位 是 指 数 码 在 一 个 数 中 所 处 的 位 置 ;

嘉義市政府暨附(所)屬機關電話禮貌測試實施要點

序 文 藝 社 (Society of Chinese Literature) 在 去 年 暑 假 開 始 籌 措 成 立, 二 零 一 三 年 九 月 正 式 展 開 所 有 活 動 文 藝 社 成 立 的 目 的 旨 在 讓 學 生 學 習 欣 賞 歷 代 名 篇 名 作, 其 中 以 古 典

第47回東海・北陸地区連合校長会教育研究愛知大会

ptex-ng ptex-ng ptex OpenType UTF-8 ptex-ng JIS X 4051 ptex ASCII ptex TEX Users Group ptex-ng 2012 LuaTEX Common TEX Y&Y TEX ptex

fduthesis: 复旦大学论文模板

好 樂 迪 股 份 有 限 公 北 大 分 公 臺 中 市 大 里 區 中 興 路 2 段 446 之 5 號 1 至 3 及 446 之 7 號 茗 園 歌 唱 視 聽 臺 中 市 大 里 區 永 隆 里 永 隆 八 街 178 號

lnag_ch_v2.01.doc

標準 BIG 中文字型碼表 A 0 9 B C D E F 一 乙 丁 七 乃 九 了 二 人 儿 入 八 几 刀 刁 力 匕 十 卜 又 三 下 丈 上 丫 丸 凡 久 么 也 乞 于 亡 兀 刃 勺 千 叉 口 土 士 夕 大 女 子 孑 孓 寸 小 尢 尸 山 川 工 己 已 巳 巾 干 廾

<4D F736F F D20D6D0CEC4B7A88C57B454CABF8C57CEBBD593CEC4D28EB9A0>

jsj0.nps

!"!"# # $!""%& ()*+, - ". - "/!%,0 -.! $ " $ # $ $ $ 1 %%&0/! 2(3!""% "/%,.4 "/" -." "" - 5/" - "045 /"""" # # 999$ 6:8$ :;<$ =>

第一章

(08) (08)

! " # $ % & (( %) "*+,- &.(/-) & ( 0 & 1! % " % # % & & $ % "/()%!"# (( (02-03 /(((.1/.2( 4 //). /$0 3)0%. /1/%-2 (( ) / ((0 // "*+,- &.(/-) & ( 0 & 1

2

目錄

彩圖 6 彩圖 7 彩圖 8 3

第 三 条 基 金 管 理 人 基 金 托 管 人 和 基 金 份 额 持 有 人 的 权 利 义 务, 依 照 本 法 在 基 金 合 同 中 约 定 基 金 管 理 人 基 金 托 管 人 依 照 本 法 和 基 金 合 同 的 约 定, 履 行 受 托 职 责 通 过 公 开 募 集 方 式

E170C2.PDF

研討會大綱/成果


ebook37-4

980105

) E F EF F F = = FE = F = F 5 E O E F O O O O O O O O O EFO E F 6 8cm 3cm 5cm cm 3cm 5cm cm 7 5% x + 3 x =

3!)4 +!*5")+,*" "!7 *"954#!767 ()9)"4 %7*"!76 #67:)+")5, "5 * 6*,;7 58 "%5 %77<4& =5%7>76 : 7 "5 4);,)8)+*," %7*<7,),; 58 "!7 +!*5")+,*" 67,:76

第六章 中国中等收入者调查的三个发现

!!""# $ %#" & $$ % $()! *% $!*% +,-. / 0 %%"#" 0 $%1 0 * $! $#)2 "

1 2 / 3 1 A (2-1) (2-2) A4 6 A4 7 A4 8 A4 9 A ( () 4 A4, A4 7 ) 1 (2-1) (2-2) ()

4 / ( / / 5 / / ( / 6 ( / / / 3 ( 4 ( ( 2

:;< =;< >!?%(, (-+ *$5(1 *$%* *#%0$#34 65&# *--.20$ $-.#+-317 A$#, 4%, 5* 54! >! B-3 0$5)/3#( * %* $-.# 5( *$#53 B3## *5.#7

第 7 章 下 一 代 网 际 协 议 IPv6 141 足 的 措 施 只 能 是 权 宜 之 计 (3) 路 由 表 膨 胀 早 期 IPv4 的 地 址 结 构 也 造 成 了 路 由 表 的 容 量 过 大 IPv4 地 址 早 期 为 网 络 号 + 主 机 号 结 构, 后 来 引 入

Microsoft Word - 01.DOC

<4D F736F F D BBF9D3DAB9FABCCAB6E0D3EFD6D6D3F2C3FBCCE5CFB5B5C4D6D0CEC4D3F2C3FBB5C4B1E0C2EBB4A6C0EDBCBCCAF5D2AAC7F32E646F63>


《中国小百科全书(5):技术科学》

,,,, :,,,,, ( ), ( ), ( ), ( ),,, ( CIP ) /. :, ( 21 ) ISBN F CIP ( 2005 ) : ( 17, ) :

民 國 105 年 大 專 程 度 義 務 役 預 備 軍 官 預 備 士 官 考 選 簡 章 目 錄 壹 考 選 依 據 1 貳 考 ( 甄 ) 選 對 象 1 參 資 格 規 定 1 肆 員 額 及 專 長 類 別 2 伍 報 名 及 選 填 志 願 日 期 方 式 3 陸 選 填 官 科 (

例 009 年高考 全国卷Ⅱ 理 8 如 图 直 三 棱 柱 ABC ABC 中 AB AC D E 分 别为 AA BC 的中点 DE 平面 BCC 证明 AB AC 设二面角 A BD C 为 0o 求 BC 与平面 BCD 所 成角的大小 图 - 略 证明 以 D 为坐标原点 DA DC DD

目 录 1 正 文 乊 前 目 癿 本 文 内 容 声 明 字 符 编 码 相 兰 癿 背 景 知 识 拉 丁 字 母 什 么 是 字 符 编 码 字 符 编 码 标 准... 8

!!!!"#$ " " %& ( " # " " " " " "$%%& " $%% " "!!

0B80:Tamil 泰米尔语 0C00:Telugu 泰卢固语 0C80:Kannada 埃纳德语 0D00:Malayalam 马拉雅拉姆语 0D80:Sinhala 锡兰语 0E00:Thai 泰国语 0E80:Lao 老挝语 0F00:Tibetan 西藏语 1000:Myanmar 玛雅语

WCA Regulations and Guidelines

山东轻工业学院

SIK) 者, 需 實 施 1 年 以 上, 經 體 格 檢 查 無 後 遺 症 者 5. 身 體 任 何 部 分 有 刺 青 紋 身 穿 耳 洞 者, 不 得 報 考, 各 項 檢 查 結 果 須 符 合 體 位 區 分 標 準 常 備 役 體 位 二 在 校 軍 訓 成 績 總 平 均 70 分

FY.DOC


馬偕醫學院 學生事務工作簡報

!!"#$ " # " " " " " "$%%& " $%% " "!!

「全國紡織技術論文競賽」投稿須知

! "! #!$$%!$$% &!!$$( # ) (

柳州化工股份有限公司

谚语阐因

小学7

zt

(CIP) /. :, 2004 ISBN ,. U CIP (2004) (1 : ) : * : : :

B

& ($ ) * +!"", &#!""#! +$ ) ( * +!"", - ($ ) * + % ($ ) * + * ), ($ ( # *$ ) ( + ) (. ($ / ($ ) ( * + &/ )! $!%

Microsoft Word 碩專手冊封面.doc

秘密大乘佛法(下)

國立臺東高級中學102學年度第一學期第二次期中考高一國文科試題

!! :!!??!!?!??!!!... :... :'?'?! :' ' :'?' :'?' :'!' : :? Page 2

Page 2 of 12

Microsoft Word - Sunday

鎶ョ焊0

<D2B0D0C4D3C5D1C52DC8CED6BEC7BF202D20BCC7CAC2B1BE>

Microsoft Word - 1-3陳詠琳-近代..

diagbox Package (v2.2): Making Table Heads with Diagonal Lines


7. 小 星 星 一 閃 一 閃 亮 晶 晶, 滿 天 都 是 小 星 星 ; 掛 在 天 空 放 光 明, 好 像 許 多 小 眼 睛 ; 一 閃 一 閃 亮 晶 晶, 滿 天 都 是 小 星 星

XeTeX about:fonts

Contents 1 Typing Simplified Chinese in LATEXOn Mac Way One: Using XeLaTeX Way Two: Copy localtexmf from instal

! " # " #!! $ %!!!!!!!! & ( $! $ A A *+, )2334-3E<=65 ) -. /0 1!2334/5 ) :;36:3<6<=:> 1 ) :;36:3<6<=

穨怎樣用電腦打出一分物理試題.PDF

!! "!!"#! # $ %&& ( "! )*+, " - &. - &/%%&& - 0!!$! "$! #$ - -! $$ 12.3! 4)5 %&& &.3 "3!!!!!!!!!!!! &/& - 0.&3.322!!!.! 2&& - 2/& - &362! /&&&//!!! 78

Contents 1 Typing Simplified Chinese in LATEXOn Mac Way One: Using XeLaTeX Way Two: Copy localtexmf from instal

《革命烈士诗抄续编》

<D7DCCEC4BCFE2E696E6464>

untitled

4.进度控制(网络计划)0.ppt

Microsoft Word - ch04三校.doc

1.3

56,,,,, :,, 1953,, 1953,1953,,1953,,,,,,,,, () ,30118, 34, ;,4912 %,5614 %, 1,1953, 1119, ,, , , 1111 (

epub 61-2

#$%&% () % ()*% +,-. /01 % + (/) " " " 2- %** -340 $%&% 5!$%&% () % ()*% +,-. /01 % + (/) " " " 2- %** -340 /64 7%,(8(, *--9( ()6 /-,%/,65 :$%&

cover1-4.ai

Ps22Pdf

1027 九 如 車 場 大 順 分 店 車 場 大 順 段 地 號 ( 九 如 一 路 九 如 一 路 565 巷 口 ) 89 計 時 : 平 日 20 元 最 高 80 元 假 日 30 元 最 高

#!$ %" & ( &)*+,((&-,./ )01,+2 ( /., )>2/ 80;2 +&,($ J &( > =.>? =0+ 9, *,0*., 0= )>2/ 2> &02($ J &( > A.;, % 9 > )>* 0= &2 9, )&11.,

! "# $! ""# %& %! ($)& ($*$ + "# &*, ""# & &! ) *! $ "#! (- ((! %-,- %- $- %

!"# $%& ()) *+,+)-./01!"# $%& ()) *+,+)-./01!"#! "#$ 2!"# ):; 2!B! 2 "B # $ 2 %4 C C 2 &4 %D?<?4 6<5 2 (9D =6

國立暨南國際大學圖書館

1-1 2

Transcription:

xecjk ctex.org 2012/05/21 v3.0.6 1 2 2 2 3 3 3.1..................................... 3 3.2................................. 5 3.2.1 XƎTEX........................... 8 3.3 CJK............................... 9 3.4 CJK............................... 10 3.5.............................. 10 4 11 5 xecjk 11 5.1.................................. 12 5.2.................................. 19 5.3.................................. 27 5.4 CJK................................ 30 5.5..................................... 33 5.6..................................... 41 5.7 CJK.............................. 42 5.8..................................... 51 5.9........................... 56 5.10 xecjk................................. 58 5.11 xecjk............................... 59 5.12................................... 60 6 63 6.1 xecjk-example-autofake.tex.......................... 63 6.2 xecjk-example-fallback.tex........................... 64 6.3 xecjk-example-subcjkblock.tex........................ 65 6.4 xecjk-example-cjkecglue.tex......................... 67 6.5 xecjk-example-checksingle.tex......................... 67 http://www.ctex.org 1

1 xecjk XƎL A TEX CJK 1. CJK 2. CJK (a z, A Z) 3. CCT 4. xecjk XƎTEX XƎTEX 0.9995.0 [2009/06/29] xecjk L A TEX 3 expl3 xparse l3keys2e fontspec 1 CJK xecjk 2009 5 ctex-kit 2 3 4 2 L A TEX xecjk \usepackage{xecjk} xecjk CJK xecjk \documentclass{article} \usepackage{xecjk} \setcjkmainfont{simsun} \begin{document} \LaTeX \end{document} SimSun UTF-8 XƎL A TEX xecjk CJK ctex xecjk ctex 5 xecjk \xecjksetup 3.1 \setcjkmainfont xecjk 3.2 1 http://mirrors.ctan.org/macros/latex/contrib/fontspec 2 http://code.google.com/p/ctex-kit/ 3 leoliu.pku@gmail.com 4 sobenlee@gmail.com 5 http://mirrors.ctan.org/language/chinese/ctex/ 2

3 3.1 xecjk key = var \xecjksetup \xecjksetup \xecjksetup { key1 = var1, key2 = var2,...} key1, key2 val1, val2 \usepackage[punctstyle=kaiming]{xecjk} \usepackage{xecjk}... \xecjksetup{punctstyle=kaiming} CJK xecjk xecjkactive CJKnumber indentfirst CJKspace CJKmath xecjkactive = true false / CJKnumber = true false CJKnumb CJKnumb xecjk xecjk \xecjksetup indentfirst = true false xecjk \xecjksetup xecjk indentfirst CJKnumber \xecjksetup CJKspace = true false xecjk CJK CJKmath = true false CJK CJK CJKglue CJKglue = {\hspace{0pt plus.08\baselineskip}} CJK glue xecjk glue 3

CJKecglue xcjkecglue CheckSingle InlineEnv InlineEnv+ InlineEnv- AutoFallBack AutoFakeBold AutoFakeSlant EmboldenFactor SlantFactor CJKecglue = { glue } CJK CJK glue glue xecjk CJK xecjk xcjkecglue = { true false glue } xecjk CJK CJKecglue CJK CheckSingle = true false CJK InlineEnv = {env1, env2, env3,...} CheckSingle xecjk CJK L A TEX \begin{...} \end{...} L A TEX CheckSingle AutoFallBack = true false 3.2 AutoFakeBold = { true false } AutoFakeSlant = { true false } EmboldenFactor = { 4 } SlantFactor = { 0.167 } 0.999 0.999 PunctStyle PunctStyle = { quanjiao banjiao kaiming hangmobanjiao CCT plain } quanjiao 1.5 banjiao kaiming hangmobanjiao CCT CCT plain 4

KaiMingPunct KaiMingPunct+ KaiMingPunct- LongPunct LongPunct+ LongPunct- MiddlePunct MiddlePunct+ MiddlePunct- PunctWidth AllowBreakBetweenPuncts KaiMingPunct = { } kaiming KaiMingPunct + - LongPunct = { } MiddlePunct = { } CJK xecjk PunctWidth = { dimen } xecjk dimen em pt plain CJK 3.5 \xecjksetwidth AllowBreakBetweenPuncts = true false xecjk CJK CJK 3.2 \setcjkmainfont AutoFakeBold AutoFakeSlant \setcjksansfont \setcjkmonofont \setcjkmainfont [ font features ] { font name } CJK \rmfamily \textrm fontspec font features font name 3.2.1 fontspec xecjk AutoFakeBold AutoFakeSlant AutoFakeBold = { true false } AutoFakeSlant = { true false } \setcjksansfont [ font features ] { font name } CJK \sffamily \textsf \setcjkmonofont [ font features ] { font name } CJK \ttfamily \texttt xecjk font features Mono 5

Mono \CJKfixedspacing \CJKflexiblespacing \setcjkmonoscale \setcjkmonoexspace \setcjkfamilyfont Mono = Scale Exspace Scale Exspace CJK \CJKfixedspacing \CJKflexiblespacing \CJKfixedspacing Mono=Exspace \CJKflexiblespacing (verbatim) \CJKfixedspacing \setcjkmonoscale \setcjkmonoexspace \setcjkmonoscale \setcjkmonoexspace CJK Mono=Scale Mono=Exspace \setcjkfamilyfont { family } [ font features ] { font name } CJK family \CJKfamily \CJKfamily { family } CJK family \newcjkfontfamily \newcjkfontfamily [ family ] \ font-switch [ font features ] { font name } CJK family \ font-switch CJK family family font-switch \newcjkfontfamily \setcjkfamilyfont \CJKfamily \newcjkfontfamily[song]\songti{simsun} \setcjkfamilyfont{song}{simsun} \newcommand\songti{\cjkfamily{song}} \CJKfontspec \CJKfontspec [ font features ] { font name } CJK \defaultcjkfontfeatures \defaultcjkfontfeatures { font features } CJK \defaultcjkfontfeatures{scale=0.962216} CJK 0.962216 6

\addcjkfontfeatures \addcjkfontfeatures { font features } CJK \addcjkfontfeatures{scale=1.1} CJK 1.1 \CJKrmdefault \rmfamily CJK rm \rmdefault \CJKsfdefault \sffamily CJK sf \sfdefault \CJKttdefault \ttfamily CJK tt \ttdefault \CJKfamilydefault \normalfont CJK \CJKrmdefault \familydefault CJK \renewcommand\familydefault{\sfdefault} \renewcommand\cjkfamilydefault{\cjksfdefault} CJK \setcjkmathfont \setcjkfallbackfamilyfont \setcjkmathfont [ font features ] { font name } CJK CJKmath \setcjkmathfont CJK \CJKfamilydefault CJK \setcjkfallbackfamilyfont { family } [ font features ] { font name } CJK family \setcjkmainfont{simsun} \setcjkfallbackfamilyfont{\cjkrmdefault}{simsun-extb} SimSun-ExtB SimSun FallBack FallBack = {[ font features ]{ font name }} xecjk font features FallBack \setcjkmainfont[fallback=simsun-extb]{simsun} FallBack \setcjkmainfont[fallback,autofakebold,scale=.97]{simsun-extb} \setcjkfallbackfamilyfont{\cjkrmdefault}[autofakebold,scale=.97]{simsun-extb} 7

\setcjkfallbackfamilyfont \setcjkfallbackfamilyfont { family } [ common font features ] { {[ font features 1 ] { font name 1 }}, {[ font features 2 ] { font name 2 }},... } \setcjkfallbackfamilyfont \setcjkmainfont[autofakebold,autofakeslant]{kaiti_gb2312} \setcjkfallbackfamilyfont{\cjkrmdefault}[autofakeslant] { [BoldFont=SimHei]{SimSun}, [AutoFakeBold] {SimSun-ExtB} } SimSun KaiTi_GB2312 SimSun-ExtB SimSun 3.2.1 XƎTEX fontspec XƎTEX XƎTEX fontconfig fc-list Windows Linux Console fc-list > fontlist.txt fontlist.txt fc-list Windows Times New Roman:style=cursiva,kurzíva,kursiv,Π ά ια,italic, Kursivoitu,Italique,Dőlt,Corsivo,Cursief,kursywa,Itálico,Курсив, İtalik,Poševno,nghiêng,Etzana Times New Roman:style=Negreta cursiva,tučné kurzíva,fed kursiv, Fett Kursiv,Έντονα Π ά ια,bold Italic,Negrita Cursiva, Lihavoitu Kursivoi,Gras Italique,Félkövér dőlt,grassetto Corsivo, Vet Cursief,Halvfet Kursiv,Pogrubiona kursywa,negrito Itálico, Полужирный Курсив,Tučná kurzíva,fet Kursiv,Kalın İtalik, Krepko poševno,nghiêng đậm,lodi etzana Times New Roman:style=Negreta,tučné,fed,Fett,Έντονα,Bold,Negrita, Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiona,Negrito, Полужирный,Fet,Kalın,Krepko,đậm,Lodia Times New Roman:style=Normal,obyčejné,Standard,Κανονικά,Regular, Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno, thường,arrunta,simsun:style=regular,simhei:style=normal,obyčejné,standard,κανονικά,regular,normaali, Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta fontspec xecjk \setmainfont{times New Roman} \setcjkmainfont{simsun} % \setcjkmainfont{ } 8

fc-list fc-list -f "%{family}\n" :lang=zh > zhfont.txt zhfont.txt 6 Windows Arial Unicode MS FangSong, KaiTi, Microsoft YaHei, MingLiU, NSimSun, PMingLiU, SimHei, SimSun, :lang=zh zh ja ko fontspec xecjk Windows \setcjkmainfont{simsun.ttc} fontspec xecjk 3.3 CJK CJK CJK xecjk CJK CJK CJK \xecjkdeclaresubcjkblock \xecjkdeclaresubcjkblock { block } { block range } block range CJK Unicode Unicode { ` -> `, "3400 -> "4DBF, "5000 -> "7000, `, `, "3500 } block range Unicode CJK \xecjkdeclaresubcjkblock{spua}{ "E400 -> "E4DA, "E500 -> "E5E8, "E600 -> "E6CE } \xecjkdeclaresubcjkblock{ext-b}{ "20000 -> "2A6DF } SPUA Ext-B 3.2 CJK font features SPUA Ext-B 3.2 FallBack 6 Windows 9

\setcjkmainfont[spua=sunmanpua,ext-b=simsun-extb]{simsun} SimSun SPUA SunmanPUA Ext-B SimSun-ExtB \xecjkdeclaresubcjkblock CJK CJK block \CJKfamilydefault block CJK block CJK CJK block block =* \xecjkcancelsubcjkblock \xecjkrestoresubcjkblock \xecjkcancelsubcjkblock { block1,block2,... } CJK \xecjkrestoresubcjkblock { block1,block2,... } CJK 3.4 CJK \xecjkdeclarecharclass \xecjkdeclarecharclass { class } { class range } class range 3.3 block range class 5.1 xecjk Unicode CJK \xecjkresetpunctclass \normalspacedchars \xecjkresetpunctclass \xecjkdeclarecharclass \xecjkresetpunctclass \normalspacedchars { char list } char list / 3.5 plain \xecjksetwidth \xecjksetwidth { } { dimen } \xecjksetwidth{ }{0.7em} 0.7em \xecjksetkern \xecjksetkern { 1 } { 2 } { dimen } xecjk CJK \xecjksetkern{ }{ }{0.3em} 10

4 CJKnumb CJKulem xecjk CJK \CJKfamily \CJKsymbol \CJKpunctsymbol xecjk CJK xecjk CJK xecjk CJKfntef xecjk XƎTEX \XeTeXinterchartoks polyglossia xecjk 5 xecjk 1 *package 2 \ProvidesExplPackage{\ExplFileName}{\ExplFileDate}{3.0.6}{\ExplFileDescription} \xecjk_msg_new:nn \xecjk_error:n \xecjk_error:nx \xecjk_warning:nx \xecjk_info:nx \xecjk_info:nxx 3 \cs_new_nopar:npn \xecjk_msg_new:nn { \msg_new:nnn { xecjk } } 4 \cs_new_nopar:npn \xecjk_error:n { \msg_error:nn { xecjk } } 5 \cs_new_nopar:npn \xecjk_error:nx { \msg_error:nnx { xecjk } } 6 \cs_new_nopar:npn \xecjk_warning:n { \msg_warning:nn { xecjk } } 7 \cs_new_nopar:npn \xecjk_warning:nx { \msg_warning:nnx { xecjk } } 8 \cs_new_nopar:npn \xecjk_warning:nxx { \msg_warning:nnxx { xecjk } } 9 \cs_new_nopar:npn \xecjk_info:nx { \msg_info:nnx { xecjk } } 10 \cs_new_nopar:npn \xecjk_info:nxx { \msg_info:nnxx { xecjk } } (End definition for \xecjk_msg_new:nn and others.) xecjk XƎTEX 11 \xecjk_msg_new:nn { Require-XeTeX } 12 { 13 The~xeCJK~package~requires~XeTeX~to~function.\\\\ 14 You~must~change~your~typesetting~engine~to~"xelatex" \\ 15 instead~of~plain~"latex"~or~"pdflatex"~or~"lualatex". 16 } 17 \xetex_if_engine:f { \msg_critical:nn { xecjk } { Require-XeTeX } } 18 \xecjk_msg_new:nn { l3-too-old } 19 { 20 Support~package~'expl3'~too~old. \\\\ 21 Please~update~an~up~to~date~version~of~the~bundles\\\\ 22 'l3kernel'~and~'l3packages'\\\\ 23 using~your~tex~package~manager~or~from~ctan. 24 } 25 \@ifpackagelater { expl3 } { 2012/02/19 } { } { \xecjk_error:n { l3-too-old } } 26 \RequirePackage{xparse} 27 \RequirePackage{l3keys2e} \XeTeXglyphbouds 28 \xecjk_msg_new:nn { XeTeX-too-old } 29 { 30 \token_to_str:n \XeTeXglyphbounds\c_space_tl is~not~defined.\\\\ 31 You~have~to~update~XeTeX~to~the~version~0.9995.0~or~later. 32 } 11

33 \cs_if_free:nt \XeTeXglyphbounds 34 { 35 \xecjk_error:n { XeTeX-too-old } 36 \AtBeginDocument { \punctstyle { plain } } 37 } BOM 38 \char_set_catcode_ignore:n { "FEFF } xecjkactive xecjk 39 \keys_define:nn { xecjk / options } 40 { 41 xecjkactive.choice:, 42 xecjkactive / true.code:n = { \makexecjkactive }, 43 xecjkactive / false.code:n = { \makexecjkinactive }, 44 xecjkactive.default:n = { true }, 45 } (End definition for xecjkactive. This function is documented on page 3.) \makexecjkactive \makexecjkinactive 46 \NewDocumentCommand \makexecjkactive { } { \XeTeXinterchartokenstate = \c_one } 47 \NewDocumentCommand \makexecjkinactive { } { \XeTeXinterchartokenstate = \c_zero } (End definition for \makexecjkactive and \makexecjkinactive.) 5.1 xecjk Default CJK FullLeft FullRight Boundary XƎTEX xecjk HalfLeft HalfRight NormalSpace Default abc123 CJK CJK FullLeft FullRight HalfLeft ( [ { HalfRight,.? ) ] } NormalSpace / Boundary \xecjk_default_class \xecjk_cjk_class \xecjk_fullleft_class \xecjk_fullright_class \xecjk_boundary_class XƎTEX 48 \int_const:nn \xecjk_default_class { 0 } 49 \int_const:nn \xecjk_cjk_class { 1 } 50 \int_const:nn \xecjk_fullleft_class { 2 } 51 \int_const:nn \xecjk_fullright_class { 3 } 52 \int_const:nn \xecjk_boundary_class { 255 } (End definition for \xecjk_default_class and others.) 12

\xecjk_new_class:n \g_xecjk_class_seq \xecjk_halfleft_class \xecjk_halfright_class \xecjk_normalspace_class \g_xecjk_base_class_clist \g_xecjk_cjk_class_clist \g_xecjk_cjk_class_prop \xecjk_class_num:n 53 \cs_new_nopar:nn \xecjk_new_class:n 54 { 55 \exp_args:nc \newxetexintercharclass { xecjk_#1_class } 56 \clist_gclear_new:c { g_xecjk_#1_range_clist } 57 \seq_gput_right:nv \g_xecjk_class_seq { xecjk_#1_class } 58 } 59 \seq_new:n \g_xecjk_class_seq (End definition for \xecjk_new_class:n and \g_xecjk_class_seq.) / 60 \xecjk_new_class:n { HalfLeft } 61 \xecjk_new_class:n { HalfRight } 62 \xecjk_new_class:n { NormalSpace } (End definition for \xecjk_halfleft_class, \xecjk_halfright_class, and \xecjk_normalspace_class.) 63 \clist_set:nn \g_xecjk_base_class_clist 64 { 65 Default, CJK, FullLeft, FullRight, Boundary, 66 HalfLeft, HalfRight, NormalSpace 67 } 68 \clist_map_inline:nn \g_xecjk_base_class_clist 69 { \clist_gclear_new:c { g_xecjk_#1_range_clist } } 70 \clist_new:n \g_xecjk_cjk_class_clist 71 \prop_new:n \g_xecjk_cjk_class_prop 72 \cs_new_nopar:nn \xecjk_save_cjk_class:n 73 { 74 \clist_gput_right:nx \g_xecjk_cjk_class_clist {#1} 75 \prop_gput:nvx \g_xecjk_cjk_class_prop { xecjk_#1_class } {#1} 76 } 77 \cs_generate_variant:nn \prop_gput:nnn { Nvx } 78 \clist_map_inline:nn { CJK, FullLeft, FullRight } { \xecjk_save_cjk_class:n {#1} } (End definition for \g_xecjk_base_class_clist, \g_xecjk_cjk_class_clist, and \g_xecjk_cjk_class_prop.) #1 79 \cs_new_nopar:nn \xecjk_class_num:n { \tl_use:c { xecjk_#1_class } } (End definition for \xecjk_class_num:n.) \tl_if_blank_p:x \tl_if_blank:xtf 80 \prg_set_conditional:nnn \tl_if_blank:x { p, T, F, TF } 81 { 82 \if_int_compare:w \pdftex_strcmp:d { \c_empty_tl } {#1} = \c_zero 83 \prg_return_true: 84 \else: 85 \if_int_compare:w \pdftex_strcmp:d { \c_space_tl } {#1} = \c_zero 86 \prg_return_true: \else: \prg_return_false: \fi: 87 \fi: 88 } (End definition for \tl_if_blank:x.) 13

\xecjkdeclarecharclass \xecjk_setcharclass_aux:nn \xecjksetcharclass \xecjk_check_num_range:nnnn #1 #2 Unicode "1100 -> "11FF 89 \NewDocumentCommand \xecjkdeclarecharclass { > { \TrimSpaces } m m } 90 { 91 \clist_gput_right:cx { g_xecjk_#1_range_clist } {#2} 92 \clist_map_inline:xn {#2} 93 { 94 \str_if_eq:xxf {##1} { -> } 95 { 96 \xecjk_setcharclass_aux:nn \xecjksetcharclass {##1} 97 { \xecjk_class_num:n {#1} } 98 } 99 } 100 } 101 \NewDocumentCommand \xecjk_setcharclass_aux:nn 102 { m > { \SplitArgument { 1 } { -> } } m } { #1 #2 } 103 \cs_generate_variant:nn \clist_map_inline:nn { x } (End definition for \xecjkdeclarecharclass. This function is documented on page 10.) #1 #2 Unicode #3 104 \NewDocumentCommand \xecjksetcharclass { m m m } 105 { 106 \xecjk_check_num_range:nnnn {#1} {#2} \l_tmpa_int \l_tmpb_int 107 \int_set:nn \l_tmpc_int {#3} 108 \prop_if_in:nvtf \g_xecjk_cjk_class_prop \l_tmpc_int 109 { \cs_set_eq:nn \xecjk_set_catcode:n \char_set_catcode_other:n } 110 { \cs_set_eq:nn \xecjk_set_catcode:n \use_none:n } 111 \loop 112 \xecjk_set_catcode:n \l_tmpa_int 113 \XeTeXcharclass \l_tmpa_int = \l_tmpc_int 114 \if_int_compare:w \l_tmpa_int < \l_tmpb_int 115 \int_incr:n \l_tmpa_int 116 \repeat 117 } (End definition for \xecjksetcharclass.) 118 \cs_new_nopar:nn \xecjk_check_num_range:nnnn 119 { 120 \bool_if:ntf { \tl_if_blank_p:x {#1} \tl_if_blank_p:x {#2} } 121 { 122 \int_set:nn #3 { \tl_if_blank:xtf {#1} {#2} {#1} } 123 \int_set_eq:nn #3 #4 124 } 125 { 126 \int_set:nn #3 { \int_min:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } 127 \int_set:nn #4 { \int_max:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } 128 } 129 } (End definition for \xecjk_check_num_range:nnnn.) 14

\xecjkresetpunctclass 130 \NewDocumentCommand \xecjkresetpunctclass { } 131 { 132 \xecjkdeclarecharclass { HalfLeft } 133 { "28, "2D, "5B, "60, "7B } 134 \xecjkdeclarecharclass { HalfRight } 135 { "21, "22, "25, "27, "29, "2C, "2E, "3A, "3B, "3F, "5D, "7D, } 136 \xecjkdeclarecharclass { FullLeft } 137 { 138 "2018, "201C, "2116, "3008, "300A, "300C, "300E, "3010, "3012, 139 "3014, "3016, "3018, "301A, "301D, "3036, "E76C, "FE59, "FE5B, 140 "FE5D, "FE5F, "FE60, "FE69, "FE6B, "FF03, "FF04, "FF08, "FF20, 141 "FF3B, "FF5B, "FFE0, "FFE1, "FFE5, "FFE6, 142 } 143 \xecjkdeclarecharclass { FullRight } 144 { 145 "00B7, "2019, "201D, "2014, "2025, "2026, "2030, "2500, "3001, 146 "3002, "3005, "3006, "3009, "300B, "300D, "300F, "3011, "3015, 147 "3017, "3019, "301B, "301E, "301F, "3041, "3043, "3045, "3047, 148 "3049, "3063, "3083, "3085, "3087, "308E, "309B, "309C, "309D, 149 "309E, "30A1, "30A3, "30A5, "30A7, "30A9, "30C3, "30E3, "30E5, 150 "30E7, "30EE, "30F5, "30F6, "30FB, "30FC, "30FD, "30FE, "FE50, 151 "FE51, "FE52, "FE54, "FE55, "FE56, "FE57, "FE5A, "FE5C, "FE5E, 152 "FE6A, "FF01, "FF05, "FF09, "FF0C, "FF0E, "FF1A, "FF1B, "FF1F, 153 "FF3D, "FF5D, "FF61, "FF63, "FF64, "FF65, "FF67, "FF68, "FF69, 154 "FF6A, "FF6B, "FF6C, "FF6D, "FF6E, "FF6F, "FF70, "FF9E, "FF9F, 155 } 156 } (End definition for \xecjkresetpunctclass. This function is documented on page 10.) CJK 157 \xecjkdeclarecharclass { CJK } 158 { Hangul Jamo 159 "1100 -> "11FF, CJK Radicals Supplement 160 "2E80 -> "2EFF, Kangxi Radicals 161 "2F00 -> "2FDF, Ideographic Description Characters 162 "2FF0 -> "2FFF, CJK Symbols and Punctuation 163 "3000 -> "303F, Hiragana 164 "3040 -> "309F, 15

Katakana 165 "30A0 -> "30FF, Bopomofo 166 "3100 -> "312F, Hangul Compatibility Jamo 167 "3130 -> "318F, Kanbun 168 "3190 -> "319F, Bopomofo Extended 169 "31A0 -> "31BF, CJK Strokes 170 "31C0 -> "31EF, Katakana Phonetic Extensions 171 "31F0 -> "31FF, Enclosed CJK Letters and Months 172 "3200 -> "32FF, CJK Compatibility 173 "3300 -> "33FF, CJK Unified Ideographs Extension-A A 174 "3400 -> "4DBF, Yijing Hexagrams Symbols 175 "4DC0 -> "4DFF, CJK Unified Ideographs 176 "4E00 -> "9FFF, Yi Syllables 177 "A000 -> "A48F, Yi Radicals 178 "A490 -> "A4CF, Hangul Jamo Extended-A A 179 "A960 -> "A97F, Hangul Syllables 180 "AC00 -> "D7AF, 16

Kana Supplement 181 "B000 -> "B0FF, Hangul Jamo Extended-B B 182 "D7B0 -> "D7FF, CJK Compatibility Ideographs 183 "F900 -> "FAFF, CJK Compatibility Forms 184 "FE30 -> "FE4F, Halfwidth and Fullwidth Forms 185 "FF00 -> "FFEF, CJK Unified Ideographs Extension-B B 186 "20000 -> "2A6DF, CJK Unified Ideographs Extension-C C 187 "2A700 -> "2B73F, CJK Unified Ideographs Extension-D D 188 "2B740 -> "2B81F, CJK Compatibility Ideographs Supplement 189 "2F800 -> "2FA1F, 190 } 191 \xecjkresetpunctclass \normalspacedchars \xecjk_inter_class_toks:nnn \xecjk_inter_class_toks:nnc 192 \NewDocumentCommand \normalspacedchars { m } 193 { 194 \tl_map_inline:nn {#1} 195 { \XeTeXcharclass `##1 = \xecjk_class_num:n { NormalSpace } } 196 } 197 \normalspacedchars{/} (End definition for \normalspacedchars. This function is documented on page 10.) 198 \cs_new_nopar:nn \xecjk_inter_class_toks:nnn 199 { \XeTeXinterchartoks \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} = {#3} } 200 \cs_generate_variant:nn \xecjk_inter_class_toks:nnn { nnc } (End definition for \xecjk_inter_class_toks:nnn and \xecjk_inter_class_toks:nnc.) 17

\xecjk_clear_inter_class_toks:nn 201 \cs_new_nopar:nn \xecjk_clear_inter_class_toks:nn 202 { 203 \XeTeXinterchartoks 204 \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} = { \c_empty_tl } 205 } (End definition for \xecjk_clear_inter_class_toks:nn.) \xecjk_pre_inter_class_toks:nnn \xecjk_app_inter_class_toks:nnn \xecjk_app_inter_class_toks:nnc \xecjk_get_inter_class_toks:nn \xecjk_copy_inter_class_toks:nnnn 206 \cs_new_nopar:nn \xecjk_pre_inter_class_toks:nnn 207 { 208 \use:x 209 { 210 \XeTeXinterchartoks \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} = 211 { 212 \exp_not:n {#3} \tex_the:d \XeTeXinterchartoks 213 \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} 214 } 215 } 216 } (End definition for \xecjk_pre_inter_class_toks:nnn.) 217 \cs_new_nopar:nn \xecjk_app_inter_class_toks:nnn 218 { 219 \use:x 220 { 221 \XeTeXinterchartoks \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} = 222 { 223 \tex_the:d \XeTeXinterchartoks \xecjk_class_num:n {#1} 224 \xecjk_class_num:n {#2} \exp_not:n {#3} 225 } 226 } 227 } 228 \cs_generate_variant:nn \xecjk_app_inter_class_toks:nnn { nnc } (End definition for \xecjk_app_inter_class_toks:nnn and \xecjk_app_inter_class_toks:nnc.) 229 \cs_new_nopar:nn \xecjk_get_inter_class_toks:nn 230 { \tex_the:d \XeTeXinterchartoks \xecjk_class_num:n {#1} \xecjk_class_num:n {#2} } (End definition for \xecjk_get_inter_class_toks:nn.) #3 #4 #1 #2 231 \cs_new_nopar:nn \xecjk_copy_inter_class_toks:nnnn 232 { 233 \use:x 234 { 235 \xecjk_inter_class_toks:nnn {#1} {#2} 236 { \xecjk_get_inter_class_toks:nn {#3} {#4} } 237 } 238 } (End definition for \xecjk_copy_inter_class_toks:nnnn.) 18

\xecjk_clear_cjk_toks: CJK 239 \cs_new_nopar:nn \xecjk_clear_cjk_toks: 240 { 241 \clist_map_inline:nn \g_xecjk_cjk_class_clist 242 { \xecjk_clear_inter_class_toks:nn { Boundary } {##1} } 243 } (End definition for \xecjk_clear_cjk_toks:.) 5.2 Default CJK FullLeft FullRight HalfLeft HalfRight NormalSpace Boundary Default CJK FullLeft FullRight HalfLeft HalfRight NormalSpace Boundary 244 \clist_map_inline:nn { Default, HalfLeft, HalfRight, NormalSpace } 245 { 246 \clist_map_inline:nn { CJK, FullLeft, FullRight } 247 { 248 \xecjk_inter_class_toks:nnn {#1} {##1} 249 { 250 \c_group_begin_token 251 \xecjk_select_font: 252 \xecjk_clear_inter_class_toks:nn {#1} {##1} 253 \xecjk_clear_cjk_toks: 254 } 255 \xecjk_inter_class_toks:nnn {##1} {#1} { \c_group_end_token } 256 } 257 \xecjk_app_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } 258 \clist_map_inline:nn { FullLeft, FullRight } 259 { \xecjk_app_inter_class_toks:nnc {#1} {##1} { xecjk_cjk_and_##1:n } } 260 } 261 \clist_map_inline:nn { Default, HalfLeft, NormalSpace } 262 { 263 \xecjk_inter_class_toks:nnn { Boundary } {#1} 264 { 265 \bool_if:ntf 266 { 267 \l_xecjk_xecglue_bool && 268 \int_compare_p:nnn \etex_lastnodetype:d = \c_eleven && 269 \skip_if_eq_p:nn \tex_lastskip:d \l_xecjk_space_glue_tl 270 } 271 { 272 \tex_unskip:d 273 \bool_if:ntf 274 { 19

275 \int_compare_p:nnn \tex_lastkern:d = \c_one 276 \int_compare_p:nnn \tex_lastkern:d = \c_two 277 } 278 { \CJKecglue } { \c_space_token } 279 } 280 { 281 \int_compare:nnntf \tex_lastkern:d = \c_one { \CJKecglue } 282 { \int_compare:nnnt \tex_lastkern:d = \c_two \xecjk_space_or_xecglue: } 283 } 284 } 285 \str_if_eq:xxf {#1} { NormalSpace } 286 { \xecjk_app_inter_class_toks:nnn { CJK } {#1} { \CJKecglue } } 287 } 288 \clist_map_inline:nn { Default, HalfRight, NormalSpace } 289 { 290 \xecjk_inter_class_toks:nnn {#1} { Boundary } 291 { 292 \peek_catcode:ntf \c_space_token 293 { { \xecjk_default_space_kern: } } { { \xecjk_default_kern: } } 294 } 295 \str_if_eq:xxf {#1} { NormalSpace } 296 { \xecjk_pre_inter_class_toks:nnn {#1} { CJK } { \CJKecglue } } 297 } 298 \xecjk_inter_class_toks:nnn { Boundary } { CJK } { \xecjk_boundary_and_cjk: } \xecjk_boundary_and_cjk: 299 \cs_new_nopar:nn \xecjk_boundary_and_cjk: 300 { 301 { 302 \bool_if:ntf 303 { 304 \int_compare_p:nnn \tex_lastkern:d = \c_one 305 \int_compare_p:nnn \tex_lastkern:d = \c_two 306 } 307 { \CJKglue } 308 { 309 \bool_if:ntf 310 { 311 \int_compare_p:nnn \tex_lastkern:d = \c_three 312 \int_compare_p:nnn \etex_lastnodetype:d = \c_ten 313 ( \int_compare_p:nnn \etex_lastnodetype:d = \c_twelve && 314 \g_xecjk_itcorr_bool ) 315 } 316 { \CJKecglue } 317 { 318 \bool_if:nt 319 { 320 \l_xecjk_xecglue_bool && 321 \int_compare_p:nnn \etex_lastnodetype:d = \c_eleven && 322 ( \skip_if_eq_p:nn \tex_lastskip:d \l_xecjk_space_glue_tl 323 \int_compare_p:nnn \tex_lastskip:d = \l_xecjk_ecglue_dim ) 324 } 20

325 { 326 \skip_set_eq:nn \l_tmpa_skip \tex_lastskip:d 327 \tex_unskip:d 328 \bool_if:ntf 329 { 330 \int_compare_p:nnn \tex_lastkern:d = \c_four 331 \int_compare_p:nnn \etex_lastnodetype:d = \c_ten 332 \int_compare_p:nnn \tex_lastkern:d = \c_three 333 \g_xecjk_itcorr_bool 334 } 335 { \CJKecglue } 336 { 337 \bool_if:nt 338 { 339! ( \int_compare_p:nnn \tex_lastkern:d = \c_one ) 340! ( \int_compare_p:nnn \tex_lastkern:d = \c_two ) 341 \l_xecjk_space_bool 342 } 343 { \skip_horizontal:n \l_tmpa_skip } 344 } 345 } 346 } 347 } 348 \bool_gset_false:n \g_xecjk_itcorr_bool 349 } 350 \c_group_begin_token 351 \xecjk_clear_cjk_toks: 352 \xecjk_select_font: 353 \CJKsymbol 354 } 355 \tl_set:nn \l_xecjk_space_glue_tl 356 { 357 \tex_fontdimen:d \c_two \tex_font:d 358 \@plus \tex_fontdimen:d \c_three \tex_font:d 359 \@minus \tex_fontdimen:d \c_four \tex_font:d 360 } (End definition for \xecjk_boundary_and_cjk:.) 361 \xecjk_inter_class_toks:nnn { CJK } { Boundary } 362 { 363 \c_group_end_token 364 { \xecjk_cjk_kern: } 365 \xecjk_ignorespaces: 366 } 367 \xecjk_inter_class_toks:nnn { CJK } { CJK } { \xecjk_cjk_and_cjk:n } \xecjk_cjk_and_cjk:n 368 \cs_new_nopar:nn \xecjk_cjk_and_cjk:n { \CJKglue \CJKsymbol {#1} } (End definition for \xecjk_cjk_and_cjk:n.) 369 \clist_map_inline:nn { FullLeft, FullRight } 370 { 371 \xecjk_inter_class_toks:nnn { Boundary } {#1} 21

372 { 373 \c_group_begin_token 374 \xecjk_clear_cjk_toks: 375 \xecjk_select_font: 376 \use:c { xecjk_cjk_and_#1:n } 377 } 378 \xecjk_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } 379 \xecjk_inter_class_toks:nnn {#1} { Boundary } { \c_group_end_token \tex_ignorespaces:d } 380 } 381 \clist_map_inline:nn \g_xecjk_base_class_clist 382 { 383 \bool_if:nf 384 { \str_if_eq_p:xx {#1} { FullLeft } \str_if_eq_p:xx {#1} { FullRight } } 385 { 386 \xecjk_pre_inter_class_toks:nnn { FullLeft } {#1} { \nobreak } 387 \xecjk_pre_inter_class_toks:nnn { FullRight } {#1} { \xecjk_after_fullright: } 388 } 389 } 390 \clist_map_inline:nn { CJK, FullLeft, FullRight } 391 { 392 \clist_map_inline:nn { FullLeft, FullRight } 393 { \xecjk_inter_class_toks:nnc {#1} {##1} { xecjk_#1_and_##1:n } } 394 } \xecjk_punct_rule:n \xecjk_punct_glue:n \xecjk_punct_kern:n / 395 \cs_new_nopar:nn \xecjk_punct_rule:n 396 { 397 \tex_vrule:d 398 \@width \dim_eval:c { \l_xecjk_punct_coor_tl/rule/#1 } 399 \@depth \c_zero_dim 400 \@height \c_zero_dim \scan_stop: 401 } (End definition for \xecjk_punct_rule:n.) / 402 \cs_new_nopar:nn \xecjk_punct_glue:n 403 { 404 \skip_horizontal:n 405 { 406 \dim_eval:c { \l_xecjk_punct_coor_tl/glue/#1 } 407 \@plus \dim_eval:n { \tl_use:c { \l_xecjk_punct_coor_tl/glue/#1 } /4 } 408 \@minus \dim_eval:n { \tl_use:c { \l_xecjk_punct_coor_tl/glue/#1 } /2 } 409 } 410 } (End definition for \xecjk_punct_glue:n.) 411 \cs_new_nopar:nn \xecjk_punct_kern:n 412 { \tex_kern:d \dim_eval:c { \l_xecjk_punct_coor_tl/kern/#1 } } (End definition for \xecjk_punct_kern:n.) 22

\dim_eval:c \xecjk_before_fullleft:n \xecjk_after_fullright: \xecjk_cjk_and_fullleft:n \xecjk_cjk_and_fullright:n 413 \cs_generate_variant:nn \dim_eval:n { c } (End definition for \dim_eval:c.) 414 \cs_new_nopar:nn \xecjk_before_fullleft:n 415 { 416 \tl_set:nx \l_xecjk_lastpunct_tl {#1} 417 \xecjk_punct_rule:n { l/#1 } 418 \CJKpunctsymbol {#1} 419 } (End definition for \xecjk_before_fullleft:n.) 420 \cs_new_nopar:nn \xecjk_after_fullright: 421 { 422 \xecjk_get_punct_bounds:nv { r } \l_xecjk_lastpunct_tl 423 \xecjk_punct_rule:n { r/\l_xecjk_lastpunct_tl } 424 \xecjk_punct_glue:n { r/\l_xecjk_lastpunct_tl } 425 } (End definition for \xecjk_after_fullright:.) 426 \cs_new_nopar:nn \xecjk_cjk_and_fullleft:n 427 { 428 \xecjk_get_punct_bounds:nn { l } {#1} 429 \int_compare:nnnf \etex_lastnodetype:d = \c_one 430 { \xecjk_punct_glue:n { l/#1 } } 431 \xecjk_before_fullleft:n {#1} 432 \xecjk_punct_if_middle:nt {#1} 433 { 434 \xecjk_punct_rule:n { m/#1 } 435 \xecjk_punct_glue:n { l/#1 } 436 } 437 } (End definition for \xecjk_cjk_and_fullleft:n.) 438 \cs_new_nopar:nn \xecjk_cjk_and_fullright:n 439 { 440 \xecjk_get_punct_bounds:nn { r } {#1} 441 \xecjk_punct_if_long:ntf {#1} \CJKglue 442 { 443 \nobreak 444 \xecjk_punct_if_middle:nt {#1} 445 { 446 \xecjk_punct_glue:n { r/#1 } 447 \xecjk_punct_rule:n { m/#1 } 448 } 449 } 450 \tl_gset:nx \l_xecjk_lastpunct_tl {#1} 451 \CJKpunctsymbol {#1} 452 } 23

(End definition for \xecjk_cjk_and_fullright:n.) \xecjk_fullleft_and_fullleft:n \xecjk_fullleft_and_fullright:n \xecjk_fullright_and_fullleft:n \xecjk_fullright_and_fullright:n 453 \cs_new_nopar:nn \xecjk_fullleft_and_fullleft:n 454 { 455 \nobreak 456 \xecjk_get_punct_bounds:nn { l } {#1} 457 \xecjk_get_kern:vn \l_xecjk_lastpunct_tl {#1} 458 \xecjk_punct_kern:n { \l_xecjk_lastpunct_tl - #1 } 459 \xecjk_before_fullleft:n {#1} 460 } (End definition for \xecjk_fullleft_and_fullleft:n.) 461 \cs_new_nopar:nn \xecjk_fullleft_and_fullright:n 462 { 463 \nobreak 464 \xecjk_get_punct_bounds:nn { r } {#1} 465 \xecjk_get_kern:vn \l_xecjk_lastpunct_tl {#1} 466 \xecjk_punct_kern:n { \l_xecjk_lastpunct_tl - #1 } 467 \nobreak 468 \tl_set:nx \l_xecjk_lastpunct_tl {#1} 469 \CJKpunctsymbol {#1} 470 } (End definition for \xecjk_fullleft_and_fullright:n.) 471 \cs_new_nopar:nn \xecjk_fullright_and_fullleft:n 472 { 473 \xecjk_punct_rule:n { r/\l_xecjk_lastpunct_tl } 474 \xecjk_get_punct_bounds:nn { l } {#1} 475 \xecjk_get_kern:vn \l_xecjk_lastpunct_tl {#1} 476 \xecjk_punct_kern:n { \l_xecjk_lastpunct_tl - #1 } 477 \xecjk_punct_nobreak: 478 \xecjk_before_fullleft:n {#1} 479 } (End definition for \xecjk_fullright_and_fullleft:n.) 480 \cs_new_nopar:nn \xecjk_fullright_and_fullright:n 481 { 482 \xecjk_punct_rule:n { r/\l_xecjk_lastpunct_tl } 483 \xecjk_get_punct_bounds:nn { r } {#1} 484 \xecjk_get_kern:vn \l_xecjk_lastpunct_tl {#1} 485 \xecjk_punct_kern:n { \l_xecjk_lastpunct_tl - #1 } 486 \nobreak 487 \tl_set:nx \l_xecjk_lastpunct_tl {#1} 488 \CJKpunctsymbol {#1} 489 } (End definition for \xecjk_fullright_and_fullright:n.) 24

\xecjk_cjk_kern: \xecjk_cjk_space_kern: \xecjk_default_kern: \xecjk_default_space_kern: CJKglue CJKecglue xcjkecglue CJKspace kern 490 \cs_new_nopar:nn \xecjk_cjk_kern: { \tex_kern:d -1 sp \tex_kern:d 1 sp } 491 \cs_new_nopar:nn \xecjk_cjk_space_kern: { \tex_kern:d -2 sp \tex_kern:d 2 sp } 492 \cs_new_nopar:nn \xecjk_default_kern: { \tex_kern:d -3 sp \tex_kern:d 3 sp } 493 \cs_new_nopar:nn \xecjk_default_space_kern: { \tex_kern:d -4 sp \tex_kern:d 4 sp } (End definition for \xecjk_cjk_kern: and others.) CJK glue 494 \keys_define:nn { xecjk / options } { CJKglue.tl_set_x:N = \CJKglue } (End definition for CJKglue. This function is documented on page 3.) CJK 495 \keys_define:nn { xecjk / options } 496 { 497 CJKecglue.code:n = 498 { 499 \cs_set:npx \CJKecglue {#1} 500 \settowidth \l_xecjk_ecglue_dim \CJKecglue 501 }, 502 xcjkecglue.choice:, 503 xcjkecglue / true.code:n = 504 { 505 \bool_set_true:n \l_xecjk_xecglue_bool 506 \cs_set_eq:nn \xecjk_space_or_xecglue: \CJKecglue 507 }, 508 xcjkecglue / false.code:n = 509 { 510 \bool_set_false:n \l_xecjk_xecglue_bool 511 \cs_set_eq:nn \xecjk_space_or_xecglue: \c_space_token 512 }, 513 xcjkecglue / unknown.code:n = 514 { 515 \bool_set_true:n \l_xecjk_xecglue_bool 516 \cs_set:npx \CJKecglue {#1} 517 \settowidth \l_xecjk_ecglue_dim \CJKecglue 518 \cs_set_eq:nn \xecjk_space_or_xecglue: \CJKecglue 519 }, 520 xcjkecglue.default:n = { true }, 521 } 522 \dim_new:n \l_xecjk_ecglue_dim 523 \bool_new:n \l_xecjk_xecglue_bool (End definition for CJKecglue and xcjkecglue. These functions are documented on page 4.) CJK 524 \keys_define:nn { xecjk / options } 525 { 526 CJKspace.choice:, 527 CJKspace / true.code:n = { \CJKspace }, 528 CJKspace / false.code:n = { \CJKnospace }, 529 CJKspace.default:n = { true }, 530 space.meta:n = { CJKspace = true }, 531 nospace.meta:n = { CJKspace = false }, 532 } 25

(End definition for CJKspace. This function is documented on page 3.) \CJKspace \CJKnospace CJK 533 \NewDocumentCommand \CJKspace { } 534 { 535 \bool_set_true:n \l_xecjk_space_bool 536 \cs_set_eq:nn \xecjk_ignorespaces: \xecjk_peek_math: 537 } 538 \NewDocumentCommand \CJKnospace { } 539 { 540 \bool_set_false:n \l_xecjk_space_bool 541 \cs_set_eq:nn \xecjk_ignorespaces: \xecjk_ignore_spaces: 542 } (End definition for \CJKspace and \CJKnospace.) \xecjk_ignore_spaces: \xecjk_peek_math: 543 \cs_new_nopar:nn \xecjk_ignore_spaces: 544 { 545 \peek_catcode:ntf \c_space_token 546 { 547 \int_compare:nnnt \tex_lastkern:d = \c_one 548 { \tex_unkern:d \tex_unkern:d { \xecjk_cjk_space_kern: } } 549 \peek_catcode_ignore_spaces:ntf \c_math_toggle_token 550 { \xecjk_space_or_xecglue: } 551 { 552 \bool_if:nt 553 { 554 \xecjk_if_outer_macro_p:c { l_peek_token } 555 \token_if_cs_p:c { l_peek_token } 556 } 557 { \xecjk_space_or_xecglue: } 558 } 559 } 560 { 561 \xecjk_if_outer_macro:cf { l_peek_token } 562 { 563 \token_if_math_toggle:ctf { l_peek_token } \CJKecglue 564 { \cs_if_exist:cf { l_peek_token } \exp_not:n } 565 } 566 } 567 } 568 \cs_new_nopar:nn \xecjk_peek_math: 569 { 570 \peek_catcode:ntf \c_space_token 571 { 572 \int_compare:nnnt \tex_lastkern:d = \c_one 573 { \tex_unkern:d \tex_unkern:d { \xecjk_cjk_space_kern: } } 574 \peek_catcode_ignore_spaces:nf \c_space_token { \xecjk_space_or_xecglue: } 575 } 576 { 577 \xecjk_if_outer_macro:cf { l_peek_token } 578 { 26

579 \token_if_math_toggle:ctf { l_peek_token } \CJKecglue 580 { \cs_if_exist:cf { l_peek_token } \exp_not:n } 581 } 582 } 583 } (End definition for \xecjk_ignore_spaces: and \xecjk_peek_math:.) 5.3 CheckSingle CheckSingleglue \xecjkenablechecksingle \xecjkdisablechecksingle \xecjk_checksingle:n \xecjk_checksingle:nn \xecjk_checksingle:nnn 584 \keys_define:nn { xecjk / options } 585 { 586 CheckSingle.choice:, 587 CheckSingle / true.code:n = { \xecjkenablechecksingle }, 588 CheckSingle / false.code:n = { \xecjkdisablechecksingle }, 589 CheckSingle.default:n = { true }, 590 CJKchecksingle.meta:n = { CheckSingle = true }, 591 CheckSingleglue.tl_set_x:N = { \CJKchecksingleglue }, 592 } (End definition for CheckSingle. This function is documented on page 4.) 593 \bool_new:n \l_xecjk_checksingle_bool 594 \NewDocumentCommand \xecjkenablechecksingle { } 595 { 596 \bool_if:nf \l_xecjk_checksingle_bool 597 { 598 \bool_set_true:n \l_xecjk_checksingle_bool 599 \cs_set_eq:nn \xecjk_checksingle_save_cjksymbol:n \xecjk_cjk_and_cjk:n 600 \cs_set_eq:nn \xecjk_checksingle_save_cjkglue \CJKglue 601 \cs_set_eq:nn \xecjk_cjk_and_cjk:n \xecjk_checksingle:n 602 \cs_set_nopar:npn \CJKglue { \CJKchecksingleglue } 603 } 604 } 605 \NewDocumentCommand \xecjkdisablechecksingle { } 606 { 607 \bool_if:nt \l_xecjk_checksingle_bool 608 { 609 \bool_set_false:n \l_xecjk_checksingle_bool 610 \cs_set_eq:nn \CJKglue \xecjk_checksingle_save_cjkglue 611 \cs_set_eq:nn \xecjk_cjk_and_cjk:n \xecjk_checksingle_save_cjksymbol:n 612 } 613 } (End definition for \xecjkenablechecksingle and \xecjkdisablechecksingle.) 614 \cs_new_nopar:nn \xecjk_checksingle:n 615 { 616 \peek_catcode:ntf \c_catcode_other_token 617 { \xecjk_checksingle:nn {#1} } 618 { 619 \bool_if:ntf 27

620 { 621! ( \xecjk_if_outer_macro_p:c { l_peek_token } ) && 622 \tl_if_empty_p:x { \token_get_arg_spec:c { l_peek_token } } && 623 \exp_args:nnc \exp_args:no \tl_if_single_token_p:n { l_peek_token } && 624 \exp_args:nnc \exp_after:wn \token_if_other_p:n { l_peek_token } 625 } 626 { \xecjk_checksingle:nn {#1} } 627 { \xecjk_checksingle_save_cjksymbol:n {#1} } 628 } 629 } 630 \cs_new_nopar:nn \xecjk_checksingle:nn 631 { 632 \peek_catcode:ntf \c_catcode_other_token 633 { \xecjk_checksingle_save_cjksymbol:n {#1} #2 } 634 { 635 \bool_if:ntf 636 { 637! ( \xecjk_if_outer_macro_p:c { l_peek_token } ) && 638 ( \token_if_space_p:c { l_peek_token } 639 \token_if_math_toggle_p:c { l_peek_token } 640 \token_if_cs_p:c { l_peek_token } ) 641 } 642 { 643 \bool_if:ntf { \token_if_space_p:c { l_peek_token } } 644 { 645 \peek_catcode_ignore_spaces:ntf \c_catcode_other_token 646 { \xecjk_checksingle_save_cjksymbol:n {#1} #2 \c_space_token } 647 { 648 \bool_if:ntf 649 { 650! ( \xecjk_if_outer_macro_p:c { l_peek_token } ) && 651 ( \token_if_math_toggle_p:c { l_peek_token } 652 \token_if_cs_p:c { l_peek_token } ) 653 } 654 { \xecjk_checksingle:nnn {#1} {#2} \c_space_token } 655 { \xecjk_checksingle_save_cjksymbol:n {#1} #2 \c_space_token } 656 } 657 } 658 { \xecjk_checksingle:nnn {#1} {#2} { } } 659 } 660 { \xecjk_checksingle_save_cjksymbol:n {#1} #2 } 661 } 662 } 663 \cs_new_nopar:nn \xecjk_checksingle:nnn 664 { 665 \bool_if:ntf 666 { 667 \token_if_eq_meaning_p:nn \l_peek_token \par 668 \token_if_eq_meaning_p:nn \l_peek_token \[ % \] 669 } 670 { \CJKsymbol {#1} \nobreak #2 } 671 { \xecjk_checksingle_env:nnn {#1} {#2} {#3} } 28

672 } (End definition for \xecjk_checksingle:n, \xecjk_checksingle:nn, and \xecjk_checksingle:nnn.) \xecjk_checksingle_env:nnn \xecjk_checksingle_env:nnnnn 673 \cs_new_nopar:nn \xecjk_checksingle_env:nnn 674 { 675 \peek_catcode_remove:ntf \c_math_toggle_token 676 { 677 \peek_catcode:ntf \c_math_toggle_token 678 { \CJKsymbol {#1} \nobreak #2 \c_math_toggle_token } 679 { \xecjk_checksingle_save_cjksymbol:n {#1} #2#3 \c_math_toggle_token } 680 } 681 { 682 \peek_meaning_remove:ntf \begin 683 { \xecjk_checksingle_env:nnnnn {#1} {#2} {#3} \begin } 684 { 685 \peek_meaning_remove:ntf \end 686 { \xecjk_checksingle_env:nnnnn {#1} {#2} {#3} \end } 687 { \xecjk_checksingle_save_cjksymbol:n {#1} #2#3 } 688 } 689 } 690 } 691 \cs_new_nopar:nn \xecjk_checksingle_env:nnnnn 692 { 693 \clist_if_in:nntf \g_xecjk_inline_env_clist {#5} 694 { \xecjk_checksingle_save_cjksymbol:n {#1} #2#3 } 695 { \CJKsymbol {#1} \nobreak #2 } 696 \scan_stop: #4 {#5} 697 } (End definition for \xecjk_checksingle_env:nnn and \xecjk_checksingle_env:nnnnn.) InlineEnv InlineEnv+ InlineEnv- 698 \keys_define:nn { xecjk / options } 699 { 700 InlineEnv.clist_gset:N = \g_xecjk_inline_env_clist, 701 InlineEnv+.code:n = 702 { 703 \clist_gput_right:nx \g_xecjk_inline_env_clist {#1} 704 \clist_gremove_duplicates:n \g_xecjk_inline_env_clist 705 }, 706 InlineEnv-.code:n = 707 { 708 \clist_map_inline:xn {#1} 709 { \clist_gremove_all:nn \g_xecjk_inline_env_clist {##1} } 710 }, 711 } (End definition for InlineEnv, InlineEnv+, and InlineEnv-. These functions are documented on page 4.) 712 \cs_generate_variant:nn \token_if_cs_p:n { c } 713 \cs_generate_variant:nn \token_if_space_p:n { c } 714 \cs_generate_variant:nn \token_get_arg_spec:n { c } 715 \cs_generate_variant:nn \token_if_math_toggle_p:n { c } 716 \cs_generate_variant:nn \token_if_math_toggle:ntf { c } 29

\xecjk_if_outer_macro_p:c \xecjk_if_outer_macro:ctf \xecjk_if_eq_meaning_p:cn \xecjk_if_eq_meaning:cntf \outer 717 \group_begin: 718 \char_set_lccode:nn { `\; } { `\: } 719 \char_set_lccode:nn { `\Z } { `\t } 720 \char_set_lccode:nn { `\Y } { `\c } 721 \char_set_lccode:nn { `\T } { `\T } 722 \char_set_lccode:nn { `\F } { `\F } 723 \tl_map_function:nn { O U Z E R M A Y R ; } \char_set_catcode_other:n 724 \tl_to_lowercase:n 725 { 726 \group_end: 727 \prg_new_conditional:nnn \xecjk_if_outer_macro:c { p, T, F, TF } 728 { 729 \exp_last_unbraced:nf \xecjk_if_outer_macro_aux:w 730 \cs_meaning:c {#1} OUZER ~ MAYRO ; \q_stop 731 } 732 \cs_new_nopar:npn \xecjk_if_outer_macro_aux:w #1 OUZER ~ MAYRO ; #2 \q_stop 733 { 734 \prg_case_str:xxn { #1 ~ } 735 { 736 { \token_to_str:n \ } { \prg_return_true: } 737 { \token_to_str:n \long \token_to_str:n \ } { \prg_return_true: } 738 { \token_to_str:n \protected \token_to_str:n \ } { \prg_return_true: } 739 { \token_to_str:n \protected \token_to_str:n \long \token_to_str:n \ } 740 { \prg_return_true: } 741 } 742 { \prg_return_false: } 743 } 744 } (End definition for \xecjk_if_outer_macro:c.) l3token \peek_catcode_ignore_spaces:ntf \outer 745 \tl_replace_once:nnn \peek_ignore_spaces_execute_branches: 746 { \token_if_eq_meaning:nntf \l_peek_token } 747 { \xecjk_if_eq_meaning:cntf { l_peek_token } } 748 \prg_new_conditional:nnn \xecjk_if_eq_meaning:cn { p, T, F, TF } 749 { 750 \exp_args:nc \if_meaning:w {#1} #2 751 \prg_return_true: \else: \prg_return_false: \fi: 752 } (End definition for \xecjk_if_eq_meaning:cn.) \xecjk_ul_subclass_patch_tl 5.4 CJK \g_xecjk_cjk_subclass_clist 753 \tl_new:n \xecjk_ul_subclass_patch_tl 754 \clist_new:n \g_xecjk_cjk_subclass_clist \xecjk_erase_cjksymbol: (End definition for \xecjk_ul_subclass_patch_tl and \g_xecjk_cjk_subclass_clist.) \xecjk_restore_cjksymbol: 755 \cs_new_nopar:nn \xecjk_erase_cjksymbol: 30

756 { 757 \cs_gset_eq:nn \CJKsymbol_Block \CJKsymbol 758 \cs_gset_eq:nn \CJKsymbol \prg_do_nothing: 759 } 760 \cs_new_nopar:nn \xecjk_restore_cjksymbol: 761 { 762 \cs_gset_eq:nn \CJKsymbol \CJKsymbol_Block 763 \CJKsymbol 764 } (End definition for \xecjk_erase_cjksymbol: and \xecjk_restore_cjksymbol:.) \xecjkdeclaresubcjkblock \xecjkcancelsubcjkblock \xecjkrestoresubcjkblock CJK #1 #2 Unicode 765 \NewDocumentCommand \xecjkdeclaresubcjkblock { m m } 766 { \xecjkdeclaresubcharclass { CJK } {#1} {#2} } 767 \@onlypreamble \xecjkdeclaresubcjkblock (End definition for \xecjkdeclaresubcjkblock. This function is documented on page 9.) CJK 768 \bool_new:n \l_xecjk_sub_cancel_bool 769 \NewDocumentCommand \xecjkcancelsubcjkblock { m } 770 { 771 \bool_if:nf \l_xecjk_sub_cancel_bool 772 { 773 \bool_set_true:n \l_xecjk_sub_cancel_bool 774 \xecjk_sub_restore_or_cancel:n {#1} 775 } 776 } 777 \NewDocumentCommand \xecjkrestoresubcjkblock { m } 778 { 779 \bool_if:nt \l_xecjk_sub_cancel_bool 780 { 781 \bool_set_false:n \l_xecjk_sub_cancel_bool 782 \xecjk_sub_restore_or_cancel:n {#1} 783 } 784 } 785 \cs_new_nopar:nn \xecjk_sub_restore_or_cancel:n 786 { 787 \clist_map_inline:xn {#1} 788 { 789 \cs_if_free:ctf { xecjk_ CJK/##1 _class } 790 { \xecjk_error:nx { SubBlock-undefined } {##1} } 791 { 792 \xecjkdeclarecharclass 793 { CJK \bool_if:nf \l_xecjk_sub_cancel_bool { /##1 } } 794 { \clist_use:c { g_xecjk_cjk/##1_range_clist } } 795 } 796 } 797 } 798 \xecjk_msg_new:nn { SubBlock-undefined } 799 { 800 The~CJK~sub~block~'#1'~is~undefined.\\\\ 801 Try~to~use~\token_to_str:N \xecjkdeclaresubcjkblock \c_space_tl 31

802 to~declare~it. 803 } (End definition for \xecjkcancelsubcjkblock and \xecjkrestoresubcjkblock. These functions are documented on page 10.) \xecjkdeclaresubcharclass \xecjk_set_sub_class_toks:nn 804 \NewDocumentCommand \xecjkdeclaresubcharclass 805 { > { \TrimSpaces } m > { \TrimSpaces } m m } 806 { 807 \cs_if_free:ct { xecjk_ #1/#2 _class } 808 { 809 \xecjk_new_class:n { #1/#2 } 810 \xecjk_set_sub_class_toks:nn {#1} {#2} 811 \xecjk_new_sub_key:n {#2} 812 \xecjk_ul_subclass_patch:nn {#1} {#2} 813 } 814 \xecjkdeclarecharclass { #1/#2 } {#3} 815 } 816 \@onlypreamble \xecjkdeclaresubcharclass (End definition for \xecjkdeclaresubcharclass.) 817 \cs_new_nopar:nn \xecjk_set_sub_class_toks:nn 818 { 819 \clist_map_inline:nn \g_xecjk_base_class_clist 820 { 821 \xecjk_copy_inter_class_toks:nnnn { #1/#2 } {##1} {#1} {##1} 822 \xecjk_copy_inter_class_toks:nnnn {##1} { #1/#2 } {##1} {#1} 823 \str_if_eq:xxtf {##1} { CJK } 824 { 825 \xecjk_pre_inter_class_toks:nnn {##1} { #1/#2 } 826 { \xecjk_switch_font:nn {#1} {#2} } 827 } 828 { 829 \xecjk_pre_inter_class_toks:nnn {##1} { #1/#2 } 830 { \xecjk_erase_cjksymbol: } 831 \xecjk_app_inter_class_toks:nnn {##1} { #1/#2 } 832 { \xecjk_switch_font:nn {#1} {#2} \xecjk_restore_cjksymbol: } 833 } 834 } 835 \xecjk_copy_inter_class_toks:nnnn { #1/#2 } { #1/#2 } {#1} {#1} 836 \clist_if_empty:nf \g_xecjk_cjk_subclass_clist 837 { 838 \clist_map_inline:nn \g_xecjk_cjk_subclass_clist 839 { 840 \xecjk_copy_inter_class_toks:nnnn { #1/#2 } { #1/##1 } {#1} {#1} 841 \xecjk_copy_inter_class_toks:nnnn { #1/##1 } { #1/#2 } {#1} {#1} 842 \xecjk_pre_inter_class_toks:nnn { #1/#2 } { #1/##1 } 843 { \xecjk_switch_font:nn {#2} {##1} } 844 \xecjk_pre_inter_class_toks:nnn { #1/##1 } { #1/#2 } 845 { \xecjk_switch_font:nn {##1} {#2} } 846 } 32

847 } 848 \clist_gput_right:nn \g_xecjk_cjk_subclass_clist {#2} 849 \xecjk_save_cjk_class:n { #1/#2 } 850 \clist_map_inline:nn { CJK, FullLeft, FullRight } 851 { 852 \xecjk_pre_inter_class_toks:nnn { #1/#2 } {##1} 853 { \xecjk_switch_font:nn {#2} {#1} } 854 } 855 } (End definition for \xecjk_set_sub_class_toks:nn.) \xecjk_ul_subclass_patch:nn 856 \cs_new_nopar:nn \xecjk_ul_subclass_patch:nn 857 { 858 \tl_put_right:nn \xecjk_ul_subclass_patch_tl 859 { 860 \clist_map_inline:nn { Default, HalfLeft, HalfRight } 861 { 862 \str_if_eq:xxtf {##1} { HalfLeft } 863 { \xecjk_inter_class_toks:nnn {#1} { #1/#2 } { \CJKecglue \CJKsymbol } } 864 { \xecjk_inter_class_toks:nnn {#1} { #1/#2 } { \CJKsymbol } } 865 \xecjk_inter_class_toks:nnn { Boundary } { #1/#2 } 866 { 867 \xecjk_erase_cjksymbol: 868 \xecjk_boundary_and_cjk: 869 \xecjk_switch_font:nn {#1} {#2} 870 \xecjk_restore_cjksymbol: 871 } 872 } 873 } 874 } (End definition for \xecjk_ul_subclass_patch:nn.) 5.5 \g_xecjk_punctstyle_clist 875 \clist_new:n \g_xecjk_punctstyle_clist 876 \clist_set:nn \g_xecjk_punctstyle_clist 877 { CCT, halfwidth, fullwidth, marginkerning, mixedwidth, plain } 878 \clist_map_inline:nn \g_xecjk_punctstyle_clist 879 { \tl_const:cn { c_xecjk_ps_#1_tl } {#1} } (End definition for \g_xecjk_punctstyle_clist.) \keys_choices_generate:v.generate_choices:v 880 \cs_generate_variant:nn \keys_choices_generate:n { V } 881 \cs_new_protected:cpn { \c_keys_props_root_tl.generate_choices:v } #1 882 { \keys_choices_generate:v {#1} } (End definition for \keys_choices_generate:v and.generate_choices:v.) 33

PunctStyle AllowBreakBetweenPuncts KaiMingPunct LongPunct MiddlePunct PunctWidth 883 \keys_define:nn { xecjk / options } 884 { 885 AllowBreakBetweenPuncts.choice:, 886 AllowBreakBetweenPuncts / true.code:n = { \xecjkallowbreakbetweenpuncts }, 887 AllowBreakBetweenPuncts / false.code:n = { \xecjknobreakbetweenpuncts }, 888 AllowBreakBetweenPuncts.default:n = { true }, 889 KaiMingPunct.code:n = { \xecjk_set_special_punct:nn { mixedwidth } {#1} }, 890 KaiMingPunct+.code:n = { \xecjk_add_special_punct:nn { mixedwidth } {#1} }, 891 KaiMingPunct-.code:n = { \xecjk_sub_special_punct:nn { mixedwidth } {#1} }, 892 LongPunct.code:n = { \xecjk_set_special_punct:nn { long } {#1} }, 893 LongPunct+.code:n = { \xecjk_add_special_punct:nn { long } {#1} }, 894 LongPunct-.code:n = { \xecjk_sub_special_punct:nn { long } {#1} }, 895 MiddlePunct+.code:n = { \xecjk_add_special_punct:nn { middle } {#1} }, 896 MiddlePunct.code:n = { \xecjk_set_special_punct:nn { middle } {#1} }, 897 MiddlePunct-.code:n = { \xecjk_sub_special_punct:nn { middle } {#1} }, 898 PunctWidth.tl_gset:N = \g_xecjk_punct_width_tl, 899 PunctStyle.choice_code:n = 900 { 901 \tl_set:nx \l_xecjk_punctstyle_tl { \l_keys_choice_tl } 902 \tl_if_eq:nnt \l_xecjk_punctstyle_tl \c_xecjk_ps_plain_tl 903 { \xecjkallowbreakbetweenpuncts } 904 }, 905 PunctStyle.generate_choices:V = \g_xecjk_punctstyle_clist, 906 PunctStyle / banjiao.meta:n = { PunctStyle = halfwidth }, 907 PunctStyle / quanjiao.meta:n = { PunctStyle = fullwidth }, 908 PunctStyle / kaiming.meta:n = { PunctStyle = mixedwidth }, 909 PunctStyle / hangmobanjiao.meta:n = { PunctStyle = marginkerning }, 910 PunctStyle / unknown.code:n = 911 { \xecjk_error:nx { PunctStyle-undefined } \l_keys_value_tl }, 912 } 913 \xecjk_msg_new:nn { PunctStyle-undefined } 914 { 915 Punctstyle~"#1"~is~not~available. \\\\ 916 You~can~only~use~one~of\\\\ 917 "\g_xecjk_punctstyle_clist".\\ 918 } (End definition for PunctStyle and others. These functions are documented on page 5.) \xecjkallowbreakbetweenpuncts \xecjknobreakbetweenpuncts 919 \NewDocumentCommand \xecjkallowbreakbetweenpuncts { } 920 { \cs_set_eq:nn \xecjk_punct_nobreak: \xecjk_zero_glue: } 921 \NewDocumentCommand \xecjknobreakbetweenpuncts { } 922 { \cs_set_eq:nn \xecjk_punct_nobreak: \nobreak } 923 \cs_new_protected_nopar:nn \xecjk_zero_glue: { \skip_horizontal:n \c_zero_skip } (End definition for \xecjkallowbreakbetweenpuncts and \xecjknobreakbetweenpuncts.) \g_xecjk_special_ps_clist \xecjk_set_special_punct:nn \xecjk_add_special_punct:nn \xecjk_sub_special_punct:nn 924 \clist_set:nn \g_xecjk_special_ps_clist { mixedwidth, long, middle } 925 \clist_map_inline:nn \g_xecjk_special_ps_clist 926 { 927 \tl_new:c { l_xecjk_#1_punct_tl } 34

928 \prop_new:c { l_xecjk_#1_punct_prop } 929 } 930 \cs_new_nopar:nn \xecjk_set_special_punct:nn 931 { 932 \tl_set:cx { l_xecjk_#1_punct_tl } {#2} 933 \prop_clear:c { l_xecjk_#1_punct_prop } 934 \tl_map_inline:cn { l_xecjk_#1_punct_tl } 935 { \prop_put:cnn { l_xecjk_#1_punct_prop } {##1} { } } 936 } 937 \cs_new_nopar:nn \xecjk_add_special_punct:nn 938 { 939 \tl_put_right:cx { l_xecjk_#1_punct_tl } {#2} 940 \tl_map_inline:cn { l_xecjk_#1_punct_tl } 941 { \prop_put:cnn { l_xecjk_#1_punct_prop } {##1} { } } 942 } 943 \cs_new_nopar:nn \xecjk_sub_special_punct:nn 944 { 945 \tl_map_inline:xn {#2} 946 { 947 \tl_remove_all:cn { l_xecjk_#1_punct_tl } {##1} 948 \prop_del:cn { l_xecjk_#1_punct_prop } {##1} 949 } 950 } 951 \cs_generate_variant:nn \tl_map_inline:nn { x } (End definition for \g_xecjk_special_ps_clist and others.) \dim_set:nc \dim_add:nc \dim_set_min:nc \l_xecjk_punct_coor_tl \xecjk_get_punct_bounds:nn 952 \cs_generate_variant:nn \dim_set:nn { Nc } 953 \cs_generate_variant:nn \dim_add:nn { Nc } 954 \cs_generate_variant:nn \dim_set_min:nn { Nc } (End definition for \dim_set:nc, \dim_add:nc, and \dim_set_min:nc.) 955 \tl_set:nn \l_xecjk_punct_coor_tl { \l_xecjk_font_coor_tl/\l_xecjk_punctstyle_tl } (End definition for \l_xecjk_punct_coor_tl.) #1 l/r #2 / / / / 956 \cs_new_nopar:nn \xecjk_get_punct_bounds:nn 957 { 958 \tl_if_exist:cf { \l_xecjk_punct_coor_tl/rule/#1/#2 } 959 { 960 \tl_if_eq:nntf \l_xecjk_punctstyle_tl \c_xecjk_ps_plain_tl 961 { 962 \clist_map_inline:nn { glue, rule, bound } 963 { \tl_gset:cv { \l_xecjk_punct_coor_tl/##1/#1/#2 } \c_zero_dim } 964 \tl_gset:cv { \l_xecjk_punct_coor_tl/rule/m/#2 } \c_zero_dim 965 } 966 { 967 \tl_if_exist:cf { \l_xecjk_punct_coor_tl/bound/#1/#2 } 968 { { \xecjk_select_font: \xecjk_get_punct_dimen:n {#2} } } 35

969 \xecjk_punct_if_long:ntf {#2} 970 { 971 \dim_zero:n \l_tmpa_dim 972 \dim_zero:n \l_tmpb_dim 973 \dim_zero:n \l_tmpc_dim 974 } 975 { 976 \dim_set:nc \l_tmpa_dim { \l_xecjk_punct_coor_tl/bound/#1/#2 } 977 \dim_set:nc \l_tmpb_dim 978 { \l_xecjk_punct_coor_tl/bound/\str_if_eq:xxtf {#1} lrl/#2 } 979 \dim_set:nn \l_tmpc_dim 980 { 981 \cs_if_exist_use:cf { g_xecjk_punct_width/#2 } 982 { 983 \tl_if_blank:xtf \g_xecjk_punct_width_tl 984 { \c_zero_dim } 985 { \g_xecjk_punct_width_tl } 986 } 987 } 988 \xecjk_punct_if_middle:ntf {#2} 989 { 990 \dim_set:nn \l_tmpc_dim 991 { 992 \dim_compare:nnntf \l_tmpc_dim > \c_zero_dim 993 { \l_tmpc_dim } 994 { 995 \prg_case_tl:nnn \l_xecjk_punctstyle_tl 996 { 997 \c_xecjk_ps_halfwidth_tl {.5 em } 998 \c_xecjk_ps_mixedwidth_tl {.5 em } 999 \c_xecjk_ps_cct_tl {.7 em } 1000 \c_xecjk_ps_fullwidth_tl { 1 em } 1001 } 1002 { 1 em } 1003 } 1004 - \tl_use:c { \l_xecjk_punct_coor_tl/dimen/#2 } 1005 } 1006 \dim_set:nn \l_tmpc_dim {.5 \l_tmpc_dim } 1007 } 1008 { 1009 \dim_compare:nnntf \l_tmpc_dim > \c_zero_dim 1010 { 1011 \dim_set:nn \l_tmpc_dim 1012 { 1013 \l_tmpc_dim - \l_tmpb_dim 1014 - \tl_use:c { \l_xecjk_punct_coor_tl/dimen/#2 } 1015 } 1016 } 1017 { 1018 \dim_set_eq:nn \l_tmpc_dim \l_tmpa_dim 1019 \dim_set_min:nn \l_tmpc_dim \l_tmpb_dim 1020 \prg_case_tl:nnn \l_xecjk_punctstyle_tl 36