[Tex/LaTex] Print out contents of two .bib files

bibliographiesbibtexsubdividing

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}

Best Answer

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}

enter image description here

enter image description here

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.