1

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
 ***********
  • Use the class option bibliography=totoc. – esdd Feb 15 '16 at 20:51
  • Can you let me know more about how to use this class? Where should I add the code bibliography=totoc? Thanks – Remi.b Feb 15 '16 at 20:53
  • Either as option for the KOMA-Script class \documentclass[...,bibliography=totoc]{scrartcl} or with command \KOMAoptions{bibliography=totoc} in the preamble. – esdd Feb 15 '16 at 21:21
  • I tried it but it failed. See edits to see what was returned. – Remi.b Feb 15 '16 at 21:29
2

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
  • I did NOT receive any compilation error with your script. I am using TeXShop (for MAC OSX) and I seem to be using the last version, that is TeXShop 3.60. Should I maybe give up on TeXShop and use the command line? – Remi.b Feb 15 '16 at 23:09
  • 1
    @Remi.b Okay, then the error is somewhere in your code. Try to locate where the error comes from. Check the log file, search the first error and check the line in your code where the error was recognised. The error can be before that line, but not after the given line number in the log. Best strategy to find the error: copy your code into a test file and reduce it part by part until the error vanished. Then check and test the latest commented part of your code. Try to create a minimal working example and add it to your question. See my MWE as an example ... – Mensch Feb 15 '16 at 23:24
  • I realize that when I get rid of \renewcommand{\refname}{\spacedlowsmallcaps{Bibliography}}, then it no error is produced and the references are added to the Table Of Contents. However, References is a section that is not numbered. Does that ring a bell to you?! – Remi.b Feb 16 '16 at 0:03
  • Ha ha. Ok it is getting better :) I just have to find a way to rename References into bibliography now given that the presence of both \renewcommand{\refname}{\spacedlowsmallcaps{Bibliography}} and bibliography=totocnumbered yield an error (as described in point 1 of the first edit in my post). Btw, if easy, can you point me to a source where I could have found by myself that bibliography=totoc is what I was looking for? – Remi.b Feb 16 '16 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.