「未定義的控制序列。[\end{flalign*}]」錯誤我似乎無法修復

「未定義的控制序列。[\end{flalign*}]」錯誤我似乎無法修復

實際上我在同一行上得到了兩個錯誤。無法弄清楚是什麼原因造成的。我的程式碼:

\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選項負責文字區塊周圍的細線,在生產版本中對其進行註釋。

在此輸入影像描述

相關內容