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 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}
share|improve this question
    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  lockstep Feb 10 '13 at 10:46
    
A quick note to mention this answer: tex.stackexchange.com/questions/35279 which deals with automatically adding keywords to different .bib files –  PLK Feb 10 '13 at 11:25
    
@lockstep, per your suggestion I added a short working code that should demonstrate what I am seeing. Thanks! –  1yen Feb 10 '13 at 12:11
    
In the Jane2010 bibentry, the comma after "month = 01" is missing. –  lockstep Feb 10 '13 at 12:19
    
Please update your question so that only the remaining problems/requests are listed. –  lockstep Feb 10 '13 at 12:26

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
running this code seems to handle bib2 correctly, but now bib1 does not display at all. –  1yen Feb 10 '13 at 13:06
    
@1yen My output possibly requires several LaTeX/biber runs. –  lockstep Feb 10 '13 at 13:07
    
thanks, but now I think your comment is revealing a more fundamental problem I have...which relates to biber. I was using bibtex to compile up to now. –  1yen Feb 10 '13 at 13:34
1  
@1yen Shold work with (several!) BibTeX runs, too. Look at your log file teo see which files must be run with BibTeX. –  lockstep Feb 10 '13 at 13:38
2  
With biber, you don't need to run on any other files - it's all done in one pass of the one (.bcf) file. I tested your example with the biblatex 2.6 beta and biber 1.5 and it gives the results which @lockstep demonstrates. –  PLK Feb 10 '13 at 16:06

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.