GeneralErrors in Bibliography Data and Style

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
sue
Posts: 2
Joined: Thu Sep 19, 2013 8:17 pm

Errors in Bibliography Data and Style

Post by sue »

Dear LaTeX Community,

This is the first time I post in the forum which I've been using a lot while writing my dissertation. Thanks for sharing your comments and clarifying our doubts.

I have a problem when running my main file. I got some errors in the BibTeX results. I'm using the packages chapterbib and natbib packages. I read in different posts that the commands \bibliographystyle and \bibliography are at the end of each chapter. I also run latex, bibtex in each chapter file, and latex twice again. The bibliography for each chapter is successfully printed and the references appear in the text. However, I get the following error message for all chapters, except the first one.

Code: Select all

Illegal, another \bibstyle command ---line X
Illegal, another \bibdata command ---line X
What am I doing wrong? (MWE is attached, I couldn't attach the second bib file)
Attachments
bib2.bib
bib for chapter2 (LaTeX2.tex)
(662 Bytes) Downloaded 462 times
LaTeX3.tex
chapter to be included
(284 Bytes) Downloaded 436 times
LaTeX2.tex
chapter to be included
(386 Bytes) Downloaded 497 times
LaTeX1.tex
Main latex file
(674 Bytes) Downloaded 451 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

GerlofVito
Posts: 27
Joined: Wed May 16, 2012 8:24 pm

Errors in Bibliography Data and Style

Post by GerlofVito »

I downloaded your files and ran them with the command line tool latexmk:

Code: Select all

latexmk -pdf LaTeX1.tex
Everything worked except there was a missing bibliography file, so I duplicated and re-named the file you provided to 'bib3.bib'. There were some 'missing citations' (I'm guessing because you didn't include the full citation file), and otherwise it compiled fine.

Latexmk is a nice tool because it will keep running the files (including bibliography files) over and over until everything is done typesetting. You won't have to do this anymore:
I also run latex, bibtex in each chapter file, and latex twice again.
Just run latexmk on the file you want to typeset, and it should take care of all of that. Here's the pdf I got after running latexmk.
Attachments
LaTeX1.pdf
(65.44 KiB) Downloaded 417 times
sue
Posts: 2
Joined: Thu Sep 19, 2013 8:17 pm

Re: Errors in Bibliography Data and Style

Post by sue »

GerlofVito, thanks for your suggestion about Latexmk! My whole code compiled fine too.

The thing is that I still get the errors in the "Bibtex-results" report. Errors correspond to the second and third bib files, not for the first bib file. Even if Latex compiled successfully, it says that the second bib file is illegal, and its style too. And the same for the third bib file (I have 3 bib files). Could it be the version of TeXnicCenter that I'm using (2.0 Beta 1)?

Thanks for your help!
GerlofVito
Posts: 27
Joined: Wed May 16, 2012 8:24 pm

Re: Errors in Bibliography Data and Style

Post by GerlofVito »

I don't know off the top of my head what could be causing that. Is there any problem with the output? If LaTeX is throwing errors, but you're still getting the PDF you want . . . I might just move on and forget it.

If you want/need to figure it out, I'd recommend to create a minimum working example: Make copies of your documents and start removing stuff until the error goes away. That might show you where the problem is.

It could be in the way that you're including the bib files. It might be the packages that you're using. It might be the bibtex backend. I imagine there are lots of possibilities.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Errors in Bibliography Data and Style

Post by cgnieder »

Hi sue,

Welcome to the LaTeX community!
sue wrote:[...] I still get the errors in the "Bibtex-results" report. Errors correspond to the second and third bib files, not for the first bib file. Even if Latex compiled successfully, it says that the second bib file is illegal, and its style too. And the same for the third bib file (I have 3 bib files).
Can you tell us the exact error messages? Or maybe attach the log file to your next post so we can have a look? Otherwise this will be just a wild guessing game.

Regards
site moderator & package author
Post Reply