CTeX-org / ctex-kit

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

xeCJKfntef:textformat 设置颜色的问题 #613

Closed zepinglee closed 2 years ago

zepinglee commented 2 years ago
macOS 12.3.1
TeX Live 2022
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-10>
Package: color 2021/12/07 v1.3c Standard LaTeX Color (DPC)
Package: xeCJK 2021/12/12 v3.8.8 Typesetting CJK scripts with XeLaTeX
Package: xeCJKfntef 2021/12/12 v3.8.8 xeCJK font effect
\documentclass{article}
\usepackage{color}
\usepackage{xeCJK}
\usepackage{xeCJKfntef}
\begin{document}
\CJKunderline[textformat=\color{blue}]{虚室生白,吉祥止止}
\end{document}

编译得到的下划线有一串多余的“1”。

Screen Shot 2022-04-13 at 23 43 34

如果交换 colorxeCJK 的调用顺序,会导致颜色消失。

Screen Shot 2022-04-13 at 23 47 31
muzimuzhi commented 2 years ago

xelatex + color 包 + \color_ensure_current: 即可复现。问题和 l3backend\__color_backend_pickup:N 的修改有关,我报给 latex3 了,见 https://github.com/latex3/latex3/issues/1085

muzimuzhi commented 2 years ago

xeCJKfntef 的关系:用到了 \color_ensure_current: https://github.com/CTeX-org/ctex-kit/blob/a8907eefdd8b69a609f94c016d017fa96dd5f146/xeCJK/xeCJK.dtx#L10146-L10155

PS: \hbox_set:Nn 已经自带了 \color_group_begin:\color_group_end:,此处可以删去了。

zepinglee commented 2 years ago

xelatex + color 包 + \color_ensure_current: 即可复现。问题和 l3backend\__color_backend_pickup:N 的修改有关,我报给 latex3 了,见 latex3/latex3#1085

感谢深入的分析。

另外交换 colorxeCJK 调用顺序后无颜色的情况,在今天更新后无法复现了。可能是 File: xetex.def 2022/04/12 v5.0l Graphics/color driver for xetex 已经修复了。我昨天应该记录这个文件的版本的。

muzimuzhi commented 2 years ago

另外交换 colorxeCJK 调用顺序后无颜色的情况,在今天更新后无法复现了。可能是 File: xetex.def 2022/04/12 v5.0l Graphics/color driver for xetex 已经修复了。我昨天应该记录这个文件的版本的。

试了下,是的。懒得找原因了。默认设置下,本地会有一个历史版本的备份(tlmgr option autobackup 输出为 1),于是在这里可以用 tlmgr restore graphics-def 62085 来撤回更新。

涉及的文件是 xetex.def

涉及的修改 https://github.com/latex3/graphics-def/commit/e30e4b83990810ebbe1fb3a2c9293b9edeef4c79#diff-428a2889ece02d2edd45b19deb32d68c370dd0d299844744c53cc99457ebabfa

zepinglee commented 2 years ago

更新 l3backend-xetex.def 2022-04-14 后问题已经解决。

Screen Shot 2022-04-15 at 22 46 31

另外 xeCJK 2021/12/12 v3.8.8 的文档中 textformat 没有颜色,看来这个 bug 存在了一段时间了。

Screen Shot 2022-04-15 at 22 47 16
muzimuzhi commented 2 years ago

另外 xeCJK 2021/12/12 v3.8.8 的文档中 textformat 没有颜色,看来这个 bug 存在了一段时间了。

是我(不想信息重复而)没有发在这里,而只发在了 https://github.com/latex3/latex3/issues/1085

PS: 在最初的例子中,\CJKunderline{虚室生白,吉祥止止} 就能得到多余的 1。因为是简化例子的中间状态,所以第一条回复 https://github.com/CTeX-org/ctex-kit/issues/613#issuecomment-1098680663 中我也没提。