We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
标点的压缩与禁则机制依赖字符状态转换。命令参数、分组都可能打破这种正常的状态,引入额外的边界状态。
例如,按基本的禁则规则,右标点禁止出现在行首,右标点之前禁止断行。但对于
\textbf{(文字)}。
由于 \textbf 的参数右花括号隔开了两个右标点,所以原来的 FullRight -> FullRight 状态转移就变成了 FullRight -> Boundary -> FullRight 状态转移。这会同时导致禁则和压缩失效。简单的测试例子:
\textbf
\documentclass{article} \usepackage{xeCJK} \setCJKmainfont{SimSun} \begin{document} \parindent=0pt \hsize=2.5em {(文字)}。文字 \end{document}
在这里,FullRight -> Boundary 的定义中会插入一个当前标点的 glue,造成可断点。
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
这里似乎可以类似处理 Boundary -> FullLeft 时的办法,利用 \lastnodetype 做一些判断,减少禁则失效的情况。
\lastnodetype
The text was updated successfully, but these errors were encountered:
目前的凑合办法是在 } 之前用 \unskip。
}
\unskip
Sorry, something went wrong.
嗯,这问题一直有,要处理的话,跟现在 CJK -> Boundary -> CJK 一样,无非就是在 FullRight -> Boundary 时,插入一个小 \kern,然后 Boundary -> FullRight 时用 \lastkern 作判断,我偷懒了就没做完整,要是能有 e-upTeX 中的 \lastnodechar的话,就会方便一些。
\lastnodechar
bf04866
qinglee
No branches or pull requests
标点的压缩与禁则机制依赖字符状态转换。命令参数、分组都可能打破这种正常的状态,引入额外的边界状态。
例如,按基本的禁则规则,右标点禁止出现在行首,右标点之前禁止断行。但对于
由于
\textbf
的参数右花括号隔开了两个右标点,所以原来的 FullRight -> FullRight 状态转移就变成了 FullRight -> Boundary -> FullRight 状态转移。这会同时导致禁则和压缩失效。简单的测试例子:在这里,FullRight -> Boundary 的定义中会插入一个当前标点的 glue,造成可断点。
这里似乎可以类似处理 Boundary -> FullLeft 时的办法,利用
\lastnodetype
做一些判断,减少禁则失效的情况。The text was updated successfully, but these errors were encountered: