KOMA-Script scrbook: How to change V-space between chapter prefix and title
The scrbook
class introduces an additional \vskip
of .5\baselineskip
between the heading "Chapter" and the title; unfortunately this skip is hard-coded, so you will have to redefine \@@makechapterhead
to suppress it:
\documentclass[12pt,letterpaper,oneside,chapterprefix=on]{scrbook}
%Margins
\usepackage[letterpaper,left=1.5in,top=1in,right=1in,bottom=1in]{geometry}
%Type
\usepackage{fontspec}
%\setmainfont{Times New Roman}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\usepackage[doublespacing]{setspace}
\setlength\parindent{0.5in}
\usepackage{microtype}
\usepackage{lipsum}
%Remove vertical space above/below chapter headings:
%http://tex.stackexchange.com/questions/43087/remove-space-before-chapter-title-with-koma- script-scrbook
\renewcommand*{\chapterheadstartvskip}{\vspace*{-\baselineskip}}
\renewcommand*{\chapterheadendvskip}{\vspace*{0in}}
\renewcommand*{\chapterformat}{\chapappifchapterprefix{\nobreakspace}\thechapter}
\setkomafont{disposition}{\normalcolor\rmfamily}
\setkomafont{chapter}{\centering\MakeUppercase}
\makeatletter
\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@mainmatter
\if@chapterprefix
\expandafter\size@chapterprefix
\else
\expandafter\size@chapter
\fi
{\chapterformat}%
\if@chapterprefix
\size@chapterprefix{}\endgraf\nobreak%\vskip\baselineskip
\fi
\fi
\fi
}%
{\raggedsection \interlinepenalty\@M\size@chapter{#1}\par}}%
\nobreak\chapterheadendvskip
}
\makeatother
\begin{document}
\frontmatter
\chapter*{Abstract Title Page}
\chapter*{Abstract}
\chapter*{Copright Page}
\chapter*{Title Page}
\tableofcontents
\listoffigures
\mainmatter
\chapter{Introduction}
\lipsum[1-2]
\appendix
\backmatter
\end{document}
With the etoolbox
package, one can do this in one-line patching \@@makechapterhead
:
\documentclass[12pt,letterpaper,oneside,chapterprefix=on]{scrbook}
%Margins
\usepackage[letterpaper,left=1.5in,top=1in,right=1in,bottom=1in]{geometry}
%Type
\usepackage{fontspec}
%\setmainfont{Times New Roman}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\usepackage[doublespacing]{setspace}
\setlength\parindent{0.5in}
\usepackage{microtype}
\usepackage{etoolbox}
\usepackage{lipsum}
%Remove vertical space above/below chapter headings:
%http://tex.stackexchange.com/questions/43087/remove-space-before-chapter-title-with-koma- script-scrbook
\renewcommand*{\chapterheadstartvskip}{\vspace*{-\baselineskip}}
\renewcommand*{\chapterheadendvskip}{\vspace*{0in}}
\renewcommand*{\chapterformat}{\chapappifchapterprefix{\nobreakspace}\thechapter}
\setkomafont{disposition}{\normalcolor\rmfamily}
\setkomafont{chapter}{\centering\MakeUppercase}
\makeatletter
\patchcmd{\@@makechapterhead}{\vskip.5\baselineskip}{}{}{}
\makeatother
\begin{document}
\frontmatter
\chapter*{Abstract Title Page}
\chapter*{Abstract}
\chapter*{Copright Page}
\chapter*{Title Page}
\tableofcontents
\listoffigures
\mainmatter
\chapter{Introduction}
\lipsum[1-2]
\appendix
\backmatter
\end{document}
I commented out the line \setmainfont{Times New Roman}
since I don't have that font in my system.
As egreg noticed in a comment, with the settings of the question, the heading "Chapter #" is slightly shifted to the left; to correct this, the following additional redefinition had to be added:
\renewcommand*{\chapterformat}{\chapappifchapterprefix{\nobreakspace}\thechapter}
With a KOMA-Script class use \RedeclareSectionCommand[...]{chapter}
to change the skips before, after and inside the chapter heading:
\RedeclareSectionCommand[
afterindent=false,beforeskip=0pt,% afterindent needs version 3.26 or newer
afterskip=0pt,innerskip=0pt
]{chapter}
or
\RedeclareSectionCommand[
beforeskip=-1sp,
afterskip=0pt,innerskip=0pt
]{chapter}
Do not use \MakeUppercase
as a font command. Its usage in the second argument of \setkomafont
or \addtokomafont
results in an error.
You can redefine \chapterlineswithprefixformat
(used for chapter headings with chapterprefix=on
) and \chapterlinesformat
(used for chapter headings with chapterprefix=off
, default) to get chapter headings in capital letters:
\renewcommand\chapterlineswithprefixformat[3]{%
\ifstr{#1}{chapter}
{\MakeUppercase{#2#3}}
{#2#3}%
}
\makeatletter
\renewcommand\chapterlinesformat[3]{%
\ifstr{#1}{chapter}
{\@hangfrom{#2}{\MakeUppercase{#3}}}
{\@hangfrom{#2}{#3}}%
}
\makeatother
Example
\documentclass[12pt,letterpaper,oneside,chapterprefix=on]{scrbook}
%Margins
\usepackage[letterpaper,left=1.5in,top=1in,right=1in,bottom=1in]{geometry}
%Type
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\usepackage[doublespacing]{setspace}
\setlength\parindent{0.5in}
\usepackage{microtype}
\usepackage{lipsum}
\RedeclareSectionCommand[
afterindent=false,beforeskip=0pt,% afterindent needs version 3.26 or newer
afterskip=0pt,innerskip=0pt
]{chapter}
\setkomafont{disposition}{\normalcolor\rmfamily}
\setkomafont{chapter}{}
\renewcommand*\raggedchapter{\centering}
\renewcommand\chapterlineswithprefixformat[3]{%
\ifstr{#1}{chapter}
{\MakeUppercase{#2#3}}
{#2#3}%
}
%\makeatletter
%\renewcommand\chapterlinesformat[3]{%
%\ifstr{#1}{chapter}
%{\@hangfrom{#2}{\MakeUppercase{#3}}}
%{\@hangfrom{#2}{#3}}%
%}
%\makeatother
\begin{document}
\frontmatter
\addchap*{Abstract Title Page}
\addchap*{Abstract}
\addchap*{Copright Page}
\addchap*{Title Page}
\tableofcontents
\listoffigures
\mainmatter
\chapter{Introduction}
\lipsum[1-2]
\chapter{Chapter 2}
\lipsum[1-2]
\appendix
\backmatter
\end{document}