3

I've been using tex for some time now but mainly by filling provided templates with content. For my current project I found a nice template to format the chapter header, but can't manage to modify it for a matching bibliography. I've looked for two days through stackexchange and other sources but cant seem to find the correct solution. Here is a simple version of what I'm trying to do:


main tex file:

\input{preamble}
\begin{document}

%TOC
\tableofcontents

% Main
\chapter{Chapter 1}
\section{Section 1}
\ \\ some text with citation \cite{testCitation}

\chapter{Chapter 2}
\section{another section}
\ \\ and more text

\bibliographystyle{unsrt}
\bibliography{literatur}{}

\ \\
%\addcontentsline{toc}{chapter}{Anhang}
\appendix
\chapter{Awesome additional information}
\ \\ appendix content

\end{document}

the preamble:

 \documentclass[
 paper=A4,pagesize=automedia,fontsize=12pt,
 BCOR=20mm,DIV=22,
 twoside,headinclude,footinclude=false,
 ngerman,             
 bibtotocnumbered,        
 liststotoc,            
 listsleft,            
 pointlessnumbers,       
 cleardoublepage=empty  
]{scrreprt}

%
%load packages
%
\usepackage[ngerman]{babel}
\usepackage{cite} %bibtex
\usepackage{tabularx}
\usepackage{longtable}%
\usepackage{color}  %noetig um hintergrundfarbe der codelistings zu definieren

%
%create the chapter header
%

\definecolor{Gray}{gray}{0.95} %hintergrundfarbe der codelistings
\definecolor{numbercolor}{gray}{0.}

\makeatletter
\renewcommand\chapterheadstartvskip{\vskip50pt}

\newcommand\chaptitlefont{%
  \fontfamily{pbk}\fontseries{d}%
  \fontshape{n}\fontsize{25}{35}\selectfont\raggedleft}

\newcommand\chapnumfont{%
  \fontfamily{pbk}\fontseries{m}\fontshape{n}%
  \fontsize{36}{0in}\selectfont\color{numbercolor}}

\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
  {%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \normalfont\sectfont\nobreak\size@chapter{}%
    \if@chapterprefix
      \let\@tempa\raggedsection
    \else
      \let\@tempa\@hangfrom
    \fi
    \@tempa{\ifnum \c@secnumdepth >\m@ne%
          \if@chapterprefix
            \expandafter\size@chapterprefix
          \else
            \expandafter\size@chapter
          \fi
          \if@chapterprefix
            \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip
          \fi
      \fi
    }%
\begin{tabularx}{\textwidth}{r}
\raisebox{25pt}{\chapnumfont \chapapp \, \thechapter} \\% \\ 
%{\parbox[b]{\linewidth}{\chapnumfont Kapitel \thechapter}}
{\parbox[b]{\linewidth}{\chaptitlefont #1}}


\end{tabularx}%
 \nobreak\chapterheadendvskip
}%
}

\renewcommand*{\@@makeschapterhead}[1]{%
  \chapterheadstartvskip%
  {\normalfont\sectfont\nobreak\size@chapter{}%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \raggedsection \interlinepenalty \@M 
\begin{tabularx}{\textwidth}{X}%
{\parbox[b]{\linewidth}{\chaptitlefont #1}%
\vphantom{\raisebox{-15pt}{\chapnumfont 1}}}
\end{tabularx}%
\par}%
  \nobreak\chapterheadendvskip%
}
\makeatother

and a very simple bib file:

@article{testCitation, author={authorName}, title={document title}, journal={The Journal}, volume={01}, number={02}, year={2014}}

My problem is the following: After compiling, all is well, except that on the page containing the bibliography, the chapter header looks like this:

**Chapter 3**
**Bibliography**
the actual content

and it should look like:

**Bibliography**
the actual content

I'm thankful for any suggestions!

1 Answer 1

4

Have a look at the KOMA-documentation. There is absolutyly no need to trouble yourself with internals.

If you want to have your bibliography included in the toc, use the global option bibliography=totoc or set it later with \KOMAoption.

\documentclass[chapterprefix=true,bibliography=totoc]{scrreprt}
\addtokomafont{disposition}{\rmfamily}
\renewcommand{\chapterheadstartvskip}{\vspace{50pt}}
\renewcommand{\raggedsection}{\raggedleft}


\begin{document}
\tableofcontents
\chapter{chapter}
{\KOMAoption{chapterprefix}{false}
\chapter{\bibname}}
\end{document}
2
  • Just noticed, that you completely (haven't had a closer look) redefined the internals. You shouldn't do that if you don't have the experience. There are also deprecated options in your document.
    – Johannes_B
    Sep 5, 2014 at 21:27
  • I tried using \KOMAoption locally, but it did not work. When I tried once more, it worked, so I will delete my answer. You may tip regarding toc=bibliography.
    – Sveinung
    Sep 5, 2014 at 22:15

You must log in to answer this question.

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