오류: \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를 사용해야 하는 경우와 시기\\ 자세한 내용은.

편집하다:무엇이 수학이고 무엇이 수학이 아닌지에 대한 의견을 바탕으로 원본 코드를 조정했습니다. 또한 명확성을 위해 "편집 연필"을 "둘 중 하나" 위치에 적용했습니다. (내 추측에 대해 사과드립니다. 내가 왜 이렇게 까다로운지 이해하려면 내 사용자 프로필을 참조하세요.)

관련 정보