無法將 bibtex 檔案新增至主 tex 檔案中

無法將 bibtex 檔案新增至主 tex 檔案中

我在論壇中看到幾個條目,建議所附的 Miminal 程式碼應myref.bib在此處列印 tex 檔案中的文件中的引用。對我來說,這個文件的輸出是一個 pdf 文件,整個頁面上只寫著「你好嗎」。

\documentclass[12pt]{article}
\usepackage{natbib}
\begin{document}

How are you 
\bibliographystyle{acm}
\bibliography{myref.bib}

\end{document}

該檔案myref.bib位於同一目錄中,有 3 個條目,如下所示:

@article{diamondprop,
    author = {Kania D R, Landstrass M I and Plano M A},
    title = {Diamond radiation detectors},
    journal = {Diamond and Related Material},
    year = { 1993 },
    volume = {2},
    number = {1012–9}
}

答案1

而不是只寫bibiliography{myref.bib}writebibiliography{myref}並在 .bib 檔案中再進行一項更改,它就可以正常工作。

\documentclass[12pt]{article}
\usepackage{natbib}

\begin{document}

 How are you \cite{diamondprop}


 \bibliography{myref}
 \bibliographystyle{plain}

 \end{document}

我還修改了 .bib 檔案。在add第一作者和第二作者的姓名之間,理想情況下您應該在每個作者的姓名之間執行此操作。這是我使用的 .bib 文件

@article{diamondprop,
author = {Kania, D. R. and Landstrass, M. I. and Plano, M. A.},
title = {Diamond radiation detectors},
journal = {Diamond and Related Material},
year = { 1993 },
volume = {2},
number = {1012–9}
}

輸出

如果您對此不熟悉,此連結可能會有所幫助:使用 BIBTeX 建立參考書目

我忘了提到你需要按以下順序編譯四次:pdflatex,bibtex,pdflatex,pdflatex。

相關內容