LegrandOrangeBook 类更改了序言章节的字体系列

LegrandOrangeBook 类更改了序言章节的字体系列

我真的很难改变部分、章节和节标题的字体系列罗格朗橙皮书等级main.tex。我希望用我下载的一些谷歌字体来更改我的序言中的内容。

到目前为止我所拥有的是:

\documentclass[
12pt,
fleqn, 
a4paper,
]{LegrandOrangeBook}

\usepackage{fontspec}

\chapterimage{orange1.jpg} % Chapter heading image
\chapterspaceabove{6.5cm} % Default whitespace from the top of the page to the chapter title on chapter pages
\chapterspacebelow{6.75cm} % Default amount of vertical whitespace from the top margin to the start of the text on chapter pages

\setmainfont[ % Selected specific google font
Path = ./static/Rubik/static/,
Extension = .ttf,
UprightFont = *-Regular,
BoldFont = *-Medium,
ItalicFont = *-Italic,
BoldItalicFont = *-MediumItalic,
]{Rubik}
\newfontfamily{\chapterfont}{Quicksand}[ % Selected specific google font
Path = ./static/Quicksand/static/,
Extension = .ttf,
UprightFont = *-Regular,
BoldFont = *-Bold,
]

\begin{document}

\chapter{Title}

\end{document}

虽然它确实可以编译,但它没有设置正确的字体。

我尝试\titleformat在序言中重新定义main.tex

\titleformat
{\chapter} % Section type being modified
[block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
{\chapterfont}{\outputchaptertitle{\thechapter}{#1}} % Format of the whole section
{} % Format of the section label
{0cm} % Space between the title and label
{} % Code before the label
[] % Code after the label

虽然它确实可以编译,但它没有设置正确的字体,并且会出现以下错误:

! LaTeX Error: Missing \begin{document} 
[…]
! Missing number, treated as zero.
<to be read again> 
                   !
l.101 ^^I\chapter{Title}
[…]
! Illegal unit of measure (pt inserted).
<to be read again> 
                   !
l.101 ^^I\chapter{Title}

我不确定我是否理解这里的问题信息。

相关内容