[Tex/LaTex] biblatex: Two .bib files with separate behavior in same document

biblatexsubdividing

I am having some trouble using biblatex with two bibliographies.

I am using the following option:

\usepackage[firstinits=true, isbn=false, url=false,  doi=false, style=ieee, defernumbers=true, sorting=ydnt, bibstyle=ieee, maxnames=5]{biblatex}
\nocite{*}
\addbibresource{bib1.bib}
\addbibresource{bib2.bib}

One bibliography I would like to insert in the middle of a document, with special sub-bibliography headings and special numberings. I have actually figured out how to do this, and it works fine. For example,

\printbibliography[heading=subbibliography,title={{\small Book Chapters}},type=incollection, keyword=DZ, prefixnumbers={B}]

\printbibliography[heading=subbibliography,title={{\small Journals}},type=article, keyword=DZ, prefixnumbers={J}]

gives me two sub-headings (Book Chapters and Journals), and under each headings the references are listed with special numberings (i.e. B1, B2, and J1, J2, etc…). It uses all the references in bib1.bib (the bib with keyword = DZ). This is exactly what I want.

I would also like to include a "standard" bibliography at the end of the document using a different .bib file. I added keywords (keywords=noDZ) to try and make life easier, and then the \printbibliography[keyword=noDZ] line where I want the bibliography to appear.

When I cite the article, it now displays the entire bib2 bibliography, and the numbering does not start at 1. I suspect I am not using \nocite correctly. I want the 2nd bibliography to start with [1], and only print references that were cited in the text.

Any help would be great!

[edit] Per request, here is a sample file closely reproducing what I described above (although now the inline reference reads [2] rather than name).

\documentclass{article}

\usepackage[firstinits=true, isbn=false, url=false,  doi=false, style=ieee, defernumbers=true, sorting=ydnt, bibstyle=ieee, maxnames=5]{biblatex}
\nocite{*}

\begin{filecontents}{\jobname-bib1.bib}
@BOOK{hectic2000,
  AUTHOR    = {Henry Hectic},
  TITLE     = {How Horticulturalists Howl},
  PUBLISHER = {Honorary Books: Henage},
  YEAR      = {2000},
  keywords={DZ}
}
@BOOK{hectic2001,
  AUTHOR    = {Henry Hectic},
  TITLE     = {How Horticulturalists Howl},
  PUBLISHER = {Honorary Books 2: Henage},
  YEAR      = {2001},
  keywords={DZ}
}
@ARTICLE{Doe2009,
author = {Jon Doe},
journal = {Transactions on Stuff},
month = 03,
number = {3},
pages = {1--11},
title = {{Example 1}},
volume = {5},
year = {2009},
keywords={DZ}
}
\end{filecontents}

\begin{filecontents}{\jobname-bib2.bib}

@ARTICLE{Kim2012,
author = {Y Kim},
journal = {Transactions on Other Stuff},
month = 01,
number = {1},
pages = {1--11},
title = {{Example 3}},
volume = {5},
year = {2012},
keywords={noDZ}
}

@ARTICLE{Jane2010,
author = {Jane Doe},
journal = {Transactions on Stuff},
month = 01,
number = {1},
pages = {1--11},
title = {{Example 2}},
volume = {5},
year = {2010},
keywords={noDZ}
}
\end{filecontents}

\addbibresource{\jobname-bib1.bib}
\addbibresource{\jobname-bib2.bib}

\begin{document}
\section{My Bib}

\printbibliography[heading=subbibliography,title={{\small Book Chapters}},type=book, keyword=DZ, prefixnumbers={B}]
\printbibliography[heading=subbibliography,title={{\small Journals}},type=article, keyword=DZ, prefixnumbers={J}]


\section{Main Text}

Now I am citing \cite{Jane2010}.  I want new references.

\printbibheading


\printbibliography[keyword=noDZ]

\end{document}

Best Answer

In your example as well as in my attempt at a solution, biblatex/biber don't stabilize (latexmk stops after the 5th compilation run); nevertheless, the output seems to be what you want:

  • Use \addsectionbib for the first bibliography resource;

  • Enclose your first section within a refsection environment, and specify the first resource as the environment's optional argument;

  • Use \nocite{*} within the refsection.

EDIT: The solution doesn't rely on keywords, so I omitted them.

\documentclass{article}

\usepackage[firstinits=true, isbn=false, url=false,  doi=false, style=ieee, defernumbers=true, sorting=ydnt, bibstyle=ieee, maxnames=5]{biblatex}

\begin{filecontents}{\jobname-bib1.bib}
@BOOK{hectic2000,
  AUTHOR= {Henry Hectic},
  TITLE = {How Horticulturalists Howl},
  PUBLISHER = {Honorary Books: Henage},
  YEAR  = {2000},
}
@BOOK{hectic2001,
  AUTHOR= {Henry Hectic},
  TITLE = {How Horticulturalists Howl},
  PUBLISHER = {Honorary Books 2: Henage},
  YEAR  = {2001},
}
@ARTICLE{Doe2009,
author = {Jon Doe},
journal = {Transactions on Stuff},
month = 03,
number = {3},
pages = {1--11},
title = {{Example 1}},
volume = {5},
year = {2009},
}
\end{filecontents}

\begin{filecontents}{\jobname-bib2.bib}
@ARTICLE{Kim2012,
author = {Y Kim},
journal = {Transactions on Other Stuff},
month = 01,
number = {1},
pages = {1--11},
title = {{Example 3}},
volume = {5},
year = {2012},
}
@ARTICLE{Jane2010,
author = {Jane Doe},
journal = {Transactions on Stuff},
month = 01,
number = {1},
pages = {1--11},
title = {{Example 2}},
volume = {5},
year = {2010},
}
\end{filecontents}

\addsectionbib{\jobname-bib1.bib}
\addbibresource{\jobname-bib2.bib}

\begin{document}

\begin{refsection}[\jobname-bib1.bib]

\nocite{*}

\section{My Bib}

\printbibliography[heading=subbibliography,title={{\small Book Chapters}},type=book,prefixnumbers={B}]
\printbibliography[heading=subbibliography,title={{\small Journals}},type=article,prefixnumbers={J}]

\end{refsection}

\section{Main Text}

Now I am citing \cite{Jane2010}.  I want new references.

\printbibliography

\end{document}

enter image description here