[Tex/LaTex] Bibliography as \section instead of \section*

bibliographiestable of contents

I’m writing on my thesis at the moment and have a problem with the bibliography. I want to have a bibliography for every chapter. I included the \usepackage[sectionbib]{chapterbib} command. The bibliography is now in the list of contents, but not as section. How can I change the sectionbib to make a \section of it instead of a \section*?

Best Answer

This is another solution, with the package tocbibind.

Load chapterbib as

\usepackage[sectionbib]{chapterbib}

and tocbibind as

\usepackage[nottoc,numbib]{tocbibind}

The option nottoc avoids the ToC to be inserted in the ToC itself, while the option numbib transforms the bibliography in a non-starred \section.

MWE (kindly borrowed from Harish' one):

\documentclass{report}
\usepackage{filecontents}
\begin{filecontents*}{chap1.tex}
  \chapter{First Chapter}
  \section{A section}
  \blindtext
  \cite{book-full}
  \bibliographystyle{plain}
  \bibliography{xampl}
\end{filecontents*}
\begin{filecontents*}{chap2.tex}
  \chapter{Second Chapter}
  \section{Another section}
  \blindtext
  \cite{article-full}
  \bibliographystyle{plain}
  \bibliography{xampl}
\end{filecontents*}
\usepackage[sectionbib]{chapterbib}
\usepackage{blindtext}
\usepackage[nottoc,numbib]{tocbibind}
\begin{document}
\tableofcontents
\include{chap1}
\include{chap2}
%% this too becomes a section not \chapter*
\bibliographystyle{plain}
\bibliography{xampl}
\end{document} 

Output:

enter image description here

Related Question