8

I am using one .bib files and need to create multiple bibliographies for each chapter + one global one in the end, using biblatex (biber). Everything works smoothly with the multiple bibliographies using refsection, however, I fail to create the global biblio.

I found a very similar problem here: Multiple bibliographies and one global bibliography - all with global labels - however the solution

\nocite{*}

does not work for me as I need only those references cited (my .bib file is very large.

My example:

\usepackage[refsection=chapter, style=authoryear-comp,natbib=false,mcite=false,backend=biber]{biblatex}
\addbibresource{refs.bib}
\begin{document} 
\begin{refsection}
blabla \cite{}
\printbibliography[heading=subbibintoc]
\end{refsection}

% and now the global one that should include all previously cited documents

\printbibliography[heading=bibintoc]

\end{document}
\begin{refsection}
blabla \cite{}
\printbibliography[heading=subbibintoc]
\end{refsection}

It does neither produce a global biblio nor an entry in the toc.

11

I use segments instead of sections. Then you get the same and unique keys for the global bibliography, and you can get a global bibliography as well.

The final \printbibliography which doesn't state which segment it is for shows all segments. This works (for me), even though I don't think this is what the Biblatex documentation says. It says that the default for segment is "0" and segment 0 consists only of the citations outside of any environments. (If you put segment=0 there explicitly you get no list there.)

\begin{filecontents}{refs.bib}
@Book{book1,
  author =       {Thor, A. U.},
  year =         2012,
  title =    {Book1}}

@Book{book2,
  author =       {Thor, A. U.},
  year =         2013,
  title =    {Book2}}

@Book{book3,
  author =       {Thor, A. U.},
  year =         2014,
  title =    {Book3}}
\end{filecontents}
\documentclass{article}

\usepackage[style=authoryear-comp]{biblatex}
\addbibresource{refs.bib}

\begin{document} 
\tableofcontents
\section{Foo}
\begin{refsegment}
  \cite{book1}
  \printbibliography[segment=1, title={First bib}, heading=subbibintoc]
\end{refsegment}

\section{Bar}
\begin{refsegment}
  \cite{book2}

  \printbibliography[segment=2, title={Second bib}, heading=subbibintoc]
\end{refsegment}

\printbibliography[title={Global bib}, heading=bibintoc]

\end{document}
  • Did you have a look at chapterbib? Your solution looks nice (untested) but a bit complicated? Also why does do you have the refs twice in the re\begin part? – Trefex Mar 31 '14 at 16:00
  • 1
    I made a cut-and-paste-error, that I've fixed now. Thanks for pointing it out, @Trefex! (Re question on some other package: No.) – pst Mar 31 '14 at 16:07
  • 1
    +1 for segments. Do you need the \makeatletter stuff? I seem to be getting perfectly satisfactory results without it. – Paul Stanley Mar 31 '14 at 20:45
  • Oops! No I tricked myself there. The Biblatex documentation says similar things about section and segment, that the citations outside the environments are assigned to section/segment 0 (which is empty), but it doesn't work the same. Will edit now. – pst Mar 31 '14 at 21:04
  • FYI, you can also use the refsegment=<part/chapter/section/subsection> biblatex's global option in order to automatically create a new refsegment every part/chapter/... – ebosi Sep 10 '17 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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