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

xeCJK 是否有必要保留汉字与活动字符之间的空格 #81

Closed
leo-liu opened this issue Mar 16, 2015 · 1 comment
Closed

xeCJK 是否有必要保留汉字与活动字符之间的空格 #81

leo-liu opened this issue Mar 16, 2015 · 1 comment
Assignees

Comments

@leo-liu
Copy link
Member

leo-liu commented Mar 16, 2015

Original issue 82 created by sobenlee on 2012-04-12T16:09:02.000Z:

目前 xeCJK 对于汉字后面的空格进行的处理是:

\def\xeCJK@@@checknext{
\ifx $@let@token
\CJKecglue
\else
\if\relax\noexpand@let@token
\unless\ifx@let@token\xeCJK@par
\CJKecglue
\fi
\fi
\fi
\let\xeCJK@nexttoken\relax}

也就是说,除了保留汉字与数学公式和控制序列之间的空格外,其余的空格都会被忽略,对于活动字符也不例外。

目前遇到的问题是对于 shortvrb 之类宏包使用 \MakeShortVerb{|} 后,如下

汉字 |xeCJK| 汉字

得到的结果是

汉字xeCJK 汉字

这结果绝非预期效果。

这是我目前想到的有必要保留汉字与活动字符之间空格的地方,不知道这样做有什么弊端。

@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #1 originally posted by sobenlee on 2012-04-12T18:13:48.000Z:

是我搞错了,现在的结果是对的,我之前的测试有问题。

对于汉字+空格+活动字符的情形,@let@token 是一个宏,所以 \if\relax\noexpand@let@token 的结果为真,因而空格被保留。

@leo-liu leo-liu closed this as completed Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant