我正在尝试使用单独的 bib 文件来存储两种参考文献:学术文献(文章、期刊等)和非学术文献(网站、博客等)。
为了区分它们,我创建了一个文件Academic.bib
:
@article{academic,
journal = "Journal",
title = "Title",
author = "Author",
year = "2014"
}
另一个文件Non-academic.bib
:
@article{nonacademic,
journal = "Journal",
title = "Title",
author = "Author",
year = "2014"
}
但是,如果我尝试在文档中引用它们,bibtex 会给出错误
"Illegal, another \bibdata command".
这是一个简单的例子:
\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}
我怎样才能达到预期的结果?
答案1
Bibtex 解决方案:
标准 bibtex 无法提供多个参考书目。但是,该multibib
软件包允许这样做。
multibib
提供\newcites{ac}{Academic}
将代理附加ac
到标准书目命令的命令,即\citeac
,,\nociteac
和\bibliographystyleac
\bibliographyac
。第二个参数是书目的标题。在这种情况下,需要第二个参数\newcites
即\newcites{nac}{Non-academic}
运行 之后latex
,必须 bibtex
为每个运行一次\newcites
;在这种情况下:
bibtex ac
bibtex nac
然后再涂两次乳胶。
以下是完整的 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}
生产:
Biblatex 解决方案
biblatex 允许多个书目。在这种情况下,可以为非学术书目条目定义一个特殊类别,non
然后category
使用notcategory
\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}