[英]Bibliography as section in LaTeX / BibTeX
我正在使用部分而不是章節作為頂層(文檔類報告)編寫一個簡短的文檔。 然而,
\bibliographystyle{amsplain}
\bibliography{general}
導致將參考書目作為章節而不是節插入。 有什么辦法可以改變這種情況嗎?
默認情況下, report
文檔類使用\\chapter
作為書目標題級別。 相比之下, article
文檔類使用\\section
作為參考書目標題級別。 如果您沒有在文檔中的任何地方使用\\chapter
,您可能希望改用article
類。
如果您真的想使用report
類,則需要重新定義thebibliography
環境以使用\\section
而不是\\chapter
。 在文檔的序言中(在\\documentclass
行之后但在\\begin{document}
行之前,插入以下內容:
\makeatletter
\renewenvironment{thebibliography}[1]
{\section*{\bibname}% <-- this line was changed from \chapter* to \section*
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\makeatother
現在您的參考書目將有一個\\section
標題而不是\\chapter
標題。
請注意,如果您加載任何特殊的書目包,您可能希望在加載這些包之前放置此代碼(這樣您就不會覆蓋它們的工作)。
請參閱參考資料,了解使用bibtex更改書目標題級別和標題文本的簡單方法http://www.flakery.org/search/show/568
查看tocibind包;
\usepackage[numbib,notlof,notlot,nottoc]{tocbibind}
numbib
確保參考書目被編號,而not*
-options 分別禁用顯示numbib
列表、表格和目錄本身。
就我而言,我還更改了 @godbyk 的解決方案以包含部分編號。
@godbyk 的台詞:
{\section*{\bibname}% <-- this line was changed from \chapter* to \section*
我的線路:
{\section{\bibname}% <-- this line was changed from \chapter* to \section
對於章節級別的參考,可以使用:\\addcontentsline{toc}{chapter}{References}。 要將它們放在部分級別,可以使用:\\addcontentsline{toc}{section}{References}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.