# bibunits: cannot get it to work (no bu1 produced)

I am trying to use the package bibunits to have separate bibliographies for sections, chapters,...

I am using TeXShop on a Mac, and I just recently installed "TeX Live 2012". I downloaded the file bibunits.sty and put it in the same folder as the files I want to compile. (I hope this is the best thing to do)

I followed the introduction by Thorsten Hansen, I used this file:

\documentclass{article} \usepackage{bibunits}
\begin{document}
\begin{bibunit}[plain]
References to the \TeX book \cite{Knuth:1991} and to Lamport’s \LaTeX\ book,
which appears only in the references\nocite{Lamport:1994}. \putbib[lit]
\end{bibunit}
\begin{bibunit}[alpha]
A new bibunit with a different style and a cite of a Postscript tutorial \end{bibunit}
\end{document}


However, no "bu1" or "bu2" is produced when I LaTeX this maintex-file. Instead, I get maintex.1.aux and maintex.2.aux, and then I simply do not know what to do next. I tried BibTex-ing and LaTex-ing all files several times, but I don't get any references in my pdf, just a "?".

Could you tell me what I am probably doing wrong?

-
Welcome to TeX.sx! Firstly, it should not be necessary to download bibunits yourself, as it is already a part of TeXlive. I suggest you remove the local copy of the style. Secondly, your example compiles fine for me and produces bu1.aux; there is no bu2.aux as you have no citations in that section. –  Andrew Swann Jan 22 '13 at 8:27
Thanks, I removed the bibunits.sty file, and only then was he willing to produce bu1.aux If I use a terminal and type "bibtex bu1.aux", then it works, but is it possible to "BibTex" bu1.auw in TexShop itself? –  fred Jan 22 '13 at 10:05
Have a look at the "Tips & Tricks" help file, in particular section 6.1 discussing the "pdflatexmk" engine. This runs "latexmk" that will cope with the necessary "bibtex" invocations etc. –  Andrew Swann Jan 22 '13 at 17:35
@AndrewSwann thanks, that works perfectly! –  fred Jan 24 '13 at 7:02
Firstly, your distribution TeXlive already includes bibunits.sty, so it is best to work with that version, rather than a local copy (which may not have been correctly set up). Just make sure your distribution is up-to-date (in this case via sudo tlmgr update --all in a terminal), and remove the local style file. Running your code on the standard distribution through pdflatex then produces bu1.aux as expected; there is no bu2.aux as you have no citations in that section.
Secondly, have a look section 6.1 of the "Tips & Trikcs" help file that comes with TexShop. There it will you tell you how to invoke the pdflatexmk engine, which will take care of the full compilation process, including running bibtex on the correct files, for you.