BibTeX 编译正在损坏我的文件

BibTeX 编译正在损坏我的文件

我正在使用 TexMaker 1.9.9 并使用 KbibTeX 管理我的参考资料。我已从 Debian Stable 版本更新所有 LiveTex 软件包。

我总是使用相同的模板来写作业:

\documentclass[10pt]{article}

% Some packages I always load, can be omitted:
\usepackage{url,graphicx,tabularx,array,geometry,amsmath,amssymb,apacite}

% Change english to the language you are writing in (for english this can   often be omitted):
\usepackage[english]{babel}

% Uncomment to use Sweave:
% \usepackage{Sweave}
% This is not a comment! Leave it in:
% need no \usepackage{Sweave.sty}

% Layout:
\setlength{\parskip}{1ex} %--skip lines between paragraphs
\setlength{\parindent}{0pt} %--don't indent paragraphs

% Commands for header:
\renewcommand{\title}[1]{\textbf{#1}\\}
\renewcommand{\line}{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}   \hline    \\\end{tabularx}\\[-0.5cm]}
\newcommand{\leftright}[2]{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}#1%
& #2\\\end{tabularx}\\[-0.5cm]}

%\linespread{2} %-- Uncomment for Double Space

%%% BEGIN DOCUMENT %%%

\begin{document}

\title{Title goes here}
\line
\leftright{\today}{Name (student number)} %-- left and right positions in the header

我的书目环境是:

\bibliographystyle{apa}
\bibliography{SIP_Project}



\end{document}

我的问题是,不知为何,没有写下任何参考文献,除了参考文献应该出现的地方出现了问号。现在,我知道这种情况经常发生,而且确实不是第一次。但以前,只要再编译几次就可以解决这个问题,然后一切都会好起来。但现在,显然出了问题。我设法重现了错误。

我开始时文件夹中只有两个文件,即 .tex 文件和 .bib 文件。我执行了 Latex 编译,进程正常启动和退出。此外,还创建了 .dvi、.log 和 .aux 文件。现在,我从 TexMaker 运行 BibTex。进程启动但以错误结束。创建了 .bbl 和 .blg 文件。现在,我快速构建以查看 pdf。pdf 文件编译后,所有参考资料都显示为问号,文件底部仅列出 3 个参考资料(我使用了 7 个参考资料)。

因此,我关闭了 pdf 并尝试再次进行快速构建。这次,pdf 没有编译,我得到了以下错误(以及其他错误)

! Undefined control sequence.
\b@King1998 ->\astroncite
{King and Napa}{1998}
l.54 \item The study by \citeA{King1998}
is a study on social pshycology who...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

这是另一条消息:

! Undefined control sequence.
\b@King1998 ->\astroncite
{King and Napa}{1998}
l.54 \item The study by \citeA{King1998}
is a study on social pshycology who...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Use of \@year@ doesn't match its definition.
\Y@King1998 ->\@year@ \astroncite

另一个:

{King and Napa}{1998}
l.54 \item The study by \citeA{King1998}
is a study on social pshycology who...
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Undefined control sequence.

等等。所有错误消息都具有这种格式,但我没有发现我的 tex 文件或 bib 文件有什么问题。顺便说一句,我的 bib 文件是由 Mendeley 自动生成的,所以我怀疑条目有问题。以防万一,我引用的第一个条目似乎至少是问题之一,它在我的 .bib 文件中是这样的:

@Article{ King1998,
    author = "L a King and C K Napa",
    issn = "0022-3514",
    journal = "Journal of personality and social psychology",
    keywords = "Adolescent, Adult, Aged, Aged, 80 and over, Female, Folklore, Happiness, Humans, Individuality, Job Satisfaction, Male, Middle Aged, Morals, Personal Satisfaction, Quality of Life, Social Values, Socioeconomic Factors, Students, Students: psychology",
month = jul,
number = "1",
pages = "156--65",
pmid = "9686456",
title = "{What makes a life good?}",
url = "http://www.ncbi.nlm.nih.gov/pubmed/9686456",
volume = "75",
year = "1998"
}

我已经使用 LaTex 和 TexMaker 有一段时间了。我反复使用 KBibTex 和相同的 tex 模板。我的 bib 文件总是由我的参考书目管理器 Mendeley 自动生成。所以我不知道这次出了什么问题。任何评论或帮助都非常感谢。

答案1

apa.bst样式是一种非常古老的 BibTeX 样式,与该包不兼容apacite

的文档apacite.sty说使用

\bibliographystyle{apacite}
\bibliographystyle{apacitex}
\bibliographystyle{apacann}
\bibliographystyle{apacannx}

第 2 部分,第 8 页:

在此处输入图片描述

相关内容