我实际上在同一行上两次遇到错误。无法弄清楚是什么原因造成的。我的代码:
\documentclass{article}
\usepackage[left=1in, top=1in, bottom=1in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{flalign*}
\textbf{14c)} \quad & \text{Let } V(x,y) \text{ be "} x \text{ has visited } y \text{",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \{ \text{places} \} &\\
& \exists x (V(x, \text{Alaska}) \land \neg V(x, \text{Hawaii})) &\\
\textbf{d)} \quad & \text{Let } L(x,y) \text{ be "} x \text{ has learned at least } y \text{ programming languages",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \R &\\
& \forall x (L(x, 1)) &\\
\textbf{e)} \quad & \text{Let } T(x,y) \text{ be "} x \text{ has taken every course offered by } y \text{",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \{ \text{departments in this school} \} &\\
& \exists x,y (T(x,y))
\end{flalign*}
\end{document}
错误:2.tex:80:未定义控制序列。[\end{flalign*}]
答案1
这可能就是您所需要的(\R
现在定义为黑板 R):
\documentclass{article}
\usepackage[left=1in, top=1in, bottom=1in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand\R{\mathbb{R}}
\begin{document}
\begin{flalign*}
\textbf{14c)} \quad & \text{Let } V(x,y) \text{ be "} x \text{ has visited } y \text{",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \{ \text{places} \} &\\
& \exists x (V(x, \text{Alaska}) \land \neg V(x, \text{Hawaii})) &\\
\textbf{d)} \quad & \text{Let } L(x,y) \text{ be "} x \text{ has learned at least } y \text{ programming languages",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \R &\\
& \forall x (L(x, 1)) &\\
\textbf{e)} \quad & \text{Let } T(x,y) \text{ be "} x \text{ has taken every course offered by } y \text{",} &\\
& \text{where } x \in \{ \text{students in this class} \} \text{ and } y \in \{ \text{departments in this school} \} &\\
& \exists x,y (T(x,y))
\end{flalign*}
\end{document}
答案2
日志文件中报告的错误消息是
! Undefined control sequence.
<argument> ...is class} \} \text { and } y \in \R
&\\ & \forall x (L(x, 1)) ...
l.17 \end{flalign*}
这很清楚地说明了问题是什么:该命令\R
默认没有定义,它应该被定义,可能用
\newcommand{\R}{\mathbb{R}}
或者
\newcommand{\R}{\mathbf{R}}
根据您的风格偏好。
您可能需要考虑使用列表,而不是那个繁琐的flalign
环境。
\documentclass{article}
\usepackage[
left=1in,
top=1in,
bottom=1in,
showframe,
]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{enumitem}
\newcommand{\R}{\mathbb{R}}
\begin{document}
\begin{enumerate}[
leftmargin=3.5em,
labelwidth=2.5em,
labelsep=1em,align=right,
]
\item[\bfseries 14c)]
Let $V(x,y)$ be ``$x$ has visited $y$'', where
$x \in \{ \text{students in this class} \}$
and $y \in \{ \text{places} \}$ \\*
$\exists x (V(x, \text{Alaska}) \land \neg V(x, \text{Hawaii}))$
\item[\bfseries d)]
Let $L(x,y)$ ``$x$ has learned at least $y$ programming languages'',
where $x \in \{ \text{students in this class} \}$ and $y \in \R$, \\*
$\forall x (L(x, 1))$
\item[\bfseries e)]
Let $T(x,y)$ be ``$x$ has taken every course offered by $y$'',
where $x \in \{ \text{students in this class} \}$ and
$y \in \{ \text{departments in this school} \}$ \\*
$\exists x,y (T(x,y))$
\end{enumerate}
\end{document}
该showframe
选项负责文本块周围的细线,对生产版本进行注释。