[Tex/LaTex] How to make an entry in the table of contents for the bibliography

bibliographiesnatbibsectioningtable of contents

Question

In a document of class scrartcl, I would to make an entry in the table of contents for the bibliography. Currently the table of contents contain entries for any notation of \section{} and \subsection{} in the document.

My trial

The only pseudo-solution I found was to create a section bibliography and then remove the standard bibliography heading.

\section{Bibliography}
\renewcommand{\refname}{\spacedlowsmallcaps{}} % For removing the bibliography heading
\bibliography{/Users/remi/Documents/Biologie/Literature/BibTex/Proposal-cited2}

However, this solution makes an extra spacing between the section header (Bibliography) and the first reference.

Extra Formatting Info

Here are a few lines of code at the beginning of the document that you might need to know to answer

\documentclass[
fontsize=10pt,
paper=a4
]{scrartcl}

\linespread{1.5}

\usepackage[round,mcite]{natbib}
\bibliographystyle{plainnat}

EDIT 1

After @esdd's comments. I have tried the following

  1. Adding bibliography=totoc to my document class. It produced the following error message

    (./ResearchPlan_0.0.1.bbl
    Runaway definition?
    ->\protect \protect \<>-\textls {\protect \begingroup \-command \ETC.
    ./ResearchPlan_0.0.1.bbl:1: TeX capacity exceeded, sorry [main memory size=5000
    000].
    \reserved@
    a
    l.1 \begin{thebibliography}{24}

    ./ResearchPlan_0.0.1.bbl:1: ==> Fatal error occurred, no output PDF file produ
    ced!
    Transcript written on ResearchPlan_0.0.1.log.

  2. Adding \KOMAoptions{bibliography=totoc} right before \begin{document} but it doesn't change anything (I typesetted several times).

EDIT 2

Here is the list of files in the log file.

 *File List*
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX
 document
scrartcl.cls    2015/05/06 v3.17a KOMA-Script document class (article)
scrkbase.sty    2015/05/06 v3.17a KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2015/05/06 v3.17a KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2015/05/06 v3.17a KOMA-Script package (loading files)
tocbasic.sty    2015/05/06 v3.17a KOMA-Script package (handling toc-files)
scrsize10pt.clo    2015/05/06 v3.17a KOMA-Script font size class option (10pt)
typearea.sty    2015/05/06 v3.17a KOMA-Script package (type area)
blindtext.sty    2012/01/06 V2.0 blindtext-Package
  xspace.sty    2014/10/28 v1.13 Space after command names (DPC,MH)
  natbib.sty    2010/09/13 8.31b (PWD, AO)
  omscmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
 ***********

Best Answer

It could be that you use an older version of KOMA-Script.

Please run the follwing MWE three times (I included a small bib file with package filecontents, resulting with one warning) and check the log file. There you should find at the end a list of used class and packages and version numbers (created with command \listfiles in the mwe). Add this list to your question please.

Edit: I added the renaming of "References" to "Bibliography" in the MWE and how you can change the font for the heading "Bibliography" (You find the changed parts in the MWE marked with <=======).

Please check my answer to this question to learn how to rename "References" (with more explained code).

The documentation of KOMA-Script you should have on your computer. Please try texdoc scrguien for the english version or texdoc scrguide for the german version on your terminal/console.

MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
@misc{mozart:KV183,
  author  = {Mozart, Wolfgang Amadeus},
  title   = {Sinfonie g-Moll},
  year    = {1773},
  address = {Salzburg},
  note    = {New K{\"o}chelverzeichnis Nr. 183, old version Nr. 25; 
             Erster Satz: Allegro con brio, Zweiter Satz: Andante, 
             Dritter Satz: Menuetto, Vierter Satz: Allegro},
}
\end{filecontents*}

\listfiles % <=========================================================
\documentclass[%
% bibliography=totoc % <=============== unnumbered bib reference  in TOC 
  bibliography=totocnumbered % <========= numbered bib reference  in TOC 
 ,fontsize=10pt
 ,paper=a4
]{scrartcl} % scrbook scrreprt

\usepackage[english]{babel}
% renaming Reference to Bibliography with KOMA-Script
%\renewcaptionname{english}{\bibname}{Bibliography} % scrreprt, scrbook
 \renewcaptionname{english}{\refname}{Bibliography} % scrartcl

\usepackage{blindtext}

\usepackage[round,mcite]{natbib}

\title{Test}
\author{Username}
\date{\today}

\begin{document}

\maketitle

\tableofcontents

\Blinddocument

This is text with \cite{Goossens} and \cite{adams}.

\nocite{*} % to test all bib entrys
\bibliographystyle{plainnat}
\addtokomafont{section}{\normalfont\scshape} % <========== Change font to SC 
\bibliography{\jobname}

\end{document}

List of used class, packages and version numbers:

 *File List*
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX document
scrartcl.cls    2015/10/03 v3.19a KOMA-Script document class (article)
scrkbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
 scrbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-independent basics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2015/10/03 v3.19a KOMA-Script package (loading files)
tocbasic.sty    2015/10/03 v3.19a KOMA-Script package (handling toc-files)
scrsize10pt.clo    2015/10/03 v3.19a KOMA-Script font size class option (10pt)
typearea.sty    2015/10/03 v3.19a KOMA-Script package (type area)
blindtext.sty    2012/01/06 V2.0 blindtext-Package
  xspace.sty    2014/10/28 v1.13 Space after command names (DPC,MH)
  natbib.sty    2010/09/13 8.31b (PWD, AO)
  omscmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
Related Question