0

As the title says, I tried adding a BibTeX entry:

@Book{hebbrule,
    author = {Donald O. Hebb},
    title = {The Organization of Behavior: A Neuropsychological Theory},
    publisher = {Taylor \& Francis Inc},
    year = {1949},
}

In the first version, I didn't have the \ before the & and I got the above mentioned error. Then I added the \, which should solve it, but the error remains even if I delete the whole entry!

Does LaTeX not recognize when I change some of my files? Because I had some errors where I removed the cause and they would still remain. (I'm using Texmaker btw.)

  • this is the full error message: "Misplaced alignment tab character &. l.22 \newblock Taylor & Francis Inc, 1949. 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" since this is my first time working with latex, i dunno how to resolve it and dont understand anything it says – Stammer91 Mar 26 at 2:13
  • 1
    Note that since bibliographies in LaTeX are created using temporary files (read tex.stackexchange.com/q/63852/35864) errors in the .bib file may persist elsewhere even if they were already fixed at the source. In those cases it should help to remove all temporary files (in particular .aux and .bbl) and rerun the fully LaTeX, BibTeX, LaTeX, LaTeX cycle again. – moewe Mar 26 at 4:43
2

The behaviour is not as dumb as it appears at first sight. You have to understand that entries in a .bib file only make their way into LaTeX indirectly. After a change has been made, the new and correct entries will not find their way in until after the next bibtex run. Until then, the old and incorrect entries, which are sitting in the .bbl file that bibtex produced last time will continue to be used. That is the source of your error on this occasion. Your rerun sequence didn't "change nothing": it changed the contents of the .bbl file.

Three ways to solve this:

  • After updating the .bib file, run bibtex again before running LaTeX. That only works if all you have changed is the .bib file. It won't work if, for instance, you have added a citation to the TeX source file too.

  • Run LaTeX again, ignoring any errors, and then run bibtex and then LaTeX. That is what you did here, evidently.

  • Delete the various files that LaTeX produces or uses as it runs (.aux and .bbl in particular, and then regenerate the document from scratch. That isn't really different from the previous option, but it avoids you seeing any errors at all, and in some cases (if an error is so bad that it really causes LaTeX to choke fatally) it's the only thing to do.

As a rough rule of thumb, if you ever get errors which are caused by something in the .bib file, it's probably a good idea to go back to a clean slate. Many editors will offer an easy way of deleting the cruft files. The same is also true for anything else that puts data into external files (such as glossaries, indexes, and so forth, even tables of contents and labels in extreme cases): if you find yourself getting hard-to-explain errors which persist even after you think you've put things right, going back to a clean sheet is often wise.

1

I somehow got it working. All I needed to do was run pdflatexbibtexpdflatex twice and all of a sudden the error disappeared even though I changed absolutely nothing.

  • 1
    Pikachu the Purple Wizard has removed inappropriate words from your answer. Those kinds of words are not allowed and welcome here. – JouleV Mar 26 at 4:04

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.