我正在尝试通过 Lyx 使用 Polyglossia 包。使用 XeLaTeX 进行编译时,出现未定义的控制序列错误,文件无法编译。
适用于 Windows 7、Lyx 2.03 和 MiKTeX 2.9。顺便说一句:我已将字体设置为 Arial,因为我知道它是固定宽度的字体。它不适用于任何类型的字体。
MWE(Lyx 来源):
\documentclass{article}
\usepackage{theorem}
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\setmainfont[Mapping=tex-text]{Arial}
\setsansfont[Mapping=tex-text]{Arial}
\setmonofont{Arial}
\theorembodyfont{\upshape}
\newtheorem{theorem}{משפט}[section]
\begin{document}
\begin{english}%
hello
\end{english}%
שלום
\end{document}
这是 XeLaTeX 的错误信息(我删掉了前几行):
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> EU1/Arial(0)/bx/it on input line 24.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> EU1/Arial(0)/bx/n on input line 24.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> EU1/Arial(1)/bx/n on input line 24.
! Undefined control sequence.
\@begindocumenthook ...aybe_setup_maths: \make@lr
\thetheorem \xpg@initial@s...
l.24 \begin{document}
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
spel
答案1
您的最小工作示例应该更改为:
\documentclass{article}
\usepackage{ntheorem}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\setmainfont[Mapping=tex-text]{Arial}
\setsansfont[Mapping=tex-text]{Arial}
\setmonofont{Arial}
\theorembodyfont{\upshape}
\newtheorem{theorem}{משפט}[section]
\begin{document}
\begin{english}%
hello
\end{english}%
שלום
\end{document}