エラー: \item は数式モードでは無効です

エラー: \item は数式モードでは無効です

正規表現に縦棒を入れたいのですが、入れるとエラーが出続けます\mid。助けてもらえますか?

\item \textbf{Give a regular expression for the language accepted by the automaton~$A$.} \\\\
(0 \mid 1)*01)0 \mid 1)*\\
 \item \textbf{Explain what makes the automaton~$A$ non-deterministic.}\\\\
 The reason automaton~$A$ is non-deterministic is because in the state q0 reading a 0 can either lead to $q_0$ or $q_1$.

答え1

\midtex が数式モードに切り替わり、次の に到達してもまだ数式モードのままであるため\item、予期しないエラー メッセージが表示されます。

\mid現在の行の代わりに、番号なしの数式表示を含む行を作成します。

\item \textbf{Give a regular expression for the language accepted by the automaton~$A$.}
\[ (0 \mid 1)*01)0 \mid 1)* \]
 \item \textbf{Explain what makes the automaton~$A$ non-deterministic.}

 The reason automaton~$A$ is non-deterministic is because in the state $q_0$ reading a $0$
 can lead to either $q_0$ or $q_1$.

すでに述べたように、二重のバックスラッシュを使用するのは良い習慣ではありません。 \parを使用する場合と\\ 詳細については。

編集:何が数学で何が数学でないかというコメントに基づいて、元のコードを調整しました。また、わかりやすくするために、「どちらか」の位置に「編集用鉛筆」を適用しました。(思い込みで申し訳ありません。なぜ私がこのようにこだわるのかを理解するには、私のユーザー プロファイルを参照してください。)

関連情報