[Tex/LaTex] Bib compilation blocks pdf compilation

bibtexurls

I am pretty sure this is not a syntax mistake. I am using a .tex file with the following form:

\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}

I know this template works. I have been using this almost all year, updating the file daily. I have many things in the file (sections, figures, tables, etc) and so far I haven't had any problems. I am using TexMaker 1.9.9 and KBibTeX

Suddenly today I try to compile and I get an error pointing to a line where I had some tables. I checked the code, but nothing. I removed the tables and tried again. The error persisted in the same line, despite the fact that now there was different content there. This seemed odd, and here I suspected that the auxiliary files might have gotten corrupt. So I deleted the .aux, .bbl, .blg and .log files and tried the compilation again. This time, it did work, but my citations were all incomplete (because it was the first compilation). So I ran BibTex and then I compiled again. Now I get the same error as before:

! 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.

So basically the situation is this: If I run BibTeX I cannot compile my pdf because of the error above. If I delete all the auxiliary files I can compile the pdf, but all my references are undefined, so I need to run BibTeX again, but then everything starts again…

Any suggestions are most welcome.

Best Answer

Ok, so the official way of fixing this was to delete the urls from my bib entries. I can't tell exactly which one was it, or why did it fail now if I had had those entries for a while now, but the point is that I noticed the "pmcentrez" part of the error message and found that the papers I was quoting from pubmed all had urls in their entries with that piece of text, so I deleted them all and then the compilation worked.

I cannot say what caused the problem, but that is how it was fixed. Thanks @David Carlisle for the tip.

Related Question