目录中包含参考文献列表作为编号部分

目录中包含参考文献列表作为编号部分

当我将参考文献列表添加到目录中时,与其他部分不同,它被列为未编号的部分。有办法改变这种情况吗?

我正在使用以下编程:

\documentclass[12pt,twoside]{report}

% Table of content               
\usepackage{etoolbox} % http://ctan.org/pkg/etoolbox

%References.bib
\usepackage{filecontents}
\begin{filecontents*}{References.bib}
@article{cite1,
author={Name LastName},
title={Title},
year={2018}}
\end{filecontents*}

\makeatletter 
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{\begingroup%
\patchcmd{\@makeschapterhead}% <cmd>
{\vspace*{50\p@}}% <search>
{}% <replace>
{}{}% <success><failure>
\oldtableofcontents%
\endgroup%
 }
\makeatother

% Reference list
\usepackage[backend=biber,style=nature]{biblatex}
\addbibresource{References.bib}


\begin{document}
\tableofcontents

\section{Theory etc.}
\cite{cite1}
\addcontentsline{toc}{section}{References}
\renewcommand\bibname{References}
\printbibliography

\end{document}

我真的希望有人能帮助我。

干杯

答案1

您不需要 \addcontentsline{toc}{section}{References} \renewcommand\bibname{References} 行。这只能通过 biblatex 实现,使用命令的选项。heading=subbibnumbered, title={References}如果\printbibliography您不想对参考书目进行编号,请使用。subbibintocsubbibnumbered

梅威瑟:

\documentclass[12pt,twoside]{report}

% Table of content               
\usepackage{etoolbox} % http://ctan.org/pkg/etoolbox

%References.bib
\usepackage{filecontents}
\begin{filecontents*}{References.bib}
@article{cite1,
author={Name LastName},
title={Title},
year={2018}}
\end{filecontents*}

\makeatletter 
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{\begingroup%
\patchcmd{\@makeschapterhead}% <cmd>
{\vspace*{50\p@}}% <search>
{}% <replace>
{}{}% <success><failure>
\oldtableofcontents%
\endgroup%
 }
\makeatother

% Reference list
\usepackage[backend=biber,style=nature]{biblatex}
\addbibresource{References.bib}


\begin{document}
\tableofcontents

\section{Theory etc.}
\cite{cite1}

%\printbibliography[heading=subbibintoc, title={References}]
\printbibliography[heading=subbibnumbered, title={References}]
\end{document}

MWE 的渲染: MWE 渲染图

相关内容