Bib 编译块 pdf 编译

Bib 编译块 pdf 编译

我很确定这不是语法错误。我使用的 .tex 文件格式如下:

\documentclass[a4paper,12pt]{article}

\title{Here goes the title}
\author{Here goes my name}
\date{\today}

\usepackage{amsmath}

\usepackage{amssymb}

\usepackage[english]{babel}

\usepackage[pdftex]{graphicx}

\usepackage{apacite}

\begin{document}
\maketitle

Here is the text

\bibliographystyle{apacite} 
\bibliography{HL_Literature}

\end{document}

我知道这个模板有用。我几乎整年都在使用它,每天更新文件。文件中有很多内容(部分、图表、表格等),到目前为止我还没有遇到任何问题。我使用的是 TexMaker 1.9.9 和 KBibTeX

今天我突然尝试编译,结果出现一个错误,指向包含一些表格的行。我检查了代码,但什么也没发现。我删除了表格,然后重试。错误仍然存​​在于同一行,尽管现在那里的内容已经不同了。这似乎很奇怪,我怀疑辅助文件可能已损坏。所以我删除了 .aux、.bbl、.blg 和 .log 文件,然后再次尝试编译。这一次,它确实成功了,但我的引文都不完整(因为这是第一次编译)。所以我运行了 BibTex,然后再次编译。现在我得到了与以前相同的错误:

! Misplaced alignment tab character &.
<argument> ...ov/articlerender.fcgi?artid=3153785&
tool=pmcentrez&rendertype=...
l.115 pmcentrez&rendertype=abstract}
\end{APACrefURL}
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.

所以基本上情况是这样的:如果我运行 BibTeX,由于上述错误,我无法编译我的 pdf。如果我删除所有辅助文件,我可以编译 pdf,但我的所有引用都是未定义的,所以我需要再次运行 BibTeX,但然后一切都会重新开始……

欢迎任何建议。

答案1

好的,所以解决这个问题的官方方法是从我的 bib 条目中删除 url。我不能确切地说出是哪一个,或者为什么现在失败了,如果我已经有这些条目一段时间了,但关键是我注意到了错误消息的“pmcentrez”部分,并发现我从 pubmed 引用的论文的条目中都有包含该文本的 url,所以我将它们全部删除,然后编译就可以正常工作了。

我不知道是什么原因导致了这个问题,但这就是解决问题的方法。感谢@David Carlisle 提供的提示。

答案2

我只需要在我的参考书目中每个 & 之前添加 '\' 就可以了。

相关内容