Undefined control sequence. \setmainfont
我在编译简单的 MWE 时遇到了错误。
我在 Ubuntu 22.04 上使用 TeXStudio 4.2.1,并安装了以下字体:/usr/share/fonts/truetype/fonts-beng-extra/Ani.ttf
这是我的母亲:
% !TeX program = lualatex
\documentclass{article}
\RequirePackage{luatex85}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{emerald}
\usepackage{geometry}
\usepackage{luacode}
\usepackage{luaotfload}
\setmainfont{Ani}
\geometry{a4paper,left=20mm,right=20mm,top=20mm,bottom=20mm}
\begin{document}
hello
\end{document}
这是日志文件的摘录:
! Undefined control sequence.
<recently read> \setmainfont
l.14 \setmainfont
{ani}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
我究竟做错了什么?