2

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.

  • 2
    looks like you have a & in one of your bibtex entries that should be \& so bibtex is generating a bad bbl file (the line number is probably of the bbl file not the .tex) – David Carlisle Jun 11 '13 at 16:17
  • @DavidCarlisle Doesn't seem to be the case. I haven't added any new entries to my bib file, not have I used new citations. In any case, I also double checked every entry but there are not signs of something being wrong in my .bib file. – HernanLG Jun 11 '13 at 16:25
  • 1
    In that case the standard comment applies: Please make a small complete document that generates the error. In other words delete every entry that you can while still making an error. Most likely you will discover the problem (as deleting the bad entry will make things work) if not post the smallest document you can make that has the issue. The error message is showing an unquoted & in a URL render.fcgi?artid=3153785& I would tend to believe it:-) – David Carlisle Jun 11 '13 at 16:49
  • Ah! Indeed David! I don't know what it was, but I deleted all my entries' urls which were from pubmed, because all of those contained the "pmcentrez" string in their urls. Since that was mentioned in the error message, I figured it had something to do with it, and indeed now I can compile. What I don't understand is why this happened. I didn't add any new entry and this was working perfectly yesterday. Also, all the entries are automatically generated, so I couldn't have made the error myself. Anyways, thanks for the help! – HernanLG Jun 11 '13 at 17:15
  • did you change you bibliography style? That could account for it as some will ignore the URL field (which would be OK) some will wrap it in \url{} (which would make & safe) and some will just copy the text (which will generate errors unless the & is already quoted) – David Carlisle Jun 11 '13 at 17:18
2

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.

0

Its worked fine with me by only adding '\' before every & in my bibliography.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.