
我正在寫一篇論文\documentclass[12pt,twoside]{report}
,並且有一個參考書目章節。目前,有一個名為「參考書目」的章節,頁面的其餘部分是空白的。下一頁是參考書目,頂部再次顯示“參考書目”。請參閱圖片以取得進一步說明。關於該部分的程式碼也是
\chapter{Bibliography}
\bibliographystyle{plainnat} % or try abbrvnat or unsrtnat
\bibliography{Mendeley} % refers to example.bib
我想要第 6 章,後面是標題“參考書目”,然後是實際的參考書目。嘗試過我在這裡找到的不同解決方案,但沒有成功。
答案1
一種快速方法是修補這報告班( report.cls
) 重新定義thebibliography
環境並更改\chapter*{\bibname}
(\chapter{\bibname}
不明顯修改文件report.cls
)。讓我們記住,\chapter*{}
創建沒有編號的章節並對\chapter{}
章節進行編號。
為了實現這一點,您可以使用該套件xpatch
(這需要在內部使用expl3.sty
和更多乳膠3包,但沒關係)。
使用命令可以進行此更改\xpatchcmd{<command>}{<search>}{<replace>}{<success>}{<failure>}
。
\documentclass[12pt,twoside]{report}
%----------------------------------
% Redefine `thebibliography` environment
\usepackage{xpatch}
\xpatchcmd{\thebibliography}{\chapter*{\bibname}}{\chapter{\bibname}}{}{}
%---------------------------------
\begin{document}
\chapter{First}
Here we cite\cite{key}
%\chapter{Bibliography} % unnecessary
\bibliographystyle{plainnat} % or try abbrvnat or unsrtnat
\bibliography{Mendeley} % refers to example.bib
\end{document}