![书目表现得像目录中的部分](https://linux22.com/image/476375/%E4%B9%A6%E7%9B%AE%E8%A1%A8%E7%8E%B0%E5%BE%97%E5%83%8F%E7%9B%AE%E5%BD%95%E4%B8%AD%E7%9A%84%E9%83%A8%E5%88%86.png)
是否可以将参考文献/参考书目包含在目录中,并附带适当的章节编号?
目前我的 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
结果: