0

My question is similar to this one, but is not covered in the answers.

I am writing a document using subfiles as chapters, for which I use standalone. I work on each chapter separately, and each chapter will appear in the final document with its own bibliography, for which I am using chapterbib. Each file has a \biblio command at the end.

Each of my chapter files compiles separately, but when I try to compile the whole document I get the warning "...Illegal, another \bibdata command"..."I'm skipping whatever remains of this command".

Wrapping the \biblio command in each chapter file prevents this from happening, but then I don't get bibliographies in each chapter, as I need.

Here's a minimal example with the errror:

Preamle for all files:

\documentclass{book}
\usepackage{chapterbib}
\usepackage{standalone}
\usepackage[noadjust]{cite}
    \bibliographystyle{unsrt}

Main file:

\begin{document}
\title{MyBook}
\include{Chap1}
\include{Chap2}
\end{document}

Chapter 1 file:

\begin{document}
\chapter{Chapter 1}
\chaptermark{Chap1}
\label{chap:1}
BlaBla\cite{Allen2013}.
\bibliography{biblio}
\end{document}

Chapter2 file:

\begin{document}
\chapter{Chapter 2}
\chaptermark{Chap2}
\label{chap:2}
BlaBla\cite{Baronchelli2018}\cite{Abraham1998}.
\bibliography{biblio}
\end{document}
  • The documentation of chapterbib explicitly mentions that you get this warning if you try to create also an overall bibliography. Can't you switch to biblatex/biber? – Ulrike Fischer Jan 29 at 10:28
  • I get the same warning whether I add an overall bibliography or not... it still says: "This is BibTeX, Version 0.99d (MiKTeX 2.9.6840 64-bit) The top-level auxiliary file: Main.aux A level-1 auxiliary file: Chap1.aux A level-1 auxiliary file: Chap2.aux Illegal, another \bibdata command---line 4 of file Chap2.aux : \bibdata : {biblio} I'm skipping whatever remains of this command I found no \bibstyle command---while reading file Main.aux" – Francisco Herrerias-Azcue Jan 29 at 16:04
  • Ulrike, how could I implement the independent bibliographies in each chapter using biblatex/biber? Thanks – Francisco Herrerias-Azcue Jan 29 at 17:33

Your Answer

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

Browse other questions tagged or ask your own question.