xelatex编译用ctex包制作的tex文件时报错“Cannot use \XeTeXOTcountfeatures with nullfont”,怎么解决?

发布于 2025-05-24 12:28:59

使用texlive 20253月8号的版本

tex文件内容

\documentclass{ctexart}
\begin{document}
你好 \LaTeX\ 世界!
\end{document}

错误:

ctex-fontset-windows.def: 错误: : Package fontspec Error:
ctex-fontset-windows.def: 错误: 101: Cannot use \XeTeXOTcountfeatures with nullfont; not an OpenType Layout font. }
ctex-fontset-windows.def: 错误: 101: Missing = inserted for \ifnum. }

win10 22h2 打了最新的更新

请问有什么解决办法吗?

完整的日志文件:

! Package fontspec Error: 
(fontspec)                The font "SimHei" cannot be found; this may be but
(fontspec)                usually is not a fontspec bug. Either there is a
(fontspec)                typo in the font name/file, the font is not
(fontspec)                installed (correctly), or there is a bug in the
(fontspec)                underlying font loading engine (XeTeX/luaotfload).

For immediate help type H <return>.
 ...                             

查看更多

关注者
0
被浏览
112
2 个回答
Skyrmion
Skyrmion 10小时前
Looking forward to my Ph.D. offer...

我曾在 GitHub 工作流测试我开发的模板时遇到相同的报错,经检查这是因为你的 Windows 系统中并未在可选功能中安装简体中文字体包
我曾遇到的错误如下:
image.png
报错

这是因为系统中并不存在相应的字体,可能是在安装 Windows 时选择外区导致的
(毕竟,GitHub 工作流安装 Windows 肯定选用外区,才不会额外安装简中字体包)

SJTUTHESIS 给出了解决方式
image.png

在系统设置 -> 可选功能中安装支撑字体即可

Sagittarius Rover
Sagittarius Rover 11小时前
我要成为Typst糕手/(ㄒoㄒ)/~~

请提供你的操作系统(是否是windows?)

同时你需要提供你所说的『ctex做的tex文件』的.tex文件内容,或者测试如下的最简代码:

\documentclass{ctexart}
\begin{document}
你好 \LaTeX\ 世界!
\end{document}

看看问题是否存在。有可能是安装时提前关闭了安装界面,进而没有做好字体配置所致(?)

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览