[Tex/LaTex] Global and per chapter bibliographies

biblatexbibliographies

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.

Best Answer

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}