之前我用latex用bib檔案寫過一份報告,運作正常。但是,我正在用 Latex 編寫一份新報告,並且我在單獨的 bib 檔案中擁有參考文獻,但該報告不起作用。唯一的主要區別是我使用書籍和維基百科作為參考,而不是主要使用文章
我在 Windows 上使用 Texworks。編譯bib產生bbl後,當我用:pdflatex + bibtex + pdflatex + pdflatex編譯tex檔。當我嘗試時,“參考文獻”部分顯示在末尾,但我沒有看到參考文獻,例如
- Reinhard,DA 案例研究 我也沒有在論文中看到引用
這是 MWE: tex 是:
\documentclass{article}
%\usepackage{url,apacite} - had problems regardless if I included this or not
%\bibliographystyle{apacite} - same as above
\begin{document}
Alpha particles \cite{wikip} (named \cite{Comp} 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{BibName}
\end{document}
第一份報告的號碼布是:
@article{example,
author = {Knuth, Donald E.},
year = {1986},
title = {The \TeX book},
}
我的第二份報告的號碼布是:
@misc{wikip,
author = "Wikipedia",
title = "Pen --- {W}ikipedia{,} The Free Encyclopedia",
year = "2014",
url = "\url{https://en.wikipedia.org/wiki/Pen}",
note = "[Online; accessed 14-December-2014]"
}
@book{Comp,
author = "Rub",
title = "Com",
year = "1997",
publisher = "John Wiley & Sons, Inc.",
address = "New York, New York"
}
我究竟做錯了什麼?
非常感謝!
答案1
有幾個錯誤;大衛卡萊爾已經在評論中指出了其中的一些內容。
您必須「轉義」
&
出版商欄位中的符號,即寫入\&
。由於您似乎想要使用
apacite
套件和關聯的參考書目樣式,因此不要將 URL 字串包含在\url{...}
.相反,只需寫url = "...",
.title
請修復條目“wikip”欄位中大括號的位置。
\documentclass{article}
\usepackage{apacite}
\bibliographystyle{apacite}
\usepackage{url}
\usepackage{filecontents}
\begin{filecontents*}{BibName.bib}
@misc{wikip,
author = "Wikipedia",
title = "Pen --- {Wikipedia, The Free Encyclopedia}",
year = "2014",
url = "https://en.wikipedia.org/wiki/Pen",
note = "Accessed 14-December-2014"
}
@book{Comp,
author = "Rub",
title = "Com",
year = "1997",
publisher = "John Wiley \& Sons, Inc.",
address = "New York, New York"
}
\end{filecontents*}
\begin{document}
\cite{wikip}
\cite{Comp}
\bibliography{BibName}
\end{document}
答案2
John Wiley & Sons,
必須
John Wiley \& Sons,
否則你會得到一個錯誤,&
但是 Latex bibtex Latex Latex 應該會產生所示的圖像。 (你的描述聽起來像是你先運行了 bibtex,這是不正確的)