我尝试使用 apacite 来引用 APA,但失败了。这是我的最小试用示例。
\documentclass[12pt]{article}
\usepackage[BCAY]{apacite}
\title{Brief Article}
\author{The Author}
\begin{document}
\maketitle
stuff \cite{anderson2012}
\bibliographystyle{apacite}
\bibliography{reference}
\end{document}
我的“reference.bib”内容如下:
@techreport{anderson2012,
title = {Alcohol in the European Union : WHO Regional Office Europe},
author = {P. Anderson and L. M{\o}ller, G. Galea},
url = {http://www.euro.who.int/__data/assets/pdf_file/0003/160680/e96457.pdf},
year = {2012}
}
并且给出以下警告:
LaTeX Warning: Citation `anderson2012' undefined on input line 17.
No file text.bbl.
[1] (./text.aux)
LaTeX Warning: There were undefined references.
)
Output written on text.pdf (1 page).
SyncTeX written on text.synctex.gz.
Transcript written on text.log
我正在使用Texshop
并将排版更改为 bibtex 我收到以下消息
This is BibTeX, Version 0.99d (TeX Live 2015)
The top-level auxiliary file: text.aux
The style file: apacite.bst
Database file #1: reference.bib
apacite.bst [2013/07/21 v6.03 APA bibliography style]
然后回到 Latex,
答案1
问题在于您的url
字段包含下划线,这是一个数学模式字符。因此,要解决这个问题,您需要告诉apacite
它正确处理 URL。为此,请添加加载url
包:
但还有第二个问题:[BCAY]
除非您使用的是旧文档,否则不应使用该选项。它是为了向后兼容而包含的,不应再使用。
我还对您的bib
条目做了一些更正。作者姓名应以逗号分隔and
。需要保留大写字母的内容需要括在 中{}
。请参阅:
% !BIB TS-program = bibtex
\documentclass[12pt]{article}
% This next bit is just a way to make a self-contained document containing
% a bib file. It will create a file with your-tex-file-name.bib based on the
% name of your .tex file. In your case you would just use your regular
% .bib file (edited to match the corrections made here)
\begin{filecontents}{\jobname.bib}
@techreport{anderson2012,
title = {Alcohol in the {European Union}: {WHO} Regional Office {Europe}},
author = {P. Anderson and L. M{\o}ller and G. Galea},
url = {http://www.euro.who.int/__data/assets/pdf_file/0003/160680/e96457.pdf},
year = {2012}
}
\end{filecontents}
% self-contained stuff ends here
\usepackage[]{apacite}
\usepackage{url}
\title{Brief Article}
\author{The Author}
\begin{document}
\maketitle
stuff \cite{anderson2012}
\bibliographystyle{apacite}
\bibliography{\jobname}
\end{document}
正如其他人所指出的,您需要使用latex
、bibtex
、latex
进行编译latex
才能正确解析引用。请参阅:
如果您想使用 TeXShop 自动执行此操作,您可以使用其中latexmk
附带的引擎之一。有关如何使其工作的说明,请参阅: