是否可以将参考文献/参考书目包含在目录中,并附带适当的章节编号?
目前我的 MWE 如下,得到以下图像:
我的 MWE:
\documentclass{report}
\usepackage[resetlabels]{multibib}
% Implements functionality to "append" and "prepend" code to other commands
\usepackage{etoolbox}
\ifdefined\chapter
\newcommand{\refname}{References}
\patchcmd{\thebibliography}{\chapter*{\bibname}}{%
\section*{\refname}
\addcontentsline{toc}{section}{\refname}
}{}{}
\newcommand{\bibliographies}{%
\chapter*{\bibname}
\addcontentsline{toc}{chapter}{\bibname}
}
\else
\newcommand{\bibname}{Bibliography}
\patchcmd{\thebibliography}{\section*{\refname}}{%
\subsection*{\refname}
\addcontentsline{toc}{subsection}{\refname}
}{}{}
\newcommand{\bibliographies}{%
\section*{\bibname}
\addcontentsline{toc}{section}{\bibname}
}
\fi
\newcites{A}{References}
\newcites{B}{References}
\begin{document}
\tableofcontents
\chapter{First Chapter}
\section{A section}
this is a citation \citeA{aa}
\bibliographystyleA{plain}
\bibliographyA{lit}
\chapter{Second Chapter}
\section{A section}
this is another citation \citeB{bb}
\bibliographystyleB{plain}
\bibliographyB{lit}
\end{document}
文件lit.bib
内容如下:
@Article{aa,
author = {Author, A.},
title = {Title},
journal = {Journal},
year = 2000
}
@Article{bb,
author = {Brother, B.},
title = {Titling},
journal = {Ann. J.},
year = 2002
}
要编译你必须运行:
pdflatex main.tex
bibtex A.aux
bibtex B.aux
pdflatex main.tex
pdflatex main.tex
答案1
替换以下几行
\ifdefined\chapter
\newcommand{\refname}{References}
\patchcmd{\thebibliography}{\chapter*{\bibname}}{%
\section*{\refname}
\addcontentsline{toc}{section}{\refname}
}{}{}
\newcommand{\bibliographies}{%
\chapter*{\bibname}
\addcontentsline{toc}{chapter}{\bibname}
}
\else
\newcommand{\bibname}{Bibliography}
\patchcmd{\thebibliography}{\section*{\refname}}{%
\subsection*{\refname}
\addcontentsline{toc}{subsection}{\refname}
}{}{}
\newcommand{\bibliographies}{%
\section*{\bibname}
\addcontentsline{toc}{section}{\bibname}
}
\fi
和
\ifdefined\chapter
\newcommand{\refname}{References}
\patchcmd{\thebibliography}{\chapter*{\bibname}}{%
\section{\refname}%
}{}{}
\newcommand{\bibliographies}{%
\chapter{\bibname}%
}
\else
\newcommand{\bibname}{Bibliography}
\patchcmd{\thebibliography}{\section*{\refname}}{%
\subsection{\refname}%
}{}{}
\newcommand{\bibliographies}{%
\section{\bibname}%
}
\fi
结果: