I am using several bibtex files, dedicated to several topics. But some references are common to several topics and then appear in several of my bibtex files. Currently, I am writing a document dealing with several of these topics, and need to use several of these bibtex files at the same time. Obviously, I get the error message when compiling with bibtex: "repeated entry". I would like to avoid this error message, but without removing my entries from the bibtex files, as I need them when compiling only with one of them (when writing articles on one topic only), and without merging my bibtex files.
|
The easiest solution is to have one BiBTeX file only. And by that, I really mean one BiBTeX file on your system for your whole bibliography. As far as I understand this is actually the intended usage, and there are several good softwares out there that make managing a bibliography easy. Much easier, in fact, than having to manage separate bibliographies. This is also why BiBTeX only includes those references that are actually used, and not just the whole file. |
|||||||||||||||
|
|
If you don't mind a bit of command-line, why not create a bib file just for this paper using just the references you need, using bibtool:
|
|||
|
|
|
Answer I recommend using Norman Ramsey's nbibtex for this. The basic idea is that you run the Another possibility Something I do with my clients is replace the Breaking up bibliography files into a number of separate Old, lost code I wrote some code back in my days as a doctoral student that did the following:
I don't think this approach makes much sense now given the availability of |
|||||||||
|
|
I think, you are looking for the package bibtopic. But afaik it's not up to date (2006). I would also recommend to create one BiBTeX file. If you want your bibliography sorted by subject, you could use the multibib-package. |
|||
|
|
There seems to be two ways that one can achieve the desired result
Adding an answer, after 2 years, as no one has suggested a solution without removing entries from the bibtex files or without merging bibtex files as the OP wanted. It is independent of the OS or LaTeX distribution that one uses. |
|||
|
|
|
Solving this problem is relatively easy on linux. Create a file in your
Do This will then replace the raw |
||||
|
|
|
You can use
Here is an example: bibtool -f '%s($key)' -Ac -s -v biblio-1.bib biblio-2.bib -o merged-biblio.bib The merged file ( @InProceedings{ examplekey1,
title = {{A title}},
author = {Doe, J.},
booktitle = {A book title},
year = {2012}
}
@InProceedings{ examplekey1*b,
title = {{A title}},
author = {Doe, J.},
booktitle = {A book title},
year = {2012}
}
@InProceedings{ examplekey2,
title = {{A title (first version)}},
author = {Foobar, K.},
booktitle = {Another book title},
year = {2013}
}
@InProceedings{ examplekey2*b,
title = {{A title (second version)}},
author = {Foobar, K.},
booktitle = {Another book title},
year = {2018}
}
The @inproceedings{examplekey1,
title = {{A title}},
author = {Doe, J.},
booktitle = {A book title},
year = {2012}
}
@inproceedings{examplekey2,
title = {{A title (first version)}},
author = {Foobar, K.},
booktitle = {Another book title},
year = {2013}
}
The @inproceedings{examplekey1,
title = {{A title}},
author = {Doe, J.},
booktitle = {A book title},
year = {2012}
}
@inproceedings{examplekey2,
title = {{A title (second version)}},
author = {Foobar, K.},
booktitle = {Another book title},
year = {2018}
}
|
|||
|
|
