# Use \singlespacing in scrheading and \onehalfspacing in the main document

I'm writing an article using KOMA-script scrartcl class. The main text uses \onehalfspacing option from setspace package. In my article I have headings with couple lines of text set up using scrpage2 package. What I'm trying to achieve is to use \singlespacing only in headings.

Something like this:

\documentclass[fontsize=14pt,headlines=3,headinclude]{scrartcl}
\usepackage{xltxtra}
\setmainfont{CMU Serif}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{scrpage2}
\chead{Some really long text\\ that takes\\more than one line}

\begin{document}
\onehalfspacing
\lipsum
\end{document}


I'd like that some really long text to have single spacing. Is it possible? Reading KOMA-script manual I didn't find anything suggesting about spacing in headings.

• How about \chead{\parbox{\textwidth}{\singlespacing\centering ..}}? – Werner Oct 23 '13 at 20:50
• Thanks for quick reply. It kind of does that, but header's top margin increases instead of heading itself shifting top. I mean, it leaves more whitespace on top of the page. Probably could be fixed by doing something with text area height? – Kona-chan Oct 23 '13 at 20:59

First, prepend \setstretch{1} to the argument of \chead. (Don't use \singlespacing because that would add extra space at the start.) Second, because a singlespaced line's height is 0.8 times the height of a onehalfspaced line, change headlines=3 to headlines=2.4.

\documentclass[fontsize=14pt,headlines=2.4,headinclude]{scrartcl}
\usepackage[onehalfspacing]{setspace}
\usepackage{lipsum}
\usepackage{scrpage2}
\chead{\setstretch{1}Some really long text\\ that takes\\more than one line}
\begin{document}
\lipsum
\end{document}

• This is it, much appreciated! – Kona-chan Oct 23 '13 at 21:11

I'd use a \parbox; but since scrpage2 already uses a \parbox itself for placing the header, the final result will be almost unpredictable, unless we do the trick of hiding the height of the box

\documentclass[fontsize=14pt,headlines=3,headinclude]{scrartcl}
\usepackage[pass,showframe]{geometry} % just to draw frames
\usepackage{fontspec}
\setmainfont{CMU Serif}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{scrpage2}
\parbox[b][0pt]{\textwidth}{
\singlespacing\centering
Some really long text\\
that takes\\
more than one line\vspace{-\dp\strutbox}
}%
}

\begin{document}
\onehalfspacing
\lipsum
\end{document}


The final \vspace is meant to push the bottom line in the “really correct” position (a couple of points, actually).

Since 2013 scrpage2 is obsolete. Since version 3.24 the official successor scrlayer-scrpage has an option singlespacing to set the page head and footer in singlespacing:

\documentclass[fontsize=14pt,headlines=3,headinclude]{scrartcl}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage[singlespacing]{scrlayer-scrpage}
\chead{Some really long text\\ that takes\\more than one line}