请问这个模板编译不成功怎么解决?

发布于 2024-02-29 23:22:37

模板链接地址:https://www.latexstudio.net/archives/9685.html,请教大佬帮忙解决,感谢

查看更多

关注者
0
被浏览
699
2 个回答
Sagittarius Rover
Sagittarius Rover 2025-01-12
我要成为Typst糕手/(ㄒoㄒ)/~~

编译不成功为何甚至不提供报错信息

其中主要的问题应该出现在字体的设置

\usepackage[no-math]{fontspec}
    \setmainfont[
        Ligatures = TeX,
        BoldFont = AGaramondPro-Semibold.otf,
%        BoldFont = AGaramondPro-Bold.otf,
        ItalicFont = AGaramondPro-Italic.otf
    ]{AGaramondPro-Regular.otf}
%    \setsansfont[
%        Ligatures = TeX,
%    ]{Source Sans Pro}
    \setsansfont[
        Ligatures = TeX,
        ItalicFont = MyriadPro-It.otf
    ]{MyriadPro-Regular.otf}
%    \newfontfamily{\helvetica}[
%        Ligatures = TeX,
%        BoldFont = HelveticaNeueLTPro-Roman.otf,
%        ItalicFont = HelveticaNeueLTPro-Roman.otf
%    ]{HelveticaNeueLTPro-Roman.otf}
%    \newfontfamily{\myriad}[
%        Ligatures = TeX,
%        ItalicFont = MyriadPro-It.otf
%    ]{MyriadPro-Regular.otf}
%中文支持
\usepackage[UTF8, heading = true]{ctex} %必须放在 xeCJK 之前调用,否则会覆盖字体设置
\usepackage{xeCJK}
    \xeCJKsetup{
        AutoFakeBold = false,
        AutoFakeSlant = false
    }
    \setCJKmainfont[
        BoldFont = 华文中宋,
        ItalicFont = 方正楷体_GBK,
        Mapping = fullwidth-stop
    ]{方正书宋_GBK}
    \setCJKfamilyfont{中宋}[BoldFont = 华文中宋, ItalicFont = 华文中宋, Mapping = fullwidth-stop]{华文中宋}
    \setCJKfamilyfont{楷体}[BoldFont = 方正楷体_GBK, ItalicFont = 方正楷体_GBK, Mapping = fullwidth-stop]{方正楷体_GBK}
    \setCJKfamilyfont{仿宋}[BoldFont = 方正仿宋_GBK, ItalicFont = 方正仿宋_GBK, Mapping = fullwidth-stop]{方正仿宋_GBK}
    \setCJKfamilyfont{黑体}[BoldFont = 方正黑体_GBK, ItalicFont = 方正黑体_GBK, Mapping = fullwidth-stop]{方正黑体_GBK}
    \newcommand{\myHeavy}{\sffamily \CJKfamily{黑体}}
%\usepackage[UTF8, heading = true]{ctex}
    \pagestyle{fancy}
    \setcounter{secnumdepth}{4}
    \ctexset{
        part = {
            format = {\bfseries \Huge \centering},
            name = {第, 篇}
        },
        chapter = {
            format = {\bfseries \LARGE \raggedright},
        },
        section = {
            format = {\bfseries \Large \centering},
        },
        subsection = {
            format = {\bfseries},
            name = {,、\hspace{-1 em}},
            numbering = true,
            number = \chinese{subsection},
        }
    }

如果不花时间仔细读懂上面的配置,同时寻找自己当前系统是否有对应的文字.
如果不提供更多的信息,上面的问题很难回答。

撰写答案

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

发布
问题

分享
好友

手机
浏览

扫码手机浏览