Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

The answer is pretty straightforward when using the biblatex package. It is somehow compatible with natbib, 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[]{}

\documentclass[a4paper,11pt,oneside,openright]{book}
\usepackage{biblatex}
\addbibresource{author_1}
\addbibresource{author_2}
\begin{document}
\chapter{author 1 section}
\begin{refsection}[author_1]
...
\printbibliography[heading=subbibliography]
\end{refsection}
\chapter{author 2 section}
\begin{refsection}[author_2]
...
\printbibliography[heading=subbibliography]
\end{refsection}
\end{document}

I advise you to read the full doc of biblatex, you can also automatically affect refsection to chapter, part, or section, without having to specify the environment.

share|improve this answer
    
Damn, you were faster with very same idea:) Why didn't you put \chapter inside refsection? –  Crowley Nov 22 '12 at 14:00
    
Hi,thanks for the answer but I get the error "! LaTeX Error: File `logreq.sty' not found." when using the biblatex package.. –  lucacerone Nov 22 '12 at 14:30
    
What is your LaTeX distribution and what backend do you use? I've tried it with MikTeX 2.9 full and biber. –  Crowley Nov 22 '12 at 14:39
    
I use texlive shipping with Ubuntu and have no idea what a backend is :) –  lucacerone Nov 22 '12 at 14:58
    
Firstly, what is the version of your Ubuntu. Secondly, BibLaTeX backend is program that creates your citation list. It is BibTeX or biber. When using BibLaTeX you compile your .tex file with (pdf)latex and then you compile it with backend to create citation database which is used in next latex run. –  Crowley Nov 22 '12 at 15:10
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.