CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
966 stars 124 forks source link

ctex: 段落内部的 \ziju 命令在 LuaTeX 中没有效果 #617

Closed zepinglee closed 2 years ago

zepinglee commented 2 years ago
\documentclass{ctexart}
\begin{document}
测试文本\par
测试文本{\ziju{1}测试文本}测试文本\par
{\ziju{1}测试文本\par}
\end{document}

上述代码使用 XeLaTeX 编译的效果是:

Screen Shot 2022-05-02 at 11 23 40

但是使用 LuaLaTeX 编译时,段落内部的 \ziju 命令(分组不含 \par)则没有效果。

Screen Shot 2022-05-02 at 11 25 26

我没找到 \ziju 与 luatex-ja 相关的代码。

LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-29>
Document Class: ctexart 2021/12/12 v2.5.8 Chinese adapter for class article (CTEX)
Package: xeCJK 2021/12/12 v3.8.8 Typesetting CJK scripts with XeLaTeX
Package: luatexja 2022-04-11 Japanese Typesetting with Lua(La)TeX
muzimuzhi commented 2 years ago

像是 luatex-ja 的限制,texdoc luatex-ja sec. 4.2

The value (a skip) of kanjiskip or xkanjiskip can be changed as the following. Note that only their values at the end of a paragraph or a hbox are adopted in the whole paragraph or the whole hbox.

\ziju 和 luatex-ja 的关系是,

\ziju
  \ctex_ziju:n
    \ctex_select_size:
      \ctex_update_size:
        \ctex_update_ziju:
          \ctex_update_em_unit: % 引擎相关,luatex 下定义为 \dim_set:Nn \ccwd { \zw }
          \ctex_update_ccglue: % 引擎相关
            \ctex_ltj_set_kanjiskip:N
              \ltj@setpar@global \ltjsetkanjiskip
zepinglee commented 2 years ago

\ziju 和 luatex-ja 的关系是,

\ziju
  \ctex_ziju:n
    \ctex_select_size:
      \ctex_update_size:
        \ctex_update_ziju:
          \ctex_update_em_unit: % 引擎相关,luatex 下定义为 \dim_set:Nn \ccwd { \zw }
          \ctex_update_ccglue: % 引擎相关
            \ctex_ltj_set_kanjiskip:N
              \ltj@setpar@global \ltjsetkanjiskip

啊,原来如此。感谢指导!

muzimuzhi commented 2 years ago

PS: 我是开 tracing 测试文本{\tracingall\ziju{1}\tracingnone 测试文本}测试文本\par,然后配合 ctex.dtx 一起看的。