Bibitem을 사용하는 경우 LaTeX 컴파일을 중단합니다.

Bibitem을 사용하는 경우 LaTeX 컴파일을 중단합니다.

\bibitem을 사용하는 경우 LaTeX 컴파일을 중단하는 방법은 무엇입니까? 다음은 컴파일이 실패하기를 원하는 코드 조각입니다.

\documentclass{article}
\usepackage{amssymb,longtable,amsmath,booktabs,url,amstext,array,geometry}

\begin{document}
\cite{notes}
\cite{notes2}

\begin{thebibliography}{1}
\bibitem{notes} John W. Dower {\em Readings compiled for History 21.479.}  1991.
\end{thebibliography}
\end{document}

답변1

의견에서 언급했듯이 bibtex 또는 biber를 사용하여 참고문헌을 생성하는 것이 더 낫습니다. 그러나 latex는 정의되지 않은 인용이나 참조에 대해 문서 끝에서 경고하며 원할 경우 경고가 아닌 오류를 쉽게 만들 수 있습니다.

\documentclass{article}
\usepackage{amssymb,longtable,amsmath,booktabs,url,amstext,array,geometry}

\makeatletter
\def\G@refundefinedtrue{%
  \gdef\@refundefined{%
    \GenericError{}{}{There were undefined references}{you wanted an error}}}
\makeatother
\begin{document}
\cite{notes}
\cite{notes2}

\begin{thebibliography}{1}
\bibitem{notes} John W. Dower {\em Readings compiled for History 21.479.}  1991.
\end{thebibliography}
\end{document}

위와 같이 터미널 출력에 다음이 표시됩니다.

! .

There were undefined references
Type  H <return>  for immediate help.
 ...                                              

l.16 \end{document}

? h
you wanted an error
? 

관련 정보