BibTeX, biblatex and biberSeparate the biblio for each chapter

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Majin_
Posts: 1
Joined: Mon May 23, 2016 4:32 pm

Separate the biblio for each chapter

Post by Majin_ »

Good afternoon everyone,

Here is my problem, for which I couldn't find a solution : I would just like to separate my biblio for every chapter, but I can't manage to do it. Here is how I proceeded, and the result :

In a folder I have my main .tex file. In this .tex file, I recall my different chapters (using \input) which are all in different subfolder (for pratical reasons). In the main folder, I have the different .bib files (so they are not in the same subfolder than the chapters).

In my main .tex file, I have the command :

Code: Select all

\usepackage[sectionbib]{chapterbib}
\bibliographystyle{IEEEtran}
Still in the main file I recall my different chapters and the .bib files like that :

Code: Select all

\lhead[]{Chapter 1}
\newpage
   \input{Chap_1/Chap1}
   \newpage
   
%Biblio Chapter 1
\bibliography{Bib_Ch1}
   \newpage

\lhead[]{Chapter 2}
\newpage
    \input{Chap_2/Chap2}
   \newpage
   
%Biblio Chapter 2
\bibliography{Bib_Ch2}
	\newpage
The problem is that both my biblio for chapter 1 and chapter 2 are the same, the one from "Bib_Ch1.bib". It's like the second .bib file "Bib_Ch2.bib" is not read.

Could you explain me how to link the "Bib_Ch1.bib" file to the first chapter and the "Bib_Ch2.bib" to the second one ? Should I put the command "\bibliography{Bib_Ch1}" directly in the "Chap_1.tex" file and the command "\bibliography{Bib_Ch2}" in the "Chap_2.tex" file ? I'm a bit lost, thanks for your help !

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Separate the biblio for each chapter

Post by kaiserkarl13 »

The chapterbib package expects you to have two bibliography styles (at most): one for the chapters and one for the "main" bibliography (if there is one). The bibliography per chapter is included based solely on the \cite and/or \nocite commands (and related things like \citep or \citenum if using natbib/cite/etc.) found in each chapter, not the contents of the .bib file BibTeX uses. So feel free to put all your references in the same file if that's easier!

Also, if you want chapterbib to work properly, you'll need to have your chapters inside \include, not \input---the former produces its own .aux file for each chapter, the latter does not. An \include command also puts a \clearpage (actually, it's \cleardoublepage) before starting the chapter heading, so your \newpage command should also be removed. If you want your headers to contain the chapter name, I would strongly suggest putting \@chapter or something similar in one command at the top, rather than doing it manually for each chapter. Using fancyhdr will help immensely, I would think.
Post Reply