0

So I have this problem, that I have the wrong chapter in the header. The Problem occours only in the last chapter and the bibliography.

as you can see here, it says chapter 4 even though it should say bibliography

From what I have seen in StackExchange I just have to change

%Literaturverzeichnis

\printbibliography[title=Literaturverzeichnis]
\ihead{Literatur}

to

%Literaturverzeichnis
\ihead{Literatur}
\printbibliography[title=Literaturverzeichnis]

and it should work just fine. I get in the Bibliograhy now the right header, but in chapter 4 the header is now wrong:

enter image description here

Now I have in Chapter 4 as header the bibliography. So I was hoping maybe someone has an idea what to do?

Here you can see my Texmaster file:

\documentclass[
    12pt,
    BCOR=5mm,
    DIV=12,
    headinclude=on,
    footinclude=off,
    parskip=half,
    bibliography=totoc,
    listof=entryprefix,
    toc=listof,
    pointlessnumbers,
    plainfootsepline]{scrreprt}
    
    \oddsidemargin = 0pt %für Seitenrand links kleiner
    \marginparsep = 16pt %für Seitenrand rechts größer

%   Konfigurationsdatei einziehen
\input{formale_einstellungen/config}

\begin{document}


%% BITTE GEBEN SIE HIER DEN TITEL UND DIE AUTORIN / DEN AUTOR DER ARBEIT AN!
%% DIESE INFORMATIONEN _MÜSSEN_ GESETZT SEIN, UM TITELBLATT, ABSTRACT UND
%% EIGENSTÄNDIGKEITSERKLÄRUNG AUTOMATISCH ANZUPASSEN!
\TitelDerArbeit{Evaluation verschiedener Datenbanken für die DAME der OFD}
\AutorDerArbeit{Sarah Übele}
\Firma{Oberfinanzdirektion Karlsruhe (LZfD)}
\Kurs{WI2019 Kurs C}

\onehalfspacing %1,5-zeiliger Abstand zwischen allen Zeilen

\input{formale_einstellungen/titlepage}

\pagenumbering{Roman} % Römische Seitennummerierung
\normalfont

%--------------------------------
% Verzeichnisse - nicht benötige Verzeichnisse bitte auskommentieren / löschen.
%--------------------------------




%   Sperrvermerk
\input{formale_einstellungen/nondisclosurenotice}
\thispagestyle{empty}

%   Kurzfassung
%\input{formale_einstellungen/abstract}
%\thispagestyle{empty}


%   Inhaltsverzeichnis
%\tableofcontents
{
  \pagestyle{empty}
  \addtocontents{toc}{\protect\thispagestyle{empty}} 
  \tableofcontents
  \clearpage
}

%   Abkürzungsverzeichnis (siehe Datei acronyms.tex!)
\input{formale_einstellungen/acronyms}
\ohead{Acronyms} % Neue Header-Definition
%\ohead{\pagemark}

%   Vorwort
%\input{vorwort}

%   Abbildungsverzeichnis
\listoffigures

%   Tabellenverzeichnis
\listoftables

%   Listingsverzeichnis
\lstlistoflistings


%   Glossar
\input{formale_einstellungen/Glossar}

%--------------------------------
% Start des Textteils der Arbeit
%--------------------------------
\clearpage
\ihead{\chaptername~\thechapter} % Neue Header-Definition (inner header)
%\ohead{\headmark} % Neue Header-Definition (outer header)
\ohead{\pagemark}
\pagenumbering{arabic}  % Arabische Seitenzahlen

%   Einleitung
\input{PJ1/Einleitung}

%   KAPITEL 2
\input{PJ1/Kapitel2}

%   KAPITEL 3
\input{PJ1/Kapitel3}

%   KAPITEL 4
\input{PJ1/Kapitel4}

% Der Anhang beginnt hier - jedes Kapitel wird alphabetisch aufgezählt. (Anhang A, B usw.)
%\appendix
%\ihead{\appendixname~\thechapter} % Neue Header-Definition

% appendix.tex einziehen
%\input{formale_einstellungen/appendix}

%Beigabenverzeichnis
%\input{beigaben}
%\ihead{Beigaben}


%Literaturverzeichnis
\ihead{Literatur}
\printbibliography[title=Literaturverzeichnis]


 %Standard aus Vorlage
