Closed StevenHD closed 2 years ago
请问你的Mac是否为Big Sur及以上版本?
在thesis-setting.tex中,找到设置中文字体
区域,里面有一段代码块通过ifplatfrom
宏包实现了跨平台编译不同字体控制流。如下所示:
%---------------------------------设置中文字体---------------------------------%
\usepackage{fontspec}
\usepackage[SlantFont,BoldFont,CJKchecksingle]{xeCJK}
% \usepackage{CJKnumb}
% \RequirePackage{CJKnumb}
% 使用默认字体
\newcommand\defaultSog{SimSong}
\newcommand\defaultHei{Heiti SC}
\newcommand\defaultKai{Kaiti SC}
\newcommand\defaultFag{STFangSong}
\newcommand\defaultEngFont{Times New Roman}
\newcommand\codeFont{Consolas}
% windows环境
\ifwindows
\renewcommand\defaultSog{SimSun}
\renewcommand\defaultHei{SimHei}
\renewcommand\defaultKai{KaiTi}
\renewcommand\defaultFag{FangSong}
\renewcommand\defaultEngFont{Times New Roman}
\renewcommand\codeFont{Consolas}
\fi
\ifmacosx
%...
%...
\fi
%...
推测是ifplatform
宏包不支持Big Sur和以上系统的判断导致的。可以将\ifmacosx
内的代码拿出来。后果是这个代码将只能在OSX上运行。
确实是这样的,而且我还发现CJKnum这个库应当被注释掉,要不然在MacOS下也跑不通
妈的,这玩意还是我自己加的,我是🐖
@kidozh 并不是,之前以为格式规定的是“第一章,第二章”,后来发现笑死根本没有这个规定。所以就闲置了这个包了
@StevenHD 应该修复了,您可以查看下最新版本 Download ZIP
编译报错
报错信息: /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:128: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:128: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:128: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:128: Package fontspec Error: The font "" cannot be found. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:129: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:129: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:129: Undefined control sequence. [...ltKai, BoldFont=\defaultHei]{\defaultSog}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:131: Undefined control sequence. [\setmonofont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Package fontspec Error: The font "" cannot be found. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:132: Undefined control sequence. [\setmainfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Package fontspec Error: The font "" cannot be found. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:134: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:135: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:136: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:137: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:138: Undefined control sequence. [\setCJKfamilyfont] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/settings/thesis-setting.tex:140: Undefined control sequence. [\newcommand] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/coverpage.tex:6: Package fontspec Error: The font "" cannot be found. [^^I^^I\fHei] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/coverpage.tex:21: Package fontspec Error: The font "" cannot be found. [^^I^^I\fSong] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/coverpage.tex:65: Package fontspec Error: The font "" cannot be found. [^^I^^I\sSanhao\fKai] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/coverpage.tex:81: Package fontspec Error: The font "" cannot be found. [...R{20XX}\fSong{年}\fTNR{X}\fSong{月}} \hfill}] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Undefined control sequence. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/frontmatter/frontpage_eng.tex:8: Package fontspec Error: The font "" cannot be found. [^^I^^I^^I\sSanhao] /Users/Desktop/Yet-Another-LaTeX-Template-for-NPU-Thesis/chapters/chapter01.tex:31: Package fontspec Error: The font "" cannot be found. [...$,超高公式会被压缩$\frac{1}{2}=0.5$或者使用\lstinline`]
分析了一下:是字体原因,但是不知道怎么解决。。