24

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?

laalto
  • 150,114
  • 66
  • 286
  • 303
Martijn
  • 5,471
  • 4
  • 37
  • 50

4 Answers4

32

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

godbyk
  • 8,359
  • 1
  • 31
  • 26
  • Not using any special packages. Thanks for the code, and for the article suggestion! – Martijn Jun 25 '09 at 06:26
  • Thanks for the code. Works nicely. However, with this modification, the bibliography would disappear from the bookmark. – Yebo Liu Sep 06 '19 at 06:17
  • Thanks for this great code! I needed to include a bibliography as a subsubsection and the format of the bibliography header and the format of the header changed without a problem. However, I also use the fancyheadr package it still puts the bibliography as a section into the header, altough it is supposed to be a subsubsection... Is there also fix for that? – Luise Feb 15 '21 at 17:13
  • @Luise That's a result of the `\@mkboth` line. If you remove that line, it should leave the running heads unmolested. I probably should've modified that originally when changing `\chapter*` to `\section*`. – godbyk Feb 26 '21 at 05:03
10

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.

Morten Siebuhr
  • 6,068
  • 4
  • 31
  • 43
0

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
Tulio Casagrande
  • 1,499
  • 1
  • 15
  • 20
-1

For having references at the chapter level, one can use: \addcontentsline{toc}{chapter}{References}. To have them at the section level, one can use:\addcontentsline{toc}{section}{References}