I am writing a collaborative document in which each author
edits a main.tex
file and provides a <author>.bib
file (no \include
, no \input
… I know it's not the ideal choice but it was not my decision).
What we are having issues with is that we can't manage to have multiple bibliographies at the end of each chapter (chapterbib
requires to use \include
, it mention something in the manual to have a single file, but it is not very clear to me how to do it)
A minimal example is like this:
% main.tex
\documentclass[a4paper,11pt,oneside,openright]{book}
\usepackage{natbib}
\usepackage{chapterbib}
\begin{document}
\chapter{Author 1}
\section{author 1 section}
..something
\addcontentsline{toc}{section}{\bibname}
\bibliographystyle{unsrtnat}
\pagestyle{plain}
\bibliography{author_1}
\chapter{Author 2}
\section{author 2 section}
..something
\addcontentsline{toc}{section}{\bibname}
\bibliographystyle{unsrtnat}
\pagestyle{plain}
\bibliography{author_2}
\end{document}
author_1.bib
@article{lagrange1772essai,
title={Essai sur le probleme des trois corps},
author={Lagrange, J.L.},
journal={{\OE}uvres},
volume={6},
pages={229--324},
year={1772}
}
author_2.bib
@article{euler1741solutio,
title={Solutio problematis ad geometriam situs pertinentis},
author={Euler, L.},
journal={Commentarii academiae scientiarum Petropolitanae},
volume={8},
pages={128--140},
year={1741}
}
It might happen that author_1.bib and author_2.bib contain the same reference (with the same id key probably).
Any hint how to do that?
Best Answer
The answer is pretty straightforward when using the
biblatex
package. It is somehow compatible withnatbib
, but if you can ditch it all together, it is even better.With
biblatex
you can list different bib files to your latex document and assign them to specific section considered for the separate bibliographies (refsections
in biblatex terms) with\addbibresource[]{}
I advise you to read the full doc of
biblatex
, you can also automatically affectrefsection
tochapter
,part
, orsection
, without having to specify the environment.