我之前用 latex 写过一份报告,使用 bib 文件,它工作正常。但是,我正在用 latex 写一份新报告,参考文献在单独的 bib 文件中,但这份报告不起作用。唯一的主要区别是我使用书籍和维基百科作为参考,而不是主要使用文章
我在 Windows 上使用 Texworks。编译 bib 生成 bbl 后,当我使用 pdflatex + bibtex + pdflatex + pdflatex 编译 tex 文件时。当我尝试这样做时,“参考”部分显示在末尾,但我看不到参考资料,例如
- Reinhard,DA案例研究我也没有在论文中看到引用
这是 MWE:文本是:
\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,这是不正确的)