# How do I include a global bibliography at the end of the document with bibunits?

I have this code:

\documentclass[10pt]{article}

\usepackage[globalcitecopy]{bibunits}
\usepackage{filecontents}
\usepackage[round]{natbib}

\begin{filecontents*}{mwecitations.bib}
@book{goossens93,
author = "Frank Mittelbach and Michel Goossens  and Johannes Braams and David Carlisle  and Chris Rowley",
title = "The {LaTeX} Companion",
year = "1993",
}
@article{fujita2010economic,
title={Economic effects of the unemployment insurance benefit},
author={Fujita, Shigeru},
volume={4},
year={2010}
}
@article{rothstein2011unemployment,
title={Unemployment insurance and job search in the {Great Recession}},
author={Rothstein, Jesse},
journal={NBER},
volume={w17534},
year={2011}
}
\end{filecontents*}

\defaultbibliography{mwecitations}
\defaultbibliographystyle{plainnat}

\begin{document}

\begin{bibunit}
\section{something}
First discuss \cite*{goossens93}.
\putbib
\end{bibunit}

\begin{bibunit}
\section{something else}
Now discuss \cite*{rothstein2011unemployment} and \cite*{fujita2010economic}.
\putbib
\end{bibunit}

\renewcommand{\refname}{Global bibliography}
\bibliography[mwecitations]

\end{document}


which outputs this:

There is no global bibliography and the name of the citation file is included erroneously. I'm trying to get a global bibliography that includes every citation from every bibunit at the end of the document. Per the bibunits documentation:

You can create a global bibliography as usual with the commands \bibliography[〈BibTeX files〉] and \bibliographystyle[〈style〉]. Use \cite and \nocite to generate citations that appear in the local bibliography. Use \cite* and \nocite* inside a unit to generate citations for both the local and global bibliography.

As far as I can tell, I've applied this correctly. If I use \bibliography instead of \bibliography[mwecitations] (since I'm hoping to use the default .bib file without having to call it by name), I get the error

! Paragraph ended before \bibliography was complete.

What am I doing wrong? I compile the document with

xelatex mwe
bibtex bu1.aux
bibtex bu2.aux
xelatex mwe
xelatex mwe


I'm using natbib for the author-year citations.

• I tyhink you have to replace \bibliography[mwecitations] with \bibliography{mwecitations} (Not tested but easy to understand from your input and output) – koleygr Sep 2 '17 at 18:24
• @koleygr The documentation clearly uses a bracket [ instead of a brace, but I'll try that. – Michael A Sep 2 '17 at 18:53
• I saw it there in your question after answered. But just some seconds later @Ulrike Fischer provided an answer using {} instead of []... Anyway if it fail, you should try your way but including the extension (bib) too because 〈BibTeX files〉 supposed to be with their extension if no other way mentioned. – koleygr Sep 2 '17 at 19:04
• It is may be a typo as far as I checked. See section 3.3 on the documentation you provided. – koleygr Sep 2 '17 at 19:11

There are three errors: You have a typo (brackets instead of braces), the global \bibliographystyle is missing, and you didn't run bibtex on your main file.

\documentclass[10pt]{article}

\usepackage[globalcitecopy]{bibunits}
\usepackage{filecontents}
\usepackage[round]{natbib}

\begin{filecontents*}{mwecitations.bib}
@book{goossens93,
author = "Frank Mittelbach and Michel Goossens  and Johannes Braams and David Carlisle  and Chris Rowley",
title = "The {LaTeX} Companion",
year = "1993",
}
@article{fujita2010economic,
title={Economic effects of the unemployment insurance benefit},
author={Fujita, Shigeru},
volume={4},
year={2010}
}
@article{rothstein2011unemployment,
title={Unemployment insurance and job search in the {Great Recession}},
author={Rothstein, Jesse},
journal={NBER},
volume={w17534},
year={2011}
}
\end{filecontents*}

\defaultbibliography{mwecitations}
\defaultbibliographystyle{plainnat}

\begin{document}

\begin{bibunit}
\section{something}
First discuss \cite*{goossens93}.
\putbib
\end{bibunit}

\begin{bibunit}
\section{something else}
Now discuss \cite*{rothstein2011unemployment} and \cite*{fujita2010economic}.
\putbib
\end{bibunit}

\renewcommand{\refname}{Global bibliography}
\bibliographystyle{plainnat}
\bibliography{mwecitations}

\end{document}