# 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.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8986096978187561, "perplexity": 7632.239676714161}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-49/segments/1416931005028.11/warc/CC-MAIN-20141125155645-00119-ip-10-235-23-156.ec2.internal.warc.gz"}