# Print out contents of two .bib files

I have two .bib file with a selection of references in each.

I would like to print out these references in the same document with diffeent section headings with the numbering of references in each section starting from 1. My first attempt is below: This gives the correct section headings but puts TEST1.bib references in both with no TEST2.bib references...Where am I going wrong? I am using TexMaker to compile.

\documentclass{article}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{multibib}
\begin{document}
\nocite{*}
\begingroup
\section*{Section 1}
\renewcommand{\section}[2]{}
\bibliographystyle{plain}
\bibliography{TEST1}
\endgroup
\begingroup
\section*{Section 2}
\renewcommand{\section}[2]{}
\bibliographystyle{plain}
\bibliography{TEST2}
\endgroup
\end{document}

-

This is how it is done:

\documentclass{article}
\usepackage[resetlabels]{multibib}
\newcites{journal,conference}{{Section--1},{Section--2}}

\begin{document}
\nocitejournal{*}
\bibliographystylejournal{plain}
\bibliographyjournal{xampl}        %% use TEST1 here
%
\nociteconference{*}
\bibliographystyleconference{plain}
\bibliographyconference{doi}       %% use TEST2 here
\end{document}


To process this, the commands should be executed as below:

pdflatex myfile   %% assuming that the above code is saved as myfile.tex
bibtex journal
bibtex conference
pdflatex myfile
pdflatex myfile


Some editors have algorithms (like winedt) which do all these by themselves. If not the above commands should be executed from the same folder as the myfile.tex file.

-
When running bibtex i get an error saying there is no \bibstyle command found in the .aux file? and no \citation commands and I still only get Test1 references? –  user2772383 Sep 25 '13 at 10:39
@user2772383 you have to execute bibtex on journal.aux and conference.aux. –  Harish Kumar Sep 25 '13 at 11:52

That's actually a very simple thing to accomplish, biblatex provides support for that out-of-the-box using the \refsection environment.

\usepackage[sorting=none, backend=biber]{biblatex}

\section{Section One}
\begin{refsection} % open refsection environment

Some Text here \cite{Author1999}

% This here prints your bibliography
\end{refsection}

\section{Next Section}
% repeat


If you need more details, check out the bibtex documentation, it even provides examples.

-

You can also use bibunits package to add multiple bibliographies.

\usepackage{bibunits}

\begin{document}

\begin{bibunit}[plain]
Some Content here!
\putbib[mybib]
\end{bibunit}

\begin{bibunit}[plain]
Some Content here!
\putbib[mybib]
\end{bibunit}


However, you will need to run bibtex with different arguments to process new bibliography files bu1.aux, bu2.aux, etc.

-