我使用 xelatex 撰写论文。这是我的序言
\documentclass[12pt, a4paper, oneside, openany]{book}
\usepackage{xltxtra}
\usepackage{xgreek}
\usepackage{amsmath}
\usepackage{amsfonts}
%\usepackage{amssymb}
\usepackage{amsthm}
\setmainfont{Times New Roman}
后来在我的文档中我使用对齐来呈现方程式
\begin{align*}
\forall s \in Q, \forall w \in \Sigma^\ast, \forall \alpha \in \Sigma, & ~ \delta (s, \epsilon) = s, \delta (s, w\alpha )=\delta (\delta (s, w), \alpha ); \\
& ~ \sigma (s, \epsilon )= \epsilon, \sigma (s, w\spaha)= \sigma (s, w)\sgima (\delta (s,w), \alpha ).
\end{align*}
但是当我用 TexMaker 编译它时,它显示已完成并出现错误。但是 pdf 输出正常。我从日志文件中得到的错误与未定义的 \end{align} 有关
! Undefined control sequence.
<argument> ...on )= \epsilon , \sigma (s, w\spaha
)= \sigma (s, w)\sgima (\d...
! Undefined control sequence.
<argument> ... (s, w\spaha )= \sigma (s, w)\sgima
(\delta (s,w), \alpha ).
l.71 \end{align*}
我的公式有问题吗?它在我的 pdf 文档上正常且正确地呈现
如果我取消注释 amssymb,我会收到不同的错误,例如:
! LaTeX Error: Command `\Finv' already defined.
! LaTeX Error: Command `\Game' already defined.
! LaTeX Error: Command `\beth' already defined.
! LaTeX Error: Command `\daleth' already defined.
我以前用过 amssymb,但和 latex 一起使用时没有出现问题。有什么帮助吗?
我认为是 Texlive 2009(Ubuntu 12.04)和 Texmaker 3.2 我的环境
答案1
\spaha
是外部命令,必须在其他地方定义。但是,您应该加载全部字体特定的东西前 fontspec
:
\documentclass[12pt, a4paper, oneside, openany]{book}
\usepackage{xgreek}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\let\spaha\relax%% because I do not know the meaning
\begin{document}
and later in my document i use the align to render an equation
\begin{align*}
\forall s \in Q, \forall w \in \Sigma^\ast, \forall \alpha \in \Sigma, & ~ \delta (s, \epsilon) = s, \delta (s, w\alpha )=\delta (\delta (s, w), \alpha ); \\
& ~ \sigma (s, \epsilon )= \epsilon, \sigma (s, w\spaha)= \sigma (s, w)\sigma (\delta (s,w), \alpha ).
\end{align*}
\end{document}
TeXLive 2009 是一个非常旧的版本。当前版本是 2013