3

I am trying to use a separate bib file for two kinds of references: academic (articles, journals, etc) and non-academic (websites, blogs, etc).

To separate them, I create a file Academic.bib:

@article{academic,
  journal = "Journal",
  title = "Title",
  author = "Author",
  year = "2014"
}

And another file Non-academic.bib:

@article{nonacademic,
  journal = "Journal",
  title = "Title",
  author = "Author",
  year = "2014"
}

However, if I try to reference them in my document, bibtex gives me the error

"Illegal, another \bibdata command".

Here's a minimal example:

\documentclass[a4paper,12pt,abstracton,titlepage]{scrartcl}
\usepackage{scrpage2}
\usepackage[utf8]{inputenc}

\title{Test document}
\author{Me}

\begin{document}
\maketitle
\newpage
\tableofcontents
\clearpage

\cite{academic} \cite{nonacademic}

\appendix

\section{Bibliography}
  \label{sec:bibliography}

  \bibliographystyle{plain}

  \subsection{Academic}
  \bibliography{Academic}{}
  \bibliography{Academic,Non-academic}{}

  \subsection{Non-Academic}
  \bibliography{Non-academic}{}

\end{document}

How can I achieve the intended result?

  • See this question on using multiple bibliographies in bibtex. – Wolhandkrab Dec 17 '14 at 8:41
  • This is not really what I wanted, since both kinds of references can be found anywhere in the document. @Guido's answer worked well though. – Schiavini Dec 17 '14 at 10:08
8

Bibtex solution:

Multiple bibliographies are not possible with standard bibtex. However, the multibib package allows for it.

multibib offers the \newcites{ac}{Academic} commands that appends the proxies ac to standard bibliography commands, i.e., \citeac, \nociteac, \bibliographystyleac and \bibliographyac. The second argument is the heading of the bibliography. In this case a second \newcites is required, i.e., \newcites{nac}{Non-academic}

After running latex, one has to run bibtex for each \newcites; in this cases:

bibtex ac
bibtex nac

and then latex two more times.

Here is a complete MWE:

\documentclass[a4paper,12pt,abstracton,titlepage]{scrartcl}
\usepackage{scrpage2}
\usepackage{multibib}
\usepackage[utf8]{inputenc}

\newcites{ac}{Academic}
\newcites{nac}{Non-Academic}

\title{Test document}
\author{Me}

\begin{document}
\maketitle
\newpage
\tableofcontents
\clearpage
\

\citeac{academic} \citenac{nonacademic}

\appendix


\section{Bibliography}
  \label{sec:bibliography}


\bibliographystyleac{plain}
  \bibliographyac{Academic}{}

\bibliographystylenac{plain}
  \bibliographynac{Non-academic}{}

\end{document} 

producing:

enter image description here

Biblatex Solution

biblatex allows for multiple bibliographies. In this case one can define a special category non for non academic bibliographic entries, and then use the category and notcategory options of \printbibliography

\documentclass[a4paper,12pt,abstracton,titlepage]{scrartcl}
\usepackage{scrpage2}
\usepackage{biblatex}

\addbibresource{Academic.bib}
\addbibresource{Non-academic.bib}

\DeclareBibliographyCategory{non}
\addtocategory{non}{nonacademic}

\usepackage[utf8]{inputenc}


\title{Test document}
\author{Me}

\begin{document}
\maketitle
\newpage
\tableofcontents
\clearpage
\

\cite{academic} \cite{nonacademic}

\appendix


\section{Bibliography}
  \label{sec:bibliography}

\printbibliography[title=Academic,heading=subbibliography,notcategory=non]

\printbibliography[title={Non-Academic},heading=subbibliography,category=non]


\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.