1

I am trying to add my bibliography to the toc, which works - but instead of showing as a regular chapter, the bib shows as a section.

Since in my understanding, the bib should show as a chapter in report classes, this is confusing me very much. Also, I found many questions on how to reach the opposite (showing as a section instead of a chapter), but nothing on this problem. So maybe it's just a very stupid mistake I made. Anyway, here is my (simplified) latex code test.tex:

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}
\usepackage[autooneside=false,headsepline]{scrlayer-scrpage} %this causes the bib to be shown as a section
% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}
% citation
\usepackage{apacite}
% german
\usepackage[english,ngerman]{babel}

\begin{document}
\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\shortcite{ESP}
\newpage

\pagenumbering{roman}
% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\bibliographystyle{apacite}
\bibliography{test}

\end{document}

Bib file test.bib:

@inproceedings{ESP,
    author = {von Ahn, Luis and Dabbish, Laura},
    title = {{Labeling Images with a Computer Game}},
    booktitle = {{Proceedings of the SIGCHI Conference on Human Factors in Computing Systems}},
    series = {CHI '04},
    year = {2004},
    isbn = {1-58113-702-8},
    location = {Vienna, Austria},
    pages = {319--326},
    numpages = {8},
    url = {http://doi.acm.org/10.1145/985692.985733},
    doi = {10.1145/985692.985733},
    acmid = {985733},
    publisher = {ACM},
    address = {New York, NY, USA},
    keywords = {World Wide Web, distributed knowledge acquisition, image labeling, online games}
}

The result is the following: Bibliography not showing as expected

As you can see, the bibliography is shown as if it were a section, not a chapter. How can I accomplish that it looks like the lof and lot in the toc? Any help is appreciated. Thanks in advance!

Edit: Removed the article option in the document class (which changed nothing) as well as the tocibind package (which resulted in the lof and lot not being shown in the toc, but I guess I can use other commands for that) and added the bib file as well as the content file. Loading hyperref last as suggested resulted in errors: !Undefined control sequence.\hyper@@link ....

Edit 2: The line \usepackage[autooneside=false,headsepline]{scrlayer-scrpage} seems to be causing this behaviour, though I could not find out why. I am searching for a solution now to use scrlayer-scrpage without messing up my bib.

  • We do not have your contents.tex and report.bib. If I use \Blinddocument provided by package blindtext and biblatex-examples.bib, I can not reproduce the issue. Your global option article seems to be unused. Do not use package tocbibind with a KOMA-Script class. These classes provide options like listof=totoc, bibliography=totoc, index=totoc to get ToC entries for LoF, LoT, Bibliography and index. – esdd Jul 21 '18 at 16:03
  • Welcome! What is the article option to the document class supposed to do? Are you sure that doesn't make the bibliography a section? – cfr Jul 22 '18 at 0:13
  • Load hyperref last. – cfr Jul 22 '18 at 0:14
  • 1
    @cfr Thank you, too, see the updated question. Loading hyperref last resulted in errors. – Nanella Jul 22 '18 at 10:06
  • 2
    Like esdd below, I can't reproduce the result you show with the code you've given. I think you might be better using the book-alike KOMA class so you have access to \frontmatter and \backmatter, just switching to single-sided if you don't want the double-sided effect. This would save the manual insertion of all the new pages and so on. – cfr Jul 22 '18 at 14:20
0

It is too long for a comment. Using your added bib file and the content.tex I still can not reporduce the issue:

\begin{filecontents*}{report.bib}
@inproceedings{ESP,
    author = {von Ahn, Luis and Dabbish, Laura},
    title = {{Labeling Images with a Computer Game}},
    booktitle = {{Proceedings of the SIGCHI Conference on Human Factors in Computing Systems}},
    series = {CHI '04},
    year = {2004},
    isbn = {1-58113-702-8},
    location = {Vienna, Austria},
    pages = {319--326},
    numpages = {8},
    url = {http://doi.acm.org/10.1145/985692.985733},
    doi = {10.1145/985692.985733},
    acmid = {985733},
    publisher = {ACM},
    address = {New York, NY, USA},
    keywords = {World Wide Web, distributed knowledge acquisition, image labeling, online games}
}
\end{filecontents*}
\begin{filecontents*}{content.tex}
Test \shortcite{ESP}
\end{filecontents*}

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[english,ngerman]{babel}
\renewcaptionname{ngerman}{\refname}{Literaturverzeichnis}

\usepackage[hypertexnames=false]{hyperref}
% citation
\usepackage{apacite}
\bibliographystyle{apacite}

\BeforeStartingTOC[toc]{\thispagestyle{empty}\pagestyle{empty}}
\AfterStartingTOC[toc]{\clearpage}

\begin{document}
\title{Titel}
\author{Autor}
\maketitle

\tableofcontents

\cleardoubleoddpage
\pagenumbering{arabic}
Test \shortcite{ESP}

\cleardoubleoddpage
\pagenumbering{roman}
\listoffigures
\listoftables

\bibliography{report}
\end{document}

Result:

enter image description here

  • Your code works for me, too. There must be something in my code that differs from yours and makes the bib look weird in the toc. I updated the example in the code, showing more of my code. – Nanella Jul 28 '18 at 9:40
  • Found out it's the srclayer-scrpage package that causes the behaviour. Cannot find out what to change, though. – Nanella Jul 28 '18 at 10:19
0

This combination of the packages scrlayer-scrpage and apacite does not seem to work. I fixed it by switching from apacite to biblatex apa style.

This works now:

\documentclass[
  headsepline,
  listof=totoc,% ToC entries for LoF, LoT etc.
  %index=totoc,% uncomment if needed
  bibliography=totoc,% ToC entry for bibliography
]{scrreprt}
\usepackage[autooneside=false,headsepline]{scrlayer-scrpage}
% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}
\usepackage[english,ngerman]{babel}
% citation
\usepackage[style=apa,backend=biber]{biblatex}
\bibliography{test}

\begin{document}
\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\cite{ESP}
\newpage

\pagenumbering{roman}
% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\printbibliography

\end{document}

Result: enter image description here

0

The problem is not because of scrlayer-scrpage.

The default option of apacite shows the bib as section not as chapter.

To show it as chapter you just have to add the option nosectionbib to apacite pachage like this:

\usepackage[nosectionbib]{apacite}

Edit: Here the complete document:

\documentclass[
headsepline,
listof=totoc,% ToC entries for LoF, LoT etc.
%index=totoc,% uncomment if needed
bibliography=totoc,% ToC entry for bibliography
]{scrreprt}

\usepackage[autooneside=false,headsepline]{scrlayer-scrpage}

% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

% font style
\usepackage{mathptmx}
\usepackage[scaled=0.9]{helvet}
\usepackage{courier}

% citation
\usepackage[nosectionbib]{apacite}

% german
\usepackage[english,ngerman]{babel}

\begin{document}

\pagestyle{empty}
\selectlanguage{ngerman}

% toc
\thispagestyle{empty}
\tableofcontents
\newpage
\clearpage

% sections
\pagenumbering{arabic}
\chapter{Test Chapter}
\cite{ESP}
\newpage

\pagenumbering{roman}

% lof
\listoffigures
\newpage

% lot
\listoftables
\cleardoublepage
\newpage

% bib
\bibliographystyle{apacite}
\bibliography{test}

\end{document}

Result:

enter image description here

  • Welcome to TeX - LaTeX! This sounds very plausible. Can you put together a complete document showing this working. – Andrew Swann May 2 at 10:48

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.