%\printbibliography[heading=bibintoc, type=book, title={Literaturverzeichnis}]
%\printbibliography[heading=subbibintoc, type=online, title={Elektronische Quellen}]
%\printbibliography[heading=subbibintoc, type=article, title={Artikel}]



%   Algorithmenverzeichnis
%\listofalgorithms


% Ehrenwörtliche Erklärung ewerkl.tex einziehen
\input{formale_einstellungen/ewerkl}


\cleardoublepage

\end{document}

and here you have my config.tex:

% !TEX root =  master.tex

%       LANGUAGE SETTINGS AND FONT ENCODING 
%
\usepackage[ngerman]{babel}     % German language
\usepackage[utf8]{inputenc}
\usepackage[german=quotes]{csquotes}    % correct quotes using \enquote{}
\usepackage[T1]{fontenc}
\usepackage[left=4cm, right=2cm, top=4cm, bottom=2cm]{geometry}
\usepackage{blindtext}

\usepackage{float}


%\usepackage[english]{babel}   % For english language
%\usepackage{csquotes}  % Richtiges Setzen der Anführungszeichen mit \enquote{}

% Zwei eigene Befehle zum Setzen von Autor und Titel. Ausserdem werden die PDF-Informationen richtig gesetzt.
\newcommand{\TitelDerArbeit}[1]{\def\DerTitelDerArbeit{#1}\hypersetup{pdftitle={#1}}}
\newcommand{\AutorDerArbeit}[1]{\def\DerAutorDerArbeit{#1}\hypersetup{pdfauthor={#1}}}
\newcommand{\Firma}[1]{\def\DerNameDerFirma{#1}}
\newcommand{\Kurs}[1]{\def\DieKursbezeichnung{#1}}

% Correct superscripts 
\usepackage{fnpct}

%       CALCULATIONS
%
\usepackage{calc} % Used for extra space below footsepline

%       BIBLIOGRAPHY SETTINGS
%
% Uncomment the next three lines for author-year-style with footnotes (Chicago)
%\usepackage[backend=biber, autocite=footnote, style=authortitle, dashed=false]{biblatex}%vorher authoryear
%Use Author-Year-Cites with footnotes
%\AdaptNoteOpt\footcite\multfootcite   %will add  separators if footcite is called multiple consecutive times 
%\AdaptNoteOpt\autocite\multautocite % will add  separators if autocite is called multiple consecutive times

% Uncomment the next line for IEEE-style 
%\usepackage[backend=biber, autocite=inline, style=ieee]{biblatex}  % Use IEEE-Style (e.g. [1])

% Uncomment the next line for apa-style 
%\usepackage[backend=biber, autocite=inline, style=apa]{biblatex}   % Use apa-Style

% Uncomment the next line for alphabetic style 
% \usepackage[backend=biber,
%   style=alphabetic,
% ]{biblatex}
% %\renewcommand*{\nameyeardelim}{\addcomma\space}

% % Use alphabetic style: alphabetic (e.g. [TGK12])
% % Don't fall back on other year fields if there is no year, use
% % "nodate" string
% \DeclareLabeldate{%
%   \field{pubstate}
%   \field{date}
%   \literal{o. D.}
% }


\usepackage[backend=biber,
  style=alphabetic,
  labeldateparts,
]{biblatex}

\DefineBibliographyStrings{german}{
  andothers = {et\addabbrvspace al\adddot},
  nodate    = {{}o.\adddotspace D\adddot},
}

\DeclareDelimFormat[doublecite]{nameyeardelim}{\addcomma\space}

\DeclareLabeldate{%
  \field{date}
  \field{year}
  \literal{nodate}
}

\renewbibmacro*{date}{%
  \ifboolexpr{    test {\iffieldundef{year}}
              and test {\iffieldundef{endyear}}}
    {\bibstring{nodate}}
    {\printdate}}

\newbibmacro*{doublecite}{%
  \printtext[bibhyperref]{%
    \printnames{labelname}%
    \setunit{\addcomma\space}%
    \printtext[labelalphawidth]{%
      \printfield{labelprefix}%
      \printfield{labelalpha}%
      \printfield{extraalpha}%
      \ifbool{bbx:subentry}
        {\printfield{entrysetcount}}
        {}}%
    \setunit{\addcomma\space}%
    \printlabeldate}}

\DeclareCiteCommand{\doublecite}[\iffootnote\mkbibbrackets\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{doublecite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\doublecites}[\iffootnote\mkbibbrackets\mkbibfootnote]
  {\doublecite}{\multicitedelim}

\DeclareAutoCiteCommand{doublecite}{\doublecite}{\doublecites}
\ExecuteBibliographyOptions{autocite=doublecite,}


\setcounter{biburllcpenalty}{9000}
\setcounter{biburlucpenalty}{9000}

\setlength{\bibparsep}{\parskip}



% Uncomment the next two lines vor Harvard-Style 
%\usepackage[backend=biber, style=apa]{biblatex}    
%\DeclareLanguageMapping{german}{german-apa}


\DefineBibliographyStrings{ngerman}{  %Change u.a. to et al. (german only!)
    andothers = {et\addabbrvspace al\adddot},
}

%%%für die Umbrüche der URLs im Literaturverzeichnis
\apptocmd{\UrlBreaks}{\do\f\do\m}{}{}
\setcounter{biburllcpenalty}{9000}% Kleinbuchstaben
\setcounter{biburlucpenalty}{9000}% Großbuchstaben

\setlength{\bibparsep}{\parskip}    %add some space between biblatex entries in the bibliography
\addbibresource{bibliography.bib}   %Add file bibliography.bib as biblatex resource

%       FOOTNOTES 
%
% Count footnotes over chapters
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}

\usepackage{tablefootnote} %damit Fußnoten in Tabellen richtig angezeigt werden

%   ACRONYMS
%%%
%%% WICHTIG: Installieren Sie das neueste Acronyms-Paket!!!
%%%
\makeatletter
\usepackage[printonlyused, withpage]{acronym}

\@ifpackagelater{acronym}{2015/03/20}
  {%
    \renewcommand*{\aclabelfont}[1]{\textbf{\textsf{\acsfont{#1}}}}
  }%
  {%
  }%
\makeatother

%Figure

\renewcaptionname{ngerman}{\figurename}{Abbildung}
\renewcommand*\listoflofentryname{\figurename}
\BeforeStartingTOC[lof]{\renewcommand*\autodot{:}}

%Table


\renewcommand*\listoflotentryname{\tablename}
\BeforeStartingTOC[lot]{\renewcommand*\autodot{:}}




%       LISTINGS

\usepackage[final]{listings}    %Format Listings properly
\usepackage{color} %für das Styling in anderen Farben
\usepackage{scrhack}
\renewcommand{\lstlistingname}{Quelltext}
\renewcommand{\lstlistlistingname}{Quelltextverzeichnis}


\newcommand\listoflolentryname\lstlistingname
\BeforeStartingTOC[lol]{\renewcommand*\autodot{:}}


\lstset{numbers=left,
    numberstyle=\tiny,
    captionpos=b,
    basicstyle=\ttfamily\small,
    escapeinside={(*@}{@*)},
    literate= %für die Umlaute in Listings
    {Ö}{{\"O}}1
    {Ä}{{\"A}}1
    {Ü}{{\"U}}1
    {ß}{{\ss}}1
    {ö}{{\"o}}1
    {ü}{{\"u}}1
    {ä}{{\"a}}1
    {~}{{\textasciitilde}}1
}
    
\definecolor{codegreen}{rgb}{0,0.6,0} 
\lstdefinestyle{stylePython}{
    backgroundcolor=\color{white},       
    belowcaptionskip=1\baselineskip,
    breaklines=true,
    frame=L,
    xleftmargin=\parindent,
    language=Python,
    showstringspaces=false,
    basicstyle=\footnotesize\ttfamily,
    commentstyle=\color{codegreen},
    keywordstyle=\color{blue},
    identifierstyle=\color{black},
    stringstyle=\color{red},
    numberstyle=\tiny\color{blue},
    morekeywords={with, as}
}

%       EXTRA PACKAGES
\usepackage{graphicx} % use various graphics formats
\usepackage[german]{varioref}   % nicer references \vref
\usepackage{caption}    %better Captions
\usepackage{booktabs} %nicer Tabs
\usepackage{array}
%\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\usepackage{setspace} %für Zeilenabstand

%       ALGORITHMS
\usepackage{algorithm}
\usepackage{algpseudocode}
\renewcommand{\listalgorithmname}{Algorithmenverzeichnis }
\floatname{algorithm}{Algorithmus}


%       FONT SELECTION: Entweder Latin Modern oder Times / Helvetica
\usepackage{lmodern} %Latin modern font
%\usepackage{mathptmx}  %Helvetica / Times New Roman fonts (2 lines)
%\usepackage[scaled=.92]{helvet} %Helvetica / Times New Roman fonts (2 lines)

%PAGE HEADER / FOOTER
%Warning: There are some redefinitions throughout the master.tex-file!  DON'T CHANGE THESE REDEFINITIONS!
\RequirePackage[automark,headsepline]{scrpage2}
\pagestyle{scrheadings}
\renewcommand*{\pnumfont}{\upshape\sffamily}
\renewcommand*{\headfont}{\upshape\sffamily}
\renewcommand*{\footfont}{\upshape\sffamily}
\renewcommand{\chaptermarkformat}{}
\RedeclareSectionCommand[beforeskip=0pt]{chapter}
\clearscrheadfoot

%\ifoot[\rule{0pt}{\ht\strutbox+\dp\strutbox}Anton Zinn]{\rule{0pt}{\ht\strutbox+\dp\strutbox}Anton Zinn}
\ohead[\rule{0pt}{\ht\strutbox+\dp\strutbox}\pagemark]{\rule{0pt}{\ht\strutbox+\dp\strutbox}\pagemark}



%       HYPERREF
%
\usepackage[
    hidelinks=true % keine roten Markierungen bei Links
]{hyperref} %am Ende laden, ansonsten kommt es zu Fehlern

\makeatletter %damit Weiterleitung ins Glossar auf richtige Zeile erfolgt
 \newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother

I hope someone has a solution for my Problem and thank you for your help.

2
  • Oof, that template is ... massive. If you ever have to write a work like this again, I can only recommend you start from a more minimal setup. This thing may be very hard to handle and debug. (For example the code posted so far is not compilable for us, because we don't have the files you)
    – moewe
    Apr 13, 2021 at 15:36
  • You may also want to edit out your personal details from the example.
    – moewe
    Apr 13, 2021 at 15:36

1 Answer 1

0

The following seemed to work at least when I turned the code shown in the question into a compilable example document.

\clearpage
\ihead{Literatur}
\printbibliography[title=Literaturverzeichnis]

Note that with a current TeX system your document will not compile because the scrpage2 package is now deprecated and replaced by scrlayer-scrpage. See LaTeX Error: File `scrpage2.sty' not found.

Minimised example document

\documentclass[
    12pt,
    BCOR=5mm,
    DIV=12,
    headinclude=on,
    footinclude=off,
    parskip=half,
    bibliography=totoc,
    listof=entryprefix,
    toc=listof,
    pointlessnumbers,
    plainfootsepline]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[german=quotes]{csquotes} 
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
  style=alphabetic,
]{biblatex}
\addbibresource{biblatex-examples.bib}

\RequirePackage[automark,headsepline]{scrlayer-scrpage}
\pagestyle{scrheadings}
\renewcommand*{\pnumfont}{\upshape\sffamily}
\renewcommand*{\headfont}{\upshape\sffamily}
\renewcommand*{\footfont}{\upshape\sffamily}
\renewcommand{\chaptermarkformat}{}
\RedeclareSectionCommand[beforeskip=0pt]{chapter}
\clearscrheadfoot

\usepackage[
    hidelinks=true
]{hyperref}


\usepackage{lipsum}

\begin{document}

\chapter{Lorem}
\lipsum[1-20] \autocite{sigfridsson}

\chapter{Ipsum}
\lipsum[21-40] \autocite{sigfridsson,worman,nussbaum} \nocite{*}

\clearpage
\ihead{Literatur}
\printbibliography[title=Literaturverzeichnis]

\end{document}
1
  • Hello moewe, thank you so much, now the document does exactly what it should do :)
    – sarahlein
    Apr 20, 2021 at 10:49

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.