[Tex/LaTex] bibunits: cannot get it to work (no bu1 produced)

auxiliary-filesbibliographiesbibunitssubdividing

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?

Best Answer

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.