3

I actually get the error twice on the same line. Can't figure out what's causing it. My code:

\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}

The error: 2.tex:80: Undefined control sequence. [\end{flalign*}]

1
  • 1
    \R is not defined. If you remove that, the code runs fine for me.
    – Troy
    Commented Jan 19, 2017 at 3:19

2 Answers 2

3

It is probably what you needed (\R is now defined as blackboard 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}
1

The error message, as reported on the log file, is

! Undefined control sequence.
<argument> ...is class} \} \text { and } y \in \R 
                                                  &\\ & \forall x (L(x, 1)) ...
l.17 \end{flalign*}

which makes pretty clear what's the problem: the command \R has no definition by default and it should be defined, possibly with

\newcommand{\R}{\mathbb{R}}

or

\newcommand{\R}{\mathbf{R}}

according to your stylistic preferences.

You may want to consider using a list, rather than that cumbersome flalign environment.

\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}

The showframe option is responsible for the thin lines around the text block, comment it for the production version.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .