[Tex/LaTex] Setspace: Make only text body double-spaced and everything else single-spaced

koma-scriptline-spacingsetspace

For the following MWE, I would like to make only the text body double-spaced without affecting chapter titles and references environment.

\begin{filecontents*}{refs.bib}
@article{someguykey2010,
author="SomeGuy",
title="A journal article",
year=2010,
journal="A Journal",
}
@article{someotherguykey2013,
author="SomeOtherGuy",
title="A journal article",
year=2013,
journal="A Journal",
}
\end{filecontents*}

\documentclass{scrreprt}

\usepackage[doublespacing]{setspace}
\usepackage{lipsum} 

\begin{document}

\chapter{Chapter\\Title}

\lipsum[1]

\nocite{*}

\bibliographystyle{plainnat}
\bibliography{refs}

\end{document} 

enter image description here


enter image description here

Best Answer

To not use double-spacing for the headings you could add \setstretch{1} to the setting of font element disposition:

\addtokomafont{disposition}{\setstretch{1}}

As alternative you also could use \linespread{1}, but in this case you should additionally append \selectfont to the font element somewhere after the \linespead command. Otherwise, if a sectioning level would not have a font setting the activation of the new line-spread would be missing.

If you want a sequence of you document without double-spacing use either environment singlespace or command \singlespacing. But if you would use this before a chapter heading, the vertical space above the chapter head would change. So for the bibliography better use it after the heading, e.g., using \AfterBibliographyPreamble.

\begin{filecontents*}{refs.bib}
@article{someguykey2010,
author="SomeGuy",
title="A journal article",
year=2010,
journal="A Journal",
}
@article{someotherguykey2013,
author="SomeOtherGuy",
title="A journal article",
year=2013,
journal="A Journal",
}
\end{filecontents*}

\documentclass{scrreprt}

\usepackage[doublespacing]{setspace}
\usepackage{lipsum}

\addtokomafont{disposition}{\setstretch{1}}

\begin{document}

\chapter{Chapter\\Title}

\lipsum[1]

\nocite{*}

\AfterBibliographyPreamble{\singlespacing}

\bibliographystyle{plainnat}
\bibliography{refs}

\end{document}

results in:

enter image description here

You could also use the opposite: Use doublespacing environment only for those sequences of your document that should be double-spaced:

\begin{filecontents*}{refs.bib}
@article{someguykey2010,
author="SomeGuy",
title="A journal article",
year=2010,
journal="A Journal",
}
@article{someotherguykey2013,
author="SomeOtherGuy",
title="A journal article",
year=2013,
journal="A Journal",
}
\end{filecontents*}

\documentclass{scrreprt}

\usepackage{setspace}
\usepackage{lipsum}

\addtokomafont{disposition}{\setstretch{1}}

\begin{document}

\chapter{Chapter\\Title}

\begin{doublespacing}
\lipsum[1]
\end{doublespacing}

\nocite{*}

\bibliographystyle{plainnat}
\bibliography{refs}

\end{document}

Here the space about chapter heading would be different from the example above:

enter image description here