
我正在用 Latex 編寫一份報告,我在一個單獨的 bib 文件中引用了它們,並在我的主文檔中將它們引用為\cite{xxx}
.
我在 Windows 上使用 Texworks。編譯 bib 產生 bbl 後,當我使用以下命令編譯 tex 文件時:“pdflatex + MakeIndex + BibTex”,我能夠看到 pdf 報告,但我看不到末尾的 Bibilography 部分,也看不到對參考書目的引用,甚至沒有問號,而不是對參考書目的正確引用。
我透過鍵入來包含參考書目
\bibliography{plain}
和
\bibliography{"C:/Users/BibName"}
在tex文件的末尾
然後我嘗試了 pdflatex + bibtex + pdflatex + pdflatex。當我嘗試時,“參考文獻”部分顯示在末尾,但我沒有看到參考文獻,例如
1. Reinhard, D.A. Case Study
我也沒看到論文中的引用
這是 MWE: tex 是:
\documentclass{article}
\begin{document}
Alpha particles \cite{example} (named after and denoted by the first letter in the
Greek alphabet,\[\alpha\]) consist of two protons and two neutrons bound
together.
This means that an particle is a helium nucleus.
\bibliography{plain}
\bibliographystyle{plain}
\bibliography{BibName}
\end{document}
圍兜是:
@article{example,
author = {Knuth, Donald E.},
year = {1986},
title = {The \TeX book},
}
我究竟做錯了什麼?
答案1
\bibliography{<file>}
<file>.bib
表示包含 BibTeX 參考文獻的名稱,而\bibliographystyle{<bibstyle>}
表示您希望參考文獻顯示的樣式\bibliography
。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{references.bib}
@article{example,
author = {Knuth, Donald E.},
year = {1986},
title = {The {\TeX} book},
}
\end{filecontents*}
\begin{document}
Alpha particles~\cite{example} (named after and denoted by the first letter in the
Greek alphabet,~$\alpha$) consist of two protons and two neutrons bound
together. This means that an particle is a helium nucleus.
\bibliographystyle{plain}
\bibliography{references}
\end{document}
答案2
也許這會有所幫助(一些非常基本的事情,也許您已經做過,但如果不這樣做,它可能會打破您的頭)。
嘗試避免 .tex 和 .bib 名稱中出現空格。它產生的名稱中也包含空格.aux
,.bbl
等等。
我遇到了同樣的問題:長 .tex 和 .bib 文件,最終 .pdf 帶有問號而不是參考文獻,以及諸如Warning--I didn't find a database entry for "XXXX"
和 之類的消息Package natbib Warning: There were undefined citations.
。完全沒有.bbl
,也沒有關於上網時的答案。
最後,我只是將所有內容複製/貼上到新文件中的新資料夾中(試圖避免未知字元),甚至更改了名稱。它神奇地起作用了,只是因為新名稱沒有空格(test.tex
而不是pritty work for my lovely boss v_342.tex
)。
N. of R.:我在 Windows 下工作,只使用 TeXworks 就發生了這種情況。在一台舊電腦(也在Windows 平台下)中,我不使用它,因為它的反應比slug 少,即使名稱中有空格,它也能完美工作,所以我想這是因為我的舊電腦中有TeXnicCenter。順便說一句,使用 TeXnicCenter 你只需要編譯幾次,但有一個獨特的編譯選項(LaTeX=>PDF);使用TeXworks,您必須使用pdfLaTeX進行編譯,然後使用BibTeX進行編譯,最後再次使用pdfLaTex進行兩次編譯,始終是.tex檔。