Bibliography as section in LaTeX / BibTeX

谁都会走 提交于 2019-12-30 01:54:10

问题


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?


回答1:


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.

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

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).




回答2:


See for a simple way to change heading level and heading text of bibliography with bibtex http://www.flakery.org/search/show/568




回答3:


Look at the package tocibind;

\usepackage[numbib,notlof,notlot,nottoc]{tocbibind}

numbib ensures the Bibliography gets numbered, while the not*-options disables showing the List of Figures, Tables and the TOC itself, respectively.




回答4:


In my case, I also changed @godbyk's solution to include the section number.

@godbyk's line:

{\section*{\bibname}% <-- this line was changed from \chapter* to \section*

My line:

{\section{\bibname}% <-- this line was changed from \chapter* to \section


来源:https://stackoverflow.com/questions/1037905/bibliography-as-section-in-latex-bibtex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!