The standard class page headers are really only set up for one line. If doing it a lot you should modify the page headers to set the mark text into a parbox, but for a one-off long entry you can put the parbox into the mark. So this breaks all three instances:
\chapter[medium-length\\ title for TOC, if wanted]{full\\ title name}
\chaptermark{\protect\parbox{.5\textwidth}{short title\\ for running headers}}
Second update
Here is a new and in my opinion better suggestion that needs KOMA-Script Version 3.19 or newer. In version 3.19 there is a new command \chapterlineswithprefixformat
that could be redefined to use \MakeUppercase
for the chapter titles.
\documentclass[english]{scrreprt}[2015/09/29]% needs version 3.19 or newer
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\KOMAoption{chapterprefix}{true}
\renewcommand*\raggedchapter{\centering}
\RedeclareSectionCommand[beforeskip=0pt,afterskip=8\baselineskip]{chapter}
\setkomafont{chapterprefix}{\normalsize\mdseries}
\renewcommand*{\chapterformat}{%
\chapappifchapterprefix{\nobreakspace}\thechapter\autodot%
\IfUsePrefixLine{%
\par\nobreak\vspace{-\parskip}\vspace{-.6\baselineskip}%
\rule{0.9\textwidth}{.5pt}%
}{\enskip}%
}
\renewcommand\chapterlineswithprefixformat[3]{%
\MakeUppercase{#2#3}
}
\begin{document}
\tableofcontents
\chapter{Chapter One}
\textbf{\KOMAScriptVersion}
\par
\Blindtext
\addchap{Chapter without number}
\Blindtext
\end{document}
Note: If you also want to use \MakeUppercase
without the option chapterprefix=true
you have to redefine the command \chapterlinesformat
:
\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
\@hangfrom{#2}{\MakeUppercase{#3}}%
}
\makeatother
Update
My original answer (see below) works with both MiKTeX2.9 and TL 2015 but not with 2014 (but you can load fixltx2e
to get it to work as @Johannes mentioned in a comment). So here is another suggestion.
\documentclass[english]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\KOMAoption{chapterprefix}{true}
\renewcommand*\raggedchapter{\centering}
\newif\ifmakeupper
\newcommand*\chaptertitleformat[1]{\ifmakeupper\MakeUppercase{#1}\else#1\fi}
\addtokomafont{chapter}{\makeuppertrue}
\setkomafont{chapterprefix}{\normalsize\mdseries}
\renewcommand*{\chapterformat}{%
\MakeUppercase{\chapappifchapterprefix{\nobreakspace}}\thechapter\autodot%
\IfUsePrefixLine{%
\par\nobreak\vspace{-\parskip}\vspace{-.6\baselineskip}%
\rule{0.9\textwidth}{.5pt}%
}{\enskip}%
}
\RedeclareSectionCommand[beforeskip=0pt,afterskip=8\baselineskip]{chapter}
\renewcaptionname{english}{\contentsname}{\chaptertitleformat{Contents}}
\begin{document}
\tableofcontents
\chapter{\chaptertitleformat{Chapter One}}
\textbf{\KOMAScriptVersion}
\par
\Blindtext
\addchap{\chaptertitleformat{Chapter without number}}
\Blindtext
\end{document}
Note, you have to redefine \tablename
, \listfigurename
, \listtablename
, ... so that they use \chaptertitleformat
and you have to insert this in all \chapter
commands. But as an advantage now there is only a switch in the \addtokomafont
command.
Original answer (does not work with Version 3.19)
Here is a suggestion but note that \MakeUppercase
inside \setkomafont
or \addtokomafont
can be problematic. In any case \MakeUppercase
have to be the last command added to the komafont of a fontelement because it needs an argument.
\documentclass[english]{scrreprt}[2015/02/07]
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\KOMAoption{chapterprefix}{true}
\renewcommand*\raggedchapter{\centering}
\addtokomafont{chapter}{\MakeUppercase}
\setkomafont{chapterprefix}{\normalsize\mdseries}
\renewcommand*{\chapterformat}{%
\chapapp~\thechapter%
\par\nobreak\vspace{-\parskip}\vspace{-.6\baselineskip}%
\rule{0.9\textwidth}{.5pt}%
}
\RedeclareSectionCommand[beforeskip=0pt,afterskip=8\baselineskip]{chapter}
\begin{document}
\tableofcontents
\blinddocument
\end{document}
Best Answer
Use a couple of
\MakeUppercase
instructions:I used
\Large
instead of\huge
because I got an overfull line with the latter. I also reduced the space between the colon and the title.