参考书目作为LaTeX/BibTeX中的一部分 [英] Bibliography as section in LaTeX / BibTeX

查看:157
本文介绍了参考书目作为LaTeX/BibTeX中的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个简短的文档,其中使用章节而不是章节作为顶层(文档类报告).但是,

I'm writing a short document using sections rather than chapters as the top-level (documentclass report). However,

\bibliographystyle{amsplain}
\bibliography{general}

使参考书目作为章节而不是章节插入.有什么办法可以改变这一点?

causes the bibliography to be inserted as a chapter rather than a section. Is there any way to change this?

推荐答案

默认情况下,report文档类使用\chapter作为书目标题级别.相反,article文档类使用\section作为书目标题级别.如果您不在文档的任何地方使用\chapter,则可能需要使用article类.

By default, the report document class uses \chapter as the bibliography heading level. In contrast, the article document class uses \section as the bibliography heading level. If you're not using \chapter anywhere in your document, you might want to use the article class instead.

如果您确实要使用report类,则需要重新定义thebibliography环境以使用\section而不是\chapter.在文档的序言中(在\documentclass行之后但在\begin{document}行之前,插入以下内容:

If you really want to use the report class, you'll need to redefine the thebibliography environment to use \section instead of \chapter. In the preamble of your document (after the \documentclass line but before the \begin{document} line, insert the following:

\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标题.

Now your bibliography will have a \section heading instead of a \chapter heading.

请注意,如果您加载任何特殊的书目包,则可能要在加载这些包之前 放置此代码(这样就不会覆盖它们的工作).

Note that if you load any special bibliography packages, you might want to put this code before those packages are loaded (so you don't overwrite their work).

这篇关于参考书目作为LaTeX/BibTeX中的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