\newcommand{\FakeBoldSize}{4}
% NOTE:
% To use LuaTeX, we manually set the AutoFakeBold size for each font,
% because in LuaTeX, CTeX invokes luatexja which does not recognize a global
% AutoFakeBold setting. So we need to set AutoFakeBold for each font.
% ctex package stores one of "windows", "mac", and "fandol" in \g__ctex_fontset_tl
\ifthenelse{\equal{\csname g__ctex_fontset_tl\endcsname}{mac}}
{
\IfFileExists{ /System/Library/Fonts/PingFang.ttc }
{
% MacOS El Capitan and later version
% https://github.com/CTeX-org/ctex-kit/issues/351
% Fonts
% Fix songti font invocation in `ctex` package on MacOS old version, to enable bold font
% Detailes in: https://github.com/TheNetAdmin/zjuthesis/issues/48
% Similar implementation: https://github.com/xueruini/thuthesis/blob/a86b0824da527268645571cc5fe3096d65a665b3/thuthesis.dtx#L1447-L1461
\setCJKfamilyfont{zhfs} {Fangsong} [AutoFakeBold={\FakeBoldSize}]
\setCJKfamilyfont{zhhei} {Heiti SC Light} [BoldFont={Heiti SC Medium}]
\setCJKfamilyfont{zhkai} {Kaiti SC} [BoldFont={Kaiti SC Bold}]
\setCJKfamilyfont{zhsong} {Songti SC Light} [BoldFont={Songti SC Bold}]
\setCJKmainfont[AutoFakeBold={\FakeBoldSize}]{Fangsong}
}
}
\setmainfont[Path=./fonts/, BoldFont={*Bold}, ItalicFont={*Italic}, BoldItalicFont={*BoldItalic}]{TimesNewRoman}
\renewcommand{\bibfont}{\zihao{5}\songti}
操作系统
MacOS
TeX 套件
TeXLive 2021 或更新的版本
TeX Compiler
XeTeX
zjuthesis 版本号
v10.0.1
MajorFormat
general
Degree
undergraduate
Type
thesis
Period
proposal
BlindReview
false
GradLevel
master
问题描述
修改了模板内的
./config/format/general/fonts.tex
。使用 xelatex 编译,tex版本见下图
遇到了字体缺失的问题,中文无法显示![image](https://github.com/TheNetAdmin/zjuthesis/assets/80182956/a979758d-5431-4533-949b-bbdd929929a5)
编译日志
zjuthesis.log
代码
./config/format/general/fonts.tex
现在的代码:截图
No response
其他信息
No response