0

I have a little problem with my bibliography. In the toc my Bibliography shows up right (without Chapter number). But in Text it shows the word "chapter" and the chapter number of the previous chapter. But it shouldn't (see screenshots). (I am using overleaf for writing).

% ============= Dokumentklasse =============
\documentclass[a4paper,12pt]{scrreprt}

% ============= Packages =============
% Standard Packages
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{lmodern}

% ============= Zitation =============
\usepackage{csquotes}
\usepackage[backend = biber, style = apa, sortcites = true, alldates=short]{biblatex}
\addbibresource{Literatur.bib}
\setquotestyle[quotes]{german}

% ============= Überschriften =============
\makeatletter

\def\@makechapterhead#1{%
    \vspace*{10\p@}%
    {\parindent \z@ \reset@font
        \LARGE \scshape \@chapapp{}  \thechapter\vspace*{-15\p@}
        \par\nobreak
        \interlinepenalty\@M\hrulefill\newline\vspace*{-5\p@}
        \raggedleft \Large \bfseries #1\par\nobreak
        \vspace*{-8\p@}%
        \hrulefill
        \par\nobreak
        \vskip 30\p@
}}

\def\@makeschapterhead#1{%
    \vspace*{4\p@}%
    {\parindent \z@ \raggedleft \reset@font
        \scshape
        \interlinepenalty\@M\hrulefill\newline\vspace*{-5\p@}
        \Large \bfseries #1\par\nobreak
        \vspace*{-8\p@}%
        \hrulefill
        \par\nobreak
        \vskip 30\p@
}}

\makeatother
\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}





\begin{document}
\tableofcontents

\chapter{TESTT}

TEXT
\chapter{TEST}
TEXT

\printbibliography[heading=bibintoc,title={Literaturverzeichnis}]

\nocite{*}

\end{document}

Example for literature

@inbook{Rhomberg.2005,
 author = {Rhomberg, Markus},
 title = {{Wirklich die \glqq vierte Gewalt\grqq?}},
 pages = {123--140},
 bookpagination = {page},
 publisher = {{Springer VS}},
 isbn = {978-3-531-14561-7},
 editor = {Jansen, Stephan A. and Priddat, Birger P.},
 booktitle = {{Korruption}},
 year = {2005},
 abstract = {},
 subtitle = {{Funktionsverstiindnisse fUr die Massenmedien in der Gesellschaft}},
 location = {Wiesbaden},
 booksubtitle = {{Unaufgekl{\"a}rter Kapitalismus --- Multidisziplin{\"a}re Perspektiven zu Funktionen und Folgen der Korruption}}
}


@inbook{Rossler.2013,
 author = {R{\"o}ssler, Patrick and Geise, Stephanie},
 title = {{Standardisierte Inhaltsanalyse: Grundprinzipien, Einsatz und Anwendung}},
 pages = {269--288},
 bookpagination = {page},
 publisher = {{Springer VS}},
 isbn = {978-3-531-18775-4},
 editor = {M{\"o}hring, Wiebke and Schl{\"u}tz, Daniela},
 booktitle = {{Handbuch standardisierte Erhebungsverfahren in der Kommunikationswissenschaft}},
 year = {2013},
 abstract = {},
 location = {Wiesbaden}
}

This is right

Should not show Kapitel and chapter number

It should look like this

4
  • 2
    I copy-and-pasted your MWE, removed the bits I don't have (your \include'd .tex files) and replace it with dummy content. When I then run the code (gist.github.com/moewew/6fabd4f9aa6a46da397514c63d2a4de5) I get a completely different output. Can you please reduce your example file as much as possible, make sure that it is compilable (test your code in a new, empty Overleaf project) and reproduces the output you show. Note that KOMA-Script classes aren't particularly fond of fancyhdr Warning: Usage of package fancyhdr' together with a KOMA-Script class is not recommended.`.
    – moewe
    Aug 22, 2020 at 13:20
  • @moewe I changed my example. I hope it's okay. The problem disappears, when I delete the chapter style. Is there any option to keep the chapter style but fix the problem?
    – roarhide
    Aug 22, 2020 at 14:07
  • 1
    I'm no KOMA-Script expert, but your redefinition of \@makechapterhead destroys the \addchap command. I seriously doubt this definition is a good idea. Maybe you want to ask a new question about how to obtain your desired chapter heading format in a KOMA-Script class without fancyhdr and without this definition of the internal command \@makechapterhead.
    – moewe
    Aug 22, 2020 at 14:21
  • It is probably not the best option, but this works for me \cleardoublepage \phantomsection \pagenumbering{Roman} \setcounter{page}{3} \addcontentsline{toc}{chapter}{Literaturverzeichnis} \printbibliography[title={Literaturverzeichnis}]
    – roarhide
    Aug 22, 2020 at 15:10

1 Answer 1

1

With a KOMA-Script class do not redefine internal commands like \@makechapterhead or \@smakechapterhead.You can redefine \chapterlineswithprefixformat instead and use \RedeclareSectionCommand for chapter.

Example:

\documentclass[a4paper,12pt,chapterprefix]{scrreprt}
%\usepackage[utf8]{inputenc}% needed with outdated TeX distributions
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
%\usepackage{fancyhdr}% not recommended with a KOMA-Script class
\usepackage{lmodern}

\usepackage{csquotes}
\usepackage[backend = biber, style = apa, sortcites = true, alldates=short]{biblatex}
\addbibresource{Literatur.bib}
\setquotestyle[quotes]{german}

\makeatletter
\renewcommand*{\chapterlineswithprefixformat}[3]{%
  \Ifstr{#1}{chapter}
    {%
      \Ifstr{#2}{}{}{\vspace*{6\p@}}
      {\raggedright#2}%
      \interlinepenalty\@M\hrulefill\newline\vspace*{-5\p@}
      #3\par\nobreak
      \vspace*{-8\p@}%
      \hrulefill
      \par\nobreak
    }
    
}
\makeatother
\RedeclareSectionCommand[
  beforeskip=4pt,
  afterindent=false,
  innerskip=-15pt,
  afterskip=30pt,
  font=\scshape\Large,
  prefixfont=\mdseries\LARGE
]{chapter}
\renewcommand*{\raggedchapter}{\raggedleft}

\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}

\begin{document}
\tableofcontents
\chapter{TESTT}
TEXT
\chapter{TEST}
TEXT
\printbibliography[heading=bibintoc,title={Literaturverzeichnis}]
\nocite{*}
\end{document}

Result:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .