LaTeX: '정의되지 않은 인용' 경고

LaTeX: '정의되지 않은 인용' 경고

이 샘플 코드를 실행할 때:

\documentclass[11pt,a4paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage[onehalfspacing]{setspace}
\usepackage{natbib}

\begin{document}

Hello World \cite{greenwood_theoretical_2016}

\end{document}

\bibliography{Bibliography}
\bibliographystyle{plain}

계속 경고가 나타납니다.

'입력 행 10에 정의되지 않은 1페이지의 인용 greenwood_theoretical_2016'

참조는 '로 표시됩니다.?' 문서에 있습니다.

LaTeXToolsmacOS High Sierra에서 Sublime Text 3.2를 사용하고 있습니다 .
빌더는 '기초적인' 그래서 다음과 같이 실행됩니다.

pdflatex
bibtex
pdflatex
pdflatex

Zotero에서 참고문헌을 내보내고(형식: Bibtex; 인코딩: UTF-8) 'Bibliography.bib' 파일(동일한 디렉토리에 있음)을 확인했는데 인용이 올바른 것 같습니다(예):

@article{greenwood_theoretical_2016,
title = {Theoretical, contemporary observational and palaeo-perspectives on ice sheet hydrology: {Processes} and products},
volume = {155},
issn = {0012-8252},
shorttitle = {Theoretical, contemporary observational and palaeo-perspectives on ice sheet hydrology},
url = {http://www.sciencedirect.com/science/article/pii/S0012825216300095},
doi = {10.1016/j.earscirev.2016.01.010},
urldate = {2018-12-05},
journal = {Earth-Science Reviews},
author = {Greenwood, Sarah L. and Clason, Caroline C. and Helanow, Christian and Margold, Martin},
month = apr,
year = {2016},
keywords = {Geomorphology, Esker, Meltwater, Review, Hydrology, Channel, Glacier, Ice Sheet},
pages = {1--27}

사용biblatex대신 natbib대괄호 안에 참조 라벨을 표시합니다.

안녕하세요 세상 [greenwood_theoretical_2016]

또한 다른 스타일을 사용해 보았지만 아무것도 바뀌지 않았습니다.

이에 대해 많은 질문이 있다는 것을 알고 있지만 여기서는 아무 것도 작동하지 않는 것 같습니다.

답변1

주어진 코드에는 몇 가지 문제가 있습니다.

  1. 호출 순서 \bibliographystyle\bibliography코드에서 변경되어야 합니다(스타일 우선!).
  2. 로딩 중에는 스타일을 대신 natbib사용하는 것이 좋습니다plainnatplain
  3. \end{document}참고 문헌을 부르기 전에 요 . 이는 이후의 코드가 \end{document}실행되지 않음을 의미합니다.

다음 코드를 사용하세요:

\RequirePackage{filecontents}
\begin{filecontents*}{Bibliography.bib}
@article{greenwood_theoretical_2016,
  title = {Theoretical, contemporary observational and palaeo-perspectives 
           on ice sheet hydrology: {Processes} and products},
  volume = {155},
  issn = {0012-8252},
  shorttitle = {Theoretical, contemporary observational and 
  palaeo-perspectives on ice sheet hydrology},
  url = {http://www.sciencedirect.com/science/article/pii/S0012825216300095},
  doi = {10.1016/j.earscirev.2016.01.010},
  urldate = {2018-12-05},
  journal = {Earth-Science Reviews},
  author = {Greenwood, Sarah L. and Clason, Caroline C. and Helanow, 
            Christian and Margold, Martin},
  month = apr,
  year = {2016},
  keywords = {Geomorphology, Esker, Meltwater, Review, Hydrology, 
              Channel, Glacier, Ice Sheet, Read Level 3},
  pages = {1--27},
}
\end{filecontents*}


\documentclass[11pt,a4paper]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage[onehalfspacing]{setspace}

\usepackage{natbib}


\begin{document}

Hello World \cite{greenwood_theoretical_2016}

\bibliographystyle{plainnat} % plain
\bibliography{Bibliography} % Bibliography

\end{document}

예상 결과를 확인하세요.

bibtex 결과

참고문헌 번호를 얻으려면 다음 옵션을 추가 numbers하세요 natbib.

\usepackage[numbers]{natbib}

컴파일할 올바른 코드는 다음과 biblatex같습니다.

\documentclass[11pt,a4paper]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage[onehalfspacing]{setspace}

\usepackage{csquotes}
\usepackage[%
  natbib=true, % <=======================================
  backend=biber, % <=====================================
]{biblatex}
\addbibresource{Bibliography.bib} % Bibliography <=======


\begin{document}

Hello World \cite{greenwood_theoretical_2016}

\printbibliography

\end{document}

결과는 다음과 같습니다.

여기에 이미지 설명을 입력하세요

답변2

\bibliographystyle{plain}"명령이 명령 앞에 있어야 한다고 거의 확신합니다 \bibliography{Bibliography}"라는 원래 답변의 일부는 bibtex 컴파일이 별도로 수행되어 이미 정보가 있는 aux 파일만 사용되기 때문에 실제로 정확하지 않습니다. 전기 스타일. (@barbarabeeton 및 @moewe에게 감사드립니다...) 물론 프로그래밍 습관으로 인해 "스타일을 가져와 인쇄하세요"라고 말하여 코드를 사람이 더 쉽게 읽을 수 있기 때문에 더 많은 사람들이 인쇄 명령 전에 코드를 추가하게 될 것입니다. . "인쇄하세요... 아! 그리고 잊지 마세요... 이 스타일에는 필요해요!" :피

테스트되지는 않았지만 명령이 \bibliographystyle{plain}명령 앞에 있어야 \bibliography{Bibliography}하고 가장 중요한 것은 두 명령이 명령 앞에 있어야 한다고 거의 확신합니다 \end{document}.

시도해 보시고 괜찮으시다면 답변 부탁드립니다.

관련 정보