我正在尝试在 Texmaker 上使用 2016 LUMC Beamer 模板 2.0 进行演示,但出现无法找到 calibri 字体的错误。所有字体文件 .ttf 都在项目文件夹(我下载的默认文件夹)内,我尝试了 LuaLaTex 和 XeLaTex,但都没有用。到目前为止,我只使用 pdfLatex,所以我很困惑,在切换到 LuaLaTex 时我是否做错了什么(我在用户命令 lualatex -interaction=nonstopmode %.tex 中插入以下命令),或者我必须将字体文件放在其他地方。
字体已加载到文件中 beamerfontthemelumc.sty
\mode<presentation>
\newcommand\customfont[1]{{\usefont{T1}{font}{m}{n} #1 }}
\usepackage{fontspec}
\setmainfont[%NormalFont = Calibri.ttf,
BoldFont = Calibrib.ttf,
ItalicFont = Calibrii.ttf,
BoldItalicFont = Calibriz.ttf]{Calibri}
\setsansfont[Font = Calibri.ttf,
BoldFont = Calibrib.ttf,
ItalicFont = Calibrii.ttf,
BoldItalicFont = Calibriz.ttf]{Calibri.ttf}
\usepackage[math-style=ISO]{unicode-math}
\setbeamerfont{header}{family=\ttfamily}
\setbeamerfont{title}{parent=header,size={\fontsize{24}{24}}, series = \bf}
\setbeamerfont{subtitle}{parent=header, size={\fontsize{20}{20}},series = \bf}
\setbeamerfont{author}{parent=header, size={\fontsize{20}{20}},series = \normalfont}
\setbeamerfont{place}{parent=header, size={\fontsize{14}{14}},series = \normalfont}
\setbeamerfont{date}{parent=header, size=\normalsize}
\setbeamerfont{institute in title}{parent=header, size=\small,series = \normalfont}
\setbeamerfont{endtext}{parent=header,size=\huge,series = \normalfont}
\setbeamerfont{endauthor}{parent=header,size=\large,series = \normalfont}
\setbeamerfont{endlink}{parent=header,size=\Large,series = \normalfont}
%%Outline font
\setbeamerfont{section in toc}{parent=header,size={\fontsize{20}{20}},series=\bf}
\setbeamerfont{subsection in toc}{parent=header,size={\fontsize{18}{18}},series = \it}
%navigation symbols
\setbeamerfont{navigation symbols}{parent=header, size={\fontsize{14}{14}},series = \bf}
%% This part is unclear yet
\setbeamerfont{header author}{parent=header,size={\fontsize{24}{24}},series = \normalfont}
\setbeamerfont{header date}{parent=header,size={\fontsize{24}{24}},series = \normalfont}
\setbeamerfont{header number}{parent=header,size={\fontsize{24}{24}},series = \normalfont}
\setbeamerfont{header title}{parent=header,size={\fontsize{24}{24}},series = \normalfont}
% Frame font
\setbeamerfont{frametitle}{parent=header,size={\fontsize{24}{24}}, series = \bf}
\setbeamerfont{framesubtitle}{parent=header,size={\fontsize{20}{20}},series = \normalfont}
% block font
\setbeamerfont{block title}{parent=header,size={\fontsize{20}{20}},series = \bf}
\setbeamerfont{block body}{parent=header,size={\fontsize{24}{24}},series = \bf}
% itermize font
\setbeamerfont{itemize/enumerate body}{parent=header,size={\fontsize{18}{18}},series = \normalfont}
\setbeamerfont{itemize/enumerate subbody}{parent=header,size={\fontsize{18}{18}},series = \normalfont}
\setbeamerfont{footer}{parent=header,size={\fontsize{12}{12}},series = \bf}
\mode
<all>
我尝试插入\usepackage{fontspec} \setmainfont{Calibri}
Main.tex 文件,但出现同样的错误。