I'm working on an edited volume, for the major time so far compiling the different chapters separately, each of them having (one or) two bibliographies. I have a biber.conf file for each chapter, for generating two bibliographies (primary and secondary literature (of which the primary ones are also an ugly hack, but that would be another question, so I've reduced my example here to one bibliography per chapter.)). I associate the bib-files with keywords, and then generate the bibliographies for primary and secondary literature based on that. The commands for that follow the pattern biber -g 1.conf 1
.
I am now putting the volume together, using docmute, and am realising my biblatex setup is seriously broken. It would have been desirable to have just one bibliographical database, from which each of the contributions would feed and build up their respective bibliographies by \cite
etc., but that's not how things have naturally grown here. I hope for the next volume I can do it like that. For now I guess I have to find a way to either keep the bibliographies completely separate, or make duplicate entries appear in all the bibliographies in whose bib files they are present.
In the following example (should be named 1.tex
. a.tex and b.tex represent chapters of the volume, of which I only display the bibliographies here.) the entry A2015 is a duplicate. How can I make it appear in both bibliographies?
\documentclass{memoir}
\usepackage{filecontents}
\usepackage[authordate]{biblatex-chicago}
\usepackage{docmute}
\addbibresource{a.bib}
\addbibresource{b.bib}
\begin{filecontents*}{1.conf}
<?xml version="1.0" encoding="UTF-8"?>
<config>
<sourcemap>
<maps datatype="bibtex" bmap_overwrite="1">
<map>
<per_datasource>a.bib</per_datasource>
<map_step map_field_set="KEYWORDS" map_field_value="a"/>
</map>
<map>
<per_datasource>b.bib</per_datasource>
<map_step map_field_set="KEYWORDS" map_field_value="b"/>
</map>
</maps>
</sourcemap>
</config>
\end{filecontents*}
\begin{filecontents*}{a.tex}
\documentclass{memoir}
\usepackage[authordate]{biblatex-chicago}
\addbibresource{a.bib}
\begin{document}
\nocite{*}
\printbibliography[keyword=a,heading=subbibliography]
\end{document}
\end{filecontents*}
\begin{filecontents*}{a.bib}
@book{A2015,
author = {Some Body},
year = {2015},
title = {A book},
}
\end{filecontents*}
\begin{filecontents*}{a.conf}
<?xml version="1.0" encoding="UTF-8"?>
<config>
<sourcemap>
<maps datatype="bibtex" bmap_overwrite="1">
<map>
<per_datasource>a.bib</per_datasource>
<map_step map_field_set="KEYWORDS" map_field_value="a"/>
</map>
</maps>
</sourcemap>
</config>
\end{filecontents*}
\begin{filecontents*}{b.tex}
\documentclass{memoir}
\usepackage[authordate]{biblatex-chicago}
\addbibresource{b.bib}
\begin{document}
\nocite{*}
\printbibliography[keyword=b,heading=subbibliography]
\end{document}
\end{filecontents*}
\begin{filecontents*}{b.bib}
@book{A2015,
author = {Some Body},
year = {2015},
title = {A Book},
}
@book{B2015,
author = {Somebody Else},
year = {2015},
title = {Another Book},
}
\end{filecontents*}
\begin{filecontents*}{b.conf}
<?xml version="1.0" encoding="UTF-8"?>
<config>
<sourcemap>
<maps datatype="bibtex" bmap_overwrite="1">
<map>
<per_datasource>b.bib</per_datasource>
<map_step map_field_set="KEYWORDS" map_field_value="b"/>
</map>
</maps>
</sourcemap>
</config>
\end{filecontents*}
\begin{document}
\input{a}
\input{b}
\end{document}
keywords
field, as inkeywords = {a,b},
in the A2015 entry of the bibfile which is loaded first.A2015
fromb.bib
is discarded because it is a duplicate key. We can't have to entries with the same identifier. Of course the information that it is in both files is lost. Your best bet is to add the keyword manually. There is for obvious reasons no "per_datasource" that only becomes active if a entry is in two files at the same time.a.conf
andb.conf
would be needed only if I'd have more than one bibliography per chapter, which I do in the real project, but not here. I could have omitted them, to keep the example file shorter, indeed. They are needed when compiling the chapters separately.keyword = {a,b}
manually for the duplicates would be best.