答案1
您的示例产生以下控制台输出(在?
提示符下我输入了“Return”):
! Undefined control sequence.
l.8 \item $|\langle v, w \rangle| \leq \norm
{v} \norm{w}$
?
! Undefined control sequence.
l.8 ...$|\langle v, w \rangle| \leq \norm{v} \norm
{w}$
?
! Undefined control sequence.
<recently read> \norm
l.9 \item \norm
{v + w} \leq \norm{v} + \norm{w}
?
! Missing $ inserted.
<inserted text>
$
l.9 \item \norm{v + w} \leq
\norm{v} + \norm{w}
?
! Undefined control sequence.
l.9 \item \norm{v + w} \leq \norm
{v} + \norm{w}
?
! Undefined control sequence.
l.9 \item \norm{v + w} \leq \norm{v} + \norm
{w}
?
! LaTeX Error: Command \end{enumerate} invalid in math mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \end{enumerate}
?
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \end{enumerate}
?
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \end{enumerate}
?
! Missing $ inserted.
<inserted text>
$
l.10 \end{enumerate}
?
有十处错误。
\norm
不是标准命令,如果您想使用它,您必须定义它。\le
是一个数学命令,因此它需要位于内部$...$
(对于内联数学模式)或位于数学显示环境中。- 如果跳过错误,TeX 将尽力恢复,在这种情况下它无法找到真正的枚举项。
这是一个固定的代码。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} % necessary for math
\usepackage{enumerate}
\newcommand{\norm}[1]{\lvert#1\rvert}
\begin{document}
\begin{enumerate}[i]
\item $|\langle v, w \rangle| \leq \norm{v} \norm{w}$
\item $\norm{v + w} \leq \norm{v} + \norm{w}$
\end{enumerate}
\end{document}