Closed sjx95 closed 4 years ago
这是底层 dvipdfmx 驱动的问题,已经被报告过多次了,如本项目中的 #353, #362, #440
这个问题在 TeX Live 2019 中修复了,但是根据 @aminophen 在 https://github.com/pgf-tikz/pgf/issues/692#issuecomment-592883450 提供的信息:
In r53973, dvipdfmx restored the previous behavior due to
so the fake-bold problem reappeared.
因为某些原因,TeX Live 2020 中的 dvipdfmx 恢复了之前的修改,导致这个问题又重现了。
提供一个临时方案,思路是在插图命令前后添加 pdf literal,局部修改 text rendering mode (0 Tr
)。(还有很少用的 \includegraphics*
语法没有兼顾,理论上可以通过 patch \includegraphics
的某个内部宏来实现,先这样吧。)
\makeatletter
\let\includegraphics@backup\includegraphics
\renewcommand\includegraphics[2][]{%
\special{pdf:code q 0 Tr}%
\includegraphics@backup[#1]{#2}%
\special{pdf:code Q}%
}
\makeatother
效果测试
% 故意设置很大的 AutoFakeBold,突出效果
\documentclass[AutoFakeBold=10]{ctexart}
\usepackage{graphicx}
% 使用某个没有粗体的字体,macOS 可以用 STSong
\setCJKmainfont{SimSun}
\begin{document}
% 使用 mwe 宏包提供的 eps 文件
默认效果测\textbf{试}
\includegraphics[scale=0.5]{example-image.eps}
\makeatletter
\let\includegraphics@backup\includegraphics
\renewcommand\includegraphics[2][]{%
\special{pdf:code q 0 Tr}%
\includegraphics@backup[#1]{#2}%
\special{pdf:code Q}%
}
\makeatother
临时方案效果测\textbf{试}
\includegraphics[scale=0.5]{example-image.eps}
\end{document}
很抱歉没有仔细搜索历史 issue,并十分感谢两位前辈提供的信息。 由于我已经把 TL2020 换成了 TL2019 Final,在论文完稿前应该暂时不会去折腾了,等后面结题了再仔细研究一下。
你可以改变eps文件的文字为通道,这样就不会被加粗了,Inkscape,可以导出为文字通道格式的eps文件
我的问题类似,是与 tcolorbox
的兼容性,在 \section
之后紧接着一个 tcolorbox
,后面的段落会被加粗,如果 \section
之后先出现一个段落,再放 tcolorbox
就不会有问题。
我下载了一个粗体的字体,暂时解决了问题,但是感觉有点不舒服
从 TeX Live 2019 Final 切换至 2020 并 Update 到最新(2020/05/11)后,发现 CTeX 的 AutoFakeBold 选项会把 eps 内的文本一起加粗,现象如下:
而 TeX Live 2019 Final 可以正常加粗:
进一步测试发现此问题还存在于: TeX Live 2018 Final (Debian 10 WSL repo) TeX Live 2019 ISO (Windows, http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/texlive2019-20190410.iso) TeX Live 2020 (Windows, tlnet-20200510) 但是 TeX Live 2019 Final (Windows, http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final/ ) 就没事,这就让人很郁闷了。现在我重新安装了 2019 Final,总算能继续改大论文了。
根据现象,由于第二个图显示正常,所以我猜测可能是 xeCJK 没有正确结束伪加粗?不知这一问题应当如何解决?
TeX:
测试样例: test-eps.zip