
我用 LaTeX LNCS 範本寫了一篇論文。論文應有指定的頁數。因此,我需要將參考書目部分與目錄放在同一頁上。我搜尋並嘗試了不同的方法,但我不知道如何實現這一點。
參考書目部分看起來像
\renewcommand\bibname{References}
\begin{thebibliography}{5}
%
\bibitem{t1}
\end{thebibliography}
\end{document}
以下是我使用的套件:
\usepackage{makeidx}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage[nottoc,notlof,notlot]{tocbibind}
答案1
ShareLaTeX 提供的範本中的參考書目部分最終是手工完成的。我認為這裡其實沒有必要。除非您不受它的約束,否則您可以使用規範\bibliographystyle
-\bibliography
對並定義一個暫時禁用的自訂目錄巨集clearpage
:
\newcommand\TOCwithBibliography[2][plain]{%
\begingroup
\let\clearpage\relax
\tableofcontents
\vspace{2em}
\bibliographystyle{#1}
\bibliography{#2}
\endgroup
\clearpage
}
\TOCwithBibliography[<bib style>]{<bib file>}
然後在應該列印您的內容+參考書目頁面時使用。當然,您也可以硬編碼圍脖樣式和圍脖文件訊息,例如
...
\vspace{2em}
\bibliographystyle{plain}% or whatever style
\bibliography{testbib}% name of your .bib file
\endgroup
...
但我不認為這一定更好。
完整範例
使用llncs.cls
v2.6
% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\RequirePackage{filecontents}
\begin{filecontents}{testbib.bib}
@article{test123,
author = {Rufus Dufus},
title = {Some article},
journal = {Some journal},
year = {2017}
}
\end{filecontents}
\documentclass{llncs}
\usepackage{makeidx}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage{float}
%\usepackage[nottoc,notlof,notlot]{tocbibind}
\newcommand\TOCwithBibliography[2][plain]{%
\begingroup
\let\clearpage\relax
\tableofcontents
\vspace{2em}
\bibliographystyle{#1}
\bibliography{#2}
\endgroup
\clearpage
}
\begin{document}
\frontmatter
\TOCwithBibliography{testbib}
\nocite{*}
\pagestyle{headings}
\chapter{foo}
\chapter{bar}
\chapter{baz}
\end{document}
輸出
附錄
請注意,在完整的範例中,我註解掉了該tocbibind
包,因為當參考書目位於同一頁上時,強制將參考書目放入目錄中是很奇怪的。
\tableofcontents
此外,如果您想重新定義(如果您想保持標記不變),我上面展示的替代方法可能會派上用場:
\let\oldtoc\tableofcontents
\renewcommand\tableofcontents{%
\begingroup
\let\clearpage\relax
\oldtoc
\vspace{2em}
\bibliographystyle{plain}
\bibliography{yourbibfile}
\endgroup
\clearpage
}
最後你可能想知道這個問題它涉及將目錄強製到一頁上。