XeTeX 希伯来语与 LyX 的问题

XeTeX 希伯来语与 LyX 的问题

我正在使用 LyX,并尝试使用 XeTeX 用希伯来语书写。我收到以下错误消息:

undefined control sequence
Package polyglossia error

这是一个我应该手动获取的包吗?我想说的是,问题只出现在希伯来语字体上。如果我正在编写英文文档,它可以很好地编译,没有任何问题。

编辑

好的,我已经编写了一个 MWE 并将其导出到 TeX 文件,我得到了以下内容:

%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,hebrew]{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{David}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
שלום עולם. זוהי דוגמה למסמך עברי\L{
\[
E=mc^{2}
\]
}זו הנוסחה המפורסמת של אינשטיין
\end{document}

错误信息如下:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Fatal fontspec error: "cannot-use-pdftex"
The fontspec package requires either XeTeX or LuaTeX to function
You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
instead of plain "latex" or "pdflatex"
See the fontspec documentation for further information
For immediate help type H <return>
...............................................  :    }

答案1

如果您有完整的 TeXLive 发行版,xelatex应该已经安装好了,并且您应该能够Document→Settings...→Fonts→Use non-TeX fonts (via XeTeX/LuaTeX)在 LyX 中选择使用 编译您的文档xelatex。如果这不起作用,您需要告诉我们有关如何安装 TeX 发行版的更多信息。

答案2

如果您使用的是 Linux,则可能必须先安装 XeTeX 包。假设您已完成此操作,则可能需要按照说明在 Lyx 中设置 XeTeX:

http://wiki.lyx.org/LyX/XeTeX

一旦您设置好它,您应该能够按照艾伦的建议选择希伯来字体。

相关内容