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 使西文在部分情况下无法断词 #118

Closed
leo-liu opened this issue Mar 16, 2015 · 3 comments
Closed

xeCJK 使西文在部分情况下无法断词 #118

leo-liu opened this issue Mar 16, 2015 · 3 comments
Assignees

Comments

@leo-liu
Copy link
Member

leo-liu commented Mar 16, 2015

Original issue 119 created by LeoLiu.PKU on 2013-04-25T09:46:20.000Z:

当长单词前面有 FullLeft 标点时,无法断词。测试代码:

\documentclass{article}
\usepackage{xeCJK}[2013-01-11 v3.1.2]
\setCJKmainfont{SimSun}
\begin{document}

\parindent0pt
\hsize7em

\rule{7em}{1pt}

中文字(international)中文字

\rule{7em}{1pt}

中文汉《international中文汉字

\rule{7em}{1pt}

中文字(international)中文字

\rule{7em}{1pt}

中文汉字international中文汉字

\end{document}

对比不用 xeCJK 改取 \XeTeXlinebreaklocale 时,可以正常输出:

\documentclass{article}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip 0pt plus 1pt
\usepackage{fontspec}
\setmainfont{SimSun}
\begin{document}

\parindent0pt
\hsize7em

\rule{7em}{1pt}

中文字(international)中文字

\end{document}

@leo-liu leo-liu self-assigned this Mar 16, 2015
@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #1 originally posted by sobenlee on 2013-04-25T11:10:13.000Z:

暂时的办法是在 FullLeft 和长单词之间加一个 \hskip0pt\relax,就可以正常断词。目前,在 FullLeft 后面总有 \penalty 10000,这可能影响到了 TeX 的断词算法。

@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #2 originally posted by sobenlee on 2013-05-20T09:42:45.000Z:

r409 按上面的方法进行了修正。

@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #3 originally posted by sobenlee on 2013-07-02T12:24:36.000Z:

无意中翻看 fixltx2e 的代码,发现 LaTeX2e 中有类似的问题,提供的解决办法也是加一个长度为 0 的 glue。

http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/3498

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