1

I'd be very glad if you could help me out with the following problem: I'm trying to reduce the spacing in my "\section{}"-text that spans two lines from 1,5 to 1,25. I couldn't find an appropriate solution online or by myself. (Unfortunately \begin{spacing}{1,25} \section{Here is the text that spans two lines.} \end{spacing} doesn't work because it also reduces the distance before and after the \section{}.)

\documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\setstretch{1,5}
\begin{document}

\section{Here is the text that spans two lines and that is supposed to have 1,25 spacing.}

\end{document}

Thank you in advance!

3
  • You can simply use this: {\linespread{1.25}\section{my very longtitle}}.
    – Bernard
    Jul 13, 2020 at 15:22
  • I've always thought that things like \linespread and \setstretch were bad hacks that were better handled through directly manipulating the \baselineskip, especially for things like double-spaced documents. But I guess all my efforts in the 90s to show an alternative route were for naught.
    – Don Hosek
    Jul 13, 2020 at 15:30
  • It seems to be a very local problem, so I guess it has no real importance – that's the simplest hack I could find.
    – Bernard
    Jul 13, 2020 at 15:39

1 Answer 1

1

You can use sectsty:

\documentclass[12pt, a4paper]{article}

\usepackage{setspace}
\usepackage{sectsty}

\sectionfont{\linespread{1.25}\selectfont}
\setstretch{2.5}


\begin{document}

\section{Here is the text that spans two lines and that is supposed to have 1,25 spacing.}

Here is text that's spaced 2.5, which is \emph{really} too much.
Here is text that's spaced 2.5, which is \emph{really} too much.
Here is text that's spaced 2.5, which is \emph{really} too much.
Here is text that's spaced 2.5, which is \emph{really} too much,
but 1.5 is too much either.

\end{document}

I used 2.5 in order to emphasize the difference and show that the normal text uses the specified stretch.

enter image description here

You must log in to answer this question.

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