I´m struggling to format the entry for the references in my table of contents like the entry for the chapter.
My table of contents ("Inhalt") looks like this:
Obviously the second entry for "Literatur" is unneccessary.
I prepared an example wich looks like this:
\documentclass[11pt,a4paper]{book} % Basisdokumentenklasse
\usepackage[utf8]{inputenc} % Standard for Linux
\usepackage{ngerman} % Fr Umlaute
\usepackage[hidelinks]{hyperref} % links in PDF ohne Ksten (RSt 2017)
\usepackage{apacite}
% Das eigentliche Dokument
\begin{document}
% Inhaltsverzeichnis
\renewcommand{\contentsname}{Inhalt} % Es soll nicht Inhaltsverzeichnis heien, sondern Inhalt
\tableofcontents % Inhaltsverzeichnis einbinden
\chapter{todo}
\cite<vgl.>{test}
% Schlielich Literatur
\renewcommand{\bibname}{Literatur}
\bibliographystyle{apacite}
\addcontentsline{toc}{chapter}{Literatur}
\bibliography{bibliographie}
\end{document}
My bibliographie.bib looks like this:
% Encoding: UTF-8
@Article{test,
author = {Dr. Britta A. Mester},
title = {Auswirkungen der DSGVO auf die IT},
journal = {Wirtschaftsinformatik \& Management},
year = {2017},
volume = {4},
pages = {12--14},
}
@Comment{jabref-meta: databaseType:bibtex;}
I only want to keep the first entry "Literatur" in my table of contents. How do I achieve this?
Best Answer
If at all possible I would try to avoid using manual
\addcontentsline
s in the document body: If not used carefully, they may end up adding entries with wrong page numbers to the table of contents.Often it is possible to avoid
\addcontentsline
by using certain package options, with additional packages or with preamble code.apacite
has a very clever heuristic to decide whether or not to typeset its bibliography as a section or a chapter. When used in a class that has chapters (likebook
),apacite
detects if the bibliography is typeset in the\backmatter
or in the\mainmatter
. In the\mainmatter
the bibliography is typeset as a section (working under the assumption that each\chapter
has its own bibliography). In the\backmatter
the bibliography is typeset as a\chapter
(here the assumption is that this is the bibliography for the whole document).So you can get what you want, if you remove
\addcontentsline
and issue\backmatter
before the bibliography.Alternatively, you can turn off
apacite
's heuristic and force a chapter bibliography with the optionnosectionbib
.As mentioned in my comment under your question I would replace
\usepackage{ngerman}
with\usepackage[ngerman]{babel}
, so that is what I did in the MWE.I also loaded
\usepackage[T1]{fontenc}
for proper hyphenation/line breaking of non-ASCII characters (äöüß), see Why should I use \usepackage[T1]{fontenc}?.It is very unusual to include academic titles and degrees in the bibliography, so I replaced
author = {Dr. Britta A. Mester},
, which would (incorrectly) show up aswith
I also moved the redefinition of
\contentsname
to\captionsgerman
, which is wherebabel
keeps its language strings.Finally, I told
apacite
to avoid applying sentence case in the example, since we are dealing with a German document where turning 'Auswirkungen der DSGVO auf die IT' intowould be wrong. (Ideally this would be language-dependent, but I don't think
apacite
supports that. See also change reference appearance of apacite (but only for german language))Note that
apacite
generates citations according to the 6th edition of the APA manual. The current edition of the APA manual is the 7th edition. In the LaTeX world 7th-ed. APA style is only implemented bybiblatex-apa
. See Is there a way to apply Apa 7th references and citation style in latex?.