Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctex: punct=plain 在 xelatex 编译时报错 #474

Closed
stone-zeng opened this issue Jan 5, 2020 · 2 comments
Closed

ctex: punct=plain 在 xelatex 编译时报错 #474

stone-zeng opened this issue Jan 5, 2020 · 2 comments

Comments

@stone-zeng
Copy link
Member

\documentclass{ctexart}
\ctexset{punct=plain}
\begin{document}
中日韩越统一表意文字(英语:CJKV Unified Ideographs),旧称中日韩统一表意文字……
\end{document}

报错为:

! Package xeCJK Error: Punctuation style "plain" is unknown.
(xeCJK)                
(xeCJK)                The available styles are listed as follow.
(xeCJK)                
(xeCJK)                "plain, quanjiao, hangmobanjiao, banjiao, kaiming,
(xeCJK)                and CCT".
(xeCJK)                

Type <return> to continue.
 ...                                              
                                                  
l.2 \ctexset{punct=plain}
                         
?

直接用 xeCJK 指定 \xeCJKsetup{PunctStyle=plain} 不出现此问题。

@muzimuzhi
Copy link
Contributor

\xeCJKsetup{PunctStyle=...} 只接受值,但在

ctex-kit/ctex/ctex.dtx

Lines 6558 to 6569 in dacf770

\keys_define:nn { ctex }
{
punct .code:n =
{
\tl_set:Nx \l_@@_punct_tl { #1 }
%<pdftex> \punctstyle { \l_@@_punct_tl }
%<xetex> \xeCJKsetup { PunctStyle = \l_@@_punct_tl }
%<luatex> \ctex_mono_jfm:o { \l_@@_punct_tl }
%<uptex|aptex> \msg_warning:nn { ctex } { invalid-option }
} ,
punct .default:n = { quanjiao } ,
}

中(6564 行), 传过去的是 \l__ctex_punct_tl.

在 ctex 中可以用

--- a/ctex/ctex.dtx
+++ b/ctex/ctex.dtx
@@ -6561,7 +6561,7 @@ Copyright and Licence
       {
         \tl_set:Nx \l_@@_punct_tl { #1 }
 %<pdftex>        \punctstyle { \l_@@_punct_tl }
-%<xetex>        \xeCJKsetup { PunctStyle = \l_@@_punct_tl }
+%<xetex>        \exp_args:Nx \xeCJKsetup { PunctStyle = \l_@@_punct_tl }
 %<luatex>        \ctex_mono_jfm:o { \l_@@_punct_tl }
 %<uptex|aptex>        \msg_warning:nn { ctex } { invalid-option }
       } ,

修复,模仿

ctex-kit/ctex/ctex.dtx

Lines 4235 to 4239 in dacf770

\exp_args:Nx \xeCJKsetup
{
LoadFandol = false ,
PunctStyle = \l_@@_punct_tl
}

我更倾向于在 xecjk 中修复,例如

--- a/xeCJK/xeCJK.dtx
+++ b/xeCJK/xeCJK.dtx
@@ -5978,9 +5978,10 @@ Copyright and Licence
       { \tl_set_eq:NN \l_xeCJK_punct_style_tl \c_@@_punct_style_plain_tl } ,
     PunctStyle / unknown       .code:n =
       {
-        \IfInstanceExistTF { xeCJK / punctuation } { \l_keys_value_tl }
-          { \tl_set:Nx \l_xeCJK_punct_style_tl { \l_keys_value_tl } }
-          { \@@_error:nx { punct-style-unknown } { \l_keys_value_tl } }
+        \tl_set:Nx \l__xeCJK_tmp_tl { \l_keys_value_tl }
+        \IfInstanceExistTF { xeCJK / punctuation } { \l__xeCJK_tmp_tl }
+          { \tl_set:Nx \l_xeCJK_punct_style_tl { \l__xeCJK_tmp_tl } }
+          { \__xeCJK_error:nx { punct-style-unknown } { \l__xeCJK_tmp_tl } }
       }
   }

PS:现在还推荐写 \changes 吗?

@muzimuzhi
Copy link
Contributor

muzimuzhi commented Jan 5, 2020

经交流

  1. 在 ctex 中修复
  2. 等目前的其他工作(部署 ci 测试、合并 pr ctex: fontset 有关问题修复 #462、合并 changelog branch)完成后,再提交
  3. 其他工作包含了「不在 dtx 中写 \changes,写单独的 changelog 文件」

@stone-zeng stone-zeng mentioned this issue Jan 10, 2020
25 tasks
stone-zeng added a commit that referenced this issue Jan 21, 2020
@qinglee qinglee closed this as completed in 240735c Apr 9, 2020
zepinglee pushed a commit that referenced this issue Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants