參考書目的行為類似目錄中的部分

參考書目的行為類似目錄中的部分

是否可以在目錄中包含具有適當章節編號的參考文獻/參考書目?

目前我的 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

結果:

在此輸入影像描述

相關內容