我想使用 calibri 文本和 cambria 数学字体来写方程式,并使用 lualatex。当我的文件中没有方程式时,一切都正常,但当我添加方程式时,我收到错误消息“未定义控制序列”。
这是我的文件:
\documentclass[12pt,a4paper]{article}
\usepackage{polyglossia}
\setdefaultlanguage{greek}
\setotherlanguage{english}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Calibri}
\setmathfont{Cambria Math}
\begin{document}
some text\\
Ορισμένο ολοκλήρωμα: % definite integral
$\int_{\alpha}^{\beta}f(x)dx = \dfrac{3}{\sqrt{5}-2}$
\end{document}
以及发生错误时的日志文件
! Undefined control sequence.
l.13 $\int_{\alpha}^{\beta}f(x)dx = \dfrac
{3}{\sqrt{5}-2}$
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.
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf" [1
{C:/Users/user/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(C:/Users/user/Documents/LaTeX/test_lualatex.aux
luatex-hyphen: loading patterns and exceptions for: greek (\language24)
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf"
luaotfload | load : Lookup/name: "Calibri" -> "calibri.ttf")
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
)
Here is how much of LuaTeX's memory you used:
20047 strings out of 494734
100000,552014 words of node,token memory allocated
310 words of node memory still in use:
nodes
avail lists: 1:52,2:67,3:23,4:41,5:14,6:49,7:3,8:2,9:511,10:981,11:520,12:229
23203 multiletter control sequences out of 65536+200000
47 fonts using 14496391 bytes
61i,4n,63p,829b,249s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Windows/Fonts/cambria.ttc(CambriaMath:1)><C:/Windows/Fonts/cambria.ttc(Cambr
iaMath:1)><C:/Windows/Fonts/calibri.ttf>
Output written on test_lualatex.pdf (1 page, 71199 bytes).
PDF statistics: 27 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 131072)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
答案1
\dfrac
在包中定义amsmath
。在之前加载此包unicode-math
。(该问题与 LuaLaTeX 或字体无关。)